:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b665e;
  --rule: #e4e0d8;
  --accent: #7a2e1f;
  --link: #8a3a24;
  --lane: #ece8df;
  --edge: #b9a98f;
  --edge-hi: #7a2e1f;
  --badge-draft: #efe6cc;
  --badge-needs: #f3d9d2;
  --ok: #2f6b3a;
  --k-assembly: #7a2e1f;
  --k-committee: #b0612d;
  --k-presbytery: #2f5d7c;
  --k-church: #3f7a52;
  --k-person: #6d4f8a;
  --k-denomination: #444;
  --k-publication: #8a7a2f;
  --k-organization: #2f7a78;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614; --surface: #1f1e1b; --ink: #ebe7df; --muted: #a39d92; --rule: #34312c;
    --accent: #e08a6c; --link: #eb9a7d; --lane: #3a3630; --edge: #6e6556; --edge-hi: #e08a6c;
    --badge-draft: #4a4126; --badge-needs: #55302a; --ok: #7cc28a;
    --k-assembly: #e08a6c; --k-committee: #e0a46c; --k-presbytery: #7fb2d6; --k-church: #84c49a;
    --k-person: #b89ad6; --k-denomination: #bbb; --k-publication: #d4c27a; --k-organization: #79c6c2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171614; --surface: #1f1e1b; --ink: #ebe7df; --muted: #a39d92; --rule: #34312c;
  --accent: #e08a6c; --link: #eb9a7d; --lane: #3a3630; --edge: #6e6556; --edge-hi: #e08a6c;
  --badge-draft: #4a4126; --badge-needs: #55302a; --ok: #7cc28a;
  --k-assembly: #e08a6c; --k-committee: #e0a46c; --k-presbytery: #7fb2d6; --k-church: #84c49a;
  --k-person: #b89ad6; --k-denomination: #bbb; --k-publication: #d4c27a; --k-organization: #79c6c2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* The background is on html too: body has container-type (containment), which stops the
   body background from filling the canvas. The body fills the window; the footer sits at the bottom. */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.6 var(--serif);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--sans); line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.2em 0 0.4em; }
h2 { font-size: 1.15rem; margin: 2.2em 0 0.8em; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 4rem; }
header.site, footer.site { max-width: 1100px; margin: 0 auto; padding: 1rem 16px; font-family: var(--sans); font-size: 0.9rem; }
header.site { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
header.site nav a { margin-left: 1rem; color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--ink); }
header.site nav { display: flex; align-items: center; flex-wrap: wrap; }
.search-open { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 1rem; padding: 0.25rem 0.5rem 0.25rem 0.6rem;
  font: inherit; font-size: 0.85rem; color: var(--muted); background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; }
.search-open:hover, .search-open:focus-visible { color: var(--ink); border-color: var(--accent); }
.search-open svg { width: 1rem; height: 1rem; }
.search-open kbd, .search-help { font-family: var(--sans); font-size: 0.72rem; color: var(--muted); }
.search-open kbd { padding: 0 0.3rem; border: 1px solid var(--rule); border-radius: 4px; }
@media (max-width: 600px) { .search-open .lbl, .search-open kbd { display: none; } }
dialog.search { width: min(40rem, calc(100vw - 32px)); max-height: min(70vh, 36rem); margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); font-family: var(--sans); overflow: hidden; }
dialog.search[open] { display: flex; flex-direction: column; }
dialog.search::backdrop { background: rgb(0 0 0 / 0.35); }
dialog.search form { margin: 0; border-bottom: 1px solid var(--rule); }
dialog.search input { width: 100%; padding: 0.9rem 1rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; outline: none; }
dialog.search ul { list-style: none; margin: 0; padding: 0.3rem; overflow-y: auto; flex: 1; }
dialog.search li a { display: grid; grid-template-columns: 4rem 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0.6rem;
  border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 0.88rem; line-height: 1.35; }
dialog.search li[aria-selected="true"] a { background: var(--lane); }
dialog.search .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
dialog.search .d { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
dialog.search li.none { padding: 0.8rem 1rem; color: var(--muted); font-size: 0.88rem; }
.search-help { margin: 0; padding: 0.4rem 1rem; border-top: 1px solid var(--rule); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: 0.02em; }
footer.site { color: var(--muted); border-top: 1px solid var(--rule); }
footer.site { display: flex; align-items: center; gap: 1rem; }
footer.site > p:first-child { flex: 1; }
footer.site .repo { margin: 0; flex: none; display: flex; }
footer.site .repo a { display: inline-flex; color: var(--muted); }
footer.site .repo a:hover { color: var(--ink); }
footer.site .repo .ico { width: 1.4rem; height: 1.4rem; }
.correct { margin: 1.5rem 0 0; font-family: var(--sans); font-size: 0.8rem; }
.correct a { color: var(--muted); }
.correct a:hover { color: var(--accent); }
.intro { max-width: 46rem; padding-top: 1.5rem; }
.eyebrow { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.count { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }

.badge { font-family: var(--sans); font-size: 0.7rem; padding: 0.1em 0.5em; border-radius: 999px; margin-left: 0.4em; vertical-align: middle; background: var(--badge-draft); color: var(--ink); }
.badge.needs-citation { background: var(--badge-needs); }
.ok { font-family: var(--sans); font-size: 0.75rem; color: var(--ok); margin-left: 0.4em; }
.ok::before { content: "✓ "; }
.tag { font-family: var(--sans); font-size: 0.8rem; display: inline-block; padding: 0.1em 0.6em; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; margin: 0 0.2em 0.3em 0; }

ol.events { list-style: none; padding: 0; margin: 0; }
.ev { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.ev time { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); padding-top: 0.2em; }
.ev a { text-decoration: none; font-weight: 600; }
.ev a:hover { text-decoration: underline; }
.ev .who { margin: 0.1rem 0 0; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
@media (max-width: 560px) { .ev { grid-template-columns: 1fr; gap: 0.1rem; } }

ul.issues, ul.plain { list-style: none; padding: 0; }
ul.issues > li { margin: 0.4rem 0; }
ul.issues ul { list-style: none; padding-left: 1.2rem; font-size: 0.95rem; }

.event { max-width: 46rem; padding-top: 1.5rem; }
.summary { font-size: 1.15rem; }
dl.facts { display: grid; grid-template-columns: 6rem 1fr; gap: 0.4rem 1rem; font-family: var(--sans); font-size: 0.9rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
ul.citations { list-style: none; padding: 0; font-family: var(--sans); font-size: 0.9rem; }
ul.citations li { margin-bottom: 1rem; }
blockquote { margin: 0 0 0.3rem; padding-left: 1rem; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 1.05rem; }

.narrative { max-width: 46rem; }
.narrative .item-marker { scroll-margin-top: 1rem; }
.narrative .item-events { font-family: var(--sans); font-size: 0.8rem; margin: 0.4rem 0 -0.4rem; }
.narrative .item-events a { margin-right: 0.6rem; }
.footnote { font-size: 0.85rem; color: var(--muted); }

/* timeline */
.timeline { margin: 1.5rem 0 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.tl-tools { display: flex; gap: 0.4rem; align-items: center; padding: 0.5rem; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: 0.8rem; flex-wrap: wrap; }
.tl-tools button { font: inherit; min-width: 2rem; padding: 0.2rem 0.6rem; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); border-radius: 4px; cursor: pointer; }
.tl-hint { color: var(--muted); margin-left: 0.4rem; transition: color 0.2s; }
.tl-hint.flash { color: var(--accent); }
.tl-canvas { position: relative; overflow: hidden; touch-action: pan-y; cursor: grab; }
.tl-canvas:active { cursor: grabbing; }
.tl-canvas.narrow { overflow-x: auto; touch-action: auto; cursor: auto; -webkit-overflow-scrolling: touch; }
.tl-canvas svg { display: block; font-family: var(--sans); }
.lane-line { stroke: var(--lane); stroke-width: 18; stroke-linecap: round; }
.lane-label { font-size: 11px; fill: var(--muted); }
.axis text { fill: var(--muted); font-size: 11px; }
.axis line, .axis path { stroke: var(--rule); }
.edge { fill: none; stroke: var(--edge); stroke-width: 1.4; opacity: 0.8; }
.edge.hi { stroke: var(--edge-hi); stroke-width: 2.4; opacity: 1; }
.edge.dim, .node.dim { opacity: 0.15; }
.node { cursor: pointer; }
.node circle, .node rect { stroke: var(--surface); stroke-width: 1.5; }
.node.sel circle, .node.sel rect { stroke: var(--ink); stroke-width: 2; }
.node .link { stroke: var(--edge); stroke-dasharray: 2 2; }
.node.uncertain circle { stroke-dasharray: 2 1.5; stroke: var(--ink); }
.node:focus { outline: none; }
.node:focus-visible circle { stroke: var(--ink); stroke-width: 2.5; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

/* Desktop: the timeline uses the full window width. */
body { container-type: inline-size; }
@media (min-width: 900px) {
  .timeline { --tl-w: min(100cqw - 32px, 2400px); width: var(--tl-w); margin-left: calc(50% - var(--tl-w) / 2); }
  .issue-filter { --tl-w: min(100cqw - 32px, 2400px); width: var(--tl-w); margin-left: calc(50% - var(--tl-w) / 2); }
}
.cluster { cursor: pointer; }
.cluster circle { stroke: var(--surface); stroke-width: 2; }
.cluster text { font-size: 10px; font-weight: 700; fill: var(--surface); pointer-events: none; }
.cluster.dim { opacity: 0.15; }
.cluster:focus { outline: none; }
.cluster:focus-visible circle { stroke: var(--ink); stroke-width: 2.5; }
.tl-pop { position: absolute; top: 0; left: 0; z-index: 20; width: max-content; max-width: min(26rem, calc(100vw - 16px));
  max-height: min(60vh, 28rem); overflow-y: auto; padding: 0.6rem 0.8rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); color: var(--ink); box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); font-family: var(--sans);
  font-size: 0.85rem; line-height: 1.4; pointer-events: none; }
.tl-pop.pinned { pointer-events: auto; }
.tl-pop[hidden] { display: none; }
.tl-pop .d { display: block; color: var(--muted); font-size: 0.75rem; }
.tl-pop .t { display: block; font-weight: 600; margin: 0.1rem 0 0.2rem; }
.tl-pop .head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.2rem; }
.tl-pop .zoom { white-space: nowrap; font: inherit; font-size: 0.8rem; padding: 0.15rem 0.6rem; border: 1px solid var(--rule); border-radius: 4px;
  background: var(--bg); color: var(--ink); cursor: pointer; }
.tl-pop .zoom:hover { border-color: var(--accent); }
.tl-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.tl-list li { margin: 0 -0.4rem 0.2rem; padding: 0.2rem 0.4rem; border-radius: 4px; }
.tl-pop.pinned .tl-list li.on { background: var(--lane); }
.node.meeting circle { stroke-width: 1.5; }
.node.meeting.sel circle { stroke: var(--ink); }

/* Source browser */
.browser { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; }
.src-list { font-family: var(--sans); font-size: 0.85rem; }
.src-list h2 { font-size: 0.75rem; margin: 1.2rem 0 0.4rem; }
.src-list ul { list-style: none; margin: 0; padding: 0; }
.src-list a { display: block; padding: 0.35rem 0.5rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
.src-list a:hover { background: var(--lane); }
.src-list a[aria-current] { background: var(--lane); box-shadow: inset 3px 0 0 var(--accent); }
.src-list .t { display: block; font-weight: 600; }
.src-list .m { color: var(--muted); font-size: 0.75rem; }
.src-filter { width: 100%; font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); }
.src-pane { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.2rem; min-width: 0; }
.src header h1 { font-size: 1.4rem; margin: 0.2rem 0; }
.src-cites h2 { margin-top: 0.6rem; }
.src-links { font-family: var(--sans); font-size: 0.85rem; margin: 0.2rem 0 0; }
.src-body { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.src-cites ol { list-style: none; padding: 0; margin: 0; font-family: var(--sans); font-size: 0.85rem; }
.src-cites li { padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.src-cites a { font-weight: 600; text-decoration: none; }
.src-cites .d { display: block; color: var(--muted); font-size: 0.75rem; }
.src-cites blockquote { margin-top: 0.3rem; font-size: 0.95rem; }
.pg { font: 600 0.75rem var(--sans); padding: 0.1rem 0.45rem; margin-right: 0.3rem; border-radius: 4px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); }
button.pg { cursor: pointer; }
button.pg:hover, button.pg.on { border-color: var(--accent); color: var(--accent); }
.src-viewer { min-height: 60vh; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); display: flex; }
.src-viewer iframe { flex: 1; width: 100%; min-height: 60vh; border: 0; border-radius: 6px; background: #fff; }
.viewer-empty { margin: auto; padding: 1.5rem; text-align: center; font-family: var(--sans); font-size: 0.9rem; max-width: 26rem; }
.viewer-empty .load { font: inherit; padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); cursor: pointer; }
@media (min-width: 900px) {
  .browser { --br-w: min(100cqw - 32px, 2400px); width: var(--br-w); margin-left: calc(50% - var(--br-w) / 2);
             grid-template-columns: 17rem 1fr; height: calc(100vh - 7rem); }
  .src-list, .src-pane { overflow-y: auto; }
  .src-list { padding-right: 0.4rem; }
  .src, .src-body { height: 100%; }
  .src { display: flex; flex-direction: column; }
  .src-body { flex: 1; min-height: 0; }
}
@media (min-width: 1200px) {
  .src-body { grid-template-columns: minmax(20rem, 26rem) 1fr; }
  .src-cites { overflow-y: auto; padding-right: 0.5rem; }
  .src-viewer, .src-viewer iframe { min-height: 0; height: 100%; }
}

.pageimg { margin: 0.6rem 0 0; }
.pageimg img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
details.pageimg summary { cursor: pointer; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
details.pageimg img { margin-top: 0.4rem; }

/* Source browser, v2: flat list with a sticky active item, hidden scrollbar,
   a ribbon from the active item to its citations, and a preview pane. */
.browser { position: relative; }
.src-list { position: relative; scrollbar-width: none; }
.src-list::-webkit-scrollbar { display: none; }
.src-list .src-item { display: block; border: 1px solid transparent; border-right: 0; border-radius: 6px 0 0 6px; }
.src-list .src-item .t { font-weight: 600; line-height: 1.3; }
.src-list a[aria-current] { position: sticky; top: 0; bottom: 0; z-index: 2; background: var(--surface);
  border-color: var(--rule); box-shadow: inset 3px 0 0 var(--accent); }
.ribbon { position: absolute; pointer-events: none; z-index: 3; overflow: visible; }
.ribbon path { fill: var(--surface); stroke: none; }
.ribbon path.edge { fill: none; stroke: var(--rule); stroke-width: 1; }
li.cite { padding: 0.6rem 0.5rem; border-radius: 6px; }
li.cite.on { background: var(--lane); }
li.cite a.hl { display: block; font-weight: 600; text-decoration: none; }
li.cite a.hl:hover { text-decoration: underline; }
li.cite a.evlink { font-weight: 400; color: var(--muted); }
.src-list [hidden] { display: none; }
.src-viewer { flex-direction: column; overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 0.8rem; }
.vb-label { color: var(--muted); margin-right: auto; }
.viewer-bar .full { font: inherit; padding: 0.25rem 0.7rem; border-radius: 4px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--surface); cursor: pointer; }
.viewer-body { flex: 1; display: flex; min-height: 50vh; overflow: auto; }
/* Page images (110 DPI crops of the page width, 604-935px): keep the aspect ratio, fit the
   pane up to 46rem (the event page width), never below 600px; a narrower pane scrolls. */
.viewer-body img { display: block; flex: none; align-self: flex-start; width: auto; height: auto;
  max-width: min(100% - 1.6rem, 46rem); min-width: 600px;
  margin: 0.8rem auto; border: 1px solid var(--rule); background: #fff; }
.viewer-body iframe { flex: 1; width: 100%; min-height: 60vh; border: 0; background: #fff; }
@media (min-width: 900px) {
  .browser { grid-template-columns: 20rem 1fr; column-gap: 2.5rem; }
  .src-list { padding-right: 0; }
}
@media (min-width: 1200px) {
  .viewer-body, .viewer-body iframe { min-height: 0; }
}
@media (min-width: 1200px) {
  .src-body:not(:has(.src-viewer)) { grid-template-columns: minmax(0, 46rem); }
}

/* Full-width header on every page. */
header.site { max-width: none; margin: 0; padding-inline: 16px; }
/* App layout (source browser): the browser fills the window under the header. */
@media (min-width: 900px) {
  body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.app header.site { flex: none; }
  body.app main { flex: 1; min-height: 0; max-width: none; width: 100%; padding: 16px; display: flex; }
  body.app .browser { width: 100%; height: 100%; margin: 0; }
}
@media (min-width: 900px) {
  /* The ribbon joins the pane's left edge: square corners there. */
  .browser .src-pane { border-top-left-radius: 0; border-bottom-left-radius: 0; }
}
.badge.opinion { background: transparent; border: 1px solid var(--muted); color: var(--muted); }

.kind-filter { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0 0.2rem; }
.kind-filter .kind { font: 600 0.72rem var(--sans); padding: 0.2rem 0.55rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.kind-filter .kind[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.kind-filter .kind:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kind-filter .kind.empty { opacity: 0.35; }

/* Event page: on wide screens, earlier events on the left, responses on the right. */
.ev-rail { display: none; }
@media (min-width: 1200px) {
  /* Rails at most 250px wide, held to the window edges; the event stays centered. */
  .ev-layout { --ev-w: calc(100cqw - 32px); width: var(--ev-w); margin-left: calc(50% - var(--ev-w) / 2);
    display: grid; grid-template-columns: 250px minmax(0, 1fr) 250px; gap: 2rem; align-items: start; }
  .ev-layout .event { max-width: 46rem; width: 100%; justify-self: center; }
  .ev-rail { display: block; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-top: 1.5rem;
    scrollbar-width: thin; }
  .ev-rail h2 { margin: 0.4rem 0 0.6rem; font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .ev-prev h2, .ev-prev > .muted { text-align: left; }
  .ev-next h2, .ev-next > .muted { text-align: right; }
  .ev-rail > .muted { font-family: var(--sans); font-size: 0.8rem; }
  .ev-inline { display: none; }
}
.ev-card { display: block; padding: 0.6rem 0.75rem; margin-bottom: 0.6rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); text-decoration: none; color: var(--ink); font-family: var(--sans); }
.ev-card:hover { border-color: var(--accent); }
.ev-card time { display: block; font-size: 0.75rem; color: var(--muted); }
.ev-card .t { display: block; font-weight: 600; font-size: 0.88rem; line-height: 1.3; color: var(--link); margin: 0.15rem 0; }
.ev-card .who { display: block; font-size: 0.75rem; color: var(--muted); }
.ev-series { margin-bottom: 1.4rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--rule); }
.ev-rail .ev-series .ev-card { border-left-width: 1px; border-right-width: 1px; }
.ev-series-inline { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; font-family: var(--sans); font-size: 0.85rem; }
@media (min-width: 1200px) { .ev-series-inline { display: none; } }
.ev-prev .ev-card { border-right: 3px solid var(--edge); }
.ev-next .ev-card { border-left: 3px solid var(--edge); }

ul.links { list-style: none; padding: 0; margin: 0.2rem 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
ul.links a { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); text-decoration: none; }
ul.links a:hover, ul.links a:focus-visible { border-color: var(--accent); color: var(--accent); }
ul.links .ico { width: 1.1rem; height: 1.1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Home: issue chips above the timeline (filters). */
.issue-filter { margin-top: 0.4rem; margin-bottom: 0.8rem; font-family: var(--sans); font-size: 0.82rem; }
.issue-filter .chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.issue-filter .chips.sub { margin-top: 0.4rem; padding-left: 0.8rem; border-left: 2px solid var(--rule); }
.issue-filter .chips[hidden], .tl-tools .tl-issue[hidden], li.ev[hidden] { display: none; }
.chip { font: inherit; padding: 0.2rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg);
  color: var(--ink); cursor: pointer; }
.chip .count { color: var(--muted); font-size: 0.75rem; margin-left: 0.15rem; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.chip[aria-pressed="true"] .count { color: inherit; opacity: 0.8; }
.chip[aria-pressed="mixed"] { border-color: var(--accent); color: var(--accent); }
.tl-tools .tl-issue { margin-left: auto; padding-right: 0.3rem; white-space: nowrap; }
.tl-tools .tl-issue:not([href]) { color: var(--muted); }

/* Header "Issues" menu: a full-width panel under the header. */
header.site { position: relative; }
.mega-open { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; margin-left: 1rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.2rem; }
.mega-open:hover, .mega-open[aria-expanded="true"] { color: var(--ink); }
.mega-open svg { width: 1em; height: 1em; transition: transform 0.15s; }
.mega-open[aria-expanded="true"] svg { transform: rotate(180deg); }
.mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--rule); box-shadow: 0 12px 24px rgb(0 0 0 / 0.08); padding: 1rem 16px 1.25rem; max-height: calc(100dvh - 4rem); overflow-y: auto; }
.mega[hidden] { display: none; }
/* Newspaper columns: at most 4; the groups flow down each column, and a group never splits. */
.mega-grid { columns: 15rem 4; column-gap: 2rem; max-width: 2400px; margin: 0 auto; }
.mega section { break-inside: avoid; margin-bottom: 1.25rem; }
.mega a { color: var(--ink); text-decoration: none; margin: 0; }
.mega a:hover { color: var(--link); text-decoration: underline; }
.mega-top { display: block; font-weight: 600; padding-bottom: 0.3rem; margin-bottom: 0.35rem; border-bottom: 1px solid var(--rule); }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega li { margin: 0.2rem 0; line-height: 1.35; }
.mega li ul { padding-left: 0.9rem; border-left: 1px solid var(--rule); margin: 0.2rem 0 0.3rem 0.2rem; }
.mega li ul a { color: var(--muted); }
.mega .count { margin-left: 0.2rem; }
/* Desktop: the menu covers the right two thirds of the page, under the Issues button. */
@media (min-width: 900px) {
  .mega { left: auto; width: calc(100% * 2 / 3); border-left: 1px solid var(--rule); border-bottom-left-radius: 8px; }
}

/* Event rails: "Related" (same issues, nearest in time) as a compact list under Responses. */
.ev-related { margin-top: 1.25rem; }
.ev-related ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.8rem; line-height: 1.35; }
.ev-related li { margin: 0 0 0.55rem; }
.ev-related a { color: var(--ink); text-decoration: none; }
.ev-related a:hover { color: var(--link); text-decoration: underline; }
.ev-related time { display: block; color: var(--muted); font-size: 0.75rem; }
