/* Crosscheck. Dark only. Palette and type from the global constraints (spec 6.1). */
:root {
  --bg: #0c0c0c;
  --well: #171717;
  --text: #ece6d8;
  --muted: #a8a396;
  --dim: #3d3c39;
  --gold: #f0cd7a;
  --teal: #35b5c0;
  --pink: #f2476f;
  --ink: #0e0e0e;
  --shadow: 5px 5px 0 #0e0e0e;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --line: 1px solid var(--dim);
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--ink); padding: 8px 12px; font: 500 12px var(--mono);
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }

/* mono label style, shared */
.label, .field-label, .stat-label, .th, .tab, .how-title, .group-title, .detail-h, .mobile-label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 500;
}

/* ---------- header ---------- */
.site-header { border-bottom: var(--line); }
.header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px 56px;
  align-items: end;
  padding-top: 40px;
  padding-bottom: 28px;
}
.wordmark {
  font: 700 30px/1 var(--mono);
  letter-spacing: 0.16em;
  text-decoration: none;
  color: var(--text);
}
.wordmark:hover { color: var(--gold); }
.subtitle { margin: 10px 0 0; font: 400 12px/1.4 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.subtitle .x { color: var(--gold); }
.header-side { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.lede { margin: 0; color: var(--muted); max-width: 46ch; }
.updated { margin: 0; font: 400 12px/1.4 var(--mono); color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.updated .dot { width: 7px; height: 7px; background: var(--dim); display: inline-block; }
.updated.fresh .dot { background: var(--teal); }

.tabs { display: flex; gap: 0; }
.tab {
  display: inline-flex; align-items: center; height: 42px; padding: 0 18px;
  text-decoration: none; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:first-child { padding-left: 0; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.5fr;
  border-bottom: var(--line);
  margin-top: 0;
}
.stat { padding: 22px 20px 20px 0; border-right: var(--line); min-width: 0; }
.stat + .stat { padding-left: 20px; }
.stat:last-child { border-right: 0; }
.stat-label { color: var(--muted); display: block; }
.stat-value { display: block; font: 500 34px/1.1 var(--mono); margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-sub { display: block; font: 400 12px/1.4 var(--mono); color: var(--muted); margin-top: 6px; }
.stat-first { background: var(--well); padding-left: 20px; box-shadow: inset 3px 0 0 var(--gold); }
.stat-first .stat-label, .stat-first .stat-value { color: var(--gold); }
.stat-first .stat-sub { color: var(--text); }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 16px 20px;
  padding: 22px 0 18px;
}
.seg { display: inline-flex; border: var(--line); }
.seg-btn {
  height: 38px; padding: 0 16px; border: 0; border-right: var(--line);
  background: transparent; color: var(--muted);
  font: 500 13px var(--sans); cursor: pointer;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--text); background: var(--well); }
.seg-btn[aria-pressed="true"] { background: var(--text); color: var(--ink); }
.seg-btn[aria-pressed="true"]:hover { background: var(--gold); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { color: var(--muted); font-size: 10px; }
.field select, .field input {
  height: 38px; background: var(--bg); color: var(--text); border: var(--line);
  font: 400 14px var(--sans); padding: 0 12px;
}
.field select { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: right 16px top 17px, right 11px top 17px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:hover, .field input:hover { border-color: var(--muted); }
.field-search { flex: 1 1 240px; }
.field input::placeholder { color: var(--muted); opacity: 0.6; }
.result-count { margin: 0 0 10px; font: 400 12px var(--mono); color: var(--muted); min-height: 1.4em; }

/* ---------- table ---------- */
.table { border-top: var(--line); }
.tr {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: var(--line);
}
.table.only-polymarket .tr, .table.only-kalshi .tr { grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr); }
.table.only-polymarket .col-kalshi, .table.only-kalshi .col-polymarket { display: none; }
.thead { position: sticky; top: 0; background: var(--bg); z-index: 2; }
.th { color: var(--muted); padding: 10px 16px 9px 0; }
.th + .th { padding-left: 16px; }
.td { padding: 18px 16px 18px 0; min-width: 0; }
.td + .td { padding-left: 16px; border-left: 1px solid var(--well); }
.tr > :first-child { padding-left: 12px; }
.row.has-first > .td:first-child { padding-left: 15px; }

.row { cursor: pointer; position: relative; }
.row:hover, .row.open { background: var(--well); }
.row.has-first { box-shadow: inset 3px 0 0 var(--gold); }

.claim { font-weight: 500; font-size: 16px; line-height: 1.45; text-decoration: none; color: var(--text); }
.claim:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.claim .ext { color: var(--muted); font-size: 12px; margin-left: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.meta .k, .tr-facts .k { color: var(--muted); opacity: 0.7; margin-right: 6px; font-size: 11px; letter-spacing: 0.08em; }
.thread { color: var(--muted); }
.expand-hint {
  display: inline-block; margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 11px var(--mono); color: var(--muted); letter-spacing: 0.06em;
}
.row:hover .expand-hint, .row.open .expand-hint { color: var(--text); }
.row .expand-hint:hover { color: var(--gold); }

.no-match { color: var(--dim); font: 400 13px var(--mono); }
.mobile-label { display: none; color: var(--muted); margin-bottom: 8px; }

/* groups and matches */
.group + .group { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--dim); }
.group-title { color: var(--muted); margin-bottom: 8px; text-transform: none; letter-spacing: 0.02em; font-size: 12px; }
.match + .match { margin-top: 12px; }
.match-title { font-size: 14px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.match-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 7px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.match-line .eq strong { color: var(--text); font-weight: 500; }
.match-sentence { margin-top: 4px; font: 400 12px/1.45 var(--sans); color: var(--muted); }
.open-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--dim); white-space: nowrap; }
.open-link:hover { color: var(--gold); border-bottom-color: var(--gold); }
.reasons { margin-top: 6px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.reasons::before { content: '— '; color: var(--dim); }

/* tags and badges */
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.06em; white-space: nowrap;
  border: 1px solid transparent;
}
.tier-high { background: var(--teal); color: var(--ink); border-color: var(--teal); }
.tier-medium { border-color: var(--text); color: var(--text); }
.tier-low { border-color: var(--dim); color: var(--muted); }
.badge-inverse { border-color: var(--pink); color: var(--pink); }
.badge-partial { border: 1px dashed var(--muted); color: var(--text); cursor: help; white-space: normal; height: auto; min-height: 22px; padding: 3px 8px; line-height: 1.3; }
.badge-related { color: var(--muted); border: 1px dashed var(--dim); }
.badge-first {
  background: var(--gold); color: var(--ink); border-color: var(--gold);
  font-weight: 700; box-shadow: 3px 3px 0 var(--ink);
}
.badge-mismatch { background: var(--pink); color: var(--ink); border-color: var(--pink); font-weight: 700; }
.badge-outcome { border-color: var(--text); color: var(--text); font-weight: 700; }
.badge-outcome.yes { border-color: var(--teal); color: var(--teal); }
.badge-outcome.no { border-color: var(--pink); color: var(--pink); }

/* track record specifics */
.tr-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.tr-facts strong { color: var(--text); font-weight: 500; }
.spread { color: var(--text); font-weight: 500; }
.spread.pos { color: var(--teal); }
.spread.neg { color: var(--pink); }

/* ---------- detail ---------- */
.detail { background: var(--well); border-top: 1px solid var(--bg); padding: 4px 0 24px; cursor: default; }
.row.has-first + .detail { box-shadow: inset 3px 0 0 var(--gold); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 0; }
.detail-col { padding: 16px 20px 0 16px; min-width: 0; }
.detail-col + .detail-col { border-left: var(--line); }
.detail-h { color: var(--gold); margin: 0 0 10px; }
.detail-sub { color: var(--muted); font: 400 12px/1.5 var(--mono); margin: 10px 0 0; }
.rule {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; color: var(--text);
  max-height: 260px; overflow: auto; padding-right: 6px;
}
.dmatch + .dmatch { margin-top: 22px; padding-top: 18px; border-top: var(--line); }
.dmatch-title { font-weight: 500; font-size: 14px; margin: 0 0 4px; overflow-wrap: anywhere; }
.dmatch-plat { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
/* hairlines drawn on the cells (not gap + background), so empty auto-fill tracks stay empty */
.scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0; background: transparent; margin: 12px 1px 13px 0; }
.score { background: var(--bg); padding: 8px 10px; border: var(--line); margin: 0 -1px -1px 0; }
.score .k { display: block; font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.score .v { display: block; font: 500 16px/1.3 var(--mono); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; font: 400 12px/1.6 var(--mono); color: var(--muted); margin: 0 0 12px; }
.kv dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ---------- states ---------- */
.empty { padding: 56px 0; text-align: left; color: var(--muted); font: 400 14px var(--mono); border-bottom: var(--line); }
.empty strong { display: block; color: var(--text); font: 500 15px var(--sans); margin-bottom: 6px; }
.error { color: var(--pink); }

/* ---------- how ---------- */
.how {
  margin: 40px 0 0; padding: 22px 24px; max-width: 760px;
  background: var(--well); border: var(--line); box-shadow: var(--shadow);
}
.how-title { margin: 0 0 8px; color: var(--gold); font-size: 11px; }
.how p { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { margin-top: 64px; border-top: var(--line); padding: 28px 0 48px; }
.site-footer p { margin: 0; font: 400 12px/1.7 var(--mono); color: var(--muted); max-width: 90ch; }
.site-footer .note { margin-top: 6px; }

/* ---------- mobile ---------- */
@media (max-width: 759px) {
  .wrap { padding: 0 16px; }
  .header-grid { grid-template-columns: 1fr; padding-top: 28px; gap: 16px; }
  .wordmark { font-size: 24px; }
  .header-side { flex-direction: column; align-items: start; gap: 10px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat, .stat + .stat { padding: 16px 12px; border-right: 0; border-bottom: var(--line); }
  .stat:nth-child(odd):not(.stat-first) { border-right: var(--line); padding-left: 0; }
  .stat-first { grid-column: 1 / -1; padding-left: 14px; border-bottom: 0; }
  .stat-value { font-size: 28px; }
  .filters { gap: 12px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; padding: 0 8px; }
  .field { flex: 1 1 140px; }
  .field-search { flex-basis: 100%; }
  .thead { display: none; }
  .tr, .table.only-polymarket .tr, .table.only-kalshi .tr { grid-template-columns: 1fr; }
  .td, .td + .td, .tr > :first-child { padding: 14px 12px; border-left: 0; }
  .td + .td { border-top: 1px dashed var(--dim); }
  .row.has-first > .td, .row.has-first > .td:first-child { padding-left: 15px; }
  .row:hover, .row.open { background: transparent; }
  .row.open { background: var(--well); }
  .row { padding: 0; }
  .mobile-label { display: block; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-col { padding: 16px 14px 0; }
  .detail-col + .detail-col { border-left: 0; border-top: var(--line); margin-top: 16px; }
}

.legend { margin: 0 0 12px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.legend summary { cursor: pointer; color: var(--text); }
.legend dl { margin: 8px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.legend dt { color: var(--gold); }
.legend dd { margin: 0; }
@media (max-width: 640px) { .legend dl { grid-template-columns: 1fr; gap: 0; } .legend dd { margin-bottom: 6px; } }
