/* Tokens. Light is the default; dark follows the system unless the reader picks one. */
:root {
  --bg: #fbfaf6; --surface: #ffffff; --ink: #1d1c1a; --muted: #5f5c55; --line: #ddd8cc;
  --accent: #0d5c58; --accent-ink: #ffffff; --banner-bg: #fff4d6; --banner-ink: #4a3500; --banner-line: #e2c36a;
  --ok-bg: #e2f1e6; --ok-ink: #17603a; --part-bg: #fbecc8; --part-ink: #7a4e00;
  --cond-bg: #ebe9f0; --cond-ink: #4b4760; --other-bg: #e1ebf8; --other-ink: #1c4c8c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --surface: #1e1e1c; --ink: #ebe8e0; --muted: #a8a399; --line: #38362f;
    --accent: #72cbc3; --accent-ink: #0b2b29; --banner-bg: #33290c; --banner-ink: #f5dfa0; --banner-line: #6b5518;
    --ok-bg: #153524; --ok-ink: #8fdcae; --part-bg: #3a2c08; --part-ink: #f0c869;
    --cond-bg: #2c2a37; --cond-ink: #c5c0dc; --other-bg: #16283f; --other-ink: #9cc3f5;
  }
}
:root[data-theme="dark"] {
  --bg: #151514; --surface: #1e1e1c; --ink: #ebe8e0; --muted: #a8a399; --line: #38362f;
  --accent: #72cbc3; --accent-ink: #0b2b29; --banner-bg: #33290c; --banner-ink: #f5dfa0; --banner-line: #6b5518;
  --ok-bg: #153524; --ok-ink: #8fdcae; --part-bg: #3a2c08; --part-ink: #f0c869;
  --cond-bg: #2c2a37; --cond-ink: #c5c0dc; --other-bg: #16283f; --other-ink: #9cc3f5;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.6 var(--sans); }
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 2rem 0 1rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
p, li, dd { max-width: 44rem; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.3em; }
.muted { color: var(--muted); }
.lede { font-size: 1.1rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--ink); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.theme-toggle, button, .button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 0.35rem 0.8rem; }
.button, button[type="submit"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); text-decoration: none; display: inline-block; font-weight: 600; }

.banner { background: var(--banner-bg); color: var(--banner-ink); border-bottom: 1px solid var(--banner-line); font-size: 0.95rem; }
.banner .wrap { display: flex; gap: 0.75rem; align-items: baseline; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.banner p { margin: 0; max-width: none; }
.banner a { color: inherit; font-weight: 600; }
.banner-tag { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; border: 1px solid currentColor; border-radius: 4px; padding: 0.05rem 0.4rem; white-space: nowrap; }
.banner-date { font-weight: 600; }

.hero { padding: 1rem 0 0.5rem; }
.hero h1 { max-width: 22ch; }
.trust { background: var(--banner-bg); color: var(--banner-ink); border: 1px solid var(--banner-line); border-radius: 8px; padding: 0.25rem 1.1rem 0.6rem; max-width: 44rem; margin-top: 1.25rem; }
.trust h2 { font-size: 1.15rem; margin: 0.9rem 0 0.4rem; }
.trust ol { padding-left: 1.2rem; margin: 0.4rem 0; }
.trust li { margin: 0.35rem 0; }
.trust a { color: inherit; }
.search label { display: block; font-weight: 600; margin: 1.5rem 0 0.35rem; }
.search-row { display: flex; gap: 0.5rem; max-width: 36rem; }
input[type="search"], select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.45rem 0.6rem; width: 100%; min-width: 0; }
.counts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; }
.count { max-width: none; }
.count a { display: block; height: 100%; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 8px; padding: 0.9rem 1rem; }
.count a:hover { border-color: var(--c); }
.count .num { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.count-label { display: block; font-weight: 700; margin-top: 0.3rem; }
.count-desc { display: block; color: var(--muted); font-size: 0.9rem; }
.count.status-unlocked { --c: var(--ok-ink); } .count.status-partial { --c: var(--part-ink); }
.count.status-still-conditional { --c: var(--cond-ink); } .count.status-proved-otherwise { --c: var(--other-ink); }
.notice { background: var(--banner-bg); color: var(--banner-ink); border: 1px solid var(--banner-line); border-radius: 8px; padding: 0.7rem 1rem; max-width: 44rem; }
.notice a { color: inherit; }

.badge, .chip, .tag { display: inline-block; font-size: 0.8rem; line-height: 1.3; border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap; border: 1px solid transparent; font-weight: 600; }
.status-unlocked.badge { background: var(--ok-bg); color: var(--ok-ink); }
.status-partial.badge { background: var(--part-bg); color: var(--part-ink); }
.status-still-conditional.badge { background: var(--cond-bg); color: var(--cond-ink); }
.status-proved-otherwise.badge { background: var(--other-bg); color: var(--other-ink); }
.badge.draft { border: 1px dashed currentColor; }
.badge[class*="review-"] { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.badge.review-human-checked, .badge.review-lean-verified { border-color: var(--ok-ink); color: var(--ok-ink); }
.chip { font-family: var(--mono); border-radius: 4px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.chip.cov-yes { border-color: var(--ok-ink); } .chip.cov-partial { border-color: var(--part-ink); border-style: dashed; } .chip.cov-no { border-color: var(--cond-ink); border-style: dotted; }
.tag { background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 400; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.filters[hidden] { display: none; }
.filters label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.2rem; }
.result-count { font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
thead th button { all: unset; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
thead th button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
thead th[aria-sort="ascending"] button::after { content: " \2191"; } thead th[aria-sort="descending"] button::after { content: " \2193"; }
table.entries tbody th { font-weight: 600; min-width: 14rem; }
table.entries td:nth-child(3) { min-width: 9rem; }
table.taxonomy td { min-width: 14rem; }

.crumbs { margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.entry h1 { margin-top: 0.75rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.field { color: var(--muted); font-size: 0.9rem; }
.statement { font-size: 1.15rem; font-family: var(--serif); }
.formal { overflow-x: auto; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.hyps { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.hyps li { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 8px; padding: 0.75rem 1rem; }
.hyps li.cov-yes { --c: var(--ok-ink); } .hyps li.cov-partial { --c: var(--part-ink); } .hyps li.cov-no { --c: var(--cond-ink); }
.hyps p { margin: 0.4rem 0 0; }
.hyp-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cov-label { font-size: 0.85rem; font-weight: 700; color: var(--c); }
.note { border-left: 3px solid var(--line); padding-left: 0.9rem; }
.sources li { margin-bottom: 0.75rem; overflow-wrap: anywhere; }
.sources .where, .sources .doi { color: var(--muted); font-size: 0.9rem; }
.role { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.3rem; }
dl.meta { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: 0.4rem 1rem; }
dl.meta dt { font-weight: 600; color: var(--muted); } dl.meta dd { margin: 0; } dl.meta ul { margin: 0; padding-left: 1.1rem; }
dl.defs dt { margin-top: 0.9rem; font-weight: 600; } dl.defs dd { margin: 0.25rem 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 2rem; }
.downloads { list-style: none; padding: 0; } .downloads li { margin: 0.5rem 0; } .downloads a { font-family: var(--mono); font-weight: 600; margin-right: 0.5rem; }
ul.plain { padding-left: 1.1rem; }
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); padding: 1.25rem 0 2rem; font-size: 0.9rem; }
.site-footer p { margin: 0.25rem 0; max-width: none; }
@media (max-width: 34rem) {
  .banner .wrap { flex-direction: column; gap: 0.3rem; }
  dl.meta { grid-template-columns: 1fr; gap: 0.1rem; } dl.meta dd { margin-bottom: 0.6rem; }
  .search-row { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
table.waiting th[scope="row"] { font-weight: 600; min-width: 15rem; }
table.waiting .num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.count-inline { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.5rem; vertical-align: middle; }
.wait-list { padding-left: 1.1rem; } .wait-list li { margin: 0.35rem 0; max-width: 52rem; }
.badge.author-sub { background: transparent; border: 1px solid var(--part-ink); color: var(--part-ink); }
.known { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.75rem; }
.known li { max-width: none; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 8px; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.known li.status-unlocked { --c: var(--ok-ink); } .known li.status-partial { --c: var(--part-ink); } .known li.status-still-conditional { --c: var(--cond-ink); } .known li.status-proved-otherwise { --c: var(--other-ink); }
.known a { text-decoration: none; color: inherit; display: block; } .known a:hover .known-title { text-decoration: underline; }
.known-title { display: block; font-weight: 700; } .known-st { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.known-badge { margin-top: auto; }
.statement-box { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 8px; padding: 0.5rem 1rem 0.75rem; margin: 1rem 0; max-width: 52rem; }
.statement-box .formal { border: 0; padding: 0.25rem 0; background: transparent; }
.statement-box p { margin: 0.4rem 0; }
dl.tried dt { font-family: var(--serif); font-size: 1.05rem; }

.wrap-any { overflow-wrap: anywhere; }
