/* Appearance changes only: both modes share the same content and layout. */
:root {
  color-scheme: dark;
  --theme-control-bg: #121c23;
  --theme-control-line: #ffffff29;
  --theme-control-text: #c6d3c5;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8f3;
  --panel: #ffffff;
  --panel2: #edf2eb;
  --text: #20362b;
  --muted: #52675a;
  --quiet: #627368;
  --line: #d4dfd2;
  --lime: #326b42;
  --violet: #7459a2;
  --coral: #a25e43;
  --light-accent-soft: #e7efdf;
  --light-accent-line: #adc4a3;
  --light-amber: #805c28;
  --light-amber-bg: #f7efdf;
  --light-blue: #3c647b;
  --light-blue-bg: #eaf1f6;
  --theme-control-bg: #ffffff;
  --theme-control-line: #c8d6c4;
  --theme-control-text: #326143;
}

/* A labelled, keyboard accessible switch stays in the main header. */
.theme-toggle {
  min-height: 44px;
  min-width: 88px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  border: 1px solid var(--theme-control-line);
  border-radius: 6px;
  background: var(--theme-control-bg);
  color: var(--theme-control-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: border-color .2s, background .2s;
}
.theme-toggle:hover { border-color: var(--lime); }
.theme-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-icon-sun { display: block; }
:root[data-theme="light"] .theme-icon-moon { display: none; }

/* A compact header keeps destinations and utilities in deliberate groups. */
.nav-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  height: 86px;
}
.nav-wrap > .brand { white-space: nowrap; }
.main-nav {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  justify-self: center;
  gap: 6px;
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--theme-control-line);
  border-radius: 8px;
  background: var(--theme-control-bg);
  color: var(--theme-control-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.main-nav a:hover { border-color: var(--lime); background: #1c2a22; }
.main-nav a[aria-current] { border-color: var(--lime); background: var(--lime); color: #14200e; font-weight: 600; }
.main-nav a[aria-current]:after { display: none; }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.theme-toggle { min-width: 78px; min-height: 44px; padding: 10px 11px; border-radius: 8px; }
.nav-compare {
  min-height: 44px;
  margin-left: 0;
  padding: 10px 12px;
  gap: 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
.nav-feedback {
  min-height: 46px;
  padding: 11px 15px;
  gap: 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.3;
  box-shadow: none;
}
.nav-feedback > span:last-child { font-size: 19px; }
@media (min-width: 721px) and (max-width: 1270px) {
  html { scroll-padding-top: 150px; }
  .nav-wrap {
    grid-template-columns: auto minmax(0, 1fr) 80px 114px;
    grid-template-areas: "brand . theme compare" "nav nav feedback feedback";
    height: auto;
    min-height: 0;
    gap: 11px 12px;
    padding: 14px 0;
  }
  .nav-wrap > .brand { grid-area: brand; }
  .nav-actions { display: contents; }
  .theme-toggle { grid-area: theme; width: 100%; }
  .nav-compare { grid-area: compare; justify-content: center; }
  .main-nav { grid-area: nav; justify-self: start; }
  .nav-feedback { grid-area: feedback; width: 100%; }
  .resource-section, .resource-record { scroll-margin-top: 150px; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 200px; }
  .nav-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand theme compare" "nav nav nav" "feedback feedback feedback";
    height: auto;
    min-height: 0;
    gap: 10px 8px;
    padding: 13px 0 12px;
  }
  .nav-wrap > .brand { grid-area: brand; margin-right: 0; font-size: 24px; gap: 8px; }
  .nav-wrap > .brand svg { width: 28px; height: 28px; }
  .nav-actions { display: contents; }
  .theme-toggle { grid-area: theme; min-width: 73px; padding: 9px; gap: 6px; font-size: 11px; }
  .nav-compare { grid-area: compare; min-height: 44px; padding: 9px; gap: 5px; font-size: 12px; }
  .main-nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: 1fr 1fr 1.32fr 1fr;
    width: 100%;
    gap: 6px;
    justify-self: stretch;
  }
  .main-nav a { min-height: 40px; padding: 9px 5px; font-size: 11px; }
  .nav-feedback { grid-area: feedback; width: 100%; min-height: 46px; padding: 11px 15px; font-size: 13px; gap: 20px; }
  .resource-section, .resource-record { scroll-margin-top: 200px; }
}
@media (max-width: 375px) {
  .nav-wrap { gap: 9px 6px; }
  .nav-wrap > .brand { font-size: 22px; gap: 6px; letter-spacing: -1.2px; }
  .nav-wrap > .brand svg { width: 25px; height: 25px; }
  .theme-toggle { min-width: 66px; padding: 8px; gap: 5px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .main-nav { gap: 5px; }
  .main-nav a { padding-inline: 4px; font-size: 10px; }
  .nav-compare { padding-inline: 7px; }
}
@media (max-width: 355px) {
  .nav-wrap > .brand { font-size: 20px; gap: 5px; }
  .nav-wrap > .brand svg { width: 22px; height: 22px; }
  .theme-toggle { min-width: 64px; padding: 7px; font-size: 10px; }
  .nav-compare { font-size: 11px; padding-inline: 5px; gap: 3px; }
  .main-nav { gap: 4px; }
  .main-nav a { font-size: 9.5px; }
}

/* Day: a warm paper surface, clear ink and restrained forest-green accents. */
:root[data-theme="light"] ::selection { background: #d1e7b6; color: #20362b; }
:root[data-theme="light"] .site-header { background: #f6f8f3ed; }
:root[data-theme="light"] .main-nav a { color: #42604c; background: #ffffff; border-color: #c8d6c4; }
:root[data-theme="light"] .main-nav a:hover { color: #326b42; background: #e7efdf; border-color: #8faa84; }
:root[data-theme="light"] .main-nav a[aria-current] { color: #ffffff; background: #326b42; border-color: #326b42; }
:root[data-theme="light"] .nav-compare { border-color: var(--line); background: var(--panel); }
:root[data-theme="light"] .nav-compare:hover { border-color: var(--lime); }
:root[data-theme="light"] .selection-count { background: var(--light-accent-soft); }
:root[data-theme="light"] .status-dot { box-shadow: none; }
:root[data-theme="light"] .button-lime,
:root[data-theme="light"] .nav-feedback,
:root[data-theme="light"] .board-feedback-actions>button:last-child,
:root[data-theme="light"] .skip-link { background: var(--lime); color: #ffffff; }
:root[data-theme="light"] .button-lime:hover,
:root[data-theme="light"] .nav-feedback:hover,
:root[data-theme="light"] .board-feedback-actions>button:last-child:hover { background: #245634; border-color: #245634; box-shadow: 0 5px 16px #29492616; }
:root[data-theme="light"] .button-quiet { color: var(--muted); }
:root[data-theme="light"] .button-quiet:hover { color: var(--lime); }
:root[data-theme="light"] .button-outline { border-color: var(--line); background: var(--panel); }
:root[data-theme="light"] .button-outline:hover { border-color: var(--lime); }
:root[data-theme="light"] .text-link { border-color: var(--light-accent-line); }
:root[data-theme="light"] .text-link:hover { border-color: var(--lime); }

/* Shared text hierarchy outside the scientific stages. */
:root[data-theme="light"] :is(
  .hero-description,.home-introduction .hero-description,.home-process-step p,.home-use p,
  .section-title p,.page-intro p,.wide-intro,.history-intro-row p,
  .card-body>p,.history-teaser p,.portal p,.context-note p,.empty-state,
  .paper-entry p,.compare-empty p,.compare-foot,.method-copy p,.metric-definitions dd,
  .detail-subtitle,.detail-summary,.detail-spec-grid dd,.source-paper-title,
  .timeline-content p,.principle-card p,.home-outlook p,
  .cb-panel-heading p,.cb-claim>p,.cb-annotation>p,.cb-empty p,.cb-loading,
  .resource-section-heading p,.resource-description p,.resource-access-note p,
  .feedback-dialog>p,.feedback-kinds small,.feedback-address>small,
  .feedback-dialog .form-note,.form-note,dialog>p
) { color: var(--muted); }
:root[data-theme="light"] :is(
  .hero-proof,.home-index,.home-context,.home-perspective-source,.home-footer>span,
  .card-topline,.card-meta,.portal-number,.results-footer,.history-date-range,
  .illustration-note,.timeline-date>small,.history-month-date>small,
  .footer-top p,.footer-links>div>span,.footer-bottom,
  .paper-meta,.paper-meta>span,.compare-remove,.compare-table th,.method-sidebar .eyebrow,
  .detail-spec-grid dt,.detail-source small,.cb-dimension-stamp,.cb-count,
  .cb-recorder-role,.cb-interpretation,.cb-overview-help,.cb-setting-legend>span:first-child,
  .cb-recorder-name>span,.cb-overview thead button>span,
  .resource-venue,.resource-kind,.resource-example,.resource-section-tag,
  .feedback-address>span
) { color: var(--quiet); }
:root[data-theme="light"] :is(
  .home-deck,.atlas-stats strong,.history-group-heading h3,.history-study h4,
  .chapter-year,.empty-state h2,.metric-definitions dt,.method-callout strong,
  .compare-head h3,.atlas-table td:first-child,.cb-recorder-name,.cb-claim>strong,
  .context-note strong,.resource-jumps strong,.feedback-kinds strong,.chart-number
) { color: var(--text); }
:root[data-theme="light"] :is(
  .card-meta button,.footer-links a,.footer-links button,.footer-bottom button,
  .paper-tech,.source-links a,.back-link,.method-sidebar a,.detail-source,.detail-source b,
  .next-page>a>span,.history-month-date>time,.history-study h4>a>span,
  .resource-paper,.resource-section-number,.resource-scope,.resource-jumps>a>span,
  .resource-action>span,.feedback-save,.feedback-dialog .feedback-address
) { color: var(--lime); }
:root[data-theme="light"] :is(
  .atlas-stats>div>span,.stat-caption p,.stat-caption p span,
  .home-perspective-source>span:first-child,.home-perspective-source cite,
  .checkbox-label,.filter,.filter span,.display-controls button,
  .search-field>span,.search-field kbd,.compare-head p,.compare-table td,
  .chapter-story>p,.chapter-navigation>span,.era-tabs button>span,.era-tabs b,
  .metric-tabs button,.metric-tabs button span,.board-controls>label,.board-stamp,
  .board-heading .eyebrow,.chart-rank,.chart-name>span,.chart-context,.chart-caption,
  .chart-caption>span:last-child,.quiet-note,.snapshot-label,
  .principle-number,.timeline-date>span,.timeline-content .eyebrow,
  .timeline-meta .eyebrow,.cb-group-tabs button,.cb-metric-tabs button,
  .cb-search>span,.cb-evidence-filter,.resource-jumps small
) { color: var(--muted); }

/* Cards and publication badges. Illustrations keep their original palette. */
:root[data-theme="light"] .tech-card { background: var(--panel); border-color: var(--line); box-shadow: 0 3px 12px #243b2910; }
:root[data-theme="light"] .tech-card:hover { border-color: var(--light-accent-line); box-shadow: 0 12px 28px #243b2919; }
:root[data-theme="light"] .card-meta button.selected { background: var(--light-accent-soft); color: var(--lime); }
:root[data-theme="light"] .badge,
:root[data-theme="light"] .cb-publication,
:root[data-theme="light"] .cb-evidence-state { color: #3c6332; border-color: #bacdad; background: #eef4e8; }
:root[data-theme="light"] .badge i { background: #5d833f; }
:root[data-theme="light"] .badge.preprint,
:root[data-theme="light"] .cb-publication.cb-preprint { color: var(--light-amber); border-color: #d8c59e; background: var(--light-amber-bg); }
:root[data-theme="light"] .badge.preprint i { background: var(--light-amber); }
:root[data-theme="light"] .badge.neutral,
:root[data-theme="light"] .cb-state-contextual { color: var(--light-blue); border-color: #b8cbd6; background: var(--light-blue-bg); }
:root[data-theme="light"] .cb-state-limited { color: #885539; border-color: #d8bda9; background: #f8eee7; }
:root[data-theme="light"] .cb-state-unresolved,
:root[data-theme="light"] .cb-state-not_indexed { color: var(--quiet); border-color: var(--line); background: #f2f4ef; }
:root[data-theme="light"] .badge.neutral i { background: var(--light-blue); }

/* Search, filters and all table views share the daytime control language. */
:root[data-theme="light"] :is(.search-field,.display-controls,select,.cb-evidence-filter select) { background: var(--panel); border-color: var(--line); color: var(--muted); }
:root[data-theme="light"] select option { background: var(--panel); color: var(--text); }
:root[data-theme="light"] .atlas-filter-row select { background: transparent; border-color: transparent; }
:root[data-theme="light"] :is(.search-field input,.cb-search input) { color: var(--text); }
:root[data-theme="light"] :is(.search-field input::placeholder,.cb-search input::placeholder) { color: var(--quiet); }
:root[data-theme="light"] .search-field kbd { border-color: var(--line); }
:root[data-theme="light"] .search-field:focus-within { border-color: var(--lime); box-shadow: 0 0 0 3px #326b4210; }
:root[data-theme="light"] .filter:hover { background: var(--panel2); color: var(--lime); }
:root[data-theme="light"] :is(.filter.active,.display-controls button.active,.metric-tabs button.active,.cb-group-tabs button[aria-pressed=true],.cb-metric-tabs button[aria-pressed=true]) { background: var(--light-accent-soft); border-color: var(--light-accent-line); color: #2d5f35; }
:root[data-theme="light"] :is(.filter.active span,.metric-tabs button.active span) { color: #426d34; }
:root[data-theme="light"] :is(.cb-group-tabs button:hover,.cb-metric-tabs button:hover) { color: var(--lime); border-color: var(--light-accent-line); }
:root[data-theme="light"] .cb-search { border-color: var(--line); }
:root[data-theme="light"] .cb-search:focus-within { border-color: var(--lime); }
:root[data-theme="light"] .atlas-table th,
:root[data-theme="light"] .cb-overview thead th,
:root[data-theme="light"] .cb-detail-head { background: var(--panel2); color: var(--muted); border-color: var(--line); }
:root[data-theme="light"] .atlas-table td { color: var(--muted); }
:root[data-theme="light"] .atlas-table td:first-child span { color: var(--quiet); }
:root[data-theme="light"] .atlas-table tbody tr:hover,
:root[data-theme="light"] .cb-overview tbody tr:hover td { background: #edf3e8; }
:root[data-theme="light"] .cb-panel,
:root[data-theme="light"] .board-panel,
:root[data-theme="light"] .compare-panel { background: var(--panel); border-color: var(--line); }
:root[data-theme="light"] .cb-overview tbody th { background: #f4f7f0; }
:root[data-theme="light"] .cb-overview th:first-child,
:root[data-theme="light"] .cb-overview tbody td { border-color: var(--line); }
:root[data-theme="light"] .cb-overview thead button { color: #426335; }
:root[data-theme="light"] .cb-cell-detail { color: #354e34; }
:root[data-theme="light"] .cb-cell-detail:hover { color: var(--lime); }
:root[data-theme="light"] .cb-not-assessed .cb-cell-detail { color: var(--quiet); }
:root[data-theme="light"] .cb-overview-help>span:last-child,
:root[data-theme="light"] .cb-source-links>a { color: var(--lime); }
:root[data-theme="light"] .cb-source-links>a { border-color: var(--light-accent-line); }
:root[data-theme="light"] .cb-overview-scroll { scrollbar-color: #a1b697 #edf2eb; }
:root[data-theme="light"] .cb-annotation { border-color: var(--line); }
:root[data-theme="light"] .cb-setting-legend { background: #f2f5ee; color: var(--muted); }
:root[data-theme="light"] .cb-setting { color: var(--light-blue); background: var(--light-blue-bg); border-color: #b8cbd6; }
:root[data-theme="light"] .cb-setting-in_vivo { color: #4b662e; background: #eef3e4; border-color: #b9c99b; }
:root[data-theme="light"] .cb-setting-ex_vivo { color: #805934; background: #f8efe4; border-color: #d4bea0; }
:root[data-theme="light"] .cb-setting-not_specified { color: var(--quiet); background: #f1f3ee; border-color: var(--line); }
:root[data-theme="light"] .compare-head { background: #f1f5ec; }
:root[data-theme="light"] .compare-empty { background: radial-gradient(ellipse at center,#e6efdc,transparent); }
:root[data-theme="light"] .compare-empty>.compare-empty-icon { color: var(--lime); }
:root[data-theme="light"] .compare-tray { color: var(--text); background: #f4f8eff5; border-color: #b7cda7; box-shadow: 0 12px 40px #29412524; }
:root[data-theme="light"] .compare-tray>button { color: var(--lime); }
:root[data-theme="light"] .toast { background: #e8f0de; color: #2d502a; border-color: #b7cda7; box-shadow: 0 10px 35px #29412524; }

/* History and explanatory pages. */
:root[data-theme="light"] :is(.history-teaser,.history-experience,.history-month .timeline-entry) { background: var(--panel); border-color: var(--line); }
:root[data-theme="light"] .history-month-date { border-color: var(--line); }
:root[data-theme="light"] .history-month-date>i,
:root[data-theme="light"] .timeline-date i { background: var(--panel); border-color: #85a56d; }
:root[data-theme="light"] .history-preprint-date { background: #f1f5eb; border-color: #d5e0c9; color: var(--muted); }
:root[data-theme="light"] .history-preprint-date time { color: #4d6841; }
:root[data-theme="light"] .history-publication-group[data-history-group=biorxiv] .history-group-heading>.eyebrow,
:root[data-theme="light"] .timeline-entry[data-history-status=biorxiv] .timeline-meta .eyebrow { color: var(--light-amber); }
:root[data-theme="light"] .chapter-techs a,
:root[data-theme="light"] .chapter-navigation button { color: var(--lime); border-color: var(--light-accent-line); }
:root[data-theme="light"] .chapter-navigation button:hover { background: var(--light-accent-soft); border-color: var(--lime); }
:root[data-theme="light"] .era-tabs button[aria-selected=true] { background: var(--light-accent-soft); }
:root[data-theme="light"] .era-tabs button[aria-selected=true] b { color: #4f703c; }
:root[data-theme="light"] .principle-card { background: var(--panel); }
:root[data-theme="light"] .principle-drawing i { background: #dce7ef; border-color: #93aebe; box-shadow: none; }
:root[data-theme="light"] .principle-drawing i:nth-child(3) { background: #ded1ee; border-color: #a08bb9; }
:root[data-theme="light"] .drawing-1 i { background: #b5c4b2; }
:root[data-theme="light"] :is(.drawing-1 i:nth-child(2),.drawing-1 i:nth-child(4)) { background: #b29bcf; }
:root[data-theme="light"] .drawing-2 i { border-top-color: #6d9944; background: linear-gradient(#accd852d,transparent); }
:root[data-theme="light"] :is(.context-note,.method-callout,.resource-access-note) { background: #edf3e6; border-color: #d0dfc2; }
:root[data-theme="light"] .context-note>span,
:root[data-theme="light"] .context-note>a { color: var(--lime); }
:root[data-theme="light"] .empty-state { border-color: var(--light-accent-line); }
:root[data-theme="light"] .board-stamp { border-color: var(--light-accent-line); }
:root[data-theme="light"] .chart-track { background: #dbe6d4; }
:root[data-theme="light"] .chart-bar { background: linear-gradient(90deg,#5d8843,#8ab451); }
:root[data-theme="light"] .chart-bar.preprint { background: repeating-linear-gradient(135deg,#93b563 0 3px,#608b4040 3px 6px); }
:root[data-theme="light"] .portal { background: #fbfcf8; }
:root[data-theme="light"] .portal:hover { background: #edf3e8; border-color: var(--light-accent-line); }
:root[data-theme="light"] .portal h3 span { color: var(--lime); }
:root[data-theme="light"] .closing-cta { background: linear-gradient(110deg,#e5eddc,#eff4e8); border-color: #c8dab8; }
:root[data-theme="light"] .cta-cross { color: #326b4215; }
:root[data-theme="light"] .teaser-orbit b { color: var(--lime); text-shadow: none; }
:root[data-theme="light"] .teaser-years { color: var(--quiet); }
:root[data-theme="light"] .load-error { color: #805c28; border-color: #d8c59e; }

/* Published Methods and sequence repositories. */
:root[data-theme="light"] .resource-jumps>a { background: linear-gradient(135deg,#e8f0df,#f9fbf5); border-color: #c2d5b2; }
:root[data-theme="light"] .resource-jumps>a:hover { background: #e5eedb; border-color: var(--lime); }
:root[data-theme="light"] .resource-section-tag { border-color: var(--line); }
:root[data-theme="light"] .resource-list { background: var(--panel); border-color: var(--line); }
:root[data-theme="light"] .resource-record { border-color: var(--line); }
:root[data-theme="light"] .resource-action { color: #376336; background: #fbfcf8; border-color: #bdceaf; }
:root[data-theme="light"] .resource-action.is-primary { background: #e9f1df; border-color: #abc391; color: #325b2a; }
:root[data-theme="light"] .resource-action:hover { background: #deebd0; border-color: var(--lime); }
:root[data-theme="light"] .resource-access-note>span { color: var(--lime); }

/* Feedback dialogs and form states are readable in either appearance. */
:root[data-theme="light"] dialog,
:root[data-theme="light"] .feedback-dialog { background: #fbfcf8; color: var(--text); border-color: #c0d0b4; box-shadow: 0 20px 90px #1f342f40; }
:root[data-theme="light"] dialog::backdrop { background: #20352a75; }
:root[data-theme="light"] .dialog-heading button,
:root[data-theme="light"] .feedback-dialog .dialog-heading button { color: var(--lime); border-color: var(--line); }
:root[data-theme="light"] .feedback-kinds button { background: var(--panel); color: var(--text); border-color: var(--line); }
:root[data-theme="light"] .feedback-kinds button:hover { border-color: var(--light-accent-line); }
:root[data-theme="light"] .feedback-kinds button[aria-pressed=true] { background: #eaf2e0; border-color: var(--lime); box-shadow: inset 0 0 0 1px #326b4210; }
:root[data-theme="light"] .feedback-kinds .feedback-kind-icon { background: #e1ecd6; }
:root[data-theme="light"] form label,
:root[data-theme="light"] .feedback-dialog form label { color: #42603d; }
:root[data-theme="light"] form input,
:root[data-theme="light"] form textarea,
:root[data-theme="light"] .feedback-dialog form input,
:root[data-theme="light"] .feedback-dialog form textarea { background: #ffffff; border-color: #becfb1; color: var(--text); }
:root[data-theme="light"] form input::placeholder,
:root[data-theme="light"] form textarea::placeholder,
:root[data-theme="light"] .feedback-dialog form input::placeholder,
:root[data-theme="light"] .feedback-dialog form textarea::placeholder { color: var(--quiet); }
:root[data-theme="light"] .feedback-dialog .feedback-address { border-color: var(--light-accent-line); }
:root[data-theme="light"] .feedback-dialog #form-result { color: var(--lime); }
:root[data-theme="light"] .board-feedback-actions>button { border-color: #adc695; background: #edf3e6; color: #315c2c; }
:root[data-theme="light"] .board-feedback-actions>button:hover { border-color: var(--lime); background: #e1ecd4; }
:root[data-theme="light"] .board-feedback-actions>button:last-child { background: var(--lime); color: #ffffff; border-color: var(--lime); }
:root[data-theme="light"] .board-feedback-actions>button:last-child:hover { background: #245634; }

/* Scientific card illustrations retain their original exhibition palette. */
:root[data-theme="light"] :is(.card-art,.detail-art,.compare-head .recorder-illustration) {
  color-scheme: dark;
  --bg: #090e13;
  --panel: #10171e;
  --panel2: #141d25;
  --text: #eff2ee;
  --muted: #95a29f;
  --quiet: #64726f;
  --line: #ffffff14;
  --lime: #c5f277;
  --violet: #b6a2eb;
  --coral: #edac98;
  color: #eff2ee;
  background-color: #0c141a;
}
:root[data-theme="light"] .card-art { background-image: radial-gradient(ellipse at 50% 52%,#21363375,transparent 78%); border-bottom-color: #273736; }
:root[data-theme="light"] .detail-art { border-color: #273736; }
:root[data-theme="light"] .compare-head .recorder-illustration { border-radius: 6px; background-image: radial-gradient(ellipse at center,#253a32,transparent 80%); }
/* Animation follows the selected appearance, including its overlays and controls. */
:root[data-theme="light"] :is(.scene-shell,.linear-story) {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel2: #f1f5f2;
  --text: #20362b;
  --muted: #52675a;
  --quiet: #627368;
  --line: #d4dfd2;
  --lime: #4f7f20;
  --violet: #82669a;
  --coral: #a56d56;
  color: var(--text);
  background: #ffffff;
  border-color: #d4dfd2;
}
:root[data-theme="light"] .linear-story { box-shadow: 0 7px 28px #23352c0d; }
:root[data-theme="light"] .scene-shell:before {
  background-image: linear-gradient(#34554809 1px,transparent 1px),linear-gradient(90deg,#34554809 1px,transparent 1px);
}
:root[data-theme="light"] :is(.scene-top,.scene-bottom,.drag-label,.scene-annotation,.story-scale,.story-caption>p,.fiber-legend,.story-progress>span,.story-footnote) { color: var(--muted); }
:root[data-theme="light"] .scene-annotation b { color: #4f703b; }
:root[data-theme="light"] .story-caption>strong { color: var(--text); }
:root[data-theme="light"] .scene-top button { color: #3c624c; border-color: #bbcabf; background: #ffffffeb; }
:root[data-theme="light"] .scene-top button:hover { color: #376716; border-color: #4f7f20; background: #edf4e7; }
:root[data-theme="light"] .scene-corner { border-color: #7e997b; }
:root[data-theme="light"] :is(.scene-mode-buttons,.story-steps) { border-color: #c8d8c1; background: #f7faf4f2; }
:root[data-theme="light"] :is(.scene-mode-buttons button,.story-steps>button) { color: #5a6f52; }
:root[data-theme="light"] :is(.scene-mode-buttons button:hover,.story-steps>button:hover) { color: #315f22; }
:root[data-theme="light"] :is(.scene-mode-buttons button.is-active,.story-steps>button.is-active) { color: #3d6b22; background: #e6efdd; }
:root[data-theme="light"] .story-steps>button>span { color: #718a62; }
:root[data-theme="light"] .story-steps>button.is-active>span { color: #4e7139; }
:root[data-theme="light"] .fiber-legend i { background: #648a9a; }
:root[data-theme="light"] .fiber-legend i.reporter { background: #4f7f20; }
:root[data-theme="light"] .fiber-legend i.growth { background: transparent; border-color: #4a7620; box-shadow: none; }
:root[data-theme="light"] .story-progress input { background: linear-gradient(to right,#4f7f20 var(--story-progress,0%),#dbe5d5 var(--story-progress,0%)); }
:root[data-theme="light"] .story-progress input::-webkit-slider-thumb { background: #4f7f20; box-shadow: none; }
:root[data-theme="light"] .story-progress input::-moz-range-thumb { background: #4f7f20; }
:root[data-theme="light"] .scale-monitor { border-left-color: #9db984; background: linear-gradient(90deg,#f1f6ebed,transparent); }
:root[data-theme="light"] :is(.scale-monitor>span,.scale-monitor>small) { color: #526b49; }
:root[data-theme="light"] .scale-monitor>strong { color: #3e672a; }
:root[data-theme="light"] .soma-annotations line { stroke: #648a9a; stroke-opacity: .7; }
:root[data-theme="light"] .soma-annotations>span { color: #3c6373; background: #fffffff0; }
:root[data-theme="light"] .soma-annotations>.tape-cell-label { color: #4f7f20; }
:root[data-theme="light"] .cell-type-key { color: #415c4b; }
:root[data-theme="light"] .cell-type-key .cell-key-title { color: #57764b; }
/* Coordinated cell-type colors; these indicate schematic cell identity only. */
:root { --cell-neuron:#a6acd8; --cell-astrocyte:#8fbed0; --cell-microglia:#d5a6b5; --cell-oligodendrocyte:#c7afd8; }
:root[data-theme="light"] { --cell-neuron:#8e95c9; --cell-astrocyte:#4f839a; --cell-microglia:#ae758a; --cell-oligodendrocyte:#9677ae; }
:root .cell-type-key i.key-neuron { background:var(--cell-neuron); }
:root .cell-type-key i.key-astrocyte { background:var(--cell-astrocyte); }
:root .cell-type-key i.key-microglia { background:var(--cell-microglia); }
:root .cell-type-key i.key-oligodendrocyte { background:var(--cell-oligodendrocyte); }
:root[data-theme="light"] .linear-story .activity-monitor { border-color: #c4d3bb; background: transparent; }
:root[data-theme="light"] .linear-story .activity-monitor[data-active=true] { border-color: #87a46b; }
:root[data-theme="light"] .linear-story .activity-monitor :is(.monitor-eyebrow,.monitor-state,.monitor-note),
:root[data-theme="light"] .linear-story .activity-monitor>strong { background: #ffffff; }
:root[data-theme="light"] .linear-story .monitor-eyebrow { color: #4f6c42; }
:root[data-theme="light"] .linear-story .activity-monitor>strong { color: #31583a; }
:root[data-theme="light"] .linear-story :is(.monitor-state,.monitor-note) { color: #5b6e60; }
:root[data-theme="light"] .linear-story .activity-monitor[data-active=true]>strong,
:root[data-theme="light"] .linear-story .activity-monitor[data-writing=true] .monitor-state { color: #4f7f20; }
:root[data-theme="light"] .linear-story .activity-monitor[data-writing=true] .monitor-state:before { color: #4f7f20; }
:root[data-theme="light"] .linear-fallback { color: #31583a; }
:root[data-theme="light"] .linear-fallback>span { color: #5b6e60; }
:root[data-theme="light"] .linear-fallback svg>g { stroke: #648a9a; }
:root[data-theme="light"] .linear-fallback svg path[stroke="#c5f277"] { stroke: #4f7f20; }
:root[data-theme="light"] .scene-references { color: var(--quiet); }
:root[data-theme="light"] .scene-references>a { color: var(--lime); border-color: var(--light-accent-line); }
:root[data-theme="light"] .scene-references>span:last-child { color: var(--quiet); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

@media (prefers-reduced-motion: reduce) { .main-nav a { transition: none; } }
