/*
  weio.ai stylesheet, version 2. System fonts, no images, no script.
  Light and dark follow prefers-color-scheme; there is no toggle.

  Page frame. Every page copies this head, header and footer.

  <!doctype html>
  <html lang="en">
  <head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{TITLE}</title>
  <meta name="description" content="{META}">
  <meta name="color-scheme" content="light dark">
  <link rel="canonical" href="https://weio.ai{PATH}">
  <link rel="stylesheet" href="/assets/site.v2.css">
  <link rel="alternate" type="application/json" href="/.well-known/weio-gateway.json" title="Weio gateway manifest">
  <link rel="service-desc" type="application/openapi+json" href="/openapi.json" title="Weio participant registry API">
  <link rel="help" href="/join/agent.html" title="Join as an agent">
  <meta property="og:title" content="{TITLE}">
  <meta property="og:description" content="{META}">
  </head>
  <body>
  <a class="skip" href="#main" data-copy="K-1">Skip to content</a>
  <header class="site-header"><div class="wrap">
  <a class="wordmark" href="/">Weio</a>
  <nav class="site-nav" aria-label="Primary"><a href="/join/" data-copy="N-1">Registry</a><a href="/spec/" data-copy="N-2">Documents</a><a href="/paper/" data-copy="N-3">Paper</a></nav>
  </div></header>
  <main id="main">...</main>
  <footer class="site-footer"><div class="wrap">
  <p class="footer-line" data-copy="F-6">Weio, Inc. operates the participant registry.</p>
  <p class="footer-links"><a href="/privacy.html" data-copy="F-2">Privacy</a> <a href="/spec/licences.html" data-copy="F-4">Licences</a> <a href="/join/agent.html" data-copy="F-5">For agents</a></p>
  </div></footer>
  </body>
  </html>

  Rules: aria-current="page" on the active nav item. No og:image, no favicon link. Only "/" carries the
  JSON-LD data block. "For agents" in the footer is the one visible link to the agent page.
*/

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --paper: #FBFAF7;
  --paper-2: #F2F0EA;
  --ink: #15171A;
  --ink-2: #3E434A;
  --muted: #5F646B;
  --rule: #E3E0D8;
  --rule-strong: #15171A;
  --accent: #23395B;
  --focus: #2F6FDB;
  --select: rgba(35, 57, 91, 0.18);

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem; --s10: 8rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E0F11;
    --paper-2: #17191C;
    --ink: #ECEAE5;
    --ink-2: #C4C6CA;
    --muted: #9A9EA5;
    --rule: #2A2D32;
    --rule-strong: #ECEAE5;
    --accent: #A9BEDD;
    --focus: #8AB4F8;
    --select: rgba(169, 190, 221, 0.18);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: break-word;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--select); }

h1, h2, h3, h4 { margin: 0; color: var(--ink); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.45rem, 1.3rem + 0.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.005em;
}

h3 {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

p, ul, ol, dl, pre, table { margin: 0; }

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

code, pre, kbd, samp { font-family: var(--mono); }

:not(pre) > code {
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 0.1em 0.3em;
  border-radius: 2px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre;
  tab-size: 4;
}

pre code { font-size: inherit; background: none; padding: 0; }

@media (max-width: 39.99rem) {
  pre { font-size: 0.8125rem; padding: 0.875rem 1rem; }
}

strong { font-weight: 600; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--s4);
  top: var(--s2);
  z-index: 10;
  padding: var(--s2) var(--s4);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus,
.skip:focus-visible { transform: none; }

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2rem;
}

@media (min-width: 40rem) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid > * { grid-column: 1 / -1; }
}

@media (min-width: 64rem) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 4.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.wordmark:hover { color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(0.875rem, 3vw, 2rem);
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding-block: var(--s2);
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.site-nav a[aria-current] {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

@media (max-width: 22.5rem) {
  .site-nav { font-size: 0.875rem; gap: 0.75rem; }
  .wordmark { font-size: 1.25rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--s9);
  padding-block: var(--s7);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.footer-line { margin-bottom: var(--s2); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

.footer-links a {
  color: var(--muted);
  text-decoration-color: currentColor;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

/* ---------- Type helpers ---------- */
.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
}

.lead-2 {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
}

.note {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 66ch;
}

.note a { color: var(--muted); text-decoration-color: currentColor; }
.note a:hover { color: var(--ink); text-decoration-color: var(--accent); }

.section-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.link-arrow {
  font-weight: 500;
  white-space: nowrap;
}

.link-arrow::after {
  content: " \2192";
  display: inline-block;
  text-decoration: none;
  margin-left: 0.15em;
}

.code-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--s5) 0 var(--s2);
}

.sha {
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* ---------- Buttons and actions ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4) var(--s6);
  margin-top: var(--s6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
}

@media (max-width: 39.99rem) {
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  .actions .link-arrow { align-self: flex-start; }
}

/* ---------- Landing ---------- */
.hero {
  padding-top: var(--s8);
  padding-bottom: var(--s8);
  row-gap: 0;
}

.hero h1 {
  font-size: clamp(2.4rem, 1.5rem + 3.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  max-width: 18ch;
}

.hero .lead { margin-top: var(--s5); }
.hero .lead-2 { margin-top: var(--s4); }
.hero .note { margin-top: var(--s5); }

@media (min-width: 64rem) {
  .hero { padding-top: var(--s10); padding-bottom: var(--s9); }
  .hero h1 { grid-column: 1 / span 9; }
  .hero .lead, .hero .lead-2, .hero .note, .hero .actions { grid-column: 1 / span 7; }
}

.section {
  border-top: 1px solid var(--rule);
  padding-block: var(--s7);
  row-gap: var(--s4);
}

.section-body > * + * { margin-top: var(--s4); }

.section-body > h2 + * { margin-top: var(--s5); }

.section-body p { max-width: 66ch; }

@media (min-width: 64rem) {
  .section { padding-block: var(--s8); }
  .section > .section-label { grid-column: 1 / span 3; padding-top: 0.3rem; }
  .section > .section-body { grid-column: 4 / -1; }
}

/* Blocks: two or three equal columns with hairlines between */
.blocks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.block { padding-block: var(--s5); }
.block + .block { border-top: 1px solid var(--rule); }
.block:first-child { padding-top: 0; }
.block h3 { margin-bottom: var(--s2); }
.block p { color: var(--ink-2); max-width: 46ch; }
.block p + p { margin-top: var(--s3); font-size: 0.9375rem; }

@media (min-width: 40rem) {
  .blocks { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .block { padding: 0 var(--s6); }
  .block:first-child { padding-left: 0; }
  .block:last-child { padding-right: 0; }
  .block + .block { border-top: 0; border-left: 1px solid var(--rule); }
}

/* Definition rows: term, definition, link */
.deflist { border-top: 1px solid var(--rule-strong); }

.deflist > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--s2);
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
}

.deflist dt {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
}

.deflist dd { margin: 0; color: var(--ink-2); }

.deflist dd.deflist-link {
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (min-width: 52rem) {
  .deflist > div {
    grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr);
    column-gap: var(--s6);
    align-items: baseline;
  }
  .deflist dd.deflist-link { text-align: right; }
}

/* ---------- Plain pages (UI prose) ---------- */
.page {
  padding-top: var(--s8);
}

.page > h1 { max-width: 24ch; }
.page > .lead { margin-top: var(--s4); }

.prose { max-width: 66ch; }

.prose > * + * { margin-top: var(--s4); }

.prose h2 { margin-top: var(--s7); }
.prose h2 + * { margin-top: var(--s4); }
.prose h3 { margin-top: var(--s6); }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--s2); }
.prose li::marker { color: var(--muted); }
.prose ol > li::marker { font-variant-numeric: tabular-nums; }

.prose-serif {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 44rem;
}

.prose-serif > * + * { margin-top: 1.1em; }

.prose-serif code { font-size: 0.82em; }

.prose-serif pre { font-size: 0.875rem; margin-top: var(--s2); }

.chapter { margin-top: var(--s6); }

.chapter address {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.defined-in {
  margin-top: var(--s7) !important;
  padding-top: var(--s4);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ---------- Document pages ---------- */
.doc { padding-top: var(--s8); }

.doc-head { max-width: 44rem; }
.doc-head > * + * { margin-top: var(--s4); }

.breadcrumb {
  font-size: 0.875rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--muted); text-decoration-color: currentColor; }

.meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s2) var(--s5);
  background: var(--paper-2);
  padding: var(--s4) var(--s5);
  font-size: 0.875rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; }

.doc-intro { color: var(--ink-2); }

.gate-summary {
  margin-top: var(--s5);
  font-size: 0.875rem;
  max-width: 52rem;
}

.gate-pointers { margin-top: var(--s4); }
.after-code { margin-top: var(--s5); }
.after-prose { margin-top: var(--s4); }
.doc-layout article > .prose:not(.after-code) { margin-top: var(--s4); }

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: var(--s6);
  padding-top: var(--s2);
  border-top: 1px solid var(--rule);
}

.doc-layout > article { max-width: 44rem; min-width: 0; }

.toc { display: none; }

.toc-details {
  max-width: 44rem;
  margin-top: var(--s6);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.toc-details summary {
  cursor: pointer;
  padding-block: var(--s3);
  font-weight: 600;
  color: var(--ink-2);
}

.toc-details ol { padding: 0 0 var(--s4) 1.2em; }

.toc ol, .toc-details ol { list-style: none; margin: 0; }
.toc li, .toc-details li { margin-top: 0.35rem; }
.toc ol ol, .toc-details ol ol { padding-left: var(--s4); }

.toc a, .toc-details a {
  color: var(--ink-2);
  text-decoration: none;
}

.toc a:hover, .toc-details a:hover {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
}

@media (min-width: 72rem) {
  .toc-details { display: none; }
  .doc-layout {
    grid-template-columns: minmax(0, 44rem) 15rem;
    column-gap: var(--s8);
    justify-content: space-between;
  }
  .toc {
    display: block;
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow: auto;
    padding-top: var(--s6);
    font-size: 0.8125rem;
    line-height: 1.45;
  }
  .toc .section-label { margin-bottom: var(--s2); }
}

/* Headings inside long documents */
.doc-layout h2, .doc-layout h3 {
  scroll-margin-top: 1.5rem;
  position: relative;
}

.doc-layout h2 { margin-top: var(--s7); }
.doc-layout h3 { margin-top: var(--s6); }
.doc-layout article > :first-child { margin-top: var(--s6); }

.anchor {
  position: absolute;
  left: -1.1em;
  width: 1em;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
}

h2:hover > .anchor, h3:hover > .anchor, .anchor:focus, .anchor:focus-visible { opacity: 1; }

@media (max-width: 47.99rem) {
  .anchor { position: static; display: inline-block; width: 0; overflow: hidden; vertical-align: top; }
  .anchor:focus, .anchor:focus-visible { width: auto; margin-right: 0.3em; }
}

/* ---------- Tables ---------- */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-top: var(--s4);
}

.table-scroll table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.table-scroll caption {
  caption-side: top;
  text-align: left;
  padding-bottom: var(--s2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-scroll th {
  text-align: left;
  font-weight: 600;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule-strong);
  padding: 0.55rem 0.75rem;
  vertical-align: bottom;
  white-space: nowrap;
}

.table-scroll td {
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.75rem;
  vertical-align: top;
}

.table-scroll td code { font-size: 0.85rem; overflow-wrap: normal; }

.table-scroll td:first-child { white-space: nowrap; }

/* ---------- Paper index ---------- */
.chapters {
  list-style: none;
  padding: 0;
  margin-top: var(--s6);
  max-width: 50rem;
  border-top: 1px solid var(--rule-strong);
  counter-reset: chapter;
}

.chapters li {
  counter-increment: chapter;
  border-bottom: 1px solid var(--rule);
}

.chapters a {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: var(--s3);
  padding-block: var(--s4);
  text-decoration: none;
  color: var(--ink-2);
}

.chapters a::before {
  content: counter(chapter);
  grid-row: 1 / span 2;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chapters strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.chapters a:hover strong {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.chapters + p { margin-top: var(--s6); }

/* ---------- Pager ---------- */
.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  max-width: 44rem;
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.pager a { text-decoration: none; display: block; }

.pager .pager-k {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.pager .pager-t {
  display: block;
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--ink);
}

.pager a:hover .pager-t {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

@media (min-width: 40rem) {
  .pager { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pager .pager-all { text-align: center; grid-column: 2; }
  .pager .pager-prev { grid-column: 1; grid-row: 1; }
  .pager .pager-next { text-align: right; grid-column: 3; grid-row: 1; }
}

/* ---------- Library (used by the documents page) ---------- */
.library { margin-top: var(--s6); }
.library th[scope="rowgroup"] {
  background: none;
  border-bottom: 1px solid var(--rule);
  padding-top: var(--s5);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Reduced motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  :root {
    --paper: #fff; --paper-2: #fff; --ink: #000; --ink-2: #000; --muted: #333;
    --rule: #999; --rule-strong: #000; --accent: #000;
  }
  body { background: #fff; color: #000; }
  .site-nav, .toc, .toc-details, .footer-links, .skip, .anchor, .actions { display: none !important; }
  .site-footer { margin-top: var(--s6); padding-block: var(--s4); }
  pre { white-space: pre-wrap; border-color: #999; }
  tr, pre { break-inside: avoid; }
  h1, h2, h3, h4 { break-after: avoid; }
  a { text-decoration: none; }
}

/* =====================================================================
   PART 2 (appended): document library and document pages.
   Used by /spec/, /spec/*.html, /spec/handoff/v0/, /spec/handoff/v0/fixtures/
   and /verify/. Nothing above this line was changed.
   ===================================================================== */

/* Rendered documents: serif prose, sans tables and labels */
.doc-body { min-width: 0; }
.doc-body > :first-child { margin-top: var(--s6); }
.doc-body h2 { margin-top: var(--s7); }
.doc-body h3 { margin-top: var(--s6); }
.doc-body h4 { margin-top: var(--s5); font-size: 1rem; }
.doc-body h2 + *, .doc-body h3 + *, .doc-body h4 + * { margin-top: var(--s3); }
.doc-body ul, .doc-body ol { padding-left: 1.4em; }
.doc-body li + li { margin-top: 0.45em; }
.doc-body li > ul, .doc-body li > ol { margin-top: 0.45em; }
.doc-body li > p + p, .doc-body li > p + ul, .doc-body li > p + ol, .doc-body li > ul + p { margin-top: 0.45em; }
.doc-body li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.doc-body pre { margin-top: var(--s3); }
.doc-body .table-scroll table { font-family: var(--sans); font-size: 0.875rem; }
.doc-body .table-scroll table.wide { min-width: 40rem; }
.doc-body .table-scroll td:first-child { white-space: normal; }
.doc-body .table-scroll th { white-space: normal; }

.doc-source, .doc-back {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}
.doc-source { margin-top: var(--s7) !important; padding-top: var(--s4); border-top: 1px solid var(--rule); }
.doc-source .sha { font-size: 0.8125rem; }

/* Wide documents (the fixture index): full text width, no contents rail */
.doc-wide {
  margin-top: var(--s6);
  padding-top: var(--s2);
  border-top: 1px solid var(--rule);
}
.doc-wide .doc-body > p { max-width: 44rem; }
.doc-wide h2 { position: relative; scroll-margin-top: 1.5rem; max-width: 44rem; }
.doc-wide .table-scroll td:nth-child(4) { white-space: nowrap; }
.doc-wide .table-scroll table.wide { min-width: 60rem; }

/* Meta block */
.meta dd a { text-decoration-color: currentColor; }
.meta .sha { display: inline; }
.doc-head .meta { margin-top: var(--s5); }
.doc-head .doc-intro { margin-top: var(--s5); max-width: 44rem; }
.doc-head .doc-intro + .doc-intro { margin-top: var(--s3); }

/* Hand-written document pages: sections inside the article */
.doc-section + .doc-section { margin-top: var(--s7); }
.doc-layout article > .doc-section:first-child { margin-top: var(--s6); }
.doc-section > h2 + * { margin-top: var(--s4); }
.doc-section > * + * { margin-top: var(--s4); }

/* Required lines (gateway protocol) */
.required-lines {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}
.required-lines li {
  padding-block: var(--s4);
  border-bottom: 1px solid var(--rule);
}
.required-lines .required-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s1);
}

/* Library (documents index) */
.library table { min-width: 44rem; }
.library td:first-child { white-space: normal; min-width: 10rem; }
.library td:first-child a { font-weight: 600; }
.library td.lib-what { color: var(--ink-2); min-width: 16rem; }
.library td.lib-ver, .library td.lib-lic { white-space: nowrap; font-size: 0.875rem; }
.library td.lib-files { white-space: nowrap; font-size: 0.875rem; }
.library td.lib-files .sha { font-size: 0.8125rem; }
.library tbody + tbody th[scope="rowgroup"] { padding-top: var(--s6); }
.library-note { margin-top: var(--s5); }

/* Sample files list (verification) */
.files { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.files li { padding-block: var(--s3); border-bottom: 1px solid var(--rule); }
.files .sha { display: block; color: var(--muted); margin-top: var(--s1); }

@media print {
  .doc-body .table-scroll table.wide, .library table, .doc-wide .table-scroll table.wide { min-width: 0; }
}
/* ===================== end of PART 2 rules ===================== */

/* ===================== SITE-0916 review fixes (appended) ===================== */
/* White paper: section headings and lists inside a chapter */
.chapter h2 { font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem); margin-top: var(--s7); }
.chapter h2 + * { margin-top: var(--s3); }
.chapter ul { padding-left: 1.4em; }
.chapter li + li { margin-top: var(--s2); }
.chapter li::marker { color: var(--muted); }

/* Phones: the documents library reads as stacked rows; the gate summary wraps */
@media (max-width: 39.99rem) {
  .library table { min-width: 0; }
  .library thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .library tbody tr, .library td, .library th[scope="rowgroup"] { display: block; }
  .library tbody tr { padding-block: var(--s3); border-bottom: 1px solid var(--rule); }
  .library td { border: 0; padding: 0.15rem 0; white-space: normal; min-width: 0; }
  .library td:first-child, .library td.lib-what, .library td.lib-ver, .library td.lib-lic, .library td.lib-files { white-space: normal; min-width: 0; }
  .library td.lib-files .sha { overflow-wrap: anywhere; }
  .gate-summary { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* ---------- Institutions: four blocks, two by two (INSTITUTIONS-COPY §1.3) ---------- */
@media (min-width: 40rem) {
  .blocks.blocks-2x2 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s6); }
  .blocks.blocks-2x2 .block { padding: 0 var(--s6); border-top: 0; border-left: 0; }
  .blocks.blocks-2x2 .block:nth-child(odd) { padding-left: 0; }
  .blocks.blocks-2x2 .block:nth-child(even) { padding-right: 0; border-left: 1px solid var(--rule); }
  .blocks.blocks-2x2 .block:nth-child(n+3) { padding-top: var(--s6); border-top: 1px solid var(--rule); }
}

/* ---------- Verifier page (/verify/run.html) ---------- */
.checker { margin-top: var(--s5); }
.checker-field { margin-top: var(--s5); }
.checker-field label { display: block; font-weight: 600; margin-bottom: var(--s2); }
.checker textarea {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: var(--s3);
  resize: vertical;
}
.checker textarea:focus-visible, .btn-quiet:focus-visible, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.checker-file { margin-top: var(--s2); font-size: 0.875rem; color: var(--muted); }
.checker-filename { font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.checker-actions { margin-top: var(--s5); }
button.btn { border: 0; cursor: pointer; }
button.btn:disabled, .btn-quiet:disabled { opacity: 0.6; cursor: progress; }
.btn-quiet {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  cursor: pointer;
}
.btn-quiet:hover { color: var(--accent); border-color: var(--accent); }
.checker-file .btn-quiet { min-height: 2rem; font-size: 0.875rem; }
.checker-result { border-top: 1px solid var(--rule-strong); padding-top: var(--s5); }
.checker-result .verdict { font-size: 1.125rem; }
.checker-result .verdict-note, .record-state { margin-top: var(--s3); }
.record-state .code-label { margin-top: var(--s4); }
.record-state-line { font-family: var(--mono); font-size: 0.875rem; overflow-wrap: anywhere; }
.findings { list-style: none; padding: 0; margin-top: var(--s3); }
.findings li { padding-block: var(--s2); border-bottom: 1px solid var(--rule); font-size: 0.875rem; overflow-wrap: anywhere; }
.findings code { font-size: 0.8125rem; }
.findings .f-level { color: var(--muted); }
.findings .f-msg { color: var(--ink-2); }
.suite-total { margin-top: var(--s4); }
/* SITE-0916 DELTA2: classes set by /verify/run.mjs on finding rows (append-only) */
.findings .f-code { color: var(--ink); font-weight: 600; }
.findings .f-seq, .findings .f-class { color: var(--muted); }
.findings-time { margin-top: var(--s4); }
