/* 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. */

/* IBM Plex Sans with IBM Plex Sans Devanagari, designed together (SIL Open Font License, web/fonts). Owner, 9 Nov 2026. */
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Devanagari'; src: url(/fonts/ibm-plex-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: 'IBM Plex Sans Devanagari'; src: url(/fonts/ibm-plex-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: 'IBM Plex Sans Devanagari'; src: url(/fonts/ibm-plex-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: 'IBM Plex Sans', 'IBM Plex Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* the type scale (9 Nov 2026): seven sizes, each with one job; typed-in text stays 16 px so phones do not zoom */
  --t-title: 22px; --t-section: 17px; --t-card: 15px; --t-body: 14px; --t-meta: 13px; --t-label: 12px; --t-over: 11px; --t-input: 16px;
  --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 var(--t-body)/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: var(--t-title); letter-spacing: -0.02em; }
h2 { font-size: var(--t-card); }
h3 { font-size: var(--t-body); }
p { margin: 0; }
@media (min-width: 1200px) { :root { --t-title: 26px; } }
/* Typed text matches the body text (14px) with a mouse. A touch screen keeps 16px, because iPhones zoom the whole page
   into a field set smaller than that; headings stay above it (17px), so the words in a box never outrank them. */
:root { --t-input: 14px; }
@media (max-width: 767px), (hover: none) and (pointer: coarse) { :root { --t-input: 16px; } }
[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); }
div.boot { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.boot-mark { color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: var(--t-meta); }
.tiny { font-size: var(--t-label); }
.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: var(--t-body); 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: var(--t-body); }
.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: var(--t-input); }
textarea.field { display: block; max-width: 100%; min-height: 88px; max-height: min(50vh, 360px); line-height: 1.6; resize: vertical; overflow-y: auto; }
.field:hover { border-color: var(--line-strong); }
.field:focus { outline: 2px solid var(--link); outline-offset: 1px; border-color: var(--line-strong); }
.field:disabled { opacity: .5; cursor: not-allowed; }

/* Every slider: a thin track, the filled part in white up to the thumb (--fill is set by app.js), a round thumb. */
input[type=range] { --fill: 50%; -webkit-appearance: none; appearance: none; width: 100%; min-height: 44px; margin: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--text) 0 var(--fill), var(--line-strong) var(--fill) 100%); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-strong); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line-strong); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--text); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-strong); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--link); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--link); }
input[type=range]:disabled { opacity: .45; cursor: not-allowed; }
.field[aria-invalid="true"] { border-color: var(--fail); }
.label { display: block; margin-bottom: 6px; font-size: var(--t-meta); color: var(--muted); }
.error { margin-top: 6px; font-size: var(--t-meta); color: var(--fail); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: var(--t-label); 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: var(--t-body); }
.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: var(--t-body); 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: var(--t-body); font-weight: 600; }

.check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: var(--t-body); 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%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 32px)); pointer-events: none; }  /* at the top: the main button of every screen lives at the bottom */
.toast-act { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 16px; pointer-events: auto; }
.toast-btn { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--bg); font-size: var(--t-body); font-weight: 600; text-decoration: underline; cursor: pointer; }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: var(--t-body); 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; }

/* One box: home, the film's own page, and the frame around plain screens */
.of-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.of-fill { height: 100vh; height: 100dvh; }
.of-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + var(--safe-t)) calc(clamp(16px, 3vw, 32px) + var(--safe-r)) 8px calc(clamp(16px, 3vw, 32px) + var(--safe-l)); }
.of-brand { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--t-body); font-weight: 500; color: var(--text); text-decoration: none; }
.of-brand:hover { color: var(--text); }
.of-me { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--raised); color: var(--text); font-size: var(--t-meta); font-weight: 500; text-decoration: none; }
.of-me:hover { color: var(--text); background: var(--line); }
.of-backbtn { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin-left: -10px; color: var(--text); }
.of-backbtn:hover { color: var(--text); }
.of-title { flex: 1; min-width: 0; font-size: var(--t-body); font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-main { flex: 1; min-width: 0; min-height: 0; width: 100%; padding: 8px calc(clamp(16px, 3vw, 32px) + var(--safe-r)) 32px calc(clamp(16px, 3vw, 32px) + var(--safe-l)); display: flex; flex-direction: column; gap: 24px; }
.of-first { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding-bottom: 12vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.of-first h1 { font-size: clamp(22px, 3vw, 26px); line-height: 1.15; }
.of-back { display: flex; flex-direction: column; align-items: center; gap: clamp(22px, 5vh, 48px); padding-top: clamp(0px, 4vh, 48px); }
.of-back .of-box { width: 100%; max-width: 720px; }
.of-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.of-box:focus-within, .of-box-on { border-color: var(--line-strong); }
.of-box-head { font-size: var(--t-section); font-weight: 600; letter-spacing: -0.01em; }
.of-say { width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font-size: max(var(--t-input), var(--t-card)); line-height: 1.45; }
.of-say::placeholder { color: var(--faint); }
.of-add { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--t-body); color: var(--text-2); cursor: pointer; }
.of-add:hover { color: var(--text); }
.of-go { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); cursor: pointer; }
.of-examples { display: flex; flex-direction: column; gap: 8px; }
.of-eg { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: var(--t-body); text-align: left; cursor: pointer; }
.of-eg:hover { border-color: var(--line-strong); color: var(--text); }
.of-films { width: 100%; max-width: 1080px; display: flex; flex-direction: column; gap: 14px; }
.of-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; }
.of-film { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--text); text-decoration: none; }
.of-film:hover { color: var(--text); }
.of-film:hover .of-pic { outline: 1px solid var(--line-strong); }
.of-card { position: relative; min-width: 0; }
.of-card-more { isolation: isolate; position: absolute; top: 4px; right: 4px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
.of-card-more::before { content: ""; position: absolute; inset: 8px; z-index: -1; border-radius: 999px; background: rgba(15, 16, 18, 0.72); }
.of-sent { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); }
.of-sent h2 { font-size: var(--t-card); }
.of-sent ul { margin: 0; padding-left: 18px; font-size: var(--t-body); line-height: 1.5; }
.of-pic { width: 100%; aspect-ratio: 9 / 14; border-radius: 12px; background: var(--raised); object-fit: cover; }
.of-pic-none { display: flex; align-items: center; justify-content: center; padding: 12px; font-size: var(--t-meta); color: var(--muted); text-align: center; overflow: hidden; }
.of-name { font-size: var(--t-body); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-status { font-size: var(--t-meta); color: var(--muted); }
.of-warn { color: var(--warn); }
.of-compose { max-width: 720px; margin: 0 auto; gap: 14px; overflow-y: auto; }
.of-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.of-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: var(--t-body); color: var(--text); cursor: pointer; }
.of-chip:hover { border-color: var(--line-strong); }
.of-files { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.of-files:empty { display: none; }
.of-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-top: 1px solid var(--line); }
.of-file { min-width: 0; font-size: var(--t-body); overflow-wrap: anywhere; }
/* The main button of a screen stays in view on any window, however short: what scrolls goes behind it. */
.of-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 720px; margin: 0 auto; padding: 12px calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); background: var(--bg); }
.of-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.of-foot p:empty { display: none; }
.of-foot-in { display: flex; flex-direction: column; gap: 8px; }
.of-foot-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.of-wide { width: 100%; min-height: 52px; font-size: var(--t-body); border-radius: 12px; }
.of-grow { min-height: 52px; font-size: var(--t-body); border-radius: 12px; }
.of-center { text-align: center; }
.of-off { margin-top: 16px; font-size: var(--t-title); line-height: 1.25; }
.of-off-note { gap: 8px; }
.of-said { color: var(--text-2); font-size: var(--t-card); }
.of-refused { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); }
.of-film-main { max-width: 720px; margin: 0 auto; gap: 14px; overflow-y: auto; }
.of-logline { margin-bottom: 8px; font-size: var(--t-card); line-height: 1.45; color: var(--text-2); }
.of-beats { display: flex; flex-direction: column; }
.of-beat { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.of-beat-t { font-size: var(--t-meta); color: var(--muted); }
.of-link { display: flex; align-items: center; min-height: 48px; font-size: var(--t-body); text-decoration: none; }
.of-player-wrap { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; }
.of-player { max-width: 100%; max-height: min(62vh, 640px); max-height: min(62dvh, 640px); width: auto; height: auto; min-width: 180px; border-radius: 14px; background: var(--raised); object-fit: contain; }
video.of-player { background: #000000; }
.of-tight { gap: 8px; }
.of-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.of-th { position: relative; flex: 0 0 56px; height: 84px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; color: var(--text-2); font-size: var(--t-label); text-decoration: none; }
.of-th img { width: 100%; height: 100%; object-fit: cover; }
.of-th span { position: absolute; left: 4px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: rgba(15, 16, 18, 0.72); }
.of-th-kept { border-color: var(--pass); }
.of-th-stale { border-color: var(--warn); }
.of-checks summary { color: var(--warn); }
.of-checks ul { margin: 6px 0 0; padding-left: 18px; }
dialog.of-sheet { width: 100%; max-width: 480px; margin: auto auto 0; padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--panel); }
.of-sheet-in { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px calc(24px + var(--safe-b)); max-height: 80vh; max-height: 80dvh; overflow-y: auto; }
.of-sheet h2 { font-size: var(--t-section); }
.of-rows { display: flex; flex-direction: column; }
.of-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 4px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font-size: var(--t-card); text-align: left; text-decoration: none; cursor: pointer; }
.of-row:hover { color: var(--text); background: var(--raised); }
.of-row-two { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; min-width: 0; }  /* a choice with its one-line meaning (looks) */
.of-attach-note { display: flex; flex-direction: column; gap: 6px; }
.of-attach-note:empty { display: none; }
.of-attach-note p { margin: 0; }
.of-more { padding-top: 10px; }
.of-more.row .field { flex: 1 1 100px; width: auto; }
.of-more.row .label { flex: 1 1 100%; margin: 0; }
@media (min-width: 768px) {
  dialog.of-sheet { margin: auto; border: 1px solid var(--line); border-radius: 16px; }
  .of-fill.of-page { height: auto; min-height: 100vh; min-height: 100dvh; }
  .of-player { max-height: 54vh; max-height: 54dvh; }
  .of-foot .of-foot-row, .of-foot .of-wide { max-width: 420px; width: 100%; margin: 0 auto; }
}
@media (max-width: 767px) {
  .of-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .of-main { padding-bottom: 16px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .of-fill { height: auto; min-height: 100dvh; }
  .of-first { padding-bottom: 8px; }
  .of-player { max-height: 56dvh; }
  .of-top { padding-top: calc(2px + var(--safe-t)); padding-bottom: 2px; }
  .of-main { gap: 12px; padding-bottom: 12px; }
  /* One row, never two: on a short window the bar must not take the screen. */
  .of-foot, .of-foot-in { flex-direction: row; align-items: center; }
  .of-foot { max-width: none; padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .of-foot > *, .of-foot-in > * { flex: 1 1 0; min-width: 0; }
  .of-foot-in, .of-foot-row { width: 100%; }
  .of-foot .of-center { flex: 0 1 28%; text-align: left; line-height: 1.25; }
  .of-foot .of-wide, .of-foot .of-grow { min-height: 44px; padding: 0 8px; font-size: var(--t-body); line-height: 1.2; white-space: normal; }
  /* The way in: the fields side by side, so the button shows above the fold. */
  .door { padding-top: 8px; padding-bottom: 8px; }
  .door-card { max-width: 640px; gap: 8px; padding: 12px 16px; }
  .door-card .stack { gap: 8px; }
  #door { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; align-items: end; }
  #door .error { grid-column: 1 / -1; }
  #go { min-height: 44px; }
  #again-part[hidden] + #go { grid-column: 1 / -1; }
}

/* The editor */
.studio { width: 100%; max-width: 100vw; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
.studio > * { min-width: 0; max-width: 100%; }
.st-left, .st-panel, .st-stage, .st-inspect { width: 100%; }
.st-panel > *, .st-inspect > * { min-width: 0; max-width: 100%; }
.st-field .field { min-width: 0; width: 100%; }
.st-head { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) 4px calc(12px + var(--safe-l)); }
.st-head .of-backbtn { margin-left: 0; }
.st-title { flex: 1; min-width: 0; font-size: var(--t-section); font-weight: 600; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-saved { flex: none; font-size: var(--t-meta); color: var(--muted); }
.st-undo { display: flex; gap: 4px; }
.st-tabs { display: flex; justify-content: space-between; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.st-tab { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: var(--t-body); white-space: nowrap; cursor: pointer; }
.st-tab[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--text); }
.st-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px calc(16px + var(--safe-r)) 12px calc(16px + var(--safe-l)); }
.st-line { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.st-on { border-color: var(--line-strong); }
.st-who { font-size: var(--t-meta); color: var(--muted); }
.st-strong { font-size: var(--t-body); font-weight: 600; }
.st-note { font-size: var(--t-meta); color: var(--warn); }
.st-acts { display: flex; gap: 8px; }  /* Keep, Redo, Remove and the two arrows stay on one line */
.st-acts .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 8px; }
.st-acts .btn-icon { flex: 0 0 44px; width: 44px; padding: 0; }
.st-wide { display: flex; width: 100%; min-height: 44px; margin-top: 8px; justify-content: center; }  /* the still, on its own row under the actions */
.st-kept { background: var(--pass-bg); border-color: var(--pass-bg); color: var(--pass); }
.st-kept:hover { color: var(--pass); }
.st-addbtn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; border: 1px dashed var(--line); border-radius: 12px; background: transparent; color: var(--text-2); font-size: var(--t-body); cursor: pointer; }
.st-addbtn:hover { border-color: var(--line-strong); color: var(--text); }
.st-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: var(--t-meta); color: var(--muted); }
.st-field .field, .st-inspect .field { font-size: var(--t-input); }
.st-two .st-take { grid-column: 1 / -1; margin: -4px 0 0; }
.st-field legend { margin-bottom: 6px; }
.st-retry { align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--fail); font-size: var(--t-meta); text-align: left; text-decoration: underline; cursor: pointer; }
.st-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-row { display: flex; align-items: flex-end; gap: 8px; }
.st-grow { flex: 1; min-width: 0; font-size: var(--t-body); color: var(--text); overflow-wrap: anywhere; }
.st-short { width: 76px; flex: none; }
/* Words on screen: the words take a whole line, with when and how below them */
.st-field > .st-row { flex-wrap: wrap; align-items: center; }
.st-field > .st-row > .field.st-grow { flex: 1 1 100%; width: 100%; }
.st-field > .st-row > .field.st-short { flex: 0 0 96px; width: 96px; }
.st-row .st-field { width: 76px; flex: none; }
.st-range { width: 100%; min-height: 44px; accent-color: var(--text); }
.st-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.st-faces { display: flex; gap: 8px; overflow-x: auto; }
.st-faces figure { flex: 0 0 96px; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-label); color: var(--muted); }
.st-faces img { width: 96px; aspect-ratio: 3 / 4; border-radius: 8px; object-fit: cover; }
.st-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.st-look { position: relative; display: flex; align-items: flex-end; min-height: 112px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font-size: var(--t-label); text-align: left; text-transform: capitalize; overflow: hidden; cursor: pointer; }
.st-look img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-look span { position: relative; width: 100%; padding: 4px 8px; background: rgba(15, 16, 18, 0.78); }
.st-looks-plain .st-look { min-height: 44px; }
.st-looks-plain .st-look span { background: transparent; }
.st-look[aria-current="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.st-strip-row { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-strip { display: flex; gap: 8px; min-width: 0; overflow-x: auto; padding: 2px; }
/* A shot with no picture yet: a dashed outline with its number in the middle, or Aa for words on screen. */
.st-more { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: var(--t-body); color: var(--text); }
.st-more-in { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.st-frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-frames:empty { display: none; }
.st-frames figure { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-label); color: var(--muted); }
.st-frames img { width: 100%; max-height: 180px; border-radius: 8px; object-fit: contain; background: #000000; }
.st-pick-tall { width: auto !important; height: 30vh; height: 30dvh; }
.st-pick { position: relative; display: block; width: 100%; flex: none; align-self: center; margin: 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #000000; overflow: hidden; cursor: crosshair; }
.st-pick img { width: 100%; height: 100%; object-fit: cover; }
.st-pick-mark { position: absolute; transform: translate(-50%, -50%); border: 2px solid var(--text); border-radius: 999px; box-shadow: 0 0 0 1px #000000; pointer-events: none; }
.st-mask { align-items: center; }
.of-second .of-row { font-size: var(--t-body); }
.th-none { display: flex; align-items: center; justify-content: center; border-style: dashed; }
.th-none b { font-size: var(--t-section); font-weight: 500; color: var(--text-2); }
.th-none > span:only-child { position: static; background: transparent; font-size: var(--t-body); }
.st-th { position: relative; flex: 0 0 52px; height: 78px; padding: 0; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; color: var(--text-2); font-size: var(--t-label); cursor: pointer; }
.st-th img { width: 100%; height: 100%; object-fit: cover; }
.st-th span { position: absolute; left: 3px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: rgba(15, 16, 18, 0.72); }
.st-th[aria-current="true"] { border-color: var(--text); }
.st-th-kept { border-color: var(--pass); }
.st-th-stale { border-color: var(--warn); }
.st-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 16px 12px; }
.st-screen { max-width: 100%; max-height: 42vh; max-height: 42dvh; width: auto; height: auto; min-width: 150px; border-radius: 12px; background: #000000; object-fit: cover; }
.st-none { display: flex; align-items: center; justify-content: center; height: 200px; background: var(--raised); color: var(--muted); font-size: var(--t-meta); }
.st-colour-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-colour { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); cursor: pointer; }
.st-card { padding: 16px; text-align: center; font-weight: 600; font-size: var(--t-card); overflow-wrap: anywhere; }
.st-transport { display: flex; align-items: center; gap: 10px; }
.st-preview-note { margin: 0; font-size: var(--t-label); color: var(--muted); text-align: center; }
.st-preview-note:empty { display: none; }
.st-inspect { display: flex; flex-direction: column; gap: 12px; padding: 4px calc(16px + var(--safe-r)) 16px calc(16px + var(--safe-l)); }
.st-inspect h2, .st-panel h2 { margin: 0; font-size: var(--t-section); font-weight: 600; }
.of-clip-name { overflow-wrap: anywhere; }
.st-tl { display: none; }
/* The editor agent's box: one message, sent once. At the top on a phone, at the top of the left column wider. */
.st-post { display: flex; flex-direction: column; gap: 8px; margin: 4px 16px 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.st-post-lab { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-card); font-weight: 600; color: var(--text); }
.st-post-lab .small { font-weight: 400; line-height: 1.35; }
.st-post textarea.field { min-height: 64px; max-height: min(30vh, 200px); }
.st-post-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-post-row .small { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.st-post-row .btn { flex: none; }
.st-post-tx { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.st-post-report { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.st-post-note summary { cursor: pointer; font-size: var(--t-meta); line-height: 1.45; }
.st-post-body { margin-top: 6px; max-height: min(45vh, 360px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; font-size: var(--t-meta); line-height: 1.5; color: var(--text-2); }
.st-post-body p, .st-post-body ul { margin: 0 0 6px; }
.st-post-body ul { padding-left: 18px; }
.st-post-body li + li { margin-top: 3px; }
.st-post-body b { color: var(--text); font-weight: 600; }
.st-post-asked { margin: 0; line-height: 1.45; }
.st-post-unwatched { display: flex; gap: 6px; align-items: flex-start; margin: 0; line-height: 1.45; color: var(--warn); }
.st-post-unwatched svg { flex: none; margin-top: 3px; }
.st-post-price { display: flex; flex-direction: column; gap: 6px; }
.st-post-price summary { cursor: pointer; font-size: var(--t-meta); color: var(--muted); }
.st-post-price[open] > * + * { margin-top: 6px; }
.st-post-price p { margin: 0; line-height: 1.4; }
.st-post-row .st-post-most { flex: 0 1 140px; min-width: 0; }
.st-post-rounds summary { cursor: pointer; font-size: var(--t-meta); color: var(--muted); }
.st-post-rounds ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.st-post-rounds li p { margin: 0; line-height: 1.45; }
.st-spin { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--text); animation: st-spin 0.9s linear infinite; }
@keyframes st-spin { to { transform: rotate(360deg); } }
.st-locked .st-panel, .st-locked .st-inspect, .st-locked .st-tl, .st-locked .st-foot, .st-locked .st-undo, .st-locked .st-tabs { opacity: 0.45; }
.st-bar { display: contents; }
.st-bottom { order: 10; position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: 10px calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l)); border-top: 1px solid var(--line); background: var(--bg); }
.st-foot { display: flex; flex-direction: column; gap: 6px; }
.st-foot .btn { width: 100%; }
/* A phone shows one tab at a time, and the picture and shot settings belong to Shots. */
@media (max-width: 767px) {
  .studio:not([data-tab="shots"]) .st-stage, .studio:not([data-tab="shots"]) .st-inspect { display: none; }
  .st-head { gap: 4px; }
  .st-saved { font-size: var(--t-label); }
  .st-undo { gap: 0; }
  .st-undo .btn { min-height: 44px; width: 40px; background: transparent; border-color: transparent; }
  .st-undo .btn:disabled { opacity: 0.35; }
  /* Shots: the picture first and smaller, then the shots beside the add button, so the controls of the shot show without scrolling. */
  .st-left { display: contents; }
  .st-tabs { order: 1; max-width: 100%; flex: none; }
  .st-stage { order: 2; padding-top: 10px; }
  .st-panel { order: 3; width: 100%; max-width: 100%; }
  .st-inspect { order: 4; }
  .st-screen { max-height: 30vh; max-height: 30dvh; }
  .st-strip-row { flex-direction: row; align-items: stretch; }
  .st-strip { flex: 1 1 0; scrollbar-width: none; }
  .st-strip-row .st-addbtn { flex: none; width: 84px; padding: 0 8px; }
  .st-foot { flex-direction: row; align-items: center; gap: 12px; }
  .st-foot .btn { flex: 1 1 0; width: auto; min-width: 0; }
  .st-foot .of-center { flex: 0 1 36%; text-align: left; line-height: 1.25; }
}
@media (max-width: 767px) and (max-height: 700px) {
  .st-screen { max-height: 26vh; max-height: 26dvh; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .st-screen { max-height: 50dvh; }
  .st-head { padding-top: calc(2px + var(--safe-t)); padding-bottom: 0; }
  .st-bottom { padding-top: 6px; padding-bottom: calc(6px + var(--safe-b)); }
  .st-foot { flex-direction: row; align-items: center; }
  .st-foot > * { flex: 1 1 0; min-width: 0; }
  .st-foot .of-center { flex: 0 1 34%; text-align: left; line-height: 1.25; }
  .st-foot .of-grow { min-height: 44px; }
}
/* Tablet and desktop: everything at once. */
@media (min-width: 768px) {
  .studio { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.4fr) minmax(260px, 0.9fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "head head head" "left stage inspect" "tl tl tl"; }
  .st-bar { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; padding: 8px clamp(12px, 2vw, 24px); border-bottom: 1px solid var(--line); }
  .st-head { flex: 1 1 320px; min-width: 0; gap: 12px; padding: 0; }
  .st-title { flex: 1 1 160px; }
  .st-left { grid-area: left; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); }
  .st-tabs { justify-content: flex-start; gap: 2px; flex: none; }
  /* A long report scrolls inside the box, which never takes more than most of the column or paints over the timeline. */
  .st-post { flex: 0 1 auto; min-height: 0; max-height: 72%; overflow-y: auto; overscroll-behavior: contain; margin: 10px; }
  .st-post > * { flex: none; }
  .st-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; }
  .st-stage { grid-area: stage; min-height: 0; justify-content: center; padding: 16px; background: var(--bg-deep); }
  .st-screen { max-height: calc(100% - 84px); min-height: 0; flex: 0 1 auto; }
  .st-inspect { grid-area: inspect; min-height: 0; overflow-y: auto; padding: 16px; border-left: 1px solid var(--line); }
  .st-bottom { position: static; order: 0; margin: 0; padding: 0; border: 0; background: transparent; }
  .st-foot { flex-direction: row; align-items: center; gap: 10px; }
  .st-foot .btn { width: auto; min-height: 36px; padding: 0 14px; font-size: var(--t-body); border-radius: var(--r); }
  .st-tl { grid-area: tl; display: block; min-width: 0; overflow-x: auto; padding: 8px clamp(12px, 2vw, 24px) 12px; border-top: 1px solid var(--line); }
  .st-tl-in { min-width: 640px; display: flex; flex-direction: column; gap: 5px; }
  .st-ruler { position: relative; height: 1.4em; margin-left: 80px; font-size: var(--t-label); color: var(--muted); font-variant-numeric: tabular-nums; }
  .st-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
  .st-tick::before { content: ""; position: absolute; left: 50%; bottom: -3px; width: 1px; height: 3px; background: var(--line); }
  .st-tick-0 { transform: none; }
  .st-tick-0::before { left: 0; }
  .st-tick-end { transform: translateX(-100%); }
  .st-tick-end::before { left: auto; right: 0; }
  .st-track { display: flex; gap: 8px; }
  .st-lab { width: 72px; flex: none; display: flex; align-items: center; font-size: var(--t-label); color: var(--muted); }
  .st-lanes { flex: 1; min-width: 0; display: flex; gap: 2px; }
  .st-t-pic .st-lanes { height: 44px; }
  .st-t-low .st-lanes { height: 22px; }
  .st-clip { flex-basis: 0; min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 5px; background: var(--raised); color: var(--text-2); font-size: var(--t-label); overflow: hidden; cursor: pointer; }
  .st-clip img { width: 100%; height: 100%; object-fit: cover; }
  .st-clip[aria-current="true"] { outline: 2px solid var(--text); outline-offset: -2px; }
  .st-seg { flex-basis: 0; min-width: 0; display: flex; align-items: center; padding: 0 6px; border-radius: 5px; font-size: var(--t-label); color: #E3E4E7; white-space: nowrap; overflow: hidden; }
  .st-gap { flex-basis: 0; min-width: 0; }
  .f-on { background: #3A2E26; }
  .m-on { background: var(--track-music); }
  .v-on { background: var(--track-voice); }
  .x-on { background: var(--track-text); }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.8fr) auto; grid-template-areas: "head head" "left stage" "left inspect" "tl tl"; }
  .st-inspect { border-left: 0; border-top: 1px solid var(--line); }
}
/* A short window (a phone or small tablet held sideways): the panels scroll together as a page. */
@media (min-width: 768px) and (max-height: 600px) {
  .studio { height: auto; min-height: 100dvh; display: flex; }
  .st-panel, .st-inspect { overflow: visible; }
  .st-bar { display: contents; }
  .st-head { padding: 8px 16px; flex: none; }
  .st-bottom { order: 10; position: sticky; bottom: 0; margin: auto 0 0; padding: 8px 16px; background: var(--bg); border-top: 1px solid var(--line); }
  .st-screen { max-height: 70dvh; }
  .st-tl { display: none; }
}

/* 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: var(--t-card); font-weight: 500; }
.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: var(--t-meta); 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: var(--t-body); }
.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: var(--t-card); font-weight: 600; }
.start span { font-size: var(--t-body); 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: var(--t-meta); }
.proj .body { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.proj .body b { font-size: var(--t-body); 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: var(--t-title); }
  .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: var(--t-over); 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: var(--t-label); color: var(--muted); }
.wtitle strong { font-size: var(--t-card); 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: var(--t-meta); }
.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: var(--t-meta); 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: var(--t-body); }
.cost span:first-child { color: var(--muted); }
.cost-total { font-size: var(--t-body); 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: var(--t-body); 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: var(--t-body); 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: var(--t-over); font-weight: 700; color: var(--bg); }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-label); 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: var(--t-input); 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: var(--t-section); }
.checks { display: flex; flex-direction: column; gap: 12px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-body); }
.chk .mark { width: 16px; flex: none; font-weight: 700; text-align: center; }
.chk small { display: block; font-size: var(--t-meta); 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: var(--t-label); 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: var(--t-body); }
.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: var(--t-label); }
.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: var(--t-label); 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: var(--t-label); 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: var(--t-label); 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: var(--t-title); }

/* 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: var(--t-body); 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 { color: var(--text-2); }
.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: var(--t-meta); }
.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: var(--t-meta); color: var(--text); }
.data-pre { margin: 6px 0 0; max-width: 560px; max-height: 280px; overflow: auto; font-size: var(--t-label); 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 p { margin: 8px 0 0; }
.data-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.data-fact { display: flex; flex-direction: column; gap: 2px; }
.data-fact b { font-size: var(--t-body); font-weight: 500; }
.data-list { margin: 0; padding-left: 18px; }
.plan-beat { padding: 10px 0; border-top: 1px solid var(--line); gap: 4px; }
.pill-bad { background: #3A1C1C; color: #F2A7A7; }
.btn-danger { background: #3A1C1C; border-color: #3A1C1C; color: #F2A7A7; }
.data-frame { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }

/* Every kind of tap target, in one place */
summary { display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; flex: none; }
details[open] > summary::before { content: "▾"; }
.link-tap { display: inline-flex; align-items: center; min-height: 44px; }
.kbd-focus { outline: 2px solid var(--link); outline-offset: 2px; border-radius: var(--r); }
/* A finger needs 44px, on any phone and on any device with a touch screen. A mouse on a desktop keeps the closer spacing. */
@media (max-width: 767px), (pointer: coarse) {
  html { scroll-padding-bottom: 96px; }  /* a control reached with the keyboard stops above the bar that stays at the bottom */
  .btn, .field, .chip, .check, .seg label, .nav { min-height: 44px; }
  .btn-icon { width: 44px; }
  .chip-x { width: 44px; height: 44px; margin-right: -12px; }
  .check input { width: 22px; height: 22px; }
  .st-undo .btn { width: 44px; }
  .st-foot .btn { min-height: 44px; }
  .ask .row .btn { min-height: 44px; padding: 0 14px; font-size: var(--t-body); }
}

/* The stages of a creator film (stages.js) */
.of-stages { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.of-stage { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; line-height: 1.35; }
.of-stage.of-approved { border-color: color-mix(in srgb, var(--ok, #2e7d32) 45%, var(--line)); }
.of-stage.of-waiting_for_person { border-color: color-mix(in srgb, var(--warn, #b26a00) 55%, var(--line)); }
.of-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.of-card h3 { margin: 0; font-size: var(--t-card); }
.of-sheet { width: 100%; max-height: 360px; object-fit: contain; border-radius: 8px; background: #0002; }
.of-sheet-small, .of-still { width: 100%; max-width: 360px; border-radius: 8px; }
.of-versions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.of-version { padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; display: grid; gap: 4px; text-align: left; cursor: pointer; }
.of-version img { width: 100%; border-radius: 8px; display: block; }
.of-version.of-chosen { border-color: var(--accent, #6a5acd); }
.of-voices { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.of-voices li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.of-voices audio { max-width: 100%; }
.of-card textarea, .of-card input[type=text] { width: 100%; box-sizing: border-box; }

.of-stages-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.of-stages-box > summary { cursor: pointer; line-height: 1.4; }
.of-stages-box .of-stages { margin: 10px 0 0; }
.of-stage { padding: 6px 8px; font-size: var(--t-meta); }
.of-section { border-top: 1px solid var(--line); padding: 6px 0; }
.of-section > summary { cursor: pointer; display: flex; align-items: baseline; gap: 8px; list-style: none; padding: 6px 0; }
.of-section > summary::-webkit-details-marker { display: none; }
.of-section > summary h2 { margin: 0; font-size: var(--t-section); }
.of-versions > .of-version:only-child { grid-column: 1 / -1; max-width: 420px; }
.of-card label { display: grid; gap: 4px; }

/* The way in with an email code or Google, and the policy links (launch, 15 Nov 2026) */
.door-head { display: flex; flex-direction: column; gap: 4px; }
.door-code { font-size: 24px; letter-spacing: 0.4em; text-align: center; }
.door-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--t-label); }
.door-or::before, .door-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.door-google { display: flex; justify-content: center; min-height: 44px; }
.door-consent-text { max-height: 40vh; max-height: 40dvh; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); color: var(--text-2); display: flex; flex-direction: column; gap: 8px; }
.door-legal, .of-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding-top: 8px; }
.door-legal a, .of-legal a { color: var(--muted); min-height: 32px; display: inline-flex; align-items: center; }

/* Credits and Account (launch, 15 Nov 2026) */
.of-cred { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: var(--t-meta); font-weight: 600; font-variant-numeric: tabular-nums; }
.of-cred:hover { color: var(--text); background: var(--raised); }
.of-top-r { display: flex; align-items: center; gap: 8px; }
.cr-grid { display: grid; gap: 28px; }
@media (min-width: 1200px) { .cr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 40px; } }
.cr-bal { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.cr-big { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cr-big span { font-size: var(--t-meta); font-weight: 400; color: var(--muted); letter-spacing: 0; }
.cr-packs { display: grid; gap: 8px; }
@media (min-width: 768px) { .cr-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cr-pack { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); cursor: pointer; min-height: 64px; }
.cr-pack:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; }
.cr-pack:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.cr-pack input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cr-radio { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; flex: none; }
.cr-pack:has(input:checked) .cr-radio { border-color: var(--text); }
.cr-pack:has(input:checked) .cr-radio::after { content: ''; width: 10px; height: 10px; border-radius: 999px; background: var(--text); }
.cr-pt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cr-pt b { font-size: var(--t-card); font-weight: 600; font-variant-numeric: tabular-nums; }
.cr-pr { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.cr-pr b { font-size: var(--t-card); font-weight: 600; }
.cr-bonus { align-self: flex-start; display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: var(--t-over); font-weight: 600; }
.cr-rows { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.cr-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-top: 1px solid var(--line); }
.cr-row:first-child { border-top: 0; }
.cr-dt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.cr-dt b { font-size: var(--t-body); font-weight: 500; }
.cr-amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cr-amt.minus { color: var(--text-2); font-weight: 500; }
.cr-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--raised); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-2); }
.cr-inv { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 32px; padding: 0; border: 0; background: transparent; font: inherit; font-size: var(--t-label); color: var(--text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cr-cur { min-height: 36px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: var(--t-meta); }
.cr-paybar { position: sticky; bottom: 0; z-index: 5; margin: 8px -16px 0; padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 768px) { .cr-paybar { position: static; margin: 0; padding: 0; border: 0; background: transparent; flex-direction: row; align-items: center; gap: 12px; } }
.cr-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: var(--t-label); color: var(--text-2); white-space: nowrap; }
.cr-code { font-size: 24px; letter-spacing: 0.4em; text-align: center; }.cr-page { max-width: 640px; }
@media (min-width: 1200px) { .cr-page { max-width: 1080px; } }
.of-reasons { gap: 8px; }
.of-reasons .cr-pack { min-height: 48px; }

/* Policy pages (web/legal), placeholders until the owner's text */
.legal-card { max-width: 720px; }
.legal-card a.brand { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.legal-wait { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); }
.door-legal a[aria-current='page'] { color: var(--text); }
.cr-invoice { width: 100%; height: 60vh; height: 60dvh; border: 1px solid var(--line); border-radius: var(--r-lg); background: #FFFFFF; }
