.upload-zone {
  min-height: 112px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 12px;
  padding: 15px;
  position: relative;
  overflow: hidden;
  border: 1px dashed #b9b3aa;
  background: var(--white, #fff);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--accent, #ff5b3d);
  background: #fff8f5;
}

.upload-zone[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.upload-zone.has-image {
  border-style: solid;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft, #ffe7df);
  color: var(--accent, #ff5b3d);
  font-size: 20px;
  font-weight: 500;
}

.upload-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.upload-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.upload-copy small {
  color: var(--muted, #6e6b66);
  font-size: 10px;
  line-height: 1.4;
}

.inserted-designs {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #ded9d0);
}

.inserted-designs[hidden] {
  display: none;
}

.inserted-designs-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.inserted-designs-heading strong {
  color: var(--ink, #181818);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.inserted-designs-heading span {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--ink, #181818);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.inserted-designs-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.inserted-design-item {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 9px;
  border: 1px solid var(--line, #ded9d0);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 160ms ease, background 160ms ease;
}

.inserted-design-item.is-active {
  border-color: var(--accent, #ff5b3d);
  background: #fff8f5;
}

.inserted-design-title,
.inserted-design-content,
.inserted-design-actions {
  display: flex;
  align-items: center;
}

.inserted-design-title {
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 7px;
}

.inserted-design-title strong {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink, #181818);
  font-size: 11px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inserted-design-title span {
  flex: 0 0 auto;
  color: var(--muted, #6e6b66);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inserted-design-content {
  min-width: 0;
  gap: 9px;
}

.inserted-design-content > img {
  width: 64px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(24, 24, 24, 0.08);
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.inserted-design-actions {
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  gap: 5px;
}

.inserted-design-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink, #181818);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.inserted-design-actions button:hover {
  border-color: var(--line, #ded9d0);
  background: #fff;
}

.inserted-design-actions button.is-danger:hover {
  border-color: rgba(186, 45, 26, 0.28);
  color: #ba2d1a;
}

.inserted-design-actions button span {
  font-size: 14px;
  line-height: 1;
}

.stage-adjustments {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  gap: 7px;
  padding: 7px;
  transform: translate(-50%, calc(-100% - 8px)) scale(0.97);
  border: 1px solid rgba(24, 24, 24, 0.12);
  border-radius: 12px;
  background: rgba(251, 250, 247, 0.94);
  box-shadow: 0 10px 28px rgba(24, 24, 24, 0.16);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.stage-adjustments.is-visible {
  transform: translate(-50%, calc(-100% - 18px)) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.stage-adjustments.is-below {
  transform: translate(-50%, 8px) scale(0.97);
}

.stage-adjustments.is-below.is-visible {
  transform: translate(-50%, 18px) scale(1);
}

.stage-adjustment-group {
  display: grid;
  grid-template-columns: auto 32px 32px;
  align-items: center;
  gap: 5px;
}

.stage-adjustment-group + .stage-adjustment-group {
  padding-left: 7px;
  border-left: 1px solid rgba(24, 24, 24, 0.1);
}

.stage-adjustment-group > span {
  padding: 0 4px;
  color: var(--muted, #6e6b66);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-adjustment-group button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line, #ded9d0);
  border-radius: 8px;
  background: var(--white, #fff);
  color: var(--ink, #181818);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.stage-adjustment-group button:hover:not(:disabled) {
  border-color: var(--accent, #ff5b3d);
  background: #fff8f5;
}

.stage-finish-position {
  min-width: 68px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: var(--ink, #181818);
  color: var(--white, #fff);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-finish-position:hover:not(:disabled) {
  background: var(--accent, #ff5b3d);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .stage-adjustment-group > span {
    display: none;
  }

  .stage-adjustment-group {
    grid-template-columns: 34px 34px;
  }

  .stage-finish-position {
    min-width: 58px;
    padding: 0 8px;
  }
}
