/* OpenFrames web client. One stylesheet; layouts change by width and by phone landscape, not by device sniffing.
   Breakpoints: phone < 768, tablet 768-1199, desktop >= 1200; phone landscape = landscape and height <= 500. */

@font-face { font-family: Inter; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Noto Sans Devanagari'; src: url(/fonts/noto-sans-devanagari-devanagari-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Noto Sans Devanagari'; src: url(/fonts/noto-sans-devanagari-devanagari-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Noto Sans Devanagari'; src: url(/fonts/noto-sans-devanagari-devanagari-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

:root {
  color-scheme: dark;
  --bg: #0F1012; --bg-deep: #0B0C0D; --panel: #17181B; --raised: #1F2024;
  --line: #2A2C31; --line-strong: #4A4D55;
  --text: #ECEDEF; --text-2: #C9CBD0; --muted: #A3A6AD; --faint: #8A8D94;
  --link: #8DBBFF; --pass: #5BC48F; --pass-bg: #15291F; --info: #8DBBFF;
  --warn: #F0B455; --warn-bg: #1B1913; --warn-line: #6B5428; --fail: #F2766B;
  --track-voice: #23395B; --track-vo: #2C3F2F; --track-music: #2E2A3A; --track-text: #3A3326;
  --font: Inter, 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 8px; --r-lg: 12px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
a:hover { color: #B9D5FF; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
[hidden] { display: none !important; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1:focus { outline: none; }
[lang="hi"] { line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r); background: var(--text); color: var(--bg); }
.skip:focus { top: 8px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); color: var(--text); font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); color: var(--text); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #FFFFFF; color: var(--bg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-icon { width: 40px; padding: 0; }
.btn-round { border-radius: 999px; }
.btn-lg { min-height: 48px; font-size: 15px; }
.btn-quiet { background: transparent; border-color: transparent; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-fill { fill: currentColor; stroke: none; }

.field { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px; }
textarea.field { line-height: 1.6; resize: vertical; }
.field:hover { border-color: var(--line-strong); }
.field[aria-invalid="true"] { border-color: var(--fail); }
.label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.error { margin-top: 6px; font-size: 13px; color: var(--fail); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--line); color: var(--text-2); background: var(--raised); }
.pill-pass { background: var(--pass-bg); color: var(--pass); border-color: transparent; }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill-info { color: var(--info); }

.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: 14px; }
.chip img { width: 28px; height: 28px; border-radius: 999px; object-fit: cover; margin-left: -8px; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: -8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.chip-x:hover { background: var(--line); color: var(--text); }
.chip-add { border-style: dashed; color: var(--text-2); cursor: pointer; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sec { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sec-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* Segmented control built from real radio inputs */
.seg { display: inline-flex; padding: 3px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.seg input:checked + label { background: var(--line); color: var(--text); }
.seg input:focus-visible + label { outline: 2px solid var(--link); outline-offset: 1px; }

/* Choice cards built from real radio inputs */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.choice input:checked + label { border-color: var(--text); background: var(--raised); }
.choice input:focus-visible + label { outline: 2px solid var(--link); outline-offset: 2px; }
.choice b { font-size: 14px; font-weight: 600; }

.check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--text); }

.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > div { height: 100%; background: var(--text-2); }

.toasts { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }

dialog { max-width: min(440px, calc(100% - 32px)); padding: 24px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog .row { justify-content: flex-end; margin-top: 20px; }

/* App shell (home and lists) */
.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; padding: 20px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 16px; font-size: 16px; font-weight: 600; }
.ws { justify-content: flex-start; margin: 0 4px 12px; padding: 0 10px; gap: 10px; }
.ws img { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; background: #FFFFFF; }
.ws span { flex: 1; text-align: left; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--r); color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav:hover { background: var(--raised); color: var(--text); }
.nav[aria-current="page"] { background: var(--raised); color: var(--text); }
.main { min-width: 0; padding: 24px clamp(16px, 4vw, 48px) 48px; display: flex; flex-direction: column; gap: 36px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.topbar .search { flex: 1 1 260px; max-width: 520px; }
.topbar .grow { flex: 1 1 0; }
.mbrand { display: none; }
.tabbar { display: none; }

.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.start { display: flex; flex-direction: column; gap: 10px; padding: 20px; color: var(--text); text-decoration: none; }
a.start:hover { border-color: var(--line-strong); color: var(--text); }
.start-main { border-color: var(--text); }
.start b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.start span { font-size: 14px; color: var(--muted); }
.start-off { opacity: 0.8; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none; }
a.proj:hover { border-color: var(--line-strong); color: var(--text); }
.proj img, .proj .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ph { display: flex; align-items: center; justify-content: center; background: var(--raised); color: var(--faint); font-size: 13px; }
.proj .body { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.proj .body b { font-size: 15px; font-weight: 600; }
.proj .pill { align-self: flex-start; }

.empty { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }

@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(96px + var(--safe-b)) calc(16px + var(--safe-l)); gap: 28px; }
  .mbrand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
  h1 { font-size: 24px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; padding: 6px calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); background: rgba(15, 16, 18, 0.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; min-height: 48px; border-radius: var(--r); color: var(--muted); font-size: 11px; text-decoration: none; }
  .tab[aria-current="page"] { color: var(--text); }
  .tab-new { color: var(--text); }
  .tab-new .ic { width: 28px; height: 28px; padding: 4px; border-radius: 999px; background: var(--text); color: var(--bg); }
  .start-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* Work screens (brief, review, edit) */
.work { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.whead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: calc(12px + var(--safe-t)) calc(clamp(12px, 3vw, 32px) + var(--safe-r)) 12px calc(clamp(12px, 3vw, 32px) + var(--safe-l)); border-bottom: 1px solid var(--line); }
.wtitle { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wtitle small { font-size: 12px; color: var(--muted); }
.wtitle strong { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.steps li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.steps li[aria-current="step"] { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.spend { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.progress { display: none; height: 3px; background: var(--line); }
.progress > div { height: 100%; background: var(--text); }

@media (max-width: 767px) {
  .steps, .whead .spend, .whead .hide-phone { display: none; }
  .whead { flex-wrap: nowrap; gap: 10px; }
  .wtitle { flex: 1 1 0; }
  .progress { display: block; }
}

/* Brief */
.brief { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 48px; }
.brief form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.brief aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.photos { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.photos img { width: 96px; height: 96px; border-radius: var(--r); object-fit: cover; background: #FFFFFF; }
.photos .logo { object-fit: contain; }
.promise { flex: 1 1 220px; display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.promise .ic { color: var(--pass); margin-top: 2px; }
.add-ing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.fields { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; }
.fields .grow { flex: 1 1 260px; }
.fields fieldset { margin: 0; padding: 0; border: 0; }
.fail { color: var(--fail); }
.cost { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.cost span:first-child { color: var(--muted); }
.cost-total { font-size: 15px; font-weight: 600; }
.cost-total span:first-child { color: var(--text); }
.rule { height: 1px; background: var(--line); }
.next { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.mfoot { display: none; }

@media (max-width: 1023px) {
  .brief { grid-template-columns: minmax(0, 1fr); }
  .brief aside { position: static; }
}
@media (max-width: 767px) {
  .brief { padding: 16px calc(16px + var(--safe-r)) calc(150px + var(--safe-b)) calc(16px + var(--safe-l)); gap: 16px; }
  .sec { padding: 16px; }
  .photos img { width: 72px; height: 72px; }
  .brief .go { display: none; }
  .add-ing { grid-template-columns: minmax(0, 1fr); }
  .mfoot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column; gap: 10px; padding: 12px calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l)); background: var(--panel); border-top: 1px solid var(--line); }
  .mfoot.row { flex-direction: row; flex-wrap: nowrap; }
  .mfoot.row .btn { flex: 1; min-height: 48px; }
}

/* Review */
.review { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; grid-template-areas: "list stage detail"; }
.shots { grid-area: list; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line); overflow: auto; }
.shots-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 8px 8px; }
.shot { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: transparent; text-align: left; cursor: pointer; }
.shot:hover { background: var(--panel); }
.shot[aria-current="true"] { background: var(--raised); border-color: var(--line-strong); }
.shot img { width: 44px; height: 78px; border-radius: 6px; object-fit: cover; background: var(--raised); }
.shot .meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shot .line { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot { display: none; position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 999px; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--bg); }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; }
.s-approved { color: var(--pass); }
.s-passed { color: var(--info); }
.s-face, .s-attention { color: var(--warn); }
.dot.s-approved { background: var(--pass); color: var(--bg); }
.dot.s-passed { background: var(--info); color: var(--bg); }
.dot.s-face, .dot.s-attention { background: var(--warn); color: var(--bg); }

.stage { grid-area: stage; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px clamp(12px, 3vw, 32px); background: var(--bg-deep); }
.screen { position: relative; height: min(68vh, 640px); height: min(68dvh, 640px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 10px; overflow: hidden; background: #000000; }
.screen video { width: 100%; height: 100%; object-fit: cover; }
.bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 999px; border: 0; background: rgba(15, 16, 18, 0.72); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.say { max-width: 520px; text-align: center; font-size: 16px; color: var(--text-2); }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.bar { display: flex; gap: 3px; width: 100%; max-width: 640px; height: 10px; }
.bar button { min-width: 6px; height: 100%; padding: 0; border: 0; border-radius: 3px; cursor: pointer; }
.bar .s-approved { background: #3E6B54; }
.bar .s-passed { background: #3A5A85; }
.bar .s-face, .bar .s-attention { background: var(--warn); }
.bar [aria-current="true"] { outline: 2px solid var(--text); outline-offset: 2px; }

.detail { grid-area: detail; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 20px; border-left: 1px solid var(--line); }
.detail .said { font-size: 17px; }
.checks { display: flex; flex-direction: column; gap: 12px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.chk .mark { width: 16px; flex: none; font-weight: 700; text-align: center; }
.chk small { display: block; font-size: 13px; color: var(--muted); }
.faces { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); }
.faces .pair { display: flex; gap: 10px; }
.faces figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.faces img { width: 84px; height: 112px; border-radius: 6px; object-fit: cover; }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.actions .btn-primary { min-height: 48px; }

@media (max-width: 1199px) {
  .review { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "stage detail" "list detail"; }
  .shots { align-self: start; flex-direction: row; gap: 6px; padding: 10px 12px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .shots-head, .shot .meta { display: none; }
  .shot { width: auto; flex: none; grid-template-columns: 44px; padding: 3px; }
  .shot img { height: 64px; }
  .shot .dot { display: flex; right: 5px; bottom: 5px; }
}
@media (max-width: 767px) {
  .review { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "list" "detail"; }
  .stage { padding: 8px 12px 12px; gap: 10px; }
  .screen { height: 42vh; height: 42dvh; }
  .say { display: none; }
  .bar { display: none; }
  .detail { border-left: 0; gap: 14px; padding: 14px calc(16px + var(--safe-r)) calc(100px + var(--safe-b)) calc(16px + var(--safe-l)); }
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: row; padding: 12px calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l)); background: var(--panel); border-top: 1px solid var(--line); }
  .actions .btn { flex: 1; min-height: 48px; }
  .actions .btn-primary { flex: 1.4; }
  .actions .more, .actions .note { display: none; }
  .faces img { width: 56px; height: 74px; }
}
/* Phone held sideways: video on the left, everything else beside it, nothing fixed over the picture. */
@media (orientation: landscape) and (max-height: 500px) {
  .work-fit { height: 100vh; height: 100dvh; }
  .review { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "stage list" "stage detail"; }
  .stage { padding: 8px 8px 8px calc(12px + var(--safe-l)); justify-content: flex-start; }
  .screen { height: calc(100vh - 128px); height: calc(100dvh - 128px); }
  .detail { overflow-y: auto; }
  .say, .bar { display: none; }
  .shots { border-top: 0; padding: 8px 12px; }
  .detail { border-left: 0; padding: 4px calc(16px + var(--safe-r)) 16px 16px; gap: 12px; }
  .actions { position: static; flex-direction: row; padding: 0; background: none; border: 0; margin-top: 0; }
  .actions .more, .actions .note { display: none; }
  .actions .btn { flex: 1; min-height: 44px; }
  .faces { flex-direction: row; align-items: center; }
  .faces img { width: 44px; height: 58px; }
  .whead { flex-wrap: nowrap; padding-top: 8px; padding-bottom: 8px; }
  .whead .steps, .whead .spend, .whead .pill, .whead .hide-phone { display: none; }
  .shots { scrollbar-width: thin; }
}

/* Review and edit fill the window on tablets and desktops (panels scroll inside); phones scroll the page. */
@media (min-width: 768px) and (min-height: 600px) {
  .work-fit { height: 100vh; height: 100dvh; }
  .work-fit .detail, .work-fit .shots { overflow-y: auto; }
}

/* Editor */
.editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "script stage inspect" "tl tl tl"; }
.ask .row .field { flex: 1 1 160px; width: auto; }
.inspect { overflow-y: auto; }
.script { grid-area: script; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.script-head { padding: 14px 16px 6px; }
.script ol { flex: 1; margin: 0; padding: 4px 8px; list-style: none; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.lineb { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px; border-radius: var(--r); border: 1px solid transparent; background: transparent; text-align: left; cursor: pointer; }
.lineb:hover { background: var(--panel); }
.lineb[aria-current="true"] { background: var(--raised); border-color: var(--line-strong); }
.lineb span:last-child { font-size: 15px; }
.ask { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ask .row .btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
.editor .stage { padding: 16px; justify-content: center; }
.editor .screen { height: min(52vh, 480px); height: min(52dvh, 480px); }
.inspect { grid-area: inspect; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px; border-left: 1px solid var(--line); }
.inspect .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tl { grid-area: tl; min-width: 0; overflow-x: auto; padding: 10px clamp(12px, 2vw, 24px) calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.tl-inner { position: relative; min-width: 720px; display: flex; flex-direction: column; gap: 6px; }
.ruler { display: flex; justify-content: space-between; margin-left: 80px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.track { display: flex; gap: 8px; }
.track .lab { width: 72px; flex: none; display: flex; align-items: center; font-size: 12px; color: var(--muted); }
.lanes { flex: 1; min-width: 0; display: flex; gap: 2px; }
.lanes > * { min-width: 0; border-radius: 5px; overflow: hidden; }
.t-pic { height: 56px; }
.t-pic button { padding: 0; border: 0; background: var(--raised); cursor: pointer; }
.t-pic button[aria-current="true"] { outline: 2px solid var(--text); outline-offset: -2px; }
.t-pic img { width: 100%; height: 56px; object-fit: cover; }
.t-voice { height: 26px; }
.t-music, .t-text { height: 22px; }
.v-on { background: var(--track-voice); }
.v-vo { background: var(--track-vo); }
.m-on { background: var(--track-music); }
.x-on { background: var(--track-text); color: #E3D3B5; font-size: 11px; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; }
.playhead { position: absolute; top: 18px; bottom: -4px; width: 2px; margin-left: 80px; background: var(--text); border-radius: 2px; pointer-events: none; }

@media (max-width: 1199px) {
  .editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "stage script" "inspect inspect" "tl tl"; }
  .script { border-right: 0; border-left: 1px solid var(--line); }
  .inspect { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
  .inspect h2, .inspect .note { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .editor { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "stage" "tl" "script" "inspect"; }
  .editor .screen { height: 40vh; height: 40dvh; }
  .script { border-left: 0; border-top: 1px solid var(--line); }
  .script ol { overflow: visible; }
  .inspect { padding-bottom: calc(24px + var(--safe-b)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .editor { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "stage script" "tl tl" "inspect inspect"; }
  .editor .screen { height: calc(100dvh - 140px); }
}

/* The way in: sign in and join */
.door { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); }
.door-card { width: 100%; max-width: 420px; }
.door-brand { padding: 0; }
.door-note { padding: 14px; }
.door h1 { font-size: 24px; }

/* Film from footage */
.film-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.film-narrow { max-width: 640px; }
.film-add { align-self: flex-start; }
.film-files { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.film-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.film-file { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.film-file b { font-size: 14px; font-weight: 500; }
.film-player { width: 100%; max-height: 62vh; max-height: 62dvh; border-radius: 10px; background: #000000; }
.film-empty { aspect-ratio: 16 / 9; border-radius: 10px; }
.film-more summary { cursor: pointer; color: var(--text-2); min-height: 28px; }
.film-more .row { margin-top: 8px; gap: 4px 14px; }
.brief > aside { min-width: 0; }
.nav-tell { width: 100%; margin-top: auto; border: 0; background: transparent; cursor: pointer; font: inherit; text-align: left; }
.tab-btn { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
@media (max-width: 767px) { .tab-btn { display: flex; } }
@media (max-width: 480px) { .film-two { grid-template-columns: minmax(0, 1fr); } }

/* People & data */
.data-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.data-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; }
.data-stat b { font-size: 22px; font-weight: 600; }
.data-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.data-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data th { text-align: left; font-weight: 500; color: var(--muted); white-space: nowrap; }
.data th, .data td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data-link { overflow-wrap: anywhere; font-size: 13px; color: var(--text); }
.data-pre { margin: 6px 0 0; max-width: 560px; max-height: 280px; overflow: auto; font-size: 12px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.door-seg { display: flex; }
.door-seg label { flex: 1; justify-content: center; }
.door-more summary { cursor: pointer; min-height: 28px; }
.door-more p { margin: 8px 0 0; }
