/* LLM Comparison — dark dense zinc dashboard.
   Zero blue / purple / violet / indigo. Custom CSS only (no Pico). */

:root {
  --zinc-950: #09090b;
  --zinc-900: #18181b;
  --zinc-800: #27272a;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-100: #f4f4f5;
  --zinc-50: #fafafa;

  --bg: var(--zinc-950);
  --surface: var(--zinc-900);
  --surface-2: var(--zinc-800);
  --border: var(--zinc-700);
  --border-soft: #2e2e33;
  --text: var(--zinc-50);
  --text-muted: var(--zinc-400);
  --text-faint: var(--zinc-500);

  /* Single warm accent */
  --accent: #f59e0b;
  --accent-deep: #ea580c;
  --accent-dim: rgba(245, 158, 11, 0.16);
  --accent-ring: rgba(245, 158, 11, 0.45);

  /* Semantic group accents (not interactive chrome) */
  --official: #f59e0b;
  --independent: #8a9a6a; /* muted olive/sage — not blue */
  --pricing: #c9a227;     /* warm ochre/gold */

  --open: #86a88a;
  --closed: #c4846a;
  --danger-soft: #7f1d1d;

  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

  --filter-w: 300px;
  --radius: 6px;
  --row-h: 2.55rem;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
}

/* Prefer no visible scrollbar chrome */
* { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* —— App shell —— */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.filters-toggle { display: none; }

.shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--filter-w) 1fr;
}

/* —— Filter panel —— */
.filter-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-height: 0;
  overflow: hidden;
}

.filter-panel-inner {
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto; /* allow pin picker + filters to scroll inside the panel */
  overscroll-behavior: contain;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.filter-heading h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

input[type="search"],
select {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--zinc-950);
  border: 1px solid var(--border);
  border-radius: 4px;
  appearance: none;
}
input[type="search"]::placeholder { color: var(--text-faint); }
input[type="search"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip, .btn {
  appearance: none;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--zinc-950);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}
.chip:hover, .btn:hover {
  color: var(--text);
  border-color: var(--zinc-600);
  background: var(--surface-2);
}
.chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
}
.btn-sm {
  padding: 3px 8px;
  font-size: 0.78rem;
}
.btn-accent {
  color: var(--zinc-950);
  background: var(--accent);
  border-color: var(--accent-deep);
  font-weight: 600;
}
.btn-accent:hover {
  background: var(--accent-deep);
  color: var(--zinc-50);
  border-color: var(--accent-deep);
}

.pin-panel {
  border-top: 1px solid var(--border-soft);
  padding-top: 8px;
  min-height: 0;
  flex: 0 1 auto;
}
.pin-panel summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  list-style: none;
}
.pin-panel summary::-webkit-details-marker { display: none; }
.pin-panel summary::before {
  content: "▸ ";
  color: var(--accent);
  font-size: 0.78rem;
}
.pin-panel[open] summary::before { content: "▾ "; }
.pin-picker {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: min(42vh, 22rem); /* long bench list must scroll, not clip */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  min-height: 0;
}
.pin {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.pin input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.muted { color: var(--text-faint); font-weight: 400; }

.filter-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2em;
}
.filter-summary:empty { display: none; }

.legend {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-faint);
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}
.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.swatch.official { background: var(--official); }
.swatch.independent { background: var(--independent); }
.swatch.pricing { background: var(--pricing); }

.filter-backdrop {
  display: none;
}

/* —— Main —— */
.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.toolbar {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.status {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.table-region {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-bottom: 1px solid var(--border-soft);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.8rem;
}

.data-table th,
.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  cursor: default;
  user-select: none;
}
.data-table thead th[data-sort] {
  cursor: pointer;
}
.data-table thead th[data-sort]:hover {
  color: var(--text);
  background: #2c2c30;
}

.data-table th .sub {
  display: block;
  margin-top: 1px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-faint);
}

.data-table th .sort-ind {
  margin-left: 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Sticky first column */
.data-table th.sticky-col,
.data-table td.sticky-col,
.data-table th.model-col,
.data-table td.model-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
  box-shadow: 1px 0 0 var(--border-soft);
  min-width: 160px;
  max-width: 220px;
  width: 180px;
}
.data-table thead th.sticky-col,
.data-table thead th.model-col {
  z-index: 3;
  background: var(--surface-2);
}

.data-table tbody tr:nth-child(even) td { background: #0e0e11; }
.data-table tbody tr:nth-child(even) td.sticky-col,
.data-table tbody tr:nth-child(even) td.model-cell { background: #0e0e11; }
.data-table tbody tr:nth-child(odd) td { background: var(--bg); }
.data-table tbody tr:hover td {
  background: #1c1910;
}
.data-table tbody tr:hover td.sticky-col,
.data-table tbody tr:hover td.model-cell {
  background: #1c1910;
}
.data-table tbody tr { cursor: pointer; }

.model-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-meta {
  display: block;
  margin-top: 1px;
  font-size: 0.76rem;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
}

td.score,
.score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  text-align: right;
}
th.num { text-align: right; }
td.na, .na { color: var(--text-faint); }

th.group-official { color: var(--official); }
th.group-indep { color: var(--independent); }
th.group-pricing { color: var(--pricing); }

.badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.badge-official {
  color: var(--official);
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--accent-dim);
}
.badge-indep {
  color: var(--independent);
  border-color: rgba(138, 154, 106, 0.4);
  background: rgba(138, 154, 106, 0.12);
}
.badge-pricing {
  color: var(--pricing);
  border-color: rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.12);
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.pill.open {
  color: var(--open);
  border-color: rgba(134, 168, 138, 0.45);
  background: rgba(134, 168, 138, 0.1);
}
.pill.closed {
  color: var(--closed);
  border-color: rgba(196, 132, 106, 0.45);
  background: rgba(196, 132, 106, 0.1);
}

.src-link {
  margin-left: 3px;
  font-size: 0.76rem;
  color: var(--accent);
  text-decoration: none;
}
.src-link:hover { color: var(--accent-deep); }

.detail-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

/* —— Pagination —— */
.pagination {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.page-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 7.5rem;
  text-align: center;
}

.colophon {
  flex: 0 0 auto;
  padding: 6px 12px 8px;
  font-size: 0.75rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
}

/* —— Detail dialog —— */
dialog#detailDialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  max-width: min(980px, 96vw);
  width: 96vw;
  max-height: min(88vh, 840px);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
dialog#detailDialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
.dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 840px);
  overflow: hidden;
}
.dialog-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.dialog-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 16px;
  display: grid;
  grid-template-columns: 1.15fr 1.05fr 0.9fr;
  gap: 14px;
}
@media (max-width: 900px) {
  .dialog-body { grid-template-columns: 1fr; }
}

.detail-col h3 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-col h3.official { color: var(--official); }
.detail-col h3.independent { color: var(--independent); }
.detail-col h3.pricing { color: var(--pricing); }

.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.mini th, .mini td {
  padding: 4px 5px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  white-space: nowrap;
}
.mini th {
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mini td.score { text-align: right; }
.score-list { overflow: hidden; }
.more-note {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
}
.detail-meta {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: normal;
}
.detail-meta code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 4px;
  border-radius: 3px;
}

/* —— Narrow screens: filter drawer —— */
@media (max-width: 900px) {
  .filters-toggle { display: inline-flex; }

  .shell {
    grid-template-columns: 1fr;
    position: relative;
  }

  .filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--filter-w), 88vw);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .filter-panel.is-open {
    transform: translateX(0);
  }

  .filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
  }
  .filter-backdrop[hidden] { display: none; }
}

/* Dashboard alignment patches */

.topbar-brand { min-width: 0; }
.topbar-brand h1 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }


.official-col { color: var(--text); }


.pricing-col { color: var(--text); }


.indep-col { color: var(--text); }



/* Metric topic explanations in detail dialog */
.metric-label { font-weight: 500; }
.metric-desc {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #a1a1aa;
  max-width: 28rem;
  font-weight: 400;
}


/* --- Effort chips + multi-source "Also check" --- */
.score-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  vertical-align: middle;
}
.score-num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.effort-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-dim);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.effort-chip.effort-fallback {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--zinc-950);
  opacity: 0.85;
}
.effort-affordance {
  font-size: 0.68rem;
  opacity: 0.75;
  margin-left: 1px;
}
.score-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 2px 0 4px;
}
.score-block {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.score-block:last-child { border-bottom: none; }
.also-check {
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-faint);
}
.also-check-label {
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.62rem;
}
.also-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.also-check-list li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.src-kind {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  padding: 0 3px;
}
.also-check-list a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.also-check-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.effort-matrix {
  margin-top: 4px;
  margin-bottom: 2px;
}
.effort-matrix .effort-chip {
  margin-right: 4px;
}
.tag {
  display: inline-block;
  font-size: 0.62rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}


/* Infinite scroll (no page breaks) */
.pagination { display: none !important; }
.scroll-status {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-soft);
}
.scroll-status[data-done="true"] { color: var(--text-faint); }

/* Context / Size meta columns (split out of model-name secondary lines) */
th.context-col,
td.context-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  text-align: center;
  white-space: nowrap;
  width: 3.25rem;
  max-width: 3.5rem;
  padding-left: 4px;
  padding-right: 4px;
}
td.size-cell {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted, #a1a1aa);
  max-width: 168px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th.meta-col .sub { display: block; }
th.size-col { text-align: left; min-width: 110px; }
.identity-line { margin: 0 0 0.75rem; }

/* ===================================================================
   Page nav + compare selection (Table page) + Compare page (compare.html)
   Same zinc / single amber accent rules. No blue/purple, no scrollbar chrome.
   =================================================================== */
.page-nav {
  display: flex;
  gap: 2px;
  margin-right: auto;
  margin-left: 18px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--zinc-950);
}
.page-nav a {
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}
.page-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.page-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

/* Table page: selection checkbox inside the sticky model cell */
.toolbar-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.compare-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.compare-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1em;
}
.compare-msg[data-tone="warn"] { color: var(--accent); font-weight: 500; }
.compare-msg[data-tone="warn"]::before { content: "! "; font-family: var(--font-mono); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.compare-link { font-family: var(--font-mono); font-size: 0.78rem; }
.compare-link.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.model-cell-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.cmp-hit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -4px 0 -4px -4px;
  cursor: pointer;
}
.cmp-check,
.toggle input,
.seg input {
  accent-color: var(--accent);
}
.cmp-check { margin: 0; width: 14px; height: 14px; cursor: pointer; }
.data-table tbody tr.is-selected th.model-cell { box-shadow: inset 2px 0 0 var(--accent), 1px 0 0 var(--border-soft); }
.data-table tbody tr.is-selected .model-name { color: var(--accent); }

/* —— Compare page —— */
.compare-toolbar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.picker { display: flex; align-items: center; gap: 8px; }
.picker-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.combo { position: relative; width: 240px; }
.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 3px;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.combo-opt {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 3px;
  font-size: 0.84rem;
  cursor: pointer;
}
.combo-opt .opt-meta { color: var(--text-faint); font-size: 0.74rem; white-space: nowrap; }
.combo-opt:hover, .combo-opt.is-active { background: var(--surface-2); }
.combo-opt.is-active { box-shadow: inset 2px 0 0 var(--accent); }
.combo-opt[aria-disabled="true"] { color: var(--text-faint); cursor: not-allowed; }
.combo-note { padding: 5px 7px; font-size: 0.76rem; color: var(--accent); }

.cmp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 320px;
  min-width: 0;
}
.cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 3px 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--zinc-950);
  font-size: 0.8rem;
}
.chip-idx { color: var(--accent); font-size: 0.72rem; margin-right: 2px; }
.chip-name { color: var(--text); font-weight: 500; margin-right: 2px; white-space: nowrap; }
.icon-btn {
  appearance: none;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border); background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.25; cursor: default; background: transparent; border-color: transparent; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* filter panel extras */
.seg-field { border: 0; padding: 0; min-width: 0; }
.seg-field legend { padding: 0; margin-bottom: 4px; }
.seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.seg label {
  flex: 1 1 0;
  position: relative;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 5px 4px; }
.seg input:checked + span { color: var(--accent); background: var(--accent-dim); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.chip-n { font-size: 0.68rem; color: var(--text-faint); margin-left: 2px; }
.chip.active .chip-n { color: var(--accent); }
.toggles { gap: 6px; }
.toggle {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
}
.toggle input { margin: 2px 0 0; }
.hidden-rows-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--text-muted); }

/* comparison table */
.compare-table { width: auto; min-width: 100%; }
.compare-table col.col-rowhead { width: 250px; }
.compare-table col.col-model { width: 190px; }
.compare-table tbody tr { cursor: default; }
.compare-table th.sticky-col,
.compare-table th.cmp-rowhead,
.compare-table th.cmp-corner {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}
.compare-table thead th { vertical-align: bottom; }
.compare-table thead th.cmp-model-head {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  text-align: right;
  white-space: normal;
}
.model-head-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.head-actions { display: flex; justify-content: flex-end; gap: 1px; margin-top: 3px; }
.corner-label { color: var(--text); text-transform: none; font-size: 0.82rem; letter-spacing: 0; }

.compare-table th.cmp-rowhead {
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  white-space: normal;
}
.rowhead-inner { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rowhead-text { flex: 1 1 auto; min-width: 0; }
.rowhead-label { font-size: 0.82rem; }
.compare-table th.cmp-rowhead .sub { display: block; font-size: 0.7rem; color: var(--text-faint); font-weight: 400; }
.cmp-cov { font-size: 0.68rem; }
.row-hide {
  flex: 0 0 auto;
  appearance: none;
  width: 20px;
  height: 20px;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.35;
}
.compare-table tr:hover .row-hide,
.row-hide:focus-visible { opacity: 1; }
.row-hide:hover { color: var(--accent); border-color: var(--border); }

/* match td zebra (section header row is child 1) */
.compare-table tbody tr:nth-child(even) th.cmp-rowhead { background: #0e0e11; }
.compare-table tbody tr:nth-child(odd) th.cmp-rowhead { background: var(--bg); }
.compare-table tbody tr:hover th.cmp-rowhead { background: #1c1910; }

.section-row th.section-head {
  overflow: visible;
  padding: 10px 8px 5px;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  position: static;
  box-shadow: none;
}
.section-inner {
  position: sticky;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.section-toggle {
  appearance: none;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 1px 2px;
  cursor: pointer;
}
.section-toggle:hover { color: var(--text); }
.section-toggle .caret { color: var(--accent); margin-right: 4px; font-size: 0.7rem; }
.section-count { font-size: 0.7rem; color: var(--text-faint); }

.cmp-cell { vertical-align: top; }
.cmp-val { display: inline-flex; align-items: baseline; gap: 4px; justify-content: flex-end; }
.cmp-sub {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.cmp-delta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.cmp-delta.is-worse { color: var(--zinc-500); }
td.cmp-cell.is-best,
td.cmp-text.is-best,
.compare-table tbody tr td.is-best {
  color: var(--accent);
  background-color: rgba(245, 158, 11, 0.07);
}
td.cmp-cell.is-best .score-num { font-weight: 600; }
.best-mark { color: var(--accent); font-size: 0.62rem; }
.peer-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: 3px;
  padding: 0 3px;
}
td.cmp-text { text-align: right; color: var(--text-muted); font-size: 0.8rem; }
td.cmp-text.mono { font-family: var(--font-mono); }
.cmp-slug { display: block; font-size: 0.66rem; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; }
.compare-table td.na { text-align: right; }

@media (max-width: 900px) {
  .page-nav { margin-left: 8px; }
  .combo { width: 100%; }
  .picker { flex: 1 1 100%; }
  .compare-table col.col-rowhead,
  .compare-table th.sticky-col,
  .compare-table th.cmp-rowhead,
  .compare-table th.cmp-corner { width: 160px; min-width: 160px; max-width: 160px; }
  .compare-table col.col-model { width: 150px; }
}

/* Compare: shared count + category tag next to row label (2026-09-25 auto-hide/sort) */
.cmp-shared {
  margin-left: 6px;
  font-size: 0.68rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.cat-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  font-size: 0.64rem;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  vertical-align: middle;
  text-transform: lowercase;
}
.toggle input:disabled + span { opacity: 0.5; }
