/* ==========================================================================
   Under Loaded: site styles
   One stylesheet. Mobile first. Light and dark via prefers-color-scheme.

   Idea: a coach's training sheet. Section headings sit in a left margin
   column, the reading column sits to the right. One bold element: the
   0 to 10 pain scale on the home page (stay under 5).

   Palette: chalk stone paper, green-black ink, one forest-green accent
   meaning "under the line, keep going".
   Rules: no gradients, no shadows, no blur, no pure white or black,
   3px corners, no uppercase labels.
   ========================================================================== */

/* Fonts: self-hosted, latin subset, SIL Open Font License. */
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/libre-franklin.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/literata.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/literata-italic.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --paper: #EEEDE7;      /* chalk stone */
  --panel: #E4E3DB;      /* forms, quiz boxes, table heads */
  --ink: #1B201C;        /* green-black */
  --ink-2: #545B55;      /* graphite: secondary text */
  --rule: #CFCEC4;       /* quiet dividers */
  --rule-strong: #7E837B;/* input and button borders (3:1+) */
  --accent: #2E5E45;     /* forest green */
  --on-accent: #EEEDE7;
  --base: #1B201C;       /* footer band */
  --on-base: #E4E3DB;
  --on-base-2: #AEB4AC;
  --skeleton: #DCDBD2;

  --font-head: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;

  /* Type scale: 1.25 ratio on an 18px desktop base */
  --t-sm: .875rem;
  --t-base: 1.0625rem;
  --t-md: 1.25rem;
  --t-lg: 1.5rem;
  --t-xl: 2rem;

  --radius: 3px;
  --measure: 38rem;
  --margin-col: 13rem;
  --wide: 66rem;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131614;
    --panel: #1C201D;
    --ink: #E4E7E1;
    --ink-2: #A2A9A2;
    --rule: #2B312D;
    --rule-strong: #6C736C;
    --accent: #86B79A;
    --on-accent: #131614;
    --base: #0E110F;
    --on-base: #E4E7E1;
    --on-base-2: #A2A9A2;
    --skeleton: #262B27;
  }
}

@media (min-width: 48em) {
  :root { --gutter: 2rem; --t-base: 1.125rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.68;
  font-optical-sizing: auto;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0 0 .75rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 7vw, 4.25rem); line-height: 1.03; letter-spacing: -0.03em; }
h2 { font-size: var(--t-lg); }
h3, h2.h3 { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.005em; }

p, ul, ol { margin: 0 0 1rem; }
p { max-width: var(--measure); text-wrap: pretty; }
ul, ol { padding-left: 1.25em; max-width: var(--measure); }
li { margin-bottom: .5em; }
li::marker { color: var(--ink-2); }

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

strong { font-weight: 650; }
small, .small { font-size: var(--t-sm); }
cite { font-style: italic; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--ink); color: var(--paper);
  padding: .5rem .9rem; font-family: var(--font-head); font-weight: 600;
  z-index: 10; border-radius: var(--radius); text-decoration: none;
}
.skip-link:focus { top: .5rem; color: var(--paper); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

.section { padding: 3.25rem 0; }
@media (min-width: 48em) { .section { padding: 4.5rem 0; } }

.lede { font-size: var(--t-md); line-height: 1.55; max-width: 34rem; }
.muted { color: var(--ink-2); }

/*
  The training-sheet grid. On wide screens a section's first h2 sits in a
  left margin column and stays in view while you read the section; every
  other child sits in the reading column. No extra markup needed.
*/
@media (min-width: 60em) {
  .section > .wrap,
  .guide-section:not(:first-of-type),
  .hero > .wrap {
    display: grid;
    grid-template-columns: var(--margin-col) minmax(0, 1fr);
    column-gap: 3.5rem;
    align-items: start;
  }
  .section > .wrap > *,
  .guide-section:not(:first-of-type) > *,
  .hero > .wrap > * { grid-column: 2; }

  .section > .wrap > h2:first-child,
  .guide-section > h2:first-child {
    grid-column: 1;
    grid-row: 1 / span 40;
    position: sticky;
    top: 1.75rem;
    font-size: var(--t-md);
    line-height: 1.3;
    padding-top: .3rem;
    border-top: 3px solid var(--ink);
  }

  .hero > .wrap > h1,
  .hero > .wrap > .scale,
  .section > .wrap > .wide { grid-column: 1 / -1; }
}

/* ---------- Header ---------- */
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--ink);
}
/* Small mark: a 10-step bar with the first 4 filled, echoing the pain scale */
.wordmark::before {
  content: "";
  width: 1.5rem; height: .6rem;
  border: 1.5px solid var(--ink);
  border-left: .6rem solid var(--accent);
  border-radius: 2px;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }

.site-nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; max-width: none; }
.site-nav li { margin: 0; }
.site-nav a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .975rem;
  text-decoration: none;
  color: var(--ink-2);
  padding: .3rem 0;
  display: inline-block;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: none; border-bottom: 2px solid var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem;
  padding: .7rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:focus-visible { outline-color: var(--ink); }
.btn[disabled] { cursor: progress; background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); }

.btn--text {
  background: none; border: 0; color: var(--ink);
  padding: .5rem 0; min-height: 2.75rem;
  font-weight: 500;
  text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--accent);
}
.btn--text:hover { background: none; color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin-top: 1.75rem; }
.text-link { font-family: var(--font-head); font-weight: 500; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero { padding: 3rem 0 2.5rem; }
@media (min-width: 48em) { .hero { padding: 5.5rem 0 3.5rem; } }
.hero h1 { max-width: 15ch; margin-bottom: 1.75rem; }
.hero .lede { margin-bottom: 0; }
.hero .lede + p { margin-top: 1rem; }
.hero-note { font-size: var(--t-sm); color: var(--ink-2); margin-top: 1rem; }

/* ---------- The pain scale (home hero) ---------- */
.scale { margin: 3rem 0 0; max-width: none; }
.scale-track {
  list-style: none; padding: 0; margin: 0; max-width: none;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 3px;
}
.scale-track li {
  margin: 0;
  height: 3.25rem;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 0 0 .35rem .4rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .85rem;
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.scale-track li.in {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  animation: scale-fill .32s ease both;
}
.scale-track li.in:nth-child(2) { animation-delay: .08s; }
.scale-track li.in:nth-child(3) { animation-delay: .16s; }
.scale-track li.in:nth-child(4) { animation-delay: .24s; }
.scale-track li.in:nth-child(5) { animation-delay: .32s; }
/* The threshold at 5: a heavy ink mark on the cell's left edge */
.scale-track li { position: relative; }
.scale-track li.line { color: var(--ink); border-color: var(--ink); }
.scale-track li.line::before {
  content: ""; position: absolute; left: -5px; top: -.5rem; bottom: -.5rem;
  width: 4px; background: var(--ink); border-radius: 1px;
}
@keyframes scale-fill {
  from { background: transparent; color: var(--ink-2); border-color: var(--rule-strong); }
}
@media (min-width: 48em) {
  .scale-track { gap: 4px; }
  .scale-track li { height: 4.5rem; font-size: 1rem; padding-left: .55rem; }
}
.scale-key {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 0 4px;
  margin-top: .6rem;
  font-family: var(--font-head);
  font-size: var(--t-sm);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-2);
}
.scale-key .lo { grid-column: 1 / 6; color: var(--accent); font-weight: 600; }
.scale-key .hi { grid-column: 6 / 12; }
.scale figcaption { font-size: var(--t-sm); color: var(--ink-2); margin-top: .9rem; max-width: var(--measure); }

/* ---------- Figures ---------- */
.figure { margin: 0; }
.figure figcaption { font-size: var(--t-sm); color: var(--ink-2); margin-top: .6rem; }

/* ---------- Lists ---------- */
/* .steps is used only where the content is a real sequence (quiz steps, program phases) */
.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: s; max-width: var(--measure); }
.steps > li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  margin: 0 0 1.5rem;
}
.steps > li::before {
  content: counter(s);
  grid-row: 1 / span 4;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--t-md);
  line-height: 1.35;
  color: var(--accent);
}
.steps > li > * { grid-column: 2; }
.steps h3, .steps h2.h3 { margin-bottom: .2rem; }
.steps p { margin-bottom: 0; }

/* The three parts of the 24-Hour Rule */
.rule-list { padding-left: 1.6em; margin: 1.25rem 0 1.5rem; max-width: var(--measure); }
.rule-list li { font-size: var(--t-md); line-height: 1.45; margin-bottom: .6rem; padding-left: .25rem; }
.rule-list li::marker { font-family: var(--font-head); font-weight: 700; color: var(--accent); }

/* ---------- Two columns ---------- */
.split { display: grid; gap: 1.75rem; }
@media (min-width: 40em) { .split { grid-template-columns: 1fr 1fr; gap: 2.25rem; } }
.split h3 { margin-bottom: .6rem; }
.split ul { padding-left: 1.1em; }
.split li { font-size: 1rem; }

/* ---------- Placeholders ---------- */
.media-slot {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem;
  color: var(--ink-2);
  font-size: var(--t-sm);
  line-height: 1.45;
}
.media-slot strong { color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: .975rem; }
.media-slot span { font-size: var(--t-sm); }
.media-slot--wide { aspect-ratio: 3 / 2; }
@media (min-width: 48em) { .media-slot--wide { aspect-ratio: 21 / 8; } }

.media-row { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 40em) { .media-row { grid-template-columns: 1fr 1fr; } }

.placeholder-quote {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 2rem 0 0;
  max-width: var(--measure);
}
.placeholder-quote p { font-style: italic; font-size: var(--t-md); margin: 0; }
.placeholder-quote footer { font-size: var(--t-sm); color: var(--ink-2); margin-top: .5rem; }
.placeholder-quote.spaced { margin-top: 2.5rem; }

.placeholder-tag {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .8rem;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: .05rem .4rem;
  color: var(--ink-2);
}

/* ---------- FAQ ---------- */
.faq { max-width: var(--measure); margin-top: .25rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1rem 2.25rem 1rem 0; position: relative;
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .3rem; top: .85rem;
  font-family: var(--font-head); font-weight: 500; font-size: 1.3rem; color: var(--accent);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--accent); }
.faq .faq-body { padding: 0 0 1.25rem; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Banners and notices ---------- */
.draft-banner {
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  text-align: center; padding: .6rem var(--gutter); margin: 0; max-width: none;
}
.notice {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  max-width: var(--measure);
}
.notice p:last-child { margin-bottom: 0; }
.notice--pending .placeholder-tag { margin-bottom: .25rem; }

/* ---------- Forms ---------- */
.form { max-width: 30rem; }
.form-block {
  background: var(--panel);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
  padding: 1.5rem 1.25rem;
  margin: 2rem 0;
  max-width: var(--measure);
}
@media (min-width: 48em) { .form-block { padding: 1.75rem 2rem 2rem; } }
.form-block h2, .form-block h3 { margin-bottom: .4rem; }

.field { margin-bottom: 1.25rem; }
.field label, .field legend {
  display: block;
  font-family: var(--font-head); font-weight: 600; font-size: .975rem;
  margin-bottom: .35rem;
}
.field fieldset { border: 0; padding: 0; margin: 0; }

input[type="email"], input[type="text"], input[type="number"], select {
  width: 100%; min-height: 3rem;
  padding: .6rem .75rem;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}
input:hover, select:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible { border-color: var(--ink); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--ink); border-width: 2px; }

.check-row, .radio-row {
  display: flex; gap: .75rem; align-items: flex-start;
  margin-bottom: .7rem; font-size: 1rem; line-height: 1.45;
}
.check-row input, .radio-row input {
  width: 1.3rem; height: 1.3rem; margin: .15rem 0 0; flex: 0 0 auto;
  accent-color: var(--accent);
}
.radio-row label { font-family: var(--font-body); font-weight: 400; font-size: 1.05rem; margin: 0; }
.check-row + .btn, .check-row + button { margin-top: .75rem; }

.privacy-note {
  font-size: var(--t-sm); color: var(--ink-2);
  margin: 1.25rem 0 0; padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.form-error { color: var(--ink); font-weight: 650; margin-top: .75rem; }
.form-error:not(:empty)::before { content: "! "; color: var(--accent); font-family: var(--font-head); font-weight: 700; }
.form-error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Payment placeholder ---------- */
.pay-slot {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: var(--measure);
  font-family: var(--font-head); font-weight: 600;
}
.pay-slot span { display: block; font-family: var(--font-body); font-weight: 400; font-size: .925rem; color: var(--ink-2); margin-top: .25rem; }

/* ---------- Citations ---------- */
.citations { font-size: .925rem; }
.citations li { margin-bottom: .9rem; }

/* ---------- Footer: a solid ink band ---------- */
.site-footer {
  background: var(--base);
  color: var(--on-base-2);
  padding: 3rem 0 3.5rem;
  font-size: var(--t-sm);
}
.site-footer p { max-width: 40rem; }
.site-footer a { color: var(--on-base); text-decoration-color: var(--on-base-2); }
.site-footer a:hover { color: var(--on-base); text-decoration-color: var(--on-base); }
.site-footer :focus-visible { outline-color: var(--on-base); }
.footer-grid { display: grid; gap: 1.75rem; }
@media (min-width: 48em) { .footer-grid { grid-template-columns: 2fr 1fr; align-items: start; } }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .2rem; }
.footer-links a { display: inline-block; padding: .2rem 0; }
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--on-base); margin-bottom: .2rem; }
.disclaimer { color: var(--on-base); font-size: .95rem; }

/* ==========================================================================
   QUIZ
   ========================================================================== */
.quiz-page main { min-height: 70vh; }
.quiz { max-width: 40rem; margin: 0 auto; padding: 2rem var(--gutter) 4.5rem; }
@media (min-width: 48em) { .quiz { padding-top: 3.5rem; } }
.quiz h1 { font-size: clamp(2.2rem, 6vw, 3.25rem); }

.quiz-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 2.75rem; margin-bottom: .5rem;
}
.quiz-step-label { font-family: var(--font-head); font-weight: 500; font-size: .925rem; color: var(--ink-2); margin: 0; }

.progress { height: 5px; background: var(--panel); border-radius: 2px; overflow: hidden; margin-bottom: 2.5rem; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

.quiz-screen { outline: none; }
.quiz-screen.is-entering { animation: quiz-in .2s ease both; }
@keyframes quiz-in { from { opacity: 0; } to { opacity: 1; } }

.q-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.5rem, 4.8vw, 2rem); line-height: 1.22; letter-spacing: -0.015em;
  margin-bottom: .75rem; outline: none;
}
.q-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.q-help { color: var(--ink-2); font-size: 1rem; }

.flag-list { margin: 1.25rem 0 0; padding: 0; list-style: none; }
.flag-list li {
  font-size: 1.05rem; line-height: 1.5;
  padding: .7rem 0 .7rem 1.4rem; margin: 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.flag-list li:first-child { border-top: 1px solid var(--rule); }
.flag-list li::before {
  content: ""; position: absolute; left: .1rem; top: 1.3rem;
  width: .45rem; height: .45rem; background: var(--ink-2); border-radius: 1px;
}

.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 2rem; }
.choice-btn {
  min-height: 3.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-head); font-weight: 600; font-size: 1.125rem;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.choice-btn:hover { border-color: var(--ink); background: var(--panel); }
.choice-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.options { list-style: none; padding: 0; margin: 1.5rem 0 0; max-width: none; display: grid; gap: .5rem; }
.options li { margin: 0; }
.option-btn {
  width: 100%; min-height: 3.4rem;
  display: flex; align-items: center; gap: .85rem;
  text-align: left; padding: .7rem 1rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1.025rem; line-height: 1.35;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.option-btn:hover { border-color: var(--ink); background: var(--panel); }
.option-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.option-key {
  flex: 0 0 auto; width: 1.75rem; height: 1.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--ink);
  border-radius: 2px;
  font-family: var(--font-head); font-weight: 700; font-size: .9rem;
}
.option-btn[aria-pressed="true"] .option-key { background: var(--paper); color: var(--ink); }
.option-group-label { font-family: var(--font-head); font-weight: 600; font-size: .95rem; color: var(--ink-2); margin: 1.75rem 0 .5rem; }

.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: 1.5rem; }
@media (min-width: 30em) { .chip-grid { grid-template-columns: repeat(7, 1fr); } }
.chip-grid .choice-btn { min-height: 3.4rem; font-variant-numeric: tabular-nums; }

.diagrams { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1.25rem 0 .5rem; }
@media (min-width: 36em) { .diagrams { grid-template-columns: repeat(3, 1fr); } }
.diagram { border-radius: var(--radius); padding: .5rem; margin: 0; background: var(--panel); }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { font-family: var(--font-head); font-weight: 600; font-size: .875rem; text-align: center; margin-top: .25rem; }
.diagram .line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.diagram .thin { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 3 4; }
.diagram .fill-soft { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.diagram .spot { fill: var(--accent); }
.diagram .spot-label { fill: var(--on-accent); font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.diagram .tendon { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }

.slider-wrap { margin-top: 1.5rem; }
.slider-value { font-family: var(--font-head); font-weight: 700; font-size: 3rem; line-height: 1; letter-spacing: -0.03em; margin: 0 0 .5rem; font-variant-numeric: tabular-nums; }
.slider-value small { font-size: 1.1rem; color: var(--ink-2); font-weight: 500; letter-spacing: 0; }
input[type="range"] { width: 100%; height: 2.75rem; accent-color: var(--accent); cursor: pointer; background: transparent; }
.scale-ends { display: flex; justify-content: space-between; font-size: var(--t-sm); color: var(--ink-2); }

.test-box { border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1.25rem 0; background: var(--panel); }
.test-box p:last-child { margin-bottom: 0; }
.quiz-next { margin-top: 2rem; }

/* Results */
.result-label { font-family: var(--font-head); font-weight: 500; font-size: .95rem; color: var(--ink-2); margin-bottom: .4rem; }
.result-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.65rem, 5vw, 2.25rem); line-height: 1.18; letter-spacing: -0.02em;
  margin-bottom: 1.5rem; outline: none;
}
.result-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.result-track { color: var(--accent); }
.result-box { padding-top: 1.25rem; margin-top: 1.75rem; border-top: 3px solid var(--ink); }
.result-box h3 { margin-bottom: .4rem; }
.not-diagnosis {
  font-size: .925rem; color: var(--ink-2);
  background: var(--panel); border-radius: var(--radius);
  padding: .85rem 1.1rem; margin: 1.75rem 0; max-width: var(--measure);
}
.not-diagnosis strong { font-family: var(--font-head); font-weight: 600; color: var(--ink); }

/* Skeleton loading state */
.skeleton { padding-top: .5rem; }
.skeleton-line { height: .9rem; background: var(--skeleton); border-radius: 2px; margin-bottom: .8rem; }
.skeleton-line.lg { height: 2rem; width: 75%; margin-bottom: 1.4rem; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-status { font-family: var(--font-head); font-weight: 500; color: var(--ink-2); margin-bottom: 1.5rem; }
.skeleton .skeleton-line { animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 50% { opacity: .55; } }

/* ==========================================================================
   GUIDE (/guide/thank-you)
   ========================================================================== */
.guide > .wrap.narrow { max-width: var(--wide); }
.guide-section { padding: 2.75rem 0; }
.guide-section:first-of-type { padding-top: 3.5rem; }
.guide-section + .guide-section { border-top: 1px solid var(--rule); }
@media (min-width: 60em) {
  .guide-section + .guide-section { border-top: 0; }
  .guide-section:first-of-type > * { max-width: calc(var(--margin-col) + 3.5rem + var(--measure)); }
}
.your-result {
  background: var(--panel);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
  padding: 1.25rem 1.4rem .5rem;
  margin: 2rem 0 0;
  max-width: var(--measure);
}

.hold-table, .log-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .975rem; }
.hold-table th, .hold-table td, .log-table th, .log-table td {
  border-bottom: 1px solid var(--rule); padding: .7rem .75rem .7rem 0; text-align: left; vertical-align: top;
}
.hold-table thead th, .log-table thead th {
  font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--ink-2);
  border-bottom: 2px solid var(--ink);
}
.hold-table tbody th { font-family: var(--font-head); font-weight: 600; font-size: .95rem; padding-right: 1rem; }
.log-table th, .log-table td { border: 1px solid var(--rule-strong); padding: .55rem .6rem; }
.log-table thead th { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--rule-strong); }
.log-table td { height: 3.25rem; }
.log-table td:first-child { font-family: var(--font-head); font-weight: 700; width: 3.5rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); }
.track-highlight { display: block; font-size: .8rem; font-weight: 700; color: var(--accent); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  :root {
    --paper: #fdfdfa; --panel: #f0efe9; --ink: #111; --ink-2: #333;
    --rule: #bbb; --rule-strong: #666; --accent: #111; --base: #fdfdfa; --on-base: #111; --on-base-2: #333;
  }
  @page { margin: 16mm 14mm; }
  body { font-size: 10.5pt; line-height: 1.45; background: none; color: #111; }
  .site-header nav, .skip-link, .no-print, .site-footer .footer-links, .btn, .btn-row { display: none !important; }
  .wordmark::before { display: none; }
  .site-footer { border-top: 1px solid #111; padding: 8pt 0 0; }
  .guide > .wrap.narrow { max-width: none; }
  .section > .wrap, .guide-section, .hero > .wrap { display: block !important; }
  .guide-section > h2:first-child { position: static; border-top: 0; }
  .section, .guide-section { padding: 10pt 0; }
  h1 { font-size: 24pt; }
  h2 { font-size: 15pt; break-after: avoid; }
  h3 { font-size: 12pt; break-after: avoid; }
  .hold-table, .log-table, .notice, .your-result { break-inside: avoid; }
  .log-section { break-before: page; }
  .log-table td { height: 38pt; }
  a { color: #111; text-decoration: none; }
  .citations a::after { content: " (" attr(href) ")"; font-size: 8.5pt; }
  .table-scroll { overflow: visible; }
}

/* Home hero: headline, intro, and buttons centered as one block.
   Overrides the margin-column grid used on other pages. */
.hero--center > .wrap { display: block; text-align: center; }
.hero--center h1,
.hero--center .lede,
.hero--center .hero-note { margin-left: auto; margin-right: auto; }
.hero--center h1 { max-width: 16ch; }
.hero--center .btn-row { justify-content: center; }
.hero--center .scale { text-align: left; }
@media (max-width: 30em) {
  .hero--center .btn-row { flex-direction: column; }
}

/* Home hero photo */
.hero-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--panel);
}
@media (min-width: 48em) {
  .hero-photo { aspect-ratio: 1280 / 488; }
}
