/* LEDGER. Colours are the LEGEND palette (legend-styles): deep cove #1A2A5B, achat blue #07A9FF,
   diamond grey #CCCCCC, and the secondary steel blue, pumpkin, teal, brick red, fuchsia. */
:root {
  --deep-cove: #1A2A5B; --achat-blue: #07A9FF; --diamond-grey: #CCCCCC;
  --bg: #f3f5f9; --panel: #ffffff; --ink: #18223f; --muted: #5b6680; --line: #dfe4ee;
  --accent: #0077BB; --btn: #1A2A5B; --btn-ink: #ffffff;
  --ok: #00695e; --ok-bg: #dff3f0; --err: #a8290e; --err-bg: #fbe9e5;
  --warn-bg: #fdeede; --warn-ink: #8a3d0b; --chip: #e8ecf4;
  --tip-bg: #fff7d6; --tip-line: #e0a800; --tip-ink: #6b4e00;
  /* plot: series colours validated for colour-blind separation on --panel */
  --grid: #e3e7ef; --axis: #b9c1d1;
  --series-1: #0077BB; --series-2: #EE3377; --series-3: #EE7733; --series-4: #009988; --series-other: #8a93a8;
}
/* Dark: when chosen with the sun/moon button, or when the system asks for it and Light was not chosen.
   (The two blocks must stay identical.) */
:root[data-theme="dark"] {
    --bg: #0c1224; --panel: #16203f; --ink: #e8ecf6; --muted: #9aa6c2; --line: #2a3760;
    --accent: #07A9FF; --btn: #07A9FF; --btn-ink: #0c1224;
    --ok: #5fd6c7; --ok-bg: #0f3a3a; --err: #ff9a82; --err-bg: #45170f;
    --warn-bg: #45290c; --warn-ink: #ffc48f; --chip: #24305a;
    --tip-bg: #3a3112; --tip-line: #d9a514; --tip-ink: #ffe08a;
    --grid: #25315a; --axis: #3d4d7d;
    --series-1: #1E8AD2; --series-2: #EE3377; --series-3: #D0741C; --series-4: #009988; --series-other: #8a93a8;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1224; --panel: #16203f; --ink: #e8ecf6; --muted: #9aa6c2; --line: #2a3760;
    --accent: #07A9FF; --btn: #07A9FF; --btn-ink: #0c1224;
    --ok: #5fd6c7; --ok-bg: #0f3a3a; --err: #ff9a82; --err-bg: #45170f;
    --warn-bg: #45290c; --warn-ink: #ffc48f; --chip: #24305a;
    --tip-bg: #3a3112; --tip-line: #d9a514; --tip-ink: #ffe08a;
    --grid: #25315a; --axis: #3d4d7d;
    --series-1: #1E8AD2; --series-2: #EE3377; --series-3: #D0741C; --series-4: #009988; --series-other: #8a93a8;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.top { background: var(--deep-cove); color: #fff; border-bottom: 3px solid var(--achat-blue); }
header.top .bar { max-width: 1240px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
header.top .brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-right: 8px; }
header.top .brand:hover { text-decoration: none; }
header.top .brand img { height: 30px; display: block; }
header.top .brand b { font-weight: 500; font-size: 17px; border-left: 1px solid rgba(255,255,255,.35); padding-left: 12px; }
header.top nav.pages { display: flex; flex-wrap: wrap; gap: 2px 14px; flex: 1; }
header.top nav.pages a { color: #dbe6ff; }
header.top nav.pages a.on { color: #fff; font-weight: 500; text-decoration: underline; text-decoration-color: var(--achat-blue); text-decoration-thickness: 2px; text-underline-offset: 6px; }
header.top .who { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; color: #c7d3f2; }
.zones { background: var(--panel); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.zones div { max-width: 1240px; margin: 0 auto; padding: 5px 16px; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.zones form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.zones select { width: auto; max-width: 240px; padding: 2px 6px; }
.zones form.search { margin-left: auto; }
.zones form.search input { width: 220px; padding: 3px 8px; }
@media (max-width: 640px) { .zones form.search { margin-left: 0; width: 100%; } .zones form.search input { width: 100%; } }
.preview { background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--line); }
.preview div { max-width: 1240px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preview form { margin: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 18px 16px 60px; }
h1 { font-size: 24px; font-weight: 500; margin: 4px 0 14px; }
h2 { font-size: 17px; font-weight: 500; margin: 0 0 10px; }
h3 { font-size: 14px; font-weight: 500; margin: 14px 0 6px; color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 0 0 16px; }
.cols > .panel { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--achat-blue); border-radius: 8px; padding: 10px 14px; color: var(--ink); }
a.tile:hover { text-decoration: none; border-color: var(--achat-blue); }  /* only tiles that are links */
.tile b { display: block; font-size: 22px; font-weight: 500; }
.tile span { color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 180px; }
/* No text-transform here: headings carry units, and "g" must not become "G". */
th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; padding-right: 16px; }
tr:last-child td { border-bottom: 0; }
table.summary tr.sub-row td:first-child { padding-left: 22px; }
table.summary tr.total th, table.summary tr.total td { border-top: 0; border-bottom: 2px solid var(--axis); }
tr.total th, tr.total td { border-top: 2px solid var(--axis); border-bottom: 0; color: var(--ink); font-weight: 600; }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 1px 9px; font-size: 12px; white-space: nowrap; }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
/* Missing material: white on red in both themes (5.6:1). */
.chip.alarm { background: #c62828; color: #fff; }
/* An incident: possibly bad news, white on orange in both themes (4.6:1). */
.chip.incident { background: #c45100; color: #fff; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.off { color: var(--muted); }
/* A deployed detector: the strong form of "active". */
.chip.deployed { background: var(--ok); color: var(--panel); font-weight: 500; }
/* Kind tags carry the colour and symbol of the item's QR label; form tags are outlined with a symbol of their own. */
.chip.kind, .chip.form { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.chip.kind { padding-left: 2px; background: color-mix(in srgb, var(--k) 18%, var(--panel)); }
.chip.kind svg { width: 17px; height: 17px; flex: none; }
.chip.form { padding-left: 6px; background: transparent; box-shadow: inset 0 0 0 1px var(--axis); }
.chip.form svg { width: 13px; height: 13px; flex: none; color: var(--muted); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.flash { border-radius: 6px; padding: 9px 12px; margin: 0 0 12px; border: 1px solid var(--line); background: var(--panel); }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.flash.error { background: var(--err-bg); color: var(--err); border-color: transparent; }
form.grid, .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; align-items: end; }
label.field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
label.field.wide { grid-column: 1 / -1; }
label.check { display: flex; gap: 6px; align-items: center; font-size: 14px; }
input, select, textarea, button { font: inherit; color: var(--ink); }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=search],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); min-width: 0;
}
textarea { min-height: 70px; }
small { color: var(--muted); }
.req { color: var(--err); }
button, a.btn { display: inline-block; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); cursor: pointer; font-weight: 500; text-decoration: none; }
button.quiet, a.btn.quiet { background: transparent; color: var(--accent); border-color: var(--accent); }
button.small, a.btn.small { padding: 2px 9px; font-size: 13px; font-weight: 400; }
button[aria-pressed=true] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
details.action { border: 1px dashed var(--line); border-radius: 6px; padding: 8px 12px; margin: 10px 0 0; }
details.action > summary { cursor: pointer; color: var(--accent); font-weight: 500; }
details.action[open] > summary { margin-bottom: 10px; }
.head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.head .tag { text-align: right; }
.head .tag img { width: 248px; max-width: 100%; display: block; border-radius: 6px; box-shadow: 0 1px 4px rgba(10, 20, 50, .18); margin: 0 0 6px auto; }
.strings { display: flex; flex-wrap: wrap; gap: 12px; }
.string { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 130px; }
.string h3 { margin-top: 0; }
.string ol { list-style: none; margin: 0; padding: 0; }
.string li { padding: 4px 0; border-top: 1px solid var(--line); font-size: 14px; }
.string li span { color: var(--muted); display: inline-block; width: 1.6em; }
.rows input, .rows select { padding: 4px 6px; font-size: 13px; }
.rows td { white-space: normal; padding-right: 6px; border-bottom: 0; }
.login { max-width: 400px; margin: 7vh auto 0; }
.login .mark { background: var(--deep-cove); border-radius: 8px 8px 0 0; margin: -14px -16px 14px; padding: 20px 16px 16px; text-align: center; color: #fff; border-bottom: 3px solid var(--achat-blue); }
.login .mark img { height: 46px; }
.login .mark b { display: block; font-weight: 500; font-size: 20px; margin-top: 6px; }
.login .mark span { font-size: 12px; color: #c7d3f2; }
.login .themepick select { width: auto; }
pre.json { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; }

/* ---- temperature plot ---- */
.tempplot .ranges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.tempplot .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.tempplot .legend i, .tempplot .tip i { display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.tempplot .frame { position: relative; }
.tempplot svg { display: block; width: 100%; outline-offset: 2px; touch-action: pan-y; }
.tempplot .grid { stroke: var(--grid); stroke-width: 1; }
.tempplot .axis { stroke: var(--axis); stroke-width: 1; }
.tempplot text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tempplot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tempplot .dot { stroke: var(--panel); stroke-width: 2; }
.tempplot .cross { stroke: var(--muted); stroke-width: 1; }
.tempplot .tip { position: absolute; top: 6px; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; box-shadow: 0 2px 10px rgba(10, 20, 50, .16); white-space: nowrap; }
.tempplot .tip .when { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.tempplot .tip b { font-weight: 500; margin-right: 6px; }
.tempplot .tip span { color: var(--muted); }
.tempplot .note { margin: 6px 0 0; }

/* ---- labels ---- */
.labelgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px; }
.labelgrid .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 2px; }
.sheet { display: flex; flex-wrap: wrap; gap: 3mm; }
.sheet .label { flex: none; background: #fff; }
.sheet .label svg { display: block; width: 100%; height: 100%; }
@media screen { .sheet .label { box-shadow: 0 1px 4px rgba(10, 20, 50, .2); border-radius: 1.4mm; } }
@media print {
  header.top, .zones, .preview, .noprint, .flash { display: none !important; }
  .report { font-size: 11pt; }
  .report .card { break-inside: auto; }
  .report h2, .report h3 { break-after: avoid; }
  .report tr, .report .tile { break-inside: avoid; }
  .report .scroll { overflow: visible; }
  .report, .report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }  /* keep the colours in the PDF */
  .report .card > h2 { break-after: avoid; }
  .report .tiles { grid-template-columns: repeat(3, 1fr); }
  th[aria-sort=none] button.sorter::after { content: none; }  /* keep ▲▼ only if a column was sorted */
  body { background: #fff; }
  main { max-width: none; padding: 0; margin: 0; }
  .sheet .label { break-inside: avoid; }
  .sheet.roll { display: block; }
  .sheet.roll .label { break-after: page; margin: 0; }
}

/* ---- navicon menu ---- */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 34px; border-radius: 6px; border: 1px solid #3c4f8c; color: #fff; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary { background: #24356d; }
details.menu > summary:focus-visible { outline: 2px solid var(--achat-blue); outline-offset: 2px; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 280px; max-width: calc(100vw - 32px);
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(10, 20, 50, .28); padding: 4px 0; font-size: 14px; }
.menu-panel .menu-who { padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); }
.menu-panel .menu-who span { color: var(--muted); font-size: 13px; }
.menu-panel .menu-section { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.menu-panel .menu-section:last-child { border-bottom: 0; }
.menu-panel .menu-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.menu-panel select { width: 100%; }
.menu-panel .menu-links { display: flex; flex-direction: column; gap: 6px; }
.menu-panel button.quiet { width: 100%; }

/* ---- information page ---- */
.info { max-width: 1100px; }
.info p, .info li { line-height: 1.55; }
.info h2 { margin-top: 4px; }
.info .toc { columns: 2; column-gap: 32px; margin: 0; padding-left: 18px; }
@media (max-width: 640px) { .info .toc { columns: 1; } }
.diagram { margin: 6px 0 4px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .node { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.diagram .node.center { stroke: var(--accent); stroke-width: 2; }
.diagram .t { fill: var(--ink); font-size: 15px; font-weight: 500; }
.diagram .s { fill: var(--muted); font-size: 12.5px; }
.diagram .p { fill: var(--muted); font-size: 12px; font-style: italic; }
.diagram .flow { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.diagram .flow.recycle { stroke: var(--accent); }
.diagram .head { fill: var(--muted); }
.diagram .head.recycle { fill: var(--accent); }
.diagram .band { fill: var(--chip); }
.diagram figcaption { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* On narrow screens the page links move into the menu. */
.menu-panel .menu-nav { display: none; }
@media (max-width: 760px) {
  header.top nav.pages { display: none; }
  header.top .who { margin-left: auto; }
  .menu-panel .menu-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .menu-panel .menu-nav a.on { font-weight: 500; text-decoration: underline; }
  .menu-panel { position: fixed; top: 56px; right: 12px; max-height: calc(100vh - 70px); overflow-y: auto; }
}

/* ---- sortable headings, filters, example label ---- */
th button.sorter { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; }
th.n button.sorter { justify-content: flex-end; }
th button.sorter::after { content: "↕"; font-size: 11px; opacity: .35; }
th[aria-sort=ascending] button.sorter::after { content: "▲"; opacity: .9; color: var(--accent); }
th[aria-sort=descending] button.sorter::after { content: "▼"; opacity: .9; color: var(--accent); }
th button.sorter:hover { color: var(--ink); }
th button.sorter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.filter-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.example-label { margin: 8px 0 12px; }
.example-label svg { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 8px; box-shadow: 0 1px 4px rgba(10, 20, 50, .18); }
.example-label figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---- sun / moon toggle (sits on the deep-cove header) ---- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; padding: 0;
  border-radius: 6px; border: 1px solid transparent; background: transparent; color: #dbe6ff; cursor: pointer; }
.theme-toggle:hover { background: #24356d; color: #fff; }
.theme-toggle:focus-visible { outline: 2px solid var(--achat-blue); outline-offset: 2px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
/* On the login page the toggle sits at the bottom of the white panel, so it uses the panel's ink. */
.login-foot { display: flex; justify-content: flex-end; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.login-foot .theme-toggle { color: var(--muted); }
.login-foot .theme-toggle:hover { background: var(--chip); color: var(--ink); }

/* ---- production history ---- */
.lineage { margin: 6px 0; }
.lineage svg { display: block; width: auto; max-width: none; height: auto; }
.lineage a.lin-node:hover .node { stroke: var(--accent); }
.lineage a.lin-node:focus-visible .node { stroke: var(--accent); stroke-width: 2.5; }
.lineage a.lin-node.retired .t { fill: var(--muted); }
.lineage .status { fill: var(--muted); font-size: 11.5px; font-style: italic; }
.lineage .edge-label rect { fill: var(--panel); stroke: var(--line); }
.lineage .edge-label text { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.lineage .flow:hover { stroke-width: 3; }

/* ---- map of where an item has been ---- */
.itemmap { height: 360px; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0 4px; z-index: 0; }
.itemmap.no-tiles { background: var(--bg); }
.itemmap-step { display: flex !important; align-items: center; justify-content: center; border-radius: 50%;
  background: #fff; color: #1A2A5B; border: 2px solid #1A2A5B; font: 600 11px/1 Roboto, sans-serif; }
.leaflet-popup-content ul { margin: 4px 0 0; padding-left: 16px; }
.leaflet-popup-content a { font-weight: 500; }

/* ---- voided records: kept, but struck out ---- */
tr.voided td { color: var(--muted); }
tr.voided td:not(:last-child) { text-decoration: line-through; text-decoration-color: var(--muted); }
tr.voided td .chip { text-decoration: none; }
.flash.voided-note { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
details.action.void > summary { color: var(--err); }
details.action.void.small { display: inline-block; margin: 0; border: 0; padding: 0; }
details.action.void.small > summary { font-size: 12px; }
details.action.void.small[open] { display: block; min-width: 260px; }
#history-log summary { cursor: pointer; }
#history-log summary h2 { margin: 0 8px 0 0; }
img.flag { vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }

.card.attention h3 { margin: 14px 0 2px; }
.card.attention ul { margin: 4px 0 0; padding-left: 20px; }

/* A person named on a record whose details have changed since: "then at LNGS". */
.then { display: inline-block; font-size: 11px; color: var(--muted); border: 1px dashed var(--axis); border-radius: 999px;
        padding: 0 7px; margin-left: 3px; white-space: nowrap; cursor: help; vertical-align: 1px; }
tr.muted td { color: var(--muted); }


/* ---- Overview: the way in for new users ---- */
/* A tip: light yellow with an information symbol, unlike every coloured card on the page. */
a.panel.intro { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none;
                background: var(--tip-bg); border: 1px solid var(--tip-line); border-left: 6px solid var(--tip-line); }
a.panel.intro .tip-icon { flex: none; width: 34px; height: 34px; color: var(--tip-ink); }
a.panel.intro .tip-text { flex: 1; min-width: 0; }
a.panel.intro .tip-text b { display: block; font-size: 17px; color: var(--tip-ink); margin-bottom: 2px; }
a.panel.intro .tip-go { flex: none; padding: 6px 14px; border-radius: 6px; background: var(--tip-line); color: #1d1600;
                        font-weight: 500; white-space: nowrap; }
a.panel.intro:hover .tip-go, a.panel.intro:focus-visible .tip-go { filter: brightness(1.08); text-decoration: underline; }
@media (max-width: 640px) { a.panel.intro { flex-wrap: wrap; } a.panel.intro .tip-go { margin-left: 48px; } }

/* ---- banner, coloured cards, and tiles (Overview and the oversight report) ---- */
:root { --alarm: #c62828; --quality: var(--muted); }
/* The banner: deep cove like the site's top bar, with the LEGEND logo on the right. */
.banner { display: flex; align-items: center; gap: 16px; background: var(--deep-cove); color: #fff;
          border-bottom: 4px solid var(--achat-blue); border-radius: 8px; margin: 0 0 20px; padding: 14px 18px; }
.banner h1 { margin: 0 0 4px; color: #fff; }
.banner p { margin: 2px 0; }
.banner-title { flex: 1; min-width: 0; }
.banner-sub { color: #dbe6ff; }
.banner-meta { color: #c9d4ee; font-size: 13px; }
.banner-logo { height: 40px; width: auto; flex: none; }
@media (max-width: 640px) { .banner { flex-wrap: wrap; } .banner-logo { height: 28px; } }
/* A card is a section in its own colour (--sec, from the plot palette), with a tinted heading band. */
.card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--sec, var(--accent));
        border-radius: 8px; padding: 0 16px 12px; margin: 0 0 22px; }
.card > h2 { margin: 0 -16px 12px; padding: 9px 16px; font-size: 18px; border-radius: 4px 4px 0 0;
             background: color-mix(in srgb, var(--sec, var(--accent)) 13%, var(--panel)); }
.card h3 { margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid var(--sec, var(--accent)); font-size: 15px; }
.card table th { background: color-mix(in srgb, var(--sec, var(--accent)) 8%, var(--panel)); }
.card table tr.total td, .card table tr.total th { border-top: 2px solid var(--sec, var(--line)); font-weight: 600; }
.card .tiles { margin: 0 0 4px; }
.tiles .tile[style] { color: var(--ink); border-top-color: var(--sec);
                      background: color-mix(in srgb, var(--sec) 6%, var(--panel)); }
.tiles .tile[style] b { color: color-mix(in srgb, var(--sec) 70%, var(--ink)); }
a.tile[style]:hover { border-color: var(--sec); }
.report-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 24px; }
@page { size: A4; margin: 15mm 14mm; }

/* ---- custody check form ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset.check-choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
fieldset.check-choice label { white-space: nowrap; }
fieldset.check-choice select { width: auto; max-width: 200px; padding: 3px 6px; font-size: 14px; }
fieldset.check-choice .elsewhere { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.check-table input[name^=note_] { width: 150px; }
.check-table td { vertical-align: middle; }

/* ---- item page: jump to a section ---- */
nav.onpage { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 14px;
             padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
nav.onpage a { white-space: nowrap; }
nav.onpage .sep { color: var(--muted); }
main .panel[id], main .cols[id] { scroll-margin-top: 64px; }  /* clear the sticky row when jumping */

/* ---- an item's kind symbol before its name in tables ---- */
a.item-link { white-space: nowrap; }
.kind-icon svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }

/* ---- a two-way switch (audit log: readable / raw values) ---- */
nav.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0 0 10px; }
nav.toggle a { padding: 6px 14px; color: var(--ink); text-decoration: none; background: var(--panel); }
nav.toggle a + a { border-left: 1px solid var(--line); }
nav.toggle a.on { background: var(--btn); color: var(--btn-ink); }
