/* =====================================================================
   HOME WATER BLUEPRINT — design system stylesheet (candidate v1.0)
   Self-contained. No external fonts, no framework. See design-system/design-system.md.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Colour */
  --paper: #F6F3EC;        /* limestone page ground */
  --paper-2: #EDE8DD;      /* panel ground */
  --white: #FFFFFF;        /* tables, inputs */
  --ink: #1F2E35;          /* slate: body text, headings (12.6:1 on paper) */
  --ink-2: #4A585E;        /* secondary text (6.6:1 on paper) */
  --rule: #B9AF9C;         /* hairlines (decorative only) */
  --rule-strong: #6F6A5E;  /* table/input borders (non-text 3:1+) */
  --copper: #A4562F;       /* accent marks, rules, large display only (4.8:1 on paper) */
  --link: #8F431F;         /* links (6.3:1 paper, 5.8:1 panel) */
  --link-hover: #6A2F14;
  --estuary: #285E62;      /* information accent (6.6:1 paper) */
  --info-bg: #E3EEEE;
  --safety: #8E2A1E;       /* stop / escalate */
  --safety-bg: #F7E4DD;
  --caution: #6E5200;
  --caution-bg: #F6EDCF;
  --ok: #2E5B39;           /* safe homeowner check */
  --ok-bg: #E4EEE4;
  --focus: #1F2E35;
  --focus-on-dark: #F2C9A8;
  --footer-bg: #1F2E35;
  --footer-ink: #F6F3EC;

  /* Type */
  --font-text: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.889rem;   /* 16px at 18px root text */
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.44rem;
  --step-3: 1.728rem;
  --step-4: 2.074rem;
  --step-5: 2.488rem;

  /* Space (4px base) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;

  /* Layout */
  --measure: 68ch;
  --wide: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 3px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* 17px */
@media (min-width: 60em) { html { font-size: 112.5%; } } /* 18px */
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: var(--step-0); line-height: 1.6;
  font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums;
}
img, svg, picture { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0; font-weight: 700; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(var(--step-3), 4.2vw, var(--step-5)); letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); margin-top: var(--s-7); }
h3 { font-size: var(--step-1); margin-top: var(--s-6); }
h4 { font-size: var(--step-0); margin-top: var(--s-5); font-family: var(--font-ui); }
p, ul, ol, dl, table, figure, blockquote { margin: var(--s-4) 0 0; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: var(--s-2); }
strong { font-weight: 700; }
abbr[title] { text-decoration: underline dotted; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-7) 0; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }
sup, sub { line-height: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 1px;
}
.site-footer a:focus-visible { outline-color: var(--focus-on-dark); }

/* Visually hidden until focused (keyboard skip link) */
.skip-link { position: absolute; left: var(--s-4); top: -10rem; z-index: 100; background: var(--ink); color: var(--paper);
  padding: var(--s-2) var(--s-4); font-family: var(--font-ui); font-size: var(--step--1); }
.skip-link:focus { top: var(--s-2); color: var(--paper); outline-color: var(--focus-on-dark); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 3. Staging banner (staging builds only) ---------- */
.staging-banner { background: #F2C94C; color: var(--ink); font-family: var(--font-ui); font-size: var(--step--1); text-align: center; padding: var(--s-2) var(--gutter); }

/* ---------- 4. Masthead and navigation ---------- */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead__inner { max-width: var(--wide); margin: 0 auto; padding: var(--s-4) var(--gutter) var(--s-3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand img { height: 3.2rem; width: auto; max-width: 60vw; object-fit: contain; }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); letter-spacing: -0.01em; }
.brand__word span { color: var(--copper); }
.nav-primary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); font-family: var(--font-ui); font-size: var(--step--1); }
.nav-primary li + li { margin-top: 0; }
.nav-primary a { color: var(--ink); text-decoration: none; padding: var(--s-2) 0; display: inline-block; border-bottom: 2px solid transparent; }
.nav-primary a:hover, .nav-primary a[aria-current="page"] { border-bottom-color: var(--copper); }

.guide-strip { background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.guide-strip__inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: baseline; gap: var(--s-4); overflow-x: auto; scrollbar-width: thin; }
.guide-strip__label { font-family: var(--font-ui); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); white-space: nowrap; }
.guide-strip ul { list-style: none; display: flex; gap: var(--s-1) var(--s-5); margin: 0; padding: 0; font-family: var(--font-ui); font-size: var(--step--1); white-space: nowrap; }
.guide-strip li + li { margin-top: 0; }
.guide-strip a { display: inline-block; padding: var(--s-3) 0; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.guide-strip a:hover, .guide-strip a[aria-current="page"] { border-bottom-color: var(--copper); }

/* ---------- 5. Page frame ---------- */
.page { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) var(--s-9); }
.breadcrumbs { font-family: var(--font-ui); font-size: 0.85rem; color: var(--ink-2); padding-top: var(--s-5); }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
.breadcrumbs li + li { margin-top: 0; }
.breadcrumbs li + li::before { content: "/"; margin: 0 var(--s-2) 0 var(--s-1); color: var(--rule-strong); }
.breadcrumbs a { color: var(--ink-2); }

.opening { padding: var(--s-6) 0 var(--s-6); border-bottom: 1px solid var(--rule); max-width: 52rem; }
.opening__kicker { font-family: var(--font-ui); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--copper); margin: 0 0 var(--s-3); font-weight: 600; }
.opening__kicker a { color: inherit; text-decoration: none; }
.opening__standfirst { font-size: var(--step-1); line-height: 1.5; color: var(--ink); margin-top: var(--s-4); max-width: 46rem; }
.opening__meta { font-family: var(--font-ui); font-size: 0.85rem; color: var(--ink-2); margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.opening__meta span + span::before { content: "·"; margin-right: var(--s-4); color: var(--rule-strong); }
@media (max-width: 40em) { .opening__meta { flex-direction: column; } .opening__meta span + span::before { content: none; } }
.jur { display: inline-block; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; border: 1px solid currentColor; border-radius: 2px; padding: 0 0.35em; vertical-align: 0.1em; }

/* Two-column guide/article layout: content + sticky contents */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); margin-top: var(--s-6); }
@media (min-width: 64em) {
  .layout--with-toc { grid-template-columns: minmax(0, var(--measure)) 15rem; justify-content: space-between; }
  .layout--with-toc .toc { grid-column: 2; grid-row: 1; position: sticky; top: var(--s-5); align-self: start; max-height: calc(100vh - 3rem); overflow: auto; }
  .layout--with-toc .prose { grid-column: 1; grid-row: 1; }
}
.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose h2 { padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.prose h2::before { content: ""; display: block; width: 2.5rem; height: 3px; background: var(--copper); margin: calc(-1 * var(--s-4) - 2px) 0 var(--s-4); }
.prose li > p { margin-top: var(--s-2); }

.toc { font-family: var(--font-ui); font-size: var(--step--1); border-left: 3px solid var(--copper); padding-left: var(--s-4); }
.toc__title { font-weight: 700; margin: 0 0 var(--s-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li + li { margin-top: var(--s-2); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 63.99em) { .toc { background: var(--paper-2); padding: var(--s-4); border-left-width: 3px; } }

/* ---------- 6. Panels ---------- */
.panel { margin: var(--s-5) 0 0; padding: var(--s-4) var(--s-5); background: var(--paper-2); border-left: 4px solid var(--rule-strong); }
.panel > :first-child { margin-top: 0; }
.panel__title { font-family: var(--font-ui); font-weight: 700; font-size: var(--step--1); letter-spacing: 0.02em; margin: 0 0 var(--s-2); }
.panel__title::before { font-family: var(--font-ui); margin-right: 0.4em; }
.panel--answer { background: var(--white); border-left-color: var(--copper); border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.panel--answer .panel__title { color: var(--copper); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.panel--info { background: var(--info-bg); border-left-color: var(--estuary); }
.panel--info .panel__title { color: var(--estuary); }
.panel--safety { background: var(--safety-bg); border-left-color: var(--safety); }
.panel--safety .panel__title { color: var(--safety); }
.panel--safety .panel__title::before { content: "Stop:"; }
.panel--caution { background: var(--caution-bg); border-left-color: var(--caution); }
.panel--caution .panel__title { color: var(--caution); }
.panel--caution .panel__title::before { content: "Caution:"; }
.panel--check { background: var(--ok-bg); border-left-color: var(--ok); }
.panel--check .panel__title { color: var(--ok); }
.panel--check .panel__title::before { content: "You can check:"; }
.panel--pro { background: var(--paper-2); border-left-color: var(--ink); }
.panel--pro .panel__title::before { content: "Professional job:"; }
.panel--uk .panel__title::before { content: "UK"; border: 1px solid; padding: 0 0.3em; font-size: 0.75rem; }
.panel--us .panel__title::before { content: "US"; border: 1px solid; padding: 0 0.3em; font-size: 0.75rem; }

/* ---------- 7. Tables ---------- */
.table-wrap { margin-top: var(--s-5); overflow-x: auto; border-top: 2px solid var(--ink); }
.table-wrap:focus-visible { outline-offset: 4px; }
table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: var(--step--1); font-variant-numeric: lining-nums tabular-nums; background: transparent; margin-top: 0; line-height: 1.45; }
caption { text-align: left; font-weight: 700; padding: var(--s-3) 0; caption-side: top; font-family: var(--font-ui); }
th, td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; }
thead th { border-bottom: 1px solid var(--ink); white-space: nowrap; }
td:last-child, th:last-child { padding-right: 0; }
td.num, th.num { text-align: right; }
@media (max-width: 40em) { .table-wrap table.table--wide { min-width: 36rem; } }

/* ---------- 8. Lists and editorial components ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 var(--s-4) 3.2rem; border-left: 1px solid var(--rule); margin: 0 0 0 1.1rem; }
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before { content: counter(step); position: absolute; left: -1.1rem; top: -0.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--copper); color: var(--ink); font-family: var(--font-ui); font-weight: 700; display: grid; place-items: center; }
.steps > li > strong:first-child { display: block; font-family: var(--font-display); font-size: var(--step-1); }
.steps li + li { margin-top: 0; }

.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 1.8rem; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 1rem; height: 1rem; border: 2px solid var(--ink-2); border-radius: 2px; }

.keyfacts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); font-family: var(--font-ui); font-size: var(--step--1); }
.keyfacts dt { font-weight: 700; }
.keyfacts dd { margin: 0; }
@media (max-width: 40em) { .keyfacts { grid-template-columns: 1fr; } .keyfacts dd { margin-bottom: var(--s-3); } }

blockquote { border-left: 3px solid var(--copper); padding-left: var(--s-5); font-style: italic; }

/* Homepage route index: typographic, not a card grid */
.routes { list-style: none; padding: 0; margin-top: var(--s-5); border-top: 2px solid var(--ink); }
.routes > li { display: grid; grid-template-columns: 1fr; gap: var(--s-1) var(--s-6); padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); margin: 0; }
@media (min-width: 48em) { .routes > li { grid-template-columns: 17rem 1fr; align-items: baseline; } }
.routes__need { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; }
.routes__go { margin: 0; }
.routes__go a { font-family: var(--font-ui); font-weight: 600; }

.home-opening { display: grid; gap: var(--s-6); padding: var(--s-7) 0 var(--s-6); border-bottom: 1px solid var(--rule); align-items: center; }
@media (min-width: 60em) { .home-opening { grid-template-columns: 1.15fr 1fr; } }
.home-opening h1 { font-size: clamp(var(--step-4), 5vw, 3.2rem); }

.split { display: grid; gap: var(--s-6); }
@media (min-width: 60em) { .split { grid-template-columns: 1fr 1fr; } }

.feature-list { list-style: none; padding: 0; }
.feature-list li { border-top: 1px solid var(--rule); padding: var(--s-4) 0 0; margin-top: var(--s-4); }
.feature-list__cat { font-family: var(--font-ui); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); display: block; }
.feature-list a { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; text-decoration: none; color: var(--ink); }
.feature-list a:hover { color: var(--link); text-decoration: underline; }
.feature-list p { margin-top: var(--s-1); color: var(--ink-2); }

/* Related reading and guide children */
.related { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 2px solid var(--ink); max-width: var(--wide); }
.related h2 { margin-top: 0; font-size: var(--step-2); border: 0; padding: 0; }
.related h2::before { display: none; }
.related__list { list-style: none; padding: 0; display: grid; gap: var(--s-4) var(--s-6); }
@media (min-width: 48em) { .related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72em) { .related__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.related__list li { margin: 0; padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.related__list a { font-family: var(--font-display); font-weight: 700; font-size: var(--step-0); }
.related__list p { margin-top: var(--s-1); font-size: var(--step--1); color: var(--ink-2); font-family: var(--font-ui); }
.related__rel { display: block; font-family: var(--font-ui); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }

/* Sources */
.sources { margin-top: var(--s-7); font-family: var(--font-ui); font-size: var(--step--1); max-width: var(--measure); }
.sources h2 { font-size: var(--step-1); margin-top: 0; padding: 0; border: 0; }
.sources h2::before { display: none; }
.sources ol { padding-left: 1.6em; }
.sources li { color: var(--ink-2); }
.sources li:target { background: var(--caution-bg); }
.sources .src-status { font-size: 0.75rem; }
.cite a { text-decoration: none; font-family: var(--font-ui); font-size: 0.72em; font-weight: 700; padding: 0 0.1em; }
.correction-note { font-family: var(--font-ui); font-size: var(--step--1); color: var(--ink-2); margin-top: var(--s-6); max-width: var(--measure); }

/* ---------- 9. Figures and image placeholders ---------- */
figure { margin: var(--s-6) 0 0; }
figure img { width: 100%; background: var(--paper-2); }
figcaption { font-family: var(--font-ui); font-size: 0.85rem; color: var(--ink-2); margin-top: var(--s-2); max-width: var(--measure); }
.image-key { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s-2) var(--s-4); counter-reset: image-key; font-family: var(--font-ui); font-size: var(--step--1); }
.image-key li { counter-increment: image-key; display: grid; grid-template-columns: 1.8rem 1fr; gap: var(--s-2); align-items: center; margin: 0; }
.image-key li::before { content: counter(image-key); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); font-weight: 700; }
.figure--diagram img { background: var(--white); border: 1px solid var(--rule); padding: var(--s-3); }
.figure--diagram__full { font-family: var(--font-ui); font-size: var(--step--1); margin-left: var(--s-3); }
.figure--diagram details { font-family: var(--font-ui); font-size: var(--step--1); margin-top: var(--s-2); }
.img-ph { border: 2px dashed var(--rule-strong); background: repeating-linear-gradient(135deg, var(--paper-2) 0 12px, var(--paper) 12px 24px); padding: var(--s-5); font-family: var(--font-ui); font-size: var(--step--1); display: grid; place-content: center; text-align: center; min-height: 12rem; }
.img-ph__id { font-family: var(--font-mono); font-weight: 700; }

/* ---------- 10. Buttons and forms ---------- */
.btn { display: inline-block; font-family: var(--font-ui); font-weight: 600; font-size: var(--step--1); padding: 0.6em 1.1em; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; border-radius: var(--radius); cursor: pointer; }
.btn:hover { background: var(--link-hover); border-color: var(--link-hover); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.tool { margin-top: var(--s-5); padding: var(--s-5); background: var(--white); border: 1px solid var(--rule-strong); font-family: var(--font-ui); font-size: var(--step--1); }
.tool > :first-child { margin-top: 0; }
.tool__title { font-weight: 700; font-size: var(--step-0); }
.tool__grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-top: var(--s-4); }
.tool label { display: block; font-weight: 600; margin-bottom: var(--s-1); }
.tool .hint { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.8rem; }
.tool input, .tool select { width: 100%; min-height: 44px; font: inherit; font-size: 1rem; padding: 0.5em 0.6em; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); color: var(--ink); }
.tool output, .tool__result { display: block; margin-top: var(--s-4); padding: var(--s-4); background: var(--paper-2); font-variant-numeric: tabular-nums; }
.tool noscript p { color: var(--ink-2); }
.tool-page { border-top: 5px solid var(--copper); }
.tool-page fieldset { border: 1px solid var(--rule); padding: var(--s-4); margin: var(--s-4) 0 0; min-width: 0; }
.tool-page legend { font-weight: 700; padding: 0 var(--s-2); }
.tool-page .btn { margin-top: var(--s-4); min-height: 44px; }
.tool-options, .compare-grid, .result-grid, .quote-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s-4); }
.tool-options { margin-top: var(--s-4); }
.quote-fields { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.result-list { margin-top: 0; padding-left: 1.4em; }
.result-title { font-family: var(--font-text); font-size: var(--step-1); font-weight: 700; margin: 0; }
.tool-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }
.tool-cards li { border-top: 4px solid var(--copper); background: var(--white); padding: var(--s-4); }
.tool-cards li + li { margin-top: 0; }
.tool-cards a { font-family: var(--font-ui); font-size: var(--step-1); font-weight: 700; }
.tool-cards p { color: var(--ink-2); margin-top: var(--s-2); }
@media (min-width: 60em) {
  .tool-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tool-cards li { grid-column: span 2; }
  .tool-cards li:nth-last-child(2) { grid-column: 2 / span 2; }
}

/* Library filter */
.library-controls { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: end; margin-top: var(--s-5); font-family: var(--font-ui); }
.library-controls label { font-weight: 600; font-size: var(--step--1); display: block; }
.library-controls input { font: inherit; padding: 0.5em 0.6em; border: 1px solid var(--rule-strong); border-radius: var(--radius); min-width: 16rem; }
.library-group { margin-top: var(--s-7); }
.library-group h2 { margin-top: 0; }
.library-list { list-style: none; padding: 0; display: grid; gap: var(--s-4) var(--s-6); }
@media (min-width: 48em) { .library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.library-list li { margin: 0; border-top: 1px solid var(--rule); padding-top: var(--s-3); }
.library-list a { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.library-list p { margin-top: var(--s-1); font-family: var(--font-ui); font-size: var(--step--1); color: var(--ink-2); }
.library-empty { font-family: var(--font-ui); }
[hidden] { display: none !important; }

/* ---------- 11. Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); font-family: var(--font-ui); font-size: var(--step--1); margin-top: var(--s-9); }
.site-footer__inner { max-width: var(--wide); margin: 0 auto; padding: var(--s-7) var(--gutter); display: grid; gap: var(--s-6); }
@media (min-width: 48em) { .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-heading { color: var(--footer-ink); font-family: var(--font-ui); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 var(--s-3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: var(--s-2); }
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: var(--focus-on-dark); }
.site-footer__about p { margin: 0 0 var(--s-3); max-width: 28rem; }
.site-footer__brand { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; }
.site-footer__legal { grid-column: 1 / -1; border-top: 1px solid #44535A; padding-top: var(--s-4); font-size: 0.8rem; }

/* ---------- 12. Motion ---------- */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } a, .btn { transition: color .12s, background-color .12s, border-color .12s; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- 13. Forced colours / high contrast ---------- */
@media (forced-colors: active) {
  .panel { border: 1px solid CanvasText; }
  .steps > li::before { border-color: CanvasText; }
  .prose h2::before { background: CanvasText; }
}

/* ---------- 14. Print ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  html { font-size: 11pt; }
  body { background: #fff; color: #000; }
  .masthead nav, .guide-strip, .toc, .site-footer, .staging-banner, .skip-link, .related, .tool, .library-controls, .img-ph { display: none !important; }
  .masthead { border: 0; }
  .layout { display: block; }
  .prose { max-width: none; }
  a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; word-break: break-all; }
  .panel { background: none; border: 1px solid #000; break-inside: avoid; }
  table, figure, .steps > li { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .sources { font-size: 9pt; }
}
