/* Forms Flow app — mobile-first, sun-readable, thumb-sized. One small palette; no framework, no web font, no CDN.
 * Skin: the owner's UI redesign, iteration 1 (design/ui-v1-2026-09-10) — the client's mark and its red as the one
 * accent, warm off-white ground, ink black, square corners, 1 px rules, uppercase letter-spaced eyebrows, a fixed
 * Back / Next bar within thumb reach. Wording, markup and behaviour are unchanged: this file only paints them.
 */
:root {
  --bg: #F5F3EF; --paper: #FFFFFF; --ink: #111111; --muted: #5C5C5C;
  --line: #D8D3CA;              /* a border at rest */
  --line-strong: #111111;       /* a border that is chosen, or strong */
  --fill: #DAD5CC;              /* text fields and the secondary button */
  --fill-hover: #CFC9BE; --fill-active: #C4BEB2;
  --track: #EDE9E3;             /* progress track, hairline divider */
  --brand: #B12A2D; --brand-dark: #8E2124; --brand-soft: #EDE9E3; --on-brand: #fff;
  --brand-on-ink: #F0B4B2;      /* eyebrow text set directly on an ink fill — full-strength --brand there is ~2.9:1 against #111111; this is ~10.7:1 */
  --muted-on-ink: #8C8C8C;      /* muted text set directly on an ink fill — full-strength --muted there is ~2.8:1 against #111111; this is ~5.6:1 */
  --ok: #111111; --warn: #5C5C5C; --bad: #B12A2D;
  --risk-low: #d9efd6; --risk-medium: #ffe6a8; --risk-high: #f8c9c4;   /* the review rows and the matrix keep their tints */
  --radius: 0; --tap: 48px;
  --col: 430px;                                                  /* the phone column, centred on anything wider */
  --gutter: max(20px, calc((100% - var(--col)) / 2));
  --hdr-h: 60px;                                                 /* the sticky header */
  --bar-h: 80px;                                                 /* the fixed action bar: 12 + 56 + 12 */
  --bar-clear: calc(96px + env(safe-area-inset-bottom));         /* what the page keeps clear beneath it */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.45 var(--font); padding-bottom: var(--bar-clear);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.has-footer { padding-bottom: 0; }        /* the dark footer carries the clearance instead */
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 32px; line-height: 1.1; margin: 0 0 8px; text-wrap: pretty; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--ink); }
a:hover { color: var(--brand-dark); }
.muted { color: var(--muted); } .small { font-size: 16px; } .ok { color: var(--ok); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- the eyebrow: every group title, section title and field label that heads something ---------- */
.eyebrow, .field-label, .hz-sub, .info-title, .review-section h3, .runner-head, .flags > strong, .warnings > strong, .problem-box > strong, .tray-head > strong {
  font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase;
}

/* ---------- chrome ---------- */
.hdr { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--hdr-h);
  padding: 0 var(--gutter); background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
/* the wordmark carries no min-width and no ellipsis rule of its own: as a flex item it cannot be compressed below
 * its own text's width, so "Artisan Drywall" fits by construction, at 360px and up. Only .who is allowed to give —
 * capped at 34% of the header and free to ellipsis past that — so a long signed-in name can never crowd the mark.
 * The sign-out link that used to live beside the name here now sits on the picker screen (ui/picker.mjs). */
.hdr .brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.hdr .brand-mark { height: 34px; width: auto; display: block; flex: 0 0 auto; }
.hdr .wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.hdr .wordmark-name { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.hdr .wordmark-sub { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); white-space: nowrap; }
.hdr .who { flex: 0 1 auto; min-width: 0; max-width: 34%; }
.hdr .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--ink); }
.banner { background: var(--ink); color: #fff; border: 0; padding: 12px var(--gutter); font-size: 14px; font-weight: 500; }
.app { width: 100%; max-width: var(--col); margin: 0 auto; padding: 20px 20px 28px; flex: 1 0 auto; }
.screen { background: none; border: 0; padding: 0; }              /* the screen is the ground; the cards inside are paper */
.screen + .screen { margin-top: 22px; }
.intro { color: var(--muted); margin: 0 0 22px; text-wrap: pretty; }

/* the dark footer: one line, at the very bottom, clearing the fixed bar */
.ftr { flex: 0 0 auto; background: var(--ink); color: #fff; padding: 18px var(--gutter); }
body:has(nav.actions) .ftr { padding-bottom: var(--bar-clear); }   /* clear the bar only where there is one */
.ftr .ftr-line { color: var(--muted-on-ink); font-size: 12px; letter-spacing: .08em; }

/* ---------- runner head + the progress line under the header ---------- */
.runner { display: flex; flex-direction: column; }
.runner-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); padding: 14px 0 0; }
.runner-head .form-name { color: var(--muted); }
.progress { order: -1; height: 3px; background: var(--track); overflow: hidden; margin: -20px -20px 0; }   /* full-bleed of the app's gutter */
.progress.small { order: 0; height: 4px; margin: 6px 0; }
.progress .bar { height: 100%; background: var(--brand); transition: width .45s cubic-bezier(.2,.7,.2,1); }

/* ---------- buttons ---------- */
button { font: inherit; color: inherit; }
.primary, .secondary { min-height: 56px; height: 56px; padding: 0 14px; border-radius: 0; border: 0;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; cursor: pointer; }
.primary { background: var(--brand); color: var(--on-brand); }
.primary:hover { filter: brightness(.94); } .primary:active { filter: brightness(.86); }
.secondary { background: var(--fill); color: var(--ink); }
.secondary:hover { background: var(--fill-hover); } .secondary:active { background: var(--fill-active); }
.primary:disabled, .secondary:disabled { background: var(--fill); color: var(--muted); cursor: default; filter: none; }
.link { background: none; border: 0; padding: .5rem .25rem; min-height: 44px; color: var(--brand); text-decoration: underline; cursor: pointer; font-size: 14px; }
.link.remove { color: var(--brand); font-size: 13px; }

/* the action bar is fixed to the bottom of the screen — the DOM keeps it where it was */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; gap: 8px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); margin: 0; border: 0; border-top: 1px solid var(--line); background: var(--bg); }
.actions .primary { flex: 1 1 40%; } .actions .secondary { flex: 0 1 auto; min-width: 34%; }
.actions button { white-space: normal; line-height: 1.15; }

/* ---------- fields ---------- */
.field { margin: 0 0 22px; }
.field-label { display: block; margin-bottom: 8px; }
/* a group heading carries a rule and, on the right, its count */
.field-head, .type-checklist > .field-label, .type-hazardmatrix > .field-label, .type-photos > .field-label, .type-signature > .field-label, .type-rows > .field-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin-bottom: 10px; }
.field-head > .field-label { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
/* a question is a sentence, not an eyebrow */
.type-yesno > .field-label, .type-segmented > .field-label, .type-checkbox > .field-label, .type-rows > .field-label {
  font-size: 17px; letter-spacing: 0; text-transform: none; font-weight: 500; margin-bottom: 4px; }
.type-rows > .field-label { border-bottom: 0; padding-bottom: 0; margin-bottom: 10px; }
.type-yesno { margin-bottom: 16px; }
.tick-count { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); white-space: nowrap; }
.req { color: var(--brand); }
.help { color: var(--muted); font-size: 16px; margin: -2px 0 8px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], textarea, select {
  width: 100%; min-height: 56px; padding: 0 14px; font: inherit; font-size: 18px; color: var(--ink); background: var(--fill);
  border: 1px solid var(--ink); border-radius: 0; }
textarea { min-height: 5rem; padding: 12px 14px; resize: vertical; font-size: 17px; }
select { padding: 0 2.2rem 0 14px; }
.textarea-wrap { position: relative; } .counter { display: block; text-align: right; color: var(--muted); font-size: 13px; }
.with-unit { display: flex; align-items: center; gap: .5rem; } .with-unit input { flex: 1; } .unit { color: var(--muted); font-weight: 600; }
.select-wrap { position: relative; } .select-wrap select { appearance: none; -webkit-appearance: none; }
.select-wrap::after { content: "▾"; position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink); }
output.readonly, output.computed { display: block; min-height: 56px; padding: 15px 14px; background: var(--fill); border: 1px solid var(--line); font-weight: 600; }
.has-problem input, .has-problem textarea, .has-problem select { border-color: var(--brand); }
.problem { color: var(--bad); font-weight: 600; font-size: 16px; margin: .35rem 0 0; }
.problem-box { background: var(--paper); border: 1px solid var(--brand); border-radius: 0; padding: 14px 16px; margin-bottom: 18px; }
.problem-box > strong { display: block; color: var(--brand); margin-bottom: 6px; }
.problem-box ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: 16px; }
.problem-box a { color: var(--ink); }
/* missing answers shown where they stand [O 2026-10-15]: the notice is itself the link to the first one, its twin sits
 * at the bottom of the step; what owes an answer wears a red frame and its own line (a field marked only for its parts —
 * a row's cell, a hazard — leaves the frame to them); every mark scrolls clear of the sticky header and the fixed bar */
.problem-box > strong a { color: inherit; }
.problem-box > strong a, .problem-jump a { display: inline-block; min-height: 44px; padding: 10px 0; }
.problem-jump { margin: -4px 0 18px; }
.problem-jump a { color: var(--brand); font-size: 16px; font-weight: 600; }
.screen .field.has-problem:has(> .problem), .hz-all.has-problem, .hz-nip-hazard.has-problem { outline: 2px solid var(--brand); outline-offset: 6px; }
.screen .hz-card.has-problem { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }   /* over .hz-card.on, further down */
.hz-card > .problem { margin: 8px 0 0; }
.screen .has-problem, .screen .problem-box { scroll-margin-top: calc(var(--hdr-h) + 20px); scroll-margin-bottom: calc(var(--bar-h) + 20px + env(safe-area-inset-bottom)); }
.field-inline { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; }

/* ---------- option buttons (yesno / segmented / checklist / hazards / roster / jobs) ---------- */
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 8px 14px; margin: 0 0 6px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 0; cursor: pointer; font-size: 17px; font-weight: 500; color: var(--ink); }
.opt:hover { border-color: var(--ink); }
.opt .tick { flex: 0 0 auto; width: 22px; height: 22px; border: 1px solid var(--ink); background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0; color: transparent; }
.opt.on .tick { background: var(--ink); }
.opt.on .tick::after { content: ""; display: block; width: 10px; height: 10px; background: var(--brand); }
.opt[role=radio] .tick { border-radius: 0; }
.opt.on { border-color: var(--ink); background: var(--paper); }
.opt.danger { border-color: var(--line); } .opt.danger.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt.danger.on .tick { border-color: #fff; background: #fff; } .opt.danger.on .tick::after { background: var(--brand); }
.opt-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.opt-label { font-weight: 500; }
.opt-help { font-size: 16px; color: var(--muted); font-weight: 400; }
.marker { font-size: 16px; color: var(--brand); font-weight: 500; }
.code { color: var(--muted); font-size: 13px; font-weight: 400; }
.opt.mini { min-height: 44px; padding: .35rem .6rem; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; width: auto; margin: 0; justify-content: center; }
.opt.mini .tick { display: none; }
.opt.mini.on { background: var(--ink); color: #fff; }
/* a chosen row is filled with ink: every scrap of text on it inherits that fill's white — a muted grey or the
 * accent red would sit at about 3:1 there and fail AA. Nothing inside a selection carries a colour of its own. */
.seg .opt.on .opt-help, .seg .opt.on .code, .seg .opt.on .marker,
.opt.danger.on .opt-help, .opt.danger.on .code, .opt.danger.on .marker,
.jobs .opt.on .job-code { color: inherit; }

/* a pair or a row of choices: a grid of plain uppercase buttons, no tick box */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 6px; margin-bottom: 0; }
.seg .opt { margin: 0; min-height: 50px; justify-content: center; text-align: center;
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; padding: 8px 10px; }
.seg .opt .tick { display: none; }
.seg .opt-text { align-items: center; flex: 0 1 auto; }
.seg .opt.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg.small { gap: 4px; grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); }
.type-yesno .seg { grid-template-columns: 1fr 1fr; }
.ticks { display: block; }
/* Optional presentation from the definition; source order and every label remain intact. */
@media (min-width: 360px) {
  .ticks.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ticks.compact > .opt, .prototype .ticks.compact > .opt { margin: 0; min-height: 48px; padding: 9px 8px; gap: 8px; font-size: 16px; line-height: 1.3; border: 1px solid var(--line); }
  .ticks.compact .opt-label { overflow-wrap: anywhere; }
}
.nested { margin: 6px 0 14px; padding: 12px 0 0 14px; border-left: 1px solid var(--ink); }
.nested .field:last-child { margin-bottom: 0; }
@keyframes ff-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.enter { animation: ff-enter .22s ease-out; }
@media (prefers-reduced-motion: reduce) { .enter { animation: none; } .progress .bar { transition: none; } }

/* ---------- info + notices ---------- */
.info { background: var(--paper); border: 1px solid var(--line); border-radius: 0; padding: 16px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 22px; }
.info-title { flex: 1 1 100%; min-width: 0; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.info p { flex: 1 1 100%; min-width: 0; margin: 0; }
.info p + p { margin-top: .4rem; }
/* the procedure link sits to the right; on a phone a long label takes the line under the notice rather than widening it */
.info-link { flex: 0 1 auto; margin: 10px 0 0 auto; overflow-wrap: anywhere;
  font-size: 12px; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--ink); }
/* an info field with a label and nothing else heads a group: a rule, not a card */
.info.info-heading { background: none; border: 0; padding: 0; display: block; margin: 26px 0 12px; }
.info.info-heading .info-title { color: var(--ink); font-size: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin: 0; }
.notice { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 0 0; margin: 10px 0 0;
  color: var(--brand); font-size: 16px; font-weight: 500; }
.flags { background: var(--ink); color: #fff; border: 0; border-radius: 0; padding: 16px; margin-top: 22px; }
.flags > strong { display: block; color: var(--brand-on-ink); margin-bottom: 8px; }
.flags ul { margin: 0 0 10px; padding-left: 18px; }
.flags li { margin-bottom: 4px; }
.flags p.small { margin: 0; color: var(--line); }
.warnings { background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 16px; margin-top: 16px; }
.warnings > strong { display: block; margin-bottom: 8px; }
.warnings ul { margin: 0; padding-left: 18px; }

/* ---------- rows ---------- */
.row-card { border: 1px solid var(--line); border-radius: 0; padding: 14px 16px 4px; margin-bottom: 12px; background: var(--paper); }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.row-n { color: var(--muted); font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; }
.add-row { width: 100%; }

/* ---------- photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 8px; margin-bottom: 12px; }
.photo-grid.small { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); }
.photo-card { margin: 0; border: 1px solid var(--line); border-radius: 0; padding: 8px; background: var(--paper); text-decoration: none; color: inherit; }
.thumb { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0; background: var(--fill); }
.thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.photo-card figcaption { font-size: 13px; color: var(--muted); margin: .3rem 0; word-break: break-all; }
.photo-card .seg { margin: .3rem 0; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.photo-btn { flex: 1 1 45%; height: 50px; min-height: 50px; }
.tag { display: inline-block; background: var(--ink); color: #fff; border-radius: 0; padding: 1px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

/* ---------- signature ---------- */
.attestation { font-weight: 500; font-size: 17px; background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 14px 16px; text-wrap: pretty; }
.signer { margin: .4rem 0; font-size: 14px; color: var(--muted); } .signer strong { color: var(--ink); font-weight: 600; }
.sigpad-wrap { position: relative; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); touch-action: none; overflow: hidden; }
.sigpad-wrap::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 34px; border-bottom: 1px solid var(--line); pointer-events: none; }
.sigpad { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.sig-hint { position: absolute; left: 16px; bottom: 10px; transform: none; color: var(--muted); pointer-events: none;
  font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; }
.sig-actions { display: flex; gap: 14px; align-items: center; margin: 8px 0 16px; }
.sig-actions .link { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding: .5rem 0; }
.sig-thumb { display: block; max-width: 14rem; border: 1px solid var(--line); border-radius: 0; margin-top: .3rem; background: #fff; }

/* ---------- hazard matrix ---------- */
.hz-group { margin-bottom: 22px; }
.hz-group-title { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--ink);
  font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; }
.hz-group-body > .small.muted { margin: 0 0 12px; }        /* "From the SWP: …" */
.hz-group-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; margin: 0 0 10px;
  text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 0; font: inherit; cursor: pointer; }
.hz-group-toggle .hz-group-title { flex: 1 1 auto; margin: 0; padding: 0; border: 0; }
.hz-group-toggle .chev { flex: 0 0 auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; border: 1px solid var(--ink); border-radius: 0; font-size: 14px; }
.hz-group-note { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.opt-long { margin-bottom: 6px; } .opt-long .opt { margin-bottom: 2px; }
.more-btn { margin-left: 2.2rem; font-size: 13px; }
.matrix-table th.axis { font-size: .66rem; letter-spacing: .02em; text-transform: uppercase; }
/* one hazard = one white card */
.hz-card { background: var(--paper); border: 1px solid var(--line); padding: 16px; margin-bottom: 12px; }
.hz-card.on { border-color: var(--ink); }
.hz-card > .opt { border: 0; padding: 0; margin: 0; min-height: 0; background: none; }
.hz-card > .opt .tick { margin-top: 2px; align-self: flex-start; }
.hz-card > .opt.on .opt-label { font-size: 20px; font-weight: 600; line-height: 1.15; }
.hz-body { margin: 14px 0 0; padding-left: 0; border-left: 0; }
.hz-sub { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.hz-risk { margin-bottom: 14px; }
.hz-risk .seg { grid-template-columns: repeat(3, 1fr); }
.hz-risk .seg .opt { min-height: 48px; font-size: 12px; }
.hz-risk .seg .opt.on[data-tone=danger] { background: var(--brand); border-color: var(--brand); }
.hz-risk .small.muted { margin: 8px 0 0; }
/* a hazard the worker ticked on an earlier screen: a heading, not a tick */
.hz-heading { display: block; padding: 0; margin: 0 0 4px; background: none; border: 0; border-radius: 0; }
.hz-heading-label { display: block; font-size: 20px; font-weight: 600; line-height: 1.15; }
.hz-heading-step, .hz-heading-note { display: block; font-size: 16px; color: var(--muted); }
/* attest: read the controls once, then one tap */
.hz-read { margin: 0 0 12px; }
.hz-read > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0;
  color: var(--ink); cursor: pointer; font-weight: 500; }
.hz-read > summary::-webkit-details-marker { display: none; }
.hz-read > summary::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; background: var(--brand); transition: transform .2s; }
.hz-read[open] > summary::before { transform: rotate(45deg); }
.hz-read-list { margin: 4px 0 8px; padding-left: 22px; font-size: 16px; } .hz-read-list li { margin-bottom: 6px; }
.hz-attest-q { font-weight: 500; margin: 6px 0 8px; }
.seg.hz-attest { grid-template-columns: 1fr; }
.seg.hz-attest .opt { justify-content: flex-start; text-align: left; text-transform: none; letter-spacing: 0;
  font-size: 17px; font-weight: 500; min-height: 50px; padding: 10px 14px; }
.help-btn { min-width: 44px; min-height: 44px; border: 1px solid var(--ink); border-radius: 0; text-decoration: none;
  font-weight: 600; padding: 0; color: var(--ink); font-size: 14px; }
.hz-controls { margin-top: 12px; }
.hz-note label { display: block; margin: 14px 0 8px; font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; }
.hz-no-controls { margin: 0 0 8px; }
dialog.matrix { border: 1px solid var(--ink); border-radius: 0; padding: 16px; max-width: 95vw; width: 34rem; background: var(--paper); color: var(--ink); }
dialog.matrix::backdrop { background: rgba(17,17,17,.5); }
dialog.matrix h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.table-scroll { overflow-x: auto; margin-bottom: .6rem; }
.matrix-table { border-collapse: collapse; font-size: .78rem; width: 100%; table-layout: fixed; }
.matrix-table col.axis { width: 23%; }
.matrix-table th, .matrix-table td { border: 1px solid var(--line); padding: .3rem .15rem; text-align: center; overflow-wrap: break-word; }
.matrix-table th { background: var(--track); font-size: .7rem; }
td.risk-low, .risk-low { background: var(--risk-low); } td.risk-medium, .risk-medium { background: var(--risk-medium); } td.risk-high, .risk-high { background: var(--risk-high); }

/* the high-risk gate that follows the hazard grid reads as one dark block (the design's "high risk today") */
.type-hazardmatrix ~ .field.type-yesno { background: var(--ink); color: #fff; padding: 18px 16px; margin-bottom: 16px; }
.type-hazardmatrix ~ .field.type-yesno .field-label, .type-hazardmatrix ~ .field.type-yesno .req { color: #fff; }
.type-hazardmatrix ~ .field.type-yesno .help { color: var(--line); }
.type-hazardmatrix ~ .field.type-yesno .opt { background: transparent; color: #fff; border-color: #fff; }
.type-hazardmatrix ~ .field.type-yesno .opt.on { background: #fff; color: var(--ink); border-color: #fff; }
.type-hazardmatrix ~ .field.type-yesno .nested { border-left-color: #fff; }
.type-hazardmatrix ~ .field.type-yesno .problem { color: #fff; }

/* ---------- review ---------- */
.review-head { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.review-head strong { color: var(--muted); font-weight: 400; }
.review-section { background: var(--paper); border: 1px solid var(--line); border-radius: 0; padding: 16px; margin-bottom: 12px; }
.review-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.review-title h3 { margin: 0; }
.review-title .link { padding: 0 0 0 8px; min-height: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; color: var(--brand); text-decoration: none; }
dl { margin: 0; } dt { font-weight: 400; margin-top: 12px; color: var(--muted); font-size: 13px; } dd { margin: 2px 0 0; font-size: 17px; text-wrap: pretty; }
dl > dt:first-child { margin-top: 0; }
dt.nested-dt { padding-left: 10px; border-left: 1px solid var(--line); }
ul.plain { margin: 0; padding-left: 1.1rem; }
.review-rows { margin: 0; padding-left: 1.2rem; } .review-rows li { margin-bottom: .3rem; } .kv { display: inline-block; margin-right: .7rem; } .kv .k { color: var(--muted); }
.review-hazards { list-style: none; margin: 0; padding: 0; } .review-hazards li { border-radius: 0; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line); }
.review-hazards li.risk-none { background: var(--track); }
.sent-status p { font-size: 17px; }
.screen.done h2, .screen.sign.done h2 { font-size: 36px; line-height: 1.05; }

/* ---------- picker + identify ---------- */
/* who this card would be filed as, and the way out if that is wrong — the "Not you?" link the header used to carry
 * beside the name, now under the heading instead (the name itself stays put in the header; see .hdr .who above). */
.who-line { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.who-line .link { padding: .5rem 0; color: var(--brand); font-size: 13px; text-transform: none; letter-spacing: 0; }
.tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 4.5rem; padding: 18px;
  text-align: left; background: var(--paper); border: 1px solid var(--ink); border-radius: 0; cursor: pointer; }
.tile:hover { background: var(--bg); } .tile:active { background: var(--fill); }
.tile-title { font-size: 20px; font-weight: 600; line-height: 1.15; color: var(--ink); } .tile-sub { color: var(--muted); font-size: 15px; text-wrap: pretty; }
.roster .opt { min-height: 56px; padding: 10px 16px; }
.roster .opt .tick { display: none; }
.roster .opt .opt-text { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; }
.roster .opt .opt-label { font-size: 18px; font-weight: 500; }
.roster .opt .opt-help { text-align: right; white-space: nowrap; }
.filter { margin-bottom: 12px; }
/* the Documents screen: one row per document, the title over its kind and revision date; the whole row is the link */
.docs { display: flex; flex-direction: column; gap: 6px; }
.docs .doc-row { min-height: 56px; padding: 10px 16px; margin: 0; text-decoration: none; color: var(--ink); }
.docs .doc-row .opt-label { font-size: 18px; font-weight: 500; }
.docs .doc-row .doc-kind { color: var(--brand); }
.docs .doc-row .opt-help { font-size: 15px; }
.docs a.doc-row:hover { border-color: var(--ink); color: var(--ink); }
.docs .doc-pending { display: flex; border: 1px dashed var(--line); background: transparent; }
.docs .doc-pending .doc-kind { color: var(--muted); }
.documents-actions .secondary { flex: 1 1 auto; }
/* the Filed forms screen [O 2026-10-02] (docs/17): the same row as a document, the status under the site and date, the
 * revise button on its own line; what is still on this phone heads the list in the tray's words */
.filed-head { font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.filed-list { display: flex; flex-direction: column; gap: 6px; }
.filed-row { display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: 10px 16px; margin: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.filed-row .filed-form { color: var(--brand); } .filed-row .filed-mark { color: var(--ink); font-weight: 700; }
.filed-row .opt-label { font-size: 18px; font-weight: 500; }
.filed-row .filed-status { font-size: 15px; }
.filed-row[data-status=returned] .filed-status, .filed-row[data-status=stuck] .filed-status { color: var(--bad); font-weight: 500; }
.filed-row[data-status=superseded], .filed-row[data-status=void] { color: var(--muted); border-style: dashed; background: transparent; }
.filed-row .filed-revise { margin-top: 8px; align-self: flex-start; min-height: 44px; padding: 0 16px; background: var(--paper); border: 1px solid var(--ink); color: var(--ink); font-size: 12px; letter-spacing: .12em; }
.filed-row .filed-revise:hover { background: var(--fill); }
.filed-row .filed-why { margin: 4px 0 0; }
.filed-queued { border-style: dashed; }
.filed-actions .secondary { flex: 1 1 auto; }
/* the revision's line on the review and the Sent screen, and a carried photo's caption on the form */
.revise-note { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--fill); }
.revise-note strong { display: block; margin-bottom: 4px; } .revise-note p { margin: 0; font-size: 15px; }
.photo-carried { color: var(--muted); }
/* the PIN: one wide field with a bar per digit under it */
.pin-field input { height: 64px; font-size: 32px; letter-spacing: .4em; text-align: left; }
.pin-bars { display: flex; gap: 6px; margin-top: 14px; }
.pin-bars span { height: 4px; flex: 1 1 auto; background: var(--line); transition: background .2s; }
.pin-bars span.on { background: var(--brand); }
/* self-serve PIN: the quiet way out of the sign-in screen, and the set-PIN page (docs/08) */
.self-serve { margin: 18px 0 0; }
.self-serve .link { padding-left: 0; text-align: left; }
a.primary, a.secondary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.primary, a.primary:hover { color: var(--on-brand); }
.setpin-page .pin-field + .pin-field { margin-top: -4px; }
/* the job site: one row per site, the number left, the name beside it */
.jobs { display: flex; flex-direction: column; gap: 6px; }
.jobs .opt { min-height: 56px; padding: 10px 16px; margin: 0; }
.job-code { flex: 0 0 auto; font-size: 13px; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
.job-name { font-size: 18px; font-weight: 500; }
.jobs .opt.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- tray ---------- */
.tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--paper); border-top: 1px solid var(--ink); box-shadow: none;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); max-height: 45vh; overflow-y: auto; }
body:has(nav.actions) .tray { bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: 12px; }
.tray-head > strong { color: var(--ink); }
.tray-list { list-style: none; margin: 8px 0 0; padding: 0; }
.tray-item { display: grid; grid-template-columns: 1fr auto; gap: 0 .6rem; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.tray-item .tray-title { font-weight: 500; grid-column: 1; } .tray-item .tray-status { grid-column: 1; color: var(--muted); font-size: 16px; }
.tray-item .progress { grid-column: 1 / -1; } .tray-item .link { grid-column: 2; grid-row: 1 / span 2; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--brand); }
.tray-item[data-status=stuck] .tray-status { color: var(--bad); font-weight: 500; }

/* ---------- sign-off page extras ---------- */
.signoff-eyebrow { display: block; color: var(--brand); margin: 0 0 6px; }
.flag-list { list-style: none; padding: 0; margin: 8px 0; } .flag-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.pill { display: inline-block; border-radius: 0; padding: 3px 6px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #fff; }
.sev-high { background: var(--ink); } .sev-medium { background: var(--brand); } .sev-low { background: var(--muted); }
.flag-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .flag-actions textarea { flex-basis: 100%; }
.flag-actions .secondary { flex: 1 1 45%; height: 44px; min-height: 44px; background: var(--paper); border: 1px solid var(--ink); color: var(--ink); font-size: 12px; letter-spacing: .12em; }
.flag-actions .secondary:hover { background: var(--fill); }

/* the foreman's page: the signature block is a section of a longer page, not a screen of its own */
.signoff-page .screen.sign > h2 { font-size: 12px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; margin-bottom: 10px; }
.signoff-page .screen.sign.done > h2 { font-size: 36px; letter-spacing: 0; text-transform: none; line-height: 1.05; }
.signoff-page .screen.sign { margin-top: 22px; }

/* attest-all [O 2026-09-16b]: each hazard's controls open on the card with one tick that they were reviewed
 * [O 2026-10-15]; one question at the end; "no" ticks what is NOT in place */
.hz-review { margin: 0 0 12px; }
.hz-review .hz-read-list { margin: 4px 0 10px; }
.hz-reviewed .opt { margin: 0; }
.hz-all { margin-top: 16px; padding-top: 12px; border-top: 1px solid #d9d9d9; }
.hz-nip { margin-top: 10px; }
.hz-nip-hazard { margin: 10px 0; }
.hz-nip-title { font-weight: 600; margin-bottom: 4px; }
.hz-nip .ticks .opt.on { border-color: #a11; }
.hz-nip .ticks .opt.on .tick { color: #a11; }
.hz-details { margin-top: 8px; }
.hz-details label { display: block; font-weight: 600; margin-bottom: 4px; }
.hz-details textarea { width: 100%; box-sizing: border-box; }
.hz-nip-note { color: #a11; margin: 4px 0 0; }

/* the preview's Sent screen and the foreman's preview page */
.prototype-next { margin: 16px 0; padding: 12px 14px; border: 1px solid #d9d9d9; border-radius: 8px; background: #fff; }
.prototype-next ol { margin: 6px 0 0; padding-left: 20px; } .prototype-next li { margin: 4px 0; }
.button-link { display: inline-block; padding: 10px 14px; border: 1px solid #111; border-radius: 6px; text-decoration: none; color: #111; font-weight: 600; }
.preview-banner { border-bottom: 1px solid #d9d9d9; margin-bottom: 8px; }
.notice-card { margin: 8px 0; padding: 10px 12px; border-left: 3px solid #a11; background: #fbeeee; border-radius: 4px; }
.notice-card strong { display: block; margin-bottom: 4px; } .notice-card p { margin: 0; }

/* ---------- sign-in, registration and the site screen (2026-09-29) ---------- */
/* docs/08 §7. The same tokens as everything above: no new colour, no new face. */
input[type=tel] { width: 100%; min-height: 56px; padding: 0 14px; font: inherit; font-size: 18px; color: var(--ink); background: var(--fill);
  border: 1px solid var(--ink); border-radius: 0; }
.identify .self-serve + .self-serve { margin-top: 0; }
.register .type-segmented .field { margin-top: 10px; }
/* the site screen: the jobs list the form already uses, one tap each */
.site .site-list { margin-top: 8px; }
/* the picker's "Site: … · Change" line, sitting over the who-line */
.site-line { font-size: 15px; color: var(--muted); margin: 0 0 4px; }
.site-line strong { color: var(--ink); font-weight: 600; }
.site-line .link, .change-site .link { padding: .5rem 0; color: var(--brand); font-size: 14px; text-transform: none; letter-spacing: 0; }
.change-site { margin: 6px 0 0; }
/* the form's job control once the site is chosen: shown, not a choice (no pointer, no hover) */
.site-chosen { cursor: default; background: var(--ink); border-color: var(--ink); color: #fff; }
.site-chosen:hover { border-color: var(--ink); }
.site-chosen .job-code { color: inherit; }

/* ---------- the foreman's side, gamified [O 2026-09-18b] ----------
 * The sign-off page opens on a faint red ground while the card waits on the foreman; the moment it is signed off the ground
 * turns a faint green and a large green box with a check mark says so. The foreman's home uses the same two tints for the
 * day's cards: red while any are waiting, green once every one is signed off. */
:root { --wait-ground: #FAF1EF; --done-ground: #EEF6EE; --done-fill: #D9EFD6; --done-ink: #1B6E2A; --wait-ink: #B12A2D; }
body.signoff-page[data-state="awaiting"], body.foreman-page[data-state="awaiting"] { background: var(--wait-ground); }
body.signoff-page[data-state="signed"], body.foreman-page[data-state="signed"] { background: var(--done-ground); }
.done-box { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; margin: 18px 0 0; padding: 20px 18px;
  background: var(--done-fill); border: 2px solid var(--done-ink); }
.done-box .check { width: 56px; height: 56px; border-radius: 50%; background: var(--done-ink); color: #fff; font-size: 34px; font-weight: 700; line-height: 56px; text-align: center; }
.done-box h2 { margin: 0; font-size: 32px; line-height: 1.05; color: var(--done-ink); letter-spacing: 0; text-transform: none; }
.done-box p { margin: 4px 0 0; } .done-box p.small { font-size: 15px; }
.signoff-page .screen.sign.done.signed { margin-top: 0; }
.signoff-page .back-to-main { margin: 18px 0 0; }
/* the foreman's home: the roll call (tap a name: Working ↔ Off), then the day's cards with a state per name */
.foreman-page .screen + .screen { margin-top: 26px; }
.foreman-site .eyebrow { display: block; color: var(--brand); margin: 0 0 4px; }
.foreman-site h3 { margin: 16px 0 6px; font-size: 20px; }
.roll { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.roll .opt { min-height: 56px; padding: 10px 14px; margin: 0; }
.roll .opt .opt-text { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 10px; }
.roll .opt .opt-label { font-size: 18px; font-weight: 500; } .roll .opt .opt-help { text-align: right; font-size: 14px; }
.roll .opt:not(.on) { color: var(--muted); } .roll .opt:not(.on) .opt-label { text-decoration: line-through; text-decoration-thickness: 1px; }
.roll-count { margin: 10px 0 0; }
.state-chip { display: inline-block; flex: 0 0 auto; padding: 4px 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #fff; background: var(--muted); white-space: nowrap; }
.state-chip[data-state="working"] { background: var(--ink); } .state-chip[data-state="off"] { background: var(--line); color: var(--muted); }
.state-chip[data-state="waiting"] { background: var(--muted); }
.state-chip[data-state="in"], .state-chip[data-state="flagged"] { background: var(--wait-ink); }
.state-chip[data-state="signed"] { background: var(--done-ink); } .state-chip[data-state="returned"] { background: var(--ink); }
.cards-block { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--paper); }
.cards-block[data-state="waiting"], .cards-block[data-state="part"] { background: var(--wait-ground); border-color: #E8C9C6; }
.cards-block[data-state="done"] { background: var(--done-ground); border-color: var(--done-ink); }
.cards-block h3 { margin-top: 0; }
.progress-line { margin: 0 0 8px; font-size: 17px; }
.bar { height: 8px; background: var(--track); overflow: hidden; margin: 0 0 12px; }
.bar > span { display: block; height: 100%; background: var(--wait-ink); transition: width .4s; }
.cards-block[data-state="done"] .bar > span { background: var(--done-ink); }
.card-rows { list-style: none; margin: 0; padding: 0; }
.card-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.card-rows li:first-child { border-top: 0; }
.card-rows .card-name { flex: 1 1 auto; font-size: 18px; font-weight: 500; }
.card-rows li[data-state="signed"] .card-name { color: var(--done-ink); }
.card-rows .signoff-link { flex-basis: 100%; text-align: center; border-color: var(--wait-ink); color: var(--wait-ink); }
.checked-line { margin: 0 0 10px; } .checked-line .link { padding: 0; min-height: 0; font-size: 15px; color: var(--brand); text-transform: none; letter-spacing: 0; }
/* a foreman may run several sites, each with its own buttons: on this page the action bar sits in the flow, not fixed to the bottom */
.foreman-page nav.actions { position: static; margin: 14px 0 0; padding: 0; border: 0; background: none; box-shadow: none; }
body.foreman-page { padding-bottom: 32px; }

/* ---------- the fall protection plan per site [O 2026-10-15] (docs/22 C6) ----------
 * The worker's line sits under the site's button and under the picker's site line — a link to the plan when one is on file [O 2026-10-16], else plain text: no colour of its own, nothing that
 * warns or counts down. The foreman's block sits under the muster line: the line, then Open · Upload a new plan · Mark as reviewed. */
.site-list .opt { flex-wrap: wrap; row-gap: 2px; }
.job-fpp { flex: 1 0 100%; font-size: 14px; font-weight: 400; color: var(--muted); }
.site-fpp { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
/* since 2026-10-16 (PLAN K36) the worker's line sits under the site's button and, on the site screen and the picker, opens the plan
 * on file: a whole tap target, as the problem links are */
.site-row .job-fpp, .site-fpp .job-fpp { display: inline-block; min-height: 44px; padding: 10px 0; }
/* a site outside the live test [O 2026-10-28] (docs/25 §2): greyed, not tappable, one line under it */
.jobs .opt.off, .jobs .opt.off:hover { color: var(--muted); border-color: var(--line); background: var(--paper); cursor: not-allowed; opacity: .55; }
.jobs .opt.off .job-code, .jobs .opt.off .job-name { color: var(--muted); }
.site-off-line { opacity: .8; }
.fpp { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); }
.fpp-line { margin: 0 0 10px; font-size: 16px; }
.fpp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fpp-actions .secondary, .fpp-actions .button-link { flex: 1 1 auto; margin: 0; }
/* the Documents screen in two tiers (docs/25 §4): a heading per tier; the line when the list could not be refreshed */
.doc-tier { margin: 0 0 18px; }
.doc-tier-title { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 14px 0 8px; }
.doc-stale { font-size: 15px; }
/* the foreman's roll call before the day's check-in [O 2026-10-29]: the cards filed so far wait behind the check-in, and the page says so */
.checkin-notice { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--fill); font-size: 16px; }
/* the team's filed forms (docs/26 §2): the period and the sort as segmented choices; the figures as plain lines */
.team-seg { margin: 6px 0 10px; }
.team-compliance { font-size: 18px; margin: 10px 0 4px; }
.team-people td, .team-people th { padding: 6px 10px; }
.team-card .button-link { margin-top: 6px; }
/* the documents a foreman keeps updated (docs/26 §3) */
.keep-block { margin: 0 0 18px; }
.keep-row { flex-wrap: wrap; }
.keep-actions { display: flex; gap: 8px; align-items: center; flex: 1 0 100%; margin-top: 6px; }
.keep-actions input[type=file] { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.keep-msg { flex: 1 0 100%; margin: 4px 0 0; }
