/* Dark Factory Index: static data site */

:root {
  color-scheme: light;
  --bg: #f7f7f6;
  --surface: #ffffff;
  --surface-2: #f1f1ef;
  --surface-3: #e9e9e6;
  --text: #191919;
  --text-2: #5f5f5f;
  --text-3: #737373;
  --line: #e7e7e5;
  --line-2: #c9c9c6;
  --accent: #1b64be;
  --accent-wash: #e8f1fc;
  --bar1: #0f4a96;
  --bar2: #257de0;
  --bar3: #84b9f3;
  --track: #eef0f3;
  --own: #f47230;
  --own-wash: #fdeee6;
  --push: #6a4ce2;
  --push-wash: #efebfc;
  --good: #006c10;
  --missing: #d9d9d6;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #181818;
    --surface-2: #202020;
    --surface-3: #2a2a2a;
    --text: #efefef;
    --text-2: #a8a8a8;
    --text-3: #8f8f8f;
    --line: #2c2c2c;
    --line-2: #474747;
    --accent: #6aabf1;
    --accent-wash: #15263b;
    --bar1: #b6d5f8;
    --bar2: #519ced;
    --bar3: #1b64be;
    --track: #242424;
    --own: #e76624;
    --own-wash: #3a2216;
    --push: #9887ef;
    --push-wash: #25203f;
    --good: #53c556;
    --missing: #333333;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #181818;
  --surface-2: #202020;
  --surface-3: #2a2a2a;
  --text: #efefef;
  --text-2: #a8a8a8;
  --text-3: #8f8f8f;
  --line: #2c2c2c;
  --line-2: #474747;
  --accent: #6aabf1;
  --accent-wash: #15263b;
  --bar1: #b6d5f8;
  --bar2: #519ced;
  --bar3: #1b64be;
  --track: #242424;
  --own: #e76624;
  --own-wash: #3a2216;
  --push: #9887ef;
  --push-wash: #25203f;
  --good: #53c556;
  --missing: #333333;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 30px; letter-spacing: -0.02em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1200px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 24px; height: 24px; flex: none; }
.brand svg rect:first-child { fill: var(--accent); }
.brand svg rect:not(:first-child) { fill: var(--surface); }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--text-2); padding: 6px 10px; border-radius: 7px; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--surface-3); }
.search { position: relative; margin-left: auto; width: 340px; max-width: 100%; }
.search input {
  width: 100%; height: 36px; padding: 0 34px 0 34px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.search-ic { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--text-3); font-size: 11px; background: var(--surface-2);
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.search-panel {
  position: absolute; top: calc(100% + 6px); right: 0; width: max(100%, 440px); max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  max-height: min(70vh, 540px); overflow-y: auto; padding: 6px; z-index: 30;
}
.search-panel .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; font-weight: 600; }
.search-panel a {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text);
}
.search-panel a:hover, .search-panel a.sel { background: var(--accent-wash); text-decoration: none; }
.search-panel a .t { font-weight: 550; }
.search-panel a .t { flex: none; max-width: 60%; }
.search-panel a .s { color: var(--text-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hero .search-panel { left: 0; right: auto; }
.search-panel mark { background: none; color: var(--accent); font-weight: 700; }
.search-panel .empty { padding: 14px 10px; color: var(--text-3); font-size: 14px; }
.theme { flex: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 1.6; }
.theme svg .fill { fill: var(--text-2); stroke: none; }

/* ---------- layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; min-height: 70vh; }
main:focus { outline: none; }
.loading, .error { padding: 80px 0; text-align: center; color: var(--text-3); }
.error { color: var(--text); }
.error pre { text-align: left; display: inline-block; background: var(--surface); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line); white-space: pre-wrap; }
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 20px 24px 32px; color: var(--text-3); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

.stack > * + * { margin-top: 28px; }
.section { margin-top: 40px; }
.section-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-h .more { margin-left: auto; font-size: 14px; }
.section-h p { color: var(--text-2); font-size: 14px; flex-basis: 100%; }
.muted { color: var(--text-3); }
.sub { color: var(--text-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.card > h2, .card > h3 { margin-bottom: 12px; }
.card-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-h h3 { flex: 1; }

.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--text-2); }
.crumbs span[aria-hidden] { color: var(--line-2); }
.page-h { margin-bottom: 22px; }
.page-h .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.page-h p.lede { color: var(--text-2); font-size: 16px; max-width: 760px; margin-top: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- home: hero and stack ---------- */
.hero { padding: 36px 0 6px; }
.hero .eyebrow { font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; margin-bottom: 14px; }
.hero h1 { font-size: 46px; line-height: 1.1; letter-spacing: -0.03em; max-width: 880px; }
.hero p { font-size: 18px; color: var(--text-2); max-width: 640px; margin-top: 16px; }

.stack-wrap { margin-top: 30px; }
.stack-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.seg-run a { font-size: 12.5px; }
.stack-sit { color: var(--text-2); font-size: 14.5px; max-width: 860px; margin: 0 0 14px; font-style: italic; }
.layers { display: flex; flex-direction: column; gap: 8px; }
.layer {
  display: grid; grid-template-columns: 210px minmax(0, 1fr) 230px; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px;
  color: var(--text); position: relative; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.layer::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bar2); }
a.layer:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.layer.empty { background: transparent; border-style: dashed; }
.layer.empty::before { display: none; }
.layer-k { display: flex; flex-direction: column; gap: 2px; }
.layer-name { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; color: var(--text-2); }
.layer-role { font-size: 13px; color: var(--text-3); }
.layer-pick { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.layer-win { font-size: 28px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.layer-next { font-size: 13.5px; color: var(--text-3); }
.layer-share { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; }
.layer-pct { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.layer-of { font-size: 12.5px; color: var(--text-3); line-height: 1.3; }
.layer-share .meter { grid-column: 1 / -1; margin-top: 8px; }
.stack-push { margin: 14px 0 0; font-size: 14.5px; color: var(--text); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stack-foot { margin-top: 12px; font-size: 12.5px; color: var(--text-3); max-width: 860px; }

.stack-table td { white-space: nowrap; }
.stack-table td a { color: inherit; }
.stack-table td.differs { color: var(--text); font-weight: 600; }
.stack-table td.agree { color: var(--text-3); }
.stack-table .varies { color: var(--text-2); font-weight: 500; font-style: italic; border-bottom: 1px dotted var(--line-2); cursor: help; }
.agree-key { color: var(--text-3); font-weight: 600; }
.stack-table td .own-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--own); margin-left: 6px; vertical-align: middle; }
.legend i.differs-key { background: var(--own-wash); border: 1px solid var(--line-2); }

.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.finding { display: flex; gap: 18px; align-items: center; color: var(--text); }
.finding:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.f-num { font-size: 40px; font-weight: 680; letter-spacing: -0.03em; flex: none; }
.f-txt { color: var(--text-2); font-size: 14.5px; }
.f-txt b { color: var(--text); }

.big-search { margin: 0 0 14px; width: 100%; max-width: 640px; }
.big-search input { height: 48px; font-size: 16px; padding-left: 42px; border-radius: 12px; }
.big-search .search-ic { left: 14px; width: 18px; height: 18px; }
.big-search .search-panel { left: 0; right: auto; }
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.ex { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.ex:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.ex span { color: var(--text-3); font-size: 13.5px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .l { font-size: 13px; color: var(--text-2); }
.tile .v { font-size: 26px; font-weight: 650; margin-top: 2px; letter-spacing: -0.02em; }
.tile .v small { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.tile .d { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.meter { height: 6px; border-radius: 3px; background: var(--track); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--bar2); border-radius: 3px; }

/* ---------- chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
a.chip:hover { text-decoration: none; border-color: var(--line-2); color: var(--text); }
.chip.run { font-family: var(--mono); font-weight: 600; }
.chip b { color: var(--text); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 7px; border-radius: 6px; font-weight: 550; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.own { background: var(--own-wash); color: var(--text); }
.badge.own::before { background: var(--own); }
.badge.push { background: var(--push-wash); color: var(--text); }
.badge.push::before { background: var(--push); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }
.badge.neutral::before { background: var(--line-2); }

/* ---------- picks (an answer's ranking) ---------- */
.picks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.picks li { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.picks .p { flex: none; width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); transform: translateY(-1px); }
.picks li:first-child .p { background: var(--bar1); color: var(--surface); }
.picks .nm { overflow-wrap: anywhere; }
.picks .own-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--own); flex: none; transform: translateY(-1px); }
.picks.big { gap: 8px; }
.picks.big li { font-size: 17px; font-weight: 550; }
.picks.big .p { width: 24px; height: 24px; font-size: 13px; }
.picks .ph { color: var(--text-3); font-style: italic; }
.none { color: var(--text-3); font-style: italic; }

/* ---------- ranking list (bars) ---------- */
.rl { display: grid; grid-template-columns: 28px minmax(140px, 1.1fr) minmax(120px, 2fr) 58px 48px; align-items: center; column-gap: 14px; }
.rl.compact { grid-template-columns: 22px minmax(0, 1fr) minmax(70px, 1fr) 40px; column-gap: 10px; }
.rl-head { display: contents; }
.rl-head > div { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.rl-row { display: contents; }
.rl-row > div { padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rl-row:last-child > div { border-bottom: none; }
.rl-row:hover > div { background: var(--surface-2); }
.rl-row > div:first-child { border-radius: 6px 0 0 6px; }
.rl-n { color: var(--text-3); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.rl-name { line-height: 1.3; }
.rl-name a { color: var(--text); font-weight: 550; }
.rl-name .o { display: block; font-size: 12px; color: var(--text-3); }
.rl-v { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.rl-v.dim { color: var(--text-3); }
.bar { display: flex; height: 12px; gap: 2px; background: none; position: relative; }
.bar-track { background: var(--track); border-radius: 0 4px 4px 0; height: 12px; position: relative; }
.bar-track .bar { position: absolute; inset: 0 auto 0 0; }
.bar i { display: block; height: 100%; min-width: 2px; }
.bar i:last-child { border-radius: 0 4px 4px 0; }
.bar i.s1 { background: var(--bar1); }
.bar i.s2 { background: var(--bar2); }
.bar i.s3 { background: var(--bar3); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin: 2px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.s1 { background: var(--bar1); } .legend i.s2 { background: var(--bar2); } .legend i.s3 { background: var(--bar3); }
.legend i.own { background: var(--own); border-radius: 50%; width: 8px; height: 8px; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 18px; }
.ctl { display: flex; align-items: center; gap: 8px; }
.ctl > label, .ctl > .lbl { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; flex-wrap: wrap; }
.seg a, .seg button { padding: 4px 11px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.seg .n { display: inline-block; min-width: 3ch; text-align: left; font-variant-numeric: tabular-nums; }
.seg a:hover, .seg button:hover { color: var(--text); text-decoration: none; }
.seg a.on, .seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 550; }
.seg a.off { opacity: .4; pointer-events: none; }
.filter { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; min-width: 220px; }
.filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
select.filter { min-width: 0; padding-right: 8px; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; }

/* ---------- tables ---------- */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
th { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted::after { content: " ↓"; }
th.sorted.asc::after { content: " ↑"; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--surface-2); }
td.cell-done { min-width: 200px; }
table.fixed { table-layout: fixed; min-width: 560px; }
td .read { font-size: 13px; white-space: nowrap; }
td.missing { color: var(--text-3); font-size: 13px; }

/* ---------- model / item cards ---------- */
.mcard { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: border-color .12s, box-shadow .12s; }
.mcard:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.mcard .nm { font-weight: 650; font-size: 16px; }
.mcard .vd { font-size: 13px; color: var(--text-3); }
.mcard .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.mcard .stats div { font-size: 12px; color: var(--text-3); line-height: 1.3; }
.mcard .stats b { display: block; font-size: 16px; color: var(--text); font-weight: 600; }

/* ---------- scenarios ---------- */
.scard { display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.scard:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.scard .sid { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-weight: 600; }
.scard h3 { font-size: 16px; }
.scard p { color: var(--text-2); font-size: 14px; }
.scard .prog { margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--text-3); }
.situation { font-size: 16px; line-height: 1.6; border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; color: var(--text); max-width: 860px; }

/* progress matrix */
.mx { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mx th, .mx td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.mx th { position: static; background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: 12px; white-space: normal; vertical-align: bottom; min-width: 70px; }
.mx td.c { text-align: center; }
.sq { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; }
.sq.done { background: var(--bar2); }
a.sq.done:hover { background: var(--bar1); }
.sq.missing { border: 1.5px solid var(--missing); }
.sq.failed { background: #dc3c3d; }
.sq.running, .sq.unreviewed { background: var(--bar3); }

/* ---------- answer page ---------- */
.ans-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.ans-side { position: sticky; top: 76px; }
.ans-side .card { padding: 14px 14px; }
.ans-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }
.peer { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 7px; font-size: 13.5px; color: var(--text); }
.peer:hover { background: var(--surface-2); text-decoration: none; }
.peer.on { background: var(--accent-wash); font-weight: 600; }
.peer .first { color: var(--text-3); font-size: 12px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.ans-sum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.prob { display: flex; align-items: center; gap: 8px; }
.prob .meter { width: 90px; margin: 0; }
.prob .meter i { background: var(--push); }
.ev { margin: 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--line-2); color: var(--text-2); font-size: 13.5px; }
.role { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.role.primary { color: var(--text); }
.role.rejected { color: #c13b3c; }
:root[data-theme="dark"] .role.rejected { color: #eb6263; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .role.rejected { color: #eb6263; } }

.md { font-size: 15.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.4em 0 .5em; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 16.5px; } .md h4 { font-size: 15px; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 .9em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: .25em; }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--line-2); padding-left: 14px; color: var(--text-2); }
.md table { display: block; overflow-x: auto; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
.md th { position: static; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.md.plain { white-space: pre-wrap; }

details.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.box > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: center; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--text-3); font-size: 18px; line-height: 1; width: 10px; }
details.box[open] > summary::before { transform: rotate(90deg); }
details.box > summary .muted { font-weight: 400; }
details.box > .in { padding: 0 16px 16px; }
.prompt { white-space: pre-wrap; font-size: 14px; background: var(--surface-2); padding: 12px 14px; border-radius: 8px; color: var(--text); margin: 0; font-family: var(--sans); }

/* evidence groups on item page */
.evlist { display: flex; flex-direction: column; gap: 12px; }
.evrow { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.evrow:first-child { border-top: none; }
.evrow .who { font-size: 13.5px; line-height: 1.4; }
.evrow .who a { font-weight: 600; }
.evrow .who .muted { display: block; font-size: 12.5px; }
.seg-bar { display: flex; height: 26px; gap: 2px; border-radius: 6px; overflow: hidden; margin: 6px 0 10px; }
.seg-bar span { display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; min-width: 2px; }
.seg-bar .primary { background: var(--bar1); }
.seg-bar .recommended { background: var(--bar2); }
.seg-bar .conditional { background: #00a888; }
.seg-bar .mentioned { background: #9b9b9b; }
.seg-bar .rejected { background: #dc3c3d; }
:root[data-theme="dark"] .seg-bar .primary { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-bar .primary { color: #0b0b0b; } }
.legend i.primary { background: var(--bar1); } .legend i.recommended { background: var(--bar2); }
.legend i.conditional { background: #00a888; } .legend i.mentioned { background: #9b9b9b; } .legend i.rejected { background: #dc3c3d; }

/* configuration params */
.params td:first-child { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.state { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }
.state.explicit { background: var(--accent-wash); color: var(--text); }

/* tooltip */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px;
  background: var(--text); color: var(--bg); font-size: 12.5px; line-height: 1.45;
  padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow);
}
.tip b { font-weight: 650; }

.empty-state { padding: 36px 20px; text-align: center; color: var(--text-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.note { font-size: 13.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 10px 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 13.5px; color: var(--text); }
.btn:hover { border-color: var(--line-2); text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid2, .ans-layout { grid-template-columns: minmax(0, 1fr); }
  .ans-side { position: static; }
  .top-in { flex-wrap: wrap; gap: 10px 14px; }
  .search { order: 5; width: 100%; margin-left: 0; }
  .theme { margin-left: auto; }
}
@media (max-width: 640px) {
  main { padding: 20px 16px 48px; }
  .top-in { padding: 10px 16px; }
  .foot-in { padding: 18px 16px 28px; }
  .nav { order: 4; width: 100%; overflow-x: auto; }
  .brand span { font-size: 15px; }
  h1 { font-size: 24px; }
  .hero { padding-top: 18px; }
  .hero h1 { font-size: 30px; }
  .hero h1 br { display: none; }
  .hero p { font-size: 16px; }
  .layer { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px 18px; }
  .layer-win { font-size: 24px; }
  .stack-ctl .seg { width: 100%; }
  .f-num { font-size: 32px; }
  .rl { grid-template-columns: 22px minmax(0, 1fr) minmax(70px, 1fr) 40px; column-gap: 10px; }
  .rl .rl-first { display: none; }
  .evrow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ans-sum { grid-template-columns: minmax(0, 1fr); }
  .filter { min-width: 0; width: 100%; }
  .ctl { flex-wrap: wrap; }
  .search-panel { min-width: 0; }
  th, td { padding: 8px 10px; }
}

/* family-level items: a vendor's model line, not a specific model */
a.fam, span.fam, .rl-name a.fam, .stack-table td a.fam { color: var(--text-3); font-style: italic; font-weight: 500; }

/* ---------- brand icons ---------- */
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ic-mono i { display: block; width: 100%; height: 100%; background: var(--text);
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.ic-gram { border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 8.5px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-style: normal; }
.ic-glyph svg { width: 100%; height: 100%; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-m { width: 24px; height: 24px; margin-right: 10px; }
.ic-m.ic-gram { font-size: 10.5px; border-radius: 6px; }
.ic-l { width: 40px; height: 40px; margin-right: 14px; vertical-align: middle; }
.ic-l.ic-gram { font-size: 15px; border-radius: 9px; }
.fam .ic { opacity: .55; }
.h-ic { display: flex; align-items: center; }
.h-ic .ic-l { margin-right: 14px; }
.who { display: flex; align-items: center; color: inherit; }
.who > span { display: flex; flex-direction: column; line-height: 1.3; }
.who:hover { text-decoration: none; }
.mcard .nm, .mcard .vd { display: block; }
.layer-win { display: flex; align-items: center; }
.layer-win .ic-l { width: 34px; height: 34px; }
.layer-next .ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.layer-next .ic-gram { font-size: 7px; }
.search-panel a .t { display: inline-flex; align-items: center; }
.peer .ic, .peer .first .ic { width: 14px; height: 14px; margin-right: 6px; }
.rl-name a.ent { display: inline; }
@media (max-width: 640px) { .ic-l { width: 32px; height: 32px; margin-right: 10px; } .ic-l.ic-gram { font-size: 12px; } }
.ic-themed .on-dark { display: none; }
:root[data-theme="dark"] .ic-themed .on-light { display: none; }
:root[data-theme="dark"] .ic-themed .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-themed .on-light { display: none; }
  :root:not([data-theme="light"]) .ic-themed .on-dark { display: block; }
}

/* rankings: picks grouped by company */
.vb { display: flex; flex-direction: column; gap: 12px; }
.vb-row { display: flex; flex-direction: column; gap: 5px; }
.vb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.vb-name { font-weight: 550; min-width: 0; }
.vb-name a { color: var(--text); }
.vb-num { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vb-num b { color: var(--text); font-weight: 600; }
.vb-indep { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.vb-note { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }

/* home: situation picker as separate pills (8 situations wrap cleanly) */
.stack-ctl { flex-direction: column; align-items: flex-start; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.chips a:hover { color: var(--text); border-color: var(--line-2); text-decoration: none; }
.chips a.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 550; }
@media (max-width: 640px) { .chips a { font-size: 13px; padding: 4px 10px; } .stack-ctl .seg { width: auto; } }

/* scenario page: one card per question type, two per row (2x2 for the four questions) */
.grid-cards.grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-cards.grid-2x2 { grid-template-columns: minmax(0, 1fr); } }

/* rankings: question tabs first, then filters */
.qtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.qtab { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); position: relative; transition: border-color .12s, box-shadow .12s; }
.qtab:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.qtab.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.qtab.on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.qtab-l { font-size: 15.5px; font-weight: 650; }
.qtab-r { font-size: 12.5px; color: var(--text-3); }
.qtab-top { margin-top: 8px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qtab-top .ic { margin-right: 6px; }
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.filters .ctl { align-items: flex-start; }
.filters .ctl > .lbl { min-width: 74px; padding-top: 6px; }
.filters-note { font-size: 12.5px; color: var(--text-3); }
.seg span.dis { padding: 4px 11px; border-radius: 7px; color: var(--text-3); font-size: 13.5px; opacity: .45; cursor: not-allowed; white-space: nowrap; }
@media (max-width: 760px) {
  .qtabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .ctl { flex-direction: column; gap: 6px; }
  .filters .ctl > .lbl { padding-top: 0; }
}

/* scenario page: every answer as its three picks */
.mx2 { font-size: 14px; }
.mx2 th { position: static; }
.mx2 td { vertical-align: middle; padding: 8px 14px; white-space: nowrap; }
.mx2 .mx2-m { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.mx2 tbody tr:hover .mx2-m { background: var(--surface-2); }
.picks3 { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; position: relative; }
.picks3:hover { background: var(--surface-3); text-decoration: none; }
.pk { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; opacity: .8; }
.pk.first { opacity: 1; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.pk .ic { margin: 0; width: 18px; height: 18px; vertical-align: 0; }
.pk.first .ic { width: 20px; height: 20px; }
.pk .ic-gram { font-size: 8.5px; }
.pk.own { box-shadow: inset 0 0 0 2px var(--own); opacity: 1; }
.pb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--push); margin-left: 2px; flex: none; }
@media (max-width: 640px) { .mx2 td { padding: 8px 10px; } .mx2 .mx2-m .ic { display: none; } }
.mx2 th:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface-2); }
.mx2 th:first-child, .mx2 .mx2-m { box-shadow: inset -1px 0 0 var(--line); }

/* official links */
.ext-ic { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ext-btn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ext-btn:hover { text-decoration: none; filter: brightness(1.08); }
.ext-btn .ext-dom { font-weight: 400; opacity: .8; }
.ext-mini { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 5px; color: var(--text-3); vertical-align: -4px; }
.ext-mini:hover { color: var(--accent); background: var(--accent-wash); }

/* about page */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.steps li { counter-increment: step; }
.steps h3::before { content: counter(step) ". "; color: var(--text-3); }
.about-layer { font-weight: 650; }
.about-prompt { white-space: pre-wrap; max-width: 760px; }
.section > .tiles + details.box { margin-top: 14px; }
.about-dl { margin: 0; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 20px; }
.about-dl dt { font-weight: 600; }
.about-dl dd { margin: 0; color: var(--text-2); }
.about-list { margin: 0; padding-left: 38px; color: var(--text-2); }
.about-list li + li { margin-top: 10px; }
.about-list b { color: var(--text); }
.repo-k { font-weight: 600; }
.repo b { overflow-wrap: anywhere; }
.pipe-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pipe-b { padding: 11px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pipe-b b { display: block; font-weight: 650; }
.pipe-b span { display: block; color: var(--text-2); font-size: 13.5px; }
.pipe-b.ai { background: var(--accent-wash); border-color: var(--accent); }
.pipe-blind { padding: 12px 14px 14px; border: 1.5px dashed var(--accent); border-radius: 14px; }
.pipe-tag { margin-bottom: 8px; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.pipe-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pipe-note { margin: 8px 0 0; color: var(--text-2); font-size: 13px; text-align: center; }
.pipe-a { display: grid; justify-items: center; padding: 4px 0; }
.pipe-a.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pipe-a i { position: relative; width: 1.5px; height: 16px; background: var(--text-3); }
.pipe-a i::after { content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); border: 4px solid transparent; border-top: 6px solid var(--text-3); border-bottom: 0; }
.pipe-side { color: var(--text-2); font-size: 14px; }
.pipe-side h3 { color: var(--text); }
.pipe-side ul { margin: 0 0 20px; padding-left: 18px; }
.pipe-side li + li { margin-top: 7px; }
@media (max-width: 900px) { .pipe-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .pipe-pair, .pipe-a.two { grid-template-columns: minmax(0, 1fr); }
  .pipe-a.two i + i { display: none; }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .about-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .about-dl dd + dt { margin-top: 12px; }
}
