/* Dark theme entry point. The base stylesheets already define the dark palette. */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(185,196,230,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.050);
  color: rgba(240,243,255,0.82);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 720;
  cursor: pointer;
  box-shadow:
    0 1px 1px rgba(0,0,0,0.10),
    inset 0 1px 0 rgba(255,255,255,0.055);
}

.theme-toggle:hover {
  background: rgba(99,102,241,0.13);
  color: rgba(248,250,255,0.98);
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(99,102,241,0.28);
  border: 1px solid rgba(129,140,248,0.42);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c7d2fe;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}

html.theme-light .theme-toggle-thumb {
  transform: translateX(16px);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(129,140,248,0.82);
  outline-offset: 3px;
}

html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-indicator {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(184,207,255,0.74);
  font-size: 0.875rem;
  transition: color 0.18s ease;
}

html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-pct {
  color: #cfe1ff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-label {
  color: rgba(184,207,255,0.58);
  transition: color 0.18s ease;
}

/* 100% complete -- restrained success state. ONLY the percentage carries
   the green; the chart icon is barely-tinted, and the "mastered" word +
   info icon stay neutral muted so the whole indicator doesn't read as a
   coloured badge. No glow. */
html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-indicator.is-complete {
  /* Base inherited colour -- governs the info icon (uses currentColor)
     and any unstyled text. Stays neutral periwinkle/muted. */
  color: rgba(184,207,255,0.56);
}

html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-indicator.is-complete svg:not(.fc-mastery-info) {
  /* The chart icon only -- subtly green, much dimmer than the previous
     bright emerald. The info icon (.fc-mastery-info) keeps the neutral
     base colour above. */
  color: rgba(74,222,128,0.58);
}

html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-indicator.is-complete .fc-mastery-pct {
  color: rgba(134,239,172,0.78);
  text-shadow: none;
}

html.theme-dark body:has(.noteviewer-body--flashcards) .fc-mastery-indicator.is-complete .fc-mastery-label {
  color: rgba(184,207,255,0.62);
}

html.theme-dark body:has(.noteviewer-body--flashcards) .flashcard-divider,
html.theme-dark body:has(.noteviewer-body--flashcards) .flashcard-hint,
html.theme-dark body:has(.noteviewer-body--flashcards) .fc-helper-row {
  display: none;
}

@media (max-width: 720px) {
  .theme-toggle-label {
    display: none;
  }
}

/* ── Topic Landing (tl-*) dark refinements ───────────────────────────────────── */
/* Base defaults in noteviewer.css already handle dark mode; this file adds
   a slightly lifted card surface and softer borders for visual grouping. */

html.theme-dark .tl-chapter-card {
  background: rgba(255,255,255,0.050);
  border-color: rgba(255,255,255,0.10);
}

html.theme-dark .tl-chapter-card:hover {
  background: rgba(255,255,255,0.065);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 8px 32px rgba(0,0,0,0.40);
}

html.theme-dark .tl-chapter-count {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

html.theme-dark .tl-topic-row + .tl-topic-row {
  border-top-color: rgba(255,255,255,0.06);
}

/* Slightly stronger hover tint in dark mode */
html.theme-dark .tl-chapter-card:nth-child(4n+1) .tl-topic-row:hover { background: rgba(99,102,241,0.08); }
html.theme-dark .tl-chapter-card:nth-child(4n+2) .tl-topic-row:hover { background: rgba(11,143,131,0.08); }
html.theme-dark .tl-chapter-card:nth-child(4n+3) .tl-topic-row:hover { background: rgba(96,165,250,0.08); }
html.theme-dark .tl-chapter-card:nth-child(4n) .tl-topic-row:hover { background: rgba(197,160,40,0.08); }

/* Notes/resource dark theme: neutral midnight reader surface. */
html.theme-dark body:has(.note-body),
html.theme-dark body:has(.noteviewer-body) {
  background: #0a0d14;
}

html.theme-dark body:has(.note-body) .layout,
html.theme-dark body:has(.note-body) .noteviewer-layout,
html.theme-dark body:has(.note-body) .nv-canvas,
html.theme-dark body:has(.noteviewer-body) .layout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-layout,
html.theme-dark body:has(.noteviewer-body) .nv-canvas {
  background: linear-gradient(180deg, #0a0d14 0%, #080a11 100%);
}

html.theme-dark body:has(.note-body) .noteviewer-main,
html.theme-dark body:has(.noteviewer-body) .noteviewer-main {
  background: linear-gradient(180deg, rgba(12,16,26,0.82) 0%, rgba(8,10,17,0) 34%);
}

html.theme-dark body:has(.note-body) .noteviewer-main::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-main::before {
  height: 0;
  background: none;
}

html.theme-dark body:has(.note-body) .noteviewer-main::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-main::after {
  background: none;
}

html.theme-dark body:has(.note-body) .noteviewer-main-inner::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-main-inner::before {
  background: none;
}

html.theme-dark body:has(.note-body) .note-body,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body {
  color: rgba(246,248,255,0.92);
}

html.theme-dark body:has(.note-body) .note-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body p {
  color: rgba(246,248,255,0.90);
}

html.theme-dark body:has(.note-body) .note-body h2,
html.theme-dark body:has(.note-body) .noteviewer-body h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.055) 0%, transparent 62%);
  box-shadow: none;
}

/* Restore clean background for review headings (override the h2 gradient above) */
html.theme-dark body:has(.note-body) .note-body .note-review-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-review-heading {
  background: none;
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body code,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body code {
  background: rgba(255,255,255,0.075);
  border: 1px solid rgba(255,255,255,0.08);
}

html.theme-dark body:has(.note-body) .note-body pre,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body pre {
  background: rgba(8, 11, 18, 0.94);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body blockquote:not(.note-callout),
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote:not(.note-callout) {
  background: rgba(12, 16, 27, 0.60);
  border-left-color: rgba(148, 163, 184, 0.24);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card {
  border-color: rgba(148, 163, 184, 0.095);
  background: rgba(8, 11, 18, 0.96);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.20);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-icon-badge,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-icon-badge {
  background: rgba(148, 163, 184, 0.055);
  color: rgba(194, 202, 216, 0.72);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-main::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-main::before {
  background: rgba(148, 163, 184, 0.10);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-heading {
  color: rgba(250, 251, 255, 0.98);
  -webkit-text-fill-color: rgba(250, 251, 255, 0.98);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-count,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-count {
  border-color: rgba(148, 163, 184, 0.09);
  background: rgba(148, 163, 184, 0.07);
  color: rgba(199, 207, 223, 0.76);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-subtitle,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-subtitle {
  color: rgba(193, 201, 225, 0.82);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-rule,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-rule {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14), transparent);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-item,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-item {
  border-color: rgba(148, 163, 184, 0.10);
  background: rgba(13, 17, 28, 0.88);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-check,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-check {
  border-color: rgba(79, 111, 242, 0.45);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-gutter,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-gutter {
  background: rgba(148, 163, 184, 0.10);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-copy,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-copy {
  color: rgba(244, 247, 255, 0.98);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-status,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status {
  border-color: rgba(148, 163, 184, 0.10);
  background: rgba(10, 13, 22, 0.72);
  color: rgba(180, 195, 235, 0.82);
}

/* Old near-black rail layer removed — superseded by the FINAL SIDEBAR LIFT
   block lower in this file (the navy/periwinkle source of truth). */

html.theme-dark body:has(.note-body) .tl-chapter-card {
  background: linear-gradient(160deg, rgba(30,38,72,0.78) 0%, rgba(18,22,50,0.70) 100%);
  border-color: rgba(255,255,255,0.13);
  box-shadow: 0 2px 16px rgba(0,0,0,0.24);
}

html.theme-dark body:has(.note-body) .tl-chapter-card:hover {
  background: linear-gradient(160deg, rgba(36,44,82,0.86) 0%, rgba(22,27,60,0.78) 100%);
  border-color: rgba(149,156,255,0.28);
}

/* ──────────────────────────────────────────────────────────────────────────
   Final note reader layer.
   theme-dark.css loads last, so note-reading colors that must win live here.
   Large surfaces stay neutral midnight; semantic colors are thin accents only.
   ────────────────────────────────────────────────────────────────────────── */

html.theme-dark body:has(.note-body),
html.theme-dark body:has(.noteviewer-body) {
  --note-ink: rgba(231, 237, 248, 0.90);
  --note-ink-strong: rgba(246, 248, 252, 0.96);
  --note-ink-soft: rgba(186, 197, 214, 0.76);
  --note-muted: rgba(132, 144, 164, 0.76);
  --note-faint: rgba(91, 103, 122, 0.74);
  --note-line: rgba(148, 163, 184, 0.115);
  --note-line-soft: rgba(148, 163, 184, 0.075);
  --note-panel: rgba(8, 11, 18, 0.88);
  --note-panel-raised: rgba(11, 15, 24, 0.94);
  --note-panel-soft: rgba(13, 17, 28, 0.72);
  --note-blue: #6f8cff;
  --note-blue-rgb: 111, 140, 255;
  --note-teal: #5eead4;
  --note-teal-rgb: 94, 234, 212;
  --note-amber: #f0b35a;
  --note-amber-rgb: 240, 179, 90;
  --note-red: #f08a8a;
  --note-red-rgb: 240, 138, 138;
}

html.theme-dark body:has(.note-body) .noteviewer-main,
html.theme-dark body:has(.noteviewer-body) .noteviewer-main {
  background: linear-gradient(180deg, rgba(10, 13, 20, 0.96) 0%, rgba(8, 10, 17, 0.98) 100%);
}

html.theme-dark body:has(.note-body) .nv-resource-header,
html.theme-dark body:has(.noteviewer-body) .nv-resource-header {
  border-bottom-color: var(--note-line);
}

html.theme-dark body:has(.note-body) .note-breadcrumbs,
html.theme-dark body:has(.noteviewer-body) .note-breadcrumbs {
  color: var(--note-faint);
}

html.theme-dark body:has(.note-body) .note-breadcrumbs a,
html.theme-dark body:has(.noteviewer-body) .note-breadcrumbs a {
  color: rgba(166, 177, 196, 0.70);
}

html.theme-dark body:has(.note-body) .note-breadcrumbs a:hover,
html.theme-dark body:has(.noteviewer-body) .note-breadcrumbs a:hover {
  color: rgba(218, 225, 237, 0.92);
}

html.theme-dark body:has(.note-body) .note-breadcrumbs span:not(.breadcrumb-sep):last-child,
html.theme-dark body:has(.noteviewer-body) .note-breadcrumbs span:not(.breadcrumb-sep):last-child {
  color: rgba(197, 207, 222, 0.76);
}

html.theme-dark body:has(.note-body) .nt-hero-title,
html.theme-dark body:has(.noteviewer-body) .nt-hero-title {
  background: linear-gradient(135deg, rgba(236, 242, 255, 0.97) 0%, rgba(193, 212, 255, 0.88) 52%, rgba(152, 180, 255, 0.78) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.theme-dark body:has(.note-body) .note-body,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body {
  color: var(--note-ink);
}

html.theme-dark body:has(.note-body) .note-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body p,
html.theme-dark body:has(.note-body) .note-body li,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body li {
  color: var(--note-ink);
}

html.theme-dark body:has(.note-body) .note-body strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body strong {
  color: rgba(250, 252, 255, 0.98);
}

html.theme-dark body:has(.note-body) .note-body em,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body em {
  color: rgba(211, 219, 233, 0.84);
}

html.theme-dark body:has(.note-body) .note-body h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 {
  border-left-color: rgba(var(--note-blue-rgb), 0.58);
  background: none;
  color: var(--note-ink-strong);
  -webkit-text-fill-color: var(--note-ink-strong);
}

html.theme-dark body:has(.note-body) .note-body h3,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3 {
  color: rgba(229, 235, 247, 0.93);
}

html.theme-dark body:has(.note-body) .note-body h4,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h4 {
  color: rgba(182, 193, 211, 0.80);
}

html.theme-dark body:has(.note-body) .note-body ul,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ul {
  border-left-color: transparent;
}

html.theme-dark body:has(.note-body) .note-body ul > li::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ul > li::before {
  background: rgba(148, 163, 184, 0.42);
  color: transparent;
}

html.theme-dark body:has(.note-body) .note-body ul ul,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ul ul {
  border-left-color: rgba(148, 163, 184, 0.085);
}

html.theme-dark body:has(.note-body) .note-body ol > li::marker,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ol > li::marker {
  color: rgba(177, 188, 207, 0.70);
}

html.theme-dark body:has(.note-body) .note-body code,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body code {
  background: rgba(148, 163, 184, 0.075);
  border-color: rgba(148, 163, 184, 0.10);
  color: rgba(232, 238, 249, 0.92);
}

html.theme-dark body:has(.note-body) .note-body pre,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body pre {
  background: var(--note-panel);
  border-color: var(--note-line);
  color: var(--note-ink);
}

html.theme-dark body:has(.note-body) .note-body blockquote:not(.note-callout),
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote:not(.note-callout) {
  background: rgba(12, 16, 26, 0.68);
  border-left-color: rgba(148, 163, 184, 0.28);
  color: rgba(217, 225, 238, 0.88);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card {
  background: rgba(8, 11, 18, 0.72);
  border-color: var(--note-line-soft);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-heading {
  color: rgba(226, 233, 245, 0.90);
  -webkit-text-fill-color: rgba(226, 233, 245, 0.90);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-subtitle,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-subtitle {
  color: var(--note-muted);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-count,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-count,
html.theme-dark body:has(.note-body) .note-body .nt-objective-status,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status {
  background: rgba(148, 163, 184, 0.055);
  border-color: rgba(148, 163, 184, 0.085);
  color: rgba(187, 198, 215, 0.72);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-rule,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-rule {
  background: rgba(148, 163, 184, 0.095);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-item,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-item {
  background: rgba(11, 15, 24, 0.76);
  border-color: rgba(148, 163, 184, 0.085);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-check,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-check {
  border-color: rgba(var(--note-blue-rgb), 0.46);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-copy,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-copy {
  color: rgba(222, 230, 243, 0.88);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll {
  background: rgba(7, 10, 16, 0.92);
  border-color: var(--note-line);
  border-top-color: rgba(148, 163, 184, 0.15);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll::before {
  background: rgba(148, 163, 184, 0.10);
}

html.theme-dark body:has(.note-body) .note-body th,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body th {
  background: rgba(12, 16, 25, 0.95);
  border-bottom-color: rgba(148, 163, 184, 0.15);
  border-right-color: rgba(148, 163, 184, 0.075);
  color: rgba(196, 207, 224, 0.82);
}

html.theme-dark body:has(.note-body) .note-body td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td {
  border-bottom-color: rgba(148, 163, 184, 0.075);
  border-right-color: rgba(148, 163, 184, 0.055);
  color: rgba(221, 228, 240, 0.84);
}

html.theme-dark body:has(.note-body) .note-body td:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td:first-child {
  border-right-color: rgba(148, 163, 184, 0.10);
  color: rgba(239, 244, 252, 0.92);
}

html.theme-dark body:has(.note-body) .note-body tbody tr:nth-child(even) td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.018);
}

html.theme-dark body:has(.note-body) .note-body tbody tr:hover td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body tbody tr:hover td {
  background: rgba(148, 163, 184, 0.028);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"],
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"],
html.theme-dark body:has(.note-body) .note-body .note-callout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout {
  --callout-rgb: var(--note-blue-rgb);
  --callout-ink: var(--note-blue);
  background: rgba(8, 11, 18, 0.86);
  border-color: var(--note-line-soft);
  border-left-color: rgba(var(--callout-rgb), 0.56);
  color: var(--note-ink);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-examiner,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-examiner,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--insight,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--insight {
  --callout-rgb: var(--note-teal-rgb);
  --callout-ink: var(--note-teal);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  --callout-rgb: var(--note-amber-rgb);
  --callout-ink: var(--note-amber);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--out-of-scope {
  --callout-rgb: var(--note-red-rgb);
  --callout-ink: var(--note-red);
}

html.theme-dark body:has(.note-body) .note-body .callout-icon-col,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-icon-col,
html.theme-dark body:has(.note-body) .note-body .note-callout::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::before {
  background: rgba(var(--callout-rgb), 0.075);
  border-color: rgba(var(--callout-rgb), 0.16);
  color: rgba(var(--callout-rgb), 0.88);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.note-body) .note-body .note-callout > strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > strong {
  color: rgba(var(--callout-rgb), 0.88);
  border-bottom-color: rgba(148, 163, 184, 0.10);
}

html.theme-dark body:has(.note-body) .note-body .callout-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-body p,
html.theme-dark body:has(.note-body) .note-body .note-callout > span,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > span {
  color: rgba(222, 230, 243, 0.88);
}

html.theme-dark body:has(.note-body) .note-body .note-figure,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure {
  background: rgba(7, 10, 16, 0.72);
  border-color: var(--note-line);
  border-top-color: rgba(148, 163, 184, 0.15);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption {
  background: rgba(11, 15, 24, 0.88);
  border-bottom-color: var(--note-line-soft);
  color: var(--note-muted);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-img-area,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-img-area {
  background: rgba(148, 163, 184, 0.035);
}

html.theme-dark body:has(.note-body) .note-review-section,
html.theme-dark body:has(.noteviewer-body) .note-review-section {
  border-top: 1px solid var(--note-line-soft);
  padding-top: 1.25em;
}

html.theme-dark body:has(.note-body) .note-body .note-review-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-review-heading {
  color: var(--note-ink-strong);
}

html.theme-dark body:has(.note-body) .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-panel {
  background: rgba(8, 11, 18, 0.78);
  border-color: var(--note-line);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-panel {
  border-left: 3px solid rgba(var(--note-teal-rgb), 0.46);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-panel {
  border-left: 3px solid rgba(var(--note-blue-rgb), 0.42);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-kicker,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-kicker {
  color: rgba(var(--note-teal-rgb), 0.82);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-kicker,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-kicker {
  color: rgba(var(--note-blue-rgb), 0.78);
}

html.theme-dark body:has(.note-body) .note-review-list,
html.theme-dark body:has(.noteviewer-body) .note-review-list {
  color: rgba(218, 226, 240, 0.84);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-list > li::before {
  color: rgba(var(--note-teal-rgb), 0.78);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li::before {
  border-color: rgba(var(--note-blue-rgb), 0.24);
}

/* Study usability emphasis: stronger scan cues, still neutral/premium. */
html.theme-dark body:has(.note-body),
html.theme-dark body:has(.noteviewer-body) {
  --note-ink: rgba(224, 231, 243, 0.94);
  --note-ink-strong: rgba(245, 248, 255, 0.985);
  --note-ink-soft: rgba(200, 210, 226, 0.84);
  --note-line: rgba(148, 163, 184, 0.15);
  --note-line-soft: rgba(148, 163, 184, 0.10);
  --note-blue: #7d96ff;
  --note-blue-rgb: 125, 150, 255;
  --note-teal: #63ead8;
  --note-teal-rgb: 99, 234, 216;
  --note-amber: #f2bd68;
  --note-amber-rgb: 242, 189, 104;
}

html.theme-dark body:has(.note-body) .note-body h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 {
  border-left-color: rgba(var(--note-blue-rgb), 0.72);
  color: var(--note-ink-strong);
  -webkit-text-fill-color: var(--note-ink-strong);
}

html.theme-dark body:has(.note-body) .note-body h2::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::after {
  background: linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.78), rgba(148, 163, 184, 0.28), transparent);
  opacity: 1;
}

html.theme-dark body:has(.note-body) .note-body h3,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3 {
  color: rgba(237, 242, 250, 0.96);
}

html.theme-dark body:has(.note-body) .note-body h3::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::before {
  background: rgba(148, 163, 184, 0.72);
  opacity: 1;
}

html.theme-dark body:has(.note-body) .note-body h4,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h4 {
  color: rgba(197, 207, 224, 0.86);
}

html.theme-dark body:has(.note-body) .note-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body p,
html.theme-dark body:has(.note-body) .note-body li,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body li {
  color: var(--note-ink);
}

html.theme-dark body:has(.note-body) .note-body strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body strong {
  color: #f7f9ff;
}

html.theme-dark body:has(.note-body) .note-body ul > li::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ul > li::before {
  background: rgba(178, 191, 212, 0.62);
}

html.theme-dark body:has(.note-body) .note-body ol > li::marker,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ol > li::marker {
  color: rgba(203, 213, 230, 0.82);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card {
  background:
    linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.055), transparent 38%),
    rgba(8, 11, 18, 0.82);
  border-color: rgba(148, 163, 184, 0.13);
  border-left-color: rgba(var(--note-blue-rgb), 0.58);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-heading {
  color: rgba(241, 245, 252, 0.96);
  -webkit-text-fill-color: rgba(241, 245, 252, 0.96);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-subtitle,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-subtitle {
  color: rgba(181, 193, 212, 0.82);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-item,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-item {
  background: rgba(12, 16, 26, 0.88);
  border-color: rgba(148, 163, 184, 0.12);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-check,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-check {
  border-color: rgba(var(--note-blue-rgb), 0.70);
  background: rgba(var(--note-blue-rgb), 0.055);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-copy,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-copy {
  color: rgba(233, 239, 249, 0.93);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"],
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"],
html.theme-dark body:has(.note-body) .note-body .note-callout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout {
  background:
    linear-gradient(90deg, rgba(var(--callout-rgb), 0.085), transparent 42%),
    rgba(8, 11, 18, 0.92);
  border-color: rgba(148, 163, 184, 0.13);
  border-left-color: rgba(var(--callout-rgb), 0.78);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  background:
    linear-gradient(90deg, rgba(var(--note-amber-rgb), 0.115), transparent 44%),
    rgba(9, 11, 18, 0.94);
  border-left-color: rgba(var(--note-amber-rgb), 0.88);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-exam-tip,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-exam-tip,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--exam-tip,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--exam-tip {
  background:
    linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.105), transparent 44%),
    rgba(8, 11, 18, 0.93);
  border-left-color: rgba(var(--note-blue-rgb), 0.84);
}

html.theme-dark body:has(.note-body) .note-body .callout-icon-col,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-icon-col,
html.theme-dark body:has(.note-body) .note-body .note-callout::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::before {
  background: rgba(var(--callout-rgb), 0.13);
  border-color: rgba(var(--callout-rgb), 0.26);
  color: rgba(var(--callout-rgb), 0.96);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.note-body) .note-body .note-callout > strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > strong {
  color: rgba(var(--callout-rgb), 0.98);
  border-bottom-color: rgba(var(--callout-rgb), 0.20);
}

html.theme-dark body:has(.note-body) .note-body .callout-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-body p,
html.theme-dark body:has(.note-body) .note-body .note-callout > span,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > span {
  color: rgba(231, 238, 249, 0.94);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll {
  border-color: rgba(148, 163, 184, 0.16);
  border-top-color: rgba(148, 163, 184, 0.22);
}

html.theme-dark body:has(.note-body) .note-body th,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body th {
  background: rgba(17, 22, 34, 0.98);
  border-bottom-color: rgba(148, 163, 184, 0.22);
  color: rgba(219, 228, 242, 0.92);
}

html.theme-dark body:has(.note-body) .note-body td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td {
  border-bottom-color: rgba(148, 163, 184, 0.105);
  color: rgba(225, 233, 245, 0.88);
}

html.theme-dark body:has(.note-body) .note-body td:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td:first-child {
  color: rgba(248, 250, 255, 0.96);
}

html.theme-dark body:has(.note-body) .note-body tbody tr:nth-child(even) td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.028);
}

html.theme-dark body:has(.note-body) .note-body .note-figure,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure {
  border-color: rgba(148, 163, 184, 0.16);
  border-top-color: rgba(148, 163, 184, 0.22);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption {
  color: rgba(195, 206, 224, 0.84);
}

html.theme-dark body:has(.note-body) .note-review-section,
html.theme-dark body:has(.noteviewer-body) .note-review-section {
  border-top-color: rgba(148, 163, 184, 0.12);
}

html.theme-dark body:has(.note-body) .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-panel {
  background: rgba(8, 11, 18, 0.90);
  border-color: rgba(148, 163, 184, 0.15);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-panel {
  background:
    linear-gradient(90deg, rgba(var(--note-teal-rgb), 0.07), transparent 42%),
    rgba(8, 11, 18, 0.92);
  border-left-color: rgba(var(--note-teal-rgb), 0.62);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-list > li::before {
  color: rgba(var(--note-teal-rgb), 0.95);
}

html.theme-dark body:has(.note-body) .note-review-list,
html.theme-dark body:has(.noteviewer-body) .note-review-list {
  color: rgba(229, 237, 248, 0.90);
}

/* Premium study-note identity polish: final winning dark-mode rules. */
html.theme-dark body:has(.note-body) .note-body h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 {
  color: #f4f7ff;
  -webkit-text-fill-color: #f4f7ff;
}

html.theme-dark body:has(.note-body) .note-body h2::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::before {
  background: linear-gradient(180deg, rgba(var(--note-blue-rgb), 0.92), rgba(148, 163, 184, 0.52));
}

html.theme-dark body:has(.note-body) .note-body h2::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::after {
  background: linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.84), rgba(148, 163, 184, 0.34), transparent);
}

html.theme-dark body:has(.note-body) .note-body h3,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3 {
  color: rgba(239, 244, 253, 0.97);
}

html.theme-dark body:has(.note-body) .note-body h3::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::before {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.78), rgba(148, 163, 184, 0.18));
}

html.theme-dark body:has(.note-body) .note-body h4,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h4 {
  color: rgba(205, 215, 230, 0.90);
}

html.theme-dark body:has(.note-body) .note-body strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body strong {
  color: #fafcff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.035);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card::before {
  background: linear-gradient(180deg, rgba(var(--note-blue-rgb), 0.72), rgba(148, 163, 184, 0.20));
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card {
  background:
    linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.07), transparent 36%),
    rgba(8, 11, 18, 0.88);
  border-color: rgba(148, 163, 184, 0.15);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-count,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-count,
html.theme-dark body:has(.note-body) .note-body .nt-objective-status,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status {
  color: rgba(207, 217, 233, 0.82);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-item,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-item {
  background: rgba(13, 17, 27, 0.94);
  border-color: rgba(148, 163, 184, 0.14);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"]::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"]::after,
html.theme-dark body:has(.note-body) .note-body .note-callout::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::after {
  background: linear-gradient(90deg, rgba(var(--callout-rgb), 0.52), rgba(148, 163, 184, 0.13), transparent);
  opacity: 1;
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"],
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"],
html.theme-dark body:has(.note-body) .note-body .note-callout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout {
  background:
    linear-gradient(90deg, rgba(var(--callout-rgb), 0.095), transparent 40%),
    rgba(8, 11, 18, 0.95);
  border-color: rgba(148, 163, 184, 0.16);
  border-left-color: rgba(var(--callout-rgb), 0.86);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  background:
    linear-gradient(90deg, rgba(var(--note-amber-rgb), 0.14), transparent 42%),
    rgba(10, 11, 17, 0.96);
  border-left-color: rgba(var(--note-amber-rgb), 0.96);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--out-of-scope {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.08), transparent 42%),
    rgba(8, 11, 18, 0.94);
  border-left-color: rgba(190, 201, 218, 0.54);
}

html.theme-dark body:has(.note-body) .note-body .callout-icon-col,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-icon-col,
html.theme-dark body:has(.note-body) .note-body .note-callout::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::before {
  background: rgba(var(--callout-rgb), 0.16);
  border-color: rgba(var(--callout-rgb), 0.34);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.note-body) .note-body .note-callout > strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > strong {
  border-bottom-color: rgba(var(--callout-rgb), 0.26);
}

html.theme-dark body:has(.note-body) .note-body .note-worked-example,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-worked-example {
  background:
    linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.065), transparent 40%),
    rgba(8, 11, 18, 0.92);
  border-color: rgba(148, 163, 184, 0.15);
  border-left-color: rgba(var(--note-blue-rgb), 0.58);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .note-worked-example > h2,
html.theme-dark body:has(.note-body) .note-body .note-worked-example > h3,
html.theme-dark body:has(.note-body) .note-body .note-worked-example > h4,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-worked-example > h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-worked-example > h3,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-worked-example > h4 {
  background: rgba(13, 17, 28, 0.90);
  border-bottom-color: rgba(148, 163, 184, 0.12);
  color: rgba(var(--note-blue-rgb), 0.92);
}

html.theme-dark body:has(.note-body) .note-body .note-review-list,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-review-list,
html.theme-dark body:has(.note-body) .note-body .note-review-list > li,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-review-list > li {
  list-style: none;
}

html.theme-dark body:has(.note-body) .note-body .note-review-list > li::marker,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-review-list > li::marker {
  content: '';
  font-size: 0;
}

html.theme-dark body:has(.note-body) .note-body .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-review-list > li::before {
  background: transparent;
  color: inherit;
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-list > li::before {
  content: "\2713";
  background: rgba(var(--note-teal-rgb), 0.13);
  border: 1px solid rgba(var(--note-teal-rgb), 0.26);
  color: rgba(var(--note-teal-rgb), 0.96);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li::before {
  content: '';
  background: transparent;
  border-color: rgba(var(--note-blue-rgb), 0.32);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-panel {
  background:
    linear-gradient(90deg, rgba(var(--note-teal-rgb), 0.09), transparent 40%),
    rgba(8, 11, 18, 0.94);
  border-color: rgba(148, 163, 184, 0.16);
  border-left-color: rgba(var(--note-teal-rgb), 0.72);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll,
html.theme-dark body:has(.note-body) .note-body .note-figure,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure {
  background: rgba(7, 10, 16, 0.94);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption {
  background: rgba(12, 16, 25, 0.94);
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Final dark-mode premium study-note refinement.
   This file loads last, so these are the winning dark-mode colours.
   ═══════════════════════════════════════════════════════════════════════════ */

html.theme-dark body:has(.note-body) .note-body h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 {
  background: none;
  border-left: 0;
  color: #f5f7ff;
  -webkit-text-fill-color: #f5f7ff;
}

html.theme-dark body:has(.note-body) .note-body h2::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::before {
  background: linear-gradient(180deg, rgba(var(--note-blue-rgb), 0.88), rgba(201, 213, 232, 0.44));
  box-shadow: 0 0 0 1px rgba(var(--note-blue-rgb), 0.05);
}

html.theme-dark body:has(.note-body) .note-body h2::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::after {
  background: linear-gradient(90deg, rgba(var(--note-blue-rgb), 0.72), rgba(203, 213, 225, 0.26), transparent);
  opacity: 1;
}

html.theme-dark body:has(.note-body) .note-body h3,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3 {
  color: rgba(236, 242, 252, 0.98);
}

html.theme-dark body:has(.note-body) .note-body h3::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::before {
  background: rgba(var(--note-blue-rgb), 0.78);
  box-shadow: 0 0 0 3px rgba(var(--note-blue-rgb), 0.075);
}

html.theme-dark body:has(.note-body) .note-body h3::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::after {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.34), transparent);
}

html.theme-dark body:has(.note-body) .note-body h4,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h4 {
  color: rgba(199, 209, 225, 0.88);
  border-bottom-color: rgba(148, 163, 184, 0.11);
}

html.theme-dark body:has(.note-body) .note-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body p,
html.theme-dark body:has(.note-body) .note-body li,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body li {
  color: rgba(220, 227, 239, 0.91);
}

html.theme-dark body:has(.note-body) .note-body strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body strong {
  color: #fbfdff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.028);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 42%),
    rgba(8, 11, 18, 0.90);
  border-color: rgba(148, 163, 184, 0.145);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.026);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card::before {
  background: linear-gradient(180deg, rgba(var(--note-blue-rgb), 0.70), rgba(148, 163, 184, 0.20));
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-heading {
  color: rgba(227, 234, 248, 0.93);
  -webkit-text-fill-color: rgba(227, 234, 248, 0.93);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-subtitle,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-subtitle {
  color: rgba(160, 171, 190, 0.82);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-count,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-count,
html.theme-dark body:has(.note-body) .note-body .nt-objective-status,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status {
  background: rgba(148, 163, 184, 0.055);
  border-color: rgba(148, 163, 184, 0.095);
  color: rgba(196, 205, 221, 0.74);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-rule,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-rule {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), transparent);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-item,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-item {
  background: rgba(11, 15, 24, 0.88);
  border-color: rgba(148, 163, 184, 0.11);
  box-shadow: none;
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-check,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-check {
  border-color: rgba(var(--note-blue-rgb), 0.58);
  background: rgba(var(--note-blue-rgb), 0.045);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-copy,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-copy {
  color: rgba(232, 238, 249, 0.92);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"],
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"],
html.theme-dark body:has(.note-body) .note-body .note-callout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout {
  background:
    linear-gradient(90deg, rgba(var(--callout-rgb), 0.058), transparent 34%),
    rgba(8, 11, 18, 0.93);
  border-color: rgba(148, 163, 184, 0.145);
  border-left-color: rgba(var(--callout-rgb), 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.024),
    0 12px 34px rgba(0, 0, 0, 0.20);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"]::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"]::after,
html.theme-dark body:has(.note-body) .note-body .note-callout::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::after {
  background: linear-gradient(90deg, rgba(var(--callout-rgb), 0.36), rgba(148, 163, 184, 0.10), transparent);
}

html.theme-dark body:has(.note-body) .note-body .callout-icon-col,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-icon-col,
html.theme-dark body:has(.note-body) .note-body .note-callout::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::before {
  background: rgba(var(--callout-rgb), 0.105);
  border-color: rgba(var(--callout-rgb), 0.24);
  color: rgba(var(--callout-rgb), 0.92);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.note-body) .note-body .note-callout > strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > strong {
  color: rgba(var(--callout-rgb), 0.92);
  border-bottom-color: rgba(var(--callout-rgb), 0.19);
}

html.theme-dark body:has(.note-body) .note-body .callout-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-body p,
html.theme-dark body:has(.note-body) .note-body .note-callout > span,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > span {
  color: rgba(229, 236, 247, 0.92);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  background:
    linear-gradient(90deg, rgba(var(--note-amber-rgb), 0.095), transparent 35%),
    rgba(10, 11, 17, 0.95);
  border-left-color: rgba(var(--note-amber-rgb), 0.94);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-examiner,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-examiner,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--insight,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--insight {
  background:
    linear-gradient(90deg, rgba(var(--note-teal-rgb), 0.07), transparent 35%),
    rgba(8, 11, 18, 0.93);
  border-left-color: rgba(var(--note-teal-rgb), 0.76);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--out-of-scope {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.06), transparent 35%),
    rgba(8, 11, 18, 0.92);
  border-left-color: rgba(177, 188, 207, 0.52);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll {
  background: rgba(7, 10, 16, 0.96);
  border-color: rgba(148, 163, 184, 0.155);
  border-top-color: rgba(148, 163, 184, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.022);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll::before {
  background: linear-gradient(90deg, transparent, rgba(203, 213, 225, 0.14), transparent);
}

html.theme-dark body:has(.note-body) .note-body th,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body th {
  background: rgba(15, 19, 29, 0.98);
  border-bottom-color: rgba(148, 163, 184, 0.20);
  color: rgba(219, 228, 242, 0.90);
}

html.theme-dark body:has(.note-body) .note-body td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td {
  border-bottom-color: rgba(148, 163, 184, 0.11);
  color: rgba(222, 230, 242, 0.89);
}

html.theme-dark body:has(.note-body) .note-body td:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td:first-child {
  color: rgba(248, 250, 255, 0.96);
}

html.theme-dark body:has(.note-body) .note-body tbody tr:nth-child(even) td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.022);
}

html.theme-dark body:has(.note-body) .note-body .note-figure,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure {
  background: rgba(7, 10, 16, 0.94);
  border-color: rgba(148, 163, 184, 0.145);
  border-top-color: rgba(148, 163, 184, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.022);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 16, 25, 0.92);
  border-bottom-color: rgba(148, 163, 184, 0.13);
  color: rgba(199, 209, 225, 0.86);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption::before {
  content: 'Figure';
  flex-shrink: 0;
  color: rgba(148, 163, 184, 0.62);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html.theme-dark body:has(.note-body) .note-body .note-figure-img-area,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-img-area {
  background: rgba(255, 255, 255, 0.035);
}

html.theme-dark body:has(.note-body) .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-panel {
  background: rgba(8, 11, 18, 0.92);
  border-color: rgba(148, 163, 184, 0.145);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.024);
}

html.theme-dark body:has(.note-body) .note-review-panel::before,
html.theme-dark body:has(.noteviewer-body) .note-review-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--note-teal-rgb), 0.32), rgba(148, 163, 184, 0.09), transparent);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-panel {
  background:
    linear-gradient(90deg, rgba(var(--note-teal-rgb), 0.06), transparent 34%),
    rgba(8, 11, 18, 0.94);
  border-left-color: rgba(var(--note-teal-rgb), 0.70);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-kicker,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-kicker {
  color: rgba(var(--note-teal-rgb), 0.86);
}

html.theme-dark body:has(.note-body) .note-review-list,
html.theme-dark body:has(.noteviewer-body) .note-review-list,
html.theme-dark body:has(.note-body) .note-review-list > li,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li {
  list-style: none;
}

html.theme-dark body:has(.note-body) .note-review-list > li::marker,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li::marker {
  content: '';
  font-size: 0;
}

html.theme-dark body:has(.note-body) .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li::before {
  background: transparent;
  color: inherit;
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-list > li::before {
  content: "\2713";
  background: rgba(var(--note-teal-rgb), 0.12);
  border: 1px solid rgba(var(--note-teal-rgb), 0.25);
  color: rgba(var(--note-teal-rgb), 0.94);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li::before {
  content: '';
  border-color: rgba(var(--note-blue-rgb), 0.30);
}

html.theme-dark .sidebar-link.is-active .sidebar-node-title {
  color: rgba(244, 248, 255, 0.96);
}

html.theme-dark .sidebar-link::before {
  top: 50%;
  transform: translateY(-50%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Final premium study colour layer.
   Controlled educational colour on a midnight base; large surfaces stay dark.
   ═══════════════════════════════════════════════════════════════════════════ */

html.theme-dark body:has(.note-body),
html.theme-dark body:has(.noteviewer-body) {
  --study-bg: #05070d;
  --study-bg-soft: #080b13;
  --study-surface: rgba(10, 14, 23, 0.96);
  --study-surface-raised: rgba(14, 19, 31, 0.95);
  --study-surface-warm: rgba(16, 18, 24, 0.94);
  --study-text: #e7ecf6;
  --study-text-strong: #f5f7ff;
  --study-text-soft: #c5cede;
  --study-muted: #8d98ad;
  --study-faint: #667286;
  --study-blue: #6f8cff;
  --study-blue-rgb: 111, 140, 255;
  --study-blue-soft: rgba(111, 140, 255, 0.12);
  --study-blue-border: rgba(111, 140, 255, 0.28);
  --study-teal: #44d7c6;
  --study-teal-rgb: 68, 215, 198;
  --study-teal-soft: rgba(68, 215, 198, 0.12);
  --study-teal-border: rgba(68, 215, 198, 0.28);
  --study-amber: #f3bd63;
  --study-amber-rgb: 243, 189, 99;
  --study-amber-soft: rgba(243, 189, 99, 0.13);
  --study-amber-border: rgba(243, 189, 99, 0.32);
  --study-rose: #f28b8b;
  --study-rose-rgb: 242, 139, 139;
  --study-rose-soft: rgba(242, 139, 139, 0.10);
}

html.theme-dark body:has(.note-body) .noteviewer-main,
html.theme-dark body:has(.noteviewer-body) .noteviewer-main {
  background:
    radial-gradient(760px 360px at 54% 0%, rgba(var(--study-blue-rgb), 0.035), transparent 68%),
    radial-gradient(620px 300px at 82% 18%, rgba(var(--study-teal-rgb), 0.018), transparent 70%),
    var(--study-bg);
}

html.theme-dark body:has(.note-body) .note-body,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body {
  color: var(--study-text);
}

html.theme-dark body:has(.note-body) .note-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body p,
html.theme-dark body:has(.note-body) .note-body li,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body li {
  color: rgba(224, 232, 244, 0.94);
}

html.theme-dark body:has(.note-body) .note-body a,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body a {
  color: rgba(var(--study-blue-rgb), 0.92);
  text-decoration-color: rgba(var(--study-blue-rgb), 0.34);
}

html.theme-dark body:has(.note-body) .note-body a:hover,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body a:hover {
  color: #9db1ff;
  text-decoration-color: rgba(var(--study-blue-rgb), 0.56);
}

html.theme-dark body:has(.note-body) .note-body strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body strong {
  color: #ffffff;
  font-weight: 810;
  text-shadow: 0 0 14px rgba(var(--study-blue-rgb), 0.045);
}

html.theme-dark body:has(.note-body) .note-body em,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body em {
  color: rgba(205, 216, 232, 0.90);
}

html.theme-dark body:has(.note-body) .note-body ul,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ul {
  border-left-color: rgba(148, 163, 184, 0.15);
}

html.theme-dark body:has(.note-body) .note-body ul > li::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ul > li::before {
  color: rgba(var(--study-blue-rgb), 0.62);
}

html.theme-dark body:has(.note-body) .note-body ol > li::marker,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body ol > li::marker {
  color: rgba(var(--study-blue-rgb), 0.76);
}

html.theme-dark body:has(.note-body) .note-body h2,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 {
  color: var(--study-text-strong);
  -webkit-text-fill-color: var(--study-text-strong);
}

html.theme-dark body:has(.note-body) .note-body h2::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::before {
  background: linear-gradient(180deg, var(--study-blue), rgba(var(--study-teal-rgb), 0.62));
  box-shadow:
    0 0 0 1px rgba(var(--study-blue-rgb), 0.08),
    0 8px 18px rgba(var(--study-blue-rgb), 0.12);
}

html.theme-dark body:has(.note-body) .note-body h2::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::after {
  background: linear-gradient(90deg, rgba(var(--study-blue-rgb), 0.86), rgba(var(--study-teal-rgb), 0.30), rgba(148, 163, 184, 0.15), transparent);
}

html.theme-dark body:has(.note-body) .note-body h3,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3 {
  color: rgba(239, 245, 255, 0.99);
}

html.theme-dark body:has(.note-body) .note-body h3::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::before {
  background: var(--study-teal);
  box-shadow: 0 0 0 3px rgba(var(--study-teal-rgb), 0.10);
}

html.theme-dark body:has(.note-body) .note-body h3::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::after {
  background: linear-gradient(90deg, rgba(var(--study-teal-rgb), 0.38), rgba(148, 163, 184, 0.16), transparent);
}

html.theme-dark body:has(.note-body) .note-body h4,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h4 {
  color: rgba(209, 219, 235, 0.92);
  border-bottom-color: rgba(var(--study-blue-rgb), 0.18);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card {
  background:
    linear-gradient(90deg, rgba(var(--study-blue-rgb), 0.075), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 46%),
    var(--study-surface);
  border-color: rgba(var(--study-blue-rgb), 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    -10px 0 28px rgba(var(--study-blue-rgb), 0.045);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-card::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-card::before {
  background: linear-gradient(180deg, var(--study-blue), rgba(var(--study-teal-rgb), 0.44));
  box-shadow: 0 0 18px rgba(var(--study-blue-rgb), 0.20);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-heading,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-heading {
  color: rgba(238, 244, 255, 0.98);
  -webkit-text-fill-color: rgba(238, 244, 255, 0.98);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-subtitle,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-subtitle {
  color: rgba(190, 201, 219, 0.88);
}

html.theme-dark body:has(.note-body) .note-body .nt-objectives-count,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objectives-count {
  background: rgba(var(--study-blue-rgb), 0.055);
  border-color: rgba(var(--study-blue-rgb), 0.18);
  color: rgba(195, 208, 255, 0.82);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-item,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent),
    rgba(13, 18, 29, 0.94);
  border-color: rgba(148, 163, 184, 0.14);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-copy,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-copy {
  color: rgba(235, 241, 252, 0.96);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-check,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-check {
  border-color: rgba(var(--study-blue-rgb), 0.72);
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--study-blue-rgb), 0.14), transparent 54%),
    rgba(var(--study-blue-rgb), 0.045);
  box-shadow: 0 0 0 3px rgba(var(--study-blue-rgb), 0.045);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-status,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status {
  background: linear-gradient(180deg, rgba(var(--study-blue-rgb), 0.10), rgba(var(--study-blue-rgb), 0.045));
  border-color: rgba(var(--study-blue-rgb), 0.24);
  color: rgba(205, 216, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-status-icon,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status-icon {
  border-color: rgba(205, 216, 255, 0.78);
  color: rgba(205, 216, 255, 0.92);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-status-icon::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status-icon::after {
  opacity: 0.95;
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-key-point,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-key-point,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--exam-tip,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--exam-tip {
  --callout-rgb: var(--study-blue-rgb);
  --callout-ink: var(--study-blue);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-examiner,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-examiner,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--insight,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--insight {
  --callout-rgb: var(--study-teal-rgb);
  --callout-ink: var(--study-teal);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  --callout-rgb: var(--study-amber-rgb);
  --callout-ink: var(--study-amber);
}

html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--example,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--example {
  --callout-rgb: var(--study-blue-rgb);
  --callout-ink: var(--study-blue);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-out-of-scope,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--out-of-scope,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--out-of-scope {
  --callout-rgb: var(--study-rose-rgb);
  --callout-ink: var(--study-rose);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"],
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"],
html.theme-dark body:has(.note-body) .note-body .note-callout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout {
  background:
    linear-gradient(90deg, rgba(var(--callout-rgb), 0.105), rgba(var(--callout-rgb), 0.036) 36%, transparent 62%),
    var(--study-surface);
  border-color: rgba(148, 163, 184, 0.16);
  border-left-color: rgba(var(--callout-rgb), 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 12px 34px rgba(0, 0, 0, 0.18);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  background:
    linear-gradient(90deg, rgba(var(--study-amber-rgb), 0.15), rgba(var(--study-amber-rgb), 0.044) 39%, transparent 66%),
    var(--study-surface-warm);
  border-left-color: rgba(var(--study-amber-rgb), 0.98);
}

html.theme-dark body:has(.note-body) .note-body .callout-icon-col,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-icon-col,
html.theme-dark body:has(.note-body) .note-body .note-callout::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::before {
  background: rgba(var(--callout-rgb), 0.15);
  border-color: rgba(var(--callout-rgb), 0.34);
  color: rgba(var(--callout-rgb), 0.98);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"] .callout-body p:first-child > strong:first-child,
html.theme-dark body:has(.note-body) .note-body .note-callout > strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > strong {
  color: rgba(var(--callout-rgb), 0.98);
  border-bottom-color: rgba(var(--callout-rgb), 0.26);
}

html.theme-dark body:has(.note-body) .note-body .callout-body p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-body p,
html.theme-dark body:has(.note-body) .note-body .note-callout > span,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > span {
  color: rgba(236, 242, 251, 0.95);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll {
  background:
    linear-gradient(180deg, rgba(var(--study-blue-rgb), 0.035), transparent 120px),
    rgba(7, 10, 16, 0.97);
  border-color: rgba(148, 163, 184, 0.18);
  border-top-color: rgba(var(--study-blue-rgb), 0.26);
}

html.theme-dark body:has(.note-body) .note-body th,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body th {
  background: rgba(18, 24, 38, 0.98);
  border-bottom-color: rgba(var(--study-blue-rgb), 0.24);
  color: rgba(230, 237, 250, 0.94);
}

html.theme-dark body:has(.note-body) .note-body td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td {
  border-bottom-color: rgba(148, 163, 184, 0.125);
  color: rgba(226, 235, 248, 0.92);
}

html.theme-dark body:has(.note-body) .note-body td:first-child,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td:first-child {
  color: #f7faff;
  font-weight: 790;
}

html.theme-dark body:has(.note-body) .note-body tbody tr:nth-child(even) td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body tbody tr:nth-child(even) td {
  background: rgba(var(--study-blue-rgb), 0.024);
}

html.theme-dark body:has(.note-body) .note-body tbody tr:hover td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body tbody tr:hover td {
  background: rgba(var(--study-blue-rgb), 0.045);
}

html.theme-dark body:has(.note-body) .note-body .note-figure,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent),
    rgba(7, 10, 16, 0.96);
  border-color: rgba(148, 163, 184, 0.17);
  border-top-color: rgba(203, 213, 225, 0.22);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption {
  background:
    linear-gradient(90deg, rgba(var(--study-blue-rgb), 0.055), transparent 55%),
    rgba(13, 18, 28, 0.95);
  color: rgba(209, 219, 234, 0.90);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-caption::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-caption::before {
  color: rgba(var(--study-blue-rgb), 0.78);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-img-area,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-img-area {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.026)),
    rgba(255, 255, 255, 0.035);
}

html.theme-dark body:has(.note-body) .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), transparent 48%),
    var(--study-surface);
  border-color: rgba(148, 163, 184, 0.16);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-panel {
  background:
    linear-gradient(90deg, rgba(var(--study-teal-rgb), 0.105), transparent 42%),
    var(--study-surface);
  border-left-color: rgba(var(--study-teal-rgb), 0.78);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-panel,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-panel {
  background:
    linear-gradient(90deg, rgba(var(--study-blue-rgb), 0.085), transparent 42%),
    var(--study-surface);
  border-left-color: rgba(var(--study-blue-rgb), 0.66);
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-kicker,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-kicker {
  color: rgba(var(--study-teal-rgb), 0.96);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-kicker,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-kicker {
  color: rgba(var(--study-blue-rgb), 0.94);
}

html.theme-dark body:has(.note-body) .note-review-list,
html.theme-dark body:has(.noteviewer-body) .note-review-list,
html.theme-dark body:has(.note-body) .note-review-list > li,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li {
  color: rgba(231, 238, 249, 0.93);
  list-style: none;
}

html.theme-dark body:has(.note-body) .note-review-list > li::marker,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li::marker {
  content: '';
  font-size: 0;
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-list > li::before {
  content: "\2713";
  background: rgba(var(--study-teal-rgb), 0.17);
  border-color: rgba(var(--study-teal-rgb), 0.36);
  color: #7cf2e4;
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li::before {
  content: '';
  background: rgba(var(--study-blue-rgb), 0.055);
  border-color: rgba(var(--study-blue-rgb), 0.38);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li:hover::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li:hover::before {
  background: rgba(var(--study-blue-rgb), 0.105);
  border-color: rgba(var(--study-blue-rgb), 0.58);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li.is-checked::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li.is-checked::before {
  border-color: rgba(var(--study-teal-rgb), 0.56);
  background: rgba(var(--study-teal-rgb), 0.10);
}

html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li.is-checked::after,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li.is-checked::after {
  border-color: var(--study-teal);
}

/* Intermediate study-blue-tinted rail layer removed — superseded by the
   FINAL SIDEBAR LIFT block lower in this file. */

/* Final micro-polish: balance, density, and long-study readability. */
@media (min-width: 1025px) {
  html.theme-dark .nv-rail + .noteviewer-main .noteviewer-main-inner {
    padding-left: clamp(30px, 3vw, 40px);
    padding-right: clamp(34px, 4vw, 58px);
  }
}

html.theme-dark body:has(.note-body) .note-body h2::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), transparent 42%),
    linear-gradient(180deg, var(--study-blue), rgba(var(--study-teal-rgb), 0.58));
  box-shadow:
    0 0 0 1px rgba(var(--study-blue-rgb), 0.10),
    0 8px 20px rgba(var(--study-blue-rgb), 0.10);
}

html.theme-dark body:has(.note-body) .note-body h2::after,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2::after {
  background: linear-gradient(90deg, rgba(var(--study-blue-rgb), 0.76), rgba(var(--study-teal-rgb), 0.24), rgba(148, 163, 184, 0.13), transparent);
}

html.theme-dark body:has(.note-body) .note-body h3::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h3::before {
  background: rgba(var(--study-teal-rgb), 0.86);
  box-shadow: 0 0 0 3px rgba(var(--study-teal-rgb), 0.085);
}

html.theme-dark body:has(.note-body) .note-body blockquote[class^="callout-"],
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote[class^="callout-"],
html.theme-dark body:has(.note-body) .note-body .note-callout,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout {
  background:
    linear-gradient(90deg, rgba(var(--callout-rgb), 0.092), rgba(var(--callout-rgb), 0.030) 32%, transparent 58%),
    var(--study-surface);
  border-color: rgba(148, 163, 184, 0.155);
}

html.theme-dark body:has(.note-body) .note-body blockquote.callout-misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body blockquote.callout-misconception,
html.theme-dark body:has(.note-body) .note-body .note-callout.note-callout--misconception,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout.note-callout--misconception {
  background:
    linear-gradient(90deg, rgba(var(--study-amber-rgb), 0.13), rgba(var(--study-amber-rgb), 0.040) 38%, transparent 64%),
    var(--study-surface-warm);
}

html.theme-dark body:has(.note-body) .note-body .callout-icon-col,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .callout-icon-col,
html.theme-dark body:has(.note-body) .note-body .note-callout::before,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout::before {
  background: rgba(var(--callout-rgb), 0.135);
  border-color: rgba(var(--callout-rgb), 0.30);
}

html.theme-dark body:has(.note-body) .note-body .note-table-scroll,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-table-scroll {
  border-color: rgba(148, 163, 184, 0.19);
  border-top-color: rgba(var(--study-blue-rgb), 0.30);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.030),
    0 18px 50px rgba(0, 0, 0, 0.16);
}

html.theme-dark body:has(.note-body) .note-body th,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body th {
  background:
    linear-gradient(180deg, rgba(var(--study-blue-rgb), 0.060), transparent),
    rgba(18, 24, 38, 0.98);
  color: rgba(235, 241, 252, 0.95);
}

html.theme-dark body:has(.note-body) .note-body td,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body td {
  border-bottom-color: rgba(148, 163, 184, 0.135);
}

html.theme-dark body:has(.note-body) .note-body .note-figure,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure {
  border-color: rgba(148, 163, 184, 0.18);
  border-top-color: rgba(203, 213, 225, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.026),
    0 18px 46px rgba(0, 0, 0, 0.14);
}

html.theme-dark body:has(.note-body) .note-body .note-figure-img-area,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-figure-img-area {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.030)),
    rgba(255, 255, 255, 0.038);
}

html.theme-dark body:has(.note-body) .note-review-list,
html.theme-dark body:has(.noteviewer-body) .note-review-list,
html.theme-dark body:has(.note-body) .note-review-list > li,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li {
  list-style: none;
}

html.theme-dark body:has(.note-body) .note-review-list > li::marker,
html.theme-dark body:has(.noteviewer-body) .note-review-list > li::marker {
  content: '';
  font-size: 0;
}

html.theme-dark body:has(.note-body) .note-review-section--recap .note-review-list > li::before,
html.theme-dark body:has(.noteviewer-body) .note-review-section--recap .note-review-list > li::before {
  background: rgba(var(--study-teal-rgb), 0.16);
  border-color: rgba(var(--study-teal-rgb), 0.34);
}

html.theme-dark body:has(.note-body) .nt-objectives-card,
html.theme-dark body:has(.noteviewer-body) .nt-objectives-card {
  border-color: rgba(var(--study-blue-rgb), 0.17);
}

html.theme-dark body:has(.note-body) .note-body .nt-objective-status,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .nt-objective-status {
  background: linear-gradient(180deg, rgba(var(--study-blue-rgb), 0.095), rgba(var(--study-blue-rgb), 0.042));
  border-color: rgba(var(--study-blue-rgb), 0.25);
}

/* Pre-final dark sidebar pass removed — the FINAL SIDEBAR LIFT block below
   is the single source of truth for dark-mode rail colour. */

/* ════════════════════════════════════════════════════════════════════════════
   FINAL SIDEBAR LIFT — landing-page material parity (dark mode)
   theme-dark.css loads last; this section is the source of truth for the
   dark-mode rail. Lifts the rail off near-black and mirrors the landing-page
   card DNA (.lp-step-card / .lp-proof — layered navy gradient, slate borders,
   inset top highlight, subtle blue atmospheric glow).

   Colour system:
     – Whole sidebar = midnight navy + periwinkle + (teal only for the active
       indicator dot and the Questions resource).
     – Premium content = a small cool violet/platinum pill. The chapter row
       itself stays navy regardless of paid/free state — Premium is signalled
       by the pill only, never by recolouring the row.
   ════════════════════════════════════════════════════════════════════════════ */

html.theme-dark {
  /* Rail material — midnight navy aligned with the homepage / MCQ dark
     atmosphere. Less blue wash, more editorial black. */
  --rail-lift-bg-top: #0b1020;
  --rail-lift-bg-mid: #080d19;
  --rail-lift-bg-bottom: #050812;

  /* Card surfaces — calmer navy panels, closer to the homepage card DNA. */
  --rail-lift-card-top: rgba(13, 20, 38, 0.92);
  --rail-lift-card-bot: rgba(7, 12, 24, 0.96);

  /* Chapter row surfaces — closed rows feel like outline items, not buttons. */
  --rail-lift-closed: rgba(10, 16, 31, 0.44);
  --rail-lift-hover: rgba(129, 169, 255, 0.07);
  --rail-lift-open-top: rgba(25, 38, 68, 0.76);
  --rail-lift-open-bot: rgba(17, 27, 50, 0.82);

  /* Borders. */
  --rail-lift-border: rgba(148, 163, 184, 0.15);
  --rail-lift-border-strong: rgba(148, 163, 184, 0.22);
  --rail-lift-row-border: rgba(148, 163, 184, 0.08);
  --rail-lift-row-border-hover: rgba(129, 169, 255, 0.20);
  --rail-lift-row-border-open: rgba(129, 169, 255, 0.30);
  --rail-lift-accent-border: rgba(129, 169, 255, 0.30);
  --rail-lift-accent-border-strong: rgba(129, 169, 255, 0.32);

  /* Premium pill — cool platinum/periwinkle, used only on the pill itself. */
  --rail-lift-premium-grad-top: rgba(226, 232, 240, 0.12);
  --rail-lift-premium-grad-bot: rgba(129, 140, 248, 0.10);
  --rail-lift-premium-border: rgba(199, 210, 254, 0.26);
  --rail-lift-premium-border-hover: rgba(199, 210, 254, 0.42);
  --rail-lift-premium-text: #dbeafe;
  --rail-lift-premium-dot: #a5b4fc;
  --rail-lift-premium-icon: rgba(199, 210, 254, 0.86);
}

/* Rail surface — midnight navy with a very restrained blue crown.
   Editorial, not a blue slab. */
html.theme-dark .nv-rail,
html.theme-dark .nv-rail-drawer {
  background:
    radial-gradient(520px 220px at 50% -12%, rgba(59, 130, 246, 0.055), transparent 58%),
    linear-gradient(180deg, var(--rail-lift-bg-top) 0%, var(--rail-lift-bg-mid) 52%, var(--rail-lift-bg-bottom) 100%);
  border-right-color: rgba(148, 163, 184, 0.10);
  color: rgba(236, 241, 251, 0.92);
}

/* The .nv-rail-header element was retired with the sidebar back-action
   experiment — the rail starts directly with the Progress card. */

/* Cards — softer editorial panels, not stacked thick cards. */
html.theme-dark .nv-rail-card,
html.theme-dark .nv-progress-card,
html.theme-dark .nv-nav-card {
  border-color: var(--rail-lift-border);
  background: linear-gradient(180deg, var(--rail-lift-card-top) 0%, var(--rail-lift-card-bot) 100%);
  border-radius: 14px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

html.theme-dark .nv-progress-card {
  padding: 14px 16px;
}

html.theme-dark .nv-rail-card-label {
  color: #aebbd4;
  font-weight: 720;
}

html.theme-dark .nv-progress-row .nv-rail-card-label {
  color: #aebbd4;
}

html.theme-dark .nv-rail-progress-pct {
  color: #edf4ff;
  font-weight: 800;
}

html.theme-dark .nv-rail-progress-track,
html.theme-dark .nv-rail-mastery-track {
  height: 4px;
  background: rgba(148, 163, 184, 0.18);
  box-shadow: none;
  border-radius: 999px;
}

html.theme-dark .nv-rail-progress-fill,
html.theme-dark .nv-rail-mastery-fill {
  background: linear-gradient(90deg, #60a5fa 0%, #2dd4bf 100%);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.20);
  border-radius: 999px;
}

html.theme-dark .nv-rail-mastery-pct {
  color: #edf4ff;
  font-weight: 720;
}

html.theme-dark .nv-progress-icon {
  background: rgba(129, 140, 248, 0.10);
  border-color: rgba(129, 140, 248, 0.22);
  color: rgba(199, 210, 254, 0.92);
}

/* Premium pill — cool platinum/periwinkle access chip.
   Quiet and deliberate; the only place violet-tinted colour appears. */
html.theme-dark .sidebar-premium-pill {
  background: linear-gradient(180deg, var(--rail-lift-premium-grad-top) 0%, var(--rail-lift-premium-grad-bot) 100%);
  border: 1px solid var(--rail-lift-premium-border);
  color: var(--rail-lift-premium-text);
  font-size: 0.65625rem;         /* ~10.5px */
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 3px 7px;
  border-radius: 999px;
  box-shadow: none;
}

html.theme-dark .sidebar-premium-pill::before {
  background: var(--rail-lift-premium-dot);
  box-shadow: none;
}

html.theme-dark .sidebar-toggle.is-paid:hover .sidebar-premium-pill,
html.theme-dark .sidebar-link.is-paid:hover .sidebar-premium-pill {
  border-color: var(--rail-lift-premium-border-hover);
}

/* Exam badge in drawer head — subject tag, periwinkle (not a paid pill). */
html.theme-dark .nv-rail-exam-badge {
  background: rgba(129, 140, 248, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.26);
  color: #c7d2fe;
  font-weight: 720;
}

/* Closed chapter — clean outline, not a boxy mini-card. The row stays
   calm and almost transparent until hovered or opened so the panel feels
   like a structured study outline rather than a stack of buttons. */
html.theme-dark .sidebar-toggle {
  border: 1px solid var(--rail-lift-row-border);
  background: var(--rail-lift-closed);
  color: #d9e4f6;
  font-weight: 760;
  box-shadow: none;
}

html.theme-dark .sidebar-toggle .sidebar-node-title {
  color: #d9e4f6;
}

html.theme-dark .sidebar-toggle .sidebar-chapter-number {
  color: rgba(143, 160, 187, 0.86);
}

html.theme-dark .sidebar-toggle:hover {
  border-color: var(--rail-lift-row-border-hover);
  background: var(--rail-lift-hover);
  color: #f3f7ff;
}

html.theme-dark .sidebar-toggle:hover .sidebar-node-title {
  color: #f3f7ff;
}

html.theme-dark .sidebar-toggle:hover .sidebar-chapter-number {
  color: rgba(199, 210, 254, 0.94);
}

/* Open/current chapter — the strongest chapter-level state. Applies to any
   chapter (free or paid) when it is open; not tied to .is-paid. */
html.theme-dark .sidebar-toggle.open {
  border-color: var(--rail-lift-row-border-open);
  background: linear-gradient(180deg, var(--rail-lift-open-top) 0%, var(--rail-lift-open-bot) 100%);
  color: #f3f7ff;
  font-weight: 800;
  box-shadow:
    inset 2px 0 0 rgba(96, 165, 250, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

html.theme-dark .sidebar-toggle.open .sidebar-node-title {
  color: #f3f7ff;
  font-weight: 800;
}

html.theme-dark .sidebar-toggle.open .sidebar-chapter-number {
  color: rgba(199, 215, 255, 0.96);
}

/* Paid chapter — same navy outline material as a free chapter. Premium is
   signalled by the cool platinum pill only, never by recolouring the row. */
html.theme-dark .sidebar-toggle.is-paid {
  border-color: var(--rail-lift-row-border);
  background: var(--rail-lift-closed);
  color: #d9e4f6;
}

html.theme-dark .sidebar-toggle.is-paid:hover {
  border-color: var(--rail-lift-row-border-hover);
  background: var(--rail-lift-hover);
  color: #f3f7ff;
}

html.theme-dark .sidebar-toggle.is-paid.open {
  border-color: var(--rail-lift-row-border-open);
  background: linear-gradient(180deg, var(--rail-lift-open-top) 0%, var(--rail-lift-open-bot) 100%);
  color: #f3f7ff;
  font-weight: 800;
  box-shadow:
    inset 2px 0 0 rgba(96, 165, 250, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

html.theme-dark .sidebar-toggle.is-paid .sidebar-node-title,
html.theme-dark .sidebar-link.is-paid .sidebar-node-title {
  color: inherit;
}

/* Chevron — low contrast unless hover/open. */
html.theme-dark .sidebar-toggle-icon {
  color: rgba(165, 180, 252, 0.46);
  opacity: 1;
  transition: color 0.14s, transform 0.18s ease;
}

html.theme-dark .sidebar-toggle:hover .sidebar-toggle-icon,
html.theme-dark .sidebar-toggle.open .sidebar-toggle-icon {
  color: rgba(199, 210, 254, 0.94);
}

html.theme-dark .sidebar-toggle.is-paid .sidebar-toggle-icon {
  color: var(--rail-lift-premium-icon);
}

/* Topic rows. */
html.theme-dark .sidebar-link {
  color: #b7c3d6;
  font-weight: 650;
}

html.theme-dark .sidebar-link:hover {
  border-color: rgba(129, 169, 255, 0.20);
  background: rgba(129, 169, 255, 0.08);
  color: #eef3ff;
}

html.theme-dark .sidebar-link.is-paid {
  color: #b7c3d6;
}

html.theme-dark .sidebar-link.is-paid:hover {
  border-color: rgba(129, 169, 255, 0.20);
  background: rgba(129, 169, 255, 0.08);
  color: #eef3ff;
}

/* Active topic — strongest local state. Calm gradient + thin accent rule.
   Slightly quieter wash so the row reads as accented, not coloured. */
html.theme-dark .sidebar-link.is-active {
  border-color: rgba(125, 156, 255, 0.28);
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.14) 0%,
    rgba(45, 212, 191, 0.045) 100%
  );
  color: #f3f7ff;
  font-weight: 800;
  box-shadow: inset 2px 0 0 #60a5fa;
}

html.theme-dark .sidebar-link.is-active .sidebar-node-title {
  color: #f3f7ff;
  font-weight: 800;
}

html.theme-dark .sidebar-link.is-active::before {
  width: 6px;
  height: 6px;
  left: 6px;
  background: #5eead4;
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.13);
}

/* This-Chapter sub-tree actives. */
html.theme-dark .nv-this-card .nv-section-item--level-2:first-child > a,
html.theme-dark .nv-this-card .nv-section-item--level-2 > a.is-active {
  background: linear-gradient(180deg, var(--rail-lift-open-top), var(--rail-lift-open-bot));
  color: rgba(243, 247, 255, 0.96);
  box-shadow: inset 3px 0 0 rgba(129, 169, 255, 0.85);
}

html.theme-dark .nv-this-card .nv-section-item--level-3 > a.is-active,
html.theme-dark .nv-this-card .nv-section-item--level-3:first-of-type > a {
  background: rgba(26, 39, 68, 0.78);
  color: rgba(231, 238, 250, 0.96);
}

html.theme-dark .nv-this-card .nv-section-item--level-3 > a.is-active::before,
html.theme-dark .nv-this-card .nv-section-item--level-3:first-of-type > a::before {
  background: rgba(129, 169, 255, 0.88);
}

/* Child indent guide. */
html.theme-dark .sidebar-children {
  border-left-color: rgba(148, 163, 184, 0.12);
}

/* Scrollbar — slate/periwinkle, low contrast. */
html.theme-dark .nv-rail-nav,
html.theme-dark .nv-rail-drawer-nav,
html.theme-dark .nv-rail-sections {
  scrollbar-width: thin;
  scrollbar-color: rgba(165, 180, 252, 0.22) transparent;
}

html.theme-dark .nv-rail-nav::-webkit-scrollbar,
html.theme-dark .nv-rail-drawer-nav::-webkit-scrollbar,
html.theme-dark .nv-rail-sections::-webkit-scrollbar {
  width: 8px;
}

html.theme-dark .nv-rail-nav::-webkit-scrollbar-track,
html.theme-dark .nv-rail-drawer-nav::-webkit-scrollbar-track,
html.theme-dark .nv-rail-sections::-webkit-scrollbar-track {
  background: transparent;
}

html.theme-dark .nv-rail-nav::-webkit-scrollbar-thumb,
html.theme-dark .nv-rail-drawer-nav::-webkit-scrollbar-thumb,
html.theme-dark .nv-rail-sections::-webkit-scrollbar-thumb {
  background-color: rgba(165, 180, 252, 0.22);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

html.theme-dark .nv-rail-nav::-webkit-scrollbar-thumb:hover,
html.theme-dark .nv-rail-drawer-nav::-webkit-scrollbar-thumb:hover,
html.theme-dark .nv-rail-sections::-webkit-scrollbar-thumb:hover {
  background-color: rgba(165, 180, 252, 0.40);
}

/* Bottom practice dock — cleaner lifted navy panel, less button-heavy. */
html.theme-dark .nv-practice-card {
  background: linear-gradient(180deg, rgba(18, 27, 49, 0.94) 0%, rgba(13, 19, 38, 0.96) 100%);
  border-color: var(--rail-lift-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 22px rgba(0, 0, 0, 0.20);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

html.theme-dark .nv-action-item {
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(22, 31, 56, 0.78);
  color: #cdd5e6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

html.theme-dark .nv-action-item:hover {
  border-color: rgba(129, 169, 255, 0.26);
  background: rgba(28, 41, 72, 0.92);
  color: #f3f7ff;
  transform: translateY(-1px);
}

/* ── Resource shortcut accent identity ────────────────────────────────
   Each "Also Practice" shortcut carries a distinct tasteful resource
   colour so Notes and Flashcards never read as the same neutral button.
   At rest the border + background carry a very subtle tint of the
   accent (≤14% opacity) so the buttons remain dark/glassy. On hover the
   tint deepens slightly with no glow and no resize. */

/* Flashcards = soft periwinkle / blue-violet. */
html.theme-dark .nv-action-item--flashcards {
  border-color: rgba(129, 140, 248, 0.24);
  background:
    linear-gradient(180deg, rgba(129, 140, 248, 0.10) 0%, rgba(129, 140, 248, 0.05) 100%),
    rgba(22, 31, 56, 0.78);
}

html.theme-dark .nv-action-item--flashcards,
html.theme-dark .nv-action-item--flashcards .nv-action-icon {
  color: rgba(165, 180, 252, 0.95);
}

html.theme-dark .nv-action-item--flashcards:hover {
  border-color: rgba(129, 140, 248, 0.42);
  background:
    linear-gradient(180deg, rgba(129, 140, 248, 0.16) 0%, rgba(129, 140, 248, 0.08) 100%),
    rgba(28, 41, 72, 0.92);
}

html.theme-dark .nv-action-item--flashcards:hover,
html.theme-dark .nv-action-item--flashcards:hover .nv-action-icon {
  color: #e0e6ff;
}

/* Questions = refined teal / cyan. */
html.theme-dark .nv-action-item--questions {
  border-color: rgba(45, 212, 191, 0.24);
  background:
    linear-gradient(180deg, rgba(45, 212, 191, 0.10) 0%, rgba(45, 212, 191, 0.04) 100%),
    rgba(22, 31, 56, 0.78);
}

html.theme-dark .nv-action-item--questions,
html.theme-dark .nv-action-item--questions .nv-action-icon {
  color: rgba(94, 234, 212, 0.95);
}

html.theme-dark .nv-action-item--questions:hover {
  border-color: rgba(45, 212, 191, 0.42);
  background:
    linear-gradient(180deg, rgba(45, 212, 191, 0.16) 0%, rgba(45, 212, 191, 0.06) 100%),
    rgba(28, 41, 72, 0.92);
}

html.theme-dark .nv-action-item--questions:hover,
html.theme-dark .nv-action-item--questions:hover .nv-action-icon {
  color: #c8fff2;
}

/* Notes = refined warm amber / bronze. Distinct from the cool resources
   so Notes never reads as the same neutral button as Flashcards. */
html.theme-dark .nv-action-item--notes {
  border-color: rgba(245, 158, 11, 0.26);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.10) 0%, rgba(245, 158, 11, 0.04) 100%),
    rgba(22, 31, 56, 0.78);
}

html.theme-dark .nv-action-item--notes,
html.theme-dark .nv-action-item--notes .nv-action-icon {
  color: rgba(252, 191, 73, 0.95);
}

html.theme-dark .nv-action-item--notes:hover {
  border-color: rgba(245, 158, 11, 0.44);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.06) 100%),
    rgba(28, 41, 72, 0.92);
}

html.theme-dark .nv-action-item--notes:hover,
html.theme-dark .nv-action-item--notes:hover .nv-action-icon {
  color: #fde7b3;
}

/* Focus. */
html.theme-dark .sidebar-toggle:focus-visible,
html.theme-dark .sidebar-link:focus-visible,
html.theme-dark .nv-action-item:focus-visible,
html.theme-dark .nv-rail-trigger:focus-visible,
html.theme-dark .nv-rail-drawer-close:focus-visible {
  outline: 2px solid rgba(129, 169, 255, 0.55);
  outline-offset: 2px;
}

/* Mobile drawer trigger / head. */
html.theme-dark .nv-rail-trigger {
  background: linear-gradient(180deg, rgba(22, 33, 60, 0.96) 0%, rgba(16, 25, 48, 0.97) 100%);
  border-color: var(--rail-lift-border-strong);
  color: rgba(199, 210, 254, 0.94);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.theme-dark .nv-rail-drawer-head {
  background: linear-gradient(180deg, rgba(22, 33, 60, 0.97) 0%, rgba(14, 22, 42, 0.98) 100%);
  border-bottom-color: var(--rail-lift-border);
}

html.theme-dark .nv-rail-drawer-close {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--rail-lift-border);
  color: rgba(199, 210, 254, 0.86);
}

/* ════════════════════════════════════════════════════════════════════════════
   Resource viewer shell — shared lifted lane for every sidebar resource page
   ──────────────────────────────────────────────────────────────────────
   Any resource page that mounts the chapter rail (Notes, Flashcards,
   Topic Questions, MCQ, Videos, Summaries) gets the same premium reader
   shell around its main content column.  Scoped via :has(.nv-rail) so
   no-sidebar pages (topic landing, resource index) are excluded — they
   centre on their own without a contained workspace frame.

   Pages keep their internal component design (note body, flashcard study
   zone, question/MCQ cards, video embed) — this shell only contains
   them in the same outer workspace, not their inner surfaces.

   No heavy border, no hard card — just a gentle reading lane that makes
   the resource workspace feel cohesive across all resource types.
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  html.theme-dark .nv-canvas:has(.nv-rail) .noteviewer-main-inner {
    /* Near-black editorial reading lane — homepage/MCQ-aligned dark base,
       very restrained blue crown highlight. No purple wash, no hard card. */
    background:
      radial-gradient(760px 320px at 50% 0%, rgba(59, 130, 246, 0.045), transparent 64%),
      linear-gradient(180deg, rgba(7, 11, 21, 0.92) 0%, rgba(3, 6, 12, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.045);
    border-radius: 20px;
    padding-top: 30px;
    padding-bottom: 72px;
    padding-left: clamp(28px, 2.4vw, 44px);
    padding-right: clamp(28px, 2.4vw, 44px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.026);
  }
}
