/* gimstamumas.lt — "Biuletenis"
 *
 * A bulletin, not a dashboard. Warm off-white canvas, near-black stone type,
 * one restrained orange, generous whitespace, strict 1200px grid, shallow
 * radii, almost no shadow. Numbers are set in mono at editorial size; prose
 * carries the explanation around them.
 *
 * CONTRAST. Every foreground token here clears 4.5:1 against every surface the
 * site paints, in both themes, and `tests/e2e/accessibility.spec.js` fails the
 * build if that stops being true. Three consequences worth knowing before
 * editing the palette:
 *
 *   - `--accent` (#E8590C) is a GRAPHIC colour only — the mark, the chart
 *     stroke, the focus ring, wash fills. It reaches 3.4:1, which clears the
 *     3:1 bar for non-text but not the 4.5:1 bar for text. Text that wants to
 *     look orange uses `--accent-ink`.
 *   - `--faint` is likewise non-text: hairlines and decorative strokes. The
 *     source design used a lighter grey for small labels; at that lightness
 *     nothing clears AA, so small labels use `--muted` and the hierarchy is
 *     carried by size and weight instead.
 *   - white on orange only clears AA from `--accent-strong` down, so any
 *     filled orange control uses that, never `--accent`.
 */

:root {
  color-scheme: light;

  --canvas: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --surface-3: #f6f4f0;

  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #6b6560;
  --faint: #a8a29b;

  --border: #e7e4de;
  --border-2: #f0eee9;
  --grid: #edebe6;
  --axis: #d6d1c9;

  --accent: #e8590c;
  --accent-ink: #bb3e09;
  --accent-strong: #9a3412;
  --accent-wash: rgba(232, 89, 12, 0.08);
  --accent-fill: rgba(232, 89, 12, 0.07);
  --accent-sel: rgba(232, 89, 12, 0.16);

  --up: #2b7a43;
  --down: #be3a2c;
  --flat: #6b6560;

  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-2: 0 6px 24px rgba(28, 25, 23, 0.09);
  --radius: 10px;
  --radius-lg: 12px;

  --ui: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
  --num: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo,
         Consolas, monospace;
  --maxw: 1200px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #161412;
    --surface: #1c1917;
    --surface-2: #211e1c;
    --surface-3: #262220;
    --ink: #edeae6;
    --ink-2: #c4beb7;
    --muted: #a8a099;
    --faint: #7c736c;
    --border: #302b27;
    --border-2: #262220;
    --grid: #262220;
    --axis: #423c36;
    --accent: #fb923c;
    --accent-ink: #fdba74;
    --accent-strong: #f97316;
    --accent-wash: rgba(251, 146, 60, 0.13);
    --accent-fill: rgba(251, 146, 60, 0.10);
    --accent-sel: rgba(251, 146, 60, 0.22);
    --up: #5fbe7a;
    --down: #f08a7c;
    --flat: #a8a099;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 6px 24px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #161412; --surface: #1c1917; --surface-2: #211e1c; --surface-3: #262220;
  --ink: #edeae6; --ink-2: #c4beb7; --muted: #a8a099; --faint: #7c736c;
  --border: #302b27; --border-2: #262220; --grid: #262220; --axis: #423c36;
  --accent: #fb923c; --accent-ink: #fdba74; --accent-strong: #f97316;
  --accent-wash: rgba(251, 146, 60, 0.13); --accent-fill: rgba(251, 146, 60, 0.10);
  --accent-sel: rgba(251, 146, 60, 0.22);
  --up: #5fbe7a; --down: #f08a7c; --flat: #a8a099;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45); --shadow-2: 0 6px 24px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }

/* The `hidden` attribute must actually hide. The UA rule is `[hidden]{display:none}`,
   which any component rule setting `display` outranks — so a hidden .btn stays
   visible, and a control that only works with scripting gets offered to readers
   who have none. */
[hidden] { display: none !important; }

/* Interface icons size to the text around them by default. Without this an
   inline SVG carrying only a viewBox expands to its container's width, which in
   a paragraph means an icon as wide as the column. Component rules below
   (.btn svg, .iconbtn svg, …) are more specific and still win. */
.ico { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }
/* No smooth scrolling. The site has no in-page anchor navigation to smooth —
 * only the skip link — and an animated scroll means any programmatic
 * scrollIntoView returns before the page has actually moved, which breaks
 * assistive tooling and automation for no reader-visible gain. */
html { -webkit-text-size-adjust: 100%; }

/* Entrance motion is opt-in, never the default state.
 *
 * The obvious way to write this — `animation: fadeUp .5s both` on the element —
 * makes `opacity: 0` the element's resting state and relies on the animation to
 * reveal it. Anything that stops the animation running then leaves the content
 * permanently invisible, on a site whose whole promise is answering fast. So
 * the elements are opaque by default and the animation is attached only where
 * the reader has expressed no objection to motion. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .hero, .sec { animation: fadeUp 0.5s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-sel); }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 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;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band-wash { background: var(--surface-2); }
.band-surface { background: var(--surface); }

/* ------------------------------------------------------------------ header */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}
.head-row {
  display: flex; align-items: center; gap: 28px;
  height: 64px; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  color: var(--ink); font-weight: 700; font-size: 16.5px; letter-spacing: -0.015em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand .glyph {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  background: var(--accent); display: grid; place-items: center;
}
.brand .glyph svg { width: 16px; height: 16px; }
.brand .dot { color: var(--muted); font-weight: 400; }

.head-nav { margin-left: auto; display: flex; gap: 26px; font-size: 14px; font-weight: 500; }
.head-nav a {
  color: var(--ink-2);
  /* WCAG 2.2 AA Target Size (Minimum): the line box alone is 22px, so the
     padding is what makes these reach 24. */
  padding: 5px 0; display: inline-flex; align-items: center;
}
.head-nav a:hover { color: var(--ink); text-decoration: none; }
.head-nav a[aria-current="page"] { color: var(--accent-ink); }

.head-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.langsw {
  display: inline-flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; font-size: 12px; font-weight: 600;
}
.langsw a { padding: 6px 11px; color: var(--muted); background: var(--surface); }
.langsw a:hover { color: var(--ink); text-decoration: none; }
.langsw a[aria-current="true"] { background: var(--accent-wash); color: var(--accent-ink); }

.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink-2);
}
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }
.iconbtn svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ search */
.searchbox { position: relative; flex: none; }
.searchbox input {
  width: 100%; height: 36px; padding: 0 16px 0 36px;
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox input:focus { border-color: var(--accent); }
.searchbox .ic {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.head-search { width: 232px; }
.hero-search { width: 100%; max-width: 440px; }
.hero-search input {
  height: 50px; font-size: 14.5px; padding: 0 22px 0 46px; box-shadow: var(--shadow);
}
.hero-search .ic { left: 20px; width: 16px; height: 16px; }

.results {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  max-height: min(60vh, 460px); overflow-y: auto; padding: 6px;
}
.results[hidden] { display: none; }
.results ul { margin: 0; padding: 0; }
.results li { list-style: none; }
.results a {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 12px;
  border-radius: 8px; color: var(--ink);
}
.results a:hover, .results a[aria-selected="true"] {
  background: var(--accent-wash); text-decoration: none;
}
.results .r-name { font-weight: 550; font-size: 14px; }
.results .r-val { font-family: var(--num); font-size: 12.5px; color: var(--ink-2); }
.results .r-topic { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.results .empty { padding: 14px 12px; color: var(--muted); font-size: 13.5px; }

/* -------------------------------------------------------------------- hero */
.hero {
  padding: 64px 0 52px;
  display: grid; grid-template-columns: 6fr 6fr; gap: 52px; align-items: center;
}
.eyebrow {
  margin: 0 0 16px; font-family: var(--num); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.hero h1 {
  margin: 0 0 14px; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05;
  letter-spacing: -0.032em; font-weight: 800; text-wrap: balance;
}
.hero .lede {
  margin: 0 0 26px; font-size: 16.5px; color: var(--ink-2);
  max-width: 46ch; text-wrap: pretty;
}
.hero-single { display: block; padding: 56px 0 36px; }
.hero-single .lede { max-width: 62ch; }

/* featured indicator card beside the hero */
.feature {
  display: block; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px 20px 12px;
  transition: border-color 0.14s ease;
}
.feature:hover { border-color: var(--accent); color: inherit; text-decoration: none; }
.feature-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.feature-name { font-size: 13.5px; font-weight: 600; }
.feature-per { font-family: var(--num); font-size: 11.5px; color: var(--muted); }
.feature-val {
  margin-left: auto; font-family: var(--num); font-size: 26px; font-weight: 600;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.feature-val .u { font-size: 14px; color: var(--muted); }
.feature svg.chart { margin-top: 4px; }

/* ------------------------------------------------------------- KPI ribbon */
.kpi-ribbon {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
}
.kpi {
  display: block; color: inherit; padding: 16px 16px 14px;
  border-left: 1px solid var(--border-2);
  transition: background 0.14s ease;
}
.kpi:first-child { border-left: 0; }
.kpi:hover { background: var(--canvas); color: inherit; text-decoration: none; }
.kpi .k-name {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi .k-val {
  margin-top: 4px; font-family: var(--num); font-size: 19px; font-weight: 600;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi .k-unit { font-size: 12px; color: var(--muted); }
.kpi .k-foot { margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.kpi .k-per { font-size: 11px; color: var(--muted); }
.k-chg {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--num); font-size: 11.5px; font-weight: 500;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.k-chg.up { color: var(--up); }
.k-chg.down { color: var(--down); }
.k-chg.flat { color: var(--flat); }

.spark { display: block; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }

/* ----------------------------------------------------- numbered sections */
.sec { padding: 64px 0; }
.sec-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.sec-num {
  margin: 0; font-family: var(--num); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--accent-ink); flex: none;
  display: inline-flex; align-items: baseline; gap: 10px;
}
/* A short rule after the number turns a bare "01" into a section marker. */
.sec-num::after {
  content: ""; width: 20px; height: 1px; background: var(--accent);
  transform: translateY(-4px);
}
.sec-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.sec-head .blurb { margin: 0; font-size: 13.5px; color: var(--muted); }
.sec-head .more { margin-left: auto; font-size: 13.5px; font-weight: 600; }

.section-title {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 34px 0 14px;
}
.section-title h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.section-title p { margin: 0; color: var(--muted); font-size: 13.5px; }
.section-title .more { margin-left: auto; font-size: 13.5px; font-weight: 600; }

/* ------------------------------------------------------------------ panels */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 15px 18px; border-bottom: 1px solid var(--border-2);
}
.panel-head h2, .panel-head h3 {
  margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em;
}
.panel-head .sub { font-size: 12.5px; color: var(--muted); }
.panel-head .more { margin-left: auto; font-size: 13px; font-weight: 600; }
.panel-body { padding: 16px 18px; }
.panel-head .tile {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--accent-wash); color: var(--accent-ink);
  display: grid; place-items: center;
}
.panel-head .tile .ico { width: 15px; height: 15px; }
.panel-head.with-tile { align-items: center; gap: 10px; }

/* Compact pill actions, for a panel header rather than a toolbar. */
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; font-weight: 600; }
.panel-body.tight { padding: 0; }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data caption {
  text-align: left; padding: 12px 18px; color: var(--muted); font-size: 12.5px;
}
table.data th, table.data td {
  padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--border-2);
}
table.data thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; white-space: nowrap;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
table.data tbody tr:hover { background: var(--canvas); }
table.data td.num, table.data th.num {
  text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data tbody th[scope="row"] { font-weight: 500; }
table.data tbody th a { color: var(--ink); font-weight: 500; }
table.data tbody th a:hover { color: var(--accent-ink); }
table.data td.spark-cell { width: 132px; padding-right: 18px; }

/* --------------------------------------------------------------- KPI cards */
.cards {
  display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cards > * { min-width: 0; }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: block; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px;
  transition: border-color 0.14s ease;
}
.card:hover { border-color: var(--accent); color: inherit; text-decoration: none; }
.card .c-name { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.card .c-val {
  margin-top: 6px; font-family: var(--num); font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.card .c-val .u { font-size: 13px; color: var(--muted); }
.card .c-foot { margin-top: 5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card .c-per { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.card .c-spark { margin-left: auto; }
.card .c-spark svg { width: 96px; height: 26px; }

/* -------------------------------------------------------- indicator header */
.ind-head { padding: 34px 0 6px; }
.ind-hero { display: grid; grid-template-columns: 7fr 5fr; gap: 52px; align-items: end; }
.ind-hero > * { min-width: 0; }

.ind-eyebrow { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.ind-eyebrow .tile {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--accent-wash); color: var(--accent-ink);
  display: grid; place-items: center;
}
.ind-eyebrow .tile .ico { width: 17px; height: 17px; }
.ind-eyebrow p {
  margin: 0; font-family: var(--num); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink);
}
.ind-lede { margin: 0; font-size: 15.5px; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }

/* The headline figure, lifted out of the flow into a card of its own. */
.figure-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 22px;
}
.figure-card .row { display: flex; align-items: baseline; gap: 10px; }
.figure-card .figure {
  font-family: var(--num); font-size: clamp(38px, 5vw, 52px); font-weight: 600;
  letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums;
}
.figure-card .figure .u {
  font-size: 0.5em; font-weight: 600; color: var(--ink-2); margin-left: 0.06em;
}
.figure-card .when {
  margin-left: auto; font-family: var(--num); font-size: 12.5px; color: var(--muted);
  text-align: right;
}
.figure-card .foot {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-2);
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  font-family: var(--num); font-size: 13px;
}
.figure-card .foot .k-per { font-size: 12px; }

/* ---- metadata band: hairlines rather than a box, six columns with icons -- */
.metaband {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 18px 0; margin: 24px 0 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px;
}
.metaband dt {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--muted); margin-bottom: 4px;
}
.metaband dt .ico { width: 13px; height: 13px; color: var(--faint); }
.metaband dd {
  margin: 0; font-family: var(--num); font-size: 12.5px; color: var(--ink);
  overflow-wrap: anywhere;
}
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs span { margin: 0 7px; color: var(--faint); }
.ind-head h1 {
  margin: 0 0 5px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12;
  letter-spacing: -0.028em; font-weight: 800; text-wrap: balance;
}
.ind-head .pub { font-size: 13.5px; color: var(--muted); margin: 0 0 22px; }
.ind-head .pub code {
  font-family: var(--num); font-size: 12.5px; color: var(--ink-2);
}

.figure-row { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.figure {
  font-family: var(--num); font-size: clamp(40px, 6.4vw, 58px); font-weight: 600;
  letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums;
}
.figure .u { font-size: 0.4em; color: var(--muted); font-weight: 500; margin-left: 5px; }
.figure-side { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.figure-side .when { font-size: 13.5px; color: var(--ink-2); }
.figure-side .k-chg { font-size: 14px; }


.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; vertical-align: 1px;
}
.badge.prelim { background: var(--accent-wash); color: var(--accent-ink); }
.badge.revised { background: var(--surface-2); color: var(--ink-2); }
.badge.stale { background: var(--accent-wash); color: var(--accent-ink); }
.badge.estimate { background: var(--surface-2); color: var(--ink-2); }
.badge.computed { background: var(--surface-2); color: var(--ink-2); }

.notice {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 17px; margin: 18px 0; font-size: 13.5px; color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice.gate { border-left-color: var(--accent); }

/* ------------------------------------------------------------------ charts */
.chart-panel .panel-body { padding: 10px 12px 14px; }
/* Segmented controls: a recessed track with a solid pill on the active choice,
   which reads as a switch rather than as a row of buttons. */
.rangebar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rangebar .grp {
  display: inline-flex; gap: 4px; padding: 3px;
  background: var(--surface-3); border-radius: 999px;
}
.rangebar button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 600;
  background: transparent; color: var(--ink-2); cursor: pointer;
  white-space: nowrap;
}
.rangebar .grp.mono button { font-family: var(--num); font-size: 11.5px; padding: 0 11px; }
.rangebar button:hover { color: var(--ink); }
.rangebar button[aria-pressed="true"] {
  background: var(--ink); color: var(--canvas);
}

.chart-holder { position: relative; }
svg.chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
svg.chart .gridline { stroke: var(--grid); stroke-width: 1; }
svg.chart .axisline { stroke: var(--axis); stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--num); }
svg.chart .line {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
}
svg.chart .line.b { stroke: var(--ink-2); stroke-dasharray: 5 4; }
svg.chart .area { fill: var(--accent-fill); stroke: none; }
svg.chart .dot { fill: var(--accent); }
svg.chart .cross { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
/* The lead illustration is drawn on a smaller box, so its stroke needs less
   scaling up to read at the same visual weight as a full-width chart. */
svg.chart-lead .line { stroke-width: 1.6; }
svg.chart .hit { fill: transparent; }

.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 132px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-2); padding: 9px 11px; font-size: 12.5px;
}
.tip[hidden] { display: none; }
.tip .t-per { color: var(--muted); font-size: 11.5px; }
.tip .t-val { font-family: var(--num); font-size: 15px; font-weight: 600; margin-top: 2px; }
.tip .t-st { font-size: 11px; color: var(--accent-ink); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 6px 8px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ----------------------------------------------------------------- buttons */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 550;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
}
.btn:hover { background: var(--surface-3); color: var(--ink); border-color: var(--axis); text-decoration: none; }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
}
.chip .ico { color: var(--accent-ink); width: 14px; height: 14px; }
.chip:hover, .chip[aria-current="page"] {
  background: var(--accent-wash); color: var(--accent-ink);
  border-color: var(--accent); text-decoration: none;
}

/* -------------------------------------------------------------- topic grid */
.topic-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.topic-card {
  display: block; color: inherit; padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.topic-card:hover { border-color: var(--accent); color: inherit; text-decoration: none; }
.topic-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.topic-card p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ trust strip */
.trust {
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.trust div h3 {
  margin: 0 0 5px; font-size: 13px; font-weight: 650;
  display: flex; align-items: baseline; gap: 8px;
}
.trust div h3::before {
  content: ""; width: 18px; height: 2px; background: var(--accent); flex: none;
  transform: translateY(-4px);
}
.trust div p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ------------------------------------------------------------------ footer */
.site-foot {
  border-top: 1px solid var(--border); margin-top: 72px; padding: 40px 0 56px;
  font-size: 13px; color: var(--muted); background: var(--canvas);
}
.foot-top { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 30px; }
.foot-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.foot-brand .glyph {
  width: 24px; height: 24px; border-radius: 6px; background: var(--accent);
  display: grid; place-items: center; flex: none;
}
.foot-brand .glyph svg { width: 13px; height: 13px; }
.foot-brand .dot { color: var(--muted); font-weight: 400; }
.foot-tagline { margin: 0; font-size: 14px; font-weight: 550; color: var(--ink-2); }
.foot-note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); max-width: 56ch; line-height: 1.6; }
.foot-links { margin-left: auto; display: flex; gap: 20px; font-size: 13px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--accent-ink); }
.foot-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.foot-grid h2 {
  margin: 0 0 9px; font-family: var(--num); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); font-weight: 500;
}
.foot-grid ul { margin: 0; padding: 0; list-style: none; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid a { color: var(--ink-2); }
.foot-grid a:hover { color: var(--accent-ink); }

/* ------------------------------------------------------------------- prose */
.prose { font-size: 14.5px; color: var(--ink-2); line-height: 1.68; }
.prose p { margin: 0 0 12px; max-width: 72ch; }
.prose p:last-child { margin-bottom: 0; }
.prose h2, .prose h3 { font-size: 14px; color: var(--ink); margin: 20px 0 6px; font-weight: 650; }
.prose a .ico { margin-left: 4px; opacity: 0.75; }
.prose code {
  font-family: var(--num); font-size: 12.5px; background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px;
}

.cols2 { display: grid; gap: 26px; grid-template-columns: 7fr 5fr; align-items: start; }
/* A grid item defaults to min-width:auto, which is its content's min-content
   width. A panel holding a nowrap data table therefore refuses to shrink and
   pushes the whole document into a horizontal scroll, defeating the .tbl-wrap
   scroll container inside it. */
.cols2 > * { min-width: 0; }

/* ----------------------------------------------------------------- compare */
.cmp-picker { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cmp-picker label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.cmp-picker select {
  width: 100%; height: 40px; font: inherit; font-size: 13.5px; padding: 0 12px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.cmp-picker select:focus { border-color: var(--accent); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding: 48px 0 40px; }
  .kpi-ribbon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--border-2); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols2 { grid-template-columns: 1fr; }
  .ind-hero { grid-template-columns: 1fr; gap: 26px; align-items: start; }
  .metaband { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 860px) {
  /* The nav becomes a second row that scrolls sideways rather than disappearing:
     hiding it would leave the footer as the only route to any other page. */
  .head-row { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; gap: 12px; }
  .head-tools { margin-left: auto; }
  .head-search { width: 180px; }
  .head-nav {
    /* flex-basis rather than width:100% plus negative margins — that combination
       makes the row 2×gutter wider than its container and pushes the whole
       document into a horizontal scroll. */
    order: 3; flex: 1 0 100%; margin: 0; padding: 0 0 4px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    gap: 20px;
  }
  .head-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 620px) {
  :root { --gutter: 16px; }
  .kpi-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:not(:nth-last-child(-n+2)) { border-bottom: 1px solid var(--border-2); }
  .cards { grid-template-columns: 1fr; }
  .brand span.word { display: none; }
  .head-search { width: 140px; }
  .metaband { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec { padding: 44px 0; }
  .sec-head { gap: 10px; }
  .sec-head .more { margin-left: 0; width: 100%; }
  .foot-links { margin-left: 0; width: 100%; }
}

@media print {
  .site-head, .site-foot, .actions, .rangebar, .skip { display: none; }
  body { background: #fff; }
  .panel { break-inside: avoid; box-shadow: none; }
}
