/* LPG Market Intelligence Monitor — Data-Dense Dashboard (dark default, theme-aware).
   Fonts: Fira Sans (text) + Fira Code (figures/tabular). Palette from ui-ux-pro-max:
   blue data (#1E40AF/#3B82F6) + amber accent (#D97706), adapted to dark surfaces. */

/* R-13: fonts are served from ./fonts (SIL OFL, see fonts/OFL.txt) rather than
   Google Fonts, whose stylesheet blocked first paint. Weights in use only
   (400–700; 300 was never used). Latin, Latin Extended and Greek subsets: the
   browser fetches a file only when the page shows characters in its range. */
@font-face { font-family: "Fira Code"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("./fonts/fira-code-400-600-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Fira Code"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("./fonts/fira-code-400-600-latin-ext.woff2") format("woff2"); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fira Code"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("./fonts/fira-code-400-600-latin.woff2") format("woff2"); 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: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/fira-sans-400-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/fira-sans-400-latin-ext.woff2") format("woff2"); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/fira-sans-400-latin.woff2") format("woff2"); 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: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/fira-sans-500-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/fira-sans-500-latin-ext.woff2") format("woff2"); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/fira-sans-500-latin.woff2") format("woff2"); 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: "Fira Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/fira-sans-600-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/fira-sans-600-latin-ext.woff2") format("woff2"); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/fira-sans-600-latin.woff2") format("woff2"); 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: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/fira-sans-700-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/fira-sans-700-latin-ext.woff2") format("woff2"); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/fira-sans-700-latin.woff2") format("woff2"); 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; }

:root[data-theme="dark"] {
  --bg: #0b1120;
  /* Chart series (dataviz reference slots 1-2, dark steps). Validated on this
     --surface: CVD ΔE 26.8, contrast >= 3:1. Never reused for status. */
  --series-1: #3987e5;
  --series-2: #d95926;
  --surface: #121a2b;
  --surface-2: #172136;
  --surface-3: #1e2b44;
  --border: #263450;
  --border-strong: #34456a;
  --fg: #eef2fb;
  --fg-muted: #9fb0cd;
  --fg-dim: #6f83a6;
  --primary: #3b82f6;
  --primary-strong: #60a5fa;
  --accent: #f59e0b;
  --accent-fg: #1a1206;
  --danger: #f87171;
  --danger-bg: #3a1a1e;
  --ok: #34d399;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  /* Light steps of the same slots; validated on #ffffff: CVD ΔE 24.7. */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --surface-3: #e9eef6;
  --border: #dbe4f0;
  --border-strong: #c3d2e6;
  --fg: #16233d;
  --fg-muted: #47597a;
  --fg-dim: #6b7c99;
  --primary: #1e40af;
  --primary-strong: #1d4ed8;
  --accent: #b45309;
  --accent-fg: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --ok: #059669;
  --shadow: 0 1px 2px rgba(16, 34, 64, 0.06), 0 6px 18px rgba(16, 34, 64, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Fira Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.01em; }

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

.tabular { font-family: "Fira Code", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  position: relative;
  max-width: 1360px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 10px; color: var(--accent);
  background: linear-gradient(160deg, var(--surface-3), var(--surface));
  border: 1px solid var(--border-strong);
}
.brand-text h1 { font-size: 17px; line-height: 1.2; }
.brand-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-muted); }
.header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.header-meta-row { display: flex; align-items: center; gap: 12px; }
.last-updated { font-size: 12.5px; color: var(--fg-muted); }
.header-meta .credit { margin: 0; font-size: 11px; color: var(--fg-dim); white-space: nowrap; }
.header-meta .credit strong { color: var(--fg-muted); font-weight: 600; }
.header-meta .credit a { color: var(--fg-muted); }
.header-meta .credit a:hover { color: var(--primary-strong); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fg-dim); flex: none; }
.status-dot.live { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.status-dot.error { background: var(--danger); }

.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; cursor: pointer;
  background: var(--surface-2); color: var(--fg-muted);
  border: 1px solid var(--border); border-radius: 9px; transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--fg); }
.icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
:root[data-theme="dark"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: none; }

/* ── Centre logo ─────────────────────────────────────────── */
/* header-inner is a flex row (brand | logo | meta). The logo is centred
   independently of the side blocks' widths so it stays optically centred
   rather than drifting with the credit line's length. */
.brand-logo {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; pointer-events: none;
}
.brand-logo img { height: 34px; width: auto; display: block; }
/* Variant swap mirrors the .ico-moon/.ico-sun theme pattern below. */
/* B-25: one logo image, src swapped by applyTheme(). */

/* Below ~900px an absolutely-centred logo overlaps the title and the meta
   block, so the whole header stacks into rows instead: logo, then brand, then
   meta. `order` alone was not enough — header-inner is a flex ROW, so it also
   needs to become a column here. */
@media (max-width: 900px) {
  .header-inner {
    flex-direction: column; align-items: center; gap: 10px; text-align: center;
  }
  .brand-logo {
    position: static; left: auto; transform: none; order: -1; margin: 0;
  }
  .brand-logo img { height: 30px; }
  .brand { justify-content: center; }
  .header-meta { align-items: center; }
  .header-meta .credit { white-space: normal; }
}

/* ── Import readout / weekly brief tabs ─────────────────── */
.import-readout { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.import-inner { max-width: 1360px; margin: 0 auto; padding: 14px 20px; }
/* Wraps: with the Figures tab (B-34) four tabs no longer fit a 400px row. */
.panel-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.panel-tab {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid transparent; background: none; border-radius: 7px; padding: 6px 10px;
  color: var(--fg-dim); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  transition: background .16s, color .16s, border-color .16s;
}
.panel-tab:hover { color: var(--fg); }
/* Same trap as .legend-panel[hidden] below: `display: inline-flex` beats the
   browser's [hidden] rule, so tabs "hidden" in JS stayed on screen. The
   Weekly brief tab, hidden for the eleven countries without a brief, was
   still clickable — and on a page that opens on Tanzania, clicking it under
   Ghana showed Tanzania's brief. */
.panel-tab[hidden] { display: none; }
.panel-tab[aria-selected="true"] { color: var(--accent); border-color: var(--border-strong); background: var(--surface-2); }
.panel-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.panel-body p { margin: 6px 0 0; font-size: 15px; color: var(--fg); max-width: 90ch; }
.import-asof { display: block; margin-top: 4px; font-size: 12px; color: var(--fg-dim); }
.panel-brief-title { font-size: 15px; font-weight: 600; color: var(--fg); margin: 10px 0 0; }

/* ── Layout ─────────────────────────────────────────────── */
.layout { max-width: 1360px; margin: 0 auto; padding: 18px 20px 40px; }

/* ── Stat tiles ─────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .16s, transform .16s;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-num { font-size: 26px; font-weight: 600; line-height: 1; color: var(--fg); }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-dim); font-weight: 600; }
.stat-alert .stat-num { color: var(--accent); }
.stat-sub { font-size: 11px; color: var(--fg-dim); }
/* NEW-16 */
.badge-historic, .badge-regional { background: var(--surface-2); color: var(--fg-muted); border-color: var(--border-strong); font-weight: 500; }
.stat-alert.has-alerts { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }

/* ── Weekly brief content (rendered inside #panel-brief) ─── */
.brief-body { max-width: 88ch; }
.brief-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: 16px 0 6px; }
.brief-body h3:first-child { margin-top: 12px; }
.brief-body p { margin: 0 0 8px; font-size: 13.5px; color: var(--fg-muted); line-height: 1.55; }
.brief-body ul { margin: 0 0 8px; padding-left: 18px; }
.brief-body li { font-size: 13.5px; color: var(--fg-muted); line-height: 1.5; margin-bottom: 3px; }
.brief-body strong { color: var(--fg); font-weight: 600; }
.brief-meta { display: block; margin-top: 12px; font-size: 12px; color: var(--fg-dim); }

.toolbar {
  position: sticky; top: 63px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  padding: 12px 14px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.search-wrap { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 200px; color: var(--fg-dim);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; }
.search-wrap input { flex: 1; border: 0; background: transparent; color: var(--fg); font: inherit; padding: 9px 2px; outline: none; }
.search-wrap input::placeholder { color: var(--fg-dim); }
.filter-group { display: flex; align-items: center; gap: 8px; position: relative; }
.filter-caption { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-dim); font-weight: 600; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }

.legend-btn {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--fg-dim);
  font-size: 11px; font-weight: 700; cursor: pointer; line-height: 1; transition: color .15s, border-color .15s;
}
.legend-btn:hover { color: var(--primary-strong); border-color: var(--primary); }
.legend-btn:focus-visible, .legend-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.legend-panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 50; width: 340px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
/* `display: flex` above has the same specificity as the browser's default
   [hidden] { display: none } rule, and wins ties by cascade order — so
   without this, the `hidden` attribute toggled correctly in JS but never
   actually hid anything visually. */
.legend-panel[hidden] { display: none; }
.legend-close {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--fg-dim); cursor: pointer;
}
.legend-close:hover { background: var(--surface-2); color: var(--fg); }
.legend-row { display: flex; gap: 10px; align-items: flex-start; padding-right: 20px; }
.legend-row:first-child { padding-right: 30px; }
.legend-badge {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px;
  font-size: 12px; font-weight: 700; margin-top: 1px;
  background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-strong);
}
.legend-row strong { font-size: 13px; color: var(--fg); }
.legend-row p { margin: 3px 0 0; font-size: 12px; color: var(--fg-muted); line-height: 1.45; }

.chip {
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--fg-muted);
  border-radius: 7px; padding: 5px 9px; font-size: 12.5px; font-weight: 500; line-height: 1;
  transition: background .16s, color .16s, border-color .16s;
}
.chip:hover { color: var(--fg); border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

select {
  font: inherit; font-size: 13px; color: var(--fg); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.alert-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg-muted); cursor: pointer; }
.alert-toggle input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.text-btn { background: none; border: 0; color: var(--fg-muted); font: inherit; font-size: 13px; cursor: pointer; padding: 6px; }
.text-btn:hover { color: var(--primary-strong); text-decoration: underline; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }

/* ── Feed ───────────────────────────────────────────────── */
.feed-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.feed-head h2 { font-size: 15px; display: flex; align-items: center; gap: 7px; }
/* Selected-country flag beside the feed heading. Sized slightly above the
   heading text because emoji render optically smaller than their em box.
   line-height:1 stops the taller glyph from shifting the heading's baseline. */
.country-flag { font-size: 17px; line-height: 1; }
/* Emoji flags are colour glyphs and ignore `color`, so nothing to theme —
   but they also fail to render as flags on some Windows builds, where the
   two regional-indicator letters show instead. That degrades to "GH" beside
   the heading, which is still meaningful, so no fallback is needed. */
.result-count { font-size: 12.5px; color: var(--fg-dim); }
.feed-list { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px 16px; box-shadow: var(--shadow); transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--border-strong); }
.card.alerted { border-left: 3px solid var(--accent); }
.card-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; justify-content: space-between; }
.card-top h3 { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.card h3 { font-size: 15.5px; line-height: 1.35; }
/* `flex: 0 1 auto` + min-width: 0, not `flex: none`: with `none` the row could
   not shrink, so `flex-wrap` never engaged and a card carrying category +
   confidence + ALERT + Escalate pushed the page 84px past a phone's edge. */
.badges { display: flex; gap: 6px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }

.badge { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; line-height: 1.2; white-space: nowrap; border: 1px solid transparent; }
.badge-cat { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-strong); border-color: color-mix(in srgb, var(--primary) 34%, transparent); }
.badge-conf-confirmed { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.badge-conf-probable { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.badge-conf-unconfirmed { background: var(--surface-3); color: var(--fg-muted); border-color: var(--border-strong); }
.badge-alert { background: var(--accent); color: var(--accent-fg); }
/* Secondary category: outlined, never filled — there is one primary. */
.badge-cat-secondary { background: transparent; color: var(--primary-strong); border-color: color-mix(in srgb, var(--primary) 34%, transparent); font-weight: 500; }
.badge-escalate { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 36%, transparent); }

.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 9px 0; font-size: 12.5px; color: var(--fg-dim); }
.card-meta .sep { opacity: .5; }
.rel { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-muted); }
.rel-dots { display: inline-flex; gap: 2px; }
.rel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.rel-dot.on { background: var(--accent); }

.card-why { color: var(--fg-muted); font-size: 13.5px; margin: 8px 0 0; }
.card-why b { color: var(--fg); font-weight: 600; }
.card-facts { color: var(--fg); font-size: 13.5px; margin: 8px 0 0; line-height: 1.5; }

/* Translated original, attached to the source name in the meta row. */
.card-source { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.lang-tag { font-size: 11px; color: var(--fg-muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 5px; line-height: 1.5; white-space: nowrap; cursor: help; }

/* Why the confidence tier is what it is. Tier word repeats the badge colour. */
.card-confnote { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--fg-muted); }
.confnote-tier { font-weight: 600; text-transform: capitalize; }
.confnote-tier.conf-confirmed { color: var(--ok); }
.confnote-tier.conf-probable { color: var(--accent); }
.confnote-tier.conf-unconfirmed, .confnote-tier.conf-unknown { color: var(--fg); }

/* Model inference. DASHED rule on the paragraph, not a solid one on the card:
   `.card.alerted` already owns a solid accent left border, and an inferred
   item must never be mistakable for an immediate alert — or hide one. The
   two can co-exist on one card and stay distinct. */
.card-inferred { border-left: 2px dashed var(--fg-dim); padding-left: 10px; }
.inference-label { display: inline-block; margin-right: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg); background: var(--surface-3); border: 1px dashed var(--fg-dim); border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
/* NEW-2: official document behind the card / figure */
.card-docs { margin-top: 8px; font-size: 12px; color: var(--fg-muted); }
.card-docs a, .fig-doc { color: var(--primary-strong); }
.fig-doc { margin-left: 8px; font-size: 12px; }
.card-baseline { margin-top: 8px; font-size: 12.5px; color: var(--primary-strong); background: color-mix(in srgb, var(--primary) 10%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); border-radius: 7px; padding: 6px 9px; }

.entities { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.entity { font-size: 11.5px; color: var(--fg-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.entity.fig { font-family: "Fira Code", monospace; font-variant-numeric: tabular-nums; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }
.src-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--fg-muted); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-link:hover { color: var(--primary-strong); }
.feedback { display: flex; align-items: center; gap: 6px; }
.fb-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--fg-dim); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.fb-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.fb-btn.up.active { color: var(--ok); border-color: var(--ok); }
.fb-btn.down.active { color: var(--danger); border-color: var(--danger); }
.fb-btn:disabled { cursor: default; opacity: .8; }
.fb-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Baseline panel ─────────────────────────────────────── */
.baseline-inner { position: sticky; top: 132px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.baseline-inner h2 { font-size: 14px; }
.baseline, .baseline-inner { min-width: 0; }
.bl-note, .bl-src { overflow-wrap: anywhere; }
/* Baseline drift: age / target / unverified, visible without expanding. */
.bl-tag { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 600; line-height: 1.4; padding: 0 5px; border-radius: 4px; border: 1px solid transparent; white-space: nowrap; vertical-align: 1px; }
.bl-tag-stale { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.bl-tag-unverified { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.bl-tag-target { color: var(--fg-muted); border-color: var(--border-strong); }
.baseline-note { font-size: 12px; color: var(--fg-dim); margin: 5px 0 14px; }
.bl-group { margin-bottom: 14px; }
.bl-group-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 7px; }
/* A baseline value chooses its own layout in baselineValue() (app.js):
   inline figures sit right-aligned beside the name, longer ones and prose drop
   below it. `nowrap` is kept ONLY for inline figures, which are short by
   construction — it used to apply to every value, and one 161-character
   citation widened the whole page to 2,346px. */
.bl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; line-height: 1.45; }
.bl-row:last-child { border-bottom: 0; }
.bl-name { color: var(--fg-muted); flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.bl-val { color: var(--fg); font-family: "Fira Code", monospace; font-variant-numeric: tabular-nums; }
.bl-row--inline .bl-val { flex: 0 0 auto; white-space: nowrap; text-align: right; }
.bl-row--stack, .bl-row--prose { flex-direction: column; align-items: stretch; gap: 3px; }
.bl-row--stack .bl-val, .bl-row--prose .bl-val { overflow-wrap: anywhere; }
.bl-val--prose { font-family: inherit; font-variant-numeric: normal; font-size: 12.5px; }

/* ── States ─────────────────────────────────────────────── */
.empty { text-align: center; color: var(--fg-dim); padding: 40px 12px; }
.skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; height: 128px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fg) 6%, transparent), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.site-footer { max-width: 1360px; margin: 0 auto; padding: 20px; border-top: 1px solid var(--border); color: var(--fg-dim); font-size: 12px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--surface-3); color: var(--fg); border: 1px solid var(--border-strong); border-radius: 9px; padding: 10px 16px; font-size: 13px; box-shadow: var(--shadow); z-index: 100; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .baseline-inner { position: static; }
  .toolbar { top: 60px; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 22px; }
}
@media (max-width: 560px) {
  .header-inner { padding: 10px 14px; }
  .brand-text p { display: none; }
  .header-meta .credit { display: none; }
  .layout { padding: 14px 12px 32px; }
  .toolbar { gap: 10px 12px; }
  .filter-group { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── Baseline rows: expandable to reveal the analyst note and source ───────
   Every baseline figure carries reasoning in `notes` and provenance in
   `source_*`. Both were stored and never rendered, so 25,000 characters of
   commercial analysis — including which competitor won a given tender — sat
   invisible. `<details>` keeps the panel as scannable as before by default. */
.bl-item { border-bottom: 1px dashed var(--border); }
.bl-item:last-child { border-bottom: 0; }
.bl-item > summary { list-style: none; cursor: pointer; }
.bl-item > summary::-webkit-details-marker { display: none; }
.bl-item > summary .bl-row { border-bottom: 0; }
.bl-item > summary:hover .bl-name { color: var(--fg); }
.bl-item > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.bl-item[open] > summary .bl-name { color: var(--fg); }
.bl-src { font-size: 11.5px; color: var(--fg-dim); padding: 0 0 4px 2px; }
.bl-src a { color: var(--fg-muted); }
.bl-src a:hover { color: var(--primary-strong); }
.bl-note { font-size: 11.5px; color: var(--fg-muted); line-height: 1.5; margin: 0 0 9px; padding-left: 2px; }

/* ── Corroborating sources on a merged card ─────────────────────────────── */
.card-alsoin { font-size: 12px; color: var(--fg-dim); margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); }
.alsoin-label { color: var(--fg-dim); }
.card-alsoin a { color: var(--fg-muted); }
.card-alsoin a:hover { color: var(--primary-strong); }

/* Result count turns amber when the feed itself was capped. */
.result-count.warn { color: var(--accent); }

/* ── Signed-in user + sign out (header) ─────────────────────────────────── */
.user-row { gap: 6px; }
.user-email { font-size: 12px; color: var(--fg-muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email:empty { display: none; }
.signout-form { margin: 0; display: inline; }
.signout-btn { font-size: 12px; padding: 4px 6px; }

/* ── Sign-in page ───────────────────────────────────────────────────────── */
.login-body { min-height: 100vh; background: var(--bg); color: var(--fg); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-shell { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.login-brand img { height: 46px; width: auto; display: block; }
.login-card { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px 22px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.login-sub { margin: 6px 0 18px; font-size: 13.5px; color: var(--fg-muted); }
.login-message { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; color: var(--danger); background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.login-message[data-tone="info"] { color: var(--fg); background: var(--surface-2); border-color: var(--border); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); }
.login-field input { font: inherit; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
.login-field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.login-submit { margin-top: 4px; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; color: #fff; background: var(--primary); border: 0; border-radius: 8px; cursor: pointer; }
.login-submit:hover { background: var(--primary-strong); }
.login-submit:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.login-help { margin: 18px 0 0; font-size: 12.5px; color: var(--fg-dim); line-height: 1.5; }
.login-help a { color: var(--fg-muted); }
.login-help a:hover { color: var(--primary-strong); }
.login-foot { margin: 0; font-size: 11.5px; color: var(--fg-dim); }

/* ── Cylinder trade (HS 7311) ───────────────────────────────────────────── */
#trade-body { max-width: 760px; }
/* Scoped under #trade-body: `.panel-body p` (0,1,1), written for the import
   readout, otherwise beats these single-class rules and set every paragraph
   here in 15px full-brightness text. */
#trade-body .trade-empty { margin: 0; font-size: 13.5px; color: var(--fg-muted); }
#trade-body .trade-headline { margin: 0; font-size: 14.5px; color: var(--fg-muted); line-height: 1.5; }
.trade-headline strong { color: var(--fg); font-weight: 600; }
.trade-yoy { font-weight: 600; white-space: nowrap; }
.trade-yoy.up { color: var(--ok); }
.trade-yoy.down { color: var(--danger); }
#trade-body .trade-warn { margin: 6px 0 0; font-size: 12.5px; color: var(--accent); }
.trade-sub { margin: 14px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-dim); }
.trade-origins { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.trade-origins li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(40px, 1fr) 3.2rem 5.6rem; align-items: center; gap: 10px; font-size: 12.5px; }
.trade-origin { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-bar-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.trade-bar { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.trade-share { text-align: right; color: var(--fg); }
.trade-unit { text-align: right; color: var(--fg-muted); white-space: nowrap; }
.trade-rest .trade-origin { color: var(--fg-muted); }
.trade-table-wrap { margin-top: 14px; overflow-x: auto; }
.trade-table { border-collapse: collapse; font-size: 12.5px; min-width: 360px; }
.trade-table th, .trade-table td { padding: 4px 14px 4px 0; text-align: right; white-space: nowrap; }
.trade-table thead th { font-size: 11px; font-weight: 600; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.trade-table th[scope="row"] { text-align: left; color: var(--fg); font-weight: 600; }
.trade-table td { color: var(--fg-muted); }
#trade-body .trade-caveat { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--fg-dim); }
.trade-caveat b { color: var(--fg-muted); }
.trade-caveat a { color: var(--fg-muted); }
@media (max-width: 560px) {
  .trade-origins li { grid-template-columns: minmax(0, 1fr) 3rem 5.2rem; }
  .trade-origins .trade-bar-track { display: none; }
}

/* ── Trend charts (HS 7311) — dataviz mark specs ────────────────────────── */
.trade-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; margin-top: 16px; }
.chart-figure { margin: 0; min-width: 0; }
.chart-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-dim); margin-bottom: 4px; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--fg-muted); margin: 2px 0 2px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; max-width: 420px; overflow: visible; }
.chart-svg:focus { outline: none; }
.chart-svg:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
/* Recessive frame: solid hairlines one step off the surface, never dashed. */
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart-tick { fill: var(--fg-dim); font-size: 10.5px; font-family: "Fira Code", monospace; }
.chart-label { fill: var(--fg); font-size: 11px; font-weight: 600; }
/* Marks: columns <=24px with 4px rounded ends, 2px lines, 8px dots with a
   2px surface ring so they stay legible where they cross a column. */
.chart-col.s1 { fill: var(--series-1); }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.s1 { stroke: var(--series-1); }
.chart-line.s2 { stroke: var(--series-2); }
.chart-dot { stroke: var(--surface); stroke-width: 2; }
.chart-dot.s1 { fill: var(--series-1); }
.chart-dot.s2 { fill: var(--series-2); }
.chart-hover { fill: var(--fg); opacity: .06; pointer-events: none; }
.chart-hit { fill: transparent; }
/* Keys mirror the mark: a block for columns, a short stroke for lines. */
.chart-key { display: inline-block; flex: none; }
.chart-key-column { width: 9px; height: 9px; border-radius: 2px; }
.chart-key-line { width: 14px; height: 2px; border-radius: 1px; }
.chart-key.s1 { background: var(--series-1); }
.chart-key.s2 { background: var(--series-2); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; z-index: 2; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; box-shadow: var(--shadow); font-size: 12px; white-space: nowrap; }
.chart-tip[data-edge="right"] { transform: translateX(-100%); }
.chart-tip[data-edge="left"] { transform: none; }
.chart-tip[hidden] { display: none; }
.chart-tip-year { font-size: 11px; color: var(--fg-dim); margin-bottom: 3px; }
.chart-tip-row { display: flex; align-items: center; gap: 7px; }
/* Value leads, label follows: the reader has the series and wants the number. */
.chart-tip-row strong { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip-row span:last-child { color: var(--fg-muted); }
#trade-body .chart-caption { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--fg-dim); }

/* ── All-markets comparison (HS 7311) ───────────────────────────────────── */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.seg-btn { font: inherit; font-size: 12px; font-weight: 600; color: var(--fg-muted); background: none; border: 0; padding: 5px 11px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.seg-btn[aria-pressed="true"] { background: var(--surface-3); color: var(--fg); }
.seg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.trade-compare { min-width: 620px; }
.trade-compare th[scope="row"] { font-weight: 500; }
.sort-btn { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sort-btn:hover { color: var(--fg); }
.sort-btn:focus-visible, .drill-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.drill-btn { font: inherit; color: var(--fg); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; white-space: nowrap; }
.drill-btn:hover { color: var(--primary-strong); text-decoration: underline; }
.trade-compare tr.is-current th, .trade-compare tr.is-current td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.trade-compare td.pos { color: var(--ok); }
.trade-compare td.neg { color: var(--danger); }
.trade-compare td.muted { color: var(--fg-dim); text-align: left; }
.spark-cell { padding-top: 2px; padding-bottom: 2px; }
.spark { display: block; width: 76px; height: 22px; }
.spark-line { fill: none; stroke: var(--fg-dim); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--series-1); }

/* ── Baseline USD equivalents (fx-normalisation) ────────────────────────── */
.bl-entry { border-bottom: 1px dashed var(--border); padding-bottom: 5px; }
.bl-entry:last-child { border-bottom: 0; }
.bl-entry > .bl-row { border-bottom: 0; padding-bottom: 2px; }
.bl-item > summary .bl-entry { border-bottom: 0; }
.bl-fx { font-size: 11.5px; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.bl-fx--right { text-align: right; }
.bl-fx--note { color: var(--fg-muted); font-style: italic; }

/* ── Market players ─────────────────────────────────────────────────────── */
.players { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; display: grid; gap: 8px; }
.players[hidden] { display: none; }
.players-head { display: flex; align-items: baseline; gap: 10px; }
.players-head h2 { font-size: 13px; margin: 0; }
.players-hint { font-size: 11.5px; color: var(--fg-dim); }
.players-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.players-role { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-dim); min-width: 8.5rem; }
.player-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; color: var(--fg); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.player-chip:hover { border-color: var(--border-strong); }
.player-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--primary) 20%, transparent); border-color: var(--primary); }
.player-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.player-chip.is-empty { color: var(--fg-dim); }
.player-count { font-size: 11px; color: var(--fg-muted); }
.players-summary { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-muted); line-height: 1.5; }
.players-summary strong { color: var(--fg); }
.players-note { color: var(--fg-dim); }
@media (max-width: 560px) { .players-role { min-width: 100%; } }

/* B-16: "Show more" under the first page of cards. */
.feed-more { display: block; width: 100%; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.feed-more:hover { border-color: var(--primary-strong); color: var(--primary-strong); }
.feed-more:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.feed-more[hidden] { display: none; }

/* B-34: figures quoted from news items. */
.fig-note { color: var(--fg-muted); font-size: 14px; margin: 0 0 12px; }
.fig-group { margin-top: 16px; }
.fig-group-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 8px; }
.fig-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fig-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface-2); }
.fig-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fig-value { font-weight: 600; color: var(--fg); }
.fig-fx, .fig-when { font-size: 13px; color: var(--fg-muted); }
.fig-quote { font-size: 13px; color: var(--fg-muted); font-style: italic; overflow-wrap: anywhere; }
.fig-src { font-size: 13px; color: var(--primary-strong); justify-self: start; }

/* B-12: an old figure re-checked recently — informational, not a warning. */
.bl-tag-checked { color: var(--fg-muted); border-color: var(--border); background: transparent; }
/* R-9: a newer news figure disagrees with this baseline row. */
.bl-tag-contradicted { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.bl-contra { margin: 6px 0 4px; padding: 8px 10px; border-left: 3px solid var(--danger); background: var(--surface-2); border-radius: 0 6px 6px 0; display: grid; gap: 4px; font-size: 12.5px; }
.bl-contra p { margin: 0; }
.bl-contra-head { font-weight: 600; color: var(--fg); }
.bl-contra-quote { color: var(--fg-muted); font-style: italic; }
.bl-contra-src { color: var(--fg-dim); }
.bl-contra-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.bl-contra-btn { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--primary-strong); background: var(--primary-strong); color: #fff; cursor: pointer; }
.bl-contra-btn--quiet { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.bl-contra-btn:disabled { opacity: .5; cursor: not-allowed; }
.bl-contra-status { font-size: 12px; color: var(--fg-muted); }
.fig-country { font-size: 13px; font-weight: 600; color: var(--fg); }
.fig-open { color: var(--primary-strong); font-weight: 600; }

/* B-14: alert subscription panel. */
.alerts-panel { max-width: 1200px; margin: 12px auto 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); display: grid; gap: 12px; }
.alerts-panel[hidden] { display: none; }
.alerts-title { margin: 0; font-size: 16px; }
.alerts-note { margin: 0; color: var(--fg-muted); font-size: 14px; }
.alerts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.alerts-choice { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.alerts-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.alerts-save { padding: 8px 18px; border-radius: 8px; border: 1px solid var(--primary-strong); background: var(--primary-strong); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.alerts-save:disabled { opacity: .6; cursor: progress; }
.alerts-save:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.alerts-status { font-size: 13px; color: var(--fg-muted); }

/* N-4: Watching strip (reported, not confirmed). Same frame as the players strip. */
.watching { max-width: 1200px; margin: 12px auto 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.watching[hidden] { display: none; }
.watch-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.watch-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.watch-kind { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-muted); }
.watch-deal, .watch-plan { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.watch-subject { font-weight: 600; color: var(--fg); }
.watch-meta { font-size: 13px; color: var(--fg-muted); }
.watch-note { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--fg-muted); }

/* N-2: input costs under the trade charts. */
.input-costs { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.maker-operating { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* B-19: market selector as the scope row of the toolbar. */
.market-scope { flex-basis: 100%; padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px solid var(--border); }
/* B-21: the stat tile whose filter is applied. */
.stat[aria-pressed="true"] { border-color: var(--primary-strong); box-shadow: inset 0 0 0 1px var(--primary-strong); }
/* B-22/23: empty and error states with an action. */
.empty-action { margin-top: 8px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.empty-action:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
