/* Storyvio web studio. Black + green "classy" theme shared with the iPhone app. */
:root {
  color-scheme: dark;
  --canvas: #040605;
  --raised: #0a100d;
  --panel: #0c130f;
  --text: #f2f4f1;
  --secondary: rgba(242, 244, 241, .74);
  --tertiary: rgba(242, 244, 241, .52);
  --stroke: rgba(255, 255, 255, .08);
  --stroke-strong: rgba(255, 255, 255, .16);
  --surface: rgba(255, 255, 255, .045);
  --surface-strong: rgba(255, 255, 255, .085);
  --emerald: #1fa968;
  --jade: #6fd6a2;
  --forest: #0c4a2f;
  --gold: #c9a55c;
  --danger: #ef6a6e;
  --grad: linear-gradient(110deg, #12784a, #23b874);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --page: 1200px;
  --gutter: 16px;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 900px 520px at 20% -160px, rgba(12, 74, 47, .5), transparent 70%),
    radial-gradient(ellipse 600px 700px at 110% 40%, rgba(31, 169, 104, .08), transparent 70%),
    var(--canvas);
}
body { overflow-x: clip; }
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--jade); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
dialog:focus-visible { outline: none; }
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--secondary); }
.small { font-size: 13px; }
.eyebrow {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 6px; color: var(--jade);
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
}
.eyebrow .i { width: 14px; height: 14px; }
.section-label { color: var(--tertiary); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; color: var(--text);
  transition: transform .15s, filter .2s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-sm .i { width: 16px; height: 16px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 11px; }
.btn-lg { height: 56px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--grad);
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 10px 28px rgba(31, 169, 104, .25), inset 0 1px rgba(255, 255, 255, .22);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 12px 34px rgba(31, 169, 104, .35), inset 0 1px rgba(255, 255, 255, .22); }
.btn-primary:disabled { background: #0d1913; border-color: rgba(31, 169, 104, .2); box-shadow: none; color: var(--tertiary); }
.btn-light { background: #fff; color: #090b09; }
.btn-light:hover { background: #e8efe9; }
.btn-glass { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.btn-glass:hover { background: rgba(255, 255, 255, .22); }
.btn-soft { background: var(--surface-strong); border-color: var(--stroke); }
.btn-soft:hover:not(:disabled) { background: rgba(255, 255, 255, .13); }
.btn-outline { background: transparent; border-color: var(--stroke-strong); }
.btn-outline:hover { background: var(--surface); border-color: rgba(255, 255, 255, .28); }
.btn-danger { background: #8f2226; border-color: rgba(255, 255, 255, .14); }
.btn-danger:disabled { background: #2a1415; color: var(--tertiary); }
.danger { color: var(--danger) !important; }
.link-button { border: 0; background: none; padding: 0; color: var(--jade); font-size: 13px; font-weight: 650; }
.link-button:hover { text-decoration: underline; }
.icon-button {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--stroke); border-radius: 50%; background: var(--surface);
}
.icon-button:hover { background: var(--surface-strong); }
.tile-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: rgba(31, 169, 104, .14); color: var(--jade);
}

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 max(var(--gutter), calc((100% - var(--page)) / 2));
  background: rgba(4, 6, 5, .72);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--stroke); }
.nav:not(.scrolled) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 21px var(--serif); letter-spacing: .2px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(31, 169, 104, .45); box-shadow: 0 0 14px rgba(31, 169, 104, .3); }
.brand.small { font-size: 17px; }
.brand.small img { width: 26px; height: 26px; border-radius: 7px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 999px; color: var(--secondary); text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.credits-pill {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border: 1px solid var(--stroke); border-radius: 999px; background: var(--surface); font-size: 14px;
}
.credits-pill:hover { border-color: rgba(201, 165, 92, .5); }
.credits-pill .i { color: var(--gold); width: 15px; height: 15px; }
.credits-pill strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.credits-pill span { color: var(--secondary); font-size: 13px; }
.avatar-button {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--stroke); border-radius: 50%; background: var(--surface); font-weight: 800;
}
.avatar-button.signed { background: var(--grad); border-color: rgba(255, 255, 255, .2); }

/* Page */
.page { width: min(100%, var(--page)); margin: 0 auto; padding: 8px var(--gutter) 0; }

/* Hero: a dark, drifting wall of reel covers behind a big centered title and the studio */
.hero {
  /* clip, not hidden: hidden would make the hero a scroll box and stop the studio header sticking under the nav. */
  position: relative; isolation: isolate; overflow: hidden; overflow: clip;
  width: 100vw; margin: -72px calc(50% - 50vw) 0; padding: 136px var(--gutter) 40px;
  min-height: 100vh;
}
.poster-wall {
  position: absolute; z-index: -2; inset: -20% -10%;
  display: flex; justify-content: center; gap: 18px;
  transform: rotate(-8deg); opacity: .5;
}
.wall-col { flex: 0 0 210px; display: flex; flex-direction: column; gap: 18px; animation: wall-up linear infinite; will-change: transform; }
.wall-col.down { animation-direction: reverse; }
.wall-col img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 18px; box-shadow: 0 20px 40px rgba(0, 0, 0, .5); }
.hero-veil {
  position: absolute; z-index: -1; inset: 0;
  background:
    radial-gradient(ellipse 58% 62% at 50% 46%, rgba(4, 6, 5, .94) 30%, rgba(4, 6, 5, .62) 70%, rgba(4, 6, 5, .4)),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(12, 74, 47, .35), transparent 70%),
    linear-gradient(180deg, var(--canvas) 0%, transparent 16%, transparent 70%, var(--canvas) 100%);
}
.hero-main { position: relative; width: min(100%, 840px); margin: 0 auto; text-align: center; }
.hero-main .eyebrow { justify-content: center; }
.headline {
  margin: 10px 0 16px; font: 700 clamp(44px, 7vw, 92px)/1 var(--serif); letter-spacing: -1.5px;
  text-shadow: 0 6px 40px rgba(0, 0, 0, .8);
}
.headline em { color: var(--jade); font-style: italic; }
.lede { max-width: 560px; margin: 0 auto 36px; color: rgba(242, 244, 241, .82); font-size: 19px; line-height: 1.55; text-shadow: 0 2px 20px rgba(0, 0, 0, .8); }
.hero .studio { text-align: left; background: rgba(9, 14, 11, .78); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); box-shadow: 0 40px 120px rgba(0, 0, 0, .7), 0 0 0 1px rgba(111, 214, 162, .08); }
.scroll-cue {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: max-content; margin: 34px auto 0;
  color: var(--secondary); font-size: 13px; font-weight: 600; text-decoration: none;
}
.scroll-cue .i { width: 16px; height: 16px; animation: bob 1.8s ease-in-out infinite; }
.scroll-cue:hover { color: var(--text); }
.chip-glass {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
}
.chip-glass .i { width: 13px; height: 13px; color: var(--gold); }

/* Studio */
.studio {
  position: relative; padding: 22px 24px 0;
  border: 1px solid var(--stroke-strong); border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02) 60%), var(--raised);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
/* Back + steps stay reachable just under the nav while a long step is scrolled. */
.studio-head {
  position: sticky; top: 64px; z-index: 6; display: flex; align-items: center; gap: 14px;
  margin: -22px -24px 22px; padding: 22px 24px 0; border-radius: 28px 28px 0 0; transition: background .2s;
}
.studio-head.stuck { border-radius: 0; background: rgba(9, 14, 11, .96); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.stepper { display: flex; flex: 1; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 3px solid rgba(255, 255, 255, .1); color: var(--tertiary); font-size: 13px; font-weight: 700; transition: color .2s, border-color .2s; }
.stepper .dot { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--stroke-strong); border-radius: 50%; font-size: 12px; }
.stepper li.done, .stepper li.active { border-color: var(--emerald); color: var(--text); }
.stepper li.active .dot { border-color: var(--jade); color: var(--jade); box-shadow: 0 0 0 4px rgba(31, 169, 104, .15); }
.stepper li.done .dot { background: var(--grad); border-color: transparent; color: #fff; }
.stepper li.done { cursor: pointer; }
.step-intro { margin-bottom: 20px; }
.step-intro h2 { margin: 0 0 6px; font: 700 clamp(26px, 3vw, 34px)/1.15 var(--serif); letter-spacing: -.3px; }
.step-intro p { margin: 0; color: var(--secondary); font-size: 15px; }
.step-intro strong { color: var(--text); }
.step-panel { animation: rise .35s ease; }

.idea-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.composer {
  position: relative; padding: 18px 20px; border: 1px solid var(--stroke); border-radius: 24px; background: rgba(0, 0, 0, .25);
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: rgba(31, 169, 104, .8); box-shadow: 0 0 0 4px rgba(31, 169, 104, .12), 0 0 30px rgba(31, 169, 104, .12); }
.composer.empty:not(:focus-within)::after {
  content: ''; pointer-events: none; position: absolute; inset: -1px; padding: 1px; border-radius: 24px;
  background: conic-gradient(from var(--angle), transparent, var(--jade), rgba(201, 165, 92, .8), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: border-turn 6s linear infinite;
}
.composer label { display: flex; align-items: center; gap: 8px; color: var(--jade); font-size: 13px; font-weight: 750; }
.composer label .i { width: 16px; height: 16px; }
.composer textarea {
  display: block; width: 100%; min-height: 110px; margin-top: 10px; padding: 0; resize: vertical;
  border: 0; outline: 0; background: transparent; font-size: 21px; font-weight: 500; line-height: 1.45;
}
.composer textarea::placeholder { color: var(--tertiary); }
.composer-tools { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.kbd-hint { margin-left: auto; color: var(--tertiary); font-size: 12px; }
#prompt-count { color: var(--tertiary); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
#prompt-count.over { color: var(--danger); }
.ideas .section-label { margin-bottom: 10px; }
.idea-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-card {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 5px;
  border: 1px solid var(--stroke-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 650;
  transition: background .2s, border-color .2s;
}
.idea-card img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.idea-card small { display: none; }
.idea-card:hover { background: var(--surface-strong); border-color: rgba(255, 255, 255, .26); }
.idea-card.selected { border-color: var(--jade); background: rgba(31, 169, 104, .14); color: var(--jade); }

.style-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.style-card {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; padding: 0;
  border: 1px solid var(--stroke); border-radius: 18px; background: #121914; text-align: left;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.style-card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }
.style-card > img, .collage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.collage img { position: absolute; width: 50%; height: 50%; object-fit: cover; }
.collage img:nth-child(2) { left: 50%; }
.collage img:nth-child(3) { top: 50%; }
.collage img:nth-child(4) { top: 50%; left: 50%; }
.style-card[data-style="sketch"] > img { transform: scaleX(-1); filter: sepia(.35) contrast(1.1); }
.style-card::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .9)); }
.style-card .style-name { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 30px; font-size: 15px; font-weight: 800; }
.style-card .style-desc { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 10px; color: rgba(255, 255, 255, .7); font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-card .check { position: absolute; z-index: 2; top: 10px; right: 10px; display: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); }
.style-card .check .i { width: 15px; height: 15px; }
.style-card.selected { border: 2px solid var(--jade); box-shadow: 0 0 22px rgba(31, 169, 104, .3); }
.style-card.selected .check { display: grid; }
.style-note { min-height: 20px; margin: 14px 0 0; color: var(--secondary); font-size: 14px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setting { padding: 20px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.setting-head { display: flex; align-items: center; gap: 8px; }
.setting-title { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.setting-title .i { color: var(--jade); width: 16px; height: 16px; }
.setting-value { margin-left: auto; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--jade); }
.setting-value strong { color: var(--text); font-weight: 650; }
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 22px 0 12px; border-radius: 999px; outline: none;
  background: linear-gradient(90deg, var(--emerald) var(--fill, 0%), rgba(255, 255, 255, .14) var(--fill, 0%));
}
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border: 3px solid var(--jade); border-radius: 50%; background: #f2f4f1; box-shadow: 0 0 0 5px rgba(31, 169, 104, .18); cursor: grab; }
.range::-moz-range-thumb { width: 18px; height: 18px; border: 3px solid var(--jade); border-radius: 50%; background: #f2f4f1; box-shadow: 0 0 0 5px rgba(31, 169, 104, .18); cursor: grab; }
.range-labels { display: flex; justify-content: space-between; color: var(--tertiary); font-size: 11px; font-weight: 600; }
.language-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; transition: border-color .2s; }
.language-row:hover { border-color: var(--stroke-strong); }
.language-copy { display: flex; flex-direction: column; gap: 1px; }
.language-copy small:first-child { color: var(--tertiary); font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.language-copy strong { font-size: 17px; }
.language-copy small { color: var(--secondary); font-size: 12px; }
.link-text { margin-left: auto; color: var(--jade); font-size: 13px; font-weight: 650; }
.chevron { color: var(--tertiary); }
.summary p { margin: 8px 0 12px; font: 600 17px/1.45 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.summary-chips button { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--stroke); border-radius: 999px; background: var(--surface-strong); font-size: 12px; font-weight: 650; }
.summary-chips .i { width: 14px; height: 14px; color: var(--jade); }

.notice { margin: 18px 0 0; padding: 12px 14px; border: 1px solid rgba(201, 165, 92, .3); border-radius: 14px; background: rgba(201, 165, 92, .08); color: #f0d39a; font-size: 13px; }
.notice.error { border-color: rgba(229, 72, 77, .3); background: rgba(229, 72, 77, .08); color: #ffa3a5; }
.notice button { margin-left: 6px; }

.studio-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 20px;
  margin: 22px -24px 0; padding: 18px 24px 22px;
  border-top: 1px solid var(--stroke); border-radius: 0 0 28px 28px;
  background: rgba(10, 16, 13, .92);
}
.next-hint { flex: 1; margin: 0; color: var(--tertiary); font-size: 13px; text-align: right; }
.studio-actions .btn-primary { min-width: 300px; }
.suffix { display: inline-flex; align-items: center; }
.suffix.credit { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 12px; font-weight: 800; }

/* Sections */
.section { margin-top: 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font: 700 clamp(26px, 3vw, 34px)/1.15 var(--serif); }
.reel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.reel-card {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden; padding: 0; text-align: left;
  border: 1px solid var(--stroke); border-radius: 20px; background: #0f1612;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.reel-card:hover { transform: translateY(-4px); border-color: var(--stroke-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.reel-card img, .reel-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-card::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .9)); pointer-events: none; }
.reel-card .reel-info { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 14px; }
.reel-card .reel-info small { display: block; color: var(--jade); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.reel-card .reel-info strong { display: block; margin-top: 2px; font-size: 15px; line-height: 1.25; }
.reel-card .play {
  position: absolute; z-index: 1; top: 50%; left: 50%; display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; background: rgba(255, 255, 255, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: translate(-50%, -50%) scale(.9); opacity: 0; transition: opacity .25s, transform .25s;
}
.reel-card:hover .play, .reel-card:focus-visible .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.reel-card .badge { position: absolute; z-index: 1; top: 12px; left: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 10px; font-weight: 800; letter-spacing: .6px; }
.reel-card.making { background: linear-gradient(100deg, #0f1612 30%, #16211b 50%, #0f1612 70%) 0 0 / 300% 100%; animation: shimmer 2.4s linear infinite; border-color: rgba(52, 211, 153, .35); }
.reel-card.making::after { display: none; }
.reel-card .making-spinner { position: absolute; top: 42%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--jade); border-radius: 50%; animation: spin 1s linear infinite; }
.reel-card.making .reel-info strong { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.reel-card.skeleton { background: linear-gradient(100deg, #0f1612 30%, #16211b 50%, #0f1612 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
#my-stories-note { margin-top: 14px; }

.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how-card { padding: 24px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.how-card h3 { margin: 16px 0 6px; font: 700 20px var(--serif); }
.how-card p { margin: 0; color: var(--secondary); font-size: 14px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 20px; color: var(--secondary); font-size: 13px; }
.trust-row span { display: flex; align-items: center; gap: 8px; }
.trust-row .i { color: var(--jade); width: 16px; height: 16px; }

.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 80px; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--stroke); }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer nav a { color: var(--secondary); font-size: 13px; text-decoration: none; }
.footer nav a:hover { color: var(--text); }
.footer p { margin: 0 0 0 auto; }

/* Mini progress + toasts */
.mini-progress {
  position: fixed; z-index: 40; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px;
  border: 1px solid rgba(31, 169, 104, .45); border-radius: 999px; background: rgba(10, 16, 13, .95);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 24px rgba(31, 169, 104, .18); font-size: 14px; font-weight: 650;
  animation: rise .3s ease;
}
.mini-progress b { color: var(--jade); font-variant-numeric: tabular-nums; }
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(111, 214, 162, .25); border-top-color: var(--jade); border-radius: 50%; animation: spin .9s linear infinite; }
.toasts { position: fixed; z-index: 100; left: 50%; top: 76px; display: grid; gap: 8px; width: min(calc(100% - 32px), 440px); transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; pointer-events: auto;
  border: 1px solid var(--stroke-strong); border-radius: 16px; background: rgba(14, 22, 18, .97);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 14px; animation: drop .3s ease;
}
.toast .i { color: var(--jade); margin-top: 1px; }
.toast.error { border-color: rgba(229, 72, 77, .4); }
.toast.error .i { color: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: .25s; }

/* Dialogs */
.sheet {
  width: min(calc(100% - 32px), 480px); max-width: none; max-height: min(90vh, 860px); overflow-y: auto;
  margin: auto; padding: 30px; border: 1px solid var(--stroke-strong); border-radius: 28px;
  background: #0b120e; color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
}
.sheet[open] { animation: pop .25s ease; }
.sheet::backdrop, .player::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet.tall { height: min(80vh, 720px); display: flex; flex-direction: column; }
.sheet.tall:not([open]) { display: none; }
.sheet-close { position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--stroke); border-radius: 50%; background: var(--surface); }
.sheet-close:hover { background: var(--surface-strong); }
.sheet-icon { width: 46px; height: 46px; margin-bottom: 14px; border-radius: 12px; }
.sheet h2 { margin: 0 0 8px; padding-right: 40px; font: 700 27px/1.2 var(--serif); }
.sheet-lead { margin: 0 0 14px; color: var(--secondary); font-size: 14px; line-height: 1.6; }
.provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; margin-top: 10px; border: 0; border-radius: 999px; font-size: 15px; font-weight: 650; }
.provider.apple { background: #fff; color: #080908; }
.provider.google { border: 1px solid var(--stroke-strong); background: var(--surface); }
.provider:hover:not(:disabled) { filter: brightness(.93); }
.provider:disabled { opacity: .6; }
.google-g { color: #4285f4; font-size: 17px; font-weight: 900; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: var(--tertiary); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--stroke); }
#email-form label, .field-label { display: block; margin: 12px 0 6px; color: var(--secondary); font-size: 12px; font-weight: 600; }
#email-form input, .field { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--stroke-strong); border-radius: 12px; background: rgba(255, 255, 255, .04); outline: none; font-size: 15px; }
#email-form input:focus, .field:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(31, 169, 104, .12); }
.form-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.switch-mode { margin: 14px 0 0; color: var(--secondary); font-size: 13px; }
.sheet-message { min-height: 18px; margin: 12px 0 0; color: #f0c987; font-size: 13px; }
.sheet-message.ok { color: var(--jade); }
.sheet-legal { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--stroke); color: var(--tertiary); font-size: 11px; }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-right: 40px; }
.account-head h2 { margin: 0; padding: 0; font-size: 22px; word-break: break-word; }
.account-head p { margin: 2px 0 0; word-break: break-all; }
.avatar-large { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--grad); font-size: 22px; font-weight: 800; }
.verify-box { margin-bottom: 14px; padding: 14px; border: 1px solid rgba(201, 165, 92, .3); border-radius: 16px; background: rgba(201, 165, 92, .07); }
.verify-box p { margin: 0; color: #f0d39a; font-size: 13px; }
.verify-box .form-row { margin-top: 10px; }
.credit-card { padding: 18px; border: 1px solid var(--stroke); border-radius: 20px; background: linear-gradient(140deg, rgba(31, 169, 104, .14), rgba(255, 255, 255, .03)); }
.credit-card strong { display: block; margin: 4px 0 2px; color: var(--jade); font: 700 46px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.credit-card small { display: block; color: var(--secondary); font-size: 12px; }
.credit-card .btn { width: 100%; margin-top: 14px; }
.sheet-links { margin: 12px 0 16px; }
.sheet-links a, .sheet-links button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--stroke); background: none; color: var(--text); font-size: 14px; text-align: left; text-decoration: none; }
.sheet-links .i { width: 16px; height: 16px; color: var(--tertiary); }
.sheet-links a:hover, .sheet-links button:hover { color: var(--jade); }
#open-delete { display: block; margin: 16px auto 0; }
.pack {
  display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 10px; padding: 16px 18px;
  border: 1px solid var(--stroke); border-radius: 16px; background: var(--surface); text-align: left;
  transition: border-color .2s, background .2s, transform .15s;
}
.pack:hover:not(:disabled) { border-color: var(--jade); background: rgba(31, 169, 104, .1); }
.pack:active:not(:disabled) { transform: scale(.98); }
.pack:disabled { opacity: .55; }
.pack strong { display: block; font: 700 18px var(--serif); }
.pack small { color: var(--secondary); font-size: 12px; }
.pack b { padding: 8px 14px; border-radius: 999px; background: var(--grad); font-size: 15px; font-weight: 800; }
.pack.featured { border-color: rgba(31, 169, 104, .5); background: rgba(31, 169, 104, .08); }
.store-dialog .muted { margin-top: 14px; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; color: var(--secondary); font-size: 14px; cursor: pointer; }
.consent-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--emerald); }
#language-search { margin: 8px 0 10px; }
.language-list { flex: 1; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.language-option { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 50px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--stroke); border-radius: 0; background: none; text-align: left; font-size: 15px; }
.language-option:hover { background: var(--surface); }
.language-option small { color: var(--tertiary); font-size: 12px; }
.language-option.selected { color: var(--jade); }
.language-option.selected small::after { content: '  ✓'; color: var(--jade); }

.player { width: min(calc(100% - 32px), 1000px); max-width: none; height: min(92vh, 860px); max-height: none; margin: auto; padding: 0; border: 0; background: transparent; overflow: visible; }
.player[open] { display: grid; animation: pop .25s ease; }
.player-frame { display: flex; flex-direction: column; min-height: 0; height: 100%; padding: 14px; border: 1px solid var(--stroke); border-radius: 24px; background: #050806; }
.player video { flex: 1; min-height: 0; width: 100%; border-radius: 14px; background: #000; object-fit: contain; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; }
.player-bar strong { display: block; font: 700 18px var(--serif); }
.player-bar small { color: var(--secondary); font-size: 12px; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.player-close { top: -14px; right: -14px; background: #111a15; }

/* Progress + result overlays */
.overlay {
  position: fixed; z-index: 50; inset: 0; overflow-y: auto; padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(ellipse 800px 600px at 30% 30%, rgba(12, 74, 47, .35), transparent 75%), rgba(4, 6, 5, .98);
  animation: fade .3s ease;
}
.overlay-inner { width: min(100%, 1100px); min-height: 100%; margin: 0 auto; }
.overlay-top { display: flex; align-items: center; justify-content: space-between; grid-column: 1 / -1; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--stroke); border-radius: 999px; background: var(--surface); color: var(--secondary); font-size: 13px; }
.pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.progress-layout { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 20px 56px; align-items: center; }
.card-stack { position: relative; display: grid; place-items: center; height: min(62vh, 540px); }
.stack-card { position: absolute; width: 200px; aspect-ratio: 2 / 3; object-fit: cover; border: 1px solid var(--stroke-strong); border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.stack-card.center { z-index: 2; width: 224px; animation: float 4s ease-in-out infinite; }
.stack-card.left { transform: translateX(-120px) rotate(-9deg); filter: brightness(.55); }
.stack-card.right { transform: translateX(120px) rotate(9deg); filter: brightness(.55); }
.sweep { position: absolute; z-index: 3; width: 224px; aspect-ratio: 2 / 3; border-radius: 20px; background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, .18), transparent 75%); animation: sweep 3.5s linear infinite; }
.progress-copy h2 { margin: 0 0 8px; font: 700 clamp(28px, 3.4vw, 40px)/1.15 var(--serif); }
.progress-prompt { margin: 0 0 22px; color: var(--secondary); font: italic 600 17px/1.5 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.progress-card { padding: 22px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.progress-heading { display: flex; justify-content: space-between; font-size: 14px; }
.progress-heading strong { color: var(--jade); }
#progress-percent { color: var(--secondary); font-variant-numeric: tabular-nums; }
.track { height: 6px; margin: 14px 0 18px; overflow: hidden; border-radius: 8px; background: var(--surface-strong); }
.track i { display: block; width: 0; height: 100%; border-radius: 8px; background: var(--grad); box-shadow: 0 0 10px rgba(31, 169, 104, .6); transition: width .8s; }
.progress-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.progress-steps li { display: flex; align-items: center; gap: 12px; color: var(--tertiary); font-size: 14px; }
.progress-steps .step-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--stroke); border-radius: 50%; background: var(--surface); font-size: 12px; font-weight: 800; }
.progress-steps .step-icon .i { width: 14px; height: 14px; }
.progress-steps li.current { color: var(--text); }
.progress-steps li.current .step-icon { border-color: var(--jade); color: var(--jade); box-shadow: 0 0 0 4px rgba(31, 169, 104, .14); }
.progress-steps li.complete { color: var(--secondary); }
.progress-steps li.complete .step-icon { border-color: transparent; background: var(--grad); color: #fff; }
#progress-note { margin-top: 18px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); grid-template-rows: auto 1fr; gap: 20px 56px; align-items: center; }
.result-video { display: grid; place-items: center; }
#story-video { width: auto; max-width: 100%; height: min(78vh, 720px); aspect-ratio: 9 / 16; border-radius: 20px; background: #000; box-shadow: 0 30px 70px rgba(0, 0, 0, .6); }
.result-meta h2 { margin: 0 0 6px; font: 700 clamp(28px, 3.4vw, 40px)/1.15 var(--serif); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 12px; }
.result-actions .btn-primary { flex: 1 1 100%; }
.result-actions .btn-outline { flex: 1; }
#make-another { margin-top: 8px; }

/* Animations */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes border-turn { to { --angle: 360deg; } }
@keyframes sweep { 0% { opacity: 0; transform: translateX(-130px); } 20% { opacity: .8; } 80% { opacity: .6; } 100% { opacity: 0; transform: translateX(130px); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes wall-up { to { transform: translateY(-50%); } }
@keyframes bob { 50% { transform: translateY(3px); } }

/* Tablet */
@media (max-width: 1100px) {
  .style-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .style-card .style-desc { display: none; }
  .style-card .style-name { bottom: 12px; }
}

/* Phone */
@media (max-width: 720px) {
  .nav { height: 58px; gap: 12px; }
  .nav-links { display: none; }
  .brand { font-size: 19px; }
  .brand img { width: 30px; height: 30px; }
  .credits-pill { height: 36px; padding: 0 12px; }
  .credits-pill span { display: none; }
  .avatar-button { width: 36px; height: 36px; }
  .page { padding-top: 4px; }
  .hero { margin-top: -62px; padding-top: 96px; min-height: 0; }
  .poster-wall { gap: 12px; }
  .wall-col { flex-basis: 120px; gap: 12px; }
  .wall-col img { border-radius: 12px; }
  .headline { font-size: 38px; letter-spacing: -.6px; }
  .lede { font-size: 15px; margin-bottom: 20px; }
  .studio { padding: 18px 16px 0; border-radius: 22px; }
  .studio-actions { position: sticky; bottom: 0; z-index: 5; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .studio-head { top: 58px; margin: -18px -16px 16px; padding: 18px 16px 0; border-radius: 22px 22px 0 0; }
  .stepper li { gap: 6px; font-size: 12px; white-space: nowrap; }
  .stepper li:not(.active) .label { display: none; }
  .composer { padding: 16px; }
  .composer textarea { min-height: 110px; font-size: 18px; }
  .kbd-hint { display: none; }
  #prompt-count { margin-left: auto; }
  .idea-grid { flex-wrap: nowrap; margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .idea-grid::-webkit-scrollbar { display: none; }
  .idea-card { flex: none; }
  .style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .style-card { border-radius: 14px; }
  .style-card .style-name { left: 8px; right: 8px; bottom: 10px; font-size: 12px; text-align: center; }
  .style-card .style-desc { display: none; }
  .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .setting { padding: 16px; }
  .studio-actions { flex-direction: column; gap: 8px; margin: 18px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 0 0 22px 22px; }
  .next-hint { text-align: center; font-size: 12px; }
  .next-hint:empty { display: none; }
  .studio-actions .btn-primary { width: 100%; min-width: 0; }
  .section { margin-top: 52px; }
  .reel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .reel-card { border-radius: 16px; }
  .reel-card .play { opacity: 1; transform: translate(-50%, -50%) scale(.85); }
  .how-grid { grid-template-columns: 1fr; }
  .footer p { margin-left: 0; }
  .sheet { width: 100%; max-height: 92vh; margin: auto 0 0; padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; border-bottom: 0; }
  .sheet[open] { animation: slide-up .3s ease; }
  .player { width: 100%; height: 100%; }
  .player-frame { border: 0; border-radius: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .player-bar { flex-direction: column; align-items: stretch; }
  .player-close { top: 16px; right: 16px; z-index: 2; }
  .mini-progress { left: 16px; right: 16px; justify-content: center; }
  .progress-layout, .result-layout { grid-template-columns: 1fr; gap: 14px; align-content: start; }
  .card-stack { height: 250px; }
  .stack-card { width: 140px; }
  .stack-card.center, .sweep { width: 150px; }
  .stack-card.left { transform: translateX(-84px) rotate(-9deg); }
  .stack-card.right { transform: translateX(84px) rotate(9deg); }
  .progress-copy { text-align: center; }
  .progress-copy .eyebrow { justify-content: center; }
  .progress-card { text-align: left; }
  #story-video { height: min(62vh, 600px); }
  .result-meta { text-align: center; }
  .result-meta .eyebrow { justify-content: center; }
}
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 380px) {
  .style-grid { gap: 8px; }
  .headline { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
