/* EntryLib: the site around the page view (claimset.css). One font, one colour scheme; colour only for links and
   status. Dark theme by the reader's setting. */
:root {
  --ground: #ffffff; --panel: #f7f7f5; --ink: #1a1a1a; --muted: #555555; --rule: #d6d6d6; --rule-light: #e6e6e6;
  --accent: #1d4f91; --ok: #1e6b3a; --ok-bg: #e7f3ec; --warn: #8a4b00; --warn-bg: #fbf0e2; --bad: #a12a2a;
  --bad-bg: #fbeaea; --cs-green: #2e8b57; --cs-amber: #d08c1a; --cs-red: #c0392b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #141517; --panel: #1c1e21; --ink: #e8e6e1; --muted: #a9a7a1; --rule: #34363b; --rule-light: #2a2c30;
    --accent: #8fb4ea; --ok: #7fcf9b; --ok-bg: #18271e; --warn: #f0b56b; --warn-bg: #2b2216; --bad: #f19a9a;
    --bad-bg: #2d1b1b;
    color-scheme: dark;
  }
}
/* EntryLib's look for the page view (claimset.css ships a neutral one): same selectors, so these win by coming later. */
.cs-page, .cs-body, .cs-header, .cs-toc {
  --cs-ink: #1a1a1a; --cs-muted: #555555; --cs-rule: #d6d6d6; --cs-rule-light: #e6e6e6; --cs-panel: #f7f7f5;
  --cs-accent: #1d4f91; --cs-target: #f4f7fb; --cs-font: "Source Serif 4", Georgia, serif;
  --cs-math-font: "STIX Two Math", math, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cs-page, :root:not([data-theme="light"]) .cs-body,
  :root:not([data-theme="light"]) .cs-header, :root:not([data-theme="light"]) .cs-toc {
    --cs-ink: #e8e6e1; --cs-muted: #a9a7a1; --cs-rule: #34363b; --cs-rule-light: #2a2c30; --cs-panel: #1c1e21;
    --cs-accent: #8fb4ea; --cs-target: #1b2433;
  }
}
.cs-page { font-family: "Source Serif 4", Georgia, serif; font-size: 17px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink);
  font: 17px/1.55 "Source Serif 4", Georgia, serif; font-variant-numeric: lining-nums tabular-nums; }
a { color: var(--accent); text-underline-offset: 2px; }
code { font: inherit; font-size: 0.94em; background: var(--panel); padding: 0 4px; border-radius: 3px;
  overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
main { min-height: 60vh; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 16px; }
.muted, .small { color: var(--muted); }
.small { font-size: 15px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Buttons (design §7.4): one style for every action, one quiet style for secondary ones. No form styles its own. */
.button, button[type="submit"]:not(.button-quiet) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: var(--ground) !important;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button-quiet { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--rule);
  border-radius: 4px; background: var(--ground); color: var(--accent); font: inherit; font-size: 15px;
  text-decoration: none; cursor: pointer; }
.button:focus-visible, button[type="submit"]:focus-visible, .button-quiet:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px; }

/* header and footer */
/* The site's header stays at the top of the window (--head is its height), so the menu, the home page and Read are
   always one click away. On a phone it slides away while reading down and comes back on the first scroll up
   (page.js sets .head-hidden); without the script it simply stays. */
:root { --head: 65px; }
.head-hidden { --head: 0px; }
.site-header { border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 30; background: var(--ground);
  transition: transform .2s ease; }
.head-hidden .site-header { transform: translateY(-100%); }
[id] { scroll-margin-top: calc(var(--head) + 12px); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { font-size: 24px; font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto;
  display: inline-flex; align-items: center; gap: 9px; }
.logo-mark { flex: none; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.button), .site-menu nav a:not(.button) { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current], .site-menu a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; }
.site-menu { display: none; }
.site-menu summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center;
  padding: 0 12px; border: 1px solid var(--rule); border-radius: 4px; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu nav { position: absolute; right: 16px; left: 16px; margin-top: 8px; z-index: 10; display: flex;
  flex-direction: column; gap: 4px; padding: 12px; background: var(--ground); border: 1px solid var(--rule);
  border-radius: 6px; }
.site-menu nav a { min-height: 44px; display: flex; align-items: center; }
.site-footer { border-top: 1px solid var(--rule); margin-top: 64px; padding: 24px 0 40px; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }
@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-menu { display: block; }
}

/* search */
.search { display: flex; gap: 8px; max-width: 44rem; margin: 16px 0; }
.search input { flex: 1; min-width: 0; min-height: 44px; font: inherit; padding: 0 12px; color: var(--ink);
  background: var(--ground); border: 1px solid var(--rule); border-radius: 4px; }
.search-big input { min-height: 52px; font-size: 18px; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.tabs a { padding: 10px 0; min-height: 44px; display: inline-block; text-decoration: none; color: var(--muted); }
.tabs a[aria-current] { color: var(--ink); border-bottom: 2px solid var(--ink); }
.results { list-style: none; padding: 0; margin: 0; }
.result { padding: 14px 0; border-top: 1px solid var(--rule-light); }
.result p { margin: 2px 0; }
.pager { margin-top: 24px; }

/* home */
.hero { padding: 48px 0 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 32px 56px;
  align-items: start; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.start-here { background: var(--panel); border: 1px solid var(--rule-light); border-radius: 6px; padding: 20px 24px; }
.start-here h2 { margin: 0 0 10px; font-size: 20px; }
.start-here ol { margin: 0 0 14px; padding-left: 22px; }
.start-here li { margin: 6px 0; }
.start-here h3 { margin: 16px 0 4px; font-size: 16px; }
.start-here p { margin: 0 0 6px; font-size: 15px; }
.hero h1 { font-size: clamp(32px, 5vw, 44px); margin: 0 0 16px; max-width: 22ch; }
.lead { font-size: 19px; max-width: 46rem; }
.paths { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; margin: 32px 0 48px; }
.path { background: var(--panel); border: 1px solid var(--rule-light); border-radius: 6px; padding: 20px 24px;
  align-self: stretch; }
.path h2 { font-size: 22px; margin: 0 0 8px; }
.path p { margin: 8px 0 0; }
.path-join { color: var(--muted); font-size: 15px; white-space: nowrap; }
@media (max-width: 760px) {
  .paths { grid-template-columns: 1fr; }
  .path-join { text-align: center; margin: -8px 0; }
}
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  border-top: 2px solid var(--ink); padding-top: 10px; }
.section-head h2 { margin: 0; font-size: 26px; }
.section-head p { margin: 0; }
.cards { display: grid; gap: 0; }
.card { padding: 18px 0; border-bottom: 1px solid var(--rule-light); }
.card h3 { margin: 6px 0 4px; font-size: 21px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin: 2px 0; }
.card-top, .card-counts, .card-who { font-size: 15px; color: var(--muted); }
.card-top { overflow-wrap: anywhere; }
.card-claim { font-size: 17px; }
.card-scored { display: flex; gap: 18px; align-items: flex-start; }
.card-body { min-width: 0; flex: 1; }
.card-score { flex: none; width: 64px; padding-top: 4px; text-align: center; text-decoration: none; color: inherit; }
.card-score-num { display: block; font-size: 32px; line-height: 1; font-weight: 700; }
.card-score-band { display: block; font-size: 13px; font-weight: 600; margin-top: 3px; }

/* labels */
.origin { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 3px; padding: 0 7px; line-height: 1.5; color: var(--ink); }
.status { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 3px; padding: 0 7px; line-height: 1.6; }
.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-bad { color: var(--bad); background: var(--bad-bg); }
.notice { border-left: 4px solid; padding: 10px 14px; margin: 12px 0; border-radius: 0 4px 4px 0; }
.notice p { margin: 2px 0; }
/* Tables of results: text and numbers alike start at the left; the row labels (first column) sit at the right. */
.cs-table td.num { text-align: left; }
.cs-table th[scope="row"], .cs-table thead th:first-child { text-align: right; }
details.notice summary { cursor: pointer; }
details.notice[open] summary { margin-bottom: 4px; }
.notice-warn { color: var(--ink); background: var(--warn-bg); border-color: var(--warn); }
.notice-bad { color: var(--ink); background: var(--bad-bg); border-color: var(--bad); }

/* claimset page */
.cs-page .cs-header { min-width: 0; }
/* One grid: the header spans the contents and the body, so "In brief" follows it directly; the panel runs down the
   right beside both, from the top of the header, and stays in view while reading. */
.entry { display: grid; grid-template-columns: 210px minmax(0, 1fr) 270px; column-gap: 40px;
  grid-template-areas: "head head panel" "nav body panel"; align-items: start; }
.entry-header { grid-area: head; margin-bottom: 28px; }
.entry > .panel { grid-area: panel; position: sticky; top: calc(var(--head) + 16px); }
.cs-page .cs-toc, .spec-toc { top: calc(var(--head) + 16px); }
.entry > .cs-toc { grid-area: nav; }
.entry > .cs-body { grid-area: body; }
.entry > .toc-bar { grid-area: bar; }
@media (max-height: 700px) { .entry > .panel { position: static; } }
@media (max-width: 1100px) {
  .entry { grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "head head" "panel panel" "nav body"; }
  .entry > .panel { position: static; margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 0 24px; }
  .entry > .panel .panel-row { border-bottom: 0; flex: 1 1 180px; }
}
.entry-top { margin: 0 0 4px; font-size: 15px; color: var(--muted); }
.entry-top .id { overflow-wrap: anywhere; }
.origin-line { margin: 10px 0 0; font-size: 16px; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--rule-light); border-radius: 6px; padding: 4px 16px;
  font-size: 15px; }
.panel-row { padding: 10px 0; border-bottom: 1px solid var(--rule-light); }
.panel-row:last-child { border-bottom: 0; }
.panel h2 { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); }
.panel p { margin: 2px 0; }
.score { font-size: 26px; font-weight: 600; }
/* scores (design §7.6): bands always named in words too; dots one per group of the rubric */
:root { --high: #1e6b3a; --high-bg: #e7f3ec; --medium: #8a4b00; --medium-bg: #fbf0e2; --low: #a12a2a; --low-bg: #fbeaea; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --high: #7fcf9b; --high-bg: #18271e; --medium: #f0b56b; --medium-bg: #2b2216;
    --low: #f19a9a; --low-bg: #2d1b1b; }
}
.band-high { color: var(--high); } .band-medium { color: var(--medium); } .band-low { color: var(--low); }
.score-big { margin: 2px 0 6px; line-height: 1; }
.score-big a { text-decoration: none; color: inherit; }
.score-num { font-size: 52px; font-weight: 700; }
.score-band { font-size: 18px; font-weight: 600; }
.score-badge { display: inline-block; min-width: 2.4em; text-align: center; font-size: 14px; font-weight: 600;
  line-height: 1.5; border-radius: 10px; padding: 0 6px; margin-right: 8px; text-decoration: none; }
.score-badge.band-high { background: var(--high-bg); } .score-badge.band-medium { background: var(--medium-bg); }
.score-badge.band-low { background: var(--low-bg); }
.score-badge.small { font-size: 13px; min-width: 2.2em; }
.cs-brief .score-badge { flex: none; align-self: flex-start; margin-top: 4px; }
.dots { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: 1px; }
.dot { width: 8px; height: 8px; border-radius: 50%; cursor: help; }
.dot-green { background: var(--cs-green); } .dot-amber { background: var(--cs-amber); } .dot-red { background: var(--cs-red); }
.novelty-row { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--rule); font-size: 15px; }
.novelty-label { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.bands { list-style: none; margin: 0; padding: 0; }
.bands li { display: flex; align-items: center; margin: 2px 0; }
.score-note { color: var(--muted); font-size: 15px; }
.problems { padding-left: 0; list-style: none; margin: 8px 0; }
.problems li { margin: 6px 0; padding-left: 52px; text-indent: -52px; }
.problems .cost { display: inline-block; width: 44px; text-indent: 0; text-align: right; margin-right: 8px; font-weight: 600; }
.problems .group { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.problems .fix { color: var(--muted); }
.score-claim { border-top: 1px solid var(--rule-light); padding: 8px 0; }
.score-claim h4 { margin: 0; font-size: 17px; font-weight: 600; }
dialog.peek h3, dialog.peek h4 { margin-top: 0; }
dialog.peek .score-claim { border-top: 0; padding-top: 0; }
.lights { list-style: none; margin: 0; padding: 0; }
.lights li { display: flex; align-items: center; }
.cite summary { cursor: pointer; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.cite-text { user-select: all; background: var(--ground); border: 1px solid var(--rule-light); border-radius: 4px;
  padding: 8px; overflow-wrap: anywhere; }
.copy-text { margin-top: 6px; font: inherit; font-size: 14px; color: var(--accent); background: none;
  border: 1px solid var(--rule); border-radius: 4px; padding: 4px 10px; cursor: pointer; min-height: 32px; }
.claim-page { color: inherit; text-decoration: underline dotted; }
.claim-code { color: var(--muted); font-weight: 400; white-space: nowrap; }
.versions { padding-left: 20px; }
.orcid-verified, .orcid.orcid-verified { padding-left: 20px; background: url(/img/orcid.svg) no-repeat left center / 16px 16px; }
@media (max-width: 860px) {
  .entry { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "panel" "bar" "nav" "body"; }
  .entry-header { margin-bottom: 16px; }
  .panel { display: flex; flex-wrap: wrap; gap: 0 24px; }
  .panel-row { border-bottom: 0; flex: 1 1 140px; }
  .cs-toc { position: static; max-height: none; flex-basis: 100%; }
  .cs-title { font-size: 30px; }
}

/* prose pages */
.prose { padding-top: 32px; }
.prose > * { max-width: 50rem; }
.prose > .grid, .prose > .table-wrap { max-width: 60rem; }
.prose h1 { font-size: clamp(30px, 4.5vw, 42px); margin: 0 0 16px; }
.prose h2 { font-size: 26px; margin: 40px 0 10px; border-top: 1px solid var(--rule); padding-top: 22px; }
.prose h3 { font-size: 19px; margin: 24px 0 6px; }
.kicker { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.actions { margin: 20px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 8px 32px; }
.grid h3 { margin-top: 16px; }
.grid p { margin: 4px 0; }
.steps { padding-left: 24px; }
.steps li { margin: 8px 0; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule-light); }
.prose th { font-weight: 600; border-bottom-color: var(--rule); }
.commands td:first-child { width: 62%; }
@media (max-width: 640px) {
  .commands thead { display: none; }
  .commands tr, .commands td { display: block; width: 100% !important; }
  .commands td:first-child { border-bottom: 0; padding-bottom: 0; }
}
.legend { list-style: none; padding: 0; }
.legend li { margin: 4px 0; }
.person { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.person img { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; }
.person h3 { margin: 0; }
.person > div { flex: 1 1 18rem; }
.spec-list li { margin: 6px 0; }

/* upload page */
.upload input[type="file"] { font: inherit; max-width: 100%; }
.upload label { display: flex; gap: 8px; align-items: baseline; }
#result pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); padding: 12px; font: inherit;
  font-size: 15px; }
.error { color: var(--bad); }

/* the section being read (page.js) */
.cs-toc a[aria-current] { font-weight: 600; color: var(--ink); }
.cs-toc a[aria-current]::before { content: ""; display: inline-block; width: 3px; height: 1em; margin: 0 7px 0 -10px;
  vertical-align: -2px; background: var(--accent); }
.toc-bar { display: none; }
@media (max-width: 860px) {
  .toc-js .toc-bar { transition: top .2s ease; display: flex; align-items: center; justify-content: space-between; position: sticky; top: var(--head);
    z-index: 20; width: 100%; min-height: 44px; margin: 0 0 8px; padding: 0 12px; font: inherit; font-size: 16px;
    font-weight: 600; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
    cursor: pointer; text-align: left; }
  .toc-js .toc-bar::after { content: "▾"; color: var(--muted); }
  .toc-js .toc-bar[aria-expanded="true"]::after { content: "▴"; }
  .toc-js .cs-toc { display: none; }
  .toc-js .cs-toc.open { display: block; position: sticky; top: calc(var(--head) + 52px); z-index: 20; max-height: 70vh; overflow-y: auto;
    background: var(--ground); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 16px; }
  .toc-js .cs-toc a { display: inline-block; min-height: 44px; line-height: 44px; }
}

/* specifications (specs.py) */
.spec { padding-top: 24px; }
.spec-body { flex: 1 1 0; min-width: 0; max-width: 50rem; }
.spec-body h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 16px; }
.spec-body h2 { font-size: 26px; margin: 40px 0 10px; border-top: 1px solid var(--rule); padding-top: 22px; }
.spec-body h3 { font-size: 20px; margin: 28px 0 8px; }
.spec-body h4 { font-size: 17px; margin: 22px 0 6px; }
.spec-body :target { scroll-margin-top: calc(var(--head) + 60px); }
.spec-body pre { background: var(--panel); border: 1px solid var(--rule-light); border-radius: 4px; padding: 12px;
  overflow-x: auto; font-size: 14px; line-height: 1.45; }
.spec-body pre code { background: none; padding: 0; overflow-wrap: normal; }
.spec-body table { border-collapse: collapse; font-size: 15px; }
.spec-body th, .spec-body td { text-align: left; vertical-align: top; padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--rule-light); }
.spec-body blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--rule); color: var(--muted); }
.spec-toc { max-height: calc(100vh - 32px); overflow-y: auto; }
.spec-toc .toc-l3 { padding-left: 14px; font-size: 15px; line-height: 1.7; }

/* removal form */
.request input:not([type]), .request input[type="email"], .request select, .request textarea { font: inherit;
  width: 100%; max-width: 40rem; min-height: 44px; padding: 8px 10px; color: var(--ink); background: var(--ground);
  border: 1px solid var(--rule); border-radius: 4px; }
.request fieldset { border: 1px solid var(--rule-light); border-radius: 6px; margin: 20px 0; padding: 4px 18px 8px; }
.request legend { font-weight: 600; padding: 0 6px; }
.spec-body table code { overflow-wrap: normal; word-break: normal; white-space: nowrap; }
@media (max-width: 860px) {
  .toc-js .cs-body [id], .toc-js .spec-body [id] { scroll-margin-top: calc(var(--head) + 60px); }
}

/* /confirm */
.pending { border: 1px solid var(--rule-light); border-radius: 6px; padding: 4px 20px 8px; margin: 20px 0; }
.pending h2 { border-top: 0 !important; padding-top: 0 !important; margin-top: 16px !important; font-size: 22px !important; }
.pending pre { white-space: pre-wrap; background: var(--panel); padding: 12px; font-size: 14px; max-height: 60vh;
  overflow-y: auto; }

/* pop-ups (page.js): figures, and explanations; the close button always in the top right corner */
dialog.popup { border: 0; padding: 0; max-width: min(96vw, 1400px); max-height: 94vh; background: var(--ground);
  color: var(--ink); border-radius: 6px; box-shadow: 0 10px 40px rgb(0 0 0 / .35); }
dialog.popup::backdrop { background: rgb(0 0 0 / .72); }
dialog.popup .popup-close { position: absolute; z-index: 2; top: 8px; right: 8px; width: 44px; height: 44px; border: 0;
  border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff; font: 26px/44px sans-serif; cursor: pointer; }
@media (max-width: 640px) {
  dialog.popup { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; border-radius: 0; }
}
.cs-figure > a { cursor: zoom-in; }
dialog.zoom figure { margin: 0; display: flex; flex-direction: column; }
dialog.zoom img { display: block; max-width: 100%; max-height: calc(94vh - 72px); object-fit: contain; margin: 0 auto;
  background: #fff; }
dialog.zoom figcaption { padding: 10px 56px 12px 16px; font-size: 15px; }
@media (max-width: 640px) { dialog.zoom img { max-height: calc(100vh - 90px); } }

/* room between items, so that definitions and claims read one at a time */
.cs-item { padding: 16px 0 !important; }
.cs-item p + p, .cs-item p + ul, .cs-item ul + p { margin-top: 8px !important; }
.cs-def p { margin-top: 10px !important; }
.cs-statement { line-height: 1.6; }
.cs-defs li, .cs-def { margin-bottom: 6px; }
.cs-brief li { padding: 6px 0 !important; }

/* Read (design §7.7): the tree of fields beside the claims or claimsets of the part chosen */
.read-layout { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 24px; align-items: flex-start; }
.read-tree { flex: 1 1 240px; max-width: 300px; font-size: 16px; }
.read-tree ul { list-style: none; margin: 0; padding: 0; }
.read-tree ul ul { padding-left: 16px; border-left: 1px solid var(--rule-light); margin: 2px 0 6px 4px; }
.read-tree li { margin: 3px 0; }
.read-tree a { text-decoration: none; }
.read-tree a[aria-current] { color: var(--ink); font-weight: 600; }
.read-tree .count { color: var(--muted); font-size: 14px; }
.read-main { flex: 999 1 560px; min-width: 0; }
.read-main h2 { margin: 0 0 4px; font-size: 26px; }
.read-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 12px; font-size: 15px; }
.read-filters select { font: inherit; min-height: 36px; }
.read-filters .check { display: flex; align-items: center; gap: 6px; }
.result .card-top .score-badge { margin-right: 6px; }
.pager { margin-top: 16px; }

/* Ask your AI (design §7.4) */
.ask-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 16px 0 0; }
.ask-ai > p { margin: 0; }
.ask-ai details { flex-basis: 100%; font-size: 15px; color: var(--muted); }
.ask-ai summary { cursor: pointer; }
.cite button[data-copy] { margin-top: 6px; }

/* Folded sections and pop-ups for IDs (page.js, design §7.4) */
.fold > h2 { margin: 0; }
.fold-toggle { all: unset; box-sizing: border-box; display: flex; align-items: baseline; gap: 10px; width: 100%;
  min-height: 44px; padding: 4px 0; cursor: pointer; }
.fold-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fold-toggle .count { font-size: 15px; font-weight: 400; color: var(--muted); }
.fold-toggle .fold-state { margin-left: auto; font-size: 15px; font-weight: 400; color: var(--accent); }
.fold:not(.open) > .fold-body { display: none; }
.cs-body > .cs-section.fold:not(.open) { margin-top: 0; padding-top: 6px; }
.cs-body > .cs-section.fold.open { margin-top: 24px; }
dialog.peek { width: min(60rem, 96vw); }
dialog.peek .popup-body { max-width: none; max-height: 90vh; overflow-y: auto; padding: 0 24px 16px; }
@media (max-width: 640px) { dialog.peek .popup-body { max-height: 100vh; height: 100%; box-sizing: border-box; padding: 0 16px 16px; } }
.peek-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 60px;
  padding-right: 52px; background: var(--ground); border-bottom: 1px solid var(--rule-light); }
.peek-title { margin: 0; font-weight: 600; }
.peek-head .button-quiet[hidden] { display: none; }
.peek-foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--rule-light); }
dialog.peek .cs-item, dialog.peek .cs-def { border: 0; }
.peek-hit { background: var(--warn-bg); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--warn-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
.to-top { position: fixed; z-index: 20; right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 44px; border-radius: 22px;
  box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.to-top[hidden] { display: none; }
.cs-toc a.toc-top { font-weight: 600; }

/* People in a claimset's header (site.person, design §7.4): an icon for each author, none for the guarantor */
.who-icon { width: 0.95em; height: 0.95em; vertical-align: -0.12em; margin-right: 0.3em; color: var(--muted); }
.cs-label { color: var(--muted); }
