/* Fonts live in frontend/fonts/, served at /fonts/: the urls are absolute
   because a relative one resolves against /css/ (where nothing is). */
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/ChakraPetch-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/ChakraPetch-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
/* Inter 4.1 (SIL OFL 1.1, frontend/fonts/Inter-LICENSE.txt): body text of the admin and queue screens. */
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #0b0e13;
  --panel: #141920;
  --panel-2: #1c232c;
  --panel-3: #232c37;
  --border: #29323d;
  --border-soft: #212932;
  --text: #e8eef4;
  --muted: #8b97a5;
  --skc: #32fe6b;
  --skc-ink: #06210f;
  --shot: #ff3b30;
  --del: #ff4136;
  --goal: #ffd400;
  --setpiece: #22b8ff;
  --interruption: #7c8b9a;
  --head: 'Chakra Petch', -apple-system, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}
button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 6px 11px; cursor: pointer; font-size: 13px;
  transition: background .12s, border-color .12s, color .12s;
}
button:hover:not(:disabled) { border-color: var(--skc); }
button:active:not(:disabled) { transform: translateY(1px); }
kbd {
  font: 600 10px var(--mono); background: #0e141b; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted);
}

/* ---- topbar ---- */
#topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: linear-gradient(180deg, #161c24, #10151b);
  border-bottom: 1px solid var(--border);
}
.brand { font: 700 16px var(--head); letter-spacing: .5px; }
.brand-sub { color: var(--skc); }

/* Reviewer mode: an admin viewing another annotator's corrections read-only
   (design: QA workflow blocker where corrections are stored per (match_id,
   annotator_id) and reviewers had no way to load someone else's worklog). */
#reviewer-banner {
  padding: 6px 18px; text-align: center;
  font: 700 12px var(--head); letter-spacing: .2px;
  background: #2a1f0e; border-bottom: 1px solid #ffab40; color: #ffab40;
}
/* Only present when reviewerMode also unlocks the Export button (see
   renderReviewerBanner) — a plain reviewer-banner without a button never
   gets this wrapper, so its content stays simply centered as before. */
.reviewer-banner-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
#reviewer-banner-text { flex: 1; text-align: center; }
#reviewer-banner-text small { display: block; margin-top: 4px; font-weight: normal; }
#reviewer-edit-btn, #reviewer-finish-btn { font-size: 12px; padding: 4px 12px; white-space: nowrap; }
#reviewer-export-btn { font-size: 12px; padding: 4px 12px; }
#match-pick { display: flex; gap: 6px; }
#match-input {
  background: #0e141b; border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 6px 11px; width: 190px; font: 600 13px var(--mono);
}
#match-input:focus { outline: none; border-color: var(--skc); }
#open-btn { background: var(--skc); color: var(--skc-ink); border-color: var(--skc); font-weight: 700; }
#open-btn:hover { filter: brightness(1.08); }
#match-meta { color: var(--muted); font-size: 13px; }
#validate-btn, #self-export-btn {
  margin-left: 10px; padding: 6px 14px; border-radius: 7px; cursor: pointer;
  background: var(--skc); color: var(--skc-ink); border: 1px solid var(--skc);
  font: 700 12px var(--head); letter-spacing: .4px; text-transform: uppercase; white-space: nowrap;
}
#validate-btn:hover:not(:disabled), #self-export-btn:hover:not(:disabled) { filter: brightness(1.08); }
#validate-btn:disabled, #self-export-btn:disabled { background: #2a323c; color: #ffca28; border-color: #ffca2855; cursor: not-allowed; }
#validate-btn.validated { background: var(--goal); border-color: var(--goal); color: #1a1200; }
/* live incoherence count > 0: amber warning state (still clickable — the
   click explains what remains via a toast) */
#validate-btn.has-incoh { background: #2a323c; color: #ffca28; border-color: #ffca2855; }
/* Live score (score.js): each side's acronym in its kit colours. The inset ring
   keeps a kit that matches the topbar (black, navy) readable. */
#score {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 5px; cursor: pointer;
}
#score[hidden] { display: none; }
#score:hover { border-color: var(--muted); }
#score .score-team {
  font: 800 12px var(--head); letter-spacing: .4px; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
#score .score-num { font: 800 16px var(--mono); color: var(--text); white-space: nowrap; }
#score .score-unplaced { font: 700 11px var(--head); color: #ffca28; padding-right: 4px; }
#progress {
  margin-left: auto; color: var(--skc); font: 700 13px var(--head); letter-spacing: .3px;
  background: var(--skc-ink); border: 1px solid #1c5c30; padding: 4px 12px; border-radius: 999px;
}

/* ---- layout ---- */
#layout { flex: 1; display: flex; min-height: 0; }
#video-pane { flex: 1; display: flex; flex-direction: column; padding: 14px; gap: 12px; min-width: 0; }
#side-pane {
  /* Fixed width on large displays, but never more than a third of a laptop
     screen — the video pane has priority on horizontal space. */
  width: min(var(--side-w, 420px), 32vw); min-width: 280px;
  flex: none; display: flex; flex-direction: column;
  background: #0f141a; border-left: 1px solid var(--border); min-height: 0;
}

/* draggable resize handles (side panel + minimap) */
.gutter-col {
  flex: none; width: 7px; align-self: stretch; cursor: col-resize;
  position: relative; background: transparent;
}
.gutter-col::before {
  content: ''; position: absolute; inset: 8px 2px; border-radius: 3px;
  background: var(--border); transition: background .12s;
}
.gutter-col:hover::before { background: var(--skc); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe, body.resizing video { pointer-events: none; }

/* ---- video ---- */
/* Video and roster share a row: the roster sits to the RIGHT of the image, so
   picking a player is a short horizontal glance from the action rather than a
   trip down to the pitch row. min-height 0 lets the row shrink on laptops
   instead of pushing the transport bar off-screen. */
#video-row { flex: 1; display: flex; min-height: 0; }
/* A column: the warning box pinned at the top, the squad below it. */
#roster-pane {
  /* Drag #gutter-roster to resize; the width persists per browser. */
  width: min(var(--roster-w, 240px), 40vw); min-width: 96px;
  flex: none; display: flex; flex-direction: column; overflow: auto;
  padding-left: 4px;
}
/* Centred against the video via auto margins, NOT align-items: center — a
   centred flex item that overflows its scroll container has its top cut off and
   unreachable, which is exactly what a tall squad on a short viewport does.
   (Auto margins resolve to 0 once free space goes negative; align-items does
   not.) */
#roster { margin-block: auto; }
/* Hiding the pane. Only ONE reason now: the annotator hid it with `r` / the
   Layout > Roster checkbox (hide-roster) — which takes the warning box with it,
   by design. `no-roster` (no squad in the payload) no longer collapses the
   column: the warning box still belongs there, and #roster:empty already keeps
   the empty grid from taking up space. */
#ann-screen.hide-roster #roster-pane,
#ann-screen.hide-roster #gutter-roster { display: none; }
#toggle-roster.off { color: var(--muted); opacity: .7; }

#video-wrap {
  position: relative; flex: 1; min-height: 200px; background: #000;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
#video-zoom { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
/* #video is fayard's original element (hidden); #ann-video is the annotator
   screen's — without this rule it renders at intrinsic pixel size and gets
   cropped by the wrap, which also throws off every overlay-box coordinate. */
#video, #ann-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
#video-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#toggle-overlay.off { color: var(--muted); opacity: .7; }
/* Per-widget layout (M9): each widget hides independently and the choice
   persists, replacing the coarse "Bigger" theater toggle (which could only hide
   the minimap). Anything hidden gives its space to #video-wrap, so hiding the
   minimap or a timeline bar grows the video. The roster keeps its own class
   (see #ann-screen.hide-roster above) so a payload with no roster stays hidden.
   Hide the label alongside each canvas so a hidden bar leaves no orphan header. */
#ann-screen.hide-minimap #pitch-row { display: none; }
#ann-screen.hide-detail #tl-detail-label,
#ann-screen.hide-detail #timeline-zoom { display: none; }
#ann-screen.hide-overview #tl-overview-label,
#ann-screen.hide-overview #timeline-bar { display: none; }
#ann-screen.hide-coverage #tl-cover-label,
#ann-screen.hide-coverage #timeline-cover { display: none; }
/* The hotkey cheat-sheet bar (#help) is a layout widget too: hiding it (via the
   Layout popover or the "?" shortcut) gives its space back to the video. */
#ann-screen.hide-help #help { display: none; }
#toggle-layout.on { border-color: var(--skc); color: var(--skc); }
/* Layout popover: anchored under the "Layout" button, one checkbox per widget
   plus the reset / video-only presets. */
#layout-wrap { position: relative; display: inline-flex; }
#layout-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 6px; min-width: 190px; padding: 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
#layout-pop[hidden] { display: none; }
#layout-pop label {
  display: flex; align-items: center; gap: 8px; font: 600 12px var(--head);
  color: var(--text); cursor: pointer; user-select: none;
}
#layout-pop input[type="checkbox"] { accent-color: var(--skc); cursor: pointer; }
#layout-pop .layout-presets { display: flex; gap: 6px; margin-top: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
#layout-pop .layout-presets button {
  flex: 1; font: 700 11px var(--head); padding: 5px 8px;
  background: var(--panel-3); color: var(--text); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
#layout-pop .layout-presets button:hover { border-color: var(--skc); color: var(--skc); }
#zoom-reset { font: 700 12px var(--head); min-width: 74px; }
#zoom-readout { font-variant-numeric: tabular-nums; }
#frame-readout {
  position: absolute; top: 12px; left: 14px;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(8,12,16,.72); backdrop-filter: blur(4px);
  padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08);
  font: 700 13px var(--head); color: var(--skc); font-variant-numeric: tabular-nums; letter-spacing: .3px;
}
#frame-readout .frame-seek-inline {
  display: inline-flex; align-items: center; gap: 6px;
  padding-left: 10px; margin-left: 2px;
  border-left: 1px solid rgba(255,255,255,.08);
}
#seek-frame-input {
  width: 72px; min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 4px 10px;
  font: 700 12px var(--mono);
  font-variant-numeric: tabular-nums;
}
#seek-frame-input::placeholder { color: var(--muted); }
#seek-frame-go {
  border-radius: 999px;
  padding: 4px 10px;
  font: 700 11px var(--head);
}
#box-status {
  position: absolute; top: 12px; right: 14px;
  font: 700 13px var(--head); padding: 5px 12px; border-radius: 999px; display: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
/* Missing player-box assignment — persistent amber strip pinned to the bottom
   of the video. Player boxes come only from the pipeline's positions.json; when
   it is absent the annotator works without boxes and must know why. */
#no-boxes-warning {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  max-width: 92%; z-index: 6;
  padding: 5px 14px; border-radius: 12px; text-align: center;
  font: 700 12px var(--head); letter-spacing: .2px; line-height: 1.35;
  background: rgba(8,12,16,.85); backdrop-filter: blur(4px);
  border: 1px solid #ffab40; color: #ffab40;
  box-shadow: 0 2px 14px rgba(0,0,0,.45);
}
/* Warning box — sits at the top of #roster-pane, beside the video rather than on
   top of it (moved out of the image 2026-08-28; it used to be #incoh-banner,
   ported from fayard style.css:165-186). Always present: quiet "No warning" while
   the event at the playhead is clean, pulsing red with the reason when it is not,
   so its silence carries information too. `r` hides it with the roster.
   Fixed two-line min-height keeps the roster from jumping as states swap. */
#warn-box {
  flex: none; margin: 0 0 8px; min-height: 40px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 10px; border-radius: 10px; text-align: left;
  font: 700 12px var(--head); letter-spacing: .2px; line-height: 1.25;
  border: 1px solid var(--border); background: var(--panel);
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
#warn-box .wb-detail { display: block; font-weight: 600; font-size: 12px; opacity: .92; }
/* Clean: muted and unclickable — it must not read as something to act on. */
#warn-box.ok { color: var(--muted); cursor: default; }
/* Real alert: red, pulsing, and click-to-seek. */
#warn-box.alert {
  cursor: pointer;
  border-color: var(--del); color: #fff;
  background: color-mix(in srgb, var(--del) 80%, #000);
  animation: wbpulse 1.15s ease-in-out infinite;
}
@keyframes wbpulse {
  0%,100% { box-shadow: 0 2px 14px rgba(0,0,0,.45); }
  50%     { box-shadow: 0 0 0 3px color-mix(in srgb, var(--del) 45%, transparent), 0 2px 14px rgba(0,0,0,.45); }
}
/* ---- video seek bar (scrubber, below the video) ---- */
#seekbar {
  position: relative; flex: none; height: 16px; cursor: pointer;
  display: flex; align-items: center;
}
#seekbar::before {
  content: ''; position: absolute; left: 0; right: 0; height: 6px;
  border-radius: 3px; background: var(--panel-3);
}
#seek-fill {
  position: absolute; left: 0; height: 6px; width: 0;
  border-radius: 3px; background: var(--skc);
}
#seek-handle {
  position: absolute; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px var(--skc), 0 1px 4px rgba(0,0,0,.5);
  transform: translateX(-50%); pointer-events: none;
}
#seekbar:hover #seek-handle { transform: translateX(-50%) scale(1.15); }

/* ---- transport ---- */
#transport {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
}
#transport .sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }
#play-btn { min-width: 92px; font-weight: 700; }
#rate-readout { font: 700 13px var(--head); color: var(--skc); min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
#rate-up, #rate-down { min-width: 32px; font-weight: 700; }
#prev-anchor, #next-anchor { border-color: var(--border); }
#next-anchor { background: var(--skc-ink); border-color: #1c5c30; color: var(--skc); font-weight: 700; }
#prev-anchor { margin-left: auto; }
#next-anchor:hover, #prev-anchor:hover { border-color: var(--skc); }
#anchor-pos { font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; border-color: #556; background: #1a2129; }
#anchor-pos:hover { border-color: #fff; background: #232c36; }
#anchor-pos.disabled { color: #5c6a78; border-color: var(--border); background: transparent; cursor: default; }
#anchor-pos.disabled:hover { border-color: var(--border); background: transparent; }

/* ---- match timeline scrubber (color-coded) ---- */
#tl-section { flex: none; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
/* The whole timeline stack hides via the "Timelines" widget in the Layout
   popover (replaced the old standalone toggle button in the timeline header). */
#ann-screen.hide-timelines #tl-section { display: none; }
#timeline-bar-wrap {
  flex: 0 1 auto; min-height: 0; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 10px 8px;
}
#tl-legend {
  display: flex; align-items: center; gap: 14px; margin-bottom: 5px;
  font: 700 10px var(--head); letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
}
#tl-legend .tl-key { display: inline-flex; align-items: center; gap: 5px; }
#tl-legend .tl-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
#tl-legend .tl-hint { margin-left: auto; color: var(--muted); opacity: .7; text-transform: none; font-weight: 600; }
#tl-detail-label {
  display: flex; align-items: center; gap: 8px; margin: 0 0 4px;
  font: 700 9px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
#tl-detail-label button {
  width: 22px; height: 18px; padding: 0; line-height: 1; font-weight: 700; font-size: 14px;
  border-radius: 5px;
}
#tl-detail-label button:hover { border-color: var(--skc); color: var(--skc); }
#tl-zoom-readout { min-width: 34px; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }
#tl-detail-label .tl-hint { color: var(--muted); opacity: .6; text-transform: none; font-weight: 600; }
#timeline-zoom { width: 100%; height: 56px; display: block; cursor: crosshair; border-radius: 6px; }
#tl-tip {
  position: fixed; z-index: 50; pointer-events: none; display: none;
  transform: translate(-50%, -110%);
  background: #0e141b; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 9px; font: 700 11px var(--head); letter-spacing: .3px; color: var(--text);
  white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.55);
}
#tl-overview-label {
  display: flex; align-items: center; gap: 8px; margin: 7px 0 2px;
  font: 700 9px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
#tl-overview-label button {
  width: 22px; height: 18px; padding: 0; line-height: 1; font-weight: 700; font-size: 14px; border-radius: 5px;
}
#tl-overview-label button:hover { border-color: var(--skc); color: var(--skc); }
#ov-zoom-readout { min-width: 34px; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }
#tl-overview-label .tl-hint { color: var(--muted); opacity: .6; text-transform: none; font-weight: 600; }
#timeline-bar { width: 100%; height: 36px; display: block; cursor: pointer; opacity: .95; }
#tl-cover-label {
  display: flex; align-items: center; gap: 12px; margin: 7px 0 2px;
  font: 700 9px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); opacity: .7;
}
#tl-cover-label .ck { display: inline-flex; align-items: center; gap: 4px; }
#tl-cover-label .ck i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
#timeline-cover { width: 100%; height: 14px; display: block; cursor: pointer; border-radius: 3px; }
#tl-bip-label {
  display: flex; align-items: center; gap: 12px; margin: 7px 0 2px;
  font: 700 9px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); opacity: .7;
}
#tl-bip-label .ck { display: inline-flex; align-items: center; gap: 4px; }
#tl-bip-label .ck i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
#tl-bip-label .tl-hint { margin-left: auto; color: var(--muted); opacity: .6; text-transform: none; font-weight: 600; }
#timeline-bip { width: 100%; height: 14px; display: block; cursor: pointer; border-radius: 3px; }

/* ---- pitch row (minimap + roster) ---- */
#pitch-row {
  display: flex; gap: 12px; align-items: stretch; flex: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  /* Hug the minimap instead of stretching a mostly-empty panel across the
     whole pane (the roster column is hidden until it's actually built). */
  align-self: flex-start; max-width: 100%;
}
/* Rounded to match the canvas. The minimap zoom needs no clip here — it is
   drawn into the canvas (overlay.setMinimapZoom), not applied as a CSS
   transform, so the canvas clips the zoomed pitch itself. */
#minimap-pane { flex: none; overflow: hidden; border-radius: 8px; }
#minimap {
  /* Height-driven so short (laptop) viewports shrink the pitch instead of
     starving the video; 285px matches the old 440px-wide size on tall
     displays. setupCanvas() re-reads clientWidth/Height every draw, so
     CSS-driven sizing stays crisp and click hit-targets stay aligned. */
  height: min(28vh, 285px); width: auto;
  aspect-ratio: 105 / 68; display: block; background: #0b4d1a; border-radius: 8px; cursor: pointer; border: 1px solid #0a3d15;
}
/* Two columns, one per team, side by side — the pairing an annotator actually
   reads ("who on the other side could this be?"). Vertically centred against
   the video by #roster-pane. No max-height: the pane scrolls, and capping the
   grid clipped the taller squad. */
#roster {
  width: 100%; min-width: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  align-items: start;
}
#roster:empty { display: none; }
/* One grid item per team: its label, then its chips. Wrapping the pair keeps the
   label attached to its own squad — as bare grid items they interleave. */
.rcol { display: flex; flex-direction: column; min-width: 0; }
/* Chips stack DOWNWARD, one per line — a vertical list of jersey numbers is
   scanned far faster than a wrapped grid, where the eye has to re-find the row
   (annotator feedback 2026-08-06). A squad taller than the pane scrolls
   (#roster-pane), which keeps one continuous list to read rather than breaking
   it into sub-columns. */
.rrow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rteam {
  font: 700 9px var(--head); letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); padding: 0 0 4px 1px;
}
/* Row-shaped: "7 MF" reads left-to-right down a vertical list. The old
   number-over-position stack was right for a wrapped grid of small squares, but
   in a column it doubles every chip's height and pushes the back of the squad
   out of view. */
.rchip {
  min-width: 30px; padding: 3px 7px; border-radius: 6px; border: 1px solid rgba(0,0,0,.25);
  cursor: pointer; line-height: 1;
  display: inline-flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 5px;
  transition: opacity .12s, filter .12s;
}
.rchip .rc-num { font: 700 12px var(--head); font-variant-numeric: tabular-nums; min-width: 15px; text-align: right; }
.rchip .rc-pos { font: 700 8px var(--mono); opacity: .72; letter-spacing: .4px; }
/* Scaling a full-width chip creates horizontal overflow and makes classic
   scrollbars recenter the lineup under the pointer. Keep its geometry stable. */
.rchip:hover { outline: 1px solid #fff; }
/* Team-kit color, not a fixed yellow (HQData ticket 1 item 3) — --rchip-team is
   set per-chip in buildRosterChip(); #888 is the fallback for a kit with none,
   matching what the video + minimap overlays fall back to in overlay.js for the
   same player (CodeRabbit, MR !91). Was var(--goal) initially — that made the
   three surfaces disagree on the highlight colour whenever kit.jersey_color was
   absent. */
.rchip.sel { outline: 2px solid var(--rchip-team, #888); outline-offset: 1px; }
/* The player whose event sits under the playhead cursor: a green dot beside
   the jersey number. Distinct from .sel (team-kit outline = clicked player). */
.rchip.has-event .rc-num::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--skc);
  box-shadow: 0 0 4px var(--skc);
  vertical-align: middle;
}
.rchip.off-pitch { opacity: .26; filter: grayscale(1); }
.rchip.off-pitch:hover { opacity: .6; }
/* An off-pitch player that cannot be picked (the lineup has play spells): no
   hover brighten, and the cursor says so. The click is still handled, to say why. */
.rchip.off-pitch.blocked { cursor: not-allowed; }
.rchip.off-pitch.blocked:hover { opacity: .26; }
/* Goalkeeper: a persistent ring + emphasised role text so the GK is
   identifiable at a glance (distinct from the amber selection outline). */
.rchip.gk { box-shadow: 0 0 0 2px var(--setpiece); }
.rchip.gk .rc-pos { color: var(--setpiece); opacity: 1; }
/* The event cursor outranks the off-camera dim: the chip's opacity caps every
   descendant (the green dot can't escape it), and this chip is the one the
   annotator is being pointed at — so it stays fully legible. */
.rchip.off-pitch.has-event { opacity: 1; filter: none; }

/* ---- side panel: section headers ---- */
.panel-head {
  font: 700 11px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  padding: 10px 14px 6px;
}

/* ---- current event card ---- */
#current-anchor { margin: 8px 12px 0; background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 9px; padding: 6px 11px; }
#current-anchor:empty { display: none; }
.ca-head { font: 700 14px var(--head); letter-spacing: .3px; margin-bottom: 2px; }
.ca-row { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); align-items: baseline; font-size: 12px; }
.ca-row b { color: var(--text); font: 700 13px var(--head); }

/* ---- annotate ---- */
#annotate {
  margin: 8px 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 7px;
  /* Never eat more than ~half the side pane — otherwise on a laptop it starves the
     event list down to 2 rows. Cap it and let the panel scroll internally instead. */
  flex: 0 1 auto; max-height: 50%; min-height: 0; overflow-y: auto;
}
#ann-target {
  font-weight: 600; padding: 6px 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
}
#ann-target.ann-empty { color: var(--muted); font-weight: 400; font-style: italic; }
#ann-target.flash { animation: annflash .3s ease; }
@keyframes annflash { from { border-color: var(--skc); background: var(--skc-ink); } to { } }
.ann-chip { padding: 3px 10px; border-radius: 6px; font: 700 13px var(--head); }
.ann-cur { color: var(--muted); font-weight: 400; font-size: 13px; }
.ann-group { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ann-h { color: var(--muted); font: 700 9px var(--head); text-transform: uppercase; letter-spacing: 1px; }
.ann-cur { color: var(--text); font: 600 9px var(--mono); text-transform: none; letter-spacing: .3px; margin-left: 4px; }
.ann-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.ann-btn {
  border: 1px solid color-mix(in srgb, var(--ev, #888) 55%, transparent); color: var(--text);
  background: color-mix(in srgb, var(--ev, #888) 12%, var(--panel-2));
  border-radius: 7px; padding: 5px 10px; font: 700 12px var(--head); letter-spacing: .3px; cursor: pointer;
}
.ann-btn:hover:not(:disabled) { background: var(--ev, var(--panel-3)); color: #07130b; border-color: var(--ev); }
.ann-btn.sel { background: var(--ev); color: #07130b; box-shadow: 0 0 0 2px var(--ev); }
/* Impossible combination for the current target (own goal off a TOUCH, header
   or save on a set piece, save on an outfielder): greyed out, not hidden, so
   the control stays discoverable. Retyping the event is the way to enable it. */
.ann-btn:disabled, .ann-row button:disabled {
  opacity: .35; filter: grayscale(60%); cursor: not-allowed;
}
/* keyboard-shortcut badge on annotation buttons */
.kb {
  display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.15);
  font: 700 9px var(--mono); vertical-align: middle; opacity: .85;
}
.ann-btn.sel .kb, .ann-btn:hover .kb { background: rgba(0,0,0,.22); border-color: rgba(0,0,0,.25); }
#ann-shot-group .ann-btn { --ev: var(--shot); }
#ann-shot-group .ann-btn[data-val="GOAL"] { --ev: var(--goal); }
/* Nudge: a SHOT with no outcome yet — pulse the (already-revealed) outcome group
   so the annotator picks one. SHOT_NO_OUTCOME also blocks validation. */
#ann-shot-group.needs-outcome { border-radius: 6px; animation: shotpulse 1.15s ease-in-out infinite; }
@keyframes shotpulse {
  0%,100% { box-shadow: 0 0 0 0 transparent; }
  50%     { box-shadow: 0 0 0 3px color-mix(in srgb, var(--goal) 55%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  #ann-shot-group.needs-outcome { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--goal) 55%, transparent); }
}
.ann-row { display: flex; align-items: center; gap: 10px; padding-top: 2px; flex-wrap: wrap; }
#ann-offside { border-color: var(--goal); color: var(--goal); font-weight: 700; }
#ann-offside:hover { background: var(--goal); color: #1a1500; }
#ann-header { border-color: #4dd0e1; color: #4dd0e1; font-weight: 700; }
#ann-header:hover:not(:disabled), #ann-header.sel { background: #4dd0e1; color: #06212a; }

#ann-fairplay { border-color: #b388ff; color: #b388ff; font-weight: 700; }
#ann-fairplay:hover, #ann-fairplay.sel { background: #b388ff; color: #1b0f33; }

/* header (de la tête) badge on worklist rows */
.wl-head {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
  background: color-mix(in srgb, #4dd0e1 22%, transparent); color: #4dd0e1;
  font: 700 9px var(--head); letter-spacing: .5px; vertical-align: middle;
}

/* fairplay badge on worklist rows — header's shape, its own colour */
.wl-fair {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
  background: color-mix(in srgb, #b388ff 22%, transparent); color: #b388ff;
  font: 700 9px var(--head); letter-spacing: .5px; vertical-align: middle;
}

/* OUT ⟷ Take jump control (shown when a set piece / its OUT is selected) */
#sp-jump {
  align-items: center; gap: 8px; margin: 8px 12px 0; padding: 7px 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-left: 3px solid #00b0ff; border-radius: 8px;
}
.sp-jump-h {
  font: 700 10px var(--head); letter-spacing: .6px; text-transform: uppercase;
  color: #00b0ff; margin-right: auto;
}
.jump-btn {
  border: 1px solid var(--border); background: var(--panel-3); color: var(--text);
  border-radius: 6px; padding: 4px 9px; font: 700 11px var(--head); cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 5px;
}
.jump-btn:hover { border-color: #00b0ff; color: #fff; }
.jump-btn.at { background: #00b0ff; color: #04222e; border-color: #00b0ff; }
.jump-f { font: 600 9px var(--mono); opacity: .7; }
#ann-count { margin-left: auto; color: var(--skc); font: 700 12px var(--head); }
button.danger { border-color: #b3261e; color: #ff6a5e; font-weight: 700; }
button.danger:hover { background: #b3261e; color: #fff; }

/* ---- events list ---- */
#worklist-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border-soft); margin-top: 6px; }
#worklist-head {
  font: 700 11px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  padding: 10px 14px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #0f141a; z-index: 1;
}
.wl-head-title { display: flex; align-items: center; gap: 8px; }
#wl-count { color: var(--skc); font-size: 10px; letter-spacing: .3px; }
/* prominent one-click switch: full event list <-> incoherences (keeps your place) */
.wl-view-toggle {
  margin-left: auto; border: 1px solid var(--skc); background: var(--skc-ink); color: var(--skc);
  border-radius: 7px; padding: 4px 10px; font: 700 11px var(--head); letter-spacing: .3px;
  text-transform: none; cursor: pointer; white-space: nowrap;
}
.wl-view-toggle:hover { background: var(--skc); color: var(--skc-ink); }
.wl-view-toggle.to-incoh { border-color: #ffca28; color: #ffca28; background: rgba(255,202,40,.08); }
.wl-view-toggle.to-incoh:hover { background: #ffca28; color: #1a1200; }
/* feed view: Corrected (merged feed) / Original (raw pipeline) pill pair */
#wl-feed-view { margin-left: auto; display: inline-flex; }
.wl-feed {
  padding: 3px 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted);
  font: 700 10px var(--head); letter-spacing: .5px; text-transform: uppercase; cursor: pointer;
}
.wl-feed:first-child { border-radius: 999px 0 0 999px; }
.wl-feed:last-child { border-radius: 0 999px 999px 0; border-left: none; }
.wl-feed:hover { border-color: var(--skc); color: var(--text); }
.wl-feed.on { background: var(--skc); border-color: var(--skc); color: var(--skc-ink); }
#wl-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.wl-filter {
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted);
  font: 700 10px var(--head); letter-spacing: .5px; text-transform: uppercase; cursor: pointer;
}
.wl-filter:hover { border-color: var(--skc); color: var(--text); }
.wl-filter.on { background: var(--skc); border-color: var(--skc); color: var(--skc-ink); }
.wl-filter.has-incoh { color: #ffca28; border-color: #ffca28aa; }
.wl-filter.has-incoh.on { background: #ffca28; border-color: #ffca28; color: #1a1200; }
#worklist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }

/* Per-frame notes (M7): a compact fixed-height block at the bottom of the side
   pane, its own scroll so it never crowds the worklist (which stays flex:1). */
#comments-pane { flex: none; display: flex; flex-direction: column; border-top: 1px solid var(--border); max-height: 30vh; }
#comments-head { padding: 6px 14px; font: 700 11px var(--head); letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
#comment-count { color: var(--skc); }
#comment-form { display: flex; gap: 6px; padding: 0 14px 8px; }
#comment-input {
  flex: 1; min-width: 0; background: #0e141b; border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 5px 9px; font-size: 13px;
}
#comment-input:focus { outline: none; border-color: var(--skc); }
#comment-add { flex: none; font: 700 12px var(--head); padding: 5px 12px; }
#comment-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.cm-item { display: flex; align-items: center; gap: 8px; padding: 4px 14px; border-bottom: 1px solid var(--border-soft); }
.cm-seek { flex: none; font: 700 11px var(--mono); color: var(--skc); background: transparent; border: 0; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.cm-seek:hover { text-decoration: underline; }
.cm-text { flex: 1; min-width: 0; font-size: 13px; word-break: break-word; }
.cm-del { flex: none; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cm-del:hover { color: var(--del); }
.wl-item {
  display: flex; align-items: center; gap: 9px;
  /* The left padding is the dot gutter (see .wl-item.active::before): reserved
     on EVERY row, so the columns sit at one x whether or not the row is the
     cursor row, and nothing wobbles during playback. */
  padding: 5px 14px 5px 20px; border-bottom: 1px solid var(--border-soft);
  cursor: pointer; border-left: 3px solid transparent; font-size: 13px;
  position: relative;
}
.wl-item:hover { background: var(--panel-2); }
/* Selected (cursor) row: a green dot at the very left. Deliberately NO
   background wash — the old green tint read too close to the corr-add green,
   so an added row and the selected row were hard to tell apart.
   ABSOLUTE, in the gutter the row's padding-left reserves: as a flex item with
   negative margins (the previous shape) the dot had net zero width, so it was
   painted straight on top of the .wl-time text it sat in front of. Out of flow
   it costs no width and overlaps nothing, and the columns still never shift. */
.wl-item.active::before {
  content: ""; position: absolute; left: 5px; top: 50%; margin-top: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--skc); box-shadow: 0 0 5px var(--skc);
}
.wl-item.anchor { border-left-color: var(--ev); }
.wl-item.incoherent { border-left-color: #ffca28; background: rgba(255,202,40,.07); }
.wl-warn { color: #ffca28; font-weight: 700; margin-left: 2px; }
/* Echoed set-piece warning on a paired interruption row: same colour, muted (it's
   a mirror of the take's real flag, not a separate incoherence to resolve). */
.wl-time { font: 600 12px var(--mono); color: var(--muted); width: 52px; }
.wl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.3); background: var(--ev-dot, var(--ev)); }
.wl-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 12px var(--head); letter-spacing: .3px; color: var(--ev); }
.wl-jersey { flex: none; min-width: 30px; text-align: right; color: var(--text); font: 600 12px var(--mono); }
.wl-del {
  margin-left: 6px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 12px; line-height: 1; padding: 2px 5px; border-radius: 4px; opacity: 0; flex: none;
}
.wl-item:hover .wl-del { opacity: 1; }
.wl-del:hover { background: #b3261e; color: #fff; }
.wl-del { font: 700 10px var(--head); text-transform: uppercase; letter-spacing: .4px; }
.wl-item.corr-del .wl-del { opacity: 1; color: var(--goal); }

/* correction states — a thicker colored left rail + tint so edited/added/deleted
   rows read at a glance against the untouched ones. */
.wl-item.corr-add { background: rgba(50,254,107,.16); border-left-color: var(--skc) !important; border-left-width: 4px; }
.wl-item.corr-del { background: rgba(255,65,54,.16); border-left-color: var(--del) !important; border-left-width: 4px; }
.wl-item.corr-del .wl-label { color: var(--muted); }
.wl-item.corr-edit { background: rgba(255,212,0,.15); border-left-color: var(--goal) !important; border-left-width: 4px; }
.corr-mark { display: inline-block; min-width: 14px; margin-right: 3px; }
.corr-old { opacity: .5; margin-right: 4px; }
.corr-extra { color: var(--text); font-size: 11px; opacity: .95; }

/* ---- help bar ---- */
/* It WRAPS. The bar used to be one nowrap line with a sideways scroll, which
   left the tail — the last third of the hotkeys — off-screen and unread: nobody
   scrolls a cheat sheet sideways. Wrapping is safe on the height-locked page
   because #layout is flex:1/min-height:0 and simply yields the rows (the video
   shrinks a little, nothing is clipped); max-height caps how much of the screen
   the bar can ever take before it scrolls instead. */
#help {
  padding: 7px 18px; color: var(--muted); font-size: 12px;
  background: var(--panel); border-top: 1px solid var(--border); letter-spacing: .2px;
  flex: none;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 9px; row-gap: 4px;
  max-height: 24vh; overflow-y: auto;
}
/* The cap can make this a scroll container, and a scroll container that only
   answers to the mouse strands whatever is past the cap. So: the scrollbar
   stays VISIBLE (it was hidden while the bar scrolled sideways, when it was
   the normal state rather than the rare one), the bar is a focusable labelled
   region in the markup, and focus is drawn — arrow keys scroll it once it is
   focused. The hotkeys themselves keep working while it holds focus: the
   keydown listener is on `document` and only stands down for INPUT/TEXTAREA. */
#help:focus-visible { outline: 2px solid var(--skc); outline-offset: -2px; }
/* One shortcut = one .hk chip that never splits, so a line break lands BETWEEN
   shortcuts and a key is never orphaned from the action it triggers. The "·"
   separators are drawn here rather than typed into the markup — a literal
   separator would wrap onto a line of its own. */
#help .hk { white-space: nowrap; }
#help .hk + .hk::before { content: "·"; opacity: .45; margin-right: 9px; }

/* ---- laptop widths: tighter transport so it stays on one line ---- */
@media (max-width: 1560px) {
  #transport { gap: 5px; padding: 7px 8px; }
  #transport button { padding: 5px 8px; font-size: 12px; }
  #play-btn { min-width: 64px; }
  #prev-anchor, #next-anchor, #anchor-pos { font-size: 11px; }
}

/* ---- top-left navigation (site_nav.js), the same on every screen ---- */
/* Never wraps or shrinks: the brand and the nav keep one line on every screen,
   and the match screen's meta text gives way instead (ellipsis, below). */
.site-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.brand { white-space: nowrap; flex: none; }
#topbar #match-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav-link {
  color: var(--muted); font: 600 12px var(--head); text-decoration: none;
  padding: 4px 10px; border: 1px solid transparent; border-radius: 7px; white-space: nowrap;
}
.site-nav-link:hover { color: var(--skc); }
.site-nav-link.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }

/* ---- match queue screen ---- */
/* The body is height-locked (100vh, overflow:hidden) for the annotator's
   fixed-viewport layout, so document-style screens must scroll INTERNALLY:
   bound the screen to the viewport (100vh) with a flex-1 scroll region, or
   their overflow is clipped by the body and cannot be reached. */
#queue-screen { height: 100vh; display: flex; flex-direction: column; }
#queue-header { flex: none; }
#queue-main { flex: 1; min-height: 0; overflow-y: auto; }

/* ---- administration screen ---- */
#admin-screen, #assign-screen, #users-screen { height: 100vh; display: flex; flex-direction: column; }
#admin-header {
  flex: none;
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: linear-gradient(180deg, #161c24, #10151b); border-bottom: 1px solid var(--border);
}
#admin-signout { color: var(--muted); background: transparent; }
#admin-signout:hover { border-color: var(--del); color: var(--del); }
#admin-main { flex: 1; min-height: 0; width: min(1440px, 100%); margin: 0 auto; padding: 26px 32px; overflow: auto; }
#admin-head-row { display: flex; align-items: flex-start; gap: 18px; justify-content: space-between; }
#admin-head-row h2 { margin: 0; font: 700 22px var(--head); }
#admin-head-row p { margin: 3px 0 0; color: var(--muted); }
#admin-head-row .admin-head-actions { display: flex; gap: 9px; flex: none; }
.admin-primary { background: var(--skc); border-color: var(--skc); color: var(--skc-ink); font-weight: 700; }
.admin-primary:hover { filter: brightness(1.08); }
.admin-secondary { background: var(--panel-2); border-color: var(--border); color: var(--text); font-weight: 700; }
.admin-secondary:hover { border-color: var(--skc); color: var(--skc); }
/* .admin-primary above only sets colors (class-based, shared with <button>);
   an <a> needs its own box model since it doesn't inherit the base `button`
   rule (the claimants drawer's "View" link, exportRowHtml in admin.js). */
a.admin-primary {
  display: inline-block; border: 1px solid var(--skc); border-radius: 7px;
  padding: 6px 11px; font-size: 13px; text-decoration: none; cursor: pointer;
}
#admin-filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 20px 0 10px; }
#admin-filter { min-width: min(100%, 280px); }
#admin-status-filter { min-width: 190px; }
#admin-archived-filter { color: var(--muted); font-size: 13px; }
#admin-archived-filter input { accent-color: var(--skc); }
#admin-message { min-height: 20px; margin: 0 0 8px; font-size: 13px; }
.admin-message { min-height: 20px; margin: 8px 0 0; font-size: 13px; }
.admin-message-ok { color: var(--skc); }
.admin-message-error { color: var(--del); }
#admin-table-wrap { border: 1px solid var(--border); border-radius: 11px; overflow-x: auto; background: var(--panel); }
#admin-matches-table, #assign-table, #users-table { width: 100%; min-width: 900px; border-collapse: collapse; }
#admin-matches-table th, #assign-table th, #users-table th {
  padding: 9px 12px; text-align: left; color: var(--muted); border-bottom: 1px solid var(--border);
  font: 700 10px var(--head); letter-spacing: 1px; text-transform: uppercase;
}
#admin-matches-table td, #assign-table td, #users-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
#admin-matches-table tbody tr:last-child td, #assign-table tbody tr:last-child td, #users-table tbody tr:last-child td { border-bottom: none; }
#admin-matches-table tbody tr:hover td, #assign-table tbody tr:hover td, #users-table tbody tr:hover td { background: var(--panel-2); }

/* ---- admin list filters + server-side pager (admin_paging.js) ---- */
.admin-list-filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 0 0 10px; }
.admin-check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.admin-check input { accent-color: var(--skc); }
.admin-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 10px 0 0; }
.admin-pager-label { color: var(--muted); font: 600 12px var(--mono); white-space: nowrap; }
.admin-pager button:disabled { opacity: .45; cursor: default; }

/* ---- assignment panel (/admin/assignments) ---- */
#assign-table .assign-priority { width: 60px; }
/* index.html gives .admin-input a 160px min-width. */
#assign-table .assign-priority, #assign-bulk-priority, #add-priority { min-width: 0; }
#assign-table .assign-priority-cell { display: inline-flex; align-items: center; gap: 6px; }
#assign-filter { min-width: min(100%, 320px); }
.assign-tag { color: var(--muted); font: 700 9px var(--head); letter-spacing: .5px; text-transform: uppercase; }
.assign-edit-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.assign-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.admin-modal-form .assign-edit-row label { display: flex; align-items: center; gap: 7px; font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text); }
.admin-modal-form .assign-edit-main { color: var(--muted); }

/* ---- users panel (/admin/users) ---- */
#users-filter { min-width: min(100%, 320px); }
.users-email { color: var(--muted); font-size: 12px; }
.users-readonly { color: var(--muted); font-size: 12px; }
.users-you { color: var(--skc); font: 700 9px var(--head); letter-spacing: .5px; text-transform: uppercase; }
#users-events { margin-top: 24px; }
#users-events h3 { margin: 0 0 8px; font: 700 14px var(--head); }
#users-role-events { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.prio-hint-inline { margin-left: 6px; color: var(--muted); font: 500 11px var(--mono); }
.admin-match-id, .admin-updated { color: var(--muted); font: 600 12px var(--mono); white-space: nowrap; }
.admin-workflow, .admin-archived {
  display: inline-block; padding: 2px 7px; border-radius: 999px; font: 700 10px var(--head);
  letter-spacing: .5px; text-transform: uppercase; border: 1px solid var(--border);
}
.admin-workflow-intake_failed { color: #ff8a80; border-color: #7f332e; background: rgba(255,65,54,.12); }
.admin-workflow-not_assigned { color: var(--muted); background: var(--panel-3); }
.admin-workflow-assigned, .admin-workflow-in_progress { color: var(--skc); border-color: #1c5c30; background: var(--skc-ink); }
.admin-workflow-annotated { color: var(--goal); border-color: #75621a; background: rgba(255,212,0,.09); }
.admin-archived { margin-left: 5px; color: var(--muted); }
/* Match priority (frontend/js/priority.js): less is most urgent. Same red /
   yellow / green as the workflow pills. */
.prio {
  display: inline-block; padding: 2px 7px; border-radius: 999px; font: 700 10px var(--head);
  letter-spacing: .5px; border: 1px solid var(--border); white-space: nowrap;
}
.prio-1 { color: #ff8a80; border-color: #7f332e; background: rgba(255,65,54,.12); }
.prio-2 { color: var(--goal); border-color: #75621a; background: rgba(255,212,0,.09); }
.prio-low { color: var(--skc); border-color: #1c5c30; background: var(--skc-ink); }
.prio-none { color: var(--muted); }
.prio-head { white-space: nowrap; }
.prio-hint {
  display: block; color: var(--muted); font: 500 10px var(--mono); letter-spacing: 0;
  text-transform: none; white-space: nowrap;
}
.admin-sfn-pending {
  margin-left: 5px; display: inline-block; padding: 2px 7px; border-radius: 999px;
  font: 700 10px var(--head); letter-spacing: .5px; text-transform: uppercase;
  border: 1px solid #75621a; color: var(--goal); background: rgba(255,212,0,.09);
}
.admin-failure-reason { margin-top: 4px; color: #ff8a80; font-size: 12px; }
.admin-actions { white-space: nowrap; }
.admin-actions button { margin: 0 3px 3px 0; padding: 4px 8px; font-size: 11px; }
.admin-danger { color: #ff8a80; border-color: #7f332e; }
.admin-danger:hover { background: #7f332e; color: #fff; }
.admin-empty { color: var(--muted); font-style: italic; text-align: center; }
.admin-modal-backdrop {
  position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(4, 7, 10, .76); backdrop-filter: blur(3px);
}
/* Capped to the viewport (minus the backdrop's 20px padding) and scrolled
   inside: the backdrop is fixed, so a dialog taller than the screen (an export
   list with 60+ claimants) was otherwise cut off with no way to reach its end.
   An explicit calc, not 100%: a percentage on the backdrop's auto grid row
   resolves against the content height and never clamps. The header sticks so
   Close stays reachable while scrolling. */
.admin-modal { width: min(480px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; background: #141920; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 22px 70px rgba(0,0,0,.55); }
.admin-modal header { position: sticky; top: 0; z-index: 1; background: #141920; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.admin-modal h3 { margin: 0; font: 700 16px var(--head); }
.admin-modal header button { padding: 4px 8px; color: var(--muted); background: transparent; }
.admin-modal-form { display: grid; gap: 13px; padding: 18px; }
.admin-modal-form label { display: grid; gap: 5px; color: var(--muted); font: 700 11px var(--head); letter-spacing: .5px; text-transform: uppercase; }
.admin-modal-form .admin-input { width: 100%; }
.admin-modal-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* The incoherence list the Validate button opens (annotator.js's
   showIncoherenceList). Rides the shared modal; each row is click-to-jump, so
   it gets the pointer and a hover state the static admin tables do not need. */
.incoh-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.incoh-item {
  display: grid;
  grid-template-columns: 4.5em 11em 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.incoh-item:hover { background: rgba(255, 255, 255, 0.07); }
.incoh-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.incoh-rule { color: #ff6b6b; font-weight: 600; }
.incoh-detail { color: var(--muted); line-height: 1.4; }
@media (max-width: 640px) {
  .incoh-item { grid-template-columns: 4.5em 1fr; }
  .incoh-detail { grid-column: 1 / -1; }
}
/* Bypass (coherence bypass): the dialog body, the per-row Bypass / Undo
   buttons, the Bypassed section with its standing warning, and the footer
   Validate button shown once only bypassed flags remain. */
#ann-incoh-modal .admin-modal { width: min(640px, 100%); }
.incoh-body { padding: 14px 18px 18px; }
.incoh-item:has(.incoh-action) { grid-template-columns: 4.5em 11em 1fr auto; }
.incoh-action { padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.incoh-section-title { margin: 16px 0 6px; font: 700 12px var(--head); letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.incoh-bypass-warning { margin: 0; padding: 9px 12px; border: 1px solid #ffca2855; background: rgba(255, 202, 40, .08); color: #ffca28; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.incoh-bypassed-item .incoh-rule { color: var(--muted); text-decoration: line-through; }
.incoh-footer { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.wl-warn.incoh-bypassed { color: var(--muted); font-weight: 600; }
#validate-btn.has-bypass { color: #ffca28; }
.admin-modal-warn { margin: 0; padding: 10px 12px; border: 1px solid #7f332e; background: rgba(127, 51, 46, .15); color: #ff8a80; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.admin-modal-warn p, .admin-modal-warn ul { margin: 0 0 8px; }
.admin-modal-warn > :last-child { margin-bottom: 0; }
.admin-warn-lead { font-weight: 700; }
.admin-warn-list { padding-left: 18px; }
.admin-warn-list li + li { margin-top: 2px; }
.admin-warn-list code { overflow-wrap: anywhere; }
.admin-modal-error { margin: 0; color: #ff8a80; font-size: 13px; min-height: 1em; }
.admin-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.admin-export-table { width: 100%; border-collapse: collapse; }
.admin-export-table th {
  padding: 7px 9px; text-align: left; color: var(--muted); border-bottom: 1px solid var(--border);
  font: 700 10px var(--head); letter-spacing: 1px; text-transform: uppercase;
}
.admin-export-table td { padding: 8px 9px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.admin-export-table tbody tr:last-child td { border-bottom: none; }

/* ---- batch match import ---- */
.admin-batch-modal { width: min(760px, 100%); }
.admin-batch-modal .admin-modal-form textarea.admin-input { resize: vertical; font: 600 13px var(--mono); }
.admin-batch-progress { padding: 0 18px 4px; }
.admin-batch-progress-bar-wrap { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.admin-batch-progress-bar { height: 100%; background: var(--skc); transition: width .15s ease; }
.admin-batch-progress-text { margin: 6px 0 0; color: var(--muted); font-size: 12px; font: 700 11px var(--head); letter-spacing: .3px; }
.admin-batch-table { width: 100%; border-collapse: collapse; margin: 0; }
.admin-batch-table th {
  padding: 7px 9px; text-align: left; color: var(--muted); border-bottom: 1px solid var(--border);
  font: 700 10px var(--head); letter-spacing: 1px; text-transform: uppercase;
}
.admin-batch-table td { padding: 7px 9px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; font-size: 13px; }
.admin-batch-table tbody tr:last-child td { border-bottom: none; }
.admin-batch-status {
  display: inline-block; padding: 2px 7px; border-radius: 999px; font: 700 10px var(--head);
  letter-spacing: .5px; text-transform: uppercase; border: 1px solid var(--border);
}
.admin-batch-status-pending { color: var(--muted); background: var(--panel-3); }
.admin-batch-status-inflight { color: var(--skc); border-color: #1c5c30; background: var(--skc-ink); }
.admin-batch-status-success { color: var(--skc); border-color: #1c5c30; background: var(--skc-ink); }
.admin-batch-status-failed { color: #ff8a80; border-color: #7f332e; background: rgba(255,65,54,.12); }
.admin-batch-status-exists { color: var(--goal); border-color: #75621a; background: rgba(255,212,0,.09); }
.admin-batch-message { color: var(--muted); }
.admin-batch-summary { padding: 14px 18px 18px; border-top: 1px solid var(--border); }
.admin-batch-summary-line { margin: 4px 0; font-size: 13px; }
.admin-batch-summary-line code { font: 600 12px var(--mono); }
.admin-batch-failed-list { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: var(--muted); }
.admin-batch-failed-list code { font: 600 12px var(--mono); color: var(--text); }

@media (max-width: 700px) {
  #admin-header { gap: 10px; padding: 10px 14px; }
  #admin-main { padding: 18px 14px; }
  #admin-head-row { align-items: stretch; flex-direction: column; }
  #admin-head-row .admin-head-actions { align-self: flex-start; }
}
/* Pre-warm not done (frontend/js/prewarm.js): the match is still being
   prepared; annotators cannot open it yet and the list refreshes itself. */
.prewarm-pill {
  display: inline-block; margin-left: 5px; padding: 2px 7px; border-radius: 999px;
  font: 700 10px var(--head); letter-spacing: .5px; text-transform: uppercase;
  color: #ffd166; border: 1px solid #6b5a1e; background: rgba(255,209,102,.12);
}
.queue-preparing { color: var(--muted); font-style: italic; cursor: not-allowed; }

/* Personal keyboard shortcut editor. */
.shortcut-panel { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: #000a; }
.shortcut-panel[hidden] { display: none; }
.shortcut-dialog { width: min(860px, 100%); max-height: 88vh; display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); box-shadow: 0 16px 70px #0008; }
.shortcut-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.shortcut-heading h2 { margin: 0; font-size: 20px; }
#shortcut-settings-instructions { color: var(--muted); line-height: 1.5; margin: 0; }
.shortcut-tools { display: flex; align-items: center; gap: 16px; min-height: 38px; }
#shortcut-settings-status { font-size: 13px; }
#shortcut-settings-status.shortcut-error { color: var(--shot); }
#shortcut-settings-rows { overflow-y: auto; min-height: 0; }
.shortcut-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.shortcut-row label { font-size: 13px; }
.shortcut-row input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); background: var(--bg); cursor: pointer; font: inherit; }
.shortcut-row input:focus { outline: 2px solid var(--skc); outline-offset: 1px; }
@media (max-width: 600px) {
  .shortcut-panel { padding: 10px; }
  .shortcut-dialog { padding: 14px; }
  .shortcut-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .shortcut-row label { grid-column: 1 / -1; }
  .shortcut-tools { align-items: flex-start; flex-direction: column; gap: 8px; }
}
.screen-error { max-width: 760px; margin: 8vh auto; padding: 24px; line-height: 1.6; }
.screen-error button, .screen-error a { margin: 8px 12px 8px 0; }
.screen-error a { color: var(--skc); }
.screen-error textarea { display: block; box-sizing: border-box; width: 100%; min-height: 180px; margin: 12px 0; }

/* ==== Admin redesign (MR 1): SkillCorner dark tokens ====
   Values from skcr-design-tokens' dark theme, applied only while an admin,
   users or queue screen is mounted (`:root:has(...)` so modals appended
   outside the screen get them too). The annotator video screen keeps the
   palette above. Inter is self-hosted (see the @font-face rules at the top). */
:root:has(#admin-screen, #assign-screen, #users-screen, #queue-screen) {
  --bg: #020617;
  --panel: #0f172a;
  --panel-2: #1e293b;
  --panel-3: #1e293b;
  --pop: #1e293b;
  --border: #334155;
  --border-soft: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --skc: #32fe6b;
  --skc-ink: #052e16;
  --info: #60a5fa;
  --warning: #fb923c;
  --danger: #f87171;
  --del: #f87171;
  --body-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root:has(#admin-screen, #assign-screen, #users-screen, #queue-screen) body { font-family: var(--body-font); }
#admin-header, #queue-header { background: var(--panel); }
#admin-main button, .admin-modal button { border-radius: 8px; }
.admin-modal, .admin-modal header { background: var(--panel); }
.admin-input { background: var(--bg); border-radius: 8px; }
#admin-table-wrap, .admin-stats-table-wrap { border-radius: 12px; background: var(--panel); }

/* status badges: pills with a dot */
.admin-workflow { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; }
.admin-workflow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.admin-workflow-assigned { color: var(--info); border-color: #1e3a8a; background: #172554; }
.admin-workflow-in_progress { color: #facc15; border-color: #713f12; background: #422006; }
.admin-workflow-annotated { color: #6fff9a; border-color: #166534; background: #14532d; }
.admin-workflow-intake_failed { color: var(--danger); border-color: #7f1d1d; background: #450a0a; }

/* KPI cards */
#admin-stats { margin-top: 16px; }
.admin-stat-card { border-radius: 12px; padding: 12px 14px; }
.admin-stat-value { font-family: var(--head); font-size: 24px; }

/* tabs */
.admin-tabs { display: flex; gap: 2px; margin: 20px 0 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.admin-tabs [role="tab"] {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
  background: none; color: var(--muted); padding: 10px 12px; font: 500 14px var(--body-font); white-space: nowrap;
}
#admin-main .admin-tabs [role="tab"] { border-radius: 0; }
.admin-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--skc); }
#admin-tab-monitoring, #admin-tab-leaderboard { margin-top: 14px; }

/* combobox (combobox.js) */
.combo { position: relative; min-width: 200px; }
.combo-btn {
  position: relative;
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  color: var(--text); font: 13px var(--body-font, inherit); text-align: left; cursor: pointer;
}
.combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-caret { width: 0; height: 0; border: 4px solid transparent; border-top-color: var(--muted); margin-top: 4px; flex: none; }
.combo-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; width: max(100%, 260px); max-width: calc(100vw - 32px);
  background: var(--pop, #1e293b); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.combo-search {
  width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0;
  background: transparent; color: var(--text); font: 13px var(--body-font, inherit); outline: none;
}
.combo-list { max-height: 260px; overflow-y: auto; padding: 4px; }
.combo-group { padding: 8px 8px 4px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.combo-opt { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.combo-opt:hover { background: var(--border); }
.combo-opt.active { background: var(--border); box-shadow: inset 2px 0 0 var(--skc); }
.combo-opt[aria-selected="true"] { color: var(--skc); }
.combo-opt mark { background: none; color: var(--skc); font-weight: 600; }
.combo-opt input[type="checkbox"] { margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--skc); pointer-events: none; }
.combo-empty { padding: 12px; color: var(--muted); text-align: center; font-size: 13px; }
/* In a dialog the list is laid in flow: it grows the dialog instead of being
   clipped by its scroll box. */
.admin-modal .combo-pop { position: static; width: 100%; max-width: none; margin-top: 4px; box-shadow: none; }
.admin-modal .combo { width: 100%; font: 13px var(--body-font, inherit); letter-spacing: normal; text-transform: none; }
/* A flex row ignores the UA [hidden] rule: the Edit assignees search hides rows with it. */
.assign-edit-row[hidden] { display: none; }

/* avatars (avatars.js) */
.avatar {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--av, #94a3b8); color: #020617; font: 700 10px var(--body-font, inherit);
  border: 2px solid var(--panel);
}
.avatar.main { box-shadow: 0 0 0 2px var(--skc); }
.avatar-stack { position: relative; display: inline-flex; align-items: center; white-space: nowrap; }
.avatar-stack .avatar + .avatar { margin-left: -6px; }
.avatar-more { margin-left: 6px; color: var(--muted); font-size: 12px; }
.avatar-none { color: var(--muted); font-size: 13px; }
.avatar-faces { display: inline-flex; align-items: center; }
.avatar-main-name { margin-left: 8px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* row actions: Open + "..." menu */
#admin-matches-table td.admin-actions { white-space: nowrap; text-align: right; }
.admin-open { color: var(--skc); text-decoration: none; font-weight: 600; margin-right: 8px; }
.row-menu { position: relative; display: inline-block; }
.row-menu summary {
  list-style: none; cursor: pointer; padding: 3px 9px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-weight: 700; letter-spacing: 1px;
}
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] summary { border-color: var(--skc); color: var(--text); }
.row-menu-items {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px;
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  background: var(--pop, #1e293b); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.row-menu-items button { width: 100%; text-align: left; border-color: transparent; background: none; }
.row-menu-items button:hover:not(:disabled) { background: var(--border-soft); }

/* phone width */
@media (max-width: 700px) {
  #admin-main { padding: 16px; }
  #admin-head-row { flex-direction: column; }
  #admin-filters > *, .admin-list-filters > * { flex: 1 1 100%; }
  .combo { min-width: 0; }
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #admin-header, #queue-header { flex-wrap: wrap; row-gap: 8px; }
  #admin-header .site-nav, #queue-header .site-nav { order: 3; flex: 1 1 100%; min-width: 0; overflow-x: auto; flex-wrap: nowrap; }
}

/* ==== Admin redesign (MR 2): Assignments split view ==== */
.assign-split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.assign-people {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; min-width: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  position: sticky; top: 0; max-height: calc(100vh - 190px);
}
.assign-people-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: none;
  color: var(--muted); font: 500 12px var(--body-font, inherit); cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--skc); color: var(--text); background: var(--border-soft); }
#assign-people-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }
#assign-people-list li[hidden] { display: none; }
.assign-person {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 0 2px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer;
}
.assign-person:hover { background: var(--border-soft); }
.assign-person[aria-pressed="true"] { background: var(--border-soft); border-color: var(--border); }
.assign-pool { border-bottom: 1px solid var(--border-soft); border-radius: 8px 8px 0 0; margin-bottom: 6px; }
.assign-person-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.assign-person-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-person-sub { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-person-count { font: 600 13px var(--mono); color: var(--muted); flex: none; }
.assign-load { display: block; height: 4px; border-radius: 2px; background: #14532d; overflow: hidden; }
.assign-load > span { display: block; height: 100%; background: var(--skc); }
.assign-detail { min-width: 0; }
#assign-detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#assign-detail-head .avatar { width: 36px; height: 36px; font-size: 13px; }
.assign-detail-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.assign-detail-title h3 { margin: 0; font: 700 18px var(--head); }
.assign-detail-sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.assign-working { padding: 3px 10px; border-radius: 999px; border: 1px solid #166534; background: #14532d; color: #6fff9a; font-size: 12px; }
.assign-idle { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 12px; }
#assign-tabs { margin-top: 12px; }
.admin-tabs[hidden] { display: none; }
.assign-toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; justify-content: space-between; margin: 12px 0 10px; }
.assign-toolbar #assign-filter { flex: 1 1 240px; max-width: 360px; }
#assign-table { min-width: 760px; }
#assign-table td.admin-actions { white-space: nowrap; text-align: right; }
#assign-table td.admin-actions [data-reopen] { margin-right: 6px; }
#assign-table tr.assign-row-current td { background: rgba(50, 254, 107, .06); }
#assign-table tr.assign-row-current td:first-child { box-shadow: inset 3px 0 0 var(--skc); }
.assign-status .assign-tag { margin-left: 4px; }
.assign-progress { margin-top: 4px; font-size: 12px; }
.assign-progress summary { color: var(--muted); cursor: pointer; }
.assign-progress ul { list-style: none; margin: 4px 0 0; padding: 0; }
.assign-progress li { padding: 1px 0; white-space: nowrap; }
.assign-progress-name { color: var(--text); }
.assign-check { width: 28px; }
.assign-check input { accent-color: var(--skc); }
/* The report and the bar share one sticky dock at the bottom of the list, so
   a run's outcome shows where the admin clicked; the report stays until
   dismissed, after the bar has closed. */
.assign-bulk-dock { position: sticky; bottom: 0; z-index: 20; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.assign-bulk-report {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; padding: 10px 12px;
  background: var(--pop); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -6px 24px rgba(0, 0, 0, .45);
}
#assign-bulk-report[hidden] { display: none; }
.assign-bulk-report > div { flex: 1 1 100%; order: 2; }
#assign-bulk-dismiss { margin-left: auto; }
#assign-bulk-progress { margin: 0; color: var(--text); font-size: 13px; }
#assign-bulk-errors { margin: 0; padding-left: 18px; color: var(--danger); font-size: 13px; max-height: 30vh; overflow-y: auto; }
#assign-bulk-errors:empty { display: none; }
.assign-bulk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--pop); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .45);
}
.assign-bulk[hidden], .assign-bulk [hidden] { display: none; }
.assign-bulk-count { font-weight: 600; margin-right: 4px; }
.assign-bulk-group { display: inline-flex; align-items: center; gap: 6px; }
#assign-bulk-priority { width: 72px; }
.assign-bulk .combo { min-width: 180px; }
/* The bar sits at the bottom: its picker opens upward. */
.assign-bulk .combo-pop { top: auto; bottom: calc(100% + 4px); }

/* Add matches side panel */
.assign-add-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(2, 6, 23, .6); }
.assign-add-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(460px, 100vw);
  display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0, 0, 0, .5);
}
.add-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.add-head h3 { margin: 0; font: 700 16px var(--head); overflow-wrap: anywhere; }
.add-filters { display: flex; align-items: center; gap: 8px; }
#add-search { flex: 1; min-width: 0; }
#add-list {
  list-style: none; margin: 0; padding: 0; flex: 1 1 auto; min-height: 160px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
}
#add-list .admin-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.add-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); font-size: 13px; cursor: pointer; }
.add-row input { accent-color: var(--skc); }
.add-row-in { color: var(--muted); cursor: default; }
.add-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-add-panel .admin-pager { flex-wrap: wrap; margin: 0; }
.add-form { display: flex; flex-direction: column; gap: 6px; }
.add-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
#add-priority { width: 100px; }
.add-help { color: var(--muted); font-size: 11px; }
.add-result { margin: 0; color: var(--danger); font-size: 13px; }
.add-result:empty { display: none; }
#add-submit { width: 100%; padding: 9px; }
/* The panel scrolls: its picker is laid in flow so the scroll box never clips it. */
.assign-add-panel .combo { width: 100%; }
.assign-add-panel .combo-pop { position: static; width: 100%; max-width: none; margin-top: 4px; box-shadow: none; }

@media (max-width: 700px) {
  .assign-split { grid-template-columns: minmax(0, 1fr); }
  .assign-people { position: static; max-height: 40vh; }
  .assign-toolbar #assign-filter { max-width: none; }
  .assign-bulk-group { flex: 1 1 100%; }
  .admin-pager { flex-wrap: wrap; }
  .assign-bulk .combo { flex: 1; min-width: 0; }
}

/* ==== Annotator page (MR 3): the sections of / (screens/queue.js) ==== */
.queue-page { width: min(920px, 100%); margin: 0 auto; padding: 24px 20px 60px; }
#queue-main .queue-title { margin: 0; font: 600 24px/32px var(--head); }
/* A flex/grid box ignores the UA [hidden] rule: empty sections must vanish. */
.queue-sec[hidden], .queue-hero[hidden], #queue-screen .admin-pager[hidden] { display: none !important; }
.queue-hero {
  margin-top: 20px; padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center;
  border: 1px solid #166534; border-radius: 12px; background: linear-gradient(135deg, var(--panel) 0%, #0b2a17 120%);
}
.queue-hero.empty { border: 1px dashed var(--border); background: var(--panel); }
.queue-hero small { color: var(--skc); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.queue-hero.empty small { color: var(--muted); }
.queue-hero h3 { margin: 6px 0 4px; font: 600 24px/30px var(--head); overflow-wrap: anywhere; }
.queue-hero.empty h3 { font-size: 20px; }
.queue-hero p { margin: 4px 0 0; }
.queue-hero-meta { color: var(--muted); font-size: 13px; }
.queue-hero-help { color: var(--muted); font-size: 13px; line-height: 1.5; }
.queue-hero-action { display: flex; align-items: center; gap: 8px; }
/* `#queue-screen` beats the older inline .queue-work-link / .queue-open-link
   rules of index.html (a solid green fill, Chakra Petch). */
#queue-screen .queue-hero .queue-work-link {
  display: inline-block; padding: 11px 18px; border: 1px solid var(--skc); border-radius: 10px;
  background: var(--skc); color: #020617; font: 600 15px var(--body-font); text-decoration: none; white-space: nowrap;
}
.queue-sec { margin-top: 28px; }
.queue-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.queue-sec-head h3, .queue-sec-title { margin: 0; font: 600 16px var(--head); }
.queue-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--danger); font-size: 13px; }
#queue-screen .queue-retry {
  flex: none; padding: 4px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
  color: var(--text); font: 500 13px var(--body-font); cursor: pointer;
}
#queue-screen .queue-retry:hover { border-color: var(--skc); }
.queue-sec-hint { color: var(--muted); font: 500 12px var(--mono); }
.queue-count:empty { display: none; }
.queue-count { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--pop); color: var(--muted); font: 500 11px var(--body-font); }
#queue-filter { width: min(300px, 100%); min-width: 0; }
#queue-finished > summary { cursor: pointer; list-style: none; }
#queue-finished > summary::-webkit-details-marker { display: none; }
.queue-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.queue-row:last-child { border-bottom: 0; }
.queue-row:hover { background: #0b1324; }
.queue-row-lead { flex: none; }
.queue-row-main { flex: 1; min-width: 0; }
.queue-row-name { font-weight: 500; overflow-wrap: anywhere; }
.queue-row-meta { color: var(--muted); font: 500 12px var(--mono); }
.queue-row-action { flex: none; }
.queue-assignees { flex: none; }
.queue-empty { padding: 16px; color: var(--muted); text-align: center; }
#queue-screen .queue-row .queue-work-link, #queue-screen .queue-row .queue-open-link {
  display: inline-block; margin: 0; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: none;
  color: var(--text); font: 500 13px var(--body-font); text-decoration: none; white-space: nowrap;
}
#queue-screen .queue-row .queue-work-link { border-color: #166534; color: var(--skc); }
#queue-screen .queue-row .queue-work-link:hover, #queue-screen .queue-row .queue-open-link:hover { background: var(--pop); filter: none; }
.queue-upnext { color: var(--muted); font-size: 12px; white-space: nowrap; }
.queue-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border);
  font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap;
}
.queue-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.queue-badge-started { color: #facc15; border-color: #713f12; background: #422006; }
.queue-badge-done { color: #6fff9a; border-color: #166534; background: #14532d; }
.queue-badge-current { margin-left: 6px; color: var(--skc); border-color: #166534; background: #052e16; }
#queue-screen .admin-pager { margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .queue-page { padding: 16px 16px 48px; }
  .queue-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .queue-row { flex-wrap: wrap; gap: 8px 10px; padding: 12px; }
  .queue-row-main { flex: 1 1 0; }
  /* The admin's avatar stack takes its own line; the action stays on the first. */
  .queue-assignees { order: 5; flex-basis: 100%; }
  #queue-filter { width: 100%; }
}
