/* Axxys brand (axxysconstruction.com theme): navy #0A2240, blue #009ADE / #0F99D6 / #0075A9, Montserrat, square corners,
   uppercase tracked labels. Fonts are served from /static/fonts (no outside call). Status colours stay the app's own. */
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("/static/fonts/montserrat-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/static/fonts/montserrat-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("/static/fonts/montserrat-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/static/fonts/montserrat-latin-700.woff2") format("woff2"); }
:root {
  --navy: #0A2240; --navy-2: #002D74; --blue: #009ADE; --blue-2: #0F99D6; --blue-dark: #0075A9;
  --bg: #f2f3f4; --panel: #ffffff; --ink: #0A2240; --muted: #5a6678; --line: #e0e0e0; --accent: #0075A9;
  --pass: #1d7a45; --pass-bg: #e5f4ea; --fail: #b3261e; --fail-bg: #fbe7e5; --review: #8a5a00; --review-bg: #fdf1d8;
  --flag: #6a3fb5; --flag-bg: #efe8fa; --info: #2e5f80; --info-bg: #e6f1f8;
  --radius: 2px;
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; letter-spacing: .01em;
  min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: .02em; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; letter-spacing: .02em; }
h3 { font-size: 14px; margin: 0; }
.lede { max-width: 760px; }

/* Header: navy bar with the white Axxys logo, uppercase tracked nav, blue underline on the active tab */
.topbar { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 0 28px; min-height: 68px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; padding: 10px 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand span { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; border-left: 1px solid rgba(255,255,255,.35); padding-left: 14px; line-height: 1.3; }
.mainnav { display: flex; gap: 6px; flex: 1; align-self: stretch; }
.mainnav a { display: flex; align-items: center; color: #fff; text-decoration: none; padding: 0 12px; font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; border-bottom: 3px solid transparent; border-top: 3px solid transparent; opacity: .85; }
.mainnav a:hover { opacity: 1; }
.mainnav a.on { opacity: 1; border-bottom-color: var(--blue); }
.topright { display: flex; gap: 14px; align-items: center; padding: 10px 0; }
.topright label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.topright input { padding: 4px 8px; font-size: 12px; width: 130px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); color: #fff; letter-spacing: .02em; text-transform: none; }
.topright input::placeholder { color: rgba(255,255,255,.6); }
.lang { display: flex; }
.lang button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .1em; border-radius: 0; }
.lang button + button { border-left: 0; }
.lang button.on { background: #fff; color: var(--navy); }

/* Buttons: square, uppercase, tracked. Primary = solid navy that turns to a navy outline on hover (as on the site). */
button, a.button { font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  display: inline-block; text-decoration: none; padding: 8px 16px; border-radius: var(--radius);
  background: #fff; color: var(--navy); border: 1px solid var(--navy); transition: background .25s ease, color .25s ease; }
button:hover, a.button:hover { background: var(--navy); color: #fff; }
button.primary, a.button.primary { background: var(--navy); color: #fff; border-color: var(--navy); padding: 11px 24px; }
button.primary:hover, a.button.primary:hover { background: transparent; color: var(--navy); }
button:disabled, button:disabled:hover { opacity: .55; cursor: default; background: #fff; color: var(--navy); }
button.primary:disabled { background: var(--navy); color: #fff; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; font-size: inherit; font-weight: 500;
  letter-spacing: normal; text-transform: none; }
button.link:hover { background: none; color: var(--navy); }
button.danger { background: #fff; color: var(--fail); border-color: var(--fail); }
button.danger:hover { background: var(--fail); color: #fff; }

.foot { text-align: center; color: var(--muted); font-size: 10px; padding: 22px 16px; letter-spacing: .08em; text-transform: uppercase;
  border-top: 1px solid var(--line); background: #fff; }
.foot img { height: 22px; vertical-align: middle; margin-right: 10px; }
a { color: var(--accent); }
.tag { font-size: 12px; opacity: .75; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.lede, .muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.span2 { grid-column: span 2; }
@media (max-width: 640px) { .span2 { grid-column: span 1; } }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12px; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; letter-spacing: normal; padding: 7px 9px; border: 1px solid #c7ccd3; border-radius: var(--radius); background: #fff; width: 100%; color: var(--ink); }
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
label.check input { width: auto; }
.drop { border: 2px dashed #b9c3cf; border-radius: var(--radius); background: #fafbfc; padding: 22px; text-align: center; cursor: pointer; font-weight: 400; }
.drop input { display: none; }
.sample-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 12px; }
details { margin: 10px 0; }
summary { cursor: pointer; }
button { font: inherit; cursor: pointer; }
.banner { background: var(--review-bg); color: #5c3d00; border-radius: var(--radius); padding: 9px 12px; margin: 8px 0; }
.banner.error { background: var(--fail-bg); color: var(--fail); }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.overall { font-weight: 700; font-size: 15px; padding: 9px 18px; border-radius: var(--radius); text-transform: uppercase; letter-spacing: .1em; }
.summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.page-nav { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; }
.page-nav .button { padding: 6px 12px; font-size: 12px; }
.sub-picker { align-items: center; }
.sub-picker-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-right: 4px; }
.summary-item.on { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--blue); }
.summary-item { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; text-decoration: none; color: var(--ink); }
.trade-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.trade-head h2 { margin: 0; }
.doc { margin: 14px 0 18px; }
.doc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.thumb { width: 54px; border: 1px solid var(--line); }
.doc-title { font-weight: 600; }
.badge { display: inline-block; background: var(--info-bg); color: var(--info); border-radius: var(--radius); padding: 0 7px; font-size: 12px; }
.badge.warn { background: var(--review-bg); color: var(--review); }
.checks { width: 100%; border-collapse: collapse; }
.checks th { text-align: left; font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.checks td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.checks td.req { width: 28%; }
.checks td.expected { width: 20%; color: var(--muted); }
.checks td.status { width: 92px; text-align: right; white-space: nowrap; }
.req-label { font-weight: 600; }
.cite { font-size: 12px; color: var(--muted); margin-top: 2px; }
.detail { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hint { font-size: 13px; margin-top: 3px; }
.conf { font-size: 11px; color: var(--muted); }
.evidence img { max-width: 100%; border: 1px solid var(--line); border-radius: 4px; margin-top: 6px; }
.chip { display: inline-block; border-radius: var(--radius); padding: 2px 9px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.s-pass { background: var(--pass-bg); color: var(--pass); }
.s-fail { background: var(--fail-bg); color: var(--fail); }
.s-review { background: var(--review-bg); color: var(--review); }
.s-flag { background: var(--flag-bg); color: var(--flag); }
.s-info { background: var(--info-bg); color: var(--info); }
.kv { font-size: 12px; border-collapse: collapse; width: 100%; }
.kv td { padding: 3px 6px; border-bottom: 1px solid var(--line); }
.email textarea { font-family: inherit; font-size: 13px; line-height: 1.45; margin-top: 8px; }
.email-to { margin-top: 8px; }
.email-addr { font-weight: 600; }
.row-inline { margin-top: 8px; }
.advanced { margin-top: 4px; }
.small { font-size: 12px; }

/* New review */
.seg { display: flex; gap: 18px; margin-bottom: 12px; }
.mode { margin-top: 4px; }
.grid.narrow { grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); margin-top: 12px; }
fieldset.regions { border: 0; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
fieldset.regions legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
fieldset.regions legend small { font-weight: 400; color: var(--muted); }
.region-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; font-weight: 400; position: relative; }
.region-card input { position: absolute; top: 12px; right: 12px; width: auto; }
.region-card .region-name { font-weight: 700; font-size: 15px; }
.region-card:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--blue); }
.req-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px 20px; }
.req-section h3 { margin: 10px 0 4px; }

/* Result */
.result-head h1 a { color: inherit; text-decoration: none; }
.cert-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 8px; }
.cert-head .cert-title { flex: 1; }
.cert-head h2 { margin: 0 0 2px; }
.banner.warn { background: var(--flag-bg); color: var(--flag); }
.banner.info { background: var(--info-bg); color: var(--info); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.banner.info button { margin-left: auto; }
.section { margin: 14px 0 6px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #f2f3f4; border-left: 3px solid var(--navy); padding: 7px 10px; }
.section-head h3 { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 700; }
.section-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mini { border-radius: var(--radius); padding: 0 8px; font-size: 11px; font-weight: 700; }
.chip.s-na { background: #eceff3; color: var(--muted); }
.na-note { color: var(--muted); padding: 8px 10px; font-style: italic; }
form.inline { display: inline; }
.verdicts { margin: 8px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cert-actions { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.followup-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.followup-form select, .followup-form input { width: auto; padding: 4px 6px; }
.followup-form input[name=note] { min-width: 220px; }
.followup-form.stack { flex-direction: column; align-items: stretch; margin-top: 6px; }
.email-lang { display: flex; gap: 14px; margin-top: 6px; }

/* Tracker and insurers */
.filters { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.filters label { flex-direction: row; align-items: center; gap: 8px; }
.filters select, .filters input[type=search] { width: auto; min-width: 260px; }
.tracker td { vertical-align: top; }
details.fu { margin: 0; min-width: 220px; }
.history { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
table.insurers td { font-size: 13px; }

/* Side-by-side document */
.wrap.wide { max-width: 1560px; }
.cert-head-tools { display: flex; gap: 12px; align-items: center; }
.cert-body.split { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: 18px; align-items: start; }
.cert-body.split.collapsed, .cert-body:not(.split) { display: block; }
.cert-body.collapsed .docview { display: none; }
.docview { position: sticky; top: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #eef1f5; margin-top: 14px; }
.docview-tools { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #fff; flex-wrap: wrap; }
.docview-tools button { border: 1px solid #c7ccd3; background: #fff; color: var(--navy); border-radius: var(--radius); width: 28px; height: 26px; padding: 0; letter-spacing: 0; }
.docview-tools label { font-size: 12px; }
.docview-hint { margin-left: auto; }
.docview-scroll { position: relative; overflow: auto; max-height: calc(100vh - 60px); padding: 8px; }
.pages { width: 100%; }
.pg { position: relative; width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); margin-bottom: 10px; }
.pg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg .hl, .pg .mark { position: absolute; border: 2px solid var(--accent); border-radius: 2px; pointer-events: none; }
.pg .hl { box-shadow: 0 0 0 9999px rgba(20, 30, 50, .18); z-index: 3; }
.pg .hl::before { content: attr(data-label); position: absolute; bottom: 100%; left: -2px; margin-bottom: 2px; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.pg .hl.s-pass { border-color: var(--pass); background: rgba(29,122,69,.08); }
.pg .hl.s-fail { border-color: var(--fail); background: rgba(179,38,30,.08); }
.pg .hl.s-review { border-color: #c98a00; background: rgba(201,138,0,.1); }
.pg .hl.s-flag { border-color: var(--flag); background: rgba(106,63,181,.08); }
.pg .hl.area { border: 2px dashed var(--review); background: rgba(201,138,0,.06); }
.pg .mark { border-width: 1.5px; pointer-events: auto; cursor: pointer; z-index: 2; }
/* "Show every value read": a coloured outline with a faint tint, so the printed text stays readable underneath
   (the generic .s-* chip classes would otherwise paint an opaque background). */
.pg .mark { background: transparent; }
.pg .mark:hover { background: rgba(0, 154, 222, .10); }
.pg .mark.s-pass { border-color: var(--pass); background: rgba(29,122,69,.06); }
.pg .mark.s-fail { border-color: var(--fail); background: rgba(179,38,30,.07); }
.pg .mark.s-review { border-color: #c98a00; background: rgba(201,138,0,.08); }
.pg .mark.s-flag { border-color: var(--flag); background: rgba(106,63,181,.07); }
.pg .mark.s-info { border-color: var(--info); background: rgba(46,95,128,.06); }
.cert-body.split:not(.collapsed) tr.locatable { cursor: pointer; }
.cert-body.split:not(.collapsed) tr.locatable:hover td { background: #f1f8fc; }
tr.pinned td { background: #e3f2fa !important; }
.cert-body.split:not(.collapsed) .evidence-btn + .evidence { display: none; }
@media (max-width: 999px) { .cert-body.split { display: block; } .docview { display: none; } }

/* "Only what is not a pass" filter on the result page */
.row-filter { display: flex; gap: 14px; align-items: center; margin: 10px 0 0; }
.filter-note { font-size: 12px; margin: 4px 0; }
body.only-issues .when-all, body:not(.only-issues) .when-issues { display: none; }
body.only-issues tr.row-pass, body.only-issues .section.all-pass { display: none; }

@media print {
  .docview { display: none !important; }
  .cert-body.split { display: block; }
  .topbar, .foot, button, .summary, .noprint, .followup-form, .email-actions, .step-actions, .step-more, .cert-more, .evidence-btn { display: none !important; }
  .card { border: 0; padding: 0; }
  body { background: #fff; font-size: 11px; }
  .cert { break-before: page; }
  .cert:first-of-type { break-before: auto; }
}

/* Next step (email first), then the review */
.next-step { border: 1px solid var(--line); border-top: 3px solid var(--blue); padding: 16px 18px; margin: 14px 0 18px; background: #f8fbfd; }
.step-title { margin: 0 0 8px; font-size: 11px; font-weight: 700; color: var(--blue-dark); text-transform: uppercase; letter-spacing: .16em; }
.step-lead { margin: 0 0 8px; font-size: 15px; }
.step-latest { margin: 0 0 8px; }
.email-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: baseline; }
.email-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.step-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.step-note summary, .step-more summary, .cert-more summary { cursor: pointer; color: var(--accent); }
.step-note form { margin-top: 6px; }
.activity-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 4px; }
.activity-pick select { max-width: 100%; }
.activity-section { margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--accent); border-left-width: 4px;
  border-radius: 6px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.activity-section select { font-size: 1rem; padding: 4px 6px; }
.activity-dialog { max-width: min(560px, calc(100vw - 32px)); border: 1px solid var(--line, #ccc); border-radius: 10px; padding: 18px 20px; }
.activity-dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.activity-dialog h3 { margin-top: 0; }
.activity-dialog .activity-pick { flex-direction: column; align-items: stretch; }
.activity-dialog select { width: 100%; font-size: 1rem; padding: 6px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 4px; }
.step-more { margin-top: 10px; }
.review-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin: 6px 0; }
.review-head .split-toggle { margin-left: auto; }
.cert-more { margin-top: 14px; }

/* Admin */
.subnav, .tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.subnav a, .tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a.on, .tabs a.on { color: var(--navy); border-bottom-color: var(--blue); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--navy); padding: 14px 16px; }
.tile-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.tile-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.tile-sub { font-size: 11px; }
.sub-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sub-head h2 { margin: 0; }
.timings { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0; font-size: 13px; }
.timeline { list-style: none; padding: 0; margin: 8px 0 0; border-left: 2px solid var(--line); }
.timeline li { padding: 4px 0 4px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 8px; }
.ev { font-weight: 600; }
.ev-email_sent, .ev-renewal_requested { color: var(--accent); }
.ev-accepted { color: var(--pass); }
.ev-new_coi_received { color: var(--flag); }
.nowrap { white-space: nowrap; }
/* Admin requirements: one row per requirement, grouped by coverage in collapsible cards */
.stack-form { display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin-top: 8px; }
.stack-form button { align-self: flex-start; }
.req-toolbar { display: flex; gap: 16px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.req-toolbar input[type=search] { flex: 1 1 260px; max-width: 420px; }
.req-group { padding: 0; }
.req-group > summary { display: flex; align-items: baseline; gap: 14px; padding: 14px 18px; cursor: pointer; list-style: none; }
.req-group > summary::-webkit-details-marker { display: none; }
.req-group > summary::before { content: "+"; font-weight: 700; color: var(--blue); width: 12px; }
.req-group[open] > summary::before { content: "−"; }
.req-group > summary h2 { margin: 0; font-size: 15px; }
.req-group[open] > summary { border-bottom: 1px solid var(--line); }
.off-count { color: var(--fail); font-weight: 600; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req.dirty, .req:has(form.dirty) { background: #f4f9fd; }
.req-main { display: grid; grid-template-columns: 52px 1fr minmax(180px, 460px); gap: 14px; align-items: center; }
.req-label { font-weight: 600; }
.req-sub { margin-top: 2px; }
.req.req-off .req-label { color: var(--muted); text-decoration: line-through; }
.req-control { justify-self: end; width: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.req-shared { margin: 6px 0 0 66px; }
/* on/off switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; background: #c3c8cf; border-radius: 12px; transition: background .15s; }
.switch .slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--pass); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--blue); outline-offset: 2px; }
/* number box with unit */
.num-box { display: inline-flex; align-items: center; border: 1px solid var(--line); background: #fff; }
.num-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,154,222,.2); }
.num-box .unit { padding: 0 8px; color: var(--muted); font-weight: 600; }
.num-box input { border: 0; outline: 0; width: 130px; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; padding: 7px 8px; background: transparent; }
.wide-input { width: 100%; }
/* accepted names */
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--info-bg); color: var(--navy); border: 1px solid #cfe3f3; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: 13px; }
.pill .x { border: 0; background: none; padding: 0 2px; font-size: 15px; line-height: 1; color: var(--muted); cursor: pointer; min-height: 0; }
.pill .x:hover { color: var(--fail); }
.pill.static { background: #f2f3f4; border-color: var(--line); }
.chips-edit { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px; width: 100%; }
.chips-edit .chip-add { flex: 1 1 140px; min-width: 120px; font-size: 13px; }
/* save bar: shown only after a change */
.req-save { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0 66px; padding: 10px; background: #fff; border: 1px solid var(--blue); }
.req-save .save-what { font-weight: 600; }
.req-save input[name=reason] { flex: 1 1 240px; }
.req-how { margin: 6px 0 0 66px; }
.req-how > summary { cursor: pointer; color: var(--blue-dark); font-size: 13px; }
.how-body { padding: 8px 0 2px; font-size: 13px; max-width: 900px; }
.how-body p { margin: 4px 0 8px; }
.form-gap { border-left: 3px solid var(--flag); padding: 6px 10px; background: var(--flag-bg); margin: 8px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.seg-q { font-weight: 600; }
.seg label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.req-history > summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; }
.req-history > summary h2 { margin: 0; }
.badge.info { background: var(--info-bg); color: var(--info); }
.flash { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Phone width: 16px gutters, stacked header, tables scroll inside their card */
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 8px 16px; }
  .brand img { height: 32px; }
  .brand span { display: none; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .mainnav a { padding: 10px 10px; }
  .req { padding: 12px; }
  .req-main { grid-template-columns: 52px 1fr; }
  .req-control { grid-column: 1 / -1; align-items: stretch; }
  .req-save, .req-how, .req-shared { margin-left: 0; }
  .wrap { padding: 18px 16px 40px; }
  .card { padding: 16px 14px; overflow-x: auto; }
  .result-head { flex-direction: column; }
  .filters { flex-wrap: wrap; }
  .filters select, .filters input[type=search] { min-width: 0; width: 100%; }
}
.req-save[hidden] { display: none; }
.num-box, .seg label, .switch { flex-direction: row; margin: 0; }
.num-box { display: inline-flex; font-weight: 400; }
.seg label { display: inline-flex; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13px; }
.seg input[type=radio] { width: auto; margin: 0; }

/* Review page: key figures, then the email and the review as folds that are closed but obvious. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-top: 4px solid var(--line);
  background: var(--panel); color: var(--ink); text-decoration: none; }
a.kpi:hover { border-color: var(--navy); }
.kpi-n { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.kpi-s { font-size: 12px; color: var(--muted); }
.kpi.k-fail { border-top-color: var(--fail); } .kpi.k-fail .kpi-n { color: var(--fail); }
.kpi.k-review { border-top-color: #c98a00; } .kpi.k-review .kpi-n { color: var(--review); }
.kpi.k-flag { border-top-color: var(--flag); } .kpi.k-flag .kpi-n { color: var(--flag); }
.kpi.k-pass { border-top-color: var(--pass); } .kpi.k-pass .kpi-n { color: var(--pass); }
.kpi.k-na { border-top-color: var(--muted); }
.kpi.k-exp { border-top-color: var(--blue); }
.kpi.k-exp.expiring { border-top-color: #c98a00; background: var(--review-bg); }
.kpi.k-exp.expired { border-top-color: var(--fail); background: var(--fail-bg); } .kpi.k-exp.expired .kpi-n { color: var(--fail); }
.kpi.zero .kpi-n { color: var(--muted); }
.fold { margin: 12px 0; border: 1px solid var(--line); background: var(--panel); }
.fold > summary { list-style: none; display: flex; gap: 14px; align-items: center; padding: 14px 18px; cursor: pointer;
  border-left: 5px solid var(--blue); background: #f8fbfd; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: #eef6fb; }
.fold-email > summary { border-left-color: var(--navy); }
.fold-icon { font-size: 22px; color: var(--blue-dark); width: 28px; text-align: center; }
.fold-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fold-text strong { text-transform: uppercase; letter-spacing: .1em; font-size: 14px; }
.fold-sub { color: var(--muted); font-size: 13px; }
.fold-cue { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--blue-dark);
  border: 1px solid var(--blue-dark); padding: 5px 12px; white-space: nowrap; }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold .when-open, .fold[open] .when-closed { display: none; }
.fold[open] .when-open { display: inline; }
.fold > .email, .fold > .review-head, .fold > .cert-body { padding-left: 16px; padding-right: 16px; }
.fold > .email { padding-bottom: 14px; }
.fold > .cert-body { padding-bottom: 12px; }
.next-step .fold-email { margin-bottom: 0; }
@media (max-width: 640px) { .fold > summary { padding: 12px; gap: 10px; } .fold-icon { display: none; } .kpi-n { font-size: 22px; } }
@media print { .kpis a { pointer-events: none; } .fold > summary .fold-cue { display: none; } }

/* shown only on paper (e.g. a date that is an input on screen) */
.print-only { display: none; }
@media print { .print-only { display: inline; } }

/* project page: project end and owner side by side */
.head-fields { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-end; margin-top: 6px; }
.head-fields .owner-form { display: flex; align-items: flex-end; gap: 8px; }
.head-fields .owner-form label { margin: 0; }

/* sign-in (week 2) */
.topright .who { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.85); font-size: 12px; }
.topright .who button.link { color: #fff; font-size: 12px; }
.auth { max-width: 440px; margin: 40px auto; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .links { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-top: 8px; }
.auth-link { word-break: break-all; font-family: monospace; font-size: 12px; background: var(--panel); padding: 8px; border: 1px solid var(--line); }
.users-table form { display: inline; }
.users-table select { width: auto; }
