:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #efece5; --text: #1d1b18; --muted: #615c53; --line: #dcd7cc;
  --accent: #b3261e; --accent-ink: #ffffff; --link: #1d1b18; --focus: #1f5fbf; --pip-off: #ddd7cb;
  --sev: #b3261e; --evi: #2f6b4f;
  --t-action: #b3261e; --t-legal: #1f5fbf; --t-consequence: #9a5b00; --t-reaction: #6b5f8a; --t-outcome: #2f6b4f; --t-context: #7a746a; --t-announcement: #7a746a;
  --shadow: 0 1px 2px rgba(30, 25, 15, .06), 0 2px 8px rgba(30, 25, 15, .04);
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413; --surface: #1e1d1b; --surface-2: #262522; --text: #ece9e3; --muted: #a9a398; --line: #36342f;
    --accent: #e5534b; --accent-ink: #160b0a; --link: #ece9e3; --focus: #7aa7ff; --pip-off: #3a3833; --sev: #f0706a; --evi: #6cc39a;
    --t-action: #f0706a; --t-legal: #7aa7ff; --t-consequence: #e0a54a; --t-reaction: #b3a6d9; --t-outcome: #6cc39a; --t-context: #a9a398; --t-announcement: #a9a398;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151413; --surface: #1e1d1b; --surface-2: #262522; --text: #ece9e3; --muted: #a9a398; --line: #36342f;
  --accent: #e5534b; --accent-ink: #160b0a; --link: #ece9e3; --focus: #7aa7ff; --pip-off: #3a3833; --sev: #f0706a; --evi: #6cc39a;
  --t-action: #f0706a; --t-legal: #7aa7ff; --t-consequence: #e0a54a; --t-reaction: #b3a6d9; --t-outcome: #6cc39a; --t-context: #a9a398; --t-announcement: #a9a398;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.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; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* top bar */
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 52px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: .04em; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.topbar nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 15px; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: 4px 0; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.theme { margin-left: auto; }

/* shared */
select, .btn { font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
h1, h2, h3 { font-family: var(--serif); }
.pagetitle { font-size: clamp(30px, 5vw, 40px); margin: 32px 0 6px; }
.dek { color: var(--muted); margin: 0; max-width: 66ch; font-size: 17px; }
.crumb { margin: 28px 0 6px; font-size: 14px; }
.crumb a { color: var(--muted); }
.crumb a::after { content: " /"; }
h2.sec { font-size: 22px; margin: 40px 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--text); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
h2.sec a { font: 14px system-ui, sans-serif; color: var(--muted); }
.sec-dek { color: var(--muted); margin: 0 0 6px; }
.note { color: var(--muted); font-size: 14px; }
.chip { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .8; }

/* home masthead */
.masthead { padding: 40px 0 28px; border-bottom: 3px double var(--line); }
.masthead .top { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
h1.sitename { font-size: clamp(44px, 8vw, 84px); line-height: 1; text-wrap: balance; margin: 0 0 14px; letter-spacing: 0; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .12em; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.cta { margin: 18px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }

/* storyline + people cards */
ol.scards, ol.pcards { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
ol.scards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
ol.pcards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.scard a, .pcard a { display: block; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); }
.scard a:hover h3, .pcard a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.scard h3, .pcard h3 { margin: 0 0 6px; font-size: 22px; }
.scard .dek { font-size: 15px; }
.figs { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.figs b { color: var(--accent); font-family: var(--serif); font-size: 17px; margin-right: 4px; }
.sc-meta, .pcard span { font-size: 13px; color: var(--muted); margin: 0; }
.pcard p { color: var(--muted); font-size: 14px; margin: 0 0 8px; }

/* entry cards */
ol.list { list-style: none; margin: 0; padding: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; }
.meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.cat { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.storylink { font-size: 12.5px; color: var(--muted); }
.card h3, .ev h3 { margin: 2px 0 4px; font-size: 19px; line-height: 1.3; font-weight: 700; }
.card h3 a, .ev h3 a { text-decoration: none; }
.card h3 a:hover, .ev h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ext { display: inline-block; width: .7em; height: .7em; margin-left: 4px; color: var(--muted); vertical-align: baseline; }
.summary { margin: 0; }
.card .summary { max-width: 85ch; }
.scores { grid-row: 2 / span 2; grid-column: 2; display: grid; gap: 8px; align-content: start; min-width: 118px; padding-top: 4px; }
.score { font-size: 12px; color: var(--muted); }
.score .lbl { display: flex; justify-content: space-between; gap: 8px; }
.score .lbl b { color: var(--text); font-weight: 600; }
.pips { display: flex; gap: 3px; margin-top: 3px; }
.pips i { flex: 1; height: 6px; border-radius: 2px; background: var(--pip-off); }
.score.sev .pips i.on { background: var(--sev); }
.score.evi .pips i.on { background: var(--evi); }
.srcline { margin: 6px 0 0; font-size: 14px; }
.src { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.src b { color: var(--text); font-weight: 600; }
.src:hover { text-decoration-color: currentColor; }
.also { grid-column: 1 / -1; margin-top: 6px; font-size: 14px; }
.also summary { cursor: pointer; color: var(--muted); }
.also ul { margin: 6px 0 0; padding-left: 18px; }
.also li { margin: 3px 0; }
.also .o { color: var(--muted); }

/* storyline page */
.story h1, .person h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.05; margin: 0 0 10px; }
.byline { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 14px 0; }
ul.facts { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
ul.facts a { display: block; height: 100%; background: var(--surface); padding: 12px 14px; text-decoration: none; }
ul.facts a:hover span { text-decoration: underline; }
ul.facts b { display: block; font-family: var(--serif); font-size: 26px; color: var(--accent); line-height: 1.1; }
ul.facts span { font-size: 13px; color: var(--muted); }
.story-grid { display: grid; grid-template-columns: 190px 1fr; gap: 32px; margin-top: 24px; }
.toc { position: sticky; top: 12px; align-self: start; font-size: 14px; }
.toc p { font-weight: 700; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 12px; text-decoration: none; }
.toc li a span { display: block; color: var(--muted); font-size: 12.5px; }
.toc li a:hover { color: var(--accent); }
.short { font-size: 17px; max-width: 68ch; }
.short h2 { font-size: 20px; margin: 0 0 6px; }
.short p { margin: 0 0 12px; }
.legend { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; }
.chapter h2 { font-size: 26px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--text); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chapter h2 span { font: 14px system-ui, sans-serif; color: var(--muted); }
ol.tl { list-style: none; margin: 0; padding: 0; position: relative; }
ol.tl > li { position: relative; padding: 0 0 22px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
ol.tl > li:last-child { border-left-color: transparent; }
ol.tl > li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--tc, var(--muted)); }
.ev.t-action { --tc: var(--t-action); } .ev.t-legal { --tc: var(--t-legal); } .ev.t-consequence { --tc: var(--t-consequence); }
.ev.t-reaction { --tc: var(--t-reaction); } .ev.t-outcome { --tc: var(--t-outcome); } .ev.t-context { --tc: var(--t-context); } .ev.t-announcement { --tc: var(--t-announcement); }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.ev-meta time { font-weight: 600; color: var(--text); }
.ev .type { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tc); }
.ev .cat { color: var(--muted); font-weight: 600; }
.ev .summary { max-width: 70ch; }
.ev-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.ev-foot .outlet { font-style: italic; }

/* sources chart (Method page) */
.srcchart { margin: 12px 0 10px; }
.srcchart figcaption { font-size: 14px; color: var(--muted); margin-bottom: 10px; max-width: 70ch; }
.srcchart ol { list-style: none; margin: 0; padding: 0; max-width: 560px; }
.srcchart li { display: grid; grid-template-columns: minmax(7.5em, 12em) 1fr 2.5em; gap: 10px; align-items: center; font-size: 14px; padding: 2px 0; }
.srcchart .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srcchart svg { display: block; width: 100%; height: 14px; }
.srcchart rect { fill: var(--muted); }
.srcchart li.other { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.srcchart li.other .nm { color: var(--muted); font-style: italic; }
.srcchart .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.srctable { font-size: 14px; margin-bottom: 8px; }
.srctable summary { cursor: pointer; color: var(--muted); }
.srctable table { border-collapse: collapse; margin-top: 8px; min-width: 260px; }
.srctable th, .srctable td { text-align: left; padding: 3px 14px 3px 0; border-bottom: 1px solid var(--line); }
.srctable td:last-child, .srctable th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.mini { display: inline-flex; gap: 12px; }
.mini .m b { font-weight: 600; }
.mini .sev b { color: var(--sev); } .mini .evi b { color: var(--evi); }
.next { margin: 12px 0 0; padding: 12px 0 0 14px; border-left: 3px solid var(--surface-2); background: linear-gradient(90deg, var(--surface-2), transparent 70%); border-radius: 0 0 0 8px; }
.next-h { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.next ol.tl > li { padding-bottom: 14px; }
.next h3 { font-size: 17px; }
details.minor { margin: 0 0 8px 8px; }
details.minor > summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.ev:target > h3 a, .card:target h3 a { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* all-entries page */
.controls { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 0; margin-top: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; font: inherit; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filters-toggle { display: none; }
.filters { margin-top: 10px; display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mins { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--muted); }
.mins label { display: inline-flex; gap: 6px; align-items: center; }
.mins select { padding: 5px 8px; }
.resultbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 0 4px; color: var(--muted); font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
h2.group { font-size: 22px; margin: 28px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2.group span { font: 14px system-ui, sans-serif; color: var(--muted); }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.more { display: block; margin: 18px auto 0; }
section.watch { margin: 20px 0 8px; }
section.watch h3 { font-size: 18px; margin: 0 0 10px; }
section.watch .credit { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.video iframe, .video button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video button { font: inherit; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; align-content: center; gap: 6px; }
.video button span { font-size: 14px; color: var(--muted); }

/* method */
.prose { max-width: 760px; }
.prose h2 { font-size: 24px; margin: 32px 0 8px; }
.prose h3 { font-size: 17px; margin: 0 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.grid2 ol { margin: 0; padding-left: 20px; font-size: 15px; }
ul.types { list-style: none; padding: 0; display: grid; gap: 4px; }
ul.types b { display: inline-block; min-width: 120px; }

.foot { margin: 56px 0 0; padding: 24px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { margin: 6px 0; max-width: 80ch; }

@media (max-width: 760px) {
  .masthead .top { grid-template-columns: 1fr; gap: 18px; }
  .story-grid { grid-template-columns: 1fr; gap: 8px; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 6px; border: 0; }
  .toc li a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--surface); }
  .toc li a span { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .card { grid-template-columns: 1fr; padding: 14px; }
  .scores { grid-row: auto; grid-column: 1; grid-template-columns: 1fr 1fr; min-width: 0; padding-top: 8px; }
  .filters-toggle { display: inline-block; }
  .filters[hidden-mobile] { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .topbar-in { gap: 6px 14px; padding-top: 8px; padding-bottom: 8px; }
  .topbar nav { order: 3; width: 100%; }
  ol.tl > li { padding-left: 16px; }
  .next { padding-left: 10px; }
}
