:root {
  --bg: #090a0d;
  --bg-soft: #111318;
  --surface: rgba(25, 28, 34, 0.78);
  --surface-strong: rgba(31, 35, 42, 0.92);
  --surface-control: rgba(42, 47, 56, 0.78);
  --line: rgba(226, 232, 240, 0.12);
  --line-strong: rgba(226, 232, 240, 0.2);
  --text: #f4f7fb;
  --muted: #aab4c3;
  --accent: #0a84ff;
  --accent-strong: #2f9bff;
  --ok: #30d158;
  --warning: #ffd60a;
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-xl: 0 28px 70px rgba(0, 0, 0, 0.54);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", "Manrope", "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 34%),
    linear-gradient(135deg, #121419 0%, #090a0d 48%, #101216 100%);
  position: relative;
}

body.intro-active {
  overflow: hidden;
}

body.intro-active .scene {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(10, 132, 255, 0.24), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(48, 209, 88, 0.12), transparent 28%),
    linear-gradient(135deg, #05070c 0%, #131722 48%, #07090f 100%);
  transition: opacity .72s ease, visibility .72s ease;
}

.intro-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.intro-screen.is-leaving .intro-video {
  transform: translate(-50%, -50%) scale(1.035);
  opacity: 0.18;
  transition: transform .78s cubic-bezier(.2, .8, .2, 1), opacity .72s ease;
}

.intro-screen.is-leaving .intro-video-ambient {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.12);
  transition: transform .78s cubic-bezier(.2, .8, .2, 1), opacity .72s ease;
}

.intro-video-ambient {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 126vw;
  height: 126vh;
  object-fit: cover;
  transform: translate(-50%, -50%) scale(1.12);
  opacity: 0.7;
  filter: blur(34px) saturate(1.22) brightness(0.72);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, rgba(0, 0, 0, 0.9) 32%, rgba(0, 0, 0, 0.48) 58%, rgba(0, 0, 0, 0.16) 80%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 0%, rgba(0, 0, 0, 0.9) 32%, rgba(0, 0, 0, 0.48) 58%, rgba(0, 0, 0, 0.16) 80%, transparent 100%);
}

.intro-video {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 860px);
  height: min(104vh, 1140px);
  object-fit: cover;
  object-position: center center;
  transform: translate(-50%, -50%);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  opacity: 0.94;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, #000 22%, rgba(0, 0, 0, 0.86) 35%, rgba(0, 0, 0, 0.54) 50%, rgba(0, 0, 0, 0.2) 68%, rgba(0, 0, 0, 0.04) 84%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 0%, #000 22%, rgba(0, 0, 0, 0.86) 35%, rgba(0, 0, 0, 0.54) 50%, rgba(0, 0, 0, 0.2) 68%, rgba(0, 0, 0, 0.04) 84%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  filter: saturate(1.03) contrast(1.01);
}

.intro-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 12, 0.48), rgba(5, 7, 12, 0.04) 36%, rgba(5, 7, 12, 0.04) 64%, rgba(5, 7, 12, 0.48)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.05) 46%, rgba(0, 0, 0, 0.34)),
    radial-gradient(circle at 50% 50%, transparent 0%, transparent 40%, rgba(0, 0, 0, 0.22) 76%);
}

.intro-sound-btn {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  z-index: 2;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(12, 14, 18, 0.52);
  color: #f4f7fb;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.intro-sound-btn:hover {
  transform: translateY(-1px);
  background: rgba(28, 32, 39, 0.68);
  border-color: rgba(255, 255, 255, 0.36);
}

.intro-action {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  filter: blur(8px);
  pointer-events: none;
  transition:
    opacity 2.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 2.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 2.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-screen.is-ready .intro-action {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.intro-enter-btn {
  min-height: 54px;
  min-width: min(320px, calc(100vw - 48px));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(245, 248, 252, 0.92);
  color: #0b0d12;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 0 22px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.intro-enter-btn:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.intro-enter-btn:active {
  transform: translateY(0);
}

.intro-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 9, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.intro-loader-panel {
  width: min(360px, calc(100vw - 40px));
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(18, 22, 30, 0.74);
  color: #f4f7fb;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.44);
}

.intro-loader-panel p {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.intro-loader-panel span {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
}

.intro-loader-panel span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f8fbff, #0a84ff);
  animation: introProgress 1.1s ease-in-out infinite;
}

.intro-loader-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  animation: introSpin .9s linear infinite;
}

.scene {
  position: relative;
  z-index: 1;
  width: min(1340px, calc(100vw - 40px));
  margin: 24px auto 28px;
  display: grid;
  gap: 14px;
  transition: opacity .4s ease, transform .4s ease;
}

.studio-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  grid-template-areas:
    "compose preview";
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  box-shadow: var(--shadow-xl);
  overflow: clip;
  animation: shellIn .45s cubic-bezier(.22, .98, .3, .98) both;
}

.preview-stage {
  grid-area: preview;
  min-height: 640px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(35, 39, 48, 0.76), rgba(16, 18, 23, 0.8));
  position: relative;
}

.preview-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  color: #a8bad6;
  font-size: 1rem;
  line-height: 1.55;
}

.compose-card {
  grid-area: compose;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  border-right: 1px solid var(--line);
  background: rgba(18, 20, 25, 0.48);
}

.compose-step {
  display: grid;
  gap: 12px;
}

.flow-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.22);
}

.flow-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 36, 0.72);
  color: #c6d3ea;
  font-size: 0.83rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flow-dot.active {
  border-color: rgba(56, 189, 248, 0.58);
  background: rgba(14, 165, 233, 0.2);
  color: #e8f7ff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.flow-dot.done {
  border-color: rgba(34, 197, 94, 0.52);
  background: rgba(34, 197, 94, 0.18);
  color: #b9f5d1;
}

.speed-grid,
.treatment-grid {
  display: grid;
  gap: 8px;
}

.speed-grid {
  grid-template-columns: 1fr 1fr;
}

.treatment-grid {
  grid-template-columns: 1fr 1fr;
}

.choice-pill {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  background: rgba(42, 47, 56, 0.58);
  color: #e2e8f8;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.choice-pill.light {
  background: rgba(54, 61, 72, 0.64);
}

.choice-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.choice-pill.active {
  border-color: rgba(10, 132, 255, 0.58);
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.22), rgba(10, 132, 255, 0.13));
  color: #f3f9ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 8px 22px rgba(10, 132, 255, 0.16);
}

.upload-card,
.advanced-panel,
.prompt-card,
.calibration-card,
.result-card,
.lead-panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.upload-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: center;
}

.upload-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 25%, rgba(56, 189, 248, 0.25), transparent 50%),
    linear-gradient(155deg, #172338, #0f1929);
  position: relative;
}

.upload-icon::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 17px;
  width: 24px;
  height: 18px;
  border: 2px solid rgba(191, 219, 254, 0.84);
  border-radius: 4px;
}

.upload-icon::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 23px;
  width: 13px;
  height: 9px;
  border-left: 2px solid rgba(191, 219, 254, 0.84);
  border-bottom: 2px solid rgba(191, 219, 254, 0.84);
  transform: skew(-24deg) rotate(-10deg);
}

.upload-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.upload-desc {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.upload-btn {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: var(--surface-control);
  color: #e7edfb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-size: 0.89rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.upload-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 132, 255, 0.5);
  background: rgba(55, 63, 75, 0.82);
  box-shadow: var(--shadow-sm);
}

.upload-btn.mini {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.photo-name {
  margin: 8px 0 0;
  color: #7dd3fc;
  font-size: 0.84rem;
}

.secondary-btn,
.primary-btn {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, border-color .18s ease, background-color .18s ease;
}

.secondary-btn {
  border: 1px solid rgba(226, 232, 240, 0.16);
  background: rgba(42, 47, 56, 0.72);
  color: #dbe7ff;
}

.primary-btn {
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: linear-gradient(180deg, #2f9bff, #0a73e8);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.secondary-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.secondary-btn:hover {
  background: rgba(55, 63, 75, 0.86);
  border-color: rgba(226, 232, 240, 0.24);
}

.secondary-btn:active,
.primary-btn:active,
.choice-pill:active,
.upload-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.2);
}

.secondary-btn.full-width,
.secondary-btn.full {
  width: 100%;
}

.advanced-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
  animation: fadeSlide .28s ease both;
}

.prompt-card,
.calibration-card {
  padding: 10px;
}

#prompt-input {
  width: 100%;
  min-height: 106px;
  border: 0;
  background: transparent;
  color: #e2e8f8;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  padding: 0;
}

#prompt-input::placeholder {
  color: #94a3b8;
}

#prompt-input:focus {
  outline: none;
}

.prompt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9badca;
  font-size: 0.85rem;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.08);
}

.calibration-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.calibration-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calibration-head p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.range-row {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  color: #c4d2ea;
  font-size: 0.84rem;
}

.range-row input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  accent-color: var(--accent);
}

.range-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.9), rgba(148, 163, 184, 0.28));
}

.range-row input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: #f8fbff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
  -webkit-appearance: none;
}

.range-row input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.9), rgba(148, 163, 184, 0.28));
}

.range-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: #f8fbff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
}

.consent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consent-row label {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  background: rgba(42, 47, 56, 0.58);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ccdaef;
  padding: 0 12px;
  font-size: 0.83rem;
}

.consent-row input[type="checkbox"] {
  accent-color: var(--accent);
}

.status {
  margin: 0;
  min-height: 36px;
  color: #cfe7ff;
  font-size: 0.88rem;
  line-height: 1.35;
  border: 1px solid rgba(10, 132, 255, 0.18);
  background: rgba(10, 132, 255, 0.08);
  border-radius: 8px;
  padding: 9px 10px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-card {
  grid-area: preview;
  margin: 12px;
  padding: 16px;
  animation: fadeSlide .34s ease both;
  align-self: start;
  box-shadow: var(--shadow-lg);
}

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.result-label {
  margin: 0;
  color: #9badca;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.result-top h3 {
  margin: 3px 0 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

#mode {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.16);
  background: rgba(42, 47, 56, 0.78);
  color: #edf2ff;
  padding: 0 34px 0 10px;
  font: inherit;
}

.compare {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #060b16;
  aspect-ratio: 4 / 3;
}

.compare canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.compare.compare-split {
  border: 0;
  background: transparent;
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.split-pane {
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #060b16;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.split-pane canvas {
  aspect-ratio: 4 / 3;
}

.pane-label {
  position: absolute;
  left: 10px;
  top: 10px;
  margin: 0;
  z-index: 2;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  font-size: 0.79rem;
  font-weight: 700;
  color: #e9f1ff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 36, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.compat-hidden {
  display: none !important;
}

.result-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.done-badge {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.result-note {
  color: #9badca;
  font-size: 0.86rem;
}

.result-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.studio-shell[data-screen="result"] {
  grid-template-columns: 1fr;
  grid-template-areas:
    "result";
}

.studio-shell[data-screen="result"] .compose-card,
.studio-shell[data-screen="result"] .preview-stage {
  display: none;
}

.studio-shell[data-screen="result"] .result-card {
  grid-area: result;
  margin: 12px;
}

.ai-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(8, 13, 24, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.ai-loader-card {
  width: min(430px, 100%);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(16, 23, 38, 0.92);
  box-shadow: var(--shadow-lg);
  padding: 18px 16px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.ai-orb {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), transparent 48%),
    radial-gradient(circle at 60% 70%, rgba(10, 132, 255, 0.95), rgba(56, 189, 248, 0.4));
  box-shadow:
    0 0 0 8px rgba(10, 132, 255, 0.12),
    0 0 28px rgba(10, 132, 255, 0.38);
  animation: orbSpin 2.8s linear infinite;
}

.ai-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
}

.ai-text {
  margin: 0;
  color: #a7bad6;
  font-size: 0.92rem;
  min-height: 22px;
}

.ai-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.45);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.ai-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #38bdf8);
  box-shadow: 0 0 18px rgba(10, 132, 255, 0.35);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}

.lead-panel {
  padding: 14px;
  box-shadow: var(--shadow-lg);
  animation: fadeSlide .35s ease both;
}

.lead-panel h3 {
  margin: 0 0 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  color: #c4d2ea;
  font-size: 0.9rem;
  font-weight: 600;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  background: rgba(42, 47, 56, 0.68);
  color: #edf2ff;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8792a3;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.62);
  background: rgba(47, 53, 64, 0.86);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.16);
}

.prompt-card #prompt-input {
  min-height: 106px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.prompt-card #prompt-input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #cbd5e1 50%),
    linear-gradient(135deg, #cbd5e1 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

button:focus-visible,
.upload-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.88);
  outline-offset: 2px;
}

.secondary-btn.full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.hidden {
  display: none;
}

@keyframes shellIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes introSpin {
  to { transform: rotate(360deg); }
}

@keyframes introProgress {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(95%); }
  100% { transform: translateX(245%); }
}

@media (max-width: 520px) {
  .intro-video {
    width: min(98vw, 520px);
    height: min(92vh, 760px);
    border-radius: 0;
  }

  .intro-enter-btn {
    min-width: min(300px, calc(100vw - 44px));
  }

  .scene {
    width: calc(100vw - 12px);
    margin-top: 8px;
  }

  .studio-shell {
    border-radius: 18px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "preview"
      "compose";
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 220px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .compose-card {
    border-right: 0;
  }

  .compare.compare-split {
    grid-template-columns: 1fr;
  }

  .result-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .studio-shell[data-screen="result"] .result-card {
    margin: 10px;
  }
}

@media (min-width: 521px) and (max-width: 1040px) {
  .scene {
    width: min(760px, calc(100vw - 18px));
  }

  .studio-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "preview"
      "compose";
  }

  .preview-stage {
    min-height: 260px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .compose-card {
    border-right: 0;
  }

  .studio-shell[data-screen="result"] .result-card {
    margin: 12px;
  }
}
