/* Review Board: black and white. Geist 400/500, hairlines instead of cards, square corners, pastel colour only on comment types.
   Spec: mockup-bw.html. Light theme = the same system inverted (data-theme="light" on <html>). */
:root {
  color-scheme: dark;
  --bg: #0a0a0a; --fg: #f4f4f4; --mute: #8a8a8a; --rule: #1f1f1f; --scrub: #2a2a2a;
  --stage: #000; --ph: #161616; --btn-bg: #f4f4f4; --btn-fg: #0a0a0a;
  --fix: #f4a7a0; --idea: #f6c9a0; --question: #a9d3f5; --request: #c9b8f2; --keep: #a8e4c4;
  --veil: rgba(10, 10, 10, .92);
  --chip-bg: rgba(0, 0, 0, .72); --chip-fg: #f4f4f4;
  /* names app.js still passes to inline styles */
  --fig-red: var(--fix); --fig-orange: var(--idea); --fig-blue: var(--question); --fig-green: var(--keep); --accent: var(--request);
  --font: "Geist", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa; --fg: #111; --mute: #6e6e6e; --rule: #e4e4e4; --scrub: #d4d4d4;
  --btn-bg: #111; --btn-fg: #fafafa;
  --fix: #bd3a30; --idea: #9a5710; --question: #1d6aa9; --request: #6246bd; --keep: #177446;
  --veil: rgba(250, 250, 250, .94);
}
* { box-sizing: border-box; border-radius: 0; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
b, strong { font-weight: 500; }
button, select, input, textarea { font: inherit; color: inherit; }
button {
  background: none; border: 0; cursor: pointer; text-decoration: underline transparent; text-underline-offset: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
button:hover { text-decoration-color: currentColor; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.dim, .small, .hint { color: var(--mute); }
.small, .hint, .hint-key { font-size: 12px; font-variant-numeric: tabular-nums; }
.hint-key { color: var(--mute); }
.eyebrow { font-size: 13px; color: var(--mute); }
code { font: 12px/1.4 var(--font); color: var(--mute); border-bottom: 1px solid var(--rule); }
kbd { font: inherit; color: var(--fg); }
svg.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; flex: none; }

/* ---------- buttons ---------- */
.ib { width: 24px; height: 24px; color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ib:hover { text-decoration: none; color: var(--mute); }
.ib.m { color: var(--mute); }
.ib.m:hover { color: var(--fg); }
.ib[aria-pressed="true"], .ib.on, .ib[aria-expanded="true"] { box-shadow: inset 0 -1px 0 var(--fg); }
.ib.muted { color: var(--mute); box-shadow: none; }
label.ib input { display: none; }
.txt { font-size: 13px; }
.btn { height: 32px; padding: 0 4px; gap: 6px; font-size: 13px; white-space: nowrap; }
.btn.sm { height: 28px; }
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); padding: 0 16px; font-weight: 500; text-decoration: none; }
.btn.primary:hover { text-decoration: underline; text-decoration-color: var(--btn-fg); }
.btn.sm.primary { padding: 0 12px; }
.btn svg.ic { width: 14px; height: 14px; }
label.btn { cursor: pointer; }
label.btn input { display: none; }
.link { font-size: 12px; color: var(--mute); }
.link:hover { color: var(--fg); text-decoration-color: var(--fg); }
.link[aria-pressed="true"] { color: var(--fg); text-decoration-color: var(--fg); }

/* ---------- form fields: hairline underline, no boxes ---------- */
input:not([type]), input[type="search"], textarea {
  background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 8px 0; outline: 0; width: 100%; min-width: 0; font-size: 14px;
}
input:not([type]):focus, input[type="search"]:focus, textarea:focus { border-bottom-color: var(--fg); }
::placeholder { color: var(--mute); opacity: 1; }
textarea { resize: none; line-height: 1.45; }
select {
  appearance: none; -webkit-appearance: none; background: none; border: 0; border-bottom: 1px solid var(--rule); color: var(--fg);
  font-size: 13px; padding: 4px 16px 4px 0; cursor: pointer; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%238a8a8a' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center;
}
select:focus { border-bottom-color: var(--fg); }
option { background: var(--bg); color: var(--fg); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--fg); }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 24px; cursor: pointer; --lo: 0%; --hi: 0%; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, var(--scrub) var(--lo), var(--fg) var(--lo), var(--fg) var(--hi), var(--scrub) var(--hi)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); border: 0; margin-top: -3.5px; }
input[type="range"]::-moz-range-track { height: 1px; background: linear-gradient(to right, var(--scrub) var(--lo), var(--fg) var(--lo), var(--fg) var(--hi), var(--scrub) var(--hi)); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); border: 0; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 24px; height: 48px; padding: 0 24px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.brand .logo { width: 16px; height: 16px; color: var(--fg); }
.picker { position: relative; }
#pickBtn { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
#pickBtn::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.round-tabs { display: flex; gap: 16px; font-size: 13px; }
.round-tabs button { color: var(--mute); text-decoration: none; }
.round-tabs button:hover { color: var(--fg); }
.round-tabs button.active { color: var(--fg); font-weight: 500; }
.round-tabs .dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--mute); margin-left: 6px; }
.pill { font-size: 12px; color: var(--mute); }
.pill.sent, .pill.approved { color: var(--fg); }
.trio { display: flex; gap: 24px; align-items: center; }
.theme-toggle .sun { display: block; } .theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }
.trio .lbl { display: none; }
#skillBtn { width: auto; min-width: 24px; gap: 8px; }
#skillBtn[data-state="queued"] .lbl, #skillBtn[data-state="running"] .lbl { display: inline; font-size: 12px; color: var(--mute); }
#skillBtn[data-state="queued"] svg, #skillBtn[data-state="running"] svg { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* video picker popover */
.pick-menu { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 340px; max-width: 92vw; border: 1px solid var(--rule); background: var(--bg); }
.pick-menu input { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--rule); display: block; }
.pick-list { max-height: min(60vh, 460px); overflow-y: auto; }
.pick-group { padding: 12px 16px 4px; color: var(--mute); font-size: 12px; }
.pick-item { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 8px 16px; cursor: pointer; font-size: 14px; }
.pick-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item .v { color: var(--mute); font-size: 13px; }
.pick-item:hover, .pick-item.hl, .pick-item.cur { background: var(--rule); }
.pick-item.cur { font-weight: 500; }
.pick-empty { color: var(--mute); padding: 12px 16px; font-size: 13px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: minmax(0, 1fr); height: calc(100% - 48px); }
.player-col, .comments-col { min-height: 0; }
.player-col { display: flex; flex-direction: column; min-width: 0; }
.stage {
  position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--stage); padding: 24px;
}
.stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; display: block; background: #000; }
.stage canvas.draw { position: absolute; cursor: crosshair; touch-action: none; }
.stage.annotating video { pointer-events: none; }
.stage.erasing canvas.draw { cursor: none; }
.stage canvas.grade-canvas { position: absolute; pointer-events: none; }
.stage video.hidden { display: none; }
.stage.comparing { padding: 40px 8px 0; gap: 12px; }
.stage.comparing video { max-width: none; max-height: none; flex: none; }
.cmp-bar { position: absolute; top: 6px; left: 0; right: 0; height: 30px; z-index: 3; }
.cmp-bar select { position: absolute; top: 0; color: #f4f4f4; border-bottom-color: #444; }
.cmp-bar select option { background: #0a0a0a; color: #f4f4f4; }
html.player-fs.idle .cmp-bar { opacity: 0; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--mute); line-height: 1.9; }
.empty code { color: var(--mute); }
.overlays { position: absolute; pointer-events: none; left: 0; top: 0; width: 0; height: 0; overflow: hidden; }
.guides { position: absolute; inset: 0; width: 100%; height: 100%; }
.guides .zone rect { fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .75); stroke-width: 1; stroke-dasharray: 14 10; vector-effect: non-scaling-stroke; }
.guides .zone.ads rect { fill: rgba(255, 255, 255, .08); stroke-dasharray: 3 7; }
.guides .lines path { stroke: rgba(255, 255, 255, .55); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }
.speed { position: absolute; top: 16px; left: 16px; font-size: 12px; line-height: 1; padding: 6px 8px; background: var(--chip-bg); color: var(--chip-fg); pointer-events: none; font-variant-numeric: tabular-nums; }
.anno-text { position: absolute; z-index: 5; min-width: 140px; background: var(--chip-bg); color: var(--chip-fg); border: 1px solid #f4f4f4; padding: 4px 8px; font: 500 14px var(--font); }
.anno-text:focus { outline: none; }

/* ---------- transport ---------- */
.transport { border-top: 1px solid var(--rule); flex: none; }
.transport, .anno-bar, .controls { user-select: none; }
.scrub { position: relative; height: 24px; margin-top: 4px; cursor: pointer; }
.scrub-bar { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--scrub); }
.scrub-fill { height: 1px; width: 0; background: var(--mute); }
.markers { position: absolute; inset: 0; }
.marker {
  position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--rc, var(--mute)); cursor: pointer;
}
.marker::after { content: ""; position: absolute; inset: -6px; }
.marker:hover { transform: scale(1.4); }
.marker.resolved { opacity: .3; }
.marker.range { height: 2px; margin: -1px 0 0 0; border-radius: 0; }
.playhead { position: absolute; top: 6px; height: 12px; width: 1px; background: var(--fg); pointer-events: none; }
.playhead::before { content: ""; position: absolute; left: -2.5px; top: -6px; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); }
.range-band { position: absolute; top: 6px; height: 12px; pointer-events: none; background: color-mix(in srgb, var(--fg) 12%, transparent); border-left: 1px solid var(--fg); border-right: 1px solid var(--fg); }
.range-band.open-end { border-right: 1px dashed var(--fg); }
.controls { display: flex; align-items: center; gap: 20px; min-height: 44px; padding: 0 24px; }
.time { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tcur { cursor: text; }
.tc-input { width: 9ch; padding: 1px 0; font-size: 13px; font-variant-numeric: tabular-nums; border-bottom-color: var(--fg); }
.tc-input.bad { background: color-mix(in srgb, var(--fix) 25%, transparent); border-bottom-color: var(--fix); }
.vol { display: inline-flex; align-items: center; gap: 8px; }
.vol input[type="range"] { width: 56px; }
.vol .off { display: none; }
.vol .ib.muted .on { display: none; }
.vol .ib.muted .off { display: block; }
.icons { display: flex; gap: 20px; align-items: center; }
@media (max-width: 1300px) { .controls, .icons { gap: 16px; } #fpsLabel { display: none; } }
.menu-wrap { position: relative; display: flex; }
.menu { position: absolute; bottom: calc(100% + 12px); right: 0; z-index: 20; min-width: 260px; padding: 8px 0; background: var(--bg); border: 1px solid var(--rule); }
.menu label { display: flex; align-items: flex-start; gap: 12px; padding: 8px 16px; cursor: pointer; font-size: 13px; }
.menu label:hover { background: var(--rule); }
.menu input { margin: 2px 0 0; }
.menu small { display: block; color: var(--mute); font-size: 12px; }
.menu-note { margin: 4px 16px 6px; font-size: 12px; color: var(--mute); }
.menu-note:empty { display: none; }
.keys { position: absolute; bottom: calc(100% + 12px); right: 0; z-index: 20; width: 392px; border: 1px solid var(--rule); background: var(--bg); padding: 16px; font-size: 12px; color: var(--mute); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; text-align: left; }
.keys div { display: flex; justify-content: space-between; gap: 12px; }
.keys kbd { color: var(--fg); white-space: nowrap; }

/* annotation bar */
.anno-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 8px 24px; border-bottom: 1px solid var(--rule); }
.anno-bar .group { display: flex; gap: 16px; align-items: center; }
.anno-bar .tool { font-size: 13px; color: var(--mute); }
.anno-bar .tool:hover { color: var(--fg); }
.anno-bar .tool.active { color: var(--fg); text-decoration-color: var(--fg); }
.anno-bar .swatches { gap: 8px; }
.anno-bar .swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--c); padding: 0; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5); text-decoration: none; }
.anno-bar .swatch.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--fg); }
.anno-bar .anno-hint { white-space: nowrap; }
@media (max-width: 1500px) { .anno-bar .anno-hint { display: none; } }

/* ---------- full screen (F): only the video; the transport floats over the bottom and fades when idle ---------- */
.ib.fs .exit { display: none; }
html.player-fs .ib.fs .enter { display: none; }
html.player-fs .ib.fs .exit { display: block; }
html.player-fs, html.player-fs body { height: 100%; overflow: hidden; background: #000; }
html.player-fs .top, html.player-fs .comments-col { display: none; }
html.player-fs .layout { grid-template-columns: minmax(0, 1fr); height: 100%; }
html.player-fs .player-col { position: relative; background: #000; }
html.player-fs .stage { flex: 1; height: auto; padding: 0; }
html.player-fs .speed { top: 24px; left: 24px; }
html.player-fs .transport {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; border-top: 0; transition: opacity .25s; color-scheme: dark;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .55) 60%, transparent);
  --bg: #0a0a0a; --fg: #f4f4f4; --mute: #bdbdbd; --rule: rgba(255, 255, 255, .25); --scrub: rgba(255, 255, 255, .35);
}
html.player-fs.idle .transport { opacity: 0; pointer-events: none; }
html.player-fs.idle { cursor: none; }

/* ---------- comments column ---------- */
.comments-col { display: flex; flex-direction: column; border-left: 1px solid var(--rule); min-height: 0; overflow: hidden; }
.col-tabs { display: flex; gap: 20px; padding: 0 24px; height: 48px; flex: none; align-items: center; border-bottom: 1px solid var(--rule); font-size: 13px; overflow-x: auto; scrollbar-width: none; }
.coltab { color: var(--mute); white-space: nowrap; text-decoration: none; }
.coltab:hover { color: var(--fg); }
.coltab.active { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg); }
.coltab .n { margin-left: 4px; color: var(--mute); }
.coltab.on .n { color: var(--fg); }
.panel { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow-y: auto; }
.panel#panelComments { overflow: hidden; }

.composer { padding: 16px 24px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; flex: none; }
.composer .row { display: flex; align-items: center; gap: 16px; }
.composer .row.head { display: none; }
.composer #ctext { order: 1; font-size: 15px; min-height: 52px; border-bottom-color: var(--fg); }
.composer #typeRow { order: 2; }
.composer #requestRow { order: 3; }
.composer #requestRow input { flex: 1; }
.composer .marks { order: 4; gap: 8px; }
.composer #pending { order: 5; }
.composer #linkRow { order: 6; }
.composer .hint-key { display: none; }
.composer #hint { display: none; }   /* no room in one row: the text field placeholder carries the hint */
.composer #linkToggle { margin-left: auto; }
.type-help { display: none; }
.types { display: flex; gap: 16px; font-size: 13px; }
.types button { color: var(--mute); text-underline-offset: 6px; }
.types button[aria-checked="true"] { color: var(--rc); text-decoration: underline; text-decoration-color: var(--rc); }
.types button[data-v="fix"] { --rc: var(--fix); } .types button[data-v="idea"] { --rc: var(--idea); } .types button[data-v="question"] { --rc: var(--question); }
.types button[data-v="request"] { --rc: var(--request); } .types button[data-v="praise"] { --rc: var(--keep); }
.types button:hover { color: var(--fg); }
.mk { width: 20px; height: 24px; font-size: 15px; color: var(--mute); }
.mk:hover { color: var(--fg); text-decoration: none; }
.mk.set { color: var(--fg); box-shadow: inset 0 -1px 0 var(--fg); }
.at { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.at b { font-weight: 400; color: var(--mute); }
.pending { display: flex; gap: 8px; flex-wrap: wrap; }
.pending:empty { display: none; }
.link-row input { flex: 1; }

.list-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px 0; font-size: 13px; color: var(--mute); flex: none; }
#panelComments .list-head .eyebrow { display: none; }
.count { font-size: 13px; color: var(--mute); }
.toggle { position: relative; cursor: pointer; color: var(--mute); font-size: 13px; text-underline-offset: 4px; }
.toggle input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.toggle:hover { color: var(--fg); }
.toggle:has(input:checked) { color: var(--fg); text-decoration: underline; }
.toggle:has(input:focus-visible) { outline: 1px solid var(--fg); outline-offset: 3px; }

/* comment colour: one variable per type, used by the bar, the tag and the scrub marker */
.fix { --rc: var(--fix); } .idea { --rc: var(--idea); } .question { --rc: var(--question); } .request { --rc: var(--request); } .praise { --rc: var(--keep); }
.comments { flex: 1; overflow-y: auto; padding: 0 0 16px; display: flex; flex-direction: column; }
.comments::-webkit-scrollbar { width: 8px; }
.comments::-webkit-scrollbar-thumb { background: var(--scrub); }
.comment { margin: 0 24px; padding: 16px 0 16px 16px; border-top: 1px solid var(--rule); position: relative; display: flex; flex-direction: column; gap: 4px; flex: none; }
.comment:first-child { border-top: 0; }
.comment::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 2px; background: var(--rc, var(--rule)); }
.comment.active::before { width: 4px; }
.comment.resolved { opacity: .55; }
.comment .head { display: flex; gap: 12px; align-items: baseline; }
.comment .tc { font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; text-underline-offset: 4px; }
.comment .tc:hover { text-decoration: underline; }
.tag { color: var(--rc, var(--mute)); font-weight: 500; text-transform: capitalize; }
.tag.round { color: var(--mute); font-weight: 400; font-size: 12px; margin-left: auto; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mute); }
.ai-badge svg { width: 10px; height: 10px; fill: currentColor; }
.comment .body { white-space: pre-wrap; margin: 0 0 4px; }
.comment .skill { font-size: 12px; color: var(--mute); }
.comment .atts { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.comment .reply { color: var(--mute); white-space: pre-wrap; }
.comment .edited { font-size: 12px; color: var(--mute); }
.comment .thread { margin: 4px 0 0 4px; padding-left: 12px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.comment .te { white-space: pre-wrap; }
.comment .te .who { display: block; font-size: 12px; color: var(--mute); }
.comment .thread .link { align-self: flex-start; }
.comment .treply, .comment .cedit { width: 100%; box-sizing: border-box; font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--rule); padding: 6px 8px; border-radius: 0; }
.comment .cedit { resize: vertical; min-height: 56px; }
.comment .treply:focus, .comment .cedit:focus { outline: none; border-color: var(--fg); }
.comment .foot { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; color: var(--mute); }
.acts { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.comment:hover .acts, .comment.active .acts, .comment:focus-within .acts { opacity: 1; }
.comment .acts label.ib:has(input:checked) { color: var(--fg); }
.comment.flashing { animation: cflash .9s ease-out; }
@keyframes cflash { 0% { box-shadow: 0 0 0 1px var(--fg); } 100% { box-shadow: 0 0 0 1px transparent; } }
.review-card { margin: 16px 24px 0; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; flex: none; }
.review-card .rc-head { display: flex; align-items: center; gap: 12px; }
.review-card .verdict { font-weight: 500; font-size: 13px; }
.review-card .verdict.block { color: var(--fix); } .review-card .verdict.approve { color: var(--keep); }
.review-card p { font-size: 13px; color: var(--mute); }

/* attachments */
.thumb { position: relative; width: 64px; height: 64px; border: 1px solid var(--rule); background: #000; cursor: zoom-in; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb video { pointer-events: none; }
.thumb .kind { position: absolute; left: 4px; bottom: 4px; font-size: 10px; line-height: 1; padding: 3px 4px; background: var(--chip-bg); color: var(--chip-fg); }
.thumb .x { position: absolute; top: 2px; right: 2px; z-index: 2; width: 18px; height: 18px; background: var(--chip-bg); color: var(--chip-fg); font-size: 13px; line-height: 18px; text-decoration: none; }
.thumb.wide { width: 128px; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 8px; background: transparent; }
.thumb.wide .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--mute); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.thumb.wide .nm { font-size: 11px; line-height: 1.25; color: var(--fg); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-all; }

/* frames */
.frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; padding: 16px 24px 24px; }
.frames:empty::after { content: "Press E (or the frame icon) to save the current frame at full resolution."; grid-column: 1 / -1; color: var(--mute); font-size: 13px; }
.frame-card { display: flex; flex-direction: column; gap: 4px; }
.frame-card .pic { aspect-ratio: 1 / 1; background: #000; cursor: zoom-in; display: flex; align-items: center; justify-content: center; }
.frame-card img { max-width: 100%; max-height: 100%; display: block; }
.frame-card .meta { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.frame-card .acts { opacity: 1; flex-wrap: wrap; gap: 4px 12px; }

/* thumbnails */
.thumb-form { padding: 16px 24px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; flex: none; }
.thumb-form .row { display: flex; align-items: center; gap: 12px; }
.thumb-form .row.head { justify-content: space-between; }
fieldset.styles { border: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
fieldset.styles legend { float: left; width: 100%; margin-bottom: 4px; }
.chip { position: relative; font-size: 13px; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.chip span { color: var(--mute); text-underline-offset: 6px; }
.chip:hover span { color: var(--fg); }
.chip input:checked + span { color: var(--fg); text-decoration: underline; }
.chip:has(input:focus-visible) { outline: 1px solid var(--fg); outline-offset: 3px; }
.thumbs { padding: 0 24px 24px; display: flex; flex-direction: column; }
.thumbs:empty::after { content: "No requests yet."; color: var(--mute); font-size: 13px; padding: 16px 0 0; }
.treq { border-top: 1px solid var(--rule); padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.treq:first-child { border-top: 0; }
.treq .t-head { display: flex; align-items: center; gap: 12px; }
.treq .st { font-size: 13px; color: var(--mute); }
.treq .st.done { color: var(--keep); }
.treq .meta { font-size: 12px; color: var(--mute); }
.treq .txt { font-size: 15px; font-weight: 500; }
.treq .results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.treq .res { display: flex; flex-direction: column; gap: 4px; border: 1px solid transparent; }
.treq .res img { width: 100%; display: block; cursor: zoom-in; background: #000; }
.treq .res .racts { display: flex; gap: 12px; padding: 4px 0; align-items: center; }
.treq .res.picked { border-color: var(--fg); }
.treq .reply { color: var(--mute); font-size: 13px; }

/* ---------- Grade tab (grade.js): Temperature and Tint first, LUT row under the sliders ---------- */
.grade-pane { padding: 16px 24px; display: grid; grid-template-columns: 1fr auto; align-items: center; }
.grade-pane::before { content: "Colour"; order: 0; font-size: 13px; color: var(--mute); }
.grade-head { display: contents; }
.grade-head .grade-on { order: 0; justify-self: end; }
/* on/off as a small toggle pill (like Resolve's effect switches): track + knob drawn by ::before / ::after */
.grade-on { position: relative; font-size: 13px; color: var(--mute); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.grade-on input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.grade-on::before { content: ""; flex: none; width: 26px; height: 14px; border-radius: 7px; background: var(--scrub); transition: background .15s ease-out; }
.grade-on::after { content: ""; position: absolute; left: 2px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--mute); transition: transform .15s ease-out, background .15s ease-out; }
.grade-on:hover { color: var(--fg); }
.grade-on:has(input:checked) { color: var(--fg); }
.grade-on:has(input:checked)::before { background: var(--fg); }
.grade-on:has(input:checked)::after { transform: translateX(12px); background: var(--bg); }
.grade-on:has(input:disabled) { opacity: .4; cursor: default; }
.grade-on:has(input:focus-visible) { outline: 1px solid var(--fg); outline-offset: 3px; }
.grade-row { order: 1; grid-column: 1 / -1; display: grid; grid-template-columns: 96px 1fr 40px 24px; align-items: center; gap: 12px; height: 40px; font-size: 13px; }
.grade-row label { grid-column: 1; grid-row: 1; color: var(--fg); }
.grade-row input[type="range"] { grid-column: 2; grid-row: 1; width: 100%; margin: 0; }
.grade-row output { grid-column: 3; grid-row: 1; text-align: right; color: var(--mute); font-variant-numeric: tabular-nums; }
.grade-row .link { grid-column: 4; grid-row: 1; width: 24px; height: 24px; font-size: 14px; }
.grade-row[data-k="lutStrength"] { order: 0; }
.grade-row[data-k="temp"] input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, transparent var(--lo), var(--fg) var(--lo), var(--fg) var(--hi), transparent var(--hi)) center / 100% 1px no-repeat, linear-gradient(90deg, rgba(127, 178, 255, .6), rgba(255, 179, 102, .6)); }
.grade-row[data-k="tint"] input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, transparent var(--lo), var(--fg) var(--lo), var(--fg) var(--hi), transparent var(--hi)) center / 100% 1px no-repeat, linear-gradient(90deg, rgba(143, 224, 160, .6), rgba(240, 154, 216, .6)); }
.grade-row[data-k="temp"] input[type="range"]::-moz-range-track { height: 2px; background: linear-gradient(to right, transparent var(--lo), var(--fg) var(--lo), var(--fg) var(--hi), transparent var(--hi)) center / 100% 1px no-repeat, linear-gradient(90deg, rgba(127, 178, 255, .6), rgba(255, 179, 102, .6)); }
.grade-row[data-k="tint"] input[type="range"]::-moz-range-track { height: 2px; background: linear-gradient(to right, transparent var(--lo), var(--fg) var(--lo), var(--fg) var(--hi), transparent var(--hi)) center / 100% 1px no-repeat, linear-gradient(90deg, rgba(143, 224, 160, .6), rgba(240, 154, 216, .6)); }
.grade-row[data-k="temp"] input[type="range"]::-webkit-slider-thumb, .grade-row[data-k="tint"] input[type="range"]::-webkit-slider-thumb { margin-top: -3px; }
.grade-lut { order: 2; grid-column: 1 / -1; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); }
.grade-lut-row { display: flex; align-items: center; gap: 12px; font-size: 13px; margin: 0 0 8px; }
.grade-lut-row select { flex: 1; min-width: 0; }
.grade-lut-row .btn { height: 24px; }
.lut-name { display: none; }
.grade-lut .grade-row { height: 40px; }
#gradeResetAll { order: 3; grid-column: 1; justify-self: start; margin-top: 24px; font-size: 13px; }
#gradeAdd { order: 3; grid-column: 2; margin-top: 24px; }
.grade-pane .menu-note { order: 4; grid-column: 1 / -1; margin: 16px 0 0; }

/* ---------- overlays ---------- */
.lightbox { position: fixed; inset: 0; background: var(--veil); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.lb-body { max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 16px; cursor: default; }
.lb-body img, .lb-body video { max-width: 92vw; max-height: 86vh; background: #000; }
.lb-body audio { width: min(520px, 90vw); }
.lb-body .lb-name { font-size: 13px; color: var(--mute); }
.lightbox#dialog { z-index: 70; cursor: default; }
.dialog { background: var(--bg); border: 1px solid var(--rule); padding: 24px; width: min(380px, 90vw); }
.dialog p { margin-bottom: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 16px; }
.dropveil { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; background: var(--veil); text-align: center; font-size: 18px; font-weight: 500; outline: 1px dashed var(--scrub); outline-offset: -16px; }
.dropveil small { display: block; margin-top: 8px; font-size: 13px; font-weight: 400; color: var(--mute); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 16px; z-index: 60; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 900px) {
  html, body { height: auto; min-height: 100%; }
  .top { height: auto; min-height: 48px; flex-wrap: wrap; gap: 8px 16px; padding: 8px 16px; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .stage { flex: none; height: min(70vh, 640px); }
  .comments-col { border-left: 0; border-top: 1px solid var(--rule); min-height: 40vh; }
  .comments { max-height: 60vh; }
}
label.btn { display: inline-flex; align-items: center; }
.thumb-form .foot .hint { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html.player-fs .transport { color: var(--fg); }
