:root {
  --surface-0: #f4f3ef;
  --surface-1: #fcfcfb;
  --line: #e2e0d9;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7a7974;
  --accent: #2a78d6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --good: #0ca30c;
  --critical: #d03b3b;
  color-scheme: light;
}
/* Dark when the viewer's system asks for it, unless the page was set to light;
   and dark whenever the page was set to dark, whatever the system says. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-0: #111110;
    --surface-1: #1a1a19;
    --line: #34332f;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e86;
    --accent: #3987e5;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --surface-0: #111110;
    --surface-1: #1a1a19;
    --line: #34332f;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e86;
    --accent: #3987e5;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px;
  padding-block: 16px; border-bottom: 1px solid var(--line); background: var(--surface-1);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
header h1 { margin: 0; font-size: 20px; letter-spacing: 0.02em; }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav a { color: var(--text-secondary); text-decoration: none; }
nav a[aria-current="page"] { color: var(--text-primary); font-weight: 600; }
main {
  max-width: 1100px; margin: 0 auto; padding-block: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); color: var(--text-secondary);
}
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.tile .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .name { color: var(--text-secondary); font-size: 13px; }
.muted { color: var(--text-muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gallery a { display: block; text-align: center; color: var(--text-secondary); text-decoration: none; font-size: 12px; padding: 4px; border-radius: 8px; }
.gallery a:hover { background: var(--surface-0); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--text-muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-secondary); margin: 4px 0 8px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend.areas i { width: 10px; height: 10px; }
.legend .lead { color: var(--text-muted); }
.chart + details { margin-top: 8px; }
th i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
}
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 13px; }
th, td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
.scroll { overflow-x: auto; }
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px; font-size: 14px; }
.traits div { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
pre { background: var(--surface-0); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; }
.tree { display: flex; flex-direction: column; gap: 8px; }
.tree .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tree .row span { color: var(--text-muted); font-size: 12px; width: 92px; }
#world { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; background: var(--surface-0); display: block; }
details summary { cursor: pointer; color: var(--text-secondary); }
@media (max-width: 600px) {
  .tile .value { font-size: 22px; }
}
a { color: var(--accent); }
#world { max-width: 720px; margin: 0 auto; }
