/* Shared course shell: loaded only by pages under /review-materials. */
:root { --matt-shell-ink: #173957; --matt-shell-blue: #177fbd; --matt-shell-line: rgba(61, 121, 161, .22); }
body.matt-course-shell { min-height: 100vh; padding-top: 58px !important; }
/* Use the document as the single reading scroller. Legacy pages with a direct
   main column often also set height:100vh + overflow-y:auto, producing a second
   scrollbar beside the browser scrollbar once the shared course bar is added. */
body.matt-course-shell > main,
body.matt-course-shell > .main,
body.matt-course-shell > #mainContent {
  height: auto !important; min-height: calc(100vh - 58px); max-height: none !important;
  overflow-y: visible !important;
}
/* App-style course pages originally clamp their flex shell to the viewport.
   The shared bar turns the document into the single reading scroller, so the
   outer shell must be allowed to grow with the full chapter content instead
   of clipping everything below the first screen. */
body.matt-course-shell > .app-layout {
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
}
.app-main {
  height: auto !important; min-height: calc(100vh - 58px); max-height: none !important;
  overflow: visible !important;
}
.matt-legacy-sidebar-offset { top: 58px !important; bottom: 0 !important; height: calc(100vh - 58px) !important; }
/* The premium skin makes every sidebar link inherit white text. Restore contrast
   for legacy pages whose active state uses a light background. */
html[data-premium-ui] .sidebar .sidebar-nav a.active {
  color: #143e5a !important; background-color: rgba(226, 242, 252, .96) !important;
  text-shadow: none !important;
}
html[data-premium-ui] .sidebar .sidebar-nav a.active:hover { color: #0b3551 !important; }
.matt-coursebar {
  position: fixed !important; top: 0; left: 0; z-index: 2147483000; display: flex; align-items: center; gap: .85rem;
  width: 100vw !important; min-width: 100vw !important; max-width: none !important; box-sizing: border-box !important;
  margin: 0 !important; min-height: 58px; padding: 0 1.15rem; color: #f8fcff;
  background: linear-gradient(105deg, rgba(14, 34, 54, .96), rgba(30, 67, 94, .91));
  border-bottom: 1px solid rgba(173, 222, 248, .28); box-shadow: 0 8px 26px rgba(9, 33, 54, .2);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif;
}
.matt-coursebar__brand { color: #fff; font-weight: 800; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.matt-coursebar__review { color: rgba(226, 243, 255, .9); font-weight: 650; text-decoration: none; white-space: nowrap; }
.matt-coursebar__review:hover, .matt-coursebar__review:focus-visible { color: #fff; text-decoration: underline; }
.matt-coursebar__divider { width: 1px; height: 22px; background: rgba(223, 242, 255, .35); }
.matt-coursebar__course { overflow: hidden; color: rgba(241, 248, 255, .92); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.matt-coursebar__spacer { flex: 1; }
.matt-coursebar__button {
  border: 1px solid rgba(180, 225, 249, .35); border-radius: 999px; padding: 5px 11px; min-height: 32px; color: #edf8ff;
  background: rgba(197, 234, 255, .11); cursor: pointer; font: inherit; font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif !important;
  font-size: 13px !important; line-height: 1.3 !important; white-space: nowrap;
}
.matt-coursebar__button--focus { min-width: 84px; text-align: center; }
.matt-coursebar__button:hover, .matt-coursebar__button:focus-visible { outline: 0; background: rgba(197, 234, 255, .24); }
/* Legacy pages provide their own theme buttons with inconsistent fixed/bottom
   positioning. Once the shared shell moves one into its header, this rule wins
   over the page-specific styles and keeps the top bar visually consistent. */
.matt-coursebar .matt-coursebar__button--theme {
  position: static !important; inset: auto !important; z-index: auto !important; display: inline-flex !important;
  align-items: center; justify-content: center; min-width: 94px; min-height: 32px; margin: 0 !important;
  width: auto !important; height: auto !important; padding: 5px 12px !important;
  box-sizing: border-box !important; box-shadow: none !important; text-decoration: none !important;
  color: #edf8ff !important; background: rgba(197, 234, 255, .11) !important;
  border: 1px solid rgba(180, 225, 249, .35) !important; border-radius: 999px !important;
  cursor: pointer; font: inherit; font-size: 13px !important; line-height: 1.3 !important; white-space: nowrap;
}
.matt-reading-progress { position: absolute; right: 0; bottom: -3px; left: 0; height: 3px; background: rgba(255,255,255,.12); }
.matt-reading-progress > i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #5fd1ff, #ad8dff); transition: width .14s linear; }
.matt-course-panel {
  position: fixed; top: 70px; right: 18px; z-index: 2147483001; width: min(390px, calc(100vw - 28px)); max-height: min(72vh, 610px); overflow: auto;
  padding: 1rem; border: 1px solid rgba(129, 190, 226, .45); border-radius: 18px; color: var(--matt-shell-ink);
  background: rgba(249, 253, 255, .9); box-shadow: 0 18px 50px rgba(13, 48, 75, .24); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.matt-course-panel[hidden] { display: none; }
.matt-panel-title { margin: 0 0 .65rem; font-size: .9rem; color: #256a99; }
.matt-search { width: 100%; box-sizing: border-box; padding: .68rem .75rem; border: 1px solid #a8d1e8; border-radius: 10px; color: #193c5b; background: rgba(255,255,255,.88); font: inherit; }
.matt-search:focus { outline: 3px solid rgba(75, 174, 229, .22); border-color: #4aa9dd; }
.matt-search-status { min-height: 1.5em; margin: .55rem 0; color: #547188; font-size: .8rem; }
.matt-search-nav { display: flex; gap: .4rem; margin-bottom: .85rem; }
.matt-search-nav button { border: 1px solid #a8d1e8; border-radius: 8px; padding: .34rem .54rem; color: #165b89; background: rgba(234,248,255,.9); cursor: pointer; font: inherit; font-size: .8rem; }
.matt-outline { margin: 0; padding: .15rem 0 0; border-top: 1px solid var(--matt-shell-line); list-style: none; }
.matt-outline button { display: block; width: 100%; overflow: hidden; margin-top: .18rem; border: 0; border-radius: 8px; padding: .48rem .56rem; color: #254b67; background: transparent; cursor: pointer; font: inherit; font-size: .85rem; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.matt-outline button:hover, .matt-outline button:focus-visible { outline: 0; color: #075f99; background: rgba(94, 190, 239, .16); }
.matt-course-shell .matt-search-hit { border-radius: .18em; color: inherit; background: rgba(255, 199, 63, .58); box-shadow: 0 0 0 2px rgba(255, 199, 63, .18); }
.matt-course-shell .matt-search-hit.is-active { background: #ff9f31; box-shadow: 0 0 0 3px rgba(255, 137, 24, .28); }
/* A few legacy courses did not ship a theme control of their own. The shared
   fallback uses the same dark palette through their existing CSS variables,
   without overriding pages that already manage their own dark theme. */
body.matt-course-shell.matt-shared-dark {
  --bg: #111c2a; --bgc: #182536; --bg-card: #182536; --bg-warm: #1b2d40; --card: #182536; --card-bg: #182536; --surface: #182536;
  --text: #e7f0f8; --text-soft: #c4d4e2; --text-muted: #9cb0c2; --text2: #9cb0c2; --muted: #9cb0c2;
  --border: #31465a; --border-strong: #4a6278; --tag-bg: #24384b; --highlight: #3a3540; --accent-light: #24384b; --primary-light: #29445a; --blue-light: #243b51;
  color-scheme: dark; background: var(--bg) !important; color: var(--text) !important;
}
body.matt-course-shell.matt-shared-dark .card,
body.matt-course-shell.matt-shared-dark .chapter-card,
body.matt-course-shell.matt-shared-dark .chapter-header,
body.matt-course-shell.matt-shared-dark .chapter-content,
body.matt-course-shell.matt-shared-dark .section,
body.matt-course-shell.matt-shared-dark .modal,
body.matt-course-shell.matt-shared-dark .search-overlay,
body.matt-course-shell.matt-shared-dark .search-panel {
  color: var(--text); background: var(--card, var(--surface)) !important; border-color: var(--border) !important;
}
body.matt-course-shell.matt-shared-dark input,
body.matt-course-shell.matt-shared-dark select,
body.matt-course-shell.matt-shared-dark textarea {
  color: var(--text); background: var(--surface) !important; border-color: var(--border) !important;
}

/* Legacy study components whose source CSS hard-codes a light surface.  Keep
   expanded answers, biochemistry tables and term cards readable when the
   shared fallback theme is active instead of pairing pale backgrounds with
   the dark-mode foreground variables. */
body.matt-course-shell.matt-shared-dark .q-card-desc-inner {
  color: #dceaf5 !important;
  background: rgba(31, 52, 71, .94) !important;
  border-color: #49677e !important;
}
body.matt-course-shell.matt-shared-dark .q-card {
  color: var(--text) !important;
  background: var(--bg-warm, var(--card)) !important;
  border-color: var(--border) !important;
}
body.matt-course-shell.matt-shared-dark .q-card-desc-inner strong {
  color: #f3fbff !important;
  background: rgba(73, 131, 170, .28) !important;
  border-bottom-color: rgba(145, 213, 255, .42) !important;
}
body.matt-course-shell.matt-shared-dark .term-card {
  color: #dceaf5 !important;
  background: rgba(24, 37, 54, .92) !important;
  border-color: #314d63 !important;
}
body.matt-course-shell.matt-shared-dark .term-card .term { color: #eff8ff !important; }
body.matt-course-shell.matt-shared-dark .term-card .def { color: #c4d4e2 !important; }
body.matt-course-shell.matt-shared-dark table.mini {
  color: #dceaf5 !important;
  border-color: #49677e !important;
}
body.matt-course-shell.matt-shared-dark table.mini th {
  color: #f0f8ff !important;
  background: #2d455b !important;
  border-color: #49677e !important;
}
body.matt-course-shell.matt-shared-dark table.mini td {
  color: #dceaf5 !important;
  background: rgba(24, 37, 54, .92) !important;
  border-color: #49677e !important;
}
body.matt-course-shell.matt-shared-dark table.mini tr:hover { background: rgba(72, 130, 170, .18) !important; }
body.matt-course-shell.matt-shared-dark .answer {
  color: #d9f2e1 !important;
  background: rgba(25, 67, 50, .9) !important;
  border-color: #4aa878 !important;
}
body.matt-course-shell.matt-shared-dark .answer summary { color: #b8f0c9 !important; }
body.matt-course-shell.matt-shared-dark .answer .ans-body { color: #d9f2e1 !important; }

/* Biochemistry II has a few fixed light-mode labels and mechanism panels in
   addition to the shared table/answer components above. */
body.matt-course-shell.matt-shared-dark.biochem-review .page-header h1,
body.matt-course-shell.matt-shared-dark.biochem-review .section h3 {
  color: #eaf6ff !important;
}
body.matt-course-shell.matt-shared-dark.biochem-review .mechanism-box {
  color: #dceaf5 !important;
  background: linear-gradient(135deg, #1e3b52, #1b3045) !important;
  border-color: #4b86a9 !important;
}
body.matt-course-shell.matt-shared-dark.biochem-review .mechanism-box h4 { color: #a8ddff !important; }
body.matt-course-shell.matt-shared-dark.biochem-review .mechanism-box p,
body.matt-course-shell.matt-shared-dark.biochem-review .mechanism-box li { color: #d6e8f4 !important; }
body.matt-course-shell.matt-shared-dark.biochem-review .substrate-flow .node {
  color: #e1f0f8 !important;
  background: #2d455b !important;
}
body.matt-course-shell.matt-shared-dark.biochem-review .ref-badge {
  color: #d6efff !important;
  background: #2e536b !important;
}
body.matt-course-shell.matt-shared-dark.biochem-review .highlight {
  color: #fff1af !important;
  background: linear-gradient(180deg, transparent 60%, #6d5d24 60%) !important;
}
body.matt-course-focus .matt-coursebar { background: linear-gradient(105deg, rgba(10, 27, 43, .985), rgba(22, 52, 74, .97)); }
body.matt-course-focus .matt-coursebar__course::after { content: " · 专注中"; color: #a9dfff; font-weight: 500; }
/* -------------------------------------------------------------------------
   Pharmacology-style focus reading
   -------------------------------------------------------------------------
   Legacy review pages use several different shells (fixed rail, flex app
   layout, politics drawer, or a simple left margin).  The focus button should
   nevertheless produce the same result as the pharmacology template: hide
   navigation, remove the old rail offset, and give the正文 a centred reading
   measure.  These rules are intentionally scoped to the focus state so the
   normal course layouts remain untouched.
   ------------------------------------------------------------------------- */
body.matt-course-focus { display: block !important; min-width: 0; }
body.matt-course-focus > .sidebar,
body.matt-course-focus > #sidebar,
body.matt-course-focus > .nav-drawer,
body.matt-course-focus > #navDrawer,
body.matt-course-focus > #sifaSidebar,
body.matt-course-focus > .app-layout > .app-sidebar,
body.matt-course-focus > .app-layout .app-sidebar {
  display: none !important;
}
body.matt-course-focus > .sidebar-overlay,
body.matt-course-focus > #sidebarOverlay,
body.matt-course-focus > #sidebar-overlay,
body.matt-course-focus > #navOverlay,
body.matt-course-focus > #overlay,
body.matt-course-focus > .nav-overlay {
  display: none !important;
  pointer-events: none !important;
}
body.matt-course-focus > .app-layout {
  display: block !important;
  width: 100% !important;
  min-height: calc(100vh - 58px) !important;
}
body.matt-course-focus > main,
body.matt-course-focus > .main,
body.matt-course-focus > #main,
body.matt-course-focus > #mainContent,
body.matt-course-focus > #top,
body.matt-course-focus > .container,
body.matt-course-focus > .app-layout > .app-main,
body.matt-course-focus > .app-layout > .app-main > .main-content {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}
body.matt-course-focus > .app-layout > .app-main { padding-top: 0 !important; }
body.matt-course-focus > .hero,
body.matt-course-focus > .chapter-strip-wrap,
body.matt-course-focus > .chapter-strip-wrap + main,
body.matt-course-focus > .chapter-strip-wrap + .main {
  margin-left: auto !important;
  margin-right: auto !important;
}
body.matt-course-focus > .chapter-strip-wrap { display: none !important; }
body.matt-course-focus > .hero {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  box-sizing: border-box !important;
}
body.matt-course-focus > .container { margin-bottom: 0 !important; }
body.matt-course-focus > footer,
body.matt-course-focus > .footer {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.matt-course-focus .matt-coursebar__button--focus {
  min-width: 84px;
  background: rgba(231, 244, 255, .16);
}
body.matt-course-focus .matt-coursebar__button--focus:hover,
body.matt-course-focus .matt-coursebar__button--focus:focus-visible {
  background: rgba(231, 244, 255, .28);
}
@media (max-width: 650px) {
  body.matt-course-focus > main,
  body.matt-course-focus > .main,
  body.matt-course-focus > #main,
  body.matt-course-focus > #mainContent,
  body.matt-course-focus > #top,
  body.matt-course-focus > .container,
  body.matt-course-focus > .app-layout > .app-main,
  body.matt-course-focus > .app-layout > .app-main > .main-content,
  body.matt-course-focus > .hero {
    width: 100% !important;
    max-width: none !important;
  }
}
/* A few course-owned rules use three-class selectors or an !important max
   width.  Repeat the focus contract at the shell specificity level so those
   pages receive the same centred reading column as the others. */
body.matt-course-shell.matt-course-focus > main,
body.matt-course-shell.matt-course-focus > .main,
body.matt-course-shell.matt-course-focus > #main,
body.matt-course-shell.matt-course-focus > #mainContent,
body.matt-course-shell.matt-course-focus > #top,
body.matt-course-shell.matt-course-focus > .container,
body.matt-course-shell.matt-course-focus > .app-layout > .app-main,
body.matt-course-shell.matt-course-focus > .app-layout > .app-main > .main-content {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}
body.matt-course-shell.matt-course-focus > .hero {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}
body.matt-course-shell.matt-glass-theme.matt-course-focus > #main {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}
body.matt-course-shell.matt-glass-theme.matt-course-focus.matt-linear-course > .content,
body.matt-course-shell.matt-glass-theme.matt-course-focus.matt-linear-course > .main,
body.matt-course-shell.matt-glass-theme.matt-course-focus.matt-linear-course > .matt-linear-content {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}
body.matt-course-shell.matt-glass-theme.matt-course-focus.matt-linear-course > footer {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}
body.matt-course-shell.matt-course-focus.matt-politics-course > .hero,
body.matt-course-shell.matt-course-focus.matt-politics-course > .main,
body.matt-course-shell.matt-course-focus.matt-politics-course > .chapter-strip-wrap,
body.matt-course-shell.matt-course-focus.matt-politics-course > .footer {
  width: min(1040px, calc(100vw - 2rem)) !important;
  max-width: 1040px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}
body.matt-course-shell.matt-course-focus.matt-politics-course > .main {
  padding-right: clamp(16px, 3vw, 36px) !important;
  padding-left: clamp(16px, 3vw, 36px) !important;
}
/* In dark mode every scrollbar keeps a distinct thumb and track. This applies
   to the document and legacy sidebars / nested lists alike. */
html[data-theme="dark"], html[data-theme="dark"] body, html.dark, html.dark body,
body[data-theme="dark"], body.dark, body.matt-shared-dark {
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 204, 239, .82) rgba(7, 20, 33, .76);
}
html[data-theme="dark"]::-webkit-scrollbar, html[data-theme="dark"] body::-webkit-scrollbar,
html[data-theme="dark"] *::-webkit-scrollbar, html.dark::-webkit-scrollbar, html.dark body::-webkit-scrollbar,
html.dark *::-webkit-scrollbar, body[data-theme="dark"]::-webkit-scrollbar, body[data-theme="dark"] *::-webkit-scrollbar,
body.dark::-webkit-scrollbar, body.dark *::-webkit-scrollbar, body.matt-shared-dark::-webkit-scrollbar,
body.matt-shared-dark *::-webkit-scrollbar { width: 11px; height: 11px; }
html[data-theme="dark"]::-webkit-scrollbar-track, html[data-theme="dark"] body::-webkit-scrollbar-track,
html[data-theme="dark"] *::-webkit-scrollbar-track, html.dark::-webkit-scrollbar-track, html.dark body::-webkit-scrollbar-track,
html.dark *::-webkit-scrollbar-track, body[data-theme="dark"]::-webkit-scrollbar-track, body[data-theme="dark"] *::-webkit-scrollbar-track,
body.dark::-webkit-scrollbar-track, body.dark *::-webkit-scrollbar-track, body.matt-shared-dark::-webkit-scrollbar-track,
body.matt-shared-dark *::-webkit-scrollbar-track { background: rgba(7, 20, 33, .76) !important; }
html[data-theme="dark"]::-webkit-scrollbar-thumb, html[data-theme="dark"] body::-webkit-scrollbar-thumb,
html[data-theme="dark"] *::-webkit-scrollbar-thumb, html.dark::-webkit-scrollbar-thumb, html.dark body::-webkit-scrollbar-thumb,
html.dark *::-webkit-scrollbar-thumb, body[data-theme="dark"]::-webkit-scrollbar-thumb, body[data-theme="dark"] *::-webkit-scrollbar-thumb,
body.dark::-webkit-scrollbar-thumb, body.dark *::-webkit-scrollbar-thumb, body.matt-shared-dark::-webkit-scrollbar-thumb,
body.matt-shared-dark *::-webkit-scrollbar-thumb {
  min-height: 34px; border: 2px solid rgba(7, 20, 33, .76) !important; border-radius: 999px;
  background: linear-gradient(180deg, #9edbfd, #4f91c4) !important;
}
html[data-theme="dark"]::-webkit-scrollbar-thumb:hover, html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover,
html.dark::-webkit-scrollbar-thumb:hover, html.dark *::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"]::-webkit-scrollbar-thumb:hover, body[data-theme="dark"] *::-webkit-scrollbar-thumb:hover,
body.dark::-webkit-scrollbar-thumb:hover, body.dark *::-webkit-scrollbar-thumb:hover,
body.matt-shared-dark::-webkit-scrollbar-thumb:hover, body.matt-shared-dark *::-webkit-scrollbar-thumb:hover { background: #c2ebff !important; }
@media (max-width: 650px) {
  .matt-coursebar { gap: .55rem; min-height: 54px; padding: 0 .7rem; }
  .matt-coursebar__divider, .matt-coursebar__course { display: none; }
  .matt-coursebar__button { padding: .33rem .52rem; font-size: .77rem; }
  .matt-coursebar__button--theme { margin-left: auto; }
  .matt-coursebar__button--focus { display: none; }
  .matt-course-panel { top: 62px; right: 10px; }
}

/* -------------------------------------------------------------------------
   Sidebar palette contract
   -------------------------------------------------------------------------
   A few legacy documents ship a dark navy rail even in their light theme.
   The shared shell owns the rail surface now: light mode is intentionally
   pale and low-contrast, while every supported dark-mode flag gets an
   explicit dark surface and readable active states.  Course-specific accents
   can still override borders and badges without bringing back a black rail.
   ------------------------------------------------------------------------- */
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar {
  color: #675f51;
  background: linear-gradient(180deg, rgba(255,254,249,.98), rgba(249,246,237,.96)) !important;
  border-right-color: rgba(185,151,73,.22) !important;
  box-shadow: 8px 0 28px rgba(125,99,39,.09) !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory .drawer-link,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar a {
  color: #756d60 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory .drawer-link:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory .drawer-link:focus-visible,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar a.active {
  color: #5f4717 !important;
  background: rgba(244,215,133,.28) !important;
  border-left-color: #c49535 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .sidebar-search input,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory input,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar input {
  color: #4d4a42 !important;
  background: rgba(255,255,255,.82) !important;
  border-color: rgba(178,145,71,.3) !important;
}

html[data-theme="dark"] body.matt-course-shell > .sidebar,
html[data-theme="dark"] body.matt-course-shell > .nav-drawer,
html[data-theme="dark"] body.matt-course-shell .matt-politics-directory,
html[data-theme="dark"] body.matt-course-shell .matt-politics-sidebar,
html.dark body.matt-course-shell > .sidebar,
html.dark body.matt-course-shell > .nav-drawer,
html.dark body.matt-course-shell .matt-politics-directory,
html.dark body.matt-course-shell .matt-politics-sidebar,
body[data-theme="dark"].matt-course-shell > .sidebar,
body[data-theme="dark"].matt-course-shell > .nav-drawer,
body[data-theme="dark"].matt-course-shell .matt-politics-directory,
body[data-theme="dark"].matt-course-shell .matt-politics-sidebar,
body.matt-course-shell.matt-shared-dark > .sidebar,
body.matt-course-shell.matt-shared-dark > .nav-drawer,
body.matt-course-shell.matt-shared-dark .matt-politics-directory,
body.matt-course-shell.matt-shared-dark .matt-politics-sidebar,
body.matt-course-shell.dark > .sidebar,
body.matt-course-shell.dark > .nav-drawer,
body.matt-course-shell.dark .matt-politics-directory,
body.matt-course-shell.dark .matt-politics-sidebar {
  color: #d8e5ee !important;
  background: linear-gradient(180deg, rgba(24,43,61,.98), rgba(15,29,43,.98)) !important;
  border-right-color: rgba(132,193,226,.25) !important;
  box-shadow: 8px 0 28px rgba(0,0,0,.26) !important;
}
html[data-theme="dark"] body.matt-course-shell > .sidebar a,
html[data-theme="dark"] body.matt-course-shell > .nav-drawer a,
html[data-theme="dark"] body.matt-course-shell .matt-politics-directory .drawer-link,
html[data-theme="dark"] body.matt-course-shell .matt-politics-sidebar a,
html.dark body.matt-course-shell > .sidebar a,
html.dark body.matt-course-shell > .nav-drawer a,
html.dark body.matt-course-shell .matt-politics-directory .drawer-link,
html.dark body.matt-course-shell .matt-politics-sidebar a,
body[data-theme="dark"].matt-course-shell > .sidebar a,
body[data-theme="dark"].matt-course-shell > .nav-drawer a,
body[data-theme="dark"].matt-course-shell .matt-politics-directory .drawer-link,
body[data-theme="dark"].matt-course-shell .matt-politics-sidebar a,
body.matt-course-shell.matt-shared-dark > .sidebar a,
body.matt-course-shell.matt-shared-dark > .nav-drawer a,
body.matt-course-shell.matt-shared-dark .matt-politics-directory .drawer-link,
body.matt-course-shell.matt-shared-dark .matt-politics-sidebar a,
body.matt-course-shell.dark > .sidebar a,
body.matt-course-shell.dark > .nav-drawer a,
body.matt-course-shell.dark .matt-politics-directory .drawer-link,
body.matt-course-shell.dark .matt-politics-sidebar a {
  color: #bfd2df !important;
}
html[data-theme="dark"] body.matt-course-shell > .sidebar a:hover,
html[data-theme="dark"] body.matt-course-shell > .sidebar a.active,
html[data-theme="dark"] body.matt-course-shell > .nav-drawer a:hover,
html[data-theme="dark"] body.matt-course-shell > .nav-drawer a.active,
html[data-theme="dark"] body.matt-course-shell .matt-politics-directory .drawer-link:hover,
html[data-theme="dark"] body.matt-course-shell .matt-politics-directory .drawer-link:focus-visible,
html.dark body.matt-course-shell > .sidebar a:hover,
html.dark body.matt-course-shell > .sidebar a.active,
html.dark body.matt-course-shell > .nav-drawer a:hover,
html.dark body.matt-course-shell > .nav-drawer a.active,
html.dark body.matt-course-shell .matt-politics-directory .drawer-link:hover,
html.dark body.matt-course-shell .matt-politics-directory .drawer-link:focus-visible,
body[data-theme="dark"].matt-course-shell > .sidebar a:hover,
body[data-theme="dark"].matt-course-shell > .sidebar a.active,
body[data-theme="dark"].matt-course-shell > .nav-drawer a:hover,
body[data-theme="dark"].matt-course-shell > .nav-drawer a.active,
body[data-theme="dark"].matt-course-shell .matt-politics-directory .drawer-link:hover,
body[data-theme="dark"].matt-course-shell .matt-politics-directory .drawer-link:focus-visible,
body.matt-course-shell.matt-shared-dark > .sidebar a:hover,
body.matt-course-shell.matt-shared-dark > .sidebar a.active,
body.matt-course-shell.matt-shared-dark > .nav-drawer a:hover,
body.matt-course-shell.matt-shared-dark > .nav-drawer a.active,
body.matt-course-shell.dark > .sidebar a:hover,
body.matt-course-shell.dark > .sidebar a.active,
body.matt-course-shell.dark > .nav-drawer a:hover,
body.matt-course-shell.dark > .nav-drawer a.active {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
html[data-theme="dark"] body.matt-course-shell .sidebar-search input,
html[data-theme="dark"] body.matt-course-shell .matt-politics-directory input,
html[data-theme="dark"] body.matt-course-shell .matt-politics-sidebar input,
html.dark body.matt-course-shell .sidebar-search input,
html.dark body.matt-course-shell .matt-politics-directory input,
html.dark body.matt-course-shell .matt-politics-sidebar input,
body[data-theme="dark"].matt-course-shell .sidebar-search input,
body[data-theme="dark"].matt-course-shell .matt-politics-directory input,
body[data-theme="dark"].matt-course-shell .matt-politics-sidebar input,
body.matt-course-shell.matt-shared-dark .sidebar-search input,
body.matt-course-shell.dark .sidebar-search input {
  color: #e7f3fb !important;
  background: rgba(9,24,38,.72) !important;
  border-color: rgba(132,193,226,.36) !important;
}

/* The light selectors above deliberately carry !important so legacy inline
   styles cannot restore a navy rail.  Repeat the dark state with an equally
   specific selector so an html[data-theme] switch always wins that contract. */
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar {
  color: #d8e5ee !important;
  background: linear-gradient(180deg, rgba(24,43,61,.98), rgba(15,29,43,.98)) !important;
  border-right-color: rgba(132,193,226,.25) !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a {
  color: #bfd2df !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a.active,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a.active,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar a.active,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .nav-drawer a.active {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .sidebar-search input,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory input,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar input,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .sidebar-search input,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-directory input,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .matt-politics-sidebar input {
  color: #e7f3fb !important;
  background: rgba(9,24,38,.72) !important;
  border-color: rgba(132,193,226,.36) !important;
}

/* App-style pages use .app-sidebar instead of .sidebar; give it the same
   palette contract without changing its layout or navigation behaviour. */
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar {
  color: #675f51;
  background: linear-gradient(180deg, rgba(255,254,249,.98), rgba(249,246,237,.96)) !important;
  border-right-color: rgba(185,151,73,.22) !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a { color: #756d60 !important; }
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a.active {
  color: #5f4717 !important; background: rgba(244,215,133,.28) !important; border-left-color: #c49535 !important;
}
html[data-theme="dark"] body.matt-course-shell .app-sidebar,
html.dark body.matt-course-shell .app-sidebar,
body.matt-course-shell.matt-shared-dark .app-sidebar,
body.matt-course-shell.dark .app-sidebar {
  color: #d8e5ee !important;
  background: linear-gradient(180deg, rgba(24,43,61,.98), rgba(15,29,43,.98)) !important;
  border-right-color: rgba(132,193,226,.25) !important;
}
html[data-theme="dark"] body.matt-course-shell .app-sidebar a,
html.dark body.matt-course-shell .app-sidebar a,
body.matt-course-shell.matt-shared-dark .app-sidebar a,
body.matt-course-shell.dark .app-sidebar a { color: #bfd2df !important; }
html[data-theme="dark"] body.matt-course-shell .app-sidebar a.active,
html.dark body.matt-course-shell .app-sidebar a.active,
body.matt-course-shell.matt-shared-dark .app-sidebar a.active,
body.matt-course-shell.dark .app-sidebar a.active {
  color: #f2fbff !important; background: rgba(82,157,201,.2) !important; border-left-color: #84c7e9 !important;
}

/* Some older materials use an id-based rail (#sidebar) rather than the
   shared .sidebar/.app-sidebar class.  Keep those pages in the same palette
   contract as the rest of the review library. */
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar {
  color: #675f51 !important;
  background: linear-gradient(180deg, rgba(255,254,249,.98), rgba(249,246,237,.96)) !important;
  border-right-color: rgba(185,151,73,.22) !important;
  box-shadow: 8px 0 28px rgba(125,99,39,.09) !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar button,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar summary {
  color: #756d60 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar button:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar summary:hover {
  color: #5f4717 !important;
  background: rgba(244,215,133,.28) !important;
  border-left-color: #c49535 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar input,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar select {
  color: #4d4a42 !important;
  background: rgba(255,255,255,.82) !important;
  border-color: rgba(178,145,71,.3) !important;
}

/* Legacy headers often hard-code white text.  On a pale rail that is the
   same as hiding the course name, so normalize the common header/search
   variants while leaving course-specific accent colors untouched. */
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header h1,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header h2,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-hd h1,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-hd h2,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar > h2,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar > h2,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .logo,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .sidebar-header h1,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .sidebar-header h2,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .sidebar-hd h1,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .sidebar-hd h2 {
  color: #504631 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header .subtitle,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header .sub,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-hd .sub,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-hd p,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .subtitle,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .sub,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .logo span,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .sidebar-hd p {
  color: #907c55 !important;
}

/* Navigation widgets that are generated as divs/buttons (rather than links)
   need the same light-rail treatment too. */
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .ch-item,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .method-item,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .practice-item,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .lab-item,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .chapter-btn,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav details summary {
  color: #756d60 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .ch-item:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .ch-item.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .method-item:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .method-item.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .practice-item:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .practice-item.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .lab-item:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .lab-item.active,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav .chapter-btn:hover,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-nav details summary:hover {
  color: #5f4717 !important;
  background: rgba(244,215,133,.28) !important;
  border-left-color: #c49535 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-srch input,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-search input {
  color: #4d4a42 !important;
  background: rgba(255,255,255,.82) !important;
  border-color: rgba(178,145,71,.3) !important;
}

body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .ch-item,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .method-item,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .practice-item,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .lab-item,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .chapter-btn,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav details summary,
body.matt-course-shell.dark > .sidebar .sidebar-nav .ch-item,
body.matt-course-shell.dark > .sidebar .sidebar-nav .method-item,
body.matt-course-shell.dark > .sidebar .sidebar-nav .practice-item,
body.matt-course-shell.dark > .sidebar .sidebar-nav .lab-item,
body.matt-course-shell.dark > .sidebar .sidebar-nav .chapter-btn,
body.matt-course-shell.dark > .sidebar .sidebar-nav details summary {
  color: #bfd2df !important;
}
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .ch-item:hover,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .ch-item.active,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .method-item:hover,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .method-item.active,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .practice-item:hover,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .practice-item.active,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .lab-item:hover,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .lab-item.active,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav .chapter-btn:hover,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-nav details summary:hover,
body.matt-course-shell.dark > .sidebar .sidebar-nav .ch-item:hover,
body.matt-course-shell.dark > .sidebar .sidebar-nav .ch-item.active,
body.matt-course-shell.dark > .sidebar .sidebar-nav .method-item:hover,
body.matt-course-shell.dark > .sidebar .sidebar-nav .method-item.active,
body.matt-course-shell.dark > .sidebar .sidebar-nav .practice-item:hover,
body.matt-course-shell.dark > .sidebar .sidebar-nav .practice-item.active,
body.matt-course-shell.dark > .sidebar .sidebar-nav .lab-item:hover,
body.matt-course-shell.dark > .sidebar .sidebar-nav .lab-item.active,
body.matt-course-shell.dark > .sidebar .sidebar-nav .chapter-btn:hover,
body.matt-course-shell.dark > .sidebar .sidebar-nav details summary:hover {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-footer button,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-ft button {
  color: #746548 !important;
  border-color: rgba(178,145,71,.32) !important;
  background: rgba(255,255,255,.56) !important;
}
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-footer button,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-ft button,
body.matt-course-shell.dark > .sidebar .sidebar-footer button,
body.matt-course-shell.dark > .sidebar .sidebar-ft button {
  color: #dfd4b8 !important;
  border-color: rgba(132,193,226,.32) !important;
  background: rgba(255,255,255,.07) !important;
}
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header .language-select,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-hd .language-select,
body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .language-select {
  color: #675f51 !important;
  border-color: rgba(178,145,71,.38) !important;
  background: rgba(255,255,255,.72) !important;
}
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-header .language-select,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-hd .language-select,
body.matt-course-shell.matt-shared-dark > #sidebar .language-select,
body.matt-course-shell.dark > .sidebar .sidebar-header .language-select,
body.matt-course-shell.dark > .sidebar .sidebar-hd .language-select,
body.matt-course-shell.dark > #sidebar .language-select {
  color: #d8e5ee !important;
  border-color: rgba(132,193,226,.35) !important;
  background: rgba(9,24,38,.55) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-header .language-select,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-hd .language-select,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > #sidebar .language-select,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-header .language-select,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-hd .language-select,
body[data-theme="dark"].matt-course-shell.matt-course-shell > #sidebar .language-select {
  color: #d8e5ee !important;
  border-color: rgba(132,193,226,.35) !important;
  background: rgba(9,24,38,.55) !important;
}

/* Immunology and a few older pages call their search wrapper .sidebar-srch. */
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-srch input,
html.dark body.matt-course-shell.matt-course-shell > .sidebar .sidebar-srch input,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-srch input,
body.matt-course-shell.matt-shared-dark > .sidebar .sidebar-srch input,
body.matt-course-shell.dark > .sidebar .sidebar-srch input {
  color: #e7f3fb !important;
  background: rgba(9,24,38,.72) !important;
  border-color: rgba(132,193,226,.36) !important;
}

html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .ch-item,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .method-item,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .practice-item,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .lab-item,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .chapter-btn,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav details summary,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .ch-item,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .method-item,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .practice-item,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .lab-item,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .chapter-btn,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav details summary {
  color: #bfd2df !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .ch-item:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .ch-item.active,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .method-item:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .method-item.active,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .practice-item:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .practice-item.active,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .lab-item:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .lab-item.active,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .chapter-btn:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-nav details summary:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .ch-item:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .ch-item.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .method-item:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .method-item.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .practice-item:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .practice-item.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .lab-item:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .lab-item.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav .chapter-btn:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-nav details summary:hover {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-footer button,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-ft button,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-footer button,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-ft button {
  color: #dfd4b8 !important;
  border-color: rgba(132,193,226,.32) !important;
  background: rgba(255,255,255,.07) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-header h1,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-header h2,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-hd h1,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > .sidebar .sidebar-hd h2,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-header h1,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-header h2,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-hd h1,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar .sidebar-hd h2 {
  color: #e6f2fb !important;
}

/* The light rules above intentionally have high specificity because several
   source pages include inline/nav-level dark declarations.  Mirror that
   specificity for the dark state so a theme toggle always wins, including
   the id-based and app-style rails. */
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar {
  color: #d8e5ee !important;
  background: linear-gradient(180deg, rgba(24,43,61,.98), rgba(15,29,43,.98)) !important;
  border-right-color: rgba(132,193,226,.25) !important;
  box-shadow: 8px 0 28px rgba(0,0,0,.26) !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar button,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar summary,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar button,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar summary {
  color: #bfd2df !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a.active,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar a.active,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a:hover,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a.active,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar button:hover,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar summary:hover,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a:hover,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar a.active,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar button:hover,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar summary:hover {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar input,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) .app-sidebar input,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar input,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar select,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar input,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) #sidebar select {
  color: #e7f3fb !important;
  background: rgba(9,24,38,.72) !important;
  border-color: rgba(132,193,226,.36) !important;
}
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header h1,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header h2,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar > h2,
html[data-theme="dark"] body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .logo,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header h1,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > .sidebar .sidebar-header h2,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar > h2,
html.dark body.matt-course-shell:not(.matt-shared-dark):not(.dark) > #sidebar .logo {
  color: #e6f2fb !important;
}

/* Body-class/data-theme variants used by native toggles and the shared
   fallback.  Repeating the shell class raises specificity without depending
   on a particular theme implementation. */
html[data-theme="dark"] body.matt-course-shell.matt-course-shell .app-sidebar,
html.dark body.matt-course-shell.matt-course-shell .app-sidebar,
body[data-theme="dark"].matt-course-shell.matt-course-shell .app-sidebar,
body.matt-course-shell.matt-shared-dark .app-sidebar,
body.matt-course-shell.dark .app-sidebar,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell > #sidebar,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar,
html.dark body.matt-course-shell.matt-course-shell > #sidebar,
html.dark body.matt-course-shell.matt-course-shell #sidebar,
body[data-theme="dark"].matt-course-shell.matt-course-shell > #sidebar,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar,
body.matt-course-shell.matt-shared-dark > #sidebar,
body.matt-course-shell.matt-shared-dark #sidebar,
body.matt-course-shell.dark > #sidebar,
body.matt-course-shell.dark #sidebar {
  color: #d8e5ee !important;
  background: linear-gradient(180deg, rgba(24,43,61,.98), rgba(15,29,43,.98)) !important;
  border-right-color: rgba(132,193,226,.25) !important;
  box-shadow: 8px 0 28px rgba(0,0,0,.26) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell .app-sidebar a,
html.dark body.matt-course-shell.matt-course-shell .app-sidebar a,
body[data-theme="dark"].matt-course-shell.matt-course-shell .app-sidebar a,
body.matt-course-shell.matt-shared-dark .app-sidebar a,
body.matt-course-shell.dark .app-sidebar a,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar a,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar button,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar summary,
html.dark body.matt-course-shell.matt-course-shell #sidebar a,
html.dark body.matt-course-shell.matt-course-shell #sidebar button,
html.dark body.matt-course-shell.matt-course-shell #sidebar summary,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar a,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar button,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar summary,
body.matt-course-shell.matt-shared-dark #sidebar a,
body.matt-course-shell.matt-shared-dark #sidebar button,
body.matt-course-shell.matt-shared-dark #sidebar summary,
body.matt-course-shell.dark #sidebar a,
body.matt-course-shell.dark #sidebar button,
body.matt-course-shell.dark #sidebar summary {
  color: #bfd2df !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell .app-sidebar a.active,
html.dark body.matt-course-shell.matt-course-shell .app-sidebar a.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell .app-sidebar a.active,
body.matt-course-shell.matt-shared-dark .app-sidebar a.active,
body.matt-course-shell.dark .app-sidebar a.active,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar a:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar a.active,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar button:hover,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar summary:hover,
html.dark body.matt-course-shell.matt-course-shell #sidebar a:hover,
html.dark body.matt-course-shell.matt-course-shell #sidebar a.active,
html.dark body.matt-course-shell.matt-course-shell #sidebar button:hover,
html.dark body.matt-course-shell.matt-course-shell #sidebar summary:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar a:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar a.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar button:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar summary:hover,
body.matt-course-shell.matt-shared-dark #sidebar a:hover,
body.matt-course-shell.matt-shared-dark #sidebar a.active,
body.matt-course-shell.matt-shared-dark #sidebar button:hover,
body.matt-course-shell.matt-shared-dark #sidebar summary:hover,
body.matt-course-shell.dark #sidebar a:hover,
body.matt-course-shell.dark #sidebar a.active,
body.matt-course-shell.dark #sidebar button:hover,
body.matt-course-shell.dark #sidebar summary:hover {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-course-shell .app-sidebar input,
html.dark body.matt-course-shell.matt-course-shell .app-sidebar input,
body[data-theme="dark"].matt-course-shell.matt-course-shell .app-sidebar input,
body.matt-course-shell.matt-shared-dark .app-sidebar input,
body.matt-course-shell.dark .app-sidebar input,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar input,
html[data-theme="dark"] body.matt-course-shell.matt-course-shell #sidebar select,
html.dark body.matt-course-shell.matt-course-shell #sidebar input,
html.dark body.matt-course-shell.matt-course-shell #sidebar select,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar input,
body[data-theme="dark"].matt-course-shell.matt-course-shell #sidebar select,
body.matt-course-shell.matt-shared-dark #sidebar input,
body.matt-course-shell.matt-shared-dark #sidebar select,
body.matt-course-shell.dark #sidebar input,
body.matt-course-shell.dark #sidebar select {
  color: #e7f3fb !important;
  background: rgba(9,24,38,.72) !important;
  border-color: rgba(132,193,226,.36) !important;
}

/* Anatomy uses body[data-theme="dark"] instead of an html attribute. */
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .nav-drawer,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-directory,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-sidebar {
  color: #d8e5ee !important;
  background: linear-gradient(180deg, rgba(24,43,61,.98), rgba(15,29,43,.98)) !important;
  border-right-color: rgba(132,193,226,.25) !important;
  box-shadow: 8px 0 28px rgba(0,0,0,.26) !important;
}
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar a,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .nav-drawer a,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-directory .drawer-link,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-sidebar a {
  color: #bfd2df !important;
}
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar a:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .sidebar a.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .nav-drawer a:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell > .nav-drawer a.active,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-directory .drawer-link:hover,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-directory .drawer-link:focus-visible,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-sidebar a.active {
  color: #f2fbff !important;
  background: rgba(82,157,201,.2) !important;
  border-left-color: #84c7e9 !important;
}
body[data-theme="dark"].matt-course-shell.matt-course-shell .sidebar-search input,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-directory input,
body[data-theme="dark"].matt-course-shell.matt-course-shell .matt-politics-sidebar input {
  color: #e7f3fb !important;
  background: rgba(9,24,38,.72) !important;
  border-color: rgba(132,193,226,.36) !important;
}

/* -------------------------------------------------------------------------
   Microbiology legacy page
   -------------------------------------------------------------------------
   This page keeps a few hard-coded light surfaces in its own inline skin.
   Keep its dark mode coherent with the shared course shell without changing
   the palette of other legacy review pages.
*/
html[data-theme="dark"] body.microbiology-review.matt-course-shell,
html.dark body.microbiology-review.matt-course-shell,
body[data-theme="dark"].microbiology-review.matt-course-shell,
body.microbiology-review.matt-course-shell.matt-shared-dark,
body.microbiology-review.matt-course-shell.dark {
  --primary: #a6dcf7;
  --secondary: #68b9e8;
  --accent: #ff978d;
  --bg: #0e1b29;
  --card-bg: #17283a;
  --card: #17283a;
  --surface: #17283a;
  --bg-card: #17283a;
  --text: #e5eff6;
  --text-soft: #c5d6e1;
  --text-muted: #9eb6c5;
  --text2: #9eb6c5;
  --border: #344b60;
  --tag-bg: #24435a;
  --highlight: #403b25;
  --important: #482a31;
  color-scheme: dark;
}

html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar,
html.dark body.microbiology-review.matt-course-shell #sidebar,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar,
body.microbiology-review.matt-course-shell.dark #sidebar {
  color: #cbdde8 !important;
  background: linear-gradient(180deg, rgba(20,39,56,.99), rgba(12,27,41,.99)) !important;
  border-right: 1px solid rgba(132,193,226,.22) !important;
  box-shadow: 2px 0 18px rgba(0,0,0,.3) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar h3,
html.dark body.microbiology-review.matt-course-shell #sidebar h3,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar h3,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar h3,
body.microbiology-review.matt-course-shell.dark #sidebar h3 {
  color: #b9e4f8 !important;
  background: rgba(20,39,56,.98) !important;
  border-bottom-color: rgba(132,193,226,.24) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar .sidebar-search,
html.dark body.microbiology-review.matt-course-shell #sidebar .sidebar-search,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar .sidebar-search,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar .sidebar-search,
body.microbiology-review.matt-course-shell.dark #sidebar .sidebar-search {
  background: rgba(20,39,56,.98) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar .sidebar-search input,
html.dark body.microbiology-review.matt-course-shell #sidebar .sidebar-search input,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar .sidebar-search input,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar .sidebar-search input,
body.microbiology-review.matt-course-shell.dark #sidebar .sidebar-search input {
  color: #e9f5fc !important;
  background-color: #162c40 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a9d5ec' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") !important;
  background-position: 10px center !important;
  background-repeat: no-repeat !important;
  border-color: rgba(132,193,226,.38) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar .sidebar-search input:focus,
html.dark body.microbiology-review.matt-course-shell #sidebar .sidebar-search input:focus,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar .sidebar-search input:focus,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar .sidebar-search input:focus,
body.microbiology-review.matt-course-shell.dark #sidebar .sidebar-search input:focus {
  background-color: #1b354c !important;
  border-color: #75c5ed !important;
  box-shadow: 0 0 0 3px rgba(104,185,232,.18) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar ol li a,
html.dark body.microbiology-review.matt-course-shell #sidebar ol li a,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar ol li a,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar ol li a,
body.microbiology-review.matt-course-shell.dark #sidebar ol li a {
  color: #bfd3df !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar ol li a.sub,
html.dark body.microbiology-review.matt-course-shell #sidebar ol li a.sub,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar ol li a.sub,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar ol li a.sub,
body.microbiology-review.matt-course-shell.dark #sidebar ol li a.sub {
  color: #a9c1cf !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar ol li a:hover,
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar ol li a.active,
html.dark body.microbiology-review.matt-course-shell #sidebar ol li a:hover,
html.dark body.microbiology-review.matt-course-shell #sidebar ol li a.active,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar ol li a:hover,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar ol li a.active,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar ol li a:hover,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar ol li a.active,
body.microbiology-review.matt-course-shell.dark #sidebar ol li a:hover,
body.microbiology-review.matt-course-shell.dark #sidebar ol li a.active {
  color: #f3fbff !important;
  background: rgba(82,157,201,.22) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell #sidebar ol li a.search-match-toc,
html.dark body.microbiology-review.matt-course-shell #sidebar ol li a.search-match-toc,
body[data-theme="dark"].microbiology-review.matt-course-shell #sidebar ol li a.search-match-toc,
body.microbiology-review.matt-course-shell.matt-shared-dark #sidebar ol li a.search-match-toc,
body.microbiology-review.matt-course-shell.dark #sidebar ol li a.search-match-toc {
  color: #ffe7a0 !important;
  background: rgba(130,96,28,.38) !important;
}

html[data-theme="dark"] body.microbiology-review.matt-course-shell .header,
html.dark body.microbiology-review.matt-course-shell .header,
body[data-theme="dark"].microbiology-review.matt-course-shell .header,
body.microbiology-review.matt-course-shell.matt-shared-dark .header,
body.microbiology-review.matt-course-shell.dark .header {
  background: linear-gradient(135deg, #185477 0%, #247fb0 100%) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell .section h2,
html[data-theme="dark"] body.microbiology-review.matt-course-shell .toc h2,
html.dark body.microbiology-review.matt-course-shell .section h2,
html.dark body.microbiology-review.matt-course-shell .toc h2,
body[data-theme="dark"].microbiology-review.matt-course-shell .section h2,
body[data-theme="dark"].microbiology-review.matt-course-shell .toc h2,
body.microbiology-review.matt-course-shell.matt-shared-dark .section h2,
body.microbiology-review.matt-course-shell.matt-shared-dark .toc h2,
body.microbiology-review.matt-course-shell.dark .section h2,
body.microbiology-review.matt-course-shell.dark .toc h2 {
  color: #a6dcf7 !important;
  border-bottom-color: rgba(132,193,226,.28) !important;
}
html[data-theme="dark"] body.microbiology-review.matt-course-shell .section h3,
html.dark body.microbiology-review.matt-course-shell .section h3,
body[data-theme="dark"].microbiology-review.matt-course-shell .section h3,
body.microbiology-review.matt-course-shell.matt-shared-dark .section h3,
body.microbiology-review.matt-course-shell.dark .section h3 { color: #73c0eb !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .section h4,
html.dark body.microbiology-review.matt-course-shell .section h4,
body[data-theme="dark"].microbiology-review.matt-course-shell .section h4,
body.microbiology-review.matt-course-shell.matt-shared-dark .section h4,
body.microbiology-review.matt-course-shell.dark .section h4 { color: #c5d6e1 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell strong,
html.dark body.microbiology-review.matt-course-shell strong,
body[data-theme="dark"].microbiology-review.matt-course-shell strong,
body.microbiology-review.matt-course-shell.matt-shared-dark strong,
body.microbiology-review.matt-course-shell.dark strong { color: #ff9e95 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell em,
html.dark body.microbiology-review.matt-course-shell em,
body[data-theme="dark"].microbiology-review.matt-course-shell em,
body.microbiology-review.matt-course-shell.matt-shared-dark em,
body.microbiology-review.matt-course-shell.dark em { color: #a8dcf8 !important; }

html[data-theme="dark"] body.microbiology-review.matt-course-shell .tag-important,
html.dark body.microbiology-review.matt-course-shell .tag-important,
body[data-theme="dark"].microbiology-review.matt-course-shell .tag-important,
body.microbiology-review.matt-course-shell.matt-shared-dark .tag-important,
body.microbiology-review.matt-course-shell.dark .tag-important { color: #ffaaa2 !important; background: rgba(134,45,53,.38) !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .tag-key,
html.dark body.microbiology-review.matt-course-shell .tag-key,
body[data-theme="dark"].microbiology-review.matt-course-shell .tag-key,
body.microbiology-review.matt-course-shell.matt-shared-dark .tag-key,
body.microbiology-review.matt-course-shell.dark .tag-key { color: #ffe08a !important; background: rgba(126,94,22,.38) !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .tag-concept,
html.dark body.microbiology-review.matt-course-shell .tag-concept,
body[data-theme="dark"].microbiology-review.matt-course-shell .tag-concept,
body.microbiology-review.matt-course-shell.matt-shared-dark .tag-concept,
body.microbiology-review.matt-course-shell.dark .tag-concept { color: #a9dcf7 !important; background: rgba(43,103,139,.38) !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell tr:nth-child(even) td,
html.dark body.microbiology-review.matt-course-shell tr:nth-child(even) td,
body[data-theme="dark"].microbiology-review.matt-course-shell tr:nth-child(even) td,
body.microbiology-review.matt-course-shell.matt-shared-dark tr:nth-child(even) td,
body.microbiology-review.matt-course-shell.dark tr:nth-child(even) td { background: rgba(28,49,67,.72) !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell th,
html.dark body.microbiology-review.matt-course-shell th,
body[data-theme="dark"].microbiology-review.matt-course-shell th,
body.microbiology-review.matt-course-shell.matt-shared-dark th,
body.microbiology-review.matt-course-shell.dark th { background: #205a7d !important; color: #f0faff !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .highlight-box,
html.dark body.microbiology-review.matt-course-shell .highlight-box,
body[data-theme="dark"].microbiology-review.matt-course-shell .highlight-box,
body.microbiology-review.matt-course-shell.matt-shared-dark .highlight-box,
body.microbiology-review.matt-course-shell.dark .highlight-box { background: rgba(116,88,22,.28) !important; border-left-color: #d7ad43 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .important-box,
html.dark body.microbiology-review.matt-course-shell .important-box,
body[data-theme="dark"].microbiology-review.matt-course-shell .important-box,
body.microbiology-review.matt-course-shell.matt-shared-dark .important-box,
body.microbiology-review.matt-course-shell.dark .important-box { background: rgba(121,40,50,.28) !important; border-left-color: #ed7770 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .info-box,
html.dark body.microbiology-review.matt-course-shell .info-box,
body[data-theme="dark"].microbiology-review.matt-course-shell .info-box,
body.microbiology-review.matt-course-shell.matt-shared-dark .info-box,
body.microbiology-review.matt-course-shell.dark .info-box { background: rgba(39,103,140,.28) !important; border-left-color: #68b9e8 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .xref,
html.dark body.microbiology-review.matt-course-shell .xref,
body[data-theme="dark"].microbiology-review.matt-course-shell .xref,
body.microbiology-review.matt-course-shell.matt-shared-dark .xref,
body.microbiology-review.matt-course-shell.dark .xref { color: #9bb5c5 !important; border-bottom-color: rgba(155,181,197,.5) !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .sidebar-toggle,
html.dark body.microbiology-review.matt-course-shell .sidebar-toggle,
body[data-theme="dark"].microbiology-review.matt-course-shell .sidebar-toggle,
body.microbiology-review.matt-course-shell.matt-shared-dark .sidebar-toggle,
body.microbiology-review.matt-course-shell.dark .sidebar-toggle { background: #247fae !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .search-info,
html.dark body.microbiology-review.matt-course-shell .search-info,
body[data-theme="dark"].microbiology-review.matt-course-shell .search-info,
body.microbiology-review.matt-course-shell.matt-shared-dark .search-info,
body.microbiology-review.matt-course-shell.dark .search-info { color: #9eb6c5 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .search-info .match-nav,
html.dark body.microbiology-review.matt-course-shell .search-info .match-nav,
body[data-theme="dark"].microbiology-review.matt-course-shell .search-info .match-nav,
body.microbiology-review.matt-course-shell.matt-shared-dark .search-info .match-nav,
body.microbiology-review.matt-course-shell.dark .search-info .match-nav { color: #79c7ee !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .search-info .match-nav.disabled,
html.dark body.microbiology-review.matt-course-shell .search-info .match-nav.disabled,
body[data-theme="dark"].microbiology-review.matt-course-shell .search-info .match-nav.disabled,
body.microbiology-review.matt-course-shell.matt-shared-dark .search-info .match-nav.disabled,
body.microbiology-review.matt-course-shell.dark .search-info .match-nav.disabled { color: #5a7180 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .search-nav-float button,
html.dark body.microbiology-review.matt-course-shell .search-nav-float button,
body[data-theme="dark"].microbiology-review.matt-course-shell .search-nav-float button,
body.microbiology-review.matt-course-shell.matt-shared-dark .search-nav-float button,
body.microbiology-review.matt-course-shell.dark .search-nav-float button { color: #dcecf5 !important; background: #1b3044 !important; border: 1px solid rgba(132,193,226,.28) !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell .search-nav-float .search-count-label,
html.dark body.microbiology-review.matt-course-shell .search-nav-float .search-count-label,
body[data-theme="dark"].microbiology-review.matt-course-shell .search-nav-float .search-count-label,
body.microbiology-review.matt-course-shell.matt-shared-dark .search-nav-float .search-count-label,
body.microbiology-review.matt-course-shell.dark .search-nav-float .search-count-label { color: #9eb6c5 !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell > footer,
html.dark body.microbiology-review.matt-course-shell > footer,
body[data-theme="dark"].microbiology-review.matt-course-shell > footer,
body.microbiology-review.matt-course-shell.matt-shared-dark > footer,
body.microbiology-review.matt-course-shell.dark > footer { color: #9eb2c1 !important; border-top-color: #30475a !important; background: transparent !important; }
html[data-theme="dark"] body.microbiology-review.matt-course-shell > footer a,
html.dark body.microbiology-review.matt-course-shell > footer a,
body[data-theme="dark"].microbiology-review.matt-course-shell > footer a,
body.microbiology-review.matt-course-shell.matt-shared-dark > footer a,
body.microbiology-review.matt-course-shell.dark > footer a { color: #9ebfd1 !important; }

/* -------------------------------------------------------------------------
   Shared frosted-glass visual layer
   -------------------------------------------------------------------------
   药理学Ⅱ的视觉基准是“内容仍然连续阅读，表面使用半透明渐变”。把
   这一层放在共用外壳里，所有专题只需加载 review-course-shell.css 就能
   获得同一套材质；章节自己的颜色、标签和交互仍由原页面保留。
   ------------------------------------------------------------------------- */
body.matt-course-shell.matt-glass-theme {
  --matt-glass-light-border: rgba(105, 151, 188, .28);
  --matt-glass-light-shadow: 0 14px 34px rgba(44, 86, 122, .12), inset 0 1px 0 rgba(255,255,255,.86);
  --matt-glass-dark-border: rgba(145, 195, 229, .22);
  --matt-glass-dark-shadow: 0 18px 42px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 7% 2%, rgba(111, 202, 255, .22), transparent 28rem),
    radial-gradient(circle at 91% 9%, rgba(190, 154, 255, .16), transparent 30rem),
    radial-gradient(circle at 54% 94%, rgba(112, 227, 192, .12), transparent 33rem),
    #eef4fb !important;
  background-attachment: fixed;
}

body.matt-course-shell.matt-glass-theme > main,
body.matt-course-shell.matt-glass-theme > .main,
body.matt-course-shell.matt-glass-theme > #mainContent,
body.matt-course-shell.matt-glass-theme > .app-layout,
body.matt-course-shell.matt-glass-theme > .app-main,
body.matt-course-shell.matt-glass-theme > .content,
body.matt-course-shell.matt-glass-theme > .matt-linear-content,
body.matt-course-shell.matt-glass-theme > .matt-linear-main {
  background: transparent !important;
}

body.matt-course-shell.matt-glass-theme .matt-coursebar {
  background: linear-gradient(105deg, rgba(14, 46, 70, .88), rgba(43, 94, 126, .76)) !important;
  border-bottom-color: rgba(174, 221, 247, .32) !important;
  box-shadow: 0 10px 28px rgba(22, 60, 91, .16) !important;
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}

body.matt-course-shell.matt-glass-theme > .sidebar,
body.matt-course-shell.matt-glass-theme > #sidebar,
body.matt-course-shell.matt-glass-theme > .app-sidebar,
body.matt-course-shell.matt-glass-theme > .matt-politics-sidebar,
body.matt-course-shell.matt-glass-theme > .matt-linear-sidebar,
body.matt-course-shell.matt-glass-theme > .nav-drawer {
  background: linear-gradient(180deg, rgba(255, 254, 249, .96), rgba(238, 247, 252, .84)) !important;
  border-right-color: rgba(156, 181, 199, .34) !important;
  box-shadow: 10px 0 34px rgba(67, 104, 132, .13) !important;
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
}
body.matt-course-shell.matt-glass-theme > .sidebar a,
body.matt-course-shell.matt-glass-theme > #sidebar a,
body.matt-course-shell.matt-glass-theme > .app-sidebar a,
body.matt-course-shell.matt-glass-theme > .matt-politics-sidebar a,
body.matt-course-shell.matt-glass-theme > .matt-linear-sidebar a,
body.matt-course-shell.matt-glass-theme > .nav-drawer a {
  color: #5b6f7d !important;
}
body.matt-course-shell.matt-glass-theme > .sidebar a:hover,
body.matt-course-shell.matt-glass-theme > .sidebar a.active,
body.matt-course-shell.matt-glass-theme > #sidebar a:hover,
body.matt-course-shell.matt-glass-theme > #sidebar a.active,
body.matt-course-shell.matt-glass-theme > .app-sidebar a:hover,
body.matt-course-shell.matt-glass-theme > .app-sidebar a.active,
body.matt-course-shell.matt-glass-theme > .matt-politics-sidebar a:hover,
body.matt-course-shell.matt-glass-theme > .matt-politics-sidebar a.active,
body.matt-course-shell.matt-glass-theme > .matt-linear-sidebar a:hover,
body.matt-course-shell.matt-glass-theme > .matt-linear-sidebar a.active,
body.matt-course-shell.matt-glass-theme > .nav-drawer a:hover,
body.matt-course-shell.matt-glass-theme > .nav-drawer a.active {
  color: #1f5e82 !important;
  background: linear-gradient(90deg, rgba(255, 220, 126, .34), rgba(214, 239, 253, .32)) !important;
}

body.matt-course-shell.matt-glass-theme .card,
body.matt-course-shell.matt-glass-theme .chapter-card,
body.matt-course-shell.matt-glass-theme .chapter-header,
body.matt-course-shell.matt-glass-theme .chapter-content,
body.matt-course-shell.matt-glass-theme .section,
body.matt-course-shell.matt-glass-theme .panel,
body.matt-course-shell.matt-glass-theme .content-card,
body.matt-course-shell.matt-glass-theme .term-card,
body.matt-course-shell.matt-glass-theme .info-card,
body.matt-course-shell.matt-glass-theme .study-card,
body.matt-course-shell.matt-glass-theme .quiz-card,
body.matt-course-shell.matt-glass-theme .intro-card {
  background: linear-gradient(135deg, rgba(255,255,255,.76), rgba(235,246,253,.56)) !important;
  border-color: var(--matt-glass-light-border) !important;
  box-shadow: var(--matt-glass-light-shadow) !important;
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
}
body.matt-course-shell.matt-glass-theme .q-card,
body.matt-course-shell.matt-glass-theme .q-card-desc-inner,
body.matt-course-shell.matt-glass-theme .answer,
body.matt-course-shell.matt-glass-theme .mechanism-box {
  background: linear-gradient(135deg, rgba(255,255,255,.70), rgba(232,244,252,.52)) !important;
  box-shadow: 0 10px 26px rgba(44, 86, 122, .10), inset 0 1px 0 rgba(255,255,255,.80) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}
body.matt-course-shell.matt-glass-theme input,
body.matt-course-shell.matt-glass-theme select,
body.matt-course-shell.matt-glass-theme textarea,
body.matt-course-shell.matt-glass-theme .search-box,
body.matt-course-shell.matt-glass-theme .sidebar-search input {
  background: rgba(255,255,255,.66) !important;
  border-color: rgba(109, 154, 188, .32) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.matt-course-shell.matt-glass-theme table {
  border-color: var(--matt-glass-light-border) !important;
}
body.matt-course-shell.matt-glass-theme table td {
  background: rgba(255,255,255,.34) !important;
  border-color: rgba(105, 151, 188, .20) !important;
}
body.matt-course-shell.matt-glass-theme .course-quicklinks a,
body.matt-course-shell.matt-glass-theme .continue-reading,
body.matt-course-shell.matt-glass-theme .matt-coursebar__button,
body.matt-course-shell.matt-glass-theme .theme-toggle,
body.matt-course-shell.matt-glass-theme .focus-toggle,
body.matt-course-shell.matt-glass-theme .menu-btn,
body.matt-course-shell.matt-glass-theme .back-top,
body.matt-course-shell.matt-glass-theme .fab {
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
}

/* Dark mode keeps the same material language while switching the glass tint
   to navy so text and borders remain readable. */
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme,
html.dark body.matt-course-shell.matt-glass-theme,
body[data-theme="dark"].matt-course-shell.matt-glass-theme,
body.matt-course-shell.matt-glass-theme.matt-shared-dark,
body.matt-course-shell.matt-glass-theme.dark {
  background:
    radial-gradient(circle at 7% 2%, rgba(36,142,202,.22), transparent 28rem),
    radial-gradient(circle at 91% 9%, rgba(123,87,194,.18), transparent 30rem),
    radial-gradient(circle at 54% 94%, rgba(41,139,110,.14), transparent 33rem),
    #0d1828 !important;
  color: #e4eef8 !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > .sidebar,
html.dark body.matt-course-shell.matt-glass-theme > .sidebar,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > #sidebar,
html.dark body.matt-course-shell.matt-glass-theme > #sidebar,
body[data-theme="dark"].matt-course-shell.matt-glass-theme > .sidebar,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > .sidebar,
body.matt-course-shell.matt-glass-theme.dark > .sidebar,
body[data-theme="dark"].matt-course-shell.matt-glass-theme > #sidebar,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > #sidebar,
body.matt-course-shell.matt-glass-theme.dark > #sidebar {
  color: #c8d9e6 !important;
  background: linear-gradient(180deg, rgba(14, 36, 55, .90), rgba(10, 24, 40, .84)) !important;
  border-right-color: rgba(145, 195, 229, .24) !important;
  box-shadow: 10px 0 34px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > .sidebar a,
html.dark body.matt-course-shell.matt-glass-theme > .sidebar a,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > #sidebar a,
html.dark body.matt-course-shell.matt-glass-theme > #sidebar a,
body[data-theme="dark"].matt-course-shell.matt-glass-theme > .sidebar a,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > .sidebar a,
body.matt-course-shell.matt-glass-theme.dark > .sidebar a,
body[data-theme="dark"].matt-course-shell.matt-glass-theme > #sidebar a,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > #sidebar a,
body.matt-course-shell.matt-glass-theme.dark > #sidebar a {
  color: #c2d4e1 !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > .sidebar a:hover,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > .sidebar a.active,
html.dark body.matt-course-shell.matt-glass-theme > .sidebar a:hover,
html.dark body.matt-course-shell.matt-glass-theme > .sidebar a.active,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > .sidebar a:hover,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > .sidebar a.active,
body.matt-course-shell.matt-glass-theme.dark > .sidebar a:hover,
body.matt-course-shell.matt-glass-theme.dark > .sidebar a.active,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > #sidebar a:hover,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme > #sidebar a.active,
html.dark body.matt-course-shell.matt-glass-theme > #sidebar a:hover,
html.dark body.matt-course-shell.matt-glass-theme > #sidebar a.active,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > #sidebar a:hover,
body.matt-course-shell.matt-glass-theme.matt-shared-dark > #sidebar a.active,
body.matt-course-shell.matt-glass-theme.dark > #sidebar a:hover,
body.matt-course-shell.matt-glass-theme.dark > #sidebar a.active {
  color: #f2fbff !important;
  background: linear-gradient(90deg, rgba(81,164,211,.24), rgba(81,164,211,.10)) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .card,
html.dark body.matt-course-shell.matt-glass-theme .card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .chapter-card,
html.dark body.matt-course-shell.matt-glass-theme .chapter-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .chapter-header,
html.dark body.matt-course-shell.matt-glass-theme .chapter-header,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .chapter-content,
html.dark body.matt-course-shell.matt-glass-theme .chapter-content,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .section,
html.dark body.matt-course-shell.matt-glass-theme .section,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .panel,
html.dark body.matt-course-shell.matt-glass-theme .panel,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .content-card,
html.dark body.matt-course-shell.matt-glass-theme .content-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .term-card,
html.dark body.matt-course-shell.matt-glass-theme .term-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .info-card,
html.dark body.matt-course-shell.matt-glass-theme .info-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .study-card,
html.dark body.matt-course-shell.matt-glass-theme .study-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .quiz-card,
html.dark body.matt-course-shell.matt-glass-theme .quiz-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .intro-card,
html.dark body.matt-course-shell.matt-glass-theme .intro-card {
  background: linear-gradient(135deg, rgba(34,58,80,.84), rgba(17,35,52,.72)) !important;
  border-color: var(--matt-glass-dark-border) !important;
  box-shadow: var(--matt-glass-dark-shadow) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .q-card,
html.dark body.matt-course-shell.matt-glass-theme .q-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .q-card-desc-inner,
html.dark body.matt-course-shell.matt-glass-theme .q-card-desc-inner,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .answer,
html.dark body.matt-course-shell.matt-glass-theme .answer,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .mechanism-box,
html.dark body.matt-course-shell.matt-glass-theme .mechanism-box,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .q-card,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .q-card-desc-inner,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .answer,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .mechanism-box {
  background: linear-gradient(135deg, rgba(34,58,80,.84), rgba(17,35,52,.72)) !important;
  color: #dceaf5 !important;
  border-color: rgba(145,195,229,.26) !important;
  box-shadow: var(--matt-glass-dark-shadow) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme input,
html.dark body.matt-course-shell.matt-glass-theme input,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme select,
html.dark body.matt-course-shell.matt-glass-theme select,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme textarea,
html.dark body.matt-course-shell.matt-glass-theme textarea,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .search-box,
html.dark body.matt-course-shell.matt-glass-theme .search-box,
body.matt-course-shell.matt-glass-theme.matt-shared-dark input,
body.matt-course-shell.matt-glass-theme.matt-shared-dark select,
body.matt-course-shell.matt-glass-theme.matt-shared-dark textarea,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .search-box {
  color: #e5f1f8 !important;
  background: rgba(18, 39, 58, .72) !important;
  border-color: rgba(145,195,229,.30) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme table td,
html.dark body.matt-course-shell.matt-glass-theme table td,
body.matt-course-shell.matt-glass-theme.matt-shared-dark table td {
  background: rgba(22, 40, 61, .42) !important;
  border-color: rgba(145,195,229,.20) !important;
}

/* Native topic components get the same material treatment as the shared
   chapter shells.  The three physiology cards keep their semantic accent. */
body.matt-course-shell.matt-glass-theme .header,
body.matt-course-shell.matt-glass-theme .hero,
body.matt-course-shell.matt-glass-theme .main-header,
body.matt-course-shell.matt-glass-theme .toc-grid,
body.matt-course-shell.matt-glass-theme .toc-item,
body.matt-course-shell.matt-glass-theme .box,
body.matt-course-shell.matt-glass-theme .k-card,
body.matt-course-shell.matt-glass-theme .knowledge-grid,
body.matt-course-shell.matt-glass-theme .chapter-section,
body.matt-course-shell.matt-glass-theme .subsection,
body.matt-course-shell.matt-glass-theme .ch-bd,
body.matt-course-shell.matt-glass-theme .sec,
body.matt-course-shell.matt-glass-theme .tip,
body.matt-course-shell.matt-glass-theme .alert,
body.matt-course-shell.matt-glass-theme .mnem,
body.matt-course-shell.matt-glass-theme .def-card,
body.matt-course-shell.matt-glass-theme .mech-card,
body.matt-course-shell.matt-glass-theme .clinical-card {
  border-color: var(--matt-glass-light-border) !important;
  box-shadow: var(--matt-glass-light-shadow) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}
body.matt-course-shell.matt-glass-theme .header,
body.matt-course-shell.matt-glass-theme .hero,
body.matt-course-shell.matt-glass-theme .main-header,
body.matt-course-shell.matt-glass-theme .toc-grid,
body.matt-course-shell.matt-glass-theme .toc-item,
body.matt-course-shell.matt-glass-theme .box,
body.matt-course-shell.matt-glass-theme .k-card,
body.matt-course-shell.matt-glass-theme .knowledge-grid,
body.matt-course-shell.matt-glass-theme .chapter-section,
body.matt-course-shell.matt-glass-theme .subsection,
body.matt-course-shell.matt-glass-theme .ch-bd,
body.matt-course-shell.matt-glass-theme .sec,
body.matt-course-shell.matt-glass-theme .tip,
body.matt-course-shell.matt-glass-theme .alert,
body.matt-course-shell.matt-glass-theme .mnem {
  background: linear-gradient(135deg, rgba(255,255,255,.70), rgba(233,245,252,.50)) !important;
}
body.matt-course-shell.matt-glass-theme .def-card {
  background: linear-gradient(135deg, rgba(255,247,215,.76), rgba(255,255,255,.46)) !important;
}
body.matt-course-shell.matt-glass-theme .mech-card {
  background: linear-gradient(135deg, rgba(226,244,255,.76), rgba(255,255,255,.44)) !important;
}
body.matt-course-shell.matt-glass-theme .clinical-card {
  background: linear-gradient(135deg, rgba(255,235,239,.76), rgba(255,255,255,.44)) !important;
}

html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .header,
html.dark body.matt-course-shell.matt-glass-theme .header,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .hero,
html.dark body.matt-course-shell.matt-glass-theme .hero,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .main-header,
html.dark body.matt-course-shell.matt-glass-theme .main-header,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .toc-grid,
html.dark body.matt-course-shell.matt-glass-theme .toc-grid,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .toc-item,
html.dark body.matt-course-shell.matt-glass-theme .toc-item,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .box,
html.dark body.matt-course-shell.matt-glass-theme .box,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .k-card,
html.dark body.matt-course-shell.matt-glass-theme .k-card,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .knowledge-grid,
html.dark body.matt-course-shell.matt-glass-theme .knowledge-grid,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .chapter-section,
html.dark body.matt-course-shell.matt-glass-theme .chapter-section,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .subsection,
html.dark body.matt-course-shell.matt-glass-theme .subsection,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .ch-bd,
html.dark body.matt-course-shell.matt-glass-theme .ch-bd,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .sec,
html.dark body.matt-course-shell.matt-glass-theme .sec,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .tip,
html.dark body.matt-course-shell.matt-glass-theme .tip,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .alert,
html.dark body.matt-course-shell.matt-glass-theme .alert,
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .mnem,
html.dark body.matt-course-shell.matt-glass-theme .mnem,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .header,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .hero,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .main-header,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .toc-grid,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .toc-item,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .box,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .k-card,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .knowledge-grid,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .chapter-section,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .subsection,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .ch-bd,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .sec,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .tip,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .alert,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .mnem {
  background: linear-gradient(135deg, rgba(34,58,80,.80), rgba(17,35,52,.62)) !important;
  border-color: var(--matt-glass-dark-border) !important;
  box-shadow: var(--matt-glass-dark-shadow) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .def-card,
html.dark body.matt-course-shell.matt-glass-theme .def-card,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .def-card {
  background: linear-gradient(135deg, rgba(115,82,30,.50), rgba(49,38,24,.34)) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .mech-card,
html.dark body.matt-course-shell.matt-glass-theme .mech-card,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .mech-card {
  background: linear-gradient(135deg, rgba(33,92,128,.48), rgba(20,42,61,.34)) !important;
}
html[data-theme="dark"] body.matt-course-shell.matt-glass-theme .clinical-card,
html.dark body.matt-course-shell.matt-glass-theme .clinical-card,
body.matt-course-shell.matt-glass-theme.matt-shared-dark .clinical-card {
  background: linear-gradient(135deg, rgba(123,47,61,.48), rgba(49,31,45,.34)) !important;
}

/* Native theme toggles on a few older pages use body.dark/body[data-theme]
   instead of the shared matt-shared-dark marker.  Mirror the dark glass
   treatment there as well so those topics do not fall back to pale panels. */
body.matt-course-shell.matt-glass-theme.dark .card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .card,
body.matt-course-shell.matt-glass-theme.dark .chapter-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .chapter-card,
body.matt-course-shell.matt-glass-theme.dark .chapter-content,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .chapter-content,
body.matt-course-shell.matt-glass-theme.dark .section,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .section,
body.matt-course-shell.matt-glass-theme.dark .panel,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .panel,
body.matt-course-shell.matt-glass-theme.dark .content-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .content-card,
body.matt-course-shell.matt-glass-theme.dark .header,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .header,
body.matt-course-shell.matt-glass-theme.dark .hero,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .hero,
body.matt-course-shell.matt-glass-theme.dark .box,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .box,
body.matt-course-shell.matt-glass-theme.dark .k-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .k-card,
body.matt-course-shell.matt-glass-theme.dark .def-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .def-card,
body.matt-course-shell.matt-glass-theme.dark .mech-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .mech-card,
body.matt-course-shell.matt-glass-theme.dark .clinical-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .clinical-card {
  background: linear-gradient(135deg, rgba(34,58,80,.80), rgba(17,35,52,.62)) !important;
  border-color: var(--matt-glass-dark-border) !important;
  box-shadow: var(--matt-glass-dark-shadow) !important;
}
body.matt-course-shell.matt-glass-theme.dark .def-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .def-card {
  background: linear-gradient(135deg, rgba(115,82,30,.50), rgba(49,38,24,.34)) !important;
}
body.matt-course-shell.matt-glass-theme.dark .mech-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .mech-card {
  background: linear-gradient(135deg, rgba(33,92,128,.48), rgba(20,42,61,.34)) !important;
}
body.matt-course-shell.matt-glass-theme.dark .clinical-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .clinical-card {
  background: linear-gradient(135deg, rgba(123,47,61,.48), rgba(49,31,45,.34)) !important;
}
body.matt-course-shell.matt-glass-theme.dark .q-card,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .q-card,
body.matt-course-shell.matt-glass-theme.dark .q-card-desc-inner,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .q-card-desc-inner,
body.matt-course-shell.matt-glass-theme.dark .answer,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .answer,
body.matt-course-shell.matt-glass-theme.dark .mechanism-box,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .mechanism-box {
  color: #dceaf5 !important;
  background: linear-gradient(135deg, rgba(34,58,80,.84), rgba(17,35,52,.72)) !important;
  border-color: rgba(145,195,229,.26) !important;
  box-shadow: var(--matt-glass-dark-shadow) !important;
}
body.matt-course-shell.matt-glass-theme.dark input,
body[data-theme="dark"].matt-course-shell.matt-glass-theme input,
body.matt-course-shell.matt-glass-theme.dark select,
body[data-theme="dark"].matt-course-shell.matt-glass-theme select,
body.matt-course-shell.matt-glass-theme.dark textarea,
body[data-theme="dark"].matt-course-shell.matt-glass-theme textarea,
body.matt-course-shell.matt-glass-theme.dark .search-box,
body[data-theme="dark"].matt-course-shell.matt-glass-theme .search-box {
  color: #e5f1f8 !important;
  background: rgba(18,39,58,.72) !important;
  border-color: rgba(145,195,229,.30) !important;
}
body.matt-course-shell.matt-glass-theme.dark table td,
body[data-theme="dark"].matt-course-shell.matt-glass-theme table td {
  background: rgba(22,40,61,.42) !important;
  border-color: rgba(145,195,229,.20) !important;
}

/* Smaller topic callouts use different names across the source pages. Keep
   their meaning-specific tint, but give all of them the same frosted surface
   as the main course panels. */
body.matt-course-shell.matt-glass-theme .highlight-box,
body.matt-course-shell.matt-glass-theme .key-box,
body.matt-course-shell.matt-glass-theme .box-info,
body.matt-course-shell.matt-glass-theme .box-warn,
body.matt-course-shell.matt-glass-theme .box-danger,
body.matt-course-shell.matt-glass-theme .box-b,
body.matt-course-shell.matt-glass-theme .box-y,
body.matt-course-shell.matt-glass-theme .box-g,
body.matt-course-shell.matt-glass-theme .important-box,
body.matt-course-shell.matt-glass-theme .info-box,
body.matt-course-shell.matt-glass-theme .red-box,
body.matt-course-shell.matt-glass-theme .summary-box,
body.matt-course-shell.matt-glass-theme .takeaway-box,
body.matt-course-shell.matt-glass-theme .objective-box,
body.matt-course-shell.matt-glass-theme .practice-box,
body.matt-course-shell.matt-glass-theme .comparison-box,
body.matt-course-shell.matt-glass-theme .rec-box,
body.matt-course-shell.matt-glass-theme .callout,
body.matt-course-shell.matt-glass-theme .case-card,
body.matt-course-shell.matt-glass-theme .review-card,
body.matt-course-shell.matt-glass-theme .question-card,
body.matt-course-shell.matt-glass-theme .essay-card,
body.matt-course-shell.matt-glass-theme .step-card,
body.matt-course-shell.matt-glass-theme .remember-card,
body.matt-course-shell.matt-glass-theme .explain-card,
body.matt-course-shell.matt-glass-theme .sa-card,
body.matt-course-shell.matt-glass-theme .qcard,
body.matt-course-shell.matt-glass-theme .exam-info,
body.matt-course-shell.matt-glass-theme .course-info,
body.matt-course-shell.matt-glass-theme .chapter-info,
body.matt-course-shell.matt-glass-theme .ch-info,
body.matt-course-shell.matt-glass-theme .syllabus-summary,
body.matt-course-shell.matt-glass-theme .quick-tips,
body.matt-course-shell.matt-glass-theme .quick-tip-item,
body.matt-course-shell.matt-glass-theme .flow,
body.matt-course-shell.matt-glass-theme .flow-list {
  border-color: var(--matt-glass-light-border) !important;
  box-shadow: var(--matt-glass-light-shadow) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

/* Gold/yellow is reserved for reminders, exam points and study actions. */
body.matt-course-shell.matt-glass-theme .highlight-box,
body.matt-course-shell.matt-glass-theme .box-warn,
body.matt-course-shell.matt-glass-theme .box-y,
body.matt-course-shell.matt-glass-theme .takeaway-box,
body.matt-course-shell.matt-glass-theme .practice-box,
body.matt-course-shell.matt-glass-theme .objective-box,
body.matt-course-shell.matt-glass-theme .summary-box,
body.matt-course-shell.matt-glass-theme .rec-box,
body.matt-course-shell.matt-glass-theme .exam-info {
  background: linear-gradient(135deg, rgba(255,247,215,.78), rgba(255,255,255,.46)) !important;
}

/* Blue is used for definitions, mechanisms and comparisons. */
body.matt-course-shell.matt-glass-theme .box-info,
body.matt-course-shell.matt-glass-theme .box-b,
body.matt-course-shell.matt-glass-theme .info-box,
body.matt-course-shell.matt-glass-theme .callout--info,
body.matt-course-shell.matt-glass-theme .concept-box,
body.matt-course-shell.matt-glass-theme .mechanism-box,
body.matt-course-shell.matt-glass-theme .comparison-box,
body.matt-course-shell.matt-glass-theme .course-info,
body.matt-course-shell.matt-glass-theme .chapter-info,
body.matt-course-shell.matt-glass-theme .ch-info,
body.matt-course-shell.matt-glass-theme .flow,
body.matt-course-shell.matt-glass-theme .flow-list {
  background: linear-gradient(135deg, rgba(226,244,255,.78), rgba(255,255,255,.44)) !important;
}

/* Neutral study cards keep their own accent labels, while their surface joins
   the same translucent blue-white material. */
body.matt-course-shell.matt-glass-theme .case-card,
body.matt-course-shell.matt-glass-theme .concept-box,
body.matt-course-shell.matt-glass-theme .review-card,
body.matt-course-shell.matt-glass-theme .question-card,
body.matt-course-shell.matt-glass-theme .essay-card,
body.matt-course-shell.matt-glass-theme .step-card,
body.matt-course-shell.matt-glass-theme .remember-card,
body.matt-course-shell.matt-glass-theme .explain-card,
body.matt-course-shell.matt-glass-theme .sa-card,
body.matt-course-shell.matt-glass-theme .qcard,
body.matt-course-shell.matt-glass-theme .course-info,
body.matt-course-shell.matt-glass-theme .chapter-info,
body.matt-course-shell.matt-glass-theme .ch-info,
body.matt-course-shell.matt-glass-theme .syllabus-summary,
body.matt-course-shell.matt-glass-theme .quick-tips,
body.matt-course-shell.matt-glass-theme .quick-tip-item {
  background: linear-gradient(135deg, rgba(255,255,255,.70), rgba(233,245,252,.48)) !important;
}

/* Red/pink is kept for warnings and error-prone points. */
body.matt-course-shell.matt-glass-theme .box-danger,
body.matt-course-shell.matt-glass-theme .important-box,
body.matt-course-shell.matt-glass-theme .red-box,
body.matt-course-shell.matt-glass-theme .callout--warning,
body.matt-course-shell.matt-glass-theme .callout--exam {
  background: linear-gradient(135deg, rgba(255,235,239,.78), rgba(255,255,255,.44)) !important;
}

/* Older history/biology pages used pale callouts in their dark theme. These
   rules keep the semantic accent while restoring readable foreground text. */
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .highlight-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .key-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-info,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-warn,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-danger,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-b,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-y,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-g,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .important-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .info-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .red-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .summary-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .takeaway-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .objective-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .practice-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .comparison-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .rec-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .callout,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .case-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .concept-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .review-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .question-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .essay-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .step-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .remember-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .explain-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .sa-card,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .qcard,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .exam-info,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .course-info,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .chapter-info,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .ch-info,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .syllabus-summary,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .quick-tips,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .quick-tip-item,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .flow,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .flow-list,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .highlight-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .key-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-info,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-warn,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-danger,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-b,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-y,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-g,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .important-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .info-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .red-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .summary-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .takeaway-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .objective-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .practice-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .comparison-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .rec-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .callout,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .case-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .concept-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .review-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .question-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .essay-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .step-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .remember-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .explain-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .sa-card,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .qcard,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .exam-info,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .course-info,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .chapter-info,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .ch-info,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .syllabus-summary,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .quick-tips,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .quick-tip-item,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .flow,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .flow-list {
  color: #dceaf5 !important;
  background: linear-gradient(135deg, rgba(34,58,80,.80), rgba(17,35,52,.62)) !important;
  border-color: var(--matt-glass-dark-border) !important;
  box-shadow: var(--matt-glass-dark-shadow) !important;
}

html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .highlight-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .highlight-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-warn,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-warn,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-y,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-y,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .takeaway-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .takeaway-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .practice-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .practice-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .objective-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .objective-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .summary-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .summary-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .rec-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .rec-box {
  background: linear-gradient(135deg, rgba(115,82,30,.50), rgba(49,38,24,.34)) !important;
}
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-danger,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-danger,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .important-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .important-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .red-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .red-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .callout--warning,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .callout--warning,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .callout--exam,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .callout--exam {
  background: linear-gradient(135deg, rgba(123,47,61,.48), rgba(49,31,45,.34)) !important;
}
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-info,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-info,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .box-b,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .box-b,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .info-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .info-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .mechanism-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .mechanism-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .concept-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .concept-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .comparison-box,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .comparison-box,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .flow,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .flow,
html:is([data-theme="dark"],.dark) body.matt-course-shell.matt-glass-theme .flow-list,
body.matt-course-shell.matt-glass-theme:is([data-theme="dark"],.matt-shared-dark,.dark) .flow-list {
  background: linear-gradient(135deg, rgba(33,92,128,.48), rgba(20,42,61,.34)) !important;
}

/* Microbiology keeps a pale frosted header in the light theme.  Its source
   stylesheet originally paired that header with white text for a saturated
   blue background; after the shared glass layer lightens the surface, that
   inheritance turns the course title into near-invisible text.  Give this
   one legacy header an explicit light/dark foreground contract instead of
   changing the shared header palette for every other course. */
body.microbiology-review.matt-course-shell.matt-glass-theme:not(.matt-shared-dark):not(.dark) .header {
  color: #164d6e !important;
  background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(226,242,252,.58)) !important;
  border-color: rgba(105,151,188,.28) !important;
}
body.microbiology-review.matt-course-shell.matt-glass-theme:not(.matt-shared-dark):not(.dark) .header h1 {
  color: #164d6e !important;
  text-shadow: none !important;
}
body.microbiology-review.matt-course-shell.matt-glass-theme:not(.matt-shared-dark):not(.dark) .header p {
  color: #496d84 !important;
  opacity: 1 !important;
}
body.microbiology-review.matt-course-shell.matt-glass-theme:not(.matt-shared-dark):not(.dark) .header .badge {
  color: #1a5276 !important;
  background: rgba(255,255,255,.62) !important;
  border: 1px solid rgba(105,151,188,.32) !important;
}
html:is([data-theme="dark"],.dark) body.microbiology-review.matt-course-shell.matt-glass-theme .header,
body.microbiology-review.matt-course-shell.matt-glass-theme.matt-shared-dark .header,
body.microbiology-review.matt-course-shell.matt-glass-theme.dark .header {
  color: #eff9ff !important;
  background: linear-gradient(135deg, rgba(24,84,119,.92), rgba(36,127,176,.82)) !important;
  border-color: rgba(145,211,239,.30) !important;
}
html:is([data-theme="dark"],.dark) body.microbiology-review.matt-course-shell.matt-glass-theme .header h1,
body.microbiology-review.matt-course-shell.matt-glass-theme.matt-shared-dark .header h1,
body.microbiology-review.matt-course-shell.matt-glass-theme.dark .header h1 {
  color: #f5fcff !important;
  text-shadow: 0 1px 12px rgba(6,30,48,.22) !important;
}
html:is([data-theme="dark"],.dark) body.microbiology-review.matt-course-shell.matt-glass-theme .header p,
body.microbiology-review.matt-course-shell.matt-glass-theme.matt-shared-dark .header p,
body.microbiology-review.matt-course-shell.matt-glass-theme.dark .header p {
  color: #d5edf8 !important;
  opacity: 1 !important;
}
html:is([data-theme="dark"],.dark) body.microbiology-review.matt-course-shell.matt-glass-theme .header .badge,
body.microbiology-review.matt-course-shell.matt-glass-theme.matt-shared-dark .header .badge,
body.microbiology-review.matt-course-shell.matt-glass-theme.dark .header .badge {
  color: #eff9ff !important;
  background: rgba(102,182,222,.25) !important;
  border: 1px solid rgba(172,225,246,.32) !important;
}
