/* =====================================================================
   QENTARI WORLD · ATLAS DESIGN SYSTEM
   Default: the qentari.com steel-navy theme (site tokens: #0b1220 base,
   steel glass panels, sky accent, Inter and Instrument Serif, no red or
   green). A paired light mode stays behind the theme toggle.
   Fonts are vendored (vendor/fonts, SIL OFL 1.1): no external requests.
   ===================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../vendor/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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: "Instrument Serif";
  src: url("../vendor/fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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: "MonoFallback";
  src: local("JetBrains Mono"), local("IBM Plex Mono"), local("Cascadia Mono"), local("Consolas");
  font-display: swap;
}

/* qentari.com steel navy: the default. */
:root {
  color-scheme: dark;
  --page: #0b1220;
  --page-grad: radial-gradient(1400px 720px at 50% -12%, rgba(34, 56, 90, 0.85), transparent 62%),
               radial-gradient(900px 520px at 92% 4%, rgba(96, 174, 213, 0.10), transparent 60%),
               linear-gradient(180deg, #101a2d 0%, #0b1220 70%);
  --surface-1: #121c30;
  --surface-2: #16233a;
  --surface-3: #1d2c47;
  --hairline: rgba(148, 180, 214, 0.14);
  --hairline-strong: rgba(148, 180, 214, 0.28);

  /* steel glass panels (site .glass) */
  --glass: linear-gradient(118deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 38%),
           linear-gradient(180deg, rgba(170, 205, 240, 0.085) 0%, rgba(150, 185, 225, 0.045) 100%);
  --glass-edge: rgba(190, 215, 240, 0.10);
  --glass-edge-top: rgba(255, 255, 255, 0.16);

  --text-primary: #e8e4df;
  --text-secondary: #b8c2d0;
  --text-muted: #a3aec1;

  --canvas: #0f1829;
  --grid: rgba(148, 180, 214, 0.08);
  --axis: rgba(148, 180, 214, 0.22);

  /* signals: sky for buying, muted brass for selling (the site never uses red/green) */
  --pos: #60aed5;
  --neg: #c9b48a;
  --neutral: #2a3a55;

  --accent-1: #60aed5;
  --accent-2: #cfe6f5;
  --accent: #8ec4e0;

  --land: #1a2740;
  --land-edge: #2c3d5c;
  --land-emphasis: #60aed5;

  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(5, 10, 20, 0.28), 0 28px 56px -32px rgba(5, 10, 20, 0.8);
  --shadow-pop: 0 30px 80px -28px rgba(5, 10, 20, 0.85);
  --radius-card: 14px;
  --radius-pill: 999px;

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "MonoFallback", "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* Light mode: only when chosen with the theme toggle. */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f2ec;
  --page-grad: radial-gradient(1200px 600px at 12% -10%, rgba(15,18,23,0.04), transparent 60%),
               radial-gradient(900px 500px at 90% 0%, rgba(15,18,23,0.03), transparent 55%);
  --surface-1: #fbfaf6;
  --surface-2: #ffffff;
  --surface-3: #f4f1ea;
  --hairline: rgba(15, 18, 23, 0.08);
  --hairline-strong: rgba(15, 18, 23, 0.14);
  --glass: linear-gradient(180deg, #ffffff, #ffffff);
  --glass-edge: rgba(15, 18, 23, 0.08);
  --glass-edge-top: rgba(15, 18, 23, 0.08);
  --text-primary: #0f1217;
  --text-secondary: #4d5666;
  --text-muted: #6b7482;
  --canvas: #ffffff;
  --grid: rgba(15, 18, 23, 0.06);
  --axis: rgba(15, 18, 23, 0.18);
  --pos: #2f6685;
  --neg: #8a6d34;
  --neutral: #d6d2c6;
  --accent-1: #2f6685;
  --accent-2: #60aed5;
  --accent: #2f6685;
  --land: #e9e5da;
  --land-edge: #cdc8b8;
  --land-emphasis: #2f6685;
  --shadow-card: 0 1px 0 rgba(15,18,23,0.02), 0 14px 32px -22px rgba(15,18,23,0.18);
  --shadow-pop: 0 24px 60px -28px rgba(15,18,23,0.35);
}

/* ===== reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { background-color: var(--page); }
body {
  margin: 0;
  /* Separate properties: a multi-layer gradient cannot share a shorthand with a colour. */
  background-color: var(--page);
  background-image: var(--page-grad);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 18px; letter-spacing: -0.015em; }
h2 { font-size: 15px; letter-spacing: -0.005em; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

/* Read by screen readers and crawlers, not drawn (the page's <h1>). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== shell ===== */
.shell {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100dvh;
}

/* ===== slim qentari.com bar ===== */
.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 28px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: color-mix(in oklab, var(--page) 92%, transparent);
  border-bottom: 1px solid var(--hairline);
}
.site-bar .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 6px;
  padding: 2px 4px;
  margin-left: -4px;
  transition: color 160ms ease;
}
.site-bar .back:hover { color: var(--text-primary); }
.site-bar .note { color: var(--text-muted); }

/* ===== top bar ===== */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 14px 28px;
  background: color-mix(in oklab, var(--page) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 16px;
  margin-right: 4px;
  border-right: 1px solid var(--hairline);
}
/* The qentari.com wordmark (public/navbar_logo.png, a dark mark on transparency):
   inverted for the dark theme exactly as the site header does. */
.brand-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: -12px -4px -12px -6px;
  filter: invert(1) brightness(1.05) contrast(1.1);
}
:root[data-theme="light"] .brand-logo { filter: none; }
.brand-name {
  display: flex; flex-direction: column; gap: 2px;
}
.brand-name .title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400; letter-spacing: -0.005em; line-height: 1.1;
  display: flex; align-items: center; gap: 8px;
}
.brand-name .pill {
  font-family: var(--font-ui);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 1px 6px;
}
.brand-name .asof {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.segmented button {
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  min-height: 28px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}
.segmented button:hover { color: var(--text-primary); }
.segmented button[aria-pressed="true"] {
  color: var(--text-primary);
  background: var(--surface-3);
  box-shadow: 0 1px 0 var(--hairline-strong) inset, 0 4px 10px -6px rgba(0,0,0,0.4);
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  color: var(--text-primary);
  min-height: 32px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.btn:hover { border-color: var(--hairline-strong); background: var(--surface-2); }
.btn:active { transform: translateY(0.5px); }
.btn .icon { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(180deg, #9fd0ea 0%, #60aed5 55%, #4a96bd 100%);
  color: #0b1626;
  border-color: transparent;
  box-shadow: 0 8px 24px -10px var(--accent-1);
}

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  color: var(--text-secondary);
  transition: color 160ms ease, border-color 160ms ease;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--hairline-strong); }
.icon-btn svg { width: 16px; height: 16px; }

button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent) 65%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== badges ===== */
.badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  width: 100%;
  padding-top: 6px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--pos);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--pos) 25%, transparent);
}
.badge-stale::before { background: #d8a341; box-shadow: 0 0 0 2px rgba(216, 163, 65, 0.25); }
.badge-missing::before { background: var(--text-muted); box-shadow: 0 0 0 2px color-mix(in oklab, var(--text-muted) 25%, transparent) !important; }

/* ===== main canvas ===== */
main {
  display: grid;
  align-content: start;
  gap: 18px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 22px 28px 32px;
  width: 100%;
}
.is-loading main { opacity: 0.55; transition: opacity 140ms ease; }

.status {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.status.error { color: var(--neg); }

/* ===== bento grid =====
   The map is the hero: it spans two columns and two rows on wide screens,
   with the rotation board and the flow topology stacked beside it. */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-rows: min-content;
  gap: 16px;
  align-items: start;
}
.bento > .span-2 { grid-column: span 2; }
.bento > .row-2 { grid-row: span 2; }

/* ===== card ===== */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-top-color: var(--glass-edge-top);
  border-radius: var(--radius-card);
  padding: 20px 22px 22px;
  min-width: 0;
  position: relative;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 25%, transparent), transparent);
  pointer-events: none;
}
.card > .card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}
.card-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin-top: 3px;
}
.card-head .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.card .caption {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 82ch;
  margin: -4px 0 14px;
}
.card .caption strong { color: var(--text-primary); font-weight: 600; }
.mt { margin-top: 14px; }

/* ===== KPI tiles ===== */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tiles-backdrop { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-top-color: var(--glass-edge-top);
  border-radius: 12px;
  padding: 15px 17px 16px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.tile::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  opacity: 0.65;
}
.tile .tile-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}
.tile .tile-value {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 7px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tile .tile-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}
.tile.positive::after { background: linear-gradient(90deg, transparent, var(--pos), transparent); }
.tile.negative::after { background: linear-gradient(90deg, transparent, var(--neg), transparent); }
.tile.positive .tile-value { color: var(--pos); }
.tile.negative .tile-value { color: var(--neg); }

/* ===== map legend =====
   The arrows carry meaning that a colour alone does not: which side sold and
   which side bought, and that the arrow is a rotation reading, not a wire. */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.map-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.map-legend .dot-sold { background: var(--neg); }
.map-legend .dot-bought { background: var(--pos); }
.map-legend .arc {
  width: 26px;
  height: 0;
  display: inline-block;
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  transform: translateY(-3px);
}
.map-legend-note { color: var(--text-muted); margin-left: auto; }

/* ===== map chips =====
   Buckets with no country on the map (Global, Europe, Emerging) would
   otherwise vanish from the board. They are listed next to the map instead. */
.map-chips {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface-1) 60%, transparent);
  font-size: 12px;
}
.chip-label { color: var(--text-secondary); }
.chip-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.chip-pos .chip-value { color: var(--pos); }
.chip-neg .chip-value { color: var(--neg); }
.chip-flat .chip-value { color: var(--text-muted); }
.chip-note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ===== tabs ===== */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface-1);
}
.tabs button {
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  min-height: 30px;
  transition: color 160ms ease, background 160ms ease;
}
.tabs button:hover { color: var(--text-primary); }
.tabs button[aria-selected="true"] {
  color: var(--text-primary);
  background: var(--surface-3);
  box-shadow: 0 1px 0 var(--hairline-strong) inset, 0 6px 14px -8px rgba(0,0,0,0.35);
}

/* ===== grids ===== */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ===== chart frames ===== */
figure { margin: 0; min-width: 0; }
figure figcaption {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.chart {
  width: 100%;
  height: 320px;
  position: relative;
}
.chart-map { height: 620px; }
.chart-trend { height: 320px; }
.chart-sankey { height: 500px; }
.chart-small { height: 220px; }
.chart svg text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px dashed var(--hairline);
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface-1) 70%, transparent);
}

/* ===== tables ===== */
.table-view { margin-top: 12px; }
.table-view summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 160ms ease, color 160ms ease;
}
.table-view summary::before {
  content: "▸";
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 160ms ease;
}
.table-view[open] summary::before { transform: rotate(90deg); }
.table-view summary:hover { color: var(--text-primary); background: var(--surface-3); }
.table-wrap {
  max-height: 360px;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  color: var(--text-primary);
}
th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-1);
  position: sticky;
  top: 0;
}
tbody tr:hover { background: color-mix(in oklab, var(--accent) 5%, transparent); }
th.num, td.num { text-align: right; font-family: var(--font-mono); }

/* ===== lists ===== */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--hairline);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.list li:last-child { border-bottom: 0; }
.list li > :first-child { color: var(--text-primary); }
.list li > :last-child { color: var(--text-secondary); font-family: var(--font-mono); }
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* A position the filer did not hold last quarter: an allocation or an IPO. */
.tag-new {
  color: var(--neg);
  border-color: color-mix(in oklab, var(--neg) 40%, transparent);
}
.list li .sub {
  color: var(--text-muted);
  font-size: 11px;
}

/* ===== drilldown ===== */
.drill-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.drill-head h2 { font-size: 18px; letter-spacing: -0.01em; }
.drill-head .btn { white-space: nowrap; }

/* ===== footer ===== */
footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 28px 28px;
  color: var(--text-secondary);
  font-size: 12px;
}
.honesty { color: var(--text-muted); }
footer details summary { cursor: pointer; }

/* ===== responsive ===== */
@media (max-width: 1240px) {
  /* The map stops being the hero before it gets too small to read. */
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento > .span-2 { grid-column: span 1; }
  .bento > .row-2 { grid-row: span 1; }
  .chart-map { height: 460px; }
}
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .site-bar { padding: 8px 16px; }
  .site-bar .note { display: none; }
  .is-offline .top-controls { display: none; }
  .top { padding: 12px 16px; gap: 10px 14px; }
  .brand { border-right: 0; padding-right: 0; margin-right: 0; }
  main { padding: 16px; }
  footer { padding: 8px 16px 24px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px 16px 18px; }
  .card-head h2 { font-size: 22px; }
  .chart { height: 300px; }
  .chart-map { height: 340px; }
  .chart-sankey { height: 420px; }
  .chart-trend { height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== scrollbar polish ===== */
.table-wrap::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar-thumb { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--text-muted) 30%, transparent);
  border-radius: 999px;
}
/* ---- data service offline ------------------------------------------ */
.offline { max-width: 680px; margin: 32px auto; }
.offline { padding: 28px 30px; }
.offline .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; }
.offline h2 { font-family: var(--font-display); font-size: 30px; font-weight: 400; line-height: 1.15; margin-bottom: 12px; }
.offline p { color: var(--text-secondary); line-height: 1.55; margin: 0 0 12px; }
.is-offline main > :not(#offline) { display: none !important; }
.is-waking main > :not(#waking) { display: none !important; }
.is-waking .top-controls { visibility: hidden; }
.is-offline .top-controls { visibility: hidden; }
.is-offline footer details { display: none; }
