/* AnyCaption Studio, visual design v2: the cutting room.
   Colour tells you what a thing is: sound is teal, words are saffron, time (the playhead and the cuts) is vermilion.
   Everything else stays quiet: flat panes divided by hairlines, ink for the one primary action, shadows only on things that float.
   This file loads after studio.css and replaces its palette, type and surfaces; the structure of the page is unchanged. */

/* ---------- tokens ---------- */
:root {
  --bg:#12161A; --panel:#1B2025; --panel-2:#232A30; --panel-3:#2B333A; --line:#2F373E; --line-2:#434D56;
  --ink:#E8EDF0; --ink-2:#A6B2BA; --ink-3:#74818B;
  --sound:#37C5BC; --words:#F0B93A; --time:#FF6B4F;
  --accent:#E8EDF0; --accent-ink:#12161A; --accent-soft:rgba(232,237,240,.09); --accent-line:rgba(232,237,240,.38);
  --live:var(--time); --ok:#37C5BC; --warn:#F0B93A; --danger:#FF7A66; --danger-soft:rgba(255,122,102,.14);
  --stage-bg:#0D1114; --tl-bg:#161B1F; --tl-row:#1A1F24; --tl-head:#1F2429;
  --vid-bg:#2A3647; --vid-line:#6F8AB0; --vid-ink:#CFDCEE;
  --aud-bg:#123B39; --aud-line:#37C5BC; --aud-ink:#BDF1EC;
  --cc0-bg:#4A3A12; --cc0-line:#F0B93A; --cc0-ink:#FFE3A0;
  --cc1-bg:#38325A; --cc1-line:#A294E8; --cc1-ink:#DDD6FF;
  --cc2-bg:#4C2C38; --cc2-line:#E9809A; --cc2-ink:#FFD0DB;
  --cc3-bg:#1E3E50; --cc3-line:#6DB8E6; --cc3-ink:#CBE9FA;
  --shadow:0 2px 6px rgba(0,0,0,.35), 0 14px 32px -10px rgba(0,0,0,.6);
  --r1:4px; --r2:6px; --r3:10px;
  --font-ui:'Instrument Sans','Noto Sans Sinhala',ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'IBM Plex Mono','Noto Sans Sinhala',ui-monospace,'SF Mono',Menlo,monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:#DADFE1; --panel:#F5F6F6; --panel-2:#FFFFFF; --panel-3:#E7EAEB; --line:#D3D9DC; --line-2:#B9C1C6;
    --ink:#15222B; --ink-2:#47565F; --ink-3:#74838C;
    --sound:#0B7A75; --words:#D99400; --time:#E2472B;
    --accent:#15222B; --accent-ink:#F5F6F6; --accent-soft:rgba(21,34,43,.07); --accent-line:rgba(21,34,43,.4);
    --ok:#0B7A75; --warn:#9A5B00; --danger:#B93222; --danger-soft:rgba(185,50,34,.1);
    --stage-bg:#1B2227; --tl-bg:#E9ECED; --tl-row:#F1F3F3; --tl-head:#F5F6F6;
    --vid-bg:#D6DDE7; --vid-line:#6F86A6; --vid-ink:#25384F;
    --aud-bg:#CFE9E6; --aud-line:#0B7A75; --aud-ink:#07524F;
    --cc0-bg:#FBE7B0; --cc0-line:#C98A00; --cc0-ink:#5A3C00;
    --cc1-bg:#E4E0F2; --cc1-line:#7A68B8; --cc1-ink:#3C2E7A;
    --cc2-bg:#F6DDE2; --cc2-line:#C0546E; --cc2-ink:#74243A;
    --cc3-bg:#D8E8F3; --cc3-line:#4A87B5; --cc3-ink:#17435F;
    --shadow:0 2px 6px rgba(21,34,43,.1), 0 14px 30px -10px rgba(21,34,43,.3);
  }
}
:root[data-theme="light"] {
  --bg:#DADFE1; --panel:#F5F6F6; --panel-2:#FFFFFF; --panel-3:#E7EAEB; --line:#D3D9DC; --line-2:#B9C1C6;
  --ink:#15222B; --ink-2:#47565F; --ink-3:#74838C;
  --sound:#0B7A75; --words:#D99400; --time:#E2472B;
  --accent:#15222B; --accent-ink:#F5F6F6; --accent-soft:rgba(21,34,43,.07); --accent-line:rgba(21,34,43,.4);
  --ok:#0B7A75; --warn:#9A5B00; --danger:#B93222; --danger-soft:rgba(185,50,34,.1);
  --stage-bg:#1B2227; --tl-bg:#E9ECED; --tl-row:#F1F3F3; --tl-head:#F5F6F6;
  --vid-bg:#D6DDE7; --vid-line:#6F86A6; --vid-ink:#25384F;
  --aud-bg:#CFE9E6; --aud-line:#0B7A75; --aud-ink:#07524F;
  --cc0-bg:#FBE7B0; --cc0-line:#C98A00; --cc0-ink:#5A3C00;
  --cc1-bg:#E4E0F2; --cc1-line:#7A68B8; --cc1-ink:#3C2E7A;
  --cc2-bg:#F6DDE2; --cc2-line:#C0546E; --cc2-ink:#74243A;
  --cc3-bg:#D8E8F3; --cc3-line:#4A87B5; --cc3-ink:#17435F;
  --shadow:0 2px 6px rgba(21,34,43,.1), 0 14px 30px -10px rgba(21,34,43,.3);
}

/* ---------- base ---------- */
body { font:13px/1.45 var(--font-ui); letter-spacing:.005em; }
:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
::selection { background:color-mix(in srgb, var(--words) 45%, transparent); }
.count, .chip { font-family:var(--font-ui); font-variant-numeric:tabular-nums; }
.tc, .clock, #clkNow, #clkTot, .res, .badge, .read, .idx, .timing .btn { font-variant-numeric:tabular-nums; }

/* ---------- shell: one workspace, panes divided by hairlines ---------- */
.app { gap:0; padding:0; min-height:620px; }
.topbar { height:48px; padding:0 14px 0 calc(var(--gl) - 2px); background:var(--panel); border-bottom:1px solid var(--line); }
.body { gap:0; background:var(--line); }
.card { background:var(--panel); border:0; border-radius:0; }
.rail { border-right:1px solid var(--line); }
.left { border-right:1px solid var(--line); }
.center { background:var(--panel); }
.right { border-left:1px solid var(--line); }
.tl { border-top:1px solid var(--line); }
.brand b { font-size:15px; font-weight:700; letter-spacing:-.02em; } .brand span { font-weight:400; color:var(--ink-3); }
.logo .bg { fill:var(--ink); } .logo .fg { fill:var(--panel); }
.proj { margin-left:12px; padding-left:12px; }
.proj input { border-radius:var(--r2); font-weight:500; }
.vsep { background:var(--line-2); }
.avatar { border-radius:var(--r2); }

/* the rail: icons with a small label; the open panel carries an ink bar */
.rail { padding:10px 0; gap:2px; }
.rbtn { position:relative; border-radius:0; padding:10px 0 8px; font-size:11px; }
.rbtn:hover { background:var(--panel-3); }
.rbtn[aria-selected="true"] { background:transparent; color:var(--ink); font-weight:600; }
.rbtn[aria-selected="true"]::before { content:""; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:0 2px 2px 0; background:var(--ink); }

/* pane titles: plain, sentence case */
.p-head { padding:14px 16px 10px; }
.p-head h2 { font-size:14.5px; font-weight:650; letter-spacing:-.01em; }
.p-bar { background:var(--panel); border-color:var(--line); }
.p-foot { border-color:var(--line); }

/* ---------- controls: 6px corners, flat, ink for the one primary action ---------- */
.btn { border-radius:var(--r2); background:var(--panel-2); border-color:var(--line-2); font-weight:550; }
.btn:hover { background:var(--panel-3); }
.btn.primary { background:var(--ink); color:var(--panel); border-color:transparent; }
.btn.primary:hover { background:var(--ink); filter:brightness(1.18); }
.btn.soft, .btn[aria-pressed="true"] { background:var(--accent-soft); color:var(--ink); border-color:var(--accent-line); }
.icon-btn { border-radius:var(--r2); }
.icon-btn[aria-pressed="true"] { background:var(--accent-soft); color:var(--ink); box-shadow:inset 0 0 0 1px var(--accent-line); }
.seg { border-radius:var(--r2); background:var(--panel-3); }
.seg button { border-radius:var(--r1); font-weight:550; }
.seg button[aria-pressed="true"] { background:var(--panel-2); color:var(--ink); box-shadow:0 0 0 1px var(--line-2), 0 1px 1px rgba(0,0,0,.12); }
select, input[type=text], input[type=number], input[type=password] { border-radius:var(--r2); background:var(--panel-2); }
select:focus-visible, input:focus-visible { outline-color:var(--ink); }
.chip { height:20px; border-radius:var(--r1); font-weight:550; font-size:11px; }
.chip.ok { background:var(--accent-soft); color:var(--ink); }
.chip.warn { background:color-mix(in srgb, var(--words) 22%, transparent); color:var(--warn); }
.sw { border-radius:10px; }
.sw[aria-checked="true"] { background:var(--ink); } .sw[aria-checked="true"]::after { background:var(--panel); }
.cinp { border-radius:var(--r2); }
input[type=range]::-webkit-slider-runnable-track { background:linear-gradient(to right, var(--ink) var(--p), var(--panel-3) var(--p)); }
input[type=range]::-moz-range-progress { background:var(--ink); }
input[type=range]::-webkit-slider-thumb { background:var(--panel-2); border:2px solid var(--ink); box-shadow:none; }
input[type=range]::-moz-range-thumb { background:var(--panel-2); border:2px solid var(--ink); }
.tag { border-radius:var(--r1); background:var(--accent-soft); color:var(--ink); }
.swrow, .smart, .tags { border-radius:var(--r2); }
.swatch[aria-pressed="true"] { box-shadow:0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.acc > summary h3 { font-size:12.5px; font-weight:650; letter-spacing:0; text-transform:none; color:var(--ink); }
.field > .lbl, .field > label { color:var(--ink-2); }

/* ---------- media and captions panes ---------- */
.drop { border-radius:var(--r3); border-color:var(--line-2); }
.drop .dz { background:var(--panel-3); color:var(--sound); }
.drop.over, .p-scroll.over { border-color:var(--ink); background:var(--accent-soft); }
.mcard { border-radius:var(--r2); background:var(--panel-2); }
.madd { background:var(--ink); color:var(--panel); border-radius:var(--r1); }
.ctab { border-radius:var(--r2); }
.ctab[aria-pressed="true"] { background:var(--panel-2); }
.cue { padding:14px 16px; }
.cue.sel { background:color-mix(in srgb, var(--words) 12%, var(--panel)); box-shadow:inset 3px 0 0 var(--words); }
.cue.live .idx { color:var(--time); }
.cue-text:focus { box-shadow:0 0 0 2px var(--ink); }
.en { color:var(--ink); background:color-mix(in srgb, var(--sound) 18%, transparent); border-radius:var(--r1); }
.empty .ei { border-radius:var(--r3); background:var(--panel-3); }

/* ---------- the preview: a dark monitor in a light room ---------- */
.stage-area { background:var(--stage-bg); }
.pv-bar { border-bottom:1px solid var(--line); background:var(--panel); }
.frame { border-radius:2px; box-shadow:0 0 0 1px rgba(255,255,255,.08), 0 18px 44px -14px rgba(0,0,0,.7); }
.cap.sel { outline:2px dashed var(--words); }
.res { color:rgba(255,255,255,.5); }
.pv-transport { background:var(--panel); }

/* ---------- the timeline: where the cutting room shows ---------- */
.tl { background:var(--tl-bg); }
.t-ruler, .t-corner, .hcorner { background:var(--tl-head); }
.ph-head { border-top-color:var(--time); }
#phLine, .ph-line { background:var(--time); }
.thead { background:var(--tl-head); gap:8px; box-shadow:inset 3px 0 0 var(--lane, var(--line-2)); padding-left:13px; }
.hrow:has(.tic) { --lane:var(--line-2); }
.tic { border-radius:var(--r1); }
.tn b { font-weight:600; }
.blk { border-radius:var(--r1); }
.blk.audio { background:var(--aud-bg); border-color:var(--aud-line); }
.blk.video { background-image:repeating-linear-gradient(90deg, transparent 0 59px, rgba(0,0,0,.2) 59px 60px); }
.ttrack.cc0 .blk.capb, .ttrack.cc1 .blk.capb, .ttrack.cc2 .blk.capb, .ttrack.cc3 .blk.capb { border-radius:var(--r1); font-weight:550; }
.blk.sel, .blk.msel { box-shadow:0 0 0 2px var(--ink); }
.blk.video.msel, .blk.audio.msel { outline-color:var(--ink); }
.range-band { background:color-mix(in srgb, var(--ink) 12%, transparent); border-color:var(--ink); }
.marquee { border-color:var(--ink); background:var(--accent-soft); }
.newtrack-hint { border-top-color:var(--ink); } .newtrack-hint span { background:var(--ink); color:var(--panel); }
.t-row.dropok .ttrack { background:var(--accent-soft); }
/* the seams Auto cut left: small vermilion notches on the clip */
.cutmark { border-color:var(--time); color:var(--time); background:var(--panel-2); border-radius:var(--r1); width:18px; height:18px; box-shadow:none; }
.cutmark:hover { background:var(--time); color:#fff; transform:none; }
.cut-line::before { background:var(--time); box-shadow:none; }
.cut-line::after { background:var(--time); color:#fff; border-radius:var(--r1); }
.t-gap .gl, .hgap { font-weight:600; letter-spacing:.02em; text-transform:none; font-size:11px; color:var(--ink-3); }

/* ---------- the caption style panel ---------- */
.right .p-scroll { background:var(--panel); padding:4px 16px 18px; gap:0; }
.right #styBody { gap:0; }
.right .p-bar.stick { background:var(--panel); padding:2px 0 10px; }
.right .look, .right .grp { background:transparent; border:0; border-radius:0; box-shadow:none; padding:14px 0; border-top:1px solid var(--line); }
.right .look { border-top:0; padding-top:4px; }
.right .look .btn.primary { background:var(--panel-2); color:var(--ink); border:1px solid var(--line-2); box-shadow:none; }
.right .look .btn.primary:hover { background:var(--panel-3); filter:none; }
.right .grp > h4 { display:block; margin:0; font:650 12.5px var(--font-ui); letter-spacing:0; text-transform:none; color:var(--ink); }
.right .grp > h4::before { content:none; }
.right .tabs { display:flex; gap:0; padding:0; margin:12px 0 0; background:transparent; border-radius:0; border-bottom:1px solid var(--line); }
.right .tabs button { flex:1; height:38px; border:0; border-bottom:2px solid transparent; margin-bottom:-1px; border-radius:0; background:transparent; color:var(--ink-3); font:550 12.5px var(--font-ui); }
.right .tabs button:hover { color:var(--ink); }
.right .tabs button[aria-selected="true"] { background:transparent; color:var(--ink); border-bottom-color:var(--ink); box-shadow:none; }
.right .tabs button svg { display:none; }
.right .tabp { gap:0; }
.right .stybody-empty { background:transparent; border-radius:var(--r3); }
.right .p-head { border-bottom:1px solid var(--line); padding:13px 16px; }
.ph-ic { background:var(--ink); color:var(--panel); border-radius:var(--r2); }
.right #styTarget { background:var(--accent-soft); color:var(--ink); border-radius:var(--r1); }
.right .seg.pills button[aria-pressed="true"], .right .seg button[aria-pressed="true"] { color:var(--ink); }
.right .tgl .icon-btn[aria-pressed="true"] { background:var(--accent-soft); color:var(--ink); border-color:var(--accent-line); }
.right input[type=range]::-webkit-slider-thumb { background:var(--panel-2); border:2px solid var(--ink); box-shadow:none; }
.right .stybody-empty .mock b { background:var(--words); color:#15222B; }
.lookstage { border-radius:var(--r2); background:#1B2227; }
.right .presets .ptile, .presets.strip .ptile { border-radius:var(--r2); }
.pbtn[aria-pressed="true"] .ptile { border-color:var(--ink); box-shadow:0 0 0 1px var(--ink); }

/* ---------- floating things: dialogs, menus, toasts ---------- */
.scrim { background:rgba(12,18,22,.55); backdrop-filter:blur(2px); }
.modal { border-radius:var(--r3); border:1px solid var(--line-2); box-shadow:var(--shadow); background:var(--panel); }
.modal header { border-bottom:1px solid var(--line); }
.toast { border-radius:var(--r2); background:var(--ink); color:var(--panel); box-shadow:var(--shadow); }
.toast button { color:var(--words); }
.stabs { background:transparent; border-radius:0; padding:0; border-bottom:1px solid var(--line); gap:2px; }
.stabs button { border-radius:0; border-bottom:2px solid transparent; margin-bottom:-1px; padding:9px 14px; color:var(--ink-3); }
.stabs button[aria-selected="true"] { background:transparent; color:var(--ink); border-bottom-color:var(--ink); box-shadow:none; }
.stabs .newtag { background:var(--words); color:#15222B; border-radius:var(--r1); letter-spacing:0; }
.mtile { border-radius:var(--r3); }
.mtile:hover, .mtile:focus-visible { border-color:var(--ink); box-shadow:none; }
.mtile[aria-pressed="true"] { border-color:var(--ink); background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--ink); }
.mstage { border-radius:var(--r2); }
.platbar { border-radius:var(--r2); box-shadow:var(--shadow); }

/* lane edges: the colour of a lane's left edge says what lives in it */
.thead:has(.tic[style*="--panel-3"]) { --lane:var(--sound); }
.thead:has(.tic[style*="--cc0"]) { --lane:var(--cc0-line); }
.thead:has(.tic[style*="--cc1"]) { --lane:var(--cc1-line); }
.thead:has(.tic[style*="--cc2"]) { --lane:var(--cc2-line); }
.thead:has(.tic[style*="--cc3"]) { --lane:var(--cc3-line); }
.tic { background:transparent; color:var(--ink-2); }
.cue.sel { background:color-mix(in srgb, var(--words) 8%, var(--panel)); }
.lookstage, .mstage { background:var(--stage-bg); box-shadow:inset 0 0 0 1px rgba(255,255,255,.07); }
.presets .ptile { background:var(--stage-bg); border-color:var(--line-2); }

/* labels are words, not shouting: sentence case, ink, a little weight. Where a label marks a group, a hairline above it does the dividing. */
.sec > h3, .keys h3, .ex-sec > h4, .cut-clip, .hgap, .t-gap .gl { text-transform:none; letter-spacing:0; font-size:12.5px; font-weight:650; color:var(--ink); }
.ex-sec > h4 { font-size:12.5px; margin-bottom:2px; }
.hgap, .t-gap .gl { font-size:11px; font-weight:600; color:var(--ink-3); height:20px; }
.cut-clip { font-size:12px; color:var(--ink-2); }
.fpop .fi small { text-transform:none; letter-spacing:0; font-size:10.5px; }
.ex-sec { border-top:1px solid var(--line); padding-top:14px; }
.ex-sec:first-child { border-top:0; padding-top:0; }
.ex-opt, .ex-card { border-radius:var(--r2); }
.ex-cards button { border-radius:var(--r2); }
.ex-cards button[aria-pressed="true"] { border-color:var(--ink); background:var(--accent-soft); box-shadow:0 0 0 1px var(--ink) inset; }

/* ---- tool palette (Premiere-style): one pill of six tools, the active one is inked ---- */
.toolpal { display:inline-flex; align-items:center; gap:1px; padding:2px; border:1px solid var(--line-2); border-radius:var(--r2); background:var(--panel-2); }
.toolpal .tool.icon { width:28px; height:26px; border-radius:calc(var(--r2) - 2px); color:var(--ink-2); }
.toolpal .tool.icon:hover:not(:disabled) { background:var(--panel-3); color:var(--ink); }
.toolpal .tool[aria-pressed="true"] { background:var(--ink); color:var(--bg, var(--panel)); box-shadow:none; }
.toolpal .tool[aria-pressed="true"]:hover:not(:disabled) { background:var(--ink); color:var(--bg, var(--panel)); }
kbd.mk { font-family:inherit; }
/* the cursor tells which tool is on */
.tl-inner.tool-hand, .tl-inner.tool-hand .blk, .tl-inner.tool-hand .ttrack { cursor:grab; }
.tl-inner.tool-zoom, .tl-inner.tool-zoom .blk, .tl-inner.tool-zoom .ttrack { cursor:zoom-in; }
.tl-inner.tool-marquee, .tl-inner.tool-marquee .blk, .tl-inner.tool-marquee .ttrack { cursor:crosshair; }
.tl-inner.tool-trackfwd .blk { cursor:e-resize; }
.tl-inner.tool-ripple .blk::before, .tl-inner.tool-ripple .blk::after { background:var(--time); opacity:.9; }

/* ---- Auto cut, live view: the recording is drawn and comes alive as it is listened to ---- */
.cut-busy { padding:2px 0 2px; gap:12px; }
.cb-steps { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:4px 16px; font:600 12px var(--font-ui); color:var(--ink-3); }
.cb-steps li { display:flex; align-items:center; gap:7px; transition:color .2s; }
.cb-steps li::before { content:""; width:9px; height:9px; border-radius:50%; border:1.5px solid var(--line-2); background:transparent; transition:background .2s,border-color .2s; }
.cb-steps li.done { color:var(--ink-2); } .cb-steps li.done::before { background:var(--sound); border-color:var(--sound); }
.cb-steps li.now { color:var(--ink); } .cb-steps li.now::before { border-color:var(--words); background:var(--words); animation:cbPulse 1.3s ease-out infinite; }
.cb-top { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:26px; }
.cb-top b { font:650 13px var(--font-ui); color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:pre; }
.cb-stop { display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 9px; border:1px solid var(--line-2); border-radius:var(--r1); background:var(--panel); color:var(--ink-2); font:600 11.5px var(--font-ui); cursor:pointer; }
.cb-stop:hover { color:var(--ink); border-color:var(--ink-3); } .cb-stop svg { width:11px; height:11px; }
.cb-wave { position:relative; height:104px; border:1px solid var(--line-2); border-radius:var(--r2); background:var(--panel-2); overflow:hidden; cursor:pointer; user-select:none; touch-action:manipulation; }
.cb-wave canvas { position:absolute; inset:0; width:100%; height:100%; display:block; }
.cb-parts, .cb-marks, .cb-ok, .cb-looks { position:absolute; inset:0; pointer-events:none; }
.cb-ok i { position:absolute; bottom:0; height:4px; background:var(--sound); opacity:.85; animation:cbIn .3s ease-out both; }
.cb-look { position:absolute; top:0; bottom:0; background:color-mix(in srgb, var(--words) 26%, transparent); box-shadow:inset 0 2px 0 var(--words), inset 0 -2px 0 var(--words); animation:cbBlink 1s ease-in-out infinite; }
.cb-part { position:absolute; top:0; bottom:0; box-shadow:inset -1px 0 0 color-mix(in srgb, var(--line-2) 70%, transparent); }
.cb-part[data-st="busy"] { background:linear-gradient(100deg, transparent 15%, color-mix(in srgb, var(--sound) 30%, transparent) 50%, transparent 85%); background-size:220% 100%; animation:cbScan 1.15s linear infinite; }
.cb-part[data-st="done"] { animation:cbDone .7s ease-out; }
.cb-part[data-st="fail"] { background:repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 22%, transparent) 0 4px, transparent 4px 8px); }
.cb-cut { position:absolute; top:0; bottom:0; pointer-events:auto; cursor:pointer; background:color-mix(in srgb, var(--time) 30%, transparent); box-shadow:inset 1px 0 0 var(--time), inset -1px 0 0 var(--time); transform-origin:50% 0; animation:cbDrop .38s cubic-bezier(.2,1.4,.4,1) both; }
.cb-cut:hover { background:color-mix(in srgb, var(--time) 52%, transparent); }
.cb-cut.k-silence { background:repeating-linear-gradient(135deg, color-mix(in srgb, var(--time) 34%, transparent) 0 3px, transparent 3px 6px); box-shadow:none; }
.cb-ph { position:absolute; top:0; bottom:0; width:2px; margin-left:-1px; background:var(--ink); pointer-events:none; box-shadow:0 0 0 1px color-mix(in srgb, var(--panel) 60%, transparent); }
.cb-hov { position:absolute; top:0; bottom:0; width:1px; background:var(--ink-3); pointer-events:none; }
.cb-hov span { position:absolute; top:4px; left:5px; padding:1px 5px; border-radius:var(--r1); background:var(--ink); color:var(--panel); font:500 10.5px var(--font-mono); white-space:nowrap; }
.cb-hov.flip span { left:auto; right:5px; }
.cb-help { margin:-4px 0 0; font-size:11.5px; line-height:1.45; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cb-help.now { color:var(--ink-2); } .cb-help.now::before { content:""; display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:var(--words); animation:cbPulse 1.3s ease-out infinite; }
.cb-stats { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.cb-stats > div { padding:9px 12px; border-left:1px solid var(--line); display:grid; gap:1px; } .cb-stats > div:first-child { border-left:0; padding-left:2px; }
.cb-stats b { font:600 20px/1.15 var(--font-mono); color:var(--ink); font-variant-numeric:tabular-nums; }
.cb-stats > div:nth-child(2) b { color:var(--time); }
.cb-stats span { font-size:11.5px; color:var(--ink-3); }
.cut-busy .exprog { height:4px; } .cut-busy .hint { margin:-4px 0 0; }
.cb-feed { height:min(176px,24vh); overflow:auto; scrollbar-width:thin; border:1px solid var(--line); border-radius:var(--r2); background:var(--panel); }
.cb-feed:empty { display:grid; place-items:center; } .cb-feed:empty::before { content:"Lines show up here as they are heard. Cuts are marked in red."; font-size:12px; color:var(--ink-3); }
.cb-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; padding:6px 8px 6px 10px; border-bottom:1px solid var(--line); animation:cbIn .32s ease-out both; }
.cb-row:last-child { border-bottom:0; }
.cb-row.find { background:color-mix(in srgb, var(--time) 7%, var(--panel)); box-shadow:inset 3px 0 0 var(--time); }
.cb-t { font:500 11.5px var(--font-mono); color:var(--ink-3); min-width:34px; }
.cb-tx { font-size:12.5px; line-height:1.4; color:var(--ink); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cb-hear { width:26px; height:24px; display:inline-grid; place-items:center; border:1px solid var(--line-2); border-radius:var(--r1); background:var(--panel); color:var(--ink-2); cursor:pointer; }
.cb-hear svg { width:13px; height:13px; } .cb-hear:hover { color:var(--ink); border-color:var(--ink-3); }
.cb-hear.on-air { background:var(--ink); color:var(--panel); border-color:var(--ink); }
@keyframes cbScan { from { background-position:120% 0; } to { background-position:-100% 0; } }
@keyframes cbPulse { 0% { box-shadow:0 0 0 0 color-mix(in srgb, var(--words) 60%, transparent); } 100% { box-shadow:0 0 0 7px transparent; } }
@keyframes cbDone { from { background:color-mix(in srgb, var(--sound) 38%, transparent); } to { background:transparent; } }
@keyframes cbDrop { from { transform:scaleY(0); opacity:0; } to { transform:scaleY(1); opacity:1; } }
@keyframes cbBlink { 50% { background:color-mix(in srgb, var(--words) 10%, transparent); } }
@keyframes cbIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
@media (max-width:520px) { .cb-help { white-space:normal; min-height:2.9em; } .cb-stats { grid-template-columns:repeat(2,1fr); } .cb-stats > div:nth-child(3) { border-left:0; padding-left:2px; } .cb-wave { height:88px; } }
@media (prefers-reduced-motion:reduce) { .cb-part[data-st="busy"], .cb-steps li.now::before, .cb-row, .cb-cut, .cb-look, .cb-ok i, .cb-part[data-st="done"] { animation:none; } }

/* ---- video export, live view: the settings are locked and replaced by what is happening ---- */
.ex-cfg, .ex-live { display:grid; gap:16px; } .ex-cfg[hidden], .ex-live[hidden] { display:none; }
.exl-main { display:grid; grid-template-columns:minmax(0,290px) minmax(0,1fr); gap:16px; align-items:stretch; }
.exl-frame { position:relative; height:166px; display:grid; place-items:center; background:#000; border:1px solid var(--line-2); border-radius:var(--r2); overflow:hidden; }
.exl-frame canvas { display:block; max-width:100%; max-height:100%; }
.exl-rec { position:absolute; top:8px; left:8px; display:inline-flex; align-items:center; gap:6px; padding:2px 8px 2px 7px; border-radius:var(--r1); background:rgba(0,0,0,.62); color:#fff; font:600 10.5px var(--font-mono); letter-spacing:.07em; }
.exl-rec::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--time); animation:exBlink 1.1s ease-in-out infinite; }
.exl-rec[data-s="save"]::before, .exl-rec[data-s="prep"]::before { background:var(--words); }
.exl-lock { display:grid; align-content:start; gap:10px; padding:12px 14px; border:1px dashed var(--line-2); border-radius:var(--r2); background:var(--panel-2); }
.exl-lock b { display:flex; align-items:center; gap:7px; font:650 12.5px var(--font-ui); color:var(--ink); } .exl-lock b svg { width:14px; height:14px; color:var(--ink-2); }
.exl-lock small { font-size:11.5px; line-height:1.45; color:var(--ink-3); }
.exl-chips { display:flex; flex-wrap:wrap; gap:6px; }
.exl-chips span { display:inline-flex; align-items:center; height:22px; padding:0 8px; border-radius:var(--r1); background:var(--panel-3); color:var(--ink-2); font:500 11.5px var(--font-mono); }
.exl-wave { height:78px; cursor:default; }
.exl-wave .cb-ph { background:var(--time); }
.exl-why { white-space:normal; min-height:2.9em; margin:-4px 0 0; }
.ex-live .cb-stats b { font-size:19px; }
@keyframes exBlink { 50% { opacity:.25; } }
@media (max-width:640px) { .exl-main { grid-template-columns:1fr; } .exl-frame { height:150px; } }
@media (prefers-reduced-motion:reduce) { .exl-rec::before { animation:none; } }
#exFile:disabled { opacity:.6; cursor:not-allowed; }
.ex-live .cb-stats > div:nth-child(2) b { color:var(--ink); }
/* The timeline scroll bar stays on screen. A thin "overlay" bar hides itself on a Mac as soon as the mouse is still, and once zoomed in there was then nothing to grab. */
.tl-scroll::-webkit-scrollbar { width:13px; height:13px; }
.tl-scroll::-webkit-scrollbar-track { background:var(--panel-2); }
.tl-scroll::-webkit-scrollbar-thumb { background:var(--line-2); border:3px solid var(--panel-2); border-radius:9px; min-width:48px; min-height:48px; }
.tl-scroll::-webkit-scrollbar-thumb:hover, .tl-scroll::-webkit-scrollbar-thumb:active { background:var(--ink-3); }
.tl-scroll::-webkit-scrollbar-corner { background:var(--panel-2); }
.exl-ask { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--time); border-radius:var(--r2); background:color-mix(in srgb, var(--time) 9%, var(--panel)); }
.exl-ask[hidden] { display:none; } .exl-ask p { margin:0; flex:1 1 260px; font-size:12.5px; line-height:1.45; color:var(--ink); }
.exl-ask > div { display:flex; gap:8px; } .exl-ask #exStop { background:var(--time); border-color:var(--time); color:#fff; }

/* ---- phone and tablet ---- */
@media (pointer:coarse) { .toolpal .tool.icon { width:38px; height:34px; } .toolpal { padding:3px; } .cb-hear { width:34px; height:32px; } .exl-ask .btn { min-height:40px; } }
@media (max-width:900px) {
  .rail { background:var(--panel); border-color:var(--line-2); }
  .rbtn { border-radius:var(--r2); }
  .rbtn svg.i { width:20px; height:20px; }
  .left, .right { background:var(--panel); border-color:var(--line-2); }
  .topbar { padding-left:calc(var(--gl) - 2px); }
  .tl-bar::after { content:""; flex:none; width:2px; }
  .toolpal { flex:none; }
}
@media (max-width:640px) {
  .modal header { padding-left:16px; } .modal footer { padding:12px 16px calc(14px + env(safe-area-inset-bottom,0px)); } .m-body { padding-inline:16px; }
  .exl-main { grid-template-columns:1fr; }
}
@media (max-width:900px) {
  .rbtn { padding:4px 2px; border-radius:var(--r2); }
  .rbtn[aria-selected="true"]::before { left:50%; right:auto; top:-7px; bottom:auto; width:26px; height:3px; margin-left:-13px; border-radius:0 0 3px 3px; }   /* a tab bar marks the open tab on its top edge */
}
@media (max-width:640px) {
  :root { --gut:112px; }
  .thead { padding:0 4px; gap:4px; } .tn { display:none; } .tic { width:24px; height:24px; }
  .tbs .tb { min-width:0; width:28px; min-height:0; height:32px; }
}
@media (max-width:1100px) and (max-height:520px) {
  .rbtn[aria-selected="true"]::before { left:0; right:auto; top:8px; bottom:8px; width:3px; height:auto; margin:0; border-radius:0 2px 2px 0; }
}
@media (max-width:900px) { .left { height:min(66dvh,640px); } .right { height:min(48dvh,460px); } }   /* the style sheet is lower, so the caption stays in sight while it is styled */
@media (max-width:640px) { .astrip { display:none; } }
@media (max-width:1100px) and (max-height:520px) { .left, .right { height:auto; } }
/* On a phone a dialog is a sheet whose buttons stay in reach: the middle scrolls, the title and the buttons do not. */
@media (max-width:640px) {
  .modal { display:flex; flex-direction:column; overflow:hidden; }
  .modal > header, .modal > footer, .modal > nav { flex:none; }
  .modal > .m-body { flex:1 1 auto; min-height:0; overflow:auto; -webkit-overflow-scrolling:touch; }
  .modal footer { border-top:1px solid var(--line); background:var(--panel); }
}
.tl-bar { overflow-x:auto; scrollbar-width:none; } .tl-bar::-webkit-scrollbar { display:none; }   /* a toolbar wider than the window scrolls sideways instead of being cut off */
.tl-bar .grp:first-child { flex:none; }
@media (max-width:900px) { .app { min-height:0; } .topbar { height:46px; } }
@media (max-width:1100px) and (max-height:520px) { .topbar { height:40px; } }
@media (max-width:1100px) and (max-height:520px) {   /* a phone held sideways: give the picture what height there is */
  .body { --tl-h:clamp(108px,40dvh,170px); }
  .pv-bar { padding:3px 8px; } .bgrow, #guidesBtn { display:none; }
  .pv-transport { padding:3px 8px; } .pv-transport .play { width:38px; height:38px; }
  .tl-bar { padding:3px 8px; }
}

/* ---------- AI editor panel ---------- */
#pane-ai { min-height:0; }
.ai-top { flex:none; display:grid; gap:6px; padding:0 16px 12px; border-bottom:1px solid var(--line); }
.ai-top > label { font-size:12px; font-weight:500; color:var(--ink-2); }
.ai-top .hint { font-size:11px; line-height:1.45; }
/* once a chat has started the model's label and price line are not needed: the model row, the caption model and the usage stay, and the chat gets the room (hover the model for its details) */
#pane-ai.ai-compact .ai-top { gap:4px; padding-bottom:8px; }
#pane-ai.ai-compact #aiModelLbl, #pane-ai.ai-compact #aiModelInfo { display:none; }
#pane-ai.ai-compact .ai-mdl-btn { height:30px; }
.ai-cap > summary { cursor:pointer; font-size:12px; color:var(--ink-2); list-style:none; display:flex; align-items:center; gap:6px; padding:2px 0; user-select:none; }
.ai-cap > summary::-webkit-details-marker { display:none; }
.ai-cap > summary::before { content:""; flex:none; width:6px; height:6px; border-right:1.6px solid var(--ink-3); border-bottom:1.6px solid var(--ink-3); transform:rotate(-45deg); transition:transform .15s; margin:0 3px 0 1px; }
.ai-cap[open] > summary::before { transform:rotate(45deg); }
.ai-cap > summary:hover { color:var(--ink); }
.ai-cap > summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
.ai-cap-b { display:grid; gap:6px; padding:6px 0 2px; }
.ai-log { flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:14px 16px; scrollbar-width:thin; scrollbar-color:var(--line-2) transparent; overscroll-behavior:contain; }
.ai-m { font-size:13px; line-height:1.55; overflow-wrap:anywhere; }
.ai-m.user { align-self:flex-end; max-width:88%; padding:7px 12px; border-radius:12px 12px 3px 12px; background:var(--accent); color:var(--accent-ink); }
.ai-m.bot { align-self:flex-start; max-width:96%; padding:8px 12px; border:1px solid var(--line); border-radius:3px 12px 12px 12px; background:var(--panel-2); color:var(--ink); }
.ai-m.note { font-size:12px; color:var(--ink-3); text-align:center; }
.ai-m.err { padding:8px 11px; border-radius:var(--r3); background:var(--danger-soft); color:var(--danger); font-size:12.5px; }
.ai-m.step { display:flex; flex-wrap:wrap; align-items:center; gap:4px 9px; padding:1px 0 1px 3px; font-size:12px; line-height:1.4; color:var(--ink-2); }
.ai-m.step i { flex:none; width:7px; height:7px; border-radius:50%; background:var(--line-2); }
.ai-m.step.run i { background:var(--time); animation:aiPulse 1s ease-in-out infinite; }
.ai-m.step.ok i { background:var(--sound); }
.ai-m.step.err i { background:var(--danger); }
.ai-m.step .r { color:var(--ink-3); font-family:var(--font-mono); font-size:11px; }
.ai-m.step.err .r { color:var(--danger); font-family:inherit; }
.ai-m.step img { flex-basis:100%; width:min(100%,220px); margin:2px 0 4px 16px; border:1px solid var(--line-2); border-radius:var(--r2); display:block; }
.ai-m.wait { display:flex; gap:4px; padding:4px 3px; }
.ai-m.wait i { width:6px; height:6px; border-radius:50%; background:var(--ink-3); animation:aiDot 1.1s ease-in-out infinite; }
.ai-m.wait i:nth-child(2) { animation-delay:.15s; } .ai-m.wait i:nth-child(3) { animation-delay:.3s; }
.ai-m.done { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 10px; border:1px dashed var(--line-2); border-radius:var(--r3); font-size:12px; color:var(--ink-2); }
.ai-m.done button { height:26px; padding:0 10px; border:1px solid var(--line-2); border-radius:var(--r2); background:var(--panel-2); color:var(--ink); font:inherit; font-size:12px; cursor:pointer; }
.ai-m.done button:hover { background:var(--panel-3); }
.ai-foot { flex:none; display:grid; gap:8px; padding:10px 16px 14px; border-top:1px solid var(--line); }
.ai-chips { display:flex; flex-wrap:wrap; gap:6px; }
.ai-chips:empty { display:none; }
.ai-chips button { padding:5px 10px; border:1px solid var(--line-2); border-radius:999px; background:transparent; color:var(--ink-2); font:inherit; font-size:12px; cursor:pointer; text-align:left; }
.ai-chips button:hover { background:var(--panel-3); color:var(--ink); }
.ai-box { display:flex; align-items:flex-end; gap:8px; }
.ai-box textarea { flex:1; min-height:40px; max-height:140px; padding:9px 11px; resize:none; border:1px solid var(--line-2); border-radius:var(--r3); background:var(--panel-2); color:var(--ink); font:inherit; font-size:13px; line-height:1.4; }
.ai-box textarea:focus-visible { outline:2px solid var(--accent); outline-offset:0; border-color:transparent; }
.ai-box .btn { flex:none; width:40px; height:40px; padding:0; border-radius:var(--r3); }
.ai-box .btn.stop { background:var(--time); color:#fff; }
.ai-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:11.5px; color:var(--ink-3); }
.ai-look { display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.ai-look input { margin:0; accent-color:var(--ink); }
.ai-lbl { font-size:12px; font-weight:500; color:var(--ink-2); }
.ai-link { padding:2px 4px; border:0; background:none; color:var(--ink-2); font:inherit; font-size:12px; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.ai-link:hover { color:var(--ink); }

/* the model picker: a button that opens a searchable list (the list has hundreds of models) */
.ai-mdl { position:relative; }
.ai-mdl-btn { display:flex; align-items:center; gap:8px; width:100%; height:36px; padding:0 10px; border:1px solid var(--line-2); border-radius:var(--r2); background:var(--panel-2); color:var(--ink); font:inherit; font-size:13px; font-weight:500; text-align:left; cursor:pointer; }
.ai-mdl-btn:hover:not(:disabled) { border-color:var(--ink-3); }
.ai-mdl-btn:focus-visible { outline:2px solid var(--accent); outline-offset:0; border-color:transparent; }
.ai-mdl-btn:disabled { opacity:.6; cursor:default; }
.ai-mdl-btn .n { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-mdl-btn .tg:not(:empty), .ai-b { flex:none; padding:1px 7px; border-radius:999px; background:var(--panel-3); color:var(--ink-2); font-size:10.5px; font-weight:600; line-height:1.5; letter-spacing:.01em; }
.ai-mdl-btn > svg.i { flex:none; width:14px; height:14px; color:var(--ink-3); transition:transform .15s; }
.ai-mdl-btn[aria-expanded="true"] > svg.i { transform:rotate(180deg); }
.ai-b.free, .ai-mdl-btn .tg.free { background:var(--accent-soft); color:var(--sound); box-shadow:inset 0 0 0 1px var(--sound); }
.ai-mdl-pop { position:absolute; z-index:40; left:0; right:0; top:calc(100% + 4px); display:flex; flex-direction:column; max-height:420px; border:1px solid var(--line-2); border-radius:var(--r3); background:var(--panel); box-shadow:0 14px 34px rgba(0,0,0,.32); overflow:hidden; }
.ai-mdl-q { flex:none; display:flex; align-items:center; gap:8px; padding:0 10px; border-bottom:1px solid var(--line); }
.ai-mdl-q svg.i { flex:none; width:14px; height:14px; color:var(--ink-3); }
.ai-mdl-q input { flex:1; min-width:0; height:38px; padding:0; border:0 !important; background:transparent !important; color:var(--ink); font:inherit; font-size:13px; outline:none !important; }
.ai-mdl-f { flex:none; display:flex; align-items:center; gap:6px; padding:7px 10px; border-bottom:1px solid var(--line); }
.ai-mdl-f button { padding:3px 10px; border:1px solid var(--line-2); border-radius:999px; background:transparent; color:var(--ink-2); font:inherit; font-size:11.5px; cursor:pointer; }
.ai-mdl-f button:hover { background:var(--panel-3); color:var(--ink); }
.ai-mdl-f button[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.ai-mdl-f span { margin-left:auto; font-size:11px; color:var(--ink-3); white-space:nowrap; }
.ai-mdl-list { flex:1; min-height:0; overflow-y:auto; padding:4px; scrollbar-width:thin; scrollbar-color:var(--line-2) transparent; overscroll-behavior:contain; }
.ai-mdl-list .g { padding:9px 8px 3px; font-size:10.5px; font-weight:650; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); }
.ai-opt { display:grid; gap:1px; padding:6px 28px 6px 8px; border-radius:var(--r2); cursor:pointer; position:relative; }
.ai-opt .l1 { display:flex; align-items:center; gap:6px; min-width:0; font-size:13px; font-weight:500; color:var(--ink); }
.ai-opt .l1 > span:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-opt .l2 { font-size:11px; color:var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-opt:hover, .ai-opt.act { background:var(--panel-3); }
.ai-opt[aria-selected="true"]::after { content:""; position:absolute; right:10px; top:50%; width:5px; height:10px; margin-top:-7px; border:solid var(--sound); border-width:0 2px 2px 0; transform:rotate(45deg); }
.ai-opt.custom .l1 { color:var(--ink); }
.ai-mdl-empty { padding:14px 10px; font-size:12px; color:var(--ink-3); }

/* what this project has used so far: one line, opens into the details */
.ai-use { flex:none; position:relative; z-index:20; border-bottom:1px solid var(--line); }
.ai-use-h { display:flex; align-items:center; gap:10px; width:100%; padding:8px 16px; border:0; background:transparent; color:var(--ink-2); font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.ai-use-h:hover { background:var(--accent-soft); }
.ai-use-h .pn { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); font-weight:550; }
.ai-use-h .tot { flex:none; display:inline-flex; align-items:baseline; gap:5px; font-family:var(--font-mono); font-size:11.5px; color:var(--ink-3); white-space:nowrap; }
.ai-use-h .tot b { color:var(--ink); font-weight:600; }
.ai-use-h .tot em { font-style:normal; color:var(--time); }
.ai-use-h > svg.i { flex:none; width:13px; height:13px; color:var(--ink-3); transition:transform .15s; }
.ai-use-h[aria-expanded="true"] > svg.i { transform:rotate(180deg); }
.ai-use.tick .tot b { animation:aiTick .7s ease-out; }
@keyframes aiTick { 0% { color:var(--time); transform:translateY(-1px); } 100% { color:var(--ink); transform:none; } }
.ai-use-d { position:absolute; left:0; right:0; top:100%; display:grid; gap:10px; overflow-y:auto; padding:6px 16px 12px; border-bottom:1px solid var(--line-2); background:var(--panel); box-shadow:0 14px 28px rgba(0,0,0,.28); font-size:12px; color:var(--ink-2); scrollbar-width:thin; scrollbar-color:var(--line-2) transparent; overscroll-behavior:contain; }   /* opens over the chat: never pushes the message box off a short panel */
.ai-ut { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.ai-ut th, .ai-ut td { padding:3px 0; text-align:right; font-weight:400; }
.ai-ut thead th { font-size:11px; color:var(--ink-3); }
.ai-ut tbody th { text-align:left; color:var(--ink-3); }
.ai-ut td { font-family:var(--font-mono); font-size:11.5px; color:var(--ink); }
.ai-ut td.pj { font-weight:600; }
.ai-ut tr.sum th, .ai-ut tr.sum td { border-top:1px solid var(--line); padding-top:5px; }
.ai-bar { display:flex; height:6px; border-radius:3px; overflow:hidden; background:var(--panel-3); }
.ai-bar i { display:block; height:100%; transition:width .4s; } .ai-bar i:first-child { background:var(--sound); } .ai-bar i:last-child { background:var(--words); }
.ai-key { display:flex; gap:12px; font-size:11px; color:var(--ink-3); } .ai-key span::before { content:""; display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; background:var(--sound); } .ai-key span + span::before { background:var(--words); }
.ai-by { display:grid; gap:3px; } .ai-by > div { display:flex; justify-content:space-between; gap:10px; font-size:11.5px; } .ai-by > div span:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .ai-by > div span:last-child { flex:none; font-family:var(--font-mono); color:var(--ink-3); }
.ai-use-d .hint { font-size:11px; line-height:1.45; }

/* the chats of every project */
.ai-hist { flex:1; min-height:0; display:flex; flex-direction:column; }
.ai-hist-h { flex:none; display:flex; align-items:center; gap:8px; padding:10px 16px 6px; font-size:12.5px; }
.ai-hist-list { flex:1; min-height:0; overflow-y:auto; display:grid; align-content:start; gap:2px; padding:0 10px 14px; scrollbar-width:thin; scrollbar-color:var(--line-2) transparent; overscroll-behavior:contain; }
.ai-ph { display:grid; gap:1px; padding:8px 6px 6px; } .ai-ph b { font-size:13px; font-weight:600; } .ai-ph small, .ai-pg summary small { font-size:11.5px; color:var(--ink-3); }
.ai-oh { margin:14px 6px 2px; font-size:10.5px; font-weight:650; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); }
.ai-pg { border-top:1px solid var(--line); } .ai-pg:first-of-type { border-top:0; }
.ai-pg summary { display:grid; gap:1px; padding:8px 6px; cursor:pointer; list-style:none; position:relative; border-radius:var(--r2); } .ai-pg summary::-webkit-details-marker { display:none; }
.ai-pg summary::after { content:""; position:absolute; right:10px; top:50%; width:6px; height:6px; margin-top:-5px; border:solid var(--ink-3); border-width:0 1.5px 1.5px 0; transform:rotate(45deg); transition:transform .15s; } .ai-pg[open] summary::after { transform:rotate(-135deg); margin-top:-2px; }
.ai-pg summary:hover { background:var(--accent-soft); } .ai-pg summary b { font-size:13px; font-weight:550; padding-right:22px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-chat { display:flex; align-items:center; gap:4px; border-radius:var(--r2); } .ai-chat:hover { background:var(--panel-3); } .ai-chat.on { background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent-line); }
.ai-chat .open { flex:1; min-width:0; display:grid; gap:1px; padding:7px 6px; border:0; background:none; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.ai-chat .open b { font-size:12.5px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .ai-chat .open small { font-size:11px; color:var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-chat .del { flex:none; width:auto; min-width:24px; padding:0 6px; margin-right:4px; font:inherit; font-size:11.5px; } .ai-chat .del.sure { background:var(--danger-soft); color:var(--danger); }
.ai-hnote { margin:12px 6px 0 !important; line-height:1.5; }
.ai-ro { flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 16px; border-bottom:1px solid var(--line); background:var(--accent-soft); font-size:12px; color:var(--ink-2); } .ai-ro span { min-width:0; overflow-wrap:anywhere; }
#pane-ai.busy .p-head h2::after { content:""; display:inline-block; width:7px; height:7px; margin-left:8px; border-radius:50%; background:var(--time); animation:aiPulse 1s ease-in-out infinite; }
@keyframes aiPulse { 0%,100% { opacity:.35; transform:scale(.8); } 50% { opacity:1; transform:scale(1.15); } }
@keyframes aiDot { 0%,80%,100% { opacity:.25; } 40% { opacity:1; } }
@media (prefers-reduced-motion: reduce) { .ai-m.step.run i, .ai-m.wait i, #pane-ai.busy .p-head h2::after { animation:none; } }
@media (pointer:coarse) { .ai-box textarea { font-size:16px; } }   /* iOS zooms into smaller text fields */
@media (max-width:640px) { .ai-top .hint { display:none; } .ai-top { padding-bottom:10px; } .ai-foot { padding-bottom:10px; } .ai-chips button { padding:4px 9px; } }   /* a phone sheet is short: the chat gets the room */

/* ---------- pictures (image clips) ---------- */
/* z-index:0 makes the layer its own stacking context: the pictures' own z-index (which track is in front) then stays inside it and can never lift a picture above the captions. */
#pics { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
#pics img { position:absolute; max-width:none; max-height:none; user-select:none; -webkit-user-drag:none; }
.blk.pic .film { opacity:.95; }


/* ---------- dedicated full-page sign-in screen (no studio behind it) ---------- */
[hidden] { display:none !important; }
.auth-screen {
  position:fixed; inset:0; overflow:auto; display:grid; place-items:center; padding:24px;
  background:radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--sound) 14%, transparent), transparent 60%), var(--bg);
}
.auth-card {
  width:100%; max-width:420px; padding:32px 28px; border-radius:14px;
  background:var(--panel); border:1px solid var(--line); box-shadow:var(--shadow);
  display:grid; gap:14px; text-align:center;
}
.auth-brand { display:inline-flex; align-items:center; justify-content:center; gap:10px; margin-bottom:4px; }
.auth-brand .logo { width:28px; height:28px; }
.auth-brand b { font-size:17px; font-weight:700; letter-spacing:-.02em; }
.auth-brand span { font-size:17px; color:var(--ink-3); margin-left:3px; }
.auth-card h1 { margin:0; font-size:21px; font-weight:700; letter-spacing:-.02em; color:var(--ink); }
.auth-sub { margin:0; font-size:13px; color:var(--ink-2); line-height:1.5; }
.auth-providers { display:grid; gap:10px; margin-top:6px; }
.oauth-btn {
  display:flex; align-items:center; justify-content:center; gap:10px;
  height:42px; padding:0 16px; border-radius:8px; font-size:13.5px; font-weight:600;
  text-decoration:none; transition:transform .08s, background .15s, border-color .15s;
}
.oauth-btn:active { transform:scale(.99); }
.oauth-google { background:#fff; color:#15222B; border:1px solid #D3D9DC; }
.oauth-google:hover { background:#F5F6F6; }
.oauth-apple { background:#000; color:#fff; border:1px solid #2F373E; }
.oauth-apple:hover { background:#181B1F; }
.oauth-btn.is-unconfigured { opacity:.72; }
.auth-setup-note {
  text-align:left; padding:10px 12px; border-radius:8px; font-size:11.5px; line-height:1.5;
  background:color-mix(in srgb, var(--words) 10%, var(--panel-2)); border:1px solid color-mix(in srgb, var(--words) 35%, var(--line));
  color:var(--ink-2); display:grid; gap:5px;
}
.auth-setup-note b { color:var(--ink); }
.auth-setup-note code { font-family:var(--font-mono); font-size:11px; background:var(--panel-3); padding:1px 4px; border-radius:4px; word-break:break-all; }
.auth-foot { margin:4px 0 0; font-size:11.5px; color:var(--ink-3); }

/* ---------- dedicated admin console ---------- */
.admin-console { min-height:100dvh; display:flex; flex-direction:column; background:var(--bg); color:var(--ink); }
.adm-topbar {
  position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  min-height:52px; padding:8px 18px; background:var(--panel); border-bottom:1px solid var(--line);
}
.adm-topbar .brand { display:flex; align-items:center; gap:8px; }
.adm-topbar .brand .logo { width:24px; height:24px; }
.adm-topbar .brand b { font-size:14.5px; }
.adm-topbar .brand span { font-size:12px; color:var(--sound); font-weight:600; margin-left:6px; padding:2px 7px; border-radius:99px; background:color-mix(in srgb, var(--sound) 14%, transparent); }
.adm-nav { display:flex; gap:4px; background:var(--panel-3); padding:3px; border-radius:8px; }
.adm-nav button {
  height:30px; padding:0 12px; border:0; border-radius:6px; background:transparent;
  color:var(--ink-2); font:inherit; font-size:12.5px; font-weight:550; cursor:pointer;
}
.adm-nav button[aria-selected="true"] { background:var(--panel-2); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.18); }

.adm-main { width:100%; max-width:1360px; margin:0 auto; padding:20px 18px 40px; display:grid; gap:18px; }
.adm-kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:12px; }
.adm-kpi {
  padding:14px 16px; border-radius:10px; background:var(--panel); border:1px solid var(--line);
  display:grid; gap:4px;
}
.adm-kpi .k-lbl { font-size:11.5px; color:var(--ink-3); font-weight:550; text-transform:uppercase; letter-spacing:.04em; }
.adm-kpi .k-val { font-size:22px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--ink); }
.adm-kpi .k-sub { font-size:11.5px; color:var(--ink-2); font-variant-numeric:tabular-nums; }

.adm-panel { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px; }
.adm-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.adm-bar h2, .adm-bar h3 { margin:0; font-size:15px; font-weight:650; }
.adm-filters { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.adm-inp, .adm-sel { height:32px; padding:0 10px; border:1px solid var(--line-2); border-radius:6px; background:var(--panel-2); color:var(--ink); font:inherit; font-size:12.5px; }
.adm-inp { min-width:220px; }

.adm-table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:8px; }
.adm-table { width:100%; border-collapse:collapse; font-size:12.5px; text-align:left; }
.adm-table th {
  padding:9px 12px; font-size:11px; font-weight:650; text-transform:uppercase; letter-spacing:.04em;
  color:var(--ink-3); background:var(--panel-2); border-bottom:1px solid var(--line); white-space:nowrap;
}
.adm-table td { padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.adm-table tbody tr:last-child td { border-bottom:0; }
.adm-table tbody tr:hover { background:var(--accent-soft); }
.adm-table .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.adm-table .muted { color:var(--ink-3); }
.adm-table code { font-family:var(--font-mono); font-size:11.5px; background:var(--panel-3); padding:2px 5px; border-radius:4px; }
.adm-empty { text-align:center; padding:28px !important; color:var(--ink-3); }

.adm-badge { display:inline-block; padding:2px 7px; border-radius:99px; font-size:11px; font-weight:600; background:var(--panel-3); color:var(--ink-2); }
.adm-badge.admin { background:color-mix(in srgb, var(--words) 20%, transparent); color:var(--words); }
.adm-badge.user, .adm-badge.u { background:color-mix(in srgb, var(--sound) 18%, transparent); color:var(--sound); }
.adm-badge.c { background:color-mix(in srgb, var(--words) 18%, transparent); color:var(--words); }
.adm-badge.s { background:var(--accent-soft); color:var(--ink); }
.adm-badge.g { background:rgba(66,133,244,.16); color:#6ea8fe; }
.adm-badge.a { background:var(--panel-3); color:var(--ink); }
.adm-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--ink-3); margin-right:5px; vertical-align:middle; }
.adm-dot.on { background:var(--sound); box-shadow:0 0 0 3px color-mix(in srgb, var(--sound) 22%, transparent); }
.adm-actions { display:flex; gap:5px; flex-wrap:wrap; }
.btn.sm { height:26px; padding:0 9px; font-size:11.5px; }

.adm-split { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:14px; }
.adm-card { padding:14px; border-radius:8px; background:var(--panel-2); border:1px solid var(--line); display:grid; gap:10px; align-content:start; }
.adm-card h3 { margin:0; font-size:14px; font-weight:650; }
.adm-form { display:grid; gap:10px; }
.adm-cfg-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.adm-cfg-item { padding:10px; border-radius:6px; background:var(--panel); border:1px solid var(--line); display:grid; gap:3px; }
.adm-cfg-item span { font-size:11px; color:var(--ink-3); }
.adm-cfg-item b { font-size:14px; font-variant-numeric:tabular-nums; }
