/* SRC-20 protocol documentation. Philatelic album styling.
   Hand-authored. No build step, no external assets, no fonts loaded over the network. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  --paper: #f7f2e7;
  --paper-edge: #ece3cf;
  --card: #fffdf7;
  --card-alt: #f2ecdc;

  --ink: #1c1a15;
  --ink-soft: #4f4a3d;
  --rule: #cfc4a9;
  --rule-soft: #e2d9c2;

  --accent: #14386e;
  --accent-strong: #0d2851;
  --accent-wash: #e3e9f4;
  --on-accent: #f8f5ec;

  --cancel: #7a2618;
  --cancel-wash: #f3e2dc;

  --ok: #1f5b32;
  --ok-wash: #e0eee4;

  --focus: #0d2851;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 74rem;
  --readw: 44rem;
  --radius: 3px;
  --shadow: 0 1px 0 rgba(28, 26, 21, .06), 0 6px 18px -12px rgba(28, 26, 21, .5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --paper: #14120e;
    --paper-edge: #0e0c09;
    --card: #1d1a14;
    --card-alt: #24211a;

    --ink: #f0e9d8;
    --ink-soft: #bdb39a;
    --rule: #3a352a;
    --rule-soft: #2a261e;

    --accent: #8fb6ec;
    --accent-strong: #b6d0f5;
    --accent-wash: #1a2436;
    --on-accent: #0b1526;

    --cancel: #e0937f;
    --cancel-wash: #2e1b15;

    --ok: #86ce9d;
    --ok-wash: #16281c;

    --focus: #b6d0f5;

    --shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 8px 22px -14px rgba(0, 0, 0, .9);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --paper: #14120e;
  --paper-edge: #0e0c09;
  --card: #1d1a14;
  --card-alt: #24211a;

  --ink: #f0e9d8;
  --ink-soft: #bdb39a;
  --rule: #3a352a;
  --rule-soft: #2a261e;

  --accent: #8fb6ec;
  --accent-strong: #b6d0f5;
  --accent-wash: #1a2436;
  --on-accent: #0b1526;

  --cancel: #e0937f;
  --cancel-wash: #2e1b15;

  --ok: #86ce9d;
  --ok-wash: #16281c;

  --focus: #b6d0f5;

  --shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 8px 22px -14px rgba(0, 0, 0, .9);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-x: hidden;
}

/* Faint album-paper tooth. Two very low-contrast gradients, no images. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 12%, var(--card-alt) 0, transparent 42%),
    radial-gradient(circle at 82% 78%, var(--card-alt) 0, transparent 46%);
  opacity: .55;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -.005em; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2rem); margin-top: 2.6rem; }
h3 { font-size: clamp(1.15rem, 1.03rem + .55vw, 1.35rem); margin-top: 1.9rem; }
h4, .label-head {
  font-size: 1.02rem;
  margin-top: 1.4rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-family: var(--font-ui);
  color: var(--ink-soft);
}
/* .label-head lets a heading keep the h4 look while sitting at the level the
   document outline actually requires. */
.panel > .label-head:first-child { margin-top: 0; }

p, ul, ol, dl { margin: 0 0 1rem; }
li { margin-bottom: .35rem; }
li > ul, li > ol { margin-top: .35rem; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: from-font; }
a:hover { color: var(--accent-strong); }

strong { font-weight: 700; }
abbr[title] { text-decoration-style: dotted; cursor: help; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img, svg { max-width: 100%; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

code, kbd, samp { font-family: var(--font-mono); font-size: .875em; }
:not(pre) > code {
  background: var(--card-alt);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: .08em .34em;
  word-break: break-word;
}

pre {
  font-family: var(--font-mono);
  font-size: .84rem;
  line-height: 1.55;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 0 0 1rem;
  overflow-x: auto;
  tab-size: 2;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.skip-link {
  position: absolute;
  left: .5rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: .6rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: .5rem; color: var(--on-accent); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- layout ---------- */
.wrap { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
@media (max-width: 26rem) { .wrap { width: calc(100% - 1.5rem); } }

main { padding-bottom: 3rem; }
.prose { max-width: var(--readw); }
.prose-wide { max-width: 60rem; }

section[id], h2[id], h3[id] { scroll-margin-top: 5.5rem; }

/* ---------- perforation motifs ---------- */
/* A perforated tear line, used as a section divider. */
.perf {
  border: 0;
  height: 15px;
  margin: 2.8rem 0;
  background-image: radial-gradient(circle at center, var(--rule) 3.1px, transparent 3.6px);
  background-size: 15px 15px;
  background-repeat: repeat-x;
  background-position: left center;
}
.perf-tight { margin: 1.6rem 0; }

/* A card punched like the edge of a stamp. The punch colour is the page ground. */
.stamp {
  position: relative;
  background-color: var(--card);
  background-image:
    radial-gradient(circle 5px at 8px 8px, var(--paper) 96%, transparent 100%),
    radial-gradient(circle 5px at 8px 8px, var(--paper) 96%, transparent 100%),
    radial-gradient(circle 5px at 8px 8px, var(--paper) 96%, transparent 100%),
    radial-gradient(circle 5px at 8px 8px, var(--paper) 96%, transparent 100%);
  background-size: 16px 16px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-position: 8px -8px, 8px calc(100% + 8px), -8px 8px, calc(100% + 8px) 8px;
  padding: 1.5rem 1.35rem;
  box-shadow: var(--shadow);
}
@media (max-width: 40rem) { .stamp { padding: 1.2rem 1.05rem; } }

/* Plain bordered panel, for dense content where punches would crowd the text. */
.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}
.panel > :last-child, .stamp > :last-child, .note > :last-child { margin-bottom: 0; }
.panel > :first-child, .stamp > :first-child, .note > :first-child { margin-top: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(8px)) { .site-header { background: var(--paper); } }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .55rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .01em;
}
.brand:hover { color: var(--accent); }
.brand-mark { flex: none; width: 30px; height: 34px; }

.site-nav { margin-left: auto; }
.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: .875rem;
}
.site-nav a {
  display: block;
  padding: .38rem .6rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink-soft);
}
.site-nav a:hover { background: var(--accent-wash); color: var(--accent-strong); }
.site-nav a[aria-current="page"] {
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.header-tools { display: flex; align-items: center; gap: .4rem; }

.theme-toggle {
  font: inherit;
  font-family: var(--font-ui);
  font-size: .8rem;
  line-height: 1;
  padding: .45rem .6rem;
  background: var(--card);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ---------- search ---------- */
.search { position: relative; font-family: var(--font-ui); }
.search-input {
  font: inherit;
  font-size: .85rem;
  width: 12.5rem;
  max-width: 42vw;
  padding: .42rem .6rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.search-input::placeholder { color: var(--ink-soft); opacity: .85; }
.search-input:focus { border-color: var(--accent); }

.search-results {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  width: min(30rem, 88vw);
  max-height: min(28rem, 65vh);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: .3rem;
  font-size: .875rem;
}
.search-results:empty { display: none; }
.search-results li { margin: 0; }
.search-results a {
  display: block;
  padding: .45rem .55rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
}
.search-results a:hover, .search-results a:focus-visible { background: var(--accent-wash); }
.search-results .r-page {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
}
.search-results .r-title { font-weight: 600; color: var(--accent-strong); }
.search-results .r-snip { display: block; color: var(--ink-soft); font-size: .8rem; }
.search-empty { padding: .7rem .6rem; color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero { padding: 2.6rem 0 1.2rem; }
.hero-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 54rem) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  font-family: var(--font-ui);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--cancel);
  margin: 0 0 .7rem;
}
.lede { font-size: 1.16rem; color: var(--ink-soft); max-width: 40rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.4rem; }
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 600;
  padding: .6rem 1.05rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  background: var(--card);
}
.btn:hover { background: var(--accent-wash); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }

/* ---------- denomination panels ---------- */
.denoms {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  padding: 0;
  margin: 1.4rem 0;
  list-style: none;
}
.denom {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  padding: .8rem .9rem;
  margin: 0;
  box-shadow: var(--shadow);
}
.denom-label {
  display: block;
  font-family: var(--font-ui);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  opacity: .85;
}
.denom-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: .28rem;
  word-break: break-word;
}
.denom-value.small { font-size: 1rem; }
.denom-note { display: block; font-family: var(--font-ui); font-size: .74rem; opacity: .85; margin-top: .25rem; }

/* Outlined variant, for use inside prose where a solid block would be heavy. */
.denom-outline {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--accent);
}
.denom-outline .denom-label { color: var(--accent); opacity: 1; }
.denom-outline .denom-note { color: var(--ink-soft); opacity: 1; }

/* ---------- cards ---------- */
.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  list-style: none;
  padding: 0;
  margin: 1.6rem 0;
}
.cards > li { margin: 0; }
.card-index {
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cancel);
}
.card h3 { margin-top: .35rem; font-size: 1.14rem; }
.card p { font-size: .95rem; color: var(--ink-soft); margin-bottom: 0; }
.card a { font-weight: 600; }

/* ---------- notes ---------- */
.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .9rem 1.1rem;
  margin: 1.4rem 0;
  font-size: .95rem;
}
.note-title {
  display: block;
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: .3rem;
  color: var(--accent-strong);
}
.note-warn { border-left-color: var(--cancel); background: var(--cancel-wash); }
.note-warn .note-title { color: var(--cancel); }
.note-ok { border-left-color: var(--ok); background: var(--ok-wash); }
.note-ok .note-title { color: var(--ok); }

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-family: var(--font-ui); }
caption {
  text-align: left;
  font-family: var(--font-ui);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: .7rem .85rem .1rem;
}
th, td { text-align: left; padding: .55rem .85rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
thead th {
  background: var(--card-alt);
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.col-narrow { width: 1%; white-space: nowrap; }

.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--cancel); font-weight: 700; }

/* ---------- rule list (numbered normative rules) ---------- */
.rules { list-style: none; padding: 0; margin: 1.2rem 0; counter-reset: none; }
.rules > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .3rem .9rem;
  padding: .75rem 0;
  border-top: 1px solid var(--rule-soft);
  margin: 0;
}
.rules > li:last-child { border-bottom: 1px solid var(--rule-soft); }
.rule-id {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 2px;
  padding: .16rem .45rem;
  height: fit-content;
  white-space: nowrap;
}
/* min-width: 0 lets a wide <pre> scroll inside the rule instead of stretching
   the grid track past the viewport. */
.rule-body { margin: 0; min-width: 0; }
.rule-body > :last-child { margin-bottom: 0; }
@media (max-width: 32rem) {
  .rules > li { grid-template-columns: minmax(0, 1fr); }
  .rule-id { justify-self: start; }
}

/* ---------- definition list ---------- */
.terms { display: grid; gap: 0; }
.terms dt {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .95rem;
  color: var(--accent-strong);
  border-top: 1px solid var(--rule-soft);
  padding-top: .8rem;
}
.terms dd { margin: .25rem 0 .85rem; color: var(--ink-soft); }

/* ---------- figures / diagrams ---------- */
figure { margin: 1.8rem 0; }
figure.plate {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
figure.plate svg { display: block; width: 100%; height: auto; }
/* Keep diagram labels legible on narrow screens: scroll rather than shrink. */
.plate-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plate-scroll svg { min-width: 34rem; }
figcaption {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--ink-soft);
  margin-top: .8rem;
  padding-top: .7rem;
  border-top: 1px solid var(--rule-soft);
}
.plate-title {
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cancel);
  margin-bottom: .7rem;
}

/* Diagram SVG palette. */
.dgm { --d-line: var(--rule); --d-ink: var(--ink); --d-soft: var(--ink-soft); }
.dgm text { font-family: var(--font-ui); fill: var(--ink); }
.dgm .d-label { font-size: 11px; fill: var(--ink-soft); }
.dgm .d-title { font-size: 12px; font-weight: 700; fill: var(--ink); }
.dgm .d-mono { font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink); }
.dgm .d-box { fill: var(--card-alt); stroke: var(--rule); stroke-width: 1.2; }
.dgm .d-box-accent { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.4; }
.dgm .d-box-warn { fill: var(--cancel-wash); stroke: var(--cancel); stroke-width: 1.4; }
.dgm .d-line { stroke: var(--rule); stroke-width: 1.2; fill: none; }
.dgm .d-arrow { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.dgm .d-fill-accent { fill: var(--accent); }
.dgm .d-fill-cancel { fill: var(--cancel); }
.dgm .d-perf { fill: none; stroke: var(--rule); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 0.1 7; }

/* ---------- table of contents ---------- */
.toc {
  background: var(--card-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.6rem 0 2.2rem;
  font-family: var(--font-ui);
  font-size: .9rem;
}
.toc > p { font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
@media (max-width: 40rem) { .toc ol { columns: 1; } }
.toc li { margin-bottom: .3rem; break-inside: avoid; }

/* ---------- validator tool ---------- */
.tool { margin: 1.6rem 0; }
.tool-grid { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 56rem) { .tool-grid { grid-template-columns: 1fr; } }

.tool label {
  display: block;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .4rem;
}
.tool textarea {
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.55;
  width: 100%;
  min-height: 15rem;
  padding: .8rem .9rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  resize: vertical;
}
.tool textarea:focus { border-color: var(--accent); }

.sample-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.sample-row li { margin: 0; }
.chip {
  font: inherit;
  font-family: var(--font-ui);
  font-size: .78rem;
  padding: .3rem .6rem;
  background: var(--card-alt);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-wash); }

.verdict {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-weight: 700;
  padding: .7rem .9rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--rule);
  background: var(--card-alt);
}
.verdict[data-state="valid"] { background: var(--ok-wash); border-color: var(--ok); color: var(--ok); }
.verdict[data-state="invalid"] { background: var(--cancel-wash); border-color: var(--cancel); color: var(--cancel); }
.verdict .verdict-sub { font-weight: 400; font-size: .82rem; color: var(--ink-soft); }

.checks { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.checks li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: .1rem .5rem;
  padding: .55rem 0;
  border-top: 1px solid var(--rule-soft);
  margin: 0;
}
.checks .mark { font-family: var(--font-ui); font-weight: 700; line-height: 1.5; }
.checks .pass .mark { color: var(--ok); }
.checks .fail .mark { color: var(--cancel); }
.checks .info .mark { color: var(--ink-soft); }
.checks .c-name { font-family: var(--font-ui); font-weight: 600; font-size: .88rem; }
.checks .c-detail { color: var(--ink-soft); font-size: .85rem; }
.checks .c-detail code { font-size: .82em; }

.tool-meta { font-family: var(--font-ui); font-size: .78rem; color: var(--ink-soft); margin-top: 1rem; }

/* ---------- vectors ---------- */
.vector { margin: 0 0 1.6rem; }
.vector h3 { margin-top: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.badge {
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 2px;
  white-space: nowrap;
}
.badge-valid { background: var(--ok-wash); color: var(--ok); border: 1px solid var(--ok); }
.badge-invalid { background: var(--cancel-wash); color: var(--cancel); border: 1px solid var(--cancel); }
.badge-neutral { background: var(--accent-wash); color: var(--accent-strong); border: 1px solid var(--accent); }

/* ---------- cancellation mark ---------- */
.cancel-mark { display: block; width: 100%; max-width: 15rem; height: auto; margin: 0 auto; opacity: .9; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--card-alt);
  margin-top: 3rem;
  padding: 2rem 0 2.4rem;
  font-family: var(--font-ui);
  font-size: .84rem;
  color: var(--ink-soft);
}
.footer-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.footer-grid h2 {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin: 0 0 .5rem;
  color: var(--ink);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .3rem; }
.footer-meta { margin: 0; }
.footer-meta dt { font-weight: 700; color: var(--ink); }
.footer-meta dd { margin: 0 0 .4rem; }
.footer-bottom {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  justify-content: space-between;
}

/* ---------- misc ---------- */
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.nowrap { white-space: nowrap; }
.linklist { list-style: none; padding: 0; }
.linklist li { margin-bottom: .45rem; }

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: .88rem;
}

@media print {
  .site-header, .site-nav, .theme-toggle, .search, .page-nav { display: none; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
