/*
 * The admin design: the mockup's structure (fixed sidebar, top bar, stat
 * cards, worker table) in a reference project's palette -- colours only, not
 * its layout or type scale.
 *
 * Rules worth keeping (the design pass of 25 Nov 2026 made every screen one
 * official, square, ruled system, after the subcontractor's pages):
 * - One brand colour, Precise Orange (`--atp-orange`), and it is never text
 *   nor under white text: the 4px strip under the top band, the bar beside
 *   the page you are on, the focus ring.
 * - Primary buttons are `--atp-primary` (one line in :root to swap); second
 *   buttons are outlined 2px in ink. Nothing is rounded, nothing casts a shadow.
 * - Status colours are data semantics only, written as bordered text with a
 *   sign (a lapsed induction is `--atp-danger`), never a filled pill.
 * - Sentence case everywhere; no small capitals.
 * - No webfont is fetched: Inter, then Calibri, then system fonts.
 */

/*
 * `hidden` wins, everywhere. The UA's `[hidden] { display: none }` loses to
 * any author `display`, so a class setting `display` silently showed controls
 * hidden from a role. Global and `!important` so no future class can defeat it
 * (hiddenWins.test.ts holds this).
 */
[hidden] { display: none !important; }

:root {
  /*
   * The one brand colour (Precise Colour Code.pdf): Precise Orange. Never text,
   * never under white text (2.0:1 on white); a strip, a bar, a focus ring, or
   * a fill under black text (9.4:1 against #111).
   */
  --atp-orange: #FFA213;
  /*
   * The primary button, in one line so it can be swapped. Black with white
   * text (18.9:1); the alternative under it is orange with black text (9.4:1).
   */
  --atp-primary: #111111; --atp-primary-ink: #ffffff; --atp-primary-hover: #3a3a3a;
  /* --atp-primary: #FFA213; --atp-primary-ink: #111111; --atp-primary-hover: #ffb84d; */

  /* Controls in ink, not a colour: links, chosen segments, hover. */
  --atp-accent: #111111;
  --atp-accent-dark: #000000;
  --atp-accent-tint: #f1f3f6;

  /* The top band, as on the subcontractor's pages. */
  --atp-band: #1c2430;

  /*
   * Two darks, not interchangeable: `--atp-panel` is a surface (the side
   * panel, a film's backdrop), neutral #171717; `--atp-deep` is a control
   * (buttons, chips, focus rings). Controls turn `--atp-accent` on hover.
   */
  --atp-panel: #171717;
  --atp-panel-mid: #333333;

  --atp-deep: #2d2d2f;
  --atp-deep-tint: #f1f3f6;

  /* Grey ramp, slate (a little blue) so the rail and page belong together. */
  --atp-grey-50: #f6f7f9;
  --atp-grey-100: #f1f5f9;
  --atp-grey-200: #dde2e8;
  --atp-grey-300: #c9d0d8;
  --atp-grey-400: #94a3b8;
  --atp-grey-500: #56606d;
  --atp-grey-700: #334155;
  --atp-grey-900: #171717;

  /* Semantic neutrals */
  --atp-ink: #1e293b;
  --atp-ink-2: var(--atp-grey-700);
  --atp-ink-3: var(--atp-grey-500);
  --atp-ink-4: var(--atp-grey-400);
  --atp-line: var(--atp-grey-200);
  --atp-line-strong: var(--atp-grey-300);
  --atp-surface: #ffffff;
  --atp-surface-alt: #eef1f4;
  --atp-surface-2: var(--atp-grey-100);

  /*
   * Status: semantic only, drawn as bordered text, never a fill. On white:
   * done 6.2:1, waiting 6.8:1, problem 8.3:1. The tints remain for notices.
   */
  --atp-success: #1f6f43;  --atp-success-tint: #eaf4ee;
  /* Waiting (ticket 068, "ink and amber"): its words and figures are ink, its marks Precise Orange,
     its tint a pale orange. Red stays for failures only. */
  --atp-warning: #0a0a0a;  --atp-warning-tint: #fff8eb;
  --atp-warning-mark: #FFA213; --atp-warning-line: #fcd9a0;
  --atp-danger: #991b1b;   --atp-danger-tint: #fbeaeb;
  --atp-info: #0e7490;     --atp-info-tint: #e0f2fe;

  --atp-font-sans: Inter, Calibri, Carlito, Roboto, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --atp-font-mono: 'JetBrains Mono', Consolas, 'SF Mono', Menlo, monospace;

  /* Square and flat: no corners, no shadows (design pass, 25 Nov 2026). */
  --atp-radius-sm: 0;
  --atp-radius-md: 0;
  --atp-shadow-1: none;
  --atp-shadow-2: none;
  --atp-ring: 0 0 0 3px var(--atp-orange);
  --atp-tx: all 180ms cubic-bezier(0.2, 0, 0, 1);

  --bar: 4rem;   /* top bar */
  --rail: 16rem; /* sidebar */
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--atp-surface-alt);
  color: var(--atp-ink);
  font: 16px/1.55 var(--atp-font-sans);
  /* Tabular figures everywhere numbers appear. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Tags and micro caps: 12px, wide tracking, 4px radius. */
.label { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }

/* ---------- the fixed chrome ---------------------------------------------- */

/* Packed from the left, with the identity pushed to the far end (`margin-left: auto`). */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar); z-index: 50;
  display: flex; align-items: center; justify-content: flex-start; gap: 1rem;
  padding: 0 1.5rem; background: var(--atp-surface); border-bottom: 1px solid var(--atp-line);
}
.topbar .bar-right { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
/* The mark, at the height of the bar's other controls. */
.topbar-brand { display: inline-flex; align-items: center; flex: none; }
.topbar-brand img { height: 1.5rem; display: block; }
.topbar .left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.topbar .who { display: flex; align-items: center; gap: 0.75rem; padding-left: 1rem; border-left: 1px solid var(--atp-line); }
.topbar .who .name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.topbar .who .chip {
  width: 2.25rem; height: 2.25rem; background: var(--atp-deep); color: #fff; border-radius: var(--atp-radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}

/* The rail: the dark panel. */
.rail {
  position: fixed; left: 0; top: var(--bar); bottom: 0; width: var(--rail); z-index: 40;
  display: flex; flex-direction: column; background: var(--atp-panel); overflow-y: auto;
  transition: transform 0.2s ease;
}

/*
 * The rail's colour runs the page's full height on a laptop, so a long page
 * (or a picture of one) never shows the rail ending where the window did.
 */
@media (min-width: 48.0625rem) {
  body:has(.rail):not(.rail-collapsed) { background-image: linear-gradient(to right, var(--atp-panel) var(--rail), transparent var(--rail)); }
}

/*
 * Collapsed on a laptop: a body class. Only the rail moves (a transform);
 * `main`'s margin never animates (stage 4, item 10: animating it laid the page
 * out every frame, lagged the rail and let it clip the Dashboard's figures).
 * Opening, the margin is made at once and the rail slides into the empty
 * strip; collapsing, the rail slides out first and the margin goes when the
 * slide ends. The rail's colour down the page follows the same order.
 */
body.rail-collapsed .rail { transform: translateX(-100%); }
body.rail-collapsed main { margin-left: 0; transition: margin-left 0s linear 0.2s; }
@media (min-width: 48.0625rem) {
  body:has(.rail):not(.rail-collapsed) { transition: background-image 0s linear 0.2s; transition-behavior: allow-discrete; }
}

@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
  body.rail-collapsed main, body:has(.rail):not(.rail-collapsed) { transition: none; }
}
/*
 * The menu button is on every width (drawer on a phone, collapse on a laptop);
 * `.navClose` lives in the drawer and is hidden above the breakpoint.
 */
.navToggle { display: inline-flex; }
.navToggle, .navClose {
  align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; flex: none;
  background: transparent; border: 0; border-radius: var(--atp-radius-sm);
  color: var(--atp-ink-2); cursor: pointer;
}
.navToggle:hover { background: var(--atp-surface-2); }
.navClose { display: none; position: absolute; top: 0.5rem; right: 0.5rem; color: #cbd5e1; }
.navClose:hover { background: var(--atp-panel-mid); color: #fff; }
.navToggle:focus-visible, .navClose:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; }

.rail .brand { padding: 20px 16px; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.rail .brand img { height: 2rem; display: block; margin-bottom: 0.5rem; }
.rail .brand p { margin: 0; font-size: 12px; letter-spacing: 0; text-transform: none; color: #94a3b8; }

.rail nav { padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.rail nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  font-size: 13.5px; font-weight: 500; color: #94a3b8; text-decoration: none;
  border-radius: 0; transition: var(--atp-tx);
}
.rail nav a:hover { color: #fff; background: rgb(255 255 255 / 6%); }
/* The reference's active item: a translucent red wash and #f87171 text (5.60:1), no stripe. */
.rail nav a.on { background: rgb(210 38 48 / 20%); color: #f87171; }
.rail nav a svg { width: 20px; height: 20px; flex: none; }

main {
  margin-left: var(--rail); padding: 2rem 2rem 4rem; padding-top: calc(var(--bar) + 2rem);
}
.page { max-width: 78rem; }

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 0.25rem; }
h2 { font-size: 1.125rem; font-weight: 600; margin: 0; }
p.lede { color: var(--atp-ink-2); margin: 0 0 1.75rem; max-width: 48rem; }

/* ---------- cards and statistics ------------------------------------------ */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }

/*
 * Exactly three across or stacked, never two and an orphan (`auto-fit`
 * would). `minmax(0, 1fr)` so three can be narrow. The dashboard's two carry
 * `.headline` and are cut for two, since the id is shared with the import.
 */
#counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 48rem) { #counts { grid-template-columns: 1fr; } }

/*
 * The dashboard's two headline cards: full width, more padding, a larger
 * figure. The id beats the class, so the phone rule names both.
 */
#counts.headline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 48rem) { #counts.headline { grid-template-columns: 1fr; } }
#counts.headline .card > a { padding: 1.25rem; gap: 1rem; }
#counts.headline .card b { font-size: 2rem; }
.card {
  background: var(--atp-surface); border: 1px solid var(--atp-line); border-radius: var(--atp-radius-md);
  box-shadow: var(--atp-shadow-1); display: flex; align-items: flex-start;
}
/* The card's whole surface is the link, so the target is the card. */
.card > a {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem; width: 100%; color: inherit; text-decoration: none; border-radius: inherit;
}
.card > a:hover small, .card > a:focus-visible small { color: var(--atp-ink); }
.card > a:hover { background: var(--atp-grey-50); }
.card > a:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }

/*
 * The explanation mark and the panel it opens. Shut by a class, not `hidden`
 * (which `!important` makes unrevealable by hover). Hovering the card reveals
 * it after a quarter second, so sweeping across cards flashes nothing; leaving
 * is instant.
 */
.card { position: relative; }
.why {
  position: absolute; top: 0.375rem; right: 0.375rem; width: 2rem; height: 2rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 0; cursor: pointer; color: var(--atp-ink-4);
}
.why svg { width: 15px; height: 15px; }
.card:hover .why { color: var(--atp-ink-2); }
.why:hover { color: var(--atp-ink); background: var(--atp-grey-100); }
.why:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 1px; color: var(--atp-ink-2); }

.explain {
  position: absolute; z-index: 5; left: 0.75rem; right: 0.75rem; top: calc(100% - 0.5rem);
  margin: 0; padding: 0.75rem 0.875rem;
  background: var(--atp-ink); color: #ffffff; border-radius: var(--atp-radius-sm);
  box-shadow: none;
  font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}
/* Three ways in: the pointer on the card, keyboard focus on the mark, or a press (touch). */
.card:hover .explain,
.card:focus-within .explain,
.card.explaining .explain {
  opacity: 1; visibility: visible;
  transition: opacity 0.12s ease 0.25s, visibility 0s linear 0.25s;
}
/* Pressed open: no delay, and it stays until pressed again or both pointer and focus leave. */
.card.explaining .explain { transition-delay: 0s; }

@media (max-width: 40rem) {
  /* No pointer to rest, so the mark being pressed is the only way in. */
  .explain { left: 0.5rem; right: 0.5rem; }

  /* A module opened on a phone: the player full width, the title a step smaller. */
  .player, .player.empty { max-width: 100%; }
  .module h2 { font-size: 1.1875rem; }
  .rowshead { padding: 0 1rem; }
}

/* How many people there are, under the cards: a denominator, not something to act on. */
/* Tighter above than below, so the two rows of figures read as one block. */
#rosterLine { margin-top: -0.5rem; }
.card .icon {
  width: 2.25rem; height: 2.25rem; border-radius: var(--atp-radius-sm); flex: none;
  display: flex; align-items: center; justify-content: center;
}
.card .icon svg { width: 20px; height: 20px; }
.card b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.card small { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); display: block; }

/* A card takes a status colour only when its count is above zero. */
.card.alert { border-left: 4px solid var(--atp-danger); }
.card.alert b { color: var(--atp-danger); }
.card.alert .icon { background: var(--atp-danger-tint); color: var(--atp-danger); }
.card.ok .icon { background: var(--atp-success-tint); color: var(--atp-success); }
.card.warn { border-left: 4px solid var(--atp-warning-mark); }
/* Not paid for: amber, waiting, as on the roster (2026-11-24). */
.card.unpaid { border-left: 4px solid var(--atp-warning-mark); }
.card.unpaid b { color: var(--reg-unpaid, var(--atp-warning)); }
.card.unpaid .icon { background: var(--reg-unpaid-tint, var(--atp-warning-tint)); color: var(--reg-unpaid, var(--atp-warning)); }
.card.warn b { color: var(--atp-warning); }
.card.warn .icon { background: var(--atp-warning-tint); color: var(--atp-warning); }
.card.plain .icon { background: var(--atp-surface-2); color: var(--atp-ink-3); }

.panel {
  background: var(--atp-surface); border: 1px solid var(--atp-line); border-radius: var(--atp-radius-md);
  box-shadow: var(--atp-shadow-1); margin-bottom: 1.25rem;
}
.panel > header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--atp-line); }
.panel > .body { padding: 1.25rem; }

/* ---------- controls ------------------------------------------------------ */

/* The Personnel search: wide enough for a name, capped on a laptop. */
.search-field { display: block; max-width: 26rem; margin-bottom: 0.875rem; }

.controls { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.controls span { color: var(--atp-ink-2); font-size: 14px; }

select, input[type="text"], input[type="email"], input[type="password"], textarea {
  font: inherit; padding: 0.5rem 0.75rem; border: 1px solid var(--atp-line-strong);
  background: var(--atp-surface); color: inherit; border-radius: var(--atp-radius-sm);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--atp-accent); box-shadow: var(--atp-ring); }
textarea { width: 100%; min-height: 11rem; font: 14px/1.6 var(--atp-font-mono); resize: vertical; }

/* Primary is solid red, secondary is solid navy, outline is a grey hairline. */
/* The reference's `.btn-primary`: 13.5px/600, sentence case, 9px by 16px, 6px corner, .98 press. */
button {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 16px; border: 2px solid transparent; border-radius: 0;
  background: var(--atp-primary); color: var(--atp-primary-ink); cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
/*
 * Every `button` fills red on hover unless it declares its own hover
 * background -- a hover rule setting only a border still gets this fill. So a
 * button that is not a call to action restates its background (`.moduletile`,
 * `button.jump`, `button.drop`, `button.withdraw`).
 */
button:hover { background: var(--atp-primary-hover); }
button:active { transform: scale(0.98); }
/* A second button: ink on white inside a 2px ink rule. */
button.secondary {
  background: var(--atp-surface); color: var(--atp-ink);
  border: 2px solid var(--atp-ink);
}
button.secondary:hover { background: var(--atp-accent-tint); color: var(--atp-ink); border-color: var(--atp-ink); }
button[disabled] { opacity: 0.4; cursor: not-allowed; }
button[disabled]:hover { background: var(--atp-primary); }
/* A secondary action, lighter than the submit beside it. */
#addRow { font-size: 12px; padding: 0.5rem 0.875rem; }

/* A row of buttons under something, with room above it. */
.actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

legend { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); padding: 0 0.375rem; }

label.choice span { color: var(--atp-ink-2); display: block; margin-left: 1.5rem; font-size: 14px; }

.note { margin: 0.75rem 0 0; font-size: 15px; }
.note.bad { color: var(--atp-danger); }
.note.good { color: var(--atp-success); }
.note.warn { color: var(--atp-warning); }

/* A fact drawn quietly: an absence that is a state, not a problem ("nobody yet"). */
.muted { color: var(--atp-ink-3); }

/* The scale of an import's removals, before the tables naming them: the one danger panel on the screen. */
.removalwarn {
  border: 1px solid var(--atp-danger);
  border-left-width: 4px;
  background: var(--atp-danger-tint);
  border-radius: var(--atp-radius-sm);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}
.removalwarn p { margin: 0 0 0.5rem; color: var(--atp-danger); }
.removalwarn p.lead { font-weight: 700; }
.removalwarn .confirm { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0; font-weight: 600; color: var(--atp-danger); cursor: pointer; }
.removalwarn .confirm input { margin-top: 0.2rem; flex: none; }
.hidden { display: none; }

/*
 * The line under a name saying somebody is inactive and why: their register's
 * word, in danger, with the document and date. A flag, never a state change.
 */
.who .inactive-why { color: var(--atp-danger); font-weight: 600; }

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

/*
 * A shadow at the right edge while there is more to scroll: a shadow layer on
 * the box, covered by a layer on the content as it reaches its end. No script.
 * Right only; the left edge has the sticky first column.
 */
.scroll {
  overflow-x: auto;
  border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-md); box-shadow: var(--atp-shadow-1);
  background:
    linear-gradient(to left, var(--atp-surface) 55%, rgba(255, 255, 255, 0)) right center / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0)) right center / 0.6rem 100% no-repeat scroll,
    var(--atp-surface);
}

/*
 * The import review panels get their own height, so the header can be sticky
 * (`top: 0` needs a box that scrolls vertically; see the `th` note) and stays
 * over the columns of a 1,200-row review. Scoped to the import screen: the
 * workers table wants the page's scroll. The header rule is an inset shadow,
 * because a border on a repositioned cell is dropped.
 */
#problems .scroll,
#details .scroll {
  max-height: min(60vh, 32rem);
  overflow-y: auto;
  /* The horizontal hint would slide away when scrolling vertically. */
  background: var(--atp-surface);
}

/* The editor too, taller, so the controls below it stay on screen with the rows. */
#editorScroll {
  max-height: min(65vh, 36rem);
  overflow-y: auto;
  background: var(--atp-surface);
}

#problems .scroll thead th,
#details .scroll thead th,
#editorScroll thead th {
  position: sticky; top: 0; z-index: 2;
  border-bottom: 0;
  box-shadow: inset 0 -2px 0 var(--atp-accent);
}

/* The row number in the problems table, as a control: styled as the number, underlined. */
button.jump {
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; font-variant-numeric: tabular-nums;
  color: var(--atp-accent); text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}

button.jump:hover { text-decoration-thickness: 2px; background: none; }

/* The row somebody was just sent to: the same paint as a row that failed. */
table.editor tr.bad > td { background: var(--atp-danger-tint); }

/* A row that will save but should be checked: amber, not `bad` (which blocks). */
table.editor tr.warn > td { background: var(--atp-warning-tint); }
table.editor tr.warn > td:first-child { box-shadow: inset 3px 0 0 var(--atp-warning-mark); }

/* A hint that is the thing standing in the way. */
.hint.bad { color: var(--atp-danger); }

/* "or" between the two ways of signing in, so the second reads as an alternative, not a step. */
.gate-or {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1rem 0 0.75rem; color: var(--atp-ink-3);
  font-size: 12px; text-transform: none; letter-spacing: 0;
}
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--atp-line); }

#signInMicrosoft button { width: 100%; }

/* The scroll box's focus ring (scrollRegion.ts makes it a tab stop), keyboard only. */
.scroll:focus-visible {
  outline: 2px solid var(--atp-deep);
  outline-offset: 2px;
}
table { border-collapse: collapse; width: 100%; }

/* Table type: 14px at 1.4, so cells line up as columns. */
th, td {
  text-align: left; padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--atp-line);
  vertical-align: middle; font-size: 14px; line-height: 1.4;
}

/* A rule between columns, not before the first. */
tbody td + td, tbody th + td, thead th + th { border-left: 1px solid var(--atp-line); }

/*
 * A table whose every cell is a link (the programme screen): the anchor fills
 * the cell, underlined on hover only, never coloured.
 */
table.pressable tbody th, table.pressable tbody td { padding: 0; }
table.pressable .cell {
  display: block; padding: 0.625rem 0.875rem;
  color: inherit; text-decoration: none;
}
table.pressable .cell:hover { background: var(--atp-grey-50); text-decoration: underline; }
table.pressable .cell:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }

/* A date never wraps mid-date. */
/* The header never wraps; the cell breaks only where `when()` put a space. */
th.when { white-space: nowrap; }
td.when { white-space: normal; }
td.when span { white-space: nowrap; }

/*
 * The detail under About wraps rather than widening the table;
 * `overflow-wrap: anywhere` because some details are unbroken tokens.
 */
.lede.detail { display: block; margin-top: 0.25rem; max-width: 28rem; overflow-wrap: anywhere; }
/* An id breaks only when it cannot fit (`auditScreen.shortId` shortens it). */
td .mono { overflow-wrap: break-word; }

/*
 * The header underlined in red. Not sticky: inside a horizontally scrolling box
 * it sticks to the box and hides the first row.
 */
th {
  font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3);
  /* Tinted, so the header band is a band and not the first row in a paler ink. */
  background: var(--atp-surface-2); white-space: nowrap; border-bottom: 2px solid var(--atp-accent);
}
th small { display: block; font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; color: var(--atp-ink-3); }
tbody tr:nth-child(even) { background: var(--atp-surface-alt); }
tbody tr:last-child td { border-bottom: 0; }
td.mono { font-family: var(--atp-font-mono); font-size: 13px; }

/* ---------- the matrix: one row per worker, one column per module ---------- */

/*
 * The name column pinned while module columns scroll (sticky resolves against
 * `.scroll`). A table rather than cards, so a reader can scan down a column.
 */
table.matrix { border-collapse: separate; border-spacing: 0; }

/* `separate`, because a collapsed border is dropped from a sticky cell; the rule becomes an inset shadow. */
table.matrix th, table.matrix td { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--atp-line); }
table.matrix thead th { box-shadow: inset 0 -2px 0 var(--atp-accent); }
table.matrix tbody tr:last-child th, table.matrix tbody tr:last-child td { box-shadow: none; }

table.matrix th[scope="row"], table.matrix thead th:first-child {
  position: sticky; left: 0;
  /* Opaque, or scrolled columns show through; matched to the row stripes below. */
  background: var(--atp-surface);
  z-index: 2;
}
table.matrix tbody tr:nth-child(even) th[scope="row"] { background: var(--atp-surface-alt); }
/* Above the body's sticky cells, so a name scrolling left goes under the header corner. */
table.matrix thead th:first-child { z-index: 3; }

/* A hairline down the pinned column, so it reads as an edge content passes behind. */
table.matrix th[scope="row"]::after, table.matrix thead th:first-child::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: var(--atp-line-strong);
}

/* A row header is a person's name: not the uppercase header style, and allowed to wrap (long names). */
table.matrix th[scope="row"] {
  max-width: 11rem; white-space: normal;
  font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--atp-ink);
}
/* Their register's reference in the mono face, so digits line up down the column. */
td.ref { white-space: nowrap; font-family: var(--atp-font-mono); font-size: 13px; }

.lang {
  display: inline-block; background: var(--atp-deep); color: #fff; font-size: 12px; font-weight: 600;
  letter-spacing: 0; padding: 0.125rem 0.375rem; border-radius: var(--atp-radius-sm);
}

footer.small { color: var(--atp-ink-3); font-size: 14px; margin-top: 2rem; }
.legend { margin: 1rem 0 0; color: var(--atp-ink-2); font-size: 14px; }

/* ==========================================================================
 * The rest of the mockup's shell and screens. Not copied: its CDN fonts and
 * icons (ours are inline SVG), its dead topbar search, and its hardcoded bell.
 * ========================================================================== */

/* ---------- topbar search and bell ---------------------------------------- */

.topbar .left { display: flex; align-items: center; gap: 2rem; min-width: 0; }
.search {
  display: flex; align-items: center; gap: 0.5rem; width: 20rem; max-width: 32vw;
  background: var(--atp-surface-alt); border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-sm); padding: 0 0.625rem;
}
.search svg { width: 16px; height: 16px; flex: none; color: var(--atp-ink-4); }
.search input { border: 0; background: none; padding: 0.5rem 0; width: 100%; }
.search input:focus { outline: none; box-shadow: none; }
/* The search survives a phone (checking somebody on arrival); it gives up its fixed width instead. */
@media (max-width: 60rem) {
  .topbar .search { flex: 1 1 auto; min-width: 0; width: auto; }
  .topbar .search input { min-width: 0; }
}

.bell {
  position: relative; background: none; border: 0; padding: 0.5rem; color: var(--atp-ink-2);
  border-radius: var(--atp-radius-sm); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.bell:hover { background: var(--atp-surface-2); }
/* The bell that could not count: amber, not red -- it is a configuration gap, not a finding. */
.bell.unknown b { background: var(--atp-warning-mark); color: #0a0a0a; }
.bell svg { width: 20px; height: 20px; }
.bell b {
  position: absolute; top: 0.125rem; right: 0; min-width: 1.05rem; height: 1.05rem; padding: 0 0.2rem;
  background: var(--atp-danger); color: #fff; border-radius: 0;
  font-size: 11px; font-weight: 700; line-height: 1.05rem; text-align: center;
}

/* ---------- page header with an action on the right ----------------------- */

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.head p.lede { margin-bottom: 0; }
/* A chooser under the lede gets its own gap (`.head p.lede` has none). */
.head p.lede + select { margin-top: 0.75rem; }
a.action, button.action {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  background: var(--atp-primary); color: var(--atp-primary-ink); border: 2px solid transparent;
}
a.action {
  font-size: 13.5px; font-weight: 600;
  padding: 7px 16px; border-radius: 0; transition: background 0.2s, transform 0.1s;
}
a.action:hover, button.action:hover { background: var(--atp-primary-hover); }

/* An action that is off, drawn as off: a button shape in the line colour (spans included). */
a.action[aria-disabled='true'], span.action[aria-disabled='true'] {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 0;
  background: var(--atp-surface-2); color: var(--atp-ink-4);
  border: 1px solid var(--atp-line);
  cursor: not-allowed; text-decoration: none;
}
a.action:active, button.action:active { transform: scale(0.98); }
a.action svg, button.action svg { width: 18px; height: 18px; }

/* ---------- dashboard: scope, shortfall, bars and activity ---------------- */

/* The workforce switch and site chooser, boxed so they are not read as a card's caption. Dashboard only. */
.scope {
  background: var(--atp-surface); border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-md); box-shadow: var(--atp-shadow-1);
  padding: 0.875rem 1.125rem 1rem; margin: 0 0 1.5rem;
}
.scoperow {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.5rem;
  /* The rule is on the row, so it runs the full width of the box. */
  padding-bottom: 0.875rem; border-bottom: 1px solid var(--atp-line);
}
/* In the row the gap is the flex gap. */
.scoperow .segmented { margin: 0; }
/* The sentence reporting what the controls decided, under a rule. */
.scopenote { margin: 0.875rem 0 0; color: var(--atp-ink-2); font-size: 14px; max-width: 48rem; }
@media (max-width: 34rem) {
  /* The switch is full width here; the chooser stretches with it. */
  .scoperow { align-items: stretch; }
  .scoperow .pickerlabel { width: 100%; }
}

/* The shortfall list and module bars left, the feed right, at 2fr/1fr. */
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 68rem) { .split { grid-template-columns: 1fr; } }
/* Spaced by the grid's gap, not their own margin. */
.split > .stack > .panel { margin-bottom: 0; }

.panel > header h2.cap {
  font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3);
}

/* A caveat under a panel's rows: small and grey. */
.panelnote {
  margin: 0; padding: 0.75rem 1.25rem; border-top: 1px solid var(--atp-line);
  font-size: 12px; line-height: 1.5; color: var(--atp-ink-3);
}

/* One row per state, each a link to that Personnel filter: rows, not cards. */
.reasons { margin: 0; padding: 0; list-style: none; }
.reasons li { border-bottom: 1px solid var(--atp-line); }
.reasons li:last-child { border-bottom: 0; }
.reasons a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8125rem 1.25rem; color: inherit; text-decoration: none;
}
.reasons a:hover { background: var(--atp-grey-50); }
.reasons a:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }
/* The state's colour as a dot; a fully tinted row reads as an error. */
.reasons .dot { width: 0.5rem; height: 0.5rem; border-radius: 0; flex: none; background: var(--atp-ink-4); }
.reasons .bad .dot { background: var(--atp-danger); }
.reasons .warn .dot { background: var(--atp-warning-mark); }
.reasons .what { flex: 1 1 auto; font-size: 14px; font-weight: 600; min-width: 0; }
/* Tabular figures, so a column of counts lines up down the panel. */
.reasons .how { font-size: 13px; color: var(--atp-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reasons .how b { font-size: 1.0625rem; font-weight: 700; color: var(--atp-ink); }
.reasons .bad .how b { color: var(--atp-danger); }
.reasons .warn .how b { color: var(--atp-warning); }
.reasons .go { flex: none; display: flex; color: var(--atp-ink-4); }
.reasons .go svg { width: 16px; height: 16px; }
.reasons a:hover .go { color: var(--atp-ink-2); }
/* Nobody is behind: not a row and not a link. */
.reasons .nothing p { margin: 0; padding: 1rem 1.25rem; font-size: 14px; color: var(--atp-ink-2); }

/* The overdue rows on Reports are two lines (person, then course): own line, own weight, dot on the first line. */
.reasons.overdue a { align-items: flex-start; gap: 0.875rem; padding: 0.9375rem 1.25rem; }
.reasons.overdue .dot { margin-top: 0.4375rem; }
.reasons.overdue .what { line-height: 1.35; }
/* The second line of any `.reasons` label: a block, and lighter than the name. */
.reasons .what .lede {
  display: block; margin-top: 0.1875rem;
  font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--atp-ink-3);
}
/* On the first line, with the name. */
.reasons.overdue .how { padding-left: 0.5rem; align-self: flex-start; line-height: 1.35; }

/* Completion by module, each row a link edge to edge. */
.bars { margin: 0; padding: 0; list-style: none; }
.bars li { border-bottom: 1px solid var(--atp-line); }
.bars li:last-child { border-bottom: 0; }
.bars a { display: block; padding: 0.875rem 1.25rem; color: inherit; text-decoration: none; }
.bars a:hover { background: var(--atp-grey-50); }
.bars a:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }
.bars .top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; }
.bars .top b { font-size: 15px; font-weight: 600; }
.bars .top i { font-style: normal; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bars .track { height: 6px; background: var(--atp-surface-2); border-radius: 0; overflow: hidden; }
.bars .track span { display: block; height: 100%; border-radius: 0; }
.bars small { display: block; margin-top: 0.4rem; font-size: 12px; color: var(--atp-ink-3); }
/* Status colours, never the brand red: a low completion rate is data semantics. */
.bars .ok   .track span, .bars .ok i   { background: var(--atp-success); color: var(--atp-success); }
.bars .ok   i { background: none; }
.bars .warn .track span { background: var(--atp-warning-mark); } .bars .warn i { color: var(--atp-warning); }
/* Low completion is not a failure (ticket 068): the share stays ink, its bar ink; red is for Not passed and Lapsed. */
.bars .bad  .track span { background: var(--atp-ink); }  .bars .bad i  { color: var(--atp-ink); }

.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: flex; gap: 0.75rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--atp-line); }
.feed li:last-child { border-bottom: 0; }
/*
 * The whole feed line is the target, by stretching the name's link across it
 * (the name stays the anchor text, which the feed's test reads). `.line` only:
 * the empty state must not light up.
 */
.feed li.line { position: relative; transition: background 120ms; }
.feed li.line:hover { background: var(--atp-grey-50); }
.feed p a::after { content: ''; position: absolute; inset: 0; }
.feed p a:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; border-radius: 2px; }
.feed .icon {
  width: 2rem; height: 2rem; flex: none; border-radius: var(--atp-radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--atp-surface-2); color: var(--atp-ink-2);
}
.feed .icon svg { width: 16px; height: 16px; }
.feed .icon.ok { background: var(--atp-success-tint); color: var(--atp-success); }
.feed .icon.bad { background: var(--atp-danger-tint); color: var(--atp-danger); }
.feed p { margin: 0; font-size: 14px; color: var(--atp-ink-2); line-height: 1.45; }
.feed p b { color: var(--atp-ink); font-weight: 600; }
.feed time { display: block; margin-top: 0.25rem; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--atp-ink-4); }

/* ---------- content: a module card with one row per language -------------- */

.module { margin-bottom: 1.25rem; }
.module > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.module .no { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-4); margin: 0 0 0.125rem; }
/* An opened module's title, at the size of the page's subject. */
.module h2 { font-size: 1.375rem; line-height: 1.25; margin: 0.125rem 0 0; }

/* A heading over the language rows. */
.rowshead {
  margin: 1.25rem 0 0; padding: 0 1.25rem;
  font-size: 12px; font-weight: 700; letter-spacing: 0;
  text-transform: none; color: var(--atp-ink-3);
}
.module .src { margin: 0.25rem 0 0; font-size: 13px; color: var(--atp-ink-3); }
.module .rows { margin: 0; padding: 0; list-style: none; }
.module .rows li {
  display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--atp-line); font-size: 14px;
}
.module .rows li:last-child { border-bottom: 0; }
.module .rows .name { width: 9rem; color: var(--atp-ink-2); }
.module .rows .state { flex: 1; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; display: flex; align-items: center; gap: 0.375rem; }
.module .rows .state svg { width: 15px; height: 15px; }
.module .rows .state.ok { color: var(--atp-success); }
.module .rows .state.wait { color: var(--atp-warning); }
.module .rows .count { color: var(--atp-ink-3); font-size: 13px; width: 8rem; text-align: right; }

/*
 * The question bank, read only: languages stacked in one column, each
 * question a card of the panel's own style so a disputed one can be found.
 */
.bank { display: grid; gap: 1rem; }
/* Messages in this element take the card's shape too. */
.bank > p {
  background: var(--atp-surface); border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-md); box-shadow: var(--atp-shadow-1);
  padding: 1rem 1.25rem; margin: 0;
}
.bank .q {
  background: var(--atp-surface); border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-md); box-shadow: var(--atp-shadow-1);
  padding: 1rem 1.25rem 1.25rem;
}
.bank .q header {
  display: flex; align-items: baseline; gap: 0.5rem; padding: 0 0 0.75rem; border: 0;
  border-bottom: 1px solid var(--atp-line); margin-bottom: 0.25rem;
}
.bank .q h3 { font-size: 13px; letter-spacing: 0; text-transform: none;
              color: var(--atp-ink-3); margin: 0; }
/* "Question 7 of 20" is what somebody hunts for, so it is not the quiet part. */
.bank .q h3 b { color: var(--atp-ink); font-size: 15px; letter-spacing: 0; text-transform: none; }
.bank .multi { font-size: 12px; font-weight: 600; color: var(--atp-deep);
               background: var(--atp-deep-tint); border-radius: 0; padding: 0.1rem 0.5rem; }
.bank .qlang { margin: 0.85rem 0 0; }
.bank .lang { font-size: 12px; color: var(--atp-ink-3); margin: 0 0 0.15rem; }
.bank .prompt { margin: 0 0 0.4rem; font-weight: 600; }
.bank .opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.bank .opts li { display: flex; gap: 0.4rem; padding-left: 1.25rem; text-indent: -1.25rem; }
/* The answer is marked with a tick, not colour: it survives print and colour blindness. */
.bank .opts li.right { font-weight: 600; padding-left: 0; text-indent: 0; }
.bank .ans { color: var(--atp-success); font-weight: 700; }

/* The model answer on a long-answer question: set apart from the prompt, real bullets to count against "cover all 3". */
.bank .keylede { font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
                 color: var(--atp-ink-3); margin: 0 0 0.3rem; }
.bank .keypoints { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.bank .keypoints li { padding-left: 0.15rem; }
.bank .keypoints li::marker { color: var(--atp-success); }
.module .rows li.pending { background: var(--atp-surface-alt); }

/* ---------- pagination footer --------------------------------------------- */

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; gap: 1rem; flex-wrap: wrap; }
.pager p { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-4); }
.pager button { background: var(--atp-surface); color: var(--atp-ink); border: 1px solid var(--atp-line-strong); }
.pager button:hover { background: var(--atp-surface-2); }
.pager-buttons { display: flex; gap: 0.5rem; }
.pager-buttons:empty { display: none; }
.pager button:disabled { opacity: 0.45; cursor: default; }

/* ---------- the induction screen ------------------------------------------ */

/* Projected on a wall: no chrome, one code sized in viewport units. */
body.project { background: var(--atp-panel); color: #fff; }
body.project main { margin: 0; padding: 0; }

/* ---------- content: the video panel and its QR --------------------------- */

/* The playback block: one column. */
.video { display: block; }
.qr-note { margin: 0.75rem 0 0; font-size: 13px; color: var(--atp-ink-3); }
.qr-note .big { margin-left: 0.5rem; }

/*
 * Sixteen by nine, filling the column, capped at 46rem and centred for wide
 * screens. The tighter height cap is only on `.empty`, the placeholder.
 */
.player {
  position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 46rem; margin: 0 auto;
  border-radius: var(--atp-radius-sm); overflow: hidden;
  background: var(--atp-panel); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.625rem;
  text-align: center; padding: 1rem;
}
/* No film behind it: the shape is kept and the size is not. */
.player.empty { max-width: 30rem; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player .disc {
  width: 3.5rem; height: 3.5rem; border-radius: 0; background: rgb(255 255 255 / 12%);
  display: flex; align-items: center; justify-content: center;
}
.player .disc svg { width: 26px; height: 26px; }
.player b { font-size: 15px; font-weight: 600; }
.player small { font-size: 13px; color: #cbd5e1; max-width: 26rem; }

/* A language with no file: dimmed, never disabled, so "missing" is not mistaken for "broken". */
.picker button.empty { opacity: 0.55; }

.picker { display: flex; gap: 0.5rem; margin-top: 0.875rem; flex-wrap: wrap; align-items: center; }
.picker button {
  background: var(--atp-surface); color: var(--atp-ink); border: 1px solid var(--atp-line-strong);
  padding: 0.5rem 0.75rem; font-size: 12px;
}
.picker button.on { background: var(--atp-deep); color: #fff; border-color: var(--atp-deep); }
.picker button:disabled { opacity: 0.4; cursor: not-allowed; }
/* The chosen chip keeps full strength even when disabled: a film's English chip is the answer, not unavailable. */
.picker button.on:disabled { opacity: 1; cursor: default; }
.picker .runtime { font-size: 13px; color: var(--atp-ink-3); margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* The QR, sized to be scanned off a laptop screen from across a room. */
.qr { text-align: center; }
.qr .frame {
  background: #fff; border: 1px solid var(--atp-line); border-radius: var(--atp-radius-sm);
  padding: 0.5rem; display: block;
}
.qr img { display: block; width: 100%; height: auto; }
.qr p { margin: 0.625rem 0 0; font-size: 12px; color: var(--atp-ink-3); line-height: 1.45; }
.qr a.big { display: inline-block; margin-top: 0.5rem; font-size: 12px; color: var(--atp-ink-3); }

/* ---------- the record behind a row ---------------------------------------- */

/* A panel over the table rather than a page, so the roster and filters are kept. */
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--atp-surface-alt); }
tbody tr:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }

/* A per-element `hidden` guard, from before the global one at the top. */
.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 60; background: rgb(15 23 42 / 45%); display: flex; justify-content: flex-end; }
.drawer .sheet {
  width: min(34rem, 100%); background: var(--atp-surface); height: 100%; overflow-y: auto;
  box-shadow: -1px 0 0 var(--atp-line); display: flex; flex-direction: column;
}
.drawer .sheet > header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--atp-line); position: sticky; top: 0;
  background: var(--atp-surface);
}
.drawer .sheet > header h2 { margin: 0; font-size: 1.125rem; }
.drawer .sheet > header p { margin: 0.25rem 0 0; color: var(--atp-ink-3); font-size: 13px; }
/* The close cross, by id: a header-wide button rule once restyled "Take off the roster" as the cross. */
.drawer .sheet > header #detailClose {
  background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--atp-ink-3);
  padding: 0 0.25rem;
}
/* Cleared / Not cleared at the top of a record: the words carry the meaning, the colour only repeats them. */
.drawer .clearance {
  margin: 0.75rem 0 0; padding: 0.625rem 0.875rem; border-radius: var(--atp-radius-sm);
  border-left: 3px solid var(--atp-danger); background: var(--atp-danger-tint); font-size: 14px;
}
.drawer .clearance.cleared { border-left-color: var(--atp-success); background: var(--atp-success-tint); }
.drawer .clearance .verdict { display: block; font-size: 1.25rem; color: var(--atp-danger); }
.drawer .clearance.cleared .verdict { color: var(--atp-success); }
.drawer .sheet > header .clearance p { margin: 0.25rem 0 0; color: var(--atp-ink-2); font-size: 14px; }
.drawer .clearance ul { margin: 0.25rem 0 0; padding-left: 1.25rem; color: var(--atp-ink); }
.drawer .sheet > .body { padding: 1.25rem 1.5rem 2rem; }
.drawer h3 {
  font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3);
  margin: 1.5rem 0 0.5rem;
}
.drawer h3:first-child { margin-top: 0; }
.drawer .record { border: 1px solid var(--atp-line); border-radius: var(--atp-radius-sm); padding: 0.75rem 0.875rem; margin-bottom: 0.5rem; }
.drawer .record .top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.drawer .record b { font-size: 14px; }
.drawer .record small { display: block; color: var(--atp-ink-3); font-size: 12px; margin-top: 0.25rem; }
.drawer .record .tag { font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.drawer .record.valid  { border-left: 3px solid var(--atp-success); } .drawer .record.valid  .tag { color: var(--atp-success); }
.drawer .record.soon   { border-left: 3px solid var(--atp-warning-mark); } .drawer .record.soon   .tag { color: var(--atp-warning); }
.drawer .record.lapsed { border-left: 3px solid var(--atp-danger);  } .drawer .record.lapsed .tag { color: var(--atp-danger); }
.drawer .record.failed { border-left: 3px solid var(--atp-danger);  } .drawer .record.failed .tag { color: var(--atp-danger); }
.drawer .record.open   { border-left: 3px solid var(--atp-ink-3);   } .drawer .record.open   .tag { color: var(--atp-ink-3); }
.drawer .record.superseded { border-left: 3px solid var(--atp-line); opacity: 0.75; }
.drawer .record.superseded .tag { color: var(--atp-ink-3); }
.drawer .empty { color: var(--atp-ink-3); font-size: 13px; margin: 0; }
.drawer .verify { font-size: 12px; }

/* A panel that explains a page before it asks for anything. */
.panel.explain { border-left: 4px solid var(--atp-deep); background: var(--atp-surface-alt); }
.panel.explain .body { padding: 1.25rem 1.5rem; }
.panel.explain p { margin: 0 0 0.75rem; max-width: 46rem; line-height: 1.55; }
.panel.explain p:last-child { margin-bottom: 0; }
.panel.explain p.small { color: var(--atp-ink-3); font-size: 13px; }

/* ---------- the worker list's editor --------------------------------------- */

/* One row per person, in fields. */
table.editor { width: 100%; }
table.editor th { font-size: 11px; }
table.editor td { padding: 0.375rem 0.5rem; vertical-align: middle; }
table.editor td:first-child { padding-left: 0; }
/* The row's number, from a CSS counter so removing a row renumbers the rest; muted, an index not a field. */
tbody { counter-reset: rownum; }
tbody tr { counter-increment: rownum; }
td.rownum, th.rownum { width: 2.25rem; padding-left: 0; padding-right: 0.25rem; text-align: center; }
td.rownum::before {
  content: counter(rownum);
  display: block; text-align: center;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--atp-ink-3);
}
table.editor input, table.editor select {
  width: 100%; min-width: 7rem; padding: 0.5rem 0.625rem; font: inherit; font-size: 14px;
  border: 1px solid var(--atp-line); border-radius: var(--atp-radius-sm); background: var(--atp-surface);
  color: var(--atp-ink);
}
table.editor input:focus, table.editor select:focus { outline: 2px solid var(--atp-deep); outline-offset: -1px; }
table.editor input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
/* The status holds two words; at the shared 7rem it would take width from the name. */
table.editor select[data-field="active"] { min-width: 5.5rem; }
table.editor td.drop { width: 2.5rem; padding-right: 0; }
table.editor button.drop {
  background: none; border: 0; cursor: pointer; color: var(--atp-ink-3); font-size: 1.25rem; line-height: 1;
  padding: 0.25rem 0.5rem;
}
table.editor button.drop:hover { color: var(--atp-danger); background: none; }
/* Selects as well as inputs, so the cell at fault is marked. */
table.editor tr.bad input,
table.editor tr.bad select { border-color: var(--atp-danger); }

/* Adding a row and checking are not peers; the rule between them says so. */
.panel .body > .actions:last-child {
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--atp-line);
  display: flex; align-items: center; gap: 0.875rem;
}

/* ---------- the code, full screen ------------------------------------------ */

/* The code is behind a button everywhere: it is for a wall or a message, never scanned off this screen. */
.qr .frame { cursor: zoom-in; border: 0; padding: 0; background: none; display: block; width: 100%; }
.qr .frame img { display: none; }
.qrfull[hidden] { display: none; }
.qrfull {
  position: fixed; inset: 0; z-index: 80; background: rgb(15 23 42 / 80%);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.qrfull .inner { text-align: center; max-width: min(80vh, 90vw); }
.qrfull img {
  display: block; width: 100%; height: auto; background: #fff; padding: 1.5rem;
  border-radius: var(--atp-radius-md);
}
.qrfull p { color: #fff; font-size: 1.125rem; font-weight: 600; margin: 1rem 0 0; }
.qrfull .row { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
/* The shared .action is white text on the dark; on this white pill it vanished. */
.qrfull .action {
  background: var(--atp-surface); color: var(--atp-deep); border: 1px solid var(--atp-line);
  justify-content: center; min-width: 12rem;
}

/* The enlarge label sits under the code, never over a finder pattern. */
.qr .frame { display: block; width: 100%; }


/* Two downloads side by side. */
.actions-row { display: flex; gap: 0.625rem; flex-wrap: wrap; justify-content: flex-end; }

/* The audit screen's explanation, folded. */
details.explain > summary {
  padding: 0.875rem 1.25rem; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--atp-ink-2);
}
details.explain > summary:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }
details.explain[open] > summary { border-bottom: 1px solid var(--atp-line); }

/* A module's controls, under its video, in a flex row. */
.mod-controls { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--atp-line); }
.mod-controls .src { margin: 0 0 0.75rem; }

/* Labelled actions left, tools right; labels size to themselves and never wrap, every control one height. */
.mod-buttons { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: stretch; }
.mod-buttons .action { justify-content: center; white-space: nowrap; }
/* Pushed to the far edge, which is what makes the two groups read as two. */
.mod-buttons > .iconbtn { margin-left: auto; }
.mod-buttons > .iconbtn + .picker { margin-left: 0; }

/* The chips and the download travel together; overrides `.picker`'s top margin and centring. */
.mod-buttons .picker { display: flex; align-items: stretch; gap: 0.375rem; margin-top: 0; flex-wrap: nowrap; }
/* Same vertical padding as the buttons beside them, so the row has one top edge. */
.mod-buttons .picker button { padding-block: 0.75rem; }
.mod-buttons .picker button { min-width: 3rem; }

/*
 * The square icon button (Download, QR), styled on its own class so it is
 * painted wherever it appears -- not `.mod-buttons .icon`, which left it bare
 * elsewhere. Only layout is scoped to `.mod-buttons`. (moduleList.test.ts
 * reads this comment as part of the rule's selector text.)
 */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; padding: 0.75rem 0; flex: none; border: 0;
  background: var(--atp-deep); color: #fff; border-radius: 0;
  text-decoration: none; transition: background 0.2s, transform 0.1s; min-height: 2.5rem;
}
.iconbtn:hover { background: var(--atp-accent); }
.iconbtn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
.iconbtn[aria-disabled='true']:hover { background: var(--atp-deep); }
.iconbtn svg { width: 19px; height: 19px; }

/* On a phone: the labelled actions full width, then the QR and language group sharing the last line. */
@media (max-width: 48rem) {
  .mod-buttons .action { flex: 1 1 100%; }
  /* The rule that groups the tools on a laptop strands them here. */
  .mod-buttons > .icon { margin-left: 0; }
  .mod-buttons .picker { flex: 1 1 auto; }
  /* The three chips share what is left, so the row has one right edge. */
  .mod-buttons .picker button { flex: 1 1 0; min-width: 0; }
  /* And one height for the chips and actions. */
  .mod-buttons .picker button, .iconbtn { padding-block: 0.5rem; }
  /* Pinned: the chips' border would otherwise leave them 2px off. */
  .mod-buttons .action, .iconbtn, .mod-buttons .picker button { min-height: 2.375rem; }

  /* The language rows wrap: the count takes its own line. */
  .module .rows li { flex-wrap: wrap; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem; }
  .module .rows .name { width: auto; }
  .module .rows .state { flex: 1 1 auto; }
  .module .rows .count { width: auto; flex: 1 1 100%; text-align: left; }
}

/* ---------- the sign in gate ---------------------------------------------- */

/* A cover, not a dialog: the screens behind it hold only refused, empty tables. */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start;
  padding: 1.5rem 2rem;
  background: var(--atp-surface-alt);
  overflow: auto;
}

.gate-card {
  width: min(24rem, 100%);
  background: #fff;
  border: 1px solid var(--atp-line);
  border-radius: 0;
  padding: 2rem;
  box-shadow: none;
}

.gate-logo { height: 1.75rem; display: block; margin-bottom: 1.5rem; }
.gate-card h1 { margin: 0 0 0.25rem; font-size: 1.375rem; }
.gate-card .lede { margin: 0 0 1.5rem; }

.gate-card label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--atp-ink-2);
}

.gate-card input {
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  border: 1px solid var(--atp-line);
  border-radius: 0;
  background: #fff;
}

.gate-card input:focus-visible { outline: 2px solid var(--atp-accent); outline-offset: 1px; }
/* The gate's button is red at rest (the client's instruction): one action on the page. */
.gate-card button { width: 100%; margin-top: 0.25rem; background: var(--atp-primary); }
/* And no hover change, declared so `button:hover` does not paint it. */
.gate-card button:hover,
.gate-card button[disabled]:hover { background: var(--atp-primary); }

/* One error line for every failure: the server does not distinguish them, and neither may this. */
.gate-error {
  margin: 0 0 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0;
  background: var(--atp-danger-tint);
  color: var(--atp-danger);
  font-size: 0.875rem;
}

.gate-note {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--atp-ink-2);
}

/* The second step of sign-in (ticket 061, mfaGate.ts). */
.mfa-line { margin: 0 0 0.75rem; font-size: 0.875rem; line-height: 1.5; color: var(--atp-ink); }
.mfa-qr { display: flex; justify-content: center; margin: 0 0 1rem; min-height: 3rem; border: 1px solid var(--atp-line); background: #fff; padding: 0.5rem; }
.mfa-qr svg { width: min(12rem, 100%); height: auto; display: block; }
.mfa-key { margin: 0 0 1.25rem; padding: 0.5rem 0.75rem; font: 600 0.9375rem/1.5 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; word-break: break-word; background: var(--atp-surface-alt); border: 1px solid var(--atp-line); }
.mfa-codes { list-style: none; margin: 0 0 1rem; padding: 0.75rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem 1rem; font: 600 0.9375rem/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--atp-surface-alt); border: 1px solid var(--atp-line); }
.gate-card #mfaCopy { margin-bottom: 0.5rem; background: var(--atp-surface); color: var(--atp-deep); }
.gate-card #mfaCopy:hover { background: var(--atp-accent-tint); }

.signout {
  margin-left: 0.5rem;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--atp-ink-2);
  background: transparent;
  border: 1px solid var(--atp-line);
  border-radius: 0;
  cursor: pointer;
}
.signout:hover { background: var(--atp-surface-alt); }

/* ---------- the administrators screen ------------------------------------- */

/* Panels down the page rather than across it. */
.stack { display: grid; gap: 1.25rem; }

/* The add form does not want the full width. */
#addAdmin, #addResult { max-width: 26rem; }

/* Row actions: small, outlined, equal, on one line where they fit. */
.row-actions { white-space: normal; }
.row-actions .rowaction {
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: none;
  padding: 0.375rem 0.625rem; margin: 0.125rem 0.25rem 0.125rem 0;
  border: 1px solid var(--atp-line-strong); border-radius: var(--atp-radius-sm);
  background: var(--atp-surface); color: var(--atp-ink); cursor: pointer; transition: var(--atp-tx);
}
.row-actions .rowaction:hover { background: var(--atp-surface-2); }
/* Disable is marked in the text, not a filled red box: it is pressed last. */
.row-actions .rowaction.danger { color: var(--atp-danger); border-color: var(--atp-danger-tint); }
.row-actions .rowaction.danger:hover { background: #fef2f2; }
.row-actions .rowaction[disabled] { opacity: 0.4; cursor: not-allowed; background: var(--atp-surface); }

/* The reset link, folded when the email sent: opening it is a deliberate act. */
.link-fallback { margin-top: 0.75rem; }
.link-fallback > summary {
  cursor: pointer; font-size: 13px; color: var(--atp-ink-3);
  padding: 0.25rem 0; list-style-position: outside;
}
.link-fallback > summary:hover { color: var(--atp-ink); }

.admin-off { color: var(--atp-ink-2); }
.admin-off td { opacity: 0.6; }

/* A one-time link or password: mono and selectable, for copying. */
.new-password {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: 0;
  background: var(--atp-success-tint);
  border: 1px solid #a7f3d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  user-select: all;
  word-break: break-all;
}

/* A stacked form field in a panel. */
.field {
  display: block;
  margin-bottom: 1rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--atp-ink-2);
}
.field input { display: block; width: 100%; margin-top: 0.375rem; font-weight: 400; }

/* Sign out, held to the bar's fixed height. */
.topbar .signout { flex: none; white-space: nowrap; padding: 0.375rem 0.75rem; font-size: 13px; }
.topbar .who { min-width: 0; }
.topbar .who .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/*
 * Content hidden (not absent, so nothing shifts) while it is unknown whether
 * anybody is signed in; the chrome stays. signIn.ts adds and always removes it.
 */
body.checking main { visibility: hidden; }

/* A withdrawn certificate's reason, on its own line: a decision, not a fact about the certificate. */
.record .withdrawn { color: var(--atp-danger); font-weight: 600; }

/* Withdraw sits beside the verification link, not in the card header. */
button.withdraw {
  margin-left: 0.75rem;
  padding: 0.125rem 0.5rem;
  font: inherit;
  font-size: 12px;
  color: var(--atp-ink-2);
  background: transparent;
  border: 1px solid var(--atp-line-strong);
  border-radius: var(--atp-radius-sm);
  cursor: pointer;
}
/* The roster control, one size up; the drawer's controls share one left edge (no `margin-left`). */
/* Who somebody reports to: one line, the chooser capped so long names keep the close button in view. */
.detail-manager { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0; font-size: 14px; }
.detail-manager label { display: flex; align-items: center; gap: 0.5rem; }
.detail-manager select { max-width: 16rem; padding: 0.25rem 0.5rem; font-size: 13px; }
.detail-manager .note { margin: 0; }

.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.detail-actions button.withdraw { margin-left: 0; padding: 0.375rem 0.75rem; font-size: 12px; }
#rosterToggle { padding: 0.375rem 0.75rem; font-size: 12px; }

button.withdraw:hover { border-color: var(--atp-danger); color: var(--atp-danger); background: transparent; }
button.withdraw:disabled { opacity: 0.5; cursor: default; }

/* ---------- utility classes used across screens --------------------------- */

/* Bare versions of classes once only defined scoped (`.empty`, `.lede`, `.mono`); scoped rules still win. */
.empty { color: var(--atp-ink-3); font-size: 14px; }
.lede { color: var(--atp-ink-2); }
.mono { font-family: var(--atp-font-mono); font-size: 12px; }

/* The controls row above the audit table: a filter and a count, on one line. */
.controls { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.controls .field { display: flex; align-items: center; gap: 0.5rem; }
.controls .field select { margin-top: 0; }

/* ---------- the Show button on a password field ---------------------------- */

/* Over the right-hand end of the field; the wrapper takes the field's top margin so centring is exact. */
.reveal-wrap { position: relative; display: block; margin-top: 0.375rem; }
.reveal-wrap input { margin-top: 0; padding-right: 4rem; }

/* Quiet: a red button on a field would read as the thing to press. */
.reveal-wrap .reveal {
  position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  background: none; color: var(--atp-ink-2); border: 0;
  padding: 0.375rem 0.5rem; font-size: 11px;
  /* Undoes `.gate-card button` (full width, top margin); selected through the wrapper to outrank it. */
  width: auto; margin-top: 0;
}
.reveal-wrap .reveal:hover { background: var(--atp-surface-2); color: var(--atp-ink); }

/* ---------- a phone ------------------------------------------------------- */

/*
 * ---- phones (below 48rem, where the 16rem rail leaves no usable column) ----
 */
@media (max-width: 48rem) {
  /* The bar offset stays: the drawer is fixed over the page, so nothing else clears the bar. */
  main { margin-left: 0; padding: 1rem 1rem 3rem; padding-top: calc(var(--bar) + 1rem); }

  /* The sidebar becomes a drawer: the laptop rail, translated off-screen until asked for. */
  .rail {
    /* Over the page and the bar, which is inert while this is open. */
    top: 0; z-index: 60;
    width: min(17rem, 82vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .rail.open { transform: none; }

  /* No slide for reduced motion: it simply arrives. */
  @media (prefers-reduced-motion: reduce) {
    .rail { transition: none; }
  }

  .navClose { display: inline-flex; }
  /* A phone has a drawer, never a collapsed rail (which would hide its way in). */
  body.rail-collapsed .rail { transform: translateX(-100%); }
  body.rail-collapsed main { margin-left: 0; }

  /* The page behind, dimmed; pressing it closes. */
  .nav-scrim {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(10, 37, 64, 0.5);
  }
  /* The page does not scroll under the drawer. */
  body.nav-open { overflow: hidden; }

  /*
   * The fixed bar's width is the page's, so nothing in it may push: the name
   * and role end in an ellipsis, the chip keeps the initials.
   */
  .topbar { padding: 0 0.75rem; gap: 0.5rem; }
  /* `.left` holds the search, which stays. */
  .topbar .left { min-width: 0; flex: 1 1 auto; }
  .topbar .left > .label { display: none; }
  .topbar .search { width: 100%; }
  .topbar .search input { min-width: 0; }
  .topbar .who { min-width: 0; padding-left: 0.5rem; gap: 0.5rem; }
  .topbar .who > div { min-width: 0; }
  .topbar .who .name, .topbar .who .label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* 16px, or iOS Safari zooms into a focused field. */
  .field input, .field select, .gate-card input { font-size: 16px; }

  /* A thumb needs more than a mouse does, and there is room for it here. */
  .reveal-wrap .reveal { padding: 0.5rem 0.625rem; font-size: 12px; }
  .reveal-wrap input { padding-right: 4.5rem; }

  /* Grid and flex items may shrink below their content, or a wide table drags the page (and the fixed bar) out. */
  .stack > *, .split > *, .cards > * { min-width: 0; }

  /* Rows of controls wrap. */
  .controls, .actions { flex-wrap: wrap; }
  /* A `<select>` is as wide as its longest option unless told otherwise. */
  .controls .field, .controls select { min-width: 0; max-width: 100%; }

  /*
   * Phone density: smaller prose and buttons so the table is reachable. No
   * blanket table minimum width (it made narrow tables scroll for nothing);
   * cells that must not break say `nowrap`.
   */

  /*
   * ---- the roster editor is a form, so it stacks ----
   *
   * A read-only table stays a table (rows are compared); this one is filled
   * in, row by row, so each row becomes a card. Table semantics are lost, so
   * every control carries its own `aria-label` and `data-label` prints it. No
   * height box on a phone: a second scrollbar under the thumb is worse.
   */
  #editorScroll { max-height: none; overflow-y: visible; }

  table.editor { min-width: 0; display: block; }
  table.editor thead { display: none; }
  table.editor tbody { display: block; }
  table.editor tr {
    display: block; position: relative;
    padding: 0.75rem 2.25rem 0.75rem 0.75rem; margin-bottom: 0.75rem;
    background: var(--atp-surface); border: 1px solid var(--atp-line); border-radius: var(--atp-radius-md);
  }
  /* The label above the field, so the field gets the width. */
  table.editor td {
    display: block; padding: 0.25rem 0 0.5rem; border: 0; box-shadow: none;
  }
  table.editor td::before {
    content: attr(data-label); display: block; margin-bottom: 0.25rem;
    font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3);
  }
  table.editor input, table.editor select { width: 100%; }
  /* Adding the next person: full width, with room above. */
  #addRow { width: 100%; }

  /*
   * Check is sticky at the bottom with its note, since an uncapped card stack
   * of a large roster puts it hundreds of thousands of pixels down. Sticky, not
   * fixed: it belongs to the table.
   */
  #checkActions {
    position: sticky; bottom: 0; z-index: 3;
    margin: 0 -1rem; padding: 0.75rem 1rem;
    background: var(--atp-surface-alt);
    border-top: 1px solid var(--atp-line);
  }
  #checkActions #check { flex: 1 1 auto; }
  /* A long refusal must not eat the screen it is explaining. */
  #checkActions .note { flex-basis: 100%; max-height: 5rem; overflow-y: auto; }

  /* The number column goes: `tr::before` numbers the card itself. */
  table.editor td.rownum { display: none; }

  /* The remove button is a corner control, not a labelled field. */
  table.editor td.drop { position: absolute; top: 0.375rem; right: 0.375rem; display: block; padding: 0; }
  table.editor td.drop::before { content: none; }

  /* A number on each card (the counter is set up outside this query). */
  table.editor tr::before {
    content: 'Worker ' counter(worker);
    display: block; margin: 0 0 0.5rem; padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--atp-line);
    font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3);
  }


  /* Exports read from the left once they wrap under the heading. */
  .head .actions-row, .actions-row { justify-content: flex-start; }
  .scroll th, .scroll td { padding: 0.625rem 0.75rem; font-size: 14px; }
  /* The account buttons stay one row; on that cell by name, not `td:last-child`. */
  .scroll td.row-actions { white-space: nowrap; }

  /* 2. The words stay; they take less room getting said. */
  /* Every explanatory paragraph. */
  .lede { font-size: 14px; }
  /* The export buttons (`a.action`). */
  a.action, button.action { padding: 0.5rem 0.75rem; font-size: 12px; }
  .controls select, .controls .field { flex: 1 1 45%; }
  /* The whole width. */
  .search-field { max-width: none; }

  /* A module card reads down the page. */

  /* The audit explanation, smaller. */
  .panel.explain .body { padding: 0.875rem 1rem; }
  .panel.explain p { font-size: 13px; margin-bottom: 0.5rem; }
  .panel.explain > summary { padding: 0.75rem 1rem; font-size: 13px; }

  /* Two-column forms have nothing to gain from a second column here. */
  .split, .video { grid-template-columns: 1fr; }
  .head { gap: 0.75rem; }
  h1 { font-size: 1.5rem; }
  .gate { padding: 1rem; }
  .gate-card { padding: 1.5rem; }
}

/* Below 30rem: the address and role leave the bar, or Sign out is pushed off the edge. */
@media (max-width: 30rem) {
  .topbar .who > div { display: none; }
  .topbar .who { padding-left: 0; border-left: 0; }

  /* A smaller chip and Sign out give the search room to type. */
  .topbar { gap: 0.375rem; }
  .topbar .who { gap: 0.375rem; }
  .topbar .who .chip { width: 2rem; height: 2rem; }
  .topbar .signout { padding: 0.5rem 0.5rem; font-size: 10px; }
  /* A typeable minimum on `.left`, the flex item, and only where it holds a search. */
  .topbar .left:has(.search) { min-width: 7.5rem; }
  .topbar .search { min-width: 0; }
}

/* ---------- the modules list, as cards ------------------------------------ */

/*
 * A course card, after a catalogue row the client sent: the picture inset
 * with its own corners, the code, the title, one muted line of facts, pills
 * at the foot; no shadow at rest, a lift on hover. The card is a `<button>`
 * (see `moduleTile` in moduleList.ts).
 */
/*
 * One line, no breakpoints: with a flexible max, `auto-fill` counts tracks at
 * their minimum, so `minmax(260px, 1fr)` gives 4 columns at 1600, 3 at 1280, 2
 * at 768, 1 at 375 inside the 78rem page. `auto-fill`, not `auto-fit`, so two
 * cards do not stretch across a wide screen.
 */
.moduletiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.5rem;                  /* 24px */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/*
 * Undoing a button's defaults. Load-bearing: the white background at rest and
 * on hover (`button:hover` is red app-wide), `font: inherit` and left text,
 * and `padding: 0` so the picture meets its margin.
 */
.modulecard {
  display: flex; flex-direction: column; height: 100%; width: 100%;
  text-align: left; font: inherit; color: inherit;
  margin: 0; padding: 0;
  background: #fff;
  border: 1px solid #e4e4e7;                   /* border-zinc-200 */
  border-radius: 0;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
/* The border alone at rest; the lift is the hover. */
.modulecard:hover {
  background: #fff;
  border-color: var(--atp-ink);
}
/* One box is the control, the press target and the ring. Nothing to disagree. */
.modulecard:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; }

/* The picture inset in a 10px margin with its own corners; 16:9 on the image, not the padded wrapper. */
.modulecard .shotwrap { display: block; padding: 10px; }
.modulecard .shot {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 0;
  background: var(--atp-surface-2);             /* while it loads, and if it never does */

  /* `height: auto`, or the img's height attribute stays definite and `aspect-ratio` is ignored. */
  height: auto;
}

.modulecard .cardbody {
  padding: 0.25rem 1rem 1rem; flex: 1;
  display: flex; flex-direction: column; gap: 0.5rem;
}

/* The module's code, in the reference's provider slot. */
.modulecard .cardcode {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0;
  text-transform: none; color: var(--atp-ink-3);
}

/* Two lines, then an ellipsis (the whole name is in `title`); `-webkit-` is the only clamp everywhere. */
.modulecard .cardtitle {
  font-size: 1rem; font-weight: 700; line-height: 1.35; color: #18181b;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}

/* One muted line: the pass mark and the languages, or what a film is for. */
.modulecard .cardmeta {
  display: block; font-size: 13px; line-height: 1.45; color: var(--atp-ink-3);
}

/* The pills on the card's floor (`margin-top: auto`), so they line up across a row. */
.modulecard .cardpills {
  margin-top: auto; padding-top: 0.25rem;
  display: flex; flex-wrap: wrap; gap: 0.375rem;
}
.modulecard .pill {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 0.375rem 0.625rem; border-radius: 0;
  background: var(--atp-surface-2); color: var(--atp-ink-2);
}
/* Red-tinted, not solid: a mark, not a warning. */
.modulecard .pill.req { background: #fdeaea; color: #a51b1b; }
/* The one state worth interrupting for, in the platform's own amber. */
.modulecard .pill.wait { background: #fff4e0; color: #0a0a0a; }

/* The opened module keeps a narrower measure than the grid. */
#moduleDetail { max-width: 64rem; }

/* The way back is a button: there is no address for a single module. */
.backlink {
  font: inherit; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0 0 1rem; padding: 0.4rem 0.7rem 0.4rem 0.5rem;
  background: none; border: 0; border-radius: var(--atp-radius-sm);
  color: var(--atp-ink-2); cursor: pointer;
}
.backlink::before { content: '\2190'; font-size: 15px; line-height: 1; }
.backlink:hover { background: var(--atp-surface-2); color: var(--atp-ink); }
.backlink:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; }

/* ---------- sections on the Training & Content screen --------------------- */
/* Section headings over the grid (assessments by workforce, and Films). */
.sectionhead {
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--atp-ink-2);
  margin: 2rem 0 0.25rem;
}
.sectionhead + div,
.sectionhead + ul {
  margin-top: 0.75rem;
}
/* One line under a heading, saying what the section is. */
.sectionnote { margin: 0.25rem 0 0.75rem; color: var(--atp-ink-3); }

/* A word over a chooser, so a project code is recognisable as one. */
.pickerlabel {
  display: inline-flex; flex-direction: column; gap: 0.25rem;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--atp-ink-3);
}

/* The workforce switch: every option visible (unlike a `select`), buttons with `aria-pressed`. */
.segmented {
  display: inline-flex; margin: 0 0 0.5rem; padding: 3px; gap: 2px;
  background: var(--atp-grey-100); border-radius: 0; border: 1px solid var(--atp-line);
}
.segmented button {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 7px 14px; border-radius: 0; margin: 0;
  font-size: 13px; font-weight: 600; color: var(--atp-ink-2); white-space: nowrap;
  transition: background 120ms, color 120ms;
}
.segmented button:hover { color: var(--atp-ink); }
/* The current segment is the dark fill, not a near-white pill: it must be unmistakable. */
.segmented button.on {
  background: var(--atp-deep); color: #fff;
  box-shadow: var(--atp-shadow-1);
}
.segmented button.on:hover { color: #fff; }
.segmented button:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 1px; }

/* At a phone's width the segments stack rather than run off the edge. */
@media (max-width: 34rem) {
  .segmented { display: grid; grid-auto-flow: row; width: 100%; }
  .segmented button { text-align: left; }
}
/* The first heading on the page needs no gap above it: the page title is there. */
.sectionhead:first-child { margin-top: 0.5rem; }

@media (max-width: 48rem) {
  .sectionhead {
    margin-top: 1.5rem;
  }
}


/* The Administrators choosers, capped so a long name does not set the column; the role note gets room. */
.rolecell select,
.personcell select { max-width: 13rem; padding: 0.25rem 0.5rem; font-size: 13px; }
.rolecell .lede { display: block; margin-top: 0.25rem; max-width: 18rem; font-size: 12px; line-height: 1.35; }
.personcell .gate-error { display: block; margin: 0.25rem 0 0; padding: 0.25rem 0.5rem; font-size: 12px; }

/* Adding one office person: a `<details>`, shut by default; fields wrap. */
.addperson {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--atp-line);
  border-radius: 0;
  background: var(--atp-surface-2);
}
.addperson > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.addperson .fields { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.addperson .fields label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--atp-ink-3);
}
.addperson .fields input { min-width: 12rem; padding: 0.375rem 0.5rem; font-size: 14px; text-transform: none; }
.addperson .lede { margin: 0.75rem 0; font-size: 13px; }

/*
 * The Organisation chart, top-down: boxes and connectors drawn over nested
 * lists and `<details>`. `#chart` scrolls sideways; the chart is `max-content`
 * inside it, never widening the page.
 *
 * On an 8px grid. Every box is one width, so a column of reports lines up and
 * a connector lands in the middle of the box it joins. Colour is an accent
 * (the box's left edge and a dot), never a fill. Every connector is one
 * `--wire`, 2px, set back half its width so it lands on the box's middle.
 */

/* The page: the ranking a narrow column beside the chart, which takes the rest. */
.split.orgsplit { grid-template-columns: minmax(16rem, 19rem) minmax(0, 1fr); gap: 1.5rem; }
.split.orgsplit > * { min-width: 0; }
@media (max-width: 68rem) { .split.orgsplit { grid-template-columns: minmax(0, 1fr); } }

/* A shadow at either edge while there is more to scroll that way (as `.scroll`, both sides). No script. */
#chart {
  overflow-x: auto; padding: 0.5rem 0 1rem;
  background:
    linear-gradient(to right, var(--atp-surface) 55%, rgba(255, 255, 255, 0)) left center / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--atp-surface) 55%, rgba(255, 255, 255, 0)) right center / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0)) left center / 0.625rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0)) right center / 0.625rem 100% no-repeat scroll,
    var(--atp-surface);
}
.panel > #chart { padding: 1.5rem 1.25rem; }
.chart, .chart ul { list-style: none; margin: 0; padding: 0; }
.chart { --boxw: 14rem; --wire: 2px solid var(--atp-ink-4); display: flex; gap: 2rem; justify-content: center; width: max-content; min-width: 100%; }
.chart li { position: relative; }

.chart .box {
  --tone: var(--atp-grey-400);
  display: flex; flex-direction: column; align-items: stretch; gap: 0.125rem; position: relative;
  width: var(--boxw); padding: 0.75rem 1rem; box-sizing: border-box;
  background: var(--atp-surface); border: 1px solid var(--atp-line-strong); border-left: 3px solid var(--tone);
  border-radius: var(--atp-radius-md); box-shadow: var(--atp-shadow-1);
  color: inherit; text-decoration: none; line-height: 1.35; text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.chart a.box:hover, .chart summary.box:hover { border-color: var(--atp-ink-4); border-left-color: var(--tone); box-shadow: var(--atp-shadow-2); }
.chart a.box:focus-visible, .chart .boxlink:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; border-radius: var(--atp-radius-sm); }
.chart .boxlink { display: flex; flex-direction: column; gap: 0.125rem; color: inherit; text-decoration: none; }
.chart .box b { font-size: 14px; font-weight: 600; color: var(--atp-ink); overflow-wrap: anywhere; }
.chart a.box:hover b, .chart .boxlink:hover b { text-decoration: underline; text-underline-offset: 2px; }
.chart .box .lede { font-size: 12px; margin: 0; color: var(--atp-ink-3); }
.chart .box .done { display: flex; align-items: center; margin-top: 0.25rem; font-size: 12px; font-weight: 500; color: var(--atp-ink-2); }
.chart .box .fold { font-size: 12px; color: var(--atp-ink-3); cursor: pointer; }
/* Said to a screen reader, not drawn: the connectors say it on screen. */
.chart .branchlabel {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; margin: 0;
}
/* A branch folds (`<details>`): no triangle, in either spelling (Safari). */
.chart summary.node { list-style: none; cursor: pointer; }
.chart summary.node::-webkit-details-marker { display: none; }
/* A root, centred over its row. */
.chart > li > details > summary.box, .chart > li > a.box { margin: 0 auto; }

/*
 * Level one: a row, joined to the box above by a stem and to each other by a
 * rail. Each column is as wide as its widest stack, its box at the left, so the
 * rail meets the box at the box's middle (`--rail`), not the column's.
 */
.chart ul.row { display: flex; justify-content: center; padding-top: 1.5rem; position: relative; }
.chart ul.row::before {
  content: ''; position: absolute; top: 0; left: 50%; height: 1.5rem; margin-left: -1px; border-left: var(--wire);
}
.chart ul.row > li { --rail: calc(0.375rem + var(--boxw) / 2); display: flex; flex-direction: column; align-items: flex-start; padding: 1.5rem 0.375rem 0; }
.chart ul.row > li::before, .chart ul.row > li::after {
  content: ''; position: absolute; top: 0; height: 1.5rem; border-top: var(--wire);
}
.chart ul.row > li::before { left: 0; width: calc(var(--rail) + 1px); }
.chart ul.row > li::after { left: calc(var(--rail) - 1px); right: 0; border-left: var(--wire); }
.chart ul.row > li:first-child::before { border-top: 0; }
.chart ul.row > li:first-child::after { border-top-left-radius: var(--atp-radius-md); }
.chart ul.row > li:last-child::after { border: 0; }
.chart ul.row > li:last-child::before { border-right: var(--wire); border-top-right-radius: var(--atp-radius-md); }
.chart ul.row > li:only-child::before { border: 0; }
.chart ul.row > li:only-child::after { border-top: 0; border-left: var(--wire); border-radius: 0; }

/* Below that: stacked under the manager, each on an elbow off one spine. */
.chart ul.stack { display: block; margin: 0 0 0 1rem; }
.chart ul.stack > li { padding: 0.5rem 0 0 1.25rem; }
.chart ul.stack > li::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: var(--wire);
}
.chart ul.stack > li:last-child::before { bottom: auto; height: calc(2rem + 2px); }
.chart ul.stack > li::after {
  content: ''; position: absolute; left: 0; top: 2rem; width: 1.25rem; border-top: var(--wire);
}

/*
 * Colour on the chart means one thing: where a person stands (`toneOf`, which
 * is `clearanceOf`): the box's left edge and the dot by the completion; the
 * legend in `.charttools` says which is which. The top of a department
 * (`head`) is set apart by its weight, the reader's own box (`mine`) by a ring.
 */
.chart .box.tone-cleared { --tone: var(--atp-success); }
.chart .box.tone-soon { --tone: var(--atp-warning-mark); }
.chart .box.tone-blocked { --tone: var(--atp-danger); }
.chart .box.tone-unknown { --tone: var(--atp-grey-400); }
.chart .box.tone-soon .done { color: var(--atp-warning); }
.chart .box.tone-blocked .done { color: var(--atp-danger); }
.chart .box.head { width: calc(var(--boxw) + 1rem); box-shadow: var(--atp-shadow-2); border-color: var(--atp-ink-4); border-left-color: var(--tone); }
.chart .box.head b { font-size: 15px; }
.chart .box.mine,
.chart a.box.mine:hover,
.chart summary.box.mine:hover { border-color: var(--atp-info); border-left-color: var(--tone); box-shadow: 0 0 0 3px var(--atp-info-tint), var(--atp-shadow-1); }
.chart .box.found { outline: 2px solid var(--atp-accent); outline-offset: 3px; }

.chart .dot, .charttools .dot {
  display: inline-block; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 0;
  margin-right: 0.5rem; background: var(--atp-grey-400);
}
.tone-cleared .dot { background: var(--atp-success); }
.tone-soon .dot { background: var(--atp-warning-mark); }
.tone-blocked .dot { background: var(--atp-danger); }
.tone-unknown .dot { background: var(--atp-grey-400); }

/* A branch's bar: held, missing, nothing required, in proportion (`standingOf`). */
.chart .branchbar {
  display: flex; gap: 2px; width: 100%; height: 0.375rem; margin-top: 0.75rem;
  border-radius: 0; overflow: hidden; background: var(--atp-surface-2);
}
.chart .branchbar .seg { flex-basis: 0; }
.chart .branchbar .seg.cleared { background: var(--atp-success); }
.chart .branchbar .seg.blocked { background: var(--atp-danger); }
.chart .branchbar .seg.unknown { background: var(--atp-grey-300); }
.chart .branchfig { margin-top: 0.25rem; font-size: 11px; color: var(--atp-ink-3); font-variant-numeric: tabular-nums; }

/* The fold row: a footer under a rule, the + / − and the head-count left, Record right. */
.chart .foldrow {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.75rem -1rem 0 -1rem; padding: 0.5rem 1rem 0; border-top: 1px solid var(--atp-line-strong);
}
/* A round + / −, its hit area widened to 44px. Quiet open; drawn in ink when there is more to see. */
.chart .toggle {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; padding: 0; border: 1px solid var(--atp-line-strong); border-radius: 0;
  background: var(--atp-surface); color: var(--atp-ink-2); font-size: 16px; font-weight: 600; line-height: 1;
}
.chart .toggle::after { content: ''; position: absolute; inset: -0.5rem; }
.chart .toggle[aria-expanded="false"] { border-color: var(--atp-deep); background: var(--atp-deep); color: #fff; }
.chart .toggle:hover,
.chart .toggle[aria-expanded="false"]:hover { background: var(--atp-accent-tint); color: var(--atp-accent); border-color: var(--atp-accent); }
.chart .toggle:focus-visible { outline: 2px solid var(--atp-accent); outline-offset: 2px; }

/* The person's record link, separate from the fold: at the right of the fold row. */
.chart summary.node .record {
  position: absolute; bottom: 1.125rem; right: 1rem; flex: none;
  font-size: 12px; font-weight: 600; line-height: 1rem; color: var(--atp-ink-3); text-decoration: none;
  opacity: 0; transition: opacity 0.12s ease;
}
/* Both selectors carry `summary.node` so the focus rule outranks the one hiding the link. */
.chart summary.node:hover .record,
.chart summary.node .record:focus-visible { opacity: 1; }
.chart .record:hover { color: var(--atp-deep); text-decoration: underline; }
.chart .record:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; border-radius: var(--atp-radius-sm); }
/* Never hidden on touch screens, which cannot hover. */
@media (hover: none) { .chart summary.node .record { opacity: 1; } }

/* Over the chart: fold all, open the gaps, find a person; the legend under them. */
.charttools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
  margin: 0 0 0.5rem; padding: 0 0 1rem; border-bottom: 1px solid var(--atp-line);
}
.panel > .charttools { margin: 0; padding: 1rem 1.25rem; }
.charttools .foldall { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0; }
.charttools .foldall button {
  display: inline-flex; align-items: center; gap: 0.375rem; height: 2.25rem; padding: 0 0.875rem;
  font-size: 13px; font-weight: 600; border: 1px solid var(--atp-line-strong); border-radius: 0;
  background: var(--atp-surface); color: var(--atp-ink-2); box-shadow: var(--atp-shadow-1);
}
.charttools .foldall button span { font-size: 15px; line-height: 1; color: var(--atp-ink-3); }
.charttools .foldall button:hover { background: var(--atp-surface-2); color: var(--atp-ink); border-color: var(--atp-line-strong); }
.charttools .foldall button:hover span { color: var(--atp-ink); }
.charttools .foldall button:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; position: relative; z-index: 1; }
/* Expand and collapse, one segmented pair. */
.charttools #expandAll { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.charttools #collapseAll { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.charttools #openBehind { margin-left: 0.5rem; }
/* The search: a field with a magnifier, its label kept for a screen reader. */
.chartfind { order: -1; position: relative; display: flex; align-items: center; flex: 1 1 16rem; max-width: 22rem; }
.chartfind label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.chartfind input {
  width: 100%; height: 2.25rem; box-sizing: border-box; padding: 0 0.75rem 0 2.25rem;
  font: inherit; font-size: 14px; color: inherit;
  border: 1px solid var(--atp-line-strong); border-radius: 0; box-shadow: var(--atp-shadow-1);
  background: var(--atp-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 0.75rem center;
}
.chartfindnote { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--atp-ink-2); }
.chartfindnote:empty { display: none; }
.charttools .legend {
  flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
  list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--atp-ink-3);
}
.charttools .legend li { display: inline-flex; align-items: center; }

/* Nobody above and nobody below: small cards in a wrapping row, under their own heading. */
#unplaced { border-top: 1px solid var(--atp-line); }
#unplaced > header { padding: 1rem 1.25rem 0; }
#unplaced h2.cap { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }
#unplacedList { display: flex; flex-wrap: wrap; gap: 0.5rem; width: auto; min-width: 0; padding: 1rem 1.25rem; justify-content: flex-start; }
#unplacedList a.node {
  display: block; height: 100%; box-sizing: border-box; padding: 0.5rem 0.75rem; line-height: 1.35;
  border: 1px solid var(--atp-line); border-radius: var(--atp-radius-md); background: var(--atp-surface);
  color: inherit; text-decoration: none; font-size: 14px;
}
#unplacedList > li { flex: 0 1 14rem; min-width: 12rem; }
#unplacedList a.node:hover { border-color: var(--atp-line-strong); box-shadow: var(--atp-shadow-1); }
#unplacedList a.node b { font-weight: 600; }
#unplacedList a.node .lede { font-size: 12px; color: var(--atp-ink-3); }

@media (max-width: 40rem) {
  .panel > .charttools { padding: 1rem; }
  .panel > #chart { padding: 1.5rem 1rem; }
  #unplacedList { padding: 1rem; }
  #unplacedList > li { flex: 1 1 100%; }
  #unplaced > header { padding: 1rem 1rem 0; }
  .charttools .foldall { flex: 1 1 100%; }
  .charttools #expandAll, .charttools #collapseAll { flex: 1 1 0; justify-content: center; }
  .charttools #openBehind { flex: 1 1 100%; justify-content: center; margin-left: 0; }
  .chartfind { flex: 1 1 100%; max-width: none; }
  /* 16px, or iOS Safari zooms into a focused field. */
  .chartfind input { font-size: 16px; height: 2.75rem; }
  .charttools .foldall button { height: 2.75rem; }
  .chart { --boxw: 13.5rem; }
}
/* On paper: the chart as it stands, without the controls or a sideways scroll. */
@media print {
  .charttools, .chart .toggle, .chart .record { display: none; }
  #chart { overflow: visible; }
  .chart .box { box-shadow: none; break-inside: avoid; }
  .chart .foldrow { border-top: 0; padding-top: 0; margin-top: 0.25rem; }
}

/* The ranking: the bar is the share, the line under it what it is a share of. */
.standings { list-style: none; margin: 0; padding: 0; }
.standings li + li { border-top: 1px solid var(--atp-line); }
.standings .standing {
  display: block; padding: 0.75rem 1.25rem; color: inherit; text-decoration: none;
}
.standings .standing:hover { background: var(--atp-surface-alt); }
.standings .standing:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }
.standings .top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.standings .top b { font-size: 14px; font-weight: 600; }
.standings .figure { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.standings .bar {
  height: 0.375rem; margin: 0.5rem 0; border-radius: 0; background: var(--atp-line); overflow: hidden;
}
.standings .bar > span { display: block; height: 100%; background: var(--atp-success); border-radius: 0; }
/* The rest of the bar is the people missing something; a branch with no verdict stays grey. */
.standings .bar:not(.none) { background: var(--atp-danger-tint); }
.standings small { display: block; font-size: 12px; line-height: 1.5; color: var(--atp-ink-3); }
.standings li.empty { padding: 0.75rem 1.25rem; }

/* The hardest questions on Reports: the prompt wraps, the figure stays right. Not a link. */
.questions { list-style: none; margin: 0; padding: 0; }
.questions li + li { border-top: 1px solid var(--atp-line); }
.questions .question { padding: 0.625rem 0.25rem; }
.questions .top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.questions .top span:first-child { font-size: 14px; line-height: 1.35; }
.questions .figure { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.questions .bar {
  height: 0.375rem; margin: 0.375rem 0; border-radius: 0; background: var(--atp-line); overflow: hidden;
}
/* Amber: this panel exists to find the questions most people fail. */
.questions .bar > span { display: block; height: 100%; background: var(--atp-warning-mark); border-radius: 0; }
.questions small { color: var(--atp-ink-3); }

/* A question bank waiting to be read: amber, pending not wrong; no ids or addresses. */
.panel.review {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--atp-warning-mark);
}
.panel.review p { margin: 0 0 0.5rem; font-size: 14px; }
.panel.review .lede { font-style: italic; }
.panel.review button { padding: 0.5rem 0.875rem; font-size: 14px; }

/* ---------- the module form, and the mark on a module card ---------------- */
/* Shared by content.html and module-edit.html, which loads only this stylesheet. */

/* The Required mark: the dark, a standing fact rather than a call to act. */
.module .req {
  display: inline-block; margin-left: 0.5rem; padding: 0.125rem 0.5rem;
  border-radius: 0; background: var(--atp-deep-tint); color: var(--atp-deep);
}

/* The form. Two columns on a laptop, one on anything narrower. */
.mform .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem 1.25rem; }
.mform label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
/* `type=url` too (the video links). */
.mform input[type=text], .mform input[type=number], .mform input[type=url] {
  width: 100%; padding: 0.5rem 0.625rem; border: 1px solid var(--atp-line-strong);
  border-radius: var(--atp-radius-sm); font: inherit;
  background: var(--atp-surface); color: inherit;
}
.mform input:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 1px; }
.mform .hint { margin: 0.25rem 0 0; color: var(--atp-ink-3); font-size: 13px; line-height: 1.45; }
/* Module edit is full width (ticket 069); its fields and help text keep a reading width. */
.mform input[type=url] { max-width: 40rem; }
.mform .hint { max-width: 70ch; }
.mform .wide { grid-column: 1 / -1; }
.mform .check { display: flex; gap: 0.5rem; align-items: flex-start; }
.mform .check input { margin-top: 0.2rem; }
/* A tick and its words are not bold like a field label. */
.mform label.check { font-weight: 400; margin-bottom: 0; }
.mform label.pickerlabel { display: inline-flex; }

/* Each "who must hold this" alternative as its own quieter block, so the rules do not run together. */
.mform .grid > .wide.check {
  background: var(--atp-surface-alt);
  border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-md);
  padding: 0.875rem 1rem;
}
/* The words and list take the rest of the row, so every block is one width. */
.mform .grid > .wide.check > div { flex: 1; min-width: 0; }
.mform .grid > .wide.check > div > label:first-child {
  font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--atp-ink-2);
}
#mfSites, #mfRoles { display: grid; gap: 0.375rem; margin-top: 0.75rem; }
/* Each choice on its own white ground. */
#mfSites label.check, #mfRoles label.check, #mfPeople label.check {
  background: var(--atp-surface); border: 1px solid var(--atp-line);
  border-radius: var(--atp-radius-sm); padding: 0.4rem 0.625rem; align-items: center;
}
#mfSites label.check small, #mfRoles label.check small, #mfPeople label.check small {
  margin-left: auto; color: var(--atp-ink-3); font-size: 12px; font-weight: 600;
  letter-spacing: 0; text-transform: none; white-space: nowrap;
}
#mfPeople .hint { margin: 0; }

/*
 * The people named on a course, as chips that wrap: the name in the ordinary
 * weight, what tells namesakes apart quieter beside it, and a small cross. The
 * tick box under each is what the form reads, kept focusable but out of sight;
 * unticked, the chip stays, struck through, until the form is saved.
 */
#mfPeople.personchips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.875rem; }
#mfPeople .peopleempty {
  flex: 1; padding: 0.625rem 0.75rem; border: 1px dashed var(--atp-line-strong);
  border-radius: var(--atp-radius-md); background: var(--atp-surface);
}
.mform label.personchip {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%;
  margin: 0; padding: 0.3125rem 0.375rem 0.3125rem 0.75rem;
  background: var(--atp-surface); border: 1px solid var(--atp-line-strong); border-radius: 0;
  font-size: 14px; font-weight: 400; line-height: 1.3; cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.personchip input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.personchip .who { min-width: 0; overflow-wrap: anywhere; }
.personchip .mark { font-size: 12px; color: var(--atp-ink-3); white-space: nowrap; }
.personchip .drop {
  display: inline-grid; place-items: center; flex: none;
  width: 1.375rem; height: 1.375rem; border-radius: 0;
  color: var(--atp-ink-3); font-size: 15px; line-height: 1;
}
.personchip .drop::before { content: "\00d7"; }
.mform label.personchip:hover { border-color: var(--atp-grey-400); }
.personchip:hover .drop { background: var(--atp-grey-100); color: var(--atp-ink); }
.personchip:has(input:focus-visible) { outline: 2px solid var(--atp-deep); outline-offset: 1px; }
/* Unticked: to be taken off on save, and one press puts them back. */
.mform label.personchip:has(input:not(:checked)) {
  background: transparent; border-style: dashed; color: var(--atp-ink-3);
}
.personchip:has(input:not(:checked)) .who { text-decoration: line-through; }
.personchip:has(input:not(:checked)) .drop { width: auto; padding: 0 0.5rem; font-size: 12px; font-weight: 600; }
.personchip:has(input:not(:checked)) .drop::before { content: "Undo"; }

/* The search under the chips: a field label like the form's own, and a full-width box. */
.mform label.personsearch {
  display: flex; margin: 1rem 0 0; gap: 0.375rem;
  font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink);
}
.mform input[type=search] {
  width: 100%; padding: 0.5rem 0.625rem 0.5rem 2.125rem; border: 1px solid var(--atp-line-strong);
  border-radius: var(--atp-radius-sm); font: inherit; font-weight: 400;
  background: var(--atp-surface) no-repeat 0.7rem 50% / 0.9rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  color: inherit;
}

/* The waiting change as a banner inside the form, with its own margin. */
.mform > .panel.review { margin: 1.25rem 1.25rem 0; }
.mform > .panel.review p:last-of-type { margin-bottom: 0.875rem; }
/* A right gap, so wrapped buttons do not indent. */
.mform > .panel.review button { margin: 0 0.5rem 0.25rem 0; }

/* Save and Cancel below a rule; wraps for the error sentence. */
.mform .buttons {
  display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--atp-line);
}
.mform .buttons .bad { color: var(--atp-danger); font-weight: 600; margin: 0; }

@media (max-width: 46rem) {
  .mform .grid { grid-template-columns: minmax(0, 1fr); }
  /* Less padding on a phone. */
  .mform > .panel.review { margin: 1rem 1rem 0; padding: 0.875rem 1rem; }
  .mform .buttons > .big, .mform .buttons > .action { flex: 1 1 auto; text-align: center; }
}

/* A panel heading with a control, `space-between`, wrapping under the heading on a phone. */
.panel > header.withaction {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.panelaction {
  font-size: 13px; font-weight: 600; color: var(--atp-deep); text-decoration: none;
  white-space: nowrap;
}
.panelaction:hover { text-decoration: underline; }
.panelaction:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 2px; border-radius: 0; }

/* The person search's matches: buttons with a second column (a username) to tell namesakes apart. */
.personmatches {
  list-style: none; margin: 0.375rem 0 0; padding: 0.25rem; max-height: 15rem; overflow-y: auto;
  background: var(--atp-surface); border: 1px solid var(--atp-line); border-radius: var(--atp-radius-md);
}
.personmatches li { border-bottom: 1px solid var(--atp-grey-100); }
.personmatches li:last-child { border-bottom: 0; }
.personmatches button {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; padding: 0.5rem 0.625rem; border: 0; border-radius: 0;
  background: none; font: inherit; font-size: 14px; color: inherit; text-align: left; cursor: pointer;
}
.personmatches button:hover { background: var(--atp-grey-50); }
.personmatches button:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }
.personmatches .who { font-weight: 400; flex: 1; min-width: 0; }
/* A quiet plus, darkening on the row under the pointer: the row adds. */
.personmatches .plus {
  display: inline-grid; place-items: center; flex: none; width: 1.25rem; height: 1.25rem;
  border-radius: 0; border: 1px solid var(--atp-line-strong); color: var(--atp-ink-3);
  font-size: 14px; line-height: 1;
}
.personmatches .plus::before { content: "+"; }
.personmatches button:hover .plus, .personmatches button:focus-visible .plus {
  background: var(--atp-deep); border-color: var(--atp-deep); color: #fff;
}
/* The disambiguator, quiet: it is read only when two names collide. */
.personmatches .mark { font-size: 12px; color: var(--atp-ink-3); white-space: nowrap; }
/* "Nobody matches that", and "8 more" -- states, not rows to press. */
.personmatches .none { padding: 0.5rem 0.625rem; font-size: 13px; color: var(--atp-ink-3); }

/* A module not asked of this person: quieter than "Not started", which is work to chase. */
.matrix td.notasked { color: var(--atp-ink-4); }
.matrix td.notasked b { font-weight: 400; }

/* The Marking screen: the queue (two links per row, so not `.reasons`) and one paper's record. */
.waiting { list-style: none; margin: 0; padding: 0; }
.waiting li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.25rem 0.875rem 0.25rem 0; border-bottom: 1px solid var(--atp-line);
}
.waiting li:last-child { border-bottom: 0; }
.waiting .paper {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; padding: 0.625rem 0.875rem; border-radius: var(--atp-radius-sm);
  color: inherit; text-decoration: none;
}
.waiting .paper:hover { background: var(--atp-grey-50); }
.waiting .paper:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; }
.waiting .what { display: block; min-width: 0; }
.waiting .what .lede { display: block; font-size: 12px; color: var(--atp-ink-3); }
.waiting .how { flex: none; text-align: right; white-space: nowrap; }
.waiting .how b { display: block; font-size: 13px; color: var(--atp-warning); }
.waiting .how small { font-size: 11px; color: var(--atp-ink-4); }
/* The person, quiet, because the row is about the paper. */
.waiting .who { flex: none; font-size: 12px; font-weight: 600; color: var(--atp-ink-3); text-decoration: none; }
.waiting .who:hover { color: var(--atp-deep); text-decoration: underline; }

/* Where the paper stands. One word, then the arithmetic or the reason. */
.marking .state { margin: 0.25rem 0; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.marking .state.marked { color: var(--atp-success); }
.marking .state.waiting { color: var(--atp-warning); }
.marking .score { margin: 0.25rem 0; font-size: 15px; }
.marking .score .ok { color: var(--atp-success); font-weight: 700; }
.marking .score .bad { color: var(--atp-danger); font-weight: 700; }
.marking .jump { margin: 0.5rem 0 0; font-size: 13px; }
.quiet { font-size: 12px; color: var(--atp-ink-3); }

/* One question, and the evidence under it. */
.q {
  background: var(--atp-surface); border: 1px solid var(--atp-line); border-radius: var(--atp-radius-md);
  padding: 1rem 1.125rem; margin-top: 0.75rem; box-shadow: var(--atp-shadow-1);
}
/* A question nothing has been said about, marked on its card. */
.q.pending { border-left: 3px solid var(--atp-warning-mark); }
.q > header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.q h3 { margin: 0; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--atp-ink-3); }
.q h4 { margin: 0.875rem 0 0.25rem; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--atp-ink-3); }
.q .tag {
  font-size: 11px; font-weight: 700; padding: 0.125rem 0.5rem; border-radius: 0;
  background: var(--atp-grey-100); color: var(--atp-ink-2);
}
.q.pending .tag { background: var(--atp-warning-tint); color: var(--atp-warning); }
.q .prompt { margin: 0.375rem 0 0; font-weight: 600; }
.q .answer {
  margin: 0; padding: 0.625rem 0.875rem; border-left: 3px solid var(--atp-line-strong);
  background: var(--atp-surface-alt); white-space: pre-wrap; overflow-wrap: anywhere;
}
.q .decide { margin: 0.75rem 0 0; padding: 0.625rem 0.75rem; border: 1px solid var(--atp-line); border-radius: 0; }
.q .decide p { margin: 0.125rem 0; }
.q .decide .advice { font-size: 13px; color: var(--atp-ink-3); }
.q .decide .person { font-weight: 600; }
.q .decide .person.right { color: var(--atp-success); }
.q .decide .person.wrong { color: var(--atp-danger); }
.q .decide .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.q .decide button[aria-pressed="true"] { outline: 2px solid var(--atp-ink); outline-offset: 1px; }
.q .points { list-style: none; margin: 0; padding: 0; }
.q .points li { display: flex; gap: 0.75rem; padding: 0.375rem 0; border-bottom: 1px solid var(--atp-line); }
.q .points li:last-child { border-bottom: 0; }
.q .points .verdict { flex: none; width: 7.5rem; font-size: 12px; font-weight: 700; }
.q .points li.yes .verdict { color: var(--atp-success); }
.q .points li.no .verdict { color: var(--atp-danger); }
/* Never red: silence is not the candidate's failure. */
.q .points li.none .verdict { color: var(--atp-ink-3); }
.q .points .text { flex: 1 1 auto; min-width: 0; }
.q .points .text small { display: block; font-size: 12px; color: var(--atp-ink-3); }
/* The sentence the candidate was shown, set like their answer. */
.q .feedback {
  margin: 0; padding: 0.625rem 0.875rem; border-left: 3px solid var(--atp-accent);
  background: var(--atp-surface-alt); white-space: pre-wrap; overflow-wrap: anywhere;
}
.q .transcript { margin-top: 0.875rem; font-size: 13px; }
.q .transcript summary { cursor: pointer; color: var(--atp-ink-2); font-weight: 600; }
.q .transcript pre {
  margin: 0.25rem 0 0.75rem; padding: 0.625rem 0.75rem; border-radius: var(--atp-radius-sm);
  background: var(--atp-surface-alt); font-family: var(--atp-font-mono); font-size: 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 22rem; overflow-y: auto;
}

/* A dangerous answer, above the key points it overrides. */
.q .danger {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--atp-danger);
  background: var(--atp-danger-wash, rgba(179, 38, 30, 0.07));
  border-radius: 0;
  font-size: 14px;
  line-height: 1.45;
}
.q .danger strong { display: block; color: var(--atp-danger); }

/*
 * A flow split into one page per step (`stepper.ts`): the numbered row on top,
 * the current step marked, earlier ones links back; Back and Next at the foot.
 */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.5rem; }
.stepper li { flex: 1 1 0; min-width: 0; }
.stepper .step {
  display: flex; align-items: center; gap: 0.625rem; height: 100%; padding: 0.625rem 0.875rem;
  border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface);
  color: var(--atp-ink-3); font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.stepper a.step { color: var(--atp-ink-2); }
.stepper a.step:hover { border-color: var(--atp-deep); color: var(--atp-deep); }
.stepper .step-num {
  flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 0;
  background: var(--atp-surface-2); color: var(--atp-ink-3); font-size: 13px; font-weight: 700;
}
.stepper .step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper .step-count {
  margin-left: auto; padding: 0 0.5rem; border-radius: 0; background: var(--atp-surface-2);
  color: var(--atp-ink-2); font-size: 12.5px;
}
.stepper .done .step-num { background: var(--atp-success-tint); color: var(--atp-success); }
.stepper .current .step { border: 2px solid var(--atp-deep); background: var(--atp-deep-tint); color: var(--atp-ink); }
.stepper .current .step-num { background: var(--atp-deep); color: #fff; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.panel > .step-nav { padding: 1rem 1.25rem; border-top: 1px solid var(--atp-line); }
.step-nav > [hidden] + button, .step-nav > button:only-child { margin-left: auto; }
@media (max-width: 40rem) {
  /* A phone keeps the numbers and the current step's name. */
  .stepper { gap: 0.375rem; }
  .stepper .step { padding: 0.5rem 0.625rem; gap: 0.5rem; }
  .stepper li:not(.current) { flex: none; }
  .stepper li:not(.current) .step-label, .stepper li:not(.current) .step-count { display: none; }
  .step-nav button { flex: 1 1 auto; }
}

/* A subcontractor's submission page: one step per page, a card per worker. */
.submit-page { max-width: none; }
.plain-steps { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.file button.linklike {
  padding: 0; min-height: 0; background: none; border: 0; box-shadow: none;
  color: var(--atp-deep); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.file button.linklike:hover { background: none; color: var(--atp-accent); }
#submitStale[hidden] + p { margin-top: 0; }
.review-table { margin: 0.75rem 0 1.25rem; font-size: 14px; }
.review-table td:first-child b, .review-table td:first-child span { display: block; }
.review-table td:first-child span { color: var(--atp-ink-3); }
.review-table .ok { color: var(--atp-success); font-weight: 600; }
.review-table td span.warn { color: var(--atp-warning); font-weight: 600; }
@media (max-width: 40rem) {
  .review-table thead { display: none; }
  .review-table tbody tr { display: grid; gap: 0.125rem; padding: 0.75rem 0; border-bottom: 1px solid var(--atp-line); background: none; }
  .review-table td { padding: 0; border: 0; background: none; }
  .review-table td:first-child { margin-bottom: 0.25rem; }
  .review-table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 6rem; color: var(--atp-ink-3); }
}
.dropzone {
  display: grid; justify-items: center; gap: 0.25rem; padding: 2rem 1rem; margin: 0.75rem 0;
  border: 2px dashed var(--atp-info); border-radius: 0; background: var(--atp-info-tint);
  cursor: pointer; text-align: center; transition: var(--atp-tx);
}
.dropzone:hover, .dropzone.over { background: #cfeafc; border-color: var(--atp-deep); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-main { font-size: 1.25rem; font-weight: 700; color: var(--atp-deep); }
.dropzone-sub { color: var(--atp-ink-3); }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.file { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 0.125rem 1rem;
  padding: 0.4rem 0.75rem; border-radius: 0; background: var(--atp-surface-2); font-size: 14px; }
@media (max-width: 40rem) {
  .file { grid-template-columns: minmax(0, 1fr) auto; }
  .file .file-said { grid-row: 2; grid-column: 1; text-align: left; }
}
.file.read, .file.list { background: var(--atp-success-tint); }
.file.reading { background: var(--atp-warning-tint); }
.file.unreadable, .file.refused { background: var(--atp-danger-tint); }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-said { color: var(--atp-ink-2); text-align: right; }
.crew { display: grid; gap: 0.75rem; }
/* The subcontractor's people at a glance (2026-11-15, `fixGlance.ts`): a count, then a dropdown of problems and stages (2026-11-16). */
.sf-glance:empty { display: none; }
.sf-glance { display: grid; gap: 0.625rem; margin: 0 0 1rem; padding: 1rem 1.125rem; border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface); }
.sf-glance-h b { font-size: 1.25rem; }
.sf-show { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 14px; font-weight: 600; color: var(--atp-ink-2); }
.sf-show select { min-width: min(16rem, 100%); max-width: 100%; font-size: 14.5px; font-weight: 400; padding: 0.4rem 0.625rem; }
.sf-fold[hidden], .sf-foot-h[hidden], .sf-head[hidden], .sf-ways[hidden], .sf-progress[hidden], .sf-list-h[hidden], #sfItems [data-fix-worker][hidden] { display: none; }
/* The count and filter above the crew (2026-11-15): how many people, how many ready, each problem with its count. */
.crew-summary { display: grid; gap: 0.5rem; padding: 1rem 1.125rem; border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface-alt); }
.crew-summary[hidden] { display: none; }
.crew-total { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.crew-total b { font-size: 1.375rem; color: var(--atp-ink); }
.crew-total span { font-size: 14.5px; color: var(--atp-ink-2); }
.crew-bill { margin: 0; font-size: 13.5px; color: var(--atp-ink-3); }
/* The filter as a dropdown (2026-11-16): grows without crowding the box. */
.crew-show { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; font-size: 14px; font-weight: 600; color: var(--atp-ink-2); }
.crew-show select { min-width: min(16rem, 100%); max-width: 100%; font-size: 14.5px; font-weight: 400; padding: 0.4rem 0.625rem; border-radius: 0; }
.crew-member[hidden] { display: none; }
.crew-who { position: relative; }
.crew-n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; margin-right: 0.5rem; padding: 0 0.25rem; border-radius: 0;
  background: var(--atp-surface-2); color: var(--atp-ink-2); font-size: 12px; font-weight: 700; vertical-align: 1px; box-sizing: border-box; }
.crew-who .crew-n + b { display: inline; }
.crew-count { font-size: 14px; font-weight: 600; color: var(--atp-ink-2); }
.crew-count:empty { display: none; }
/* Step 2's way on stays in view down a long crew. */
.submit-main [data-step-page="crew"] > .step-nav { position: sticky; bottom: 0; z-index: 2; box-shadow: none; }
.crew-member {
  display: grid; grid-template-columns: 2fr 1.4fr 1.2fr; gap: 0.5rem 1rem; align-items: center;
  padding: 0.75rem 1rem; border: 1px solid var(--atp-line); border-left: 4px solid var(--atp-success);
  border-radius: 0; background: var(--atp-surface);
}
.crew-member.incomplete { border-left-color: var(--atp-warning-mark); }
.crew-who b { display: block; }
.crew-who span { color: var(--atp-ink-3); font-size: 14px; }
.crew-born small.label, .crew-trade small.label { display: block; }
.crew-born .needs, .crew-trade .needs { display: none; margin-top: 0.25rem; color: var(--reg-red, var(--atp-danger)); font-size: 13px; font-weight: 600; }
/* Empty and required: a red edge and its note under it, gone once filled (2026-11-18). A date past the latest allowed is said in the card's problems instead. */
.crew-born input:invalid:not(:out-of-range), .crew-trade select:invalid { border: 2px solid var(--reg-red, var(--atp-danger)) !important; }
.crew-born input:invalid:not(:out-of-range) ~ .needs, .crew-trade select:invalid ~ .needs { display: block; }
.crew-docs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.375rem; }
.crew-issues { grid-column: 1 / -1; padding: 0.5rem 0.75rem; border-radius: 0; background: var(--atp-warning-tint); color: var(--atp-warning); font-size: 14px; }
.crew-issues ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.doc-read { display: inline-block; }
.doc-read summary { list-style: none; cursor: pointer; padding: 0.15rem 0.6rem; border-radius: 0; font-size: 13px; font-weight: 600;
  background: var(--atp-success-tint); color: var(--atp-success); }
.doc-read summary::-webkit-details-marker { display: none; }
.doc-read[open] { display: block; flex-basis: 100%; }
.doc-read dl { display: grid; grid-template-columns: auto 1fr; gap: 0.125rem 0.75rem; margin: 0.5rem 0 0.25rem; font-size: 14px; }
.doc-read dt { color: var(--atp-ink-3); }
.doc-read dd { margin: 0; font-weight: 600; }
.doc-chip { padding: 0.15rem 0.6rem; border-radius: 0; font-size: 13px; font-weight: 600;
  background: var(--atp-success-tint); color: var(--atp-success); }
.doc-chip.missing { background: var(--atp-danger-tint); color: var(--atp-danger); }
.loose { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 0; background: var(--atp-warning-tint); }
.loose-file { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 0.5rem; }
.loose-acts { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; min-width: 0; }
/* On a phone the file and its chooser stack, and the chooser fits the width (stage 4: it pushed the page sideways at 360). */
.loose-acts select { min-width: 0; max-width: 100%; }
@media (max-width: 40rem) { .loose-file { flex-wrap: wrap; } .loose-acts { flex: 1 1 100%; } .loose-acts select { flex: 1 1 12rem; } }
.loose-file.placed { padding: 0.375rem 0.625rem; border-radius: 0; background: var(--atp-surface); }
.loose-to { margin-left: 0.375rem; font-weight: 600; color: var(--atp-ink); }
.quiet-details { margin-top: 1rem; color: var(--atp-ink-3); font-size: 14px; }
@media (max-width: 40rem) { .crew-member { grid-template-columns: 1fr; } }
.verdict-group { margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: 0; border-left: 4px solid var(--atp-line-strong); }
.verdict-group.eligible { background: var(--atp-success-tint); border-left-color: var(--atp-success); }
.verdict-group.outstanding { background: var(--atp-danger-tint); border-left-color: var(--atp-danger); }
.verdict-group.needs_review { background: var(--atp-danger-tint); border-left-color: var(--atp-danger); }
.verdict-group h3 { margin: 0 0 0.25rem; font-size: 16px; }
.verdict-group .next { margin: 0 0 0.5rem; }
.verdict-group ul { margin: 0; padding-left: 1.25rem; }

/* Prequalification for a PIC: one page per step; links, then the groups worst first. */
.project-pick { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.project-pick[hidden] { display: none; }
.sub-row { display: grid; gap: 0.5rem; padding: 0.875rem 0; border-bottom: 1px solid var(--atp-line); }
.sub-row:first-child { padding-top: 0; }
.sub-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.sub-row b { display: block; }
.sub-row span { color: var(--atp-ink-3); font-size: 14px; }
.register-step { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
.register-step > div { min-width: 0; }
.register-step p { margin-top: 0; }
.register-code { width: 11rem; padding: 0.5rem; border: 1px solid var(--atp-line); border-radius: 0; background: #fff; }
.register-code svg { display: block; width: 100%; height: auto; }
.register-code:empty { display: none; }
.copy-line { display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }
.copy-line input { flex: 1; min-width: 0; font-family: var(--atp-font-mono); font-size: 13px; background: var(--atp-surface-2); }
a.button {
  display: inline-block; font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 0;
  text-decoration: none; white-space: nowrap;
}
a.button.primary { background: var(--atp-primary); color: var(--atp-primary-ink); }
a.button.primary:hover { background: var(--atp-primary-hover); }
a.button.secondary { background: var(--atp-surface); color: var(--atp-deep); border: 1.5px solid var(--atp-deep); }
a.button.secondary:hover { color: var(--atp-accent); border-color: var(--atp-accent); }
.empty { color: var(--atp-ink-3); font-style: italic; margin: 0.25rem 0; }
.reasons { margin: 0.5rem 0; padding-left: 1.25rem; }
.override { display: grid; grid-template-columns: 2fr 1fr auto; gap: 0.5rem; }
.thread { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.message { display: grid; gap: 0.125rem; padding: 0.5rem 0.75rem; border-radius: 0; font-size: 14px; }
.message.pic { background: var(--atp-info-tint); }
.message.subcontractor { background: var(--atp-surface-2); }
.message small { color: var(--atp-ink-3); }
.ask { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-top: 0.75rem; }
/* The PIC's two pickers, the loop back to a subcontractor, and the roster badge. */
.prequal-picks { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.prequal-picks select { min-width: 12rem; }
button.send-back {
  padding: 0.875rem 1.5rem; font-size: 15px; border-radius: 0;
  background: var(--atp-warning); color: #fff; border: 0; box-shadow: var(--atp-shadow-2);
}
button.send-back:hover { background: #3f3f46; }
button.send-back::before { content: '↩ '; font-weight: 700; }
button.roster-badge {
  margin-top: 0.75rem; padding: 0.5rem 1rem; border-radius: 0;
  background: var(--atp-success-tint); color: var(--atp-success); border: 1.5px solid var(--atp-success); font-weight: 700;
}
button.roster-badge:hover { background: var(--atp-success); color: #fff; }
.prequal-dialog {
  width: min(44rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 1.5rem;
  border: 0; border-radius: 0; box-shadow: none;
}
.prequal-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.prequal-dialog h2 { margin: 0 0 0.5rem; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.25rem; }
.prequal-dialog textarea { width: 100%; font: inherit; padding: 0.5rem; border: 1px solid var(--atp-line-strong); border-radius: 0; }
.roster-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.375rem 1rem; margin: 1rem 0; }
.roster-facts dt { color: var(--atp-ink-3); }
.roster-facts dd { margin: 0; font-weight: 600; }
/* Grid children may shrink below their content, or a long link pushes the page wide. */
.copy-line, .sub-row { min-width: 0; }
@media (max-width: 52rem) {
  .override, .ask, .register-step { grid-template-columns: 1fr; }
  .copy-line { flex-wrap: wrap; }
  .copy-line input { flex-basis: 100%; }
  .head .project-pick { margin-top: 0.5rem; }
}

/* A project's name opens its people: a link in looks, a button in kind. */
#projectList button.linklike {
  background: none; border: 0; padding: 0; min-height: 0; box-shadow: none;
  color: var(--atp-deep); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}

/* A project's registration QR code: one A4 page when printed, the code as large as it reads. */
.qr-body { background: #fff; }
.qr-sheet { margin: 2rem 2rem 1rem; padding: 2rem; text-align: center; border: 3px solid var(--atp-deep); border-radius: 0; }
.qr-project { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-accent); }
.qr-title { margin: 0.25rem 0 1rem; font-size: 2.5rem; }
.qr-lines span, .qr-ready span { display: block; }
.qr-lines { font-size: 1.75rem; font-weight: 700; margin: 0 0 1rem; }
.qr-code { width: min(22rem, 80vw); margin: 0 auto 1rem; }
.qr-code svg { width: 100%; height: auto; display: block; }
.qr-ready { font-size: 1.125rem; margin: 0 0 1rem; }
.qr-link { font-family: var(--atp-font-mono); font-size: 14px; color: var(--atp-ink-3); overflow-wrap: anywhere; margin: 0; }
.qr-actions { margin: 0 2rem 2rem; text-align: center; }
@media print {
  .qr-actions { display: none; }
  .qr-sheet { margin: 0 auto; border-width: 2px; }
}

/* Opening a kept prequalification document (0045). */
a.view-doc { font-weight: 600; color: var(--atp-deep); white-space: nowrap; }
a.view-doc::after { content: ' ↗'; font-size: 0.85em; }
.file a.view-doc { margin-left: 0.75rem; }
.open-docs { margin: 0.5rem 0 0; font-size: 14px; }
.doc-read a.view-doc { display: inline-block; margin-top: 0.25rem; }

/* A message keeps its own line breaks. */
.message span { white-space: pre-line; }

/* The PIC's remarks, hard to miss. */
.sentback-banner { padding: 0.875rem 1.125rem; border-radius: 0; background: var(--atp-warning-tint);
  border-left: 5px solid var(--atp-warning-mark); color: var(--atp-ink); }
.sentback-banner b { color: var(--atp-warning); }
.sentback-banner a { margin-left: 0.5rem; font-weight: 700; color: var(--atp-deep); }

/* The PIC's comment on a decision: its own box, labelled, on both sides. */
.pic-comment { display: grid; gap: 0.125rem; margin: 0.625rem 0; padding: 0.625rem 0.875rem; border-radius: 0;
  background: #eef2ff; border-left: 4px solid var(--atp-deep); }
.pic-comment > b { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--atp-deep); }
.pic-comment > span { font-size: 15px; font-weight: 600; color: var(--atp-ink); white-space: pre-line; }
.pic-comment > small { color: var(--atp-ink-3); }

/* ---- Subcontractor page (2026-10-09 redesign) ---- */
/* No top bar and no rail on this page: no room kept for either, the column centred. */
main.submit-main { margin-left: 0; padding: 1.5rem 2rem 6rem; }
.submit-main .submit-page { margin: 0; }
.submit-main .submit-page .head { margin-bottom: 1rem; }
.submit-main .submit-page h1 { font-size: 1.625rem; }
.submit-main .submit-page .stack { gap: 0.875rem; }
.sentback-banner.done { background: var(--atp-success-tint); border-left-color: var(--atp-success); }
.sentback-banner.done b { color: var(--atp-success); }

/* Two ways to send: all at once (first, big) or one worker at a time. */
.sf-ways { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: stretch; }
.sf-way-all { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.125rem 1rem; align-items: center;
  padding: 1rem 1.25rem; border: 2.5px dashed var(--atp-info); border-radius: 0; background: var(--atp-info-tint); cursor: pointer; font-weight: 400; }
.sf-way-all.over, .sf-way-all:hover { border-color: var(--atp-deep); background: #cfeafc; }
.sf-way-all input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sf-way-all svg { grid-row: span 3; width: 2.5rem; height: 2.5rem; color: var(--atp-info); }
.sf-step { font-size: 11.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }
.sf-way-all .sf-step { color: var(--atp-info); }
.sf-way-all h2 { font-size: 1.25rem; font-weight: 700; color: var(--atp-deep); letter-spacing: -0.01em; }
.sf-way-all p { margin: 0; color: var(--atp-ink-2); font-size: 14.5px; line-height: 1.45; }
.sf-way-all p small { color: var(--atp-ink-3); font-size: 12.5px; }
.sf-choose { grid-column: 3; grid-row: 1 / span 3; display: inline-block; padding: 10px 16px; border-radius: 0;
  background: var(--atp-primary); color: var(--atp-primary-ink); font-size: 14px; font-weight: 600; white-space: nowrap; text-align: center; }

.sf-dropsum { margin: 0; font-size: 14px; color: var(--atp-ink-2); }
.sf-dropsum:empty, #sfTray:empty, .sf-said:empty { display: none; }
.sf-dropsum b { color: var(--atp-success); }
.sf-warnword { color: var(--atp-warning); font-weight: 700; }

/* Files that went with nobody. */
.sf-tray { padding: 0.625rem 0.875rem; border-radius: 0; background: var(--atp-warning-tint); border: 1px solid #fcd9a0; }
.sf-tray h3 { margin: 0 0 0.25rem; font-size: 14.5px; }
.sf-tray h3 small { font-weight: 400; color: var(--atp-ink-2); }
.sf-tray ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
.sf-tray li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center; padding: 0.4rem 0.75rem;
  border-radius: 0; background: var(--atp-surface); font-size: 14px; }
.sf-tray li > * { min-width: 0; }
.sf-what b { overflow-wrap: anywhere; }
.sf-what span { color: var(--atp-ink-2); }
.sf-acts { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sf-tray select { padding: 0.25rem 0.5rem; font-size: 14px; max-width: 100%; min-width: 0; }
.sf-linkbtn { padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; color: var(--atp-deep); font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sf-linkbtn:hover { background: none; color: var(--atp-accent); }

/* Count, progress, search and Send: kept on screen while scrolling. */
.sf-progress { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; align-items: center;
  padding: 0.625rem 1rem; margin: 0 -1rem; background: rgb(248 249 250 / 97%); border-bottom: 1px solid var(--atp-line); backdrop-filter: blur(4px); }
.sf-progress.sf-static { position: static; }
.sf-count { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.sf-count b { font-size: 1.0625rem; }
.sf-count span { font-size: 14px; color: var(--atp-ink-2); }
.sf-count strong { color: var(--atp-success); }
.sf-bar { grid-column: 1; height: 0.4375rem; border-radius: 0; background: var(--atp-grey-200); overflow: hidden; }
.sf-bar i { display: block; width: 0; height: 100%; background: var(--atp-success); border-radius: 0; transition: width 0.2s ease; }
.sf-progress .sf-send { grid-row: 1 / span 2; grid-column: 2; font-size: 15px; padding: 10px 18px; }
.sf-progress .sf-said { grid-column: 1 / -1; margin: 0; font-size: 14px; font-weight: 600; }
.sf-finder { grid-column: 1 / -1; display: flex; gap: 0.5rem 0.75rem; flex-wrap: wrap; align-items: center; }
.sf-findbox { position: relative; flex: 1 1 18rem; min-width: 0; display: block; margin: 0; }
.sf-findbox svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--atp-ink-3); pointer-events: none; }
.sf-findbox input { width: 100%; font-size: 15px; padding: 0.5rem 2.25rem; border-radius: 0; border: 1.5px solid var(--atp-line-strong); background: var(--atp-surface); }
.sf-findbox input:not(:placeholder-shown) { border-color: var(--atp-deep); }
.sf-clear { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0;
  border-radius: 0; border: 0; background: var(--atp-surface-2); color: var(--atp-ink-2); font-size: 15px; line-height: 1; }
.sf-clear:hover { background: var(--atp-grey-200); color: var(--atp-ink); }
.sf-findbox input:placeholder-shown + .sf-clear { display: none; }
.sf-filters { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.sf-filters button { background: var(--atp-surface); color: var(--atp-ink-2); border: 1px solid var(--atp-line-strong); border-radius: 0; padding: 4px 12px; font-size: 13px; min-height: 0; }
.sf-filters button:hover { background: var(--atp-surface-2); color: var(--atp-ink); }
.sf-filters button.on { background: var(--atp-deep); color: #fff; border-color: var(--atp-deep); }
.sf-showing { font-size: 13px; color: var(--atp-ink-3); white-space: nowrap; }
.sf-showing b { color: var(--atp-ink); }

/* The workers to correct: a card each, or one line opening to it in a long list. */
.sf-list, #sfItems { display: grid; gap: 0.5rem; }
.sf-list-h { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 0.125rem 0 -0.125rem; }
.sf-list-h h2 { font-size: 1.0625rem; }
.sf-list-h p { margin: 0; font-size: 13.5px; color: var(--atp-ink-3); }
.sf-nomatch { padding: 1.25rem; border: 1px dashed var(--atp-line-strong); border-radius: 0; text-align: center; color: var(--atp-ink-2); background: var(--atp-surface); }
.sf-nomatch b { color: var(--atp-ink); }
.sf-nomatch button { margin-top: 0.5rem; }
.sf-num { flex: none; display: inline-grid; place-items: center; min-width: 1.625rem; height: 1.625rem; padding: 0 0.375rem; border-radius: 0;
  background: var(--atp-deep); color: #fff; font-size: 12.5px; font-weight: 700; }
.ready .sf-num { background: var(--atp-success); }
.sf-of { font-size: 12.5px; color: var(--atp-ink-3); }
.sf-card { border: 1px solid var(--atp-line); border-radius: 0; padding: 0.75rem 0.875rem; display: grid; gap: 0.5rem; background: var(--atp-surface); }
.sf-card > *, .sf-inner > * { min-width: 0; }
.sf-card.ready { border-color: #86d5b4; box-shadow: inset 4px 0 0 var(--atp-success); }
.sf-whead { display: flex; flex-wrap: wrap; gap: 0.25rem 0.625rem; align-items: center; }
.sf-whead b { font-size: 15px; }
.sf-fin { color: var(--atp-ink-3); font-size: 14px; }
.sf-pill { margin-left: auto; padding: 0.125rem 0.65rem; border-radius: 0; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sf-pill.needs_review { background: var(--atp-danger-tint); color: var(--atp-danger); }
.sf-pill.outstanding { background: var(--atp-danger-tint); color: var(--atp-danger); }
.sf-pill.ready { background: var(--atp-success-tint); color: var(--atp-success); }
.sf-meta { display: flex; flex-wrap: wrap; gap: 0.125rem 1.25rem; font-size: 13px; color: var(--atp-ink-2); }
.sf-meta summary { cursor: pointer; }
.sf-meta ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.sf-box { display: grid; gap: 0.375rem; }
.sf-placed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 1rem; align-items: center; padding: 0.375rem 0.75rem; border-radius: 0;
  background: var(--atp-success-tint); font-size: 14px; }
.sf-placed .sf-line { overflow-wrap: anywhere; }
.sf-placed .sf-line b { color: var(--atp-success); }
.sf-placed .sf-how { grid-column: 1; font-size: 12.5px; color: var(--atp-success); }
.sf-placed .sf-acts { grid-row: 1 / span 2; grid-column: 2; }
.sf-placed.reading { background: var(--atp-surface-2); color: var(--atp-ink-2); }
.sf-placed.warn { background: var(--atp-danger-tint); }
.sf-placed.warn .sf-line b, .sf-placed.warn .sf-how { color: var(--atp-danger); }
.sf-placed.bad { background: var(--atp-danger-tint); }
.sf-placed.bad .sf-line b, .sf-placed.bad .sf-how { color: var(--atp-danger); }
/* Trade (and a date of birth), then Send at the end of the line; the reply to the PIC sits under the conversation. */
.sf-wfoot { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 0.375rem 0.75rem; align-items: end; }
.sf-wfoot.born { grid-template-columns: auto 11rem auto; }
/* Replace file (stage 4, P20): a bordered button over a hidden chooser; a file dropped on it goes with this person. */
.sf-wfoot label.sf-replace { position: relative; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
  color: var(--reg-ink, var(--atp-ink)); cursor: pointer; padding: 6px 14px; border: 1px solid currentColor; background: var(--reg-paper, #fff); border-radius: 0; }
.sf-wfoot label.sf-replace input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sf-wfoot label.sf-replace.over { background: var(--atp-surface-2); }
.sf-box:empty { display: none; }
/* One drop box (stage 4, P20): it fills the width now the "one at a time" card is gone. */
.sf-ways { grid-template-columns: minmax(0, 1fr) !important; }
.sf-wfoot label { display: grid; gap: 0.125rem; font-size: 12px; font-weight: 600; color: var(--atp-ink-3); }
.sf-wfoot select, .sf-wfoot input { font-size: 14px; padding: 0.3rem 0.625rem; width: 100%; max-width: 100%; }
.sf-wfoot button { padding: 6px 14px; }
.sf-card > .sf-said, .sf-inner > .sf-said { margin: 0; font-size: 14px; font-weight: 600; }

.sf-row { border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface); }
.sf-row.ready { border-color: #b7e6d1; }
.sf-row > summary { display: grid; grid-template-columns: 1.75rem minmax(0, 1.2fr) 6.5rem minmax(0, 1fr) 7.5rem 1.25rem; gap: 0.25rem 0.875rem; align-items: center;
  padding: 0.375rem 0.75rem; cursor: pointer; list-style: none; font-size: 14px; }
.sf-row > summary::-webkit-details-marker { display: none; }
.sf-row > summary > * { min-width: 0; }
.sf-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-finc { font-size: 13px; color: var(--atp-ink-3); }
.sf-problem { color: var(--atp-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-row > summary .sf-pill { margin-left: 0; justify-self: end; }
.sf-row[open] { border-color: var(--atp-line-strong); box-shadow: none; }
.sf-inner { padding: 0 0.75rem 0.75rem; display: grid; gap: 0.5rem; }
.sf mark { background: #ffe2b0; color: inherit; border-radius: 2px; padding: 0 1px; }

/* The workers with nothing left to send. */
.sf-foot-h { margin: 0.25rem 0 0.5rem; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }
.sf-fold { background: var(--atp-surface); border: 1px solid var(--atp-line); border-radius: 0; margin-bottom: 0.5rem; }
/* Not accepted by the project team (0055): red at the left, the reason in words. */
.sf-fold.sf-rejected { border-left: 4px solid var(--atp-danger); }
.sf-rejected-why { color: var(--atp-danger); font-size: 14px; }
.sf-fold > summary { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; padding: 0.75rem 1.25rem; cursor: pointer; list-style: none; }
.sf-fold > summary::-webkit-details-marker { display: none; }
.sf-fold > summary b { font-size: 1rem; }
.sf-fold > summary span { font-size: 14px; color: var(--atp-ink-3); }
.sf-fold-body { padding: 0 1.25rem 0.875rem; font-size: 14px; }
.sf-fold-body p { margin: 0 0 0.375rem; color: var(--atp-ink-2); overflow-wrap: anywhere; }
.sf-fold-body ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.25rem; }

.sf-phone-send { display: none; }
@media (max-width: 40rem) {
  main.submit-main { padding: 1rem 1rem 6rem; }
  .sf-ways { grid-template-columns: 1fr; gap: 0.375rem; }
  .sf-way-or { justify-self: center; }
  .sf-way-all { grid-template-columns: auto minmax(0, 1fr); padding: 0.875rem; gap: 0.125rem 0.75rem; }
  .sf-way-all svg { grid-row: span 2; width: 2rem; height: 2rem; }
  .sf-way-all h2 { font-size: 1.125rem; }
  .sf-way-all p { grid-column: 1 / -1; }
  .sf-choose { grid-column: 1 / -1; grid-row: auto; margin-top: 0.375rem; }
  .sf-way-one { padding: 0.75rem 0.875rem; }
  .sf-progress .sf-send { display: none; }
  .sf-progress { grid-template-columns: 1fr; }
  .sf-phone-send { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 0.625rem 1rem;
    background: var(--atp-surface); border-top: 1px solid var(--atp-line); box-shadow: none; }
  .sf-phone-send button { width: 100%; font-size: 15px; padding: 11px; }
  .sf-tray li { grid-template-columns: 1fr; }
  .sf-tray .sf-acts { justify-content: flex-start; }
  .sf-tray .sf-acts select { flex: 1 1 100%; }
  .sf-wfoot, .sf-wfoot.born { grid-template-columns: 1fr; }
  .sf-wfoot button { width: 100%; }
  .sf-placed { grid-template-columns: 1fr; }
  .sf-placed .sf-acts { grid-row: auto; grid-column: 1; justify-content: flex-start; }
  .sf-findbox { flex-basis: 100%; }
  .sf-row > summary { grid-template-columns: 1.75rem minmax(0, 1fr) auto 1.25rem; gap: 0 0.625rem; padding: 0.375rem 0.625rem; }
  .sf-row > summary .sf-num { grid-row: span 2; }
  .sf-row > summary .sf-finc { grid-column: 2; grid-row: 2; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sf-row > summary .sf-finc::after { content: ' · ' attr(data-problem); }
  .sf-row > summary .sf-problem { display: none; }
  .sf-row > summary .sf-pill { grid-column: 3; grid-row: 1 / span 2; }
  .sf-row > summary > .chev { grid-column: 4; grid-row: 1 / span 2; }
}

/* ---- PIC prequalification (2026-10-09 redesign) ---- */
/* The PIC's page (prequalification.html): title and pickers on one line, three tabs, five counts and a search
   kept under the top bar, one numbered queue whose rows open on what the check read. Every class is `pq-`. */
.pq-phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap; margin-bottom: 0.625rem; }
.pq-phead h1 { font-size: 1.625rem; margin: 0; }
.pq-phead p { margin: 0.125rem 0 0; font-size: 14px; color: var(--atp-ink-2); }
.pq-phead .prequal-picks { gap: 0.75rem; }
.pq-phead .prequal-picks select { min-width: 0; max-width: 16rem; font-size: 14px; padding: 0.375rem 0.625rem; }
.pq-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--atp-line); overflow-x: auto; scrollbar-width: none; }
.pq-tabs a { padding: 0.5rem 0.75rem; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--atp-ink-3);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pq-tabs a.on { color: var(--atp-ink); border-bottom-color: var(--atp-deep); }
.pq-tabs a small { margin-left: 0.25rem; padding: 0 0.4rem; border-radius: 0; background: var(--atp-surface-2); font-size: 12px; color: var(--atp-ink-2); }
.pq-tabpage { margin-top: 1rem; }

.pq-pin { position: sticky; top: var(--bar); z-index: 30; display: grid; gap: 0.5rem; padding: 0.625rem 0;
  background: var(--atp-surface-alt); border-bottom: 1px solid var(--atp-line); }
.pq-states { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.375rem; }
button.pq-st { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.375rem 0.625rem; border-radius: 0; border: 1px solid var(--atp-line);
  background: var(--atp-surface); color: var(--atp-ink-2); font-size: 13px; font-weight: 400; line-height: 1.25; text-align: left; min-width: 0; }
button.pq-st:hover { background: var(--atp-surface-2); color: var(--atp-ink); }
button.pq-st b { font-size: 1.25rem; color: var(--atp-ink); }
button.pq-st.act { border-color: var(--atp-deep); box-shadow: inset 0 -3px 0 var(--atp-deep); }
button.pq-st.act b { color: var(--atp-deep); }
button.pq-st.zero { opacity: 0.55; }
.pq-finder { display: flex; gap: 0.5rem 0.75rem; align-items: center; flex-wrap: wrap; }
.pq-findbox { position: relative; flex: 1 1 20rem; min-width: 0; display: block; margin: 0; }
.pq-findbox svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--atp-ink-3); pointer-events: none; }
.pq-findbox input[type="text"] { width: 100%; box-sizing: border-box; font-size: 15px; padding: 0.45rem 2.25rem; border-radius: 0; border: 1.5px solid var(--atp-line-strong); }
.pq-findbox input:not(:placeholder-shown) { border-color: var(--atp-deep); }
button.pq-clear { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 1.75rem; height: 1.75rem; padding: 0;
  border-radius: 0; background: var(--atp-surface-2); color: var(--atp-ink-2); font-size: 15px; line-height: 1; }
button.pq-clear:hover { background: var(--atp-grey-200); color: var(--atp-ink); }
button.pq-clear:active { transform: translateY(-50%); }
button.pq-clear[hidden] { display: none; }
.pq-showing { font-size: 13px; color: var(--atp-ink-3); white-space: nowrap; }
.pq-showing b { color: var(--atp-ink); }
.pq mark { background: #ffe2b0; color: inherit; border-radius: 2px; padding: 0 1px; }

.pq-next { margin-top: 0.75rem; padding: 0.625rem 1rem; border-radius: 0; background: var(--atp-deep-tint); border-left: 5px solid var(--atp-deep); font-size: 15px; }
.pq-next:empty { display: none; }
.pq-next p { margin: 0; }
.pq-next b { color: var(--atp-deep); }
.pq-none { margin: 1rem 0 0; color: var(--atp-ink-3); }

.pq-group { margin-top: 1rem; }
/* The queue's problems (2026-11-15): a dropdown of the kinds anybody has, with how many (2026-11-16). */
.pq-issues:empty { display: none; }
.pq-issues { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin: 0.5rem 0; }
.pq-issues-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 14px; font-weight: 600; color: var(--atp-ink-2); }
.pq-issues-h select { min-width: min(16rem, 100%); max-width: 100%; font-size: 14.5px; font-weight: 400; padding: 0.4rem 0.625rem; }
.pq-group > header { display: flex; align-items: baseline; gap: 0.25rem 0.75rem; flex-wrap: wrap; margin-bottom: 0.375rem; }
.pq-group > header h2 { font-size: 1rem; margin: 0; }
.pq-group > header p { margin: 0; font-size: 13px; color: var(--atp-ink-3); }
/* Add all to roster (2026-11-15): short words, a comfortable height, to the right of its heading. */
.pq-group > header .pq-tickall { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; border: 2px solid var(--reg-ink, #1c2430); font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.pq-group > header .pq-tickall input { width: 1.05rem; height: 1.05rem; margin: 0; }
.pq-group > header .pq-roster-all { margin-left: auto; padding: 0.5rem 1rem; min-height: 2.25rem; font-size: 14px; white-space: nowrap; }
.pq-gact { margin-left: auto; }
.pq-gact button { padding: 7px 14px; }
.pq-rows { display: grid; gap: 0.375rem; }
.pq-rows > *, .pq-pane > *, .pq-head > *, .pq-read > *, .pq-side > * { min-width: 0; }

.pq-row { border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface); }
.pq-row.open { border-color: var(--atp-line-strong); box-shadow: none; }
.pq-head { display: grid; grid-template-columns: 1.1rem 1.875rem minmax(0, 1.5fr) 6.5rem minmax(0, 1.4fr) 9.5rem 12.5rem; gap: 0.75rem;
  align-items: center; padding: 0.375rem 0.75rem; font-size: 14px; min-height: 2.75rem; cursor: pointer; }
.pq-head input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--atp-deep); margin: 0; }
.pq-num { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.625rem; padding: 0 0.375rem; border-radius: 0;
  background: var(--atp-surface-2); color: var(--atp-ink-2); font-size: 12.5px; font-weight: 700; box-sizing: border-box; }
.pq-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pq-name small { font-weight: 400; color: var(--atp-ink-3); font-size: 12.5px; margin-left: 0.375rem; }
.pq-fin { font-size: 13px; color: var(--atp-ink-3); }
.pq-prob { color: var(--atp-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pq-prob.bad { color: var(--atp-danger); }
.pq-head .pq-pill { justify-self: start; }
.pq-br { display: none; }
.pq-head .pq-go { justify-self: end; font-size: 13px; padding: 5px 11px; white-space: nowrap; }
/* The way on (if any) and the row's toggle share the last cell, the arrow always at the far right. */
.pq-end { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.pq-pill { padding: 0.125rem 0.6rem; border-radius: 0; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pq-pill.needs_review { background: var(--atp-danger-tint); color: var(--atp-danger); }
.pq-pill.outstanding { background: var(--atp-danger-tint); color: var(--atp-danger); }
/* Rejected outright (24 Nov 2026): red, with a sign; the reason is a form of its own under the decision. */
.pq-pill.rejected { background: var(--atp-danger-tint); color: var(--atp-danger); border: 1px solid currentColor; }
.pq-reject { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.pq-reject label { display: grid; gap: 0.25rem; font-size: 13px; font-weight: 600; }
.pq-reject textarea { width: 100%; font: inherit; font-weight: 400; }
.pq-reject .pq-acts { justify-content: flex-end; }
.pq-check.bad small { display: block; margin-top: 0.25rem; color: var(--atp-ink-2); }
.pq-pill.eligible { background: var(--atp-success-tint); color: var(--atp-success); }
.pq-pill.waiting { background: var(--atp-surface-2); color: var(--atp-ink-2); }
.pq-pill.resent { background: var(--atp-info-tint); color: var(--atp-info); }

/* The open row: what was read, each column a link to its document, beside what is wrong and the decision. */
.pq-pane { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1rem 1.25rem; padding: 0.75rem 0.875rem 0.875rem; border-top: 1px solid var(--atp-line); }
.pq-read, .pq-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; align-content: start; }
.pq-read h3 { margin: 0; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }
.pq-cmpwrap { overflow-x: auto; }
.pq-cmp { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.pq-cmp th, .pq-cmp td { text-align: left; padding: 0.375rem 0.625rem; border-bottom: 1px solid var(--atp-line); vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
.pq-cmp thead th { font-weight: 600; vertical-align: bottom; background: var(--atp-surface-alt); }
.pq-cmp thead th:first-child { width: 7.5rem; background: none; }
.pq-cmp thead a, .pq-cmp thead .pq-gone { display: block; font-size: 14px; color: var(--atp-deep); text-decoration: none; }
.pq-cmp thead a b { text-decoration: underline; text-underline-offset: 2px; }
.pq-cmp thead a b::after { content: ' ↗'; display: inline-block; margin-left: 0.125rem; }
.pq-cmp thead small { display: block; font-weight: 400; font-size: 12px; color: var(--atp-ink-3); }
.pq-cmp tbody th { color: var(--atp-ink-3); font-weight: 500; font-size: 13px; text-transform: none; letter-spacing: 0; }
.pq-cmp td.bad { background: var(--atp-danger-tint); color: var(--atp-danger); font-weight: 700; }
.pq-cmp td.ok::after { content: ' ✓'; color: var(--atp-success); font-weight: 700; }
.pq-cmp td.none { color: var(--atp-ink-4); font-style: italic; }
.pq-cmp :is(th, td).missing { background: var(--atp-danger-tint); color: var(--atp-danger); font-weight: 700; }
.pq-cmp thead th.missing b { display: block; font-size: 14px; }
.pq-cmp thead th.missing small { color: var(--atp-danger); }
.pq-cmp :is(th, td).unread { background: #fff8eb; color: #0a0a0a; }
.pq-cmp thead th.unread small.pq-unread { color: #0a0a0a; font-weight: 700; }
.pq-audit, .pq-rule { margin: 0; font-size: 12.5px; color: var(--atp-ink-3); }
.pq-check { margin: 0; padding: 0.5rem 0.75rem; border-radius: 0; font-size: 14px; background: var(--atp-danger-tint); color: var(--atp-danger); }
.pq-check.ok { background: var(--atp-success-tint); color: var(--atp-success); }
.pq-side .pic-comment, .pq-side .thread { margin: 0; }
/* The conversation as a card of its own (2026-11-15): heading, the messages in their own panel, the reply along the foot. */
.pq-convo { display: grid; min-width: 0; border: 1px solid var(--atp-line); border-radius: 0; overflow: hidden; background: var(--atp-surface); }
.pq-convo > header { padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--atp-line); background: var(--atp-surface-alt); }
.pq-convo h4, .pq-decide-h { margin: 0; font-size: 14px; font-weight: 700; color: var(--atp-ink); }
.pq-convo-body { display: grid; gap: 0.5rem; min-width: 0; padding: 0.75rem 0.875rem; max-height: 26rem; overflow-y: auto; }
.pq-convo-empty { margin: 0; font-size: 13px; color: var(--atp-ink-3); text-align: center; }
.pq-convo > .pt-reply { padding: 0.625rem 0.875rem 0.75rem; border-top: 1px solid var(--atp-line); background: var(--atp-surface-alt); }
.pq-decide { display: grid; gap: 0.5rem; padding: 0.625rem 0.75rem; border-radius: 0; background: var(--atp-surface-alt); border: 1px solid var(--atp-line); }
.pq-acts { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.pq-decide label { display: grid; gap: 0.2rem; font-size: 12.5px; font-weight: 600; color: var(--atp-ink-3); }
.pq-decide label.pq-tick { display: flex; gap: 0.5rem; align-items: center; font-size: 14px; color: var(--atp-ink); }
.pq-decide textarea, .pq-sw textarea { min-height: 0; height: 4.5rem; font: 14px/1.45 var(--atp-font-sans); box-sizing: border-box; }
.pq-decide .roster-badge { margin-top: 0; }
.pq button.ghost, .pq-sheet button.ghost { background: var(--atp-surface); color: var(--atp-ink-2); border: 1px solid var(--atp-line-strong); }
.pq button.ghost:hover, .pq-sheet button.ghost:hover { background: var(--atp-surface-2); color: var(--atp-ink); }
.pq button.big, .pq-sheet button.big { font-size: 15px; padding: 10px 18px; }

/* The bar that follows a ticked worker, and the sheet it opens. */
.pq-bulk { position: sticky; bottom: 0.5rem; z-index: 30; display: flex; gap: 0.5rem 1rem; align-items: center; flex-wrap: wrap; margin-top: 0.75rem;
  padding: 0.625rem 1rem; border-radius: 0; background: var(--atp-deep); color: #fff; box-shadow: none; }
.pq-bulk p { margin: 0; font-size: 14px; }
.pq-sp { margin-left: auto; }
button.pq-light { background: #fff; color: var(--atp-deep); }
button.pq-light:hover { background: var(--atp-accent-tint); color: var(--atp-deep); }
button.pq-line { background: transparent; border: 1px solid rgb(255 255 255 / 45%); color: #fff; }
button.pq-line:hover { background: rgb(255 255 255 / 12%); }
/*
 * Send back, a page of its own (2026-11-15): the whole window, not a side panel; the people in a grid of
 * roomy cards, the button in a bar along the foot. Still a <dialog>, so the queue under it keeps its ticks.
 */
dialog.pq-sheet { --pq-gutter: max(1.25rem, calc((100vw - 72rem) / 2)); position: fixed; inset: 0; margin: 0; width: 100vw; max-width: 100vw;
  height: 100dvh; max-height: none; padding: 0; border: 0; background: var(--atp-surface-alt); box-sizing: border-box; }
dialog.pq-sheet::backdrop { background: var(--atp-surface-alt); }
.pq-sheet form { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.pq-sheet #sendBackBody { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.pq-sheet header { padding: 1.25rem var(--pq-gutter) 1rem; border-bottom: 1px solid var(--atp-line); background: var(--atp-surface); }
.pq-sheet header h2 { font-size: 1.5rem; margin: 0.375rem 0 0; }
.pq-sheet header p { margin: 0.375rem 0 0; font-size: 14.5px; color: var(--atp-ink-2); }
.pq-sheet .pq-sheetback { padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; color: var(--atp-ink-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pq-sheet .pq-sheetback:hover { color: var(--atp-ink); text-decoration: underline; }
.pq-sheetlist { overflow: auto; padding: 1.25rem var(--pq-gutter); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr)); gap: 1rem; align-content: start; }
.pq-sheetlist > *, .pq-sw > * { min-width: 0; }
fieldset.pq-sw { display: grid; gap: 0.625rem; align-content: start; margin: 0; padding: 1rem 1.125rem; border: 1px solid var(--atp-line); border-radius: 0; min-width: 0; background: var(--atp-surface); box-shadow: var(--atp-shadow-1); }
.pq-swh { display: flex; gap: 0.25rem 0.5rem; align-items: center; flex-wrap: wrap; font-size: 15px; }
.pq-swh span { color: var(--atp-ink-3); }
.pq-swh .pq-pill { margin-left: auto; }
.pq-swp { margin: 0; font-size: 13.5px; color: var(--atp-ink-2); }
.pq-need { margin: 0; font-size: 13px; font-weight: 600; color: var(--atp-danger); }
.pq-need[hidden] { display: none; }
.pq-sw textarea[aria-invalid="true"] { border-color: var(--atp-danger); }
.pq-sw label { display: grid; gap: 0.25rem; font-size: 13px; font-weight: 600; color: var(--atp-ink-3); }
/* Its own line, the box beside the words: `.pq-sw label` above made it a grid, which stood the box alone in the middle. */
.pq-sw label.pt-no-pick { display: flex; gap: 0.5rem; align-items: center; }
.pq-sheet .pq-sw textarea { height: 6rem; }
.pq-sw select { font-size: 14px; padding: 0.375rem 0.5rem; max-width: 100%; width: 100%; }
.pq-sheet footer { display: flex; gap: 0.75rem; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 0.875rem var(--pq-gutter);
  border-top: 1px solid var(--atp-line); background: var(--atp-surface); box-shadow: none; }
.pq-sheet footer p { margin: 0; font-size: 13px; color: var(--atp-ink-3); }
.pq-sheet button.send-back::before { content: none; }

.pq-nomatch { margin-top: 1rem; padding: 1.25rem; border: 1px dashed var(--atp-line-strong); border-radius: 0; text-align: center; color: var(--atp-ink-2); background: var(--atp-surface); }
.pq-nomatch b { color: var(--atp-ink); }
.pq-nomatch ul { list-style: none; margin: 0.75rem auto; padding: 0; max-width: 34rem; text-align: left; }
.pq-nomatch li { display: flex; gap: 0.25rem 0.75rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0.75rem; border: 1px solid var(--atp-line); border-radius: 0; }
.pq-nomatch li span { color: var(--atp-ink-3); }
.pq-nomatch li a { margin-left: auto; color: var(--atp-deep); font-weight: 600; }
.pq-fold { border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface); margin-top: 1rem; }
.pq-fold > summary { display: flex; align-items: baseline; gap: 0.25rem 0.75rem; flex-wrap: wrap; padding: 0.625rem 0.875rem; cursor: pointer; list-style: none; }
.pq-fold > summary::-webkit-details-marker { display: none; }
.pq-fold > summary span { font-size: 13.5px; color: var(--atp-ink-3); }
.pq-fold .pq-rows { padding: 0 0.5rem 0.5rem; }

@media (max-width: 64rem) {
  .pq-pane { grid-template-columns: minmax(0, 1fr); }
  .pq-head { grid-template-columns: 1.1rem 1.875rem minmax(0, 1.5fr) 6.5rem minmax(0, 1.2fr) auto auto; }
}
@media (max-width: 48rem) {
  .pq-phead p { display: none; }
  .pq-phead .prequal-picks select { max-width: 100%; }
  .pq-pin { gap: 0.375rem; padding: 0.5rem 0; }
  /* Wrapped, never cut off past the screen's edge (fix list P17). */
  .pq-states { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  button.pq-st { padding: 0.25rem 0.625rem; min-height: 2.25rem; font-size: 12.5px; }
  button.pq-st b { font-size: 1.0625rem; }
  .pq-finder { gap: 0.375rem 0.5rem; }
  .pq-findbox { flex-basis: 100%; }
  .pq-head { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; padding: 0.5rem 0.625rem; }
  .pq-head > input { order: 0; }
  .pq-head > .pq-num { order: 1; }
  .pq-head .pq-name { order: 2; flex: 1 1 0; white-space: normal; overflow: visible; overflow-wrap: break-word; }
  .pq-head .pq-pill { order: 3; }
  .pq-br { display: block; order: 4; flex-basis: 100%; height: 0; }
  .pq-head .pq-fin { order: 5; flex: 0 0 auto; }
  .pq-head .pq-prob { order: 6; flex: 1 1 0; white-space: normal; font-size: 13px; }
  .pq-end { display: contents; }
  .pq-head .pq-go { order: 7; flex: 1 1 100%; }
  .pq-pane { padding: 0.625rem; }
  .pq-cmp thead th:first-child { width: 5.25rem; }
  .pq-cmp tbody th { font-size: 12px; }
  .pq-cmp th, .pq-cmp td { padding: 0.3rem 0.4rem; font-size: 13px; }
  .pq-gact { margin-left: 0; width: 100%; }
  .pq-gact button { width: 100%; }
  .pq-sp { margin-left: 0; }
  .pq-bulk button { flex: 1 1 auto; }
}

/* One kept document in its own tab (prequalification/document.html): the file large on a neutral ground. */
body.pqd-body { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-height: 100vh; background: #2a2d33; }
.pqd-head { display: flex; align-items: center; gap: 0.5rem 1.25rem; flex-wrap: wrap; padding: 0.625rem 1.25rem; background: var(--atp-surface); border-bottom: 1px solid var(--atp-line); }
.pqd-what { min-width: 0; }
.pqd-what b { font-size: 1.0625rem; }
.pqd-fin { color: var(--atp-ink-3); font-size: 14px; margin-left: 0.375rem; }
.pqd-type { display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.55rem; border-radius: 0; background: var(--atp-deep-tint); color: var(--atp-deep);
  font-size: 12.5px; font-weight: 700; vertical-align: 2px; }
.pqd-sub { display: block; font-size: 13px; color: var(--atp-ink-3); overflow-wrap: anywhere; }
.pqd-tools { margin-left: auto; display: flex; gap: 0.375rem; align-items: center; flex-wrap: wrap; }
.pqd-tools[hidden], .pqd-tools [hidden] { display: none; }
.pqd-tools button, .pqd-tools a { background: var(--atp-surface); color: var(--atp-ink-2); border: 1px solid var(--atp-line-strong); border-radius: 0;
  padding: 5px 10px; font-size: 13px; font-weight: 600; text-decoration: none; }
.pqd-tools button:hover, .pqd-tools a:hover { background: var(--atp-surface-2); color: var(--atp-ink); }
.pqd-tools .pqd-zoom { min-width: 3.25rem; text-align: center; }
.pqd-strip { display: flex; gap: 0.25rem 1.5rem; flex-wrap: wrap; align-items: baseline; padding: 0.5rem 1.25rem; background: var(--atp-surface-alt);
  border-bottom: 1px solid var(--atp-line); font-size: 13.5px; }
.pqd-strip:empty { display: none; }
.pqd-strip > span { overflow-wrap: anywhere; }
.pqd-strip i { font-style: normal; color: var(--atp-ink-3); margin-right: 0.375rem; font-size: 12px; text-transform: none; letter-spacing: 0; }
.pqd-strip b.bad { color: var(--atp-danger); background: var(--atp-danger-tint); padding: 0 0.375rem; border-radius: 0; }
.pqd-strip small { color: var(--atp-danger); }
.pqd-strip .pqd-audit { margin-left: auto; color: var(--atp-ink-3); font-size: 12.5px; }
.pqd-stage { position: relative; overflow: auto; display: grid; place-items: center; padding: 1.25rem; min-height: 0; }
.pqd-stage img { display: block; max-width: 100%; max-height: var(--pqd-fit, 70vh); object-fit: contain; box-shadow: none;
  background: #fff; transition: transform 0.2s; }
.pqd-stage iframe { width: min(60rem, 100%); height: var(--pqd-fit, 75vh); border: 0; background: #fff; }
.pqd-missing { color: #e5e7eb; text-align: center; max-width: 32rem; }
@media (max-width: 40rem) {
  .pqd-head { padding: 0.5rem 0.75rem; }
  .pqd-tools { margin-left: 0; width: 100%; }
  .pqd-strip { padding: 0.5rem 0.75rem; gap: 0.125rem 1rem; }
  .pqd-strip .pqd-audit { margin-left: 0; }
  .pqd-stage { padding: 0.75rem; }
}

/* A subcontractor's email on the PIC's tab, and the code card on their link (0046). */
.sub-email-line { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.sub-row .sub-noemail { color: var(--atp-danger); }
.sub-row button.linklike {
  padding: 0; min-height: 0; background: none; border: 0; box-shadow: none;
  color: var(--atp-deep); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.sub-row button.linklike:hover { background: none; color: var(--atp-accent); }
.sub-email { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.sub-email input { flex: 1 1 14rem; min-width: 0; }
.code-card { max-width: 28rem; margin-inline: 0; }
.code-card .body { display: grid; gap: 0.875rem; }
.code-card p { margin: 0; }
.code-card form { display: grid; gap: 0.625rem; }
.code-card form[hidden] { display: none; }
.code-input {
  width: 100%; max-width: 12rem; font-family: var(--atp-font-mono); font-size: 26px; letter-spacing: 0.35em;
  text-align: center; padding: 0.5rem 0.25rem;
}
.code-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.code-card button.linklike, .pay-address-line button.linklike {
  padding: 0; min-height: 0; background: none; border: 0; box-shadow: none;
  color: var(--atp-deep); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.code-card button.linklike:disabled { color: var(--atp-ink-3); text-decoration: none; cursor: default; }
@media (max-width: 52rem) {
  .code-card { max-width: none; }
  .code-actions .primary { flex: 1 1 auto; }
}

/* Finding one subcontractor among many (2026-10-09): the picker's count and typing box, and the tab's search. */
.sub-pick { flex-wrap: wrap; }
.sub-pick label { display: inline-flex; align-items: center; gap: 0.375rem; margin: 0; }
.pq-subfind { display: inline-flex; align-items: center; gap: 0.5rem; }
.pq-subfind[hidden] { display: none; }
.pq-subfind input { width: 12rem; min-width: 0; font-size: 14px; font-weight: 400; padding: 0.375rem 0.625rem; }
.pq-findnote { font-size: 13px; font-weight: 400; color: var(--atp-ink-3); }
.pq-findnote:empty { display: none; }
.sub-finder { margin-bottom: 0.875rem; }
.sub-finder[hidden] { display: none; }
@media (max-width: 48rem) {
  .pq-subfind { flex: 1 1 100%; flex-wrap: wrap; }
  .pq-subfind input { flex: 1 1 auto; width: auto; }
}

/* ---- Subcontractor page, polished (2026-10-09) ---- */
/* A band in the platform's own dark and red with its white mark; the project and subcontractor as labelled chips;
   step panels with a kicker; the corrections page restyled in place (its structure is the approved mock-up's). */
body.sub-body { min-height: 100vh; background: var(--atp-surface-alt); }
.sub-band { position: relative; color: #fff; background: linear-gradient(120deg, var(--atp-deep) 0%, var(--atp-panel) 60%, var(--atp-panel-mid) 100%);
  border-bottom: 3px solid var(--atp-accent); }
.sub-band-in { max-width: none; margin: 0; padding: 0.75rem 2rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.sub-logo { display: block; width: 6.5rem; height: auto; }
/* One slim row (2026-11-15): the mark, the page's name, whose link; the band was a third of a laptop screen. */
.sub-band-title { flex: 1 1 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; padding-left: 1.25rem; border-left: 1px solid rgb(255 255 255 / 20%); }
.sub-band h1 { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: #fff; }
.sub-who { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0 0 0 auto; font-size: 13px; color: #e2e8f0; }
.sub-chip { display: inline-flex; align-items: baseline; gap: 0.375rem; padding: 0.125rem 0.625rem; border-radius: 0;
  background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 18%); color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.sub-chip small { font-size: 10.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #cbd5e1; }

main.submit-main { padding-top: 1.5rem; }
.submit-main .submit-page { max-width: none; }
.submit-main .panel { border-radius: 0; box-shadow: var(--atp-shadow-2); margin-bottom: 0; }
.submit-main .panel > header { padding: 1.125rem 1.5rem; }
.submit-main .panel > header h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.submit-main .panel > .body { padding: 1.25rem 1.5rem 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875rem; }
.submit-main .panel > .body > * { margin-top: 0; margin-bottom: 0; }
.submit-main .panel > .step-nav { padding: 1rem 1.5rem; background: var(--atp-surface-alt); border-radius: 0; }
.submit-main .step-nav button { min-width: 7rem; padding: 10px 18px; font-size: 14.5px; }
.sub-step, .sub-kicker { margin: 0; font-size: 13px; color: var(--atp-ink-3); }
.sub-step { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-accent); margin-bottom: 0.125rem; }
.panel > header .sub-kicker { margin-top: 0.25rem; }

/* The code card: centred, an envelope, the six digits large. */
.submit-main .code-card { max-width: 28rem; margin: 1rem 0 0; text-align: center; }
.code-card > header { display: grid; justify-items: center; gap: 0.25rem; border-bottom: 0; padding-top: 1.75rem; }
.sub-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 0.375rem; border-radius: 0;
  background: var(--atp-accent-tint); color: var(--atp-accent); }
.sub-icon svg { width: 1.6rem; height: 1.6rem; }
.submit-main .code-card .body { padding-top: 0.5rem; justify-items: center; }
.code-card form { justify-items: center; width: 100%; }
.code-card .field { font-size: 14px; font-weight: 600; color: var(--atp-ink-2); }
.submit-main .code-input { max-width: 15rem; padding: 0.625rem 0.5rem; font-size: 30px; border: 1.5px solid var(--atp-line-strong); border-radius: 0;
  background: var(--atp-surface-alt); }
/* Stacked under the box, the same width as it: Continue, then the quieter "Send a new code", both centred. */
.code-card .code-actions { flex-direction: column; justify-content: center; gap: 0.75rem; width: 100%; max-width: 15rem; }
.code-card .code-actions .primary { width: 100%; padding: 11px 20px; font-size: 15px; }
.code-card form > .lede { font-size: 13.5px; color: var(--atp-ink-3); }
/*
 * One box per digit (2026-11-15): a real input lies over the boxes, unseen, so typing, pasting, the phone's
 * code autofill and backspace are the browser's own; the boxes only show what it holds. More room around
 * the code and Continue.
 */
.submit-main .code-card .body { padding: 0.75rem 2rem 2rem; gap: 1.25rem; }
.code-card form { gap: 1rem; }
.code-boxes { position: relative; margin: 0.25rem auto 0.5rem; }
.code-cells { display: flex; gap: 0.625rem; justify-content: center; pointer-events: none; }
.code-cell { display: grid; place-items: center; width: 3rem; height: 3.5rem; box-sizing: border-box; border: 1.5px solid var(--atp-line-strong);
  border-radius: 0; background: var(--atp-surface-alt); font: 600 1.625rem/1 var(--atp-font-mono); color: var(--atp-ink); }
.code-cell.active { border-color: var(--atp-accent); box-shadow: var(--atp-ring); background: var(--atp-surface); }
.submit-main .code-boxes .code-input { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; margin: 0; padding: 0; border: 0;
  opacity: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.code-card .code-actions { margin-top: 0.5rem; }
@media (max-width: 40rem) {
  .submit-main .code-card .body { padding: 0.5rem 1.25rem 1.5rem; }
  .code-cells { gap: 0.375rem; }
  .code-cell { width: 2.625rem; height: 3.125rem; font-size: 1.375rem; }
}
.code-card #signInError { width: 100%; padding: 0.5rem 0.75rem; border-radius: 0; background: var(--atp-danger-tint); font-size: 14px; }

/* The steps. */
.submit-main .stepper .step { border-radius: 0; padding: 0.5rem 1rem 0.5rem 0.5rem; background: var(--atp-surface); box-shadow: var(--atp-shadow-1); }
.submit-main .stepper .step-num { width: 1.875rem; height: 1.875rem; }
.submit-main .stepper .done .step-num { font-size: 0; background: var(--atp-success); color: #fff; }
.submit-main .stepper .done .step-num::after { content: '✓'; font-size: 14px; }
.submit-main .stepper .current .step { border: 2px solid var(--atp-accent); background: var(--atp-surface); }
.submit-main .stepper .current .step-num { background: var(--atp-accent); }

/* Nothing sent yet: the three steps as a row of tiles. */
.sub-first .plain-steps { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; counter-reset: sub; }
.sub-first .plain-steps li { counter-increment: sub; display: grid; align-content: start; gap: 0.25rem; padding: 1rem; border: 1px solid var(--atp-line);
  border-radius: 0; background: var(--atp-surface-alt); }
.sub-first .plain-steps li > span:last-child { font-size: 14px; color: var(--atp-ink-2); }
.sub-first .plain-steps b::before { content: counter(sub) '. '; color: var(--atp-accent); }
.sub-stepicon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-bottom: 0.375rem; border-radius: 0;
  background: var(--atp-surface); border: 1px solid var(--atp-line); color: var(--atp-deep); }
.sub-stepicon svg { width: 1.25rem; height: 1.25rem; }
/* Pay for training (demonstration payments, `submitPay.ts`): the label first, never missable. */
/* A notice, not a problem (2026-11-24): red is kept for a problem, so the demonstration line is ink on grey with a rule. */
.pay-demo { margin: 0.25rem 0 0; padding: 0.375rem 0.75rem; border-radius: 0; background: #eef1f4; border-left: 4px solid #4a5868; color: #1c2430; font-weight: 700; font-size: 14px; }
.pay-list, .pay-orders { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.375rem; }
.pay-person { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--atp-line); border-radius: 0; }
.pay-person small { color: var(--atp-ink-2); }
.pay-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-why { display: block; font-style: normal; font-size: 13px; color: var(--atp-danger); }
.pay-passed summary { cursor: pointer; color: var(--atp-ink-2); margin: 0.25rem 0; }
.pay-todo { font-weight: 600; }
.pay-orders li { overflow-wrap: anywhere; font-size: 14px; }
.pay-orders .pay-order-names { margin: 0.25rem 0 0.25rem 1.25rem; padding: 0 0 0 0.5rem; display: grid; gap: 0.125rem; list-style: decimal; color: var(--atp-ink-2); }
.pay-orders .pay-order-names li { padding: 0; border: 0; background: none; font-size: 13px; }
.pay-sum { font-weight: 600; font-variant-numeric: tabular-nums; margin: 0.75rem 0 0.5rem; }
.pay-sat { color: var(--atp-ink-2); white-space: nowrap; }
.pay-refund { color: var(--atp-danger); }
.pay-address { color: var(--atp-ink-2); overflow-wrap: anywhere; }
.pay-address-line { font-size: 14px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.address-form { display: grid; gap: 0.375rem; max-width: 32rem; }
.address-form .field { font-size: 14px; font-weight: 600; color: var(--atp-ink-2); margin-top: 0.375rem; }
.address-form input { width: 100%; min-width: 0; }
#voidList td.nowrap { white-space: nowrap; }
.sub-address { color: var(--atp-ink-2); font-size: 14px; margin: 0; overflow-wrap: anywhere; }
#paymentsList td.nowrap { white-space: nowrap; }
/* Tick all on the pay list (2026-11-15). */
.pay-all { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; padding: 0.5rem 0.75rem; border-radius: 0;
  background: var(--atp-surface-alt); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.pay-all[hidden] { display: none; }
.pay-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pay-tools input[type="search"] { flex: 1 1 14rem; min-width: 0; }
/* Payments at a glance (2026-11-15): figures, one line per order, whom it pays for folded under it. */
.pay-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; margin: 1rem 0 0.25rem; }
.pay-tile { display: grid; gap: 0.125rem; padding: 0.875rem 1rem; border: 1px solid var(--atp-line); border-radius: 0; background: var(--atp-surface); }
.pay-tile b { font-size: 1.375rem; font-variant-numeric: tabular-nums; color: var(--atp-ink); }
.pay-tile span { font-size: 13px; color: var(--atp-ink-3); }
.pay-tile.bad b { color: var(--atp-danger); }
.pay-sum { font-size: 13px; font-weight: 400; color: var(--atp-ink-3); }
.pay-table td { vertical-align: middle; }
button.pay-workers { min-height: 0; padding: 0.25rem 0.625rem; border: 1px solid var(--atp-line-strong); border-radius: 0; background: var(--atp-surface);
  color: var(--atp-ink); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: none; cursor: pointer; white-space: nowrap; }
button.pay-workers::after { content: ' ▸'; color: var(--atp-ink-3); }
button.pay-workers[aria-expanded="true"]::after { content: ' ▾'; }
.pay-detail[hidden] { display: none; }
.pay-detail > td { background: var(--atp-surface-alt); padding: 0.75rem 1rem 1rem; }
.pay-names { margin: 0; padding-left: 1.75rem; columns: 3 14rem; column-gap: 2rem; font-size: 14px; }
.pay-names li { break-inside: avoid; padding: 0.125rem 0; }
.pay-detail .pay-address { margin: 0.625rem 0 0; font-size: 13px; }
.pay-status { display: inline-block; padding: 0.125rem 0.625rem; border-radius: 0; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--atp-surface-2); color: var(--atp-ink-2); }
.pay-status.paid { background: var(--atp-success-tint); color: var(--atp-success); }
.pay-status.pending { background: var(--atp-warning-tint); color: var(--atp-warning); }
.pay-status.refund { background: var(--atp-danger-tint); color: var(--atp-danger); }
/* Finance's Payments (2026-11-24): the register look (`.pq` on the page), a glance of every state that filters when
   pressed, a line per project, filters with labels, a sign beside every status's words, and each order opened on
   what it paid for, the sum, the references and the invoice address. On a phone every table stacks, one entry per order. */
.pay-page .stack > * { min-width: 0; }
.pay-page td.pay-ref { max-width: 11rem; overflow-wrap: anywhere; }
.pay-page td.pay-ref code { font-size: 12px; overflow-wrap: anywhere; }
.pay-page .pay-states { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.5rem; margin: 0 0 1rem; }
.pay-page button.pay-st { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 0.5rem; padding: 0.5rem 0.75rem;
  border: 2px solid var(--reg-rule); border-left-width: 4px; background: var(--reg-paper); color: var(--reg-ink); text-align: left; font: inherit; cursor: pointer; min-height: 0; }
.pay-page button.pay-st b { font-size: 1.375rem; font-variant-numeric: tabular-nums; grid-row: span 2; }
.pay-page button.pay-st span { font-size: 14px; font-weight: 700; }
.pay-page button.pay-st small { font-size: 12.5px; color: var(--reg-steel); font-variant-numeric: tabular-nums; min-height: 1em; }
.pay-page button.pay-st:hover { background: #f6f7f9; }
.pay-page button.pay-st.ok { border-left-color: var(--reg-green); }
.pay-page button.pay-st.wait { border-left-color: var(--reg-amber-mark); }
.pay-page button.pay-st.bad { border-left-color: var(--reg-red); }
.pay-page button.pay-st.bad:not(.zero) b, .pay-page button.pay-st.bad:not(.zero) span { color: var(--reg-red); }
.pay-page button.pay-st.zero { color: var(--reg-steel); }
.pay-page button.pay-st.act { border-color: var(--reg-ink); background: #f4f4f5; }
.pay-page .pay-projects th[scope="row"] { font-weight: 700; }
.pay-page .pay-projects td.bad { color: var(--reg-red); font-weight: 700; }
.pay-page .pay-all-projects > * { border-top: 2px solid var(--reg-rule); font-weight: 700; }
.pay-page button.linklike { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 700; color: var(--atp-deep, #1d4e89);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pay-page .pay-tools { align-items: end; gap: 0.5rem 0.75rem; }
.pay-page .pay-tools label { display: grid; gap: 0.25rem; font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-page .pay-tools :is(select, input) { min-height: 2.5rem; padding: 0.375rem 0.625rem; border: 2px solid var(--reg-rule); background: var(--reg-paper);
  font: inherit; font-size: 15px; font-weight: 400; color: var(--reg-ink); box-sizing: border-box; }
.pay-page .pay-tools .pay-find { flex: 1 1 16rem; min-width: 0; }
.pay-page .pay-tools .pay-find input { width: 100%; }
.pay-page .pay-showing { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.75rem 0 0.25rem; font-size: 14px; color: var(--reg-steel); }
.pay-page .pay-showing span { margin-right: auto; font-weight: 600; }
.pay-page .pay-showing button { min-height: 2.25rem; padding: 0.25rem 0.875rem; font-size: 14px; }
.pay-page .pay-showing button[hidden] { display: none; }
.pay-page button.pay-workers { border: 2px solid var(--reg-ink); background: var(--reg-paper); }
.pay-page .pay-status { white-space: nowrap; }
.pay-page .pay-void td:nth-child(2) { white-space: nowrap; }
.pay-page .pay-status.paid::before { content: '✓ '; }
.pay-page .pay-status.pending::before { content: '… '; }
.pay-page .pay-status.expired::before { content: '! '; }
.pay-page .pay-status.expired.voided::before { content: '– '; }
.pay-page .pay-status.refund::before { content: '✕ '; }
.pay-page .pay-status.late::before { content: '! '; }
.pay-page .pay-status.late { color: var(--reg-amber); background: #fff8eb !important; }
.pay-page .pay-status.pending { color: var(--reg-amber); background: #fff8eb !important; }
.pay-page .pay-status.expired { color: var(--reg-amber); background: #fff8eb !important; }
.pay-page .pay-status.expired.voided { color: var(--reg-steel); background: transparent !important; }
.pay-page .pay-status.paid { color: var(--reg-green); background: var(--atp-success-tint) !important; }
.pay-page .pay-status.refund { color: var(--reg-red); background: var(--atp-danger-tint) !important; }
.pay-page .pay-status + small { display: block; margin-top: 0.125rem; font-size: 12.5px; color: var(--reg-steel); }
.pay-page small.pay-tovoid { color: var(--reg-amber); font-weight: 700; }
.pay-page .pay-retake-note { display: block; margin-top: 0.375rem; font-size: 12.5px; color: var(--reg-steel); }
.pay-page .pay-retake-note b { color: var(--reg-ink); }
.pay-page .pay-for { margin: 0 0 0.75rem; font-size: 15px; font-weight: 600; color: var(--reg-ink); }
.pay-page td.pay-ref { min-width: 7rem; }
.pay-page .pay-facts dd { min-width: 0; }
.pay-page .pay-open > * { min-width: 0; }
.pay-page tr.pay-row.pay-here > td { background: #fff8eb; box-shadow: inset 0 2px 0 var(--reg-amber-mark), inset 0 -2px 0 var(--reg-amber-mark) !important; }
.pay-page .pay-none { color: var(--reg-steel); }
.pay-page button.pay-goto { font-size: inherit; }
/* The subcontractor's banner button is the way to the pay step: once there, it goes. */
.sub-body:has(#stepPay:not([hidden])) #payToDo { display: none !important; }
.pay-page .pay-detail > td { background: #f6f7f9; border-left: 3px solid var(--reg-ink); }
.pay-page .pay-open { display: grid; grid-template-columns: minmax(16rem, 2fr) minmax(12rem, 1fr) minmax(16rem, 1.4fr); gap: 1rem 1.5rem; }
.pay-page .pay-block h3 { margin: 0 0 0.375rem; font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-page .pay-names { columns: 2 12rem; padding-left: 1.75rem; }
.pay-page .pay-names li { padding: 0.125rem 0 0.125rem 0.25rem; }
.pay-page .pay-retake { display: block; font-size: 12.5px; font-weight: 700; color: var(--reg-steel); }
.pay-page :is(.pay-sums, .pay-facts) { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; margin: 0; font-size: 14px; }
.pay-page :is(.pay-sums, .pay-facts) dt { color: var(--reg-steel); }
.pay-page :is(.pay-sums, .pay-facts) dd { margin: 0; overflow-wrap: anywhere; }
.pay-page .pay-sums dd { text-align: right; font-variant-numeric: tabular-nums; }
.pay-page .pay-sums .bad { color: var(--reg-red); font-weight: 700; }
.pay-page .pay-facts code { font-size: 12.5px; }
.pay-page .pay-detail .pay-address { margin: 0.75rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--reg-rule); font-size: 14px; color: var(--reg-ink); }
.pay-page .pay-detail .pay-address b { color: var(--reg-steel); margin-right: 0.25rem; }
.pay-page .pay-demo { border-radius: 0 !important; }
@media (max-width: 760px) {
  .pay-page .pay-open { grid-template-columns: 1fr; }
  .pay-page .pay-names { columns: 1; }
  .pay-page :is(.pay-table, .pay-projects, .pay-void) thead { display: none; }
  .pay-page :is(.pay-table, .pay-projects, .pay-void), .pay-page :is(.pay-table, .pay-projects, .pay-void) :is(tbody, tr, td, th) { display: block; width: auto; }
  .pay-page :is(.pay-table, .pay-projects, .pay-void) tr { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--reg-rule); }
  .pay-page :is(.pay-table tr.pay-row, .pay-projects tr, .pay-void tr) { border-top: 2px solid var(--reg-rule); }
  .pay-page :is(.pay-table, .pay-projects, .pay-void) :is(td, th) { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.5rem; padding: 0.25rem 0; border: 0; text-align: left; white-space: normal; }
  .pay-page :is(.pay-table, .pay-projects, .pay-void) :is(td, th)[data-label]::before { content: attr(data-label); font-size: 13px; font-weight: 700; color: var(--reg-steel); }
  .pay-page :is(.pay-table, .pay-projects, .pay-void) :is(td, th):empty { display: none; }
  .pay-page :is(.pay-table, .pay-projects, .pay-void) :is(td, th)[data-label] > * { grid-column: 2; justify-self: start; }
  .pay-page .pay-table tr.pay-detail { padding: 0; border: 0; }
  .pay-page .pay-table tr.pay-detail[hidden] { display: none; }
  .pay-page .pay-table tr.pay-detail > td { display: block; padding: 0.75rem; }
  .pay-page .pay-void td:not([data-label]) { display: block; padding-top: 0.5rem; }
  .pay-page .pay-void td:not([data-label]) button { width: 100%; }
  .pay-page .pay-tools label { flex: 1 1 100%; }
  .pay-page .pay-tools :is(select, input) { width: 100%; }
  .pay-page .scroll { overflow-x: visible; }
  .pay-page .pay-status, .pay-page .pay-void td { white-space: normal !important; }
  .pay-page td.pay-ref { max-width: none; }
  .pay-page button.pay-workers { min-height: 2.25rem; }
  .pay-page button.linklike { min-height: 2.25rem; display: inline-flex; align-items: center; }
  /* The subcontractor's pay list and band on a phone: a thumb-sized tick and sign out (2026-11-24). */
  .sub-body .pay-list .pay-person input { width: 2rem; height: 2rem; }
  .sub-body .band-signout { min-height: 2.25rem; }
}
/* The subcontractor's pay list (2026-11-24): a search for long lists, and each order a ruled entry with its names one to a line. */
.sub-body .pay-find { display: grid; gap: 0.25rem; margin: 0 0 0.5rem; font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.sub-body .pay-find input { min-height: 2.5rem; padding: 0.375rem 0.625rem; border: 2px solid var(--reg-rule); font: inherit; font-size: 15px; font-weight: 400; color: var(--reg-ink); }
.sub-body .pay-find-said { display: block; font-size: 13px; color: var(--reg-steel); margin: -0.25rem 0 0.5rem; }
.sub-body .pay-find-said:empty { display: none; }
.sub-body .pay-orders { gap: 0; border: 1px solid var(--reg-rule); background: var(--reg-paper); }
.sub-body .pay-orders > li.pay-order { padding: 0.625rem 0.875rem; border-left: 3px solid var(--reg-rule); }
.sub-body .pay-orders > li.pay-order + li.pay-order { border-top: 1px solid var(--reg-rule); }
.sub-body .pay-orders > li.pay-order.paid { border-left-color: var(--reg-green); }
.sub-body .pay-orders > li.pay-order.pending { border-left-color: var(--reg-amber-mark); }
.sub-body .pay-order-head { margin: 0 0 0.375rem; font-size: 14.5px; }
.sub-body .pay-order-head .button { margin-left: 0.5rem; min-height: 2.25rem; padding: 0.25rem 0.75rem; font-size: 14px; }
.sub-body .pay-order-sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.sub-body .pay-order-names { margin: 0; padding-left: 1.75rem; columns: 2 14rem; column-gap: 2rem; font-size: 14px; }
.sub-body .pay-order-names li { break-inside: avoid; padding: 0.0625rem 0; }
.sub-body .pay-orders .pay-refund { margin: 0.375rem 0 0; color: var(--reg-red); font-weight: 700; font-size: 14px; }
.sub-body .pay-orders .pay-by-email { margin: 0.375rem 0 0; color: var(--reg-steel); font-size: 13px; }
/* Coming back from the checkout: what became of the payment, where the eye lands. */
.sub-body #payReturned { padding: 0.75rem 1rem; border: 1px solid var(--reg-rule); border-left: 4px solid var(--reg-green); background: #f2f8f4; color: var(--reg-ink); font-size: 16px; font-weight: 700; }
.pay-page span.nowrap { white-space: nowrap; }
.pay-page .pay-hide-empty { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; margin: 0 0 0.5rem; font-size: 14px; font-weight: 600; color: var(--reg-ink); cursor: pointer; }
.pay-page .pay-hide-empty input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--reg-ink); }
.pay-page .pay-ending { color: var(--reg-steel); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 760px) { .pay-page .pay-hide-empty input { width: 2rem; height: 2rem; } }
.pay-page .pay-sums dd { white-space: nowrap; }
.pay-page tr.pay-row.pay-here > td { background: #f4f4f5 !important; box-shadow: inset 0 2px 0 var(--reg-ink), inset 0 -2px 0 var(--reg-ink) !important; }
.pay-page button.pay-st.zero { border-left-color: var(--reg-rule); }
.sub-body .pay-list .pay-person input { flex: none; }
.pay-page .pay-said { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border-left: 4px solid var(--reg-green); background: #f2f8f4; color: var(--reg-ink); font-weight: 600; }
.pay-page .pay-said[hidden] { display: none; }
/* Mark refunded (0056): the refund part of an order's details, its form, and the Refunded state (done: no colour). */
.pay-page .pay-status.refunded { color: var(--reg-steel); background: transparent !important; }
.pay-page .pay-status.refunded::before { content: '✓ '; }
.pay-page .pay-refund-block { margin: 0.75rem 0 0; padding: 0.75rem 0.875rem; border: 1px solid var(--reg-rule); border-left: 3px solid var(--reg-red); background: var(--reg-paper); }
.pay-page .pay-refund-block.done { border-left-color: var(--reg-steel); }
.pay-page .pay-refund-block h3 { margin: 0 0 0.375rem; font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-page .pay-refund-block.owed h3 { color: var(--reg-red); }
.pay-page .pay-refund-block > p { margin: 0 0 0.5rem; font-size: 14px; }
.pay-page .pay-refund-block > button { min-height: 2.5rem; }
.pay-page .pay-refund-block .pay-facts { margin-bottom: 0.625rem; }
.pay-page .pay-refund-form[hidden] { display: none; }
.pay-page .pay-refund-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.625rem 0.875rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--reg-rule); }
.pay-page .pay-refund-fields .help, .pay-page .pay-refund-fields .note, .pay-page .pay-refund-fields .wide, .pay-page .pay-refund-go { grid-column: 1 / -1; margin: 0; }
.pay-page .pay-refund-fields label { display: grid; gap: 0.25rem; font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-page .pay-refund-fields label small { font-weight: 400; }
.pay-page .pay-refund-fields :is(input, select, textarea) { min-height: 2.5rem; padding: 0.375rem 0.625rem; border: 2px solid var(--reg-rule); background: var(--reg-paper); font: inherit; font-size: 15px; font-weight: 400; color: var(--reg-ink); box-sizing: border-box; width: 100%; }
.pay-page .pay-refund-fields :is(input, select, textarea):focus { border-color: var(--reg-ink); }
.pay-page .pay-refund-go { display: flex; justify-content: flex-end; gap: 0.625rem; }
.pay-page .pay-refund-go button { min-height: 2.5rem; }
.sub-body .pay-orders .pay-refund.done { color: var(--reg-steel); }
@media (max-width: 760px) {
  .pay-page .pay-refund-go { flex-direction: column-reverse; }
  .pay-page .pay-refund-go button, .pay-page .pay-refund-block > button { width: 100%; }
}
.pay-page [data-refund-said] { white-space: pre-line; }
.pay-page .pay-projects tr.pay-chosen > * { background: #f4f4f5; box-shadow: inset 0 2px 0 var(--reg-ink), inset 0 -2px 0 var(--reg-ink); }
.pay-page .pay-projects tr.pay-chosen small { font-size: 12px; color: var(--reg-steel); font-weight: 600; }
#submitStart { padding: 11px 22px; font-size: 15px; background: var(--atp-primary); }
#submitStart:hover { background: var(--atp-primary-hover); }
.sub-empty { padding: 1.25rem; border: 1px dashed var(--atp-line-strong); border-radius: 0; text-align: center; color: var(--atp-ink-3); }

/* Upload. */
.submit-main .dropzone { gap: 0.375rem; padding: 2rem 1rem; margin: 0; border-width: 2px; border-radius: 0; }
.dropzone-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 0; background: var(--atp-surface); color: var(--atp-info);
  box-shadow: var(--atp-shadow-1); }
.dropzone-icon svg { width: 1.5rem; height: 1.5rem; }
.submit-main .file-list:empty { display: none; }
/* Name, what was read, View, Remove: one line (Remove used to wrap under the name, the grid having three columns). */
.submit-main .file { position: relative; grid-template-columns: minmax(10rem, 1fr) fit-content(24rem) auto auto; align-items: center;
  padding: 0.5rem 0.875rem 0.5rem 2rem; border: 1px solid var(--atp-line); background: var(--atp-surface); }
.submit-main .file a.view-doc { margin-left: 0; }
/* A phone: the name may shrink and wrap, the description goes under it (the 40rem `.file` rule is outranked here). */
@media (max-width: 40rem) {
  .submit-main .file { grid-template-columns: minmax(0, 1fr) auto auto; }
  .submit-main .file .file-said { grid-row: 2; grid-column: 1 / -1; text-align: left; }
}
.submit-main .file::before { position: absolute; left: 0.75rem; top: 0.5rem; font-weight: 700; }
.submit-main .file.read::before { content: '✓'; color: var(--atp-success); }
.submit-main .file.reading::before { content: '…'; color: var(--atp-warning); }
.submit-main .file.unreadable::before, .submit-main .file.refused::before { content: '✗'; color: var(--atp-danger); }
.submit-main .file.read { border-color: #a7e3c7; background: #f3fcf8; }
.submit-main .file.reading { border-color: #fcd9a0; background: #fff8eb; }
.submit-main .file.unreadable, .submit-main .file.refused { border-color: #fca5a5; background: #fef2f2; }
.submit-main .file.list::before { content: '≡'; color: var(--atp-success); }
.submit-main .file.list { border-color: #a7e3c7; background: #f3fcf8; }
.code-card .code-actions .primary { background: var(--atp-primary); }
.code-card .code-actions .primary:hover { background: var(--atp-primary-hover); }

/* Crew, review and done. */
.submit-main .crew-member { border-radius: 0; padding: 1rem 1.125rem; box-shadow: var(--atp-shadow-1); }
.submit-main .crew-who b { font-size: 15.5px; }
.submit-main .review-table { margin: 0; }
.submit-main #submitRisk { font-size: 14px; padding: 0.75rem 1rem; border-radius: 0; background: var(--atp-surface-alt); }
#submitSend:not([disabled]) { background: var(--atp-primary); }
#submitSend:not([disabled]):hover { background: var(--atp-primary-hover); }
#submitResultPanel > header h2::before { content: '✓'; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-right: 0.625rem;
  border-radius: 0; background: var(--atp-success); color: #fff; font-size: 15px; vertical-align: 2px; }
.submit-main .verdict-group { margin: 0; border-radius: 0; }
.submit-main #submitResult { display: grid; gap: 0.75rem; }

/* The corrections page, restyled in place. */
.submit-main .sentback-banner { border-radius: 0; padding: 1rem 1.25rem; box-shadow: var(--atp-shadow-1); font-size: 15.5px; }
.submit-main .sf-way-all { border-radius: 0; box-shadow: var(--atp-shadow-1); }
.submit-main .sf-way-all h2 { font-size: 1.3125rem; }
.submit-main .sf-choose { background: var(--atp-primary); }
.submit-main .sf-way-one { border-radius: 0; box-shadow: var(--atp-shadow-1); }
.submit-main .sf-progress { background: rgb(248 249 250 / 96%); border-radius: 0; }
.submit-main .sf-progress .sf-send:not([disabled]) { background: var(--atp-primary); }
.submit-main .sf-card { border-radius: 0; padding: 1rem 1.125rem; gap: 0.625rem; box-shadow: var(--atp-shadow-1); }
.submit-main .sf-whead b { font-size: 16px; }
.submit-main .sf-row { border-radius: 0; }
.submit-main .sf-fold { border-radius: 0; box-shadow: var(--atp-shadow-1); }
.submit-main .sf-list-h h2 { font-size: 1.125rem; font-weight: 700; }
.sub-body .sf-phone-send .sf-send:not([disabled]) { background: var(--atp-primary); }

@media (max-width: 40rem) {
  .sub-band-in { padding: 0.625rem 1rem 0.75rem; }
  .sub-logo { width: 5.5rem; }
  .sub-band-title { flex-basis: 100%; padding-left: 0; border-left: 0; }
  .sub-who { margin-left: 0; }
  main.submit-main { padding-top: 1rem; }
  .submit-main .panel > header { padding: 1rem; }
  .submit-main .panel > .body { padding: 1rem; }
  .submit-main .panel > .step-nav { padding: 0.875rem 1rem; }
  .submit-main .code-card { margin-top: 0.25rem; }
  .sub-first .plain-steps { grid-template-columns: 1fr; }
  .sub-first .plain-steps li { grid-template-columns: auto minmax(0, 1fr); column-gap: 0.75rem; padding: 0.75rem; }
  .sub-first .plain-steps li .sub-stepicon { grid-row: span 2; margin: 0; }
  #submitStart { width: 100%; }
  .submit-main .stepper .step { padding: 0.375rem 0.75rem 0.375rem 0.375rem; }
  .submit-main .file { grid-template-columns: minmax(0, 1fr) auto; }
  .submit-main .file .file-said { grid-row: 2; grid-column: 1; }
  .submit-main .file a.view-doc { grid-row: 2; grid-column: 2; }
  .submit-main .file button.linklike { grid-row: 1; grid-column: 2; justify-self: end; }
}

/*
 * "Are you sure?" (`confirmDialog.ts`, 2026-10-09): one dialog for every
 * action that sends, changes or cannot be undone. Centred at a desk; at a
 * phone's width it is the width of the screen less a gutter, buttons full
 * width with the action on top.
 */
dialog.confirm-dialog {
  width: min(30rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.25rem 1.375rem 1.125rem;
  border: 1px solid var(--atp-line); border-top: 4px solid var(--atp-deep); border-radius: var(--atp-radius-md);
  background: var(--atp-surface); color: var(--atp-ink); box-shadow: none;
}
dialog.confirm-dialog.danger { border-top-color: var(--atp-danger); }
dialog.confirm-dialog::backdrop { background: rgb(15 23 42 / 50%); }
.confirm-dialog h2 { margin: 0 0 0.625rem; font-size: 1.1875rem; line-height: 1.3; }
.confirm-dialog #confirmBody p { margin: 0 0 0.5rem; font-size: 15px; line-height: 1.5; color: var(--atp-ink-2); }
.confirm-names { margin: 0.25rem 0 0.5rem; padding: 0.5rem 0.75rem 0.5rem 1.75rem; max-height: 12rem; overflow: auto;
  background: var(--atp-surface-alt); border: 1px solid var(--atp-line); border-radius: var(--atp-radius-sm); font-size: 14px; }
.confirm-names li { margin: 0.125rem 0; overflow-wrap: anywhere; }
.confirm-names li.confirm-more { list-style: none; margin-left: -1rem; color: var(--atp-ink-3); }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.625rem; margin-top: 1rem; }
.confirm-actions button { min-height: 2.75rem; }
.confirm-actions button.confirm-danger { background: var(--atp-danger); color: #fff; }
.confirm-actions button.confirm-danger:hover { background: #7f1d1d; }
.confirm-dialog button:focus-visible { outline: none; box-shadow: var(--atp-ring); }
.confirm-dialog .confirm-field { display: block; margin: 0.625rem 0 0; font-size: 14px; font-weight: 600; color: var(--atp-ink-2); }
.confirm-dialog .confirm-field small { font-weight: 400; }
.confirm-dialog .confirm-field input { display: block; width: 100%; max-width: 100%; margin-top: 0.25rem; padding: 0.5rem 0.625rem; font: inherit; font-weight: 400; border: 1px solid var(--atp-line, #c9d1da); }
@media (max-width: 30rem) {
  dialog.confirm-dialog { width: calc(100vw - 2rem); padding: 1rem; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions button { width: 100%; }
}

/*
 * A subcontractor's first page keeps two jobs apart (2026-10-09): the
 * corrections the PIC asked for, headed and edged amber, and "Add new
 * personnel", its own panel edged blue with its button inside it. What to
 * upload (`submitNeeds.ts`) sits on step 1 and folds under the panel.
 */
.sf-head { padding: 0.75rem 1rem; border: 1px solid var(--atp-line); border-left: 4px solid var(--atp-warning-mark); background: var(--atp-surface); border-radius: var(--atp-radius-sm); }
.sf-head h2 { margin: 0; font-size: 1.125rem; }
.sf-head p { margin: 0.25rem 0 0; font-size: 14px; color: var(--atp-ink-2); }
.sub-first.sub-more { border-left: 4px solid var(--atp-info); }
.sub-first.sub-more .plain-steps { display: none; }
.sub-needs-fold { margin-top: 0.75rem; }
.sub-needs { color: var(--atp-ink-2); font-size: 14px; }
.sub-needs p { margin: 0.5rem 0; }
.sub-needs .sub-needs-h { margin-bottom: 0.25rem; }
.sub-needs-list { margin: 0 0 0.5rem; padding-left: 1.25rem; }
.sub-needs-list li { margin: 0.125rem 0; }
.sub-needs-trades { margin: 0.25rem 0 0; padding-left: 1.125rem; }
.sub-needs-trades small { color: var(--atp-ink-3); }

/* The state pills at the end of a PIC's row. */
.pq-head .pq-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; justify-self: start; min-width: 0; }
@media (max-width: 48rem) {
  .pq-head .pq-tags { order: 3; }
}

/* ---- Add a subcontractor (2026-10-09): the tab's button beside the search, and its own page ---- */
.sub-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 0.75rem; margin-bottom: 0.875rem; }
.sub-toolbar .sub-finder { flex: 1 1 24rem; min-width: 0; margin: 0; }
a.button.sub-add { display: inline-flex; align-items: center; gap: 0.375rem; margin-left: auto; padding: 10px 18px; font-size: 14px; }
a.button.sub-add svg { width: 1rem; height: 1rem; flex: none; }

.addsub-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-bottom: 0.75rem; font-size: 13.5px; color: var(--atp-ink-3); }
.addsub-crumbs a { color: var(--atp-ink-2); font-weight: 600; text-decoration: none; }
.addsub-crumbs a:hover { color: var(--atp-accent); text-decoration: underline; }
.addsub-crumbs [aria-current] { color: var(--atp-ink); }
.addsub .pq-phead { margin-bottom: 1.25rem; }
.addsub-refused { max-width: 40rem; padding: 0.875rem 1rem; border-radius: var(--atp-radius-md); background: var(--atp-danger-tint); }
.addsub-grid { display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 20rem); gap: 1.25rem; align-items: start; }
.addsub-grid > .panel { margin-bottom: 0; }
.addsub-card form { display: grid; gap: 0.25rem; }
.addsub-project { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; margin-bottom: 1rem; padding: 0.625rem 0.875rem;
  border-radius: var(--atp-radius-md); background: var(--atp-surface-2); }
.addsub-project b { font-size: 15px; }
.addsub-project select { min-width: 0; max-width: 100%; font-size: 15px; }
.addsub-label { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }
.addsub-field { display: grid; gap: 0.375rem; margin-top: 0.75rem; font-size: 14px; font-weight: 600; color: var(--atp-ink); }
.addsub-field small { font-size: 13px; font-weight: 400; color: var(--atp-ink-3); }
.addsub-field input { width: 100%; box-sizing: border-box; font-size: 16px; font-weight: 400; padding: 0.625rem 0.75rem; }
.addsub-field input[aria-invalid="true"] { border-color: var(--atp-danger); }
.addsub-error { margin: 0.25rem 0 0; font-size: 13.5px; color: var(--atp-danger); }
.addsub-actions { margin-top: 1.25rem; }
/* Numbers in circles inside the panel's padding: `.panel > .body` outranks a plain `ol` rule, so a marker hung outside it touched the edge. */
.addsub-next > ol.body { margin: 0; padding: 1.125rem 1.25rem 1.25rem; list-style: none; counter-reset: next; display: grid; gap: 0.875rem; font-size: 14px; color: var(--atp-ink-2); line-height: 1.5; }
.addsub-next li { counter-increment: next; display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; align-items: start; }
.addsub-next li::before { content: counter(next); width: 1.5rem; height: 1.5rem; border-radius: 0; display: grid; place-items: center; background: var(--atp-deep-tint); color: var(--atp-deep); font-size: 12px; font-weight: 700; line-height: 1; }

.addsub-done { max-width: 44rem; }
.addsub-donehead { display: flex; gap: 0.875rem; align-items: flex-start; }
.addsub-donehead h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.addsub-donehead h2:focus { outline: none; }
.addsub-donehead p { margin: 0.25rem 0 0; font-size: 14px; color: var(--atp-ink-2); overflow-wrap: anywhere; }
.addsub-tick { display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0;
  background: var(--atp-success-tint); color: var(--atp-success); font-weight: 700; font-size: 1.125rem; }
.addsub-outcome { padding: 0.75rem 1rem; border-radius: var(--atp-radius-md); border-left: 4px solid; }
.addsub-outcome.good { background: var(--atp-success-tint); border-color: var(--atp-success); }
.addsub-outcome.bad { background: var(--atp-warning-tint); border-color: var(--atp-warning-line); }
.addsub-outcome b { display: block; overflow-wrap: anywhere; }
.addsub-outcome p { margin: 0.25rem 0 0; font-size: 14px; color: var(--atp-ink-2); }
.addsub-link { margin-top: 0.875rem; }
.addsub-also { margin: 0.875rem 0 0; font-size: 14px; color: var(--atp-ink-3); }
@media (max-width: 60rem) {
  .addsub-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  a.button.sub-add { flex: 1 1 100%; justify-content: center; margin-left: 0; }
  .addsub-actions > * { flex: 1 1 100%; text-align: center; }
  .addsub .pq-phead p { display: block; }
}

/* ---- The arrow on every bar that opens and closes in place (2026-10-09, `chevron.ts`) ---- */
/* Down when closed, up when open. On a <summary> it follows details[open]; on the PIC's row toggle (a button
   the page redraws) it carries .open, and .turn plays the turn once after the redraw. */
.chev { display: block; width: 20px; height: 20px; flex: none; color: var(--atp-ink-3); transition: transform 0.2s ease, color 0.12s ease; }
.chev.open, details[open] > summary > .chev { transform: rotate(180deg); }
.chev.turn { animation: chev-down 0.2s ease; }
.chev.open.turn { animation-name: chev-up; }
@keyframes chev-up { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }
@keyframes chev-down { from { transform: rotate(180deg); } to { transform: rotate(0deg); } }
summary:hover > .chev, summary:focus-visible > .chev, .pq-head:hover .chev, button.pq-chev:focus-visible .chev { color: var(--atp-ink); }
summary.disclose, .sf-row > summary { position: relative; }
summary.disclose { padding-right: 2.75rem; }
summary.disclose > .chev { position: absolute; right: 0.875rem; top: 50%; margin-top: -10px; }
.sf-row > summary > .chev { justify-self: end; }
summary.disclose:focus-visible, .sf-row > summary:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: -2px; border-radius: inherit; }
button.pq-chev { display: inline-grid; place-items: center; justify-self: end; flex: none; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 0;
  background: none; color: var(--atp-ink-3); }
button.pq-chev:hover, .pq-head:hover button.pq-chev { background: var(--atp-surface-2); }
button.pq-chev:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 1px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; }
@media (prefers-reduced-motion: reduce) {
  .chev, .chev.turn { transition: none; animation: none; }
}
/* On a phone the bar wraps, so the toggle is pinned to its top-right corner, with room kept for it,
   and the name keeps enough width to be read beside the pills (which stack instead). */
@media (max-width: 48rem) {
  .pq-head { position: relative; padding-right: 2.875rem; }
  .pq-head .pq-chev { position: absolute; top: 0.375rem; right: 0.375rem; margin: 0; }
  .pq-head .pq-name { min-width: 7.5rem; }
  .pq-head .pq-tags { flex: 0 1 auto; justify-content: flex-end; }
}

/* One person's conversation between the PIC and a subcontractor, the same on both sides (`thread.ts`,
   2026-10-09): what's wrong, bubbles (the reader's own on the right), grey lines between, whose turn.
   Bubbles wrap whatever is typed; nothing scrolls sideways at 390. */
.pt { display: grid; gap: 0.5rem; min-width: 0; }
.pt-wrong { margin: 0; padding: 0.4rem 0.75rem; border-radius: 0; background: var(--atp-danger-tint); border-left: 4px solid var(--atp-danger); font-size: 14px; overflow-wrap: anywhere; }
.pt-wrong b { font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--atp-danger); margin-right: 0.375rem; }
.pt-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; min-width: 0; }
.pt-event { justify-self: center; text-align: center; font-size: 12px; color: var(--atp-ink-3); max-width: 100%; overflow-wrap: anywhere; }
.pt-event time { white-space: nowrap; }
.pt-msg { display: grid; gap: 0.2rem; justify-items: start; max-width: min(36rem, 88%); min-width: 0; }
.pt-msg.mine { justify-self: end; justify-items: end; }
.pt-meta { font-size: 12px; color: var(--atp-ink-3); overflow-wrap: anywhere; }
.pt-meta b { color: var(--atp-ink); }
.pt-msg.mine .pt-meta { text-align: right; }
.pt-bubble { padding: 0.5rem 0.75rem; border-radius: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; max-width: 100%; }
.pt-msg.pic .pt-bubble { background: var(--atp-info-tint); border-top-left-radius: 0.2rem; }
.pt-msg.sub .pt-bubble { background: var(--atp-surface-2, var(--atp-grey-100)); border: 1px solid var(--atp-line); border-top-left-radius: 0.2rem; }
.pt-msg.mine .pt-bubble { border-top-left-radius: 0.75rem; border-top-right-radius: 0.2rem; }
.pt-msg.turned-down .pt-bubble { border-left: 4px solid var(--atp-danger); }
.pt-bubble p { margin: 0; }
.pt-bubble p + p { margin-top: 0.375rem; }
.pt-words { white-space: pre-line; }
.pt-asked small { font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-info); margin-right: 0.25rem; }
.pt-no { color: var(--atp-danger); font-weight: 700; white-space: nowrap; }
.pt-turn { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--atp-ink-3); }
.pt-turn.yours { color: var(--atp-warning); background: var(--atp-warning-tint); padding: 0.3rem 0.625rem; border-radius: 0; justify-self: start; }
.pt-reply { display: grid; gap: 0.25rem; font-size: 12px; font-weight: 600; color: var(--atp-ink-3); min-width: 0; }
.pt-reply label { display: grid; gap: 0.25rem; }
.pt-reply textarea { width: 100%; max-width: 100%; min-height: 0; height: 4.5rem; box-sizing: border-box; font: 14px/1.45 var(--atp-font-sans); padding: 0.4rem 0.625rem; resize: vertical; color: var(--atp-ink); }
.pt-reply-acts { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: flex-end; }
.pt-no-pick, .pt-reply .pt-no-pick { display: inline-flex; gap: 0.375rem; align-items: center; font-size: 13px; font-weight: 600; color: var(--atp-danger); }
.pt-no-pick input[type="checkbox"] { width: auto; min-width: 0; height: auto; margin: 0; flex: none; display: inline-block; }
.pq-prob.turn { color: var(--atp-warning); font-weight: 700; }

/*
 * The subcontractor's pages: what can be pressed (2026-11-16, "no clear indication of what to click on").
 * One rule: anything that does something has a border or an underline; a rounded tinted pill never does.
 */
.submit-main :is(button, a, summary, select):focus-visible,
.submit-main :is(.dropzone, .sf-way-all, .sf-replace):has(input:focus-visible) { outline: 3px solid var(--atp-accent); outline-offset: 2px; }

/* Step row: a step you can go to is a bordered link with its name underlined; one you can't reach yet is flat. */
.submit-main .stepper .step { box-shadow: none; }
.submit-main .stepper a.step { border: 1.5px solid var(--atp-line-strong); color: var(--atp-ink-2); cursor: pointer; }
.submit-main .stepper a.step .step-label { text-decoration: underline; text-underline-offset: 3px; }
.submit-main .stepper a.step:hover { border-color: var(--atp-deep); background: var(--atp-surface-2); color: var(--atp-deep); }
.submit-main .stepper li:not(.current) span.step { background: transparent; border-color: transparent; color: var(--atp-ink-4); cursor: default; }
.submit-main .stepper .current .step { box-shadow: var(--atp-shadow-1); cursor: default; }

/* Nothing sent yet: the three steps read as a list, not as cards to press. */
.sub-first .plain-steps li { background: none; border: 0; border-left: 3px solid var(--atp-line); border-radius: 0; padding: 0.25rem 0 0.25rem 0.875rem; }
.sub-first .sub-stepicon { background: var(--atp-surface-alt); }

/* A document read for a person opens: a bordered chip with a tick and the arrow (`chevron.ts`). */
.submit-main .doc-read summary { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; box-sizing: border-box;
  padding: 0.25rem 0.75rem; border: 1px solid var(--atp-line-strong); border-radius: 0; background: var(--atp-surface); color: var(--atp-ink); }
.submit-main .doc-read summary::before { content: '✓'; color: var(--atp-success); font-weight: 700; }
.submit-main .doc-read summary > .chev, .submit-main .sf-meta summary > .chev { width: 16px; height: 16px; }
.submit-main .doc-read summary:hover { border-color: var(--atp-deep); background: var(--atp-surface-2); }

/* Labels that only say something: a pill, no border, nothing to press. */
.submit-main :is(.doc-chip, .sf-pill) { cursor: default; user-select: none; border: 0; }
.submit-main .doc-chip { align-self: center; }
.submit-main :is(.doc-chip.missing, .sf-pill.needs_review, .sf-pill.outstanding)::before { content: '! '; }
.doc-upload { align-self: center; margin-left: 0.5rem; font-size: 13.5px; font-weight: 700; color: var(--atp-deep); text-decoration: underline; text-underline-offset: 2px; }
.doc-upload:hover { color: var(--atp-accent); }

/* "Waiting for you" is a line of text, not a yellow pill. */
.submit-main .pt-turn.yours { background: none; padding: 0; border-radius: 0; }

/* Links are underlined; View is a small outlined button; Remove is a quiet ✕, kept apart from View. */
.submit-main :is(.sentback-banner a, .sf-way-one a, .sf-fold-body a, .sf-head a) { text-decoration: underline; text-underline-offset: 2px; }
.submit-main a.view-doc { display: inline-flex; align-items: center; gap: 0.25rem; margin: 0.125rem 0; padding: 0.2rem 0.625rem;
  border: 1px solid var(--atp-line-strong); border-radius: 0; background: var(--atp-surface); color: var(--atp-deep);
  text-decoration: none; font-size: 13.5px; white-space: normal; overflow-wrap: anywhere; }
.submit-main a.view-doc:hover { border-color: var(--atp-deep); background: var(--atp-surface-2); }
.submit-main .file a.view-doc { margin-left: 0.5rem; }
.submit-main :is(.file button.linklike[data-remove], .sf-linkbtn[data-fix-remove]) { color: var(--atp-ink-3); text-decoration: none; margin-left: 0.5rem; }
.submit-main :is(.file button.linklike[data-remove], .sf-linkbtn[data-fix-remove])::before { content: '✕ '; }
.submit-main :is(.file button.linklike[data-remove], .sf-linkbtn[data-fix-remove]):hover { color: var(--atp-danger); }
.link-btn { min-height: 0; margin-left: 0.5rem; padding: 0; background: none; border: 0; box-shadow: none; color: var(--atp-deep);
  font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { background: none; color: var(--atp-accent); }

/* "Why (n)" opens like the document chips, with the same arrow; "choose a file" in a person's box is a button. */
.submit-main .sf-meta summary { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; color: var(--atp-deep);
  text-decoration: underline; text-underline-offset: 2px; list-style: none; }
.submit-main .sf-meta summary::-webkit-details-marker { display: none; }
.submit-main .sf-minidrop { padding: 0.625rem 0.75rem; }
.submit-main .sf-minidrop u { display: inline-block; margin-left: 0.25rem; padding: 0.15rem 0.625rem; border: 1px solid var(--atp-deep);
  border-radius: 0; background: var(--atp-surface); text-decoration: none; }
.submit-main .sf-row > summary:hover { background: var(--atp-surface-2); }

/* On a phone, everything pressable is at least a finger tall. */
@media (pointer: coarse) {
  .submit-main :is(button, .doc-read summary, .stepper a.step) { min-height: 44px; }
  .submit-main :is(a.view-doc, .sf-linkbtn, .linklike, .link-btn, .doc-upload) { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Who waits for the person in charge (2026-11-16, `picWaiting.ts`): a number on the menu, a line per other subcontractor, a flashing dropdown. */
.rail nav a .nav-count { margin-left: auto; min-width: 1.375rem; padding: 0.05rem 0.4rem; border-radius: 0; background: var(--atp-danger);
  color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pq-alerts { display: grid; gap: 0.5rem; }
.pq-alerts:empty { display: none; }
.pq-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0.5rem 1rem; margin: 0;
  padding: 0.5rem 0.875rem; border-radius: 0; font-size: 14.5px; }
.pq-alert b { color: var(--atp-ink); }
.pq-alert select { flex: 0 1 22rem; min-width: 12rem; max-width: 100%; }

/* The crew card (2026-11-16): a row of document buttons with one panel under it, and one block per problem. */
.crew-docs { display: block; }
.doc-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.doc-tab { min-height: 2.25rem; padding: 0.25rem 0.75rem; border: 1px solid var(--atp-line-strong); border-radius: 0; background: var(--atp-surface);
  color: var(--atp-ink); font: inherit; font-size: 14px; font-weight: 600; box-shadow: none; cursor: pointer; }
.doc-tab:hover { border-color: var(--atp-deep); background: var(--atp-surface-2); }
.doc-tab[aria-pressed="true"] { border-color: var(--atp-deep); background: var(--atp-deep); color: #fff; }
.doc-panel { margin-top: 0.5rem; padding: 0.625rem 0.75rem; border: 1px solid var(--atp-line); border-left: 3px solid var(--atp-deep); background: var(--atp-surface); }
.doc-panel dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.125rem 1rem; margin: 0 0 0.5rem; font-size: 14px; }
.doc-panel dt { color: var(--atp-ink-3); }
.doc-panel dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.crew-problems { grid-column: 1 / -1; display: grid; gap: 0.5rem; }
.crew-problems:empty { display: none; }
.crew-problem { padding: 0.625rem 0.875rem; border: 1px solid var(--atp-line); border-left: 3px solid var(--atp-danger); background: var(--atp-surface); font-size: 14px; }
.crew-problem p { margin: 0; }
.crew-problem-title { font-weight: 700; color: var(--atp-ink); margin-bottom: 0.125rem !important; }
.crew-problem-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; margin-top: 0.375rem !important; color: var(--atp-ink-2); }
.crew-problem-fix:empty { display: none; }
.crew-problem .doc-upload { margin-left: 0; }

/*
 * ---- The register look (2026-11-16) ----
 * "The UI is very kiddish with its rounded corners. Please make it more
 * official-looking." The subcontractor's pages (`.sub-body`) and the person in
 * charge's Prequalification screen (`.pq`) read as construction paperwork: a
 * submittal register, one ruled entry per person, problems as marked-up notes.
 * Square panels, 2px on what you press, no pills, no soft shadows, no tinted
 * washes for decoration, sentence case everywhere. Colour only where it means
 * something: amber a problem, green ready, red refused or an alert.
 * (2026-11-18: a problem with a document is red, after Precise asked
 * for red, not yellow; amber stays for what is waiting, such as payment.)
 * Scoped to those two screens; the rest of the admin keeps its look for now.
 */
.sub-body, .pq {
  --reg-ink: #1c2430; --reg-steel: #4a5868; --reg-rule: #c9d0d8; --reg-faint: #e3e7ec;
  --reg-ground: #eef1f4; --reg-paper: #fff; --reg-amber: #0a0a0a; --reg-amber-mark: #ffa213; --reg-green: #1f6f43; --reg-red: #b3262e;
}
.sub-body { background: var(--reg-ground); color: var(--reg-ink); }
.sub-body *, .pq * { border-radius: 0 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; }
.sub-body :is(input, select, textarea, button, .button, a.view-doc, .doc-tab, .sf-minidrop u),
.pq :is(input, select, textarea, button, .button, a.view-doc) { border-radius: 2px !important; }
.sub-body :is(h1, h2, h3), .pq :is(h1, h2, h3) { color: var(--reg-ink); letter-spacing: 0; }
.sub-body :is(.crew-who span, .crew-born span, .sf-fin, .file-said, .doc-panel dd), .pq :is(.pq-fin, td) { font-variant-numeric: tabular-nums; }

/* The band: the mark and the page's name; whose link it is as plain text, not lozenges. */
.sub-body .sub-who { background: none !important; border: 0 !important; padding: 0 !important; color: #c9d1db; }
.sub-body .sub-who * { background: none !important; border: 0 !important; padding: 0 0.5rem 0 0 !important; color: inherit; }

/* Panels: white sheets with a rule, a ruled heading strip. */
.sub-body :is(.panel, .crew-summary, .sf-head, .sf-way-one, .sf-tray, .sf-card, .sf-row, .sf-fold, .code-card, .pay-panel, .address-panel) {
  background: var(--reg-paper) !important; border: 1px solid var(--reg-rule) !important; }
.sub-body .panel > header { background: #f6f7f9; border-bottom: 1px solid var(--reg-rule); }
.sub-body .sub-step { color: var(--reg-steel); font-size: 13px; font-weight: 600; }

/* Notices: white, with a coloured rule on the left that says what kind. */
.sub-body :is(.sentback-banner, .pay-todo, .loose, .crew-issues, .pt-wrong, .verdict-group, .note.bad, .sf-placed.warn, .sf-placed.bad, .file.unreadable, .file.refused),
.pq :is(.pq-next, .pq-alert, .addsub-refused) {
  background: var(--reg-paper) !important; border: 1px solid var(--reg-rule) !important; border-left: 3px solid var(--reg-amber-mark) !important; color: var(--reg-ink); }
.sub-body :is(.sentback-banner b, .loose b) { color: var(--reg-amber); }
/* "What's wrong" on the subcontractor's page: filled like the person in charge's (2026-11-23).
   .pt-wrong twice: the notices rule above counts as two classes. */
.sub-body .pt-wrong.pt-wrong { background: var(--atp-danger-tint) !important; }
/* Once the new files cover everything (✓ Ready), What's wrong no longer applies: it goes (2026-11-23). */
.sub-body :is(.sf-card, .sf-row).ready .pt-wrong { display: none; }
/* Files nobody is matched to: amber all round, so it is not read as a problem (red) with a person.
   .loose twice: the notices rule above counts as two classes (its :is holds .file.unreadable). */
.sub-body .loose.loose { border: 1px solid var(--reg-amber-mark) !important; border-left: 3px solid var(--reg-amber-mark) !important; background: #fff8eb !important; }
.sub-body .pt-wrong b { color: var(--reg-red); }
.sub-body :is(.file.unreadable, .file.refused, .sf-placed.warn, .sf-placed.bad, .note.bad, .pt-wrong, .verdict-group.outstanding, .verdict-group.needs_review) { border-left-color: var(--reg-red) !important; }
.sub-body .verdict-group.eligible { border-left-color: var(--reg-green) !important; }
.sub-body :is(.file.read, .file.list) { background: var(--reg-paper) !important; border: 1px solid var(--reg-rule) !important; border-left: 3px solid var(--reg-green) !important; }
/* Read, but no FIN or name on it: red, with a sign, like the crew card (2026-11-24). */
.sub-body :is(.file.read.unclear, .file.read.bad) { border-left-color: var(--atp-danger) !important; background: var(--atp-danger-tint) !important; }
.submit-main :is(.file.read.unclear, .file.read.bad)::before { content: '!'; color: var(--atp-danger); font-weight: 700; }
/* A problem said at upload (stage 4, P19): red for what keeps the person here, amber for a name the project team reviews. */
.sub-body .file.read.warn { border-left-color: var(--reg-amber-mark) !important; background: #fff8eb !important; }
.submit-main .file.read.warn::before { content: '!'; color: var(--reg-amber); font-weight: 700; }
.submit-main .file-said .file-problem { display: block; font-weight: 600; color: var(--reg-red, var(--atp-danger)); }
.submit-main .file.warn .file-said .file-problem { color: var(--reg-amber); }
/* Set all to Worker (stage 4, P9): one line, the button beside what it fixes. */
.submit-main .crew-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.5rem 0; }
.submit-main .crew-roles small { color: var(--atp-ink-3); font-size: 13.5px; }
/* The people a Submit left here (stage 4, P8). */
.sub-body .verdict-group.held-here { border-left-color: var(--reg-amber-mark) !important; background: #fff8eb; }

/* Steps: a ruled row of section tabs; the one you are on underlined in ink. */
.sub-body .stepper { gap: 0; border-bottom: 1px solid var(--reg-rule); }
.sub-body .stepper .step { border: 0 !important; border-bottom: 3px solid transparent !important; background: transparent !important; padding: 0.625rem 0.875rem; }
.sub-body .stepper .current .step { border-bottom-color: var(--reg-ink) !important; color: var(--reg-ink); }
.sub-body .stepper .step-num { background: transparent !important; border: 1px solid currentColor; color: inherit; width: 1.5rem; height: 1.5rem; font-size: 13px; }
.sub-body .stepper .current .step-num { background: var(--reg-ink) !important; border-color: var(--reg-ink); color: #fff; }
.sub-body .stepper .done .step-num { background: var(--reg-green) !important; border-color: var(--reg-green); color: #fff; }

/* The crew: a register, one ruled entry per person, the left rule saying ready or to check. */
.sub-body .crew-member { background: var(--reg-paper) !important; border: 1px solid var(--reg-rule) !important; border-left: 3px solid var(--reg-amber-mark) !important; }
.sub-body .crew-member:not(.incomplete) { border-left-color: var(--reg-green) !important; }
.sub-body .crew-n { background: transparent !important; border: 0; color: var(--reg-steel); font-weight: 700; }
.sub-body .crew-summary { background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--reg-rule) !important; padding-left: 0; padding-right: 0; }
.sub-body small.label, .sub-body .crew-born .label, .sub-body .crew-trade .label { color: var(--reg-steel); font-size: 13px; font-weight: 600; }
.sub-body .crew-problem { border-color: var(--reg-red); border-left: 3px solid var(--reg-red); background: #fbeaeb; }
.sub-body .crew-problem-title { color: var(--reg-red); }
.sub-body .doc-panel { border-color: var(--reg-faint); border-left-color: var(--reg-ink); background: #f9fafb; }

/* Status: a small square box in the colour that means it, filled with its pale tint (2026-11-23); never a rounded lozenge. */
.sub-body :is(.sf-pill, .doc-chip), .pq :is(.pq-pill, .pay-status) {
  background: transparent !important; border: 1px solid currentColor !important; padding: 0 0.375rem; font-size: 12.5px; font-weight: 700; }
.sub-body :is(.sf-pill.outstanding, .sf-pill.needs_review, .doc-chip.missing), .pq :is(.pq-pill.outstanding, .pq-pill.needs_review) { color: var(--reg-red); background: var(--atp-danger-tint) !important; }
.sub-body .sf-pill.ready, .pq .pq-pill.eligible { color: var(--reg-green); background: var(--atp-success-tint) !important; }

/* The quick way to send corrections: a plain drop box, ruled not washed. */
.sub-body :is(.sf-way-all, .dropzone) { background: var(--reg-paper) !important; border: 1.5px dashed var(--reg-steel) !important; }
.sub-body :is(.sf-way-all, .dropzone):hover, .sub-body .dropzone.over { border-color: var(--reg-ink) !important; background: #f6f7f9 !important; }
.sub-body .dropzone-icon { background: transparent !important; }

/* The conversation: the person in charge's words in a ruled note, not a bubble. */
.sub-body .pt-bubble, .pq .pt-bubble { background: var(--reg-paper) !important; border: 1px solid var(--reg-rule) !important; border-left: 3px solid var(--reg-steel) !important; }

/* What you press: ink buttons, outlined second buttons, nothing round. */
.sub-body button.primary, .sub-body .button.primary, .pq button.primary { background: var(--atp-primary); color: var(--atp-primary-ink); border-color: transparent; }
.sub-body button.secondary, .pq button.secondary { background: var(--reg-paper); border: 1px solid var(--reg-ink); color: var(--reg-ink); }
.sub-body .sub-band :is(h1, h2, h3) { color: #fff; }
.sub-body .pay-todo { padding: 0.625rem 0.875rem; }
.sub-body .pt-turn.yours { color: var(--reg-amber); }
/* The subcontractor dropdown fits a name and its "· N to review". */
.pq #prequalSub { width: auto; min-width: 16rem; max-width: 100%; }
.doc-tab { text-align: left; }

/* The register look, continued (2026-11-16, after review). */
/* The person in charge's dialogs open outside `.pq` (on <body>): the same rules for them. */
.pq-body {
  --reg-ink: #1c2430; --reg-steel: #4a5868; --reg-rule: #c9d0d8; --reg-faint: #e3e7ec;
  --reg-paper: #fff; --reg-amber: #0a0a0a; --reg-amber-mark: #ffa213; --reg-green: #1f6f43; --reg-red: #b3262e;
}
.pq-body dialog, .pq-body dialog * { border-radius: 0 !important; text-transform: none !important; letter-spacing: normal !important; }
.pq-body dialog { border: 1px solid var(--reg-rule); }
.pq-body dialog :is(input, select, textarea, button, .button) { border-radius: 2px !important; }
/* Shadows that meant something come back, as rules or outlines. */
.pq button.pq-st.act { border-color: var(--reg-ink) !important; box-shadow: inset 0 -3px 0 var(--reg-ink) !important; }
:is(.sub-body, .pq, .pq-body dialog) :is(input, select, textarea, button, a, summary):focus-visible { outline: 2px solid var(--reg-ink); outline-offset: 1px; }
.sub-body .code-cell.active { outline: 2px solid var(--reg-ink); outline-offset: 1px; }
.sub-body .sf-card.ready, .sub-body .sf-row.ready { border-left: 3px solid var(--reg-green) !important; }
.sub-body [data-step-page="crew"] > .step-nav { border-top: 1px solid var(--reg-rule); }
.pq .pq-bulk { outline: 1px solid var(--reg-ink); }
/* The band flat, not a gradient; the quick way's heading in the page's own grey. */
.sub-body .sub-band { background: var(--reg-ink) !important; }
.sub-body .sf-way-all .sf-step { color: var(--reg-steel); }

/* The crew's document buttons say which document is off (2026-11-16): green with a tick, red with "!". */
.doc-tab .doc-mark { margin-right: 0.375rem; font-weight: 700; }
/* A light fill of the same colour (2026-11-18), so fine and wrong show at a glance; solid stays for the one open. */
.sub-body .doc-tab.ok { border-color: var(--reg-green); color: var(--reg-green); background: #eaf4ee; }
.sub-body .doc-tab.bad { border-color: var(--reg-red); color: var(--reg-red); background: #fbeaeb; }
.sub-body .doc-tab.ok[aria-pressed="true"] { background: var(--reg-green); border-color: var(--reg-green); color: #fff; }
.sub-body .doc-tab.bad[aria-pressed="true"] { background: var(--reg-red); border-color: var(--reg-red); color: #fff; }
.sub-body .doc-tab.ok:not([aria-pressed="true"]):hover { background: #d9ece0; }
.sub-body .doc-tab.bad:not([aria-pressed="true"]):hover { background: #f6d8da; }
.sub-body .doc-tab[aria-pressed="true"]:hover { filter: brightness(1.1); }

/* Sent and waiting for the person in charge (2026-11-16): below the list, greyed, still opening to add to. */
.sf-sent { margin-top: 1.25rem; display: grid; gap: 0.5rem; }
.sf-sent .sf-list-h h2 { color: var(--atp-ink-3); }
.sub-body .sf-row.sent { background: #f3f5f7 !important; border-left: 3px solid #9aa5b1 !important; color: var(--atp-ink-2); }
.sub-body .sf-row.sent > summary .sf-name { color: var(--atp-ink-2); }
.sub-body .sf-row.sent[open] { background: var(--reg-paper, #fff) !important; }

/*
 * Pay for training, made plain and clear (2026-11-16: "should be a proper button ... stand out more").
 * A select-all button above a ruled list of people, each row green-ruled once chosen,
 * and the total with Continue to payment as one summary bar at the foot.
 */
.sub-body .pay-panel .body { display: grid; gap: 0.75rem; }
.sub-body .pay-all { padding: 0; margin: 0; background: transparent !important; border: 0 !important; }
.sub-body .pay-select { display: inline-flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0.5rem 1.125rem;
  border: 2px solid var(--reg-ink); background: var(--reg-paper); color: var(--reg-ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.sub-body .pay-select::before { content: ''; width: 1.125rem; height: 1.125rem; border: 2px solid currentColor; box-sizing: border-box; flex: none; }
.sub-body .pay-select:hover { background: #f1f3f6; }
.sub-body .pay-select.on { background: var(--reg-ink); color: #fff; }
.sub-body .pay-select.on::before { content: '✓' / ''; display: grid; place-items: center; font-size: 13px; line-height: 1; border-color: #fff; }
.sub-body .pay-list { gap: 0; border: 1px solid var(--reg-rule); }
.sub-body .pay-list li + li { border-top: 1px solid var(--reg-faint); }
.sub-body .pay-person { border: 0 !important; border-left: 3px solid transparent !important; padding: 0.625rem 0.875rem; cursor: pointer; }
.sub-body .pay-person:hover { background: #f6f7f9; }
.sub-body .pay-person:has(input:checked) { border-left-color: var(--reg-green) !important; background: #f2f8f4; }
.sub-body .pay-person input { width: 1.125rem; height: 1.125rem; accent-color: var(--reg-ink); }
.sub-body .pay-total { margin: 0; padding: 0.875rem 1rem; border: 1px solid var(--reg-rule); border-left: 3px solid var(--reg-ink); background: #f6f7f9;
  font-size: 17px; font-weight: 700; color: var(--reg-ink); }
.sub-body .pay-total:empty { display: none; }
.sub-body #payFoot { position: sticky; bottom: 0; z-index: 2; background: var(--reg-paper); border-top: 1px solid var(--reg-rule); }
.sub-body #payGo { min-height: 2.75rem; padding: 0.5rem 1.5rem; font-size: 15px; }
.sub-body .pay-demo { border-radius: 0 !important; }
.sub-body .pay-foot-total { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--reg-ink); }

/* "Your other personnel": one ruled row a person, name and FIN apart from their documents (2026-11-17: "the text is all jumbled up"). */
.sf-people { list-style: none; margin: 0.5rem 0 0; padding: 0; border: 1px solid var(--atp-line); }
.sf-person { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; gap: 0.5rem 1.25rem; align-items: start; padding: 0.75rem 0.875rem; }
.sf-person + .sf-person { border-top: 1px solid var(--atp-line); }
.sf-person-who { display: grid; gap: 0.125rem; }
.sf-person-who span { color: var(--atp-ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.sf-person-docs { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.sf-person-docs a.view-doc { margin: 0 !important; font-size: 13.5px; }
.sf-none { color: var(--atp-ink-3); font-size: 14px; }
@media (max-width: 40rem) { .sf-person { grid-template-columns: 1fr; } }

/* The line at the top: what is owed on the left, a real Pay for training button on the right (2026-11-17). */
.sub-body .pay-todo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem;
  padding: 0.875rem 1rem !important; border-left-color: var(--reg-ink) !important; font-size: 15.5px; }
.sub-body .pay-todo[hidden] { display: none; }
.sub-body a.button.pay-todo-go { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.5rem 1.375rem;
  background: var(--atp-primary); color: var(--atp-primary-ink); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sub-body a.button.pay-todo-go:hover { background: var(--atp-primary-hover); color: var(--atp-primary-ink); }
@media (max-width: 40rem) { .sub-body a.button.pay-todo-go { flex: 1 1 100%; } }
.sf-fold-body .sf-people { margin-left: 0; padding-left: 0; }
.sf-person { padding: 0.5rem 0.875rem; }
.sf-person-who { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 0.625rem; }

/* Who on the roster is paid for (2026-11-17): those not paid for marked amber (waiting, 2026-11-24: the user, over the blue of 23 Nov) and listed first; each state its own words and mark. */
.pq, .pq-body { --reg-unpaid: var(--atp-warning); --reg-unpaid-tint: var(--atp-warning-tint); }
.pq-states:has(.pq-st.unpaid) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pq-states:has(.pq-st.unpaid):has(.pq-st.failed) { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pq button.pq-st.failed { border-left: 4px solid var(--atp-danger); color: var(--atp-danger); font-weight: 700; }
.pq button.pq-st.failed b { color: var(--atp-danger); }
.pq button.pq-st.unpaid { border-left: 4px solid var(--reg-unpaid); color: var(--reg-unpaid); font-weight: 700; }
.pq button.pq-st.unpaid b { color: var(--reg-unpaid); }
.pay-tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0 0.375rem; border: 1px solid currentColor; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pay-tag::before { content: ""; width: 0.55rem; height: 0.55rem; box-sizing: border-box; border: 1.5px solid currentColor; }
.pay-tag.unpaid { color: var(--reg-unpaid, var(--atp-warning)); background: var(--reg-unpaid-tint, var(--atp-warning-tint)); }
.pay-tag.paid { color: var(--reg-steel); }
.pay-tag.paid::before { background: currentColor; }
.pay-tag:is(.sat, .sitting) { color: var(--reg-steel); }
.pay-tag:is(.sat, .sitting)::before { background: linear-gradient(to top right, currentColor 50%, transparent 50%); }
.pay-tag:is(.passed, .certified) { color: var(--reg-green); }
.pay-tag:is(.passed, .certified)::before { content: "✓"; width: auto; height: auto; border: 0; }
.pay-tag.failed { color: var(--atp-danger); background: var(--atp-danger-tint); }
.pay-tag.failed::before { content: "!"; width: auto; height: auto; border: 0; }
.pq .pq-row.unpaid { border-left: 4px solid var(--reg-unpaid); background: var(--reg-unpaid-tint); }
.pq-head .pay-tag { justify-self: start; }
@media (max-width: 48rem) { .pq-head .pay-tag { order: 3; } }

/* Where paid personnel register (2026-11-17): a button in the band, then the link and its QR code below it. */
/* Sign out, in the band once signed in (2026-11-23): plain words, underlined, so it reads as an action without competing. */
.band-signout { margin-left: auto; padding: 0.25rem 0; min-height: 2.25rem; background: none; border: 0; color: #fff; font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.band-signout:hover { color: #dfe4ea; }
.band-signout:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* At the top of the page (2026-11-23): a bar with a QR mark and an arrow that turns, the card opening under it. */
.pay-register { margin: 0 0 1rem; text-align: right; }
/* A link to the registration page (stage 4 round 2): a plain bordered link, no fold. */
.pay-register a { display: inline-block; padding: 0.5rem 0.875rem; border: 1px solid var(--reg-ink, #1c2430); background: #fff; color: var(--reg-ink, #1c2430);
  font-weight: 600; font-size: 14px; text-decoration: none; }
.pay-register a:hover { text-decoration: underline; }
/* The registration page: what to do, the link with Copy, the QR sized for a phone. */
.reg-page .reg-back { display: inline-block; margin-bottom: 0.5rem; font-size: 14px; font-weight: 600; color: var(--reg-ink, #1c2430); text-decoration: underline; }
.reg-page .reg-back::before { content: '← '; }
#payRegisterPanel:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: start; color: var(--reg-ink, #1c2430); }
#payRegisterPanel a { color: var(--reg-ink, #1c2430); }
@media (max-width: 40rem) {
  #payRegisterPanel:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .pay-register { text-align: left; }
}
.pay-returned-link, .pay-register-go { font-weight: 600; text-decoration: underline; color: inherit; margin-left: 0.25rem; }
.pay-register-steps { margin: 0 0 1rem; padding-left: 1.25rem; line-height: 1.6; }
.pay-register-label { margin: 0 0 0.375rem; font-size: 13px; font-weight: 700; color: var(--reg-steel, #4a5868); }
.pay-register-link { display: flex; gap: 0.5rem; align-items: stretch; }
.pay-register-link a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; padding: 0.5rem 0.75rem; border: 1px solid var(--reg-rule, #c9d0d8); background: #f6f8fa; font: 600 14px/1.4 ui-monospace, Menlo, monospace; text-decoration: none; }
.pay-register-link button { flex: none; }
.pay-register-code { margin: 0; padding: 0.75rem; border: 1px solid var(--reg-rule, #c9d0d8); text-align: center; }
.pay-register-qr svg { display: block; width: min(15rem, 100%); height: auto; margin: 0 auto; }
.pay-register-code figcaption { margin-top: 0.375rem; font-size: 13px; font-weight: 700; color: var(--reg-steel, #4a5868); }
@media (max-width: 40rem) { .pay-register-link { flex-wrap: wrap; } }

/* ---------- the hard stop beside Submit and Send (heldBack.ts, 23 Nov 2026) ---------- */
/* Red is a problem with a document: a ruled block like the crew card's problem, square, never a pill. */
.held { margin: 1rem 0 0; padding: 0.875rem 1rem; border: 1px solid var(--reg-red, #b3262e); border-left: 4px solid var(--reg-red, #b3262e);
  background: #fbeaeb; font-size: 14px; line-height: 1.45; color: var(--atp-ink); }
.held p { margin: 0; }
.held-title b { color: var(--reg-red, #b3262e); }
.held-list { margin: 0.625rem 0; padding-left: 1.75rem; }
.held-list > li { padding: 0.375rem 0; border-top: 1px solid rgb(179 38 46 / 25%); }
.held-list > li:first-child { border-top: 0; }
.held-list > li::marker { font-weight: 700; }
.held-fin { color: var(--atp-ink-3); margin-left: 0.25rem; }
.held-list ul { margin: 0.25rem 0 0; padding-left: 1.125rem; }
.held-fix { color: var(--atp-ink-2); }
.sf-progress .sf-held { grid-column: 1 / -1; }
.sf-held:empty, .sf-held-one:empty { display: none; }
.sf-held .held { margin: 0; }
.sf-held-one { margin: 0.5rem 0 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--reg-red, #b3262e); background: #fbeaeb; font-size: 14px; }
.sf-held-one b { color: var(--reg-red, #b3262e); }
.review-table td span.bad { color: var(--reg-red, #b3262e); font-weight: 700; }

/* ---------- Personnel by subcontractor (subcontractorView.ts, 23 Nov 2026) ---------- */
.subsum-wrap { margin: 0 0 1rem; scroll-margin-top: 5rem; } /* clear of the sticky top bar when the Dashboard lands here */
.subsum-wrap:has(#subSummary:empty) { display: none; }
table.subsum { width: auto; min-width: min(100%, 36rem); border-collapse: collapse; font-size: 14px; background: var(--atp-surface); border: 1px solid var(--atp-line); }
table.subsum caption { caption-side: top; text-align: left; font-weight: 700; padding: 0 0 0.375rem; color: var(--atp-ink); }
table.subsum th, table.subsum td { padding: 0.5rem 0.875rem; border-bottom: 1px solid var(--atp-line); text-align: left; }
table.subsum thead th { font-size: 13px; color: var(--atp-ink-3); border-bottom: 2px solid var(--atp-ink-3); }
table.subsum td { font-variant-numeric: tabular-nums; text-align: right; }
table.subsum tbody tr:last-child th, table.subsum tbody tr:last-child td { border-bottom: 0; }
table.subsum .linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--atp-deep); text-decoration: underline; cursor: pointer; text-align: left; }
table.subsum .linklike[aria-pressed="true"] { color: var(--atp-ink); }
/* On a phone each subcontractor is a block: the name, then each figure with its word. */
@media (max-width: 40rem) {
  table.subsum { width: 100%; min-width: 0; }
  table.subsum thead { display: none; }
  table.subsum tbody, table.subsum tr { display: block; }
  table.subsum tr { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--atp-line); }
  table.subsum tbody tr:last-child { border-bottom: 0; }
  table.subsum th, table.subsum td { display: flex; justify-content: space-between; padding: 0.25rem 0; border: 0; }
  table.subsum td::before { content: attr(data-label); color: var(--atp-ink-3); }
}

/* ---------- the Dashboard's figures (dashboardScreen.ts, 23 Nov 2026) ---------- */
/* Two labelled rows, Personnel and Prequalification; four across, two on a tablet or a phone. */
.figures { margin: 0 0 1.25rem; }
.figures-h { margin: 0 0 0.5rem; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--atp-ink-3); }
#counts.figures-row, .cards.figures-row { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; margin: 0; }
@media (max-width: 68rem) { #counts.figures-row, .cards.figures-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.figures-row .card > a { padding: 1rem; gap: 0.75rem; }
.figures-row .card b { font-size: 1.75rem; }
@media (max-width: 30rem) {
  .figures-row .card > a { padding: 0.75rem; gap: 0.5rem; flex-direction: column; }
  .figures-row .card .icon { display: none; }
  .figures-row .card b { font-size: 1.5rem; }
  .figures-row .card small { font-size: 11px; letter-spacing: 0.02em; }
  /* Three to a row on a phone, so six figures are two even rows; four stay two by two. */
  #counts.figures-row, .cards.figures-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  #counts.figures-row:has(> li:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures-row .card > a { padding: 0.625rem 0.5rem; }
  .figures-row .card small { font-size: 10.5px; letter-spacing: 0.01em; overflow-wrap: anywhere; }
}
/* Personnel: workforce, site and subcontractor on one row; the search under it, drawn as an input. */
.pickrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 0 0 0.875rem; }
.pickrow .pickerlabel select { min-height: 2.5rem; min-width: 12rem; }
.search-field input { min-height: 2.5rem; padding: 0 0.75rem; border: 1px solid var(--atp-line-strong); border-radius: var(--atp-radius-sm);
  background: var(--atp-surface); font: inherit; font-size: 15px; font-weight: 400; }
.search-field input:focus-visible { outline: 2px solid var(--atp-deep); outline-offset: 1px; }
@media (max-width: 40rem) { .pickrow > * { flex: 1 1 100%; } .pickrow .pickerlabel select { width: 100%; min-width: 0; } }
/* Phones (24 Nov 2026): every tick box and small link-button a thumb can hit, 32px at least. */
@media (max-width: 40rem) {
  .pq input[type=checkbox], .pq-sw input[type=checkbox], .pq-group > header .pq-tickall input, #payPanel input[type=checkbox],
  main input[type=checkbox], .pq-head input[type="checkbox"] { width: 2rem; height: 2rem; min-width: 2rem; flex: none; }
  button.linklike[data-edit-email] { min-height: 2.25rem; }
  button.linklike { min-height: 2rem; }
  .sub-body select { min-height: 2.25rem; }
  .pq-sheet .pq-sheetback { min-height: 2.25rem; }
  table.subsum .linklike { min-height: 2rem; }
  #submitCsv { min-height: 2.25rem; }
}
/* New submissions waiting (prequalNotice): amber is waiting; the way in is a button. */
.dash-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; padding: 0.875rem 1rem;
  background: var(--atp-surface); border: 1px solid var(--atp-line); border-left: 5px solid var(--atp-warning-mark); font-size: 15px; }
.dash-notice p { margin: 0; }
.dash-notice a.action { white-space: nowrap; flex: none; }
@media (max-width: 40rem) { .dash-notice { flex-direction: column; align-items: stretch; } .dash-notice a.action { justify-content: center; } }
/* Without Recent activity the two panels share the row. */
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 68rem) { .split.even { grid-template-columns: 1fr; } }
.split.even > .panel { margin-bottom: 0; }

/* A difference the project team reviews (a name that differs while the FIN matches): amber, not red (23 Nov 2026). */
.sub-body .crew-problem.review { border-color: var(--reg-amber-mark); border-left-color: var(--reg-amber-mark); background: #fff8eb; }
.sub-body .crew-problem.review .crew-problem-title { color: var(--reg-amber); }
.sub-body .doc-tab.warn { border-color: var(--reg-amber-mark); color: var(--reg-amber); background: #fff8eb; }
.sub-body .doc-tab.warn[aria-pressed="true"] { background: var(--reg-amber-mark); border-color: var(--reg-amber-mark); color: #0a0a0a; }

/* Payments' one money line for the period (25 Nov 2026, F2): Received = Refunds owed + Refunded + Net kept. */
.pay-page .pay-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); margin: 0 0 1rem; border: 2px solid var(--reg-rule, #c9d1da); }
.pay-page .pay-money > div { padding: 0.5rem 0.75rem; border-right: 1px solid var(--reg-rule, #c9d1da); }
.pay-page .pay-money > div:last-child { border-right: 0; }
.pay-page .pay-money dt { font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-page .pay-money dd { margin: 0.125rem 0 0; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-page .pay-money .bad dd { color: var(--reg-red); }
@media (max-width: 40rem) { .pay-page .pay-money > div { border-right: 0; border-bottom: 1px solid var(--reg-rule, #c9d1da); } }

/* The month-end report (F3): one table, a total row; printed alone. */
.pay-report .pay-back { margin: 0 0 0.25rem; font-size: 14px; }
.pay-report .pay-report-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; margin: 0 0 0.75rem; }
.pay-report-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pay-report-table caption { text-align: left; font-weight: 700; padding: 0 0 0.5rem; }
.pay-report-table th, .pay-report-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--reg-rule, #c9d1da); text-align: left; }
.pay-report-table .num { text-align: right; }
.pay-report-table a { color: var(--atp-deep, #1d4e89); font-weight: 700; text-decoration: underline; }
.pay-report-table tfoot > tr > * { border-top: 2px solid var(--reg-ink, #1f2933); font-weight: 700; }
@media (max-width: 40rem) {
  .pay-report-table thead { display: none; }
  .pay-report-table tr { display: block; border-bottom: 2px solid var(--reg-rule, #c9d1da); padding: 0.25rem 0; }
  .pay-report-table th, .pay-report-table td { display: flex; justify-content: space-between; border: 0; padding: 0.25rem 0; }
  .pay-report-table td::before { content: attr(data-label); font-weight: 600; color: var(--reg-steel); }
}
@media print {
  .topbar, #rail, .pay-report .pay-back, .pay-report .pay-report-tools, .pay-report #reportHelp, .pay-report .panel > header { display: none !important; }
  body:has(.pay-report) { background: #fff !important; }
  body:has(.pay-report) main { margin: 0 !important; padding: 0 !important; }
  .pay-report .panel { border: 0; box-shadow: none; }
  .pay-report-table { font-size: 11pt; }
  .pay-report-table thead { display: table-header-group; }
}

/* Under a Dashboard figure, each subcontractor's share as its own link (25 Nov 2026). */
/* One small line of links under the help text (stage 4): the names wrap as text, never as stacked columns. */
.card .card-parts { display: block; margin: 0.25rem 0 0; padding: 0 1rem 0.75rem; font-size: 13px; line-height: 1.6; }
.card .card-parts a { color: var(--atp-deep, #1d4e89); text-decoration: underline; font-weight: 400; }
.card .card-parts .part-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.card .card-parts .part-sep { color: var(--atp-muted, #5b6470); }
/* A count on Personnel's per-subcontractor table that opens its people; Not paid for stays amber (facts M14). */
.subsum td.unpaid button.linklike, .subsum td.unpaid a.linklike { color: var(--reg-unpaid, var(--atp-warning)); }

/*
 * Finance's four pages (stage 2, 25 Nov 2026, fix list F5, F18, F23):
 * Overview, Orders, To do, Month-end report. Finance's sidebar is the four
 * pages; everybody else reaches them by tabs. Headings sized above body text;
 * colour only for meaning (red a refund owed or a missing reference, amber
 * waiting, green paid).
 */
.pay-page .head h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
.pay-page .panel > header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--reg-ink); }
.pay-page .pay-block h3, .pay-page .pay-refund-block h3 { font-size: 1rem; color: var(--reg-ink); }
.pay-tabs { display: flex; gap: 0; margin: 0 0 1rem; border-bottom: 2px solid var(--reg-rule); overflow-x: auto; }
.pay-tabs a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 1.125rem; margin-bottom: -2px; border-bottom: 3px solid transparent;
  font-weight: 700; font-size: 15px; color: var(--reg-steel); text-decoration: none; white-space: nowrap; }
.pay-tabs a:hover { color: var(--reg-ink); background: #f6f7f9; }
.pay-tabs a[aria-current="page"] { color: var(--reg-ink); border-bottom-color: var(--reg-ink); }
.pay-tab-count { min-width: 1.5rem; padding: 0 0.375rem; border: 2px solid var(--reg-rule); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.pay-tab-count.due { border-color: var(--reg-red); color: var(--reg-red); }
.pay-page .pay-demo { margin: 0 0 1rem; }
.pay-period { display: grid; gap: 0.625rem; margin: 0 0 0.75rem; }
.pay-presets { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pay-page button.pay-preset { min-height: 2.5rem; padding: 0.25rem 0.875rem; border: 2px solid var(--reg-rule); background: var(--reg-paper); color: var(--reg-ink); font-weight: 700; font-size: 14px; }
.pay-page button.pay-preset:hover { border-color: var(--reg-ink); }
.pay-page button.pay-preset[aria-pressed="true"] { border-color: var(--reg-ink); background: var(--reg-ink); color: #fff; }
.pay-days { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; }
.pay-days label { display: grid; gap: 0.25rem; font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-days input { min-height: 2.5rem; padding: 0.375rem 0.625rem; border: 2px solid var(--reg-rule); font: inherit; font-size: 15px; color: var(--reg-ink); }
.pay-sgt { font-size: 13px; color: var(--reg-steel); padding-bottom: 0.625rem; }
.pay-period .note[hidden] { display: none; }
.pay-page .pay-money a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pay-page .pay-money .bad a { color: var(--reg-red); }
.pay-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.25rem; align-items: start; }
@media (max-width: 60rem) { .pay-pair { grid-template-columns: 1fr; } }
.pay-todo-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--reg-rule); }
.pay-todo-list li + li { border-top: 1px solid var(--reg-rule); }
.pay-todo-list a { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.625rem 0.875rem; color: var(--reg-ink); text-decoration: none; }
.pay-todo-list a:hover { background: #f6f7f9; }
.pay-todo-list a span { text-decoration: underline; text-underline-offset: 3px; }
.pay-todo-list b { min-width: 2rem; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: right; }
.pay-todo-list b.due { color: var(--reg-red); }
.pay-todo-list b.zero { color: var(--reg-steel); }
.pay-page .pay-projects a, .pay-page .pay-todo-table a, .pay-page .pay-why-line a, .pay-page .pay-todo-links a, .pay-page .pay-names a { color: var(--atp-deep, #1d4e89); font-weight: 700; text-decoration: underline; }
.pay-page .pay-projects td.num, .pay-page .pay-table td.num, .pay-page .pay-table th.num, .pay-page .pay-projects th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-page .pay-projects tfoot > tr > * { border-top: 2px solid var(--reg-ink); font-weight: 700; }
.pay-filters { margin: 0 0 0.5rem; }
.pay-filters > summary { cursor: pointer; min-height: 2.5rem; display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--reg-ink); }
.pay-filters > summary::marker { content: ''; }
.pay-page .pay-tools select { max-width: 16rem; }
.pay-page .pay-filters .pay-tools .pay-find { flex: 1 1 100%; }
.pay-page .pay-table tr.pay-row { cursor: pointer; }
.pay-page .pay-table tr.pay-row:hover > td { background: #f6f7f9; }
.pay-page .pay-table td.nowrap { white-space: nowrap; }
.pay-page a.pay-open-link { font-weight: 700; color: var(--atp-deep, #1d4e89); white-space: nowrap; }
.pay-page .pay-status { border-radius: 0; padding: 0.0625rem 0.5rem; }
.pay-label { display: inline-block; margin: 0.125rem 0 0 0.25rem; padding: 0 0.375rem; border: 1px solid var(--reg-rule); font-size: 12.5px; font-weight: 700; color: var(--reg-steel); white-space: nowrap; }
.pay-label.bad { border-color: var(--reg-red); color: var(--reg-red); }
.pay-page .pay-why-line { display: block; margin-top: 0.25rem; font-size: 13px; color: var(--reg-steel); }
.pay-pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; margin-top: 0.75rem; font-size: 14px; }
.pay-pager:empty { display: none; }
.pay-page code.pay-code { font-size: 13px; overflow-wrap: anywhere; }
.pay-page button.pay-copy { min-height: 2rem; padding: 0.125rem 0.625rem; border: 2px solid var(--reg-rule); background: var(--reg-paper); font-size: 13px; font-weight: 700; color: var(--reg-ink); }
.pay-page button.pay-copy:hover { border-color: var(--reg-ink); }
.pay-page .pay-todo-table th, .pay-page .pay-todo-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--reg-rule); text-align: left; vertical-align: top; }
.pay-page .pay-todo-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-page .pay-todo-table td.pay-act { min-width: 10rem; }
.pay-page .pay-todo-table td.pay-act .pay-said { margin: 0 0 0.375rem; }
.pay-page .pay-todo-table tr.pay-form-row > td { background: #f6f7f9; border-left: 3px solid var(--reg-ink); }
.pay-page .pay-todo-links { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.pay-page .pay-none-left { margin: 0; }
.pay-page .pay-back { margin: 0 0 0.75rem; font-size: 14px; }
.pay-page .pay-order-line { margin: 0 0 0.5rem; color: var(--reg-steel); font-weight: 600; }
.pay-page .pay-order-status { margin: 0 0 0.75rem; }
.pay-page .pay-open { margin-top: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.pay-page .pay-names { columns: 1; }
/* An order's references each on one unbroken line (F15): the Payment block takes the whole width. */
.pay-page .pay-open > .pay-pay { grid-column: 1 / -1; }
.pay-page .pay-pay .pay-facts { grid-template-columns: 11rem 1fr; }
.pay-page .pay-pay code.pay-code { white-space: nowrap; overflow-wrap: normal; }
.pay-page .pay-pay .pay-facts dd { overflow-wrap: normal; }
.pay-page .pay-refund-what, .pay-page .pay-refund-amount { font-size: 14px; }
.pay-page .pay-refund-amount span { font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-page .pay-facts .bad, .pay-page b.bad { color: var(--reg-red); }
@media (max-width: 760px) {
  .pay-page :is(.pay-todo-table) thead { display: none; }
  .pay-page .pay-todo-table, .pay-page .pay-todo-table :is(tbody, tr, td, th) { display: block; width: auto; }
  .pay-page .pay-todo-table tr { padding: 0.5rem 0; border-top: 2px solid var(--reg-rule); }
  .pay-page .pay-todo-table td { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; padding: 0.25rem 0; border: 0; text-align: left !important; }
  .pay-page .pay-todo-table td[data-label]:not([data-label=""])::before { content: attr(data-label); font-size: 13px; font-weight: 700; color: var(--reg-steel); }
  .pay-page .pay-todo-table td.pay-act { display: block; }
  .pay-page .pay-todo-table td.pay-act button { width: 100%; min-height: 2.75rem; }
  .pay-page .pay-table td.nowrap { white-space: normal; }
  .pay-page .pay-table td.num, .pay-page .pay-projects td.num { text-align: left; }
  .pay-page .pay-pay code.pay-code { white-space: normal; overflow-wrap: anywhere; }
  .pay-page .pay-pay .pay-facts { grid-template-columns: auto 1fr; }
  .pay-tabs a { padding: 0.5rem 0.75rem; font-size: 14px; }
  .pay-page .pay-pager { justify-content: space-between; }
}
.pay-page label.pay-hide { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; margin: 0 0 0.5rem; font-size: 14px; font-weight: 600; color: var(--reg-ink); cursor: pointer; }
.pay-page label.pay-hide input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--reg-ink); }
.pay-page .pay-cell a, .pay-page .pay-why-line a { white-space: nowrap; }
.pay-page .pay-todo-table code.pay-code { white-space: nowrap; overflow-wrap: normal; }
.pay-page .pay-todo-table td.pay-act .pay-said { max-width: 16rem; }
#signInTo .nowrap { white-space: nowrap; }
/* Whom an order paid for takes the whole width, the names in columns, so a long list is short. */
.pay-page .pay-open > .pay-block:first-child { grid-column: 1 / -1; }
.pay-page .pay-open > .pay-block:first-child .pay-names { columns: 3 16rem; column-gap: 2.5rem; }
.pay-page p.pay-sum { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0.5rem 0 0.75rem; font-size: 14px; color: var(--reg-ink); }
.pay-page p.pay-sum > span { display: inline-flex; align-items: baseline; gap: 0.375rem; white-space: nowrap; }
.pay-page p.pay-sum small { font-size: 13px; font-weight: 700; color: var(--reg-steel); }
.pay-page p.pay-sum b { font-variant-numeric: tabular-nums; }
.pay-page .pay-for a { color: var(--atp-deep, #1d4e89); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pay-page small.pay-ref-small { font-family: var(--atp-font-mono, ui-monospace, monospace); font-size: 12px; color: var(--reg-steel); }
/* One order's people (F15): the name, then the FIN ending in a column of its own. */
.pay-page .pay-names .pay-who { display: inline-flex; width: min(100% - 0.25rem, 24rem); justify-content: space-between; align-items: baseline; gap: 0.75rem; vertical-align: top; }
.pay-page .pay-names .pay-who > span { min-width: 0; }
.pay-page .pay-names .pay-who > .pay-ending { flex: 0 0 auto; white-space: nowrap; }
.pay-page .pay-names :is(.pay-sat, .pay-retake) { display: block; }
.pay-page .pay-status-cell { display: inline; }
@media (max-width: 760px) {
  /* Orders on a phone (F16): each order a short card, company and total first, no label column. */
  .pay-page .pay-table tr.pay-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; padding: 0.75rem; }
  .pay-page .pay-table tr.pay-row > td { display: block; padding: 0; }
  .pay-page .pay-table tr.pay-row > td[data-label]::before { content: none; }
  .pay-page .pay-table tr.pay-row > td:nth-child(3) { order: 1; flex: 1 1 calc(100% - 8rem); min-width: 0; font-weight: 700; }
  .pay-page .pay-table tr.pay-row > td:nth-child(8) { order: 2; flex: 0 0 auto; font-weight: 700; text-align: right; }
  .pay-page .pay-table tr.pay-row > td:nth-child(1) { order: 3; flex: 0 0 auto; height: auto; }
  .pay-page .pay-table tr.pay-row > td:nth-child(4) { order: 4; color: var(--reg-steel); }
  .pay-page .pay-table tr.pay-row > td:nth-child(2) { order: 5; color: var(--reg-steel); }
  .pay-page .pay-table tr.pay-row > td:is(:nth-child(1), :nth-child(4)) { margin-right: 0.5rem; }
  .pay-page .pay-table tr.pay-row > td:nth-child(7) { order: 6; flex: 0 0 100%; }
  .pay-page .pay-table tr.pay-row > td:nth-child(5) { order: 7; font-size: 13px; color: var(--reg-steel); }
  .pay-page .pay-table tr.pay-row > td:nth-child(6) { order: 8; font-size: 13px; color: var(--reg-steel); }
  .pay-page .pay-table tr.pay-row > td:nth-child(6)::before { content: "· "; font: inherit; color: inherit; }
  .pay-page .pay-table tr.pay-row > td:nth-child(6)::after { content: " " attr(data-unit); }
  .pay-page .pay-table tr.pay-row .pay-label { margin-left: 0.25rem; }
  /* To do on a phone: a cell's words, links and Copy as one block beside its label. */
  .pay-page .pay-todo-table td > .pay-cell { grid-column: 2; min-width: 0; }
  /* By project on a phone: the total line laid out as every other. */
  .pay-page .pay-projects tfoot { display: block; }
  .pay-page .pay-projects tfoot > tr { border-top: 2px solid var(--reg-ink); }
  .pay-page .pay-projects tfoot > tr > * { border-top: 0; }
  .pay-page label.pay-hide input { width: 2rem; height: 2rem; }
  .pay-tabs { flex-wrap: wrap; overflow-x: visible; }
  /* References on a phone (audit 15, 16): the label above, the reference whole on its own line, Copy beside or under it. */
  .pay-page .pay-todo-table td:has(.pay-code) { grid-template-columns: 1fr; gap: 0.125rem; }
  .pay-page .pay-todo-table td:has(.pay-code) > .pay-cell { grid-column: 1; }
  .pay-page .pay-facts { grid-template-columns: 1fr !important; row-gap: 0.125rem; }
  .pay-page .pay-facts dd { margin: 0 0 0.5rem; }
  .pay-page code.pay-code, .pay-page .pay-pay code.pay-code { white-space: nowrap; overflow-wrap: normal; }
  .pay-page .pay-refund-what { display: grid; gap: 0.25rem; justify-items: start; }
  .pay-page .pay-facts dd { overflow-wrap: normal; }
  .pay-page .pay-money > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media print {
  .pay-tabs, .pay-page .pay-demo { display: none !important; }
}

/* ==========================================================================
 * The official look, everywhere (design pass, 25 Nov 2026). The subcontractor's
 * pages set it ("no rounded corners"); every admin screen now follows: the
 * dark band with the mark once and a 4px orange strip under it, a light rail
 * whose current page has an orange bar, square ruled panels, figures as ruled
 * blocks with their help in a line, sentence case, bordered status words.
 * Look only: nothing here moves, hides or renames what a screen does.
 * ========================================================================== */

/* -- the band -- */
.topbar { background: var(--atp-band); color: #fff; border-bottom: 4px solid var(--atp-orange); }
.topbar-brand { gap: 0.875rem; color: #fff; text-decoration: none; }
.topbar-brand img { height: 1.75rem; }
.topbar-name { padding-left: 0.875rem; border-left: 1px solid rgb(255 255 255 / 25%); font-size: 15px; font-weight: 600; white-space: nowrap; }
@media (max-width: 64rem) { .topbar-name { display: none; } }
.topbar .navToggle { color: #fff; }
.topbar .navToggle:hover { background: rgb(255 255 255 / 10%); }
.topbar .who { border-left-color: rgb(255 255 255 / 25%); }
.topbar .who .name { color: #fff; }
.topbar .who .label { color: #c9d1db; font-size: 12.5px; font-weight: 600; }
.topbar .who .chip { background: transparent; border: 1px solid rgb(255 255 255 / 45%); color: #fff; }
.topbar .signout { background: transparent; color: #fff; border: 2px solid rgb(255 255 255 / 70%); font-weight: 600; }
.topbar .signout:hover { background: rgb(255 255 255 / 12%); }
.topbar .bell { color: #fff; }
.topbar .bell:hover { background: rgb(255 255 255 / 10%); }
.bell b { background: var(--atp-orange); color: #111; }
.topbar .search { background: #fff; border-color: #fff; }

/* -- the rail: the original dark panel; the page you are on has the orange bar (user, 25 Nov) -- */
.rail { background: var(--atp-panel); border-right: 0; }
@media (min-width: 48.0625rem) {
  body:has(.rail):not(.rail-collapsed) { background-image: linear-gradient(to right, var(--atp-panel) var(--rail), transparent var(--rail)); }
}
.rail nav { padding: 0.75rem 0; gap: 0; }
/* #cbd5e1 on #171717: 12.9:1. */
.rail nav a { color: #cbd5e1; font-size: 14px; font-weight: 500; padding: 11px 16px 11px 20px; border-left: 4px solid transparent; }
.rail nav a:hover { color: #fff; background: rgb(255 255 255 / 6%); }
.rail nav a.on { background: rgb(255 162 19 / 14%); color: #fff; font-weight: 700; border-left-color: var(--atp-orange); }
.rail nav a .nav-count { background: var(--atp-orange); color: #111; }
.navClose { color: var(--atp-ink-2); }
.navClose:hover { background: var(--atp-surface-2); color: var(--atp-ink); }

/* -- type: a real heading scale, sentence case -- */
h1 { font-size: 1.875rem; letter-spacing: 0; }
h2 { font-weight: 700; }
.label { font-size: 13px; color: var(--atp-ink-3); }
.panel > header h2.cap, .figures-h, #unplaced h2.cap { font-size: 1.0625rem; font-weight: 700; color: var(--atp-ink); }
.figures-h { margin: 0 0 0.625rem; }
legend { font-size: 14px; color: var(--atp-ink-2); }

/* -- panels: white sheets with a rule -- */
.panel, .scope, .scroll { border-color: var(--atp-line-strong); }
.panel > header { background: var(--atp-grey-50); }

/* -- figures: a ruled block, the number over its label, the help as one line under them -- */
.card { flex-direction: column; align-items: stretch; border-color: var(--atp-line-strong); }
.card .icon, .feed .icon { display: none; }
.card > a { padding: 1rem 1rem 0.5rem; }
.card b { font-size: 2rem; letter-spacing: 0; }
.card small, .figures-row .card small { font-size: 14px; font-weight: 600; color: var(--atp-ink-2); overflow-wrap: normal; }
.card .why { display: none; }
.card .explain, .card:hover .explain, .card:focus-within .explain, .card.explaining .explain {
  position: static; opacity: 1; visibility: visible; transition: none;
  margin: 0; padding: 0 1rem 0.875rem; background: none; color: var(--atp-ink-3);
  font-size: 13px; line-height: 1.45;
}
.card.plain { border-left-width: 1px; }
.card small::first-letter { text-transform: uppercase; }
/* On a phone the figures are one column, each with its line of help. */
@media (max-width: 40rem) {
  #counts.figures-row, .cards.figures-row, #counts.figures-row:has(> li:nth-child(4)) { grid-template-columns: 1fr; gap: 0.625rem; }
  .figures-row .card > a { padding: 0.875rem 1rem 0.375rem; flex-direction: column; gap: 0.125rem; }
  .figures-row .card b { font-size: 1.75rem; }
  .figures-row .card small { font-size: 14px; }
}
.card.alert, .card.warn, .card.unpaid { border-left-width: 4px; }

/* -- buttons and fields: square, 2px on what you press -- */
select, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="number"], textarea {
  border-color: #7a8591;
}
.signout { border-width: 2px; border-color: var(--atp-ink); color: var(--atp-ink); font-weight: 600; }
.segmented { background: var(--atp-surface); border-color: var(--atp-line-strong); }
.segmented button.on { background: var(--atp-ink); color: #fff; }

/* One focus ring for everything: a black rule inside an orange one, so it shows on white (18.9:1) and on the band (7.8:1). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--atp-orange) !important; outline-offset: 2px !important; box-shadow: 0 0 0 2px #111 !important;
}
select:focus, input:focus, textarea:focus { border-color: var(--atp-ink); }

/* -- tables: ruled, no zebra, the header in ink -- */
th { font-size: 13px; color: var(--atp-ink-2); background: var(--atp-grey-50); }
thead th { border-bottom: 2px solid var(--atp-ink); }
tbody th, tfoot th { border-bottom: 1px solid var(--atp-line); }
tbody tr:nth-child(even), table.matrix tbody tr:nth-child(even) th[scope="row"] { background: transparent; }

/* -- tabs: the one you are on underlined in orange, its words in ink -- */
.pay-tabs a[aria-current="page"] { color: var(--atp-ink); border-bottom-color: var(--atp-orange); }

/* -- status: bordered words with a sign, never a filled pill -- */
.pq-pill, .pay-status, .pay-tag, .sf-pill, .doc-chip, .q .tag, .modulecard .pill,
.pq :is(.pq-pill, .pay-status), .sub-body :is(.sf-pill, .doc-chip),
.pay-page .pay-status:is(.paid, .pending, .expired, .late, .refund, .refunded), .pay-tag:is(.unpaid, .failed),
.sub-body :is(.sf-pill.outstanding, .sf-pill.needs_review, .doc-chip.missing, .sf-pill.ready), .pq :is(.pq-pill.outstanding, .pq-pill.needs_review, .pq-pill.eligible) {
  background: transparent !important; border: 1px solid currentColor !important; border-radius: 0 !important;
  padding: 0 0.375rem; font-size: 12.5px; font-weight: 700;
}
.pq-pill.eligible::before, .sf-pill.ready::before { content: '✓ '; }
:is(.pq-pill, .sf-pill):is(.outstanding, .needs_review)::before { content: '! '; }
.pq-pill.rejected::before { content: '× '; }
.pay-page .pay-status.refund::before { content: '× '; }
.pay-status.paid::before { content: '✓ '; }
.pay-status:is(.pending, .expired, .late)::before { content: '! '; }
.pay-status.refund::before { content: '× '; }
/* The roster's states: a sign where one means something, no drawn squares. */
.pay-tag::before, .pay-tag.paid::before, .pay-tag:is(.sat, .sitting)::before { content: none; }
.pay-tag.unpaid::before { content: '!'; width: auto; height: auto; border: 0; background: none; }
.pay-tag.failed::before { content: '×'; width: auto; height: auto; border: 0; background: none; }
.pay-tag:is(.passed, .certified)::before { content: '✓'; width: auto; height: auto; border: 0; background: none; }
.doc-chip.missing::before { content: '! '; }
.pq-pill.outstanding, .pq-pill.needs_review, .pq-pill.rejected { color: var(--atp-danger); }
.pq-pill.eligible { color: var(--atp-success); }
.pay-tag.unpaid, .pay-page .pay-status:is(.pending, .expired, .late) { color: var(--atp-warning); }

/* -- dashboard rows: the colour as the figure, not a dot -- */
.reasons .bad .how b { color: var(--atp-danger); }
.bars .track { background: var(--atp-line); }

/* -- the subcontractor's band: the same strip -- */
.sub-band, .sub-body .sub-band { border-bottom: 4px solid var(--atp-orange); }

/* -- the sign-in card: a ruled sheet -- */
.gate-card { border-color: var(--atp-line-strong); }

/* Personnel: "Assign supervisor to N" while somebody is ticked (fix list P7). Square and ruled, as the rest. */
#bulkBar:empty { display: none; }
.bulk-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem;
  margin: 0 0 0.75rem; padding: 0.75rem 1rem;
  background: var(--atp-surface); border: 2px solid var(--atp-ink); border-left-width: 6px;
}
.bulk-bar > b { align-self: center; font-size: 15px; }
.bulk-bar select { min-width: min(22rem, 100%); }
.bulk-bar .pickerlabel { flex: 1 1 16rem; }
.bulk-said { margin: 0 0 0.75rem; font-weight: 600; }
table.matrix th.ticks { padding-left: 2.75rem; }
table.matrix label.tick { position: absolute; left: 0; top: 0; bottom: 0; width: 2.5rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }
table.matrix label.tick input { width: 1.25rem; height: 1.25rem; margin: 0; cursor: pointer; }
table.matrix td.boss { font-size: 14px; color: var(--atp-ink-2); }
@media (max-width: 48rem) {
  .bulk-bar { flex-direction: column; align-items: stretch; }
  .bulk-bar button { width: 100%; }
}

/* Prequalification's pages of their own (fix list P17): links on the right, the way back on the left. */
.pq-pagelinks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.pq-pagelinks .pq-back { margin-right: auto; font-weight: 600; }
.pq-pagelinks .pq-back[hidden] + a { margin-left: auto; }
@media (max-width: 48rem) { .pq-pagelinks .button { flex: 1 1 auto; text-align: center; } }

/* Manage subcontractors (fix list P23): where each one's personnel stand, each count a link; Replace link folded under More. */
.sub-counts { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.25rem; font-size: 14px; }
.sub-count { color: var(--atp-ink-2); text-decoration: underline; text-underline-offset: 2px; }
.sub-count.zero { text-decoration: none; color: var(--atp-ink-3); }
.sub-count strong { color: var(--atp-ink); }
.sub-count.unpaid, .sub-count.unpaid strong { color: var(--atp-warning); }
.sub-more { position: relative; }
.sub-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.4rem 0.6rem; font-weight: 600; font-size: 13.5px; border: 1px solid var(--atp-line-strong); }
.sub-more > summary::-webkit-details-marker { display: none; }
.sub-more[open] > button { position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 5; white-space: nowrap; background: var(--atp-surface); box-shadow: 0 2px 8px rgb(0 0 0 / 0.18); }
@media (max-width: 48rem) { .sub-more[open] > button { right: auto; left: 0; } }

/* Personnel's table on a phone: a count that is a link sits on its label's line. */
@media (max-width: 48rem) { table.subsum td[data-label] { align-items: center; } table.subsum td .linklike { min-height: 24px; display: inline-flex; align-items: center; } }

/* ---------- stage 3b: one page header and toolbar; wide screens ---------- */
/*
 * Prequalification, Personnel and the Dashboard share one header (25 Nov
 * 2026): the title and its line on the left, the page's own actions on the
 * right of that row; one toolbar of choosers, labels above; then the counts.
 */
.head { margin-bottom: 1.25rem; }
.pq-phead { margin-bottom: 1.25rem; }
.pq-phead h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.pq-phead p.lede { margin: 0; font-size: inherit; color: var(--atp-ink-2); }
.pq-pagelinks { margin: 0; justify-content: flex-end; }
.pq-pagelinks .pq-back { margin-right: 0; }
.pq-pagelinks .pq-back[hidden] + a { margin-left: 0; }
.pickrow { align-items: flex-end; gap: 0.75rem 1rem; margin: 0 0 1.25rem; }
.prequal-picks .project-pick { display: inline-flex; flex-direction: column; align-items: stretch; gap: 0.25rem;
  font-size: 12px; font-weight: 600; color: var(--atp-ink-3); }
.prequal-picks .project-pick[hidden] { display: none; }
.prequal-picks .sub-pick label { display: block; margin: 0; font: inherit; color: inherit; }
.pickrow select, .pickrow input[type="search"] { min-height: 2.5rem; font-size: 14px; }
.prequal-picks select { min-width: 12rem; max-width: 22rem; padding: 0 0.625rem; }
.pickrow .search-field { margin: 0; flex: 1 1 18rem; max-width: 28rem; }
.pickrow .search-field input { width: 100%; box-sizing: border-box; }
.scope { background: none; border: 0; box-shadow: none; padding: 0; margin: 0 0 1.25rem; }
.scoperow { padding-bottom: 0; border-bottom: 0; }
.scopenote { margin: 0.5rem 0 0; font-size: 13px; }
.pq-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1rem; }
.pq-tools .pq-issues { margin: 0; }
.pq-tools .pq-issues-h { flex-direction: column; align-items: stretch; gap: 0.25rem; font-size: 12px; color: var(--atp-ink-3); }
.pq-tools .pq-issues-h select { min-height: 2.5rem; font-size: 14px; }
.pq-tools .pq-findbox input[type="text"] { min-height: 2.5rem; }
.pq-tools .pq-finder { min-height: 2.5rem; }
.pq-alerts:not(:empty) { margin-bottom: 0.75rem; }
.pq-tools .pq-finder { flex: 1 1 20rem; }
@media (max-width: 40rem) {
  .prequal-picks > * { flex: 1 1 100%; }
  .prequal-picks select { width: 100%; max-width: none; min-width: 0; }
  .pq-pagelinks { justify-content: flex-start; width: 100%; }
  .pickrow .search-field { max-width: none; }
}

/*
 * Wide screens (25 Nov 2026): the content column is centred in the space
 * right of the sidebar (in the page where there is none). Lists and tables
 * (`page-wide`: Dashboard, Personnel, Prequalification's list, every Finance
 * page) grow to 100rem; forms and reading pages keep their width.
 */
.page { margin-inline: auto; }
.page.page-wide { max-width: none; }
/* look-screens.css has `main .page { max-width: 80rem }` (0,1,1); `main .page.page-wide` (0,2,1) beats it from here (ticket 069). */
main .page.page-wide { max-width: none; }

/*
 * Ultrawide monitors (stage 4, item 9; 3440x1440 is a real reader's screen):
 * list pages use the width beside the sidebar, main's 2rem gutter each side,
 * up to 150rem (2400px), then centre. Reading and form pages keep their width.
 * Space is used, not stretched: past ~2000px of content the Dashboard's two
 * figure groups share one row, tables fill their box, and a Prequalification
 * row's name, FIN and tags keep sensible widths while the issue takes the slack.
 * Nothing here applies at 1440 or below.
 */
@media (min-width: 1800px) {
  .page-wide table.subsum { width: 100%; }
  .page-wide table.subsum th:first-child, .page-wide table.subsum td:first-child { width: 40%; }
  /* Name, FIN, tag and actions keep sensible widths; the issue takes the slack, so every row's arrow sits at the right edge, in line with the group headings' (the user, 25 Nov 2026). */
  .pq-head { grid-template-columns: 1.1rem 1.875rem minmax(14rem, 26rem) 7rem minmax(0, 1fr) 10rem 13rem; }
}
@media (min-width: 2300px) {
  /* The Personnel and Prequalification groups side by side, six figures in one row; each keeps its heading. */
  .page.page-wide:has(> #prequalFigures:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.25rem; align-items: start; }
  .page.page-wide:has(> #prequalFigures:not([hidden])) > * { grid-column: 1 / -1; }
  .page.page-wide:has(> #prequalFigures:not([hidden])) > section.figures { grid-column: auto; }
}

/* The bell's list (stage 3b): under the bell, one link per line; never wider than the screen. */
#bellSlot { position: relative; display: inline-flex; }
.bell-menu { position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 60; width: max-content; min-width: 16rem;
  max-width: min(24rem, calc(100vw - 1.5rem)); background: var(--atp-surface); color: var(--atp-ink);
  border: 1px solid var(--atp-line-strong); box-shadow: var(--atp-shadow-2); padding: 0.375rem 0; text-align: left; }
.bell-menu[hidden] { display: none; }
.bell-menu ul { list-style: none; margin: 0; padding: 0; }
.bell-menu a { display: block; padding: 0.625rem 1rem; color: var(--atp-ink); font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.35; }
.bell-menu a:hover, .bell-menu a:focus-visible { background: var(--atp-surface-2); text-decoration: underline; }
.bell-menu li + li { border-top: 1px solid var(--atp-line); }
.bell-empty { margin: 0; padding: 0.625rem 1rem; font-size: 14px; color: var(--atp-ink-2); }
@media (max-width: 40rem) { .bell-menu { position: fixed; top: calc(var(--bar) + 0.25rem); right: 0.75rem; left: 0.75rem; width: auto; max-width: none; min-width: 0; } }

/* "Your orders" (stage 4, P24): a section heading of its own, ruled off from the list above. */
.sub-body .pay-orders-h { font-size: 1.125rem; font-weight: 700; margin: 1.25rem 0 0.5rem; padding-top: 1rem; border-top: 1px solid var(--reg-rule); color: var(--reg-ink); }

/* A date never breaks in two in the review table (stage 4). */
.review-table td.nowrap { white-space: nowrap; }

/*
 * Controls keep a sensible width on a wide screen (stage 4 round 2, user 25 Nov):
 * the page may grow, a button or a field does not. Inputs and selects stop at
 * 40rem; Prequalification's count boxes stop at 17rem each and sit from the
 * left; the search sits beside its dropdown. Tables and lists still use the width.
 */
@media (min-width: 48.0625rem) {
  .page :is(input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input:not([type]), select) { max-width: 40rem; }
  .pq-states, .pq-states:has(.pq-st.unpaid), .pq-states:has(.pq-st.unpaid):has(.pq-st.failed) { display: flex; flex-wrap: wrap; justify-content: flex-start; }
  .pq-states > * { flex: 0 1 17rem; min-width: 0; }
  .pq-tools .pq-finder { flex: 1 1 30rem; }
  .pq-findbox { flex: 1 1 20rem; max-width: 40rem; }
  .page :is(button, a.button) { max-width: 30rem; }
}

/*
 * Accent boxes, one rule (stage 4 round 2, user 25 Nov: "a coloured line on one
 * side only looks strange"). Every accent box has a 1px border all round in a
 * light line of its hue and a 4px accent on the left in the same hue; a box
 * that is a message also takes a faint tint of that hue. No stripe-only box.
 * Last in the file and !important, as the subcontractor's restyle above is.
 */
:root {
  --acc-green: #1f6f43; --acc-green-line: #b9d8c4; --acc-green-tint: #eef6f1;
  --acc-red: #b3262e; --acc-red-line: #e7b3b6; --acc-red-tint: #fbeaeb;
  --acc-amber: #FFA213; --acc-amber-line: #fcd9a0; --acc-amber-tint: #fff8eb;
  /* An explanation is not a status: zinc, not blue (ticket 068). */
  --acc-blue: #a1a1aa; --acc-blue-line: #e4e4e7; --acc-blue-tint: #f4f4f5;
  --acc-steel: #4a5868; --acc-steel-line: #c9d0d8; --acc-steel-tint: #f2f4f6;
}
/* Messages: line, accent and tint. */
:is(.sub-body #payReturned, .pay-page .pay-said, .verdict-group.eligible, .sub-body .pay-orders > li.pay-order.paid, .addsub-outcome.good) {
  border: 1px solid var(--acc-green-line) !important; border-left: 4px solid var(--acc-green) !important; background: var(--acc-green-tint) !important; }
:is(.held, .sf-held-one, .pt-wrong, .pay-page .pay-refund-block, .verdict-group.outstanding, .verdict-group.needs_review, .sub-body .crew-problem, .drawer .clearance, .note.bad) {
  border: 1px solid var(--acc-red-line) !important; border-left: 4px solid var(--acc-red) !important; background: var(--acc-red-tint) !important; }
/* Payments (25 Nov): a refund recorded or a checkout voided is done, so green; a checkout still to void waits, so amber, as its tag. */
.pay-page .pay-refund-block.done { border-color: var(--acc-green-line) !important; border-left-color: var(--acc-green) !important; background: var(--acc-green-tint) !important; }
.pay-page .pay-refund-block.done h3 { color: var(--acc-green) !important; }
.pay-page .pay-refund-block.owed.pay-void-block { border-color: var(--acc-amber-line) !important; border-left-color: var(--acc-amber) !important; background: var(--acc-amber-tint) !important; }
.pay-page .pay-refund-block.owed.pay-void-block h3 { color: var(--atp-ink) !important; }
.pay-page .panel.pay-chosen-list { border: 1px solid var(--acc-blue-line) !important; border-left: 4px solid var(--acc-blue) !important; }
:is(.sentback-banner, .verdict-group.held-here, .sub-body .loose.loose, .sub-body .crew-problem.review, .sf-head, .dash-notice, .addsub-outcome.bad, .pq-alert) {
  border: 1px solid var(--acc-amber-line) !important; border-left: 4px solid var(--acc-amber) !important; background: var(--acc-amber-tint) !important; }
:is(.pq-next, .pic-comment, .panel.explain) {
  border: 1px solid var(--acc-blue-line) !important; border-left: 4px solid var(--acc-blue) !important; background: var(--acc-blue-tint) !important; }
:is(.pay-demo, .sub-body .pay-total, .sub-body .pay-orders > li.pay-order) {
  border: 1px solid var(--acc-steel-line) !important; border-left: 4px solid var(--acc-steel) !important; background: var(--acc-steel-tint) !important; }
.sub-body .sentback-banner.done.done, .sentback-banner.done.done.done { border-color: var(--acc-green-line) !important; border-left-color: var(--acc-green) !important; background: var(--acc-green-tint) !important; }
/* Cards (not messages): line all round, the accent on the left, a white ground. */
:is(.sub-body .crew-member, .sf-fold.sf-rejected, .drawer .record.valid, .drawer .record.soon, .drawer .record.lapsed, .drawer .record.failed, .drawer .record.open, .q.pending, .sub-first.sub-more) {
  border: 1px solid var(--acc-steel-line) !important; border-left-width: 4px !important; }
.sub-body .crew-member { border-left-color: var(--acc-amber) !important; }
.sub-body .crew-member:not(.incomplete) { border-left-color: var(--acc-green) !important; }
.sub-body :is(.sf-card.ready, .sf-row.ready) { border: 1px solid var(--acc-green-line) !important; border-left: 4px solid var(--acc-green) !important; }
.sf-fold.sf-rejected, .drawer .record.lapsed, .drawer .record.failed { border-left-color: var(--acc-red) !important; }
.drawer .record.valid { border-left-color: var(--acc-green) !important; }
.drawer .record.soon, .q.pending { border-left-color: var(--acc-amber) !important; }
.drawer .record.open { border-left-color: var(--acc-steel) !important; }
.sub-first.sub-more { border-left-color: var(--acc-blue) !important; }
/* On the registration page itself, no link to it (stage 4 round 2). */
.pay-register.on-page { display: none; }
/* Round 2 review: the done banner's words in its own green; the first-visit steps ruled all round;
   each accent card's line in its own hue; the subcontractor picker's waiting ring stays red, as its alert (user, 25 Nov). */
.sub-body .sentback-banner.done.done b { color: var(--acc-green) !important; }
.sub-first .plain-steps li { border: 1px solid var(--acc-steel-line) !important; border-left: 4px solid var(--acc-steel) !important; padding: 0.25rem 0.75rem !important; margin-bottom: 0.375rem; }
.card.alert { border: 1px solid var(--acc-red-line); border-left: 4px solid var(--acc-red); }
.card.warn, .card.unpaid { border: 1px solid var(--acc-amber-line); border-left: 4px solid var(--acc-amber); }
.sub-body .crew-member { border-color: var(--acc-amber-line) !important; }
.sub-body .crew-member:not(.incomplete) { border-color: var(--acc-green-line) !important; }
.sf-fold.sf-rejected, .drawer .record.lapsed, .drawer .record.failed { border-color: var(--acc-red-line) !important; }
.drawer .record.valid { border-color: var(--acc-green-line) !important; }
.drawer .record.soon, .q.pending { border-color: var(--acc-amber-line) !important; }
.sub-first.sub-more { border-color: var(--acc-blue-line) !important; }
.sub-body .crew-member, .sub-body .crew-member:not(.incomplete), .sf-fold.sf-rejected, .drawer .record, .q.pending, .sub-first.sub-more { border-left-width: 4px !important; }
.sub-body .crew-member { border-left-color: var(--acc-amber) !important; }
.sub-body .crew-member:not(.incomplete) { border-left-color: var(--acc-green) !important; }
.sf-fold.sf-rejected, .drawer .record.lapsed, .drawer .record.failed { border-left-color: var(--acc-red) !important; }
.drawer .record.valid { border-left-color: var(--acc-green) !important; }
.drawer .record.soon, .q.pending { border-left-color: var(--acc-amber) !important; }
.sub-first.sub-more { border-left-color: var(--acc-blue) !important; }
/* At 360 the glance and the phone's Send bar fit the screen (stage 4 round 3: both ran 2px wide). */
.sf-glance { grid-template-columns: minmax(0, 1fr); }
.sf-glance select { max-width: 100%; min-width: 0; }
.sf-phone-send { box-sizing: border-box; }

/* ---------- a subcontractor's worker sign-in code (ticket 045, signInCodeCard.ts) ---------- */

/* The subcontractor's Sign-in code page (?step=code); its link at the top is not shown on it. */
main:has(#stepCode:not([hidden])) #codeBand { display: none; }
.code-line { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.code-value { font: 700 1.25rem/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.05em; }
.code-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 0.5rem; }
/* The person in charge's panel under a subcontractor's card. */
.sub-code { margin-top: 0.75rem; padding: 0.75rem 1rem; border: 1px solid var(--reg-rule, #c9d0d8); border-radius: 6px; background: #f7f9fb; }
.sub-code .lede { margin: 0; font-size: 14px; }
.sub-code .code-actions { margin-bottom: 0; }
/* `.sub-row b` makes a bold word a block; the code stays in its line. */
.sub-code .code-value { display: inline; }
/* Side by side at phone width too, each button its own width (the user, 29 Nov 2026). */
.sub-code .code-actions { flex-wrap: nowrap; }
.sub-code .code-actions button { flex: 0 1 auto; padding-inline: 0.875rem; }

/* -- status labels are filled, never a hollow outline (the user, 26 Nov 2026) --
   White words on the state's own colour, with its sign. Neutral states are grey.
   `:not(.unfilled)` only lifts each state rule above the default's weight. */
body :is(.pq-pill, .pay-status, .pay-tag, .sf-pill, .doc-chip, .q .tag, .modulecard .pill,
  .pq .pq-pill.outstanding, .sub-body .sf-pill.outstanding) {
  background: var(--atp-ink-2) !important; color: #fff !important; border-color: transparent !important;
}
body :is(.pq-pill, .sf-pill, .pay-status, .pay-tag, .doc-chip, .modulecard .pill):is(.outstanding, .needs_review, .rejected, .missing, .refund, .failed, .req):not(.unfilled) { background: var(--atp-danger) !important; }
body :is(.pq-pill, .sf-pill, .pay-status, .pay-tag, .doc-chip):is(.eligible, .ready, .paid, .passed, .certified, .refunded):not(.unfilled) { background: var(--atp-success) !important; }
/* Waiting: black words on Precise Orange (9.8:1), never white on it. */
body :is(.pq-pill, .sf-pill, .pay-status, .pay-tag, .doc-chip, .modulecard .pill):is(.pending, .expired, .late, .unpaid, .wait):not(.unfilled) { background: var(--atp-warning-mark) !important; color: #0a0a0a !important; }
body .q.pending .tag { background: var(--atp-warning-mark) !important; color: #0a0a0a !important; }
body :is(.pq-pill, .sf-pill, .pay-status, .pay-tag):is(.resent):not(.unfilled) { background: var(--atp-info) !important; }
body :is(.pq-pill, .sf-pill, .pay-status, .pay-tag):is(.waiting, .voided, .sat, .sitting):not(.unfilled):not(.unfilled-x) { background: var(--atp-ink-2) !important; }

/* -- the per-subcontractor table's total: one tinted band, ruled off above (the user, 26 Nov 2026) --
   Every cell the same navy tint and ink, figures bold, a 2px rule over the whole row. */
table.subsum tfoot > tr > * {
  background: #f4f4f5 !important; color: var(--atp-ink); font-weight: 700;
  border-top: 2px solid var(--atp-ink); border-bottom: 1px solid var(--atp-line-strong);
}
table.subsum tfoot td { border-left: 1px solid var(--atp-line-strong); }
table.subsum tfoot th { font-size: 14px; }
table.subsum tfoot td small { font-weight: 400; color: var(--atp-ink-2); }
@media (max-width: 48rem) {
  table.subsum tfoot { display: block; }
  table.subsum tfoot > tr { display: block; padding: 0.5rem 0.75rem; background: #f4f4f5; border-top: 2px solid var(--atp-ink); }
  table.subsum tfoot > tr > * { border-top: 0; }
}

/* -- Finance's pages, fitted (the user, 26 Nov 2026) --
   The tabs' underline is a shadow inside the row, so the row never scrolls a
   few pixels to itself. By project takes two thirds of the pair and goes under
   To do when the pair is too narrow for it; its own box scrolls before the page
   would. Both totals (By project, the month-end report) are the band the
   per-subcontractor table's total is: tinted, ruled above, bordered, bold. */
.pay-tabs { border-bottom: 0; box-shadow: inset 0 -2px 0 var(--reg-rule); overflow-y: hidden; }
.pay-tabs a { margin-bottom: 0; }
.pay-tabs[hidden] { display: none; }
.pay-tabs:empty { box-shadow: none; }
.pay-page #overview { container: pay-overview / inline-size; }
.pay-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@container pay-overview (max-width: 60rem) { .pay-pair { grid-template-columns: minmax(0, 1fr); } }
.pay-page .pay-projects { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
@media (min-width: 761px) { .pay-page .pay-projects :is(th, td) { padding: 0.5rem 0.625rem; } }
.pay-page .pay-projects thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.pay-page .pay-projects td.num { white-space: nowrap; }
/* Orders: the subcontractor and course wrap, so Status and Total stay in view on a laptop with the sidebar open;
   a HitPay invoice stays whole on a wide screen and breaks only where a phone card is too narrow for it. */
.pay-page .pay-table td:is(:nth-child(3), :nth-child(5)) { white-space: normal; min-width: 8rem; }
.pay-page small.pay-ref-small { overflow-wrap: break-word; }
:is(.pay-page .pay-projects, .pay-report-table) tfoot > tr > * {
  background: #f4f4f5 !important; color: var(--atp-ink); font-weight: 700;
  border-top: 2px solid var(--atp-ink); border-bottom: 1px solid var(--atp-line-strong);
}
:is(.pay-page .pay-projects, .pay-report-table) tfoot td { border-left: 1px solid var(--atp-line-strong); }
:is(.pay-page .pay-projects, .pay-report-table) tfoot th { font-size: 14px; }
@media (max-width: 760px) {
  /* An order card's cells never wider than the card: a long HitPay invoice breaks rather than widening the page. */
  .pay-page .pay-table tr.pay-row > td { max-width: 100%; min-width: 0; }
  .pay-page .pay-projects tfoot { display: block; }
  .pay-page .pay-projects tfoot > tr { display: block; padding: 0.5rem 0.75rem; background: #f4f4f5; border-top: 2px solid var(--atp-ink); }
  .pay-page .pay-projects tfoot > tr > * { border-top: 0; border-left: 0; border-bottom: 0; }
}
/* The report stacks at 40rem, its total with it; never in print, where it stays a table row. */
@media screen and (max-width: 40rem) {
  .pay-report-table tfoot { display: block; }
  .pay-report-table tfoot > tr { display: block; padding: 0.5rem 0.75rem; background: #f4f4f5; border-top: 2px solid var(--atp-ink); }
  .pay-report-table tfoot > tr > * { border-top: 0; border-left: 0; border-bottom: 0; }
}

/* Ticket 044 (26 Nov 2026). A Dashboard figure several subcontractors share opens nothing itself: each share below is a link. */
.card > .card-body, .figures-row .card > .card-body { display: block; padding: 1rem 1rem 0.5rem; }
@media (max-width: 40rem) { .figures-row .card > .card-body { padding: 0.875rem 1rem 0.375rem; } }
.card ul.card-parts { list-style: none; padding: 0 1rem 0.75rem; margin: 0; display: grid; gap: 0.25rem; }
.card.shared ul.card-parts { padding-top: 0; }
/* The bell's headings: one per kind of line. */
.bell-menu li.bell-h { padding: 0.5rem 1rem 0.25rem; font-size: 12px; font-weight: 700; color: var(--atp-ink-3); text-transform: none; }
.bell-menu li.bell-h + li { border-top: 0; }
/* Waiting for you: the total of the three boxes after it, set apart by a heavier rule. */
.pq-st.total { border-width: 2px; }
.pq-empty .pq-empty-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; }

/* The send-back bar follows the page while anybody is ticked (ticket 044): its holder sticks, not only the bar inside it. */
#pqBulk { position: sticky; bottom: 0.5rem; z-index: 30; }
#pqBulk .pq-bulk { position: static; }
/* Manage subcontractors (ticket 044): two lines a card, Prequalification and the roster, each with its heading. */
.sub-counts .sub-counts-h { font-weight: 700; color: var(--atp-ink); min-width: 9.5rem; }
.sub-counts .sub-counts-h a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sub-head .sub-counts { display: flex; }

/* Personnel on a phone (ticket 044): name, Status and Supervisor; the subcontractor and NRIC / FIN under the name; the per-subcontractor table folded. */
.matrix .who-phone { display: none; }
@media (max-width: 40rem) {
  .matrix :is(td, th).role, .matrix :is(td, th).fin, .matrix :is(td, th).ref { display: none; }
  .matrix .who-phone { display: block; font-weight: 400; font-size: 12.5px; color: var(--atp-ink-3); white-space: normal; }
  .subsum-fold { border: 1px solid var(--atp-line); background: var(--atp-surface); }
  .subsum-fold > summary { padding: 0.625rem 0.875rem; font-weight: 700; cursor: pointer; }
  .subsum-fold table.subsum { border: 0; border-top: 1px solid var(--atp-line); }
  .subsum-fold table.subsum caption { display: none; }
}
/* A completion bar that opens nothing (ticket 044): laid out as the linked one. */
.bars .bar-body { display: block; padding: 0.875rem 1.25rem; }
/* Admin's To do tab count: the same filled orange badge as Finance's sidebar (ticket 044 extras). */
.pay-tab-count, .pay-tab-count.due { display: inline-block; min-width: 1.375rem; padding: 0.05rem 0.4rem; border: 0; background: var(--atp-orange); color: #111; font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center; }

/* The drawer's close button has a row of its own above the first item, for every role (ticket 044 extras); after the rail's own padding so it wins. */
@media (max-width: 48rem) { .rail nav { padding-top: 3.25rem; } }
/* Wide Finance pages (the user, 26 Nov 2026): the page grows as the Dashboard does, but a list of names never runs edge to edge. */
.pay-page .pay-names { max-width: 75rem; }
