@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/inter-tight-800.woff2) format('woff2'); }

:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --text: #0b1220;
  --muted: #5b6676;
  --line: #e3e8e6;
  --brand: #0b7d57;            /* text and buttons: 5:1 on white */
  --brand-strong: #0b6e4f;
  --logo-green: #0e9f6e;
  --brand-2: #f2a900;
  --ink: #0b1220;
  --brand-ink: #ffffff;
  --brand-soft: #e3f6ee;
  --ok: #0f9d6b;
  --bad: #d92d4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 10 50 / 0.04), 0 10px 30px -14px rgb(20 10 50 / 0.18);
  /* Hero device mock-ups: a dark bezel with a lighter rim, distinct from the page in both themes. */
  --device-frame: #1b2130;
  --device-edge: #59647a;
  color-scheme: light;
}
/* Dark theme: the system setting, unless the visitor picked light or dark with the switcher. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1018;
    --panel: #121925;
    --text: #eef2f7;
    --muted: #94a3b8;
    --line: #233041;
    --brand: #34d399;
    --brand-strong: #34d399;
    --logo-green: #34d399;
    --brand-2: #ffc93c;
    --ink: #f2f0f8;
    --brand-ink: #062b1e;
    --brand-soft: #0f2a22;
    --shadow: none;
    --device-frame: #2a3343;
    --device-edge: #8592a8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1018;
  --panel: #121925;
  --text: #eef2f7;
  --muted: #94a3b8;
  --line: #233041;
  --brand: #34d399;
  --brand-strong: #34d399;
  --logo-green: #34d399;
  --brand-2: #ffc93c;
  --ink: #f2f0f8;
  --brand-ink: #062b1e;
  --brand-soft: #0f2a22;
  --shadow: none;
  --device-frame: #2a3343;
  --device-edge: #8592a8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; }
h1, h2 { font-family: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* Keep the wrong account view out of the first paint while the session loads. */
.booting body { overflow: hidden; }
.booting body > :not(#boot-screen) { visibility: hidden; }
.boot-screen { display: none; }
.booting .boot-screen { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: var(--bg); text-align: center; }
.boot-screen p { margin: 0; color: var(--muted); }
.boot-spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: boot-spin .8s linear infinite; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-spinner { animation: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; color: var(--brand-ink); background: var(--brand); border: 1px solid transparent; border-radius: 12px; padding: 11px 18px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.big { padding: 15px 26px; font-size: 17px; border-radius: 14px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in oklab, var(--panel) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; display: block; }
.word { font: 800 20px/1 'Inter Tight', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: -0.035em; color: var(--ink); }
.word span { color: var(--logo-green); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.balance { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; color: var(--text); background: var(--brand-soft); border: 0; border-radius: 999px; padding: 6px 6px 6px 14px; cursor: pointer; }
.balance .plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .email { display: none; } .top { padding: 10px 16px; flex-wrap: wrap; } .top-right { gap: 12px; flex-wrap: wrap; } }

/* Landing */
#landing { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 64px 0 48px; }
.eyebrow { display: inline-block; margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-strong); }
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 16px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-media { position: relative; min-height: 380px; }
.hero-media video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.hero-media .screen { position: absolute; right: 0; top: 30px; width: 86%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 7px solid var(--device-frame); box-shadow: 0 0 0 1.5px var(--device-edge), 0 30px 60px -25px rgb(30 10 80 / 0.55); }
.hero-media .phone { position: absolute; left: 0; bottom: 0; z-index: 1; width: 34%; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden; border: 7px solid var(--device-frame); box-shadow: 0 0 0 1.5px var(--device-edge), 0 30px 60px -20px rgb(30 10 80 / 0.6); }
/* Speaker notch at the top of the phone. */
.hero-media .phone::before { content: ''; position: absolute; z-index: 2; left: 50%; top: 6px; width: 30%; height: 7px; translate: -50% 0; border-radius: 999px; background: var(--device-frame); box-shadow: 0 0 0 1px var(--device-edge); }
.gallery-media { border: 5px solid var(--device-frame); box-shadow: 0 0 0 1.5px var(--device-edge), var(--shadow); }
.steps-wrap, .uses, .faq, .cta-band, .gallery { padding: 24px 0 48px; }
.gallery h2 { font-size: 28px; text-align: center; margin-bottom: 8px; }
.gallery-lede { text-align: center; max-width: 60ch; margin: 0 auto 16px; }
.gallery-tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.gallery-tabs button { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.gallery-tabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gallery-grid[data-format="16x9"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-item { margin: 0; display: grid; gap: 8px; }
.gallery-media { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #111; box-shadow: var(--shadow); }
.gallery-grid[data-format="16x9"] .gallery-media { aspect-ratio: 16 / 9; }
.gallery-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-item figcaption { display: grid; gap: 2px; font-size: 14px; }
.gallery-item figcaption span { color: var(--muted); font-size: 13px; }
.gallery-note { text-align: center; margin-top: 14px; }
.made-with { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 4px 9px; border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; pointer-events: none; backdrop-filter: blur(4px); }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gallery-grid[data-format="16x9"] { grid-template-columns: 1fr; } }
.steps-wrap h2, .uses h2, .faq h2 { font-size: 28px; text-align: center; margin-bottom: 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; margin: 0; padding: 0; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step p { margin: 0; color: var(--muted); }
.num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; margin-bottom: 12px; }
.pricing { text-align: center; padding: 24px 0 56px; }
.pricing h2 { font-size: 30px; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px auto 16px; max-width: 760px; }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow); text-align: center; }
.tier .price { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; }
.tier .label { font-weight: 700; font-size: 15px; margin: 0; }
.tier .sub { color: var(--muted); font-size: 13px; }
.tier .credits { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--muted); opacity: 0.85; }
.tier.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.use-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.use { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.use p { margin: 0; color: var(--muted); font-size: 14px; }
.faq { max-width: 820px; margin: 0 auto; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { padding: 14px 18px; font-size: 16px; font-weight: 700; color: var(--text); }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
.cta-band { text-align: center; margin: 8px 0 32px; padding: 40px 24px; border-radius: 20px; background: radial-gradient(90% 140% at 80% 100%, color-mix(in oklab, var(--brand) 55%, #0b1220), #0b1220 65%); color: #fff; }
.cta-band h2 { font-size: 30px; margin: 0 0 8px; }
.cta-band .muted { color: #c9d6e3; margin: 0 0 20px; }
.cta-band .btn { background: var(--brand-2); color: #0b1220; }
.foot { text-align: center; padding: 24px 0 40px; border-top: 1px solid var(--line); }
.foot-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--text); margin-bottom: 6px; }
.foot p { margin: 0; }
@media (max-width: 900px) { .use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hide-sm { display: none; } .use-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 28px; }
  .hero-media { min-height: 0; aspect-ratio: 16 / 11; }
  .steps { grid-template-columns: 1fr; }
}
.tiers.four { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 900px; }
@media (max-width: 760px) { .tiers.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiers { grid-template-columns: 1fr; } }

/* App */
#app { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 22px; max-width: 1400px; margin: 0 auto; padding: 24px; align-items: start; }
@media (max-width: 900px) { #app { grid-template-columns: 1fr; padding: 16px; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.create { position: sticky; top: 76px; }
@media (max-width: 900px) { .create { position: static; } }
.field { display: grid; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 700; padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field > .hint { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; }
.code { font-size: 26px; letter-spacing: 0.4em; text-align: center; font-weight: 800; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 14px; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.error { color: var(--bad); font-size: 14px; margin: 0 0 12px; }
.error:empty { display: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; cursor: pointer; background: var(--bg); }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-empty { display: grid; gap: 4px; text-align: center; padding: 14px 4px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(#e9e7f0 0 25%, #f7f6fb 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.6); color: #fff; cursor: pointer; font-size: 12px; line-height: 22px; padding: 0; }
.thumb.add { display: grid; place-items: center; color: var(--muted); font-size: 26px; background: var(--panel); }

.tiers.pick { margin: 0; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiers.pick label { position: relative; }
.tiers.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tiers.pick .tier { padding: 12px 6px; box-shadow: none; cursor: pointer; }
.tiers.pick .tier .price { font-size: 20px; }
.tiers.pick input:checked + .tier { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.tiers.pick input:focus-visible + .tier { outline: 2px solid var(--brand); outline-offset: 2px; }

.library-head { display: flex; align-items: center; justify-content: space-between; }
#projects { display: grid; gap: 16px; }
.tiles-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: start; }
.tiles-grid > p.muted { grid-column: 1 / -1; }
.tile { display: grid; text-align: left; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); box-shadow: var(--shadow); cursor: pointer; font: inherit; transition: transform 0.15s ease, border-color 0.15s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand); }
.tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tile-media { position: relative; aspect-ratio: 16 / 9; background: #0b0f17; display: grid; place-items: center; overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-media .status { position: absolute; left: 8px; top: 8px; font-size: 11px; background: rgb(255 255 255 / 0.94); color: #0b1220; box-shadow: 0 2px 8px rgb(0 0 0 / 0.3); }
.tile-empty { display: grid; gap: 8px; width: 80%; color: #94a3b8; font-size: 12px; text-align: center; }
.tile-body { padding: 10px 12px 12px; display: grid; gap: 4px; min-width: 0; }
.tile-title { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.tile-chips span { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sheet.wide { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; }
.sheet.wide .job { border: 0; box-shadow: none; padding: 0; background: none; }
.sheet.wide .job-head { padding-right: 28px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.job-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.job-title { font-weight: 700; overflow-wrap: anywhere; }
.job-meta { font-size: 13px; color: var(--muted); }
.status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.status.done { background: color-mix(in oklab, var(--ok) 15%, transparent); color: var(--ok); }
.status.failed { background: color-mix(in oklab, var(--bad) 15%, transparent); color: var(--bad); }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; transition: width 0.4s ease; }
.job-msg { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.videos { display: grid; grid-template-columns: minmax(0, 16fr) minmax(0, 6fr); gap: 14px; align-items: start; }
.video { display: grid; gap: 8px; }
.video video { width: 100%; border-radius: 10px; background: #000; display: block; }
.video .row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
@media (max-width: 560px) { .videos { grid-template-columns: 1fr; } .videos .video.portrait video { max-height: 70vh; width: auto; margin: 0 auto; } }

/* Dialogs */
.sheet { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.45); }
.sheet::backdrop { background: rgb(10 8 20 / 0.55); backdrop-filter: blur(2px); }
.sheet h2 { margin-top: 0; }
.sheet-close { position: absolute; top: 14px; right: 16px; margin: 0; }
.sheet-close .link { color: var(--muted); font-size: 18px; }
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 18px; }
.amounts button { font: inherit; font-weight: 700; padding: 10px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.amounts button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
#paypal-buttons { min-height: 50px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); max-width: calc(100vw - 32px); }

/* Projects: script, then renders */
.script { margin: 12px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.script summary { padding: 10px 14px; background: var(--bg); color: var(--text); font-size: 14px; }
.script ol { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.script li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.script .t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.script .t b { display: block; color: var(--text); font-size: 13px; }
.script .onscreen { font-weight: 700; }
.script .vo { color: var(--muted); font-style: italic; }
.script .vo::before { content: 'Voice: '; font-style: normal; font-weight: 600; }
.brief { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.brief p { margin: 0 0 4px; }
.brief h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.brief ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; max-height: none; overflow: visible; }
.script .brief li { display: list-item; grid-template-columns: none; padding: 0; border: 0; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); margin-right: 4px; text-transform: capitalize; }
.slide-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.anims { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chip { font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.chip b { color: var(--text); font-weight: 600; }
.edit-row { margin-top: 10px; align-items: center; gap: 10px; }
.narration { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.make { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--bg); }
.make h3 { margin: 0; font-size: 14px; }
.make .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.seg input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.renders .video video { max-height: 420px; object-fit: contain; }
.render-pending { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; display: grid; gap: 8px; }

/* Voiceover */
.voice { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); display: grid; gap: 10px; }
.voice h3 { margin: 0; font-size: 15px; }
.voice p { margin: 0; }
.voice-row { display: flex; gap: 8px; align-items: center; }
.voice-select { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.voice-more summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.voice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 10px; }
.voice-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.voice-grid label output { float: right; color: var(--text); font-variant-numeric: tabular-nums; }
.voice-grid select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.voice-grid input[type="range"] { accent-color: var(--brand); width: 100%; }
.voice-grid .hint { font-size: 11px; }
.voice .hear { display: grid; gap: 6px; }
.voice .hear audio { width: 100%; }
.voice-warn { margin: 0; padding-left: 18px; font-size: 13px; color: var(--brand-2); }
.play-line { border: 1px solid var(--line); background: var(--panel); color: var(--brand); border-radius: 99px; width: 22px; height: 22px; font-size: 10px; line-height: 1; margin-right: 6px; cursor: pointer; vertical-align: 1px; font-style: normal; }
.play-line.playing { background: var(--brand); color: var(--brand-ink); }
.check.small { font-size: 13px; }
@media (max-width: 560px) { .voice-grid { grid-template-columns: 1fr; } }

/* Account */
.notice { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--brand-soft); color: var(--text); font-size: 14px; }
.top-right .link[data-action="signin"] { font-weight: 600; }
#signin .pane .field + .field { margin-top: 10px; }
#signin .pane p.small { margin: 12px 0 0; }

/* Promo code in the Add credits dialog */
.promo-form { display: flex; gap: 8px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.promo-form .field { flex: 1; margin: 0; }
.promo-form input { text-transform: uppercase; }

/* Look picker: three cards with looping previews */
.look-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.look-head > span { font-size: 13px; font-weight: 700; }
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.looks-wrap { container-type: inline-size; min-width: 0; }
.look-card { position: relative; display: grid; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.look-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.look-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.look-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.look-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.look-card:has(input:checked) .look-text b::after { content: ' ✓'; color: var(--brand); }
.look-media { display: block; aspect-ratio: 16 / 9; background: #0b0b12; }
.look-media video, .tpl video { width: 100%; height: 100%; object-fit: cover; display: block; }
.look-text { display: grid; gap: 2px; padding: 8px 10px 10px; }
.look-text b { font-size: 14px; }
.look-text .small { line-height: 1.35; }
@container (max-width: 560px) {
  .looks { grid-template-columns: 1fr; gap: 8px; }
  .look-card { grid-template-columns: 136px minmax(0, 1fr); align-items: center; }
}

/* Template gallery */
#template-list h3 { margin: 18px 0 10px; font-size: 15px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tpl { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.tpl .look-media { aspect-ratio: 16 / 9; }
.tpl figcaption { padding: 8px 10px 10px; display: grid; gap: 2px; font-size: 13px; }

/* A project is a page with two base tabs, sharing the same editor session. */
body.workspace-open { overflow: hidden; }
body.workspace-open > #app, body.workspace-open > #landing, body.workspace-open > footer { display: none; }
body.workspace-open > .top { position: fixed; inset: 0 0 auto; z-index: 30; }
.workspace { overflow: hidden; position: fixed; inset: var(--top-height, 64px) 0 0; z-index: 20; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: var(--bg); }
.workspace-top { display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.workspace-back { color: var(--brand); text-decoration: none; font-weight: 700; white-space: nowrap; }
#workspace-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.workspace-tabs { overflow-x: auto; min-width: 0; display: flex; gap: 24px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.workspace-tabs button { flex-shrink: 0; white-space: nowrap; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 4px 11px; font: inherit; font-weight: 700; cursor: pointer; }
.workspace-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
#config-panel, #videos-panel { overflow: auto; padding: 24px; min-height: 0; }
#workspace-unsaved { margin-bottom: 18px; }
#project-detail .job { border: 0; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
#project-detail .job-head { margin-bottom: 20px; }
#project-detail .job-title { font-size: 24px; line-height: 1.3; }
.project-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 24px; align-items: start; }
.project-script, .project-settings { min-width: 0; }
.project-script .script { margin-top: 0; background: var(--panel); }
.project-script .script ol { max-height: none; overflow: visible; }
.project-settings { display: grid; gap: 20px; }
.project-settings .voice, .project-settings .make { margin-top: 0; background: var(--panel); border: 1px solid var(--line); }
#videos-panel h2 { margin-top: 0; }
#editor-panel { min-height: 0; position: relative; }
#editor-mount { height: 100%; }
#editor-loading { padding: 24px; margin: 0; }
#editor-loading:not([hidden]) + #editor-mount { display: none; }
@media (max-width: 900px) {
  .project-layout { grid-template-columns: minmax(0, 1fr); }
  .workspace-top { gap: 12px; padding: 10px 16px; }
  .workspace-tabs { padding: 0 16px; gap: 20px; }
  #config-panel, #videos-panel { padding: 20px 16px; }
  #project-detail .job-title { font-size: 20px; }
}
@media (max-width: 560px) {
  .workspace-top { flex-wrap: wrap; }
  #workspace-title { order: 3; flex-basis: 100%; }
  .workspace-top > button { margin-left: auto; }
  .workspace-tabs { gap: 16px; font-size: 14px; }
  .workspace .ed-top { flex-wrap: wrap; }
  .workspace .ed-tools { justify-content: flex-start; }
  .workspace .ed-status { max-width: 130px; }
}

.palette-field { border: 0; padding: 0; margin: 16px 0; min-width: 0; }
.palette-field legend { font-weight: 700; margin-bottom: 8px; }
.palette-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.palette-choice { display: grid; gap: 5px; position: relative; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; }
.palette-choice:has(input:checked) { border-color: var(--brand); outline: 1px solid var(--brand); }
.palette-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.palette-choice:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.palette-swatches { display: flex; height: 18px; border-radius: 4px; overflow: hidden; }
.palette-swatches i { flex: 1; }

.script-artwork { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.script-artwork span { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; }
.script-artwork img { width: 28px; height: 28px; padding: 3px; border-radius: 4px; background: #e2e8f0; }

/* Let nested voice controls shrink inside the project column instead of widening it. */
.workspace { grid-template-columns: minmax(0, 1fr); }
.workspace > * { min-width: 0; }
.project-settings > *, .voice, .voice > *, .voice-grid > *, .voice .hear { min-width: 0; }
.voice { container-type: inline-size; }
.voice .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.voice-select { flex: 1 1 180px; width: 100%; max-width: 100%; }
.voice-grid select, .voice-grid input { min-width: 0; max-width: 100%; width: 100%; }
.voice-grid input[type="range"] { margin-inline: 0; }
.voice .hear audio { display: block; min-width: 0; max-width: 100%; }
.voice-warn, .voice p { overflow-wrap: anywhere; }
.voice-volume { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: 13px; color: var(--muted); }
.voice-volume input { grid-column: 1 / -1; width: 100%; min-width: 0; margin: 0; accent-color: var(--brand); }
.voice-volume output { color: var(--text); font-variant-numeric: tabular-nums; }
@container (max-width: 420px) { .voice-grid { grid-template-columns: minmax(0, 1fr); } }
.regenerate-script { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.regenerate-script h3 { font-size: 15px; margin: 0; }
.regenerate-script p { margin: 0; }
.regenerate-script .btn { justify-self: start; }
.regenerate-script .error:empty { display: none; }

/* Custom voiceover playback controls. */
.audio-player { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); display: grid; gap: 14px; }
.audio-transport { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; }
.audio-play { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--brand-ink); background: var(--brand); cursor: pointer; }
.audio-play:hover { filter: brightness(1.08); }
.audio-track { min-width: 0; display: grid; gap: 8px; }
.audio-timing { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 12px; color: var(--muted); }
[data-audio-time] { white-space: nowrap; font-variant-numeric: tabular-nums; }
[data-audio-seek] { appearance: none; width: 100%; min-width: 0; height: 6px; margin: 8px 0; border-radius: 99px; background: linear-gradient(to right, var(--brand) var(--played, 0%), var(--line) var(--played, 0%)); cursor: pointer; }
[data-audio-seek]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); }
[data-audio-seek]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--brand); }
[data-audio-seek]:disabled { opacity: .45; cursor: default; }
.audio-volume-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.audio-mute { font: inherit; font-size: 12px; padding: 8px; min-width: 62px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; }
.audio-error [data-audio-status] { color: var(--bad); }
.media-spinner { display: inline-block; flex-shrink: 0; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: boot-spin .75s linear infinite; }
@media (prefers-reduced-motion: reduce) { .media-spinner { animation: none; } }

/* Render status stays above both tabs while their content scrolls. */
.workspace-top { flex-wrap: wrap; }
.workspace-render-status { flex: 1 0 100%; min-width: 0; display: grid; gap: 7px; padding: 12px 16px; border: 1px solid var(--brand); border-radius: 12px; background: var(--brand-soft); }
.render-notice-heading { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.render-notice-heading > strong { font-size: 15px; }
.render-locked { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 8px; border: 1px solid var(--brand); border-radius: 99px; }
.workspace-render-status p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.workspace-render-status progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); accent-color: var(--brand); }
.workspace-render-status progress::-webkit-progress-bar { background: var(--line); }
.workspace-render-status progress::-webkit-progress-value { background: var(--brand); }
.workspace-render-status progress::-moz-progress-bar { background: var(--brand); }
@media (max-width: 560px) { .workspace-render-status { order: 4; padding: 10px; } }

/* Light/dark switcher, fixed at the bottom left; hidden while a project is open. */
.theme-toggle {
  position: fixed; left: 16px; bottom: 16px; z-index: 900;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  box-shadow: 0 6px 20px -8px rgb(0 0 0 / 0.35); cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--brand); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.workspace-open .theme-toggle, .booting .theme-toggle { display: none; }

/* Generated videos: posters in the library, one branded player on demand. */
.render-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.render-card > .row { padding: 12px 14px; justify-content: space-between; font-size: 13px; }
.render-thumbnail { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 0; cursor: pointer; color: #fff; background: radial-gradient(ellipse at top, #145943, #081d18); }
.render-thumbnail img { width: 100%; height: 100%; position: absolute; object-fit: contain; }
.thumbnail-play { display: grid; place-items: center; width: 56px; height: 56px; padding-left: 3px; border-radius: 50%; background: #ffc93c; color: #062b1e; box-shadow: 0 4px 24px #0006; z-index: 1; transition: transform .15s; }
.render-thumbnail:hover .thumbnail-play { transform: scale(1.1); }
.thumbnail-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 25px 12px 10px; font-weight: 700; background: linear-gradient(transparent, #000b); }
.thumbnail-brand { position: absolute; top: 12px; left: 14px; font-weight: 800; }
.thumbnail-brand span, .player-brand span { color: #34d399; }
.video-player { padding: 0; width: min(1000px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid #267258; border-radius: 20px; color: #f3fff9; background: #0b211b; box-shadow: 0 24px 100px #0008; }
.video-player::backdrop { background: #02130ee0; backdrop-filter: blur(8px); }
.video-player-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.player-brand { font-weight: 800; font-size: 18px; }
.video-player h2 { margin: 4px 0 0; font-size: 13px; font-weight: 400; color: #b4cec2; overflow-wrap: anywhere; }
.video-player video { display: block; width: 100%; height: min(58dvh, 560px); object-fit: contain; background: #020a07; }
.video-controls { padding: 14px 20px; }
.video-player button, .video-player a { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 9px; border: 1px solid #32624d; background: #143b2d; color: #effff7; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.video-player [data-video-play] { background: #ffc93c; color: #062b1e; border-color: #ffc93c; font-weight: 700; min-width: 90px; }
.video-player :focus-visible { outline-color: #ffc93c; }
.video-control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
[data-video-time] { font-size: 12px; font-variant-numeric: tabular-nums; margin-right: auto; }
[data-video-volume] { width: 80px; accent-color: #34d399; }
[data-video-seek] { display: block; width: 100%; margin: 0; accent-color: #34d399; cursor: pointer; }
[data-video-status] { font-size: 13px; color: #ffc93c; margin: 8px 0 0; min-height: 18px; }
.video-player-body:fullscreen { background: #0b211b; overflow: auto; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
.video-player-body:fullscreen video { height: calc(100dvh - 200px); }
@media (max-width: 560px) { .video-controls, .video-player-header { padding: 12px; } .video-control-row { gap: 8px; } .video-player video { height: 48dvh; } }
