:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-2: #f2f1ee;
  --border: #dedcd6;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #8a8884;
  --grid: #e6e5e1;
  --land: #ebe9e3;
  --land-line: #cfccc4;
  --s1: #2a78d6;   /* blue: Unity / primary */
  --s2: #eb6834;   /* orange: Eve / secondary */
  --s3: #1baf7a;   /* aqua: balloons */
  --bad: #e34948;
  --warn: #eda100;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1a1a19; --surface-2: #232322; --border: #3a3936; --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86;
    --grid: #2e2d2b; --land: #262624; --land-line: #3d3c39; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --bad: #e66767; --warn: #c98500;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a19; --surface-2: #232322; --border: #3a3936; --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86;
  --grid: #2e2d2b; --land: #262624; --land-line: #3d3c39; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --bad: #e66767; --warn: #c98500;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { padding: 20px 16px 8px; max-width: 1200px; margin: 0 auto; }
header h1 { font-size: 1.35rem; margin: 0 0 4px; }
header p { margin: 0; color: var(--text-2); max-width: 70ch; }
nav.tabs { display: flex; gap: 6px; padding: 10px 16px 0; max-width: 1200px; margin: 0 auto; border-bottom: 1px solid var(--border); }
nav.tabs button { background: none; border: 1px solid transparent; border-bottom: none; padding: 8px 12px; color: var(--text-2); cursor: pointer; border-radius: 8px 8px 0 0; font: inherit; }
nav.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--border); background: var(--surface-2); }
main { max-width: 1200px; margin: 0 auto; padding: 12px 16px 40px; }
section[hidden] { display: none; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 0; }
.controls label { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 0.92rem; }
.controls select, .controls input[type=range] { font: inherit; }
.controls select { padding: 4px 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; }
.controls input[type=range] { width: min(420px, 60vw); accent-color: var(--s1); }
.controls button { font: inherit; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .panel { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 8px; position: relative; }
.card h2 { font-size: 0.95rem; margin: 2px 6px 6px; color: var(--text-2); font-weight: 600; }
svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 6px 2px; font-size: 0.85rem; color: var(--text-2); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--swatch, var(--s1)); border: 2px solid var(--swatch, var(--s1)); }
.legend span.hollow::before { background: var(--surface); }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 0.82rem; color: var(--text); white-space: nowrap; display: none; z-index: 2; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.stat .v { font-size: 1.4rem; font-weight: 600; }
.stat .k { color: var(--text-2); font-size: 0.85rem; }
.note { color: var(--text-2); font-size: 0.9rem; max-width: 80ch; }
footer { max-width: 1200px; margin: 0 auto; padding: 0 16px 30px; color: var(--muted); font-size: 0.82rem; }
table.filtered { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
table.filtered th, table.filtered td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border); }
table.filtered th { color: var(--text-2); font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.hidden-row { color: var(--muted); }
