/* ==========================================================================
   Upkeep design system v2  ·  assets/css/upkeep.css
   "Workshop manual, magazine cover": sage paper from the photography,
   petrol enamel, one inspection-tag yellow. Archivo (compressed) for
   headlines and UI, Source Serif 4 for reading.
   Reference: private/plan/design-system.md. Do not add page-specific CSS
   elsewhere; extend this file and document the class in design-system.md.
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, OFL; see assets/fonts/LICENSE.txt) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-var-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic-var-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- 2. Tokens: light (default) ---------- */
:root {
  color-scheme: light;
  /* colour */
  --paper: #EDF1EC;          /* page: the sage of the photo surfaces */
  --paper-2: #E0E8E2;        /* panels, image placeholder */
  --card: #F8FAF7;           /* raised: inputs, tool panels, picks */
  --ink: #0F2529;            /* text, heavy rules */
  --ink-2: #46595D;          /* secondary text (6.4:1 on paper) */
  --rule: #BFCBC4;           /* hairlines, decorative only */
  --line: #6E827D;           /* UI borders that must reach 3:1 */
  --petrol: #0B5866;         /* links, brand accents (7:1 on paper) */
  --petrol-hover: #073F49;
  --enamel: #0A3640;         /* deep bands: workshop, footer */
  --on-enamel: #E9F0EC;
  --on-enamel-2: #A9C2BE;
  --enamel-line: rgba(233, 240, 236, .28);
  --enamel-wash: rgba(233, 240, 236, .08);   /* warning rows inside the enamel result panel */
  --alert-on-enamel: #FF8E84;                /* error marker on enamel, both themes */
  --tag: #F6C833;            /* the inspection tag: one bold colour */
  --tag-ink: #0F2529;        /* text on tag, both themes */
  --alert: #A8261C;          /* warning light: see a doctor */
  --alert-wash: #F5E3DF;
  --ok: #2B6A39;             /* done / up to date */
  --ok-wash: #DDEBDF;
  --focus: #0B5866;
  --img-filter: none;
  --cover-ink: #0F2529;

  /* type */
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --t-xs: .75rem;      /* 12 */
  --t-sm: .875rem;     /* 14 */
  --t-base: 1rem;      /* 16 */
  --t-text: 1.125rem;  /* 18 */
  --t-md: 1.3125rem;   /* 21 */
  --t-lg: 1.5rem;      /* 24 */
  --t-xl: 2.25rem;     /* 36 */
  --t-2xl: 3rem;       /* 48 */
  --t-3xl: 3.75rem;    /* 60 */
  --t-4xl: 4.5rem;     /* 72 */
  --lh-tight: .92;
  --lh-head: 1.02;
  --lh-ui: 1.35;
  --lh-text: 1.62;
  --measure: 40rem;

  /* space (4px base) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --wrap: 82rem;
  --section-gap: clamp(3.5rem, 8vw, 6.5rem);

  /* shape */
  --r-0: 0;          /* editorial: images, bands, rails */
  --r-1: 3px;        /* interactive: buttons, inputs, tags */
  --r-2: 8px;        /* data panels: tools, picks, callouts */
  --r-pill: 999px;   /* counts and toggles only */
  --rule-heavy: 3px;

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 160ms;
}

/* ---------- 3. Tokens: dark (system preference unless the reader chose light) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0B1D21; --paper-2: #11282D; --card: #14303A;
    --ink: #E3EBE6; --ink-2: #A3B5B0; --rule: #2A464C; --line: #6A8784;
    --petrol: #74C7D4; --petrol-hover: #A5DDE6;
    --enamel: #0E333B; --on-enamel: #E9F0EC; --on-enamel-2: #A9C2BE; --enamel-line: rgba(233, 240, 236, .22);
    --alert: #FF8E84; --alert-wash: #3A1D1B; --ok: #86D094; --ok-wash: #16331F;
    --focus: #F6C833; --img-filter: brightness(.88) saturate(.95);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0B1D21; --paper-2: #11282D; --card: #14303A;
  --ink: #E3EBE6; --ink-2: #A3B5B0; --rule: #2A464C; --line: #6A8784;
  --petrol: #74C7D4; --petrol-hover: #A5DDE6;
  --enamel: #0E333B; --on-enamel: #E9F0EC; --on-enamel-2: #A9C2BE; --enamel-line: rgba(233, 240, 236, .22);
  --alert: #FF8E84; --alert-wash: #3A1D1B; --ok: #86D094; --ok-wash: #16331F;
  --focus: #F6C833; --img-filter: brightness(.88) saturate(.95);
}

/* ---------- 4. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: var(--lh-ui);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; filter: var(--img-filter); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: var(--lh-head); text-wrap: balance; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--petrol-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
::selection { background: var(--tag); color: var(--tag-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
time { font-variant-numeric: tabular-nums; }

/* helpers */
.u-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s-4); top: -10rem; z-index: 100; background: var(--tag); color: var(--tag-ink); padding: var(--s-3) var(--s-4); font-weight: 700; border: 2px solid var(--tag-ink); border-radius: var(--r-1); }
.skip:focus { top: var(--s-4); }
.block { margin-top: var(--section-gap); }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }

/* ---------- 5. Type roles ---------- */
.section-title {
  font-family: var(--font-display);
  font-stretch: 66%;
  font-weight: 900;
  font-size: clamp(2.25rem, 5vw, var(--t-3xl));
  line-height: var(--lh-tight);
  letter-spacing: -.005em;
}
.section-head { display: grid; gap: var(--s-3); align-items: end; padding-top: var(--s-4); border-top: var(--rule-heavy) solid var(--ink); margin-bottom: var(--s-6); }
.section-head__dek { font-family: var(--font-text); font-size: var(--t-text); line-height: 1.5; color: var(--ink-2); max-width: 36rem; }
@media (min-width: 48rem) {
  .section-head { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-6); }
  .section-head .section-head__dek { grid-column: 1; }
  .section-head .link-more { grid-column: 2; grid-row: 1; justify-self: end; align-self: end; }
}
.link-more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-stretch: 88%; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; text-decoration-color: var(--tag); }
.link-more:hover { color: var(--petrol); text-decoration-color: currentColor; }
.lede { font-family: var(--font-text); font-size: var(--t-md); line-height: 1.45; color: var(--ink-2); max-width: 36rem; }

/* ---------- 6. Masthead + nav ---------- */
.masthead { background: var(--paper); position: relative; z-index: 20; }
.masthead__top { display: flex; align-items: center; gap: var(--s-4); min-height: 4rem; padding-block: var(--s-2); }
.wordmark {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-stretch: 62%;
  font-weight: 900;
  font-size: 2.25rem;
  line-height: .85;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
  padding-right: .27em;
}
.wordmark::after { /* the inspection tag, echoing the favicon */
  content: "";
  position: absolute;
  right: .02em;
  top: .04em;
  width: .2em;
  height: .14em;
  background: var(--tag);
  box-shadow: 0 0 0 1px var(--tag-ink);
  border-radius: 1px;
}
.wordmark:hover { color: var(--ink); }
.masthead__tagline { display: none; font-family: var(--font-text); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.3; }
.masthead__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
@media (min-width: 48rem) { .masthead__tagline { display: block; max-width: 16rem; } }

.icon-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; min-width: 44px; padding: 0 var(--s-3);
  background: transparent; border: 0; border-radius: var(--r-1);
  color: var(--ink); font-weight: 600; font-size: var(--t-sm); text-decoration: none;
  justify-content: center;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
/* The label is the button's accessible name: visually hidden below 64rem, never display:none. */
.icon-btn__label { position: absolute; 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; }
.icon-btn__kbd { display: none; font: 600 var(--t-xs)/1 var(--font-ui); padding: .2rem .4rem; border: 1px solid var(--line); border-radius: var(--r-1); color: var(--ink-2); }
.icon--close { display: none; }
[data-menu-toggle][aria-expanded="true"] .icon--menu { display: none; }
[data-menu-toggle][aria-expanded="true"] .icon--close { display: block; }
/* Phones: three header buttons (Search, Saved, Menu); Dark mode moves into the menu sheet (.megamenu__foot). */
@media (max-width: 39.99rem) { .masthead__actions [data-theme-toggle] { display: none; } }
@media (min-width: 64rem) {
  .icon-btn__label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; }
  .icon-btn__kbd { display: inline-block; }
}
.count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem; border-radius: var(--r-pill); background: var(--tag); color: var(--tag-ink); font-size: var(--t-xs); font-weight: 800; font-variant-numeric: tabular-nums; }

.nav { border-top: 1px solid var(--rule); border-bottom: var(--rule-heavy) solid var(--ink); }
.nav__inner { display: flex; align-items: stretch; }
.nav__list { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: 1; margin-inline: calc(var(--s-2) * -1); }
.nav__list::-webkit-scrollbar { display: none; }
.nav__item--split { margin-left: var(--s-3); padding-left: var(--s-3); border-left: 1px solid var(--rule); }
.nav__link {
  display: flex; align-items: center; min-height: 48px; padding: 0 var(--s-2);
  font-weight: 650; font-stretch: 85%; font-size: var(--t-base); white-space: nowrap;
  color: var(--ink); text-decoration: none;
}
.nav__link:hover { color: var(--petrol); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .3em; }
.nav__link[aria-current="page"] { position: relative; }
.nav__link[aria-current="page"]::after { content: ""; position: absolute; left: var(--s-2); right: var(--s-2); bottom: 0; height: 5px; background: var(--tag); box-shadow: 0 -1px 0 var(--tag-ink) inset; }
@media (min-width: 64rem) { .nav__list { gap: var(--s-3); } }

/* Below 64rem the strip scrolls sideways: fade the edges so it reads as scrollable.
   site.js scrolls the aria-current link into view on load (spec §5.1). */
@property --nav-fade-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --nav-fade-r { syntax: "<length>"; inherits: false; initial-value: 40px; }
@keyframes nav-fade {
  0% { --nav-fade-l: 0px; --nav-fade-r: 40px; }
  8%, 92% { --nav-fade-l: 40px; --nav-fade-r: 40px; }
  100% { --nav-fade-l: 40px; --nav-fade-r: 0px; }
}
@media (max-width: 63.99rem) {
  .nav__list {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--nav-fade-l), #000 calc(100% - var(--nav-fade-r)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--nav-fade-l), #000 calc(100% - var(--nav-fade-r)), transparent);
  }
  .nav__list::after { content: ""; flex: 0 0 var(--s-6); }
  @supports (animation-timeline: scroll()) {
    /* duration auto (not 0ms) even under reduced motion: this tracks scrolling, it does not animate */
    .nav__list { animation: nav-fade linear both; animation-timeline: scroll(self inline); animation-duration: auto !important; }
  }
}

/* homepage nameplate: wordmark and buttons always share the first row; tagline below on phones */
.masthead--home .masthead__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-3); padding-block: var(--s-4) var(--s-3); }
.masthead--home .wordmark { font-size: clamp(2.25rem, calc((100vw - 12rem) / 3.1), 4.5rem); }
.masthead--home .masthead__tagline { display: block; grid-column: 1 / -1; grid-row: 2; font-size: var(--t-base); }
.masthead--home .masthead__actions { grid-column: 2; grid-row: 1; }
@media (min-width: 40rem) { .masthead--home .wordmark { font-size: clamp(4.5rem, 10vw, 6rem); } }
@media (min-width: 48rem) {
  .masthead--home .masthead__top { grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; column-gap: var(--s-5); padding-block: var(--s-5) var(--s-4); }
  .masthead--home .wordmark { font-size: clamp(5rem, 9vw, 8.75rem); }
  .masthead--home .masthead__tagline { grid-column: 2; grid-row: 1; max-width: 18rem; margin-bottom: .5rem; font-size: var(--t-md); line-height: 1.25; color: var(--ink); }
  .masthead--home .masthead__actions { grid-column: 3; margin-bottom: .25rem; }
}

/* mega menu. 64rem and up: a panel under the nav that scrolls with the page.
   Below 64rem: a full-screen sheet; the Menu button pins to the top right and shows a close (X) icon. */
.megamenu { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: var(--rule-heavy) solid var(--ink); }
.megamenu__grid { display: grid; gap: var(--s-6) var(--s-5); padding-block: var(--s-6) var(--s-7); }
.megamenu__title { font-stretch: 70%; font-weight: 850; font-size: var(--t-lg); }
.megamenu__title a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.megamenu__title a:hover { color: var(--petrol); }
.megamenu__list a { display: flex; align-items: center; min-height: 44px; padding: .25rem 0; color: var(--ink); text-decoration: none; font-size: var(--t-base); line-height: 1.3; border-bottom: 1px solid var(--rule); }
.megamenu__list a:hover { color: var(--petrol); text-decoration: underline; }
.megamenu__all { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: var(--t-sm); }
.megamenu__foot { display: none; padding-bottom: var(--s-7); }
@media (min-width: 40rem) { .megamenu__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .megamenu__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .megamenu__list a { font-size: var(--t-sm); } }
@media (max-width: 39.99rem) { .megamenu__foot { display: block; } .megamenu__grid { padding-bottom: var(--s-5); } }
@media (max-width: 63.99rem) {
  .megamenu { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; border-bottom: 0; }
  .megamenu::before {
    content: "Upkeep"; content: "Upkeep" / "";
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; min-height: 4rem; padding-inline: var(--gutter);
    background: var(--paper); border-bottom: var(--rule-heavy) solid var(--ink);
    font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: 2.25rem; line-height: .85; letter-spacing: -.01em; color: var(--ink);
  }
  .megamenu__grid { padding-top: var(--s-4); }
  [data-menu-toggle][aria-expanded="true"] { position: fixed; top: .625rem; right: var(--gutter); z-index: 61; }
  html:has(#megamenu:not([hidden])) { overflow: hidden; }
  html:has(#megamenu:not([hidden])) :is(main, .footer, .progress, .skip),
  .masthead:has(#megamenu:not([hidden])) :is(.wordmark, .masthead__tagline, .nav, .masthead__actions > :not([data-menu-toggle])) { visibility: hidden; }
}

/* reading progress (articles only) */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 50; pointer-events: none; }
.progress__bar { height: 100%; background: var(--petrol); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }

/* ---------- 7. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  font-family: var(--font-ui); font-weight: 750; font-stretch: 90%; font-size: var(--t-base); line-height: 1.1;
  border: 2px solid var(--ink); border-radius: var(--r-1);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--petrol); border-color: var(--petrol); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--tag { background: var(--tag); color: var(--tag-ink); border-color: var(--tag-ink); }
.btn--tag:hover { background: var(--tag-ink); color: var(--tag); }
.btn--on-dark { background: var(--on-enamel); color: var(--enamel); border-color: var(--on-enamel); }
.btn--on-dark:hover { background: transparent; color: var(--on-enamel); }
.btn--sm { min-height: 44px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.btn[aria-pressed="true"] { background: var(--tag); color: var(--tag-ink); border-color: var(--tag-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- 8. Breadcrumbs ---------- */
/* Links are 44px tall; the negative block margin keeps the visual rhythm of a 14px line. */
.crumbs { margin-block: -.75rem; }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-2); font-size: var(--t-sm); color: var(--ink-2); }
.crumbs li { display: flex; align-items: center; min-height: 44px; }
.crumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.crumbs a:hover { color: var(--petrol); }

/* ---------- 9. The inspection tag (service interval / this week's service) ---------- */
.tag {
  position: relative;
  background: var(--tag);
  color: var(--tag-ink);
  border: 2px solid var(--tag-ink);
  border-radius: var(--r-1);
  box-shadow: 4px 4px 0 var(--tag-ink);
  padding: var(--s-3) var(--s-4) var(--s-4) var(--s-4);
  max-width: 22rem;
}
.tag::before { /* punched hole */
  content: ""; position: absolute; top: .7rem; right: .7rem;
  width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--tag-ink);
}
.tag__head { font-size: var(--t-sm); font-weight: 650; padding-bottom: var(--s-2); margin-bottom: var(--s-2); margin-right: 1.25rem; border-bottom: 1px solid rgba(15, 37, 41, .4); }
.tag__label { font-family: var(--font-display); font-stretch: 70%; font-weight: 850; font-size: var(--t-lg); line-height: 1.05; }
.tag__value { margin-top: var(--s-1); font-size: var(--t-base); line-height: 1.4; }
.tag__src { margin-top: var(--s-2); font-size: var(--t-sm); }
.tag a { color: var(--tag-ink); font-weight: 700; text-decoration-thickness: 2px; }
.tag a:hover { color: var(--tag-ink); text-decoration-thickness: 3px; }
.tag :focus-visible { outline-color: var(--tag-ink); }
.tag--tilt { transform: rotate(-1.5deg); }

/* ---------- 10. Evidence grade ---------- */
.grade { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; }
.grade__letter {
  display: grid; place-items: center; width: 3rem; height: 3rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: 2.25rem; line-height: 1;
  border-radius: var(--r-1);
}
.grade--a .grade__letter { background: var(--petrol); }
.grade__name { font-weight: 800; font-stretch: 88%; font-size: var(--t-base); }
.grade__name a { color: var(--ink); }
.grade__def { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; margin-top: .15rem; }
.grade__basis { font-size: var(--t-sm); line-height: 1.4; margin-top: var(--s-2); }
.grade--plain { grid-template-columns: 1fr; }

.grade-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); line-height: 1; }
.grade-chip b { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: 1.05rem; border-radius: 2px; }
.grade-chip--a b { background: var(--petrol); }
.grade-chip--plain::before { content: ""; width: .55rem; height: .55rem; border: 2px solid var(--ink-2); border-radius: 1px; }

/* ---------- 11. Story cards (editorial; no borders, no shadows) ---------- */
.story { position: relative; display: grid; gap: var(--s-3); align-content: start; }
.story__media { overflow: hidden; background: var(--paper-2); }
.story__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 16% 50%; }
.story__section { font-size: var(--t-sm); font-weight: 650; color: var(--petrol); }
.story__title { font-stretch: 74%; font-weight: 800; font-size: var(--t-lg); line-height: 1.04; letter-spacing: -.003em; }
.story__title a { color: var(--ink); text-decoration: none; }
.story__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.story:hover .story__title a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; text-decoration-color: var(--tag); }
.story__title a:focus-visible { outline: none; }
.story:has(.story__title a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.story__dek { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story__meta { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

.story--lead .story__title { font-stretch: 66%; font-weight: 900; font-size: clamp(2rem, 4.2vw, var(--t-3xl)); line-height: .96; }
.story--lead .story__dek { font-size: var(--t-text); -webkit-line-clamp: 4; }
.story--lead .story__media img { aspect-ratio: 16 / 10; }
.story--mid .story__media img { aspect-ratio: 16 / 10; }
.story--mid .story__title { font-size: clamp(1.6rem, 3vw, 2.25rem); font-stretch: 68%; font-weight: 850; line-height: 1; }
.story--row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto auto auto 1fr; column-gap: var(--s-4); row-gap: var(--s-2); }
.story--row .story__media { grid-row: span 4; }
.story--row .story__media img { aspect-ratio: 1 / 1; }
.story--row .story__title { font-size: var(--t-md); }
.story--row .story__dek { -webkit-line-clamp: 2; font-size: var(--t-sm); }
.story--compact { padding-top: var(--s-3); border-top: 1px solid var(--rule); gap: var(--s-2); }
.story--compact .story__title { font-size: var(--t-md); }
.story--compact .story__dek { font-size: var(--t-sm); -webkit-line-clamp: 2; }
@media (min-width: 40rem) { .story--row .story__title { font-size: var(--t-lg); } }
/* Phones: compact and row stories drop their dek; the title and grade carry them. */
@media (max-width: 39.99rem) { .story--compact .story__dek, .story--row .story__dek, .rail .story--mid .story__dek { display: none; } }

/* Service plate: replaces a card photo that is already on the page (template.md §13).
   Shows the guide's own service-interval sticker. Decorative copy: aria-hidden. */
.story__plate {
  container-type: inline-size;
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s-2);
  aspect-ratio: 3 / 2; padding: var(--s-4); overflow: hidden;
  background: var(--paper-2); color: var(--ink);
  border-top: var(--rule-heavy) solid var(--ink);
}
.story__plate::after { /* punched hole, as on the tag */
  content: ""; position: absolute; top: var(--s-3); right: var(--s-3);
  width: .8rem; height: .8rem; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink);
}
.story__plate-head { position: absolute; top: var(--s-3); left: var(--s-4); font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); line-height: 1.2; }
.story__plate-label { font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: clamp(1.375rem, 12cqi, 3.25rem); line-height: .92; letter-spacing: -.01em; text-wrap: balance; }
.story__plate-value { font-family: var(--font-text); font-size: clamp(.875rem, 4.6cqi, 1.125rem); line-height: 1.35; color: var(--ink-2); max-width: 26rem; }
.story--lead .story__plate, .story--mid .story__plate, .story--feature .story__plate { aspect-ratio: 16 / 10; }
.story--row .story__plate { aspect-ratio: 1 / 1; grid-row: span 4; padding: var(--s-3); }
.story--row .story__plate-head, .story--row .story__plate-value { display: none; }

/* ---------- 12. Homepage: cover ---------- */
.cover { position: relative; }
.cover__grid { display: grid; }
.cover__media { background: var(--paper-2); overflow: hidden; }
.cover__media img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 18% 50%; }
.cover__copy { padding: var(--s-6) var(--gutter) var(--s-7); display: grid; gap: var(--s-5); align-content: center; }
.cover__title {
  font-stretch: 62%;
  font-weight: 900;
  font-size: clamp(3rem, 11vw, 6rem);
  line-height: .9;
  letter-spacing: -.012em;
  max-width: 11em;
}
.cover__dek { font-family: var(--font-text); font-size: var(--t-md); line-height: 1.45; color: var(--ink-2); max-width: 32rem; }
.cover .tag { justify-self: start; }
@media (min-width: 64rem) {
  .cover__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 6fr); min-height: clamp(34rem, 46vw, 44rem); }
  .cover__media img { aspect-ratio: auto; position: absolute; inset: 0; }
  .cover__media { position: relative; }
  .cover__copy { padding: var(--s-7) max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) var(--s-7) var(--s-7); }
  .cover__title { font-size: clamp(4rem, 5.9vw, 6.5rem); }
}

.coverlines { display: grid; border-top: var(--rule-heavy) solid var(--ink); margin-top: 0; }
.coverline { position: relative; padding: var(--s-4) 0 var(--s-5); border-bottom: 1px solid var(--rule); display: grid; gap: var(--s-2); align-content: start; }
.coverline__section { font-size: var(--t-sm); font-weight: 650; color: var(--petrol); }
.coverline__title { font-family: var(--font-display); font-stretch: 72%; font-weight: 850; font-size: var(--t-lg); line-height: 1.02; color: var(--ink); text-decoration: none; }
.coverline__title::after { content: ""; position: absolute; inset: 0; }
.coverline:hover .coverline__title { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--tag); text-underline-offset: .12em; }
@media (min-width: 40rem) { .coverlines { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); } }
@media (min-width: 64rem) {
  .coverlines { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 0; }
  .coverline { padding: var(--s-4) var(--s-4) var(--s-5); border-bottom: 0; border-left: 1px solid var(--rule); }
  .coverline:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- 13. Spec sheet (the numbers that matter) ---------- */
.spec-sheet__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border-top: var(--rule-heavy) solid var(--ink); border-bottom: 1px solid var(--rule); }
.spec { background: var(--paper); }
.spec__link { display: grid; gap: var(--s-1); align-content: start; height: 100%; padding: var(--s-4) var(--s-3) var(--s-5) 0; color: var(--ink); text-decoration: none; }
.spec__value { font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: clamp(2.25rem, 6vw, var(--t-3xl)); line-height: .9; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.spec__label { font-weight: 600; font-size: var(--t-base); line-height: 1.3; }
.spec__src { font-size: var(--t-sm); color: var(--ink-2); }
.spec__link:hover .spec__value { color: var(--petrol); }
.spec__link:hover .spec__label { text-decoration: underline; text-decoration-color: var(--tag); text-decoration-thickness: 2px; }
.spec-sheet__note { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); max-width: 50rem; }
.spec:nth-child(2n) .spec__link { padding-left: var(--s-4); }
@media (min-width: 48rem) {
  .spec-sheet__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .spec .spec__link { padding-left: var(--s-4); }
  .spec:nth-child(4n + 1) .spec__link { padding-left: 0; }
}

/* ---------- 13b. The schedule, by age (homepage service-schedule teaser) ---------- */
.ages__list { display: grid; border-top: var(--rule-heavy) solid var(--ink); }
.ages__item { position: relative; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); column-gap: var(--s-4); row-gap: .15rem; align-items: baseline; padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.ages__age { grid-row: span 2; font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: 2.75rem; line-height: .85; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.ages__check { font-weight: 650; font-stretch: 92%; font-size: var(--t-base); line-height: 1.3; }
.ages__src { font-size: var(--t-sm); color: var(--ink-2); }
.ages__note { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); max-width: 50rem; }
@media (min-width: 40rem) {
  .ages__list { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--s-4); }
  .ages__item { grid-template-columns: minmax(0, 1fr); align-content: start; padding-top: var(--s-4); }
  .ages__age { grid-row: auto; font-size: clamp(3.5rem, 6vw, 5rem); margin-bottom: var(--s-2); }
  .ages__item::before { /* tick on the ruler */ content: ""; position: absolute; top: 0; left: 0; width: 3px; height: .75rem; background: var(--ink); }
}
@media (min-width: 64rem) {
  .ages__list { grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 0; border-bottom: 1px solid var(--rule); }
  .ages__item { padding: var(--s-4) var(--s-4) var(--s-5); border-bottom: 0; border-left: 1px solid var(--rule); }
  .ages__item:first-child { border-left: 0; padding-left: 0; }
  .ages__item::before { left: -1px; }
  .ages__item:first-child::before { left: 0; }
}

/* ---------- 14. River (editors' picks) ---------- */
.river__grid { display: grid; gap: var(--s-6) var(--s-6); }
.river__side { display: grid; gap: var(--s-5); align-content: start; }
.river__list { display: grid; gap: var(--s-5); }
@media (min-width: 40rem) { .river__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) {
  .river__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .river__list { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 15. Bands (enamel) + workshop + tool cards ---------- */
.band { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band--enamel { background: var(--enamel); color: var(--on-enamel); --focus: var(--tag); }
.band--enamel .section-head { border-top-color: var(--on-enamel); }
.band--enamel .section-head__dek { color: var(--on-enamel-2); }
.band--enamel .link-more { color: var(--on-enamel); }
.band--enamel .link-more:hover { color: var(--tag); }
.band--enamel a { color: var(--on-enamel); }

.tool-grid { display: grid; gap: var(--s-4); }
.tool-grid .tool-card--feature { grid-column: 1 / -1; }   /* full row below 64rem */
@media (min-width: 40rem) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tool-grid .tool-card--feature { grid-column: auto; grid-row: span 2; } }
/* Compact strip (home and hub bands, not tools.html): two up on phones, name + basis only. */
@media (max-width: 39.99rem) {
  .tool-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .tool-grid--compact .tool-card:not(.tool-card--feature) { padding: var(--s-4); }
  .tool-grid--compact .tool-card:not(.tool-card--feature) .tool-card__name { font-size: var(--t-md); }
  .tool-grid--compact .tool-card:not(.tool-card--feature) .tool-card__does { display: none; }
}

.tool-card {
  position: relative; display: grid; gap: var(--s-2); align-content: start;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--card);
  color: var(--ink);
}
.tool-card__name { font-stretch: 74%; font-weight: 850; font-size: var(--t-lg); line-height: 1.02; }
.tool-card__name a { color: inherit; text-decoration: none; }
.tool-card__name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-2); }
.tool-card__does { font-size: var(--t-base); line-height: 1.45; }
.tool-card__basis { margin-top: auto; padding-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); }
.tool-card:hover .tool-card__name a { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--tag); text-underline-offset: .12em; }
.tool-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.tool-card a:focus-visible { outline: none; }
.band--enamel .tool-card { background: transparent; border-color: var(--enamel-line); color: var(--on-enamel); }
.band--enamel .tool-card__basis { color: var(--on-enamel-2); }
.band--enamel .tool-card:hover { border-color: var(--on-enamel-2); }
.tool-card--feature { background: var(--tag) !important; color: var(--tag-ink) !important; border: 2px solid var(--tag-ink) !important; padding: var(--s-6); gap: var(--s-3); }
.tool-card--feature .tool-card__name { font-stretch: 62%; font-weight: 900; font-size: clamp(2.25rem, 4vw, var(--t-3xl)); line-height: .92; }
.tool-card--feature .tool-card__does { font-family: var(--font-text); font-size: var(--t-text); line-height: 1.5; max-width: 30rem; }
.tool-card--feature .tool-card__basis { color: var(--tag-ink); }
.tool-card--feature .tool-card__cta { margin-top: var(--s-3); justify-self: start; pointer-events: none; background: var(--tag-ink); color: var(--on-enamel); border-color: var(--tag-ink); }
.tool-card--feature:hover .tool-card__cta { background: var(--enamel); border-color: var(--enamel); }
.tool-card--feature:hover .tool-card__name a { text-decoration-color: var(--tag-ink); }
.tool-card--feature:has(a:focus-visible) { outline-color: var(--on-enamel); }

/* ---------- 16. Section rails (homepage) ---------- */
.rail__head { display: grid; gap: var(--s-2); padding-top: var(--s-3); border-top: var(--rule-heavy) solid var(--ink); margin-bottom: var(--s-5); }
.rail__title { font-stretch: 62%; font-weight: 900; font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: .9; letter-spacing: -.01em; }
.rail__title a { display: inline-block; min-height: 44px; color: var(--ink); text-decoration: none; }
.rail__title a:hover { color: var(--petrol); }
.rail__dek { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.5; color: var(--ink-2); max-width: 34rem; }
.rail__body { display: grid; gap: var(--s-5) var(--s-6); }
.rail__list { display: grid; gap: var(--s-4) var(--s-5); align-content: start; }
@media (min-width: 48rem) {
  .rail__head { grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: end; column-gap: var(--s-6); }
  .rail__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) { .rail__body { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .rail__list { grid-template-columns: 1fr; } }
.rail + .rail { margin-top: clamp(3rem, 6vw, 4.5rem); }

/* Rail variants: the five homepage section modules must not share one layout (spec §3.1). */
/* a) cards: 4 photo cards, two up on phones */
.rail--cards .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-3); }
@media (max-width: 39.99rem) {
  .rail--cards .story__title { font-size: 1.125rem; }
  .rail--cards .story__dek { display: none; }
}
@media (min-width: 40rem) { .rail--cards .card-grid { gap: var(--s-6) var(--s-5); } }
@media (min-width: 64rem) { .rail--cards .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* b) split: one wide .story--feature, then a row of text stories */
.rail--split .rail__body { grid-template-columns: minmax(0, 1fr); }
.rail--split .rail__list { padding-top: var(--s-2); }
@media (min-width: 48rem) { .rail--split .rail__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .rail--split .rail__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* c) pair: two sections side by side, each a lead and three titles */
.rail-pair { display: grid; gap: var(--section-gap) var(--s-7); }
.rail-pair .rail + .rail { margin-top: 0; }
.rail--half .rail__head { grid-template-columns: minmax(0, 1fr) auto; }
.rail--half .rail__dek { grid-column: 1 / -1; grid-row: 2; }
.rail--half .rail__title { font-size: clamp(2.5rem, 5vw, 3.5rem); }
.rail--half .rail__body, .rail--half .rail__list { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 64rem) {
  .rail-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail-pair .rail--half + .rail--half { position: relative; }
  .rail-pair .rail--half + .rail--half::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--s-7) / -2); border-left: 1px solid var(--rule); }
}
/* d) night: the default rail on an enamel band (sleep) */
.band--enamel .rail__head { border-top-color: var(--on-enamel); }
.band--enamel .rail__title a { color: var(--on-enamel); }
.band--enamel .rail__title a:hover { color: var(--tag); }
.band--enamel .rail__dek, .band--enamel .story__dek { color: var(--on-enamel-2); }
.band--enamel .story__section { color: var(--on-enamel-2); }
.band--enamel .story__title a { color: var(--on-enamel); }
.band--enamel .story--compact { border-top-color: var(--enamel-line); }
.band--enamel .story__media { background: var(--paper-2); }
.band--enamel .grade-chip { color: var(--on-enamel-2); }
.band--enamel .grade-chip b { background: var(--on-enamel); color: var(--enamel); }
.band--enamel .grade-chip--plain::before { border-color: var(--on-enamel-2); }

/* ---------- 17. Ask (questions), standard (promises), stay (reminders) ---------- */
.ask__list { display: grid; border-top: var(--rule-heavy) solid var(--ink); }
.ask__list li { border-bottom: 1px solid var(--rule); }
.ask__list a { display: block; padding: var(--s-4) 0; font-family: var(--font-display); font-stretch: 76%; font-weight: 750; font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.12; color: var(--ink); text-decoration: none; }
.ask__list a:hover { color: var(--petrol); text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--tag); text-underline-offset: .15em; }
@media (min-width: 48rem) { .ask__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); } }

.standard__list { display: grid; gap: var(--s-5) var(--s-6); }
.standard__item { padding-top: var(--s-3); border-top: 1px solid var(--ink); }
.standard__item h3 { font-stretch: 74%; font-weight: 850; font-size: var(--t-lg); margin-bottom: var(--s-2); }
.standard__item p { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.55; color: var(--ink-2); }
.standard__links { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
@media (min-width: 48rem) { .standard__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .standard__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stay { display: grid; gap: var(--s-5); padding: var(--s-6); border: 2px solid var(--ink); border-radius: var(--r-2); background: var(--card); }
.stay__title { font-stretch: 66%; font-weight: 900; font-size: clamp(2rem, 4.5vw, var(--t-2xl)); line-height: .95; }
.stay__text { font-family: var(--font-text); font-size: var(--t-text); line-height: 1.55; color: var(--ink-2); max-width: 36rem; margin-top: var(--s-3); }
@media (min-width: 64rem) { .stay { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: var(--s-7); } }

/* ---------- 18. Section hub ---------- */
.hub-hero { border-bottom: var(--rule-heavy) solid var(--ink); overflow-x: clip; }
.hub-hero__grid { display: grid; gap: var(--s-5); padding-top: var(--s-5); }
.hub-hero__copy { display: grid; gap: var(--s-4); align-content: start; padding-bottom: var(--s-6); }
.hub-hero__title { font-stretch: 62%; font-weight: 900; font-size: clamp(3.25rem, 11vw, 7.5rem); line-height: .86; letter-spacing: -.015em; }
.hub-hero__sub { font-stretch: 80%; font-weight: 700; font-size: var(--t-md); }
.hub-hero__count { font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); }
.hub-hero__media { overflow: hidden; background: var(--paper-2); margin-inline: calc(var(--gutter) * -1); }
.hub-hero__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 14% 50%; }
@media (min-width: 64rem) {
  .hub-hero__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--s-7); align-items: stretch; padding-top: var(--s-6); }
  .hub-hero__copy { padding-bottom: var(--s-7); align-content: end; }
  /* bleed to the right edge of the window, like the cover photo bleeds left */
  .hub-hero__media { margin-inline: 0 calc(-1 * max(var(--gutter), (100vw - var(--wrap)) / 2 + var(--gutter))); }
  .hub-hero__media img { height: 100%; aspect-ratio: auto; min-height: 26rem; }
}
.story--feature .story__title { font-stretch: 64%; font-weight: 900; font-size: clamp(2.25rem, 4.6vw, var(--t-3xl)); line-height: .95; }
.story--feature .story__dek { font-size: var(--t-text); -webkit-line-clamp: 5; }
.story--feature .story__media img { aspect-ratio: 16 / 10; }
.story--feature .tag { position: relative; z-index: 2; margin-top: var(--s-4); justify-self: start; }
@media (min-width: 64rem) {
  .story--feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--s-7); }
  .story--feature .story__media { grid-row: 1 / span 8; }
  .story--feature .story__media img { height: 100%; aspect-ratio: 4 / 3; }
}
.card-grid { display: grid; gap: var(--s-6) var(--s-5); }
@media (min-width: 40rem) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .card-grid--4 .story__title { font-size: var(--t-md); } }
.section-index { display: grid; gap: 0; border-top: var(--rule-heavy) solid var(--ink); }
.section-index li { border-bottom: 1px solid var(--rule); }
.section-index a { display: grid; gap: var(--s-1); padding: var(--s-4) 0; color: var(--ink); text-decoration: none; }
.section-index__name { font-family: var(--font-display); font-stretch: 66%; font-weight: 900; font-size: var(--t-xl); line-height: .95; }
.section-index__desc { font-family: var(--font-text); color: var(--ink-2); font-size: var(--t-base); line-height: 1.5; }
.section-index a:hover .section-index__name { color: var(--petrol); }
@media (min-width: 48rem) { .section-index { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); } }

/* ---------- 19. Article ---------- */
.article__head { padding-top: var(--s-5); display: grid; gap: var(--s-4); }
.article__section { font-weight: 700; font-size: var(--t-base); color: var(--petrol); }   /* plain kicker; the crumb above links the hub */
.article__title { font-stretch: 64%; font-weight: 900; font-size: clamp(2.6rem, 7.5vw, var(--t-4xl)); line-height: .92; letter-spacing: -.012em; max-width: 15em; }
.article__dek { font-family: var(--font-text); font-size: clamp(1.1875rem, 2.2vw, var(--t-lg)); line-height: 1.42; color: var(--ink-2); max-width: 42rem; }
.article__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-4); padding-block: var(--s-3); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-top: var(--s-2); }
.article__actions { display: flex; gap: var(--s-2); }
/* Layout (template.md §7), source order = phone order: hero, lead (disclosure + Quick answer), rail, main.
   64rem and up: hero, lead and main stack in column 1; the rail sits beside them and sticks. */
.article__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); margin-top: var(--s-5); }
.article__hero { margin: 0; min-width: 0; }
.article__hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 16% 50%; background: var(--paper-2); }
.article__lead { display: grid; gap: var(--s-4); }
.article__lead, .article__main { min-width: 0; max-width: var(--measure); }
.article__rail { min-width: 0; display: grid; gap: var(--s-5); align-content: start; }
.article__rail-top { display: grid; gap: var(--s-5); }
@media (min-width: 40rem) { .article__rail-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
@media (min-width: 64rem) {
  .article__layout { grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem); column-gap: var(--s-8); row-gap: var(--s-6); }
  .article__hero { grid-column: 1; grid-row: 1; }
  .article__lead { grid-column: 1; grid-row: 2; }
  .article__main { grid-column: 1; grid-row: 3; }
  .article__rail { grid-column: 2; grid-row: 1 / span 3; align-self: start; position: sticky; top: var(--s-5); max-height: calc(100vh - 2.5rem); overflow-y: auto; padding-bottom: var(--s-4); }
  .article__rail-top { grid-template-columns: 1fr; }
}
.article__main > * + * { margin-top: var(--s-6); }

/* service record */
/* Phones: a 2 x 2 grid with no dividers. 40rem and up: one row with dividers between items. */
.record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
.record__item { display: grid; gap: .1rem; align-content: start; }
@media (min-width: 40rem) {
  .record { display: flex; flex-wrap: wrap; gap: var(--s-2) 0; }
  .record__item + .record__item { padding-left: var(--s-4); margin-left: var(--s-4); border-left: 1px solid var(--rule); }
}
.record dt { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.record dd { margin: 0; font-size: var(--t-sm); font-weight: 700; }
.record a { color: var(--ink); }

/* disclosure line */
.disclosure { font-size: var(--t-sm); line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }

/* table of contents */
.toc { border-top: var(--rule-heavy) solid var(--ink); padding-top: var(--s-2); }
.toc > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 800; font-stretch: 88%; cursor: pointer; list-style: none; }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after { content: "+"; font-size: var(--t-lg); font-weight: 500; }
.toc[open] > summary::after { content: "\2212"; }
.toc__list { counter-reset: toc; padding-bottom: var(--s-2); }
.toc__list a { display: flex; align-items: center; min-height: 44px; padding: .3rem 0 .3rem var(--s-3); border-left: 3px solid var(--rule); color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); line-height: 1.3; }
.toc__list a:hover { color: var(--ink); border-left-color: var(--ink); }
.toc__list a[aria-current="true"] { color: var(--ink); font-weight: 700; border-left-color: var(--tag); }

/* callouts */
.callout { padding: var(--s-4); border-radius: var(--r-2); background: var(--paper-2); }
@media (min-width: 48rem) { .callout { padding: var(--s-5); } }
.callout__title { font-family: var(--font-ui); font-stretch: 88%; font-weight: 800; font-size: var(--t-base); margin-bottom: var(--s-2); display: flex; align-items: center; gap: var(--s-2); }
.callout p { font-family: var(--font-text); font-size: var(--t-text); line-height: 1.55; }
.callout p + p { margin-top: var(--s-3); }
.callout--answer { background: var(--card); border: 2px solid var(--ink); }
.callout--answer p { font-size: clamp(1.1875rem, 2vw, var(--t-md)); line-height: 1.5; }
.callout--doctor { background: var(--alert-wash); border-top: var(--rule-heavy) solid var(--alert); border-radius: 0 0 var(--r-2) var(--r-2); }
.callout--doctor .callout__title::before { /* warning light */ content: ""; width: .8rem; height: .8rem; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 3px var(--alert-wash), 0 0 0 4px var(--alert); }
.callout--note { background: transparent; border: 1px solid var(--line); }
.callout-pair { display: grid; gap: var(--s-4); }
@media (min-width: 48rem) { .callout-pair--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* key takeaways: a service checklist */
.takeaways { border-top: var(--rule-heavy) solid var(--ink); padding-top: var(--s-3); }
.takeaways__title { font-family: var(--font-ui); font-stretch: 88%; font-weight: 800; font-size: var(--t-base); margin-bottom: var(--s-3); }
.takeaways__list { display: grid; gap: var(--s-3); }
.takeaways__list li { position: relative; padding-left: 2.25rem; font-family: var(--font-text); font-size: var(--t-text); line-height: 1.5; }
.takeaways__list li::before { content: ""; position: absolute; left: 0; top: .2em; width: 1.35rem; height: 1.35rem; border: 2px solid var(--ink); border-radius: 2px; background: var(--card); }
.takeaways__list li::after { content: ""; position: absolute; left: .42rem; top: .38em; width: .45rem; height: .8rem; border: solid var(--petrol); border-width: 0 3px 3px 0; transform: rotate(45deg); }

/* prose */
.prose { font-family: var(--font-text); font-size: var(--t-text); line-height: var(--lh-text); max-width: var(--measure); font-optical-sizing: auto; }
.prose > section + section { margin-top: var(--s-7); }
.prose h2 { font-stretch: 70%; font-weight: 850; font-size: clamp(1.875rem, 3.6vw, var(--t-xl)); line-height: 1; margin-bottom: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--ink); }
.prose h3 { font-stretch: 80%; font-weight: 800; font-size: var(--t-lg); margin: var(--s-5) 0 var(--s-2); }
.prose p { margin-bottom: 1em; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--petrol); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose a { text-decoration-thickness: 1px; }
@media (min-width: 64rem) { .prose { font-size: 1.1875rem; } }

/* tables */
.table-wrap { overflow-x: auto; margin: var(--s-4) 0 var(--s-5); }
.data-table, .prose table { width: 100%; min-width: 30rem; border-collapse: collapse; font-family: var(--font-ui); font-size: var(--t-base); line-height: 1.4; font-variant-numeric: tabular-nums; }
.data-table caption, .prose caption { text-align: left; font-weight: 800; font-stretch: 88%; padding-bottom: var(--s-2); }
.data-table th, .data-table td, .prose th, .prose td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.data-table thead th, .prose thead th { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); border-bottom: 2px solid var(--ink); }
.data-table tbody th, .prose tbody th { font-weight: 700; }

/* pull quote (repeats body text, hidden from screen readers) */
.pullquote { margin: var(--s-7) 0; padding: var(--s-4) 0 0; border-top: 6px solid var(--tag); max-width: 34rem; }
.pullquote p { font-family: var(--font-display); font-stretch: 68%; font-weight: 850; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1; color: var(--ink); margin: 0; }

/* calculators inside guides (and tool pages) */
.calc { margin: var(--s-4) 0 var(--s-5); padding: var(--s-5); border: 2px solid var(--ink); border-radius: var(--r-2); background: var(--card); font-family: var(--font-ui); display: grid; gap: var(--s-4); max-width: 32rem; }
.calc__out { font-family: var(--font-display); font-stretch: 78%; font-weight: 800; font-size: var(--t-md); line-height: 1.2; padding-top: var(--s-3); border-top: 1px solid var(--rule); }

/* form fields */
.field { display: grid; gap: var(--s-2); }
.field__label { font-weight: 750; font-size: var(--t-base); }
.field__hint { font-size: var(--t-sm); color: var(--ink-2); }
.field__error { font-size: var(--t-sm); font-weight: 700; color: var(--alert); }
.field__input, .field__select {
  min-height: 48px; padding: 0 var(--s-3);
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--r-1);
  font-size: var(--t-md); font-variant-numeric: tabular-nums;
}
.field__input { width: 100%; max-width: 10rem; }
.field__select { padding-right: var(--s-6); appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.1rem) 52%, calc(100% - .75rem) 52%; background-size: .35rem .35rem; background-repeat: no-repeat; }
.field__input:hover, .field__select:hover { border-color: var(--ink); }
.field__input:focus-visible, .field__select:focus-visible { border-color: var(--ink); outline-offset: 2px; }
.field__input[aria-invalid="true"] { border-color: var(--alert); }
.field__combo { display: flex; gap: var(--s-2); }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--r-1); padding: 0; margin: 0; overflow: hidden; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); font-weight: 700; font-size: var(--t-sm); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -5px; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: 44px; font-size: var(--t-base); line-height: 1.4; cursor: pointer; }
.check input { width: 1.35rem; height: 1.35rem; margin: .1rem 0 0; accent-color: var(--ink); flex: none; }

/* gear picks */
.gear__head h2 { font-stretch: 70%; font-weight: 850; font-size: clamp(1.875rem, 3.6vw, var(--t-xl)); line-height: 1; padding-top: var(--s-3); border-top: var(--rule-heavy) solid var(--ink); }
.gear__method { margin-top: var(--s-3); font-family: var(--font-text); font-size: var(--t-base); line-height: 1.55; color: var(--ink-2); }
.gear__list { display: grid; gap: var(--s-4); margin: var(--s-5) 0; }
.pick { display: grid; gap: var(--s-2); padding: var(--s-5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2); }
.pick-role, .pick__role { font-size: var(--t-sm); font-weight: 700; color: var(--petrol); }
.pick-name, .pick__name { font-stretch: 76%; font-weight: 850; font-size: var(--t-lg); line-height: 1.05; }
.pick__status { display: inline-flex; align-items: center; gap: .4rem; justify-self: start; font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); padding: .25rem .5rem; border: 1px solid var(--line); border-radius: var(--r-1); }
.pick-why, .pick__why { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.55; }
.pick-meta, .pick__meta { display: grid; gap: var(--s-2); margin: var(--s-2) 0 var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.pick-meta div, .pick__meta div { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s-3); }
.pick-meta dt, .pick__meta dt { font-size: var(--t-sm); font-weight: 750; }
.pick-meta dd, .pick__meta dd { margin: 0; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.pick .buy, .buy {
  display: inline-flex; align-items: center; justify-self: start; min-height: 48px; padding: 0 var(--s-5);
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-1);
  font-weight: 750; font-stretch: 90%; text-decoration: none;
}
.pick .buy:hover, .buy:hover { background: var(--petrol); border-color: var(--petrol); color: var(--paper); }

/* FAQ accordion */
.faq h2, .sources h2, .related h2 { font-stretch: 70%; font-weight: 850; font-size: clamp(1.875rem, 3.6vw, var(--t-xl)); line-height: 1; padding-top: var(--s-3); border-top: var(--rule-heavy) solid var(--ink); margin-bottom: var(--s-3); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q { display: flex; justify-content: space-between; gap: var(--s-4); align-items: center; min-height: 56px; padding: var(--s-3) 0; cursor: pointer; list-style: none; font-family: var(--font-display); font-stretch: 82%; font-weight: 750; font-size: var(--t-md); line-height: 1.2; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border: 2px solid var(--ink); border-radius: var(--r-1); font-family: var(--font-ui); font-weight: 600; font-size: 1.25rem; line-height: 1; }
.faq__item[open] > .faq__q::after { content: "\2212"; background: var(--ink); color: var(--paper); }
.faq__q:hover { color: var(--petrol); }
.faq__a { padding: 0 0 var(--s-4); font-family: var(--font-text); font-size: var(--t-text); line-height: 1.6; max-width: 36rem; }

/* sources + author */
.sources__list { list-style: decimal; padding-left: 1.5rem; display: grid; gap: var(--s-2); font-size: var(--t-base); line-height: 1.45; }
.sources__list li::marker { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.author { display: grid; gap: var(--s-2); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-2); }
.author__title { font-family: var(--font-ui); font-stretch: 88%; font-weight: 800; font-size: var(--t-base); }
.author p { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.55; }
.author .author__legal { font-family: var(--font-ui); font-size: var(--t-sm); color: var(--ink-2); }

/* related */
.related { margin-top: var(--section-gap); }

/* ---------- 20. Single tool pages + service schedule ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); margin-top: var(--s-6); }
.tool__form { display: grid; gap: var(--s-5); align-content: start; padding: var(--s-5); background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-2); }
.tool__fields { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.tool__result { padding: var(--s-5); border-radius: var(--r-2); background: var(--enamel); color: var(--on-enamel); --focus: var(--tag); min-height: 12rem; }
.tool__result-title { font-family: var(--font-ui); font-weight: 800; font-stretch: 88%; font-size: var(--t-base); color: var(--on-enamel-2); }
.result__empty { margin-top: var(--s-3); font-family: var(--font-text); font-size: var(--t-text); color: var(--on-enamel-2); }
.result__grid { display: grid; gap: var(--s-4); margin-top: var(--s-3); }
.result__value { font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: clamp(3rem, 8vw, 5rem); line-height: .9; font-variant-numeric: tabular-nums; color: var(--on-enamel); }
.result__unit { font-size: .45em; font-weight: 750; margin-left: .15em; }
.result__label { font-size: var(--t-sm); color: var(--on-enamel-2); }
.result__note { margin-top: var(--s-4); font-size: var(--t-sm); line-height: 1.45; color: var(--on-enamel-2); }
.result__warn { margin-top: var(--s-3); padding: var(--s-3) var(--s-4); border-left: 4px solid var(--tag); background: var(--enamel-wash); font-size: var(--t-sm); line-height: 1.45; color: var(--on-enamel); }
.result__warn--error { border-left-color: var(--alert-on-enamel); font-weight: 700; }
.result__panel + .result__panel { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--enamel-line); }
.result__panel-title { font-family: var(--font-ui); font-stretch: 88%; font-weight: 800; font-size: var(--t-base); color: var(--on-enamel); }
.tool__panel { display: grid; gap: var(--s-4); min-width: 0; margin: 0; padding: var(--s-4) 0 0; border: 0; border-top: 1px solid var(--rule); }
.tool__panel > legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-stretch: 78%; font-weight: 850; font-size: var(--t-md); line-height: 1.1; }
.tool__panel > legend + * { clear: both; }
.tool__result .data-table th, .tool__result .data-table td { border-bottom-color: var(--enamel-line); color: var(--on-enamel); }
.tool__result .data-table thead th { color: var(--on-enamel-2); border-bottom-color: var(--on-enamel); }
.method { display: grid; gap: var(--s-3); }
.method__formula { font-family: var(--font-ui); font-size: var(--t-base); padding: var(--s-4); background: var(--paper-2); border-radius: var(--r-2); overflow-x: auto; font-variant-numeric: tabular-nums; }
@media (min-width: 64rem) { .tool { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } .tool__result { position: sticky; top: var(--s-5); } }

.sched { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
.sched__group-title { font-stretch: 70%; font-weight: 850; font-size: var(--t-xl); padding-top: var(--s-3); border-top: var(--rule-heavy) solid var(--ink); margin-bottom: var(--s-3); }
.sched__list { display: grid; gap: var(--s-3); }
.sched__row { display: grid; gap: var(--s-2) var(--s-4); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card); }
.sched__name { font-stretch: 78%; font-weight: 850; font-size: var(--t-md); line-height: 1.1; }
.sched__when { font-weight: 700; }
.sched__why { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.5; color: var(--ink-2); }
.sched__src { font-size: var(--t-sm); }
.sched__status { justify-self: start; display: inline-flex; align-items: center; gap: .4rem; font-size: var(--t-sm); font-weight: 750; padding: .3rem .6rem; border-radius: var(--r-1); }
.sched__status--due { background: var(--tag); color: var(--tag-ink); }
.sched__status--ok { background: var(--ok-wash); color: var(--ok); }
.sched__status--no { background: var(--paper-2); color: var(--ink-2); }
.sched__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: end; }
@media (min-width: 48rem) { .sched__row { grid-template-columns: minmax(0, 1fr) auto; } .sched__actions { grid-column: 2; grid-row: 1 / span 3; align-self: start; justify-content: flex-end; } }

/* saved page + empty states */
.saved-list { display: grid; gap: var(--s-4); }
.saved-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding-bottom: var(--s-4); border-bottom: 1px solid var(--rule); }
.empty { padding: var(--s-7) var(--s-5); border: 2px dashed var(--line); border-radius: var(--r-2); text-align: left; display: grid; gap: var(--s-3); justify-items: start; }
.empty__title { font-stretch: 72%; font-weight: 850; font-size: var(--t-xl); }
.empty p { font-family: var(--font-text); font-size: var(--t-text); color: var(--ink-2); max-width: 32rem; }

/* simple pages (about, privacy, contact, 404) */
.page-head { padding-top: var(--s-5); padding-bottom: var(--s-5); display: grid; gap: var(--s-4); border-bottom: var(--rule-heavy) solid var(--ink); margin-bottom: var(--s-6); }
.page-head__title { font-stretch: 62%; font-weight: 900; font-size: clamp(2.75rem, 8vw, 5.5rem); line-height: .9; letter-spacing: -.012em; }

/* ---------- 21. Search dialog ---------- */
/* The dialog keeps the hard ink offset shadow (design-system §1: hard offsets only, tag 4px, dialog 8px). */
.search { width: min(44rem, calc(100vw - 2rem)); max-height: min(40rem, calc(100vh - 4rem)); margin: 4vh auto auto; padding: 0; border: 2px solid var(--ink); border-radius: var(--r-2); background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: hidden; }
.search::backdrop { background: rgba(6, 22, 26, .62); }
.search__bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 2px solid var(--ink); }
.search__input { flex: 1; min-height: 52px; border: 0; background: transparent; font-family: var(--font-display); font-stretch: 80%; font-weight: 700; font-size: var(--t-md); color: var(--ink); }
.search__input:focus-visible { outline: none; }
.search__bar:focus-within { box-shadow: inset 0 -4px 0 var(--tag); }
.search__close { min-height: 44px; padding: 0 var(--s-3); background: transparent; border: 1px solid var(--line); border-radius: var(--r-1); font-weight: 700; font-size: var(--t-sm); }
.search__body { max-height: calc(min(40rem, 100vh - 4rem) - 5rem); overflow-y: auto; padding: var(--s-3) var(--s-4) var(--s-5); }
.search__status { font-size: var(--t-sm); color: var(--ink-2); padding: var(--s-2) 0; }
.search__suggest { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: var(--s-2) 0 var(--s-3); }
.search__suggest-label { font-size: var(--t-sm); font-weight: 700; margin-right: var(--s-1); }
.search__suggest button { min-height: 44px; padding: 0 var(--s-3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-1); font-size: var(--t-sm); font-weight: 600; }
.search__suggest button:hover { border-color: var(--ink); }
.search__results { display: grid; }
.search__item a { display: grid; gap: .2rem; padding: var(--s-3) var(--s-3); margin: 0 calc(var(--s-3) * -1); border-radius: var(--r-1); color: var(--ink); text-decoration: none; }
.search__item a:hover, .search__item a:focus-visible { background: var(--paper-2); outline-offset: -3px; }
.search__section { font-size: var(--t-xs); font-weight: 700; color: var(--petrol); }
.search__title { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: var(--t-md); line-height: 1.15; }
.search__desc { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.search mark { background: var(--tag); color: var(--tag-ink); padding: 0 .05em; }

/* ---------- 22. Footer ---------- */
.footer { margin-top: var(--section-gap); background: var(--enamel); color: var(--on-enamel); --focus: var(--tag); padding-block: var(--s-8) var(--s-5); }
.footer a { color: var(--on-enamel); }
.footer a:hover { color: var(--tag); }
.footer__grid { display: grid; gap: var(--s-6); }
.footer .wordmark { color: var(--on-enamel); font-size: clamp(3.5rem, 10vw, 6rem); }
.footer__brand { display: grid; gap: var(--s-4); align-content: start; }
.footer__brand p { font-family: var(--font-text); font-size: var(--t-base); line-height: 1.55; max-width: 30rem; color: var(--on-enamel); }
.footer__brand .footer__legal { font-family: var(--font-ui); font-size: var(--t-sm); color: var(--on-enamel-2); }
.footer__head { font-family: var(--font-ui); font-stretch: 88%; font-weight: 800; font-size: var(--t-base); color: var(--on-enamel-2); margin-bottom: var(--s-2); }
.footer__list a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }
.footer__list a:hover { text-decoration: underline; }
.footer__base { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--enamel-line); font-size: var(--t-sm); color: var(--on-enamel-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); }
.footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
.footer__brand { grid-column: 1 / -1; }
@media (min-width: 48rem) { .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .footer__grid { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); } .footer__brand { grid-column: auto; } }

/* ---------- 22b. Guides A to Z (guides.html; keeps the old ids q / qe and li[data-q]) ---------- */
.az-filter { display: grid; gap: var(--s-2); max-width: 28rem; }
.az-filter .field__input { max-width: none; }
.search-empty { margin-top: var(--s-4); font-family: var(--font-text); font-size: var(--t-text); color: var(--ink-2); }
.az-wrap { display: grid; gap: var(--s-7) var(--s-8); margin-top: var(--s-6); }
@media (min-width: 52rem) { .az-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.az-group h2 { font-stretch: 66%; font-weight: 900; font-size: var(--t-xl); line-height: .95; padding-top: var(--s-3); border-top: var(--rule-heavy) solid var(--ink); margin-bottom: var(--s-2); }
.az-group h2 a { color: var(--ink); text-decoration: none; }
.az-group h2 a:hover { color: var(--petrol); }
.az li { border-bottom: 1px solid var(--rule); }
.az a { display: flex; align-items: center; min-height: 48px; padding: var(--s-2) 0; color: var(--ink); text-decoration: none; font-weight: 600; font-stretch: 92%; line-height: 1.3; }
.az a:hover { color: var(--petrol); text-decoration: underline; text-decoration-color: var(--tag); text-decoration-thickness: 2px; }

/* ---------- 23. Motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .cover__title { animation: cover-in 520ms var(--ease) both; }
  .cover .tag { animation: tag-in 620ms 160ms var(--ease) both; }
  @keyframes cover-in { from { opacity: 0; transform: translateY(.35em); } to { opacity: 1; transform: none; } }
  @keyframes tag-in { from { opacity: 0; transform: translateY(-.75rem) rotate(-6deg); } to { opacity: 1; transform: rotate(-1.5deg); } }
}
@media print {
  :root { --paper: #fff; --card: #fff; --paper-2: #fff; --ink: #000; --ink-2: #333; }
  .masthead__actions, .nav, .megamenu, .progress, .search, .footer nav, .article__actions, .related, .buy, .btn, .toc { display: none !important; }
  .footer { background: #fff; color: #000; padding: 0; }
  .article__layout { display: block; }
  .tag { box-shadow: none; }
  a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; word-break: break-all; }
}

/* ---------- Review fixes: tool overflow and schedule empty state ---------- */
.tool__form > *, .field, .result__grid > *, .sched__row > * { min-width: 0; }
.field__select { width: 100%; max-width: 100%; }
.field__combo .field__select{width:auto;flex:none}
.result__grid [data-show="macros"] .data-table { min-width: 0; }
.sched .result__empty { color: var(--ink-2); }
