/* Examenos — 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;
}

/* Deployed-build tag (data/version.json, written by build.sh). Hidden on
   phones so the count/Filters row keeps its wrap order. */
.build-tag {
  font-size: 0.75rem;
  color: var(--text-faint, #71717a);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .build-tag { display: none; }
}

.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);
}

/* Sidebar layout (2026-09-25, v2): .filter-panel-inner is a viewport-height flex column
   (the grid cell / mobile drawer is exactly the visible height). Every item keeps its natural
   height (flex-shrink: 0 — before, shrinking squeezed the open pin <details> to ~9px and its list
   spilled over the summary + legend). The ONE flexible item is the open pin panel: its list box
   takes whatever height is left (flex: 1 1 auto, min-height: 0 down the chain) but never less
   than --pin-list-min, so the summary + legend stay on screen without the panel scrolling.
   Only when even the minimum does not fit (very short viewports) does the panel scroll as a whole. */
.filter-panel { --pin-list-min: 140px; }            /* ≈7 rows */
@media (max-height: 760px) { .filter-panel { --pin-list-min: 112px; } } /* ≈5.5 rows on short laptops */
.filter-panel-inner { gap: 8px; padding: 10px 12px; }
.filter-panel-inner > * { flex-shrink: 0; }

/* Compact controls so the whole sidebar fits common laptop heights (1280×720 and up). */
.filter-panel .field { gap: 3px; }
.filter-panel .field-label { font-size: 0.68rem; }
.filter-panel input[type="search"],
.filter-panel select { font-size: 0.82rem; padding: 4px 7px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}
.field-grid .field-wide { grid-column: 1 / -1; }
.field-grid select { text-overflow: ellipsis; }
.filter-panel .chip-row { gap: 4px; }
.filter-panel .chip { font-size: 0.72rem; padding: 1px 5px; line-height: 1.35; }
.filter-panel .hint { margin-top: 5px; font-size: 0.72rem; }
.filter-heading-actions { display: flex; align-items: center; gap: 6px; }

.pin-panel {
  border-top: 1px solid var(--border-soft);
  padding-top: 7px;
  flex: 0 0 auto;
}
/* Open: the panel is the flexible item; min-height = summary + minimum list + hint. */
.pin-panel[open] {
  flex: 1 1 auto;
  min-height: calc(var(--pin-list-min) + 3.6rem); /* + summary, borders, one-line hint */
  display: flex;
  flex-direction: column;
}
.pin-panel[open]::details-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pin-panel summary {
  flex: 0 0 auto;
  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;
  flex: 1 1 auto;           /* fills the space left in the sidebar… */
  min-height: var(--pin-list-min); /* …but never collapses */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 6px 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  /* Scroll cue without scrollbar chrome: fades/shadows appear only where more items are hidden
     (local covers slide with content, scroll shadows stay at the edges). */
  background:
    linear-gradient(var(--surface) 30%, rgba(24, 24, 27, 0)) center top / 100% 28px no-repeat local,
    linear-gradient(rgba(24, 24, 27, 0), var(--surface) 70%) center bottom / 100% 28px no-repeat local,
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)) center top / 100% 14px no-repeat scroll,
    linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55)) center bottom / 100% 14px no-repeat scroll,
    var(--surface);
}
.pin-picker > .pin { flex-shrink: 0; }
.pin-panel .hint { flex: 0 0 auto; }
/* Browsers without ::details-content can't flex the list: fall back to a fixed cap. */
@supports not selector(::details-content) {
  .pin-picker { flex: 0 0 auto; max-height: min(34vh, 18rem); }
  .pin-panel[open] { 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);
}

/* —— 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); }



/* --- 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;
}
/* 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: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th.meta-col .sub { display: block; }
th.size-col { text-align: left; min-width: 85px; }
/* REVERSIBLE (2026-09-27): user-resizable column handles on the main table. */
.data-table thead th .col-resize {
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  bottom: 0;
  cursor: col-resize;
  touch-action: none;
  z-index: 4;
}
.data-table thead th .col-resize::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  right: 3px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}
.data-table thead th:hover .col-resize::after { background: var(--border); }
.data-table thead th .col-resize:hover::after,
.data-table thead th .col-resize.active::after { background: var(--accent); }
.data-table.col-resizing,
.data-table.col-resizing th { cursor: col-resize; user-select: none; }
/* END REVERSIBLE */
th.released-col,
td.released-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  text-align: center;
  white-space: nowrap;
  width: 6rem;
  max-width: 6.5rem;
  padding-left: 4px;
  padding-right: 4px;
}
th.provider-col,
td.provider-cell {
  max-width: 6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th.access-col,
td.access-cell {
  max-width: 5.5rem;
  white-space: nowrap;
}
td.access-cell .pill { padding: 2px 4px; }
th.group-official,
th.group-indep {
  min-width: 7rem;
}
.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;
}
.peer-tag.third-tag { color: var(--closed); border-color: rgba(196, 132, 106, 0.55); border-style: solid; }
.dd-tag-third { color: var(--closed); border-color: rgba(196, 132, 106, 0.55); }
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; }

/* —— Model detail dialog (redesign 2026-09-25) ——
   header (identity + links + section nav) → body grid: rail (facts, pricing, notes) | main
   (main-table tiles, independent by evaluator, official by category). One scroller (.dd-body). */
dialog.dd {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  width: min(1120px, 96vw);
  max-width: 96vw;
  height: min(92vh, 920px);
  max-height: 92vh;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
dialog.dd::backdrop { background: rgba(0, 0, 0, 0.66); }
.dd-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.dd-header {
  flex: 0 0 auto;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dd-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dd-head-main { min-width: 0; }
.dd-header h2 { margin: 0; font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dd-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 6px; font-size: 0.8rem; color: var(--text-muted);
}
.dd-provider { color: var(--zinc-300); font-weight: 500; }
.dd-sub .pill { font-size: 0.72rem; padding: 1px 8px; }
.dd-license {
  font-size: 0.72rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px;
}
.dd-links { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; padding-left: 10px; border-left: 1px solid var(--border-soft); }
.dd-link { font-size: 0.78rem; color: var(--accent); white-space: nowrap; }
.dd-close { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; }

.dd-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 16px 20px; }
.dd-grid {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "rail top" "rail main"; gap: 22px; align-items: start;
}
.dd-rail { grid-area: rail; position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dd-top { grid-area: top; min-width: 0; }
.dd-main { grid-area: main; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.dd-top .dd-pref { margin: 0 0 8px; }

.dd-sec h3 {
  margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.dd-sec h3 .badge { margin-left: 0; }
.dd-sec h3.official { color: var(--official); }
.dd-sec h3.independent { color: var(--independent); }
.dd-sec h3.pricing { color: var(--pricing); }
.dd-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dd-sec-head h3 { margin: 0; }
.dd-count {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0;
  color: var(--text-faint); border: 1px solid var(--border-soft); border-radius: 3px; padding: 0 4px;
}
.dd-empty { margin: 0; font-size: 0.8rem; }
.dd-hint { margin: 6px 0 0; font-size: 0.72rem; color: var(--text-faint); line-height: 1.45; }
.dd-pref { margin: 0; padding: 6px 8px; border: 1px solid var(--border-soft); border-radius: 4px; background: var(--zinc-950); }
.dd-pref b { color: var(--zinc-300); font-weight: 500; }
.dd-unit { font-size: 0.72rem; color: var(--text-faint); font-weight: 400; }
.dd-code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--zinc-300); overflow-wrap: anywhere; }

/* Key facts */
.dd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden; }
.dd-fact { background: var(--surface); padding: 6px 8px; min-width: 0; }
.dd-fact-wide { grid-column: 1 / -1; }
.dd-fact dt { font-size: 0.64rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.dd-fact dd { margin: 2px 0 0; font-size: 0.84rem; color: var(--text); overflow-wrap: anywhere; }
.dd-mods { display: flex; flex-wrap: wrap; gap: 4px; }
.dd-mod { font-size: 0.72rem; color: var(--zinc-300); border: 1px solid var(--border); border-radius: 3px; padding: 0 5px; }

/* Pricing */
.dd-price { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dd-price th, .dd-price td { padding: 5px 6px; border-bottom: 1px solid var(--border-soft); }
.dd-price thead th { font-size: 0.68rem; font-weight: 600; color: var(--text-faint); text-align: right; letter-spacing: 0.03em; }
.dd-price thead th:first-child { text-align: left; }
.dd-price tbody th { text-align: left; font-weight: 400; color: var(--text-muted); }
.dd-price td { text-align: right; font-variant-numeric: tabular-nums; }
.dd-price .is-pref { color: var(--pricing); }
.dd-price-src { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; }
.dd-price-src li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.dd-price-tier { color: var(--text-faint); min-width: 5.6rem; }
.dd-price-note { flex-basis: 100%; color: var(--text-faint); padding-left: 0; }

/* Notes */
.dd-notes { border: 1px solid var(--border-soft); border-radius: 4px; background: var(--zinc-950); }
.dd-notes summary {
  cursor: pointer; list-style: none; padding: 6px 8px; display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.dd-notes summary::-webkit-details-marker { display: none; }
.dd-notes summary::before { content: "▸"; color: var(--text-faint); font-size: 0.7rem; transition: transform 0.12s; }
.dd-notes[open] summary::before { transform: rotate(90deg); }
.dd-notes p, .dd-notes-list { margin: 0; padding: 0 10px 10px; font-size: 0.78rem; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.dd-notes-list { padding-left: 24px; }
.dd-notes-list li + li { margin-top: 4px; }

/* On-main-table tiles */
.dd-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dd-tile {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 7px 10px; background: var(--zinc-950);
  border: 1px solid var(--border-soft); border-left: 2px solid var(--border); border-radius: 4px;
}
.dd-tile.is-off { border-left-color: var(--official); }
.dd-tile.is-ind { border-left-color: var(--independent); }
.dd-tile-k { font-size: 0.74rem; color: var(--zinc-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-tile-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 1.05rem; color: var(--text); }
.dd-tile-v .mono { white-space: nowrap; }
.dd-tile-s { font-size: 0.64rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }

/* Score tables */
.dd-scores { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.83rem; }
.dd-scores thead th {
  padding: 4px 8px; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint); text-align: left; border-bottom: 1px solid var(--border);
}
.dd-scores thead th.dd-effort { width: 72px; text-align: right; }
.dd-scores thead th.dd-score { width: 92px; text-align: right; }
.dd-scores thead th.dd-date { width: 92px; }
.dd-scores thead th.dd-srccell { width: 30px; }
.dd-group-head th {
  padding: 10px 8px 5px; text-align: left; border-bottom: 1px solid var(--border-soft);
  font-size: 0.72rem; font-weight: 600; color: var(--zinc-300); letter-spacing: 0.02em;
}
.dd-group-head .dd-count { margin-left: 6px; }
.dd-group-link { float: right; font-size: 0.7rem; font-weight: 400; color: var(--text-faint); }
.dd-group-link:hover { color: var(--accent); }
.dd-row > th, .dd-row > td { padding: 5px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.dd-row:hover > th, .dd-row:hover > td, .dd-row.is-open > th, .dd-row.is-open > td { background: rgba(255, 255, 255, 0.025); }
.dd-name { text-align: left; font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.dd-toggle {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%;
  padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
}
.dd-toggle:hover .dd-name-txt { color: var(--accent); }
.dd-caret { flex: 0 0 auto; font-size: 0.66rem; color: var(--text-faint); transition: transform 0.12s; }
.dd-toggle[aria-expanded="true"] .dd-caret { transform: rotate(90deg); color: var(--accent); }
.dd-tag {
  display: inline-block; margin-left: 6px; padding: 0 4px; vertical-align: 1px;
  font-size: 0.62rem; line-height: 1.5; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 3px;
}
.dd-tag-table { color: var(--accent); border-color: rgba(245, 158, 11, 0.4); }
.dd-tag-shown { color: var(--zinc-300); background: var(--surface-2); }
.dd-variants { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin: 3px 0 0 16px; font-size: 0.72rem; color: var(--text-faint); }
.dd-variants-label { font-family: var(--font-mono); font-size: 0.66rem; }
.dd-variant { white-space: nowrap; cursor: help; }
.dd-variants-more { font-size: 0.68rem; color: var(--text-faint); }
.dd-variant-k { color: var(--text-faint); }
.dd-variant .mono { color: var(--text-muted); }
.dd-effort { text-align: right; white-space: nowrap; }
.dd-score { text-align: right; white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.dd-date { font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; }
.dd-srccell { text-align: center; }
.dd-src { color: var(--accent); text-decoration: none; font-size: 0.82rem; }
.dd-src:hover { color: var(--accent-deep); text-decoration: none; }

.dd-more > td { padding: 8px 10px 12px 24px; background: var(--zinc-950); border-bottom: 1px solid var(--border-soft); }
.dd-desc { margin: 0 0 8px; max-width: 72ch; font-size: 0.78rem; line-height: 1.45; color: var(--text-muted); }
.dd-runs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-soft); border-radius: 4px; }
.dd-run {
  display: grid; align-items: baseline; gap: 2px 10px; padding: 5px 8px;
  grid-template-columns: 64px 104px minmax(0, auto) 88px minmax(0, 1fr);
  grid-template-areas: "eff score marks date src" "notes notes notes notes notes";
  font-size: 0.78rem;
}
.dd-run + .dd-run { border-top: 1px solid var(--border-soft); }
.dd-run.is-shown { background: rgba(245, 158, 11, 0.05); }
.dd-run-effort { grid-area: eff; }
.dd-run-score { grid-area: score; color: var(--text); }
.dd-exact { color: var(--text-faint); font-size: 0.7rem; }
.dd-run-marks { grid-area: marks; white-space: nowrap; }
.dd-run-marks .dd-tag:first-child { margin-left: 0; }
.dd-run-date { grid-area: date; font-size: 0.72rem; color: var(--text-faint); }
.dd-run-src { grid-area: src; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.74rem; }
.dd-run-notes { grid-area: notes; margin: 2px 0 0; font-size: 0.74rem; line-height: 1.45; color: var(--text-faint); overflow-wrap: anywhere; }
.dd-also { margin-top: 8px; font-size: 0.72rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.dd-also-label { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.dd-also ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dd-also li { display: inline-flex; align-items: baseline; gap: 4px; }
.dd-also a { color: var(--text-muted); }
.dd-also a:hover { color: var(--accent); }
.dd-kind { font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-faint); border: 1px solid var(--border-soft); border-radius: 2px; padding: 0 3px; }
.dd-legend { margin-top: -8px; }
.dd-legend .dd-tag { margin-left: 0; }

@media (max-width: 1000px) {
  .dd-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "top" "rail" "main"; gap: 20px; }
  .dd-rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
}
@media (max-width: 760px) {
  dialog.dd { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .dd-header { padding: 10px 12px 0; }
  .dd-header h2 { font-size: 1.08rem; }
  .dd-links { flex-basis: 100%; padding-left: 0; border-left: 0; }
  .dd-close { padding: 6px 10px; }
  .dd-close-txt { display: none; }
  .dd-body { padding: 12px 12px 24px; }
  .dd-rail { display: flex; align-items: stretch; }
  .dd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* keep the column (colspan rows stay aligned) but collapse it */
  .dd-scores .dd-date { width: 0; padding: 0 !important; font-size: 0; overflow: hidden; border-left: 0; }
  .dd-scores thead th.dd-date { width: 0; }
  .dd-scores thead th.dd-effort { width: 58px; }
  .dd-scores thead th.dd-score { width: 70px; }
  .dd-scores thead th.dd-srccell { width: 24px; }
  .dd-row > th, .dd-row > td { padding: 6px 4px; }
  .dd-row > th { padding-left: 2px; }
  .dd-more > td { padding: 8px 6px 10px 8px; }
  .dd-run {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "eff score date" "marks marks marks" "src src src" "notes notes notes";
  }
  .dd-run-marks:empty { display: none; }
  .dd-legend { margin-top: -10px; }
}

/* —— Feedback (header button + panel, 2026-09-27) ——
   Button: same family as the Table/Compare switch, quieter (muted text, never the accent).
   Panel: reuses dialog.dd (look, backdrop, full-screen ≤760px); .fb only narrows it. */
.nav-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  margin-left: 18px;
  min-width: 0;
}
.nav-cluster .page-nav { margin: 0; }
.nav-feedback {
  appearance: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: normal;
  color: var(--text-muted);
  background: var(--zinc-950);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-feedback:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 900px) { .nav-cluster { margin-left: 8px; } }
/* Header never overlaps: switch + Feedback and the meta group keep their size; the brand text wraps,
   then the bar wraps. Phones (≤640px): brand + count/Filters on row 1, Table/Compare + Feedback on row 2. */
.nav-cluster, .topbar-meta { flex: 0 0 auto; }
.topbar-brand { flex: 0 1 auto; }
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-brand { flex: 1 1 0; min-width: 200px; }
}
@media (max-width: 640px) {
  .topbar-brand { flex: 1 1 150px; min-width: 150px; }
  .topbar-meta { flex: 0 1 auto; min-width: 0; }
  .result-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .filters-toggle { flex: 0 0 auto; }
  .topbar-meta { order: 1; }
  .nav-cluster { order: 2; flex: 1 1 100%; margin: 0; }
}

dialog.dd.fb {
  width: min(520px, 96vw);
  height: fit-content; /* not auto: a modal dialog is inset:0, so auto would stretch */
  max-height: min(92vh, 720px);
}
dialog.dd.fb .dd-shell { height: auto; max-height: inherit; }
.fb-header { padding-bottom: 12px; }
.fb-lead { margin: 4px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.fb-body { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fb-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fb-opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
/* AA contrast inside the panel: muted (≈7:1) instead of faint (≈3.9:1) for small text */
.fb .field-label, .fb-opt { color: var(--text-muted); }
.fb-count { font-size: 0.75rem; color: var(--text-muted); }
.fb-count.is-warn { color: var(--accent); }
.fb-count.is-max { color: var(--accent); font-weight: 600; }
.fb textarea,
.fb input[type="text"] {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--zinc-950);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.fb textarea { resize: vertical; min-height: 8.5rem; max-height: 40vh; }
.fb textarea::placeholder,
.fb input[type="text"]::placeholder { color: var(--text-faint); }
.fb textarea:focus,
.fb input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.fb textarea[readonly], .fb input[readonly] { opacity: 0.7; }
/* Honeypot: off-screen, not display:none (some bots skip hidden inputs) */
.fb-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.fb-turnstile[hidden] { display: none; }
.fb-status { min-height: 1.2em; font-size: 0.82rem; color: var(--text-muted); }
.fb-status:empty { display: none; }
.fb-status.is-success { color: var(--independent); }
.fb-status.is-error { color: #e0826b; }  /* terracotta — no blue/purple, not the accent */
.fb-status.is-limited { color: var(--accent); }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; }
.fb-send { min-width: 6.5rem; padding: 6px 14px; }
.fb-send:disabled:hover { background: var(--accent); color: var(--zinc-950); border-color: var(--accent-deep); }
@media (max-width: 760px) {
  dialog.dd.fb { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; }
  dialog.dd.fb .dd-shell { height: 100%; }
  .fb-body { flex: 1 1 auto; padding: 14px 12px 24px; }
  .fb textarea { min-height: 10rem; max-height: none; }
}
