/* Plain CSS, no framework and no build step. The whole point of this box is that
   it can be patched and understood in one sitting.

   The look is the public site's (datamanufacturer.com): warm paper and ink, deep teal for
   the main action, hairlines instead of boxes, pill buttons, and the site's three typefaces.
   Every typeface and colour is a token in :root below, so the text style, or a colour,
   changes in one place. */

/* Self-hosted, as on the site, so a video review page makes no third-party request.
   Geist and Geist Mono are variable fonts: one file holds every weight. Licences (SIL OFL)
   are beside them in fonts/. */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/geist-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/geist-mono-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/instrument-serif-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/static/fonts/instrument-serif-latin-400-italic.woff2) format("woff2");
}

:root {
  /* ---- Text style. Change the portal's type here, and only here. ----
     --font-sans     everything you read: text, tables, buttons, labels
     --font-mono     IDs, versions, serials, times, durations, keys
     --font-display  page titles and the big numbers on tiles
     Instrument Serif has one weight, so --display-weight is 400; a sans display face would
     want 600 or 700 and a tracking nearer -.02em. */
  --font-sans:        "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:        "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display:     "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --display-weight:   400;
  --display-tracking: -.012em;
  --title-size:       40px;   /* a page's title */
  --number-size:      34px;   /* a tile's number */
  --display:          var(--font-display);   /* the older name, still used below */

  /* ---- Colour: the site's palette. ----
     The fills (--brand, --ok, --warn, --bad) carry light text, so they stay dark enough
     for it in both themes; text on cards uses the *-ink and --brand-text tokens. */
  --brand:        #0f4c5c;
  --brand-dark:   #0c3a45;
  --brand-mid:    #1a6b7d;
  --brand-tint:   rgb(15 76 92 / .08);
  --brand-pale:   #e4e8e3;
  --brand-paler:  #efece4;
  --on-brand:     #f5f2eb;

  --accent:       #9c4027;
  --accent-soft:  #f3e3d8;
  --saffron:      #e9a23b;

  --ok:           #1c6352;
  --ok-soft:      #e1ece6;
  --ok-ink:       #165443;
  --ok-line:      #b9d3c7;
  --warn:         #a8650e;
  --warn-soft:    #f7ebd5;
  --warn-ink:     #7a4a0c;
  --warn-line:    #e9d0a3;
  --bad:          #c2412d;
  --bad-soft:     #f7e3dd;
  --bad-ink:      #923221;
  --bad-line:     #ecc1b6;

  --text:         #14252a;
  --text-2:       #44545a;
  --muted:        #5b6769;
  --line:         rgb(20 37 42 / .18);
  --line-soft:    rgb(20 37 42 / .10);
  --surface:      #f5f2eb;
  --white:        #fbfaf7;

  /* Always dark: video letterboxing and poster backgrounds read as the frame
     around footage, not as part of the page, so they do not follow the theme. */
  --media-bg:     #0d1418;
  --clip:         linear-gradient(160deg, #1b2528 0%, #121a1c 70%);

  /* Brand as TEXT, as opposed to --brand which is a fill with light text on it.
     These must differ in dark mode: the fill has to stay dark enough for light
     text, while text on a dark card has to be light. */
  --brand-text:   #0f4c5c;
  --brand-text-2: #0c3a45;

  --radius:       10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 1px rgb(20 37 42 / .04), 0 4px 12px -8px rgb(20 37 42 / .12);
  --shadow:       0 1px 1px rgb(20 37 42 / .05), 0 14px 30px -18px rgb(20 37 42 / .30);
  --shadow-md:    0 1px 1px rgb(20 37 42 / .04), 0 10px 24px -10px rgb(20 37 42 / .16), 0 40px 80px -32px rgb(20 37 42 / .28);
}

/* Dark theme: the site's dark palette. Follows the system unless the viewer has chosen one,
   which is the same contract as the public site: the toggle writes data-theme and the
   :not([data-theme="light"]) guard lets an explicit light choice win over a dark
   system preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:        #1a6b7d;
    --brand-dark:   #155a69;
    --brand-mid:    #2a8295;
    --brand-tint:   rgb(127 196 189 / .12);
    --brand-pale:   #1d2b2d;
    --brand-paler:  #1b2427;
    --on-brand:     #ebe8e1;
    --brand-text:   #7fc4bd;
    --brand-text-2: #a9dcd6;

    --accent:       #e8956a;
    --accent-soft:  #3a2921;
    --saffron:      #f0b25a;

    --ok:           #2b7563;
    --ok-soft:      #16302a;
    --ok-ink:       #82cbb6;
    --ok-line:      #2a5247;
    --warn-soft:    #33270f;
    --warn-ink:     #f0b25a;
    --warn-line:    #5b461a;
    --bad-soft:     #3b1f1a;
    --bad-ink:      #ef9a86;
    --bad-line:     #6e3428;

    --text:         #ebe8e1;
    --text-2:       #a6b1b2;
    --muted:        #8f9a9b;
    --line:         rgb(235 232 225 / .17);
    --line-soft:    rgb(235 232 225 / .09);
    --surface:      #0f1517;
    --white:        #172022;

    --shadow-sm:    0 1px 1px rgb(0 0 0 / .30);
    --shadow:       0 0 0 1px rgb(255 255 255 / .03), 0 18px 36px -20px rgb(0 0 0 / .75);
    --shadow-md:    0 0 0 1px rgb(255 255 255 / .06), 0 24px 60px -24px rgb(0 0 0 / .70);
  }
}

:root[data-theme="dark"] {
  --brand:        #1a6b7d;
  --brand-dark:   #155a69;
  --brand-mid:    #2a8295;
  --brand-tint:   rgb(127 196 189 / .12);
  --brand-pale:   #1d2b2d;
  --brand-paler:  #1b2427;
  --on-brand:     #ebe8e1;
  --brand-text:   #7fc4bd;
  --brand-text-2: #a9dcd6;

  --accent:       #e8956a;
  --accent-soft:  #3a2921;
  --saffron:      #f0b25a;

  --ok:           #2b7563;
  --ok-soft:      #16302a;
  --ok-ink:       #82cbb6;
  --ok-line:      #2a5247;
  --warn-soft:    #33270f;
  --warn-ink:     #f0b25a;
  --warn-line:    #5b461a;
  --bad-soft:     #3b1f1a;
  --bad-ink:      #ef9a86;
  --bad-line:     #6e3428;

  --text:         #ebe8e1;
  --text-2:       #a6b1b2;
  --muted:        #8f9a9b;
  --line:         rgb(235 232 225 / .17);
  --line-soft:    rgb(235 232 225 / .09);
  --surface:      #0f1517;
  --white:        #172022;

  --shadow-sm:    0 1px 1px rgb(0 0 0 / .30);
  --shadow:       0 0 0 1px rgb(255 255 255 / .03), 0 18px 36px -20px rgb(0 0 0 / .75);
  --shadow-md:    0 0 0 1px rgb(255 255 255 / .06), 0 24px 60px -24px rgb(0 0 0 / .70);
}

/* What the browser draws itself follows the theme too: a dropdown's open list, date
   pickers, scrollbars. Set on single controls only, Chrome still opened some lists white,
   with the page's light text on them. The options carry the theme's colours as well, so a
   list can never be light on light or dark on dark, whatever the select itself is styled. */
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }
select option, select optgroup { background-color: var(--white); color: var(--text); }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.55;
  /* Instrument Serif has no bold: a heading set bold stays as drawn, not smeared. */
  font-synthesis: style;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--brand-text); text-underline-offset: 2px; }
a:hover { color: var(--brand-text-2); }
:is(a, button, select, input, textarea, summary):focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px;
}

.mono, code, .h-when, td.mono { font-family: var(--font-mono); }
code { font-size: .88em; background: var(--brand-paler); border: 1px solid var(--line-soft);
       padding: .08em .34em; border-radius: 4px; }
.small { font-size: 12px; }

/* ---------- header ---------- */

.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 24px; min-height: 64px; box-sizing: border-box;
  background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line-soft);
}
.bar a.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -.01em;
}
.bar a.brand > span:not(.brand-mark) { font-weight: 400; font-size: 13px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); }
/* The four-bar mark from the public site, drawn the same: teal bars, the third in burnt
   orange, so the two read as one product. */
.brand-mark { display: inline-flex; gap: 2.5px; align-items: center; height: 22px; flex: none; }
.brand-mark i { width: 3px; height: 11px; border-radius: 2px; background: var(--brand-text); }
.brand-mark i:nth-child(2) { height: 21px; }
.brand-mark i:nth-child(3) { height: 16px; background: var(--accent); }
.brand-mark i:nth-child(4) { height: 8px; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.bar .who {
  opacity: .95; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px;
}
/* Scoped to the header. As a bare `.warn` it also matched `.checks li.warn`,
   painting the whole WARN row dark brown with unreadable text -- a type
   selector colliding with an element-scoped one. */
.bar .warn {
  background: #6d4300; color: #ffd79a; padding: 4px 9px;
  border-radius: 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .02em;
}

button { font: inherit; cursor: pointer; border-radius: var(--radius); }
/* Buttons are pills, as on the site: teal for the main action, a hairline for the rest,
   a red tint for the one that throws something away. */
button.ghost, a.ghost-link {
  background: transparent; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); padding: 6px 14px; font-size: 13px; font-weight: 500;
  border-radius: 999px; display: inline-block; line-height: 1.35;
  transition: background .12s ease, border-color .12s ease;
}
button.ghost:hover, a.ghost-link:hover { background: var(--brand-paler); border-color: var(--text-2); color: var(--text); }
button.primary {
  background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); border-radius: 999px;
  padding: 9px 18px; font-weight: 500; font-size: 14px; transition: background .12s ease;
}
button.primary:hover { background: var(--brand-dark); }
button.danger {
  background: var(--bad-soft); color: var(--bad-ink); border: 1px solid var(--bad-line); border-radius: 999px;
  padding: 9px 18px; font-weight: 500; font-size: 14px;
}
button.danger:hover { border-color: var(--bad); }
form.inline { display: inline; margin: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 56px; }

/* ---------- messages ---------- */

.flash, .banner {
  padding: 11px 15px; border-radius: var(--radius); margin: 0 0 16px;
  border: 1px solid var(--ok-line); background: var(--ok-soft); color: var(--ok-ink); font-size: 14px;
}
.flash.bad, .banner.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-ink); }
.error {
  background: var(--bad-soft); border: 1px solid var(--bad-line);
  color: var(--bad-ink); padding: 10px 14px; border-radius: var(--radius);
  margin: 0 0 14px; font-size: 14px;
}

/* ---------- headings ---------- */

h1 { margin: 6px 0 4px; font-family: var(--font-display); font-size: 34px; font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); line-height: 1.05; }
h2 { margin: 26px 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.col-main h2:first-of-type, .col-side h2:first-of-type { margin-top: 20px; }
p.sub { margin: 0 0 18px; color: var(--text-2); font-size: 14.5px; }
.crumb { margin: 0 0 10px; font-size: 13px; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--brand-text); }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 8px 0; }
.empty {
  background: var(--white); border: 1px dashed var(--line);
  border-radius: var(--radius-lg); padding: 26px; text-align: center;
  color: var(--muted); font-size: 14px;
}

/* ---------- stat tiles ---------- */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.stats div {
  background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 13px 16px; box-shadow: var(--shadow-sm); min-width: 0;
}
.stats strong {
  display: block; font-family: var(--font-display); font-size: 30px; font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); line-height: 1.05; color: var(--text);
}
.stats strong.bad-num { color: var(--bad-ink); }
.stats span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- filters ---------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.filters label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.filters label.check {
  flex-direction: row; align-items: center; gap: 7px; text-transform: none;
  letter-spacing: 0; font-size: 13px; font-weight: 400; color: var(--text-2);
  padding-bottom: 8px;
}
.filters select, .filters input[type="number"] {
  font: inherit; font-size: 14px; padding: 7px 9px; min-height: 36px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  color: var(--text);
}
.filters select:hover, .filters input[type="number"]:hover { border-color: var(--brand); }
.filters input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.filters button.primary { min-height: 36px; }

/* ---------- episode grid ---------- */

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px;
}
.card {
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .13s ease, box-shadow .13s ease, transform .13s ease;
}
.card:hover { border-color: var(--line); box-shadow: var(--shadow); transform: translateY(-1px); }
.card a { text-decoration: none; color: inherit; display: block; }
.card.is-superseded { opacity: .58; }
.card.is-superseded:hover { opacity: 1; }

.poster { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--media-bg); }
.poster.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(155deg, var(--brand-mid) 0%, var(--brand) 52%, var(--brand-dark) 100%);
}
.poster.placeholder .ph-score { font-family: var(--font-mono); font-size: 30px; font-weight: 500; line-height: 1; }
.poster.placeholder .ph-of { font-size: 11px; opacity: .72; margin-top: 3px; }
.poster.placeholder .ph-plat { font-family: var(--font-mono); font-size: 11px; opacity: .8; margin-top: 9px; }
.poster.placeholder.score-good { background: linear-gradient(155deg, #66a487 0%, var(--ok) 52%, #2f5e4b 100%); }
.poster.placeholder.score-warn { background: linear-gradient(155deg, #d6a353 0%, var(--warn) 52%, #7d5312 100%); }
.poster.placeholder.score-bad  { background: linear-gradient(155deg, #c9635f 0%, var(--bad) 52%, #7c2a28 100%); }

.card .meta { padding: 12px 14px 14px; }
.card .task {
  font-weight: 500; font-size: 14.5px; line-height: 1.3; letter-spacing: -.01em;
  margin-bottom: 3px;
}
.card .sub { color: var(--muted); font-size: 12px; margin: 0 0 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* Tinted pills with same-hue text: a label, not a warning light. A state (good, warning,
   bad) carries the site's dot as well as its colour. Solid fills are reserved for a
   recorded decision. */
.chip {
  display: inline-block; font-size: 12px; font-weight: 500; line-height: 1.5;
  padding: 1px 9px; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-text-2);
  border: 1px solid transparent; white-space: nowrap;
}
.chip.good { background: var(--ok-soft); color: var(--ok-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.bad  { background: var(--bad-soft); color: var(--bad-ink); }
.chip.good::before, .chip.warn::before, .chip.bad::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%;
  background: currentColor; vertical-align: 1px; }
.chip.solid.good { background: var(--ok); color: #fff; }
.chip.solid.bad  { background: var(--bad); color: #fff; }
.chip.open { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip.plat { font-family: var(--font-mono); font-size: 11px; }
.chip.job { background: var(--brand-paler); color: var(--text-2); border-color: var(--line-soft); }

.pager { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; align-items: center; margin: 26px 0 0; font-size: 14px; }
.pager a { text-decoration: none; font-weight: 500; }
.pager .pg-off { color: var(--muted); opacity: .55; }
.pg-nums { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pg-nums a, .pg-cur { min-width: 34px; height: 34px; box-sizing: border-box; padding: 0 8px; border-radius: 999px;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pg-nums a { border: 1px solid var(--line); }
.pg-nums a:hover { background: var(--surface); }
.pg-cur { background: var(--text); color: var(--surface); font-weight: 500; }
.pg-gap { color: var(--muted); padding: 0 2px; }
.pg-sum, .list-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-count { margin-right: 10px; }

/* ---------- episode page ---------- */

.columns { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
/* Letterboxed into a fixed box rather than sized by the video.
   These files are intrinsically 720x1280 -- portrait -- even though the
   on-device check records 1280x720, so an unconstrained width:100% made the
   player about 1780px tall and pushed the whole page down. object-fit keeps
   portrait, landscape and rotated footage all inside the same frame. */
.player {
  width: 100%; aspect-ratio: 16 / 9; max-height: 68vh;
  background: #000; border-radius: var(--radius-lg);
  display: block; box-shadow: var(--shadow); object-fit: contain;
  /* The player background is always dark, so the <video> fallback text --
     shown only when the browser cannot decode the file -- needs a light
     colour. It inherited --text and was unreadable on black in light mode. */
  color: #e8eef0;
}

/* Card thumbnail: a real frame, layered over the score tile and faded in once
   it decodes, so a failed or slow load leaves the tile visible. */
.poster { position: relative; }
.poster[hidden] { display: none; }
.poster-clip {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--media-bg);
  opacity: 0; transition: opacity .25s ease;
}
.poster-clip.ready { opacity: 1; }
.card:hover .poster-clip.ready { object-fit: contain; }
.poster .ph-hint {
  position: absolute; right: 7px; bottom: 6px; z-index: 2;
  font-size: 11px; font-weight: 500;
  background: rgba(0,0,0,.55); color: #fff; padding: 2px 7px; border-radius: 999px;
  opacity: 0; transition: opacity .18s ease;
}
.card:hover .ph-hint { opacity: 1; }

.trace { margin: 0; }
.trace dt { font-weight: 500; font-size: 13.5px; color: var(--text); margin: 16px 0 6px; }
.trace dd {
  margin: 0 0 6px; padding: 11px 14px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--radius); font-size: 14px;
}
.trace dd p { margin: 0 0 6px; }
.trace dd p:last-child { margin-bottom: 0; }
.trace audio { width: 100%; max-width: 380px; height: 34px; margin: 4px 6px 4px 0; vertical-align: middle; }

.score {
  font-family: var(--font-display); font-size: 34px; font-weight: var(--display-weight); margin: 0 0 12px;
  padding: 12px 16px; border-radius: var(--radius); text-align: center;
}
.score.good { background: var(--ok-soft); color: var(--ok-ink); }
.score.warn { background: var(--warn-soft); color: var(--warn-ink); }
.score.bad  { background: var(--bad-soft); color: var(--bad-ink); }

.checks { list-style: none; margin: 0 0 8px; padding: 0; font-size: 12.5px; }
.checks li {
  display: grid; grid-template-columns: 52px 1fr; gap: 3px 9px;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.checks li:last-child { border-bottom: 0; }
.checks .lvl {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em;
  padding: 2px 0; text-align: center; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-text-2); height: fit-content;
}
.checks li.pass .lvl { background: var(--ok-soft); color: var(--ok-ink); }
.checks li.warn .lvl { background: var(--warn-soft); color: var(--warn-ink); }
.checks li.fail .lvl { background: var(--bad-soft); color: var(--bad-ink); }
.checks .id { font-weight: 500; }
.checks .detail { grid-column: 2; color: var(--muted); }

.kv { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; }
.kv li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--line-soft);
}
.kv li:last-child { border-bottom: 0; }
.kv li > span:first-child { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.kv li > span:last-child { text-align: right; font-weight: 500; }

/* ---------- verdict ---------- */

.verdict {
  margin: 0 0 8px; padding: 11px 14px; border-radius: var(--radius);
  font-weight: 600; font-size: 15px;
}
.verdict span { display: block; font-weight: 400; font-size: 11.5px; opacity: .85; margin-top: 2px; }
.verdict.accept { background: var(--ok-soft); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.verdict.reject { background: var(--bad-soft); color: var(--bad-ink); border: 1px solid var(--bad-line); }
.verdict-reason {
  margin: 0 0 12px; font-size: 13px; color: var(--text-2);
  border-left: 3px solid var(--line); padding: 2px 0 2px 11px;
}
.verdict-form {
  margin: 0 0 6px; background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 13px 14px; box-shadow: var(--shadow-sm);
}
/* In the Verdict card the form is the card's own content, not a second box inside it. */
.panel-body > .verdict-form { background: transparent; border: 0; box-shadow: none; padding: 0; }
.verdict-form .vf-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.verdict-form .vf-label .hint { display: block; font-weight: 400; font-size: 12.5px; margin: 3px 0 0; }
.verdict-form textarea {
  width: 100%; font: inherit; font-size: 13.5px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); resize: vertical;
  background: var(--white); color: var(--text);
}
.verdict-form textarea:hover { border-color: var(--brand); }
.vf-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vf-buttons button { padding: 8px 14px; font-size: 13.5px; flex: 1 1 auto; }
.vf-buttons button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); flex: 0 0 auto; }
.vf-buttons button.ghost:hover { border-color: var(--bad-line); color: var(--bad-ink); background: var(--bad-soft); }

/* ---------- job segments ---------- */

.segments {
  list-style: none; margin: 0 0 20px; padding: 0;
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--white); box-shadow: var(--shadow-sm);
}
.segments li {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 11px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.segments li:last-child { border-bottom: 0; }
.segments li:hover { background: var(--brand-paler); }
.segments li.here { background: var(--brand-pale); box-shadow: inset 3px 0 0 var(--brand); }
.segments .seg-n {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--brand-text-2); background: var(--brand-tint);
  padding: 3px 8px; border-radius: 999px; min-width: 54px; text-align: center;
}
.segments .seg-label { font-weight: 500; text-decoration: none; }
.segments li.here .seg-label { color: var(--muted); font-weight: 400; font-style: italic; }
.segments .seg-meta { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* ---------- history ---------- */

.history { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.history li {
  display: flex; gap: 9px; padding: 6px 0;
  border-bottom: 1px solid var(--line-soft); color: var(--muted);
}
.history li:last-child { border-bottom: 0; }
.history .h-when { white-space: nowrap; font-size: 11px; }
.history .h-who { font-weight: 500; color: var(--text); }
.history .h-what { margin-left: auto; text-align: right; }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto; border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-sm);
}
table.audit { border-collapse: collapse; width: 100%; font-size: 13px; }
table.audit th {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
table.audit td {
  padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
table.audit tbody tr:last-child td { border-bottom: 0; }
table.audit tbody tr:hover { background: var(--brand-paler); }
table.audit td.nowrap, a.nowrap { white-space: nowrap; }
table.audit td.tiny { font-size: 10.5px; color: var(--muted); word-break: break-all; }
table.collectors td.num, table.collectors th.num { text-align: right; white-space: nowrap; }
table.collectors td:first-child { font-weight: 500; }
table.collectors td:first-child .sub2 { font-weight: 400; margin-top: 2px; }
table.collectors td:first-child .sub2.fleet-tag { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
table.collectors td.verdicts .sub2 { white-space: nowrap; }

.chip.act-verdict { background: var(--brand); color: var(--on-brand); }
.chip.act-verdict_cleared { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.chip.act-media { background: var(--warn-soft); color: var(--warn-ink); }
.chip.act-login { background: var(--ok-soft); color: var(--ok-ink); }
.chip.act-view { background: var(--brand-paler); color: var(--text-2); border-color: var(--line-soft); }
.chip.act-rescan { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- login ---------- */

.login {
  max-width: 400px; margin: 9vh auto 0; background: var(--white);
  border: 1px solid var(--line-soft); border-radius: 18px;
  padding: 30px 28px 24px; box-shadow: var(--shadow-md);
}
.login h1 { margin: 0 0 18px; font-size: 38px; }
.login form { display: flex; flex-direction: column; gap: 5px; }
.login label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 10px; }
.login input {
  font: inherit; font-size: 15px; padding: 10px 12px; min-height: 42px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.login input:hover { border-color: var(--brand); }
.login button.primary { margin-top: 18px; min-height: 44px; }
.login .hint { margin-top: 16px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  main { padding: 14px 13px 44px; }
  .bar { flex-wrap: wrap; gap: 9px 10px; padding: 10px 13px; }
  .bar-right { flex-wrap: wrap; gap: 7px; width: 100%; }
  .bar .who { order: -1; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px; }
  .stats strong { font-size: 18px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters label.check { padding-bottom: 0; }
  .filters select, .filters input[type="number"], .filters button.primary {
    width: 100%; min-height: 42px;
  }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
  .player { border-radius: 0; margin-inline: -13px; width: calc(100% + 26px); }
  .vf-buttons button { min-height: 44px; }
  .segments li { gap: 7px; }
  .segments .seg-meta { margin-left: 0; width: 100%; }
  .history li { flex-wrap: wrap; }
  .history .h-what { margin-left: 0; text-align: left; width: 100%; }
}

@media (max-width: 420px) { .stats { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
  .poster-clip { transition: none; }
}

/* The roster on /collectors reuses the audit table; these are the two things
   it needs that nothing else did. */
.stats a { text-decoration: none; color: inherit; display: block; }
.muted { color: var(--muted); }

/* Job types. The textarea is the whole editor: one line per job, and deleting a
   line retires it -- so it wants to read as a list, not as prose. */
.field-label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin: 18px 0 6px; }
textarea.joblist {
  width: 100%; box-sizing: border-box; min-height: 220px; resize: vertical;
  font-family: var(--font-mono);
  font-size: 14px; line-height: 1.9; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  color: var(--text); tab-size: 2;
}
textarea.joblist:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
textarea.joblist:disabled { background: var(--brand-paler); color: var(--muted); }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
ul.retired { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
ul.retired li { margin: 0; }
ul.retired code {
  background: var(--brand-paler); border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 4px 9px; font-size: 13px; color: var(--text-2);
}

/* --- Theme toggle ---------------------------------------------------------- */
.theme-btn {
  background: transparent; color: var(--text-2); border: 0; border-radius: 50%;
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  cursor: pointer; padding: 0; line-height: 0;
}
.theme-btn:hover { background: var(--brand-paler); color: var(--text); }
.theme-btn svg { width: 15px; height: 15px; }
/* One button, two glyphs: show the icon for the theme you would switch TO. */
.theme-btn .moon { display: block; }
.theme-btn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
}
:root[data-theme="dark"] .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: block; }
:root[data-theme="light"] .theme-btn .sun { display: none; }

/* Devices page (headsets): one table row each; Edit opens that headset's panel under its
   row (?edit=<device>, server-rendered, no script).
   One type scale for the whole page: 14px Inter for text, 13px muted for secondary lines,
   the portal's 11px uppercase label for every heading and form label, monospace only for
   the serial and the pairing code, tabular figures for numbers. One button style, two
   sizes: 36px in rows and panels, 40px next to the 40px inputs. */
.dv-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dv-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; background: var(--white); border: 1px solid var(--line); color: var(--text-2); }
.pill.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); font-weight: 500; }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }

.dv-label { display: block; margin: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); font-family: var(--font-sans); }
.num { font-variant-numeric: tabular-nums; }
.dv-sub { margin-top: 3px; font-size: 13px; color: var(--muted); }
.dv-sub.mono { font-size: 12.5px; }
.dv-note { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.warn-text { color: var(--warn-ink); }

.dv-wrap { margin: 18px 0 12px; background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px;
  overflow-x: auto; box-shadow: var(--shadow-sm);
  /* the containing block of the tables' .sr-only labels, which otherwise sat outside the
     scroll box and widened the page on a phone */
  position: relative; }
table.dv { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 14px; color: var(--text); }
table.dv th { text-align: left; padding: 12px 18px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
table.dv td { padding: 16px 18px; vertical-align: top; border-top: 1px solid var(--line-soft); line-height: 1.45; }
table.dv tr.is-open > td, table.dv tr.dv-panel-row > td { background: var(--brand-paler); }
table.dv tr.dv-panel-row > td { border-top: 0; padding: 0 18px 20px; }
table.dv .chip, .dv-panel .chip { font-size: 12px; padding: 2px 8px; }
.dv-name { font-weight: 500; font-size: 15px; }
.dv-st { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.dv-num { font-weight: 500; }
.dv-tag { margin-top: 6px; }
td.dv-act { text-align: right; white-space: nowrap; padding-top: 12px; }

/* Buttons on this page: links and buttons look and size the same. */
.dv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box;
  height: 36px; min-width: 76px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text);
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.dv-btn:hover { border-color: var(--text-2); background: var(--brand-paler); color: var(--text); }
.dv-btn:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.dv-btn.is-on { border-color: var(--brand-text); color: var(--brand-text-2); background: var(--brand-tint); }
.dv-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.dv-btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }
.dv-btn.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.dv-btn.warn:hover { border-color: var(--warn-ink); }
.dv-btn.lg { height: 40px; min-width: 92px; padding: 0 18px; font-size: 14px; }
.dv-btn[disabled] { opacity: .5; cursor: not-allowed; }

.dv-panel { padding: 20px 22px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--white);
  display: flex; flex-direction: column; gap: 20px; font-size: 14px; }
.dv-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dv-panel-title { font-size: 18px; font-weight: 600; color: var(--text); display: flex; align-items: baseline;
  gap: 10px; flex-wrap: wrap; }
.dv-panel-title .dv-sub { margin: 0; font-weight: 400; }
.dv-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.dv-cols .dv-label { margin-bottom: 10px; }
.dv-cols p { margin: 0; line-height: 1.5; }
.dv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.dv-kv dt { color: var(--muted); }
.dv-kv dd { margin: 0; }
.code-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pairing-code { font-size: 20px; font-weight: 500; letter-spacing: .12em; padding: 6px 12px; line-height: 1.2;
  border: 1px dashed var(--line); border-radius: var(--radius); }
.pairing-code.masked { color: var(--muted); font-weight: 400; }
.dv-newcode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.dv-newcode .dv-note { margin: 0; }
.dv-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dv-hist li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none;
  opacity: .6; }
.dot.on { background: var(--ok); opacity: 1; box-shadow: 0 0 0 3px var(--ok-soft); }

/* Three fields, then Save and Cancel, on one row; the box under them. */
.dv-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 14px 12px;
  align-items: end; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.dv-field { display: flex; flex-direction: column; gap: 6px; }
.dv-form input[type=text], .dv-form input[type=datetime-local] {
  box-sizing: border-box; width: 100%; height: 40px; padding: 0 12px; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font-family: var(--font-sans); font-size: 14px; font-weight: 400; line-height: normal;
  font-variant-numeric: tabular-nums; }
.dv-form input:hover { border-color: var(--brand-text); }
.dv-form input:focus { outline: 2px solid var(--brand-text); outline-offset: 1px; border-color: var(--brand-text); }
.dv-form input::placeholder { color: var(--muted); }
.dv-form-actions { display: flex; gap: 8px; }
.dv-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.dv-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dv-form input { color-scheme: dark; } }
:root[data-theme="dark"] .dv-form input { color-scheme: dark; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .dv-cols, .dv-form { grid-template-columns: 1fr; } }
.howto { margin-top: 8px; }
.howto > summary { cursor: pointer; }
.chip.act-device { background: var(--brand-paler); color: var(--text-2); border-color: var(--line-soft); }

/* ---------- accounts: header, People, Add user, account page ---------- */

.bar a.who { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.bar a.who:hover { background: rgba(255,255,255,.22); }
.who-role { font-weight: 500; opacity: .8; }
.who-role::before { content: "\00b7"; margin-right: 6px; }

.chip.role-admin    { background: var(--brand); color: var(--on-brand); }
.chip.role-lead     { background: var(--accent-soft); color: var(--accent); }
.chip.role-reviewer { background: var(--brand-tint); color: var(--brand-text-2); }
.chip.role-viewer   { background: var(--brand-paler); color: var(--text-2); border-color: var(--line-soft); }
.chip.act-user-add, .chip.act-user-update, .chip.act-password-link,
.chip.act-password-set, .chip.act-sessions-revoked { background: var(--accent-soft); color: var(--accent); }
.chip.act-login-failed { background: var(--bad-soft); color: var(--bad-ink); }
.chip.act-logout { background: transparent; border: 1px solid var(--line); color: var(--muted); }

table.dv.people { min-width: 960px; }
table.dv.people tr.is-muted td { opacity: .6; }
.people-inline { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: nowrap; }
.people-inline select, .people-inline input {
  height: 36px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white);
  color: var(--text); padding: 0 10px; font: inherit; font-size: 13.5px; }
.people-inline input { min-width: 200px; }
/* A table cell stays a table cell (display: flex here broke the row's lines). */
td.people-act { text-align: right; white-space: nowrap; }
td.people-act form { margin: 0; }
.role-list { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }

/* A real dialog: fixed overlay, focusable, closed with Escape or the X. */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; padding: 16px;
  grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: center;
  background: rgba(10, 20, 24, .55); }
.modal-card { box-sizing: border-box; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--white); color: var(--text); border: 1px solid var(--line-soft); border-radius: 18px;
  box-shadow: var(--shadow-md); padding: 22px 24px 20px;
  display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 30px; letter-spacing: var(--display-tracking);
  line-height: 1.05; color: var(--text); font-weight: var(--display-weight); }
.modal-x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--muted); text-decoration: none; }
.modal-x:hover { background: var(--brand-paler); color: var(--text); }
.modal-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500;
  color: var(--text-2); border: 0; padding: 0; margin: 0; }
.modal-field input[type=text], .modal-field input[type=email], .modal-field input[type=password] {
  box-sizing: border-box; width: 100%; min-width: 0; height: 40px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 0 12px; font: inherit; font-weight: 400; font-size: 15px; }
.modal-field input:focus { outline: 2px solid var(--brand-text); outline-offset: 1px; border-color: var(--brand-text); }
.modal-field legend { margin-bottom: 6px; }
.req { color: var(--bad); }
.roles-pick { gap: 8px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 400; color: var(--text); }
.role-option:has(input:checked) { border-color: var(--brand-text); background: var(--brand-tint); }
.role-option input { margin-top: 3px; accent-color: var(--brand); }
.role-option span { display: flex; flex-direction: column; gap: 2px; }
.modal-submit { min-height: 44px; font-weight: 500; }
.modal-actions { display: flex; justify-content: flex-end; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; height: 40px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: 0 10px; font-size: 12.5px; }

.account-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 18px 0 28px; }
.account-card { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; }
.account-card h2 { margin: 0; font-size: 17px; letter-spacing: -.005em; color: var(--text); font-weight: 500; }
.account-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.account-form .modal-field { align-self: stretch; }

/* ==============================================================================

   The app frame: sidebar + top bar (base.html).
   The sidebar is the page's paper with a hairline edge, as on the site; the page you are
   on is tinted with a teal edge. Both follow the theme.
   ===================================================================================== */

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 236px; max-width: 100%; box-sizing: border-box;
  background: var(--surface); color: var(--text); padding: 16px 12px 12px;
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 14px; font-size: 14px;
}
.shell-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 900px) {
  .shell { flex-wrap: nowrap; }
  .side { flex: 0 0 236px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.side a { color: inherit; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text) !important;
  text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.side-warn { align-self: flex-start; margin: 0 8px; font-size: 11.5px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; background: var(--bad); color: #fff; }
.side-label { display: block; padding: 0 8px 6px; font-size: 12px; color: var(--muted); }
.side-select { position: relative; display: flex; align-items: center; }
.side-select select {
  width: 100%; min-height: 40px; padding: 0 12px 0 32px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font: inherit; font-weight: 500; font-size: 13.5px; }
.side-select select:hover { border-color: var(--text-2); }
.side-select select:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.fleet-mark { width: 12px; height: 12px; border-radius: 3px; background: var(--fleet, #86c9c4); flex: none; display: inline-block; }
.side-select .fleet-mark { position: absolute; left: 12px; pointer-events: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: var(--radius);
  color: var(--text-2); text-decoration: none; }
.side-nav a svg { color: var(--muted); flex: none; }
.side-nav a:hover { background: var(--brand-paler); color: var(--text); }
.side-nav a.on { background: var(--brand-tint); color: var(--text); font-weight: 500; box-shadow: inset 2px 0 0 var(--brand-text); }
.side-nav a:hover svg, .side-nav a.on svg { color: var(--brand-text); }
.side-nav a span:first-of-type { flex: 1; }
.side-badge { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 999px;
  background: var(--warn-soft); background: color-mix(in srgb, var(--saffron) 24%, transparent); color: var(--warn-ink); }
/* A thin line between the groups of entries (shell.NAV). */
.side-sep { display: block; height: 1px; margin: 6px 10px; background: var(--line-soft); }
/* You and two icon buttons, one row at the foot. */
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px;
  border-top: 1px solid var(--line-soft); }
.side .side-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.side .side-icon:hover { background: var(--brand-paler); color: var(--text); }
.side .side-icon:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.dot.busy { background: var(--saffron) !important; opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.busy { animation: none; } }
.side-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; width: 100%;
  padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer; }
.side-btn:hover { background: var(--brand-paler); }
.side-btn[disabled] { opacity: .5; cursor: not-allowed; }
.side-user { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 4px; border-radius: var(--radius);
  text-decoration: none; }
.side-user:hover { background: var(--brand-paler); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-text-2); display: grid;
  place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.3; }
.side-user-text strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.side-user-text span { color: var(--muted); font-size: 12px; }
.side-tools { display: flex; gap: 2px; flex: none; }
.side-tools form { display: flex; margin: 0; }
.side .theme-btn svg { width: 16px; height: 16px; }

/* The site's menu bar: the paper, see-through, with a hairline under it. */
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 28px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 5;
  background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.search { flex: 1 1 320px; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 15px;
  border-radius: 999px; border: 1px solid var(--line-soft); background: var(--white); color: var(--muted); margin: 0; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; color: var(--text); }
.search:focus-within { outline: 2px solid var(--brand-text); outline-offset: 1px; }
kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
main.page { width: 100%; max-width: 1280px; box-sizing: border-box; padding: 28px 28px 56px; margin: 0; }

/* ---------- shared pieces of the redesigned pages ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: var(--title-size); line-height: 1.02; }
.page-head p { margin: 8px 0 0; color: var(--text-2); max-width: 820px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Tiles: raised paper with a hairline and a soft shadow; the number in the display face. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 20px; }
.tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 15px; border-radius: 14px; background: var(--white);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--line); box-shadow: var(--shadow); }
a.tile.on { border-color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-text); }
.tile.on .tile-l { color: var(--brand-text); }
.tile-n { font-family: var(--font-display); font-size: var(--number-size); font-weight: var(--display-weight); line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: var(--display-tracking); margin-top: 2px; }
.tile.bad .tile-n { color: var(--bad-ink); }
.tile-l { font-size: 13px; color: var(--muted); }
.tile-note { font-size: 12.5px; color: var(--muted); }
.tile-note.good, .tile-note .good { color: var(--ok-ink); font-weight: 500; }
.tile-note.bad, .tile-note .bad { color: var(--bad-ink); font-weight: 500; }
.panel { background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; margin: 0 0 18px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -.005em; color: var(--text); font-weight: 500; }
.panel-body { padding: 14px 18px; }
.panel-body > :first-child { margin-top: 0; }
.panel-foot { padding: 10px 18px 14px; font-size: 12.5px; color: var(--muted); }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.cols > .main-col { flex: 999 1 560px; min-width: 0; }
.cols > .side-col { flex: 1 1 320px; min-width: 0; }
/* One column at every width: the page's own content first, then what used to sit beside
   it (fleet settings, a headset's page, job types). A side column squeezed wide tables
   and moved about as the sidebar folded. The episode page keeps its verdict beside the video. */
.cols.stack { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.cols.stack > .main-col, .cols.stack > .side-col { flex: none; width: 100%; }
/* Tabs underline like the site's menu; the count is a small mono pill. */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-soft); margin: 0 0 14px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--text-2); text-decoration: none; font-size: 14px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.tab-n { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 0 7px; border-radius: 999px;
  background: var(--brand-paler); color: var(--text-2); }
.tabs a.on .tab-n { background: var(--text); color: var(--surface); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.toolbar .grow { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Filters are hairline pills; one that is on turns teal-tinted, so you can see what is applied. */
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 6px 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 400; box-sizing: border-box; }
.fchip select, .fchip input { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500; min-height: 30px; }
.fchip input[type=number] { width: 56px; background: var(--surface); border-radius: 999px; padding: 0 8px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.toggle:hover, .fchip:hover { border-color: var(--text-2); }
.toggle input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.toggle.on { background: var(--brand-tint); border-color: var(--brand-text); color: var(--brand-text-2); font-weight: 500; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--brand-paler); }
.seg a, .seg button { min-height: 30px; padding: 0 13px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.seg .on { background: var(--white); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--line-soft), 0 1px 2px rgb(0 0 0 / .06); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.score-pill { display: inline-block; min-width: 36px; text-align: center; padding: 2px 8px; border-radius: 7px; font-weight: 500;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.score-pill.good { background: var(--ok-soft); color: var(--ok-ink); }
.score-pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.score-pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); box-sizing: border-box; }
.dots i.on { background: var(--brand-text); border-color: var(--brand-text); }
.heat { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; min-width: 120px; }
.heat i { height: 18px; border-radius: 3px; background: var(--line-soft); }
.heat i.h1 { background: #f1d3c4; } .heat i.h2 { background: #e0a084; } .heat i.h3 { background: #c4663f; } .heat i.h4 { background: #8f3a1b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .heat i.h1 { background: #4a2a1f; }
  :root:not([data-theme="light"]) .heat i.h2 { background: #7a3d26; }
  :root:not([data-theme="light"]) .heat i.h3 { background: #b85a36; }
  :root:not([data-theme="light"]) .heat i.h4 { background: #e8916b; }
}
:root[data-theme="dark"] .heat i.h1 { background: #4a2a1f; }
:root[data-theme="dark"] .heat i.h2 { background: #7a3d26; }
:root[data-theme="dark"] .heat i.h3 { background: #b85a36; }
:root[data-theme="dark"] .heat i.h4 { background: #e8916b; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--line-soft); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.bars i { flex: 1; max-width: 14px; border-radius: 4px 4px 0 0; background: var(--fleet, var(--brand-text)); min-height: 2px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bars i, :root:not([data-theme="light"]) .fleet-mark { background: var(--fleet-dark, var(--fleet, #86c9c4)); }
}
:root[data-theme="dark"] .bars i, :root[data-theme="dark"] .fleet-mark { background: var(--fleet-dark, var(--fleet, #86c9c4)); }
.bars i.today { opacity: .55; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; min-width: 60px; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--brand-text); }
.meter > i.warn { background: var(--warn); } .meter > i.bad { background: var(--bad); }
.fleet-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.attn { list-style: none; margin: 0; padding: 4px 0; }
.attn li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.attn li:last-child { border-bottom: 0; }
.attn .sev-icon { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.sev-bad .sev-icon, .sev-bad .sev { background: var(--bad-soft); color: var(--bad-ink); }
.sev-warn .sev-icon, .sev-warn .sev { background: var(--warn-soft); color: var(--warn-ink); }
.sev-info .sev-icon, .sev-info .sev { background: var(--brand-pale); color: var(--brand-text-2); }
/* How soon: the site's status pill, a ring with a hollow dot. */
.attn .sev { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  padding: 2px 10px 2px 9px; border-radius: 999px; background: transparent !important; box-shadow: inset 0 0 0 1px currentColor; white-space: nowrap; }
.attn .sev::before { content: ""; width: 5px; height: 5px; border-radius: 50%; border: 1.25px solid currentColor; }
.sev-bad .sev { color: var(--accent); }
.attn-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.attn-body strong { font-weight: 500; }
.attn-body .d { font-size: 13px; color: var(--text-2); }
/* The bar over a list: a soft teal tint once something is ticked, the buttons unchanged. */
.bulkbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 58px; box-sizing: border-box; padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft); background: transparent; border-radius: 14px 14px 0 0; }
.bulkbar.on { background: var(--brand-tint); }
.bulkbar .count { font-weight: 500; }
.bulkbar.on .count { color: var(--brand-text-2); }
.keys { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-left: auto; }
.keys span { display: inline-flex; align-items: center; gap: 4px; }
/* Buttons: pills. Teal for the page's main action; Accept and Reject as green and red tints. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 13.5px;
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; box-sizing: border-box;
  transition: background .12s ease, border-color .12s ease; }
.btn:hover { border-color: var(--text-2); background: var(--brand-paler); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.btn.ok:hover { border-color: var(--ok-ink); background: var(--ok-soft); }
.btn.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-ink); }
.btn.bad:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.btn.on-dark { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn.lg { min-height: 40px; padding: 0 20px; }
.btn.sm { min-height: 36px; padding: 0 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.kv-grid { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0; }
.field input, .field select, .field textarea {
  box-sizing: border-box; width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 400; font-size: 14px; }
.field textarea { padding: 10px 12px; min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.field .hint { font-weight: 400; margin: 0; }
.check-line { display: flex; gap: 10px; align-items: center; min-height: 40px; font-size: 14px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--brand); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .field input, :root:not([data-theme="light"]) .field select,
  :root:not([data-theme="light"]) .fchip select { color-scheme: dark; }
}
:root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .fchip select { color-scheme: dark; }
.tbl-wrap { overflow-x: auto; position: relative; }  /* holds anything positioned inside (sr-only headers):
   otherwise it sits past a wide table's end and the whole page scrolls sideways */
/* A row menu open in a table (Move): over what is below, not a scrollbar inside the table. */
.tbl-wrap:has(details.row-menu[open]), .tbl-wrap:has(details.fw-confirm[open]) { overflow: visible; }
/* ... and on the last rows it opens upward, so it never hangs below the page. */
.tbl-wrap tbody tr:nth-last-child(-n+2) .row-menu .row-pop { top: auto; bottom: calc(100% + 6px); }
/* With the script (base.html), each opens where it fits: up when there is no room below. */
/* (as specific as the rule above, and after it, so the script's choice wins) */
.tbl-wrap tbody tr .row-menu .row-pop.up, .row-menu .row-pop.up { top: auto; bottom: calc(100% + 6px); }
.tbl-wrap tbody tr .row-menu .row-pop.down, .row-menu .row-pop.down { top: calc(100% + 6px); bottom: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text); }
table.tbl th { text-align: left; padding: 11px 14px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.sel td { background: var(--brand-tint); }
table.tbl tr.dim td { opacity: .55; }
table.tbl tr.focus td:first-child { box-shadow: inset 3px 0 0 var(--brand-text); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sub2 { display: block; font-size: 12px; color: var(--muted); }
.thumb { position: relative; display: block; width: 104px; height: 58px; border-radius: var(--radius); background: var(--media-bg); background: var(--clip); overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .t-tag, .thumb .t-dur { z-index: 1; }
.thumb .t-tag { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 600; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; }
.thumb .t-dur { position: absolute; bottom: 4px; right: 4px; font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.55); color: #fff; }
.thumb .t-score { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 19px; font-weight: 500; color: #e9e7e2; }
.claim-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.claim-chip .avatar { width: 24px; height: 24px; font-size: 10px; }
.empty-box { padding: 28px 20px; text-align: center; color: var(--muted); }

/* ---- page pieces of the redesign: episode list, episode page, roster, fleets ---------- */
.col-main .panel-head h2, .col-side .panel-head h2 { margin: 0; }
.page-head .claim-chip, .page-head .pill { align-self: flex-start; }
.ep-pos { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; }
.ep-cell { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 240px; }
.ep-cell:hover strong { color: var(--brand-text); text-decoration: underline; }
.ep-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ep-tbl tbody tr { cursor: default; }
.ep-tbl td .chip { margin: 1px 2px 1px 0; }
.saved-views > summary { cursor: pointer; list-style: none; border-bottom: 0; }
.saved-views[open] > summary { border-bottom: 1px solid var(--line-soft); }
.saved-views > summary::-webkit-details-marker { display: none; }
.sv-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sv-list li { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 12px; border-radius: 999px; background: var(--brand-pale); }
.sv-list a { font-weight: 500; text-decoration: none; }
.sv-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.sv-save .field { flex: 1 1 260px; }
.bb-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-reject { position: relative; }
.bb-reject > summary { list-style: none; }
.bb-reject > summary::-webkit-details-marker { display: none; }
.bb-pop, .row-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(340px, 86vw); box-sizing: border-box;
  padding: 14px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--white); color: var(--text);
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 6px; }

.bulkbar .check-line { min-height: 36px; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu .row-pop { left: auto; right: 0; }
.ep-player { padding: 0; overflow: hidden; background: var(--media-bg); border-color: var(--media-bg); box-shadow: var(--shadow); }
.ep-player .player { display: block; width: 100%; margin: 0; border-radius: 0; }
.ep-player .empty { margin: 0; padding: 32px 20px; color: #c9d6d8; background: transparent; border: 0; }
.ep-player .cam-label, .ep-player .hls-unsupported { margin: 0; padding: 8px 14px; color: #c9d6d8; }
.ep-timeline { position: relative; height: 22px; margin: 0 14px; border-top: 1px solid rgba(255,255,255,.12); }
.ep-timeline button { position: absolute; top: 5px; width: 10px; height: 12px; margin-left: -5px; padding: 0; border: 0; border-radius: 3px; cursor: pointer; }
.ep-timeline .tl-marker, .tl-key.marker { background: var(--saffron); }
.ep-timeline .tl-comment, .tl-key.comment { background: #86c9c4; }
.ep-legend { padding: 4px 14px 10px; color: #c9d6d8; }
.ep-legend i.tl-key { width: 10px; height: 10px; }
.comments { list-style: none; margin: 0 0 14px; padding: 0; }
.comments li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.comments li:last-child { border-bottom: 0; }
.comments .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.c-body { flex: 1; min-width: 0; }
.c-body p { margin: 2px 0 0; overflow-wrap: anywhere; }
.c-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; }
.c-at { font: inherit; font-family: var(--font-mono); font-size: 12px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--brand-text); cursor: pointer; }
.c-form { display: flex; flex-direction: column; gap: 10px; }
.c-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.c-time { flex: 0 1 160px; }
.c-row .btn.primary { margin-left: auto; }
.verdict-form .quick { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.verdict-form .quick legend { padding: 0; }
.verdict-form .quick .check-line { position: relative; min-height: 32px; padding: 0 12px; gap: 0; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; color: var(--text-2); cursor: pointer; box-sizing: border-box; }
.verdict-form .quick .check-line input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.verdict-form .quick .check-line:hover { border-color: var(--text-2); color: var(--text); }
.verdict-form .quick .check-line:has(input:checked) { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-ink); }
.verdict-form .quick .check-line:has(input:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.verdict-form .keys { margin: 10px 0 0; }
.funnel { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.funnel li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.f-label { overflow-wrap: anywhere; }
.f-n { font-weight: 500; min-width: 2.5em; text-align: right; }
.join-act { display: flex; gap: 8px; margin-top: 6px; }
.attn li > .join-act { margin: 0; align-self: center; flex: none; }
.legend i.heat-k.h1 { background: #f1d3c4; } .legend i.heat-k.h2 { background: #e0a084; }
.legend i.heat-k.h3 { background: #c4663f; } .legend i.heat-k.h4 { background: #8f3a1b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .legend i.heat-k.h1 { background: #4a2a1f; }
  :root:not([data-theme="light"]) .legend i.heat-k.h2 { background: #7a3d26; }
  :root:not([data-theme="light"]) .legend i.heat-k.h3 { background: #b85a36; }
  :root:not([data-theme="light"]) .legend i.heat-k.h4 { background: #e8916b; }
}
:root[data-theme="dark"] .legend i.heat-k.h1 { background: #4a2a1f; }
:root[data-theme="dark"] .legend i.heat-k.h2 { background: #7a3d26; }
:root[data-theme="dark"] .legend i.heat-k.h3 { background: #b85a36; }
:root[data-theme="dark"] .legend i.heat-k.h4 { background: #e8916b; }
.dv-health { min-width: 110px; }
.dv-health .meter { margin: 3px 0 4px; }
.tile.sel { border-color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-text); }
.fleet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; margin: 0 0 18px; }
.fleet-card { display: block; margin: 0; text-decoration: none; color: inherit; border-top: 4px solid var(--fleet); }
.fleet-card:hover { box-shadow: var(--shadow); }
.fleet-card .fleet-mark { background: var(--fleet); }
.swatches { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatches legend { padding: 0; margin-bottom: 6px; }
.swatch { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 2px solid transparent; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch .fleet-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--fleet); }
.swatch:has(input:checked) { border-color: var(--text); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.field.wide { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 18px; }
.pay-period { font-size: 15px; }
.people-fleets .fleet-tag { margin: 1px 0; }
.people-fleets .row-menu { margin-top: 4px; }
@media (max-width: 720px) {
  .bulkbar .keys, .verdict-form .keys { display: none; }
  .ep-cell { min-width: 200px; }
  .thumb { width: 84px; height: 48px; }
}
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
ul.rows li:last-child { border-bottom: 0; }
ul.rows li > :last-child { text-align: right; }
.side-btn { white-space: nowrap; }
.page-head h1 .fleet-tag { font-size: inherit; color: inherit; gap: 12px; white-space: normal; }
.page-head h1 .fleet-mark { width: 22px; height: 22px; border-radius: 6px; }
.field.swatches { flex-direction: row; align-items: center; }
.field.swatches legend { float: left; width: 100%; }
table.collectors td:first-child { min-width: 136px; }
/* Phones and narrow windows: the sidebar becomes a compact bar (brand, fleet, account) with
   the navigation as one scrolling row under it, so the page itself starts on the first screen. */
@media (max-width: 899.98px) {
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 16px;
    border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .side-brand { flex: 1 1 auto; padding: 0; }
  .side-warn { order: 1; margin: 0; }
  .side-fleet { order: 3; flex: 1 1 100%; }
  .side-fleet .side-label { display: none; }
  .side-nav { order: 4; flex: 1 1 100%; flex-direction: row; overflow-x: auto; gap: 4px; margin: 0 -16px; padding: 0 16px;
    scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: none; white-space: nowrap; min-height: 40px; }
  .side-nav a span:first-of-type { flex: none; }
  .side-nav a.on { box-shadow: none; }
  .side-sep { display: none; }
  /* You and the two icons on the brand's row, at its right. */
  .side-foot { order: 2; flex: none; margin: 0; padding: 0; border: 0; gap: 2px; }
  .side-user { flex: none; padding: 2px; }
  .side-user-text { display: none; }
  .topbar { padding: 10px 16px; position: static; }
  main.page { padding: 18px 16px 48px; }
  .page-head h1 { font-size: 32px; }
}
.only-narrow { display: none; }
@media (max-width: 899.98px) { .only-narrow { display: inline-flex; } }

/* Camera switch on the episode page (static/cameras.js). Without the script, every camera
   shows stacked with its label. */
.cam-switch { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; background: var(--media-bg);
  border-bottom: 1px solid rgba(255,255,255,.12); }
.cam-switch .seg { background: rgba(255,255,255,.08); }
.cam-switch .seg button { color: #c9d6d8; gap: 6px; min-height: 36px; }
.cam-switch .seg button.on { background: #fff; color: #0d1418; }
.cam-switch .seg button:focus-visible { outline: 2px solid #86c9c4; outline-offset: 1px; }
.cam-switch .cs-sound { flex: none; }
.cam-switch .cs-note { font-size: 13px; color: var(--saffron); }
.cam-switch .keys { color: #9fb3b6; }
.cams.single .cam-label { display: none; }
.cams.all { display: grid; gap: 2px; background: var(--media-bg); }
@media (min-width: 900px) {
  .cams.all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cams.all .cam { min-width: 0; position: relative; }
.cams.all .player { aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
/* Side by side, each camera's name sits on its picture instead of taking a row above it. */
.ep-player .cams.all .cam-label { position: absolute; z-index: 1; top: 8px; left: 8px; padding: 2px 8px; border-radius: 6px;
  background: rgba(13,20,24,.72); color: #e8eef0; font-size: 12px; line-height: 1.5; pointer-events: none; }
/* Each camera's own full-screen icon, where Chrome's is hidden (static/cameras.js): side by
   side, and in full screen. It puts both cameras full screen, or leaves. */
.ep-player .cam { position: relative; }
.cam-fs { display: none; }
.cams.own-off .cam-fs { position: absolute; z-index: 1; top: 6px; right: 6px; display: inline-flex; align-items: center;
  justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px;
  background: rgba(13,20,24,.72); color: #e8eef0; cursor: pointer; }
.cams.own-off .cam-fs:hover { background: rgba(13,20,24,.92); color: #fff; }
.cams.own-off .cam-fs:focus-visible { outline: 2px solid #86c9c4; outline-offset: 1px; }
/* Chrome greys its own icon out rather than removing it, and a greyed icon that does
   nothing is what people click. Its own rule: other browsers drop a rule they cannot read. */
.cams.own-off video::-webkit-media-controls-fullscreen-button { display: none; }
.cam-switch .cs-full { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); background: transparent; color: #c9d6d8; font: inherit; font-size: 13px; cursor: pointer; }
.cam-switch .cs-full:hover { background: rgba(255,255,255,.08); color: #fff; }
.cam-switch .cs-full:focus-visible { outline: 2px solid #86c9c4; outline-offset: 1px; }
.cam-switch .cs-full[hidden] { display: none; }
@media (max-width: 599.98px) {
  .cam-switch .keys { display: none; }
  .cam-switch .cs-full { margin-left: auto; }
}

/* The episode page: the player, the rest of the page and the verdict are three cells of one
   grid. The verdict sits beside the player; side by side (.wide, static/cameras.js) the player
   spans the whole window and the verdict sits beside the reasoning trace, so each camera is
   about half the window wide. Narrower than the two columns need (560 + 320), it is one
   column in page order. A grid rather than moving the player: a video moved in the page pauses. */
.ep-layout { container-type: inline-size; }
.ep-cols { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 18px; align-items: start; }
.ep-cols > * { min-width: 0; }
@container (min-width: 898px) {
  .ep-cols { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr;
    grid-template-areas: "player side" "rest side"; }
  .ep-cols.wide { grid-template-areas: "player player" "rest side"; }
  .ep-cols > .ep-player { grid-area: player; }
  .ep-cols > .main-col { grid-area: rest; }
  .ep-cols > .side-col { grid-area: side; }
}
main.page:has(.ep-cols.wide) { max-width: none; }

/* Full screen (the bar's button or F): the whole player, so the cameras on show fill the
   screen together, with the switch above them. */
.ep-player:fullscreen { display: flex; flex-direction: column; margin: 0; border: 0; border-radius: 0; background: #000; overflow-y: auto; }
.ep-player::backdrop { background: #000; }
.ep-player:fullscreen .cams { flex: 1 1 auto; display: grid; align-content: center; background: #000; }
.ep-player:fullscreen .cams.all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ep-player:fullscreen .player { max-height: calc(100vh - 120px); }
@media (max-aspect-ratio: 1 / 1) {
  .ep-player:fullscreen .cams.all { grid-template-columns: minmax(0, 1fr); }
  .ep-player:fullscreen .cams.all .player { max-height: calc(50vh - 62px); }
}
/* Phones: a bulk-bar menu spans the bar instead of starting under its button, which can
   sit near the right edge (Headsets has three menus in a row). */
@media (max-width: 599.98px) {
  .bulkbar { position: relative; }
  .bulkbar .bb-reject { position: static; }
  .bulkbar .bb-pop { left: 8px; right: 8px; width: auto; top: calc(100% - 4px); }
}
/* Headsets: the tick-box column takes only what the box needs; the cells are a little
   tighter so the table fits a 1366 px laptop with the sidebar open. */
table.dv.hs th, table.dv.hs td { padding-left: 11px; padding-right: 11px; }
table.dv.hs .pick { width: 1%; padding-left: 16px; padding-right: 2px; }

/* ---------- the sidebar, collapsible to its icons (base.html: the << button, or [) ----------
   Wide screens only: on a narrow one the sidebar is already a compact bar. The choice is
   a class on <html> (side-min), set in <head> from this browser's last choice. */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.side-toggle:hover { background: var(--brand-paler); color: var(--text); }
.side-toggle:focus-visible, .side-fleet-min:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.side-toggle[hidden], .sw-short, .side-fleet-min { display: none; }
@media (max-width: 899.98px) { .side-toggle:not([hidden]) { display: none; } }
@media (min-width: 900px) {
  .side { transition: flex-basis .16s ease, padding .16s ease; }
  html.side-min .side { flex-basis: 72px; padding: 18px 10px; align-items: center; overflow-x: hidden; }
  html.side-min .side-head { flex-direction: column; gap: 10px; }
  html.side-min .side-brand { padding: 0; }
  html.side-min .side-brand > span:not(.brand-mark) { display: none; }
  html.side-min .side-brand .brand-mark { margin: 0; }
  html.side-min .side-toggle svg { transform: rotate(180deg); }
  html.side-min .side-warn { align-self: center; margin: 0; padding: 3px 6px; }
  html.side-min .sw-long { display: none; }
  html.side-min .sw-short { display: inline; }
  html.side-min .side-fleet .side-label, html.side-min .side-select { display: none; }
  html.side-min .side-fleet-min { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
    border-radius: 50%; border: 1px solid var(--line); background: transparent; }
  html.side-min .side-fleet-min:hover { background: var(--brand-paler); }
  html.side-min .side-fleet-min .fleet-mark { width: 14px; height: 14px; }
  html.side-min .side-nav { align-self: stretch; }
  html.side-min .side-nav a { justify-content: center; padding: 0; position: relative; }
  html.side-min .side-nav a > span:not(.side-badge) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html.side-min .side-badge { position: absolute; top: 1px; right: 2px; font-size: 10px; line-height: 15px; padding: 0 5px;
    background: var(--warn-soft); }
  html.side-min .side-sep { margin: 6px 8px; }
  html.side-min .side-foot { flex-direction: column; align-self: stretch; align-items: center; gap: 4px; }
  html.side-min .side-user { flex: none; padding: 2px; }
  html.side-min .side-user-text { display: none; }
  html.side-min .side-tools { flex-direction: column; align-items: center; }
}
@media (min-width: 900px) and (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* Collectors: up to eleven columns at a laptop width. */
table.tbl.collectors th, table.tbl.collectors td { padding-left: 8px; padding-right: 8px; }
table.tbl.collectors .heat { min-width: 98px; }
table.tbl.collectors td.verdicts .sub2 { font-size: 11.5px; }
.row-more { padding: 0 8px; min-width: 34px; }
table.tbl.collectors th:first-child, table.tbl.collectors td:first-child { padding-left: 16px; }

/* ---------- Collectors: sortable headings, the Fleet column, the Manage menu ---------- */
table.tbl th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: baseline; gap: 4px; }
table.tbl th.sortable a:hover, table.tbl th.sortable.on a { color: var(--text); }
table.tbl th.num.sortable a { justify-content: flex-end; }
.sort-mark { font-size: 9px; }
table.collectors td.fleet-cell { min-width: 88px; }
table.collectors td.fleet-cell .fleet-tag { white-space: normal; align-items: flex-start; }
table.collectors td.fleet-cell .fleet-mark { margin-top: 3px; }
.row-pop form + form { border-top: 1px solid var(--line-soft); margin-top: 12px; padding-top: 12px; }
.row-pop .row-delete .hint { margin: 0 0 10px; }
/* Deleting a collector: what happens to their episodes. */
.ep-fate { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.ep-fate legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ep-fate label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; font-size: 13px; color: var(--text); cursor: pointer; }
.ep-fate label .sub2 { grid-column: 2; }
.ep-fate .give-to { box-sizing: border-box; width: calc(100% - 24px); margin: -2px 0 2px 24px; min-height: 36px; padding: 0 10px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.ep-fate .give-to:focus { outline: 2px solid var(--brand-text); outline-offset: 1px; }

/* Firmware page (firmware.html). Built from the Devices page's pieces: its table, chips,
   pills and buttons; only the rollout card, the tabs and the confirmations are new. */
.pill.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-ink); font-weight: 600; }
/* A confirmation that opens under its button: <details>, so the page needs no script. */
.fw-confirm { display: inline-block; position: relative; text-align: left; }
.fw-confirm > summary { list-style: none; }
.fw-confirm > summary::-webkit-details-marker { display: none; }
.fw-confirm[open] > summary { border-color: var(--brand-text); }
.fw-confirm-body { position: absolute; right: 0; z-index: 5; margin-top: 6px; width: min(360px, 86vw);
  padding: 14px 16px; background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px;
  box-shadow: var(--shadow-md); white-space: normal; font-size: 13.5px; }
.fw-confirm-body p { margin: 0 0 12px; line-height: 1.5; color: var(--text); }
/* Opened by the script (base.html) where it fits: up when there is no room below. */
.fw-confirm-body.up { top: auto; bottom: calc(100% + 6px); margin-top: 0; }
/* A version is one word: "ota-test-" over "2" read as two. */
.fw-table .dv-name.mono { white-space: nowrap; }
.dv-btn.fw-danger { color: var(--bad-ink); }
.dv-btn.fw-danger:hover { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
.fw-act { display: flex; gap: 6px; justify-content: flex-end; }
.fw-notes { max-width: 340px; min-width: 190px; font-size: 13.5px; color: var(--text-2); }
/* The actions wrap (Delete under Promote and Download) before the notes are squeezed to a word a line. */
.fw-table .fw-act { flex-wrap: nowrap; margin-left: auto; }
.fw-notes summary { cursor: pointer; list-style: none; }
.fw-notes summary::-webkit-details-marker { display: none; }
.fw-more { color: var(--brand-text); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.fw-notes details[open] .fw-more { display: none; }
.fw-notes-full { margin-top: 6px; white-space: pre-wrap; }
.fw-detail { max-width: 360px; overflow-wrap: anywhere; }
td.nowrap, a.nowrap { white-space: nowrap; }

/* Firmware page, groups (step 2): the Create group button beside the intro, the More menu,
   the group filter and the "put ticked headsets in" bar. */
.fw-intro { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; margin: 16px 0 0; }
.fw-intro p { margin: 0; max-width: 760px; color: var(--text-2); }
.fw-new .fw-confirm-body { right: 0; }
.fw-confirm-body .dv-field { margin-bottom: 12px; }
.fw-confirm-body select, .fw-confirm-body input[type=text], .fw-inline select, .fw-inline input[type=text],
.fw-bulk select {
  font: inherit; font-size: 14px; height: 40px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 100%; }
.fw-confirm-body select, .fw-confirm-body input[type=text] { width: 100%; box-sizing: border-box; }
.fw-more-menu { display: flex; flex-direction: column; gap: 10px; }
.fw-more-menu .dv-btn { width: 100%; justify-content: flex-start; }
.fw-inline { display: flex; gap: 6px; }
.fw-inline .dv-btn { width: auto; flex: 0 0 auto; }
.fw-inline select, .fw-inline input[type=text] { flex: 1 1 auto; min-width: 0; }
.fw-flags { margin-top: 6px; }
.fw-groups .pill { white-space: nowrap; }
.fw-filter { margin: 16px 0 0; }
.fw-filter a { text-decoration: none; }
.fw-bulk { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; padding: 10px 14px;
  border: 1px solid var(--line-soft); border-radius: 14px; background: var(--white); }
td.pick { width: 28px; }

/* The sidebar fits a 1366x768 laptop as it is. On a shorter window only the list of entries
   scrolls (with no visible bar), so you and sign out stay at the foot. */
@media (min-width: 900px) {
  .side { overflow: hidden; }
  .side-nav { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  html.side-min .side-nav a { min-height: 36px; }
}

/* ==============================================================================
   Consistency pass (ux/portal-polish)

   One size system for controls across every page:
     40 px  text boxes, dropdowns and page-level buttons (.btn, .dv-btn.lg)
     36 px  buttons inside table rows and toolbars (.btn.sm, .dv-btn), filter chips
   8 px corners on all of them, 14 px text in fields, 13.5 px semibold on buttons. A field
   and the button beside it are always the same height. Short values get short boxes.
   ============================================================================== */

/* Without the script, the bits it replaces (a filter bar's Filter button). */
.js .nojs-only { display: none !important; }

/* The top bar: when the bucket was last checked, and Check now (pages that list uploads). */
.topbar-actions { gap: 12px; }
.scan-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted);
  white-space: nowrap; }
.scan-status .dot { opacity: 1; }
.scan-status .dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.scan-status .dot.err { background: var(--bad); }
.scan-status.has-err .scan-text { color: var(--bad-ink); font-weight: 500; }
@media (max-width: 599.98px) { .scan-status .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* Fields: the same box everywhere. Number boxes are as wide as a number. */
.field input[type=number], .fchip input[type=number] { font-variant-numeric: tabular-nums; }
.field input[type=number] { max-width: 160px; }
.field textarea, .modal-field textarea, .verdict-form textarea, textarea.joblist {
  border-radius: var(--radius); font-size: 14px; line-height: 1.5; padding: 10px 12px; field-sizing: content; }
.field textarea, .verdict-form textarea { min-height: calc(3 * 1.5em + 22px); max-height: 420px; }
.modal-field textarea { box-sizing: border-box; width: 100%; min-height: calc(3 * 1.5em + 22px); resize: vertical;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-family: inherit; font-weight: 400; }
.modal-field textarea:focus { outline: 2px solid var(--brand-text); outline-offset: 1px; border-color: var(--brand-text); }
.modal-field .hint { font-weight: 400; margin: 0; }
.fw-inline .dv-btn, .fw-bulk .dv-btn, .people-inline .dv-btn { height: 40px; }
.people-inline select, .people-inline input { height: 40px; }

/* Menus in a row (Manage on People, More on Firmware groups): a list of actions, each with
   a line saying what it does, instead of a stack of bordered buttons. */
.row-pop.menu-list { width: min(300px, 86vw); padding: 6px; gap: 2px; }
.menu-list form, .row-pop.menu-list form + form { margin: 0; padding: 0; border: 0; }
.menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left;
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--brand-paler); }
.menu-item .sub2 { font-weight: 400; }
.menu-item.is-danger { color: var(--bad-ink); }
.menu-item.is-danger:hover { background: var(--bad-soft); }
.fw-more-menu { gap: 8px; }
.fw-more-menu .fw-inline { padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
summary.dv-btn svg, summary.btn svg { margin-left: 2px; }
td.people-act { vertical-align: middle; }
table.dv th { white-space: nowrap; }
.file-pick-text .mono { white-space: nowrap; }
/* Phones: Ctrl K means nothing without a keyboard, and the box needs the room. */
@media (max-width: 899.98px) { .search kbd { display: none; } }
/* Phones: a row's menu or confirmation opens as a sheet along the bottom of the screen,
   full width, instead of squeezed into a table cell. */
@media (max-width: 760px) {
  .fw-confirm-body, .row-pop, .tbl-wrap tbody tr .row-menu .row-pop.up, .tbl-wrap tbody tr .row-menu .row-pop.down {
    position: fixed !important; left: 8px !important; right: 8px !important; bottom: 8px !important; top: auto !important;
    width: auto !important; max-height: 75vh; overflow: auto; margin: 0; z-index: 60;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .35); }
  /* The sheet is fixed to the screen, so the table keeps its own sideways scroll: letting it
     overflow (as on a wide screen) made the page wider than the phone and the sheet fell off it. */
  .tbl-wrap:has(details.row-menu[open]), .tbl-wrap:has(details.fw-confirm[open]) { overflow-x: auto; }
}

/* Episodes: the filters, then the count, layout and saved views on the same row. */
.list-tools { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: 0 0 14px; }
.list-tools .toolbar { flex: 1 1 520px; margin: 0; }
.list-tools-end { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.list-tools-end .list-count { margin-right: 2px; }
.saved-views > summary { border: 1px solid var(--line); }
.saved-views .row-pop { width: min(360px, 90vw); gap: 12px; }
.saved-views .sv-list { margin: 0; flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.saved-views .sv-list li { justify-content: space-between; border-radius: var(--radius); padding: 4px 4px 4px 12px; }
.saved-views .sv-list form { margin: 0; }
.saved-views .sv-save { flex-wrap: nowrap; }
.saved-views .sv-save .field { flex: 1 1 auto; }
.icon-x { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.icon-x:hover { background: var(--bad-soft); color: var(--bad-ink); }
.toolbar .fchip, .toolbar .toggle { min-height: 36px; }

/* Firmware page. */
.fw-notes { max-width: 360px; min-width: 220px; }
.fw-notes details > summary { display: block; }
.fw-notes-first { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fw-notes details[open] .fw-notes-first { display: none; }
.fw-notes .fw-more { display: inline-block; margin-top: 2px; }
.fw-notes-full { margin-top: 0; }
.fw-confirm-body > .dv-btn[type=submit] { width: 100%; height: 40px; }
.pick-list { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick-list legend { padding: 0; margin-bottom: 8px; }
.pick-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; }
.pick-opt:hover { border-color: var(--brand-text); }
.pick-opt:has(input:checked) { border-color: var(--brand-text); background: var(--brand-tint); }
/* The radio itself is small; the ring goes round the whole row for the keyboard. */
.pick-opt:has(input:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.pick-opt input { margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.pick-opt input:focus-visible { outline: none; }
.pick-opt > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
/* "promoted 23 Nov 02:33 by sara" reads as one phrase: kept on one line. */
.fw-groups td .dv-sub { white-space: nowrap; }
/* A long form's Save and Cancel: at the foot of the window while the form is on screen. */
.save-bar { position: sticky; bottom: 0; z-index: 4; margin: 0 0 18px; padding: 12px 0;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -14px rgba(0, 0, 0, .35); }
.fw-bulk .hint { margin: 0; }
.fw-bulk select { min-width: 200px; }
.howto { margin-top: 18px; }
.howto-body { max-width: 780px; padding: 4px 0 0 2px; }
.howto-body p { margin: 8px 0; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.empty-box p { margin: 0 0 12px; }
.empty-box p:last-child { margin-bottom: 0; }

/* Picking a file: one box to click (or drop a file on), with the chosen name in it. */
.file-pick { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; }
.file-pick:hover, .file-pick:focus-within { border-color: var(--brand-text); color: var(--brand-text); }
.file-pick input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick svg { flex: none; }
.file-pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--text); }
.file-pick-text strong { overflow-wrap: anywhere; }
.file-pick.has-file { border-style: solid; border-color: var(--ok-line); background: var(--ok-soft); }
.modal-card { width: min(520px, 100%); }
.modal-card .check-line { min-height: 0; }

/* Forms laid out as rows of fields, each as wide as what goes in it (fleet settings). */
.form-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-start; }
.form-row > .field { flex: 0 1 auto; width: 100%; }
.form-row > .w-xs { max-width: 130px; }
.form-row > .w-sm { max-width: 180px; }
.form-row > .w-md { max-width: 260px; }
.form-row > .w-lg { max-width: 360px; }
.form-row > .w-text { max-width: 640px; }
.form-row > .field.swatches { width: auto; }
.form-row .hint { max-width: 100%; }
.form-row > p, .form-row > .check-line { flex: 1 1 100%; margin: 0; }
.join-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 8px; }
.join-line .pairing-code { margin: 0; }
.panel-body > .check-line:last-child { margin-bottom: 0; }

/* Job types: the editor is as wide as a job name, and as tall as the list. */
textarea.joblist { max-width: 640px; min-height: calc(6 * 1.9em + 24px); max-height: 640px; line-height: 1.9; }

/* Account: the browsers you are signed in on. */
.ua-name { font-weight: 500; }
.api-card p { margin: 0; color: var(--text-2); }
