/* BikesExplained content site: design system v1.0 (October 2026)
   Tokens follow THEME-002 in the calculator spec v0.8 so the content site and the
   gearing app share one look. No third-party requests (SEC-013, SEC-015).
   Signature element: the road ribbon from the logo, used for the quiz progress bar
   and section rules. Everything else stays quiet. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-800-normal.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --panel: #F4F6F9;
  --ink: #1E293B;
  --muted: #526174;
  --accent-text: #B65420;      /* orange for text: 4.9:1 on white */
  --brand-orange: #E8611A;     /* graphics and large text only in light: 3.4:1 */
  --navy: #102A43;
  --control: #7A8A9E;          /* control boundaries: 3.5:1 */
  --divider: #D3DBE4;          /* decorative only */
  --selected-border: #102A43;
  --selected-fill: #E2EEF8;
  --focus: #1D4ED8;
  --link: #1E4E8C;
  --callout-fill: #EEF3F8;
  --note-fill: #FFF4EC;
  --lane: #FFFFFF;
  --shadow: 0 1px 2px rgba(16, 42, 67, .06), 0 4px 16px rgba(16, 42, 67, .06);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1724;
  --panel: #12243A;
  --ink: #E6EDF5;
  --muted: #9FB0C3;
  --accent-text: #F08A4B;
  --brand-orange: #E8611A;
  --navy: #102A43;
  --control: #5E7FA3;
  --divider: #26405C;
  --selected-border: #F08A4B;
  --selected-fill: #1B3350;
  --focus: #8AB4FF;
  --link: #8CC0F2;
  --callout-fill: #12243A;
  --note-fill: #2A2018;
  --lane: #0B1724;
  --shadow: none;
}

/* Type scale (major third, 1.25) on a 17 px body. Measure capped near 68 characters. */
:root {
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: 2.05rem;
  --step-4: clamp(2.2rem, 5vw, 3rem);
  --measure: 46rem;           /* readable line length for text */
  --wide: 72rem;              /* page container */
  --toc: 14rem;               /* "On this page" column, 1200px and wider */
  --gap: clamp(1rem, 3vw, 2rem);
  --radius-s: 6px;
  --radius-m: 12px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-body);
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); margin-top: 2.2em; }
h3 { font-size: var(--step-1); margin-top: 1.6em; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: .35em; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 700; }
small, .muted { color: var(--muted); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--bg); color: var(--ink); padding: .6rem 1rem; z-index: 50; border: 2px solid var(--focus); }
.skip:focus { left: .5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2 * var(--gap), var(--wide)); margin-inline: auto; }
/* Text keeps a readable measure, left-aligned in the container. Tables, card grids, photos,
   checklists and the quote card use the container's full width (or the main column when the
   page has an "On this page" sidebar). Diagrams stop at the text measure. */
.page .wrap :is(p, ul, ol, dl, h1, h2, h3, h4, blockquote, .callout, .entries, .jump-list) { max-width: var(--measure); }
.page .wrap :is(.checklist, .grid > *, .type-card *, .table-scroll *, .quote-band *, .breadcrumb *, .toc *, .meta) { max-width: none; }
.page .wrap .tier > h2 { max-width: none; }
.page { padding-block: clamp(2rem, 6vw, 4rem) 4rem; }
.page > .wrap > header, .page .page-main > header { margin-bottom: 2.5rem; }
.grid { display: grid; gap: var(--gap); }
.with-aside > * { min-width: 0; } /* a wide table scrolls in its box instead of widening the page */
@media (min-width: 52rem) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .with-aside { grid-template-columns: minmax(0, 1fr) 18rem; align-items: start; }
  /* Home entry points: equal heights, with headings, text and buttons on shared rows (subgrid). */
  .start-grid { row-gap: 0; }
  .start-grid > .type-card, .start-grid > .type-card > .body { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: .75rem; }
  .start-grid .button { justify-self: start; align-self: end; }
}

/* ---------- Header and navigation ---------- */
.site-header { border-bottom: 1px solid var(--divider); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.brand img { width: 150px; height: auto; display: block; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
:root[data-theme="dark"] .brand .logo-light { display: none; }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .7rem;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; border-radius: var(--radius-s);
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { background: var(--panel); }
.site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { border-bottom-color: var(--brand-orange); font-weight: 750; }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: 44px; min-height: 44px; padding: 0 .7rem;
  background: transparent; color: var(--ink); font: 600 .9rem var(--font-body);
  border: 1px solid var(--control); border-radius: var(--radius-s); cursor: pointer;
}
.icon-button:hover { background: var(--panel); }
.icon-button svg { width: 1.2rem; height: 1.2rem; }
.menu-toggle { display: none; }

@media (max-width: 72rem) {
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .site-nav { position: absolute; left: 0; right: 0; top: 4.5rem; background: var(--bg); border-bottom: 1px solid var(--divider); z-index: 20; display: none; margin: 0; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: .5rem var(--gap) 1rem; }
  .site-nav a { width: 100%; border-bottom: 0; border-left: 3px solid transparent; }
  .site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { border-left-color: var(--brand-orange); }
  .site-header { position: relative; }
}

/* ---------- Quote band (QUOTE-01, QUOTE-06): a centered card, hidden in print ----------
   Placed in the page by the placeQuoteBand transform. Contrast on --panel, light / dark:
   quote text 13.5 / 13.3, label 13.5 / 10.6, orange mark 3.2 / 4.6 (graphics need 3:1).
   The label is never orange: orange fails 4.5:1 for small text in light. */
.quote-band { max-width: 32rem; margin: 2.75rem auto; padding: 1.5rem 1.75rem 1.75rem; background: var(--panel); border-radius: var(--radius-m); }
.quote-band .quote-mark { display: block; width: 2.6rem; height: auto; margin-bottom: .6rem; color: var(--brand-orange); }
.quote-band .quote-label { margin: 0 0 .4rem; font-size: 1.05rem; font-weight: 700; font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--navy); }
:root[data-theme="dark"] .quote-band .quote-label { color: #C9D6E3; }
.quote-band .quote-text { margin: 0; font: 800 1.35rem/1.35 var(--font-head); color: var(--ink); }
@media (min-width: 48rem) { .quote-band .quote-text { font-size: 1.6rem; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--divider); padding-block: 2.5rem 3rem; color: var(--muted); font-size: var(--step--1); }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--muted); }
.site-footer p { max-width: 60ch; }

/* ---------- Road ribbon (signature) ---------- */
/* A section rule drawn like the logo's road: an orange band with lane dashes. */
.ribbon-rule { height: 10px; border: 0; margin: 3rem 0; border-radius: 5px; background:
  repeating-linear-gradient(90deg, transparent 0 14px, var(--lane) 14px 30px) center / 100% 2px no-repeat,
  var(--brand-orange); max-width: 12rem; }

/* ---------- Page meta ---------- */
.meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--muted); font-size: var(--step--1); margin-top: 1rem; }
.breadcrumb { font-size: var(--step--1); margin-bottom: 1rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li + li { margin-top: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--muted); margin-right: .4rem; }
.breadcrumb a { color: var(--muted); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.3rem;
  font: 700 1rem var(--font-body); border-radius: var(--radius-s); text-decoration: none; cursor: pointer;
  border: 2px solid var(--navy); background: var(--navy); color: #FFFFFF;
}
:root[data-theme="dark"] .button { background: var(--accent-text); border-color: var(--accent-text); color: #0B1724; }
.button:hover { filter: brightness(1.12); }
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--control); }
.button[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.5rem; }
.button-row + p { margin-top: 1em; } /* normal paragraph spacing after a row of buttons (Gears "Next:") */

/* ---------- Cards (used sparingly, for the three lead bike types) ---------- */
.type-card { display: flex; flex-direction: column; border: 1px solid var(--divider); border-radius: var(--radius-m); overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.type-card .body { padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.type-card h3 { margin: 0; }
.type-card p { margin: 0; color: var(--muted); }
.type-card a.more { margin-top: auto; padding-top: .5rem; font-weight: 700; }

/* ---------- Image placeholder (until open-licensed photos are sourced) ---------- */
.ph {
  margin: 0; display: grid; place-items: center; text-align: center; padding: 1rem;
  background: var(--panel); color: var(--muted); font-size: var(--step--1);
  border: 2px dashed var(--control); border-radius: var(--radius-m); aspect-ratio: 3 / 2;
}
.ph.wide { aspect-ratio: 16 / 9; }
.ph.square { aspect-ratio: 1; }
.type-card .ph { border-radius: 0; border-width: 0 0 2px; }
.ph strong { display: block; color: var(--ink); }
/* ---------- Photos: responsive WebP at 3:2, never cropped ---------- */
.photo { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: var(--radius-m); margin: 1.5rem 0; background: var(--panel); }
.type-card .photo { border-radius: 0; margin: 0; }
/* Inline SVG diagrams (content/_includes/diagrams/). Colors are theme tokens, so they follow the
   saved theme. Contrast on --panel, light / dark: ink 13.5 / 13.3, muted 5.8 / 7.1,
   control 3.3 / 3.8, brand orange 3.2 / 4.6. */
.diagram { display: block; width: 100%; max-width: var(--measure); height: auto; margin: 1.5rem 0; }
.diagram .d-card { fill: var(--panel); }         .diagram .d-card-line { stroke: var(--panel); }
.diagram .d-ink { fill: var(--ink); }            .diagram .d-ink-line { stroke: var(--ink); }
.diagram .d-muted { fill: var(--muted); }        .diagram .d-muted-line { stroke: var(--muted); }
.diagram .d-control { fill: var(--control); }    .diagram .d-control-line { stroke: var(--control); }
.diagram .d-orange { fill: var(--brand-orange); } .diagram .d-orange-line { stroke: var(--brand-orange); }
/* Drivetrain side view (Gears page): the calculator's side-view classes and part colors
   (content/calculator/index.njk), light first, then dark. Labels use --ink on a --bg halo.
   --dt-stack (chainring and cog outlines) is darker than the calculator's so outlines reach 3:1. */
.drivetrain { --dt-tyre: #e3e8ee; --dt-rim: #c9d2dc; --dt-frame: #e8edf2; --dt-stack: #7A8A9E; --dt-metal: #dfe5ec; --dt-metal-line: #5b6b7d; --dt-cage: #2e4a66; --dt-pulley: #1f2f40; --dt-bolt: #c9d2dc; --dt-chain-out: #3c4a5a; --dt-chain-in: #7d8a99; --dt-roller: #1b2633; --dt-crank: #102A43; }
:root[data-theme="dark"] .drivetrain { --dt-tyre: #1a2c42; --dt-rim: #2b4462; --dt-frame: #162a40; --dt-stack: #5E7FA3; --dt-metal: #22384f; --dt-metal-line: #9fb0c3; --dt-cage: #8fa6bf; --dt-pulley: #c9d6e3; --dt-bolt: #22384f; --dt-chain-out: #b9c6d4; --dt-chain-in: #7f93a8; --dt-roller: #e6edf5; --dt-crank: #dbe5ef; }
.drivetrain .dt-tyre { fill: none; stroke: var(--dt-tyre); stroke-width: 26; }
.drivetrain .dt-rim { fill: none; stroke: var(--dt-rim); stroke-width: 4; }
.drivetrain .dt-spoke { stroke: var(--dt-rim); stroke-width: 2.5; }
.drivetrain .dt-valve, .drivetrain .dt-dropout { fill: var(--dt-rim); }
.drivetrain .dt-tube { stroke: var(--dt-frame); stroke-width: 30; stroke-linecap: round; }
.drivetrain .dt-stack { fill: none; stroke: var(--dt-stack); stroke-width: 2.5; }
.drivetrain .dt-sprocket { fill: var(--dt-metal); stroke: var(--dt-metal-line); stroke-width: 2.2; stroke-linejoin: round; }
.drivetrain .dt-cog { fill: var(--dt-metal); stroke: var(--dt-metal-line); stroke-width: 2.5; }
.drivetrain .dt-axle { fill: var(--dt-metal-line); }
.drivetrain .dt-rd-body { fill: var(--dt-metal); stroke: var(--dt-metal-line); stroke-width: 2.5; stroke-linejoin: round; }
.drivetrain .dt-hanger { fill: var(--dt-metal-line); stroke: var(--dt-metal-line); stroke-width: 1.5; }
.drivetrain .dt-rd-link { stroke: var(--dt-metal-line); stroke-width: 5; stroke-linecap: round; opacity: .7; }
.drivetrain .dt-cage { fill: var(--dt-cage); fill-opacity: .16; stroke: var(--dt-cage); stroke-width: 2.5; stroke-opacity: .8; }
.drivetrain .dt-pulley { fill: var(--dt-pulley); }
.drivetrain .dt-bolt { fill: var(--dt-bolt); }
.drivetrain .dt-plate-out { stroke: var(--dt-chain-out); stroke-width: 8; }
.drivetrain .dt-plate-in { stroke: var(--dt-chain-in); stroke-width: 6.5; }
.drivetrain .dt-roller { fill: var(--dt-roller); }
.drivetrain .dt-crank { stroke: var(--dt-crank); stroke-width: 20; stroke-linecap: round; }
.drivetrain .dt-pedal, .drivetrain .dt-spider { fill: var(--dt-crank); }
.drivetrain .dt-label line { stroke: var(--muted); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.drivetrain .dt-label circle { fill: var(--brand-orange); }
.diagram-figure .diagram { margin-bottom: 0; }
/* Drivetrain labels (Gears): HTML over the drawing, so they stay one size at every width. Each label
   starts where its leader line ends (positions are the line ends, in % of the SVG's viewBox:
   -610 -222 840 412). When the drawing is under 32rem wide the words don't fit, so each label
   becomes a numbered marker and a key shows below. */
.dt-box { container-type: inline-size; max-width: var(--measure); margin: 1.5rem 0 0; }
.dt-art { position: relative; }
.dt-art .diagram { margin: 0; }
.dt-tag { position: absolute; transform: translateY(-50%); font: 800 1rem/1.2 var(--font-head); color: var(--ink);
  background: var(--bg); padding: .1rem .3rem; border-radius: var(--radius-s); white-space: nowrap; }
.dt-tag-1 { left: 2.143%; top: 25.485%; }
.dt-tag-2 { left: 2.143%; top: 8.252%; }
.dt-tag-3 { left: 51.786%; top: 8.252%; }
.dt-tag-4 { right: 1.667%; top: 8.252%; }
.dt-num { display: none; }
.dt-key { display: none; }
@container (width < 32rem) {
  .dt-tag { padding: 0; background: none; }
  .dt-tag .dt-word { display: none; }
  .dt-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
    background: var(--ink); color: var(--bg); font: 800 .85rem/1 var(--font-head); flex: none; }
  .page .wrap .dt-key { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; padding: 0; margin: .75rem 0 0; font-size: var(--step--1); }
  .dt-key li { display: flex; align-items: center; gap: .4rem; margin: 0; }
}
.entry-body .photo, .result .photo { max-width: 32rem; margin: 0 0 1rem; }
figure { margin: 1.5rem 0; }
figcaption { color: var(--muted); font-size: var(--step--1); margin-top: .5rem; }

/* ---------- Callouts ---------- */
.callout { border-left: 4px solid var(--navy); background: var(--callout-fill); padding: 1rem 1.25rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 1.5rem 0; }
:root[data-theme="dark"] .callout { border-left-color: var(--muted); }
.callout > :last-child { margin-bottom: 0; }
.callout .title { display: flex; align-items: center; gap: .5rem; font-weight: 700; margin-bottom: .35rem; }
.callout .title svg { width: 1.15rem; height: 1.15rem; flex: none; }
.callout.note { border-left-color: var(--brand-orange); background: var(--note-fill); }

/* ---------- Evidence labels: shape + text, never color alone ---------- */
.evidence { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; border: 1px solid var(--control); border-radius: 999px; font-size: .8rem; font-weight: 650; color: var(--ink); white-space: nowrap; vertical-align: .1em; }
.evidence svg { width: .8rem; height: .8rem; flex: none; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--divider); border-radius: var(--radius-s); }
.table-scroll:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
caption { text-align: left; font-weight: 700; padding: .75rem 1rem; }
th, td { text-align: left; vertical-align: top; padding: .7rem 1rem; border-top: 1px solid var(--divider); }
thead th { border-top: 0; background: var(--panel); font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 700; }

/* ---------- Expandable entries (secondary bike types) ---------- */
.entries { border-top: 1px solid var(--divider); }
/* Jump list: "On this page" links at the top of a long page. */
.jump-list { margin: 1.5rem 0 2rem; padding: 1rem 1.25rem; border: 1px solid var(--divider); border-radius: var(--radius-s); }
.jump-list .title { font-weight: 700; margin: 0 0 .4rem; }
.jump-list ul { margin: 0; padding-left: 1.25rem; }
.jump-list li { margin: .3rem 0; }
.jump-list a { display: inline-block; padding: .15rem 0; min-height: 24px; }
@media print { .jump-list { display: none; } }

/* "On this page" sidebar (addPageToc in eleventy.config.mjs): pages with 3 or more h2 sections.
   A sticky column right of the text at 1200px and wider; hidden below that and in print.
   The page's own jump list (Safety) steps aside while the sidebar shows. */
.toc { display: none; }
@media (min-width: 1200px) {
  .has-toc { display: grid; grid-template-columns: minmax(0, 1fr) var(--toc); gap: 3rem; align-items: start; }
  .has-toc .jump-list { display: none; }
  .toc { display: block; position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto;
    padding: .25rem 0 .25rem 1rem; border-left: 1px solid var(--divider); font-size: var(--step--1); }
  .toc-title { margin: 0 0 .5rem; font-weight: 700; color: var(--ink); }
  .toc ul { list-style: none; margin: 0; padding: 0; }
  .toc li + li { margin-top: .15rem; }
  .toc a { display: block; padding: .3rem 0; min-height: 24px; color: var(--muted); text-decoration: none; line-height: 1.35; }
  .toc a:hover { color: var(--ink); text-decoration: underline; }
}

details.entry { border-bottom: 1px solid var(--divider); }
details.entry > summary {
  list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font: 800 var(--step-1) var(--font-head); padding: .6rem 0;
}
details.entry > summary::-webkit-details-marker { display: none; }
details.entry > summary::after { content: ""; width: .7rem; height: .7rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); margin-right: .4rem; flex: none; }
details.entry[open] > summary::after { transform: rotate(-135deg); }
details.entry .entry-body { padding: 0 0 1.25rem; }
details.entry .tag { font: 600 .85rem var(--font-body); color: var(--muted); margin-left: auto; margin-right: .5rem; }

/* ---------- Checklist (accessories) ---------- */
.tier { margin-top: 2.5rem; }
.tier h2 { margin-top: 0; display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.tier h2 small { font: 600 var(--step--1) var(--font-body); }
.checklist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--divider); }
.checklist li { margin: 0; border-bottom: 1px solid var(--divider); }
.checklist label { display: grid; grid-template-columns: 1.6rem 1fr; gap: .25rem .75rem; padding: .85rem 0; cursor: pointer; }
.checklist input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; accent-color: var(--navy); }
:root[data-theme="dark"] .checklist input { accent-color: var(--accent-text); }
.checklist .item { font-weight: 700; }
.checklist .who { color: var(--muted); font-size: var(--step--1); }
.checklist .why { grid-column: 2; color: var(--ink); font-size: .95rem; }

/* ---------- Glossary terms (WCAG 1.4.13: hover, focus, tap; dismissible; hoverable) ---------- */
.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: .2em; }
.term-wrap { position: relative; display: inline; }
.term-tip {
  position: absolute; left: 0; top: calc(100% + .4rem); z-index: 30; width: min(20rem, 80vw);
  background: var(--ink); color: var(--bg); padding: .7rem .85rem; border-radius: var(--radius-s); font-size: .9rem; line-height: 1.45; font-weight: 400;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.term-tip[hidden] { display: none; }
.term-tip a { color: inherit; }

/* ---------- Selected state (THEME-004): 3 px border, shaded fill, bold ---------- */
.choice {
  display: grid; grid-template-columns: 1.5rem 1fr; gap: .75rem; align-items: start;
  padding: .85rem 1rem; border: 1px solid var(--control); border-radius: var(--radius-s); cursor: pointer; background: var(--bg);
  min-height: 52px;
}
.choice:hover { background: var(--panel); }
.choice input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--navy); }
:root[data-theme="dark"] .choice input { accent-color: var(--accent-text); }
.choice:has(input:checked) { border: 3px solid var(--selected-border); background: var(--selected-fill); font-weight: 700; padding: calc(.85rem - 2px) calc(1rem - 2px); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice .ph { grid-column: 1 / -1; aspect-ratio: 4 / 3; font-weight: 400; }
.choices { display: grid; gap: .6rem; margin: 0; padding: 0; border: 0; }
@media (min-width: 40rem) { .choices.two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- Quiz ---------- */
.quiz { max-width: 44rem; }
.quiz fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.quiz legend { font: 800 var(--step-2) / 1.2 var(--font-head); padding: 0; margin-bottom: .4rem; }
.quiz .hint { color: var(--muted); margin: 0 0 1.25rem; }
.quiz .status { min-height: 1.6em; color: var(--muted); font-size: var(--step--1); margin-top: .75rem; }
.quiz .status.error { color: var(--accent-text); font-weight: 650; }

/* Road progress: an orange lane fills as you go; dashes mark each question. */
.road { margin: 0 0 2rem; }
.road-track { position: relative; height: 14px; border-radius: 7px; background: var(--panel); border: 1px solid var(--divider); overflow: hidden; }
.road-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--brand-orange); transition: width .35s ease; }
.road-fill::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, transparent 0 10px, var(--lane) 10px 22px); }
.road-label { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--muted); margin-top: .5rem; }
@media (prefers-reduced-motion: reduce) { .road-fill { transition: none; } }

/* Results */
.results { max-width: 52rem; }
.result { border: 1px solid var(--divider); border-radius: var(--radius-m); padding: 1.5rem; margin-top: 1.25rem; background: var(--bg); box-shadow: var(--shadow); }
.result.primary { border: 3px solid var(--selected-border); }
.result h2 { margin: 0 0 .25rem; font-size: var(--step-3); }
.result .rank { font-weight: 700; color: var(--accent-text); margin-bottom: .25rem; }
.result ul { margin-bottom: .5rem; }
.result .why-title { font-weight: 700; margin: 1rem 0 .25rem; }
.notes { margin-top: 2rem; }
.page .wrap .notes .callout { max-width: none; }

/* ---------- Print: checklists print clean ---------- */
@media print {
  :root, :root[data-theme] { color-scheme: light; --bg: #FFFFFF; --ink: #000000; --muted: #333333; --panel: #FFFFFF; --divider: #999999; }
  .site-header, .site-footer, .quote-band, .no-print, .skip, .button-row { display: none !important; }
  body { font-size: 11pt; }
  .page { padding: 0; }
  .checklist label { padding: .35rem 0; }
  .checklist .why { display: none; }
  .tier { break-inside: avoid; margin-top: 1rem; }
  a { color: inherit; text-decoration: none; }
  .breadcrumb, button:not(.term), .button, .toc { display: none !important; }
  .has-toc { display: block; }
  /* Print keeps the earlier widths, so printed pages don't change with the screen layout. */
  .page .wrap :is(p, ul, ol, dl, h1, h2, h3, h4, blockquote, .callout, .entries, .jump-list) { max-width: none; }
  .page .wrap :is(.prose, .callout, .entries, .jump-list) { max-width: 68ch; }
  .page .wrap .checklist { max-width: 52rem; }
  .page .wrap .lede { max-width: 60ch; }
  .diagram, .dt-box { max-width: 40rem; }
  .photo.hero { max-width: 52rem; }
  .page .wrap .notes .callout { max-width: none; }
}

/* A print button with data-print="<id>" prints only that .print-target (site.js).
   Ride Prep's pre-ride checklist: one US Letter page. Nothing smaller than 10pt. */
@media print {
  :root[data-print-only] .page :is(.wrap:not(.has-toc), .page-main) > :not(.print-target) { display: none !important; }
  :root[data-print-only] .print-target { max-width: none; margin: 0; }
  :root[data-print-only] .print-target h2 { font-size: 16pt; margin: 0 0 .12in; }
  :root[data-print-only] .print-target .table-scroll { overflow: visible; margin: 0 0 .12in; }
  :root[data-print-only] .print-target table { font-size: 11pt; line-height: 1.3; }
  :root[data-print-only] .print-target th, :root[data-print-only] .print-target td { padding: 5pt 8pt; }
  :root[data-print-only] .print-target thead th { border-bottom: 1px solid var(--divider); }
  :root[data-print-only] .print-target p { font-size: 11pt; margin: 0; }
}

/* Accessories checklist: one US Letter page, two columns. Nothing smaller than 10pt. */
@page { size: letter; margin: .5in; }
@media print {
  .page :is(.wrap, .page-main):has(> .tier) { columns: 2; column-gap: .35in; padding: 0; max-width: none; font-size: 10pt; line-height: 1.25; }
  .page :is(.wrap, .page-main):has(> .tier) > header { column-span: all; margin-bottom: .1in; }
  .page :is(.wrap, .page-main):has(> .tier) h1 { font-size: 16pt; margin: 0 0 .04in; }
  .page :is(.wrap, .page-main):has(> .tier) .lede, .page :is(.wrap, .page-main):has(> .tier) .meta { font-size: 10pt; margin: 0 0 .03in; max-width: none; }
  .page :is(.wrap, .page-main):has(> .tier) .tier { margin: 0 0 .1in; break-inside: auto; }
  .page :is(.wrap, .page-main):has(> .tier) .tier h2 { font-size: 12pt; margin: 0 0 .03in; break-after: avoid; }
  .page :is(.wrap, .page-main):has(> .tier) .tier h2 small { font-size: 10pt; }
  .page :is(.wrap, .page-main):has(> .tier) .checklist li { break-inside: avoid; }
  .page :is(.wrap, .page-main):has(> .tier) .checklist label { grid-template-columns: 12pt 1fr; gap: 0 5pt; padding: 2.5pt 0; }
  .page :is(.wrap, .page-main):has(> .tier) .checklist input { width: 10pt; height: 10pt; margin: 1pt 0 0; }
  .page :is(.wrap, .page-main):has(> .tier) .checklist .who { font-size: 10pt; }
}

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

/* Quiz refinements */
.quiz legend h2 { margin: 0; }
.quiz .counter { margin: 0 0 1.25rem; }
.quiz legend { margin-bottom: .9rem; }
