:root {
  color-scheme: light;
  --surface-0: #f4f4f2;
  --surface-1: #fcfcfb;
  --border: #dcdbd6;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6b6a66;
  --series-inc: #eb6834; /* categorical slot 2 (orange): current MehrGo engines */
  --series-plat: #2a78d6; /* categorical slot 1 (blue): MehrGo Maps */
  --track: #ecebe7;
  --status-critical-bg: #fde8e8;
  --status-critical-fg: #8a1c1c;
  --good: #1d6b35;
  --bad: #9b2c1f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #121211;
    --surface-1: #1a1a19;
    --border: #3a3a37;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #a3a298;
    --series-inc: #d95926;
    --series-plat: #3987e5;
    --track: #2a2a28;
    --status-critical-bg: #4a1616;
    --status-critical-fg: #ffd9d6;
    --good: #7fd49a;
    --bad: #ff9c8f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121211;
  --surface-1: #1a1a19;
  --border: #3a3a37;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #a3a298;
  --series-inc: #d95926;
  --series-plat: #3987e5;
  --track: #2a2a28;
  --status-critical-bg: #4a1616;
  --status-critical-fg: #ffd9d6;
  --good: #7fd49a;
  --bad: #ff9c8f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
code { font-size: 0.9em; }
.banner {
  background: var(--status-critical-bg);
  color: var(--status-critical-fg);
  padding: 10px 16px;
  border-bottom: 2px solid var(--status-critical-fg);
  font-size: 15px;
}
.top {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: flex-end;
  padding: 20px 16px 8px; max-width: 1200px; margin: 0 auto;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 12px; }
.sub { margin: 0; color: var(--text-secondary); max-width: 70ch; }
.legend { color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 10px; }
.key-inc { background: var(--series-inc); }
.key-plat { background: var(--series-plat); }
main { max-width: 1200px; margin: 0 auto; padding: 0 16px 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card, .panel {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  min-width: 0;
}
.card h3 { margin: 0; font-size: 16px; }
.card .what { margin: 2px 0 10px; color: var(--text-secondary); font-size: 13px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-left: 6px;
  background: var(--status-critical-bg); color: var(--status-critical-fg); vertical-align: middle;
}
.nodata { color: var(--text-muted); font-style: italic; margin: 8px 0; }
.hl { margin: 10px 0 12px; }
.hl-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin: 3px 0; }
.bar-track { background: var(--track); border-radius: 4px; height: 10px; position: relative; overflow: hidden; }
.bar { height: 10px; border-radius: 4px; }
.bar.inc { background: var(--series-inc); }
.bar.plat { background: var(--series-plat); }
.bar-val { font-variant-numeric: tabular-nums; font-size: 14px; min-width: 8ch; text-align: right; }
.delta { font-size: 13px; font-variant-numeric: tabular-nums; }
.delta.better { color: var(--good); }
.delta.worse { color: var(--bad); }
.meta { font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px;
  overflow-wrap: anywhere; }
.target { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
details { margin-top: 8px; font-size: 13px; }
summary { cursor: pointer; color: var(--text-secondary); }
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 600; }
.split { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-top: 8px; }
.map { height: 360px; border-radius: 8px; overflow: hidden; background: var(--track); position: relative; }
.map .map-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); padding: 16px;
  text-align: center; }
.attribution-note { font-size: 12px; color: var(--text-muted); }
.foot {
  max-width: 1200px; margin: 0 auto; padding: 12px 16px 32px; display: flex; flex-wrap: wrap; gap: 8px 24px;
  color: var(--text-secondary); font-size: 13px;
}
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .map { height: 280px; }
}

.demo-link { color: var(--series-plat, #2a78d6); text-decoration: none; font-size: 14px; white-space: nowrap; }
.demo-link:hover { text-decoration: underline; }
