:root {
  --ink: #090909;
  --muted: #616161;
  --line: #d9d9d4;
  --soft: #f4f4f0;
  --paper: #fbfbf8;
  --alert: #7a2f18;
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.42 Arial, Helvetica, sans-serif; }
a { color: inherit; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }

.site-header {
  min-height: 64px;
  padding: 10px clamp(18px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, .96);
}
.brand {
  display: grid;
  grid-template-columns: 32px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .15em;
  font-size: 12px;
}
.brand img { grid-row: 1 / 3; width: 25px; height: 34px; object-fit: contain; }
.brand span { align-self: end; }
.brand b { align-self: start; font-size: 9px; letter-spacing: .22em; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.preview-flag { color: var(--muted); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.language { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.language button { min-width: 34px; padding: 4px 8px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.language button.active { color: white; background: var(--ink); }

main { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }
.hero { max-width: 780px; padding: clamp(44px, 6vw, 72px) 0 42px; }
.eyebrow { margin: 0 0 13px; color: var(--muted); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { max-width: 780px; margin: 0; font-size: clamp(34px, 4.8vw, 58px); font-weight: 400; line-height: 1; letter-spacing: -.04em; }
h2 { margin: 0; font-size: clamp(22px, 2.5vw, 32px); font-weight: 400; line-height: 1.1; letter-spacing: -.02em; }
.lead { max-width: 680px; margin: 22px 0 0; font-size: clamp(16px, 1.55vw, 19px); line-height: 1.36; }
.scope-copy { max-width: 720px; margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.automation-copy { max-width: 720px; margin: 14px 0 0; padding-left: 12px; border-left: 2px solid var(--ink); font-size: 13px; }
.beta-copy { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.update-notice { max-width: 760px; margin: 14px 0 0; padding: 9px 11px; border: 1px solid var(--alert); color: var(--alert); font-size: 12px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-links a { padding: 8px 11px; border: 1px solid var(--ink); text-decoration: none; font-size: 12px; }

.batch-quality { padding: 42px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.quality-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.quality-heading h2 { max-width: 760px; }
.quality-state { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .07em; }
.quality-state strong { padding: 7px 9px; color: white; background: var(--ink); font-weight: 400; }
.quality-state span { color: var(--alert); }
.quality-copy { max-width: 820px; margin: 18px 0 22px; color: var(--muted); font-size: 13px; }
.quality-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.quality-grid p { display: flex; min-height: 86px; flex-direction: column; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quality-grid p:nth-child(4n) { border-right: 0; }
.quality-grid span { color: var(--muted); font-size: 11px; }
.quality-grid b { font: 20px/1 ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 400; }
.quality-meta { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; color: var(--muted); font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.quality-meta p { margin: 0; }
.confidence-method { max-width: 880px; margin-top: 24px; border-top: 1px solid var(--ink); }
.confidence-method summary { padding: 13px 0; cursor: pointer; font-size: 13px; font-weight: 600; }
.confidence-method > div { padding: 8px 0 20px; }
.confidence-method h3 { margin: 30px 0 10px; font-size: 21px; font-weight: 400; }
.confidence-method p { max-width: 850px; margin: 0 0 14px; color: var(--muted); }
.confidence-method pre { max-width: 100%; padding: 16px; overflow-x: auto; color: white; background: var(--ink); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.confidence-method code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--ink); }
.summary article { min-height: 108px; padding: 17px 14px; border-right: 1px solid var(--line); }
.summary article:last-child { border-right: 0; }
.summary span { display: block; font-size: clamp(30px, 4vw, 48px); line-height: 1; }
.summary p { max-width: 170px; margin: 14px 0 0; color: var(--muted); font-size: 12px; }

.victim-map { padding: 50px 0; border-bottom: 1px solid var(--ink); }
.map-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.map-heading h2 { max-width: 720px; }
.map-coverage { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--muted); font: 11px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.map-coverage strong { color: var(--ink); font-size: 14px; font-weight: 400; }
.map-scope { max-width: 800px; margin: 17px 0 0; font-size: 15px; }
.map-warning { max-width: 800px; margin: 11px 0 22px; padding-left: 12px; border-left: 2px solid var(--alert); color: var(--muted); font-size: 12px; }
.map-data-boundary { max-width: 800px; margin: -11px 0 20px; color: var(--muted); font-size: 11px; }
.map-frame { width: 100%; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
#world-map { display: block; width: 100%; height: auto; }
.map-country { fill: #d9d9d2; stroke: var(--paper); stroke-width: .8; vector-effect: non-scaling-stroke; }
.map-country.has-data { fill: var(--alert); stroke: var(--ink); stroke-width: .9; cursor: pointer; }
.map-country.has-data:hover, .map-country.has-data:focus { outline: none; stroke-width: 1.4; }
.heat-1 { fill-opacity: .35; }
.heat-2 { fill-opacity: .48; }
.heat-3 { fill-opacity: .61; }
.heat-4 { fill-opacity: .74; }
.heat-5 { fill-opacity: .9; }
.map-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 14px; }
.map-detail { min-height: 22px; margin: 0; font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.map-legend { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.map-legend i { width: 110px; height: 8px; background: linear-gradient(90deg, rgba(122,47,24,.25), rgba(122,47,24,.95)); }
.map-source { margin: 12px 0 0; color: var(--muted); font-size: 11px; }

.validation-progress { padding: 42px 0; border-bottom: 1px solid var(--ink); }
.validation-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.validation-heading h2 { max-width: 700px; }
.provisional-label { flex: 0 0 auto; padding: 7px 9px; border: 1px solid var(--alert); color: var(--alert); font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.validation-copy { max-width: 800px; margin: 17px 0; color: var(--muted); font-size: 13px; }
.validation-meter { height: 8px; overflow: hidden; background: var(--line); }
.validation-meter span { display: block; width: 0; height: 100%; background: var(--ink); }
.validation-numbers { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.validation-numbers p { display: flex; flex-direction: column; gap: 4px; margin: 0; padding-right: 18px; }
.validation-numbers b { font: 20px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 400; }
.validation-numbers span, .validation-as-of { color: var(--muted); font-size: 11px; }
.validation-as-of { margin: 18px 0 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.records { padding: 50px 0; border-bottom: 1px solid var(--ink); }
.records[hidden] { display: none; }
.records-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.records-heading strong { font: 22px/1 ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 400; }
.records-warning { max-width: 880px; margin: 17px 0 20px; padding: 11px; border: 1px solid var(--alert); display: grid; gap: 4px; font-size: 12px; }
.table-tools { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 150px auto; gap: 10px; align-items: end; }
.table-tools label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.table-tools input, .table-tools select { width: 100%; min-height: 34px; padding: 5px 7px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); font: inherit; }
.column-picker { position: relative; }
.column-picker summary { min-height: 34px; padding: 7px; border: 1px solid var(--line); cursor: pointer; font-size: 11px; }
#column-controls { position: absolute; z-index: 3; right: 0; width: min(320px, 90vw); padding: 12px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
#column-controls label { display: flex; min-height: 34px; align-items: center; gap: 8px; color: var(--ink); }
.sort-help { margin: 12px 0; color: var(--muted); font-size: 11px; }
.filter-panel { margin: 18px 0; padding: 14px; background: var(--soft); }
.filter-heading, .group-head, .filter-actions, .results-bar, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-heading h3 { margin: 0; font-size: 18px; }
.filter-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.quiet-button, .filter-button, .remove-button, .pagination button { min-height: 31px; padding: 5px 8px; border: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; font-size: 12px; }
.remove-button { border: 0; }
.filter-group { margin-top: 12px; padding: 12px; border-left: 2px solid var(--line); }
.filter-group .filter-group { margin-left: 14px; border-color: var(--ink); }
.group-head label { font-size: 12px; }
.group-head select, .condition select, .condition input { min-height: 32px; padding: 4px 6px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); font: inherit; font-size: 12px; }
.group-children { display: grid; gap: 8px; margin: 10px 0; }
.condition { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(130px,.65fr) minmax(180px,1fr) 34px; gap: 8px; }
.filter-actions { justify-content: flex-start; }
.results-bar { margin: 18px 0 10px; color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.results-bar p { margin: 0; }
.table-shell { width: min(940px, 100%); }
.table-shell table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table-shell th, .table-shell td { padding: 6px 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: break-word; font-size: 10px; line-height: 1.25; }
.table-shell th button { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; font: inherit; }
.table-shell th button:hover, .table-shell th button:focus { text-decoration: underline; text-underline-offset: 3px; }
.table-shell [data-field="domain"] { width: 20%; }
.table-shell td[data-field="domain"] { overflow-wrap: normal; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.table-shell [data-field="network_membership_status"] { width: 12%; }
.table-shell td[data-field="network_membership_status"] { white-space: nowrap; }
.table-shell [data-field="presumed_victim"] { width: 20%; overflow-wrap: anywhere; }
.table-shell [data-field="presumed_victim_domain"] { width: 18%; }
.table-shell td[data-field="presumed_victim_domain"] { overflow-wrap: normal; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.table-shell [data-field="presumed_victim_country"] { width: 8%; }
.table-shell [data-field="presumed_victim_state_or_province"] { width: 8%; }
.table-shell [data-field="presumed_victim_status"] { width: 14%; }
.table-shell td[data-field="presumed_victim_status"] { white-space: nowrap; }
.state-code { font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.empty { padding: 30px 0; color: var(--muted); }
.pagination { justify-content: center; margin-top: 20px; }
.pagination button:disabled { cursor: default; opacity: .35; }

.boundary { display: grid; grid-template-columns: minmax(220px, .7fr) 1fr; gap: 36px; padding: 50px 0; border-bottom: 1px solid var(--line); }
.boundary > p { max-width: 620px; margin: 18px 0 0; font-size: 15px; }
.method { padding: 62px 0; }
.method-copy { margin-top: 38px; }
.method-copy[hidden] { display: none; }
.method-intro { max-width: 800px; margin: 0 0 34px; font-size: clamp(16px, 1.7vw, 21px); line-height: 1.4; }
.history-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--ink); }
.history-grid article { padding: 20px 20px 24px 0; border-bottom: 1px solid var(--line); }
.history-grid article:nth-child(odd) { border-right: 1px solid var(--line); }
.history-grid article:nth-child(even) { padding-left: 26px; }
.history-grid b { color: var(--muted); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.history-grid h3 { margin: 17px 0 8px; font-size: 18px; }
.history-grid p { max-width: 500px; margin: 0; color: var(--muted); }
.method-heading { margin: 50px 0 17px; font-size: clamp(21px, 2.4vw, 29px); font-weight: 400; letter-spacing: -.02em; }
.ethics-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.ethics-grid article { padding: 18px 16px 22px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ethics-grid article:nth-child(3n) { padding-left: 20px; border-right: 0; }
.ethics-grid article:nth-child(3n+2) { padding-left: 20px; }
.ethics-grid h4 { margin: 0 0 6px; font-size: 14px; }
.ethics-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.limits { max-width: 840px; margin-top: 48px; padding: 20px; color: white; background: var(--ink); }
.limits h3 { margin: 0 0 11px; font-size: 18px; }
.limits p { margin: 0; color: #d9d9d4; font-size: 14px; }

footer { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; padding: 26px 0 34px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: .8fr 1fr auto; gap: 20px; color: var(--muted); font-size: 11px; }
footer p { margin: 0; }

@media (max-width: 820px) {
  .preview-flag { display: none; }
  .quality-grid, .summary { grid-template-columns: repeat(2, 1fr); }
  .quality-grid p:nth-child(odd), .summary article:nth-child(odd) { border-right: 1px solid var(--line); }
  .quality-grid p:nth-child(even), .summary article:nth-child(even) { border-right: 0; }
  .summary article { border-bottom: 1px solid var(--line); }
  .summary article:nth-last-child(-n+2) { border-bottom: 0; }
  .boundary { grid-template-columns: 1fr; gap: 10px; }
  .ethics-grid { grid-template-columns: repeat(2, 1fr); }
  .ethics-grid article, .ethics-grid article:nth-child(3n), .ethics-grid article:nth-child(3n+2) { padding: 22px 18px 26px 0; border-right: 1px solid var(--line); }
  .ethics-grid article:nth-child(even) { padding-left: 18px; border-right: 0; }
  footer { grid-template-columns: 1fr; }
  .table-tools { grid-template-columns: 1fr 1fr; }
  .condition { grid-template-columns: 1fr 1fr; }
  .condition input { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .table-shell thead { display: none; }
  .table-shell tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table-shell td, .table-shell td:nth-child(n) { display: grid; grid-template-columns: minmax(90px, .5fr) 1fr; width: 100%; padding: 4px 0; border: 0; }
  .table-shell td[data-field="domain"], .table-shell td[data-field="presumed_victim_domain"], .table-shell td[data-field="network_membership_status"], .table-shell td[data-field="presumed_victim_status"] { white-space: normal; }
  .table-shell td::before { content: attr(data-label); color: var(--muted); font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
}

@media (max-width: 620px) {
  .site-header { align-items: flex-start; }
  main { width: min(100% - 24px, var(--max)); }
  .hero { padding-top: 46px; }
  h1 { font-size: clamp(34px, 10vw, 46px); }
  .quality-heading, .validation-heading, .map-heading, .records-heading, .filter-heading { align-items: flex-start; flex-direction: column; }
  .map-coverage { align-items: flex-start; }
  .map-footer { align-items: flex-start; flex-direction: column; }
  .map-legend { width: 100%; }
  .map-legend i { flex: 1 1 auto; }
  .quality-state { align-items: flex-start; }
  .quality-grid, .summary, .validation-numbers, .history-grid, .ethics-grid { grid-template-columns: 1fr; }
  .quality-grid p, .quality-grid p:nth-child(odd), .quality-grid p:nth-child(even) { min-height: 74px; padding: 11px 0; border-right: 0; }
  .summary article, .summary article:nth-child(odd), .summary article:nth-child(even) { min-height: 92px; border-right: 0; border-bottom: 1px solid var(--line); }
  .summary article:last-child { border-bottom: 0; }
  .validation-numbers { gap: 16px; }
  .boundary > p { font-size: 16px; }
  .history-grid article, .history-grid article:nth-child(odd), .history-grid article:nth-child(even) { padding: 22px 0; border-right: 0; }
  .ethics-grid article, .ethics-grid article:nth-child(3n), .ethics-grid article:nth-child(3n+2), .ethics-grid article:nth-child(even) { padding: 22px 0; border-right: 0; }
  .confidence-method pre { font-size: 11px; }
  .filter-panel { padding: 12px; }
  .table-tools { grid-template-columns: 1fr; }
  #column-controls { left: 0; right: auto; }
  .condition { grid-template-columns: 1fr; }
  .condition input { grid-column: auto; }
  .filter-group .filter-group { margin-left: 6px; }
  .table-shell thead { display: none; }
  .table-shell tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table-shell td, .table-shell td:nth-child(n) { display: grid; grid-template-columns: minmax(90px, .5fr) 1fr; width: 100%; padding: 4px 0; border: 0; }
  .table-shell td[data-field="domain"], .table-shell td[data-field="presumed_victim_domain"], .table-shell td[data-field="network_membership_status"], .table-shell td[data-field="presumed_victim_status"] { white-space: normal; }
  .table-shell td::before { content: attr(data-label); color: var(--muted); font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
  .results-bar { align-items: flex-start; flex-direction: column; }
  footer { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
