:root {
  --bg: #f6f7fb; --card: #fff; --text: #1d2130; --muted: #646b80; --border: #dde1ea;
  --accent: #4f46e5; --accent-soft: #eef0ff; --best: #dcfce7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117; --card: #181b24; --text: #e6e8ef; --muted: #9aa1b5; --border: #2c3140;
    --accent: #818cf8; --accent-soft: #262a45; --best: #143d26;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin: 0 0 4px; font-size: 1.8rem; }
h2 { margin: 0 0 12px; font-size: 1.2rem; }
header p { margin: 0 0 16px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 16px; }
.label { display: block; font-weight: 600; margin: 4px 0 6px; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
input[type=text], input:not([type]) { flex: 1; min-width: 220px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); }
button:hover { filter: brightness(1.08); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px;
  border-radius: 999px; background: var(--accent-soft); font-size: 0.85rem; }
.chip .swatch { width: 10px; height: 10px; border-radius: 50%; }
.chip button { padding: 0 7px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1.4; }
.msg { min-height: 1.2em; margin: 2px 0 8px; color: #dc2626; font-size: 0.85rem; }
.benches { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.benches label, .toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--card); }
th.sorted::after { content: " ▾"; }
th.sorted.asc::after { content: " ▴"; }
td.best { background: var(--best); font-weight: 600; }
td.na { color: var(--muted); }
.tag { text-decoration: none; font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); margin-left: 6px; }
.charts { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.chart { min-height: 480px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
details summary { cursor: pointer; font-weight: 600; }
pre { background: var(--bg); padding: 10px; border-radius: 8px; overflow-x: auto; }
footer { color: var(--muted); font-size: 0.8rem; }
footer a { color: var(--accent); }
.bench-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.bench-head .label { margin: 0 4px 0 0; }
.bench-head .toggle { margin-left: auto; font-size: 0.9rem; }
button.small { padding: 3px 10px; font-size: 0.85rem; }
button.link { padding: 0 4px; border: 0; background: none; color: var(--accent); font-size: 0.8rem; text-decoration: underline; }
.benches { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-top: 10px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px 8px; margin: 0; }
legend { font-weight: 600; font-size: 0.85rem; padding: 0 4px; }
.bench-list { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.85rem; }
.bench { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.bench.empty { color: var(--muted); opacity: 0.6; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.org { color: var(--muted); font-size: 0.75rem; margin-left: 8px; }
code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }
.msg.info { color: var(--muted); }
