/* Agnostik Cut: the dark NLE look, warm. Blue stays for focus, selection and the playhead (as in every NLE);
   Meander's warm golds and clays carry the picks, notes and anything that needs a person's attention. */
/* Every colour, size, radius, shadow and timing is a token in tokens.css. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs)/1.45 var(--ui); overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
kbd { font: 10.5px var(--mono); background: var(--raise); border: 1px solid var(--edge2); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 4px; color: var(--bright); }
code { font: 11px var(--mono); background: var(--well); padding: 1px 4px; border-radius: var(--r-xs); }
.dim { color: var(--dim); } .small { font-size: 11px; } .mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--tog-off); border-radius: var(--r-m); border: 2px solid var(--panel); } ::-webkit-scrollbar-track { background: transparent; }

.btn { border: 1px solid var(--edge2); background: var(--raise); border-radius: var(--r-s); padding: 3px 11px; color: var(--text); white-space: nowrap; transition: background var(--t), border-color var(--t); }
.btn:hover { border-color: var(--edge3); background: var(--raise-hover); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.danger { background: var(--danger-bg); border-color: var(--danger-edge); color: var(--danger-text); }
.btn.big { padding: 8px 16px; font-size: 13px; }
.field { width: 100%; background: var(--well); border: 1px solid var(--edge2); border-radius: var(--r-s); color: var(--bright); padding: 6px 9px; font: 13px var(--ui); }
.field:focus { outline: none; border-color: var(--blue); }

/* ---------- layout: workspaces as in Premiere ---------- */
/* Edit's tracks come from the splitters (js/panels.js): --col-bin is the bin's width, --col-src Source's. The middle
   column is their difference, so either can be the wider; .wide-bin swaps which of them spans it. */
.app { height: 100vh; display: grid; grid-template-rows: var(--bar-h) minmax(0, 1fr) minmax(var(--timeline-min), var(--row-tl, var(--timeline-h))); gap: var(--gutter); padding: 0 var(--gutter) var(--gutter);
  --cb: var(--col-bin, 34%); --cs: var(--col-src, calc(50% + var(--gutter)));
  grid-template-columns: min(var(--cb), var(--cs)) max(0px, calc(max(var(--cb), var(--cs)) - min(var(--cb), var(--cs)) - var(--gutter))) minmax(0, 1fr);
  grid-template-areas: "bar bar bar" "src src prg" "bin tl tl"; }
@media (min-width: 821px) { .app.ws-edit.wide-bin { grid-template-areas: "bar bar bar" "src prg prg" "bin bin tl"; } }
.app > .bar { grid-area: bar; } #srcPanel { grid-area: src; } #prgPanel { grid-area: prg; } #binPanel { grid-area: bin; } #tlPanel { grid-area: tl; } #logPanel { grid-area: log; display: none; }

.bar { display: flex; align-items: center; gap: 14px; padding: 0 6px; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; color: var(--bright); letter-spacing: .01em; }
.logo { width: 18px; height: 18px; border-radius: var(--r); background: var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 23 16 8l7 15' fill='none' stroke='%23f0b94a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M11.5 18h9' stroke='%23e8e2d8' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E") center/100%; border: 1px solid var(--edge); }
.proj { color: var(--bright); font-weight: 600; padding: 4px 8px; border-radius: var(--r-s); display: inline-flex; gap: 6px; align-items: baseline; }
.proj:hover { background: var(--panel2); }
.proj .client { color: var(--dim); font-weight: 500; } .proj .slash { color: var(--faint); }
.caret { color: var(--dim); font-size: 10px; margin-left: 4px; }
.badge { font-size: 10.5px; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); border-radius: var(--r-pill); padding: 0 8px; cursor: help; }
.bar .ws { display: flex; gap: 2px; background: var(--panel); border-radius: var(--r-m); padding: 2px; margin-left: 6px; }
.bar .ws button { color: var(--dim); padding: 3px 12px; border-radius: var(--r-s); }
.bar .ws button:hover { color: var(--bright); }
.bar .ws button.on { color: var(--bright); background: var(--raise); box-shadow: inset 0 -2px var(--blue); }
.bar .sp { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--edge); border-radius: var(--r-pill); padding: 2px 11px 2px 9px; color: var(--text); }
.pill:hover { border-color: var(--edge2); background: var(--panel); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.ok i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.pill.part i { background: var(--warn); }
.pill.none { color: var(--star); border-color: color-mix(in srgb, var(--star) 45%, transparent); }
.pill.none i { background: var(--star); }
.iconbtn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--edge); color: var(--dim); font-weight: 600; }
.iconbtn:hover { color: var(--bright); border-color: var(--edge2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--star) 22%, var(--panel2)); color: var(--star); font-weight: 700; border: 1px solid color-mix(in srgb, var(--star) 40%, transparent); }

.panel { background: var(--panel); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; position: relative; transition: box-shadow var(--t-mid); }
.panel.focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 70%, transparent); }
.tabs { display: flex; gap: 2px; height: var(--tab-h); align-items: flex-end; padding: 0 8px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { padding: 5px 9px 6px; color: var(--dim); border-radius: var(--r-xs) 3px 0 0; }
.tabs button:hover { color: var(--bright); }
.tabs button.on { color: var(--bright); box-shadow: inset 0 -2px var(--blue); }
.tabs .title { padding: 5px 9px 6px; color: var(--bright); font-weight: 600; box-shadow: inset 0 -2px var(--blue); }
.tabs .extra { margin-left: auto; padding-bottom: 7px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; }

/* ---------- monitors ---------- */
.screen { flex: 1; min-height: 0; background: var(--black); display: flex; align-items: center; justify-content: center; position: relative; }
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; }
.screen .msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); text-align: center; padding: 20px; line-height: 1.7; }
.screen .msg b { color: var(--text); }
.screen .msg .btn { margin-top: 10px; }
.screen .words { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px 10px; background: linear-gradient(transparent, var(--caption-fade)); color: var(--caption); font-size: 14px; line-height: 1.4; text-align: center; pointer-events: none; text-wrap: balance; }
.screen .words:empty { display: none; }
.screen .words span.on { color: var(--caption-on); }
.scrub { height: var(--scrub-h); background: var(--panel2); position: relative; flex: none; cursor: pointer; border-top: 1px solid var(--line); }
.scrub .marks { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--blue) 30%, transparent); border-left: 2px solid var(--blue); border-right: 2px solid var(--blue); }
.scrub .head { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: var(--bright); box-shadow: 0 0 0 1px var(--clip-edge); }
.transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 10px; flex: none; }
.transport .tc { font: 600 var(--fs-tc) var(--mono); color: var(--blue); letter-spacing: .02em; }
.transport .tc.dur { color: var(--dim); font-weight: 400; text-align: right; font-size: 13px; }
.btns { display: flex; gap: 2px; }
.btns button { min-width: 30px; height: 26px; border-radius: var(--r-s); color: var(--bright); font-size: 13px; padding: 0 6px; }
.btns button:hover { background: var(--sel); }
#smarkin, #smarkout { font-family: var(--mono); color: var(--blue); font-weight: 700; }
.srcinfo { padding: 2px 10px 8px; color: var(--dim); display: flex; gap: 8px; align-items: center; flex: none; min-height: 30px; }
.srcinfo .who { color: var(--c); filter: brightness(1.4); font-weight: 600; white-space: nowrap; }
.srcinfo .q { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srcinfo .flag { color: var(--warn); white-space: nowrap; }
.srcinfo .pickbar { flex: none; }

/* ---------- picks: ★ ✕ ⚠ and notes ---------- */
.pickbar { display: inline-flex; gap: 2px; }
.pb { width: 26px; height: 22px; border-radius: var(--r-s); border: 1px solid var(--edge); background: var(--well2); color: var(--faint); font-size: 12px; line-height: 1; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.pb:hover { color: var(--text); border-color: var(--edge2); }
.pb-star.on { color: var(--on-star); background: var(--star); border-color: var(--star); }
.pb-reject.on { color: var(--on-accent); background: var(--reject); border-color: var(--reject); }
.pb-warn.on { color: var(--on-warn); background: var(--warn); border-color: var(--warn); }
.pb-note.on { color: var(--note); border-color: color-mix(in srgb, var(--note) 60%, transparent); }
.pk { font-size: 11px; margin-right: 3px; white-space: nowrap; }
.pk sup { font: 600 8.5px var(--ui); margin-left: 1px; opacity: .8; vertical-align: super; }
.pk-star { color: var(--star); } .pk-reject { color: var(--reject); } .pk-warn { color: var(--warn); }
.notes { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.nl { color: var(--note); background: color-mix(in srgb, var(--note) 8%, transparent); border-left: 2px solid var(--note); padding: 2px 8px; border-radius: 0 3px 3px 0; user-select: text; }
.nl b { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; background: color-mix(in srgb, var(--note) 25%, transparent); font-size: 9.5px; margin-right: 6px; }
.noteedit { margin-top: 6px; }
.noteedit textarea { width: 100%; background: var(--well); color: var(--bright); border: 1px solid var(--note); border-radius: var(--r-s); padding: 6px 8px; font: var(--fs)/1.45 var(--ui); resize: vertical; }
.noteedit textarea:focus { outline: none; }
.noteedit .row { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 4px; }
.noteedit .row .dim { margin-right: auto; font-size: 11px; }

/* ---------- bin ---------- */
.search { margin: 6px 8px 4px; flex: none; }
.search input, .lfilters input[type=search] { width: 100%; background: var(--well); border: 1px solid var(--edge); border-radius: var(--r-s); color: var(--bright); padding: 4px 9px; font: 12px var(--ui); }
.search input:focus, .lfilters input[type=search]:focus { outline: none; border-color: var(--blue); }
.binpicks, .seg { display: flex; gap: 2px; align-items: center; flex: none; }
.binpicks { padding: 0 8px 6px; flex-wrap: wrap; }
.binpicks button, .seg button { padding: 1px 8px; border-radius: var(--r-pill); color: var(--dim); border: 1px solid transparent; }
.binpicks button:hover, .seg button:hover { color: var(--bright); }
.binpicks button.on, .seg button.on { color: var(--bright); border-color: var(--edge2); background: var(--raise); }
.binpicks label, .lfilters label { color: var(--dim); display: inline-flex; gap: 4px; align-items: center; margin-left: 8px; white-space: nowrap; }
.list { overflow: auto; flex: 1; min-height: 0; }
.grp { position: sticky; top: 0; background: var(--panel2); padding: 4px 8px; color: var(--bright); font-weight: 600; z-index: 1; border-bottom: 1px solid var(--line); cursor: pointer; }
.grp.static { cursor: default; }
.grp .caret { margin: 0 6px 0 0; }
.grp .n { color: var(--dim); font-weight: 400; margin-left: 6px; }
.grp.closed + .rows { display: none; }
.item, .hit { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 46px 14px; gap: 8px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--row-line); }
.hit { grid-template-columns: 10px minmax(0, 1fr); cursor: pointer; }
.item:hover, .hit:hover { background: var(--hover); }
.item.sel { background: var(--blue-dim); }
.item i, .hit i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.item .nm, .hit .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--bright); }
.hit .nm { white-space: normal; color: var(--text); }
.hit mark { background: color-mix(in srgb, var(--star) 35%, transparent); color: var(--bright); border-radius: 2px; padding: 0 1px; }
.item .nm small, .hit .nm small { color: var(--dim); margin-left: 6px; }
.devstar { color: var(--star); font-size: 9px; margin-right: 5px; vertical-align: 1px; }
.item .d { color: var(--dim); font: 11px var(--mono); text-align: right; }
.item .f { color: var(--warn); }
.none { padding: 16px; color: var(--faint); }

/* ---------- timeline ---------- */
.cuttabs { align-items: center; padding: 0 8px 0 6px; }
.cutbar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cutname { color: var(--bright); font-weight: 650; padding: 3px 8px; border-radius: var(--r-s); font-size: 13px; box-shadow: inset 0 -2px var(--blue); white-space: nowrap; }
.cutname:hover { background: var(--panel2); }
.ver { color: var(--dim); padding: 2px 6px; border-radius: var(--r-s); white-space: nowrap; }
.ver:hover { background: var(--panel2); color: var(--text); }
.warn { color: var(--warn); }
.dirty { color: var(--star); white-space: nowrap; }
.saved { color: var(--faint); }
.cutbar .btn { padding: 2px 10px; }
.tlwrap { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--heads-w) 1fr; overflow: hidden; }
.heads { background: var(--panel2); border-right: 1px solid var(--line); padding-top: var(--ruler-h); overflow: hidden; }
.heads > div { height: var(--track-v); display: flex; align-items: center; gap: 4px; padding: 0 6px 0 4px; border-bottom: 1px solid var(--line); color: var(--dim); font-weight: 600; }
.heads > div.a { height: var(--track-a); } .heads > div.a.open { height: var(--ruler-h); }
.heads > div.sub { height: var(--track-sub); font-weight: 400; padding-left: 10px; }
.heads .tw { width: 16px; color: var(--dim); font-size: 10px; padding: 0; }
.heads .tw:hover { color: var(--on-accent); }
.heads .dots { display: flex; gap: 3px; margin-left: auto; }
.heads .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--track-off); }
.heads .dots i.on { background: var(--s); }
.heads .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.heads .tog { width: 26px; height: 18px; border-radius: var(--r-xs); font-size: 10.5px; background: var(--tog-off); color: var(--dim); }
.heads .tog.on { background: var(--s); color: var(--on-star); }
.heads > div.sub.off .nm { color: var(--faint); text-decoration: line-through; }
.heads .lab { background: var(--blue-dim); color: var(--on-accent); border-radius: var(--r-xs); padding: 1px 5px; font-size: 11px; }
.scroll { overflow-x: auto; overflow-y: hidden; position: relative; }
#lane { position: relative; min-width: 100%; min-height: 100%; }
.ruler { height: var(--ruler-h); position: relative; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--well2); }
.ruler .tick { position: absolute; bottom: 0; width: 1px; background: var(--tick); height: 6px; }
.ruler .tick.big { height: 12px; background: var(--tick-big); }
.ruler .tick span { position: absolute; left: 3px; bottom: 9px; font: 10px var(--mono); color: var(--dim); white-space: nowrap; }
.track { height: var(--track-v); position: relative; border-bottom: 1px solid var(--line); }
.track.spacer { height: var(--ruler-h); background: var(--well2); }
.track.a { height: var(--track-a); } .track.a.sub { height: var(--track-sub); }
.track.a.off .clip { opacity: .3; }
.clip { position: absolute; top: 3px; bottom: 3px; border-radius: var(--r-s); background: var(--c); overflow: hidden; cursor: grab; border: 1px solid var(--clip-edge); }
.track.v .clip { background: linear-gradient(color-mix(in srgb, var(--c) 92%, var(--on-accent)), color-mix(in srgb, var(--c) 78%, var(--black))); }
.track.a .clip { background: color-mix(in srgb, var(--c) 40%, var(--audio-tint)); }
.clip .t { padding: 3px 7px; color: var(--on-accent); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--text-shadow); }
.clip .t small { opacity: .8; margin-left: 5px; font-weight: 400; }
.clip canvas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; opacity: .6; }
.clip.sel { outline: 2px solid var(--on-accent); outline-offset: -2px; z-index: 1; }
.clip.drag { opacity: .45; }
/* trimmed away from the logged bite: a dashed edge on that side */
.clip.tl { border-left: 2px dashed var(--trim-mark); }
.clip.tr { border-right: 2px dashed var(--trim-mark); }
.hd { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; }
.hd.l { left: 0; } .hd.r { right: 0; }
.hd::after { content: ""; position: absolute; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--on-accent); opacity: 0; transition: opacity var(--t-fast); }
.hd.l::after { left: 1px; } .hd.r::after { right: 1px; }
.clip:hover .hd::after { opacity: .45; }
.hd:hover::after { opacity: 1 !important; background: var(--star); }
body.trimming, body.trimming * { cursor: ew-resize !important; }
.trimtip { position: absolute; display: none; z-index: 6; background: var(--tip-bg); border: 1px solid var(--star); color: var(--text); border-radius: var(--r); padding: 4px 9px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-tip); }
.trimtip b { color: var(--star); font-size: 13px; margin-right: 8px; }
.trimtip span { font: 11px var(--mono); color: var(--dim); }
.ins { position: absolute; top: var(--ruler-h); bottom: 0; width: 2px; background: var(--star); display: none; z-index: 3; pointer-events: none; box-shadow: 0 0 8px var(--star); }
.playhead { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--blue); z-index: 4; pointer-events: none; }
.playhead::before { content: ""; position: absolute; top: 0; left: -6px; border: 6px solid transparent; border-top: 10px solid var(--blue); }
.empty { position: absolute; left: 0; right: 0; top: var(--ruler-h); bottom: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); pointer-events: none; }
.zoom { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-top: 1px solid var(--line); flex: none; color: var(--dim); }
.zoom input { width: 120px; accent-color: var(--blue); }
.zoom .sp { flex: 1; }
.zoom .hint { color: var(--faint); margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom button { color: var(--dim); padding: 1px 7px; border-radius: var(--r-xs); white-space: nowrap; }
.zoom button:hover { background: var(--sel); color: var(--bright); }

/* ---------- log ---------- */
.lfilters { display: flex; gap: 6px 4px; flex-wrap: wrap; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); flex: none; }
.lfilters .chips { display: flex; gap: 4px; flex-wrap: wrap; width: 100%; }
.lfilters input[type=search] { width: auto; flex: 1; min-width: 160px; }
.chip { border: 1px solid var(--edge); border-radius: var(--r-pill); padding: 1px 9px 1px 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.chip i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.chip[aria-pressed="false"] { opacity: .35; }
.log { overflow: auto; flex: 1; min-height: 0; padding: 4px 12px 40px; }
.log .act { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--warn); margin: 22px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--edge); }
.log .act:first-child { margin-top: 8px; }
.log .seq { margin: 14px 0 6px; scroll-margin-top: 8px; }
.log .seq.allhidden .cards { display: none; }
.log .seq-h { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; }
.log .seq-h .num { font: 600 11px var(--mono); color: var(--blue); }
.log .seq-h h3 { font-size: 14px; color: var(--bright); margin: 0; font-weight: 600; }
.log .seq-h .sum { color: var(--dim); font: 400 11px var(--mono); margin-left: 8px; white-space: nowrap; }
.log .voices, .log .note, .log .also-line, .log .cards, .log .intro, .log .tbd { margin-left: 30px; }
.log .voices, .log .intro { color: var(--dim); margin-top: 1px; }
.log .note, .log .tbd { color: var(--faint); font-style: italic; }
.log .also-line { color: var(--dim); font-size: 11px; margin-top: 4px; }
.log a { color: var(--blue); text-decoration: none; }
.log .cards { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.card { display: grid; grid-template-columns: 3px 1fr auto; gap: 10px; padding: 7px 8px 7px 0; border-radius: var(--r); background: var(--panel2); border: 1px solid transparent; transition: border-color var(--t), background var(--t); }
.card:hover { border-color: var(--edge); }
.card.cur { border-color: var(--blue); }
.card.m-star { background: color-mix(in srgb, var(--star) 7%, var(--panel2)); }
.card.m-reject { opacity: .55; } .card.m-reject:hover { opacity: 1; }
.card.hidden { display: none; }
.card .cbar { background: var(--c); border-radius: var(--r-xs) 0 0 3px; }
.card .body { min-width: 0; }
.card .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.card .who { font-weight: 600; color: var(--c); filter: brightness(1.4); }
.card .tc { color: var(--dim); font: 11px var(--mono); }
.card .pkb { margin-left: auto; }
.card .gist { color: var(--bright); font-weight: 600; }
.card .q { color: var(--dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; margin-top: 1px; user-select: text; }
.card .q.open { -webkit-line-clamp: unset; color: var(--text); }
.card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.card.ghost { --c: var(--faint); opacity: .7; }
.tag { font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 0 5px; border-radius: var(--r-xs); border: 1px solid var(--edge); color: var(--dim); }
.tag.release, .tag.sensitive { border-color: var(--warn); color: var(--warn); }
.tag.star { border-color: color-mix(in srgb, var(--star) 50%, transparent); color: var(--star); }
.tag a { color: inherit; }
.card .acts { display: flex; flex-direction: column; gap: 3px; align-items: stretch; }
.card .acts > button { border: 1px solid var(--edge); background: var(--well2); border-radius: var(--r-s); padding: 2px 8px; white-space: nowrap; color: var(--text); }
.card .acts > button:hover { border-color: var(--edge2); }
.card .acts > button.in { background: var(--blue-dim); border-color: var(--blue-dim); color: var(--on-accent); }
.card .acts .pickbar { margin-top: 2px; }
.total { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--panel2); border-radius: var(--r); padding: 9px 12px; margin-top: 8px; }
.total b { font-size: 18px; color: var(--bright); }
.md { max-width: 780px; color: var(--muted); line-height: 1.55; user-select: text; padding-top: 6px; }
.md h2 { color: var(--bright); font-size: 15px; margin: 18px 0 6px; }
.md h3 { color: var(--bright); font-size: 13px; margin: 14px 0 4px; }
.md b { color: var(--bright); }
.md table { border-collapse: collapse; margin: 6px 0; }
.md td, .md th { border: 1px solid var(--edge); padding: 3px 6px; text-align: left; vertical-align: top; }
.problems { border: 1px solid var(--warn); color: var(--warn); border-radius: var(--r-s); padding: 6px 10px; margin: 8px 0; }

/* ---------- dialogs, menus, first run ---------- */
.modal, .welcome { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 20; }
.modal { background: var(--scrim); backdrop-filter: blur(2px); }
.modal.on, .welcome.on { display: flex; }
.dlg { background: var(--panel); border: 1px solid var(--edge2); border-radius: var(--r-l); width: min(480px, 92vw); padding: 18px; box-shadow: var(--shadow-dlg); animation: pop var(--t-mid) ease-out; max-height: 88vh; display: flex; flex-direction: column; }
.dlg.wide { width: min(820px, 94vw); }
.dlg h2 { margin: 0 0 8px; font-size: 15px; color: var(--bright); }
.dlg p { color: var(--dim); margin: 0 0 10px; }
.dlg p b { color: var(--text); }
.dlg .ver { margin: -4px 0 10px; font: var(--fs-xs)/1.4 var(--mono); color: var(--dim); user-select: text; }
.dlg .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.dlg textarea#cmd { width: 100%; height: 190px; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--edge); border-radius: var(--r); font: 11px/1.5 var(--mono); padding: 10px; user-select: text; resize: vertical; flex: none; }
.extable { overflow: auto; min-height: 0; border: 1px solid var(--edge); border-radius: var(--r); }
.extable table { border-collapse: collapse; width: 100%; }
.extable td { padding: 3px 8px; border-bottom: 1px solid var(--menu-bg); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.extable td.n { color: var(--faint); width: 24px; text-align: right; }
.extable .k { font-size: 11px; } .k-logged { color: var(--dim); } .k-words { color: var(--star); } .k-exact { color: var(--warn); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.keys h3 { color: var(--bright); font-size: 12px; margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .08em; }
.kr { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 3px 0; color: var(--dim); border-bottom: 1px solid var(--row-line2); }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
.menu { position: fixed; z-index: 30; background: var(--menu-bg); border: 1px solid var(--edge2); border-radius: var(--r-m); padding: 4px; min-width: 220px; max-width: 420px; max-height: 70vh; overflow: auto; box-shadow: var(--shadow-menu); animation: pop var(--t-fast) ease-out; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 5px 10px; border-radius: var(--r-s); color: var(--text); }
.menu button:hover { background: var(--blue-dim); color: var(--on-accent); }
.menu button.on { color: var(--bright); box-shadow: inset 2px 0 var(--blue); }
.menu button.danger { color: var(--danger-menu); }
.menu button small { color: var(--dim); font-size: 11px; }
.menu button:hover small { color: var(--blue-text); }
.menu button em { font-style: normal; font-size: 10px; color: var(--star); margin-left: 6px; text-transform: uppercase; letter-spacing: .05em; }
.menu .sep { height: 1px; background: var(--edge); margin: 4px 2px; }
.menu .mh { padding: 5px 10px 3px; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.welcome { background: var(--welcome-glow); }
.wcard { width: min(520px, 92vw); background: var(--panel); border: 1px solid var(--edge2); border-radius: var(--r-xl); padding: 26px 28px; box-shadow: var(--shadow-card); animation: pop var(--t-slow) ease-out; }
.wcard .brand { margin-bottom: 18px; }
.wcard h1 { font-size: 21px; color: var(--bright); margin: 0 0 8px; font-weight: 650; letter-spacing: -.01em; }
.wcard p { color: var(--dim); margin: 0 0 14px; font-size: 13px; }
.wcard .who { display: flex; gap: 10px; margin: 16px 0; }
.wcard .who .btn { flex: 1; display: flex; align-items: center; gap: 10px; justify-content: center; padding: 12px; }
.wcard .who .btn b { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--star) 22%, var(--panel2)); color: var(--star); }
.wcard .other { display: flex; gap: 8px; }
.wcard .hint { background: var(--well); border: 1px dashed var(--edge2); border-radius: var(--r-m); padding: 9px 12px; margin: 0 0 14px; font: 12px/1.5 var(--mono); color: var(--text); }
.wcard .status { border-radius: var(--r-m); padding: 8px 12px; margin: 0 0 14px; background: var(--panel2); }
.wcard .status.ok { border-left: 3px solid var(--ok); } .wcard .status.part { border-left: 3px solid var(--warn); }
.wcard .status details { margin-top: 4px; color: var(--dim); font: 11px/1.5 var(--mono); }
.wcard .row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.wcard .row .sp { flex: 1; }
.wcard.loading { text-align: center; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 8px); background: var(--toast-bg); border: 1px solid var(--edge2); color: var(--bright); padding: 7px 15px; border-radius: var(--r-m); opacity: 0; transition: opacity var(--t-mid), transform var(--t-mid); pointer-events: none; z-index: 40; box-shadow: var(--shadow-toast); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  body { overflow: auto; }
  .app { height: auto; grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "bar" "src" "prg" "log" "bin" "tl"; }
  .bar { flex-wrap: wrap; height: auto; padding: 6px; }
  .screen { aspect-ratio: 16/9; flex: none; }
  #binPanel, #logPanel { height: 60vh; }
  .tl { height: 260px; }
  .zoom .hint { display: none; }
}

/* ---------- multicam: an angle beside the main camera ---------- */
.screen .angle { position: absolute; inset: 0; display: none; }
.screen[data-cam="B"] .angle:not(.idle) { display: block; }
.screen.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-items: center; }
.screen.dual video { position: static; display: block; height: auto; aspect-ratio: 16/9; cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color var(--t); }
.screen.dual .angle.idle { visibility: hidden; display: block; }
.screen.dual[data-cam="A"] #sv, .screen.dual[data-cam="A"] #pv { outline-color: var(--cam-a); }
.screen.dual[data-cam="B"] .angle { outline-color: var(--cam-b); }
.camtag { position: absolute; top: 8px; display: none; font: 600 var(--fs-xs) var(--ui); color: var(--bright); background: var(--scrim); padding: 1px 7px; border-radius: var(--r-pill); pointer-events: none; }
.camtag.on { background: var(--blue); }
.camtag[data-cam="B"].on { background: var(--cam-b); color: var(--on-warn); }
.screen.dual .camtag { display: block; }
.screen.dual .camtag[data-cam="A"] { left: 8px; } .screen.dual .camtag[data-cam="B"] { left: calc(50% + 8px); }
.screen:not(.split)[data-cam="B"] .camtag[data-cam="B"] { display: block; left: 8px; }
.angbtn { margin-left: 8px; margin-bottom: 4px; padding: 1px 8px !important; border: 1px solid var(--edge); border-radius: var(--r-pill) !important; color: var(--dim); align-self: center; }
.angbtn.on { color: var(--bright); border-color: var(--cam-b); }
.clip .mc { color: var(--on-accent); opacity: .85; margin-left: 5px; font-weight: 400; }
.camseg { position: absolute; top: 0; height: 6px; background: var(--cc); pointer-events: none; }
.camseg span { position: absolute; top: 6px; left: 3px; font: 600 9.5px var(--ui); color: var(--on-accent); text-shadow: var(--text-shadow); white-space: nowrap; }
.track.v .clip .t { padding-top: 8px; }
.camseg.miss { background: repeating-linear-gradient(135deg, var(--cc) 0 4px, transparent 4px 8px); }
.k-cam { color: var(--cam-b); }

/* ---------- tags, rights, context, operations ---------- */
.tagline { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tv { font-size: var(--fs-s); color: var(--text); background: var(--well2); border: 1px solid var(--edge); border-radius: var(--r-xs); padding: 0 6px; white-space: nowrap; }
.tv i { font-style: normal; color: var(--faint); margin-right: 4px; font-size: var(--fs-xs); }
.tagfs { display: flex; gap: 4px; flex-wrap: wrap; width: 100%; }
.tagfs select, .total select { background: var(--well); color: var(--text); border: 1px solid var(--edge); border-radius: var(--r-s); padding: 2px 6px; font: var(--fs) var(--ui); max-width: 220px; }
.tagfs select.on { border-color: var(--star); color: var(--bright); }
.r-cleared { color: var(--ok); } .r-pending, .r-sensitive { color: var(--warn); } .r-restricted { color: var(--reject); } .r-none { color: var(--faint); }
.rpill { border: 1px solid currentColor; border-radius: var(--r-pill); padding: 0 8px; font-size: var(--fs-s); white-space: nowrap; }
.ctx { padding: 10px 14px 40px; user-select: text; }
.ctx.empty { color: var(--faint); padding: 24px; }
.ctx h2 { margin: 0 0 2px; font-size: var(--fs-l); color: var(--bright); }
.ctx h3 { margin: 18px 0 6px; font-size: var(--fs-s); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ctx h3 .dim { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.ctxhead { border-bottom: 1px solid var(--edge); padding-bottom: 10px; }
.ctxpicks { margin-top: 8px; }
.lnk { color: var(--blue); font-size: var(--fs-s); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.rights { display: flex; flex-direction: column; gap: 6px; }
.rrow { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; background: var(--panel2); border-radius: var(--r); padding: 6px 10px; }
.rrow .lvl { color: var(--faint); font-size: var(--fs-s); }
.rrow .tname { color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .btn { padding: 1px 9px; }
.rnote { grid-column: 2 / -1; color: var(--text); }
.rnote small, .hrow small { display: block; color: var(--faint); font-size: var(--fs-s); }
.hist { display: flex; flex-direction: column; gap: 5px; }
.hrow { color: var(--text); border-left: 2px solid var(--edge2); padding-left: 8px; }
.hrow b { color: var(--bright); margin-right: 4px; }
.tx { color: var(--dim); line-height: 1.7; }
.tx.v-tx, .tx[data-clip] { max-width: 760px; }  /* the transcript reads in a column; grid, filmstrip and table fill the panel */
.tx p { margin: 0 0 8px; }
.tx span { cursor: pointer; border-radius: 2px; }
.tx span:hover { color: var(--bright); background: var(--hover); }
.tx span.in { color: var(--bright); background: color-mix(in srgb, var(--blue) 22%, transparent); }
.srcfacts { display: flex; flex-direction: column; gap: 4px; }
.srcfacts div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; color: var(--text); word-break: break-all; }
.srcfacts i { font-style: normal; color: var(--faint); }
#binPanel.ctxmode .search, #binPanel.ctxmode .binpicks { display: none; }
.form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.form label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: var(--fs-s); }
.oplist { overflow: auto; max-height: 52vh; border: 1px solid var(--edge); border-radius: var(--r); }
.oprow { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; padding: 6px 10px; border-bottom: 1px solid var(--row-line2); color: var(--text); cursor: pointer; }
.oprow small { grid-column: 2; color: var(--faint); }
.oprow:not(:has(input)) { grid-template-columns: 1fr; } .oprow:not(:has(input)) small { grid-column: 1; }
.menu em.ops { color: var(--blue-text); text-transform: none; }
.seg.fmt { margin-bottom: 10px; }
.seg.fmt button { padding: 3px 12px; }
.dlg .extable td.r-pending, .dlg .extable td.r-sensitive { color: var(--warn); } .dlg .extable td.r-restricted { color: var(--reject); }
.xcheck { border-radius: var(--r); padding: 8px 12px; margin: 0 0 10px; background: var(--panel2); color: var(--dim); border-left: 3px solid var(--edge2); }
.xcheck b { display: block; color: var(--bright); }
.xcheck.ok { border-left-color: var(--ok); } .xcheck.ok b { color: var(--ok); }
.xcheck.bad { border-left-color: var(--reject); } .xcheck.bad b { color: var(--reject); }
.xcheck em { color: var(--reject); font-style: normal; }
.xcheck pre { white-space: pre-wrap; font: var(--fs-s)/1.5 var(--mono); color: var(--text); max-height: 200px; overflow: auto; margin: 6px 0 0; }

/* ---------- transcript lane head, minimap, ⌘K, multicam thumbnails (Instrument soft) ---------- */
.heads > div.t { height: calc(var(--track-t) + 8px); font-weight: 450; }
.heads .tk { background: var(--hot); color: var(--on-hot, #1b0d05); }
.tsep { position: absolute; top: 8px; bottom: 8px; width: 1px; background: var(--edge2); pointer-events: none; }
.track.t { position: relative; user-select: none; }
.mini { height: 18px; flex: none; position: relative; margin: 6px 10px 2px calc(var(--heads-w) + 10px); background: var(--lcd, #000); border-radius: var(--r-s); overflow: hidden; box-shadow: var(--lcd-inset); cursor: pointer; }
.mini .c { position: absolute; top: 4px; bottom: 4px; border-radius: 2px; opacity: .8; }
.mini .view { position: absolute; top: 0; bottom: 0; border: 1px solid var(--bright); border-radius: var(--r-s); background: rgba(255,255,255,.06); pointer-events: none; }
.mini .ph { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--blue); pointer-events: none; }
.mini .m { position: absolute; top: 1px; width: 5px; height: 5px; border-radius: 50%; transform: translateX(-2px); }
.overlay { position: fixed; inset: 0; z-index: 25; display: none; background: rgba(0,0,0,.4); }
.overlay.on { display: grid; }
.pal { align-self: start; justify-self: center; margin-top: 12vh; width: min(660px, 92vw); max-height: 70vh; display: flex; flex-direction: column; border-radius: var(--r-l); overflow: hidden;
  background: color-mix(in srgb, var(--body-hi) 94%, transparent); backdrop-filter: var(--frost); -webkit-backdrop-filter: var(--frost); box-shadow: var(--shadow-dlg), inset 0 0 0 1px var(--edge2); animation: pop var(--t-mid) var(--ease); }
.pal .q { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--edge); background: var(--lcd); }
.pal .q input { flex: 1; background: none; border: 0; outline: none; color: var(--bright); font: 16px var(--ui); }
.pal .list { overflow: auto; min-height: 0; }
.pal .grp { padding: 8px 8px 4px; }
.pal .grp > small { display: block; padding: 4px 8px 6px; color: var(--faint); font-size: var(--fs-s); }
.pal .row { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: var(--r); color: var(--text); cursor: pointer; }
.pal .row.on { background: color-mix(in srgb, var(--blue) 20%, transparent); color: var(--bright); }
.pal .row em { font-style: normal; color: var(--hot); }
.pal .row small { color: var(--dim); white-space: nowrap; }
.pal .row .ic { color: var(--faint); text-align: center; }
.pal .foot { display: flex; gap: 14px; padding: 9px 16px; color: var(--faint); font-size: var(--fs-s); border-top: 1px solid var(--edge); }
.iconbtn { width: auto; min-width: 26px; padding: 0 6px; }
.mcthumbs { display: flex; gap: 8px; align-items: center; padding: 0 12px 10px; flex: none; }
.mcthumbs[hidden] { display: none; }
.mcthumbs button { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; color: var(--dim); font-size: var(--fs-s); }
.mcthumbs canvas { width: 72px; height: 40.5px; border-radius: var(--r-s); background: var(--screen, #000); box-shadow: 0 0 0 1px var(--edge); transition: box-shadow var(--t); }
.mcthumbs button.live canvas { box-shadow: 0 0 0 2px var(--cam-a); }
.mcthumbs button[data-cam="B"].live canvas { box-shadow: 0 0 0 2px var(--cam-b); }
.mcthumbs button.live span { color: var(--bright); }
.mcthumbs button.off canvas { opacity: .35; }
.mcthumbs .hint { color: var(--faint); font-size: var(--fs-s); margin-left: 6px; }

/* ---------- Simple view (js/simple.js): the monitor and the timeline, for a phone ---------- */
.simple-tools { display: none; gap: 6px; }
body.simple { display: block; overflow: hidden; }
body.simple .guide, body.simple .gstrip, body.simple .gedge, body.simple #tipx { display: none !important; }
body.simple .app { height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "bar" "prg" "tl"; }
body.simple #srcPanel, body.simple #binPanel, body.simple #logPanel, body.simple .app > .split, body.simple .app > .gutter { display: none !important; }
body.simple .bar { flex-wrap: nowrap; height: auto; padding: 6px var(--gutter); }
body.simple .bar .phases, body.simple .bar .steps, body.simple .brand, body.simple #palBtn, body.simple #layoutBtn, body.simple #bodyBtn, body.simple #soundBtn, body.simple #keysBtn, body.simple #mediaPill, body.simple #syncPill { display: none; }
body.simple .barrow { flex-wrap: nowrap; width: 100%; }
body.simple .screen { aspect-ratio: 16/9; flex: none; }
body.simple #tlPanel { min-height: 0; height: auto; }
body.simple #trimHint { display: none; }
body.simple .simple-tools { display: inline-flex; }
body.simple .zoom button, body.simple .simple-tools button { min-height: 36px; padding: 0 12px; }
body.simple .bar .barrow { justify-content: space-between; gap: 8px; }
body.simple .bar .bl { min-width: 0; flex: 1; }
body.simple .proj { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
body.simple .bar .br { flex: none; gap: 6px; }
body.simple #pSplit, body.simple #prgPanel .lutkey, body.simple #prgPanel .lutmenu { display: none !important; }
body.simple #snapKey { display: none; }
body.simple .app { --heads-w: 92px; }
body.simple .heads .nm { display: none; }
body.simple .zoom { flex-wrap: wrap; row-gap: 6px; }
body.simple .zoom #zoom { width: 90px; }
body.simple .zoom #clear { display: none; }
body.simple .bar { display: block; }
body.simple .barrow { display: flex !important; flex-wrap: nowrap !important; align-items: center; }
body.simple #tlInfo { display: none; }
body.simple .cuttabs { overflow-x: auto; flex-wrap: nowrap; }
body.simple .cutbar { flex-wrap: nowrap; }
body.simple .zoom > .dim { display: none; }
body.simple .zoom #zoom { width: 64px; }
body.simple .zoom .sp { display: none; }
body.simple .zoom button, body.simple .simple-tools button { padding: 0 8px; }
body.simple .app { --track-v: 96px; --track-sub: 44px; }
/* Colour open on a phone: the grade sits under the picture and the page scrolls to the timeline */
body.simple:has(#prgPanel.colouron) { overflow: auto; }
body.simple .app:has(#prgPanel.colouron) { height: auto; grid-template-rows: auto auto 70dvh; }
body.simple .pcolour { position: static; width: auto; max-height: none; }
body.simple #prgPanel.colouron > :not(.pcolour) { margin-right: 0; }
.track .clip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }  /* press and hold drags (timeline.js), never selects text */
.track.v .clip { touch-action: none; }  /* a touch on a clip is the app's: hold to move, swipe to scroll (timeline.js) */
.simple-zoom { display: none; gap: 6px; margin-left: auto; }
body.simple .simple-zoom { display: inline-flex; }
body.simple .simple-zoom button { min-width: 44px; min-height: 44px; font-size: 22px; line-height: 1; padding: 0; }
body.simple .simple-zoom button:disabled { opacity: .35; }
body.simple .zoom #zoom, body.simple .zoom #fit { display: none; }
body.simple .zoom { flex-wrap: nowrap; gap: 4px; }
body.simple .simple-tools { gap: 4px; }
body.simple .simple-tools button { min-width: 44px; min-height: 44px; font-size: 18px; padding: 0; }
body.simple .zoom #del { min-height: 44px; padding: 0 10px; }
