/* A Little Space — dark version.
   Loaded last on every page. Everything dark is scoped to
   html[data-theme="dark"], which the inline boot script sets before first
   paint from localStorage ("als-theme") or the visitor's system preference.
   Light mode is untouched: no rule here applies without [data-theme="dark"],
   except the theme toggle button's own styles (it shows in both versions). */

/* ---------- The day/night slider (both versions) ---------- */
/* A clear glass track, sun on the left, moon on the right, and a
   thumb that slides with a finger (Nov 12, 2026, Graham, after
   the workout app switcher). The class names stayed the same, so
   every page mount and the footer rules below still hold. */
.als-theme-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 4px 6px;
  border: none; background: transparent; color: inherit;
  font: inherit; font-size: .9rem; font-weight: 700; line-height: 1;
  cursor: pointer; white-space: nowrap; flex: none;
  -webkit-tap-highlight-color: transparent; touch-action: pan-y;
}
.als-theme-toggle:focus-visible { outline: 3px solid #916244; outline-offset: 3px; border-radius: 999px; }
.als-theme-track {
  position: relative; display: block; width: 92px; height: 40px; flex: none;
  border-radius: 999px; border: 1px solid rgba(110,150,128,.5);
  background: rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 4px rgba(20,40,30,.18);
}
html[data-theme="dark"] .als-theme-track { background: rgba(18,30,24,.45); border-color: rgba(160,190,170,.35); }
.als-theme-ic { position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; opacity: .8; pointer-events: none; }
.als-theme-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.als-theme-sun { left: 9px; }
.als-theme-moonic { right: 9px; }
.als-theme-thumb {
  position: absolute; top: 3px; left: 4px; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.88); color: #285d56;
  box-shadow: 0 2px 6px rgba(20,40,30,.35);
  transition: transform .22s ease;
}
html[data-theme="dark"] .als-theme-thumb { background: rgba(40,58,48,.92); color: #f0d9a8; }
.als-theme-toggle.is-dark .als-theme-thumb { transform: translateX(50px); }
.als-theme-toggle.dragging .als-theme-thumb { transition: none; }
.als-theme-toggle .als-theme-icon { display: inline-flex; width: 17px; height: 17px; }
.als-theme-toggle .als-theme-icon svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) { .als-theme-thumb { transition: none; } }
/* The toggle sits in the footer now, beside the Comfort toggle:
   same calm pill, footer spacing, matched height. */
.footer .als-theme-toggle, footer .als-theme-toggle { margin-top: 12px; margin-right: 10px; min-height: 44px; }
.als-theme-row { display: flex; justify-content: flex-start; margin: 12px 0 0; }
@media (max-width: 660px) {
  /* Five tabs and no toggle up top: keep the even three-column grid. */
  header.als-header .als-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print { .als-theme-toggle, .als-theme-row { display: none !important; } }

/* ---------- Dark design tokens (sheets that use variables) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  /* soft-space.css */
  --space-paper: #131e19; --space-ink: #edeade; --space-deep: #8fd0bf;
  --space-sage: #22382b; --space-violet: #2d2838; --space-peach: #382a23;
  --space-custard: #37311f; --space-stroke: #33463b;
  --space-shadow: 0 12px 33px rgba(0, 0, 0, .35);
  /* start/styles.css */
  --bg: #131e19; --ink: #edeade; --muted: #aebba9; --forest: #8fd0bf;
  --sage: #1e2f26; --rose: #36272b; --lilac: #2c2739; --sand: #33291d;
  --line: #33463b; --focus: #e3a857;
  /* conversations (inline :root tokens) */
  --teal: #8fd0bf; --teal2: #24463a; --plum: #c4aed6; --blue: #223140;
  --paper: #213129;
  /* three-home.css */
  --als-deep: #8fd0bf; --als-text: #edeade; --als-muted: #aebba9;
  /* three-paths.css (not linked today, kept for safety) */
  --tri-ink: #edeade; --tri-deep: #8fd0bf; --tri-sage: #22382b; --tri-mauve: #2d2838; --tri-sun: #37311f;
  /* live-well */
  --well-ink: #edeade;
}
html[data-theme="dark"] .tomorrow-page {
  --tomorrow-paper: #131e19; --tomorrow-ink: #edeade; --tomorrow-teal: #8fd0bf;
  --tomorrow-muted: #aebba9; --tomorrow-line: #33463b; --tomorrow-white: #213129;
  /* --tomorrow-sky stays light on purpose: the hero sky is a lit window. */
}

/* ---------- Dark base ---------- */
html[data-theme="dark"] { background: #131e19; color: #edeade; }
html[data-theme="dark"] body { background: #131e19; color: #edeade; }
html[data-theme="dark"] p { color: #cfd4c6; }
html[data-theme="dark"] li { color: #cfd4c6; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: #f2eee1; }
html[data-theme="dark"] a { color: #8fd0bf; }
html[data-theme="dark"] em { color: #c4aed6; }
html[data-theme="dark"] ::selection { background: #2e6b58; color: #ffffff; }
html[data-theme="dark"] :focus-visible { outline-color: #e3a857; }

/* Dark forms everywhere */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #1b2922; color: #edeade; border-color: #41584a;
  color-scheme: dark;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8fa295; opacity: 1; }
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] select:focus-visible { outline: 3px solid #e3a857; outline-offset: 2px; }

/* ---------- Dark header & navigation ---------- */
html[data-theme="dark"] header.als-header {
  background: rgba(19, 30, 25, .97); border-bottom-color: #2a3a31; color: #edeade;
}
html[data-theme="dark"] header.als-header > .brand,
html[data-theme="dark"] header.als-header .brand { color: #8fd0bf; }
html[data-theme="dark"] header.als-header .als-nav { background: #1b2922; border-color: #33463b; }
html[data-theme="dark"] header.als-header .als-nav a { color: #cfd4c6; }
html[data-theme="dark"] header.als-header .als-nav a:hover { background: #26382e; }
html[data-theme="dark"] header.als-header .als-nav a[aria-current] { background: #2b4234; color: #f0d9a8; box-shadow: none; }
html[data-theme="dark"] header.als-header .als-tools { border-top-color: #2a3a31; }
html[data-theme="dark"] .als-theme-toggle { background: #22382c; border-color: #41584a; color: #f0d9a8; }
html[data-theme="dark"] .als-theme-toggle:hover { background: #2b4234; }
html[data-theme="dark"] .als-theme-toggle:focus-visible { outline-color: #e3a857; }

html[data-theme="dark"] .top { background: rgba(19, 30, 25, .97); border-bottom-color: #2a3a31; }
html[data-theme="dark"] .top .brand { color: #8fd0bf; }
/* The doors shelf closes the top banner in dark too: same deep green
   as the dark header, same border, never the light paper. */
html[data-theme="dark"] .sf-door-switcher { background: #131e19; border-bottom-color: #2a3a31; }
html[data-theme="dark"] .top nav a { color: #cfd4c6; }
html[data-theme="dark"] .top nav a:hover { background: #22382c; color: #edeade; }
html[data-theme="dark"] .topbar { background: rgba(19, 30, 25, .97); border-bottom-color: #33463b; }
html[data-theme="dark"] .skip { background: #213129; color: #edeade; }

/* ---------- Dark shared components (site-pages.css / soft-space.css) ---------- */
html[data-theme="dark"] .button, html[data-theme="dark"] .primary,
html[data-theme="dark"] .btn:not(.secondary):not(.outline) { background: #2e6b58; color: #ffffff; }
html[data-theme="dark"] .button:hover, html[data-theme="dark"] .primary:hover,
html[data-theme="dark"] .btn:not(.secondary):not(.outline):hover { background: #37806a; }
html[data-theme="dark"] .button.alt, html[data-theme="dark"] .btn.secondary {
  background: #22382c !important; color: #a9dccb !important; border-color: #41584a;
}
html[data-theme="dark"] .button.alt:hover, html[data-theme="dark"] .btn.secondary:hover { background: #2b4234 !important; }
html[data-theme="dark"] .card, html[data-theme="dark"] .docs a, html[data-theme="dark"] .next-grid a,
html[data-theme="dark"] .chapter-grid article {
  background: #213129; border-color: #33463b; color: #edeade;
}
html[data-theme="dark"] .card p, html[data-theme="dark"] .docs a span { color: #aebba9; }
html[data-theme="dark"] .card:hover, html[data-theme="dark"] .docs a:hover { border-color: #4d7263; }
html[data-theme="dark"] .intro-card { background: #1e2f26; border-color: #33463b; }
html[data-theme="dark"] .guide article { background: #262233; }
html[data-theme="dark"] .guide h3 { color: #e6ddf2; }
html[data-theme="dark"] .guide ul { color: #c9cdd0; }
html[data-theme="dark"] .note { background: #33291d; border-color: #54432a; }
html[data-theme="dark"] .cta { background: #1e2f26; }
html[data-theme="dark"] .pullquote { border-left-color: #7d6891; color: #ddd6ea; }
html[data-theme="dark"] .eyebrow { color: #c4aed6; }
html[data-theme="dark"] .number { color: #d3a6cc; }
html[data-theme="dark"] .tiny, html[data-theme="dark"] .small { color: #aebba9; }
html[data-theme="dark"] .footer { background: #101915; border-top-color: #2a3a31; color: #aebba9; }
html[data-theme="dark"] .footer a { color: #8fd0bf; }
html[data-theme="dark"] .plain ul { color: #c9d2c2; }

/* Soft-space hero panels become deep tints, keeping their shapes */
html[data-theme="dark"] .story-view .hero {
  background: radial-gradient(ellipse at 82% 23%, #4a3f22 0%, transparent 40%), linear-gradient(130deg, #2b2438 10%, #33262c 84%);
}
html[data-theme="dark"] .life-view .hero {
  background: radial-gradient(ellipse at 87% 23%, #4a3f22 0%, transparent 35%), linear-gradient(120deg, #33262a, #282238 86%);
}
html[data-theme="dark"] .school-view .hero { background: linear-gradient(135deg, #1e2f26, #33291d 83%); }
html[data-theme="dark"] .story-view .hero:after { color: #8d739e; }
html[data-theme="dark"] .life-view .hero:after, html[data-theme="dark"] .school-view .hero:after { color: #96748f; }
html[data-theme="dark"] .school-view .card:nth-child(1) { background: #2c2739; }
html[data-theme="dark"] .school-view .card:nth-child(2) { background: #22382b; }
html[data-theme="dark"] .school-view .card:nth-child(3) { background: #37311f; }
html[data-theme="dark"] .life-view .side-note { background: #1e2f26; }
html[data-theme="dark"] .life-view .letter { background: #382a23; }
html[data-theme="dark"] .space-motion-toggle { background: #1b2922; border-color: #41584a; color: #cfd4c6; }
html[data-theme="dark"] .space-motion-toggle:hover { background: #22382c; border-color: #4d7263; }

/* ---------- Start page extras (tokens do most of it) ---------- */
html[data-theme="dark"] .route-card { box-shadow: none; }
html[data-theme="dark"] .route-card:hover { border-color: #4d7263; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .card-icon { background: #2c4238; }
html[data-theme="dark"] .privacy-note { background: #1b2922; }

/* ---------- Conversations extras (tokens do most of it) ---------- */
html[data-theme="dark"] .segmented { background: #1b2922; }
html[data-theme="dark"] .segmented button[aria-pressed="true"],
html[data-theme="dark"] .segmented button.active { background: #2b4234; color: #edeade; }

/* ---------- Little Things Journal & A Little Reminder (inline styles) ---------- */
html[data-theme="dark"] .panel { background: #213129; border-color: #33463b; }
html[data-theme="dark"] section.panel h2 { color: #f2eee1; }
html[data-theme="dark"] textarea { background: #1b2922; }
html[data-theme="dark"] button.secondary { background: #22382c; color: #a9dccb; }

/* ---------- Room for Tomorrow ---------- */
html[data-theme="dark"] .tomorrow-page h1 em { color: #a8ccd8; }
html[data-theme="dark"] .tomorrow-page a:focus-visible,
html[data-theme="dark"] .tomorrow-page button:focus-visible,
html[data-theme="dark"] .tomorrow-page summary:focus-visible { outline-color: #8fc1e9; }
html[data-theme="dark"] .als-quiet-tools { border-top-color: #33463b; color: #aebba9; }
html[data-theme="dark"] .als-quiet-tools a { background: #1e2f26; color: #a9dccb; border-color: #41584a; }
html[data-theme="dark"] .tomorrow-book { background: #1b2922; border-color: #33463b; }
html[data-theme="dark"] .tomorrow-book select { background: #213129; color: #edeade; border-color: #41584a; }
/* The sky scenes stay lit windows in the dark version. Only their caption
   strip joins the dark page; the illustration and its controls are untouched. */
html[data-theme="dark"] .sky-room { --sky-caption: #1d2a24; --sky-caption-ink: #e8e4d8; --sky-caption-muted: #aebba9; }
html[data-theme="dark"] .sky-room .sky-room-frame { border-color: #41584a; }

/* Print stays on paper */
@media print {
  html[data-theme="dark"] body { background: #fff !important; color: #000 !important; }
}

/* ================= Pass 2: per-page components (audit-driven) ============ */

/* Shared widgets: reading preferences panel, video sections, story shelf */
html[data-theme="dark"] .als-reading-preferences { background: #1e2f26; border-color: #33463b; color: #edeade; }
html[data-theme="dark"] .watch-space { background: #1b2922; border-color: #33463b; color: #edeade; }
html[data-theme="dark"] .watch-playlist button { background: #213129; border-color: #33463b; color: #edeade; }
html[data-theme="dark"] .watch-playlist button[aria-pressed="true"] { background: #2b4234; border-color: #4d7263; }
html[data-theme="dark"] .watch-number { color: #c4aed6; }
html[data-theme="dark"] .als-story-shelf a { background: #213129; border-color: #33463b; color: #edeade; }
html[data-theme="dark"] .als-story-shelf a:hover { background: #26382e; border-color: #4d7263; }
html[data-theme="dark"] .als-story-shelf a > span:first-child { background: #2c4238; color: #a9dccb; box-shadow: 2px 2px 0 #101915; }
html[data-theme="dark"] .als-story-shelf p, html[data-theme="dark"] .als-shelf-eyebrow { color: #aebba9; }
html[data-theme="dark"] .hero .lead { color: #aebba9; }

/* Home */
html[data-theme="dark"] .pillar { border-color: #33463b; box-shadow: 0 13px 30px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .pillar-talk { background: #22382b; }
html[data-theme="dark"] .pillar-story { background: #2c2739; }
html[data-theme="dark"] .pillar-health { background: #37311f; }
html[data-theme="dark"] .pillar-tomorrow { background: #223140; }
html[data-theme="dark"] .pillar-type { color: #c0b3d6; }
html[data-theme="dark"] .how-grid > div { background: #213129; }
html[data-theme="dark"] .quiet-links a { background: #213129; border-color: #33463b; }
html[data-theme="dark"] .welcome-explore { color: #8fd0bf; }
html[data-theme="dark"] .welcome-faq summary { color: #cfd4c6; }

/* Live Well */
html[data-theme="dark"] .live-hero { background: linear-gradient(120deg, #1e2f26, #282238 78%); }
html[data-theme="dark"] .live-hero .lead { color: #cfd4c6; }
html[data-theme="dark"] .live-hero .hero-small { color: #aebba9; }
html[data-theme="dark"] .longevity-intro { background: #1b2922; border-color: #33463b; }
html[data-theme="dark"] .lw-demo { background: #2c2739; }
html[data-theme="dark"] .lw-secondary { background: #22382c; color: #a9dccb; border-color: #41584a; }
html[data-theme="dark"] .lw-answer-overview { background: #1e2f26; }
html[data-theme="dark"] .lw-answer-nav a { background: #213129; }
html[data-theme="dark"] .lw-question { background: #213129; border-color: #33463b; }
html[data-theme="dark"] .lw-question-number { background: #2b4234; color: #a9dccb; }
html[data-theme="dark"] .lw-references { background: #1b2922; border-color: #33463b; }

/* My Story builder */
html[data-theme="dark"] .panel { border-color: #33463b; }
html[data-theme="dark"] .story-view #begin { background: #1b2922; border-color: #33463b; }
html[data-theme="dark"] .prompt-card { background: #213129; border-color: #33463b; }
html[data-theme="dark"] .prompt-card.has-error { background: #38261f; border-color: #a64937; }
html[data-theme="dark"] .prompt-no { background: #2b4234; color: #a9dccb; }
html[data-theme="dark"] .easy-demo { background: #223140; }
html[data-theme="dark"] .completion-banner { background: #2c2739; }
html[data-theme="dark"] .file-btn { background: #22382c; }
html[data-theme="dark"] .optional-settings { background: #1e2f26; }
html[data-theme="dark"] .setting-symbol { background: #2b4234; }
html[data-theme="dark"] .cast-maker { background: #213129; }
html[data-theme="dark"] .book-promise { background: #1e2f26; }
html[data-theme="dark"] .step { background: #213129; }
html[data-theme="dark"] .research-stats article { background: #213129; }
html[data-theme="dark"] .research-boundary { background: #1e2f26; }
html[data-theme="dark"] .text-button { background: #22382c; color: #a9dccb; }
html[data-theme="dark"] button.outline, html[data-theme="dark"] .btn.outline { background: #22382c; color: #a9dccb; border-color: #41584a; }

/* Feel Understood */
html[data-theme="dark"] .u-paths a { border-color: #33463b; }
html[data-theme="dark"] .u-paths a:first-child { background: #22382b; }
html[data-theme="dark"] .u-paths a:last-child { background: #2c2739; }
html[data-theme="dark"] .u-path-icon { background: #2b4234; }
html[data-theme="dark"] .u-path-icon.couples { background: #372f4a; }
html[data-theme="dark"] .u-step-grid article { background: #213129; }
html[data-theme="dark"] .u-step-grid article:nth-child(2) { background: #2a2438; }
html[data-theme="dark"] .u-example { background: #37311f; }
html[data-theme="dark"] .u-safety { background: #1e2f26; }
html[data-theme="dark"] .u-next-cards a { background: #213129; }
html[data-theme="dark"] .u-lead { color: #aebba9; }
html[data-theme="dark"] .u-art { background: radial-gradient(at 25% 25%, #4a3f22 0%, transparent 47%), linear-gradient(130deg, #22382b, #2c2739); }

/* Conversations (self-contained app, scoped to its shell) */
html[data-theme="dark"] #app .hero { background: #1b2922; }
html[data-theme="dark"] #app .panel { background: #1b2922; border-color: #33463b; }
html[data-theme="dark"] #app .science-steps li { background: #213129; }
html[data-theme="dark"] #app .bubble-demo p { background: rgba(33, 49, 41, .95); }
html[data-theme="dark"] #app .bubble-demo span.micro { background: rgba(33, 49, 41, .93); }
html[data-theme="dark"] #app button.small, html[data-theme="dark"] #app a.small { background: #22382c; color: #a9dccb; }
html[data-theme="dark"] #app .start-card .badge { background: #2b4234; }
html[data-theme="dark"] #app label.pick { background: #213129; }
html[data-theme="dark"] #app .iconbtn { background: #22382c; color: #edeade; }
html[data-theme="dark"] #app .workbook-card { background: #213129; border-color: #33463b; }

/* A Little Reminder (headerless page) */
html[data-theme="dark"] body.als-page-reminder section { background: #213129; border-color: #33463b; }
html[data-theme="dark"] body.als-page-reminder button { background: #2e6b58; }
html[data-theme="dark"] body.als-page-reminder button.secondary { background: #22382c; color: #a9dccb; }

/* Room for Tomorrow, pass 2 */
html[data-theme="dark"] a.tomorrow-skip { background: #213129; color: #edeade; }
html[data-theme="dark"] .tomorrow-primary-link,
html[data-theme="dark"] .tomorrow-copy,
html[data-theme="dark"] .tomorrow-support-actions a:first-child { background: #2e6b58; color: #ffffff; }
html[data-theme="dark"] nav.tomorrow-paths a { background: #213129; border-color: #33463b; }
html[data-theme="dark"] .tomorrow-arrival { background: #1b2922; }
html[data-theme="dark"] .tomorrow-feeling-choices button { background: #213129; border-color: #33463b; }
html[data-theme="dark"] .sky-room { color: #edeade; }
html[data-theme="dark"] .sky-room-eyebrow { color: #aebba9; }
html[data-theme="dark"] .sky-room-intro p { color: #cfd4c6; }
html[data-theme="dark"] .sky-room-footnote { color: #aebba9; }
html[data-theme="dark"] .sky-room-footnote a { color: #8fd0bf; }
html[data-theme="dark"] .tomorrow-sky figcaption { color: #aebba9; }
html[data-theme="dark"] .tomorrow-words { background: #1b2922; }
html[data-theme="dark"] .tomorrow-note { background: #213129; }
html[data-theme="dark"] .tomorrow-quiet-box { background: #213129; }
html[data-theme="dark"] .tomorrow-wonder { background: #1b2922; }
html[data-theme="dark"] .tomorrow-wonder-card { background: #213129; }
html[data-theme="dark"] .tomorrow-keep { background: #22382c; color: #a9dccb; }
html[data-theme="dark"] .tomorrow-support { background: #1b2922; }
html[data-theme="dark"] .tomorrow-support-actions a { border-color: #41584a; }
html[data-theme="dark"] .tomorrow-support-actions a + a { background: #22382c; color: #a9dccb; }
html[data-theme="dark"] .tomorrow-emergency { background: #33291d; }
html[data-theme="dark"] footer.tomorrow-footer { background: #101915; color: #aebba9; border-top-color: #2a3a31; }
html[data-theme="dark"] .tb-start-copy p, html[data-theme="dark"] .tb-fine { color: #aebba9; }

/* ================= Pass 3: stubborn text colors (audit round 2) ========= */
html[data-theme="dark"] .pillar .pillar-lead { color: #edeade; }
html[data-theme="dark"] .pillar-details { color: #aebba9; }
html[data-theme="dark"] .watch-caption { color: #aebba9; }
html[data-theme="dark"] .watch-caption strong { color: #edeade; }
html[data-theme="dark"] .watch-transcript summary { color: #a9dccb; }
html[data-theme="dark"] .how-grid strong { color: #edeade; }
html[data-theme="dark"] .how-grid span { color: #aebba9; }
html[data-theme="dark"] .lw-form-status { color: #a9dccb; }
html[data-theme="dark"] .lw-question label { color: #edeade; }
html[data-theme="dark"] .lw-references summary { color: #a9dccb; }
html[data-theme="dark"] .als-story-shelf nav a small { color: #aebba9; }
html[data-theme="dark"] .als-story-shelf .als-shelf-current { color: #f0d9a8; }
html[data-theme="dark"] .u-example blockquote { color: #edeade; }
html[data-theme="dark"] .u-example p { color: #cfd4c6; }
html[data-theme="dark"] .u-next-cards a span { color: #aebba9; }
html[data-theme="dark"] .easy-demo strong { color: #edeade; }
html[data-theme="dark"] .easy-demo small { color: #aebba9; }
html[data-theme="dark"] .completion-banner { color: #edeade; }
html[data-theme="dark"] .book-promise { color: #edeade; }
html[data-theme="dark"] .step b { color: #c4aed6; }
html[data-theme="dark"] .research-number { color: #c4aed6; }
html[data-theme="dark"] .research-stats article p { color: #aebba9; }
html[data-theme="dark"] button.destructive { color: #f0a596; }
html[data-theme="dark"] footer { color: #aebba9; }
html[data-theme="dark"] nav.tomorrow-paths a small { color: #aebba9; }
html[data-theme="dark"] .tomorrow-eyebrow { color: #a8ccd8; }
html[data-theme="dark"] .tomorrow-supporter blockquote { color: #cfd4c6; }
html[data-theme="dark"] .sky-room .sky-room-title { color: #f2eee1; }
html[data-theme="dark"] .sky-room .sky-room-intro p { color: #cfd4c6; }
/* The originals set these two colors with !important; matching strength, dark only. */
html[data-theme="dark"] .tomorrow-keep { color: #a9dccb !important; }
html[data-theme="dark"] .tomorrow-another { color: #8fd0bf !important; }
html[data-theme="dark"] .cast-maker { background: #213129 !important; }
html[data-theme="dark"] .top-actions .iconbtn { background: #22382c; color: #edeade; }
html[data-theme="dark"] .recovery-links .badge { background: #2b4234; }

/* ================= Pass 4: final specificity fixes ====================== */
html[data-theme="dark"] .story-view .optional-settings .setting-symbol { background: #2b4234; color: #a9dccb; }
html[data-theme="dark"] .optional-settings summary strong { color: #edeade; }
html[data-theme="dark"] .optional-settings summary small { color: #aebba9; }
html[data-theme="dark"] #vault-remove { color: #f0a596; }

/* ================= Pass 5: reader-state components ====================== */
html[data-theme="dark"] .watch-playlist small { color: #aebba9; }
html[data-theme="dark"] .destructive { color: #f0a596 !important; border-color: #8a5a4c !important; }
html[data-theme="dark"] .audio-controls { background: #213129; border-color: #33463b; }
html[data-theme="dark"] .reflection { background: #213129; border-color: #54432a; }
html[data-theme="dark"] .reflection-prompt { color: #c4aed6; }
html[data-theme="dark"] .branch-impact { color: #c4aed6; }
html[data-theme="dark"] .prose p.reading-now { background: #2c2739; box-shadow: 0 0 0 9px #2c2739; }

/* The book page in the dark version: warm dark paper with the same warm
   ink as the rest of the dark book (book.css paints the paper #27352b).
   These colors must stay light enough to read on that paper. */
html[data-theme="dark"] .tb-paper { color: #eae5d1; }
html[data-theme="dark"] .tb-paper h3, html[data-theme="dark"] .tb-paper h4 { color: #f0ead6; }
html[data-theme="dark"] .tb-paper p { color: #eae5d1; }
html[data-theme="dark"] .tb-paper .tb-chapter-label { color: #b8ab8d; }
html[data-theme="dark"] .tb-paper .tb-paper-number { color: #9db098; }
html[data-theme="dark"] .tb-paper a { color: #8fd0bf; }

/* site-features: the single source of dark truth for .sf-root components.
   site-features.css carries light values only and never consults the OS
   color scheme; components follow html[data-theme] alone. The palette
   keeps the site's dark warmth: cards one step above the #131e19 page,
   headings warm off-white, and the accent stays warm amber. */
html[data-theme="dark"] .sf-root{
  --sf-bg:#213129;
  --sf-bg-soft:#1b2922;
  --sf-ink:#edeade;
  --sf-ink-soft:#cfd4c6;
  --sf-line:#3a4f42;
  --sf-accent:#f2b266;
  --sf-accent-ink:#2e1f07;
  --sf-chip:#2e4436;
  --sf-focus:#e8a857;
  --sf-card-shadow:0 14px 34px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.35);
}
html[data-theme="dark"] .sf-breath-circle{background:radial-gradient(circle at 38% 34%,#8a6a3f,#54401f 70%,#3a2c15);box-shadow:0 8px 24px rgba(0,0,0,.45)}
/* sf text links keep the warm amber accent in dark, above the site-wide link color */
html[data-theme="dark"] .sf-journey-list a { color: var(--sf-accent); }

/* ---------- wave2 pages ---------- */
/* Dark coverage for the wave-2 sections (Hard Moments, Today, Letters,
   For a Friend, Room for Tonight, Pocket Cards, For Professionals).
   Screen only, so the pocket cards and professional printables keep
   their light print rendering. Base body, headings, links, and form
   controls on these pages are covered by the dark base rules above;
   shared .card and .note surfaces are covered earlier in this sheet. */
@media screen {
  /* Shared wave-2 widgets (wave2-features.css) */
  html[data-theme="dark"] .w2-breath { background: #1b2922; border-color: #33463b; }
  html[data-theme="dark"] .w2-breath-title { color: #e9e2f2; }
  html[data-theme="dark"] .w2-breath-phase { color: #cfd4c6; }
  html[data-theme="dark"] .w2-breath [data-breath-stop] { background: #213129; color: #c4aed6; }
  html[data-theme="dark"] .w2-share button { background: #213129; color: #8fd0bf; border-color: #8fd0bf; }
  html[data-theme="dark"] .w2-share button:hover { background: #26382e; }
  html[data-theme="dark"] .w2-share-status { color: #cfd4c6; }
  html[data-theme="dark"] .w2-support { background: #33291d; border-color: #54432a; }
  html[data-theme="dark"] .w2-skill { color: #c4aed6; }
  html[data-theme="dark"] .w2-letter p { color: #cfd4c6; }
  html[data-theme="dark"] .w2-letter .w2-sign { color: #b9cec0; }
  html[data-theme="dark"] .w2-today-date { color: #cfd4c6; }

  /* Room for Tonight (tonight.css) */
  html[data-theme="dark"] .tn-book { background: #1b2922; border-color: #33463b; }
  html[data-theme="dark"] .tn-paper { background: #213129; border-color: #33463b; color: #edeade; box-shadow: 0 4px 0 #182420, 0 5px 0 #101713, 0 12px 25px rgba(0, 0, 0, .35); }
  html[data-theme="dark"] .tn-chapter-label { color: #e0b48c; }
  html[data-theme="dark"] .tn-help-step { background: #213129; border-color: #33463b; }
  html[data-theme="dark"] .tn-ending { background: #1b2922; border-color: #33463b; }
  html[data-theme="dark"] .tn-secondary { background: #213129; color: #8fd0bf; border-color: #41584a; }
  html[data-theme="dark"] .tn-secondary:hover { background: #26382e; }
  html[data-theme="dark"] .tn-text-button { color: #8fd0bf; }
  html[data-theme="dark"] .tn-fine, html[data-theme="dark"] .tn-device-note,
  html[data-theme="dark"] .tn-saved { color: #b9cec0; }

  /* Pocket Cards screen previews (pocket-cards.css) */
  html[data-theme="dark"] .pc-card { background: #213129; color: #edeade; border-color: #6b7a70; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
  html[data-theme="dark"] .pc-card-title { color: #8fd0bf; }
  html[data-theme="dark"] .pc-card-line { color: #cfd4c6; }
  html[data-theme="dark"] .pc-card-footer, html[data-theme="dark"] .pc-card-site,
  html[data-theme="dark"] .pc-record-label { color: #b9cec0; }
  html[data-theme="dark"] .pc-skills-list, html[data-theme="dark"] .pc-words-script { color: #edeade; }
  html[data-theme="dark"] .pc-notes, html[data-theme="dark"] .pc-print-status { color: #cfd4c6; }

  /* For Professionals screen surfaces (print.css) */
  html[data-theme="dark"] .pro-handout { background: #213129; border-color: #33463b; }
  html[data-theme="dark"] .pro-handout-lead { color: #edeade; }
  html[data-theme="dark"] .pro-handout-list { color: #cfd4c6; }
  html[data-theme="dark"] .pro-card { background: #213129; border-color: #41584a; }
  html[data-theme="dark"] .pro-handout-url, html[data-theme="dark"] .pro-short-url,
  html[data-theme="dark"] .pro-card-url { color: #8fd0bf; }
}


/* Liquid glass (Nov 12, 2026): the footer goes frosted to match the
   header and the door shelf. */
footer,.footer{background:rgba(252,248,242,.6);-webkit-backdrop-filter:blur(16px) saturate(150%);backdrop-filter:blur(16px) saturate(150%);border-top:1px solid rgba(120,110,90,.18)}
html[data-theme="dark"] footer,html[data-theme="dark"] .footer{background:rgba(23,33,29,.55);border-top-color:rgba(255,255,255,.12)}
@media (prefers-reduced-transparency: reduce){footer,.footer{-webkit-backdrop-filter:none;backdrop-filter:none}}

/* Top slider row on the long app pages (Nov 12, 2026): same switch,
   at the top of the page where it can be reached. */
.als-theme-top{display:flex;justify-content:flex-end;padding:2px 2px 8px}
