/* LBFL Zoology Academic Design System
 * Shared by HSC Zoology and Higher Zoology routes.
 * Content authority stays in the lecture Markdown; this layer standardizes
 * readability, hierarchy, learning-cycle presentation, tables and legacy cards.
 */

.lbfl-zoology-route {
  --zoo-heading-color: #153f3b;
  --zoo-ink: #102a2a;
  --zoo-muted: #496560;
  --zoo-paper: #fbfaf5;
  --zoo-surface: #ffffff;
  --zoo-soft: #eef7f3;
  --zoo-teal: #147a6d;
  --zoo-teal-strong: #0d5f55;
  --zoo-link: #073c37;
  --zoo-amber: #b77a21;
  --zoo-border: rgba(20, 122, 109, 0.18);
  --zoo-shadow: 0 0.8rem 2.2rem rgba(15, 62, 57, 0.07);
}

.lbfl-zoology-route body,
.lbfl-zoology-route .initial-content {
  background: var(--zoo-paper);
}

.lbfl-zoology-route .page__inner-wrap {
  max-width: 72rem;
}

.lbfl-zoology-route .page__title {
  color: #123835;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}

.lbfl-zoology-route .page__content {
  color: var(--zoo-ink);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.lbfl-zoology-route .page__content > p:first-of-type {
  font-size: 1.04em;
}

.lbfl-zoology-route .page__content h1,
.lbfl-zoology-route .page__content h2,
.lbfl-zoology-route .page__content h3,
.lbfl-zoology-route .page__content h4 {
  color: var(--zoo-heading-color);
  font-family: inherit;
  text-wrap: balance;
}

.lbfl-zoology-route .page__content h2 {
  margin: 2.6rem 0 1rem;
  padding: 0.78rem 1rem;
  border-left: 0.28rem solid var(--zoo-teal);
  border-radius: 0 0.75rem 0.75rem 0;
  background: linear-gradient(90deg, var(--zoo-soft), rgba(238, 247, 243, 0));
  font-size: clamp(1.35rem, 1.18rem + 0.75vw, 1.85rem);
  line-height: 1.18;
}

.lbfl-zoology-route .page__content h3 {
  margin-top: 2rem;
  color: var(--zoo-teal-strong) !important;
  font-size: clamp(1.14rem, 1.06rem + 0.35vw, 1.42rem);
  line-height: 1.3;
}

.lbfl-zoology-route .page__content h4 {
  color: #315f59 !important;
}

/*
 * Preserve established dark Animal Diversity component heading colors.
 * Canonical Animal Diversity participates in the shared Zoology route,
 * while its existing dark components retain their light typography.
 */
html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .lbfl-hub-title,
html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .lbfl-study-step h3,
html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .lbfl-principle-card h3,
html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .lbfl-route-card h3,
html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .lbfl-log-card h3 {
  color: #f8fafc !important;
}

/* Section titles sit on the light reading surface, not inside dark cards. */
html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .lbfl-section-title {
  color: var(--zoo-heading-color) !important;
}

.lbfl-zoology-route .page__content .animal-anchor-grid h3 {
  color: #7fffe7 !important;
}

/*
 * Reconcile legacy dark-shell tokens with the Zoology light reading shell.
 *
 * production-hotfix.css still applies light body text to
 * .layout--single.wide with !important. Zoology intentionally
 * uses cream/soft reading surfaces, so restore the existing
 * Zoology palette without introducing new color tokens.
 */
html.lbfl-zoology-route body.layout--single.wide .page__content {
  color: var(--zoo-ink) !important;
}

html.lbfl-zoology-route:has(.lbfl-hub-intro) .page__content .educational-boundary,
html.lbfl-zoology-route:has(.animal-matrix-hero) .page__content .educational-boundary {
  color: var(--zoo-ink) !important;
}

html.lbfl-zoology-route:has(.lbfl-hub-intro) .contextual-sidebar-nav .sidebar-nav-title,
html.lbfl-zoology-route:has(.animal-matrix-hero) .contextual-sidebar-nav .sidebar-nav-title {
  color: var(--zoo-ink) !important;
}

html.lbfl-zoology-route:has(.lbfl-hub-intro) .contextual-sidebar-nav .sidebar-nav-link,
html.lbfl-zoology-route:has(.lbfl-hub-intro) .contextual-sidebar-nav .sidebar-nav-child-link,
html.lbfl-zoology-route:has(.animal-matrix-hero) .contextual-sidebar-nav .sidebar-nav-link,
html.lbfl-zoology-route:has(.animal-matrix-hero) .contextual-sidebar-nav .sidebar-nav-child-link {
  color: #174d47 !important;
}

.lbfl-zoology-route .page__content a {
  color: var(--zoo-link) !important;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.lbfl-zoology-route .page__content a:focus-visible,
.lbfl-zoology-route .page__content button:focus-visible,
.lbfl-zoology-route .page__content summary:focus-visible {
  outline: 3px solid rgba(20, 122, 109, 0.38);
  outline-offset: 3px;
  background: rgba(20, 122, 109, 0.1);
}

.lbfl-zoology-route .page__content blockquote,
.lbfl-zoology-route .page__content .notice,
.lbfl-zoology-route .page__content .notice--info,
.lbfl-zoology-route .page__content .notice--warning,
.lbfl-zoology-route .page__content .notice--success {
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  color: var(--zoo-ink) !important;
  border: 1px solid var(--zoo-border) !important;
  border-left: 0.3rem solid var(--zoo-teal) !important;
  border-radius: 0.85rem !important;
  background: var(--zoo-soft) !important;
  box-shadow: none !important;
}

.lbfl-zoology-route .page__content table {
  display: block;
  width: 100% !important;
  max-width: 100%;
  margin: 1.35rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--zoo-surface);
  border: 1px solid var(--zoo-border);
  border-radius: 0.7rem;
}

.lbfl-zoology-route .page__content th,
.lbfl-zoology-route .page__content td {
  min-width: 7.5rem;
  padding: 0.68rem 0.78rem !important;
  color: var(--zoo-ink) !important;
  border-color: rgba(20, 122, 109, 0.14) !important;
  vertical-align: top;
}

.lbfl-zoology-route .page__content th {
  color: #123835 !important;
  background: var(--zoo-soft) !important;
  font-weight: 800;
}

.lbfl-zoology-route .page__content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(20, 122, 109, 0.18);
  border-radius: 0.85rem;
  background: #102825;
  color: #f5fbf8;
}

.lbfl-zoology-route .page__content code {
  overflow-wrap: normal;
}

.lbfl-zoology-route .page__content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.9rem;
}

.lbfl-zoology-route .page__content details {
  margin: 1.2rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--zoo-border);
  border-radius: 0.85rem;
  background: var(--zoo-surface);
}

.lbfl-zoology-route .page__content summary {
  cursor: pointer;
  color: #174d47;
  font-weight: 800;
}

/* Normalize older inline dark-card lectures without deleting their content. */
.lbfl-zoology-route .page__content div[style*="#0f172a"],
.lbfl-zoology-route .page__content div[style*="#131c2e"],
.lbfl-zoology-route .page__content div[style*="#0b1329"],
.lbfl-zoology-route .page__content div[style*="#090d16"] {
  color: var(--zoo-ink) !important;
  background: var(--zoo-surface) !important;
  border-color: var(--zoo-border) !important;
  box-shadow: var(--zoo-shadow) !important;
}

.lbfl-zoology-route .page__content [style*="color:#cbd5e1"],
.lbfl-zoology-route .page__content [style*="color: #cbd5e1"],
.lbfl-zoology-route .page__content [style*="color:#abb2bf"],
.lbfl-zoology-route .page__content [style*="color: #abb2bf"] {
  color: var(--zoo-muted) !important;
}

.lbfl-zoology-route .page__content [style*="color:#ffffff"],
.lbfl-zoology-route .page__content [style*="color: #ffffff"],
.lbfl-zoology-route .page__content [style*="color:#00d4b2"],
.lbfl-zoology-route .page__content [style*="color: #00d4b2"],
.lbfl-zoology-route .page__content [style*="color:#3b82f6"],
.lbfl-zoology-route .page__content [style*="color: #3b82f6"] {
  color: var(--zoo-teal-strong) !important;
}

.lbfl-zoology-cycle {
  margin: 0 0 2rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--zoo-border);
  border-radius: 1rem;
  background: linear-gradient(145deg, #ffffff, #f1f8f5);
  box-shadow: var(--zoo-shadow);
}

.lbfl-zoology-cycle__eyebrow {
  margin: 0 0 0.35rem !important;
  color: var(--zoo-teal-strong) !important;
  font-size: 0.78rem !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lbfl-zoology-cycle__title {
  margin: 0 !important;
  color: #123835 !important;
  font-size: clamp(1.12rem, 1.02rem + 0.45vw, 1.4rem) !important;
}

.lbfl-zoology-cycle__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
  counter-reset: zoo-cycle;
}

.lbfl-zoology-cycle__steps li {
  counter-increment: zoo-cycle;
  min-width: 0;
  padding: 0.8rem;
  border-top: 2px solid rgba(20, 122, 109, 0.23);
  background: rgba(255, 255, 255, 0.68);
}

.lbfl-zoology-cycle__steps li::before {
  content: counter(zoo-cycle, decimal-leading-zero);
  display: block;
  margin-bottom: 0.2rem;
  color: #7a4f10;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.lbfl-zoology-cycle__steps strong {
  display: block;
  color: #153f3b;
  font-size: 0.88rem;
}

.lbfl-zoology-cycle__steps span {
  display: block;
  margin-top: 0.18rem;
  color: var(--zoo-muted);
  font-size: 0.78rem;
  line-height: 1.42;
}

@media (max-width: 48rem) {
  .lbfl-zoology-route .page__content {
    font-size: 1rem;
    line-height: 1.72;
  }

  .lbfl-zoology-route .page__content h2 {
    margin-top: 2.15rem;
    padding-inline: 0.8rem;
  }

  .lbfl-zoology-cycle__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html.lbfl-zoology-route:has(.animal-matrix-hero) .page__content > ul li {
  color: var(--zoo-ink) !important;
}

html.lbfl-zoology-route:has(.animal-matrix-hero) .page__content > ul a {
  color: var(--zoo-teal-strong) !important;
}

html.lbfl-zoology-route:has(.animal-matrix-hero) .page__content pre,
html.lbfl-zoology-route:has(.animal-matrix-hero) .page__content pre code {
  color: #f5fbf8 !important;
  background: #102825 !important;
}

html.lbfl-zoology-route:has(.animal-matrix-hero) .lbfl-language-switcher__link {
  color: var(--zoo-ink) !important;
  background: #ffffff !important;
}

/*
 * The two canonical Animal Diversity pages use legacy dark cards inside the
 * Zoology reading shell. A server-rendered route class keeps these foreground
 * repairs out of unrelated Zoology pages and avoids relying on :has() in the
 * cascade that Axe inspects.
 */
body.lbfl-animal-diversity-document .educational-boundary,
body.lbfl-animal-diversity-document .educational-boundary strong,
body.lbfl-animal-diversity-document .educational-boundary span[lang="bn"],
body.lbfl-animal-diversity-document .contextual-sidebar-nav .sidebar-nav-title,
body.lbfl-animal-diversity-document .page__title,
body.lbfl-animal-diversity-document .page__content > h1,
body.lbfl-animal-diversity-document .page__content > ul li {
  color: #102a2a !important;
}

body.lbfl-animal-diversity-document .contextual-sidebar-nav .sidebar-nav-link,
body.lbfl-animal-diversity-document .contextual-sidebar-nav .sidebar-nav-child-link,
body.lbfl-animal-diversity-document .page__content > ul a {
  color: var(--zoo-link) !important;
}

body.lbfl-animal-diversity-document .lbfl-section-title {
  color: var(--zoo-heading-color) !important;
}

body.lbfl-animal-diversity-document .lbfl-hub-intro .lbfl-hub-title,
body.lbfl-animal-diversity-document .lbfl-study-step h3,
body.lbfl-animal-diversity-document .lbfl-principle-card h3,
body.lbfl-animal-diversity-document .lbfl-route-card h3,
body.lbfl-animal-diversity-document .lbfl-log-card h3,
body.lbfl-animal-diversity-document .lbfl-outcome-card h2,
body.lbfl-animal-diversity-document .lbfl-outcome-card h2 a,
body.lbfl-animal-diversity-document .lbfl-outcome-card h3 {
  color: #f8fafc !important;
}

body.lbfl-animal-diversity-document .page__content pre,
body.lbfl-animal-diversity-document .page__content pre code {
  color: #f5fbf8 !important;
  background: #102825 !important;
}

body.lbfl-animal-diversity-document .lbfl-language-switcher__link {
  color: #102a2a !important;
  background: #ffffff !important;
}

@media (max-width: 24rem) {
  .lbfl-zoology-cycle__steps {
    grid-template-columns: 1fr;
  }
}

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

/*
 * Exact-head browser evidence at e9785020 identified contrast regressions on
 * the canonical Animal Diversity complete matrix. These rules intentionally
 * apply only to the two server-labelled Animal Diversity documents and are
 * stronger than legacy hotfix selectors loaded elsewhere in the cascade.
 */
html.lbfl-zoology-route body.lbfl-animal-diversity-document .page__content a {
  color: var(--zoo-link) !important;
}

/* Keep links inside legacy dark cards on their established light foreground. */
html.lbfl-zoology-route body.lbfl-animal-diversity-document .page__content .lbfl-log-card a,
html.lbfl-zoology-route body.lbfl-animal-diversity-document .page__content .lbfl-outcome-card a {
  color: #5eead4 !important;
}

html.lbfl-zoology-route body.lbfl-animal-diversity-document .page__content .lbfl-outcome-card h2 a {
  color: #f8fafc !important;
}

html.lbfl-zoology-route body.lbfl-animal-diversity-document .contextual-sidebar-nav a.sidebar-nav-link,
html.lbfl-zoology-route body.lbfl-animal-diversity-document .contextual-sidebar-nav a.sidebar-nav-child-link {
  color: var(--zoo-link) !important;
}

html.lbfl-zoology-route body.lbfl-animal-diversity-document .page__content pre,
html.lbfl-zoology-route body.lbfl-animal-diversity-document .page__content pre code {
  color: #f5fbf8 !important;
  background: #102825 !important;
}

/* ============================================================================
   ECOLOGY P1 DARK COMPONENT CONTRAST
   Keep dark gateway/framework cards readable inside the light Zoology shell.
   ============================================================================ */
html.lbfl-zoology-route .page__content .lbfl-info-card h3,
html.lbfl-zoology-route .page__content .lbfl-framework-links h2 {
  color: #f8fafc !important;
}

html.lbfl-zoology-route .page__content .lbfl-info-card a,
html.lbfl-zoology-route .page__content .lbfl-framework-link,
html.lbfl-zoology-route .page__content .lbfl-framework-link strong {
  color: #ccfbf1 !important;
}

html.lbfl-zoology-route .page__content .lbfl-info-card p,
html.lbfl-zoology-route .page__content .lbfl-info-card li,
html.lbfl-zoology-route .page__content .lbfl-framework-links p,
html.lbfl-zoology-route .page__content .lbfl-framework-link span {
  color: #dbeafe !important;
}

/* ============================================================================
   ECOLOGY P1 LIGHT-SHELL ACCESSIBILITY
   Prevent the site's dark-theme foreground tokens from leaking into the
   Zoology cream reading shell, educational notice, and contextual sidebar.
   ============================================================================ */
html.lbfl-zoology-route .educational-boundary,
html.lbfl-zoology-route .educational-boundary strong,
html.lbfl-zoology-route .educational-boundary span,
html.lbfl-zoology-route .contextual-sidebar-nav .sidebar-nav-title {
  color: var(--zoo-ink) !important;
}

html.lbfl-zoology-route .contextual-sidebar-nav .sidebar-nav-link,
html.lbfl-zoology-route .contextual-sidebar-nav .sidebar-nav-child-link {
  color: var(--zoo-link) !important;
}

/* ============================================================================
   ECOLOGY COURSE RESPONSIVE TABLES
   Prefer wrapping over keyboard-inaccessible horizontal scrolling on the
   lecture reading surface.
   ============================================================================ */
html.lbfl-zoology-route body.lbfl-ecology-course .page__content table {
  display: table;
  width: 100% !important;
  table-layout: fixed;
  overflow: visible;
}

html.lbfl-zoology-route body.lbfl-ecology-course .page__content th,
html.lbfl-zoology-route body.lbfl-ecology-course .page__content td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Ecology light blockquotes must not inherit dark-card foreground tokens. */
html.lbfl-zoology-route body.lbfl-ecology-course .page__content > blockquote > p {
  color: var(--zoo-ink) !important;
}

/* ============================================================================
   COURSE-OWNED LIGHT SHELL + DARK QUIZ ACCESSIBILITY
   Exact-head browser evidence from the canonical Biostatistics, Genetics and
   Human Physiology successors identified shared contrast leakage from legacy
   dark-theme tokens. Keep the remediation inside explicitly course-owned
   shells so Homepage V3, Ecology, Animal Diversity and unrelated pages retain
   their established visual systems.
   ============================================================================ */

html.lbfl-zoology-route [data-lbfl-course-owned] .page__meta,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__lead {
  color: var(--zoo-muted) !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .lbfl-course-nav a {
  color: var(--zoo-link) !important;
}

/* Course tables wrap on the reading surface instead of creating an unfocusable
   horizontal scroll region under the full-page WCAG browser contract. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content table {
  display: table;
  width: 100% !important;
  table-layout: fixed;
  overflow: visible;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .page__content th,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Inline code belongs to the light reading shell unless it is inside <pre>. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content :not(pre) > code {
  color: var(--zoo-ink) !important;
  background: var(--zoo-soft) !important;
}

/* quiz-render.html and the MCQ arena intentionally use dark component
   surfaces. Restore their light/accent foregrounds after the generic legacy
   token normalizer above. */
html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena {
  color: #f8fafc !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card h2,
html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card .question-node > p,
html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card .feedback-box strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .mcq-arena-title,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .question-text-line,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .result-score-title {
  color: #f8fafc !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card .option-label-wrapper > span,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .option-label-wrapper {
  color: #dbeafe !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card .option-label-wrapper strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card .question-node > p > span,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .mcq-status-badge .status-text,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .mcq-timer-node .timer-countdown,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .result-score-numeric {
  color: #5eead4 !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .quiz-engine-card .feedback-box p,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .mcq-arena-desc,
html.lbfl-zoology-route [data-lbfl-course-owned] .premium-mcq-arena .mcq-timer-node {
  color: #dbeafe !important;
}

/* ============================================================================
   COURSE-OWNED SECOND-PASS CONTRAST FIX
   Combined validation at 2e05982a identified two remaining shared families:
   light-shell header h2 text inheriting legacy pale foregrounds, and one
   legacy #0b1324 Human Physiology challenge card whose intended light text
   was overwritten by the Zoology light-shell normalizer.
   ============================================================================ */

/* Course-owned lecture headers live on the cream reading surface. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content header > h2 {
  color: var(--zoo-heading-color) !important;
}

/* Legacy teal accent on a light card needs the stronger course link token. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content [style*="color:#1abc9c"],
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content [style*="color: #1abc9c"] {
  color: var(--zoo-teal-strong) !important;
}

/* Preserve the intentional dark Human Physiology challenge surface instead
   of converting its descendant foregrounds to the light-shell palette. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] {
  color: #f8fafc !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] h2,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] h3,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] h4,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] [style*="color:#1abc9c"],
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] [style*="color: #1abc9c"] {
  color: #5eead4 !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] p,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] li,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] span {
  color: #dbeafe !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] p[style*="color:#ffffff"],
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#0b1324"] p[style*="color: #ffffff"] {
  color: #f8fafc !important;
}

/* HSC Human Physiology Markdown section headers may render inside semantic
   <header> wrappers that are not descendants of .page__content. Keep those
   light-shell headings on the Zoology heading token without touching quiz
   headings, which use classed div containers rather than semantic headers. */
html.lbfl-zoology-route .lbfl-human-physiology-course header > h2 {
  color: var(--zoo-heading-color) !important;
}


/* ============================================================================
   COURSE-OWNED THIRD-PASS CONTRAST FIX
   Exact-head browser evidence at 1d1b6fbd found 15 serious Axe contrast
   failures limited to five legacy Biostatistics/Physiology routes. Keep this
   repair inside data-lbfl-course-owned and target only the proven light/dark
   surface families; do not alter Ecology, Animal Diversity, Practical, IELTS,
   Homepage, Admission, or the global Minimal Mistakes palette.
   ============================================================================ */

/* Legacy Biostatistics modules set pale body text at the module root even
   where paragraphs/lists sit directly on the cream reading shell. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > p,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > ul,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > ol,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > ul li,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > ol li,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > ul strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .biostats-module > ol strong {
  color: var(--zoo-ink) !important;
}

/* Generic production hotfixes can re-introduce pale blockquote text after the
   Zoology light-shell blockquote background is applied. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content blockquote,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content blockquote p,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content blockquote strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content blockquote em {
  color: var(--zoo-ink) !important;
}

/* Legacy .concept-block is intentionally dark and therefore keeps light
   typography instead of inheriting the shared light-shell h3 normalizer. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block {
  color: #dbeafe !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block h3,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block h4 {
  color: #f8fafc !important;
}

html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block p,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block li,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .concept-block span {
  color: #dbeafe !important;
}

/* Shared Zoology table cells are dark on light by default. Only rows that
   explicitly declare the legacy #131c2e dark surface need their foreground
   switched back to a light accessible value. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content tr[style*="#131c2e"] > th,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content tr[style*="#131c2e"] > td,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content tr[style*="rgb(19, 28, 46)"] > th,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content tr[style*="rgb(19, 28, 46)"] > td {
  color: #f8fafc !important;
}

/* The legacy footer combines a muted foreground with opacity: .5 on cream,
   producing an effective contrast below AA. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content .footer-line {
  color: var(--zoo-muted) !important;
  opacity: 1 !important;
}


/* ============================================================================
   COURSE-OWNED FOURTH-PASS CONTRAST FIX
   The 710d5855 browser artifact narrowed the remaining failures to legacy
   inline dark-card declarations that the shared Zoology shell intentionally
   normalizes to white, plus table headers whose shared th rule intentionally
   normalizes their background to --zoo-soft. Align the foreground with the
   rendered surface instead of the legacy inline declaration.
   ============================================================================ */

/* These inline-dark legacy cards are rendered on the light Zoology surface by
   the shared normalizer above. Override their stale pale inline foregrounds. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#090d16"] p,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#090d16"] li,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#090d16"] strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#090d16"] span,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#131c2e"] p,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#131c2e"] li,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#131c2e"] strong,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content div[style*="#131c2e"] span {
  color: var(--zoo-ink) !important;
}

/* Shared Zoology th cells always render on --zoo-soft. Keep their foreground
   dark even when the legacy source row requested a dark background. The
   dark-row td rule above remains intentionally light because td backgrounds
   do not receive the shared th surface. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content th {
  color: #123835 !important;
}


/* Final specificity correction: shared Zoology th backgrounds are always
   --zoo-soft, so even legacy rows declaring #131c2e must retain dark header
   text. Match the earlier dark-row selector specificity and win by source
   order; td cells on those rows intentionally remain light. */
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content tr[style*="#131c2e"] > th,
html.lbfl-zoology-route [data-lbfl-course-owned] .page__content tr[style*="rgb(19, 28, 46)"] > th {
  color: #123835 !important;
}
