/* import.tax — site styles. Tokens first; the chart reads them via CSS vars. */

:root {
  color-scheme: light;
  --plane:          #f9f9f7;
  --surface:        #fcfcfb;
  --ink:            #0b0b0b;
  --ink-2:          #52514e;
  --muted:          #898781;
  --grid:           #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11, 11, 11, 0.10);
  --accent:         #2a78d6;
  --series-imp:     #2a78d6;
  --series-exp:     #eb6834;
  --wash-imp:       rgba(42, 120, 214, 0.10);
  --wash-exp:       rgba(235, 104, 52, 0.10);
  --good-text:      #006300;
  --hover-wash:     rgba(11, 11, 11, 0.045);
  --shadow:         0 1px 2px rgba(11, 11, 11, 0.05), 0 4px 16px rgba(11, 11, 11, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane:      #0d0d0d;
    --surface:    #1a1a19;
    --ink:        #ffffff;
    --ink-2:      #c3c2b7;
    --muted:      #898781;
    --grid:       #2c2c2a;
    --baseline:   #383835;
    --border:     rgba(255, 255, 255, 0.10);
    --accent:     #3987e5;
    --series-imp: #3987e5;
    --series-exp: #d95926;
    --wash-imp:   rgba(57, 135, 229, 0.12);
    --wash-exp:   rgba(217, 89, 38, 0.12);
    --good-text:  #0ca30c;
    --hover-wash: rgba(255, 255, 255, 0.06);
    --shadow:     0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane:      #0d0d0d;
  --surface:    #1a1a19;
  --ink:        #ffffff;
  --ink-2:      #c3c2b7;
  --muted:      #898781;
  --grid:       #2c2c2a;
  --baseline:   #383835;
  --border:     rgba(255, 255, 255, 0.10);
  --accent:     #3987e5;
  --series-imp: #3987e5;
  --series-exp: #d95926;
  --wash-imp:   rgba(57, 135, 229, 0.12);
  --wash-exp:   rgba(217, 89, 38, 0.12);
  --good-text:  #0ca30c;
  --hover-wash: rgba(255, 255, 255, 0.06);
  --shadow:     0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- header / footer ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}
.wordmark {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark-dot { color: var(--accent); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 15px;
}
.site-nav a:hover { background: var(--hover-wash); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.theme-toggle {
  margin-left: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-2);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--hover-wash); }
.tt-sun  { fill: currentColor; display: none; }
.tt-moon { fill: currentColor; }
:root[data-theme="dark"] .tt-sun  { display: block; }
:root[data-theme="dark"] .tt-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .tt-sun  { display: block; }
  :root:where(:not([data-theme="light"])) .tt-moon { display: none; }
}

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
}
.site-footer p {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 70ch;
}

/* ---------- home ---------- */

.hero { padding: 56px 0 8px; max-width: 46rem; }
.hero h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.hero-sub {
  color: var(--ink-2);
  font-size: 17.5px;
  margin: 0 0 24px;
}
.hero-cta { margin: 0 0 8px; }

.btn {
  display: inline-block;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.07); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--border);
  padding: 5px 12px;
  font-size: 13.5px;
  font-weight: 500;
}
.btn-ghost:hover { background: var(--hover-wash); }
.btn-ghost[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--baseline);
  background: var(--hover-wash);
}

/* ---------- KPI tiles ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0 0;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.tile-label {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.tile-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.tile-delta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------- cards (home) ---------- */

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card-link { color: inherit; display: block; }
.card-link:hover {
  text-decoration: none;
  border-color: var(--baseline);
  box-shadow: var(--shadow);
}
.card-go {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14.5px;
}

/* ---------- explorer: page head + filters ---------- */

.page-head { padding: 34px 0 4px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.015em; }
.page-sub { margin: 0; color: var(--ink-2); max-width: 56rem; }

.filter-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin: 22px 0 0;
}
.filters-title {
  grid-column: 1 / -1;
  margin: 0 0 -6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.combobox { position: relative; }
.combobox input {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 34px 9px 12px;
  font: inherit;
  font-size: 15px;
}
.combobox input::placeholder { color: var(--muted); }
.combobox input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.combo-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
}
.combo-clear:hover { background: var(--hover-wash); color: var(--ink); }

.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 340px;
  overflow-y: auto;
}
.combo-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.combo-list li:hover { background: var(--hover-wash); }
.combo-list li[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.combo-code {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.combo-desc {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.combo-tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  white-space: nowrap;
}
.combo-note {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: default;
}
.combo-note:hover { background: none; }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.seg button:hover { background: var(--hover-wash); }
.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ---------- helpers: composition + top countries ---------- */

.helper {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 8px;
  transition: opacity 0.15s ease;
}
.helper.is-loading { opacity: 0.45; }
.helper-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 0 6px 6px;
}
.helper-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.helper-period { font-size: 12px; color: var(--muted); white-space: nowrap; }
.helper-list { list-style: none; margin: 0; padding: 0; }
.helper-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "code name val" "bar bar pct";
  column-gap: 8px;
  row-gap: 3px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.helper-row.no-code {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name val" "bar pct";
}
.helper-row:hover { background: var(--hover-wash); }
.h-code { grid-area: code; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.h-name { grid-area: name; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-val  { grid-area: val; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.h-bar  { grid-area: bar; height: 4px; background: var(--grid); border-radius: 2px; overflow: hidden; }
.h-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.h-pct  { grid-area: pct; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; min-width: 34px; }
.helper-other { font-size: 12.5px; color: var(--muted); padding: 6px 6px 2px; }
.helper-empty { margin: 0; padding: 2px 6px 4px; font-size: 13px; color: var(--muted); }

/* ---------- continuity note (family / renumbered codes) ---------- */

.hs-note {
  margin: 14px 0 0;
  padding: 12px 14px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.hs-note p { margin: 0; }
.hs-note p + p { margin-top: 6px; }
.hs-note strong { color: var(--ink); font-weight: 600; }
.hs-note .note-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-small {
  padding: 5px 12px;
  font-size: 13.5px;
  border-radius: 7px;
}
.btn-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hs-note.is-muted { border-left-color: var(--baseline); }

/* ---------- chart card ---------- */

.chart-card {
  margin: 20px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 12px;
}
.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-head > div:first-child { flex: 1 1 300px; min-width: 0; }
.chart-tools { flex: 0 0 auto; }
.chart-title { font-weight: 650; font-size: 16.5px; }
.chart-sub { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.chart-tools { display: flex; align-items: center; gap: 12px; }

.legend { display: flex; gap: 4px; }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.legend-item:hover { background: var(--hover-wash); }
.legend-item[aria-pressed="false"] { opacity: 0.42; }
.legend-key {
  width: 16px;
  height: 0;
  border-top: 3px solid;
  border-radius: 2px;
}
.key-imp { border-color: var(--series-imp); }
.key-exp { border-color: var(--series-exp); }

.chart-body { position: relative; }
.chart-plot {
  position: relative;
  min-height: 300px;
  transition: opacity 0.15s ease;
}
.chart-plot.is-loading { opacity: 0.45; }
.chart-plot svg { display: block; width: 100%; height: auto; }

/* chart furniture — all colors via tokens so theme flips restyle instantly */
.ax-grid   { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ax-base   { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.ax-text   { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.series-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.line-imp  { stroke: var(--series-imp); }
.line-exp  { stroke: var(--series-exp); }
.dot       { stroke: var(--surface); stroke-width: 2; }
.dot-imp   { fill: var(--series-imp); }
.dot-exp   { fill: var(--series-exp); }
.end-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.leader    { stroke: var(--baseline); stroke-width: 1; }
.crosshair { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }

.chart-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px 11px;
  min-width: 170px;
  font-size: 13px;
}
.tip-head {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
  font-size: 12.5px;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 1.5px 0;
}
.tip-key { width: 12px; height: 0; border-top: 3px solid; border-radius: 2px; }
.tip-key.key-none { border-color: transparent; }
.tip-val { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tip-name { color: var(--ink-2); }
.tip-minor { color: var(--muted); font-size: 12px; }

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-2);
  padding: 24px;
}
.chart-empty p { margin: 3px 0; font-size: 14.5px; }

/* ---------- table view ---------- */

.chart-table { overflow-x: auto; margin-top: 4px; }
.chart-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.chart-table caption {
  text-align: left;
  color: var(--muted);
  font-size: 12.5px;
  padding-bottom: 6px;
}
.chart-table th, .chart-table td {
  text-align: right;
  padding: 6px 10px;
  border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th {
  color: var(--ink-2);
  font-weight: 600;
  border-bottom: 1px solid var(--baseline);
}
.chart-table td { color: var(--ink); }

.fine-print {
  color: var(--muted);
  font-size: 13px;
  max-width: 76ch;
  margin: 14px 2px 0;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .filter-row { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile-value { font-size: 21px; }
  .hero { padding-top: 36px; }
  .chart-card { padding: 12px 10px 8px; }
  .site-nav a { padding: 6px 7px; font-size: 14px; }
}

/* =====================================================================
   Tariffs — shared by /tariffs, /tariffs/product, /measure(s), /changes,
   /country. Programme families keep one colour everywhere (the reference
   palette's validated slots, light and dark); the base rate is muted ink.
   ===================================================================== */

:root {
  --f-base: #898781;
  --f-301: #2a78d6;  --f-232: #eb6834;  --f-338: #1baf7a;  --f-201: #eda100;
  --f-ieepa: #e87ba4; --f-other: #008300; --f-122: #4a3aa7; --f-col2: #e34948;
  --ok-bg: rgba(0, 131, 0, 0.09);   --ok-ink: #006300;
  --off-bg: rgba(11, 11, 11, 0.06); --off-ink: #52514e;
  --warn-bg: rgba(250, 178, 25, 0.16); --warn-ink: #7a5200;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --f-base: #898781;
    --f-301: #3987e5;  --f-232: #d95926;  --f-338: #199e70;  --f-201: #c98500;
    --f-ieepa: #d55181; --f-other: #008300; --f-122: #9085e9; --f-col2: #e66767;
    --ok-bg: rgba(12, 163, 12, 0.14);  --ok-ink: #0ca30c;
    --off-bg: rgba(255, 255, 255, 0.07); --off-ink: #c3c2b7;
    --warn-bg: rgba(250, 178, 25, 0.14); --warn-ink: #fab219;
  }
}
:root[data-theme="dark"] {
  --f-base: #898781;
  --f-301: #3987e5;  --f-232: #d95926;  --f-338: #199e70;  --f-201: #c98500;
  --f-ieepa: #d55181; --f-other: #008300; --f-122: #9085e9; --f-col2: #e66767;
  --ok-bg: rgba(12, 163, 12, 0.14);  --ok-ink: #0ca30c;
  --off-bg: rgba(255, 255, 255, 0.07); --off-ink: #c3c2b7;
  --warn-bg: rgba(250, 178, 25, 0.14); --warn-ink: #fab219;
}

.f-base  { --c: var(--f-base); }   .f-301 { --c: var(--f-301); }  .f-232 { --c: var(--f-232); }
.f-338   { --c: var(--f-338); }    .f-201 { --c: var(--f-201); }  .f-ieepa { --c: var(--f-ieepa); }
.f-122   { --c: var(--f-122); }    .f-col2 { --c: var(--f-col2); } .f-other { --c: var(--f-other); }

/* chart series classes used by tlib's LineChart */
.series-line.s1 { stroke: var(--f-301); }  .dot.s1, .tip-key.s1 { fill: var(--f-301); border-color: var(--f-301); }
.series-line.s2 { stroke: var(--f-232); }  .dot.s2, .tip-key.s2 { fill: var(--f-232); border-color: var(--f-232); }
.series-line.s3 { stroke: var(--f-338); }  .dot.s3, .tip-key.s3 { fill: var(--f-338); border-color: var(--f-338); }
.series-line.s4 { stroke: var(--f-201); }  .dot.s4, .tip-key.s4 { fill: var(--f-201); border-color: var(--f-201); }
.series-line.s5 { stroke: var(--f-ieepa); } .dot.s5, .tip-key.s5 { fill: var(--f-ieepa); border-color: var(--f-ieepa); }
.series-line.sx { stroke: var(--muted); }  .dot.sx, .tip-key.sx { fill: var(--muted); border-color: var(--muted); }
.series-line.is-context { stroke-width: 1.5; }
.tip-indent { padding-left: 19px; }
.chart-empty-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); font-size: 14.5px; text-align: center; padding: 24px;
}
.chart-plot:focus-visible { outline-offset: 4px; }

/* ---------- page furniture ---------- */

.crumbs { margin: 26px 0 0; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.crumbs span[aria-hidden] { margin: 0 6px; }
.section { margin: 34px 0 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0 0 10px;
}
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.section-note { margin: 0; color: var(--muted); font-size: 13.5px; }
.lede { color: var(--ink-2); max-width: 60rem; margin: 6px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
a.ext::after { content: " \2197"; font-size: 0.85em; }
a.hlink { font-variant-numeric: tabular-nums; white-space: nowrap; }

.card-plain {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}

.badge {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.6; padding: 0 8px;
  border-radius: 999px; background: var(--off-bg); color: var(--off-ink); white-space: nowrap;
}
.badge.is-on { background: var(--ok-bg); color: var(--ok-ink); }
.badge.is-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.is-pending { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.fam-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c);
  margin-right: 6px; vertical-align: 0.02em; flex: none;
}

/* ---------- lookup card (product + origin) ---------- */

.lookup {
  margin: 20px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: grid; gap: 12px;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) auto; align-items: end;
}
.lookup .filter-label { display: block; margin-bottom: 5px; }
.lookup .btn { white-space: nowrap; }
.lookup-examples { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.chip {
  border: 1px solid var(--border); background: transparent; color: var(--ink-2); border-radius: 999px;
  padding: 3px 11px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none;
}
.chip:hover { background: var(--hover-wash); text-decoration: none; }
.combo-list li.combo-line { display: block; }
.cl-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cl-sub { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.cl-imp { color: var(--ink-2); }

/* ---------- product header ---------- */

.prod-head { margin: 22px 0 0; }
.prod-code { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.prod-head h1 { margin: 2px 0 6px; font-size: clamp(22px, 3.2vw, 28px); line-height: 1.2; letter-spacing: -0.015em; }
.prod-path { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 70rem; }
.prod-path span + span::before { content: " \203a  "; }
.prod-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }

/* ---------- answer + paid ---------- */

.answer-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px; margin: 18px 0 0; align-items: start; }
.answer { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px 14px; }
.answer-label { font-size: 13.5px; color: var(--ink-2); }
.answer-hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 2px 0 2px; }
.hero-num { font-size: 52px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; }
.hero-num.is-text { font-size: 26px; letter-spacing: -0.01em; line-height: 1.25; }
.hero-side { color: var(--ink-2); font-size: 14px; }
.answer-alt { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.answer-alt strong { color: var(--ink); }
.answer .sbar { margin: 12px 0 4px; }

.receipt { width: 100%; border-collapse: collapse; margin: 12px 0 2px; font-size: 14.5px; }
.receipt td { padding: 7px 0; vertical-align: top; border-bottom: 1px solid var(--grid); }
.receipt td.r-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 12px; }
.receipt tr.r-total td { border-bottom: 0; border-top: 1px solid var(--baseline); font-weight: 650; font-size: 15.5px; padding-top: 9px; }
.r-name { display: flex; align-items: baseline; gap: 0; flex-wrap: wrap; }
.r-name .hlink { font-weight: 600; margin-right: 8px; }
.r-why { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }

.buckets { margin: 12px 0 0; border-top: 1px solid var(--grid); }
.bucket { border-bottom: 1px solid var(--grid); }
.bucket > summary {
  list-style: none; cursor: pointer; padding: 9px 0; display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.bucket > summary::-webkit-details-marker { display: none; }
.bucket > summary::before { content: "\25B8"; color: var(--muted); font-size: 12px; width: 12px; }
.bucket[open] > summary::before { content: "\25BE"; }
.bucket > summary .muted { font-weight: 400; font-size: 13px; }
.bucket-list { list-style: none; margin: 0 0 10px; padding: 0 0 0 20px; }
.bucket-list li { padding: 6px 0; font-size: 13.5px; border-top: 1px dashed transparent; }
.bucket-list li + li { border-top-color: var(--grid); }
.b-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.b-rate { font-weight: 600; font-variant-numeric: tabular-nums; }
.is-struck .b-rate { text-decoration: line-through; color: var(--muted); }
.is-off .b-line { color: var(--ink-2); }
.b-why { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; line-height: 1.45; }

.paid { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.paid h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.paid-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.paid-row:last-of-type { border-bottom: 0; }
.paid-val { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.paid-sub { color: var(--muted); font-size: 12.5px; text-align: right; }
.paid-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.gap-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--ink); font-size: 13px; }

.ratecard { width: 100%; border-collapse: collapse; font-size: 14px; }
.ratecard th, .ratecard td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
.ratecard th { width: 150px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.prog-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.prog-list li { font-size: 13px; color: var(--ink-2); }
.prog-list .spi { display: inline-block; min-width: 30px; font-weight: 600; color: var(--ink); }

/* ---------- composition bars ---------- */

.sbar { display: block; height: 10px; width: 100%; position: relative; }
.sbar-fill { display: flex; gap: 2px; height: 100%; width: var(--fill); min-width: 2px; }
.sbar-seg { background: var(--c); height: 100%; min-width: 2px; flex-basis: 0; }
.sbar-seg:first-child { border-radius: 0; }
.sbar-seg:last-child { border-radius: 0 4px 4px 0; }
.sbar.is-thin { height: 8px; }
.fam-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin: 8px 0 0; }
.fam-item { display: inline-flex; align-items: center; gap: 6px; }
.fam-key { width: 12px; height: 8px; border-radius: 2px; background: var(--c); }

/* ---------- data tables ---------- */

.dtable-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th, .dtable td { padding: 8px 12px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: middle; }
.dtable thead th { font-size: 12.5px; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--baseline); white-space: nowrap; background: var(--surface); }
.dtable td.n, .dtable th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr.is-link { cursor: pointer; }
.dtable tbody tr.is-link:hover td { background: var(--hover-wash); }
.dtable tbody tr.is-current td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dtable .bar-cell { min-width: 150px; width: 30%; }
.bar-with-label { display: flex; align-items: center; gap: 8px; }
.bar-with-label .sbar { flex: 1; }
.bar-with-label .lbl { min-width: 54px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable .desc { max-width: 460px; }
.dtable .desc small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 460px; }
.sort-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: 600; }
.sort-btn[aria-sort="descending"]::after { content: " \25BE"; }
.sort-btn[aria-sort="ascending"]::after { content: " \25B4"; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--grid); }
.spark { display: block; }
.spark-line { fill: none; stroke: var(--f-301); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--f-301); }
.delta-up { color: var(--ink); }
.delta-down { color: var(--ink); }

/* ---------- rate ladder (all origins grouped by rate) ---------- */

.ladder { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.rung { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 14px; padding: 12px 16px; border-bottom: 1px solid var(--grid); }
.rung:last-child { border-bottom: 0; }
.rung-rate { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rung-rate small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.rung-why { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.rung-cty { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cty-chip {
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; font-size: 13px; background: transparent;
  color: var(--ink); cursor: pointer; font: inherit; font-size: 13px;
}
.cty-chip:hover { background: var(--hover-wash); }
.cty-chip .muted { font-size: 12px; }
.cty-chip.is-current { border-color: var(--accent); }

/* ---------- mini timelines (duties in force, measure periods) ---------- */

.tl { margin: 6px 0 0; }
.tl-axis { position: relative; height: 18px; margin-left: var(--tl-label); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-row { display: grid; grid-template-columns: var(--tl-label) minmax(0, 1fr); align-items: center; min-height: 30px; border-top: 1px solid var(--grid); }
.tl-name { font-size: 13px; padding-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; height: 30px; }
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--grid); }
.tl-bar {
  position: absolute; top: 8px; height: 14px; background: var(--c); border-radius: 0 4px 4px 0; min-width: 3px;
  font-size: 11px; line-height: 14px; color: #fff; padding: 0 4px; overflow: visible; white-space: nowrap;
}
.tl-bar.is-off { background: transparent; border: 1px solid var(--baseline); border-radius: 0 4px 4px 0; top: 9px; height: 12px; }
.tl-bar .tl-lbl { position: absolute; left: 4px; top: 0; color: #fff; font-weight: 600; }
.tl-bar.is-narrow .tl-lbl { left: calc(100% + 4px); color: var(--ink-2); }
.tl-bar.is-off .tl-lbl { color: var(--muted); font-weight: 400; }
.tl-today { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--ink-2); }

/* ---------- feed (changes) ---------- */

.feed { list-style: none; margin: 0; padding: 0; }
.feed-day { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--grid); }
.feed-day:first-child { border-top: 0; }
.feed-date { font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.feed-date small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.feed-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed-item { font-size: 14px; }
.feed-item .k { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-right: 6px; }
.feed-item .t { color: var(--ink); }
.feed-item .d { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.feed-group > summary { cursor: pointer; list-style: none; }
.feed-group > summary::-webkit-details-marker { display: none; }
.feed-group > summary::after { content: " \25B8"; color: var(--muted); font-size: 11px; }
.feed-group[open] > summary::after { content: " \25BE"; }
.feed-group ul { margin: 6px 0 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); }
.feed-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 16px; }

/* ---------- programmes (hub) ---------- */

.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.prog-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: block; color: inherit; }
a.prog-card:hover { text-decoration: none; border-color: var(--baseline); box-shadow: var(--shadow); }
.prog-card h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: baseline; gap: 2px; }
.prog-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.prog-card .rates { font-weight: 650; color: var(--ink); font-size: 14px; }
.prog-card.is-ended { background: transparent; }

/* ---------- filters row (index pages) ---------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 18px 0 12px; }
.toolbar .search {
  flex: 1 1 260px; min-width: 200px; background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 14.5px;
}
.toolbar .search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.toolbar .count { color: var(--muted); font-size: 13px; }

.group-head { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 8px; font-size: 16px; font-weight: 650; }
.group-head .muted { font-size: 13px; font-weight: 400; }

.facts { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px; margin: 0; }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid var(--grid); margin: 0; }
.facts dt { color: var(--ink-2); font-weight: 600; font-size: 13.5px; padding-right: 12px; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.legal-text { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.legal-text p { margin: 0 0 8px; }
.legal-text .path { font-weight: 650; color: var(--ink); margin-right: 6px; }
.more-btn { margin-top: 8px; }

.bands { margin: 8px 0 0; }
.bands-bar { display: flex; gap: 2px; height: 18px; }
.bands-bar span { height: 100%; min-width: 2px; background: var(--c); }
.bands-bar span:first-child { border-radius: 0; }
.bands-bar span:last-child { border-radius: 0 4px 4px 0; }
.bands-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; margin: 10px 0 0; font-size: 13px; }
.bands-legend div { display: flex; align-items: center; gap: 7px; }
.bands-legend b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }
/* rate bands: a validated ordinal ramp (blue 250->700 light; 600->150 dark, low values recede) */
.o1 { --c: #86b6ef; } .o2 { --c: #5598e7; } .o3 { --c: #2a78d6; } .o4 { --c: #1c5cab; } .o5 { --c: #0d366b; }
.ox { --c: var(--baseline); } .oy { --c: var(--grid); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .o1 { --c: #184f95; }
  :root:where(:not([data-theme="light"])) .o2 { --c: #256abf; }
  :root:where(:not([data-theme="light"])) .o3 { --c: #3987e5; }
  :root:where(:not([data-theme="light"])) .o4 { --c: #6da7ec; }
  :root:where(:not([data-theme="light"])) .o5 { --c: #b7d3f6; }
}
:root[data-theme="dark"] .o1 { --c: #184f95; }
:root[data-theme="dark"] .o2 { --c: #256abf; }
:root[data-theme="dark"] .o3 { --c: #3987e5; }
:root[data-theme="dark"] .o4 { --c: #6da7ec; }
:root[data-theme="dark"] .o5 { --c: #b7d3f6; }
.bands-legend .key { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }

@media (max-width: 860px) {
  .lookup { grid-template-columns: 1fr; }
  .answer-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .feed-day { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 560px) {
  .hero-num { font-size: 42px; }
  .rung { grid-template-columns: 1fr; }
  .dtable th, .dtable td { padding: 7px 8px; }
  .hide-sm { display: none; }
}
.page-title-lg { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.015em; }
#prod.is-loading .answer, #prod.is-loading .paid { opacity: 0.5; transition: opacity 0.15s ease; }
.tile-value-sm { font-size: 20px; line-height: 1.3; }
.compare-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin: 10px 0 6px; }
.compare-row .fam-legend { margin: 0; flex: 1 1 320px; }
.compare-add { flex: 0 1 260px; min-width: 200px; }
.compare-add .combobox input { padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.legend-chip { border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.legend-chip .legend-key { width: 14px; }
.chip-x { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 5px; border-radius: 50%; }
.chip-x:hover { color: var(--ink); background: var(--hover-wash); }
.changes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel-title { margin: 10px 0 2px; font-size: 14px; color: var(--ink-2); }
.changes-grid .feed-day { grid-template-columns: 96px minmax(0, 1fr); }
.btn:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 860px) { .changes-grid { grid-template-columns: 1fr; } }
.tl-bar + .tl-bar { box-shadow: -2px 0 0 var(--surface); }
.bar-with-label .lbl.is-text { font-size: 12px; font-weight: 600; white-space: normal; min-width: 90px; max-width: 150px; line-height: 1.3; }
@media (max-width: 560px) {
  .site-nav a[href="/"] { display: none; }
  .dtable .bar-cell { min-width: 84px; width: auto; }
  .bar-with-label .lbl { min-width: 42px; }
  .answer { padding: 14px 14px 10px; }
  .lookup { padding: 12px; }
}

/* ---------- accounts: sign in, register, account ---------- */

.nav-account { margin-left: 6px; border: 1px solid var(--border); }
.auth-card {
  max-width: 440px; margin: 48px auto 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 26px 20px;
}
.auth-card h1 { margin: 0 0 10px; font-size: 24px; letter-spacing: -0.015em; }
.auth-card p { color: var(--ink-2); font-size: 15px; }
.auth-lede { margin: 0 0 14px; }
.auth-note { margin: 16px 0 0; font-size: 13.5px !important; color: var(--muted) !important; }
.auth-form { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0; }
.auth-form label, .invite-form label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 8px; display: block; }
.auth-form input, .invite-form input, .invite-form select, .invite-url input {
  width: 100%; background: var(--plane); color: var(--ink); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font: inherit; font-size: 15px;
}
.auth-form input[readonly], .invite-url input { color: var(--ink-2); }
.auth-form input:focus, .invite-form input:focus, .invite-form select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.auth-form .btn { margin-top: 16px; align-self: flex-start; }
.field-note { font-size: 12.5px; color: var(--muted); }
.form-error, .form-ok { border-radius: 8px; padding: 9px 12px; font-size: 14px; margin: 12px 0; }
.form-error { background: color-mix(in srgb, #d03b3b 12%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, #d03b3b 40%, transparent); }
.form-ok { background: var(--ok-bg); color: var(--ink); border: 1px solid color-mix(in srgb, #0ca30c 35%, transparent); }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; margin: 8px 0 16px; font-size: 14.5px; }
.kv dt { color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.invite-form { display: grid; grid-template-columns: 1.3fr 1.3fr 0.8fr auto; gap: 10px; align-items: end; }
.invite-form label { margin-top: 0; margin-bottom: 5px; }
.invite-new { background: var(--ok-bg); border: 1px solid color-mix(in srgb, #0ca30c 35%, transparent); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.invite-new p { margin: 0 0 8px; font-size: 14px; }
.invite-url { display: flex; gap: 8px; }
.invite-url input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
@media (max-width: 860px) {
  .account-grid { grid-template-columns: 1fr; }
  .invite-form { grid-template-columns: 1fr; }
}

/* ---------- home: tariffs and trade sections ---------- */

.home-section { margin: 40px 0 0; }
.home-section > .section-head h2 { font-size: 22px; }
.home-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; margin: 12px 0 0; align-items: start; }
.home-split .chart-card { margin: 0; }
.home-split .feed-panel { padding: 6px 16px 10px; }
.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 0; }
@media (max-width: 860px) { .home-split { grid-template-columns: 1fr; } }

/* =====================================================================
   Articles — /articles, /articles/<slug>, the home page's latest strip.
   Reading column ~70ch; charts reuse the tariff pages' LineChart and
   series colours (s1..s5 = the validated categorical slots, sx muted).
   ===================================================================== */

.k-s1 { border-color: var(--f-301); }  .k-s2 { border-color: var(--f-232); }  .k-s3 { border-color: var(--f-338); }
.k-s4 { border-color: var(--f-201); }  .k-s5 { border-color: var(--f-ieepa); } .k-sx { border-color: var(--muted); }

/* list: tabs, cards */
.beat-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 18px 0 0; }
.beat-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--ink-2); font-size: 14px;
}
.beat-tab:hover { background: var(--hover-wash); text-decoration: none; }
.beat-tab[aria-current="page"] { color: var(--ink); border-color: var(--baseline); background: var(--hover-wash); font-weight: 600; }
.beat-n { color: var(--muted); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.beat-feed { margin-left: auto; font-size: 13.5px; color: var(--ink-2); }

.ac { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 14px; }
.ac-kicker { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.ac-beat { color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11.5px; }
.ac-kicker .badge { margin-left: 6px; }
.ac-title { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; }
.ac-title a { color: var(--ink); }
.ac-title a:hover { color: var(--accent); text-decoration: none; }
.ac-dek { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.ac-meta { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.ac-leadwrap { margin: 18px 0 0; }
.ac-lead { padding: 24px 26px 20px; }
.ac-lead .ac-title { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; max-width: 34em; }
.ac-lead .ac-dek { font-size: 17px; max-width: 46em; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin: 12px 0 0; }
.ac-compact { padding: 14px 16px; }
.ac-compact .ac-title { font-size: 16px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 0; }

/* one article */
.art { margin: 0; }
.art-head { max-width: 780px; padding: 16px 0 0; }
.art-kicker { margin: 0 0 10px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.art-kicker .badge { text-transform: none; letter-spacing: 0; margin-left: 8px; font-weight: 600; }
.art-head h1 { margin: 0; font-size: 36px; line-height: 1.15; letter-spacing: -0.022em; text-wrap: balance; }
.art-dek { margin: 12px 0 0; font-size: 19px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.art-meta { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }

.art-grid { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 260px); gap: 44px; margin: 26px 0 0; align-items: start; }
.art-main { min-width: 0; }

.art-keypoints { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 20px 6px; margin: 0 0 26px; }
.art-keypoints h2 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.art-keypoints ul { margin: 0; padding-left: 18px; }
.art-keypoints li { margin: 0 0 8px; font-size: 15.5px; line-height: 1.5; }

.art-body { font-size: 17.5px; line-height: 1.68; }
.art-body > p { margin: 0 0 1.05em; }
.art-body h2 { font-size: 23px; line-height: 1.25; letter-spacing: -0.015em; margin: 1.7em 0 0.5em; }
.art-body h3 { font-size: 18.5px; line-height: 1.3; margin: 1.4em 0 0.4em; }
.art-body ul, .art-body ol { margin: 0 0 1.05em; padding-left: 1.3em; }
.art-body li { margin: 0 0 0.35em; }
.art-body a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.art-body a:hover { text-decoration-color: var(--accent); }
.art-body a.hlink { text-decoration: none; }
/* the external-link arrow sits outside the underline */
.art-body a.ext::after { display: inline-block; text-decoration: none; margin-left: 1px; }
.art-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: var(--hover-wash);
  padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.art-body blockquote { margin: 0 0 1.05em; padding: 2px 0 2px 16px; border-left: 3px solid var(--baseline); color: var(--ink-2); }
.art-body blockquote p { margin: 0; }
.art-note { margin: 1.3em 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface);
  border-radius: 0 10px 10px 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.art-note p { margin: 0; }
.art-note p::before { content: "Data note. "; font-weight: 650; color: var(--ink); }

.art-table { overflow-x: auto; margin: 1.3em 0 1.4em; }
.art-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.4; }
.art-table th, .art-table td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
.art-table thead th { color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--baseline); font-size: 13.5px; }
.art-table tbody th { font-weight: 500; }
.art-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.art-figure { margin: 1.5em 0 1.6em; }
.art-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.art-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.art-data { margin: 6px 0 0; }
.art-data > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); width: max-content; }
.art-data .chart-table { max-height: 320px; overflow: auto; }
.art-fig-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

.art-foot { margin: 34px 0 0; padding: 18px 0 0; border-top: 1px solid var(--grid); }
.art-foot h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 6px; }
.art-foot p, .art-foot li { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.art-foot p { margin: 0 0 18px; }
.art-foot ul { margin: 0; padding-left: 18px; }

.art-side { position: sticky; top: 16px; }
.art-side-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 8px; }
.art-side-box h2 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.art-side-box ul { list-style: none; margin: 0; padding: 0; }
.art-side-box li { padding: 7px 0; border-top: 1px solid var(--grid); font-size: 14px; line-height: 1.4; }
.art-side-box li:first-child { border-top: 0; }
.art-more { margin-top: 44px; }

@media (max-width: 960px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .art-side { position: static; }
}
@media (max-width: 560px) {
  .art-head h1 { font-size: 27px; }
  .art-dek { font-size: 17px; }
  .art-body { font-size: 16.5px; }
  .ac-lead { padding: 18px 18px 16px; }
  .ac-lead .ac-title { font-size: 22px; }
  .beat-feed { margin-left: 0; width: 100%; }
}

/* header: five items must fit a phone; "Trade explorer" becomes "Trade" */
.nav-short { display: none; }
@media (max-width: 480px) {
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .header-row { gap: 8px; }
  .wordmark { font-size: 17px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 6px 6px; font-size: 13.5px; white-space: nowrap; }
  .theme-toggle { margin-left: 2px; }
}
