/*
 * Rapid Reports — Proprietary and Confidential.
 * Copyright (c) 2026 <LICENSOR LEGAL NAME>. All rights reserved.
 * Licensed, not sold. Unauthorized copying, distribution, modification, or use
 * is prohibited. See LICENSE and THIRD_PARTY_NOTICES.txt.
 */
/*
 * app.css — the parts every page is made of (accounts-and-cloud spec §10.2), built only from the tokens of
 * css/tokens.css, which a page links first. No colour, typeface, type size, corner radius or shadow is written out
 * here: each is a token (tests/look.test.js holds that, with one exception it names, the select arrow's data URI). To
 * change the look, change a token; to add a part, add its rules here and its sample to js/styleguide.js.
 *
 * In this order: the base; a page behind the door before the door has answered; the card; the field; the form's tables (js/ui/form-renderer.js); the result chips; the
 * compliance results (js/ui/results.js); the notices; the action bar; the button; the header bar of the pages without
 * the rail; the preview page (js/preview.js); the nameplate scan (js/ui/nameplate-scan.js); the shell
 * and its rail (js/ui/shell.js); the page head; the banner and the strip; what the app says; the filters; the counts;
 * the list table, its tags, pills and upload line, and the opened row's panel; the tabs; adding a person; the admin
 * lists (js/ui/admin-lists.js); the question (js/ui/ask.js); the sign-in card; the style-guide page's own frame; and,
 * last, what changes on a narrow screen. styleguide.html shows them all.
 *
 * What stays true whatever the look (spec §10.7): every text input, select and button is at least --ctl tall (44 px,
 * 52 px on the report page); a result is never told by colour alone; a table scrolls sideways inside its card; text
 * meets WCAG AA on its background, which is why secondary text is --muted on a card and --ink-2 on the page.
 */

/* ======== the base ======== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
/* a column, so that a page shorter than the screen still has its action bar at the foot */
body { display: flex; flex-direction: column; min-height: 100vh; font-family: var(--text); font-size: var(--fs-base); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body > main { flex: 1 0 auto; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 22px 26px 26px; }
.muted { font-size: var(--fs-sm); color: var(--ink-2); }
.section .muted, .card .muted { color: var(--muted); }
/* a link or a button reached with the keyboard */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the opened report's title takes the keyboard when its panel opens, so a screen reader reads which report it is: no
   box round it, which read as a selection after a click; a quiet accent line under it marks where the keyboard is
   (look fix round 2, B2-L12, A2-L10) */
.panel h3:focus { outline: none; }
.panel h3:focus-visible { text-decoration: underline 2px var(--accent); text-underline-offset: 4px; }

/* ======== a page behind the door, before the door has answered: each such page starts with <html class="door-pending">,
   and js/ui/shell.js's openPage takes the class away once it has let the person in, with the rail drawn. Until then
   the page shows only its calm ground and the rail's navy with the mark and the name, which the page carries in its
   own markup (look fix round 2, A2-L14: the wait looks meant); after half a second one quiet line says it is opening.
   A page the door sends to the sign-in page never shows its content. The word is here, not in a script: it must show
   before any script has run ======== */
html.door-pending .page-col, html.door-pending .rail > :not(.rail-brand) { visibility: hidden; }
html.door-pending body::after { content: 'Opening…'; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-md); color: var(--ink-2); opacity: 0; pointer-events: none; animation: door-wait 0s linear .5s forwards; }
@keyframes door-wait { to { opacity: 1; } }
/* the line is centred on the page's column, where the content will be, not on the whole window: the rail's width is
   left out, narrow from 700 px, wide from 1100 px but on the report page (look fix round 2, B2-L21) */
@media (min-width: 700px) {
  html.door-pending body.has-rail::after { left: var(--rail-narrow); }
}
@media (min-width: 1100px) {
  html.door-pending body.has-rail:not(.field-page)::after { left: var(--rail); }
}

/* ======== the card: .section is the form renderer's name for it, .card the pages' ======== */
.section, .card { margin-bottom: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.section h2, .card h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; font-family: var(--display); font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }
.section h3, .card h3 { margin: 20px 0 8px; font-size: var(--fs-md); font-weight: 650; color: var(--ink-2); }
.section h2 + .tblock h3 { margin-top: 4px; }
/* a card that holds a table edge to edge; with .twrap the table scrolls sideways inside it */
.card-flush { padding: 0; overflow: hidden; }
.card-flush.twrap { overflow-x: auto; }

/* ======== the field ======== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fg[hidden] { display: none; }
.fg.wide { grid-column: 1 / -1; }
/* the words that name a box; the offer of instruments used before (js/ui/used-before.js) asks for a press in one line,
   its one instruction, so that line is set as a box's label is, here and on the report page */
.fg > label, .used-before-line { font-size: var(--fs-sm); font-weight: 550; color: var(--muted); }
/* on the report page, read at arm's length outdoors, the words that name a box are larger and darker (A's M7) */
.field-page .fg > label, .field-page .used-before-line { font-size: var(--fs-md); color: var(--ink-2); }
.fg.required > label::after { content: ' *'; color: var(--fail); font-weight: 700; }
.fhint { font-size: var(--fs-xs); color: var(--muted); }
.field-page .fhint { font-size: var(--fs-sm); }
/* a hint that warns: why the weather could not be read, why a number is outside its field's range */
.fhint.fhint-warn { color: var(--warn); font-weight: 600; }
/* the temperature, the humidity and the button that fills them (js/app.js's weather): a row of the job card of their
   own, in the card grid's own columns, so they line up with the fields above (look fix round 2, A2-L1); and the
   weather's line, when it says something, a whole row under them, so that a message never widens a column (A2-H1) */
.site-conditions { display: contents; }
.site-conditions > .fg:first-child { grid-column-start: 1; }
.grid > .weather-line { grid-column: 1 / -1; margin-top: -6px; }
/* the field after it always starts a row, so the weather's row is a row of its own and nothing after it moves sideways
   when the line comes or goes (look fix round 3, M1: Feeder jumped under the weather's row when it failed) */
.grid > .weather-line + .fg { grid-column-start: 1; }
/* the instruments used before (js/ui/used-before.js) on a new report: under the Test equipment heading and above its
   boxes, the line (set as a box's label: the rules above) then the buttons; the buttons wrap onto further lines, and a
   long name wraps inside its button, so nothing is cut off and nothing scrolls sideways on a narrow screen (the class
   pair outranks .btn's one line) */
.used-before { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.used-before-items { display: flex; flex-wrap: wrap; gap: 8px; }
.used-before .used-before-item { max-width: 100%; justify-content: flex-start; text-align: left; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; }
/* a button's words, part by part (the Test set; "serial" and its number; "calibrated" and its date): each part stays
   whole on a line where it fits and wraps inside itself only when it is longer than the line; the separator's dot is
   glued to the part before it, so a wrapped line never begins with it. The words are one box, the button's one item. */
.used-before-words { min-width: 0; }
.used-before-part { display: inline-block; max-width: 100%; }
.used-before-glue { white-space: nowrap; }
/* a select whose choices are long (js/ui/form-renderer.js marks it fg-wide) takes two columns where the grid has two
   or more, so the choice made is not cut (A2-M1); never where the grid is one column, which it would widen */
@media (min-width: 480px) {
  .grid > .fg-wide { grid-column: span 2; }
}
.fg input, .fg select, .fg textarea { width: 100%; min-height: var(--ctl); margin: 0; padding: 0 13px; font-family: inherit; font-size: var(--fs-input); color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-control); }
.fg textarea { min-height: 96px; padding: 10px 13px; line-height: 1.4; resize: vertical; }
.fg input[type=file] { padding-top: 9px; padding-bottom: 9px; }
/* a button that belongs to the fields beside it (the report page's weather button) fills its cell like an input */
.fg > .btn { width: 100%; }
/* a field that cannot be changed here, such as the form picker while a report is being amended, or an admin list's
   role select while its row's call is out */
.fg input:disabled, .fg select:disabled, .fg textarea:disabled, .row-pick:disabled { color: var(--ink-2); background-color: var(--off-soft); }
/* the arrow's colour is --ink-2's value: a data URI cannot read a token, so it is the one colour written out here */
.fg select, .filters select, .row-pick { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23334155' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.fg input:focus, .fg select:focus, .fg textarea:focus, .ttable input:focus, .filters input:focus, .filters select:focus, .row-pick:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
/* amber when the browser cannot read a number (1,234 reads as blank, so nothing is stored) or a number is
   outside the field's min/max (it is still stored, and the engine judges it); and on a field the page marks as at
   fault (aria-invalid: a name left blank, an address the server refused) until something is typed in it. An address
   being typed is not marked at its first letter, only once the field is left (B's M18) */
.fg input:invalid:not([type=email]), .fg input[type=email]:invalid:not(:focus), .ttable input:invalid, .fg input[aria-invalid="true"] { border-color: var(--amber); }
/* a reading the row's FAIL names, in the table: red, as the verdict is (A's M6) */
.ttable input[aria-invalid="true"] { border-color: var(--fail); background: var(--fail-wash); }
/* the ghost value of a derive_when_blank input: used while the input is blank, replaced by anything typed */
.fg input.derived::placeholder, .ttable input.derived::placeholder { color: var(--accent); opacity: .75; font-style: italic; font-weight: 600; }
/* a field the engine needs before the report can be submitted (the reason for a changed basis or tolerance) */
.fg.needs-input > label { color: var(--warn); font-weight: 700; }
.fg.needs-input input, .fg.needs-input select, .fg.needs-input textarea { border-color: var(--amber); background-color: var(--warn-soft); box-shadow: var(--ring-warn); }

/* ======== the form's tables ======== */
.twrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ttable { border-collapse: collapse; width: 100%; min-width: 640px; }
/* a column's heading says what goes in its boxes, read at arm's length: in the words' own case, as large and as dark as
   a field's hint (look fix round 2, A2-M8: no longer small grey capitals) */
.ttable th { padding: 8px 6px 10px; font-size: var(--fs-sm); font-weight: 650; line-height: 1.35; color: var(--ink-2); text-align: center; white-space: nowrap; border-bottom: 1.5px solid var(--line); }
.ttable th.left { text-align: left; }
/* the units, as they are written: mA is not MA */
.ttable th .sublabel { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.ttable td { padding: 7px 6px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--line); }
.ttable td.rowlabel { padding-right: 14px; font-family: var(--display); font-size: var(--fs-lg); font-weight: 800; text-align: left; white-space: nowrap; }
.ttable td.rowlabel .sublabel { font-family: var(--text); font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.ttable input { width: 100%; min-width: 84px; min-height: var(--ctl); margin: 0; padding: 0 8px; font-family: inherit; font-size: var(--fs-input); font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-control); }
.ttable input[type=number]::-webkit-inner-spin-button, .ttable input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ttable input[type=number] { -moz-appearance: textfield; }
.ttable td.rowlabel, .ttable th.left:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
/* and a row's verdict and its remove button stay at the right edge while the readings scroll sideways under them (a
   tablet held upright: A's M15); the column order is the form's */
.ttable:has(.row-status, .row-remove) tr > :last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); }
.ttable:has(.row-status):has(.row-remove) tr > :nth-last-child(2) { position: sticky; right: calc(var(--ctl) + 12px); z-index: 1; background: var(--surface); }
.ttable input.muted-col { min-width: 54px; padding-left: 2px; text-align: left; color: var(--muted); background: transparent; border-color: transparent; }
.ttable input.muted-col:focus { background: var(--surface); border-color: var(--field-line); }
/* a value copied from the nameplate */
.ttable input.hv-col { background: var(--nameplate); }
/* a computed column: read only, recalculated by the engine on every change */
.ttable td.calc-col output { display: flex; align-items: center; justify-content: center; min-width: 84px; min-height: var(--ctl); padding: 0 8px; font-size: var(--fs-input); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent); background: var(--calc); border: 1.5px solid var(--accent-line); border-radius: var(--radius-control); }

/* a table that grows: add a row below, remove one at its end (never below min_rows) */
.add-row { flex: none; max-width: none; min-height: var(--ctl); margin-top: 10px; padding: 0 16px; font-family: inherit; font-size: var(--fs-md); font-weight: 650; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.row-remove { flex: none; max-width: none; width: var(--ctl); min-height: var(--ctl); padding: 0; font-family: inherit; font-size: var(--fs-xl); line-height: 1; color: var(--muted); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.add-row:disabled, .row-remove:disabled { opacity: .4; cursor: default; }

/* ======== the result chips: a row's verdict and a result's status ======== */
/* the border, transparent, keeps every chip the size of the outlined INVESTIGATE one */
.row-status, .status { display: inline-block; padding: 5px 10px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .03em; white-space: nowrap; border: 1.5px solid transparent; border-radius: var(--radius-chip); }
.row-status { min-width: 40px; }
.status-pass { color: var(--pass); background: var(--pass-soft); }
/* FAIL solid red; INVESTIGATE red outlined, so an open flag reads as not certified (certification-rule spec §4) */
.status-fail { color: var(--on-strong); background: var(--fail); }
.status-investigate { color: var(--fail); background: var(--fail-soft); border-color: var(--fail); }
.status-advisory { color: var(--warn); background: var(--warn-soft); }
.status-incomplete { color: var(--ink-2); background: var(--off-soft); }

/* ======== the compliance results: stacked on a phone, a table from 641 px ======== */
.results-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.results-table thead { display: none; }
.results-table tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.results-table td { padding: 0; text-align: left; vertical-align: top; }
.results-table td.r-label { font-weight: 600; }
.results-table td.r-status { white-space: nowrap; text-align: right; }
.results-table td.r-detail { grid-column: 1 / -1; margin-top: 4px; }
.r-note { margin-top: 3px; font-size: var(--fs-sm); color: var(--muted); }
.r-recommendation { margin-top: 3px; font-size: var(--fs-sm); font-weight: 600; color: var(--fail); }
.r-source { margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); }
@media (min-width: 641px) {
  .results-table thead { display: table-header-group; }
  .results-table tr { display: table-row; padding: 0; }
  .results-table th { padding: 8px 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: left; border-bottom: 1.5px solid var(--line); }
  .results-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
  .results-table td.r-status { text-align: left; }
  .results-table td.r-detail { margin-top: 0; }
}
.assumptions { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.assumptions h3 { margin: 0 0 6px; font-size: var(--fs-sm); font-weight: 700; }
.assumptions ul { margin: 0; padding-left: 20px; }
.corrected-line { margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.needs-input-line { margin-top: 12px; padding: 10px 12px; font-size: var(--fs-md); font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-control); }
.overall { margin-top: 10px; padding: 12px; font-family: var(--display); font-size: var(--fs-xl); font-weight: 700; text-align: center; border: 1.5px solid transparent; border-radius: var(--radius-control); }
.overall-pass { color: var(--pass); background: var(--pass-soft); }
.overall-fail { color: var(--on-strong); background: var(--fail); }
.overall-investigate { color: var(--fail); background: var(--fail-soft); border-color: var(--fail); }
.overall-incomplete { color: var(--warn); background: var(--warn-soft); }

/* ======== the notices: a problem with the form; amend mode on the report page (js/app.js) ======== */
.notice { margin-bottom: 14px; padding: 12px 14px; font-size: var(--fs-md); line-height: 1.45; color: var(--fail); background: var(--fail-soft); border-radius: var(--radius-control); }
.notice p { font-weight: 700; }
.notice ul { margin-top: 6px; padding-left: 20px; overflow-wrap: anywhere; }
/* which report and revision is being amended, with the reason input below */
.amend-banner { margin-bottom: 14px; padding: 12px 14px; font-size: var(--fs-md); line-height: 1.45; color: var(--navy); background: var(--accent-soft); border-radius: var(--radius-control); }
.amend-banner p { margin-bottom: 8px; font-weight: 700; }
.amend-banner .fg > label { color: var(--ink-2); }

/* ======== the action bar: stays at the foot of the screen while the form scrolls. On its left, why Submit is off and
   what the last submit did; on its right, the buttons ======== */
.bar { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 26px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-bar); }
.bar-note { flex: 1 1 320px; padding: 9px 12px; font-size: var(--fs-md); line-height: 1.4; overflow-wrap: anywhere; border-radius: var(--radius-control); }
.bar-note.warn { font-weight: 600; color: var(--warn); background: var(--warn-soft); }
.bar-note.info { color: var(--navy); background: var(--accent-soft); }
.bar-note.ok { color: var(--pass); background: var(--pass-soft); }
.bar-note.error { font-weight: 600; color: var(--fail); background: var(--fail-soft); }
#gate { white-space: pre-line; }   /* the needs-input line and the Equipment status line, one under the other */
/* a line with a button of its own ("Show me", "Amend this report"): the button at the end of the words, under them on a
   narrow bar */
.bar-note:has(> .btn) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bar-note-text { flex: 1 1 220px; }
#gate .bar-note-text { white-space: pre-line; }
.bar-actions { display: flex; gap: 10px; margin-left: auto; }
.bar-actions > button, .bar-actions > a { min-width: 170px; }
/* once the report on screen is saved: "Submitted" as a status, level between Check compliance and "Start a new report"
   (js/app.js; look fix round 2, A2-M2). It takes the keyboard only where Submit had it, so it needs no ring */
.bar-actions > .bar-done { flex: none; padding: 0 6px; font-size: var(--fs-md); white-space: nowrap; }
.bar-done:focus { outline: none; }

/* ======== the button: .btn with .btn-primary (the one that carries the work forward), .btn-quiet (the one beside it),
   .btn-danger (it switches something off) and .btn-small (less room, the same height). .primary and .secondary are the
   action bar's own names for the first two ======== */
.btn, .primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctl); padding: 0 18px; font-family: inherit; font-size: var(--fs-md); font-weight: 650; text-align: center; text-decoration: none; white-space: nowrap; border: 1.5px solid transparent; border-radius: var(--radius-control); cursor: pointer; }
.btn-primary, .primary { color: var(--on-strong); background: var(--accent); }
.btn-primary:hover, .primary:hover { background: var(--accent-ink); }
.btn-quiet, .secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.btn-danger { color: var(--fail); background: var(--surface); border-color: var(--fail-line); }
.btn-small { padding: 0 12px; font-size: var(--fs-sm); }
.btn:disabled, .primary:disabled, .secondary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled, .primary:disabled { background: var(--accent); }
/* a button as wide as its card (a choice on the sign-in card, the opened report's buttons, the weather button) may hold
   a company's or a person's long name: its words wrap inside it, and the card never grows past the screen (A's H3) */
.signin-list .btn, .panel .btn, .fg > .btn { white-space: normal; overflow-wrap: break-word; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; }

/* ======== the header bar of a page without the rail (the preview page) ======== */
.app-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; color: var(--on-strong); background: var(--navy); }
.app-header h1 { font-family: var(--display); font-size: var(--fs-xl); font-weight: 650; }
.app-header p { font-size: var(--fs-sm); color: var(--navy-ink); }
.preview-version { flex: none; padding: 3px 9px; font-size: var(--fs-xs); white-space: nowrap; color: var(--navy-ink); background: var(--rail-hover); border-radius: 999px; }
/* the card that holds the form picker: a card like any other */
.picker select { font-weight: 650; }

/* a list with nothing in it yet, or nothing the filters let through */
.empty { padding: 30px; text-align: center; color: var(--ink-2); }
/* the report page's form while it is read (after the door, and after another report type is chosen): one quiet line
   in its place, never an empty page (js/app.js; look fix round 2, A2-M5) */
.form-opening { margin: 0; padding: 48px 16px; font-size: var(--fs-md); text-align: center; color: var(--ink-2); }
/* the way back from a list that shows nothing: "Clear the search and filters" (B's L4) */
.empty .btn { margin-top: 12px; }
/* a list with nothing in it at all: a card that says so and, where there is one, the way on (look fix round 2, B2-L20,
   A2-L8: no longer one grey line under a set of filters with nothing to filter) */
.empty-card { margin-bottom: 14px; padding: 36px 24px; font-size: var(--fs-base); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.empty-card .btn { margin-top: 16px; }

/* ======== the preview page (preview.html, js/preview.js): for form authors, never cached ======== */
.preview-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.picker .preview-source { margin-top: 12px; font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
/* the source line with Reload, which reads what it names again (R68) */
.preview-source-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.picker .preview-source-row .preview-source { flex: 1 1 240px; margin-top: 0; }
.preview-reload { flex: none; }
/* the message panels (index and ruleset, validation): errors red, warnings amber, each under its count; a load that failed in code type */
.preview-panel > h3:first-child { margin-top: 0; }
.section h3.preview-errors { color: var(--fail); }
.section h3.preview-warnings { color: var(--warn); }
.preview-messages { padding-left: 20px; font-size: var(--fs-md); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-messages li + li { margin-top: 4px; }
.preview-messages.errors { color: var(--fail); }
.preview-messages.warnings { color: var(--warn); }
.preview-messages .code { font-family: var(--mono); font-size: var(--fs-sm); }
.preview-ok { font-size: var(--fs-base); font-weight: 700; color: var(--pass); }
.preview-hint { margin-top: 12px; }
/* why there is no form to show */
.preview-note { margin-bottom: 14px; padding: 12px 14px; font-size: var(--fs-md); color: var(--muted); background: var(--surface); border: 1.5px dashed var(--field-line); border-radius: var(--radius-card); }
/* the buttons follow the form and stay at the foot of the screen while it scrolls */
.preview-bar { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-card); }
.preview-bar .bar-actions { flex: 1 1 100%; flex-wrap: wrap; }
.preview-bar .bar-actions > button { flex: 1 1 150px; min-width: 0; }
.preview-def summary { font-weight: 700; color: var(--accent); cursor: pointer; }
.preview-def pre { max-height: 70vh; margin-top: 12px; overflow: auto; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.45; }
/* while a file is dragged over the page, which is all one drop zone */
body.preview-dropping::after { content: 'Drop the .yaml file to preview it'; position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: var(--display); font-size: var(--fs-xl); font-weight: 700; text-align: center; color: var(--accent); background: var(--accent-soft); border: 4px dashed var(--accent); opacity: .94; pointer-events: none; }

/* ======== the nameplate scan (js/ui/nameplate-scan.js): the bar, the review, the filled inputs ======== */
.np-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: -2px 0 14px; padding: 12px 14px; background: var(--accent-soft); border: 1.5px dashed var(--accent-line); border-radius: var(--radius-card); }
.np-bar .np-txt { flex: 1 1 220px; font-size: var(--fs-sm); color: var(--ink-2); }
.np-bar .np-txt b { display: block; font-size: var(--fs-base); color: var(--ink); }
/* the scan cannot run: the model is missing, the agent does not answer, or the last read failed */
.np-bar[data-state="missing"], .np-bar[data-state="unreachable"], .np-bar[data-state="error"], .np-bar[data-state="failed"] { background: var(--warn-wash); border-color: var(--warn-line); }
.np-bar .np-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.np-status { flex-basis: 100%; font-size: var(--fs-sm); color: var(--ink-2); }
.np-status:empty { display: none; }
.np-spinner { width: 18px; height: 18px; border: 3px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: np-spin .8s linear infinite; }
@keyframes np-spin { to { transform: rotate(360deg); } }
.np-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--ctl); padding: 0 18px; font-family: inherit; font-size: var(--fs-md); font-weight: 650; white-space: nowrap; color: var(--on-strong); background: var(--accent); border: 1.5px solid transparent; border-radius: var(--radius-control); cursor: pointer; appearance: none; }
.np-btn.sec { color: var(--ink); background: var(--surface); border-color: var(--line); }
.np-btn:disabled { opacity: .55; cursor: default; }
/* the review of what was read */
.np-ov { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow: auto; background: var(--overlay); }
.np-modal { width: 100%; max-width: 760px; padding: 20px; font-size: var(--fs-base); color: var(--ink); background: var(--surface); border-radius: var(--radius-modal); box-shadow: var(--shadow-modal); }
.np-modal h3 { margin: 0 0 6px; font-family: var(--display); font-size: var(--fs-xl); font-weight: 650; }
.np-modal .np-sub { margin-bottom: 14px; font-size: var(--fs-md); color: var(--muted); }
.np-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.np-photo { display: block; max-width: 100%; max-height: 160px; border-radius: var(--radius-control); }
/* a thumbnail that opens the photo large (js/ui/photo-viewer.js): in the review, and on the bar after it */
.np-photo-btn { min-width: var(--ctl); min-height: var(--ctl); margin: 0; padding: 0; background: none; border: none; border-radius: var(--radius-control); cursor: zoom-in; appearance: none; }
.np-photo-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.np-hint { margin: -6px 0 12px; font-size: var(--fs-sm); color: var(--muted); }
.np-last { flex-basis: 100%; display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.np-last:empty { display: none; }
.np-last .np-photo { width: auto; height: 48px; max-height: none; border: 2px solid var(--accent-line); border-radius: var(--radius-control); }
/* the photo large: the review's backdrop darker (the ink, whole), above the review; the photo fitted, or with .full at
   its own size */
.np-viewer { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; padding: 12px; background: var(--ink); }
.np-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.np-viewer-hint { font-size: var(--fs-md); color: var(--on-strong); }
.np-viewer-frame { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.np-viewer-photo { display: block; max-width: 100%; max-height: 100%; border-radius: var(--radius-card); cursor: zoom-in; }
.np-viewer.full .np-viewer-frame { align-items: flex-start; justify-content: flex-start; }
.np-viewer.full .np-viewer-photo { max-width: none; max-height: none; border-radius: 0; cursor: zoom-out; }
/* the page's own camera view (js/ui/camera.js): the viewer's look; data-state shows the live picture or the still */
.np-camera-video { display: block; max-width: 100%; max-height: 100%; background: var(--ink); border-radius: var(--radius-card); }
.np-camera .np-viewer-photo { display: none; cursor: default; }
.np-camera[data-state="taken"] .np-viewer-photo { display: block; }
.np-camera[data-state="taken"] .np-camera-video { display: none; }
/* a camera that cannot start: no picture, so the sentence and its buttons sit together in the middle */
.np-camera[data-state="failed"] { justify-content: center; }
.np-camera[data-state="failed"] .np-viewer-frame { display: none; }
.np-camera-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.np-mismatch { margin-bottom: 10px; padding: 10px 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-control); }
.np-warning { margin-bottom: 6px; font-size: var(--fs-sm); color: var(--warn); }
.np-group { margin: 16px 0 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.np-row { display: grid; grid-template-columns: 34px 1fr 1.2fr auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.np-row input[type=checkbox] { width: 24px; height: 24px; }
.np-row input[type=text] { width: 100%; min-height: var(--ctl); padding: 0 10px; font-family: inherit; font-size: var(--fs-input); color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-control); }
.np-row .np-lab { font-weight: 600; }
.np-row .np-cur, .np-row .np-evidence { display: block; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.np-row .np-notes { display: block; margin: 2px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); font-weight: 400; color: var(--warn); }
.np-row .np-notes li + li { margin-top: 2px; }
.np-row .np-evidence { font-style: italic; }
.np-row .np-source { display: block; margin-top: 2px; font-size: var(--fs-sm); font-weight: 400; color: var(--warn); }
.np-row .np-use { margin-top: 6px; padding: 0 12px; font-size: var(--fs-sm); }
.np-row .np-rows { display: block; margin-top: 4px; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); white-space: pre-wrap; }
.np-look { margin: 12px 0 4px; font-size: var(--fs-sm); color: var(--muted); }
.np-chip { padding: 5px 9px; font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; border-radius: 999px; }
.np-chip.ok { color: var(--pass); background: var(--pass-soft); }
.np-chip.chk { color: var(--warn); background: var(--warn-soft); }
.np-taps { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.np-taps th, .np-taps td { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.np-taps th { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.np-taps td.np-off { font-weight: 600; color: var(--warn); white-space: nowrap; }
.np-taps .np-expected { display: block; font-size: var(--fs-xs); font-weight: 400; }
.np-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.np-raw { display: none; max-height: 240px; margin-top: 10px; padding: 10px; overflow: auto; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.4; white-space: pre-wrap; background: var(--off-soft); border-radius: var(--radius-control); }
/* what the scan did, above the form */
.np-toast { margin: -2px 0 14px; padding: 12px 14px; font-size: var(--fs-md); font-weight: 600; color: var(--pass); background: var(--pass-soft); border: 1.5px solid var(--pass-line); border-radius: var(--radius-card); }
/* an input the scan filled, until the technician changes it; background-color, so a select keeps its arrow */
input.ocr-filled, select.ocr-filled { background-color: var(--pass-wash) !important; border-color: var(--pass-line) !important; }

/* ======== the shell: the rail beside one column that holds the banner, the page and, on the report page, the action
   bar (js/ui/shell.js fills the rail). The rail is --rail wide from 1100 px, --rail-narrow below that and on the report
   page (.field-page), and a bar across the top below 700 px ======== */
.has-rail { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.has-rail.field-page { grid-template-columns: var(--rail-narrow) minmax(0, 1fr); }
/* on the report page a control is taller, for a gloved hand */
.field-page { --ctl: var(--ctl-field); }
/* the column is as tall as the screen at least, so the action bar of a short page is still at the foot */
.page-col { display: flex; flex-direction: column; min-width: 0; }
.page { flex: 1 0 auto; width: 100%; padding: 22px 26px 26px; }

/* the rail. Its items are laid out by its own width, not the screen's (the container rule below), so one set of rules
   serves the narrow rail wherever it is narrow */
.rail { position: sticky; top: 0; z-index: 20; align-self: start; display: flex; flex-direction: column; gap: 2px; height: 100vh; padding: 18px 8px 14px; overflow-y: auto; color: var(--navy-ink); background: var(--navy); container: rail / inline-size; }
.rail :focus-visible { outline-color: var(--volt); }
.rail-brand { display: flex; align-items: center; gap: 8px; padding: 2px 14px 18px; font-family: var(--display); font-size: var(--fs-xl); font-weight: 700; letter-spacing: .01em; white-space: nowrap; color: var(--on-strong); }
.rail-brand svg { flex: none; width: 20px; height: 20px; fill: var(--volt); }
.rail-item { display: flex; align-items: center; gap: 10px; min-height: var(--ctl); margin: 0 4px; padding: 0 10px; font-size: var(--fs-md); font-weight: 550; color: var(--navy-ink); text-decoration: none; white-space: nowrap; border-left: 3px solid transparent; border-radius: var(--radius-control); }
.rail-item:hover { color: var(--on-strong); background: var(--rail-hover); }
.rail-item.is-active { color: var(--on-strong); background: var(--rail-hover); border-left-color: var(--volt); }
.rail-item svg, .rail-menu svg, .saved svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* how many wait: reports to upload on My reports, held reports on Admin */
.rail-count { margin-left: auto; padding: 1px 7px; font-size: var(--fs-xs); font-style: normal; font-weight: 700; color: var(--navy); background: var(--volt); border-radius: 999px; }
.rail-foot { position: relative; display: grid; gap: 12px; margin: auto 4px 0; padding: 12px 8px 0; border-top: 1px solid var(--rail-rule); }
.rail-foot > small { font-size: var(--fs-xs); color: var(--navy-faint); }
/* while the person's menu is open the version shows at its foot, so the one under it is hidden (A's Low 8, B's L17); and
   the menu says where the reports are, so the rail's own line under it is too, keeping its room so that nothing moves
   (look fix round 2, B2-L18, A2-L9) */
.rail-foot:has(> .who-menu:not([hidden])) > small { display: none; }
.rail-foot:has(> .who-menu:not([hidden])) > :is(.rail-net, .rail-net-short) { visibility: hidden; }
/* the narrow rail's word or two under the dot (js/ui/shell.js): hidden where the rail is wide and says it in full */
.rail-net-short { display: none; }
/* words for a screen reader alone, such as what a rail count counts */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* where the reports are: the dot's colour follows data-tone, and the words say the same */
.rail-net { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); white-space: nowrap; }
.rail-net i { flex: none; width: 8px; height: 8px; background: var(--navy-faint); border-radius: 50%; }
.rail-net[data-tone="ok"] i { background: var(--ok); }
.rail-net[data-tone="wait"] i, .rail-net[data-tone="busy"] i { background: var(--amber); }
.rail-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rail-who div { min-width: 0; }
.rail-who b { display: block; overflow: hidden; font-size: var(--fs-sm); font-weight: 650; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; color: var(--on-strong); }
.rail-who small { display: block; overflow: hidden; font-size: var(--fs-xs); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-faint); }
.avatar { display: grid; flex: none; place-items: center; width: 32px; height: 32px; font-size: var(--fs-sm); font-weight: 700; color: var(--on-strong); background: var(--accent); border-radius: 50%; }
/* the person's menu (js/ui/shell.js): when someone is signed in their line is a button, and it opens a card above the
   rail's foot, at least as wide as the wide rail whatever the rail's width, so a company's name fits. While it is open
   the rail does not clip it */
button.rail-who { width: 100%; min-height: var(--ctl); padding: 0 6px; font: inherit; text-align: left; color: inherit; background: none; border: none; border-radius: var(--radius-control); cursor: pointer; }
button.rail-who:hover, button.rail-who[aria-expanded="true"] { background: var(--rail-hover); }
.rail:has(.who-menu:not([hidden])) { overflow: visible; }
.who-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; display: grid; gap: 2px; width: max-content; min-width: var(--rail); max-width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 12px 8px 8px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-modal); }
.who-menu :focus-visible { outline-color: var(--accent); }
.who-menu > b { padding: 0 10px; font-size: var(--fs-md); font-weight: 650; overflow-wrap: anywhere; }
.who-menu > small { padding: 0 10px; font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.who-menu > small:last-child { margin-top: 6px; padding-top: 8px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); }
/* where the reports are, under the company, as the rail's line says it (A's M3) */
.who-menu > .who-net { margin-top: 2px; font-weight: 600; }
.who-menu > button { min-height: var(--ctl); padding: 0 10px; font: inherit; font-size: var(--fs-md); font-weight: 550; text-align: left; color: var(--ink); background: none; border: none; border-radius: var(--radius-control); cursor: pointer; }
.who-menu > button:first-of-type { margin-top: 8px; }
.who-menu > button:hover:not(:disabled) { background: var(--off-soft); }
.who-menu > button:disabled { color: var(--muted); cursor: not-allowed; }
/* why a greyed item is off ("Needs a connection"), on a second line inside it: a touch tablet shows no tooltip */
.who-menu > button:has(> small) { padding-top: 6px; padding-bottom: 6px; }
.who-menu > button > small { display: block; font-size: var(--fs-sm); font-weight: 400; line-height: 1.3; color: inherit; }
/* the button that shows the items when the rail is a bar across the top; while they show, a cross in place of its three
   lines (B's L17) */
.rail-menu { display: none; flex: none; align-items: center; justify-content: center; width: var(--ctl); min-height: var(--ctl); color: var(--on-strong); background: var(--rail-hover); border: none; border-radius: var(--radius-control); cursor: pointer; }
.rail.is-open .rail-menu svg { display: none; }
.rail.is-open .rail-menu::after { content: '×'; font-size: var(--fs-2xl); line-height: 1; }
/* the narrow rail (120 px is wider than --rail-narrow and narrower than --rail; a condition cannot read a token): the
   icon above its label, the mark alone, the dot with a word or two under it (A's M3), the initials alone */
@container rail (max-width: 120px) {
  .rail-brand { justify-content: center; padding: 2px 0 18px; }
  .rail-brand span { display: none; }
  .rail-item { position: relative; flex-direction: column; justify-content: center; gap: 5px; margin: 0; padding: 8px 2px; font-size: var(--fs-xs); text-align: center; white-space: normal; border-left-width: 0; }
  .rail-item svg { width: 22px; height: 22px; }
  .rail-count { position: absolute; top: 4px; right: 8px; margin: 0; }
  .rail-foot { justify-items: center; margin: auto 0 0; padding: 12px 0 0; }
  .rail-net span, .rail-who div, .rail-foot > small { display: none; }
  .rail-net-short { display: block; max-width: 100%; margin-top: -6px; font-size: var(--fs-xs); line-height: 1.2; text-align: center; overflow-wrap: break-word; color: var(--navy-ink); }
  button.rail-who { justify-content: center; padding: 0; }
}

/* ======== the page head: the title, the line under it, and what the page offers on the right ======== */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.page-title { font-family: var(--display); font-size: var(--fs-2xl); font-weight: 650; line-height: 1.15; letter-spacing: -.005em; overflow-wrap: anywhere; }
.page-sub { margin-top: 3px; font-size: var(--fs-md); color: var(--ink-2); }
.page-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.saved { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.saved svg { width: 15px; height: 15px; }

/* ======== the banner (above the page, for the whole app) and the strip (in the page, for this list) ======== */
.banner { padding: 10px 26px; font-size: var(--fs-md); line-height: 1.4; color: var(--warn); background: var(--warn-soft); border-bottom: 1px solid var(--warn-line); }
.banner[data-tone="info"] { color: var(--navy); background: var(--accent-soft); border-bottom-color: var(--accent-line); }
.banner[data-tone="bad"] { color: var(--fail); background: var(--fail-soft); border-bottom-color: var(--fail-line); }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 16px; font-size: var(--fs-md); color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-card); }
.strip b { font-weight: 700; }
.strip .btn { flex: none; margin-left: auto; }

/* ======== what the app says: a thing to know, a thing to do, a thing that went wrong, a thing that went well ======== */
.say { margin-bottom: 14px; padding: 12px 14px; font-size: var(--fs-md); line-height: 1.45; border-radius: var(--radius-control); }
.say-info { color: var(--navy); background: var(--accent-soft); }
.say-warn { color: var(--warn); background: var(--warn-soft); }
.say-bad { color: var(--fail); background: var(--fail-soft); }
.say-ok { color: var(--pass); background: var(--pass-soft); }
.say .btn { margin-top: 10px; }

/* ======== the filters above a list ======== */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
/* the filters but the search (reports.html's .filters-more) sit in the same row as it, the box around them taking no
   room of its own; the button that shows them is for a narrow screen only (below: look fix round 2, B2-M6) */
.filters-more { display: contents; }
.filters-toggle { display: none; }
/* background-color, not the shorthand, so the select keeps the arrow the field's rule gives it */
.filters input, .filters select { flex: 1 1 150px; width: auto; min-height: var(--ctl); padding: 0 13px; font-family: inherit; font-size: var(--fs-input); color: var(--ink); background-color: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-control); }
/* a select is never wider than its line, nor than a select's measure: one long report type made the Reports page
   wider than a phone (look fix round 2, B2-H1), and stretched a select alone on a line across the card (B2-L9). Where
   there is room it keeps the width of its longest choice, so the choice made is not cut (440 px holds the longest
   report type, and the search starts from 200 px so the first row still holds all three selects at 1280 px: look fix
   round 3, L3); on a phone (below) it may be narrower than that */
.filters select { max-width: min(100%, 440px); padding-right: 36px; }
.filters input[type=search] { flex: 3 1 200px; }
.filters .filter-check { display: flex; flex: none; align-items: center; gap: 8px; min-height: var(--ctl); font-size: var(--fs-md); color: var(--ink-2); white-space: nowrap; }
.filters .filter-check input { flex: none; width: 20px; height: 20px; min-height: 0; padding: 0; }
/* the test date's two boxes, From and To, each the size of a date, kept together after their name, and wrapping with
   the other filters as one */
.filters .filter-dates { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.filter-dates > span { font-size: var(--fs-md); font-weight: 650; color: var(--ink-2); }
.filters .filter-date { display: flex; flex: none; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--ink-2); white-space: nowrap; }
.filters .filter-date input { flex: none; width: 170px; }

/* ======== the counts above a list ======== */
/* the four counts: two by two, and one row of four from 820 px (B's M3: no tile left alone on a row) */
.counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.count { padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.count small { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.count b { display: block; margin-top: 3px; font-family: var(--display); font-size: var(--fs-count); font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
/* the line under a number, kept whether or not it says something, so that a note coming and going with the filters
   never moves the page (look fix round 2, B2-L3) */
.count span { display: block; min-height: 1.4em; font-size: var(--fs-sm); color: var(--muted); }
.count[data-tone="pass"] b { color: var(--pass); }
.count[data-tone="fail"] b { color: var(--fail); }
/* while the list for a change is out its counts are dimmed with it: they are about to change (B2-L10) */
.counts[aria-busy="true"] { opacity: .5; }

/* ======== the list table: a row is two lines a cell (js/ui/reports-table.js), beside the opened row's panel ======== */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
/* with no row opened the list has the whole width */
.split:has(> .panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
.list-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.list-table th { padding: 12px 14px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: left; white-space: nowrap; border-bottom: 1.5px solid var(--line); }
.list-table td { padding: 11px 14px; font-size: var(--fs-md); vertical-align: middle; border-bottom: 1px solid var(--line); }
.list-table tbody tr:last-child td { border-bottom: 0; }
.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover td { background: var(--off-soft); }
.list-table tr.is-selected td, .list-table tr.is-selected:hover td { background: var(--accent-soft); }
/* the row whose button has the keyboard is tinted whole, not only its first cell's ring (B's L6); its grey lines take the
   darker grey there, as on the other tints (below) */
.list-table tbody tr:has(.row-open:focus-visible) td { background: var(--accent-soft); }
.list-table tbody tr:has(.row-open:focus-visible) :is(.cell-sub, .rev, .upload-done), .list-table tbody tr.is-off:has(.row-open:focus-visible) td { color: var(--ink-2); }
/* on either tint the grey of the second lines, and of a replaced revision's row, is under AA (4.3:1): there they
   take the darker grey */
.list-table tbody tr:is(:hover, .is-selected) :is(.cell-sub, .rev, .upload-done), .list-table tbody tr.is-off:is(:hover, .is-selected) td { color: var(--ink-2); }
/* a row that no longer counts: a replaced revision, a tablet switched off */
.list-table tr.is-off td, .list-table tr.is-off .cell-sub { color: var(--muted); }
.list-table tr.is-off .cell-main { font-weight: 550; }
/* under the table when the list is longer than what is drawn: how many of how many are shown, and the button that draws
   the next ones (B2-L11) */
.list-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-top: 1px solid var(--line); }
/* a row's first cell is its button (js/ui/reports-table.js): the keyboard's stop on the row, with the look of the
   cell it fills. Its focus ring is drawn inside it, so the edge of the card never cuts the ring */
.list-table td:has(> .row-open) { padding: 0; }
.row-open { display: block; width: 100%; min-height: var(--ctl); padding: 11px 14px; font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.row-open:focus-visible { outline-offset: -2px; }
.row-open .cell-main, .row-open .cell-sub { display: block; }
/* a long name wraps inside its column between its words, and nothing is cut: a word is broken only when it is longer
   than the column can be (A's Low 16), and a table too narrow for one scrolls sideways inside its card */
.cell-main { font-weight: 650; overflow-wrap: break-word; }
.cell-sub { margin-top: 1px; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: break-word; }
.rev { margin-left: 9px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.tag { display: inline-block; margin-left: 6px; padding: 3px 8px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-chip); }
/* a tag that asks something of the person reading it (the server's own check differs from the tablet's): the look of a
   verdict to investigate, apart from the amber tags that only inform (B's M4) */
.tag-alert { color: var(--fail); background: var(--fail-soft); border: 1.5px solid var(--fail); }
/* a tag that only says a state (a replaced revision, a discarded held report): grey, not the warning amber (A2-L7) */
.tag-quiet { color: var(--ink-2); background: var(--off-soft); }
/* in the office's list the technician keeps one line, and a row's tags sit one a line under its verdict, so the verdict
   column stays narrow and the rows low (B's M7); a held report's the same. A tag is one line, never broken inside, not
   even at a hyphen: its column is as wide as its longest tag (look fix round 2, B2-M5) */
.list-table td:nth-child(3) .cell-main { white-space: nowrap; }
.list-table td:last-child > .tag, .held-result > .tag { display: block; width: fit-content; max-width: 100%; margin: 5px 0 0; white-space: nowrap; }
.pill { display: inline-block; padding: 4px 10px; font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; color: var(--ink-2); background: var(--off-soft); border: 1px solid transparent; border-radius: 999px; }
.pill-admin { color: var(--accent-ink); background: var(--accent-soft); }
.pill-new { color: var(--warn); background: var(--warn-soft); }
.pill-off { color: var(--muted); background: var(--surface); border-color: var(--line); }
/* where a report's upload stands: the dot and the words say the same */
.upload { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.upload::before { content: ''; flex: none; width: 8px; height: 8px; background: var(--faint); border-radius: 50%; }
.upload-wait { color: var(--warn); }
.upload-wait::before { background: var(--amber); }
.upload-done { color: var(--muted); }
.upload-done::before { background: var(--ok); }
.upload-bad { color: var(--fail); }
.upload-bad::before { background: var(--fail); }
/* a list of reports measured by its own card (reports.html's and my-reports.html's .report-list): on a card too narrow
   for four columns each report is a small card of its own, its equipment and its verdict on the first line, then its
   customer and site, then the third column's two lines, so the verdict is never off to the side (B's M17, A's Low 16).
   From 600 px of list and less (look fix round 3, L7: at 600 px the table's rows took two or three lines), and up to 670
   px (a condition cannot read a token), the list's width just below 700 px, where the rail becomes a bar: the list is
   narrower at 700 px, beside the narrow rail, so a threshold under 670 px would turn cards back into a table as a window
   narrowed past 700 px. It switches once, at a window of about 820 px */
.report-list { container: report-list / inline-size; }
@container report-list (max-width: 670px) {
  .list-table, .list-table tbody { display: block; min-width: 0; }
  .list-table thead { display: none; }
  .list-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
  .list-table tbody tr:last-child { border-bottom: 0; }
  .list-table tbody td { display: block; padding: 0 14px 10px; border: 0; }
  .list-table tbody td:first-child { grid-column: 1; grid-row: 1; padding: 0; }
  .list-table tbody td:last-child { grid-column: 2; grid-row: 1; padding: 11px 14px 6px 0; text-align: right; }
  .list-table tbody td:nth-child(2), .list-table tbody td:nth-child(3) { grid-column: 1 / -1; }
  .list-table td:nth-child(3) .cell-main { white-space: normal; }
  .list-table td:last-child > .tag { margin-left: auto; }
}

/* the opened row (js/ui/report-panel.js): its title, the verdict, the reason, the facts, what can be done */
/* its head: the title, and Close at the top right, where it is found without scrolling the panel (B's M6) */
.panel-head { display: flex; align-items: flex-start; gap: 10px; }
.panel-head h3 { flex: 1 1 auto; min-width: 0; }
.panel-close { flex: none; width: var(--ctl); min-height: var(--ctl); margin: -8px -10px 0 0; padding: 0; font-family: inherit; font-size: var(--fs-2xl); line-height: 1; color: var(--ink-2); background: none; border: none; border-radius: var(--radius-control); cursor: pointer; }
.panel-close:hover { background: var(--off-soft); }
.panel h3 { margin: 0; font-family: var(--display); font-size: var(--fs-lg); font-weight: 650; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.panel p { margin-top: 10px; }
.panel p + p { margin-top: 8px; font-size: var(--fs-md); color: var(--muted); }
.facts { display: grid; gap: 10px; margin: 14px 0; }
.facts div { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 8px; font-size: var(--fs-md); }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 550; overflow-wrap: anywhere; }
.panel .btn { width: 100%; margin-top: 8px; }
/* what the page says about the opened report (a retry refused again, where its PDF went), under its buttons */
.panel .say { margin: 12px 0 0; }
/* beside a list the panel keeps its place on the screen while the list, several screens long, scrolls past it, so it
   is always on the screen of the row that was opened; a panel taller than the screen scrolls inside itself */
.split > .panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
/* while the list for a change is out, the list on the screen is dimmed: it is about to be replaced (B's M9) */
.split[aria-busy="true"] .list-table { opacity: .5; }

/* ======== the tabs of a page with several lists ======== */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1.5px solid var(--line); }
.tab { min-height: var(--ctl); margin-bottom: -1.5px; padding: 0 14px; font-family: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); white-space: nowrap; background: none; border: none; border-bottom: 2.5px solid transparent; cursor: pointer; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { margin-left: 6px; padding: 1px 7px; font-size: var(--fs-xs); font-style: normal; font-weight: 700; color: var(--navy); background: var(--volt); border-radius: 999px; }
/* what the last act came to (admin.html's #said): its line stays in view under the top of the screen while a long list
   scrolls, so a refusal for a row low in the list is seen (B's M11) */
.said-line { position: sticky; top: 8px; z-index: 6; }
.said-line .say { box-shadow: var(--shadow-card); }
/* an address in that line: moved whole to the next line rather than broken at a hyphen, and broken only where it is
   longer than a whole line (look fix round 2, B2-L16) */
.say-whole { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
/* a list being read from the server, the first time, says so in its card (B's M10) */
.list-loading { padding: 18px 20px; }

/* ======== adding a person: one line of three fields and a button ======== */
.add-person { display: grid; grid-template-columns: 1.3fr 1fr 180px auto; gap: 12px; align-items: end; }
.add-person + .muted { margin-top: 10px; }

/* ======== the admin lists (js/ui/admin-lists.js): a list table whose rows are not opened, a row's select and its
   buttons, a held report with why it is held, and a line of one field and its button ======== */
.list-plain tbody tr { cursor: default; }
.list-plain tbody tr:hover td { background: var(--surface); }
/* each cell draws its own line, so the line under a row runs on under the buttons' column, whose cell keeps its
   background over what scrolls under it (look fix round 2, B2-L1) */
.list-plain { border-collapse: separate; border-spacing: 0; }
/* a name or an address in an admin list is never broken inside a word: where the table is too narrow for one, it
   scrolls sideways inside its card (below the width the table needs, each row is a block instead: further down) */
.list-plain .cell-main, .list-plain .cell-sub { overflow-wrap: normal; }
/* in the table: a row's buttons side by side in the narrowest column, which stays at the card's right edge should a
   long name or address make the table scroll sideways; the short cells on one line; a heading may take two lines; the
   tablet in hand's sentence kept to a narrow measure, under its name and browser */
.list-plain th { white-space: normal; }
.list-plain td:not(:first-child):not(:last-child) { white-space: nowrap; }
.list-plain td:last-child { width: 1%; white-space: nowrap; }
.list-plain th:last-child, .list-plain td:last-child { position: sticky; right: 0; background: var(--surface); }
.list-plain .row-actions { flex-wrap: nowrap; }
/* a row's first button starts where the row above's does, and a second button is as wide as "Switch off", so the
   buttons line up down the list whichever a row has (B2-L2) */
.list-plain td:last-child .row-actions { justify-content: flex-start; }
.list-plain .row-actions .btn-small + .btn-small { min-width: 86px; }
/* the tablet in hand's sentence, under its name (not the words in a row's place for buttons, which keep a button's
   height and no more: B2-L17) */
.list-plain td > .muted { max-width: 34ch; margin-top: 4px; }
.row-pick { min-height: var(--ctl); padding: 0 36px 0 12px; font-family: inherit; font-size: var(--fs-md); font-weight: 550; color: var(--ink); background-color: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-control); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
/* words in place of buttons ("You are here") take a button's height, so their row is as tall as the others (B's L18) */
.row-actions .muted { display: inline-flex; align-items: center; min-height: var(--ctl); color: var(--muted); }
/* the held reports share one set of columns, so their verdicts and buttons line up down the list */
.held { display: grid; grid-template-columns: minmax(0, 1fr) 180px 280px; gap: 10px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.held:first-child { padding-top: 0; }
.held:last-child { padding-bottom: 0; border-bottom: 0; }
.held-why { margin-top: 6px; font-size: var(--fs-sm); line-height: 1.4; color: var(--warn); }
/* a switched-off tablet's held reports, all at once: one line above the list, which names the tablet and how many (B's
   M12) */
.held-tablet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 6px; padding: 12px 14px; font-size: var(--fs-md); color: var(--warn); background: var(--warn-wash); border: 1px solid var(--warn-line); border-radius: var(--radius-control); }
.held-tablet p { flex: 1 1 260px; }
.held-result { min-width: 0; }
/* a line of one name and its button, as wide as a name needs, not the whole card (B's L15) */
.add-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; max-width: 560px; }
.add-line + .muted { margin-top: 10px; }
/* each admin list's card (admin.html's .admin-list) is measured by its own width: below the width its own content
   needs, each row is a block, as a held report is: its name over its details, each detail after its heading
   (data-label, js/ui/admin-lists.js), and its buttons in a row under them, all on the screen; a word longer than the
   whole line is broken rather than cut. A list becomes blocks once as a window narrows (look fix round 2, B2-M1):
   each threshold is below the narrowest its card is with the wide rail (a window of 1100 px: about 805 px of a flush
   card, 765 px inside the held list's), so the narrow rail's extra room never turns blocks back into a table. People
   and Tablets: 780 px (a condition cannot read a token), a table squeezed below 900 px letting its middle cells, and
   an address, wrap; the held reports: 720 px; All companies, two short columns, a container of its own: 519 px, under
   the least width of a list table, 520 px, so it never scrolls sideways (look fix round 3, L1), and under its card at a
   700 px window (541 px), so the narrow rail never turns its blocks back into a table */
.admin-list { container: admin-list / inline-size; }
.admin-list-short { container-name: admin-list-short; }
@container admin-list (max-width: 899px) {
  .list-plain td:not(:first-child):not(:last-child) { white-space: normal; }
  .list-plain td:first-child .cell-sub { overflow-wrap: anywhere; }
}
/* a tablet's status carries until when it works offline as a second line, shown only where the table is squeezed (781
   to 899 px of card), in place of that column, which is hidden there: the first column gets about 100 px more (look
   fix round 3, L2: the tablet in hand's name and sentence took seven lines) */
.list-plain .cell-fold { display: none; margin-top: 1px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
/* the fold's line keeps its date whole (look fix round 4, L-b: "27 / Nov"); from 781 px of card the table has the room.
   And a tablet's person may take two lines at any width, so a long name never takes the device column's room
   (L-a: "Maximilian Montgomery-Fairweather" left the first column 105 px); the class pair outranks the middle cells'
   nowrap */
.list-plain.list-tablets td:nth-child(2) { white-space: normal; }
@container admin-list (min-width: 781px) and (max-width: 899px) {
  .list-tablets th:nth-child(4), .list-tablets td:nth-child(4) { display: none; }
  .list-tablets .cell-fold { display: block; }
}
@container admin-list (max-width: 780px) {
  .list-plain, .list-plain tbody { display: block; min-width: 0; }
  .list-plain thead { display: none; }
  .list-plain tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .list-plain tbody tr:last-child { border-bottom: 0; }
  .list-plain tbody td, .list-plain tbody td:not(:first-child):not(:last-child) { display: block; padding: 0; border: 0; white-space: normal; }
  .list-plain tbody td:first-child, .list-plain tbody td:last-child { flex: 1 1 100%; width: auto; position: static; white-space: normal; }
  .list-plain td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); }
  .list-plain .row-actions { flex-wrap: wrap; justify-content: flex-start; }
  .list-plain .cell-main, .list-plain .cell-sub { overflow-wrap: break-word; }
}
@container admin-list-short (max-width: 519px) {
  .list-plain, .list-plain tbody { display: block; min-width: 0; }
  .list-plain thead { display: none; }
  .list-plain tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .list-plain tbody tr:last-child { border-bottom: 0; }
  .list-plain tbody td, .list-plain tbody td:not(:first-child):not(:last-child) { display: block; padding: 0; border: 0; white-space: normal; }
  .list-plain tbody td:first-child, .list-plain tbody td:last-child { flex: 1 1 100%; width: auto; position: static; white-space: normal; }
  .list-plain td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); }
  .list-plain .row-actions { flex-wrap: wrap; justify-content: flex-start; }
  .list-plain .cell-main, .list-plain .cell-sub { overflow-wrap: break-word; }
}
@container admin-list (max-width: 720px) {
  .held { grid-template-columns: minmax(0, 1fr); }
  .held .row-actions { justify-content: flex-start; }
}

/* ======== the question (js/ui/ask.js): asked over the page before something is switched off, removed or decided, and
   its small form for one line of text. The browser shows it as a modal, over a backdrop ======== */
.ask { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; overflow-y: auto; color: var(--ink); background: var(--surface); border: none; border-radius: var(--radius-modal); box-shadow: var(--shadow-modal); }
.ask::backdrop { background: var(--overlay); }
.ask-card { padding: 22px 22px 18px; }
.ask-title { font-family: var(--display); font-size: var(--fs-xl); font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.ask-card p { margin-top: 10px; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); }
.ask-card .fg { margin-top: 14px; }
/* the form's line under its field when Save meets a blank name (js/ui/ask.js), in the warning colour */
.ask-card .fg p { margin-top: 0; font-size: var(--fs-sm); color: var(--warn); }
.ask-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ask-actions .btn { flex: 1 1 140px; }
/* the act that takes something away is solid red here, clearly apart from the safe button beside it (B's L24); the
   keyboard still starts on the safe one */
.ask .btn-danger { color: var(--on-strong); background: var(--fail); border-color: var(--fail); }

/* ======== the sign-in card ======== */
.signin { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 100vh; padding: 30px 16px; background: var(--navy); }
.signin-card { width: 100%; min-width: 0; max-width: 400px; padding: 30px 30px 24px; background: var(--surface); border-radius: var(--radius-modal); box-shadow: var(--shadow-modal); }
/* the mark and the name, on white: the mark in --amber, because --volt does not show on white */
.signin-card .rail-brand { margin-bottom: 22px; padding: 0; color: var(--ink); }
.signin-card .rail-brand svg { width: 24px; height: 24px; fill: var(--amber); }
.signin-card h1 { font-family: var(--display); font-size: var(--fs-2xl); font-weight: 650; line-height: 1.15; }
.signin-card .page-sub { margin-bottom: 20px; color: var(--muted); }
.signin-card .btn { width: 100%; min-height: var(--ctl-field); }
.signin-card .fg { margin-bottom: 12px; }
.signin-card .muted { margin-top: 18px; line-height: 1.45; text-align: center; color: var(--muted); }
/* the sign-in page's own door (js/signin.js): what the card says, then a line naming a list and its buttons, one under
   another (the test people, the companies to choose from) */
.signin-card .say { margin-bottom: 16px; }
.signin-label { margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
/* when a company must be chosen, the question is the card's main one (A's Low 3) */
.signin-pick .signin-label { font-size: var(--fs-base); color: var(--ink); }
.signin-list { display: grid; gap: 10px; }
/* dev mode's door: a little room between the card's heading and "Choose a test person" (look fix round 2, A2-L2) */
#door > .signin-label:first-child { margin-top: 6px; }
/* the person pressed at dev mode's door, while "Which company?" is open under it (A's Low 2) */
.signin-list .btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--ring); }
.signin-pick { margin-top: 18px; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: var(--fs-sm); color: var(--muted); }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ======== the style-guide page (styleguide.html, js/styleguide.js): each part under its title, drawn from these same
   rules. A part that fills the screen in the app is drawn here in a frame ======== */
.sg-part { margin-bottom: 30px; }
.sg-part > h2 { font-family: var(--display); font-size: var(--fs-xl); font-weight: 650; }
.sg-part > code { display: block; margin: 2px 0 12px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.sg-sample > * + * { margin-top: 12px; }
.sg-sample .has-rail { min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); }
.sg-sample .rail { position: static; height: 430px; }
.sg-sample .signin { min-height: 0; border-radius: var(--radius-card); }
.sg-sample .bar, .sg-sample .banner { position: static; }
.sg-sample .split > .panel { position: static; width: auto; max-height: none; margin: 16px 0 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.sg-sample .split > .panel .panel-head { position: static; margin: 0; padding: 0; border-bottom: 0; }
.sg-sample .np-modal { border: 1px solid var(--line); }
.sg-sample .np-raw { display: block; }
.sg-sample .np-viewer { position: static; height: 300px; border-radius: var(--radius-card); }
/* a sample question sits in the page's flow, square to its sides; the sample rule's gap above it stands */
.sg-sample .ask { position: static; margin-right: 0; margin-bottom: 0; margin-left: 0; }
/* the sample photo is a stand-in with no colour of its own: a light ground shows it, on the viewer's dark backdrop too */
.sg-sample .np-photo, .sg-sample .np-viewer-photo { background: var(--off-soft); }
/* the index of the parts, and the tokens themselves (look fix round 1, B's M19): js/styleguide.js hands each sample its
   token as --sg-token, so a value is never written twice */
/* the index: columns of links, each a full touch target (look fix round 2, B2-L24) */
.sg-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; margin-bottom: 26px; font-size: var(--fs-md); }
.sg-index a { display: flex; align-items: center; min-height: var(--ctl); color: var(--accent-ink); }
.sg-kind { margin: 18px 0 10px; font-size: var(--fs-md); font-weight: 650; color: var(--ink-2); }
.sg-tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.sg-token { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.sg-token code { display: block; font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink); }
.sg-token small { display: block; font-size: var(--fs-xs); color: var(--ink-2); overflow-wrap: anywhere; }
/* a swatch's edge is dark enough that the page's own ground and the white of a card show as swatches too (B2-L24) */
.sg-swatch { flex: none; width: 40px; height: 40px; background: var(--sg-token); border: 1px solid var(--faint); border-radius: var(--radius-chip); }
.sg-size { flex: 1 1 100%; font-size: var(--sg-token); font-weight: 600; line-height: 1.2; }
.sg-radius { flex: none; width: 48px; height: 36px; background: var(--accent-soft); border: 1.5px solid var(--accent-line); border-radius: var(--sg-token); }
.sg-shadow { flex: none; width: 48px; height: 36px; background: var(--surface); border-radius: var(--radius-control); box-shadow: var(--sg-token); }

/* ======== narrow screens ======== */
@media (max-width: 1099px) {
  .has-rail { grid-template-columns: var(--rail-narrow) minmax(0, 1fr); }
}
/* below 1200 px the list needs the whole width, so the opened row's panel is a drawer at the right of the screen, over
   the list, as tall as the screen, its head (the title and Close) kept at its top while it scrolls; the list's left
   columns stay in view beside it, the opened row tinted among them (look fix round 2, B2-M2: docked at the foot of
   the screen, it hid the very row it was opened from) */
@media (max-width: 1199px) {
  .split { display: block; }
  .split > .panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 25; width: min(420px, 92vw); max-height: none; margin: 0; padding: 0 20px 18px; border-width: 0 0 0 1px; border-radius: 0; box-shadow: var(--shadow-modal); }
  .split > .panel .panel-head { position: sticky; top: 0; z-index: 1; margin: 0 -20px; padding: 16px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
}
/* the four counts in one row where each has room for its name (B's M3) */
@media (min-width: 820px) {
  .counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .add-person, .add-line { grid-template-columns: minmax(0, 1fr); }
  /* a list's headings may take two lines, so its four columns fit a narrow tablet without scrolling sideways */
  .list-table th { white-space: normal; }
}
/* below 700 px the rail is a bar across the top: the mark, the name and the menu button, which shows the rest */
@media (max-width: 699px) {
  .has-rail, .has-rail.field-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; align-self: auto; gap: 4px; height: auto; padding: 8px 12px; overflow: visible; }
  .rail-brand { flex: 1; padding: 0 4px; }
  .rail-menu { display: inline-flex; }
  .rail-item, .rail-foot { display: none; }
  .rail.is-open .rail-item { display: flex; flex: 1 1 100%; margin: 0; }
  .rail.is-open .rail-foot { display: grid; flex: 1 1 100%; margin: 8px 0 4px; }
  /* the bar has the whole width: the person's menu opens in its place in the foot, under the person's line */
  .who-menu { position: static; width: auto; min-width: 0; max-width: none; }
  .page { padding: 14px; }
  .banner { padding: 10px 14px; }
  .sg-sample .rail { height: auto; }
  /* the line of the last act sits above the list, in its place: on a screen this small a line that stayed over the
     list covered its rows until the next act (look fix round 2, B2-L15; the row acted on shows what it came to) */
  .said-line { position: static; }
  /* the counts compact, so the list starts on the first screen (B's M3, M17) */
  .count { padding: 10px 12px; }
  .count b { font-size: var(--fs-2xl); }
  /* every filter but the search behind the Filters button, the search and the button on one line; pressed, the
     filters show under them (look fix round 2, B2-M6: the first report was at the foot of a phone's first screen) */
  .filters-toggle { display: inline-flex; flex: none; }
  .filters input[type=search] { flex: 1 1 160px; }
  .filters-more { display: none; }
  /* open, the box is as wide as its line and no wider: a flex item's least width is otherwise its widest choice's, and
     one long report type made the page 440 px wide on a phone (look fix round 3, H1) */
  .filters.is-open .filters-more { display: flex; flex: 1 1 100%; min-width: 0; flex-wrap: wrap; align-items: center; gap: 10px; }
  /* the opened report is a sheet over the whole screen, its head (the title and Close) kept at the top while it
     scrolls, and the list it came from is where it was once it is closed (B's M6, A's M14) */
  .split > .panel { position: fixed; inset: 0; z-index: 40; width: auto; max-height: none; margin: 0; padding: 0 14px 16px; border: 0; border-radius: 0; box-shadow: none; overflow-y: auto; }
  .split > .panel .panel-head { position: sticky; top: 0; z-index: 1; margin: 0 -14px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .split > .panel .panel-close { margin: -4px -6px 0 0; }
}
@media (max-width: 640px) {
  .wrap { padding: 14px; }
  /* the two fields side by side, the weather's button a full line under them, with no empty label line above it */
  .site-conditions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .site-conditions > .fg:last-child { grid-column: 1 / -1; }
  .site-conditions > .fg:last-child > label[aria-hidden="true"] { display: none; }
  /* the two boxes level whatever their labels' lines: a label takes two lines' room, its words at the foot (look fix
     round 3, L4: the temperature's box sat 19 px under the humidity's) */
  .site-conditions > .fg:not(:last-child) > label { display: flex; align-items: flex-end; min-height: 38px; }
  /* the title at the left and what the page offers (New report) at the right edge (A2-L8) */
  .page-head { justify-content: space-between; }
  .section, .card { padding: 16px 14px; }
  .card-flush { padding: 0; }
  .ttable td.rowlabel { font-size: var(--fs-base); }
  .bar { padding: 10px 12px; }
  .bar-actions { flex: 1 1 100%; }
  .bar-actions > button, .bar-actions > a { flex: 1; min-width: 0; padding: 0 8px; }
  .page-actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .np-row { grid-template-columns: 30px 1fr; }
  .np-row .np-val, .np-row .np-chip, .np-row .np-taps { grid-column: 2; }
}
/* wherever the test date's pair cannot stand on one line (it needs about 490 px), its name has a line of its own, with
   From and To each on a full line under it, their boxes lined up (look fix round 2, B2-L8, A2-L8: never "To" alone at
   the start of a line; round 3, L8: from 480 px to about 517 px it still split, so this is a block of its own) */
@media (max-width: 539px) {
  .filters .filter-dates, .filter-dates > span { flex: 1 1 100%; }
  .filters .filter-date { display: grid; flex: 1 1 100%; grid-template-columns: 3em minmax(0, 1fr); }
  .filters .filter-date input { width: 100%; }
}
/* on a phone the tabs stay one row, which scrolls sideways, so the active one's line sits under it (B's L23) */
@media (max-width: 479px) {
  /* the row fades at its right edge, so a tab cut there reads as more to scroll to; its end has room for the fade,
     so the last tab, scrolled to, is clear of it (look fix round 2, B2-L28) */
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-right: 32px; -webkit-mask-image: linear-gradient(to right, var(--ink) calc(100% - 32px), transparent); mask-image: linear-gradient(to right, var(--ink) calc(100% - 32px), transparent); }
  .tab { flex: none; }
  /* a select as narrow as the screen at most, whatever its longest choice (B2-H1, as measured: the page 375 px) */
  .filters select { min-width: 0; max-width: 100%; }
  /* a count is one line, its name at the left (its note under it) and its number at the right, two by two (B2-M6) */
  .counts { gap: 8px; }
  .count { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 8px 10px; }
  .count small, .count span { grid-column: 1; }
  .count b { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; font-size: var(--fs-xl); }
}
