:root {
  --bg: #0c1218;
  --bar: #101820;
  --card: #172230;
  --line: #2a3b4e;
  --text: #e8f0f7;
  --muted: #93a4b8;
  --good: #2ee6a6;
  --watch: #ffc14d;
  --bad: #ff5c7a;
  --blue: #7ec8ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  font-family: "Source Sans 3", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand span { color: var(--watch); font-weight: 600; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  font-weight: 600;
}

.tab.active {
  color: #102018;
  background: var(--good);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 48px;
}

.banner h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 6px 0 8px;
}

.eyebrow {
  margin: 0;
  color: var(--watch);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.lede { font-size: 1.08rem; margin: 0 0 18px; max-width: 70ch; }

.kpis {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.kpi.good { border-top-color: var(--good); }
.kpi.watch { border-top-color: var(--watch); }
.kpi.bad { border-top-color: var(--bad); }

.kpi .label,
.kpi .detail,
.kpi .exact { overflow-wrap: anywhere; }
.kpi .label { color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.kpi .value {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.kpi .detail { margin: 0; color: var(--text); }
.exact { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

.panel h2 { margin: 0 0 8px; font-size: 1.15rem; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text); font-family: inherit; }
.muted-text { fill: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.map-panel .chart {
  width: min(100%, 760px);
  height: auto;
  margin: 0 auto;
}

.means {
  background: #122033;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.means strong { display: block; margin-bottom: 4px; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
}
.pill.active { background: var(--blue); color: #081018; border-color: var(--blue); }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 5px; }

footer.sources {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 18px;
}
footer.sources a { color: var(--blue); }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  table { font-size: 0.86rem; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}
