/* © 2026 Alexandra Badescu. Licensed under CC BY-NC-ND 4.0 (see LICENSE). */
/* DM Sans, self-hosted (no third-party requests), the same family as the banner's DM Serif Display and DM Mono.
   SIL Open Font License 1.1: dashboard/fonts/OFL.txt. One variable file covers every weight. */
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; }
:root {
  color-scheme: light dark;
  --ink: #1f2e25;
  --muted: #4a5a50;
  --line: #e3ded4;
  --bg: #f7f3ee;
  --card: #fffdf9;
  --field: #fffdf9;
  --field-line: #7b877e;
  --brand: #283c30;
  --accent: #a34e48;        /* deeper rose: 5.1:1 on ivory */
  --accent-soft: #f6e9e4;
  --plum: #2f5a43;
  --plum-soft: #e2ebe3;
  --btn: #283c30; --btn-ink: #ffffff;
  --chip: #eceee7;
  --track: #ebe7df;
  --ok: #2c6a43;  --ok-soft: #e2efe5;
  --warn: #855600; --warn-soft: #fbf0db; --warn-line: #e3c88f;
  --bad: #9e2f2a; --bad-soft: #f8e4e1; --bad-line: #e6b3ad; --bad-ink: #ffffff;
  --low: #3f4650; --low-soft: #eef0f2; --low-line: #d4d8dd;
  --zero: #84907f;
  --heat1: #eef3ee; --heat2: #dae6db; --heat3: #bcd2c0;
  --c1: #243c30; --c2: #af8b3d; --c3: #a64d3b; --c4: #466188; --c5: #a578c2; /* categorical: checked by tools/check-palette.js */
  --seq-l: #c6d8c9; --seq-m: #8db098; --seq-h: #4d7a5d; --seq-vh: #22402f; /* ordinal ramp: checked by tools/check-palette.js */
  --side-bg: #e6ede6; --side-ink: #1f2e25; --side-muted: #45534a; --side-line: #b9c8bc; --side-soft-line: #cfdbd1; --side-active: #fffdf9; --side-marker: #a34e48;
  --focus: #1b5fd6;
  --radius: 12px;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1ea;
    --muted: #b9c4bb;
    --line: #34433a;
    --bg: #141c17;
    --card: #1b251f;
    --field: #212d26;
    --field-line: #7d8b80;
    --brand: #e9efe6;
    --accent: #e8a59c;
    --accent-soft: #3a2522;
    --plum: #a9d3b7;
    --plum-soft: #24352b;
    --btn: #a9d3b7; --btn-ink: #13201a;
    --chip: #24312a;
    --track: #2a3830;
    --ok: #8fd3a5;  --ok-soft: #173325;
    --warn: #f0c46e; --warn-soft: #3a2b12; --warn-line: #6b5120;
    --bad: #ff9e96; --bad-soft: #3e1d1b; --bad-line: #6e302c; --bad-ink: #2a0b0a;
    --low: #d5d9de; --low-soft: #2e3238; --low-line: #4a5058;
    --zero: #8f9b92;
    --heat1: #213028; --heat2: #2f4638; --heat3: #42614d;
    --c1: #8ed8b4; --c2: #daa664; --c3: #bd6265; --c4: #3f7cc4; --c5: #c9b2d9; /* categorical, dark */
    --seq-l: #3b5446; --seq-m: #6f9a7c; --seq-h: #a8cdb2; --seq-vh: #e2efe4; /* ordinal ramp, dark: stronger = brighter */
    --side-bg: #18211b; --side-ink: #eef1ea; --side-muted: #b9c4bb; --side-line: #3f5045; --side-soft-line: #33433a; --side-active: #212d26; --side-marker: #e8a59c;
    --focus: #8fb4ff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--plum); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
/* Chromium focuses a part inside the date field, so :focus-visible never matches it; text fields show focus on click too. */
.filters input:focus, .filters input:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--line); padding: 24px 18px; }
.brand { font-size: 1.35rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; color: var(--side-ink); }
.brand span { color: var(--side-marker); }
.tagline { margin: 2px 0 22px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-muted); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nav li { display: flex; }
.nav li a { flex: 1; }
/* Every view keeps a light outline, so the options still read as choices (1.0 test report, B6), without arrows. */
.nav a { display: flex; flex-direction: column; justify-content: center; position: relative; padding: 9px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none;
  background: transparent; border: 1px solid var(--side-soft-line); }
.nav a small { display: block; color: var(--side-muted); font-size: 0.78rem; }
.nav a:hover { background: var(--side-active); border-color: var(--side-marker); }
.nav a[aria-current="page"] { background: var(--side-active); border-color: var(--side-marker); color: var(--side-ink); font-weight: 600; box-shadow: inset 4px 0 0 var(--side-marker); }
.nav a[aria-current="page"] small { color: var(--side-muted); font-weight: 400; }
.note { margin-top: 22px; border: 1px solid var(--side-line); border-radius: 10px; padding: 12px; font-size: 0.82rem; color: var(--side-muted); }
.note strong { display: block; color: var(--side-ink); margin-bottom: 2px; }
.byline { margin-top: 18px; font-size: 0.82rem; color: var(--side-muted); }
.byline a { color: var(--side-ink); display: inline-block; margin-top: 6px; }

main { padding: 28px clamp(16px, 3vw, 36px) 40px; min-width: 0; }
.eyebrow { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 4px 0 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -0.02em; }
.lead { margin: 0 0 18px; color: var(--muted); max-width: 70ch; }
.who { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.who li { font-size: 0.78rem; background: var(--plum-soft); color: var(--plum); border-radius: 999px; padding: 2px 10px; font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.filters[hidden] { display: none; }
.filters label { display: grid; gap: 4px; font-size: 0.82rem; font-weight: 600; }
.filters input, .filters select, button { font: inherit; font-size: 0.9rem; padding: 7px 10px; border: 1px solid var(--field-line); border-radius: 8px; background-color: var(--field); color: var(--ink); min-height: 38px; }
button { cursor: pointer; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232f5a43' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
@media (prefers-color-scheme: dark) {
  select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9d3b7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
.filters label { width: 13rem; }
.filters input, .filters select { width: 100%; height: 40px; }
.filters select { padding-right: 36px; }
.filters .btn { height: 40px; }
.filters input[type="date"] { -webkit-appearance: none; appearance: none; line-height: 1.2; display: flex; align-items: center; }
/* Safari: remove the extra padding it adds inside date fields, and keep the date left-aligned */
.filters input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.filters input[type="date"]::-webkit-datetime-edit,
.filters input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
/* iPhone Safari zooms the page when a field's text is under 16px, so phones get 16px */
@media (max-width: 860px) { .filters input, .filters select, .filters .btn { font-size: 16px; } }
.filters .spacer { flex: 1; }
.btn { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile h2 { margin: 0; font-size: 0.86rem; font-weight: 650; color: var(--muted); }
.tile .num { font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; }
.tile .num.alert { color: var(--bad); }
.tile .sub { margin: 0; font-size: 0.85rem; color: var(--muted); }
details.how { margin-top: 8px; font-size: 0.82rem; color: var(--muted); }
details.how summary { cursor: pointer; color: var(--plum); font-weight: 600; }
details.how p { margin: 6px 0 0; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-bottom: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; min-width: 0; }
.panel h2 { margin: 0 0 2px; font-size: 1.1rem; }
.panel .help { margin: 0 0 12px; font-size: 0.86rem; color: var(--muted); }
.panel .take { margin: 12px 0 0; padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; font-size: 0.88rem; }

.table-wrap { overflow-x: auto; border-radius: 6px; }
.table-wrap:focus-visible { outline-offset: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
caption { text-align: left; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.idbtn { background: none; border: 0; padding: 0; min-height: 0; color: var(--plum); font-weight: 600; text-decoration: underline; }
.title { display: block; }
.why { display: flex; flex-wrap: wrap; gap: 4px; }
.why span { font-size: 0.76rem; background: var(--chip); border-radius: 6px; padding: 1px 6px; }
.why span.hot { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.next { font-weight: 600; }

.tag { display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.tag.vh { background: var(--bad); color: var(--bad-ink); }
.tag.h { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.tag.m { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.l { background: var(--low-soft); color: var(--low); border-color: var(--low-line); }
.pi { display: inline-flex; flex-wrap: wrap; gap: 6px 6px; align-items: center; }
.prio { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--field-line); color: var(--ink); background: var(--card); }
.prio.p0 { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.prio.p1 { border-color: var(--bad-line); color: var(--bad); }
.tag.u { background: var(--card); color: var(--muted); border: 1px dashed var(--field-line); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 3.2em; gap: 10px; align-items: center; font-size: 0.86rem; }
.bar { height: 12px; background: var(--track); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--plum); border-radius: 6px; }
.bar.over i { background: var(--bad); }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.cols { display: flex; align-items: end; gap: 8px; height: 170px; padding: 0; margin: 0; list-style: none; }
.cols li { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; font-size: 0.75rem; color: var(--muted); min-width: 0; }
.cols .col { width: 100%; max-width: 46px; background: var(--plum); border-radius: 6px 6px 0 0; }
.cols li.last .col { background: var(--accent); }
.cols b { color: var(--ink); font-size: 0.82rem; }
.cols .wk { white-space: nowrap; font-size: 0.72rem; }
.cols .unk { font-size: 0.68rem; line-height: 1.2; text-align: center; min-height: 2.4em; }
.gap-top { margin-top: 14px; }
.age { display: none; font-size: 0.8rem; color: var(--muted); }

.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 14px; }
.goal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.goal h3 { margin: 0; font-size: 0.95rem; }
.goal .metric { margin: 0; font-size: 0.82rem; color: var(--muted); }
.goal .big { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.goal .meta { font-size: 0.82rem; color: var(--muted); }
.goal { align-content: start; }
.goal .status { justify-self: start; align-self: start; }
.goal .alongside { font-size: 0.86rem; }
.goal .alongside.late { color: var(--bad); font-weight: 600; }
.goal .how { margin-top: 4px; }
dl.def { display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; margin: 6px 0; font-size: 0.82rem; }
dl.def dt { font-weight: 600; }
dl.def dd { margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; }
.summary ul { margin: 0; padding-left: 18px; }
.summary li { margin-bottom: 6px; }
.summary .ids { color: var(--muted); font-size: 0.86rem; white-space: normal; }
.summary .fiction { margin: 12px 0 0; font-size: 0.86rem; color: var(--muted); }
.status { display: inline-block; max-width: 100%; justify-self: start; font-size: 0.8rem; font-weight: 600; line-height: 1.35; padding: 2px 10px; border-radius: 0.9em; }
.nowrap { white-space: nowrap; }
td.promised { min-width: 10rem; }
.status.on { background: var(--ok-soft); color: var(--ok); }
.status.watch { background: var(--warn-soft); color: var(--warn); }
.status.off { background: var(--bad-soft); color: var(--bad); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0 0 12px; padding: 0; font-size: 0.8rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .seg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.stacks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stacks li { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 2.4em; gap: 10px; align-items: center; font-size: 0.86rem; }
.sbar { display: flex; gap: 2px; height: 18px; min-width: 0; }
.sbar .seg:first-child { border-radius: 4px 0 0 4px; }
.sbar .seg:last-child { border-radius: 0 4px 4px 0; }
.sbar .seg:only-child { border-radius: 4px; }
.seg { display: block; height: 100%; }
.s-vh { background: var(--seq-vh); }
.s-h { background: var(--seq-h); }
.s-m { background: var(--seq-m); }
.s-l { background: var(--seq-l); }
.s-u { background: repeating-linear-gradient(45deg, var(--field-line) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px var(--field-line); }
.stacks .tot { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
details.tableview { margin-top: 12px; font-size: 0.86rem; }
details.tableview summary { cursor: pointer; color: var(--plum); font-weight: 600; }
details.tableview .table-wrap { margin-top: 8px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--field-line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 600; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--card); stroke-width: 2; }
.chart .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.chart .col-mark { fill: var(--c1); }
.chart .hit:hover + * , .chart .col-mark:hover { opacity: .85; }
.chart .target { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 3; }
.ln.c1 { stroke: var(--c1); } .pt.c1 { fill: var(--c1); }
.ln.c2 { stroke: var(--c2); } .pt.c2 { fill: var(--c2); }
.ln.c3 { stroke: var(--c3); } .pt.c3 { fill: var(--c3); }
.key-line { display: inline-block; width: 16px; height: 0; border-top: 3px solid currentColor; border-radius: 2px; }
.key-line.c1 { border-color: var(--c1); } .key-line.c2 { border-color: var(--c2); } .key-line.c3 { border-color: var(--c3); }
.key-line.dash { border-top: 2px dashed var(--ink); }
.key-box { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-box.c1, .pbar.c1 { background: var(--c1); } .key-box.c2, .pbar.c2 { background: var(--c2); } .key-box.c3 { background: var(--c3); }
.key-box.c4 { background: var(--c4); } .key-box.c5 { background: var(--c5); }
.grid2.flat { margin: 0; }
.sub-h { margin: 0 0 4px; font-size: 0.95rem; }
.kpi { margin: 0 0 10px; font-size: 0.86rem; color: var(--muted); }
.kpi b { font-size: 1.6rem; color: var(--ink); margin-right: 4px; }
.take .status { margin-right: 6px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut .arc { fill: none; stroke-width: 22; }
.arc.c1 { stroke: var(--c1); } .arc.c2 { stroke: var(--c2); } .arc.c3 { stroke: var(--c3); } .arc.c4 { stroke: var(--c4); } .arc.c5 { stroke: var(--c5); }
.donut .arc:hover { stroke-width: 26; }
.donut-num { fill: var(--ink); font-size: 26px; font-weight: 700; }
.donut .ax { fill: var(--muted); font-size: 11px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; min-width: 170px; font-size: 0.86rem; }
.donut-legend li { display: grid; grid-template-columns: 14px 1fr 2em 3em; gap: 8px; align-items: center; }
.donut-legend b, .donut-legend .pct { text-align: right; font-variant-numeric: tabular-nums; }
.donut-legend .pct { color: var(--muted); }
.pairs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pairs li { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 10px; align-items: center; font-size: 0.86rem; }
.pair { display: grid; gap: 4px; }
.prow { display: grid; grid-template-columns: 1fr 2em; gap: 8px; align-items: center; }
.prow b { text-align: right; font-variant-numeric: tabular-nums; }
.pbar { display: block; height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar i.c2 { background: var(--c2); } .bar i.c3 { background: var(--c3); } .bar i.c4 { background: var(--c4); }
.optional { display: inline-block; vertical-align: middle; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--field-line); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
code { font-size: 0.85em; background: var(--chip); padding: 0 4px; border-radius: 4px; }
.bar i.s-vh { background: var(--seq-vh); } .bar i.s-h { background: var(--seq-h); } .bar i.s-m { background: var(--seq-m); }
.bar i.s-l { background: var(--seq-l); } .bar i.s-u { background: repeating-linear-gradient(45deg, var(--field-line) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px var(--field-line); }
#tip { white-space: pre-line;  position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--card); font-size: 0.8rem; padding: 4px 8px; border-radius: 6px; max-width: 260px; }
.heat td.c { text-align: center; font-weight: 600; }
.heat td.c0 { color: var(--zero); font-weight: 400; }
.heat td.c1 { background: var(--heat1); }
.heat td.c2 { background: var(--heat2); }
.heat td.c3 { background: var(--heat3); }

.matrix td, .matrix th { text-align: center; }
.matrix th[scope="row"] { text-align: left; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { margin: 0 0 12px 0; padding-left: 14px; position: relative; font-size: 0.88rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--plum); }
.timeline time { font-weight: 600; display: block; }

dialog { color: var(--ink); background: var(--card); border: 0; border-radius: 14px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgba(30, 10, 35, 0.35); }
dialog::backdrop { background: rgba(30, 15, 35, 0.45); }
.dlg-head { position: sticky; top: 0; background: var(--card); padding: 16px 18px 10px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; align-items: start; }
.dlg-head h2 { margin: 0; font-size: 1.1rem; }
.dlg-body { padding: 14px 18px 18px; }
.facts { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 4px 14px; font-size: 0.88rem; margin: 0 0 14px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dt, .facts dd { overflow-wrap: anywhere; }
.facts dd { margin: 0; }
/* On narrow screens, or with a wide fallback font, a term column can't fit beside its definition: stack them. */
@media (max-width: 420px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .facts dd { margin-bottom: 8px; } }

footer { margin-top: 18px; font-size: 0.8rem; color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { padding: 16px; }
  .tagline { margin-bottom: 12px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note, .byline { display: none; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filters label { width: calc(50% - 7px); }
  .filters label:first-child { width: 100%; }
  .tile { padding: 12px; }
  .tile .num { font-size: 1.6rem; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.stack td { border: 0; padding: 3px 0; text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); font-size: 0.78rem; }
  table.stack td[data-label="Impact"]::before { content: ""; }
  table.stack .age { display: inline; }
  table.stack td.hide-sm { display: none; }
  .cols .unk { font-size: 0.6rem; }
  .bars li { grid-template-columns: 1fr 3em; }
  .stacks li { grid-template-columns: 1fr 2.4em; }
  .pairs li { grid-template-columns: 1fr; gap: 4px; }
  .stacks li .lab { grid-column: 1; grid-row: 1; }
  .stacks li .tot { grid-column: 2; grid-row: 1; }
  .stacks li .sbar { grid-column: 1 / -1; grid-row: 2; }
  .bars li .bar { grid-column: 1 / -1; grid-row: 2; }
  th, td { padding: 8px 6px; }
  .hide-sm { display: none; }
}
@media print {
  .side, .filters, .skip { display: none; }
  .layout { display: block; }
}
/* label names in tables */
th code { font-size: 0.8rem; font-weight: 600; }

/* disclaimer on the reference page */
.disclaimer { border-left: 4px solid var(--accent); }
.disclaimer p { margin: 6px 0 0; }

/* ===== Sage and forest, with a calmer layout =====
   Colours: ivory, sage and forest, with a deeper rose (#a34e48, 5.1:1 on ivory) for links and markers.
   Gold is decoration only. Status never relies on colour alone (see the end of this file). */

/* Quieter surfaces: more space, fewer filled boxes. */
.tiles, .goals { gap: 16px; margin-bottom: 20px; }
.grid2 { gap: 18px; margin-bottom: 18px; }
.panel { padding: 18px 22px; margin-bottom: 18px; }
.panel .take { background: transparent; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 0 0; }
.who li { background: none; color: var(--muted); padding: 0; border-radius: 0; }
.who li + li::before { content: "·"; margin-right: 6px; color: var(--muted); }
details.more { margin: -6px 0 12px; font-size: 0.82rem; color: var(--muted); }
details.more summary { cursor: pointer; color: var(--plum); font-weight: 600; }
details.more p { margin: 6px 0 0; }

/* Status that doesn't rely on colour: Off track is solid, Watch is tinted, On track is an outline. */
.status.on { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ok); }
.status.off { background: var(--bad); color: var(--bad-ink); }

/* "Explore": the second level of each view. Closed by default, one click to open; nothing inside is removed. */
details.explore { margin: 6px 0 18px; border-top: 1px solid var(--line); padding-top: 14px; }
details.explore > summary { cursor: pointer; list-style: none; display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
details.explore > summary::-webkit-details-marker { display: none; }
details.explore > summary .explore-title { font-weight: 600; color: var(--plum); }
details.explore > summary .explore-title::before { content: "▸ "; }
details.explore[open] > summary .explore-title::before { content: "▾ "; }
details.explore > summary .explore-sub { font-size: 0.85rem; color: var(--muted); }
details.explore[open] > summary { margin-bottom: 16px; }

/* The action list's extra rows: hidden until asked for, even where table rows become cards on phones. */
.stack tr[hidden] { display: none !important; }
.linkbtn { margin-top: 10px; background: transparent; border: 1px solid var(--field-line); color: var(--plum); font-weight: 600; border-radius: 8px; min-height: 40px; }
.linkbtn:hover { border-color: var(--plum); }

/* Numbers line up in columns and tiles, whatever the digits. */
.num, .big, .val, .tot, .pct, .kpi b, .donut-legend b, td.n, td.c, .age, .alongside, .heat td { font-variant-numeric: tabular-nums; }
h1 { font-weight: 650; }
.panel h2 { font-weight: 600; }
