/* ComplySet MVP: brand tokens from the ComplySet design system. */
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url(/fonts/archivo-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url(/fonts/archivo-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --surface: #F2F4F5; --raised: #FFFFFF; --line: #DADFE2; --line-strong: #7B858C;
  --ink: #121417; --muted: #59636A;
  --signal: #F2520F; --on-signal: #121417; --signal-text: #C2410C;
  --blueprint: #1849C6; --blueprint-soft: #E3EAFC; --deep: #0B2545; --grid: #1E4270;
  --ok: #0F7B4B; --ok-soft: #DFF3E8; --due: #8A5300; --due-soft: #FBF0D5; --over: #C0261A; --over-soft: #FCE7E4;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-sm: 4px; --r-md: 8px; --r-lg: 16px;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--blueprint);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/24px var(--body); min-height: 100vh; }
a { color: var(--blueprint); }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Header */
.bar { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.brand img { height: 32px; display: block; }
/* ComplySet: the full logo needs 160 px; narrower headers show the mark alone (brand book, Clear space and size) */
.brand .logo-mark { display: none; height: 32px; width: 32px; }
@media (max-width: 600px) { .brand .logo-full { display: none; } .brand .logo-mark { display: block; } }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { color: #fff; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); }
.icon-btn:focus-visible { outline: 2px solid #fff; }
button.icon-btn { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }

main { max-width: 760px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-left, 0px)) 64px; outline: none; }
.loading, .empty { color: var(--muted); }

/* Type */
h1 { font: 800 28px/34px var(--display); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h2 { font: 700 20px/26px var(--display); margin: 0; }
.label { font: 700 12px/16px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }

/* Buttons */
.btn { font: 700 16px/1 var(--body); min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--raised); color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .asset:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--blueprint); padding: 0 8px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.bar .btn-signal { min-height: 44px; padding: 0 16px; }

/* Status badges: always icon + word */
.status { display: inline-flex; align-items: center; gap: 4px; font: 700 12px/16px var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px 6px 6px; border-radius: var(--r-sm); white-space: nowrap; }
.status .i { width: 16px; height: 16px; stroke-width: 2.25; }
.status-in-date { background: var(--ok-soft); color: var(--ok); }
.status-due-soon { background: var(--due-soft); color: var(--due); }
.status-overdue { background: var(--over-soft); color: var(--over); }
.status-unknown { background: #E9ECEE; color: var(--muted); }

/* Summary + list */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary button { font: inherit; text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; cursor: pointer; color: var(--ink); }
.summary button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.summary b { display: block; font: 800 28px/32px var(--display); font-variant-numeric: tabular-nums; }
.search { width: 100%; }
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.asset { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; text-decoration: none; color: inherit; min-height: 72px; }
.asset:hover { border-color: var(--line-strong); }
.asset-name { font: 700 17px/22px var(--display); }
.asset-meta { font-size: 14px; line-height: 20px; color: var(--muted); }
.asset-right { display: grid; justify-items: end; gap: 4px; text-align: right; }

/* Cards */
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.next { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.next b { display: block; font: 800 22px/28px var(--display); }
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; margin: 0; }
.details dt { font: 700 12px/16px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.details dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Trail */
.trail { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.trail > li { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; }
.trail > li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: -22px; width: 2px; background: var(--line-strong); }
.trail > li:last-child::before { display: none; }
.node { width: 12px; height: 12px; margin: 6px 0 0 4px; border-radius: 50%; background: var(--raised); border: 2.5px solid var(--ink); position: relative; z-index: 1; }
.trail > li:first-child .node { width: 20px; height: 20px; margin: 2px 0 0; background: var(--signal); border: 0; }
.rec-title { font: 700 17px/24px var(--display); margin: 0; }
.rec-meta { font-size: 14px; line-height: 20px; color: var(--muted); margin: 2px 0 0; }
.rec-notes { margin: 6px 0 0; white-space: pre-wrap; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file { font: 500 13px/1 var(--mono); padding: 8px 10px; border-radius: var(--r-sm); background: var(--blueprint-soft); color: var(--blueprint); border: 0; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Forms */
form.stack { gap: 14px; }
label.field { display: grid; gap: 6px; font-weight: 700; }
label.field small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 16px/24px var(--body); color: var(--ink); background: var(--raised); border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 12px; width: 100%; min-height: 48px; }
textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } .summary b { font-size: 24px; } }
.error { background: var(--over-soft); color: var(--over); border-radius: var(--r-md); padding: 12px 14px; font-weight: 700; }
.note { background: var(--blueprint-soft); border-radius: var(--r-md); padding: 12px 14px; }

/* Scanner */
.scanner { position: relative; background: var(--deep); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3 / 4; max-height: 70vh; width: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 18% 14%; }
.scanner .frame i { position: absolute; width: 44px; height: 44px; border: 6px solid #fff; }
.scanner .frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.scanner .frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.scanner .frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.scanner .frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; border-color: var(--signal); }
#cam { display: grid; gap: 10px; }
#cam > .btn { justify-self: start; }
.notice { background: var(--due-soft); color: var(--ink); border-left: 4px solid var(--due); border-radius: var(--r-md); padding: 12px 14px; margin: 0; }
.manual-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; }
.manual-row input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--body); }

/* Printed tag: 50 x 30 mm */
.tag-sheet { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tag { width: 50mm; height: 30mm; background: #fff; color: #121417; border: 1px solid var(--line); border-radius: 3mm; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 22mm 1fr; gap: 2.5mm; padding: 3mm; align-items: center; }
.tag .qr svg { width: 22mm; height: 22mm; display: block; }
.tag-info { display: grid; gap: 1.2mm; align-content: center; min-width: 0; }
/* a 50 x 30 mm label is too small for the full logo: the mark and the web address instead */
.tag-brand { display: flex; align-items: center; gap: 1.2mm; }
.tag-brand img { width: 4.8mm; height: 4.8mm; flex: none; }
.tag-brand span { font: 500 5.4pt/1 var(--mono); letter-spacing: .01em; white-space: nowrap; }
.tag-cta { font: 800 6pt/1.1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.tag-id { font: 500 9.5pt/1 var(--mono); }
@media print {
  .bar, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .tag { border: 0.2mm solid #ccc; }
}

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: var(--r-md); font-weight: 700; z-index: 20; max-width: calc(100% - 32px); }

/* Section tabs */
.tabs { position: sticky; top: var(--bar-h, calc(64px + env(safe-area-inset-top, 0px))); z-index: 9; display: flex; gap: 4px; background: var(--raised); border-bottom: 1px solid var(--line);
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); overflow-x: auto; }
.tabs a { font: 700 15px/1 var(--body); color: var(--muted); text-decoration: none; padding: 14px 12px 12px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }

/* Filters */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .filters { grid-template-columns: 1fr; } }
.newname { margin-top: 6px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery a, .gallery .vid { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--deep); }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .vid video { object-fit: contain; background: #000; }
.gallery .pdf { display: flex; align-items: center; justify-content: center; color: #fff; font: 700 14px/1.2 var(--display); padding: 8px; text-align: center; }
.gallery .tagline { position: absolute; left: 6px; bottom: 6px; background: rgba(18,20,23,.75); color: #fff; font: 700 11px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; pointer-events: none; }

/* Registered location (website only) */
.map { width: 100%; height: 260px; border: 0; border-radius: var(--r-md); display: block; background: var(--line); }
.coords { font: 500 15px/22px var(--mono); }

/* Upload progress */
progress { width: 100%; height: 10px; accent-color: var(--signal); }

/* Blank tag sheets: A4, 4 x 9 labels of 50 x 30 mm */
.sheet { width: 210mm; height: 297mm; background: #fff; margin: 0 auto 16px; padding: 13.5mm 5mm; box-shadow: 0 2px 12px rgba(0,0,0,.12);
  display: grid; grid-template-columns: repeat(4, 50mm); grid-auto-rows: 30mm; transform-origin: top left; }
.sheet .tag { border: 0; border-radius: 0; outline: 0.2mm dashed #c9cfd3; outline-offset: -0.1mm; }
.sheet-wrap { overflow-x: auto; max-width: 100%; }
.tag-code { font: 500 7pt/1 var(--mono); letter-spacing: .02em; }
@media print {
  @page { size: A4; margin: 0; }
  .tabs { display: none !important; }
  .sheet { margin: 0; box-shadow: none; page-break-after: always; break-after: page; }
  .sheet-wrap { overflow: visible; }
}

[hidden] { display: none !important; }
h2.sub { font: 700 13px/18px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 -4px; padding-top: 12px; border-top: 1px solid var(--line); }
.field > span { font-weight: 700; }
div.field { display: grid; gap: 6px; }
fieldset.checks { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 10px 14px 12px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
fieldset.checks legend { font-weight: 700; padding: 0 4px; }
fieldset.checks label { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 400; }
fieldset.checks input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
input[disabled] { background: #E9ECEE; color: var(--muted); }


/* ---------- 0.4: packs, checks, contacts, accessibility ---------- */
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--signal); color: var(--on-signal); padding: 12px 16px; border-radius: var(--r-md); font-weight: 700; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.req { font-weight: 400; color: var(--muted); font-size: 14px; }
.warning { background: var(--due-soft); color: var(--due); border-radius: var(--r-md); padding: 12px 14px; font-weight: 700; }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 15px; }
a:focus-visible, summary:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: 4px; }
[aria-invalid="true"] { border-color: var(--over); box-shadow: 0 0 0 1px var(--over); }

/* Checks an asset needs */
.duties { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.duty { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.duty:first-child { border-top: 0; padding-top: 0; }
.duty-main { min-width: 0; flex: 1; }
.duty-name { font: 700 16px/22px var(--display); }
.fails { margin: 6px 0 0; padding-left: 20px; color: var(--over); font-weight: 700; }

/* Yes/no and choice controls: big targets for gloved hands */
label.check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 700; cursor: pointer; }
label.check input, fieldset.choice input, .choice-list input, .pack-opt input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--ink); margin: 0; }
div.field.yesno { align-content: start; }
div.field.yesno small { color: var(--muted); }
fieldset.choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.choice legend { font-weight: 700; margin-bottom: 6px; padding: 0; width: 100%; }
fieldset.choice label { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); cursor: pointer; font-weight: 700; }
fieldset.choice label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--blueprint-soft); }
fieldset.choice label:has(input[value="fail"]:checked) { background: var(--over-soft); border-color: var(--over); color: var(--over); }
fieldset.choice label:has(input:focus-visible) { box-shadow: var(--focus); }
.choice-list { display: grid; gap: 4px; }
.choice-list label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.cl-item { display: grid; gap: 4px; }
.auto { margin: 0; color: var(--muted); }
.feedback { margin: 0; min-height: 24px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.feedback.good { color: var(--ok); }
.feedback.bad { color: var(--over); }
.feedback .i { width: 18px; height: 18px; }
fieldset.failpanel { border: 2px solid var(--over); border-radius: var(--r-md); padding: 12px 14px 14px; margin: 0; background: var(--over-soft); }
fieldset.failpanel legend { font-weight: 700; color: var(--over); padding: 0 6px; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--blueprint); }
details.card > summary { color: var(--ink); }

/* Packs on the customer form */
fieldset.packs-pick { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 10px 14px 12px; margin: 0; display: grid; gap: 6px; }
fieldset.packs-pick legend { font-weight: 700; padding: 0 4px; }
.pack-opt { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.pack-opt input { margin-top: 3px; }
.pack-opt small { color: var(--muted); font-weight: 400; }
fieldset.prefs small { font-weight: 400; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .status, .feedback, .btn { border: 1px solid CanvasText; } }


/* ---------- 0.5: people, contractors, addresses, documents ---------- */
.chip { display: inline-block; font: 700 12px/16px var(--display); letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--blueprint-soft); color: var(--blueprint); margin: 2px 2px 2px 0; }
.days { font-weight: 700; color: var(--ink); }
.days.late { color: var(--over); }
.days-big { display: block; font: 700 15px/20px var(--body); color: var(--muted); margin-top: 2px; }
.days-big.late { color: var(--over); }
.days-hint { font-weight: 700; color: var(--muted); }
fieldset.address, fieldset.docbox { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 10px 14px 14px; margin: 0; display: grid; gap: 12px; }
fieldset.address legend, fieldset.docbox legend { font-weight: 700; padding: 0 4px; }
.lookup { flex-wrap: nowrap; align-items: end; }
@media (max-width: 420px) { .lookup { flex-wrap: wrap; } }
fieldset.roles { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 10px 14px 12px; margin: 0; display: grid; gap: 4px; }
fieldset.roles legend { font-weight: 700; padding: 0 4px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.role-opt input { width: 22px; height: 22px; min-height: 0; margin-top: 3px; accent-color: var(--ink); flex: none; }
.role-opt small { color: var(--muted); font-weight: 400; }
.newperson { border-left: 4px solid var(--blueprint); padding-left: 12px; display: grid; gap: 12px; margin-top: 8px; }
ul.plain { margin: 0; padding-left: 20px; }
.filters-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.linkish { background: none; border: 0; padding: 0; color: var(--blueprint); text-decoration: underline; font: inherit; cursor: pointer; min-height: 0; width: auto; }
.docview { display: grid; gap: 10px; justify-items: start; }
.pdf-frame { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.doc-img img { max-width: 100%; max-height: 420px; border-radius: var(--r-md); border: 1px solid var(--line); display: block; }
.same-addr { font-weight: 400; }

.banner { margin: 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--blueprint-soft); color: var(--ink); font-weight: 700; }
.replace-opt { font-weight: 400; align-items: flex-start; min-height: 0; padding-top: 10px; }
.replace-opt input { margin-top: 3px; }
ul.changes li { margin: 4px 0; }

/* ---------- 0.6: texts option, tasks, reports, exports ---------- */
body[data-sms="off"] .sms-opt { display: none; }
.late-text { color: var(--over); font-weight: 700; }
.due-text { color: var(--due); font-weight: 700; }
.chip-done { background: var(--ok-soft); color: var(--ok); }
.chip-due { background: var(--due-soft); color: var(--due); }
.chip-cancelled { background: var(--surface); color: var(--muted); }
.chip-waiting { background: var(--due-soft); color: var(--due); }
.banner-over { background: var(--over-soft); color: var(--over); }
ol.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ol.timeline li { border-left: 3px solid var(--blueprint); padding: 2px 0 2px 12px; }
ol.timeline li.sys { border-left-color: var(--line-strong); color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: grid; }
a.tile { color: var(--ink); text-decoration: none; }
a.tile:hover { border-color: var(--ink); }
a.tile:focus-visible { outline: none; box-shadow: var(--focus); }
.tile b { font: 800 24px/30px var(--display); }
.tile span { color: var(--muted); font-size: 14px; }
.tile.tone-overdue b, .tile.tone-escalated b { color: var(--over); }
.tile.tone-due-soon b { color: var(--due); }
.tile.tone-in-date b, .tile.tone-done b { color: var(--ok); }
.table-wrap { overflow-x: auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); }
.table-wrap:focus-visible { outline: none; box-shadow: var(--focus); }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; min-width: 760px; }
.report-table th { text-align: left; background: var(--ink); color: #fff; padding: 8px 10px; font: 700 13px/18px var(--body); position: sticky; top: 0; }
.report-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.report-table tbody tr:nth-child(even) td { background: var(--surface); }
.report-table .st-overdue { color: var(--over); font-weight: 700; }
.report-table .st-due-soon { color: var(--due); font-weight: 700; }
.report-table .st-in-date { color: var(--ok); font-weight: 700; }
@media print {
  .bar, .tabs, .no-print, #toast, .skip { display: none !important; }
  body { background: #fff; }
  main { padding: 0 !important; max-width: none !important; }
  .table-wrap { overflow: visible; border: 0; }
  .report-table { min-width: 0; font-size: 10px; line-height: 13px; }
  .report-table th { background: #121417 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; position: static; }
  .tile { border-color: #999; }
  @page { size: A4 landscape; margin: 12mm; }
}
.report, .report > * { min-width: 0; max-width: 100%; }
.report .filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.report .filters .field { min-width: 0; }
.report .filters select, .report .filters input { width: 100%; min-width: 0; }
.report-table td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 13px; }

/* ---------- 0.7: document reading ---------- */
.readbox { display: grid; gap: 6px; justify-items: start; }
.read-summary { background: var(--blueprint-soft); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 6px; }
.read-summary .warn li { color: var(--due); font-weight: 700; }
input.from-doc, select.from-doc { border-color: var(--blueprint); background: #F5F8FF; }
input.check-this, select.check-this { border-color: var(--due); background: var(--due-soft); }
.read-note { display: block; color: var(--blueprint); font-weight: 700; }

/* ---------- 0.7: contractor portal, welcome ---------- */
.narrow { max-width: 520px; }
.code-input { font: 700 28px/36px var(--mono); letter-spacing: .3em; max-width: 220px; }
.portal-badge { font: 700 12px/16px var(--display); letter-spacing: .06em; text-transform: uppercase; background: var(--signal); color: var(--on-signal); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
body.portal .tabs { background: var(--deep); }
body.portal .tabs a { color: #fff; }
body.portal .tabs a[aria-current="page"] { border-bottom-color: var(--signal); }
.doors { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.door { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); padding: 20px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.door b { font: 800 24px/30px var(--display); }
.door .label { margin-top: -6px; }
/* Buttons sit on the bottom edge of every card, so they line up whatever the text length. */
.door .btn { align-self: flex-start; margin-top: auto; }
.door > span:nth-of-type(2) { margin-bottom: 6px; }
/* The highlighted-card hover, shared with the marketing website: a dark edge and a soft lift. */
.door:hover { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 10px 24px rgba(18,20,23,.10); transform: translateY(-2px); }
.door:focus-visible { outline: none; box-shadow: var(--focus); }
.door-staff { background: var(--surface); border-style: dashed; }
.door-staff .label { color: var(--over); }
/* Staff only: the admin card lights up red, as a warning that it isn't for general use. */
.door-staff:hover { border-color: var(--over); border-style: solid; background: var(--over-soft); box-shadow: 0 0 0 1px var(--over), 0 10px 24px rgba(192,38,26,.16); }
.btn-danger { background: var(--over); border-color: var(--over); color: #fff; }
@media (prefers-reduced-motion: reduce) { .door, .door:hover { transition: none; transform: none; } }
.doc-img { display: inline-block; min-width: 44px; min-height: 44px; }
body.portal .bar { flex-wrap: nowrap; }
.portal-badge { font-size: 11px; padding: 3px 7px; }
@media (max-width: 480px) {
  /* keep the Scan button's name for screen readers, show just the icon */
  body.portal .bar .btn-signal span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.portal .bar .btn-signal { padding: 0 12px; }
}
/* 0.25: signed out, the header keeps the website-style menu and Help; Scan, Settings and Sign out need a session */
body.signed-out .bar-actions .btn-signal, body.signed-out #settingsBtn, body.signed-out #signOut { display: none; }
.tabs[data-public] a[href^="https://"]::after { content: " \2197"; font-weight: 400; }
@media (max-width: 480px) {
  .portal-badge { font-size: 10px; padding: 3px 6px; letter-spacing: .03em; }
  body.portal .bar { gap: 8px; }
  body.portal .bar-actions { gap: 4px; }
}

/* ---------- admin ---------- */
.admin-badge { font: 700 11px/16px var(--display); letter-spacing: .06em; text-transform: uppercase; background: #fff; color: var(--ink); padding: 3px 8px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.bar-tags { display: flex; align-items: center; gap: 6px; margin-right: auto; min-width: 0; }
.bar-tags:empty { display: none; }
.org-badge { font: 600 12px/16px var(--display); background: rgba(255,255,255,.14); color: #fff; padding: 3px 10px; border-radius: 999px; text-decoration: none; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-badge:hover, .org-badge:focus-visible { background: rgba(255,255,255,.24); }
/* 0.29: the administrator's email beside Admin portal, on white */
.org-badge.org-light { background: #fff; color: var(--ink); }
.org-badge.org-light:hover, .org-badge.org-light:focus-visible { background: #e9ebee; }
a.portal-badge { text-decoration: none; }
.cust-badge { font: 600 12px/16px var(--display); background: rgba(255,255,255,.14); color: #fff; padding: 3px 10px; border-radius: 999px; margin-right: auto; text-decoration: none; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-badge:hover, .cust-badge:focus-visible { background: rgba(255,255,255,.24); }
/* The admin portal's own address: a clear signal-orange edge so it's never mistaken for the customer app. */
.admin-site .bar { box-shadow: inset 0 -4px 0 var(--signal); }
.admin-site .bar-actions a[href="/scan"] { display: none; }
/* Asset licence (0.11) */
.licence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.licence div { background: var(--surface); border-radius: var(--r-md); padding: 8px 10px; }
.licence dt { font: 700 11px/14px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.licence dd { margin: 2px 0 0; font: 800 22px/1.1 var(--display); }
@media (max-width: 420px) { .licence { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tag-cust { font: 700 7.5pt/1.1 var(--display); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.report-table.compact { min-width: 0; }
.report-table tbody th { text-align: left; font: 700 14px/20px var(--body); background: transparent; color: var(--text); position: static; padding: 8px 10px; border-top: 1px solid var(--line); }
.report-table tbody tr:nth-child(even) th { background: var(--surface); }
/* 0.12: a pack document sits right under the tick box it depends on, full width. */
.grid2 > .packdoc, .grid2 > .person-pick:has(.new-person:not([hidden])) { grid-column: 1 / -1; }
.packdoc { margin: 0; }
.person-pick > label { font-weight: 700; }
/* 0.14 licence: running low / full, and Request more */
.licence-card.is-low { border-color: var(--due); }
.licence-card.is-full { border-color: var(--over); }
.licence-msg { color: var(--ink); }
.licence-card.is-full .licence-msg b { color: var(--over); }
.licence-card.is-low .licence-msg b { color: var(--due); }
.more-form { border-top: 1px solid var(--line); padding-top: 10px; }
/* 0.14 help, training and tips */
.tip { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; background: var(--blueprint-soft); border: 1px solid #B9C9F3; border-radius: var(--r-md); padding: 10px 6px 10px 12px; }
.tip p { margin: 2px 0 0; }
.tip-badge { font: 700 12px/20px var(--display); letter-spacing: .06em; text-transform: uppercase; background: var(--blueprint); color: #fff; border-radius: var(--r-sm); padding: 0 6px; margin-top: 2px; }
.tip-close { background: none; border: 0; font: 400 24px/1 var(--body); color: var(--ink); width: 44px; height: 44px; margin: -8px 0; cursor: pointer; border-radius: var(--r-md); }
.tip-close:focus-visible { outline: none; box-shadow: var(--focus); }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.steps li span { display: block; }
.how summary { cursor: pointer; font-weight: 700; padding: 2px 0; }
.how ol { margin: 10px 0 0; padding-left: 1.4em; display: grid; gap: 6px; }
.glossary { margin: 0; display: grid; gap: 8px; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; }
.meter { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--ok); }
.checks-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.checks-list li { display: flex; gap: 10px; align-items: center; min-height: 32px; }
.checks-list .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.checks-list .is-done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checks-list .is-done span:not(.tick) { color: var(--muted); text-decoration: line-through; }
@media (max-width: 420px) { .bar-actions .icon-btn { width: 40px; } .bar-actions { gap: 2px; } }
.how summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 32px; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; font: 700 22px/1 var(--display); color: var(--blueprint); }
.how[open] summary::after { content: "−"; }
/* Phones: the portal and organisation tags get their own row under the logo, so nothing overlaps. */
@media (max-width: 640px) {
  .bar, body.portal .bar { flex-wrap: wrap; row-gap: 0; }
  .bar-tags { order: 3; flex-basis: 100%; margin: 0 0 8px; }
  .org-badge { max-width: 62vw; }
}
/* One way to scan on every device (0.14): phones and tablets keep the orange Scan button in the header,
   which is the main action on site; computers (a precise pointer and a wide screen, usually no camera facing
   the kit) use the Scan a tag button on To do instead, where the code can also be typed in. */
.scan-desk { display: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .bar-actions .btn-signal { display: none; }
  .scan-desk { display: inline-flex; }
}
.filters.filters-1 { grid-template-columns: 1fr; }
/* 0.15 admin onboarding steps */
.onboard { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.onboard li { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; }
.onboard h2 { font-size: 20px; line-height: 26px; margin: 0; }
.onboard-n { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 800 20px/1 var(--display); }
.onboard li:first-child .onboard-n { background: var(--signal); color: var(--ink); }
@media (max-width: 520px) { .onboard li { grid-template-columns: 1fr; } }
/* 0.15 licence usage tags: green more than 10 left, amber 6 to 10, red 5 or fewer */
.lic { display: inline-flex; align-items: center; gap: 0; font: 700 13px/18px var(--body); padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.lic::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: currentColor; }
.lic-ok { color: var(--ok); background: var(--ok-soft); border-color: currentColor; }
.lic-low { color: var(--due); background: var(--due-soft); border-color: currentColor; }
.lic-tight { color: var(--over); background: var(--over-soft); border-color: currentColor; }
.lic-left { font-weight: 400; margin-left: 4px; }
/* 0.15 computers: the section menu sits in the header bar, like the website's menu */
/* 0.24: right-aligned beside the header buttons, styled like the website's menu (complyset.co.uk) */
.tabs.in-bar { position: static; background: transparent; border: 0; padding: 0; margin: 0 8px 0 auto; overflow: visible; gap: 2px; align-self: center; }
.tabs.in-bar a { color: #fff; font: 700 16px/1.2 var(--body); display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: var(--r-md); border-bottom: 0; }
.tabs.in-bar a:hover { background: rgba(255,255,255,.08); }
.tabs.in-bar a[aria-current="page"] { color: #fff; background: transparent; border-radius: 0; box-shadow: inset 0 -3px 0 var(--signal); }
.tabs.in-bar a:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.bar:has(.tabs.in-bar) .bar-tags { margin-right: 0; }
.bar:has(.tabs.in-bar) .brand { margin-right: 4px; }
body.portal .tabs.in-bar { background: transparent; }
/* 0.15 dd/mm/yyyy date boxes with a calendar button */
.uk-date-wrap { position: relative; display: block; }
.uk-date-wrap .uk-date { width: 100%; padding-right: 52px; }
.uk-date-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: none; border: 0; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); }
.uk-date-btn:hover { background: var(--surface); }
.uk-date-iso { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.uk-date[aria-invalid="true"] { border-color: var(--over); }
/* 0.17 priority colours: a bar down the left of each task and check, matching the key above the list.
   Red = overdue or escalated, amber = due within 7 days (or no recent update), green/blue = later or in date. */
.asset { border-left-width: 5px; }
.asset.pri-high, .asset:has(.status-overdue) { border-left-color: var(--over); }
.asset.pri-mid, .asset:has(.status-due-soon) { border-left-color: var(--due); }
.asset.pri-low { border-left-color: var(--blueprint); }
.asset:has(.status-in-date) { border-left-color: var(--ok); }
.asset.pri-done { border-left-color: var(--line-strong); opacity: .85; }
.asset.pri-high { background: linear-gradient(90deg, var(--over-soft), var(--raised) 40%); }
.pri-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14px; color: var(--muted); }
.pri-key .k::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pri-key .k-high::before { background: var(--over); }
.pri-key .k-mid::before { background: var(--due); }
.pri-key .k-low::before { background: linear-gradient(90deg, var(--blueprint) 50%, var(--ok) 50%); }
/* 0.17 bulk certificates: the review table uses the full window width on a computer */
main:has(.bulk-page) { max-width: 1180px; }
.bulk-wrap { overflow-x: auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); }
table.bulk { width: 100%; min-width: 860px; border-collapse: collapse; }
table.bulk th, table.bulk td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--line); }
table.bulk td.mono { word-break: break-all; max-width: 220px; }
table.bulk select { min-width: 190px; }
table.bulk ul.plain { margin: 0; }
table.bulk tr.row-tight { box-shadow: inset 5px 0 var(--over); }
table.bulk tr.row-low { box-shadow: inset 5px 0 var(--due); }
table.bulk tr.row-ok { box-shadow: inset 5px 0 var(--ok); }
table.bulk input[type=checkbox] { width: 22px; height: 22px; }
.lic-plain { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
/* 0.18 Tasks page: focus tiles, quick actions, rounds */
.task-tiles { margin: 0; }
.task-tiles .tile { border-left-width: 5px; }
.tile.tone-overdue, .tile.tone-escalated { border-left-color: var(--over); }
.tile.tone-due-soon { border-left-color: var(--due); }
.tile.tone-due-soon b { color: var(--due); }
.tile.tone-rounds { border-left-color: var(--blueprint); }
.tile.tone-rounds b { color: var(--blueprint); }
.tile.is-on { box-shadow: 0 0 0 2px var(--ink); border-color: var(--ink); }
.focus-note { margin: 0; padding: 8px 12px; background: var(--blueprint-soft); border-radius: var(--r-md); }
li.has-actions { display: flex; gap: 8px; align-items: stretch; }
li.has-actions > .asset { flex: 1; min-width: 0; }
.row-actions { display: flex; align-items: center; }
@media (max-width: 600px) { li.has-actions { flex-direction: column; } li.has-actions .row-actions { justify-content: flex-end; } }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.round-item .meter { margin: 6px 0 2px; max-width: 320px; }
.round-now { border-left: 5px solid var(--blueprint); }
.btn-big { min-height: 52px; font-size: 18px; }
ol.stops { list-style: none; padding: 0; }
.stop-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font: 800 15px/1 var(--display); margin-right: 4px; }
.pri-done .stop-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.stop-order { display: grid; gap: 6px; margin: 0; }
.stop-row { display: flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 6px; }

/* 0.19: contractor service reports */
fieldset.report-types { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
fieldset.report-types legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.report-types .choice { display: flex; justify-content: flex-start; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--raised); cursor: pointer; font-weight: 400; }
.report-types .choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 5px 0 0 var(--signal); }
.report-types .choice input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--ink); }
.report-types .choice span { display: grid; gap: 2px; }
.report-types .choice small { color: var(--muted); font-size: 14px; }
.field-help { margin: 0 0 4px; color: var(--muted); font-size: 15px; grid-column: 1 / -1; }
.report-frame { height: 70vh; min-height: 420px; }
.declaration { padding: 10px 12px; border: 2px solid var(--ink, #111); border-radius: 8px; font-weight: 600; }
.logo-box { min-height: 64px; display: flex; align-items: center; }
.logo-box img { max-height: 72px; max-width: 240px; object-fit: contain; }
.count-pill { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 12px; background: var(--signal); color: var(--on-signal); font-weight: 700; font-size: 14px; line-height: 24px; text-align: center; vertical-align: middle; }
.file-report { font-weight: 700; }
fieldset.recips { grid-template-columns: 1fr; }

/* ===== 0.20 Today: one list, one verb per row ===== */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; background: var(--raised); }
.fchip b { font-variant-numeric: tabular-nums; }
.fchip:hover { border-color: var(--ink); }
.fchip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.today-list { display: grid; gap: 8px; }
.today-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 12px 14px; background: var(--raised); border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: var(--r-md); }
.today-item.pri-high { border-left-color: var(--over); background: linear-gradient(90deg, var(--over-soft), var(--raised) 40%); }
.today-item.pri-mid { border-left-color: var(--due); }
.today-item.pri-low { border-left-color: var(--blueprint); }
.today-main { min-width: 0; }
.today-main .asset-name a { color: var(--ink); text-decoration: none; }
.today-main .asset-name a:hover { text-decoration: underline; }
.today-when { font-size: 15px; color: var(--ink); margin-top: 2px; }
.today-item .row-actions { margin: 0; }
.btn-verb { min-width: 120px; }
@media (max-width: 640px) {
  .btn-verb { min-width: 96px; }
}

/* ===== 0.20 asset page: lead with what to do next ===== */
.hero { display: grid; gap: 10px; }
.hero h1 { margin: 0; }
.hero-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 6px; border-top: 1px solid var(--line); }
.hero-next > div:first-child { display: grid; gap: 2px; }
.hero-date { font: 700 28px/1.1 var(--display); }
.btn-big { min-height: 56px; padding: 0 28px; font-size: 18px; }
.hero-note { margin: 0; color: var(--over); }
.hero-links { margin: 0; color: var(--muted); }
.hero-links a { color: var(--ink); }
details.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 44px; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); margin-right: 6px; transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
.fold-title { font: 700 20px/1.2 var(--display); flex: 1; }
.fold-count { min-width: 28px; padding: 0 8px; border-radius: 14px; background: var(--surface); text-align: center; font-weight: 700; }
.fold-body { margin-top: 12px; gap: 12px; }
@media (prefers-reduced-motion: reduce) { details.fold > summary::after { transition: none; } }

/* ===== 0.20 quick register ===== */
.more-details > summary { cursor: pointer; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.quick-form:not(.show-more) #packFields .grid2 > :not(:has([required])) { display: none; }
.quick-form:not(.show-more) #packFields > p { display: none; }
.quick-form:not(.show-more) #packFields:not(:has([required])) > h2 { display: none; }

/* ===== 0.20 inbox and automation ===== */
.inbox-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .inbox-grid { grid-template-columns: 1fr; } }
.needs-check { border-color: var(--due) !important; background: var(--due-soft); }
.automation > summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.automation code { background: var(--surface); padding: 2px 6px; border-radius: var(--r-sm); word-break: break-all; }

/* ===== 0.20 recognition ===== */
.medal circle { stroke: #121417; stroke-opacity: .2; stroke-width: 1.5; }
.medal-gold circle { fill: #C9A227; } .medal-silver circle { fill: #A7ADB4; } .medal-bronze circle { fill: #B26B3A; }
.recog-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--raised); color: var(--ink); text-decoration: none; }
.recog-card:hover { border-color: var(--ink); }
.recog-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.recog-text span { color: var(--muted); }
.recog-go { font-weight: 700; white-space: nowrap; text-decoration: underline; }
.recog-pct { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 700; flex: none; }
@media (max-width: 640px) { .recog-go { display: none; } }
.standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); margin: 6px 0 4px; }
.meter span { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--ok); }
.meter i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.badge-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.badge-face { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: var(--r-md); background: #121417; color: #fff; text-align: center; }
.badge-face span { font-size: 13px; color: #D9DCE1; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) { .badge-card { grid-template-columns: 1fr; } }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.more-details > summary { align-items: flex-start; text-align: left; }
.more-details > summary small { font-weight: 400; }
/* 0.21 task score */
.task-score { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.task-score > div { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.task-score b { font: 700 26px/1 var(--display); }
.task-score span { font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { .task-score { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 0.22: offline banner and the page shown when something couldn't load */
.offline { position: sticky; top: 0; z-index: 60; background: #fff4d6; color: #4a3500; border-bottom: 1px solid #e8c766; padding: .6rem 1rem; font-size: .95rem; text-align: center; }
.offline[hidden] { display: none; }
.error-page code { font-size: .9em; background: #f2f3f5; padding: .1rem .35rem; border-radius: 4px; user-select: all; }
/* 0.24: the resend-code link while it counts down */
.linkish:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* 0.27: deleting */
.danger-zone { border-color: var(--over-soft, #f6d5d1); margin-top: 8px; }
.danger-zone h2 { font-size: 18px; }
.btn-danger-outline { background: transparent; color: var(--over); border: 2px solid var(--over); }
.btn-danger-outline:hover { background: var(--over-soft, #fdecea); }
/* 0.27: links in "looks after" lists are big enough to tap (WCAG 2.2 target size) */
.looks-after li { line-height: 2; }
.looks-after a { display: inline-block; min-height: 24px; padding: 2px 0; }
[data-role] > ul > li { padding: 3px 0; }
[data-role] > ul > li > a { display: inline-block; min-height: 24px; }

/* 0.28: service certificates (paid add-on for contractors) */
.cert-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; }
.cert-row > .asset { min-width: 0; }
.cert-pick { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 32px; }
.cert-pick input { width: 22px; height: 22px; margin: 0; }
.cert-row > .btn { white-space: nowrap; }
.logo-box.small { min-height: 48px; }
.logo-box.small img { max-height: 56px; max-width: 180px; }
.logo-pick { display: grid; gap: 8px; }
.cert-pdf .btn .i, [data-cb] .i, [data-bp] .i { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .cert-row { grid-template-columns: 32px 1fr; }
  .cert-row > .btn { grid-column: 2; justify-self: start; }
}

/* 0.29: Take a photo / Choose a file for certificates and insurance (the file input is inside the button) */
.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus, #1d4ed8); outline-offset: 2px; }
.doc-pick > span { display: block; margin-bottom: 6px; }
.doc-picked { align-self: center; }
.doc-pick > span small { font-weight: 400; }
/* 0.29: two fields side by side whose hints differ in length keep their boxes level (Create task: Assigned to, Due date) */
.align-controls { align-items: end; }
.align-controls > .field { position: relative; padding-bottom: 22px; }
.align-controls .days-hint { position: absolute; left: 0; bottom: 0; margin: 0; }
