body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: #ffffff;
  color: #222222;
  margin: 0;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin-top: 0;
  font-weight: normal;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
  width: 100%;
  max-width: 600px;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  padding: 24px 0;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.template-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-picker {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.template-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 112px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #222;
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.template-option:hover {
  border-color: #ccc;
}

.template-option[aria-pressed="true"] {
  border-color: #222;
}

.template-option:focus-visible {
  outline: 2px solid #222;
  outline-offset: 2px;
}

.template-option img {
  width: 112px;
  height: 72px;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: #e0e0e0;
  border-radius: 2px;
  flex-shrink: 0;
}

.template-option-name {
  font-size: 13px;
  line-height: 1.2;
  padding: 0 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

label {
  font-size: 14px;
  color: #444;
}

input[type="text"] {
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 2px;
  width: 100%;
  box-sizing: border-box;
}

#search-status {
  font-size: 14px;
  color: #666;
  margin: 0;
}

#search-status.error {
  color: #c00;
}

#album-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 2px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#album-dropdown.visible {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e0e0e0;
}

.dropdown-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropdown-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item-artist {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#canvas-container {
  position: relative;
  width: 1920px;
  height: 1080px;
  background-color: #000;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(0.6);
  transform-origin: top center;
}

#canvas-container.native-bg {
  width: 665px;
  height: 886px;
  position: relative;
  overflow: hidden;
  transform: scale(0.8);
  transform-origin: top left;
}

#layer-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  object-fit: cover;
}

#canvas-container.native-bg #layer-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.album-src {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  transform-origin: center center;
}

.album-src[hidden] {
  display: none !important;
}

.album-src-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #e0e0e0;
}

.album-physical {
  left: 734px;
  top: 525px;
  width: 391px;
  height: 385px;
  transform: skewX(-11.1deg) rotate(-4.5deg);
  box-shadow:
    -12px 12px 25px rgba(0, 0, 0, 0.35),
    -3px 3px 6px rgba(0, 0, 0, 0.1),
    0 0 100px rgba(255, 255, 255, 0.04) inset;
}

.album-physical .album-src-image {
  filter: blur(0.5px) brightness(0.9) contrast(1.1);
}

.album-physical::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(-135deg, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.12) 65%, rgba(255, 255, 255, 0.0) 70%, rgba(255, 255, 255, 0.05) 80%, rgba(255, 255, 255, 0.0) 90%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.04) 10%, rgba(255, 255, 255, 0.0) 90%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0.0) 100%);
  pointer-events: none;
}

.album-phone-container {
  overflow: hidden;
  transform-origin: 0 0;
  background: transparent;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.album-phone-container .album-src-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: transparent;
  outline: none;
  border: none;
}

.album-clear-container-2 {
  position: absolute;
  z-index: 3;
  left: 59px;
  top: 531px;
  width: 237px;
  height: 237px;
  box-shadow: -15px 20px 30px rgba(0, 0, 0, 0.6), 0 0 2px rgba(255, 255, 255, 0.2) inset;
}

.album-clear-container-2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-phone-container.export-baked .album-src-image,
.album-physical.export-baked .album-src-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  filter: none;
}

.album-physical.export-baked::after {
  display: none;
}

#layer-hand {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  object-fit: cover;
  pointer-events: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.actions button {
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #222;
  cursor: pointer;
}

.actions button:hover:not(:disabled) {
  background: #f5f5f5;
}

.actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions button.primary {
  background: #222;
  color: #fff;
  border-color: #222;
}

.actions button.primary:hover:not(:disabled) {
  background: #444;
}

#export-status {
  font-size: 14px;
  color: #666;
  margin: 0;
  min-height: 20px;
}

#export-status.error {
  color: #c00;
}
