/* Shorts Studio — the review desk. Lato Black echoes the burned-in captions; the one accent is the caption highlight yellow. */
@font-face { font-family: "Lato"; src: url("/fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/Lato-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

:root {
  --bg: #e9edf2;
  --surface: #f8fafc;
  --ink: #18202e;
  --muted: #5a6474;
  --line: #cdd5e0;
  --accent: #ffd400;
  --accent-ink: #18202e;
  --go: #1e7f55;
  --stop: #b93a33;
  --warn: #9a6400;
  --bezel: #0e131b;
  --focus: #2f6fdb;
  --radius-s: 6px;
  --radius-l: 14px;
  color-scheme: light;
}
/* Dark: follows the system unless the theme cookie forces light; data-theme="dark" forces it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171f; --surface: #1a212c; --ink: #e4e9f0; --muted: #8d97a8; --line: #2a3342;
    --go: #4cc38a; --stop: #f07068; --warn: #e7b04a; --bezel: #05080c; --focus: #7aa7ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12171f; --surface: #1a212c; --ink: #e4e9f0; --muted: #8d97a8; --line: #2a3342;
  --go: #4cc38a; --stop: #f07068; --warn: #e7b04a; --bezel: #05080c; --focus: #7aa7ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-weight: 900; font-size: 1.95rem; letter-spacing: -0.01em; }
h2 { font-weight: 900; font-size: 1.25rem; margin-bottom: .75rem; }
h3 { font-weight: 700; font-size: 1rem; margin: 1.25rem 0 .25rem; }
p { margin: .25rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* layout */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
  padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; text-decoration: none; margin: 0 8px 22px; }
.brand-mark { width: 14px; height: 24px; border-radius: 3px; background: var(--bezel); box-shadow: inset 0 -7px 0 var(--accent); }
.nav-link { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--muted); font-weight: 700; }
.nav-link:hover { color: var(--ink); background: var(--bg); text-decoration: none; }
.nav-link.is-active { color: var(--ink); background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.nav-count { min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; text-align: center; }
.rail-foot { margin-top: auto; padding: 0 10px; display: grid; gap: 14px; justify-items: start; }

/* theme switch: light / dark / system, saved in a cookie */
.theme-switch { display: inline-flex; gap: 2px; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.theme-switch label { position: relative; display: grid; place-items: center; width: 30px; height: 26px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.theme-switch label:hover { color: var(--ink); }
.theme-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-switch label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), inset 0 -2px 0 var(--accent); }
.theme-switch label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-theme { position: fixed; top: 16px; right: 16px; z-index: 2; }
.main { padding: 28px clamp(16px, 4vw, 48px) 64px; min-width: 0; max-width: 1400px; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.block { margin-bottom: 32px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

/* controls */
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px;
}
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--ink); }
input[type="range"] { padding: 0; accent-color: var(--ink); border: 0; background: none; }
input[type="file"] { padding: 6px; }
label { display: block; font-weight: 700; font-size: .9rem; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
output { font-weight: 400; color: var(--muted); margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 .95rem/1 "Lato", system-ui, sans-serif; padding: 10px 16px; min-height: 40px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent-ink); }
.btn-wide { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.danger { color: var(--stop); }

.stack { display: grid; gap: 14px; }
.stack.narrow { max-width: 420px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row-end { display: flex; justify-content: flex-end; }
.inline { display: inline; margin-left: 10px; }
.upload-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.upload-row input { flex: 1; }

/* notices & pills */
.notice { padding: 10px 14px; border-radius: var(--radius-s); margin-bottom: 14px; border: 1px solid; font-size: .95rem; }
.notice-ok { border-color: color-mix(in srgb, var(--go) 45%, transparent); background: color-mix(in srgb, var(--go) 10%, var(--surface)); }
.notice-error { border-color: color-mix(in srgb, var(--stop) 45%, transparent); background: color-mix(in srgb, var(--stop) 10%, var(--surface)); }
.notice-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }

.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill-pending_review { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill-approved, .pill-uploaded { color: var(--go); border-color: color-mix(in srgb, var(--go) 40%, transparent); }
.pill-failed, .pill-rejected { color: var(--stop); border-color: color-mix(in srgb, var(--stop) 40%, transparent); }
.pill-generating, .pill-uploading { color: var(--ink); border-style: dashed; }

/* make form */
.make-form { display: flex; gap: 8px; flex: 1; max-width: 640px; }
.make-form input { flex: 1; }
.make-form select { width: auto; }

.voice-ne { display: flex; align-items: end; }
.pill-lang { color: var(--ink); }

/* trending topic ideas */
.ideas { scroll-margin-top: 110px; }
.ideas-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.ideas-head h2 { margin-bottom: .25rem; }
.idea-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.idea { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.idea strong { line-height: 1.3; }
.idea-trend { align-self: flex-start; max-width: 100%; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .78rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: inset 2px 0 0 var(--accent); }
.idea-actions { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 14px; }
.idea-actions .btn { min-height: 34px; padding: 8px 12px; }

/* posters: tall 9:16 frames, the shape of the product */
.shelf { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.shelf .poster { flex: 0 0 200px; scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 18px; }
.poster { display: grid; gap: 6px; text-decoration: none; }
.poster:hover { text-decoration: none; }
.poster-frame {
  position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--radius-l); overflow: hidden;
  background: var(--bezel); border: 4px solid var(--bezel);
}
.poster:hover .poster-frame, .poster:focus-visible .poster-frame { border-color: var(--accent); }
.poster-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #8d97a8; font-weight: 700; font-size: .9rem; padding: 12px; text-align: center; }
.poster-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: .75rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.poster-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty { border: 2px dashed var(--line); border-radius: var(--radius-l); padding: 40px 24px; text-align: center; color: var(--muted); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* production progress: a real sequence, so it's ordered */
.progress-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.progress-list > li { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); }
.progress-list > li > a { font-weight: 700; }
.stages { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.stages li { flex: 1; font-size: .78rem; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); }
.stages li.done { border-top-color: var(--ink); color: var(--ink); }
.stages li.now { border-top-color: var(--accent); color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .stages li.now { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { border-top-color: color-mix(in srgb, var(--accent) 35%, var(--line)); } }
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: .9rem; font-weight: 700; color: var(--muted); }
.tabs a span { font-weight: 400; margin-left: 4px; }
.tabs a.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* review page: the screen is the hero */
.review { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.screen {
  position: sticky; top: 24px; aspect-ratio: 9 / 16; max-height: calc(100vh - 48px);
  background: var(--bezel); border-radius: 22px; padding: 10px; box-shadow: 0 24px 48px -24px rgba(8, 12, 20, .55);
}
.screen video { width: 100%; height: 100%; border-radius: 13px; background: #000; display: block; object-fit: contain; }
.screen-wait { height: 100%; display: grid; place-content: center; text-align: center; color: #c9d1dd; }
.screen-stage {
  font-weight: 900; font-size: 1.6rem; text-transform: uppercase; color: #fff;
  -webkit-text-stroke: 6px #000; paint-order: stroke fill;
}
.dossier { min-width: 0; max-width: 760px; }
.dossier-head { display: grid; gap: 6px; margin-bottom: 18px; justify-items: start; }
.decide { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0; margin-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.redo { display: grid; gap: 10px; padding: 16px; margin: -6px 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); }

.scenes { margin: 0; padding: 0; list-style: none; counter-reset: scene; display: grid; gap: 14px; }
.scenes li { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: start; counter-increment: scene; }
.scene-thumb img { width: 54px; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; display: block; background: var(--bezel); }
.scene-line { font-size: 1.05rem; }
.scene-line::before { content: counter(scene) "  "; font-weight: 900; color: var(--muted); }
.scene-prompt { font-size: .85rem; color: var(--muted); }
.sources { margin: 0; padding-left: 18px; overflow-wrap: anywhere; }
.log summary { cursor: pointer; font-weight: 700; }
.log pre { white-space: pre-wrap; font-size: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; max-height: 340px; overflow: auto; }
.danger-zone { margin-top: 28px; }

/* settings */
.settings { display: grid; grid-template-columns: 170px minmax(0, 820px); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.settings-nav a { padding: 6px 10px; text-decoration: none; color: var(--muted); font-weight: 700; border-radius: var(--radius-s); }
.settings-nav a:hover { color: var(--ink); background: var(--surface); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; margin-bottom: 24px; scroll-margin-top: 24px; }
.panel > p.muted { margin: -6px 0 16px; }
.steps { margin: 0 0 22px; padding-left: 22px; display: grid; gap: 12px; }
.steps > li h3 { margin-top: 0; }
.steps > li.done h3::after { content: " — done"; color: var(--go); font-weight: 700; }
.key-row { display: grid; gap: 4px; }
.tests { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.tests [data-test-result] { flex-basis: 100%; }
.tests .ok { color: var(--go); }
.tests .bad { color: var(--stop); }

/* login: a single caption on a phone-shaped screen */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { display: grid; grid-template-columns: 240px 320px; gap: 48px; align-items: center; }
.login-frame {
  aspect-ratio: 9 / 16; border-radius: 22px; border: 10px solid var(--bezel);
  background: linear-gradient(160deg, #1d3557, #0b1220 70%); display: grid; place-items: center; padding: 14px;
}
.login-cap {
  font-weight: 900; font-size: 1.7rem; line-height: 1.15; text-align: center; color: #fff;
  -webkit-text-stroke: 7px #000; paint-order: stroke fill;
}
.login-cap em { font-style: normal; color: var(--accent); }
.login-form { display: grid; gap: 14px; }
.login-form h1 { margin-bottom: -8px; }

/* small screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 10px 0 0; }
  .brand span:last-child { display: none; }
  .rail-foot { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 12px; }
  .main { padding: 20px 16px 48px; }
  .review { grid-template-columns: 1fr; }
  .screen { position: static; max-width: 360px; width: 100%; margin: 0 auto; }
  .split, .cols, .cols-3 { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; }
  .make-form { flex-wrap: wrap; max-width: none; }
  .make-form input { flex-basis: 100%; }
  .login { grid-template-columns: 1fr; }
  .login-frame { display: none; }
}

/* visual source choice */
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice legend { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.choice-opt { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.choice-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.choice-opt input { width: auto; margin-top: 4px; accent-color: var(--ink); }
.choice-opt > span { display: grid; }
.scene-thumb video { width: 54px; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; display: block; background: var(--bezel); }
