:root {
  --black: #080808;
  --dark: #111111;
  --panel: #171717;
  --line: #2a2a2a;
  --red: #c0392b;
  --red-dark: #962d22;
  --cream: #ede9e0;
  --white: #f7f4ee;
  --muted: #7a7870;
  --muted-light: #aaa99f;
  --green: #3f8f5a;
  --amber: #c98a1b;
  --radius: 6px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--black);
  color: var(--cream);
  font-family: "Barlow", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--cream); }
h1, h2, h3 { font-family: "Bebas Neue", "Barlow Condensed", sans-serif; font-weight: 400; letter-spacing: 0.03em; margin: 0 0 0.5rem; color: var(--white); }
h1 { font-size: 2.2rem; line-height: 1.05; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
.label, th, .tab, .btn, label > span.l {
  font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em;
}

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); background: var(--dark); position: sticky; top: 0; z-index: 5; }
.logo { font-family: "Bebas Neue", sans-serif; font-size: 1.6rem; letter-spacing: 0.06em; color: var(--white); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--red); }
.topbar .logos { display: flex; align-items: center; gap: 0.9rem; }
.company-logo { height: 2.4rem; width: auto; padding-left: 0.9rem; border-left: 1px solid var(--line); }
.topbar .who { font-size: 0.85rem; color: var(--muted-light); text-align: right; }

/* Layout */
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.narrow { max-width: 560px; }
/* Results: one line per row when it fits the screen (the page widens just enough); otherwise rows wrap. */
#r-table.oneline th, #r-table.oneline td, #cv-table.oneline th, #cv-table.oneline td { white-space: nowrap; }
#r-table tr.answers-row > td { white-space: normal; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* Dashboard: the headline boxes at a quarter of the width; the general boxes on the first row and the
   per-test boxes on the row below (two per row on phones). */
.dash-stats { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-stats > div { display: contents; }
.dash-stats #stats-tests > :first-child, .dash-stats .row-start { grid-column-start: 1; }
.dash-stats .span-2 { grid-column: 1 / span 2; }
.dash-stats .side-box { grid-column: 3 / span 2; grid-row: var(--side-row); }
@media (max-width: 700px) { .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stats .side-box { grid-column: 1 / span 2; grid-row: auto; } }
.stat { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); padding: 0.9rem 1rem; }
.stat .frac { font-family: "Barlow Condensed", sans-serif; font-size: 1rem; color: var(--muted-light); margin-left: 0.5rem; letter-spacing: 0.04em; }
.stat-spark { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }
.stat-spark .spark { flex: none; max-width: 55%; height: auto; }
.stat-link { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-link:hover { background: #1d1d1d; border-left-color: #e0503f; }
.stat-link:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.stat .n { font-family: "Bebas Neue", sans-serif; font-size: 2.2rem; line-height: 1; color: var(--white); }
.stat .t { font-size: 0.8rem; color: var(--muted-light); text-transform: uppercase; letter-spacing: 0.06em; font-family: "Barlow Condensed", sans-serif; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-top: 0.75rem; }
.filters label { margin: 0; min-width: 9rem; }
.filters label.grow { flex: 1; min-width: 12rem; }
.filters .btn { margin-bottom: 0.15rem; }
.muted { color: var(--muted-light); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tab { background: none; border: none; color: var(--muted-light); padding: 0.7rem 0.9rem; cursor: pointer; font-size: 0.95rem; border-bottom: 2px solid transparent; }
.tab.active { color: var(--white); border-bottom-color: var(--red); }

/* Forms */
label { display: block; margin-bottom: 0.9rem; }
label > span.l { display: block; font-size: 0.8rem; color: var(--muted-light); margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=date], input[type=time], select, textarea {
  width: 100%; background: var(--black); color: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.8rem; font: inherit; font-size: 16px;
}
/* Fix 19 (10 Nov): dropdowns the same height as the text boxes beside them. */
select { min-height: 3rem; }
/* Fix 4 (10 Nov): always keep the scrollbar's space, so the page doesn't shift sideways between short and long tabs. */
html { scrollbar-gutter: stable; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
textarea { min-height: 7rem; resize: vertical; }
.check { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--red); }

.btn { display: inline-block; border: 1px solid var(--line); background: transparent; color: var(--cream); padding: 0.65rem 1.1rem; border-radius: var(--radius); cursor: pointer; font-size: 0.95rem; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.block { width: 100%; padding: 0.9rem; font-size: 1.05rem; }
/* Test page: "applying here / already staff" choice, and the Back button under Continue. */
.who-pick { margin-top: 1rem; }
.who-pick .btn + .btn, .b-who { margin-top: 0.6rem; }

.msg { padding: 0.75rem 0.9rem; border-radius: var(--radius); margin: 0.75rem 0; font-size: 0.95rem; }
.msg.err { background: rgba(192,57,43,0.15); border: 1px solid var(--red); color: #f2c6c0; }
.msg.ok { background: rgba(63,143,90,0.15); border: 1px solid var(--green); color: #c8ead3; }
.msg.info { background: rgba(255,255,255,0.04); border: 1px solid var(--line); }

/* Tables */
.tablewrap { overflow-x: auto; }
/* On computer screens, table headings (Surname, Name…) stay in view under the header bar while scrolling down.
   (The tables fit the width there, so they don't need their own sideways scrolling, which would stop the headings sticking.) */
@media (min-width: 1000px) {
  .tablewrap { overflow-x: visible; }
  table th { position: sticky; top: var(--topbar-h, 4.3rem); z-index: 2; background: var(--panel); }
  .rr-log th { top: calc(var(--topbar-h, 4.3rem) + var(--rr-head-h, 0px)); }
  .cp-showbar { position: sticky; top: var(--topbar-h, 4.3rem); z-index: 3; box-shadow: 0 0.6rem 0 0 var(--panel); }   /* the strip under it hides rows scrolling past before the headings */
  .cp-table th { top: calc(var(--topbar-h, 4.3rem) + var(--cp-bar-h, 0px)); }
  /* Group headings (Expired, November 2026…) stay under the column headings until the next group pushes them off. */
  .cp-table tr.cp-month td { position: sticky; top: calc(var(--topbar-h, 4.3rem) + var(--cp-bar-h, 0px) + var(--cp-th-h, 0px)); z-index: 1; }
  .cp-table th { box-shadow: 0 0.4rem 0 0 var(--panel); }   /* fills the gap down to the group heading, so rows don't show through */
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-size: 0.75rem; color: var(--muted-light); font-weight: 500; border-bottom: 1px solid var(--line); padding: 0.5rem; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 0.55rem 0.5rem; vertical-align: top; }
tr:hover td { background: rgba(255,255,255,0.02); }
th.center, td.center { text-align: center; }
a.person { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.person:hover { color: var(--white); border-bottom-color: var(--red); }

/* Individual view */
.iv-matches { margin-top: 0.5rem; display: grid; gap: 0.25rem; }
.iv-matches button { text-align: left; background: var(--black); border: 1px solid var(--line); color: var(--cream); padding: 0.55rem 0.75rem; border-radius: var(--radius); cursor: pointer; font: inherit; }
.iv-matches button:hover { border-color: var(--red); }
.iv-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; }
.iv-head h2 { margin: 0; font-size: 2rem; }
/* One fact per line, labels lined up in a column. */
.iv-facts { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.6rem; font-size: 0.92rem; }
.iv-facts span b { display: inline-block; min-width: 5.5rem; color: var(--muted-light); font-weight: 400; margin-right: 0.3rem; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }
.iv-badge { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; font-family: "Barlow Condensed", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; border: 1px solid; }
.iv-badge.ok { color: #5fc27e; border-color: #5fc27e; }
.iv-badge.warn { color: #f0a030; border-color: #f0a030; }
.iv-badge.bad { color: #ff5c4a; border-color: #ff5c4a; }
/* Two daily boxes side by side (each a quarter of the width, taller); the monthly test box underneath, as wide as both. */
.iv-sum { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0.75rem; }
.iv-sum .stat.daily { min-height: 9.3rem; display: flex; flex-direction: column; gap: 0.35rem; }
.iv-sum .stat.daily .sub { margin: 0; text-align: center; }
.iv-sum .stat.daily .n .pct.txt-green, .iv-sum .stat.daily .n .pct.txt-red { font-weight: inherit; }
.iv-sum .stat.daily .t { font-size: 1.05rem; font-weight: 700; color: var(--white); line-height: 1.2; }
/* Number centred in the space under the title; % the same size as the fraction. */
.iv-sum .stat.daily .n { margin: auto 0; align-self: center; text-align: center; font-size: 2.2rem; white-space: nowrap; }
.stat .n.txt-red { color: #ff5c4a; }
.stat .n.txt-amber { color: #f0a030; }
.stat .n.txt-green { color: #5fc27e; }
.iv-sum .stat.daily .n .pct { font-size: inherit; margin-left: 0.9rem; }
/* Fix 7 (10 Nov): the test boxes two side by side across the full width (they used to stack in the left half). */
.iv-sum .stat.wide { grid-column: span 2; }
.iv-sum .stat.wide .t { text-align: center; }
/* Fix 8 (10 Nov): every box's heading centred, like the test boxes. */
.iv-sum .stat.daily .t { text-align: center; }
@media (max-width: 600px) {
  .iv-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iv-sum .stat.wide { grid-column: 1 / -1; }
}
.iv-sum .stat .n { font-size: 1.7rem; }
.iv-sum .stat .n .pct { font-size: 1.1rem; margin-left: 0.35rem; }
.iv-sum .stat .sub { font-size: 0.8rem; color: var(--muted-light); margin-top: 0.2rem; }
.iv-flags { margin: 0; padding-left: 1.2rem; }
.iv-flags li { margin: 0.35rem 0; padding: 0.15rem 0.35rem; border-radius: 4px; transition: background 0.6s; }
.iv-flags li .btn.small { margin-left: 0.4rem; padding: 0.1rem 0.6rem; }
.iv-flags li.dismissed { color: var(--muted-light); }
.iv-flags li.dismissed > span { text-decoration: line-through; }
.iv-flags li.flag-focus { background: rgba(201, 138, 27, 0.25); }
.iv-flags .flag-dismiss { margin: 0.5rem 0 0.75rem; }
.iv-flags .flag-dismiss textarea { min-height: 3.5rem; margin-bottom: 0.4rem; }
.status-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.iv-notes .note.dismissal { border-left-color: var(--amber); }
.iv-chart svg { width: 100%; height: auto; display: block; }
/* Test card with a list and a graph: heading opens the list, the graph icon (far right) opens the charts. */
.dual-head { display: flex; align-items: center; gap: 0.75rem; }
.dual-head .card-toggle { flex: 1; min-width: 0; width: auto; }
.chart-btn { flex: none; background: none; border: 1px solid rgba(77,163,255,0.5); border-radius: 6px; color: #4da3ff; padding: 0.35rem 0.6rem; line-height: 0; cursor: pointer; }
.chart-btn:hover, .chart-btn:focus-visible { color: #7dbcff; border-color: #4da3ff; }
.chart-btn.on { color: #fff; border-color: #4da3ff; background: rgba(77,163,255,0.25); }
.collapsible.dual[data-mode="list"] .mode-chart, .collapsible.dual[data-mode="chart"] .mode-list { display: none; }
/* Clickable "Needs attention" badge and count box. */
a.stat-link { text-decoration: none; }
a.iv-badge.status-link { text-decoration: none; cursor: pointer; }
a.iv-badge.status-link:hover { background: rgba(255,255,255,0.06); }
/* Dashboard headline boxes: white heading above the number. */
.stat .t.dash-head { color: var(--white); margin-bottom: 0.3rem; }
/* Small line under a headline number, e.g. "▲ Up 3% on last month". */
.stat-sub { font-size: 0.8rem; margin-top: 0.3rem; line-height: 1.3; }
/* Table rows you can click to open that person. */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: rgba(255,255,255,0.04); }
/* Company view headline boxes: label on top, big number underneath. The label area is always two lines
   high so the numbers line up across all the boxes. */
#cv-stats { gap: 1rem; }
#cv-stats .stat { height: 7.45rem; box-sizing: border-box; padding: 0.85rem 0.6rem; display: flex; flex-direction: column-reverse; justify-content: center; align-items: center; text-align: center; gap: 0.5rem; }
/* Fix 9 (10 Nov): Company view's top boxes left-aligned, the same as the Dashboard's boxes. */
#cv-stats .stat { align-items: flex-start; text-align: left; padding-left: 1rem; padding-right: 1rem; }
/* Fix 23 (10 Nov): Company view lists: name and number columns only as wide as they need; the rest share the space. */
[data-pane="company"] .card-body table tr > :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(3)) { width: 1%; white-space: nowrap; padding-right: 2rem; }
/* Labels on one line (sized so the longest, "Today's Quiz Participation", fits even in the narrowest box). */
#cv-stats .stat .t { font-size: 0.82rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#cv-stats .stat .n { font-size: 3rem; line-height: 1; }
#cv-stats .stat .stat-sub { margin: 0; line-height: 1; }
/* Key under a chart with several lines (e.g. cynophobia levels). */
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.1rem; font-size: 0.8rem; color: var(--muted-light); margin-top: 0.4rem; }
.chart-legend i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: -0.1rem; }
/* Staff list: each person's "needs attention" items, one per line. */
#cv-table .attn-cell { font-size: 0.8rem; line-height: 1.35; white-space: nowrap; }
#cv-table .attn-cell a { text-decoration: none; }
#cv-table .attn-cell a > span { display: block; }   /* the hidden "; " between items is for the Excel download */
#cv-table .attn-cell a > span[hidden] { display: none; }
#cv-stats .stat:has(.stat-sub) { gap: 0.4rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
/* Test page: "please note" points before a self-assessment, and the honesty tick box before submitting. */
.intro-notes { margin: 0 0 1rem; padding-left: 1.2rem; }
.intro-notes li { margin: 0.3rem 0; }
.confirm-box { align-items: flex-start; margin: 1rem 0 0.5rem; line-height: 1.4; }
.confirm-box input { margin-top: 0.2rem; flex: none; }
/* Several charts inside one card (Company view), split by a faint line. */
/* Each chart's title in a column to its left, centred top to bottom. The first chart also has the
   30 days / 3 months toggle at the top of that column. On phones the column goes above the chart. */
.chart-block { display: flex; align-items: stretch; gap: 1rem; }
.chart-block + .chart-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.chart-block .chart-side { flex: 0 0 10rem; display: flex; flex-direction: column; }
.chart-block .chart-title { margin: auto 0; font-size: 1.05rem; line-height: 1.25; }
.chart-block .chart-fig { flex: 1; min-width: 0; align-self: center; }
.chart-toggle { display: flex; gap: 0.35rem; }
.chart-toggle .btn.small { padding: 0.25rem 0.5rem; }
@media (max-width: 600px) {
  .chart-block { flex-direction: column; gap: 0.5rem; }
  .chart-block .chart-side { flex: none; gap: 0.5rem; }
}
/* Hover label on line charts: date and score of the nearest day. */
.line-hover { position: relative; }
.line-hover svg { cursor: crosshair; touch-action: pan-y; }
.hv-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: #0d0d0d; border: 1px solid var(--line); color: var(--white); font-size: 0.8rem; padding: 0.25rem 0.55rem; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 2; }
.iv-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted-light); margin-top: 0.4rem; }
.iv-legend i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.iv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 2.6rem)); gap: 4px; }
.iv-cal .dow { font-size: 0.7rem; color: var(--muted-light); text-align: center; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; }
.iv-cal .day { height: 2.3rem; border-radius: 4px; font-size: 0.72rem; display: flex; align-items: flex-start; justify-content: flex-end; padding: 2px 4px; background: rgba(255,255,255,0.04); color: var(--muted-light); }
.iv-cal .day.pass { background: #2e7d4a; color: #fff; }
.iv-cal .day.fail { background: #b06d10; color: #fff; }
.iv-cal .day.miss { background: #8a2a20; color: #fff; }
.iv-cal .day.today { outline: 2px solid var(--white); }
.iv-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 80px; }
.iv-bar > div { height: 100%; background: #ff5c4a; }
.iv-notes .note { border-left: 3px solid var(--line); padding: 0.4rem 0.75rem; margin-bottom: 0.6rem; }
.iv-notes .note .meta { font-size: 0.78rem; color: var(--muted-light); }
.print-only { display: none; }

@media print {
  body.print-individual { background: #fff !important; color: #000 !important; }
  body.print-individual * { visibility: hidden; }
  body.print-individual #iv-body, body.print-individual #iv-body * { visibility: visible; }
  body.print-individual #iv-body { position: absolute; left: 0; top: 0; width: 100%; }
  body.print-individual #iv-body .no-print, body.print-individual #iv-body .no-print * { display: none !important; }
  body.print-individual .print-only { display: block; }
  body.print-individual .card, body.print-individual .stat { background: #fff !important; border-color: #999 !important; color: #000 !important; break-inside: avoid; }
  body.print-individual h1, body.print-individual h2, body.print-individual h3, body.print-individual td, body.print-individual th, body.print-individual .muted { color: #000 !important; }
  body.print-individual a.person { border: 0; }
}
tr.answers-row > td { background: rgba(255,255,255,0.03); padding: 0.75rem 1rem 1rem; }
tr.answers-row:hover > td { background: rgba(255,255,255,0.03); }
.answers-list { margin: 0; padding-left: 1.4rem; }
.answers-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.answers-list li:last-child { border-bottom: 0; }
.answers-list li .small { margin-top: 0.2rem; color: var(--muted-light); }
.answers-list li .small strong { color: var(--white); font-weight: 500; }
.card-toggle { display: block; width: 100%; background: none; border: 0; padding: 0; margin: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.card-toggle h3 { margin: 0; }
.card-toggle:hover .chev, .card-toggle:focus-visible .chev { color: var(--red); }
.card-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.chev { display: inline-block; transition: transform 0.15s; margin-right: 0.15rem; }
.collapsible .card-body { margin-top: 0.75rem; }
.collapsible.collapsed .card-body { display: none; }
.collapsible.collapsed .chev { transform: rotate(-90deg); }
/* Tests and links tab: test headings take less height (same font size), so more tests fit on one screen. */
[data-pane="tests"] .collapsible { padding-top: 0.5rem; margin-bottom: 0.5rem; }
[data-pane="tests"] .collapsible.collapsed { padding-bottom: 0.5rem; }
[data-pane="tests"] .collapsible .card-toggle h3 { line-height: 1.2; }
h3.split { display: flex; justify-content: flex-start; align-items: baseline; gap: 0.25rem 2.5rem; flex-wrap: wrap; }
.card-toggle h3.split { flex-wrap: nowrap; justify-content: flex-start; }
.card-toggle h3.split > .card-title { flex: none; }
.card-toggle h3.split > span:last-child { flex: 1 1 auto; min-width: 0; text-align: center; }
.card-toggle h3.split > span:last-child > span { white-space: nowrap; }
.cnt { display: inline-block; padding: 0 1.5rem; }   /* equal space either side, so the row of counts sits centred */
.card-toggle h3.split { column-gap: 1.75rem; }
@media (max-width: 600px) {
  .card-toggle h3.split { flex-wrap: wrap; }
  .card-toggle h3.split > .card-title { min-width: 0 !important; }
}
.txt-red { color: #ff5c4a; font-weight: 500; }
.txt-green { color: #5fc27e; font-weight: 500; }
.wheel-icon { color: #5fc27e; vertical-align: middle; }
.txt-amber { color: #f0a030; font-weight: 500; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th:hover, table.cp-sortable th[data-cp-sort]:hover { color: var(--white); }
table.cp-sortable th[data-cp-sort] { cursor: pointer; user-select: none; }
table.sortable th[data-sorted="asc"]::after, table.cp-sortable th[data-sorted="asc"]::after { content: " ▲"; color: var(--red); }
table.sortable th[data-sorted="desc"]::after, table.cp-sortable th[data-sorted="desc"]::after { content: " ▼"; color: var(--red); }
/* Compliance list: a heading row per month, and "also due" items (shown lighter) for people already in that month. */
.cp-table tr.cp-month td { background: var(--panel); font-size: 1rem; padding: 0.6rem 0.4rem 0.35rem; border-bottom: 2px solid var(--line); }
.cp-table th.cp-gap, .cp-table td.cp-cell.cp-gap { padding-left: 1.3rem !important; padding-right: 1.3rem !important; border-left: 2px solid var(--line); }.cp-table th, .cp-table td, #cp-expiry table th, #cp-expiry table td { text-align: center; }
.cp-table tr.cp-month td { text-align: center; }
#cp-expiry table th:first-child, #cp-expiry table td:first-child { text-align: left; }
.cp-table td.cp-also .cp-d, .cp-table td.cp-also .cp-chip { opacity: 0.55; }

.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--line); }
.pill.pass, .pill.active { color: #c8ead3; border-color: var(--green); }
.pill.fail, .pill.left { color: #f2c6c0; border-color: var(--red); }
.pill.pending, .pill.warn { color: #f3d9a6; border-color: var(--amber); }

/* Staff test page */
.test-q { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.test-q:last-child { border-bottom: none; }
.test-q .qn { font-family: "Barlow Condensed", sans-serif; color: var(--red); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
.test-q .qt { font-size: 1.08rem; color: var(--white); margin: 0.2rem 0 0.75rem; font-weight: 500; }
.opt { display: flex; gap: 0.7rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 0.85rem; margin-bottom: 0.5rem; cursor: pointer; background: var(--black); }
.opt input { margin-top: 0.25rem; accent-color: var(--red); width: 1.1rem; height: 1.1rem; flex: none; }
.opt.sel { border-color: var(--red); background: rgba(192,57,43,0.08); }
.fb { padding: 0.75rem 0.9rem; border-radius: var(--radius); margin-bottom: 0.6rem; border: 1px solid var(--line); }
.fb.right { border-color: var(--green); }
.fb.wrong { border-color: var(--red); }
.stepbar { height: 6px; background: var(--line); border-radius: 6px; margin: 0.25rem 0 0.5rem; overflow: hidden; }
.stepbar > div { height: 100%; width: 0; background: var(--red); transition: width 0.2s; }
#stepnav .btn { min-width: 7rem; padding: 0.85rem 1.2rem; font-size: 1rem; }
.bigscore { font-family: "Bebas Neue", sans-serif; font-size: 4rem; line-height: 1; color: var(--white); text-align: center; }
.qr { background: #fff; padding: 8px; display: inline-block; border-radius: 4px; }

/* Company-branded test pages (colours are set from the company's settings) */
/* Sunlight theme (fitness test page, used outdoors on a phone): white background, black text, strong colours. */
body.sunlight { color-scheme: light; background: #fff; color: #000;
  --black: #ffffff; --dark: #f2f2ef; --panel: #ffffff; --line: #8c8c8c; --cream: #000000; --white: #000000;
  --muted: #333333; --muted-light: #333333; --red: #b3241a; --red-dark: #8a1c12; --green: #1f7a3f; }
body.sunlight .topbar { background: #fff; border-bottom: 2px solid #000; }
body.sunlight .card { background: #fff; border: 2px solid #000; }
body.sunlight .fit-person { background: #fff; border-color: #8c8c8c; }
body.sunlight input[type=text], body.sunlight input[type=tel] { background: #fff; color: #000; border: 2px solid #000; }
body.sunlight .btn { color: #000; border-color: #000; background: #fff; }
body.sunlight .btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
body.sunlight .btn.btn-att-on, body.sunlight .btn.btn-att-on:disabled { background: var(--green); border-color: var(--green); color: #fff; }
body.sunlight .btn:disabled:not(.btn-att-on) { opacity: 0.45; }
body.sunlight .switch .slider { background: #9a9a9a; }
body.sunlight .switch .slider::after { background: #fff; }
body.sunlight .fit-waiver.ok { color: #000; }   /* the tick is black on the white page */
body.sunlight .msg.err { background: #fff; color: #8a1c12; border-color: #8a1c12; }
body.sunlight .msg.ok { background: #fff; color: #1d5c34; border-color: #1d5c34; }
body.sunlight .sec-table th, body.sunlight .sec-table td { color: #000; border-color: #8c8c8c; }
body.sunlight .sec-table td.txt-red { color: var(--red); }
body.sunlight .sec-table td.txt-green { color: var(--green); }
body.sunlight .sec-table td.muted { color: #555; }
body.sunlight .sh-num { color: #fff; }
body.sunlight .txt-red { color: #b3241a; } body.sunlight .txt-green { color: #1f7a3f; } body.sunlight .txt-amber { color: #8a5500; }
body.sunlight .pill.pass { background: var(--green); border-color: var(--green); color: #fff; }
body.sunlight .pill.fail { background: var(--red); border-color: var(--red); color: #fff; }
.pill.fit-approved, body.sunlight .pill.fit-approved { background: #f39c12; border-color: #f39c12; color: #000; }   /* vitals: cleared by the instructor */
/* Fitness Vitals screen: one card per participant, the readings in small boxes, the result underneath */
.fit-person.fit-vit-card { display: block; cursor: default; padding: 0.5rem 0.75rem; }
.fit-person.fit-vit-card > span:first-of-type { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; }
.fit-vit-boxes { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; margin: 0.35rem 0; }
.fit-vit-box { display: flex; flex-direction: column; gap: 0.1rem; margin: 0; }
.fit-vit-in { display: flex; align-items: center; gap: 0.2rem; }
.fit-person .fit-vit-in input[type=text] { width: 4.2rem; font-size: 1.05rem; padding: 0.35rem 0.2rem; }
.fit-person .fit-vit-in input::placeholder { font-size: 0.8rem; font-weight: 400; color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.05em; }
.fit-vit-l { font-size: 0.85rem; font-weight: 600; }
.fit-vit-entry { padding: 0.75rem; border: 2px solid var(--white); border-radius: var(--radius); background: var(--dark); display: flex; flex-direction: column; gap: 0.4rem; }
/* The entry line: App # | readings | Save, all one row of big, easy-to-tap boxes that share the width.
   (With more than pulse + BP switched on, the extra boxes wrap onto a second row on a phone.) */
.fit-vit-line { display: flex; align-items: flex-end; gap: 0.3rem; flex-wrap: wrap; }
.fit-vit-cell { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; flex: 1 1 3.3rem; min-width: 3.3rem; }
.fit-vit-cell.two { flex: 2 1 7rem; min-width: 7rem; }
.fit-vit-cell .fit-vit-l { white-space: nowrap; font-size: 0.78rem; }
.fit-vit-cell .fit-vit-in { display: flex; align-items: center; gap: 0.2rem; }
.fit-vit-entry input[type=text] { width: 100%; min-width: 0; height: 3.1rem; font-size: 1.2rem; font-weight: 700; text-align: center; padding: 0 0.1rem; }
.fit-vit-entry input::placeholder { font-size: 0.8rem; font-weight: 400; color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.05em; }
.fit-vit-save { flex: 0 0 auto; height: 3.1rem; padding: 0 0.7rem; }
.fit-vit-entry { padding: 0.6rem 0.5rem; }
/* Everyone's vitals taken: the box keeps its size (its boxes are only hidden) and says so instead */
.fit-vit-entry, .fit-timer { position: relative; }
.fit-vit-done { display: none; }
.fit-vit-entry.all-done > :not(.fit-vit-done), .fit-timer.all-done > :not(.fit-vit-done) { visibility: hidden; }
.fit-vit-entry.all-done .fit-vit-done, .fit-timer.all-done .fit-vit-done { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; text-align: center; padding: 0.5rem;
  font: 500 1.6rem/1.1 'Bebas Neue', 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--green); }
.fit-vit-top { align-items: center; flex-wrap: nowrap; }
.fit-vit-read { margin: 0.15rem 0; }
.fit-vit-state:empty { display: none; }
/* Run timer: big Start button, then a big running clock with the finisher entry line under it */
.btn.fit-timer-go { padding: 1.1rem; font-size: 1.4rem; margin-bottom: 0.75rem; background: var(--green); border-color: var(--green); color: #fff; }
.fit-timer { padding: 0.6rem 0.5rem; margin-bottom: 0.75rem; border: 2px solid var(--white); border-radius: var(--radius); background: var(--dark); display: flex; flex-direction: column; gap: 0.4rem; }
.fit-clock { font: 500 3rem/1 'Bebas Neue', 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--green); }
.fit-timer.stopped .fit-clock { color: var(--white); }
/* "5 not finished": on its own line, centred in the timer box, as big as fits on one line (the clock's size on wider screens) */
.fit-left { order: 10; flex-basis: 100%; text-align: center; white-space: nowrap; font: 500 clamp(1.5rem, 8.5vw, 3rem)/1 'Bebas Neue', 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.fit-left b { font-weight: inherit; }
/* Timer stopped: clock, "n not finished", "Timer stopped" and Reset all on one neat line */
.fit-timer.stopped > .row { flex-wrap: nowrap; gap: 0.35rem; min-width: 0; }
.fit-timer.stopped .fit-clock { font-size: clamp(1.4rem, 7vw, 3rem); }
.fit-timer.stopped .fit-left { order: 0; flex: 0 1 auto; min-width: 0; font-size: clamp(1rem, 4.6vw, 2rem); }
.fit-timer.stopped > .row .small { white-space: nowrap; font-size: 0.75rem; }
.fit-timer.stopped > .row .spacer { min-width: 0; }
.fit-timer.stopped > .row .btn { flex: none; padding: 0.3rem 0.5rem; }
/* One-at-a-time box (strikes): who's up, clock, big Start then a big red Stop; keeps its size when everyone is done */
.fit-solo { min-height: 10rem; }
.fit-solo-top, .fit-solo-mid { align-items: center; flex-wrap: nowrap; gap: 0.5rem; }
.fit-solo-who { font-size: 1.3rem; min-width: 0; }
.fit-solo-mid { justify-content: space-between; }
.fit-solo .fit-left { order: 0; flex: none; text-align: right; font-size: clamp(1.5rem, 8vw, 3rem); }
.fit-solo .fit-clock, .fit-solo.stopped .fit-clock { font-size: clamp(1.5rem, 8vw, 3rem); }
.fit-solo .btn.fit-timer-go { margin-bottom: 0; }
.fit-solo-next { text-align: center; }
.fit-solo-reps .fit-left { font-size: clamp(1.2rem, 6vw, 2rem); }
.fit-solo-reps .fit-vit-line { align-items: flex-end; }
/* CPO rubric exercises: countdown (sit-ups / push-ups), "Time!", the bag carry choices and the scoring guide */
.btn.fit-timer-go.fit-go-small { margin: 0; padding: 0.6rem 1rem; font-size: 1.1rem; }
.fit-clock.fit-time-up { color: var(--red); }
.fit-choice { display: flex; flex-direction: column; gap: 0.35rem; }
.fit-choice .btn { text-align: left; white-space: normal; font-family: 'Barlow', sans-serif; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.fit-choice .btn b { display: inline-block; min-width: 3rem; }
.fit-guide summary { cursor: pointer; }
.fit-guide-line { display: block; font-weight: 400; }
.fit-results td .small { display: block; }
.fit-cd-len { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.fit-timer .fit-cd-len input[type=text] { width: 4.5rem; height: 2.2rem; font-size: 1rem; }
.fit-rest-btns { gap: 0.4rem; flex-wrap: wrap; }
/* Recruitment → Documents: a subtle month heading between the recruits' rows (recruit.js monthGroups). */
tr.rc-month td { background: transparent; color: var(--muted, #9a978f); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.75rem 0.5rem 0.25rem; border-bottom: 1px solid var(--line); cursor: default; }
/* Tests and links: "See governing documents" on a card's title bar, and the documents' rows. */
.gov-hint { color: #4da3ff; font-family: inherit; letter-spacing: 0; text-transform: none; font-weight: normal; }
.grade-row { padding: 0.35rem 0; border-top: 1px solid var(--line); gap: 0.4rem; flex-wrap: wrap; }
/* Fix 5 (10 Nov): the name takes the free space, so View / Download / Replace / Remove line up on the right on every row;
   Replace (a label holding the file picker) no longer gets the labels' bottom margin, so it sits level with the others. */
.grade-row > .grow { flex: 1 1 14rem; min-width: 0; }
.grade-doc label.btn { display: inline-block; margin: 0; line-height: normal; }
/* Fix 6 (10 Nov): "See governing documents" at the right edge of the card's title bar. */
.card-toggle h3.split > span:last-child:has(> .gov-hint) { text-align: right; }
/* The Recruitment tab's label in blue (dashboard.html). */
.tab .tab-blue { color: #4da3ff; }
/* The Control panel tab's label in red (dashboard.html). */
.tab .tab-red { color: #e5484d; }
/* Bag carry rows (fitness.html): − Rests + and a red "Did not complete" button (black text); then "Did not complete" + Undo. */
.bag-row { cursor: default; flex-wrap: wrap; }
.bag-row > span:first-child { flex: 1; min-width: 10rem; }
.bag-ctl { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bag-step { display: inline-flex; align-items: center; gap: 0.35rem; }
.bag-step .btn { min-width: 2.4rem; font-size: 1.2rem; line-height: 1; }
.bag-val { display: inline-flex; flex-direction: column; align-items: center; min-width: 7.5rem; text-align: center; font-weight: 600; }
.bag-val .small { font-weight: normal; }
#fit-test .bag-row .btn.bag-dnc, body.sunlight #fit-test .bag-row .btn.bag-dnc { background: #e5484d; border-color: #e5484d; color: #000; }
.bag-dnc-txt { color: #e5484d; font-weight: 600; }
/* 2.4 km run rows: − Laps n + (counting laps around a field) left of the time box */
/* One line, also on a phone: number over name | − laps + | time */
.fit-person.run-row { cursor: default; flex-wrap: nowrap; gap: 0.5rem; padding: 1.2rem 0.6rem 0.5rem; }
.run-row .run-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.run-row .run-who > span { font-size: 0.85rem; overflow-wrap: break-word; }
.lap-step { display: inline-flex; align-items: center; gap: 0.3rem; flex: none; }
/* −, the lap number, + and the time box: all the same height, centred on one line ("Laps" floats above the number) */
.lap-step .btn, .fit-person.run-row input[type=text] { height: 2.6rem; box-sizing: border-box; margin: 0; }
.lap-step .btn { min-width: 2.2rem; padding: 0 0.5rem; font-size: 1.2rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.lap-step .btn.lap-hide { visibility: hidden; }
.lap-val { position: relative; display: inline-flex; margin: 0; cursor: text; }
.lap-val .small { position: absolute; bottom: 100%; left: -0.5rem; right: -0.5rem; text-align: center; font-weight: normal; line-height: 1.3; }
.fit-person.run-row .lap-val input[type=text] { width: 2.9rem; font-size: 1rem; padding: 0 0.1rem; }
.fit-person.run-row input[data-fit-val] { width: 4.3rem; font-size: 1.05rem; padding: 0 0.15rem; }
.fit-person.run-row input[data-fit-val]::placeholder { font-size: 0.9rem; }
.fit-person .lap-val input.final { color: var(--green); }
.fit-solo #m-tmr .msg { margin: 0; padding: 0.4rem 0.6rem; text-align: center; }
.btn.fit-timer-stop { padding: 1.1rem; font-size: 1.4rem; background: var(--red); border-color: var(--red); color: #fff; }
body.sunlight .btn.fit-timer-stop { background: #000; border-color: #000; color: #fff; }   /* sunlight: Start is red, so Stop is black */
.fit-timer input[type=text] { width: 100%; min-width: 0; height: 3.1rem; font-size: 1.2rem; font-weight: 700; text-align: center; }
.fit-vit-l span { font-weight: 400; color: var(--muted-light); }
.fit-vit-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
body.branded { color-scheme: light; background: #ffffff; }
body.branded .topbar { background: var(--black); border-bottom-color: var(--line); justify-content: center; }
body.branded #company-name { display: none; }
.brand-logo { height: 48px; width: auto; display: block; }
body.branded .brand-logo { height: 72px; width: auto; display: block; }
body.branded .card { background: var(--black); border-color: var(--line); }
body.branded input[type=text], body.branded select { background: #fff; color: #111; border-color: var(--line); }
body.branded .opt { background: rgba(255,255,255,0.55); color: var(--cream); }
body.branded .opt.sel { background: #fff; border: 2px solid var(--red); }
body.branded .btn.primary { background: var(--red); border-color: var(--red); color: var(--black); }
body.branded .btn.primary:hover { background: var(--red-dark); }
body.branded .test-q .qn { color: var(--cream); opacity: 0.75; }
body.branded .msg.err { background: #fff; color: #8a1c12; border-color: #8a1c12; }
body.branded .msg.ok { background: #fff; color: #1d5c34; border-color: #1d5c34; }
body.branded .fb { background: rgba(255,255,255,0.55); }
body.branded .fb.right { border-color: #1d5c34; }
body.branded .fb.wrong { border-color: #8a1c12; }
.powered { text-align: center; font-size: 0.75rem; opacity: 0.6; margin-top: 2rem; font-family: "Barlow Condensed", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Recruitment: applicant page ---------- */
.doc-row { display: flex; width: 100%; gap: 0.75rem; align-items: center; text-align: left; color: inherit; font: inherit; cursor: pointer; margin-bottom: 0.6rem; padding: 0.9rem 1rem; }
.doc-row:hover:not(:disabled) { border-color: var(--muted); }
.doc-row:disabled { cursor: default; }
.doc-row-main { flex: 1; min-width: 0; }
.doc-row-sub { display: block; margin-top: 0.2rem; }
.photo-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.photo-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; min-height: 9rem; margin: 0; padding: 0.75rem; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; }
.photo-slot:hover { border-color: var(--muted); }
.photo-slot.has { border-style: solid; border-color: var(--green); }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-prev img { max-width: 100%; max-height: 7rem; border-radius: 4px; display: block; }
.photo-label { font-weight: 500; }
.photo-state { color: var(--muted-light); }
.multi { margin-bottom: 0.9rem; }
.multi-opts { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.multi-opts .check { margin: 0; }
.job-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; margin-bottom: 0.75rem; }

/* ---------- Recruitment: dashboard tab ---------- */
/* Timeline of the recruitment steps on the left; the chosen step's page on the right. */
.rc-layout { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 0.85rem; align-items: start; }
.rc-steps { position: sticky; top: 5.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 0.5rem; }
.rc-steps-title { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--muted-light); padding: 0 0.5rem 0.5rem; }
.rc-step { position: relative; display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.45rem 0.5rem; background: none; border: 0; border-radius: 4px;
  color: var(--cream); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.rc-step:hover { background: rgba(255,255,255,0.05); }
.rc-step.on { background: rgba(192,57,43,0.15); color: var(--white); }
.rc-step-n { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--line); background: var(--dark);
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--muted-light); position: relative; z-index: 1; }
.rc-step.on .rc-step-n { background: var(--red); border-color: var(--red); color: #fff; }
/* The line joining the step numbers. */
.rc-step:not(:last-child)::after { content: ""; position: absolute; left: calc(0.5rem + 0.8rem - 0.5px); top: 1.85rem; height: calc(100% - 1.4rem); width: 1px; background: var(--line); }
.rc-step-t { flex: 1; min-width: 0; }
.rc-step-all { margin-bottom: 0.1rem; }
.rc-step-all::after { display: none; }
/* "Failed recruits" sits just under Recruits, with a line before the numbered steps. */
.rc-step-sub { padding-left: 1.6rem; font-size: 0.85rem; margin-bottom: 0.6rem; border-bottom: 1px solid var(--line); border-radius: 4px 4px 0 0; padding-bottom: 0.6rem; }
.rc-step-sub .rc-step-n { width: 1.3rem; height: 1.3rem; font-size: 0.7rem; color: var(--red); }
.rc-step-sub::after { display: none; }
/* Security check / Failed recruits: the person on the left, a gap and line, then the checks on the right. */
/* Only as wide as needed, so the person's details stay tight on the left however wide the screen. */
.sec-table { width: auto; font-size: 0.86rem; }
/* Fixes 11 and 17 (10 Nov): the Compliance tables (Expiration calendar, Compliance list) and the Recruitment lists use
   the full width of their card instead of stopping half-way. */
#cp-expiry .sec-table, .cp-table, #rc-body .sec-table.ppl { width: 100%; }
/* Headings may wrap onto two lines (e.g. "Average / score") so the table fits without scrolling sideways. */
.sec-table th { white-space: normal; vertical-align: bottom; padding-left: 0.4rem; padding-right: 0.55rem; }
.sec-table td { white-space: nowrap; padding-left: 0.4rem; padding-right: 0.55rem; }
.sec-table .sec-split { border-left: 2px solid var(--line); padding-left: 0.75rem; }
.sec-table td.cell-wrap { white-space: normal; }
/* Narrower screens: recruit lists drop the Cell and ID number columns (they're on each recruit's own page) so nothing scrolls sideways. */
@media (max-width: 1000px) {
  .sec-table.ppl th:nth-child(3), .sec-table.ppl td:nth-child(3), .sec-table.ppl th:nth-child(4), .sec-table.ppl td:nth-child(4) { display: none; }
  /* With a Rank column first, Cell and ID are one further along. */
  .sec-table.ppl.ranked th:nth-child(3), .sec-table.ppl.ranked td:nth-child(3) { display: table-cell; }
  .sec-table.ppl.ranked th:nth-child(5), .sec-table.ppl.ranked td:nth-child(5) { display: none; }
}
/* Documents list: a gap between the Docs count and the document columns (the 7th column on). */
#rc-table th:nth-child(5), #rc-table td:nth-child(5) { padding-left: 3rem; }
.sec-table td.sec-split, .sec-table td.sec-split + td { white-space: nowrap; }
.sec-table .btn.small { margin: 0.1rem 0.15rem 0.1rem 0; }
.btn.sec-pass { border-color: var(--green); color: #c8ead3; }
.btn.sec-pass:hover { background: rgba(63,143,90,0.2); }
.btn.sec-fail { border-color: var(--red); color: #f2c6c0; }
.btn.sec-fail:hover { background: rgba(192,57,43,0.2); }
.btn.sec-flag { border-color: var(--amber); color: #f3d9a6; }
.btn.sec-flag:hover { background: rgba(201,138,27,0.2); }
/* "Details are correct" on a recruit's document: green with black text. */
.btn.ok-btn { background: #4caf6e; border-color: #4caf6e; color: #000; }
.btn.ok-btn:hover { background: #63c283; border-color: #63c283; color: #000; }
/* Instructor notes (Polygraph and Interview pages): yellow with black text. */
.btn.notes-btn { background: #f5c518; border-color: #f5c518; color: #000; }
.btn.notes-btn:hover { background: #ffd84a; border-color: #ffd84a; color: #000; }
/* "✓ Passed by …" with the date underneath: two small lines, no taller than the Pass / Fail buttons. */
/* "✓ Passed / date" and "name / Undo" side by side, the pair centred in the cell (same centre as the Pass / Fail buttons). */
.sec-done { display: inline-flex; gap: 0.75rem; align-items: center; font-size: 0.75rem; line-height: 1.15; vertical-align: middle; }
.sec-done .sec-who, .sec-done .sec-mark { display: flex; flex-direction: column; align-items: center; }
.sec-done .sec-who { color: var(--muted-light); }
/* Credit and Criminal columns wide enough for the name beside the mark, with room between them. */
#sec-table th:nth-child(6), #sec-table td:nth-child(6), #sec-table th:nth-child(7), #sec-table td:nth-child(7) { min-width: 15rem; }
#sec-table th:nth-child(7), #sec-table td:nth-child(7) { padding-left: 2.5rem; }
.sec-done .linkish { font-size: inherit; }
.sec-passed td { opacity: 0.75; }
/* Tests tab: pass mark rows (name · on/off switch · % · Save). */
.pm-row { display: grid; grid-template-columns: minmax(12rem, 1fr) auto auto auto; gap: 0.5rem 1.25rem; align-items: center; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.pm-name { display: flex; flex-direction: column; }
.pm-mark { display: flex; align-items: center; gap: 0.3rem; }
.pm-mark input { width: 4.2rem; text-align: center; font-weight: 700; }
.pm-mark.off { opacity: 0.4; }
.pm-msg { grid-column: 1 / -1; }
.pm-msg .msg { margin: 0; padding: 0.3rem 0.5rem; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 2.6rem; height: 1.4rem; border-radius: 999px; background: var(--line); position: relative; transition: background 0.15s; }
.switch .slider::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--white); transition: transform 0.15s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { transform: translateX(1.2rem); }
.switch input:focus-visible + .slider { outline: 2px solid var(--red); outline-offset: 2px; }
.switch.locked { cursor: not-allowed; opacity: 0.5; }
.switch .sw-t { font-size: 0.85rem; min-width: 1.6rem; }
@media (max-width: 600px) { .pm-row { grid-template-columns: 1fr auto; } }
/* Fitness page: a recruit's test history opens under their line. */
#fit-table tr.open > td { background: rgba(255,255,255,0.04); }
#fit-table tr.fit-hist > td { padding: 0.25rem 0 0.75rem 1.5rem; background: rgba(255,255,255,0.02); }
.fit-hist-t th, .fit-hist-t td { font-size: 0.82rem; padding-top: 0.3rem; padding-bottom: 0.3rem; }
/* Fitness test day (Tests tab). */
.fit-std { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end; }
.fit-std label { margin: 0; width: 9.5rem; }
.fit-std input { text-align: center; }
.fit-roster tr.fit-out td { opacity: 0.45; }
.fit-roster input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--green); cursor: pointer; }
.fit-entry input { width: 7rem; text-align: center; font-size: 1.05rem; font-weight: 700; padding: 0.35rem; }
#fit-test input.bad { border-color: var(--red); outline: 2px solid var(--red); }
/* Small pop-up window (e.g. Schedule interview). */
.rc-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.rc-modal-box { width: 100%; max-width: 22rem; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.rc-modal-box input[type=date], .rc-modal-box input[type=time] { width: 100%; color-scheme: dark; font-size: 1rem; padding: 0.55rem; }
/* Fitness test page (phone): one line per person, big tap targets. */
.fit-list { display: flex; flex-direction: column; gap: 0.4rem; }
/* "1 of 2 taken · 1 passed", "3 confirmed · 2 to confirm": the same size and font as a participant's name. */
.fit-count { font-weight: 700; }
.fit-person { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--dark); cursor: pointer; }
.fit-person > span:first-of-type { flex: 1; display: flex; flex-direction: column; }
.fit-person.out { opacity: 0.45; }
.fit-person input[type=checkbox] { width: 1.4rem; height: 1.4rem; accent-color: var(--green); flex: none; }
.fit-person input[type=text] { width: 6.5rem; text-align: center; font-size: 1.15rem; font-weight: 700; padding: 0.45rem; flex: none; }
/* Fitness test screens: the screen's name big on the left, "Fitness test" (+ Cancel) small in the top right corner */
.fit-head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.6rem; }
.fit-hero { flex: 1; min-width: 0; margin: 0; font-size: 2rem; line-height: 1.05; }
.fit-head-r { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
/* Step tabs (Roster onwards): wrap onto more lines rather than scroll sideways; the open step is filled in */
.fit-tabs { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border-radius: 10px; background: var(--dark); }
.fit-tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.6rem; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted-light); font: 500 0.95rem/1 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.fit-tab:hover { color: var(--white); }
.fit-tab.on { background: var(--white); color: var(--black); cursor: default; }
.fit-tab-n { min-width: 1.25rem; padding: 0.12rem 0.3rem; border-radius: 999px; background: var(--line); color: var(--black);
  font: 600 0.72rem/1 'Barlow', sans-serif; letter-spacing: 0; text-align: center; }
.fit-tab-n.some { background: var(--green); color: #fff; }
.fit-tab.on .fit-tab-n:not(.some) { background: #777; color: #fff; }
#fit-test .row > .btn.primary:last-child { margin-left: auto; }   /* the "Start …" button stays bottom right */
.fit-brand { font: 500 0.8rem/1 'Barlow Condensed', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-light); }
/* Fitness roster: one thin line per recruit (name + App # | Indemnity ✓/✗ | Confirm attendance / Remove),
   in columns that line up with the heading row above the list. */
.fit-roster, .fit-roster-head { --att-w: 15rem; display: grid; grid-template-columns: minmax(0, 1fr) var(--att-w); align-items: center; gap: 0.5rem; }
.fit-roster.with-w, .fit-roster-head.with-w { grid-template-columns: minmax(0, 1fr) 5.5rem var(--att-w); }
.fit-roster { padding: 0.35rem 0.75rem; cursor: default; }
.fit-roster > span:first-of-type { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; }
.fit-roster > span:first-of-type .small { white-space: nowrap; }
.fit-roster-head { padding: 0 calc(0.75rem + 1px); margin-bottom: 0.25rem; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-light); }
.fit-w-col { text-align: center; }
.fit-att { display: flex; gap: 0.4rem; justify-content: flex-end; align-items: center; }
.fit-att .btn { white-space: nowrap; }
.btn.btn-att-on, .btn.btn-att-on:disabled { background: var(--green); border-color: var(--green); color: #fff; opacity: 1; cursor: default; }
@media (max-width: 560px) { .fit-roster, .fit-roster-head { --att-w: 9.5rem; } .fit-att { flex-direction: column; align-items: stretch; } }
/* Fitness results: fits the phone width (no sideways scroll); names wrap, Result = Pass/Fail with the score under it */
.fit-results { width: 100%; table-layout: fixed; }
.fit-results th, .fit-results td { padding: 0.4rem 0.25rem; white-space: normal; overflow-wrap: anywhere; }
.fit-results th:first-child, .fit-results td:first-child { width: 34%; padding-left: 0; }
.fit-results td:last-child span { display: block; }
@media (max-width: 560px) { .fit-results { font-size: 0.8rem; } .fit-results th { font-size: 0.65rem; letter-spacing: 0.02em; } }
.fit-ex-row { cursor: default; }
/* Training waiver and indemnity text (apply page + indemnity page): scrolls in its own box */
.waiver-text { max-height: 55vh; overflow-y: auto; padding: 0.75rem 1rem; margin: 0.5rem 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--dark); font-size: 0.9rem; line-height: 1.45; }
.waiver-text p { margin: 0 0 0.6rem; }
.waiver-text ol { margin: 0 0 0.6rem; padding-left: 1.6rem; }
.waiver-text li { margin-bottom: 0.35rem; }
/* Finger signature box: white like paper, no page scrolling while drawing */
.sig-box { margin: 0.5rem 0; }
.sig-box .row { align-items: center; margin-bottom: 0.3rem; }
.sig-pad { display: block; width: 100%; height: 170px; background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
/* Fitness roster Indemnity column: signed the waiver (white tick) or not (red cross) */
.fit-waiver { font-weight: 800; font-size: 1.1rem; }
.fit-waiver.ok { color: #fff; }
.fit-waiver.no { color: var(--red); }
/* fitness opening page: exercise | pass score | On/Off */
.fit-ex-row .fit-pass { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.fit-ex-row .fit-pass input[type=text] { width: 5.5rem; font-size: 1rem; padding: 0.35rem; }
.fit-std-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.4rem; margin: 0.5rem 0; }
.fit-std-list > div { display: flex; flex-direction: column; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.85rem; }
.fit-std-list span { color: var(--muted-light); }
/* Shooting test page (phone). */
.sh-who { display: flex; flex-direction: column; gap: 0.75rem; }
.sh-big { font: 700 1.6rem/1 'Barlow Condensed', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; padding: 1.4rem 1rem; border-radius: var(--radius); border: 0; cursor: pointer; }
.sh-big.staff { background: #fece1e; color: #000; }
.sh-big.recruit { background: #1f6fd1; color: #fff; }
.sh-guns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sh-chip { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; opacity: 0.6; }
.sh-chip.on { opacity: 1; border-color: var(--green); }
.sh-chip input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--green); }
.sh-row { flex-wrap: wrap; cursor: default; }
.sh-num { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; }
.sh-doc { flex: none; background: none; border: 0; padding: 0.2rem; cursor: pointer; }
.sh-doc.off { opacity: 0.3; filter: grayscale(1); cursor: default; }
.sh-who-top { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin: -0.25rem 0 0.75rem; padding: 0.6rem 0.75rem; background: #fece1e; color: #000; border-radius: var(--radius); font-size: 1.15rem; }
.sh-photo { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.sh-photo img { max-width: 100%; max-height: 80vh; }
.sh-photo.hidden { display: none; }
/* Dashboard Shooting tab (shooting-tab.js): add-a-roster form and roster cards */
.st-add { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-top: 0.75rem; }
.st-add label { margin: 0; }
.st-add label.grow { flex: 1; min-width: 12rem; }
#st-body .sh-row .grow { flex: 1; min-width: 9rem; }
#st-body .sh-row select { width: auto; max-width: 16rem; }
.st-past { opacity: 0.7; }
/* Roster cards side by side (soonest first), scrolling left to right */
.st-rosters { display: flex; gap: 1rem; overflow-x: auto; margin-top: 0.5rem; padding-bottom: 0.5rem; scroll-snap-type: x proximity; }
.st-rosters > .card { flex: 0 0 47rem; max-width: calc(100vw - 3rem); scroll-snap-align: start; }
/* One line per person: name + number, firearm ticks, Move to, Remove */
.st-people { gap: 0.25rem; }
.st-people .sh-row { flex-wrap: nowrap; gap: 0.4rem; padding: 0.3rem 0.5rem; align-items: center; }
.st-people .sh-row .grow { display: block; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-people .sh-row .grow > b, .st-people .sh-row .grow > .small { display: inline; }
.st-people .sh-row .grow > .small { margin-left: 0.4rem; }
.st-people .sh-guns { flex: none; flex-wrap: nowrap; gap: 0.25rem; }
.st-people .sh-chip { padding: 0.15rem 0.45rem; font-size: 0.85rem; }
.st-people select { flex: none; width: 7.5rem; padding: 0.2rem 0.3rem; font-size: 0.85rem; }
.st-people .btn.small { flex: none; padding: 0.2rem 0.5rem; }
.st-flash { animation: st-flash 1.6s ease-out; }
@keyframes st-flash { 0%, 40% { box-shadow: 0 0 0 3px #f2c230; } 100% { box-shadow: 0 0 0 3px transparent; } }
.st-toggle { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; width: 100%; }
.st-wait { max-height: 22rem; overflow-y: auto; }
/* Fitness tab: the whole staff list in its own scrolling box */
/* snug: the box is only as wide as its columns need (no big gaps), never wider than the page */
/* Fix 14 (10 Nov): "No rosters coming up" across the full width (Shooting and Fitness tabs). */
.st-rosters > .card.muted { flex: 1 1 100%; width: auto; max-width: none; }
/* Fix 13 (10 Nov): the Fitness tab's staff table (and its scrollbar) across the full card width. */
.ft-staff { max-height: 26rem; width: 100%; max-width: 100%; }
.ft-staff table { width: 100%; }
.ft-staff td, .ft-staff th { white-space: nowrap; padding-left: 0.5rem; padding-right: 0.5rem; }
#ft-body .ft-staff select { width: 12rem; }
/* Billable items: the delete password bar and archived lines (billing.js, 65-billing-archive.sql), 12 Nov 2026. */
.bl-lock { margin-bottom: 1rem; border-left: 3px solid var(--line); }
.bl-lock.open { border-left-color: #ff5c4a; }
.bl-lock input[type=password] { padding: 0.45rem 0.6rem; }
#bl-table tr.bl-archived td { opacity: 0.55; }
#bl-table tr.bl-archived td:last-child { opacity: 1; }
/* Record evidence (evidence.html, evidence-view.js), 12 Nov 2026: thumbnails of the pictures / PDFs, and the viewer. */
.ev-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.ev-file { display: flex; flex-direction: column; gap: 0.35rem; background: var(--black); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; color: var(--cream); text-decoration: none; min-width: 0; }
.ev-file img, .ev-file .ev-pdf { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: #111; }
.ev-file .ev-pdf { display: flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: 0.05em; color: #fff; background: #c0392b; }
.ev-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ev-file:hover, a.ev-file:focus-visible { border-color: var(--cream); outline: none; }
.ev-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.75); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.ev-modal-in { width: 100%; max-width: 900px; margin: 0; }
/* Fitness tab: click a tested person's line to open their earlier tests under it (12 Nov 2026). */
.ft-staff tr.ft-row { cursor: pointer; }
.ft-staff tr.ft-row:hover td { background: rgba(255,255,255,0.03); }
.ft-staff tr.ft-open td { background: rgba(255,255,255,0.05); border-bottom-color: transparent; }
.ft-caret { display: inline-block; width: 0; height: 0; margin-right: 0.45rem; vertical-align: middle; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform 0.15s; }
.ft-open .ft-caret { transform: rotate(90deg); border-left-color: var(--cream); }
.ft-staff tr.ft-hist > td { background: var(--black); padding: 0.6rem 0.75rem 0.9rem; white-space: normal; }
.ft-hist-box .tablewrap { max-width: 100%; overflow-x: auto; }
.ft-staff .ft-hist-table th { position: static; background: transparent; }
.ft-staff .ft-hist-table td { font-size: 0.85rem; white-space: nowrap; }
.ft-staff .ft-hist-table td.ft-vit div { line-height: 1.35; }
.ft-staff .ft-hist-table td.ft-note { white-space: normal; min-width: 10rem; max-width: 18rem; }
#ft-body th[data-ft-sort] { cursor: pointer; user-select: none; }
#ft-body th[data-ft-sort]:hover { color: var(--white); }
#ft-body th[data-sorted="asc"]::after { content: " ▲"; color: var(--red); }
#ft-body th[data-sorted="desc"]::after { content: " ▼"; color: var(--red); }
/* Add a roster: date box the same height as the name box (so the labels line up), a short name box, buttons right beside it */
#ft-add input[type=date] { background: var(--black); color: var(--white); color-scheme: dark; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.8rem; font: inherit; font-size: 16px; }
#ft-add #ft-name { width: 10rem; }
#ft-add #ft-who { width: auto; }
/* One line: Add a roster on the left, the search on the right (wraps under it on a narrow screen) */
.ft-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.5rem; margin-top: 0.75rem; }
.ft-bar .st-add { margin-top: 0; }
.ft-find { margin-left: auto; }
.ft-find #ft-find-person { width: 10rem; }
#ft-add input[type=date], #ft-add #ft-name, #ft-add #ft-who, .ft-find #ft-find-person { height: 3rem; box-sizing: border-box; }
.ft-found { width: max-content; max-width: 100%; margin-left: auto; }
/* Fitness roster cards: only as wide as the names + Move / Remove need, so no big gap in the middle */
#ft-body .st-rosters > .card { flex: 0 0 auto; width: max-content; min-width: 24rem; max-width: calc(100vw - 3rem); }
#ft-body .st-people .sh-row .grow { flex: 1 1 auto; min-width: 0; }
.st-wait td, .st-wait th { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.st-wait th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.st-wait select { padding: 0.25rem 0.4rem; font-size: 0.9rem; }
/* Knowledge Test: the heading on the left, the pass score window at the top right. */
.kt-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.kt-head > div:first-child { flex: 1; min-width: 16rem; }
.kt-pass { margin: 0; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius); background: var(--dark); padding: 0.6rem 0.8rem; }
.kt-pass-t { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--muted-light); margin-bottom: 0.35rem; }
.kt-pass-row { display: flex; align-items: center; gap: 0.4rem; }
.kt-pass-v { font-family: "Bebas Neue", sans-serif; font-size: 2.2rem; line-height: 1; color: var(--white); text-align: center; }
.kt-pass { min-width: 7.5rem; text-align: center; }
.kt-pass input { width: 4.5rem; font-size: 1.4rem; font-weight: 700; text-align: center; padding: 0.2rem 0.3rem; }
.kt-pass-row span { font-size: 1.2rem; font-weight: 700; margin-right: 0.4rem; }
.kt-pass .msg { margin: 0.4rem 0 0; padding: 0.35rem 0.5rem; font-size: 0.8rem; }
/* Number of recruits next to the Recruits heading. */
.rr-count { margin-left: 0.35rem; color: var(--white); font: inherit; }
/* A recruit's page: name and details stay just under the header bar while scrolling. */
.rr-head { position: sticky; top: var(--topbar-h, 4.6rem); z-index: 3; background: var(--panel); margin: -1.25rem -1.25rem 0; padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
@media (max-width: 600px) { .rr-head { margin: -1rem -1rem 0; padding: 1rem 1rem 0.75rem; } }
/* A recruit's details on their activity log page: one per line, label then value. */
.rr-facts { font-size: 0.92rem; line-height: 1.6; }
.rr-facts span:first-child { display: inline-block; width: 4.5rem; color: var(--muted-light); }
/* A recruit's page: the process as boxes joined by arrows (wraps onto more lines rather than scrolling sideways). */
.rr-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.3rem; margin-top: 1rem; }
.rr-flow-box { display: flex; flex-direction: column; justify-content: center; min-width: 6.5rem; padding: 0.45rem 0.6rem; text-align: center;
  border: 1px solid var(--green); border-radius: var(--radius); background: rgba(63,143,90,0.12); line-height: 1.25; }
.rr-flow-t { font-size: 0.72rem; color: var(--muted-light); }
.rr-flow-v { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.rr-flow-box.now { border: 2px solid #f2c230; background: rgba(242,194,48,0.1); }
.rr-flow-box.failed { border-color: var(--red); background: rgba(192,57,43,0.15); }
.rr-flow-box.failed .rr-flow-v { color: #e5675a; }
.rr-flow-box.todo { border-color: var(--line); background: transparent; opacity: 0.45; }
.rr-flow-box.todo .rr-flow-v { font-weight: 400; color: var(--muted); }
.rr-flow-arrow { color: var(--muted-light); font-size: 1rem; }
.rr-flow-docs { display: flex; align-items: flex-end; gap: 0.55rem; padding: 0.2rem 0.1rem; }
.rr-doc-ic { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.rr-doc-ic svg { height: 1.7rem; width: 2.3rem; display: block; }   /* same slot for every icon; long guns shrink to fit */
.rr-doc-ic > span { font-size: 0.65rem; color: var(--muted-light); }
button.rr-doc-ic { background: none; border: 0; padding: 0.15rem; margin: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 4px; }
button.rr-doc-ic:hover { background: rgba(255,255,255,0.08); }
button.rr-doc-ic:focus-visible { outline: 2px solid #f2c230; }
.rr-flow-box.info { border-color: var(--muted-light); background: transparent; text-decoration: none; }
a.rr-flow-box.info:hover { border-color: #f2c230; }
.rc-doc-flash { outline: 2px solid #f2c230; transition: outline-color 1.5s; }
/* Documents list → Details: the recruit's documents as a table under their line (it wraps rather than scrolling sideways). */
.rc-dd-row > td { white-space: normal; background: var(--dark); padding: 0.6rem 0.75rem 0.9rem; }
.rc-dd-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.85rem; margin-bottom: 0.5rem; }
.rc-dd-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.sec-table .rc-dd-table th, .sec-table .rc-dd-table td,
.sec-table.ppl .rc-dd-table th, .sec-table.ppl .rc-dd-table td { display: table-cell; position: static; white-space: normal; vertical-align: top; padding: 0.4rem 0.5rem; text-align: left; border-bottom: 1px solid var(--line); }
.rc-dd-table th { font-size: 0.7rem; color: var(--muted-light); background: transparent; }
.rc-dd-table td:first-child { white-space: nowrap; }
.rc-dd-photos { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.rc-thumb.rc-thumb-sm { width: 3.6rem; padding: 0; }
.rc-thumb.rc-thumb-sm img { width: 3.6rem; height: 2.5rem; object-fit: cover; display: block; }
/* Find a recruit: at the bottom right of the boxes, with the matches dropping down under it. */
.rr-find { position: relative; margin-left: auto; display: flex; gap: 0.35rem; align-items: center; }
.rr-find input { width: 13rem; padding: 0.4rem 0.55rem; font-size: 0.9rem; }
.rr-find-list { position: absolute; right: 0; top: calc(100% + 0.3rem); z-index: 40; width: 20rem; max-width: 90vw; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.5); padding: 0.25rem; }
.rr-find-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; color: var(--white);
  font: inherit; padding: 0.4rem 0.55rem; border-radius: 4px; cursor: pointer; }
.rr-find-item:hover, .rr-find-item:focus-visible { background: rgba(255,255,255,0.08); outline: none; }
.rr-find-more { padding: 0.4rem 0.55rem; }
/* Not loaded: the icon (and its label) turns plain grey. */
.rr-doc-ic.missing { opacity: 0.4; filter: grayscale(1) brightness(0.8); }
/* Shooting step: small competency icons in one row, and the wide table squeezed so it fits without sideways scroll */
#sched-table .rr-flow-docs { gap: 0.15rem; justify-content: center; }
#sched-table .rr-doc-ic svg { height: 1.1rem; width: 1.6rem; }
#sched-table th, #sched-table td { padding-left: 0.3rem; padding-right: 0.3rem; }
#sched-table .btn.small { white-space: normal; line-height: 1.15; }
.rr-log td { font-size: 0.88rem; }
.rr-log td:nth-child(3) { min-width: 18rem; max-width: 40rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted-light); text-decoration: underline; cursor: pointer; font: inherit; }
/* How many recruits at each step: white, same font as the step's name, right-aligned in one column. */
.rc-step-count { flex: none; width: 2rem; text-align: right; font: inherit; color: var(--white); font-variant-numeric: tabular-nums; }
.rc-stage-n { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--red); color: #fff; font-size: 0.7rem; margin-right: 0.2rem; }
.rc-step-badge { flex: none; min-width: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--amber); color: #000; font-size: 0.72rem; text-align: center; line-height: 1.3rem; }
/* Narrower screens: the steps go across the top (wrapping onto more lines, never scrolling sideways),
   so the tables get the full width. */
@media (max-width: 1300px) {
  .rc-layout { grid-template-columns: 1fr; }
  .rc-steps { position: static; display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem; }
  .rc-steps-title { display: none; }
  .rc-step { flex: none; width: auto; white-space: nowrap; padding: 0.35rem 0.5rem; }
  .rc-step::after { display: none; }
  .rc-step-all, .rc-step-sub { margin: 0; border: 0; padding: 0.35rem 0.5rem; }
  .rc-step-count { width: auto; margin-left: 0.25rem; }
}
.rc-link { font-size: 0.85rem; background: var(--black); border: 1px solid var(--line); border-radius: 4px; padding: 0.35rem 0.6rem; word-break: break-all; }
.doc-mark { font-size: 1.15rem; font-weight: 700; line-height: 1; }
/* Sign-off has the most columns: a little tighter so it fits without scrolling sideways. */
.so-table { font-size: 0.82rem; width: 100%; }
.so-table th, .so-table td { padding-left: 0.32rem; padding-right: 0.32rem; }
.so-table .sec-split { padding-left: 0.55rem; }
.so-table .btn.small { padding: 0.28rem 0.5rem; font-size: 0.72rem; }
.so-table th { font-size: 0.66rem; }
.so-table th, .so-table td { vertical-align: middle; }
.so-table .so-place { font-weight: 700; color: #f2c230; }
/* Admin: recruitment performance table (totals | gap | percentages). */
.ad-table td, .ad-table th { white-space: nowrap; }
.ad-table .ad-gap { width: 1.5rem; padding: 0; border: 0; background: transparent; }
.ad-table .ad-head { font-size: 0.85rem; color: #f2c230; }
.ad-table tr.ad-sec th { padding-top: 1.1rem; text-align: left; font-size: 0.8rem; color: var(--white); border-bottom: 1px solid var(--line); position: static; }
.ad-table tr.ad-sec th.ad-note { font-weight: 400; color: var(--muted-light); text-transform: none; letter-spacing: 0; white-space: normal; }
.rc-step-admin { margin-top: 0.6rem; border-top: 1px solid var(--line); }
/* Rank recruits: the button and the "Ranked by" line above the Sign-off table, and the section that opens under it. */
.so-rankbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin-top: 0.75rem; }
.so-rank-item { white-space: nowrap; }
.btn.so-rank-btn { background: var(--green); border-color: var(--green); color: #000; }
.btn.so-rank-btn:hover { background: #4ba86a; border-color: #4ba86a; color: #000; }
.btn.so-clear-btn { background: var(--red); border-color: var(--red); color: #fff; }
.btn.so-clear-btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.so-rank-item b { color: #f2c230; }
.so-rankpanel { margin-top: 0.6rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--dark); }
.rank-table { border-collapse: collapse; width: auto; }
.rank-table th, .rank-table td { padding: 0.3rem 0.75rem 0.3rem 0; vertical-align: middle; border: 0; text-align: left; position: static; background: none; }
.rank-table th { white-space: nowrap; font-size: 0.85rem; color: var(--muted-light); }
.rank-table select { min-width: 12rem; }
.rank-picks { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-right: 0.5rem; }
.rank-pick { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.9rem; cursor: pointer; text-transform: none; letter-spacing: 0; }
.doc-ok, .docs-part { color: var(--white); }
.docs-full { color: #f2c230; font-weight: 700; }
.rc-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.rc-stats .stat { text-align: center; }
.rc-contact { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1.5rem; }
.rc-kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.rc-kv span { color: var(--muted-light); }
.rc-kv b { font-weight: 500; text-align: right; }
.rc-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 1rem; align-items: start; }
.rc-photos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.rc-thumb { background: var(--black); border: 1px solid var(--line); border-radius: 4px; padding: 0.25rem; cursor: zoom-in; color: var(--muted-light); font: inherit; font-size: 0.75rem; }
.rc-thumb img { display: block; width: 130px; height: 90px; object-fit: cover; border-radius: 3px; margin-bottom: 0.2rem; background: #222; }
.rc-thumb:hover { border-color: var(--muted); }
.rc-fix textarea { width: 100%; min-height: 4rem; margin: 0.5rem 0; }
.rc-jobs { font-size: 0.8rem; margin-top: 0.5rem; }
.rc-lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; cursor: zoom-out; }
.rc-lightbox img { max-width: 100%; max-height: 88vh; border-radius: 4px; }
.rc-lightbox p { color: var(--muted-light); font-size: 0.8rem; }
@media (max-width: 600px) { .rc-docs { grid-template-columns: 1fr; } }

/* Compliance tab: boxes for expired / 30 / 60 / 90 days, the list with a coloured date per document or test, and a side panel */
.cp-boxes { display: grid; gap: 0.75rem; grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cp-boxes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cp-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cp-box.on { border-left-color: var(--white); background: #1d1d1d; outline: 1px solid var(--muted); }
.cp-table { font-size: 0.82rem; }
.cp-table td { vertical-align: middle; }
.cp-cell { padding: 0.25rem 0.3rem !important; }
.cp-cellbtn { background: none; border: 0; padding: 0.15rem 0.2rem; font: inherit; color: inherit; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem; border-radius: 4px; }
.cp-cellbtn:hover { background: #222; }
.cp-dim { opacity: 0.35; }
.cp-d { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-expired { background: #7a1f16; color: #fff; }
.cp-d30 { background: #b8442f; color: #fff; }
.cp-d60 { background: #c98a1b; color: #000; }
.cp-d90 { background: #e8d27a; color: #000; }
.cp-ok { color: #5fc27e; }
.cp-none { color: var(--muted-light); }
.cp-expired-t, .cp-d30-t { color: #ff5c4a; font-weight: 500; }
.cp-d60-t, .cp-d90-t { color: #f0a030; font-weight: 500; }
.cp-ok-t { color: #5fc27e; }
.cp-chip { display: inline-block; font-size: 0.68rem; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 0.35rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.cp-missing, .cp-fix { color: #f2c6c0; border-color: var(--red); }
.cp-check { color: #f3d9a6; border-color: var(--amber); }
.cp-key { display: inline-flex; gap: 0.3rem; margin-left: 0.5rem; flex-wrap: wrap; vertical-align: middle; }
.cp-key .cp-d { font-size: 0.72rem; }
/* Expiry by month: clickable lines, and the month headings in the list they open */
.cp-xrow { cursor: pointer; }
.cp-xrow:hover td, .cp-xrow.on td { background: rgba(255, 255, 255, 0.06); }
.cp-xhead { cursor: pointer; }
.cp-xhead a { color: inherit; }
.cp-xhead:hover, .cp-xhead.on { background: rgba(255, 255, 255, 0.06); }
.cp-xgroup { background: rgba(255, 255, 255, 0.04); padding-top: 0.7rem; }
/* Compliance list: the "Show" tick boxes in a bar above the table (coloured like the cells), and tick-box dropdown filters */
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; align-items: start; }
.cp-layout .cp-table th, .cp-layout .cp-table td { padding-left: 0.3rem; padding-right: 0.3rem; }
.cp-layout .cp-table .cp-cellbtn { padding: 0.15rem 0.05rem; }
.cp-layout .cp-table .cp-d { font-size: 0.8rem; padding: 0.05rem 0.25rem; }
.cp-side-h { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--muted-light); }
.cp-showbar { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; align-items: center; margin-top: 0.75rem; padding: 0.5rem 0.7rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.cp-showopt { display: flex; gap: 0.35rem; align-items: center; margin: 0; cursor: pointer; font-size: 0.85rem; }
.cp-multi-wrap { min-width: 9rem; }
/* Fix 12 (10 Nov): the Compliance list's dropdown labels in the same style as every other label (small capitals),
   and their boxes the same height as the other filter boxes, so Reset filters lines up with them. */
.cp-multi-wrap > span.l { display: block; font-size: 0.8rem; color: var(--muted-light); margin-bottom: 0.3rem;
  font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; }
.cp-multi summary { min-height: 3rem; display: flex; align-items: center; font-size: 16px; }
#cp-clear { margin-bottom: 0.15rem; align-self: flex-end; }
/* Fix 10 (10 Nov): Waiting for check: the count at the right edge of its bar. */
#cp-waiting .card-toggle h3.split > span:last-child { text-align: right; }
.cp-multi { position: relative; }
.cp-multi summary { cursor: pointer; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); list-style: none; font-size: 0.9rem; }
.cp-multi summary::after { content: " ▾"; color: var(--muted-light); }
.cp-multi-list { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 14rem; max-height: 18rem; overflow: auto; margin-top: 2px; padding: 0.3rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.cp-multi-list label { display: flex; gap: 0.5rem; align-items: center; margin: 0; padding: 0.35rem 0.5rem; cursor: pointer; font-size: 0.85rem; }
.cp-multi-list label:hover { background: rgba(255, 255, 255, 0.06); }
.cp-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--amber); border-radius: var(--radius); background: rgba(201,138,27,0.08); }
.cp-drawer-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.6); display: flex; justify-content: flex-end; }
.cp-drawer { width: min(34rem, 100%); height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 1.25rem; }
.cp-drawer .rc-photos { margin: 0.75rem 0; }
.cp-upload { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.cp-upload summary { cursor: pointer; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; }
body.cp-noscroll { overflow: hidden; }
.cp-set td { vertical-align: middle; }

@media (max-width: 600px) {
  h1 { font-size: 1.8rem; }
  .wrap { padding: 1rem 0.85rem 3rem; }
  .card { padding: 1rem; }
  .hide-sm { display: none; }
}

/* ---------- Driver assessment (drive.html): the paper form on a tablet turned sideways ---------- */
.dv-wide { padding-left: 0.6rem; padding-right: 0.6rem; }
.dv-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 0.75rem; }
.dv-head { position: sticky; top: 4.2rem; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding: 0.55rem 0.75rem; margin-bottom: 0.6rem;
  background: var(--dark); border: 1px solid var(--line); border-radius: var(--radius); }
.dv-head > div:first-child { display: flex; flex-direction: column; line-height: 1.2; }
.dv-clock { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.dv-clock b { font-family: "Bebas Neue", sans-serif; font-size: 1.9rem; font-weight: 400; color: var(--white); font-variant-numeric: tabular-nums; }
/* Rows of four cells: headings side by side line up; each column is only as wide as its longest item,
   so the − number + buttons sit right after the words and line up down the column. */
.dv-grid { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 0.6rem; align-items: start; }
.dv-col { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.dv-span { grid-column: 3 / span 2; }
.dv-sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.dv-sh { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0.55rem; background: var(--cream); color: #000;
  font-family: "Barlow Condensed", sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }
.dv-sh span + span { font-size: 0.72rem; align-self: center; }
.dv-sh b { font-size: 1rem; line-height: 1.2; min-width: 1.9rem; text-align: center; font-variant-numeric: tabular-nums; }   /* the card's total demerit points */
.dv-sh b.on, .dv-light .dv-sh b.on { color: #ff6b5b; }
.dv-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.12rem 0.3rem 0.12rem 0.55rem; border-bottom: 1px solid var(--line); min-height: 2.35rem; }
.dv-w { flex: none; width: 1.3rem; text-align: right; color: var(--muted-light); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.dv-l { flex: 1; min-width: 0; font-size: 0.86rem; line-height: 1.15; }
.dv-ctr { flex: none; display: flex; align-items: center; }
.dv-ctr button { width: 2.1rem; height: 2.1rem; border: 1px solid var(--line); background: var(--dark); color: var(--cream); border-radius: var(--radius);
  font-size: 1.2rem; line-height: 1; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.dv-ctr button:active { background: var(--line); }
.dv-ctr button[data-dv-plus] { border-color: var(--red); }
.dv-ctr button:disabled { opacity: 0.3; cursor: default; }
.dv-ctr b { width: 1.9rem; text-align: center; font-size: 1.05rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dv-ctr b.on, .dv-tot b.on { color: #ff6b5b; }
.dv-tot { display: flex; justify-content: space-between; padding: 0.3rem 0.55rem; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }
.dv-tot b { font-size: 1.05rem; color: var(--muted); padding-right: 0.95rem; }
.dv-sec .dv-com { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0.35rem 0.55rem; font-size: 0.85rem; margin: 0; resize: none; min-height: 2.1rem; }
/* A section whose comment box stretches down to the next heading (Mirrors). */
.dv-fill { align-self: stretch; }
.dv-fill > .dv-sec { flex: 1; display: flex; flex-direction: column; }
.dv-fill .dv-com { flex: 1; }
.dv-sec textarea { width: 100%; border: 0; border-radius: 0; background: transparent; margin: 0; padding: 0.5rem 0.6rem; font-size: 0.9rem; resize: vertical; }
.dv-stop { display: grid; grid-template-columns: 1fr 1fr; }
.dv-stop textarea { border-left: 1px solid var(--line); }
.dv-check { display: flex; align-items: center; gap: 0.55rem; margin: 0; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.88rem; cursor: pointer; }
.dv-check input { width: 1.3rem; height: 1.3rem; accent-color: var(--red); flex: none; }
/* Immediate cessation of session: red, so it stands out. */
.dv-stopsec { background: var(--red-dark); border-color: var(--red); }
.dv-stopsec .dv-check, .dv-stopsec .dv-stop textarea { border-color: var(--red); color: #fff; }
.dv-stopsec textarea::placeholder { color: #f2c6c0; }
.dv-stopsec .dv-check input { accent-color: var(--black); }
/* PDF icon in a table row (test-report.js): opens the PDF of that test. */
.pdf-btn { background: none; border: 0; padding: 0.15rem; cursor: pointer; line-height: 0; border-radius: 4px; }
/* Fix 18 (10 Nov): the Google Drive icon's place is kept even when there's no Drive copy, so the PDF icon sits in the same
   spot on every row. */
.drive-slot { display: inline-block; width: calc(20px + 0.35rem + 0.3rem); vertical-align: middle; text-align: left; }
/* Fix 16 (10 Nov): the Recruitment step menu keeps every step on one line, so the counts stay lined up. */
.rc-step-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-step[data-rc-step="character"] .rc-step-t { font-size: 0.9em; letter-spacing: -0.01em; }
/* Fix 22 (10 Nov): "Loading…" centred while a page gets ready, instead of in the top-left corner. */
#loading { text-align: center; padding: 2rem 0; }
.pdf-btn:hover, .pdf-btn:focus-visible { background: rgba(192,57,43,0.18); outline: none; }
/* Daylight look for the whole driver assessment page (used outside in the sun): white page, black text and lines. */
html.dv-light { --black: #fff; --dark: #fff; --panel: #fff; --line: #000; --cream: #000; --white: #000; --muted: #444; --muted-light: #333; color-scheme: light; }
.dv-light .dv-sh { color: #fff; }
.dv-light .dv-ctr b, .dv-light .dv-tot b { color: #000; }
.dv-light .dv-ctr b.on, .dv-light .dv-tot b.on { color: var(--red); }
.dv-light .dv-ctr button:active { background: #ddd; }
/* Buttons black, not red (Start Test, Finish & save, Save, Next driver, the + buttons…). */
.dv-light .btn.primary { background: #000; border-color: #000; color: #fff; }
.dv-light .btn.primary:hover { background: #333; border-color: #333; }
.dv-light .dv-ctr button[data-dv-plus] { border-color: #000; }
/* Result page: Driver Report options in a row (wrapping on narrow screens); the chosen one is filled with its colour (--c). */
.dv-rep { margin-top: 0.85rem; }
.dv-rep > .l { font-weight: 700; }
/* Final Decision: big and bold, on the result page and the Saved screen. */
.dv-rep.dv-final > .l { font-size: 1.5rem; font-weight: 800; }
.dv-rep.dv-final .dv-opt { font-size: 1.1rem; font-weight: 700; padding: 0.9rem 0.5rem; }
.dv-dec { display: inline-block; padding: 0.1rem 0.55rem; border-radius: var(--radius); background: var(--c); color: #fff; font-weight: 700; white-space: nowrap; }
/* Saved page: result and risk as plain black text, no bubbles. */
.dv-saved .fit-std-list .pill { border: 0; padding: 0; border-radius: 0; color: #000; font: inherit; text-transform: none; letter-spacing: normal; }
.dv-saved .fit-std-list [class*="txt-"] { color: #000; }
.fit-std-list .dv-final { grid-column: 1 / -1; align-items: center; text-align: center; background: var(--c, #fff); border-color: var(--c, #000); }   /* its own line, full width, filled with the decision's colour */
.fit-std-list .dv-final span, .fit-std-list .dv-final b { color: #fff; }
.fit-std-list .dv-final span { font-size: 1.1rem; font-weight: 800; }
.fit-std-list .dv-final b { font-size: 1.5rem; font-weight: 800; }
.dv-opts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.dv-opt { flex: 1 1 7.5rem; padding: 0.75rem 0.5rem; border: 1px solid #000; border-radius: var(--radius); background: #fff; color: #000; font: inherit; font-size: 0.95rem; cursor: pointer; }
.dv-opt.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.dv-opt:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
/* Warnings on the driver pages (e.g. a Driver Report question missed): red background, black text. */
.dv-light .msg.err { background: #e5533f; border-color: #000; color: #000; font-weight: 600; }
.dv-light .msg.ok { background: #e6f4ea; border-color: #2e8b57; color: #000; }
/* First screen: Staff Member (yellow) or Recruit (blue), black text; the chosen one gets a thick black edge and a tick. */
.dv-kinds { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.dv-kind { flex: 1 1 10rem; padding: 1.1rem 0.75rem; border: 2px solid transparent; border-radius: var(--radius); color: #000; font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.dv-kind.staff { background: #f5c518; }
.dv-kind.recruit { background: #5aa9f0; }
.dv-kind.training { background: #7ccf8a; }
.dv-day { border-top: 1px solid var(--line); padding: 0.6rem 0 0.4rem; }
.dv-day > h4 { margin: 0 0 0.35rem; font-size: 1rem; }
.dv-entry { margin: 0 0 0.5rem; padding: 0.5rem 0.6rem; border-left: 4px solid #999; background: color-mix(in srgb, #999 8%, #fff); border-radius: 4px; }
.dv-entry.note { border-left-color: #2e8b57; background: color-mix(in srgb, #2e8b57 8%, #fff); }
.dv-entry .note-text { white-space: pre-wrap; margin-top: 0.2rem; }
.dv-kind.on { border: 4px solid #000; }
.dv-kind.on::before { content: "✓ "; }
.dv-kind:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
/* "Continue test": add or leave out the time spent on the result page. */
.dv-ask { border: 2px solid #000; border-radius: var(--radius); padding: 0.75rem 0.85rem; margin-bottom: 1rem; }
.dv-light input:focus, .dv-light select:focus, .dv-light textarea:focus { outline-color: #000; border-color: #000; }
.dv-light .dv-ctr button:disabled { opacity: 0.25; }
.dv-light textarea::placeholder, .dv-light input::placeholder { color: #777; }
/* Immediate cessation of session: red heading bar and outline, white rows with black text. */
.dv-light .dv-stopsec { background: #fff; border-color: var(--red); }
.dv-light .dv-stopsec .dv-sh { background: var(--red); color: #fff; }
.dv-light .dv-stopsec .dv-check, .dv-light .dv-stopsec .dv-stop textarea { border-color: var(--red); color: #000; }
.dv-light .dv-stopsec .dv-check input { accent-color: var(--red); }
/* Smaller screens: two columns, then one. */
@media (max-width: 1100px) { .dv-grid { grid-template-columns: repeat(2, auto); } .dv-gap { display: none; } .dv-grid > .dv-col { grid-row: auto !important; } .dv-span { grid-column: 1 / -1; } }
@media (max-width: 640px) { .dv-grid, .dv-stop { grid-template-columns: 1fr; } .dv-head { top: 3.6rem; } }
/* Individual page → Full history: a driver assessment's comments, on their own line under it. */
#iv-history tr.iv-follow td { border-top: 0; padding-top: 0; color: var(--muted-light); }
.iv-drv-com { display: block; }
/* Tests tab: the Driver assessment card stays hidden until driver.js fills it (driver.js isn't on the live site yet). */
.card[data-card="drive"]:has(#drv-test:empty) { display: none; }
/* Admin → Companies: which pages and tests each manager sees. Narrow tick columns so it fits the width. */
.mgr-access { width: 100%; }
.mgr-access th, .mgr-access td { padding: 0.35rem 0.25rem; }
.mgr-access th.small { font-size: 0.68rem; line-height: 1.15; letter-spacing: 0; }
.mgr-access td:first-child { overflow-wrap: anywhere; min-width: 8rem; }

/* ---------- Recruitment steps, minimalist layout (17 Nov 2026) ----------
   Every recruitment table sits on the left (only as wide as it needs), headings and data centred in their columns,
   one row height, lighter dividers, and the step's explanation kept to a readable line length. */
#rc-body .sec-table, #rc-body .so-table { width: auto; }
#rc-body .sec-table th, #rc-body .sec-table td { text-align: center; vertical-align: middle; padding: 0.5rem 0.85rem; }
#rc-body .sec-table th { font-size: 0.7rem; letter-spacing: 0.04em; }
#rc-body .sec-table .sec-split { border-left: 1px solid var(--line); padding-left: 0.85rem; }
#rc-body .sec-table .sec-done, #rc-body .sec-table .sec-mark, #rc-body .sec-table .sec-who { justify-content: center; text-align: center; }
#rc-body .sec-table tr.answers-row td, #rc-body .sec-table tr.rc-month td, #rc-body .sec-table tr.rc-dd-row td { text-align: left; }
#rc-body .so-table th, #rc-body .so-table td { padding-left: 0.5rem; padding-right: 0.5rem; }
#rc-body .card > p.small.muted { max-width: 120ch; line-height: 1.5; }
#rc-body .card > h2 { margin-bottom: 0.4rem !important; }

#rc-body .sec-table .btn.small { white-space: nowrap; }
#rc-body .sec-table.ppl { width: auto; }
/* Documents list: many narrow columns, so tighter spacing to fit without scrolling sideways. */
#rc-body #rc-table th, #rc-body #rc-table td { padding-left: 0.4rem; padding-right: 0.4rem; }
#rc-body #rc-table th:nth-child(5), #rc-body #rc-table td:nth-child(5) { padding-right: 1.2rem; }
/* Invite: date and time boxes on each recruit's row, and the Invitation Calendar's day headings. */
#rc-body .inv-pick input[type=date], #rc-body .inv-pick input[type=time] { width: auto; min-width: 0; padding: 0.35rem 0.5rem; font-size: 0.9rem; }
#rc-body .inv-day { margin: 1.1rem 0 0.35rem; font-size: 0.95rem; letter-spacing: 0.03em; }
#rc-body .inv-day:first-of-type { margin-top: 0.25rem; }
/* Onboarding: narrow columns (headings wrap), each done step on three short lines, short buttons: no sideways scrolling. */
#rc-body .onb-table th { white-space: normal; max-width: 6.5rem; padding-left: 0.45rem; padding-right: 0.45rem; }
#rc-body .onb-table td { padding-left: 0.45rem; padding-right: 0.45rem; }
#rc-body .onb-table td.onb-done span, #rc-body .onb-table td.onb-done input { display: block; line-height: 1.25; font-size: 0.78rem; }
#rc-body .onb-table td.onb-done input { width: 6rem; margin: 0 auto 0.25rem; padding: 0.25rem 0.35rem; }
