/* ==========================================================================
   Keepersbook stylesheet
   One hand-written file. No build step, no webfonts, no external requests.

   TOKENS
   Every colour, size and space in this file comes from the custom properties
   below. Change a token, not a rule.

   Colour (light only: the product has no dark theme)
     --paper        page ground #F5F3ED
     --surface      panels, rows, inputs #FFFFFF
     --sunk         selected row, track, nil fill #ECE9E1
     --ink          body text #191B18
     --ink-2        secondary text (7:1+) #4A4D46
     --ink-3        tertiary text (AA on paper) #62655D
     --rule         hairlines #D8D3C6
     --rule-2       control borders (3:1) #B4AE9F
     --accent       primary action, links, focus #1E4A3D
     --accent-ink   text on --accent #FFFFFF
     --accent-soft  chosen tile, done banner #E2EBE6
     --overdue      overdue state #9A2B17
     --due          due within 14 days #7A5200
     --ok           up to date / held #2C5B37
     --*-soft       tinted grounds for the above
   State is never carried by colour alone: each state also has a shape
   (see .status) and a written label.

   Type
     --font-serif   Charter / Sitka / Cambria: headings and long reading
     --font-sans    system UI face: everything else
     All figures are tabular (font-variant-numeric on body).
     Scale (px): --t-xs 13 · --t-sm 14 · --t-md 16 · --t-lg 17
                 --t-h3 19 · --t-h2 22 · --t-h1 32 · --t-num 28

   Space (4px base): --s-1 4 · --s-2 8 · --s-3 12 · --s-4 16 · --s-5 20
                     --s-6 24 · --s-7 32 · --s-8 48
   Targets: --tap 44px minimum, --tap-lg 52px for primary actions.
   Radius: --radius 6px, --radius-pill 999px.

   Hazard categories (Appendix B) are drawn by box weight, not hue:
     1A solid ink box · 1 double-weight border · 2 single border · 3 plain.
   That survives mono print and never reads as decoration.
   ========================================================================== */

:root {
  --paper: #F5F3ED; --surface: #FFFFFF; --sunk: #ECE9E1;
  --ink: #191B18; --ink-2: #4A4D46; --ink-3: #62655D;
  --rule: #D8D3C6; --rule-2: #B4AE9F;
  --accent: #1E4A3D; --accent-ink: #FFFFFF; --accent-soft: #E2EBE6;
  --overdue: #9A2B17; --overdue-soft: #F6E3DC;
  --due: #7A5200; --due-soft: #F3EAD4;
  --ok: #2C5B37;

  --font-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs: 13px; --t-sm: 14px; --t-md: 16px; --t-lg: 17px;
  --t-h3: 19px; --t-h2: 22px; --t-h1: 32px; --t-num: 28px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 48px;

  --tap: 44px; --tap-lg: 52px;
  --radius: 6px; --radius-pill: 999px;
  --measure: 1040px; --measure-wide: 1240px;

  color-scheme: light;
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: var(--t-md)/1.5 var(--font-sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
em { font-family: var(--font-serif); }

h1, h2 { font-family: var(--font-serif); font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--t-h1); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--s-2); }
h2 { font-size: var(--t-h2); line-height: 1.25; margin: var(--s-7) 0 var(--s-3); }
h3 { font-size: var(--t-h3); line-height: 1.3; font-weight: 650; margin: var(--s-5) 0 var(--s-2); }
p.sub { color: var(--ink-2); font-family: var(--font-serif); font-size: var(--t-lg); line-height: 1.5; margin: 0 0 var(--s-6); max-width: 68ch; }

/* --- Header and frame ---------------------------------------------------- */
header.top {
  background: var(--surface); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
}
.doc, h2, [id] { scroll-margin-top: 72px; }
header.top .in {
  max-width: var(--measure-wide); margin: 0 auto; padding: var(--s-1) var(--s-4);
  display: flex; gap: var(--s-1) var(--s-2); align-items: center; flex-wrap: wrap;
}
header.top a {
  color: var(--ink-2); text-decoration: none; font-size: 15px;
  min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 var(--s-2);
}
header.top a:hover { color: var(--ink); }
header.top a[aria-current] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
header.top .brand { font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--ink); margin-right: var(--s-3); }
header.top form button { min-height: var(--tap); }
.nav-wide { display: contents; }
.spacer { flex: 1; }
header.top .cta { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 0 var(--s-4); font-weight: 600; }
header.top .cta:hover { color: var(--accent-ink); filter: brightness(1.08); }

/* Mobile menu: a disclosure, so it works without JavaScript. Hidden on wide screens. */
.nav-menu { display: none; margin-left: auto; }
.mobile-cta { display: none !important; }
.nav-menu summary {
  list-style: none; cursor: pointer; min-height: var(--tap); padding: 0 var(--s-3);
  display: inline-flex; align-items: center; gap: var(--s-2);
  border: 1px solid var(--rule-2); border-radius: var(--radius); font-weight: 600; font-size: 15px; color: var(--ink);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary svg { width: 18px; height: 18px; }
.nav-menu summary .x { display: none; }
.nav-menu[open] summary { background: var(--sunk); }
.nav-menu[open] summary .bars { display: none; }
.nav-menu[open] summary .x { display: inline; }
.nav-menu .menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--rule-2);
  box-shadow: 0 16px 24px -16px rgba(25, 27, 24, 0.35);
  padding: var(--s-1) var(--s-4) var(--s-4); display: flex; flex-direction: column;
}
header.top .menu-panel a {
  min-height: 52px; padding: 0 var(--s-3); font-size: var(--t-lg); color: var(--ink);
  border-bottom: 1px solid var(--rule); display: flex; align-items: center;
}
header.top .menu-panel a[aria-current] { box-shadow: inset 3px 0 0 var(--accent); font-weight: 650; }
.menu-panel .who { font-size: var(--t-sm); color: var(--ink-2); padding: var(--s-3) var(--s-3) var(--s-1); }
.menu-panel form { margin-top: var(--s-3); }
.menu-panel form button { width: 100%; }
header.top .menu-panel .cta { justify-content: center; margin-top: var(--s-3); border-bottom: 0; }

main { max-width: var(--measure); margin: 0 auto; padding: var(--s-7) var(--s-4) var(--s-8); }
footer.foot { max-width: var(--measure); margin: 0 auto; padding: 0 var(--s-4) var(--s-8); color: var(--ink-3); font-size: var(--t-xs); line-height: 1.55; }

.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s-5); margin: 0 0 var(--s-5);
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

/* --- Text utilities ------------------------------------------------------ */
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.warn { color: var(--due); }
.bad { color: var(--overdue); }
p.bad, p.warn { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Forms --------------------------------------------------------------- */
label { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--ink); margin: var(--s-3) 0 var(--s-1); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  min-height: var(--tap); padding: var(--s-2) var(--s-3);
  width: 100%; max-width: 420px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
input:user-invalid { border-color: var(--overdue); box-shadow: inset 0 0 0 1px var(--overdue); }
input.num { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
input[type=checkbox], input[type=radio] {
  width: 22px; height: 22px; min-height: 0; max-width: none; margin: 0 var(--s-3) 0 0;
  accent-color: var(--accent); flex: none;
}
input[type=file] { min-height: 0; border: 0; padding: 0; background: transparent; font-size: var(--t-sm); }

button, .btn {
  font: inherit; font-size: var(--t-md); font-weight: 600; cursor: pointer;
  min-height: var(--tap); padding: 0 var(--s-5);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
button:hover, .btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); font-weight: 500; }
button.ghost:hover, .btn.ghost:hover { background: var(--sunk); color: var(--ink); filter: none; }
.btn.big, button.big { min-height: var(--tap-lg); font-size: var(--t-lg); padding: 0 var(--s-6); }
button:disabled { background: var(--sunk); color: var(--ink-3); cursor: not-allowed; filter: none; }

.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: end; }
.row > * { flex: 0 0 auto; }
.row label, .fields label { margin-top: 0; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4) var(--s-5); align-items: start; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field > label { margin: 0 0 var(--s-1); }
.field input, .field select { width: 100%; max-width: none; }
.field .hint { font-size: var(--t-sm); color: var(--ink-2); margin: var(--s-1) 0 0; }
.field.wide { grid-column: span 2; }
.actions { margin-top: var(--s-5); display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* --- M.F.U counts ---------------------------------------------------------
   Plain text "1.2.3" stays the canonical form (it is what the return uses).
   .mfu marks one up so nil parts recede: <span class="mfu"><b>1</b>.<b>2</b>.<b class="z">0</b></span>
   A whole nil count can take .mfu.nil.                                      */
.mfu { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mfu b { font-weight: inherit; }
.mfu .z, .mfu.nil { color: var(--ink-3); }

/* Three-part input: <fieldset class="mfu-input"> with three number inputs
   labelled Male / Female / Unknown. See design/views-changes.md.            */
.mfu-input { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); min-width: 0; }
.mfu-input legend { font-size: var(--t-sm); font-weight: 600; padding: 0; margin-bottom: var(--s-1); }
.mfu-input label { margin: 0; font-weight: 500; font-size: var(--t-xs); color: var(--ink-2); }
.mfu-input input { max-width: none; text-align: center; font-size: var(--t-lg); padding: var(--s-2) var(--s-1); }

/* --- Tables -------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
th, td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th {
  font-size: var(--t-xs); font-weight: 650; color: var(--ink-2);
  border-bottom: 1.5px solid var(--ink); vertical-align: bottom; line-height: 1.3;
}
tbody tr:hover { background: var(--sunk); }
td.num, th.num { text-align: right; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
td.bad { background: var(--overdue-soft); }
td > em { font-size: 1.05em; }
/* Wide tables scroll inside their own box rather than the page.
   Preferred markup: <div class="scroll" tabindex="0" role="region" aria-label="…"><table>… */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 var(--s-5); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.scroll table { margin: 0; }
.scroll tbody td, .scroll tbody th { white-space: nowrap; }
.scroll th:first-child, .scroll td:first-child { position: sticky; left: 0; background: var(--surface); }

/* --- Hazard category ------------------------------------------------------
   Current markup: <span class="pill cat1A">1A</span>, modifier as a suffix. */
.pill, .haz {
  display: inline-block; min-width: 2.4em; text-align: center;
  font-size: var(--t-sm); font-weight: 700; line-height: 1.35;
  padding: 0 var(--s-1); border: 1px solid transparent; border-radius: 2px; color: var(--ink);
}
.pill.cat1A, .haz.c1A { background: var(--ink); color: var(--paper); border: 2px solid var(--ink); }
.pill.cat1,  .haz.c1  { border: 2px solid var(--ink); }
.pill.cat2,  .haz.c2  { border: 1px solid var(--ink-2); }
.pill.cat3,  .haz.c3  { color: var(--ink-2); font-weight: 600; }

/* --- Status ---------------------------------------------------------------
   Shape + word, never colour alone: ▲ overdue, ● due soon, ✓ up to date, ○ not held. The glyph is decorative (empty alt).    */
[class^="state-"]::before, [class*=" state-"]::before { display: inline-block; width: 1.1em; margin-right: 0.15em; font-weight: 700; }
.state-overdue  { color: var(--overdue); font-weight: 650; }
.state-overdue::before  { content: "\25B2" / ""; }   /* ▲ */
.state-due-soon { color: var(--due); font-weight: 650; }
.state-due-soon::before { content: "\25CF" / ""; }   /* ● */
.state-ok, .state-held { color: var(--ok); }
.state-ok::before, .state-held::before { content: "\2713" / ""; } /* ✓ */
.state-never, .state-missing { color: var(--ink-2); }
.state-never::before, .state-missing::before { content: "\25CB" / ""; } /* ○ */

/* --- Stat cards ---------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-2); margin: 0 0 var(--s-5); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-3) var(--s-4); min-height: 72px; }
.card .n { font-size: var(--t-num); font-weight: 650; line-height: 1.1; display: block; }
.card .n.bad { color: var(--overdue); }
.card .n.warn { color: var(--due); }
.card .k { font-size: var(--t-sm); color: var(--ink-2); }

/* --- Checklist: current table markup -------------------------------------
   Kept working until the list markup below replaces it.                    */
table.checks-table th:first-child, table.checks-table td:first-child { width: 4.5em; font-weight: 600; }
table.checks-table td:nth-child(2) { min-width: 14em; }
.done-form { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.done-form input[type=date] { width: auto; min-width: 9.5em; }
.done-form button { white-space: nowrap; }
.ev { max-width: 100%; margin-top: var(--s-2); }
.ev-list { margin-top: var(--s-1); }

/* --- Checklist: proposed list markup (design/views-changes.md) ------------
   <ul class="docs"><li class="doc"><details><summary>…</summary><div class="doc-body">…
   One row per document; the controls live in the opened drawer.            */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: 0 0 var(--s-5); }
.filters a, .filters button {
  min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--radius-pill);
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink);
  font-weight: 500; text-decoration: none; display: inline-flex; align-items: center;
}
.filters [aria-current], .filters [aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.section-h { font-family: var(--font-sans); font-size: var(--t-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin: var(--s-6) 0 var(--s-2); }
.section-h span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); margin-left: var(--s-2); }

ul.docs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.doc + .doc { border-top: 1px solid var(--rule); }
.doc summary {
  list-style: none; cursor: pointer; min-height: 64px;
  display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 11em 20px; gap: var(--s-3);
  align-items: start; padding: var(--s-3) var(--s-4);
}
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: ""; width: 10px; height: 10px; margin-top: 6px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.doc details[open] summary::after { transform: rotate(-135deg); margin-top: 10px; }
.doc .ref { font-weight: 650; }
.doc .title { font-size: var(--t-lg); line-height: 1.35; display: block; }
.doc .meta { font-size: var(--t-sm); color: var(--ink-2); display: block; margin-top: 2px; }
.doc .status { font-size: 15px; line-height: 1.3; }
.doc .status small { display: block; font-size: var(--t-sm); color: var(--ink-2); font-weight: 400; }
.doc-body {
  margin: 0 var(--s-4) var(--s-4) calc(4.5em + var(--s-4) + var(--s-3));
  padding-top: var(--s-4); border-top: 1px dashed var(--rule-2);
  display: grid; gap: var(--s-5);
}
.doc-body .clause { font-family: var(--font-serif); color: var(--ink-2); margin: 0; }
.when { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.when legend { font-size: var(--t-sm); font-weight: 600; padding: 0; margin-bottom: var(--s-2); }
.when label {
  margin: 0; font-weight: 500; font-size: 15px; display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 var(--s-3); border: 1px solid var(--rule-2); border-radius: var(--radius);
}
.when label:has(input:checked) { border: 2px solid var(--ink); font-weight: 600; }
.when input[type=date] { border: 0; min-height: 0; padding: 0 0 0 var(--s-2); max-width: 10em; background: transparent; }
.files { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.files li { display: flex; gap: var(--s-3); align-items: baseline; padding: var(--s-2) var(--s-3); font-size: 15px; }
.files li + li { border-top: 1px solid var(--rule); }
.files a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.files .muted { font-size: var(--t-sm); }
.attach { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-4); border: 1px solid var(--rule-2); border-radius: var(--radius); font-weight: 500; cursor: pointer; margin: 0; }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attach:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- Setup questionnaire --------------------------------------------------
   Current markup: .group > .checks > label. Proposed: .tiles > label.tile   */
.group { border: 0; padding: 0; margin: 0 0 var(--s-7); }
.group h3 { margin: 0 0 var(--s-3); }
.checks, .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-2); }
.checks label, .tile {
  display: flex; align-items: center; margin: 0; min-height: 56px;
  padding: var(--s-2) var(--s-4); font-size: var(--t-md); font-weight: 500; line-height: 1.3;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer;
}
.checks label:has(input:checked), .tile:has(input:checked) { background: var(--accent-soft); border: 2px solid var(--accent); padding: calc(var(--s-2) - 1px) calc(var(--s-4) - 1px); }
.tile .adds { margin-left: auto; padding-left: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; }
.tally { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-5); }
.tally .tally-big { font-family: var(--font-serif); font-size: 56px; font-weight: 700; line-height: 1; display: block; }

/* --- Narrow screens ------------------------------------------------------- */
@media (max-width: 760px) {
  /* One compact row: brand, optional call to action, Menu. */
  header.top .in { flex-wrap: nowrap; padding: var(--s-2) var(--s-4); gap: var(--s-2); }
  .nav-wide { display: none; }
  .nav-menu { display: block; }
  .mobile-cta { margin-left: auto; }
  .mobile-cta { display: inline-flex !important; }
  header.top .cta { min-height: 40px; padding: 0 var(--s-3); font-size: 15px; }
  main { padding: var(--s-5) var(--s-4) var(--s-8); }
  h1 { font-size: 26px; }
  /* Tables that have no .scroll wrapper yet still scroll instead of
     pushing the page sideways. */
  main > table, .panel > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.checks-table th:nth-child(3), table.checks-table td:nth-child(3),
  table.checks-table th:nth-child(4), table.checks-table td:nth-child(4) { display: none; }
  .doc summary { grid-template-columns: minmax(0, 1fr) 20px; gap: var(--s-1) var(--s-3); }
  .doc .ref { grid-column: 1; grid-row: 1; }
  .doc .status { grid-column: 1; grid-row: 1; justify-self: end; text-align: right; }
  .doc .status small { display: none; }
  .doc summary::after { grid-column: 2; grid-row: 1; }
  .doc .main-col { grid-column: 1 / -1; }
  .doc-body { margin: 0 var(--s-4) var(--s-4); }
  .doc-body .btn.big, .doc-body button.big { width: 100%; }
}
@media (max-width: 480px) {
  .field.wide { grid-column: span 1; }
  .checks, .tiles { grid-template-columns: 1fr; }
  .tally { position: static; }
}

/* --- Print -----------------------------------------------------------------
   Both printed documents go to a licensing authority on A4, often in mono.
   Ink only, rules at least 1px, nothing lighter than #767676.              */
@page { size: A4; margin: 14mm 12mm 16mm; }
@page stock { size: A4 landscape; margin: 12mm; }
@media print {
  :root { --ink: #000; --ink-2: #333; --ink-3: #767676; --rule: #8A8A8A; --paper: #fff; --surface: #fff; --sunk: #fff; color-scheme: light; }
  header.top, .noprint, footer.foot, .filters, .cards, .done-form, .ev, .attach, button, .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.35; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .panel { border: 0; padding: 0; margin: 0 0 4mm; background: none; }
  h1 { font-size: 18pt; margin: 0 0 2mm; }
  h2 { font-size: 12pt; margin: 5mm 0 2mm; break-after: avoid; }
  p.sub { font-size: 10pt; margin: 0 0 3mm; }
  table { font-size: 9pt; }
  thead { display: table-header-group; }
  thead th { color: #000; border-bottom: 1.5pt solid #000; }
  th, td { border-bottom: 0.75pt solid #8A8A8A; padding: 1.4mm 2mm; }
  tr { break-inside: avoid; }
  tbody tr:hover { background: none; }
  tr.total td { border-top: 1.5pt solid #000; }
  td.bad { background: none; font-style: italic; }
  .scroll { overflow: visible; border: 0; }
  main > table, .panel > table { display: table; }
  .mfu .z, .mfu.nil { color: #767676; }
  .pill.cat1A, .haz.c1A { background: #000 !important; color: #fff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  [class^="state-"], [class*=" state-"] { color: #000; }

  /* Annual Stock Record: landscape, prescribed column order untouched. */
  body.print-stock main { page: stock; }
  body.print-stock th:nth-child(5), body.print-stock td:nth-child(5),
  body.print-stock th:nth-child(10), body.print-stock td:nth-child(10) { border-left: 1pt solid #000; }
  body.print-stock td:nth-child(10) { font-weight: 700; }

  /* Inspection pack: ZLH and ZI stay as columns 3 and 4, drawn as boxes. */
  .tick { display: inline-block; width: 4mm; height: 4mm; border: 0.75pt solid #000; text-align: center; line-height: 4mm; font-weight: 700; }
}

/* --- Added with the views.mjs changes ------------------------------------ */
main.wide { max-width: var(--measure-wide); }
.print-only { display: none; }
td.ref { font-weight: 600; white-space: nowrap; }
td.tickcol, th.tickcol { text-align: center; width: 3em; }
.tick { display: inline-block; width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 2px; text-align: center; line-height: 15px; font-weight: 700; font-size: 14px; }
fieldset.group { border: 0; padding: 0; margin: 0 0 var(--s-7); min-width: 0; }
fieldset.group legend { padding: 0; }
fieldset.group legend h3 { margin: 0 0 var(--s-3); }
.setup { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .setup { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-8); align-items: start; } }
.tally p { margin: 0 0 var(--s-3); }
.tally .tally-n { font-size: var(--t-md); color: var(--ink-2); }
.tally .bar { height: 8px; background: var(--sunk); border-radius: 2px; overflow: hidden; margin: 0 0 var(--s-4); }
.tally .bar span { display: block; height: 100%; background: var(--accent); }
.tally button { width: 100%; }
.evidence { display: grid; gap: var(--s-2); justify-items: start; }
.evidence .files { justify-self: stretch; }
.section-h + ul.docs { margin-bottom: var(--s-2); }
@media print {
  .print-only { display: block; }
  .sign { display: grid; grid-template-columns: 2fr 1fr; gap: 10mm; margin-top: 10mm; font-size: 9pt; }
  .sign span { border-top: 0.75pt solid #000; padding-top: 1mm; }
  .tick { width: 4mm; height: 4mm; border-width: 0.75pt; line-height: 3.6mm; font-size: 9pt; }
  .scroll { display: block; }
}
