/* A neutral, cool working surface. One interface typeface; the screenplay font appears only on the page itself.
   Colour carries meaning only: green = done, amber = needs an answer, red = must fix. Everything else is greyscale. */
:root {
  --bg: #111316;
  --panel: #16191D;
  --raise: #1D2126;
  --hover: #22272D;
  --ink: #E7E9EC;
  --muted: #A0A6AE;
  --faint: #656C75;
  --rule: #272C32;
  --line: #31373E;
  --focus: #9DB4C8;
  --sel: rgba(157,180,200,.10);
  --good: #6DBA8A;
  --ask: #D2A85C;
  --bad: #E06C5C;
  --page: #FBFBFA;
  --page-ink: #1A1C1F;
  --page-mark: #4F6F8A;
  --frame: #0B0C0E;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --script: "Courier Prime", "Courier New", Courier, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5F6F7; --panel: #FFFFFF; --raise: #F0F2F4; --hover: #E9ECEF; --ink: #16181B; --muted: #596069; --faint: #9AA1A9;
    --rule: #E3E6EA; --line: #D3D8DD; --focus: #3D5A73; --sel: rgba(61,90,115,.07);
    --good: #2E7D4F; --ask: #9A6A12; --bad: #C0392B; --page: #FFFFFF; --page-ink: #1A1C1F; --page-mark: #3D5A73;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F5F6F7; --panel: #FFFFFF; --raise: #F0F2F4; --hover: #E9ECEF; --ink: #16181B; --muted: #596069; --faint: #9AA1A9;
  --rule: #E3E6EA; --line: #D3D8DD; --focus: #3D5A73; --sel: rgba(61,90,115,.07);
  --good: #2E7D4F; --ask: #9A6A12; --bad: #C0392B; --page: #FFFFFF; --page-ink: #1A1C1F; --page-mark: #3D5A73;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); }
body { color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--panel); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
b, strong { font-weight: 500; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 500; }
.sub { color: var(--muted); }
.lbl { font-size: 13px; font-weight: 500; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Motion: short and quiet */
a, button, .chip, .btn, input, textarea, select, .crow-h, .tbl td, .pop a { transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease); }
.view:not([hidden]) { animation: rise .22s var(--ease); }
#directPane:not([hidden]), #cutPane:not([hidden]) { animation: fade .18s var(--ease); }
.ins > * { animation: fade .16s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: 1240px; margin: 0 auto; height: 52px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 28px; }
.mark { font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px; }
.mark i { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--ink); display: inline-block; }
nav { display: flex; align-items: stretch; height: 100%; gap: 4px; }
nav > a, .menu > a { display: flex; align-items: center; padding: 0 10px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px; box-shadow: inset 0 -2px 0 transparent; height: 100%; }
nav > a:hover, .menu > a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.menu { position: relative; display: flex; }
.menu .pop { position: absolute; top: calc(100% - 4px); left: 0; min-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.28); padding: 6px; z-index: 6; display: grid; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .14s var(--ease), transform .14s var(--ease), visibility 0s linear .14s; }
.menu:hover .pop, .menu:focus-within .pop { opacity: 1; visibility: visible; transform: none; transition-delay: .06s, .06s, 0s; }
.menu.shut .pop { opacity: 0; visibility: hidden; }
.pop .grp { display: grid; }
.pop .lbl { padding: 8px 10px 4px; font-size: 12.5px; }
.pop a { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; padding: 6px 10px; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: 14px; align-items: baseline; }
.pop a:hover, .pop a:focus-visible { background: var(--hover); }
.pop a .n { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.pop a .h { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop a .t { color: var(--faint); font-size: 13px; }
.pop .all { display: block; border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 9px; color: var(--muted); }
.pop .empty { padding: 2px 10px 6px; color: var(--faint); font-size: 14px; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; min-width: 0; }
.proj { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.saved { font-size: 13px; color: var(--muted); opacity: 0; transition: opacity .4s var(--ease); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.saved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.saved.on { opacity: 1; transition-duration: .1s; }
.saved.warn::before { background: var(--ask); }

main { max-width: 1240px; margin: 0 auto; padding-block: 32px 72px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.view { display: grid; gap: 24px; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.vhead > div:not(.row) { display: grid; gap: 4px; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; background: var(--ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); background: var(--hover); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; }
.pad { padding: 18px 20px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--faint); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.pill.progress { color: var(--ink); } .pill.progress::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.pill.done { color: var(--good); } .pill.done::before { background: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; padding: 3px 11px; border-radius: 999px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.chip:hover { color: var(--ink); border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; font-size: 14.5px; line-height: 1.5; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--faint); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--sel); }
.field textarea { resize: none; min-height: 44px; overflow: hidden; }
.field .src { font-size: 13px; color: var(--faint); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.r { color: var(--faint); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbox { overflow-x: auto; }

/* Home */
.home { max-width: 640px; padding-block: 72px 24px; display: grid; gap: 24px; }
.home h1 { font-size: 34px; line-height: 1.18; letter-spacing: -.022em; }
.home .lede { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 54ch; }
.home .row { gap: 10px; }
.home .btn { height: 40px; padding: 0 18px; font-size: 15px; }
.how { margin: 16px 0 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--rule); }
.how li { display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.how li span { color: var(--faint); font-variant-numeric: tabular-nums; }
.how b { font-weight: 500; color: var(--ink); }

/* Script */
.upline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border: 1px dashed var(--line); border-radius: 8px; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.upline.over { border-color: var(--focus); background: var(--sel); }
.upline > div { min-width: 0; display: grid; gap: 2px; }
.upline b { font-weight: 500; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.split > * { min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.sc-place { color: var(--ink); text-decoration: none; font-weight: 500; }
.sc-meta { display: block; font-size: 13px; color: var(--faint); margin-top: 1px; }
.who { color: var(--muted); font-size: 14px; }
.notes { display: grid; }
.note { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.note:last-child { border-bottom: 0; }
.note b { color: var(--ink); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; background: var(--ask); }
.dot.ok { background: var(--good); } .dot.bad { background: var(--bad); } .dot.fix { background: var(--faint); }

/* Scene */
.scenebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.scenebar .crumb { color: var(--muted); text-decoration: none; }
.scenebar .crumb:hover { color: var(--ink); }
.scenebar .sep { color: var(--faint); }
.scenebar .slug { font-weight: 500; }
.scenebar .grow { flex: 1; }
.seg { display: inline-flex; padding: 3px; background: var(--raise); border-radius: 7px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 5px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.scene-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.page { background: var(--page); color: var(--page-ink); font-family: var(--script); font-size: 16px; line-height: 1.5; padding: 48px 56px; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.2); max-width: 760px; width: 100%; justify-self: center; }
.page .sl { font-weight: 700; text-transform: uppercase; margin-bottom: 1.1em; }
.page .act { margin: 0 0 1.1em; }
.page .dlg { margin: 0 -8px 1.1em; padding: 4px 8px; border-radius: 3px; cursor: pointer; transition: background-color .15s var(--ease); }
.page .dlg:hover { background: rgba(0,0,0,.035); }
.page .dlg.sel { background: rgba(79,111,138,.09); box-shadow: inset 2px 0 0 var(--page-mark); }
.page .cue { display: block; margin-left: 38%; text-transform: uppercase; }
.page .cue button { all: unset; cursor: pointer; }
.page .cue button:hover { text-decoration: underline; text-underline-offset: 3px; }
.page .cue button:focus-visible { outline: 2px solid var(--page-mark); }
.page .key { font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--page-mark); margin-left: 10px; text-transform: none; }
.page .par { display: block; margin-left: 30%; }
.page .txt { display: block; margin-left: 17%; margin-right: 14%; }
.page .dir { display: block; margin-left: 17%; margin-top: 4px; font-family: var(--sans); font-size: 13.5px; color: var(--page-mark); }
.inspector { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); display: grid; gap: 12px; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--raise); border-radius: 7px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 5px; cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.ins { padding: 18px 20px; display: grid; gap: 16px; }
.ins .quote { font-size: 15px; }
.carry { font-size: 14px; color: var(--muted); padding: 10px 12px; background: var(--raise); border-radius: 6px; display: grid; gap: 2px; }
.presets { display: grid; gap: 8px; }
.preset { text-align: left; border: 1px solid var(--line); background: transparent; padding: 10px; border-radius: 8px; cursor: pointer; display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.preset:hover { background: var(--hover); }
.preset[aria-pressed="true"] { border-color: var(--ink); }
.preset .thumb { aspect-ratio: 16/9; background: var(--frame); border-radius: 3px; overflow: hidden; }
.preset .thumb svg { width: 100%; height: 100%; display: block; }
.preset span { display: grid; gap: 2px; min-width: 0; }
.preset b { font-weight: 500; font-size: 14.5px; }
.preset small { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
input[type="range"] { width: 100%; accent-color: var(--ink); }
input[type="checkbox"] { accent-color: var(--ink); width: 15px; height: 15px; }

/* Cut */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 184px; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.shot { border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 7px; display: grid; gap: 5px; cursor: pointer; text-align: left; align-content: start; scroll-snap-align: start; }
.shot:hover { border-color: var(--line); }
.shot.sel { border-color: var(--ink); }
.fr { aspect-ratio: 16/9; background: var(--frame); border-radius: 4px; overflow: hidden; }
.fr svg { width: 100%; height: 100%; display: block; }
.shot .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.shot b { font-size: 14px; font-weight: 500; }
.shot .ln { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl { display: flex; height: 16px; border-radius: 3px; overflow: hidden; gap: 1px; }
.tl button { border: 0; cursor: pointer; padding: 0; min-width: 3px; opacity: .75; }
.tl button:hover { opacity: 1; }
.tl button.sel { opacity: 1; box-shadow: inset 0 0 0 2px var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.stats { display: flex; gap: 32px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.stats b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.stats s { color: var(--faint); }
.cut-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.cut-grid > * { min-width: 0; }
.editor { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.editor > div { min-width: 0; display: grid; gap: 10px; align-content: start; }
.editor .quote { font-size: 15px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.ref { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.audio { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.wave { display: flex; gap: 2px; align-items: center; height: 18px; }
.wave i { display: block; width: 3px; border-radius: 1px; background: var(--faint); height: 5px; }
.wave.on i { animation: wv .9s ease-in-out infinite; background: var(--ink); }
@keyframes wv { 0%,100% { height: 4px; } 50% { height: 17px; } }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.lib div { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.checks { display: grid; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.cat { padding: 6px 0; display: grid; }
.cat b { font-weight: 400; font-size: 13.5px; color: var(--muted); }
.cat span { font-size: 14px; font-weight: 500; }
.s-block { color: var(--bad); } .s-ask { color: var(--ask); } .s-fixed, .s-ok { color: var(--good); }
.issue { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; animation: fade .2s var(--ease); }
.issue:last-child { border-bottom: 0; }
.issue .where { display: block; font-size: 13px; color: var(--faint); margin-bottom: 2px; }
.issue .row { margin-top: 10px; }
.rbar { height: 3px; background: var(--raise); border-radius: 2px; overflow: hidden; }
.rbar i { display: block; height: 100%; width: 0; background: var(--good); transition: width .3s var(--ease); }

/* Cast */
.castcols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.castcols > div { min-width: 0; display: grid; gap: 10px; }
.castcols h2 { color: var(--muted); font-size: 14px; }
.castcols h2 span { color: var(--faint); font-weight: 400; margin-left: 6px; }
.rows { border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); overflow: hidden; }
.crow + .crow { border-top: 1px solid var(--rule); }
.crow-h { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center; padding: 12px 16px; background: transparent; border: 0; cursor: pointer; text-align: left; }
.crow-h:hover { background: var(--hover); }
.crow.open .crow-h { background: var(--raise); }
.face { width: 30px; height: 30px; border-radius: 50%; display: block; opacity: .9; }
.crow-h .nm { display: grid; min-width: 0; }
.crow-h .nm b { font-weight: 500; font-size: 15px; }
.crow-h .nm span { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 8px; height: 8px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease); }
.crow.open .chev { transform: rotate(-135deg) translate(-2px, 0); }
.marks { display: flex; gap: 12px; font-size: 13px; color: var(--faint); }
.marks span { display: inline-flex; align-items: center; gap: 5px; }
.marks span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.marks .y { color: var(--good); }
.marks .y::before { background: currentColor; }
.crow-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s var(--ease); }
.crow.open .crow-wrap { grid-template-rows: 1fr; }
.crow-wrap > div { overflow: hidden; min-height: 0; }
.crow-b { padding: 16px 16px 20px 58px; display: grid; gap: 16px; opacity: 0; transition: opacity .2s var(--ease); }
.crow.open .crow-b { opacity: 1; }
.trio { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
.trio .field:last-child { grid-column: 1 / -1; }
.looks { display: grid; gap: 8px; }
.look { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; }
.look .sw { width: 4px; border-radius: 2px; }
.look > div { display: grid; gap: 6px; min-width: 0; }
.look input, .look textarea { width: calc(100% + 12px); min-height: 0; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 6px; margin: -3px -6px; font-size: 14.5px; resize: none; overflow: hidden; line-height: 1.5; }
.look input { font-weight: 500; }
.look textarea { color: var(--muted); }
.look input:hover, .look textarea:hover { border-color: var(--line); }
.look input:focus, .look textarea:focus { outline: none; border-color: var(--focus); color: var(--ink); background: var(--panel); }
.look small { color: var(--faint); font-size: 13px; white-space: nowrap; }
.look .x { all: unset; cursor: pointer; color: var(--faint); font-size: 13px; align-self: start; }
.look .x:hover { color: var(--bad); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }

/* Continuity */
.cont { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cont > div { min-width: 0; display: grid; gap: 10px; }
.kind { font-size: 13px; color: var(--faint); }
.q { font-size: 14px; color: var(--muted); margin-top: 2px; }
.scs { display: flex; flex-wrap: wrap; gap: 4px; }
.scs span { font-size: 12.5px; min-width: 22px; text-align: center; padding: 0 5px; border: 1px solid var(--rule); border-radius: 4px; color: var(--faint); font-variant-numeric: tabular-nums; }
.scs span.first { color: var(--ink); border-color: var(--line); background: var(--raise); }

body.simple .adv { display: none !important; }
body:not(.simple) .simple-only { display: none !important; }

@media (max-width: 1000px) {
  .split, .scene-grid, .cut-grid, .castcols, .cont { grid-template-columns: 1fr; }
  .inspector { position: static; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .bar-in { gap: 8px; padding-inline: 14px; }
  nav > a, .menu > a { padding: 0 8px; }
  .mark { font-size: 14px; }
  .mark span { display: none; }
  .proj, .saved { display: none; }
  .menu .pop { display: none !important; }
  .page { padding: 24px 16px; font-size: 14px; }
  .page .cue { margin-left: 30%; }
  .page .txt, .page .dir { margin-left: 6%; margin-right: 4%; }
  .page .par { margin-left: 18%; }
  .editor { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr 1fr; }
  .crow-h { grid-template-columns: 30px minmax(0, 1fr) 14px; }
  .crow-h .marks { display: none; }
  .crow-b { padding-left: 16px; }
  .trio { grid-template-columns: 1fr 1fr; }
  .trio .field:last-child { grid-column: 1 / -1; }
  .home { padding-block: 32px 8px; }
  .home h1 { font-size: 27px; }
  .tbl .who-col { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wave.on i { height: 12px; }
}

/* Cast: choosing faces and voices */
img.face { object-fit: cover; background: var(--raise); }
.facebox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.facebox:not(:has(.portrait)) { grid-template-columns: minmax(0, 1fr); }
.facebox > .field { min-width: 0; }
.portrait { width: 96px; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 6px; background: var(--raise); display: block; animation: fade .25s var(--ease); }
.opts.faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.opt { all: unset; cursor: pointer; display: grid; gap: 6px; text-align: center; font-size: 13px; color: var(--muted); animation: rise .25s var(--ease) both; }
.opt:nth-child(2) { animation-delay: .04s; } .opt:nth-child(3) { animation-delay: .08s; } .opt:nth-child(4) { animation-delay: .12s; }
.opt img { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 6px; border: 2px solid transparent; background: var(--raise); transition: border-color .15s var(--ease), transform .15s var(--ease); }
.opt:hover img { transform: translateY(-2px); }
.opt.on img { border-color: var(--good); }
.opt.on span { color: var(--good); }
.opt:focus-visible img { outline: 2px solid var(--focus); outline-offset: 2px; }
.opts.voices { display: grid; gap: 6px; margin-top: 4px; }
.vopt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; animation: rise .2s var(--ease) both; }
.vopt.on { border-color: var(--good); }
.vopt.on [aria-pressed="true"] { color: var(--good); border-color: var(--good); }
@media (max-width: 600px) { .opts.faces { grid-template-columns: repeat(2, minmax(0, 1fr)); } .facebox { grid-template-columns: 1fr; } }

/* Making a scene */
.make { display: flex; gap: 8px; flex-wrap: wrap; }
.make .btn { height: 38px; }
.free { font-size: 12px; color: var(--good); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; margin-left: 4px; }
dialog.confirm { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); padding: 22px 24px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0,0,0,.4); }
dialog.confirm::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
dialog.confirm[open] { animation: rise .2s var(--ease); display: grid; gap: 12px; }
dialog.confirm #confirmBody { display: grid; gap: 8px; }
dialog.confirm .big { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.row.end { justify-content: flex-end; }

/* Editor */
.edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.stagecol { display: grid; gap: 10px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 2; background: var(--bg); padding-bottom: 12px; }
.stage { aspect-ratio: 16 / 9; max-height: 52vh; width: 100%; margin: 0 auto; background: var(--frame); border-radius: 8px; overflow: hidden; position: relative; }
.stage svg, .stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; animation: fade .3s var(--ease); }
.kb { transform-box: view-box; transform-origin: 50% 40%; }
.kb.go { animation: push 6s linear forwards; }
.kb-wide.go, .kb-two.go { animation-name: drift; }
.kbimg { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 40%; }
.kbimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kbimg.go { animation: push 6s linear forwards; }
.kbimg.kb-wide.go, .kbimg.kb-two.go { animation-name: drift; }
@keyframes push { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes drift { from { transform: translateX(0) scale(1.02); } to { transform: translateX(-1.5%) scale(1.04); } }
.caption { min-height: 26px; font-size: 16px; text-align: center; color: var(--ink); max-width: 70ch; margin: 0 auto; }
.caption b { color: var(--muted); font-weight: 500; margin-right: 6px; }
.caption i { color: var(--muted); }
.transport { display: flex; align-items: center; gap: 8px; }
.transport #playBtn { min-width: 76px; }
.transport .tc { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; margin-left: 6px; }
.transport .grow { flex: 1; }
.erows { display: grid; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.erow { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: 16px; padding: 12px 16px; border-top: 1px solid var(--rule); transition: background-color .2s var(--ease); }
.erow:first-child { border-top: 0; }
.erow.cur { background: var(--raise); box-shadow: inset 2px 0 0 var(--ink); }
.eline { all: unset; cursor: pointer; display: grid; gap: 2px; align-content: start; font-size: 14.5px; line-height: 1.45; }
.eline b { font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.eline i { color: var(--faint); }
.eline .act { color: var(--muted); font-style: italic; }
.eline:hover span { color: var(--ink); }
.eline:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }
.lane { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; align-items: start; }
.take { all: unset; cursor: pointer; width: 132px; flex: none; display: grid; gap: 3px; animation: fade .25s var(--ease); }
.take .fr { border-radius: 5px; border: 2px solid transparent; transition: border-color .15s var(--ease), opacity .15s var(--ease); opacity: .72; }
.take:hover .fr { opacity: 1; }
.take.on .fr { border-color: var(--ink); opacity: 1; }
.take img { width: 100%; height: 100%; object-fit: cover; display: block; }
.take .tl { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.take.on .tl { color: var(--ink); }
.take .tk { font-size: 11.5px; color: var(--faint); }
.take.busy { cursor: default; }
.take .pending { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); background: repeating-linear-gradient(135deg, var(--raise) 0 8px, var(--panel) 8px 16px); animation: shimmer 1.2s linear infinite; background-size: 200% 100%; }
@keyframes shimmer { to { background-position: -45px 0; } }
.take:focus-visible .fr { outline: 2px solid var(--focus); outline-offset: 2px; }
.more { position: relative; flex: none; }
.add { all: unset; cursor: pointer; width: 96px; aspect-ratio: 16 / 9; border: 1px dashed var(--line); border-radius: 5px; display: grid; place-items: center; text-align: center; font-size: 12.5px; color: var(--muted); padding: 0 6px; box-sizing: border-box; }
.add:hover, .add[aria-expanded="true"] { color: var(--ink); border-color: var(--faint); }
.angles { position: absolute; left: 0; top: calc(100% + 6px); z-index: 4; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.3); display: grid; gap: 1px; animation: rise .16s var(--ease); }
.angles button { all: unset; cursor: pointer; padding: 7px 10px; border-radius: 5px; font-size: 14px; }
.angles button:hover, .angles button:focus-visible { background: var(--hover); }
.angles .hint { padding: 6px 10px 2px; font-size: 12.5px; }
.empty { padding: 28px; display: grid; gap: 14px; justify-items: start; max-width: 520px; }
/* Wide screens: the picture on the left stays put while the script runs down the right */
@media (min-width: 1100px) {
  .edit { grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); align-items: start; }
  .stagecol { padding-bottom: 0; }
  .stage { max-height: none; }
  .erow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .caption { min-height: 50px; }
}
@media (max-width: 1099px) { .stage { max-height: 38vh; } }
@media (max-width: 760px) {
  .erow { grid-template-columns: 1fr; gap: 8px; }
  .stagecol { position: static; }
}

/* Library: a contact sheet of every shot */
.shots { display: grid; gap: 12px; margin-bottom: 36px; }
.sfilter { display: grid; gap: 8px; }
.lscene { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.lsh { display: flex; gap: 10px; align-items: baseline; }
.lsh span { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsh a { font-size: 13.5px; color: var(--muted); }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px 12px; }
.lcard { all: unset; cursor: pointer; display: grid; gap: 3px; min-width: 0; animation: fade .25s var(--ease); }
.lcard .fr { aspect-ratio: 16 / 9; border-radius: 5px; overflow: hidden; border: 2px solid transparent; background: var(--raise); transition: border-color .15s var(--ease); }
.lcard .fr svg, .lcard .fr img { width: 100%; height: 100%; display: block; object-fit: cover; }
.lcard:hover .fr, .lcard:focus-visible .fr { border-color: var(--faint); }
.lcard.on .fr { border-color: var(--good); }
.lcard .tl { font-size: 13px; }
.lcard .tq { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .tk { font-size: 11.5px; color: var(--faint); }
.lcard.on .tk { color: var(--good); }
@media (max-width: 430px) {
  nav { gap: 0; }
  nav > a, .menu > a { padding: 0 6px; }
  #modeBtn { display: none; }
}

/* Screening: the cut alone, full screen */
.screen { position: relative; }
.slate { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .72); border-radius: 8px; text-align: center; color: #E7E9EC; animation: fade .4s var(--ease); }
.slate > div { display: grid; gap: 10px; justify-items: center; }
.slate p { margin: 0; color: #A9AFB6; }
.slate .t { font-size: 28px; letter-spacing: -.01em; color: #E7E9EC; }
.slate .btn { margin-top: 10px; }
body.watching { background: #000; }
body.watching .bar, body.watching .vhead, body.watching .erows { display: none; }
body.watching main { max-width: none; padding: 0; }
body.watching [data-view="edit"] { padding: 0; }
body.watching .stagecol { position: relative; top: 0; background: #000; padding: 0; gap: 6px; min-height: 100vh; align-content: center; }
body.watching .stage, body.watching .slate { max-height: calc(100vh - 120px); border-radius: 0; }
body.watching .caption { color: #E7E9EC; }
body.watching .transport { padding: 0 20px 14px; color: #A9AFB6; }
body.watching #cutCost { display: none; }
body.watching .screen { width: min(100%, calc((100vh - 120px) * 16 / 9)); margin: 0 auto; }
.lanes { display: grid; gap: 6px; min-width: 0; position: relative; }
.unote { margin: 0; font-size: 13px; color: var(--muted); animation: fade .2s var(--ease); }
.unote .link { all: unset; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Make this scene: three numbered steps, one main button at a time */
.steps { display: grid; gap: 4px; }
.steps > .hint { margin: 0 0 6px; }
.step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--rule); }
.step .sn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step.done .sn { border-color: var(--good); color: var(--good); }
.step > div { display: grid; gap: 4px; min-width: 0; }
.step > div > b { font-weight: 500; }
.step .hint { margin: 0; }
@media (max-width: 600px) { .step { grid-template-columns: 24px minmax(0, 1fr); } .step > .btn { grid-column: 2; justify-self: start; } }
.lanes > .angles { position: static; justify-self: start; box-shadow: none; }
#editScenes { position: relative; }
.sharep { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; width: min(380px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.3); animation: rise .16s var(--ease); }
.sharep p { margin: 0; font-size: 14px; color: var(--muted); }
.sharep input { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 7px 9px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
body.watching .stagecol:has(.slate:not([hidden])) .transport, body.watching .stagecol:has(.slate:not([hidden])) .caption { visibility: hidden; }
.take .tl { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.face.blank { background: var(--raise); border: 1px solid var(--line); box-sizing: border-box; display: grid; place-items: center; font-size: 12.5px; color: var(--muted); opacity: 1; }
.over { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.over p { margin: 0; color: var(--ink); }
.over input { width: 80px; font: inherit; padding: 4px 8px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
#passIn, #signEmail, #signCode { font: inherit; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* Home: the scripts opened on this computer */
.plist { display: grid; gap: 0; margin: 8px 0 4px; max-width: 560px; }
.plist h2 { margin-bottom: 6px; }
.prow { display: grid; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--rule); color: var(--ink); text-decoration: none; border-radius: 6px; }
.prow:hover { background: var(--hover); }
.prow b { font-weight: 500; }
.prow span { font-size: 13.5px; color: var(--muted); }
.prow.on span { color: var(--good); }
body.watching .edit { grid-template-columns: minmax(0, 1fr); gap: 0; }
#signCode { letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.seg button[aria-checked="true"] { background: var(--panel); color: var(--ink); }

/* Make-the-scene dialog: what was checked before anything is spent */
ul.pre { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
ul.pre li { position: relative; padding-left: 18px; font-size: 14px; }
ul.pre li::before { content: ''; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
ul.pre li.ok::before { background: var(--good); }
ul.pre li.warn::before { background: var(--ask); }

/* Cast: find, add, tidy */
.casttools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#castQ { width: 220px; }
.row.wrap { flex-wrap: wrap; gap: 12px; }
.row.tidy { align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.row.tidy select { max-width: 240px; }

/* Export menu */
details.menu { position: relative; }
details.menu summary { list-style: none; } details.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; min-width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.menu-list button { all: unset; cursor: pointer; padding: 8px 10px; border-radius: 6px; display: grid; gap: 2px; }
.menu-list button span { font-size: 12px; color: var(--muted); }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--hover); }
/* Editing the script in place */
.pagecol { display: grid; gap: 8px; justify-self: center; width: 100%; max-width: 760px; align-content: start; }
.pagebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page.editing .ed { position: relative; margin: 0 -8px 1.1em; padding: 6px 8px; border-radius: 3px; }
.page.editing .ed:hover, .page.editing .ed:focus-within { background: rgba(0,0,0,.035); }
.page.editing textarea, .page.editing input, .page.editing select { overflow: hidden; font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 3px; width: 100%; padding: 2px 4px; resize: none; box-sizing: border-box; }
.page.editing textarea:focus, .page.editing input:focus, .page.editing select:focus { border-color: var(--page-mark); outline: none; background: #fff; }
.page.editing .ed.dlg select { width: auto; margin-left: 36%; text-transform: uppercase; }
.page.editing .ed.dlg input { margin-left: 28%; width: 44%; font-style: italic; }
.page.editing .ed.dlg textarea { margin-left: 18%; width: 64%; }
.page.editing .e-head { font-weight: 700; text-transform: uppercase; margin-bottom: 1em; }
.edtools { display: flex; gap: 6px; justify-content: flex-end; opacity: 0; transition: opacity .15s var(--ease); font-family: var(--sans); }
.ed:hover .edtools, .ed:focus-within .edtools { opacity: 1; }
.edtools button { all: unset; cursor: pointer; font-size: 12px; color: var(--page-mark); padding: 2px 6px; border-radius: 3px; }
.edtools button:hover { background: rgba(0,0,0,.06); }
