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


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) {
}

/* ── 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(91,140,255,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(169,190,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) {
  /* Soft blue-slate body ink — the note body is the product, so the ink
     must read as confident and clear. 0.94 alpha is close to crisp white
     without losing the calm cool cast that keeps long sessions easy. */
  --note-ink: rgba(228, 236, 248, 0.94);
  --note-ink-strong: rgba(246, 249, 255, 0.98);
  --note-ink-soft: rgba(198, 210, 228, 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 {
  /* Bold terms must still scan as emphasis but never as chunky shouting.
     630 is the sweet spot — clearly heavier than body (400) yet not
     visually loud when six bolded terms land in one paragraph. The cool
     near-white tint distinguishes bold from body without going pure #fff. */
  color: rgba(236, 244, 255, 0.97);
  font-weight: 630;
  text-shadow: none;
}

/* Inline-callout labels (the ones from .note-callout > strong) are structural
   labels, not body emphasis — they must stay heavy. Restore the loud weight. */
html.theme-dark body:has(.note-body) .note-body .note-callout > strong,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body .note-callout > strong {
  font-weight: 800;
}

/* Section-entry lede: the first paragraph after a major h2 reads as the
   section's opening line. A faint clarity bump (no box, no decoration)
   gives the eye a soft anchor at the start of each section, which makes
   long prose feel guided rather than continuous. */
html.theme-dark body:has(.note-body) .note-body h2 + p,
html.theme-dark body:has(.noteviewer-body) .noteviewer-body h2 + p {
  color: rgba(238, 245, 255, 0.96);
}

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: "\2022";
  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: "\2022";
  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);
}


/* ═══════════════════════════════════════════════════════════════════════════
   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: "\2022";
  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.088), rgba(var(--study-blue-rgb), 0.025)),
    rgba(18, 24, 38, 0.98);
  color: rgba(228, 236, 252, 0.98);
  box-shadow: inset 0 1px 0 rgba(199, 212, 252, 0.10);
  border-bottom-color: rgba(var(--study-blue-rgb), 0.46);
}

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.10);
  border-top-color: rgba(203, 213, 225, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.030),
    0 6px 18px rgba(0, 0, 0, 0.08);
}

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(91, 140, 255, 0.10);
  --rail-lift-premium-border: rgba(190, 205, 255, 0.26);
  --rail-lift-premium-border-hover: rgba(190, 205, 255, 0.42);
  --rail-lift-premium-text: #dbeafe;
  --rail-lift-premium-dot: #a9beff;
  --rail-lift-premium-icon: rgba(190, 205, 255, 0.86);
}

/* Rail surface — midnight navy with a very restrained blue crown.
   Editorial, not a blue slab. */

/* 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. */


/* 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. */


/* Open/current chapter — the strongest chapter-level state. Applies to any
   chapter (free or paid) when it is open; not tied to .is-paid. */


/* Topic rows. */


/* Active topic — strongest local state. Calm gradient + thin accent rule.
   Slightly quieter wash so the row reads as accented, not coloured. */


/* This-Chapter sub-tree actives. */

/* Child indent guide. */

/* Scrollbar — slate/periwinkle, low contrast. */

/* Focus. */

/* Mobile drawer trigger / head. */


/* ════════════════════════════════════════════════════════════════════════════
   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);
  }
}


/* =========================================================================
   Notes textbook reader — dark-mode parity.
   theme-dark.css loads after noteviewer.css. The h3-dot/hairline override has
   to out-specify earlier `html.theme-dark body:has(.note-body) .note-body
   h3::before` (specificity 0,3,4), so each rule below uses the same
   `body:has(.note-body--notes)` wrapper. Concept-panel rules from the previous
   pass were removed wholesale — concept paragraphs now flow as plain prose.
   ========================================================================= */

html.theme-dark .note-body--notes {
  --notes-reader-strong: rgba(248, 251, 255, 0.98);
  --notes-reader-soft: rgba(181, 194, 216, 0.78);
  --notes-reader-indigo: 148, 163, 244;
  --notes-reader-term: 198, 215, 250;
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > p {
  /* Calm soft blue-slate, but clearly present — body ink must feel
     confident on the midnight panel for long-session reading. */
  color: rgba(226, 235, 248, 0.94);
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > h3 {
  color: rgba(237, 243, 253, 0.98);
  text-shadow: none;
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > h3::before {
  background: rgba(var(--notes-reader-indigo), 0.92);
  box-shadow: 0 0 0 3px rgba(var(--notes-reader-indigo), 0.10);
}

/* The h3 hairline-below uses the noteviewer.css default gradient (slate with
   a leading indigo accent). Dark mode just inherits that. No override needed. */

html.theme-dark body:has(.note-body--notes) .note-body--notes > p.note-lead {
  color: rgba(232, 239, 252, 0.94);
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > p.note-lead > strong {
  color: var(--notes-reader-strong);
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > p.note-concept > strong:first-child {
  color: rgb(var(--notes-reader-term));
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > p.note-concept .note-concept-def {
  /* Soft indigo wash + hairline edge — the gloss visually separates from
     the term + definition body without becoming a UI element. */
  color: rgba(190, 204, 226, 0.84);
  background: rgba(91, 140, 255, 0.055);
  box-shadow: inset 0 0 0 1px rgba(169, 190, 255, 0.10);
}

html.theme-dark body:has(.note-body--notes) .note-body--notes > p > strong,
html.theme-dark body:has(.note-body--notes) .note-body--notes > ul strong,
html.theme-dark body:has(.note-body--notes) .note-body--notes > ol strong {
  color: rgba(223, 234, 250, 0.94);
}

/* =========================================================================
   Summaries — dark mode
   Summaries flow through the shared notes editorial prose system (article
   width, .note-prose-surface, signature h2 rail + bottom hairline, signature
   h3 dot+trailing-rule, .note-lead voice, brand-blue strong, etc.) declared
   in noteviewer.css under the .note-body--{notes,summaries} selector pairs.
   The only summary-specific dark-mode style left is the KEY DEFINITION
   callout-definition card, which also lives in noteviewer.css.

   This block is intentionally empty: every prior version that re-declared
   summary rules here overrode the shared system at higher specificity and
   broke the design. Keep it empty unless adding a truly theme-dark-only
   summary affordance with no equivalent in noteviewer.css.
   ========================================================================= */

/* =========================================================================
   Quick Recap — bullets, not checkmarks
   Render the recap list marker as a standard disc bullet (•) in dark mode,
   dropping the boxed-checkmark (✓) treatment from the earlier passes above.
   Mirrors the light-mode change in noteviewer.css (content: "\2022"). Last
   in source order so it wins over every prior recap-bullet pass.
   ========================================================================= */
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: "\2022";
  background: none;
  border-color: transparent;
}

/* Progress-check SVG checkbox — match the dark teal/blue of the legacy pseudo box. */
html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list .esa-check-box,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list .esa-check-box {
  stroke: rgba(var(--study-blue-rgb), 0.38);
  fill: rgba(var(--study-blue-rgb), 0.055);
}
html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li:hover .esa-check-box,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li:hover .esa-check-box {
  stroke: rgba(var(--study-blue-rgb), 0.58);
  fill: rgba(var(--study-blue-rgb), 0.105);
}
html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list > li.is-checked .esa-check-box,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list > li.is-checked .esa-check-box {
  stroke: rgba(var(--study-teal-rgb), 0.56);
  fill: rgba(var(--study-teal-rgb), 0.10);
}
html.theme-dark body:has(.note-body) .note-review-section--progress .note-review-list .esa-check-tick,
html.theme-dark body:has(.noteviewer-body) .note-review-section--progress .note-review-list .esa-check-tick {
  stroke: var(--study-teal);
}
