/* SignsToSave — one stylesheet, no framework.
   Light theme only by design (§10). Mobile-first. */

:root {
  --ink: #14263A;
  --ink-soft: #40566E;
  --teal: #0F766E;
  --teal-dark: #115E59;
  --teal-wash: #ECF6F4;
  --red: #B91C1C;
  --red-wash: #FEF2F2;
  --amber: #B45309;
  --amber-wash: #FEF7EC;
  --green: #15803D;
  --green-wash: #F0FAF2;
  --bg: #FAF9F6;
  --card: #FFFFFF;
  --line: #E5E1D8;

  --t-foundations: #0F766E;
  --t-everyday: #0369A1;
  --t-aging-parents: #9A3412;
  --t-young-kids: #CA8A04;
  --t-crisis: #6D28D9;
  --t-pregnancy: #BE185D;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", "Nimbus Roman", serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 38, 58, .05), 0 4px 14px rgba(20, 38, 58, .06);
  --shadow-lift: 0 2px 4px rgba(20, 38, 58, .06), 0 12px 28px rgba(20, 38, 58, .10);
  --wrap: 1120px;
  --measure: 68ch;
}

/* Dark theme. Only the tokens change — every component reads them.
   Three states: explicit dark, explicit light, and system default. */
:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #E6EDF3;
    --ink-soft: #A3B4C4;
    --teal: #2DD4BF;
    --teal-dark: #5EEAD4;
    --teal-wash: #10262A;
    --red: #FCA5A5;
    --red-wash: #2B1517;
    --amber: #FCD34D;
    --amber-wash: #2A2114;
    --green: #86EFAC;
    --green-wash: #11251A;
    --bg: #0E151C;
    --card: #161F29;
    --line: #26333F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .45), 0 12px 28px rgba(0, 0, 0, .5);
    --t-foundations: #2DD4BF;
    --t-everyday: #60A5FA;
    --t-aging-parents: #FB923C;
    --t-young-kids: #FACC15;
    --t-crisis: #C4B5FD;
    --t-pregnancy: #F9A8D4;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #E6EDF3;
  --ink-soft: #A3B4C4;
  --teal: #2DD4BF;
  --teal-dark: #5EEAD4;
  --teal-wash: #10262A;
  --red: #FCA5A5;
  --red-wash: #2B1517;
  --amber: #FCD34D;
  --amber-wash: #2A2114;
  --green: #86EFAC;
  --green-wash: #11251A;
  --bg: #0E151C;
  --card: #161F29;
  --line: #26333F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .45), 0 12px 28px rgba(0, 0, 0, .5);
  --t-foundations: #2DD4BF;
  --t-everyday: #60A5FA;
  --t-aging-parents: #FB923C;
  --t-young-kids: #FACC15;
  --t-crisis: #C4B5FD;
  --t-pregnancy: #F9A8D4;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); margin-top: 2em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.3rem); margin-top: 1.75em; font-weight: 600; }
h4 { font-size: 1.05rem; margin-top: 1.5em; font-weight: 600; }

p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.35em; }
li { margin-bottom: .5em; }
li:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

a { color: var(--teal-dark); text-underline-offset: 2px; }
a:hover { color: var(--teal); }

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

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.measure { max-width: var(--measure); }
main { flex: 1 0 auto; }
.section { padding: 48px 0; }
.section--tight { padding: 32px 0; }
.section--wash { background: var(--card); border-block: 1px solid var(--line); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 0 0 var(--radius) 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 246, .94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand svg { display: block; height: 30px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-block; padding: 9px 12px; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.site-nav a:hover { background: var(--teal-wash); color: var(--teal-dark); }
.site-nav a[aria-current="page"] { color: var(--teal-dark); font-weight: 600; }
@media (max-width: 560px) {
  .site-nav a { padding: 8px 9px; font-size: .88rem; }
  .brand svg { height: 26px; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  background: var(--teal); color: #fff; border: 1px solid var(--teal);
  border-radius: var(--radius); font: inherit; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s ease;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--teal-dark); border-color: var(--line); }
.btn--ghost:hover { background: var(--teal-wash); color: var(--teal-dark); border-color: var(--teal); }
.btn--small { min-height: 40px; padding: 8px 16px; font-size: .92rem; }
.btn--block { width: 100%; }

/* ---------- hero ---------- */

.hero { padding: 56px 0 40px; }
.hero h1 { max-width: 16ch; margin-bottom: .35em; }
.hero__sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 54ch; margin-bottom: 1.6em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta { margin-top: 22px; font-size: .92rem; color: var(--ink-soft); }

/* ---------- cards & grids ---------- */

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}

.course-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; position: relative;
  transition: box-shadow .15s ease, transform .15s ease;
}
.course-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); color: inherit; }
.course-card__title { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.course-card__promise { display: block; font-size: .93rem; color: var(--ink-soft); margin: 0; }
.course-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }

.track-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--accent, var(--teal));
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.track-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); color: inherit; }
.track-card__name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--accent, var(--teal)); }
.track-card__tagline { font-size: .95rem; color: var(--ink-soft); margin: 0; }
.track-card__count { font-size: .85rem; color: var(--ink-soft); margin-top: auto; padding-top: 8px; font-weight: 600; }

/* ---------- chips & badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap;
  background: var(--chip-bg, var(--teal-wash)); color: var(--chip-fg, var(--teal-dark));
  border: 1px solid transparent;
}
a.chip:hover { border-color: currentColor; color: var(--chip-fg, var(--teal-dark)); }
.chip--minutes { background: #F1EFE9; color: var(--ink-soft); }
.chip--done { background: var(--green-wash); color: var(--green); }

.done-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: .8rem; font-weight: 700; flex: none;
}

/* ---------- the 911 box ---------- */

.box-911 {
  background: var(--red-wash); border: 1px solid #F5CFCF; border-left: 4px solid var(--red);
  border-radius: var(--radius); padding: 18px 20px; margin: 26px 0;
}
.box-911__lead {
  font-family: var(--sans); font-weight: 700; font-size: 1.05rem;
  color: var(--red); margin: 0 0 .6em; text-transform: none;
}
.box-911 ul { margin: 0; padding-left: 1.25em; }
.box-911 li { margin-bottom: .45em; }
.box-911 li::marker { color: var(--red); }

.crisis-banner {
  background: #F5F1FB; border: 1px solid #DDD1F2; border-left: 4px solid var(--t-crisis);
  border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; font-size: .98rem;
}
.crisis-banner strong { color: var(--t-crisis); }

.callout {
  background: var(--amber-wash); border: 1px solid #F3DFC0; border-left: 4px solid var(--amber);
  border-radius: var(--radius); padding: 16px 20px; margin: 22px 0;
}
.callout--teal { background: var(--teal-wash); border-color: #C9E4E0; border-left-color: var(--teal); }
.callout--green { background: var(--green-wash); border-color: #CDE9D5; border-left-color: var(--green); }

/* ---------- course page ---------- */

.course-hero { padding: 36px 0 8px; }
.course-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.course-hero__promise { font-size: 1.12rem; color: var(--ink-soft); max-width: var(--measure); }

.course-body { max-width: var(--measure); }
.course-body h2 { scroll-margin-top: 80px; }
.course-body h3 { scroll-margin-top: 80px; }

.vignette {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 22px; margin: 18px 0;
}
.vignette__title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; margin: 0 0 .5em; }
.vignette p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0; }
.steps li {
  counter-increment: step; position: relative;
  padding-left: 46px; margin-bottom: 16px; min-height: 32px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: #fff;
  font-family: var(--sans); font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}

.myth { margin: 0 0 16px; }
.myth__wrong { display: block; font-weight: 600; color: var(--amber); }
.myth__right { display: block; }

.recap { background: var(--teal-wash); border-radius: var(--radius-lg); padding: 20px 24px; margin: 24px 0; }
.recap ul { margin-bottom: 0; }

.sources ol { font-size: .95rem; }
.sources li { margin-bottom: .4em; }
.feedback-link { font-size: .92rem; color: var(--ink-soft); }

details.faq-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); margin-bottom: 10px; overflow: hidden;
}
details.faq-item > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
details.faq-item > summary::-webkit-details-marker { display: none; }
details.faq-item > summary::after { content: "+"; color: var(--teal); font-size: 1.3rem; line-height: 1; flex: none; }
details.faq-item[open] > summary::after { content: "\2013"; }
details.faq-item > div { padding: 0 18px 16px; }
details.faq-item > div p:last-child { margin-bottom: 0; }

.related-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.course-nav-note { font-size: .92rem; color: var(--ink-soft); }

/* ---------- quiz ---------- */

.quiz { max-width: var(--measure); margin: 8px 0 0; }
.quiz__shell {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow);
}
.quiz__progress { font-size: .88rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 10px; }
.quiz__q { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; margin: 0 0 18px; line-height: 1.35; }
.quiz__options { border: 0; padding: 0; margin: 0 0 18px; }
.quiz__options legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.quiz__opt {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; background: #fff;
  transition: border-color .12s ease, background .12s ease;
}
.quiz__opt:hover { border-color: var(--teal); background: var(--teal-wash); }
.quiz__opt input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.quiz__opt.is-correct { border-color: var(--green); background: var(--green-wash); }
.quiz__opt.is-wrong { border-color: var(--red); background: var(--red-wash); }
.quiz__opt.is-locked { cursor: default; }
.quiz__opt.is-locked:hover { border-color: var(--line); background: #fff; }
.quiz__opt.is-locked.is-correct:hover { border-color: var(--green); background: var(--green-wash); }
.quiz__opt.is-locked.is-wrong:hover { border-color: var(--red); background: var(--red-wash); }
.quiz__explain { display: block; font-size: .92rem; color: var(--ink-soft); margin-top: 8px; }
.quiz__verdict { font-weight: 700; font-size: .92rem; }
.quiz__verdict--ok { color: var(--green); }
.quiz__verdict--no { color: var(--red); }
.quiz__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz__result { text-align: center; padding: 10px 0; }
.quiz__score { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; margin: 0; }
.quiz__score--pass { color: var(--green); }
.quiz__score--fail { color: var(--amber); }
.quiz__missed { text-align: left; margin: 18px 0; }

/* ---------- certificate ---------- */

.cert-block { margin: 22px 0; }
.cert-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 240px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field textarea {
  font: inherit; font-size: 1rem; padding: 12px 14px; min-height: 48px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
  width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--teal); }
.field__hint { font-size: .85rem; color: var(--ink-soft); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cert-preview {
  margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 10px; box-shadow: var(--shadow);
}
.cert-preview canvas, .cert-preview img { display: block; width: 100%; height: auto; border-radius: 4px; }
.cert-id {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem; word-break: break-all; color: var(--ink-soft);
  background: #F4F2EC; padding: 8px 10px; border-radius: 6px; display: block; margin: 10px 0;
}
.cert-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cert-note { font-size: .85rem; color: var(--ink-soft); margin-top: 12px; }

/* ---------- progress ---------- */

.ring { display: inline-flex; align-items: center; gap: 10px; }
.ring svg { width: 54px; height: 54px; flex: none; }
.ring__track { stroke: var(--line); }
.ring__fill { stroke: var(--accent, var(--teal)); stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.ring__label { font-size: .9rem; font-weight: 600; color: var(--ink-soft); }

.badge-state {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 600; color: var(--ink-soft);
  background: #F1EFE9; border-radius: 999px; padding: 6px 14px;
}
.badge-state--unlocked { background: var(--green-wash); color: var(--green); }

/* ---------- crisis resources page ---------- */

.resource {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.resource__name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; margin: 0 0 6px; }
.resource__number {
  display: inline-block; font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 700;
  font-family: var(--serif); color: var(--teal-dark); text-decoration: none; margin: 4px 0 8px;
  letter-spacing: -.01em;
}
.resource__number:hover { color: var(--teal); text-decoration: underline; }
.resource p { margin-bottom: 0; font-size: .96rem; color: var(--ink-soft); }

/* ---------- stats ---------- */

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.stat__figure { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; color: var(--teal-dark); line-height: 1.15; margin-bottom: .3em; }
.stat__label { font-size: .98rem; margin-bottom: .6em; }
.stat__source { font-size: .82rem; color: var(--ink-soft); font-style: normal; }

.how-step { display: flex; gap: 14px; align-items: flex-start; }
.how-step__n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal-wash); color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem;
}
.how-step__body h3 { margin: 2px 0 .35em; font-size: 1.05rem; }
.how-step__body p { font-size: .95rem; color: var(--ink-soft); margin: 0; }

/* ---------- footer ---------- */

.site-footer { flex: none; margin-top: 56px; }
.crisis-strip { background: var(--ink); color: #fff; padding: 14px 0; }
.crisis-strip__inner { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; text-align: center; font-size: .95rem; }
.crisis-strip__item { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.crisis-strip__label { color: #C6D2DF; }
.crisis-strip a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.crisis-strip a:hover { color: #fff; text-decoration: none; }

.footer-main { background: #F4F2EC; border-top: 1px solid var(--line); padding: 34px 0 28px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 18px; }
.footer-nav a { font-size: .93rem; color: var(--ink); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; color: var(--teal-dark); }
.footer-disclaimer { font-size: .88rem; color: var(--ink-soft); max-width: 74ch; margin-bottom: 14px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; font-size: .85rem; color: var(--ink-soft); }
.footer-bottom button {
  font: inherit; font-size: .85rem; background: none; border: 0; padding: 0;
  color: var(--ink-soft); text-decoration: underline; cursor: pointer;
}
.footer-bottom button:hover { color: var(--teal-dark); }

/* ---------- misc ---------- */

.lede { font-size: 1.12rem; color: var(--ink-soft); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-dark); margin-bottom: .6em; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 14px; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.noscript-note {
  background: var(--amber-wash); border: 1px solid #F3DFC0; border-radius: var(--radius);
  padding: 14px 18px; font-size: .95rem;
}

.toc { font-size: .95rem; }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .card, .quiz__shell, .course-card, .track-card { padding: 18px; }
  .hero { padding: 40px 0 30px; }
}

/* ---------- brand mark (themeable) ---------- */

.mark-tile { fill: var(--teal); }
.mark-a { fill: var(--ink); }
.mark-b { fill: var(--teal); }

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 4px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ink-soft); cursor: pointer;
}
.theme-toggle:hover { background: var(--teal-wash); color: var(--teal-dark); border-color: var(--line); }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: block; }
}
:root[data-theme="light"] .theme-toggle__sun { display: block; }
:root[data-theme="light"] .theme-toggle__moon { display: none; }

/* ---------- surfaces that were hard-coded for the light theme ---------- */

.site-header { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.footer-main { background: color-mix(in srgb, var(--card) 60%, var(--bg)); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
  .footer-main { background: var(--card); }
}
:root[data-theme="dark"] .crisis-strip,
:root[data-theme="dark"] .how-step__n { color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .crisis-strip { background: #060B10; }
  :root:not([data-theme="light"]) .box-911 { border-color: #4B2226; }
  :root:not([data-theme="light"]) .quiz__opt { background: var(--card); }
  :root:not([data-theme="light"]) .field input,
  :root:not([data-theme="light"]) .field textarea { background: var(--card); }
  :root:not([data-theme="light"]) .cert-id { background: #101922; }
}
:root[data-theme="dark"] .crisis-strip { background: #060B10; }
:root[data-theme="dark"] .box-911 { border-color: #4B2226; }
:root[data-theme="dark"] .quiz__opt { background: var(--card); }
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea { background: var(--card); }
:root[data-theme="dark"] .cert-id { background: #101922; }
.crisis-strip { background: var(--strip-bg, var(--ink)); }

/* ---------- search ---------- */

.search-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.search-form .field { flex: 1 1 280px; }
.search-count { font-size: .92rem; color: var(--ink-soft); margin: 18px 0 10px; }
.search-hit {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--teal));
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  text-decoration: none; color: inherit;
}
.search-hit:hover { box-shadow: var(--shadow-lift); color: inherit; }
.search-hit__title { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; display: block; }
.search-hit__why { font-size: .92rem; color: var(--ink-soft); display: block; margin-top: 4px; }
.search-hit__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.search-hit mark { background: color-mix(in srgb, var(--teal) 22%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.search-empty { color: var(--ink-soft); }
.search-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.search-suggest button {
  font: inherit; font-size: .85rem; padding: 6px 12px; cursor: pointer;
  background: var(--card); color: var(--teal-dark);
  border: 1px solid var(--line); border-radius: 999px;
}
.search-suggest button:hover { border-color: var(--teal); background: var(--teal-wash); }

/* ---------- print: a course page should print like a handout ---------- */

@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; --ink-soft: #333; --line: #bbb; }
  body { font-size: 11.5pt; line-height: 1.45; background: #fff; color: #000; }
  .site-header, .site-nav, .theme-toggle, .site-footer, .skip-link,
  .quiz, #quiz-mount, .related-row, .course-nav-note, .feedback-link,
  .hero__actions, .search-form, [data-champion-block], [data-badge-block],
  noscript { display: none !important; }
  main { padding-top: 0; }
  .wrap { max-width: none; padding: 0; }
  .course-body, .measure { max-width: none; }
  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; margin-top: 14pt; page-break-after: avoid; }
  h3 { font-size: 12pt; page-break-after: avoid; }
  .box-911 {
    border: 2pt solid #000 !important; background: #fff !important;
    padding: 8pt 10pt; page-break-inside: avoid;
  }
  .box-911__lead { color: #000; }
  #call-911-recap { display: none; }
  .vignette, .recap, .callout, .crisis-banner, .steps li { page-break-inside: avoid; }
  .card, .vignette, .recap { border: 1pt solid #999; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
  .sources a::after { content: " (" attr(href) ")"; font-size: 8.5pt; word-break: break-all; }
  details.faq-item { border: 1pt solid #999; page-break-inside: avoid; }
  details.faq-item > div { display: block !important; }
  .course-article::after {
    content: "SignsToSave — free emergency-recognition courses. Educational content, not medical advice. In an emergency, call 911.";
    display: block; margin-top: 14pt; padding-top: 8pt;
    border-top: 1pt solid #999; font-size: 9pt; color: #333;
  }
  @page { margin: 14mm; }
}

.print-link { font-size: .92rem; }
