:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #5d6679;
  --line: #e4e7ec;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --link: #1d4ed8;
  --ok: #067647;
  --warn: #b54708;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  font-family: "Segoe UI Variable Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1, h2, h3, .brand, .finding b, .stat b, .money-card .amount { font-family: "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.35rem); }
h2 { font-size: 1.3rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
code { background: #eef0f3; padding: 0 .3em; border-radius: 4px; font-size: .9em; }
blockquote { margin: .4rem 0 0; padding: .4rem .8rem; border-left: 3px solid var(--line); color: var(--muted); font-size: .92rem; background: #fafafa; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem; z-index: 10; }

/* header + nav */
.site-header { background: #0d1117; color: #fff; border-bottom: 1px solid #1f2630; }
.site-header .inner { max-width: 1280px; margin: 0 auto; padding: .75rem 1.2rem .35rem; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.brand span { color: #f87171; }
.tagline { color: #a6adbb; font-size: .9rem; }
nav.main-nav { max-width: 1280px; margin: 0 auto; padding: .2rem .8rem .6rem; display: flex; align-items: center; gap: .15rem; overflow-x: auto; scrollbar-width: thin; }
nav.main-nav a { color: #c3cad5; text-decoration: none; padding: .4rem .7rem; border-radius: 8px; white-space: nowrap; font-size: .92rem; }
nav.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
nav.main-nav a.active { color: #fff; background: rgba(255, 255, 255, .13); }
nav.main-nav .nav-group { color: #8b93a3; font-size: .75rem; font-weight: 600; padding: 0 .15rem 0 .75rem; margin-left: .4rem; border-left: 1px solid #262d38; white-space: nowrap; }

main { max-width: 1280px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; background: #fff; }
.site-footer .inner { max-width: 1280px; margin: 0 auto; padding: 1rem 1.2rem 2rem; }

/* building blocks */
.lead { font-size: 1.12rem; color: #475467; max-width: 75ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: .6rem 1.05rem; text-decoration: none; font-weight: 600; cursor: pointer; font-size: .95rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.btn:hover { background: #1e40af; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid #d0d5dd; }
.btn.secondary:hover { background: #f9fafb; border-color: #98a2b3; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; font-weight: 500; border-radius: 8px; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
.badge { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 999px; background: #eef0f3; color: #344054; margin: 0 .25rem .25rem 0; white-space: nowrap; }
.badge.case { background: #fde8e8; color: #9b1c1c; }
.badge.ok { background: #dcfae6; color: var(--ok); }
.badge.warn { background: #fef0c7; color: var(--warn); }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.callout { border: 1px solid #fedf89; background: #fffaeb; padding: .85rem 1.1rem; border-radius: 12px; margin: 1rem 0; }
.callout.info { border-color: #b2ddff; background: #eff8ff; }
.callout.ok { border-color: #abefc6; background: #ecfdf3; }
.loading { color: var(--muted); padding: 2rem 0; }
.error { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; padding: 1rem; border-radius: 12px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: .8rem; }
.controls label { font-size: .9rem; color: #344054; display: inline-flex; gap: .35rem; align-items: center; max-width: 100%; min-width: 0; }
select, input[type=search], input[type=text] { font: inherit; font-size: .95rem; padding: .4rem .55rem; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; max-width: 100%; min-width: 0; }
select { width: auto; max-width: min(34rem, 100%); text-overflow: ellipsis; }
input[type=search] { min-width: min(240px, 100%); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f9fafb; color: #475467; font-weight: 600; position: sticky; top: 0; z-index: 1; }
tbody tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
details summary { cursor: pointer; color: var(--link); }

/* charts */
.chart { width: 100%; height: 420px; }
.chart.short { height: 300px; }
.fig { margin: 0 0 1rem; }
.fig-title { font-size: 1.08rem; margin-bottom: .2rem; }
.fig-how { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; max-width: 80ch; }
.fig-how:empty { display: none; }
.fig-src { font-size: .82rem; color: var(--muted); margin: .4rem 0 0; }

/* overview findings */
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.finding { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.3rem; display: flex; flex-direction: column; }
.finding b { font-size: 2.05rem; font-weight: 700; line-height: 1.1; margin-bottom: .3rem; font-variant-numeric: tabular-nums; }
.finding .small a, .fig-src a { text-decoration: none; }
.finding .small a:hover, .fig-src a:hover { text-decoration: underline; }
.finding .small a:first-child, .case-card .btn-row .small a { font-weight: 600; }
.finding p { margin: 0 0 .6rem; }
.finding .small { margin-top: auto; margin-bottom: 0; }
.stats.quiet .stat b { font-size: 1.15rem; }

/* money cards */
.money-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.money-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; }
.money-card .amount { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.money-card .what { font-weight: 600; margin: .2rem 0; }
.chart.tall { height: 640px; }
.chart.xtall { height: 820px; }

/* map page */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1rem; }
.map-layout .chart { height: 74vh; min-height: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; height: 74vh; min-height: 520px; overflow-y: auto; }
.conn { border-top: 1px solid var(--line); padding: .6rem 0; }
.conn:first-of-type { border-top: 0; }
.conn .who { font-weight: 600; }
.conn a.node-link { cursor: pointer; }
.src { font-size: .85rem; margin-top: .25rem; }
.legend-list { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .85rem; margin: .4rem 0; }
.line-sample { display: inline-block; width: 28px; height: 0; border-top: 2px solid #475467; vertical-align: middle; margin-right: .35rem; }
.line-sample.dashed { border-top-style: dashed; }
.line-sample.dotted { border-top-style: dotted; border-top-width: 3px; }

/* case cards */
.case-card h3 { margin-bottom: .25rem; }
.case-card .meta { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }

/* timeline */
.tl-month { margin-top: 1.4rem; }
.tl-month h3 { position: sticky; top: 0; background: var(--bg); padding: .3rem 0; z-index: 1; }
.tl-item { display: grid; grid-template-columns: 7.5rem 1fr; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.tl-item time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.tl-item .title { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid #d0d5dd; border-radius: 999px; padding: .2rem .7rem; background: #fff; cursor: pointer; font-size: .88rem; }
.chip[aria-pressed=false] { opacity: .45; }

/* ownership: an indented list built from native <details>, so it opens and closes with the keyboard */
.o-tree { font-size: .92rem; max-height: 75vh; overflow: auto; }
.o-tree ul { list-style: none; margin: 0; padding-left: 1.3rem; border-left: 1px solid var(--line); }
.o-tree > ul { padding-left: 0; border-left: 0; }
.o-tree li { margin: .1rem 0; }
.o-tree li.leaf { padding-left: 1.05rem; }
.o-tree summary { color: inherit; }
.o-tree .o-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.o-tree .hit { background: #fef0c7; outline: 2px solid #f59e0b; border-radius: 4px; }
.path { font-size: .88rem; }
.path span + span::before { content: " › "; color: var(--muted); }

@media (max-width: 960px) {
  .map-layout { grid-template-columns: 1fr; }
  .side { height: auto; min-height: 0; }
  .tl-item { grid-template-columns: 1fr; gap: .1rem; }
  h1 { font-size: 1.6rem; }
}

/* Vesper credit in the header, where the tagline was */
.tagline.credit { color: #98a2b3; font-size: .85rem; }
.tagline.credit b { color: #e4e7ec; }
.tagline.credit a { color: #cbd5e1; text-decoration-color: rgba(203, 213, 225, .45); }
.head-search { order: 3; margin-left: auto; color: #fff; text-decoration: none; font-size: .9rem; background: rgba(255, 255, 255, .06); border: 1px solid #2b3340; border-radius: 999px; padding: .3rem .95rem; align-self: center; }
.head-search:hover { background: rgba(255, 255, 255, .12); border-color: #475467; }
@media (max-width: 700px) {
  .head-search { order: 1; }
  .tagline.credit { order: 2; flex-basis: 100%; }
}

/* ownership diagram: scrolls sideways when a deep branch is open */
.o-scroll { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.seg { display: inline-flex; border: 1px solid #d0d5dd; border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: .9rem; border: 0; background: #fff; padding: .35rem .85rem; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid #d0d5dd; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.hit { background: #fef0c7; outline: 2px solid #f59e0b; border-radius: 4px; }

/* search page */
.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; }
.big-search { display: flex; gap: .5rem; max-width: 40rem; margin: 1rem 0 .4rem; }
.big-search input { flex: 1; font: inherit; font-size: 1.05rem; padding: .55rem .8rem; border: 1px solid #d0d5dd; border-radius: 8px; min-width: 0; }
.count { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; background: #eef0f3; color: #344054; vertical-align: .15em; }
.q-group h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.q-list { list-style: none; margin: 0 0 .6rem; padding: 0; columns: 2 18rem; column-gap: 2rem; }
.q-list li { break-inside: avoid; padding: .3rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }

/* about page */
.credit-panel h2 { margin-top: 0; }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: .8rem; margin: 1rem 0; }
.glossary > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .7rem 1rem; }
.glossary dt { font-weight: 700; margin-bottom: .2rem; }
.glossary dd { margin: 0; color: #344054; font-size: .95rem; }

/* ownership: Groups view (parent, children, grandchildren as blocks joined by ribbons) */
.og-trail { font-size: .9rem; margin: .3rem 0 .5rem; }
.og-trail:empty { display: none; }
.og-scroll { padding: .6rem .7rem .8rem; }
.og-cols { position: relative; height: 1.5rem; }
.og-cols span { position: absolute; top: 0; font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.og { position: relative; }
.og svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.og-b { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: .05rem;
  margin: 0; padding: 0 .55rem; font: inherit; text-align: left; color: var(--ink); background: #fff; cursor: pointer;
  border: 1px solid #d0d5dd; border-left: 4px solid var(--c); border-radius: 6px; overflow: hidden; }
.og-b:hover { background: #f5f7fa; border-color: #98a2b3; border-left-color: var(--c); }
.og-b:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 1px; z-index: 2; }
.og-b .n { font-size: .8rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.og-b .m { font-size: .74rem; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.og-b.short { flex-direction: row; align-items: center; justify-content: space-between; gap: .5rem; }
.og-b.short .n { flex: 1 1 auto; min-width: 0; }
.og-b.short .m { flex: none; }
.og-b.focus { justify-content: flex-start; padding-top: .6rem; background: #eef0f3; border-color: #d0d5dd; border-left-color: var(--c); }
.og-b.focus .n { white-space: normal; font-size: .85rem; }
.og-b.focus .m { white-space: normal; }
.og-b.bucket { background: #f2f4f7; border-style: dashed; border-left-style: solid; }
.og-b.hit { background: #fef0c7; outline: 3px solid var(--accent); z-index: 1; }
.og-b.picked { box-shadow: 0 0 0 2px #1d4ed8; z-index: 1; }
.og-pick { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
.og-pick h4 { margin: 0 0 .4rem; font-size: .95rem; }
.og-pick .table-wrap { max-height: 22rem; overflow: auto; }

/* Simple-first pieces: dotted words, square counts, per-person lines, guess box, "Change what's shown", "Show all" */
.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help;
  text-decoration: underline dotted #1d4ed8; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.term:hover, .term[aria-expanded=true] { color: #1d4ed8; }
#term-pop { position: absolute; z-index: 50; max-width: min(22rem, calc(100vw - 16px)); background: #14171c; color: #fff;
  padding: .6rem .8rem; border-radius: 8px; font-size: .92rem; line-height: 1.45; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.squares { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 16rem; vertical-align: middle; margin: .2rem 0 .5rem; }
.squares i { width: 13px; height: 13px; border: 1.5px solid #98a2b3; border-radius: 2px; background: #fff; }
.squares i.on { background: var(--accent); border-color: var(--accent); }
.squares.warn i.on { background: #b54708; border-color: #b54708; }
.squares.ok i.on { background: var(--ok); border-color: var(--ok); }
.pic-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.pic-line .squares { margin: 0; }
.per { font-size: .92rem; color: #1e3a8a; background: #eef4ff; border-radius: 8px; padding: .25rem .55rem; margin: 0 0 .6rem; }
.money-card .per { margin: .25rem 0 .3rem; display: inline-block; }
.guess { border: 1px solid #d6e0fb; background: linear-gradient(180deg, #f3f6ff, #fff 70%); }
.guess h2 { margin-top: 0; }
.guess-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.guess-row input[type=range] { flex: 1 1 14rem; min-height: 28px; accent-color: #1d4ed8; }
.guess-row output { font-weight: 700; font-variant-numeric: tabular-nums; display: inline-block; min-width: 3.2em; }
.guess-result { margin-top: .9rem; }
.g-bar { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 3.5rem; align-items: center; gap: .6rem; margin: .35rem 0; }
.g-bar b { font-variant-numeric: tabular-nums; }
.g-track { display: block; }
.g-track i { display: block; height: 22px; width: 0; border-radius: 4px; background: #98a2b3; transition: width .6s ease-out; }
.g-bar.real .g-track i { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .g-track i { transition: none; } }
.change { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .9rem .1rem; margin: -.3rem 0 1rem; }
.change-title { font-size: .9rem; margin: 0 0 .35rem; color: #344054; }
.change .controls { margin-bottom: .5rem; }
.show-all { margin: .6rem 0 1.2rem; }
.nw { white-space: nowrap; }

/* "Get the data" under each chart: a button that looks like a link, with a 24px tap target */
.linkish { background: none; border: 0; padding: 0; min-height: 24px; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
