/*
 * Archivo is self-hosted (see scripts/build-fonts.mjs). One variable family covers the whole
 * interface: normal width for reading, the condensed end of its width axis for return figures.
 * The unicode ranges let the browser skip the Latin Extended file unless a page needs it.
 */
@font-face {
  font-family: 'Archivo Variable'; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/assets/vendor/fonts/archivo-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Archivo Variable'; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/assets/vendor/fonts/archivo-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/*
 * Tokens. The palette borrows from an analyst's accounting pad: cool green-grey paper,
 * blue-black ink, a ledger green for "meets the hurdle / selected" and a red pencil for losses.
 * Chart equivalents live in web/charts/palette.js because ECharts cannot read CSS variables.
 */
:root {
  --page: #eef1ee; --paper: #fff; --sunk: #f6f8f6;
  --ink: #16202a; --ink-2: #3e4a52; --muted: #66727a; --faint: #8c979c;
  --line: #d3dad5; --soft-line: #e6ebe7;
  --forest: #1e6a4e; --forest-dark: #15523b; --soft-green: #e5f0ea;
  --negative: #b23a2e; --soft-negative: #f8e9e6;
  --warning: #8f5e12; --soft-warning: #f6eedd;
  --focus: #2f6f9f;
  /* Radii follow hierarchy: the sheet is softest, panels firmer, controls and tags tighter. */
  --radius-sheet: 12px; --radius: 8px; --radius-control: 6px; --radius-tag: 3px;
  --font: 'Archivo Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Type scale (≈1.2 ratio from a 14px body): 12 · 14 · 17 · 21 · 26 · 32. */
  --text-s: 12px; --text-m: 14px; --text-l: 17px; --text-xl: 21px; --text-2xl: 26px; --text-3xl: 32px;
  font-family: var(--font); font-size: var(--text-m); color: var(--ink); background: var(--page);
  font-variant-numeric: tabular-nums;
  font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--page); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--forest); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; border: 0; background: transparent; }
button:disabled { opacity: .55; cursor: wait; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input, textarea, select { border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--paper); color: var(--ink); }
input, textarea { padding: 10px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--ink-2); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }
p { line-height: 1.6; }
strong { font-weight: 600; }
small { color: var(--muted); font-size: var(--text-s); }
code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: var(--text-s); color: var(--ink-2); }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--paper); font-size: 13px; font-weight: 500; white-space: nowrap; }
.button:hover { background: var(--sunk); border-color: var(--faint); color: var(--ink); }
.button-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.button-primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.button-small { min-height: 32px; padding: 7px 10px; }
.button-small .icon { width: 15px; height: 15px; }
.icon-button { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: var(--radius-control); color: var(--muted); }
.icon-button:hover { background: var(--sunk); color: var(--ink); }
/* Text links read as links: underlined ink, not a coloured label with an arrow. */
.text-link { display: inline-flex; gap: 7px; align-items: center; color: var(--ink); font-weight: 500; font-size: 13px; padding: 0; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.text-link .icon { width: 14px; height: 14px; }
.text-link:hover { color: var(--forest); text-decoration-color: currentColor; }
.muted { color: var(--muted); }
.positive { color: var(--forest); }
.negative { color: var(--negative) !important; }
.warning-text { color: var(--warning); }
.pill { display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; line-height: 1.4; font-weight: 500; padding: 2px 6px; border-radius: var(--radius-tag); white-space: nowrap; }
.pill.draft { background: var(--soft-warning); color: var(--warning); }
.pill.neutral { background: var(--sunk); color: var(--muted); box-shadow: inset 0 0 0 1px var(--soft-line); }
.pill.primary-source { background: var(--soft-green); color: var(--forest); }
.status-dot { display: inline-block; width: 6px; height: 6px; background: var(--forest); border-radius: 50%; }
.separator { color: var(--faint); margin: 0 4px; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px #16202a08; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 14px; }
.section-heading h2 { font-size: var(--text-l); margin-bottom: 0; }
.section-heading p { font-size: var(--text-s); color: var(--muted); margin: 6px 0 0; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--soft-line); white-space: nowrap; }
th { font-weight: 550; color: var(--ink-2); font-size: 12px; }
thead th { background: var(--sunk); border-bottom: 1px solid var(--line); font-weight: 600; }
td { color: var(--ink-2); }
tbody tr:hover > td, tbody tr:hover > th[scope="row"] { background: #f8faf8; }
tbody tr:last-child > td, tbody tr:last-child > th { border-bottom: 0; }
.empty-inline { color: var(--muted); font-size: 13px; padding: 20px 24px; }
.error-banner { background: var(--soft-negative); border-left: 3px solid var(--negative); border-radius: var(--radius-tag); color: #7d2a21; font-size: 13px; padding: 12px 14px; margin: 12px 0; }
.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; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 12px; background: var(--paper); border: 2px solid var(--focus); }
.skip-link:focus { top: 8px; }
.initial-loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 30px; }
.initial-loading h1 { margin: 0; font-size: var(--text-2xl); font-stretch: 80%; }
.initial-loading p { color: var(--muted); font-size: 13px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; margin-left: auto; font-weight: 400; color: var(--muted); flex-shrink: 0; }
details[open] > summary::after { content: '−'; }
details.panel > summary { display: flex; align-items: center; gap: 14px; padding: 20px 26px; font-size: 13px; font-weight: 500; transition: background 120ms ease; }
details.panel > summary:hover { background: var(--sunk); }
details.panel > summary:focus-visible { outline-offset: -4px; }
details.panel > summary > span:not(.section-number) { margin-left: auto; font-size: var(--text-s); color: var(--muted); font-weight: 400; text-align: right; }
details.panel > summary:has(> span:not(.section-number))::after { margin-left: 0; }
details.panel > .panel { border: 0; border-top: 1px solid var(--soft-line); border-radius: 0; margin-bottom: 0; box-shadow: none; }
@media (max-width: 600px) { details.panel > summary { padding: 18px 20px; } }
.refreshing .icon { animation: rotate 1.2s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
