:root {
  --ink: #16130f;
  --bone: #f5f1e8;
  --paper: #faf7f0;
  --panel: #ece6d8;
  --line: #16130f;
  --hair: rgba(22, 19, 15, .16);
  --muted: #6a6255;
  --accent: #e5341d;
  --accent-ink: #b8210f;
  --green: #2f7d4f;
  --amber: #b5790f;
  --disp: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --ui: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1440px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }

/* visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
tr:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
table.grid tr:focus-visible { outline-offset: -3px; }

h1, h2, h3 { font-family: var(--disp); font-weight: 800; letter-spacing: -.02em; line-height: .98; margin: 0; }

.eyebrow {
  font: 600 12px/1 var(--ui); letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 20px;
}
.eyebrow.light { color: #fff; }

/* ---------- nameplate ---------- */
.nameplate {
  border-bottom: 3px solid var(--line);
  padding: 14px 40px 0;
  max-width: var(--maxw); margin: 0 auto;
}
.np-top {
  display: flex; justify-content: space-between;
  font: 500 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--hair);
}
.np-word {
  display: block; text-decoration: none;
  font-family: var(--disp); font-weight: 800;
  font-size: clamp(48px, 9vw, 120px); letter-spacing: -.03em; line-height: 1;
  padding: 10px 0 6px;
}
.np-nav {
  display: flex; gap: 0; border-top: 1px solid var(--hair);
}
.np-nav a {
  flex: 1; text-align: center; text-decoration: none;
  font: 600 12px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase;
  padding: 14px 8px; color: var(--muted);
  border-right: 1px solid var(--hair);
}
.np-nav a:first-child { border-left: 1px solid var(--hair); }
.np-nav a:hover { color: var(--ink); background: var(--bone); }
.np-nav a.on { background: var(--ink); color: var(--paper); }

main.wrap { padding-top: 56px; padding-bottom: 40px; }

/* ---------- home ---------- */
.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px;
  align-items: end; margin-bottom: 64px;
  padding-bottom: 44px; border-bottom: 3px solid var(--line);
}
.hero h1 { font-size: clamp(44px, 7vw, 104px); }
.hero-aside { padding-bottom: 6px; }
.deck {
  font: 400 clamp(17px, 1.5vw, 21px)/1.45 var(--ui);
  color: var(--muted); margin: 0 0 26px;
}
.jump { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.jump a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 2px; text-decoration: none; border-bottom: 1px solid var(--hair);
}
.jump a:hover { color: var(--accent-ink); }
.jump span {
  font: 600 13px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase;
}
.jump em { font-family: var(--mono); font-style: normal; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; align-items: start; }
}

.index-list { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--line); }
.index-list li { border-bottom: 1px solid var(--hair); }
.index-list a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: start;
  padding: 34px 8px; text-decoration: none;
  transition: background .12s, padding .12s;
}
.index-list a:hover { background: var(--ink); color: var(--paper); padding-left: 20px; }
.index-list a:hover .ix-blurb,
.index-list a:hover .ix-stats span { color: rgba(250,247,240,.72); }
.index-list a:hover .ix-num { color: var(--accent); }
.ix-num { font-family: var(--mono); font-size: 15px; padding-top: 14px; color: var(--accent-ink); }
.ix-title { font-family: var(--disp); font-weight: 800; font-size: clamp(30px, 4.5vw, 52px); display: block; }
.ix-blurb { display: block; color: var(--muted); max-width: 52ch; margin-top: 10px; font-size: 15px; }
.ix-stats { display: flex; gap: 30px; margin-top: 18px; flex-wrap: wrap; }
.ix-stats span { font: 500 12px/1.3 var(--ui); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.ix-stats b { font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.index-list a:hover .ix-stats b { color: var(--paper); }
.ix-go { font-size: 28px; align-self: center; }

.slab {
  margin: 80px -40px 0; background: var(--accent); color: var(--paper);
  padding: 56px 40px;
}
.slab p:last-child { font: 400 clamp(20px, 3vw, 30px)/1.32 var(--disp); font-weight: 600; max-width: 900px; margin: 0; }

/* ---------- register head ---------- */
.reg-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px;
  padding-bottom: 24px; border-bottom: 3px solid var(--line); margin-bottom: 0;
}
.reg-head h1 { font-size: clamp(40px, 6vw, 72px); }
.kpis { display: flex; gap: 40px; margin: 0; }
.kpis div { display: flex; flex-direction: column; text-align: right; }
.kpis dd { font-family: var(--mono); font-size: clamp(20px, 2.6vw, 30px); margin: 0; }
.kpis dt { font: 500 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- register layout ---------- */
.reg { display: grid; grid-template-columns: 248px 1fr; }
.rail {
  border-right: 1px solid var(--hair); padding: 28px 28px 40px 0;
  position: sticky; top: 20px; align-self: start;
}
.rail-search { display: flex; border: 2px solid var(--line); margin-bottom: 28px; }
.rail-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px;
  font: 400 14px var(--ui); color: var(--ink);
}
.rail-search input:focus { outline: 0; background: #fff; }
.rail-search button {
  border: 0; border-left: 2px solid var(--line); background: var(--ink); color: var(--paper);
  width: 40px; font-size: 16px; cursor: pointer;
}
.rail-search button:hover { background: var(--accent); }

.rail-group { margin-bottom: 32px; }
.rail-group:last-child { margin-bottom: 0; }
.rail-label { font: 600 11px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.facets { list-style: none; margin: 0; padding: 0; }
.facets a {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 8px 0; text-decoration: none; border-bottom: 1px solid var(--hair);
  font-size: 14px; color: var(--muted);
}
.facets a:hover { color: var(--ink); }
.facets a.on { color: var(--ink); font-weight: 600; }
.facets a.on span { box-shadow: inset 0 -.5em 0 rgba(229,52,29,.22); }
.facets em { font-family: var(--mono); font-style: normal; font-size: 12px; }
.facets.flags a span { display: inline-flex; align-items: center; gap: 8px; }

/* green/yellow/red match indicator */
.flagdot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--hair); flex: none;
}
.flag-green { background: var(--green); }
.flag-yellow { background: var(--amber); }
.flag-red { background: var(--accent); }
.tag .flagdot { margin-right: 2px; }
.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;
}

.results { padding: 28px 0 0 32px; min-width: 0; overflow: hidden; }
.results-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--hair); margin-bottom: 2px;
}
.results-bar p { margin: 0; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.results-bar b { color: var(--ink); }
.csv-link {
  font: 600 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); text-decoration: none; white-space: nowrap;
}
.csv-link:hover { text-decoration: underline; }

.contact-link { color: var(--accent-ink); text-decoration: none; }
.contact-link:hover { text-decoration: underline; }
table.grid tbody tr:hover .contact-link { color: var(--paper); text-decoration: underline; }

.badge-new {
  display: inline-block; padding: 2px 7px;
  background: var(--accent); color: #fff; font: 700 10px/1.6 var(--ui);
  letter-spacing: .08em; text-transform: uppercase;
}
/* Absolutely positioned (not display:flex) - a flexed <td> drops out of
   the table's own column-width algorithm under table-layout:fixed and
   collapses to near-nothing. This keeps the cell a normal table-cell so
   the 30% column width still applies, reserves room on the right so the
   ellipsis-truncated name doesn't run under the badge, and the badge
   stays inside the cell's own clipped box so it's never cut off. */
table.grid td.titlecell { position: relative; padding-right: 52px; }
table.grid td.titlecell .badge-new {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
}
.active { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag {
  display: inline-flex; gap: 8px; align-items: center; background: var(--ink); color: var(--paper);
  font-size: 12px; padding: 4px 6px 4px 10px;
}
.tag a { text-decoration: none; opacity: .7; font-weight: 700; }
.tag a:hover { opacity: 1; color: var(--accent); }
.clear-all { font-size: 12px; color: var(--accent-ink); text-decoration: underline; }

/* ---------- table ---------- */
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.grid th:first-child, table.grid td:first-child { width: 30%; }
table.grid th.num, table.grid td.num { width: 15%; }
table.grid th.flagcol, table.grid td.flagcol { width: 70px; text-align: center; }
table.grid th {
  text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--line);
  font: 600 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
table.grid th a { text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
table.grid th a:hover { color: var(--ink); }
table.grid th i { font-style: normal; font-size: 10px; color: var(--hair); }
table.grid th.sorted { color: var(--ink); }
table.grid th.sorted i { color: var(--accent); }
table.grid th.num, table.grid td.num { text-align: right; font-family: var(--mono); }
table.grid td {
  padding: 15px 14px; border-bottom: 1px solid var(--hair); vertical-align: top;
  font-size: 14.5px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
table.grid tbody { }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--ink); }
table.grid tbody tr:hover td { color: var(--paper); border-color: var(--ink); }
table.grid tbody tr:hover td:first-child { box-shadow: inset 4px 0 0 var(--accent); }

.pager { display: flex; align-items: center; gap: 18px; margin-top: 28px; font: 600 12px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; }
.pager a { text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
.pager a:hover { color: var(--accent); }
.pager .off { color: var(--hair); }
.pager .pos { font-family: var(--mono); letter-spacing: 0; color: var(--muted); }
.empty { padding: 56px 0; }
.empty p { margin: 0 0 20px; font: 600 clamp(20px, 3vw, 28px)/1.3 var(--disp); max-width: 30ch; }
.btn {
  display: inline-block; background: var(--ink); color: var(--paper);
  text-decoration: none; padding: 12px 20px;
  font: 600 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase;
}
.btn:hover { background: var(--accent); }

/* ---------- detail ---------- */
.crumb { margin: 0 0 26px; font: 600 12px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; }
.crumb a { text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
.record { max-width: 860px; }
.record h1 { font-size: clamp(34px, 5.5vw, 60px); margin-bottom: 8px; }
.record dl { margin: 40px 0 0; border-top: 3px solid var(--line); }
.record dl > div {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  padding: 18px 0; border-bottom: 1px solid var(--hair);
}
.record dt { font: 600 11px/1.5 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.record dd { margin: 0; font-size: 15.5px; line-height: 1.6; }
.record dd a { color: var(--accent-ink); word-break: break-all; }

/* ---------- news ---------- */
.page-blurb { color: var(--muted); max-width: 70ch; margin: 18px 0 40px; font-size: 15.5px; }
.newslist { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--line); max-width: 860px; }
.newslist li { border-bottom: 1px solid var(--hair); }
.newslist a { display: block; text-decoration: none; padding: 20px 4px; }
.newslist a:hover { background: var(--panel); }
.news-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.news-source { font: 600 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.news-date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.news-title { display: block; font-family: var(--disp); font-weight: 700; font-size: 19px; line-height: 1.28; }
.news-summary { display: block; color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 68ch; }

/* ---------- footer ---------- */
.foot { margin-top: 90px; border-top: 3px solid var(--line); background: var(--ink); color: var(--paper); }
.foot .wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: start; padding-top: 44px; padding-bottom: 56px; }
.fword { font-family: var(--disp); font-weight: 800; font-size: 30px; letter-spacing: -.02em; }
.foot p { margin: 0; color: rgba(250,247,240,.66); font-size: 14px; max-width: 46ch; }
.foot .freshness { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: rgba(250,247,240,.45); }
.foot nav { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.foot nav a { text-decoration: none; font: 600 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: rgba(250,247,240,.8); }
.foot nav a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .wrap, .nameplate { padding-left: 20px; padding-right: 20px; }
  .reg-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .kpis { gap: 28px; flex-wrap: wrap; }
  .kpis div { text-align: left; }
  .reg { grid-template-columns: 1fr; }
  .rail { position: static; border-right: 0; border-bottom: 1px solid var(--hair); padding: 20px 0 24px; }
  .results { padding-left: 0; }
  .index-list a { grid-template-columns: auto 1fr; }
  .index-list a:hover { padding-left: 8px; }
  .ix-go { display: none; }
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr { padding: 12px 0; border-bottom: 2px solid var(--line); }
  table.grid tbody tr:hover { background: transparent; }
  table.grid tbody tr:hover td { color: inherit; }
  table.grid td {
    max-width: none; white-space: normal; overflow: visible;
    text-overflow: clip; border: 0; padding: 3px 0;
  }
  table.grid td.num { text-align: left; }
  table.grid td.flagcol { text-align: left; }
  table.grid td.titlecell { padding-right: 3px; }
  table.grid td.titlecell .badge-new {
    position: static; transform: none; display: inline-block;
    margin-left: 8px; vertical-align: 2px;
  }
  table.grid td::before {
    content: attr(data-label); display: block;
    font: 600 10px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
  }
  .foot .wrap { grid-template-columns: 1fr; gap: 24px; }
  .foot nav { text-align: left; flex-flow: row wrap; gap: 18px; }
}
