/* Provenance gaps portal.
   Archive-box palette: grey-green paper, blue-black ink, box-board blue for structure.
   Oxblood is reserved for one thing only: the undocumented years. */

:root {
  --paper: #EEF1EC;
  --surface: #F8F9F6;
  --sunk: #E4E8E2;
  --ink: #1B2230;
  --ink-2: #465163;
  --muted: #5F6977;
  --rule: #C6CCC4;
  --rule-soft: #D9DED6;
  --box: #335675;
  --box-weak: #DCE4EA;
  --gap: #7D2433;
  --gap-band: #E9DCDA;
  --focus: #335675;
  --shadow: 0 1px 0 rgba(27, 34, 48, .06);

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --s-1: 0.8125rem;   /* 13 */
  --s0: 1rem;         /* 16 */
  --s1: 1.25rem;      /* 20 */
  --s2: 1.5625rem;    /* 25 */
  --s3: 1.953rem;     /* 31 */
  --s4: 2.441rem;     /* 39 */

  --measure: 68ch;
  --radius-s: 3px;
  --radius-m: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12161B;
    --surface: #191E25;
    --sunk: #0E1115;
    --ink: #E3E7EB;
    --ink-2: #B4BCC6;
    --muted: #8C96A3;
    --rule: #2E353E;
    --rule-soft: #242A32;
    --box: #8EB1CF;
    --box-weak: #22303D;
    --gap: #E58A93;
    --gap-band: #3A2328;
    --focus: #8EB1CF;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12161B;
  --surface: #191E25;
  --sunk: #0E1115;
  --ink: #E3E7EB;
  --ink-2: #B4BCC6;
  --muted: #8C96A3;
  --rule: #2E353E;
  --rule-soft: #242A32;
  --box: #8EB1CF;
  --box-weak: #22303D;
  --gap: #E58A93;
  --gap-band: #3A2328;
  --focus: #8EB1CF;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--s0);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: var(--box); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: var(--s3); }
h2 { font-size: var(--s2); }
h3 { font-size: var(--s1); }
p { margin: 0 0 1em; max-width: var(--measure); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 12px; flex: none; }
.brand-mark path { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.brand-mark .gapline { stroke: var(--gap); stroke-dasharray: 1.5 2.5; stroke-linecap: butt; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
#lab-name { font-size: var(--s-1); color: var(--muted); }
.brand-project { font-family: var(--serif); font-size: 1.125rem; font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: var(--radius-s); }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.theme-toggle { background: none; border: 1px solid var(--rule); border-radius: var(--radius-s); width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 1.5; stroke-linecap: round; }
.storage-warning { background: var(--gap-band); color: var(--ink); padding: 10px 16px; text-align: center; font-size: var(--s-1); }

main { max-width: 1240px; margin: 0 auto; padding: 32px 16px 64px; outline: none; }
.footer { border-top: 1px solid var(--rule); max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; color: var(--muted); font-size: var(--s-1); }
.footer p { margin: 0 0 4px; max-width: none; }
.footer a { color: var(--muted); }

/* ---------- Overview ---------- */
.lede { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 28px; }
.lede h1 { font-size: var(--s4); max-width: 24ch; font-weight: 400; }
.lede p { font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); margin-top: 8px; }

.silence { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 20px 20px 12px; margin-bottom: 40px; box-shadow: var(--shadow); }
.silence-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.silence-head h2 { font-size: var(--s1); }
.silence-note { color: var(--muted); font-size: var(--s-1); margin: 0 0 8px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.chart .axis line, .chart .grid line { stroke: var(--rule-soft); stroke-width: 1; }
.chart .band { fill: var(--gap-band); }
.chart .band-label { fill: var(--gap); font-size: 12px; font-family: var(--sans); }
.chart .area { fill: var(--gap); opacity: .14; }
.chart .line { fill: none; stroke: var(--gap); stroke-width: 2; stroke-linejoin: round; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .bar-before { fill: var(--ink-2); }
.chart .bar-after { fill: var(--gap); }
.chart .bar-hit { fill: transparent; }
.chart .bar-hit:hover + .bar-hl, .chart .bar-hl { pointer-events: none; }
.chart .cluster-label { fill: var(--ink); font-size: 13px; font-family: var(--sans); font-weight: 500; }
.chart .cluster-sub { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.silence-foot { color: var(--muted); font-size: var(--s-1); margin: 8px 0 0; }
.chart .dot { fill: var(--gap); stroke: var(--surface); stroke-width: 2; }

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; }
.seg button { background: none; border: 0; padding: 4px 10px; font-size: var(--s-1); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.two-up { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; }
.panel h2 { font-size: var(--s1); margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: var(--s-1); margin-bottom: 16px; }

.funnel { list-style: none; padding: 0; margin: 0; }
.funnel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
.funnel li:first-child { border-top: 0; }
.funnel .f-label { font-size: 0.9375rem; color: var(--ink-2); }
.funnel .f-n { font-weight: 600; text-align: right; }
.funnel .f-bar { grid-column: 1 / -1; height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.funnel .f-bar span { display: block; height: 100%; background: var(--ink-2); border-radius: 0 4px 4px 0; min-width: 2px; }
.funnel li:last-child .f-bar span { background: var(--gap); }

.names { list-style: none; padding: 0; margin: 0; columns: 1; }
.names li { border-top: 1px solid var(--rule-soft); }
.names li:first-child { border-top: 0; }
.names button { width: 100%; background: none; border: 0; padding: 8px 4px; display: grid; grid-template-columns: minmax(0, 1fr) 120px 36px; align-items: center; gap: 12px; text-align: left; cursor: pointer; border-radius: var(--radius-s); }
.names button:hover { background: var(--sunk); }
.names .n-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.names .n-kind { color: var(--muted); font-size: var(--s-1); margin-left: 6px; }
.names .n-bar { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.names .n-bar span { display: block; height: 100%; background: var(--box); border-radius: 0 3px 3px 0; }
.names .n-count { text-align: right; color: var(--ink-2); font-size: 0.9375rem; }

details.table-view { margin-top: 8px; }
details.table-view summary { cursor: pointer; color: var(--box); font-size: var(--s-1); }
.data-table { border-collapse: collapse; font-size: var(--s-1); margin-top: 8px; }
.data-table th, .data-table td { padding: 4px 12px 4px 0; text-align: right; border-bottom: 1px solid var(--rule-soft); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--muted); font-weight: 500; }

/* ---------- Leads ---------- */
.leads-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.filters { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.filters legend { font-weight: 600; font-size: 0.875rem; margin-bottom: 6px; padding: 0; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; color: var(--ink-2); cursor: pointer; }
.filters label .cnt { margin-left: auto; color: var(--muted); font-size: var(--s-1); }
.filters input[type="checkbox"], .filters input[type="radio"] { accent-color: var(--box); width: 15px; height: 15px; margin: 0; }
.field { width: 100%; border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius-s); padding: 8px 10px; }
.field:focus-visible { outline-offset: 0; }
.search-label { font-weight: 600; font-size: 0.875rem; display: block; margin-bottom: 6px; }
.filters-toggle { display: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--box); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: var(--s-1); }

.results-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.results-head h1 { font-size: var(--s2); }
.results-count { color: var(--muted); }
.results-head .sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: var(--s-1); color: var(--muted); }
.results-head .sort select { width: auto; padding: 4px 8px; font-size: 0.875rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--box); color: var(--box); background: var(--box-weak); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: var(--s-1); }
.chip button { background: none; border: 0; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.chip button:hover { background: var(--surface); }

.strip-key { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: var(--s-1); margin: 0 0 8px; }
.strip-key span { display: inline-flex; align-items: center; gap: 6px; }
.strip-key svg { width: 22px; height: 10px; }

.lead-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.lead { border-bottom: 1px solid var(--rule); }
.lead a { display: grid; grid-template-columns: 52px minmax(0, 1fr) 210px 64px 104px; gap: 16px; align-items: center; padding: 10px 4px; color: inherit; text-decoration: none; }
.lead a:hover { background: var(--surface); }
.thumb { width: 52px; height: 52px; border-radius: var(--radius-s); background: var(--sunk); object-fit: cover; display: block; }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.1; }
.lead .l-text, .lead .l-strip { min-width: 0; display: block; }
.lead .l-title, .lead .l-meta { display: block; }
.lead .l-title { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lead .l-meta { color: var(--muted); font-size: var(--s-1); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead .l-strip svg { width: 100%; height: 22px; display: block; }
.lead .l-years { color: var(--muted); font-size: 11px; display: flex; justify-content: space-between; }
.tier { display: inline-grid; place-items: center; min-width: 26px; height: 22px; border-radius: var(--radius-s); border: 1px solid var(--rule); font-size: var(--s-1); font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.tier[data-tier="A"] { border-color: var(--gap); color: var(--gap); }
.triage-pill { font-size: var(--s-1); color: var(--muted); white-space: nowrap; }
.triage-pill[data-s] { color: var(--ink); }
.triage-pill[data-s]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ink-2); vertical-align: 1px; }
.triage-pill[data-s="research"]::before { background: var(--gap); }
.triage-pill[data-s="cleared"]::before { background: var(--box); }
.triage-pill[data-s="parser"]::before { background: var(--muted); }
.triage-pill[data-s="referred"]::before { background: var(--ink); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pager button { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 6px 14px; cursor: pointer; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager span { color: var(--muted); font-size: var(--s-1); }
.empty-state { padding: 40px 0; color: var(--ink-2); }

/* gap strip (shared) */
.gs-base { stroke: var(--rule); stroke-width: 1; }
.gs-track { stroke: var(--ink-2); stroke-width: 1.5; }
.gs-band { fill: var(--gap-band); }
.gs-gap { stroke: var(--gap); stroke-width: 2; stroke-dasharray: 2 3; }
.gs-dot { fill: var(--ink); }
.gs-dot.eu { fill: var(--ink); }
.gs-acq { stroke: var(--box); stroke-width: 2; }
.gs-made { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }

/* ---------- Object ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 24px; font-size: 0.9375rem; }
.crumbs .spacer { margin-left: auto; display: flex; gap: 8px; }
.crumbs .spacer a, .crumbs .spacer span { padding: 4px 10px; border: 1px solid var(--rule); border-radius: var(--radius-s); text-decoration: none; color: var(--ink-2); background: var(--surface); }
.crumbs .spacer span { opacity: .45; }
.object { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 40px; align-items: start; }
.object-side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 84px; }
.object-img { width: 100%; border-radius: var(--radius-m); background: var(--sunk); display: block; aspect-ratio: auto; }
.object-img.empty { aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--muted); font-size: var(--s-1); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 0.9375rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.links { display: flex; flex-direction: column; gap: 4px; font-size: 0.9375rem; }

.review { border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); padding: 16px; }
.review h2 { font-size: var(--s0); font-family: var(--sans); font-weight: 600; margin-bottom: 10px; }
.review fieldset { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.review legend { position: absolute; left: -999px; }
.review label { display: flex; gap: 8px; align-items: center; font-size: 0.9375rem; cursor: pointer; }
.review input[type="radio"] { accent-color: var(--box); margin: 0; }
.review textarea { width: 100%; min-height: 110px; resize: vertical; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--paper); padding: 8px 10px; line-height: 1.45; }
.review .saved { color: var(--muted); font-size: var(--s-1); margin-top: 6px; min-height: 1.2em; }

.object-main h1 { font-size: var(--s4); font-weight: 400; max-width: 22ch; }
.object-main .byline { font-family: var(--serif); font-size: var(--s1); color: var(--ink-2); margin: 6px 0 24px; }
.why { border-left: 3px solid var(--gap); padding: 2px 0 2px 16px; margin: 0 0 28px; }
.why h2 { font-family: var(--sans); font-size: var(--s0); font-weight: 600; margin-bottom: 4px; }
.why p { margin: 0 0 6px; color: var(--ink-2); }
.timeline { margin: 0 0 32px; }
.timeline h2, .chain h2, .museum-notes h2 { font-family: var(--sans); font-size: var(--s0); font-weight: 600; margin-bottom: 8px; }
#big-strip svg { width: 100%; height: auto; display: block; overflow: visible; }
.timeline .axis text { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.timeline .axis line { stroke: var(--rule); }
.timeline .ev-hit { fill: transparent; cursor: pointer; }
.timeline .ev-hit:focus-visible { outline: none; stroke: var(--focus); stroke-width: 2; }

.chain ol { margin: 0; padding: 0; list-style: none; counter-reset: ev; }
.chain li > span { min-width: 0; }
.chain li { counter-increment: ev; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--rule-soft); font-family: var(--serif); font-size: 1.0625rem; line-height: 1.6; max-width: 76ch; }
.chain li::before { content: counter(ev); color: var(--muted); font-family: var(--sans); font-size: var(--s-1); padding-top: 4px; text-align: right; padding-right: 6px; }
.chain li.in-gap { background: linear-gradient(90deg, var(--gap-band), transparent 70%); }
.chain li.in-gap::before { color: var(--gap); font-weight: 600; }
.chain .yr { font-weight: 600; }
.chain .yr.win { color: var(--gap); }
.chain .place { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
.chain-key { color: var(--muted); font-size: var(--s-1); margin-bottom: 8px; }
.chain-key .k-gap { display: inline-block; width: 18px; height: 10px; background: var(--gap-band); border-left: 2px solid var(--gap); vertical-align: -1px; margin-right: 4px; }
.museum-notes { margin-top: 28px; }
.museum-notes summary { cursor: pointer; color: var(--box); }
.museum-notes pre { white-space: pre-wrap; font-family: var(--serif); font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); max-width: 76ch; }
.ctx-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ctx-list span { border: 1px solid var(--rule); border-radius: 999px; padding: 1px 10px; font-size: var(--s-1); color: var(--ink-2); }

/* ---------- Method & research ---------- */
.prose { max-width: var(--measure); }
.prose h1 { margin-bottom: 16px; }
.prose h2 { margin: 36px 0 10px; font-size: var(--s2); }
.prose p, .prose li { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.65; }
.prose ol, .prose ul { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 500; }
.prose td.num, .prose th.num { text-align: right; }
.callout { border-left: 3px solid var(--gap); padding: 4px 0 4px 16px; margin: 20px 0; }

.research-head { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 20px; }
.research-head h1 { margin-right: auto; }
.btn { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 7px 14px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.danger { color: var(--gap); }
.tallies { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 24px; padding: 0; list-style: none; }
.tallies li { display: flex; flex-direction: column; }
.tallies .t-n { font-family: var(--serif); font-size: var(--s3); line-height: 1.1; }
.tallies .t-l { color: var(--muted); font-size: var(--s-1); }
.notes-cell { color: var(--ink-2); font-size: 0.9375rem; max-width: 60ch; white-space: pre-wrap; }
.research-table { width: 100%; border-collapse: collapse; }
.research-table th, .research-table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.research-table th { color: var(--muted); font-weight: 500; font-size: var(--s-1); }
.research-table td:first-child a { font-family: var(--serif); font-size: 1.0625rem; }

/* ---------- v0.4: trace, verdicts, precision, changes ---------- */
.muted { color: var(--muted); }
.small { font-size: var(--s-1); }
.nowrap { white-space: nowrap; }
.tier-key { display: inline-grid; place-items: center; min-width: 18px; font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--rule); border-radius: 2px; }
.vs-mark { color: var(--box); }
.change-note { margin: 10px 0 0; font-size: var(--s-1); color: var(--ink-2); }
.why .change-note { padding-top: 8px; border-top: 1px dashed var(--rule); }

.trace { margin: -12px 0 28px; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); }
.trace summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 0.9375rem; }
.trace summary .trace-n { font-weight: 400; color: var(--muted); font-size: var(--s-1); margin-left: 6px; }
.trace ol { list-style: none; margin: 0; padding: 0 14px 4px; }
.trace li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule-soft); font-size: 0.9375rem; color: var(--ink-2); }
.trace-foot { margin: 0; padding: 8px 14px 12px; font-size: var(--s-1); color: var(--muted); }
code.rule { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; color: var(--box); background: var(--box-weak); border-radius: var(--radius-s); padding: 1px 5px; justify-self: start; align-self: start; white-space: nowrap; }

.chain .link-note { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.nonyear { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); text-decoration-thickness: 1px; }
.chain .nonyear { font-weight: 400; }

.rev-sub { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin: 4px 0 2px; }
.rev-help { color: var(--muted); font-size: var(--s-1); margin: 0 0 8px; }

.method .small, .prose p.small { font-size: var(--s-1); font-family: var(--sans); color: var(--muted); }
.prose .ci, .ci { color: var(--muted); font-size: 12px; white-space: nowrap; }
.prose tr.total td { font-weight: 600; border-top: 2px solid var(--rule); }
.prose .rules td:nth-child(2) { font-size: 0.875rem; color: var(--ink-2); }
.table-wrap { overflow-x: auto; max-width: 100%; }
.prose .btn { text-decoration: none; display: inline-block; font-family: var(--sans); font-size: 0.9375rem; }

.lede-s { color: var(--ink-2); max-width: 80ch; margin-bottom: 20px; }
.change-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 16px; }
.seg a { display: inline-block; padding: 4px 10px; font-size: var(--s-1); color: var(--ink-2); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--rule); }
.seg a[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg a[aria-pressed="true"] .muted { color: var(--paper); opacity: .7; }
.change-table tr.reviewed td:first-child { box-shadow: inset 3px 0 0 var(--box); padding-left: 8px; }
.change-table .tier { min-width: 22px; height: 20px; }

/* ---------- v0.5: names, red flags, cross-references, journey map ---------- */
.flag-badge { display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .01em; line-height: 1; padding: 3px 6px; border-radius: var(--radius-s); background: var(--ink); color: var(--paper); vertical-align: 1px; white-space: nowrap; margin-left: 4px; }
.flag-badge.prov { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.flag-badge.ccp { background: var(--box-weak); color: var(--box); box-shadow: none; }
.flag-line { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--rule); font-size: 0.9375rem; }
.flag-line .flag-badge { margin-left: 0; }
.flag-panel { border: 1px solid var(--ink); border-radius: var(--radius-m); padding: 12px 14px 4px; margin: 16px 0; max-width: 76ch; background: var(--surface); }
.flag-panel p { font-size: 0.9375rem; margin-bottom: 8px; }
.flag-panel .flag-badge { margin-left: 0; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; }
.l-extra { color: var(--ink-2); }
.l-flags { display: block; margin-top: 3px; }
.l-flags .flag-badge { margin: 0 4px 0 0; }
.gap-mark { color: var(--gap); font-weight: 600; }
.sec-h { font-family: var(--sans); font-size: var(--s0); font-weight: 600; margin: 28px 0 8px; }

.people { margin-top: 28px; }
.people h2, .journey h2, .xref h2, .merge h2, .holdings h2 { font-family: var(--sans); font-size: var(--s0); font-weight: 600; margin-bottom: 8px; }
.people ol { list-style: none; margin: 0; padding: 0; max-width: 76ch; }
.people li { padding: 8px 0 8px 10px; border-top: 1px solid var(--rule-soft); border-left: 3px solid transparent; }
.people li.in-gap { border-left-color: var(--gap); background: linear-gradient(90deg, var(--gap-band), transparent 70%); }
.people li a { font-family: var(--serif); font-size: 1.0625rem; }
.people li .muted { display: block; }

.journey { margin: 0 0 32px; }
.jmap svg { width: 100%; height: auto; display: block; border-radius: var(--radius-m); }
.jm-sea { fill: var(--surface); }
.jm-land { fill: var(--sunk); stroke: var(--rule); stroke-width: .6; }
.jm-leg { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.jm-leg.gap { stroke: var(--gap); stroke-width: 2; stroke-dasharray: 3 3; }
.jm-arrow { fill: var(--ink-2); }
.jm-arrow.gap { fill: var(--gap); }
.jm-node rect { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.jm-node.gap rect { fill: var(--gap); }
.jm-node.region rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.jm-node.region.gap rect { stroke: var(--gap); }
.jm-num { fill: var(--paper); font: 600 11px var(--sans); }
.jm-node.region .jm-num { fill: var(--ink); }
.jm-node.region.gap .jm-num { fill: var(--gap); }
.jm-name { fill: var(--ink); font: 500 12px var(--sans); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.jm-node:focus-visible rect { stroke: var(--focus); stroke-width: 3; }
.jm-list { font-size: var(--s-1); color: var(--ink-2); }
.chain-key .k-gapline { display: inline-block; width: 18px; height: 0; border-top: 2px dashed var(--gap); vertical-align: 3px; margin: 0 2px 0 4px; }

.xref { margin-top: 28px; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); padding: 16px; max-width: 76ch; }
.xref .field { max-width: 520px; }
.xref-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.btn.small { padding: 5px 10px; font-size: 0.875rem; }
.xref-note { color: var(--muted); font-size: var(--s-1); margin: 4px 0 0; }

.profile-head h1 { font-size: var(--s4); font-weight: 400; max-width: 26ch; }
.profile-head .byline { font-family: var(--serif); font-size: var(--s1); color: var(--ink-2); margin: 6px 0 12px; }
.alts { font-size: 0.9375rem; color: var(--ink-2); }
.links-inline { display: flex; gap: 16px; font-size: 0.9375rem; }
.links-inline:empty { display: none; }
.holdings { margin: 8px 0 24px; }
.hc-bar { stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; }
.hc-bar.gap { stroke: var(--gap); }
.hc-dot { fill: var(--ink-2); }
.hc-dot.gap { fill: var(--gap); }
.holdings .band-label { fill: var(--gap); font-size: 12px; font-family: var(--sans); }
.holdings .axis text { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.profile-tools { margin-top: 32px; align-items: start; }
.profile-tools .xref { margin-top: 0; }
.merge { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 16px; }
.merge .field { margin-bottom: 8px; }
.merged { list-style: none; padding: 0; margin: 12px 0 0; font-size: var(--s-1); }
.names-q { max-width: 280px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; color: var(--ink-2); }
.check input { accent-color: var(--box); }
.names-table td.num, .names-table th.num { text-align: right; }
.names-table .flag-badge { margin-left: 0; }
.pager a.btn { text-decoration: none; }
.pager a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.prose code { font-size: 0.875em; }

/* ---------- v0.6: case files, annotations, memo ---------- */
.case { margin-top: 32px; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); padding: 18px 18px 12px; max-width: 80ch; }
.case h2 { font-family: var(--sans); font-size: var(--s1); font-weight: 600; }
.case-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.case-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.case-actions a.btn { text-decoration: none; }
.case-sub { font-family: var(--sans); font-size: var(--s0); font-weight: 600; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--rule-soft); }
.case-q { width: 100%; resize: vertical; line-height: 1.45; }
.case textarea.field { resize: vertical; line-height: 1.45; }
.src-list { margin: 0 0 8px; padding-left: 1.6em; }
.src-list li { padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.src-list li:first-child { border-top: 0; }
.src-cite { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.45; }
.src-meta { font-size: var(--s-1); color: var(--muted); margin-top: 2px; }
.src-list blockquote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--rule); font-family: var(--serif); color: var(--ink-2); }
.src-note { font-size: 0.9375rem; color: var(--ink-2); margin: 4px 0; }
.row-actions { font-size: var(--s-1); display: flex; gap: 12px; margin-top: 2px; }
.bearing { font-weight: 600; color: var(--ink-2); }
.bearing[data-b="supports"] { color: var(--box); }
.bearing[data-b="contradicts"] { color: var(--ink); text-decoration: underline; }
.case-form { margin: 6px 0 4px; }
.case-form summary { cursor: pointer; color: var(--box); font-size: 0.9375rem; padding: 4px 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.grid-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--s-1); font-weight: 600; color: var(--ink-2); }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .field { font-weight: 400; font-size: 0.9375rem; }
.src-pick { border: 1px solid var(--rule-soft); border-radius: var(--radius-s); padding: 8px 10px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.src-pick legend { font-size: var(--s-1); font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.src-pick label { flex-direction: row; align-items: center; font-weight: 400; gap: 8px; }
.src-pick input, .task-list input { accent-color: var(--box); }
.form-actions { display: flex; align-items: center; gap: 14px; }
.ann-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin-bottom: 6px; }
.ann-table th, .ann-table td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.ann-table th { color: var(--muted); font-weight: 500; font-size: var(--s-1); }
.conf[data-c="documented"] { color: var(--box); font-weight: 600; }
.conf[data-c="probable"], .conf[data-c="possible"] { color: var(--ink-2); font-style: italic; }
.task-list { list-style: none; padding: 0; margin: 0 0 8px; }
.task-list li { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 0.9375rem; }
.task-list .done { text-decoration: line-through; color: var(--muted); }
.task-add { display: flex; gap: 8px; }
.case-foot { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 0; font-size: var(--s-1); max-width: none; }
.linkish.danger { color: var(--gap); }
.case-mark { display: block; font-size: 11px; color: var(--box); margin-top: 2px; }
/* annotation lanes on the big timeline */
.an-title { fill: var(--muted); font: 600 11px var(--sans); }
.an-bar { stroke: var(--box); stroke-width: 6; stroke-linecap: round; }
.an-bar.probable { stroke-dasharray: 8 4; stroke-linecap: butt; }
.an-bar.possible { stroke-dasharray: 2 4; stroke-linecap: butt; }
.an-pt { fill: var(--box); }
.an-pt.probable, .an-pt.possible { fill: none; stroke: var(--box); stroke-width: 2; }
.an-label { fill: var(--ink-2); font: 12px var(--sans); }
/* memo */
.memo { max-width: 76ch; }
.memo h1 { font-size: var(--s3); margin-bottom: 8px; }
.memo h2 { font-size: var(--s1); margin: 28px 0 8px; }
.memo h3 { font-family: var(--sans); font-size: var(--s0); font-weight: 600; margin: 20px 0 6px; }
.memo blockquote { margin: 12px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--gap); color: var(--ink-2); font-family: var(--serif); }
.memo .sub-note { font-size: 0.9375rem; color: var(--ink-2); margin: 0 0 6px; }
.memo hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0 10px; }
.memo table { font-size: 0.875rem; display: block; overflow-x: auto; max-width: 100%; }
.memo { overflow-wrap: anywhere; }
@media print {
  .topbar, .footer, .no-print, .skip, .storage-warning { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .memo { max-width: none; }
  .memo a { color: #000; }
}
@media (max-width: 720px) {
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .case-actions { margin-left: 0; }
  .ann-table thead { display: none; }
  .ann-table tr { display: block; border-bottom: 1px solid var(--rule-soft); padding: 6px 0; }
  .ann-table td { display: inline-block; border: 0; padding: 2px 8px 2px 0; }
}

/* ---------- v0.7: museums, acquisitions ---------- */
.mu-seg { margin: 4px 0 6px; align-self: start; justify-self: start; }
.mu-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--box); border: 1px solid var(--box-weak); background: var(--box-weak); border-radius: 2px; padding: 0 4px; margin-right: 2px; }
.acq-a { fill: var(--ink); }
.acq-o { fill: var(--box); opacity: .55; }
.donors-table td.num, .donors-table th.num { text-align: right; }

/* ---------- v0.8: cite, figures, letters, AI verdicts, print ---------- */
.fig-actions { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; white-space: nowrap; }
.fig-actions .linkish { font-size: 12px; }
.cite { margin-top: 20px; max-width: 76ch; }
.cite summary { cursor: pointer; color: var(--box); font-size: 0.9375rem; }
.cite-tabs { margin: 10px 0 8px; }
.cite-out { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 10px 12px; font: 13px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 8px; }
.ai-verdict { font-size: 0.9375rem; margin: 0 0 8px; padding: 6px 8px; background: var(--box-weak); border-radius: var(--radius-s); }
.letter { max-width: 80ch; }
.letter h1 { margin-bottom: 6px; }
.letter-text { width: 100%; font: 0.9375rem/1.55 var(--serif); resize: vertical; margin: 10px 0; }
.letter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .letter-print { white-space: pre-wrap; font: 11pt/1.5 var(--serif); border: 0; }
}

/* ---------- Tooltip ---------- */
.tooltip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: var(--paper); padding: 8px 10px; border-radius: var(--radius-s); font-size: var(--s-1); max-width: 340px; line-height: 1.4; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.tooltip strong { font-weight: 600; }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
  .two-up { grid-template-columns: minmax(0, 1fr); }
  .leads-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; display: none; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); }
  .filters.open { display: flex; }
  .filters-toggle { display: inline-block; }
  .object { grid-template-columns: minmax(0, 1fr); }
  .object-side { position: static; order: 2; }
  .object-main { order: 1; }
  .object-img { max-width: 420px; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .theme-toggle { margin-left: auto; }
  .lede h1, .object-main h1 { font-size: var(--s3); }
  .lead a { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "img text tier" "img strip pill"; gap: 6px 12px; }
  .lead .l-img { grid-area: img; }
  .lead .l-text { grid-area: text; }
  .lead .l-strip { grid-area: strip; }
  .lead .l-tier { grid-area: tier; }
  .lead .l-pill { grid-area: pill; }
  .names button { grid-template-columns: minmax(0, 1fr) 70px 32px; }
  .research-table thead { display: none; }
  .research-table tr { display: block; border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .research-table td { display: block; border: 0; padding: 2px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .gs-gap, .chart .line { stroke: Highlight; }
}
.prose a, .prose code { overflow-wrap: anywhere; }

/* ---------- v0.9: public website ---------- */
.status-banner { background: var(--box-weak); color: var(--ink); padding: 9px 16px; text-align: center; font-size: var(--s-1); border-bottom: 1px solid var(--rule); }
.status-banner a { color: var(--box); }
.status-callout { border-left-color: var(--box); background: var(--surface); padding: 10px 16px; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.status-callout p { margin: 0; }
.about table td:last-child { white-space: nowrap; font-family: var(--sans); font-size: 0.9375rem; }
.byline-card { font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; border-left: 3px solid var(--box); padding-left: 12px; }

/* v0.11 Volunteer page */
.volunteer .vol-intro { font-size: 1.125rem; }
.vol-jump { font-family: var(--sans); font-size: 0.9375rem; }
.vol-role { border-top: 1px solid var(--rule); margin-top: 28px; padding-top: 4px; scroll-margin-top: 80px; }
.vol-role h3 { font-family: var(--sans); font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); margin: 18px 0 6px; }
.vol-meta { font-family: var(--sans); font-size: 0.875rem; color: var(--ink-2); margin-top: -6px; }
a.btn.vol-apply { display: inline-block; text-decoration: none; font-family: var(--sans); font-size: 0.9375rem; overflow-wrap: anywhere; }
.vol-cta { margin-top: 32px; background: var(--surface); border-left-color: var(--box); padding: 12px 18px; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.vol-cta h2 { margin-top: 4px; }
