/* ============================================================
   Filament Selector — test build
   Near-monochrome shell, hairline borders, dense tabular data.
   One accent (green) does all interactive + status work.
   ============================================================ */

:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #fafbfb;
  --ink: #17191b;
  --ink-2: #4d545b;
  --ink-3: #878f96;
  --line: #e4e7ea;
  --line-2: #d4d9dd;

  --accent: #1c7c44;
  --accent-hover: #166538;
  --accent-bg: #ecf6f0;
  --accent-line: #bfe0cc;

  --warn: #8a5a00;
  --warn-bg: #fdf4dd;
  --warn-line: #ecd9a4;
  --bad: #b13c2e;
  --bad-bg: #fbeeec;
  --bad-line: #ecc8c2;

  --r: 4px;
  --sans: system-ui, "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }
input, select { font: inherit; }
::selection { background: var(--accent-bg); }

.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* ── top nav ─────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1380px; margin: 0 auto; padding: 0 20px;
  height: 48px;
  display: flex; align-items: center; gap: 20px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 650; font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink); white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand .mark {
  width: 20px; height: 20px; border-radius: 4px;
  background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700; font-family: var(--mono);
}
.nav-brand .beta {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 1px 7px;
}
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a {
  padding: 14px 11px 12px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-links .count-badge {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 1px 6px; margin-left: 5px;
  vertical-align: 1px;
}
.nav-meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ── shell ───────────────────────────────────────────────── */
.shell { max-width: 1380px; margin: 0 auto; padding: 18px 20px 64px; }
.shell.narrow { max-width: 980px; }

/* ── status bar (the green bar) ──────────────────────────── */
.statusbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border: 1px solid var(--accent-line);
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--r);
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.statusbar.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.statusbar strong { font-weight: 650; }
.statusbar .sep { color: inherit; opacity: 0.35; }
.statusbar .assume { margin-left: auto; font-size: 12px; opacity: 0.85; }

/* ── layout: rail + main ─────────────────────────────────── */
.cols { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.cols.slim-rail { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 900px) { .cols, .cols.slim-rail { grid-template-columns: 1fr; } }

.rail { position: sticky; top: 62px; max-height: calc(100vh - 76px); overflow-y: auto; }
@media (max-width: 900px) { .rail { position: static; max-height: none; } }

/* ── panels ──────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.panel + .panel { margin-top: 12px; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 13px; font-weight: 650; }
.panel-body { padding: 12px 14px; }
.panel-action { font-size: 12px; }

/* rail groups */
.rail-group { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.rail-group:last-child { border-bottom: none; }
.rail-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.rail-label .reset { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* requirement row: label + segmented */
.req-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 3px 0;
}
.req-row .req-name { font-size: 13px; color: var(--ink-2); }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button {
  padding: 3px 9px; font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button.on { background: var(--accent); color: #fff; }
.seg.wide button { padding: 5px 12px; font-size: 12.5px; }

/* checkbox-ish rows */
.checkrow {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; font-size: 13px; color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.checkrow:hover { color: var(--ink); }
.checkrow .box {
  width: 14px; height: 14px; flex: none;
  border: 1px solid var(--line-2); border-radius: 3px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
}
.checkrow.on .box { background: var(--accent); border-color: var(--accent); }
.checkrow.on .box::after { content: ""; width: 8px; height: 4.5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(0.5px, -1px); }
.checkrow .tail { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* numeric input */
.num-input {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  padding: 0 9px; height: 30px;
}
.num-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.num-input input {
  border: none; outline: none; width: 100%; min-width: 0;
  font-family: var(--mono); font-size: 13px; color: var(--ink); background: transparent;
}
.num-input .affix { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* preset chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  padding: 3.5px 11px; font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2);
  padding: 5px 12px; font-size: 12.5px; font-weight: 550;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.sm { padding: 2.5px 9px; font-size: 11.5px; }
.btn.linkish { border: none; background: none; color: var(--accent); padding: 0; }

/* ── tables ──────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow-x: auto;
}
table.data { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.data th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  padding: 7px 10px;
  font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3);
  text-align: left; white-space: nowrap;
}
table.data th.num, table.data td.num { text-align: right; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arr { font-size: 9px; margin-left: 3px; }
table.data th.sorted { color: var(--accent); }
table.data td {
  padding: 6.5px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.rowlink { cursor: pointer; }
table.data tbody tr.rowlink:hover td { background: var(--surface-2); }
table.data td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data td .null { color: var(--ink-3); opacity: 0.6; }
table.data tr.dim td { color: var(--ink-3); }
table.data tr.dim td .name-cell strong { color: var(--ink-3); }
.name-cell { display: flex; flex-direction: column; line-height: 1.25; }
.name-cell strong { font-weight: 600; color: var(--ink); }
.name-cell .sub { font-size: 11px; color: var(--ink-3); }

/* score bar cell */
.score-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.score-cell .bar { flex: 1; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 50px; }
.score-cell .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.score-cell .pct { font-family: var(--mono); font-size: 12px; font-weight: 600; width: 34px; text-align: right; }
tr.dim .score-cell .bar > i { background: var(--line-2); }

/* dot meter (0-10 as 5 dots) */
.dots { display: inline-flex; gap: 2.5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.dots i.f { background: var(--accent); }
.dots i.h { background: linear-gradient(90deg, var(--accent) 50%, var(--line-2) 50%); }
tr.dim .dots i.f { background: var(--ink-3); }
tr.dim .dots i.h { background: linear-gradient(90deg, var(--ink-3) 50%, var(--line-2) 50%); }

/* implausible source value: shown, flagged, excluded from aggregates */
.suspect { color: var(--warn) !important; }

/* badges / flags */
.badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  border-radius: 3px; padding: 1px 6px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface-2);
  white-space: nowrap;
}
.badge.ok { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-line); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.badge.mono { font-family: var(--mono); }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* star (shortlist) */
.star { font-size: 15px; color: var(--line-2); padding: 0 2px; line-height: 1; }
.star:hover { color: var(--ink-3); }
.star.on { color: var(--accent); }

/* expand row */
tr.expand > td { background: var(--surface-2); white-space: normal; padding: 14px 16px; }
.expand-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 20px; font-size: 12.5px; }
@media (max-width: 1000px) { .expand-grid { grid-template-columns: 1fr; } }
.expand-grid h4 {
  margin: 0 0 7px; font-size: 10.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3);
}
.expand-grid ul { margin: 0; padding-left: 16px; }
.expand-grid li { margin-bottom: 3px; }
.why-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.why-row .w-name { color: var(--ink-2); }
.why-row .w-val { font-family: var(--mono); font-size: 11.5px; }

/* ── swatches ────────────────────────────────────────────── */
.sw {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.12);
  vertical-align: -2px;
}
.sw-strip { display: inline-flex; gap: 2px; }

.swatch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.swatch-card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  overflow: hidden; cursor: pointer;
}
.swatch-card:hover { border-color: var(--accent); }
.swatch-card .swatch-top { height: 56px; display: flex; }
.swatch-card .swatch-top i { flex: 1; }
.swatch-card .swatch-info { padding: 7px 9px; line-height: 1.3; }
.swatch-card .swatch-info .cname { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-card .swatch-info .cprod { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-card .swatch-info .cmeta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }

/* ── product detail ──────────────────────────────────────── */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-head h1 { margin: 0 0 2px; font-size: 24px; letter-spacing: -0.01em; }
.detail-head .crumb { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.detail-head .crumb a { color: var(--ink-3); }
.detail-head .crumb a:hover { color: var(--accent); }
.detail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.kv {
  padding: 10px 14px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.kv .k { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 2px; }
.kv .v { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.kv .v .unit { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.kv .s { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

table.props { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.props td, table.props th { padding: 5.5px 14px; border-bottom: 1px solid var(--line); text-align: left; }
table.props th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); background: var(--surface-2); }
table.props td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
table.props .cat-row td {
  background: var(--surface-2); font-size: 10.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3);
  padding: 4px 14px;
}

/* ── compare ─────────────────────────────────────────────── */
.compare-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); }
table.compare { border-collapse: collapse; min-width: 100%; font-size: 12.5px; }
table.compare th, table.compare td { padding: 7px 14px; border-bottom: 1px solid var(--line); text-align: left; min-width: 150px; }
table.compare td.lbl {
  position: sticky; left: 0; background: var(--surface-2); z-index: 1;
  font-size: 11px; font-weight: 600; color: var(--ink-2); min-width: 170px;
  border-right: 1px solid var(--line);
}
table.compare td.num { font-family: var(--mono); }
table.compare td.best { color: var(--accent); font-weight: 650; }
table.compare th .cmp-head { display: flex; flex-direction: column; gap: 2px; }
table.compare .sect td {
  background: var(--surface-2); font-size: 10.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); padding: 4px 14px;
}

/* ── misc ────────────────────────────────────────────────── */
.empty {
  border: 1px dashed var(--line-2); border-radius: var(--r);
  padding: 36px 20px; text-align: center; color: var(--ink-3); font-size: 13px;
  background: var(--surface);
}
.empty a { font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar .search {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  padding: 0 10px; height: 31px; min-width: 220px;
}
.toolbar .search input { border: none; outline: none; background: none; font-size: 13px; width: 100%; }
.toolbar .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }

.note {
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn);
  border-radius: var(--r); padding: 9px 13px; font-size: 12.5px; margin-bottom: 14px;
}
.note.info { border-color: var(--line-2); background: var(--surface-2); color: var(--ink-2); }

.footer {
  max-width: 1380px; margin: 0 auto; padding: 16px 20px 28px;
  border-top: 1px solid var(--line);
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
.footer .grow { flex: 1; }

h2.section { font-size: 15px; margin: 22px 0 10px; letter-spacing: -0.01em; }
h2.section:first-child { margin-top: 0; }
h2.section .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 8px; }

.loading { padding: 60px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* about page prose */
.prose { max-width: 760px; font-size: 13.5px; }
.prose h2 { font-size: 16px; margin: 26px 0 8px; }
.prose h3 { font-size: 13.5px; margin: 18px 0 6px; }
.prose p { margin: 8px 0; }
.prose li { margin: 3px 0; }
.prose table { border-collapse: collapse; font-size: 12.5px; }
.prose table td, .prose table th { border: 1px solid var(--line-2); padding: 4px 10px; text-align: left; }
