:root {
  /* System stack only -- no external font requests. The original build
     pulled General Sans from fontshare.com and Geist Mono from Google,
     which leaks every visitor's IP to two third parties. */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --xs: 0.72rem; --sm: 0.82rem; --base: 0.9rem; --lg: 1.1rem;
}
[data-theme="dark"] {
  --bg: #0f1012; --surface: #17181b; --surface2: #1f2024; --line: #2a2b30;
  --text: #ebe6dc; --muted: #9a958b; --faint: #5f5b55;
  --s1: #77726a; --s2: #c2ad6e; --s3: #e39a3e; --s4: #e2563f; --s5: #ff3d6e;
  --monitor: #7f9ec4; --media: #4fb3a5; --academic: #a68ad6; --government: #b7bd72; --platform: #d38bb0; --reference: #9a958b; --funder: #d8a24a; --legal: #c98a5e; --counter: #4fb3a5; --impact: #8fb4d9;
}
[data-theme="light"] {
  --bg: #f4f1ea; --surface: #fbf9f4; --surface2: #efebe2; --line: #ddd7cb;
  --text: #1d1c1a; --muted: #67625a; --faint: #a39d92;
  --s1: #8b867d; --s2: #9c8536; --s3: #b8620d; --s4: #c23e28; --s5: #c4124a;
  --monitor: #3f6797; --media: #1f857a; --academic: #6f4fae; --government: #6c7230; --platform: #a3477a; --reference: #7a766e; --funder: #a8730f; --legal: #94582c; --counter: #1f857a; --impact: #3d6f9e;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--base); -webkit-font-smoothing: antialiased; }
a { color: var(--s3); text-underline-offset: 2px; }
button { font: inherit; color: inherit; background: var(--surface2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: var(--sm); }
button:hover { border-color: var(--muted); }
button.ghost { background: transparent; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: var(--lg); letter-spacing: -0.01em; }
h2 { font-size: var(--xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.app { display: grid; grid-template-columns: 240px 1fr 340px; grid-template-rows: auto 1fr; height: 100dvh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; gap: 12px; align-items: center; min-width: 280px; max-width: 420px; }
.logo { color: var(--text); flex: none; }
.sub { margin: 2px 0 0; font-size: var(--xs); color: var(--muted); line-height: 1.4; }
.kpis { display: flex; flex: 1; overflow-x: auto; }
.kpi { display: flex; flex-direction: column; padding: 4px 14px; border-left: 1px solid var(--line); min-width: 0; flex: 1; }
.kv { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; }
.kpi.hot .kv { color: var(--s5); }
.kl { font-size: var(--xs); color: var(--muted); line-height: 1.3; }
.theme { padding: 7px; display: grid; place-items: center; }
.topbtns { display: flex; gap: 6px; align-items: center; flex: none; }

.side { border-right: 1px solid var(--line); background: var(--surface); padding: 16px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 20px; }
.side section { display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: var(--sm); cursor: pointer; padding: 2px 0; }
.checks input { accent-color: var(--s3); }
.checks .ct { margin-left: auto; font-family: var(--mono); font-size: var(--xs); color: var(--faint); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.sq { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { padding: 4px 8px; font-size: var(--xs); }
.seg button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.sevkey { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 5px; font-size: var(--xs); color: var(--muted); }
.sevkey li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.sevkey .dot { margin-top: 2px; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: var(--sm); cursor: pointer; }
.toggle input { accent-color: var(--s3); }
#search, #brSearch { font: inherit; font-size: var(--sm); background: var(--surface2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; color: var(--text); }
.note p { margin: 0; font-size: var(--xs); color: var(--muted); line-height: 1.55; }

.main { overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.meta { font-size: var(--xs); color: var(--faint); }
.timeline { height: 470px; position: relative; }
.timeline svg, .network svg { width: 100%; height: 100%; display: block; }
.network { height: min(64dvh, 620px); min-height: 480px; }
.foot { font-size: var(--xs); color: var(--muted); margin: 6px 0 0; }
.edgekey { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--xs); color: var(--muted); }
.edgekey span { display: inline-flex; align-items: center; gap: 6px; }
.edgekey i { width: 20px; height: 0; border-top: 2px solid; display: inline-block; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--sm); }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: var(--xs); text-transform: uppercase; letter-spacing: .06em; padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
th.num, td.num { text-align: right; }
td { padding: 7px 8px; } td.mono { white-space: nowrap; } td { border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.sel { background: var(--surface2); }
td .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--xs); color: var(--muted); white-space: nowrap; }
.nm { display: inline-block; font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); margin-right: 3px; color: var(--muted); }
.nm.SJ { border-color: var(--s5); color: var(--s5); }
.nm.GMI { border-color: var(--s3); color: var(--s3); }
.sevb { font-family: var(--mono); font-size: var(--xs); padding: 1px 6px; border-radius: 4px; color: #111; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: var(--xs); color: var(--muted); }

.detail { border-left: 1px solid var(--line); background: var(--surface); padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.detail .empty p { color: var(--muted); font-size: var(--sm); line-height: 1.55; }
.startlist { display: flex; flex-wrap: wrap; gap: 6px; }
.detail h3 { font-size: 1.1rem; line-height: 1.3; margin: 8px 0 4px; }
.detail .kind { font-size: var(--xs); color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 12px; }
.detail .row { display: flex; gap: 14px; margin: 12px 0; }
.detail .row div { display: flex; flex-direction: column; }
.detail .row b { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; }
.detail .row span { font-size: var(--xs); color: var(--muted); }
.detail p { font-size: var(--sm); line-height: 1.6; margin: 10px 0; }
.detail blockquote { margin: 12px 0; padding: 10px 12px; border-left: 3px solid var(--s4); background: var(--surface2); border-radius: 0 6px 6px 0; font-size: var(--sm); line-height: 1.55; }
.detail .lab { font-size: var(--xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 16px; }
.detail ul.evs { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 5px; }
.detail ul.evs li { padding: 7px 9px; background: var(--surface2); border-radius: 6px; font-size: var(--xs); line-height: 1.45; cursor: pointer; display: grid; grid-template-columns: 62px 1fr; gap: 6px; }
.detail ul.evs li .d { font-family: var(--mono); color: var(--muted); }
.detail .warn { font-size: var(--xs); border: 1px dashed var(--muted); color: var(--muted); padding: 2px 7px; border-radius: 4px; display: inline-block; }
.detail .action { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: var(--sm); line-height: 1.5; margin-top: 8px; }

.tip { position: fixed; pointer-events: none; background: var(--surface2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: var(--xs); max-width: 300px; opacity: 0; transition: opacity .12s; z-index: 40; line-height: 1.45; }
.lane-label { font-size: 10.5px; fill: var(--muted); }
.axis text { fill: var(--muted); font-family: var(--mono); font-size: 10px; }
.axis line, .axis path { stroke: var(--line); }
.node-label { font-size: 10px; fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.ann { font-size: 10px; fill: var(--muted); font-family: var(--mono); }

@media (max-width: 1200px) {
  .app { grid-template-columns: 220px 1fr; }
  .detail { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; z-index: 30; transform: translateX(100%); transition: transform .2s; box-shadow: -8px 0 24px rgba(0,0,0,.3); }
  .detail.open { transform: none; }
  .detail.open::before { content: ""; }
}
@media (max-width: 760px) {
  html, body { overflow: auto; height: auto; }
  .app { display: flex; flex-direction: column; height: auto; }
  .top { flex-wrap: wrap; }
  .brand { max-width: none; min-width: 0; flex: 1; }
  .kpis { order: 3; flex: 1 0 100%; }
  .kpi { min-width: 120px; }
  .main { order: 1; overflow: visible; padding: 12px; }
  .side { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .detail { width: 100%; }
  .timeline { height: 420px; }
  .network { height: 520px; }
}

.fundfilters { display: grid; gap: 8px; margin-bottom: 10px; }
.fundfilters > div { display: flex; gap: 10px; align-items: flex-start; }
.flab { font-size: var(--xs); color: var(--muted); min-width: 82px; padding-top: 5px; }
.ev { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); white-space: nowrap; }
.ev.filed, .ev.grant_db { border-color: var(--media); color: var(--media); }
.ev.publisher { border-color: var(--monitor); color: var(--monitor); }
.ev.secondary, .ev.reported { border-color: var(--s2); color: var(--s2); }
.ev.metadata { color: var(--muted); }
.ev.refuted { border-color: var(--s5); color: var(--s5); }
.ev.not_found { border-style: dashed; color: var(--muted); }
td.amt { white-space: nowrap; }

.conf-verified { color: var(--counter); } .conf-partial { color: var(--funder); } .conf-lead { color: var(--muted); border-style: dashed; }
#bridges td .t { max-width: 46ch; } #bridges td:nth-child(3) { max-width: 30ch; } #bridges .chip { margin: 2px 2px 2px 0; }
.card .sub { color: var(--muted); font-size: var(--sm); margin: -.25rem 0 .75rem; max-width: 80ch; }
.bridgetag { display:inline-block; font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; color:var(--funder); margin-top:2px; }
.detail .stat { font-size:.72rem; font-family: var(--mono); white-space:nowrap; }
#brSearch { min-width: 220px; }

/* ---------------------------------------------- evidence mode + new parts */

/* Mode switch. Public is the default and the safe state. */
.modeswitch { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; flex: none; }
.modeswitch button { border: 0; border-radius: 0; background: transparent; padding: 6px 11px; font-size: var(--xs); white-space: nowrap; }
.modeswitch button.on { background: var(--s4); color: #fff; }
.modeswitch button.on[data-m="public"] { background: var(--media); color: #06201d; }

/* Loud, unmissable banner whenever unverified material is on screen. */
.researchbar { grid-column: 1 / -1; display: none; align-items: center; gap: 12px; padding: 8px 20px; background: var(--s4); color: #fff; font-size: var(--sm); }
[data-mode="research"] .researchbar { display: flex; }
.researchbar b { font-weight: 600; }
.researchbar button { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; margin-left: auto; }

/* Per-row provenance badges. */
.tierb { display: inline-block; font-size: 10px; font-family: var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px dashed var(--s4); color: var(--s4); white-space: nowrap; margin-left: 4px; }
.directb { display: inline-block; font-size: 10px; font-family: var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--s5); color: var(--s5); white-space: nowrap; }
.listb { display: inline-block; font-size: 10px; font-family: var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }

/* Funding track tabs. */
.tracktabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tracktabs button { padding: 6px 11px; font-size: var(--xs); }
.tracktabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.trackblurb { font-size: var(--xs); color: var(--muted); line-height: 1.6; margin: 0 0 10px; padding: 9px 11px; border-left: 3px solid var(--line); background: var(--surface2); border-radius: 0 6px 6px 0; max-width: 90ch; }
.trackblurb.warn { border-left-color: var(--s4); }
.trackblurb.good { border-left-color: var(--media); }
.subtotals { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 10px; }
.subtotals div { display: flex; flex-direction: column; }
.subtotals b { font-family: var(--mono); font-size: 1.25rem; font-weight: 500; }
.subtotals span { font-size: var(--xs); color: var(--muted); }

/* Methodology */
.methodology { font-size: var(--sm); line-height: 1.65; color: var(--muted); max-width: 86ch; }
.methodology h3 { font-size: var(--base); color: var(--text); margin: 16px 0 6px; }
.methodology p { margin: 8px 0; }
.methodology ul { margin: 8px 0; padding-left: 20px; }
.methodology li { margin: 5px 0; }
.methodology code { font-family: var(--mono); font-size: var(--xs); background: var(--surface2); padding: 1px 5px; border-radius: 4px; }
.methodology strong { color: var(--text); font-weight: 600; }
details.meth > summary { cursor: pointer; font-size: var(--xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ------------------------------------------- disclosure, findings, grades */

/* Always visible. The compiler of this record was a plaintiff against one of
   its subjects; that has to be on the page, not buried in methodology. */
.disclosure { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 20px; background: var(--surface2); border-bottom: 1px solid var(--line); font-size: var(--xs); color: var(--muted); line-height: 1.5; }
.disclosure .dtag { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--s4); border: 1px solid var(--s4); border-radius: 4px; padding: 1px 6px; flex: none; }
.disclosure button { padding: 3px 8px; font-size: var(--xs); }
.disclosure.open { align-items: flex-start; }

/* A negative finding is the headline, not a footnote. */
.negheadline { font-size: var(--base); line-height: 1.6; margin: 0 0 12px; padding: 10px 13px; border-left: 3px solid var(--media); background: var(--surface2); border-radius: 0 6px 6px 0; max-width: 92ch; }
.negheadline b { color: var(--media); }

/* Claim classes are counted separately and never summed. */
.classcounts { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 12px; }
.classcounts div { display: flex; flex-direction: column; min-width: 90px; }
.classcounts b { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; }
.classcounts span { font-size: var(--xs); color: var(--muted); line-height: 1.3; }

.findings { display: grid; gap: 10px; }
.finding { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface2); }
.finding.research { border-style: dashed; border-color: var(--s4); }
.finding h4 { margin: 0 0 6px; font-size: var(--base); font-weight: 600; line-height: 1.4; }
.finding p { margin: 6px 0; font-size: var(--sm); line-height: 1.6; color: var(--muted); }
.finding p.bodytext { color: var(--text); }
.finding .fhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.finding .srcs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: var(--xs); }
.finding .prov { font-size: var(--xs); color: var(--faint); margin-top: 6px; font-family: var(--mono); }
.findings.neg .finding { background: transparent; }

/* Grade badges. The third grade is the point: an inference is published AS an
   inference, so the grading discipline survives contact with the reader. */
.grade { display: inline-block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; white-space: nowrap; border: 1px solid; }
.grade.verified { color: var(--media); border-color: var(--media); }
.grade.inference { color: var(--s3); border-color: var(--s3); border-style: dashed; }
.grade.partial { color: var(--muted); border-color: var(--muted); border-style: dashed; }
.cls { display: inline-block; font-size: 10px; font-family: var(--mono); padding: 1px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.jur { display: inline-block; font-size: 10px; font-family: var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--monitor); color: var(--bg); white-space: nowrap; }
.caveat { border-left: 3px solid var(--s3); padding: 7px 11px; background: var(--surface); border-radius: 0 6px 6px 0; }
.caveat.hard { border-left-color: var(--s4); }
.outcome { display: inline-block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--s4); color: var(--s4); white-space: nowrap; }
.outcome.declined, .outcome.injunction_entered { border-color: var(--media); color: var(--media); }
.outcome.pending { border-color: var(--s2); color: var(--s2); }

.stepn { display:inline-block; font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:.06em; padding:1px 7px; border-radius:4px; background:var(--s4); color:#fff; white-space:nowrap; }
.findings.chain .finding { border-left:3px solid var(--s4); }
.arch { color: var(--media); }
.prov.warnprov { color: var(--s3); font-family: var(--font); line-height: 1.5; }
.corrorigin { display:inline-block; font-size:10px; font-family:var(--mono); padding:1px 6px; border-radius:4px; border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.ixlabel { font-size:12px; color:var(--muted); margin:14px 0 6px; }
.findingindex { display:flex; flex-direction:column; gap:3px; margin-bottom:18px;
  max-height:none; border:1px solid var(--line); border-radius:8px; padding:6px; }
.findingindex button { display:flex; align-items:baseline; gap:8px; width:100%; text-align:left;
  background:none; border:0; border-radius:5px; padding:6px 8px; cursor:pointer;
  font:inherit; font-size:12.5px; color:var(--text); line-height:1.35; }
.findingindex button:hover { background:var(--surface2); }
.findingindex button.on { background:var(--surface2); font-weight:600;
  box-shadow:inset 2px 0 0 var(--media); }
.findingindex .ixn { flex:0 0 18px; font-family:var(--mono); font-size:10.5px; color:var(--muted); }
.finding.solo { border-color:var(--media); box-shadow:0 0 0 1px var(--media) inset; }
.permalink { margin-left:auto; font-family:var(--mono); font-size:10px; color:var(--muted);
  text-decoration:none; opacity:.65; }
.permalink:hover { opacity:1; text-decoration:underline; }
.finding.lifetime { opacity:.92; border-style:dashed; }
.subh { font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:22px 0 8px; }
.escal { margin:10px 0 0; padding:9px 11px; border-left:2px solid var(--government); background:var(--surface2); border-radius:0 6px 6px 0; }
.escal b { font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); }
.escal ul { margin:5px 0 0; padding-left:18px; }
.escal li { font-size:12.5px; line-height:1.5; margin:2px 0; }
