/* ===========================================================
   OM Midterm Study System — Technical Editorial Design Language
   Inspired by Technical Documentation × Editorial Typography × Cinematic Minimalism
   Palette: Monochrome Deep Obsidian (#050505), Raw Technical Grid, Minimal Accents
   Typography: Inter / Geist (Large Light 400 Headings, 0.18em Tracking Micro-Labels)
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Geist:wght@300;400;500;600&family=Inter:wght@300;400;500;600&display=swap');

/* ---------- System Tokens & Monochrome Themes ---------- */
:root {
  /* Typography */
  --font-display: 'Inter', 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: 'Inter', 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Geist Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Dark Theme — Primary Default Theme */
  --bg: #050505;
  --bg-secondary: #080808;
  --bg-surface: #0B0B0B;
  --bg-elevated: #101010;
  --bg-sidebar: #060606;
  --bg-card: #0B0B0B;
  --bg-code: #0E0E0E;

  --border: #242424;
  --border-subtle: #171717;
  --border-strong: #383838;
  --border-focus: #E8E8E8;

  --text: #F1F1F1;
  --text-secondary: #A1A1A1;
  --text-muted: #666666;
  --text-faint: #444444;
  --text-soft: #A1A1A1;

  --accent: #E8E8E8;
  --accent-hover: #FFFFFF;
  --accent-light: #F1F1F1;
  --accent-subtle: rgba(255, 255, 255, 0.04);
  --accent-border: #2E2E2E;

  /* Subtle Meaning-Only Status Colors */
  --success: #8FAF9A;
  --success-bg: rgba(143, 175, 154, 0.08);
  --success-border: #2A3830;
  --success-text: #B4CEBD;

  --warning: #B5A16A;
  --warning-bg: rgba(181, 161, 106, 0.08);
  --warning-border: #3A3320;
  --warning-text: #D6C492;

  --danger: #A56A6A;
  --danger-bg: rgba(165, 106, 106, 0.08);
  --danger-border: #382222;
  --danger-text: #CCA0A0;

  --info: #8A9BA8;
  --info-bg: rgba(138, 155, 168, 0.08);
  --info-border: #222E38;
  --info-text: #B2C4D0;

  /* Academic Study Component Styles */
  --exam: #8FAF9A;
  --exam-bg: #0A0E0B;
  --exam-border: #1F2E24;
  --exam-text: #C1DACB;

  --warn: #B5A16A;
  --warn-bg: #0E0C07;
  --warn-border: #2C2615;
  --warn-text: #D6C492;

  --case: #8A9BA8;
  --case-bg: #080C0F;
  --case-border: #18222A;
  --case-text: #B2C4D0;

  --textbook: #A1A1A1;
  --textbook-bg: #0A0A0A;
  --textbook-border: #242424;
  --textbook-text: #E0E0E0;

  --lecture: #A1A1A1;
  --lecture-bg: #0A0A0A;
  --lecture-border: #242424;
  --lecture-text: #E0E0E0;

  --core-badge-bg: #141414;
  --core-badge-text: #F1F1F1;
  --supporting-badge-bg: #0A0A0A;
  --supporting-badge-text: #888888;

  /* Architectural Radii & Grid Dimensions */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;

  --sidebar-w: 260px;
  --toc-w: 230px;
  --header-h: 54px;
  --content-max-w: 1080px;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode (Technical Paper / Editorial Print) */
:root[data-theme="light"] {
  --bg: #F9F9FB;
  --bg-secondary: #F3F4F6;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-sidebar: #F9F9FB;
  --bg-card: #FFFFFF;
  --bg-code: #F0F2F5;

  --border: #E0E2E7;
  --border-subtle: #ECEEF2;
  --border-strong: #C4C8D0;
  --border-focus: #111111;

  --text: #11141A;
  --text-secondary: #525866;
  --text-muted: #868C98;
  --text-faint: #B0B5BF;
  --text-soft: #525866;

  --accent: #11141A;
  --accent-hover: #000000;
  --accent-light: #333333;
  --accent-subtle: rgba(0, 0, 0, 0.04);
  --accent-border: #D0D4DC;

  --success: #2E6B47;
  --success-bg: #F0F7F3;
  --success-border: #D1E7DA;
  --success-text: #1E4E32;

  --warning: #7D5F18;
  --warning-bg: #FDF9EE;
  --warning-border: #F3E6C4;
  --warning-text: #5A430E;

  --danger: #8C3333;
  --danger-bg: #FDF2F2;
  --danger-border: #F5D3D3;
  --danger-text: #6B2222;

  --info: #355773;
  --info-bg: #F2F7FA;
  --info-border: #D0E1EC;
  --info-text: #233D52;

  --exam: #2E6B47;
  --exam-bg: #F4FAF6;
  --exam-border: #D5EBDD;
  --exam-text: #1E4E32;

  --warn: #7D5F18;
  --warn-bg: #FDF9EE;
  --warn-border: #F3E6C4;
  --warn-text: #5A430E;

  --case: #355773;
  --case-bg: #F2F7FA;
  --case-border: #D0E1EC;
  --case-text: #233D52;

  --textbook: #525866;
  --textbook-bg: #F5F6F8;
  --textbook-border: #E0E2E7;
  --textbook-text: #11141A;

  --lecture: #525866;
  --lecture-bg: #F5F6F8;
  --lecture-border: #E0E2E7;
  --lecture-text: #11141A;

  --core-badge-bg: #11141A;
  --core-badge-text: #FFFFFF;
  --supporting-badge-bg: #ECEEF2;
  --supporting-badge-text: #525866;
}

/* ===========================================================
   Base Reset & Subtle Technical Grid Texture
   =========================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.72;
  letter-spacing: -0.01em;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

/* Headings: Large, Thin/Regular (400–500), Negative Tracking */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

code {
  background: var(--bg-code);
  color: var(--text);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  font-weight: 400;
}

/* ===========================================================
   Top Header (Compact, Technical, 1px Border)
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.header-brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.header-brand .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}
.menu-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-focus);
}

.header-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.15s ease;
}

.header-search input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.header-search input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--border-focus);
}

.header-search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  background: var(--bg-surface);
  pointer-events: none;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--border-focus);
}

/* ===========================================================
   Search Results (Minimal Technical Command Dropdown)
   =========================================================== */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 80;
  padding: 6px;
}

.search-results.open {
  display: block;
}

.search-results .sr-item {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.12s ease;
}
.search-results .sr-item:last-child {
  border-bottom: none;
}
.search-results .sr-item:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.sr-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
}
.sr-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sr-snippet {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.45;
}
.sr-empty {
  padding: 24px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}

mark {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
}

/* ===========================================================
   Layout Shell (Structural Grid Divisions)
   =========================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  width: 100%;
  max-width: 100%;
  margin: 0;
  align-items: start;
  border-left: none;
  border-right: none;
  background: var(--bg);
}

@media (max-width: 1200px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .page-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    border-left: none;
    border-right: none;
  }
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: block;
  }
  .menu-toggle {
    display: flex;
  }
}

/* ===========================================================
   Sidebar (Narrow, Typography-Driven, 1px Grid Border)
   =========================================================== */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 24px 12px 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 84vw;
    max-width: 300px;
    z-index: 70;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    background: var(--bg-surface);
  }
}

.sb-group {
  margin-bottom: 6px;
}

.sb-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}

.sb-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  transition: all 0.12s ease;
  position: relative;
}

.sb-link .num {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  min-width: 16px;
  font-weight: 500;
}

.nav-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  position: relative;
  top: 2px;
}

.sb-link:hover {
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
}

.sb-link.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 500;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.sb-link.active .num,
.sb-link.active .nav-icon {
  color: var(--text);
}

.sb-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 14px 8px;
}

/* ===========================================================
   Center Reading Column (Editorial Canvas)
   =========================================================== */
.content-col {
  min-width: 0;
  padding: 48px 72px 140px;
  max-width: var(--content-max-w);
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1100px) {
  .content-col {
    padding: 36px 40px 100px;
  }
}

@media (max-width: 900px) {
  .content-col {
    padding: 28px 20px 70px;
    max-width: 100%;
  }
}

/* Secondary Navigation / Breadcrumbs (Tiny Uppercase 0.18em) */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs a {
  color: var(--text-muted);
}
.breadcrumbs a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero Section: Large, Thin/Regular (400), Highly Readable */
.page-title {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--text);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  margin: 0 0 32px;
}

.page-subtitle.lead {
  font-size: 17px;
  color: var(--text-secondary);
}

/* Micro Badges (Uppercase, Technical) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.badge-core {
  background: var(--core-badge-bg);
  color: var(--core-badge-text);
  border-color: var(--border-strong);
}

.badge-supporting {
  background: var(--supporting-badge-bg);
  color: var(--supporting-badge-text);
  border-color: var(--border);
}

/* Unit Meta Bar (Technical 1px Divider Row) */
.unit-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px 20px;
  margin: 24px 0 40px;
}

.unit-meta-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.unit-meta-bar b {
  color: var(--text);
  font-weight: 500;
}

/* ===========================================================
   Editorial Prose & Structural Sections (No Cards Everywhere)
   =========================================================== */
.prose {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text);
}

.prose h2 {
  font-size: 26px;
  font-weight: 400;
  margin: 56px 0 16px;
  padding-top: 8px;
  scroll-margin-top: 76px;
  letter-spacing: -0.025em;
  color: var(--text);
}

.prose h2.concept-title {
  font-size: 24px;
  font-weight: 400;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-top: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  letter-spacing: -0.02em;
}

.prose h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin: 36px 0 12px;
  scroll-margin-top: 76px;
  display: flex;
  align-items: center;
}

.prose h3 .step-no {
  color: var(--text-secondary);
  margin-right: 8px;
  font-weight: 600;
}

.prose p {
  margin: 0 0 18px;
  color: var(--text);
}

.prose ul, .prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
  color: var(--text);
}

.prose strong {
  font-weight: 600;
  color: var(--text);
}

/* Simple Explanation (Subtle Border & Whitespace, No Card Bloat) */
.simple-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.simple-box b {
  color: var(--text);
  font-weight: 600;
}

/* Editorial Structural Cards (Restrained) */
.card {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  margin: 0 0 24px;
}

.card-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

/* Exam-Ready Answer (Editorial Monospace Bordered Box) */
.exam-card {
  background: var(--exam-bg);
  border: 1px solid var(--exam-border);
  position: relative;
}

.exam-card .card-title {
  color: var(--exam-text);
  font-weight: 600;
}

.exam-card p:last-child {
  margin-bottom: 0;
}

/* Example Card */
.example-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.example-card .tag-illustrative {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Common Mistakes / Warning Callout */
.mistakes-card {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
}

.mistakes-card .card-title {
  color: var(--warn-text);
  font-weight: 600;
}

/* Case Card */
.case-card {
  background: var(--case-bg);
  border: 1px solid var(--case-border);
}

.case-card .card-title {
  color: var(--case-text);
  font-weight: 600;
}

/* Source Reference Card (Editorial Bottom Reference) */
.source-card {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin: 32px 0 16px;
}

.source-card .card-title {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.source-card .src-line {
  margin: 4px 0;
  line-height: 1.6;
}

.source-card .src-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Figure / Image Container (Editorial Figure 01.01) */
.figure-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: var(--bg-surface);
  margin: 24px 0 32px;
  text-align: center;
}

.figure-card img {
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  margin: 0 auto;
}

.figure-card .fig-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 14px;
  letter-spacing: 0.04em;
}

.figure-card .fig-source {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

/* Formula Block (Technical Mathematical Block) */
.formula-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 16px 20px;
  margin: 16px 0 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  overflow-x: auto;
  /* Formulas are authored one step per line — preserve those newlines. */
  white-space: pre;
}

.formula-block .fvar {
  color: var(--text);
  font-weight: 600;
}

/* High-Precision Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 30px;
  font-size: 14px;
  border: 1px solid var(--border);
}

th, td {
  border: 1px solid var(--border);
  padding: 10px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

td {
  background: var(--bg);
  color: var(--text);
}

tr:nth-child(even) td {
  background: var(--bg-secondary);
}

/* QA List */
.qa-list {
  list-style: none;
  padding-left: 0;
}

.qa-list li {
  padding: 12px 0 12px 28px;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
}

.qa-list li:last-child {
  border-bottom: none;
}

.qa-list li::before {
  content: "Q.";
  position: absolute;
  left: 0;
  top: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}

/* ===========================================================
   Page TOC (Right Sidebar, Subtle Technical Index)
   =========================================================== */
.page-toc {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 28px 16px 48px;
  font-size: 12.5px;
  scrollbar-width: thin;
}

.page-toc .toc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.page-toc a {
  display: block;
  padding: 5px 0 5px 10px;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.4;
  transition: all 0.12s ease;
}

.page-toc a:hover {
  color: var(--text);
  border-left-color: var(--text-muted);
  text-decoration: none;
}

.page-toc a.active {
  color: var(--text);
  border-left-color: var(--accent);
  font-weight: 500;
}

.page-toc a.toc-sub {
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===========================================================
   Unit Grid & Technical Node Cards (Homepage)
   =========================================================== */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 24px 0 44px;
}

.unit-card {
  padding: 20px 22px;
  background: var(--bg-surface);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.unit-card:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.unit-card .u-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.unit-card .u-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
  margin: 6px 0 8px;
  letter-spacing: -0.015em;
}

.unit-card .u-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.quick-links-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 20px 0 40px;
}

.quick-link-card {
  padding: 16px 20px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  transition: all 0.15s ease;
}

.quick-link-card:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.quick-link-card .qc-emoji {
  font-size: 16px;
}

/* Revision Blocks */
.rev-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 24px;
  margin-bottom: 20px;
  background: var(--bg-surface);
}

.rev-block h3 {
  margin-top: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
  color: var(--text);
  text-transform: none;
  font-weight: 500;
}

.rev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 30px;
}

@media (max-width: 640px) {
  .rev-grid {
    grid-template-columns: 1fr;
  }
}

.rev-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-top: 14px;
}

.kw-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  margin: 4px 4px 0 0;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 26px;
}

.filter-tab {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.q-group {
  margin-bottom: 38px;
}

.q-group-title {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 12px;
}

/* Footer Unit Pager */
.unit-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.pager-link {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px 18px;
  flex: 1;
  max-width: 48%;
  background: var(--bg-surface);
  transition: all 0.15s ease;
}

.pager-link:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  text-decoration: none;
}

.pager-link .pg-dir {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
}

.pager-link .pg-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text);
  margin-top: 3px;
}

.pager-link.next {
  text-align: right;
  margin-left: auto;
}

/* Utility classes */
.hr-soft {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.text-faint {
  color: var(--text-muted);
}

.mt-0 {
  margin-top: 0;
}

/* ===========================================================
   SOURCE VIEWER — Right-side document panel
   Opens the exact textbook page / lecture slide a section cites.
   =========================================================== */

:root {
  --sv-w: 540px;
}

/* Clickable citation chip inside source cards, figure captions, prose */
.src-ref {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  margin: 0 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  vertical-align: baseline;
  white-space: nowrap;
}
.src-ref:hover,
.src-ref:focus-visible {
  border-color: var(--border-focus);
  color: var(--text);
  background: var(--accent-subtle);
  text-decoration: none;
  outline: none;
}
.src-ref::before {
  content: "";
  width: 9px;
  height: 11px;
  flex: none;
  border: 1.2px solid currentColor;
  border-radius: 1px;
  border-left-width: 2.5px;
  opacity: 0.75;
}
.src-ref.is-active {
  border-color: var(--border-focus);
  color: var(--text);
  background: var(--accent-subtle);
}

/* Panel shell */
.source-viewer {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: var(--sv-w);
  max-width: 100vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.28s var(--ease-spring);
  visibility: hidden;
}
.source-viewer.open {
  transform: translateX(0);
  visibility: visible;
}

/* Push page content aside on wide screens so nothing sits under the panel.
   The reading column keeps its measure; the on-this-page rail is collapsed
   (see the rule further down) since the panel takes over that side. */
@media (min-width: 1100px) {
  body.sv-open .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--sv-w);
  }
}
@media (max-width: 1099px) {
  .source-viewer { width: 100vw; }
}

/* Drag handle to resize */
.sv-resize {
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 2;
}
.sv-resize:hover { background: var(--accent-subtle); }
@media (max-width: 1099px) { .sv-resize { display: none; } }

/* Header */
.sv-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex: none;
}
.sv-kind {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  display: inline-block;
  margin-bottom: 6px;
}
.sv-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.sv-title { min-width: 0; flex: 1; }
.sv-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.sv-close:hover { color: var(--text); border-color: var(--border-focus); }

/* Toolbar */
.sv-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex: none;
  flex-wrap: wrap;
}
.sv-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 26px;
  min-width: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, opacity 0.15s;
}
.sv-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-focus); }
.sv-btn:disabled { opacity: 0.32; cursor: default; }
.sv-locator {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.06em;
  padding: 0 6px;
  white-space: nowrap;
}
.sv-spacer { flex: 1 1 auto; }
.sv-open-original {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  white-space: nowrap;
}
.sv-open-original:hover { color: var(--text); border-color: var(--border-focus); text-decoration: none; }

/* Body / image stage */
.sv-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px;
  background: var(--bg-secondary);
  text-align: center;
}
.sv-stage img {
  max-width: 100%;
  width: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #FFFFFF;
  box-shadow: 0 2px 14px rgba(0,0,0,0.18);
}
.sv-stage.zoomed img {
  max-width: none;
}
.sv-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  line-height: 1.6;
  padding: 12px 16px 4px;
  text-align: left;
  border-top: 1px solid var(--border-subtle);
  margin-top: 12px;
}
.sv-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 48px 20px;
  line-height: 1.8;
}

/* Backdrop on small screens */
.sv-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 85;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
@media (max-width: 1099px) {
  body.sv-open .sv-backdrop { opacity: 1; visibility: visible; }
}

@media print {
  .source-viewer, .sv-backdrop { display: none !important; }
}

/* Collapse the on-this-page rail while the document panel is open. */
@media (min-width: 1100px) {
  body.sv-open .page-toc {
    display: none;
  }
}

/* ===========================================================
   Mid-term additions — exam briefing, point-wise answers,
   video cards, scope banners.
   =========================================================== */

/* ---------- Scope banner ---------- */
.scope-banner {
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  border-radius: 3px;
  padding: 16px 18px;
  margin: 0 0 26px;
}
.scope-banner .sb-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warn-text);
  margin-bottom: 8px;
}
.scope-banner p { margin: 0 0 8px; font-size: 14px; }
.scope-banner p:last-child { margin-bottom: 0; }

/* ---------- In-scope / out-of-scope pills ---------- */
.scope-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
  margin-left: 8px;
  white-space: nowrap;
}
.scope-pill.in  { border-color: var(--exam-border); background: var(--exam-bg); color: var(--exam-text); }
.scope-pill.out { border-color: var(--border); background: var(--bg-code); color: var(--text-muted); }

/* ---------- Point-wise exam answer ---------- */
.point-answer {
  border: 1px solid var(--exam-border);
  background: var(--exam-bg);
  border-radius: 3px;
  padding: 20px 22px 18px;
  margin: 0 0 18px;
}
.point-answer > .card-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--exam-text);
  margin-bottom: 14px;
}
.point-answer .pa-lead {
  font-size: 14px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--exam-border);
}
.point-answer h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 16px 0 7px;
  color: var(--text);
}
.point-answer h4:first-of-type { margin-top: 0; }
.point-answer ul, .point-answer ol { margin: 0 0 10px; padding-left: 20px; }
.point-answer li { margin-bottom: 5px; font-size: 14px; line-height: 1.6; }
.point-answer li:last-child { margin-bottom: 0; }
.point-answer table { margin: 6px 0 12px; font-size: 13px; }
.point-answer .pa-close {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--exam-border);
  font-size: 13.5px;
  font-style: italic;
  color: var(--text-secondary);
}

/* Marks hint strip inside a point answer */
.pa-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.pa-marks b { color: var(--text-secondary); font-weight: 500; }

/* ---------- Video cards ---------- */
.video-card { border-color: var(--border); }
.video-list { list-style: none; margin: 0; padding: 0; }
.video-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.video-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.video-list li > span:last-child { display: block; }
.v-lang {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  margin-top: 2px;
  min-width: 44px;
  text-align: center;
}
.v-chan {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 2px;
}
.video-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Briefing page quote ---------- */
.quote-block {
  border-left: 2px solid var(--border-strong);
  padding: 4px 0 4px 16px;
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--text-secondary);
  font-style: italic;
}
.quote-block .q-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  font-style: normal;
  margin-top: 6px;
}

/* ---------- Pattern table emphasis ---------- */
table.pattern-table td:first-child { white-space: nowrap; font-weight: 500; }

/* ---------- "Open full deck" buttons in the unit meta bar ---------- */
.unit-meta-bar .meta-ppt-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.unit-meta-bar .meta-ppt-group > .mp-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Sits on .src-ref so it drives the source viewer, but reads as a button. */
.src-ref.meta-ppt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  padding: 6px 11px;
  margin: 0;
  gap: 8px;
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
}
.src-ref.meta-ppt:hover,
.src-ref.meta-ppt:focus-visible {
  border-color: var(--border-focus);
  background: var(--accent-subtle);
}
/* Replace the small document glyph with a slide/deck glyph. */
.src-ref.meta-ppt::before {
  width: 13px;
  height: 10px;
  border-width: 1.3px;
  border-left-width: 1.3px;
  border-radius: 1.5px;
  opacity: 0.65;
}
.src-ref.meta-ppt .mp-count {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

@media (max-width: 900px) {
  .unit-meta-bar .meta-ppt-group { margin-left: 0; width: 100%; }
}

/* ===========================================================
   Collapsible sidebar
   The grid columns all read --sidebar-w, so zeroing that one
   variable collapses the rail everywhere it is referenced
   (including the source-viewer layout) without duplicating rules.
   =========================================================== */
@media (min-width: 861px) {
  body.nav-collapsed { --sidebar-w: 0px; }
  /* Keep the rail as a grid item so the content and TOC columns stay in
     their tracks — collapse it to zero width instead of removing it. */
  body.nav-collapsed .sidebar {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
    border-right: 0;
  }
  body.nav-collapsed .sidebar > * { display: none; }
}

/* The toggle is available at every width, not just on mobile. */
.menu-toggle {
  display: inline-flex;
  flex: none;
}
.menu-toggle svg { display: block; }

/* ===========================================================
   Step-by-step solution blocks
   One idea per line, one line per step — the layout the
   Complete Study Notes uses for its worked examples.
   =========================================================== */
ol.solve {
  list-style: none;
  counter-reset: solvestep;
  margin: 18px 0 24px;
  padding: 0;
}
ol.solve > li {
  counter-increment: solvestep;
  position: relative;
  padding: 0 0 0 44px;
  margin: 0 0 18px;
}
ol.solve > li::before {
  content: counter(solvestep);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-surface);
}
ol.solve > li > .s-lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}
ol.solve > li > p { margin: 0 0 8px; }
ol.solve > li > p:last-child { margin-bottom: 0; }

/* A single equation / working line. Each one sits on its own row. */
.eqn {
  display: block;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--bg-code);
  border-left: 2px solid var(--border-strong);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 9px 14px;
  margin: 0 0 6px;
  white-space: pre-wrap;
  overflow-x: auto;
}
.eqn:last-child { margin-bottom: 0; }
.eqn .note {
  color: var(--text-muted);
  font-style: normal;
}
.eqn.answer {
  border-left-color: var(--exam);
  background: var(--exam-bg);
  color: var(--exam-text);
  font-weight: 500;
}
.eqn.label {
  background: transparent;
  border-left-color: transparent;
  padding-left: 0;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
}

/* Simplex / transportation tableaux — tight, monospaced, scrollable. */
.tableau-wrap { overflow-x: auto; margin: 14px 0 20px; }
table.tableau {
  font-family: var(--font-mono);
  font-size: 12.5px;
  min-width: 100%;
  white-space: nowrap;
}
table.tableau th, table.tableau td { padding: 6px 12px; text-align: center; }
table.tableau td.lbl, table.tableau th.lbl { text-align: left; }
table.tableau tr.rule td, table.tableau tr.rule th { border-top: 1px solid var(--border-strong); }
table.tableau .pivot {
  background: var(--accent-subtle);
  font-weight: 600;
  color: var(--text);
  outline: 1px solid var(--border-focus);
}

/* Compact "Watch" strip used inside a concept */
.watch-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}
.watch-strip a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 12px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.watch-strip a:hover { border-color: var(--border-focus); color: var(--text); background: var(--bg-elevated); }
.watch-strip a::before { content: "▶"; font-size: 9px; opacity: .7; }
.watch-strip a .ch { color: var(--text-faint); }
.watch-strip a .lang {
  font-size: 9px;
  letter-spacing: .12em;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 4px;
  color: var(--text-muted);
}

/* ===========================================================
   PROBLEM-SOLVING MODULE  (solve/unit-XX.html)
   A "how to solve anything of this shape" panel, KaTeX formula
   cards with a variable legend, a two-column WHY | MATH working
   grid, and the two question banks (worked / attempt-first).
   =========================================================== */

/* ---------- KaTeX host tuning ---------- */
.katex { font-size: 1.06em; }
.katex-display { margin: 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.katex-display > .katex { text-align: left; }

/* ---------- Topic shell ---------- */
.topic {
  border-top: 1px solid var(--border-strong);
  margin: 54px 0 0;
  padding-top: 26px;
}
.topic:first-of-type { margin-top: 26px; }
.topic-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.prose h2.topic-title { margin-top: 0; }

/* ---------- The method panel ---------- */
.method-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin: 18px 0 28px;
  overflow: hidden;
}
.method-panel > .mp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.method-panel > .mp-head::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--exam);
}
.mp-body { padding: 18px 18px 6px; }
.mp-sec {
  margin: 0 0 22px;
}
.mp-sec > .mp-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 9px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-subtle);
}

/* ---------- Formula card ---------- */
.fx {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-code);
  margin: 0 0 10px;
  overflow: hidden;
}
.fx > .fx-name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  align-self: stretch;
  display: flex;
  align-items: center;
}
.fx > .fx-body {
  padding: 12px 16px;
  overflow-x: auto;
}
.fx.key { border-color: var(--exam-border); background: var(--exam-bg); }
.fx.key > .fx-name { color: var(--exam-text); border-right-color: var(--exam-border); background: transparent; }
.fx-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: -4px 0 14px;
  padding-left: 2px;
}

/* ---------- Symbol legend ---------- */
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin: 12px 0 18px;
}
.legend > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.legend > div > b {
  min-width: 34px;
  color: var(--text);
  font-weight: 500;
}

/* ---------- The routine (numbered spine) ---------- */
ol.route {
  list-style: none;
  counter-reset: routestep;
  margin: 10px 0 18px;
  padding: 0;
  border-left: 1px solid var(--border);
}
ol.route > li {
  counter-increment: routestep;
  position: relative;
  padding: 0 0 0 40px;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-secondary);
}
ol.route > li:last-child { margin-bottom: 4px; }
ol.route > li::before {
  content: counter(routestep);
  position: absolute;
  left: -11px;
  top: 0;
  width: 22px; height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}
ol.route > li b { color: var(--text); font-weight: 500; }

/* ---------- Pattern-recognition table ---------- */
table.patterns { font-size: 13px; }
table.patterns td:first-child { white-space: nowrap; font-weight: 500; color: var(--text); }
table.patterns .cue {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--warn-text);
}

/* ---------- Two-column WHY | MATH working grid ---------- */
.work {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin: 12px 0 16px;
}
.work > .wrow {
  display: grid;
  grid-template-columns: 232px 1fr;
  border-bottom: 1px solid var(--border-subtle);
}
.work > .wrow:last-child { border-bottom: none; }
.work > .whead {
  display: grid;
  grid-template-columns: 232px 1fr;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.work > .whead > span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px;
}
.work > .whead > span:first-child { border-right: 1px solid var(--border); }
.work > .wrow > .wwhy {
  padding: 12px 14px;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 12.8px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.work > .wrow > .wwhy b { color: var(--text); font-weight: 500; }
.work > .wrow > .wmath {
  padding: 12px 16px;
  overflow-x: auto;
  background: var(--bg-code);
  font-size: 14px;
  line-height: 1.7;
}
.work > .wrow.final > .wmath { background: var(--exam-bg); color: var(--exam-text); }
.work > .wrow.final > .wwhy { color: var(--exam-text); }

/* ---------- Question cards ---------- */
.qcard {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 18px 20px 16px;
  margin: 0 0 20px;
}
.qcard > .q-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.q-no {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--text);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
}
.q-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
}
.q-tag.exam { color: var(--exam-text); border-color: var(--exam-border); background: var(--exam-bg); }
.q-tag.trap { color: var(--warn-text); border-color: var(--warn-border); background: var(--warn-bg); }
.qcard > .q-stem { font-size: 14.5px; line-height: 1.66; margin: 0 0 6px; }
.why-line {
  border-left: 2px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
  padding: 8px 13px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 13.2px;
  line-height: 1.55;
  margin: 12px 0 14px;
}
.why-line b { color: inherit; }
.ans-line {
  border: 1px solid var(--exam-border);
  background: var(--exam-bg);
  color: var(--exam-text);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  margin: 12px 0 0;
  font-size: 14px;
}
.ans-line .lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  opacity: 0.75;
}
.marker-note {
  font-size: 12.6px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  margin-top: 14px;
  padding-top: 10px;
  line-height: 1.6;
}
.marker-note b { color: var(--text-secondary); }

/* ---------- Attempt-first reveal ---------- */
.reveal {
  border-top: 1px dashed var(--border);
  margin-top: 12px;
  padding-top: 10px;
}
.reveal > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  user-select: none;
}
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::before { content: "▸"; font-size: 11px; }
.reveal[open] > summary::before { content: "▾"; }
.reveal > summary:hover { color: var(--text); border-color: var(--border-strong); }
.reveal[open] > summary { margin-bottom: 12px; }

.reveal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 22px;
}
.reveal-bar button {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.reveal-bar button:hover { color: var(--text); border-color: var(--border-strong); }
.reveal-bar .hint { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Section divider header ---------- */
.bank-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 34px 0 6px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}
.bank-head .bh-title { font-size: 17px; font-weight: 500; color: var(--text); }
.bank-head .bh-sub { font-size: 13px; color: var(--text-muted); }

@media (max-width: 860px) {
  .fx { grid-template-columns: 1fr; }
  .fx > .fx-name { border-right: none; border-bottom: 1px solid var(--border); }
  .work > .wrow, .work > .whead { grid-template-columns: 1fr; }
  .work > .wrow > .wwhy { border-right: none; border-bottom: 1px dashed var(--border-subtle); }
  .work > .whead > span:first-child { border-right: none; }
  .work > .whead > span:last-child { display: none; }
}

/* Horizontal scroll host for wide reference tables inside the method panel. */
.table-scroll { overflow-x: auto; margin: 0 0 4px; position: relative; }
.table-scroll > table { min-width: 480px; }

/* KaTeX hides its MathML copy with `position:absolute`, which escapes an
   overflow container unless that container is itself positioned. Without this
   the invisible MathML sits at the un-scrolled x of a wide table or formula
   and drags the page into a horizontal scroll on narrow screens. */
.wmath, .fx-body, .tableau-wrap, .formula-block, .eqn, .work > .wrow { position: relative; }

/* ===========================================================
   TOPIC ID CARD — "how do I know a question belongs here?"
   The first thing on every topic: the signals that let you
   classify an unseen exam question before you solve it.
   =========================================================== */
.idcard {
  border: 1px solid var(--exam-border);
  background: var(--exam-bg);
  border-radius: var(--radius-sm);
  margin: 18px 0 26px;
  overflow: hidden;
}
.idcard > .id-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--exam-border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--exam-text);
}
.idcard > .id-head::before { content: "◎"; font-size: 12px; }
.idcard > .id-body { padding: 16px 18px 6px; }
.id-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--exam-border);
  font-size: 13.4px;
  line-height: 1.6;
}
.id-row:last-child { border-bottom: none; }
.id-row > .id-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 3px;
}
.id-row > .id-v { color: var(--text-secondary); }
.id-row > .id-v b { color: var(--text); font-weight: 500; }
.id-cue {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-xs);
  padding: 1px 7px;
  margin: 2px 4px 2px 0;
}
table.confuse { font-size: 13px; }
table.confuse td:first-child, table.confuse th:first-child { white-space: nowrap; }

/* Textbook bank header strip */
.tb-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-left: 2px solid var(--textbook, var(--border-strong));
  background: var(--bg-surface);
  border-radius: var(--radius-xs);
  padding: 10px 15px;
  margin: 6px 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.tb-strip .tb-n {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
}
.q-src {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.q-src a { color: var(--text-secondary); }

@media (max-width: 860px) {
  .id-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ===========================================================
   FAA additions — accounting-specific components
   Journal entries, T-accounts, ledger and trial-balance tables,
   the account dictionary, and the "which side" chips.
   =========================================================== */

/* ---------- Journal entry block ----------
   Markup:
     <div class="je">
       <div class="je-head">1 Jan 2025 · Started business with cash ₹25,000</div>
       <table class="je-t">
         <tr class="dr"><td>Cash A/c</td><td class="dr-lbl">Dr.</td><td class="amt">25,000</td><td class="amt"></td></tr>
         <tr class="cr"><td><span class="to">To</span> Capital A/c</td><td></td><td class="amt"></td><td class="amt">25,000</td></tr>
       </table>
       <div class="je-narr">(Being capital introduced in cash)</div>
       <div class="je-why">Cash comes in → real a/c → debit. Owner is the giver → personal a/c → credit.</div>
     </div>                                                                  */
.je {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 3px;
  margin: 14px 0 18px;
  overflow: hidden;
}
.je > .je-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-code);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 14px;
}
table.je-t { width: 100%; border-collapse: collapse; margin: 0; font-size: 14px; }
table.je-t td {
  padding: 7px 14px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: baseline;
}
table.je-t tr:last-child td { border-bottom: none; }
table.je-t tr.cr td:first-child { padding-left: 42px; }
table.je-t td.dr-lbl {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
table.je-t td.amt {
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-align: right;
  white-space: nowrap;
  width: 100px;
  color: var(--text);
}
table.je-t tr.dr td:first-child { color: var(--text); font-weight: 500; }
table.je-t tr.cr td:first-child { color: var(--text-secondary); }
table.je-t .to { color: var(--text-faint); font-style: italic; margin-right: 4px; }
.je > .je-narr {
  padding: 8px 14px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}
.je > .je-why {
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--exam-text);
  background: var(--exam-bg);
  border-top: 1px solid var(--exam-border);
}
.je > .je-why b { color: inherit; font-weight: 600; }

/* ---------- T-account ----------
   Markup:
     <div class="ta"><div class="ta-name">Cash Account</div>
       <table class="ta-t">
         <thead><tr><th colspan="2">Dr.</th><th colspan="2">Cr.</th></tr></thead>
         <tbody><tr><td>Jan 1 To Capital A/c</td><td class="amt">1,000</td>
                    <td>Jan 8 By Purchases A/c</td><td class="amt">800</td></tr></tbody>
       </table></div>                                                        */
.ta { margin: 14px 0 20px; overflow-x: auto; }
.ta > .ta-name {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
table.ta-t { width: 100%; min-width: 460px; border-collapse: collapse; margin: 0; font-size: 13.5px; }
table.ta-t th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 6px 12px;
  text-align: left;
}
table.ta-t th:nth-child(2) { border-left: 2px solid var(--border-strong); }
table.ta-t td {
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  vertical-align: baseline;
  color: var(--text-secondary);
}
table.ta-t td:nth-child(3) { border-left: 2px solid var(--border-strong); }
table.ta-t td.amt {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
  width: 92px;
  color: var(--text);
}
table.ta-t tr.total td { border-top: 1px solid var(--border-strong); font-weight: 500; color: var(--text); }
table.ta-t tr.bal td { color: var(--exam-text); }
/* Six-column variant (particulars · inner · outer on each side), used for
   final accounts on the Solved Papers page: the Dr/Cr divider moves to col 4. */
table.ta-t.six th:nth-child(2), table.ta-t.six td:nth-child(3) { border-left: none; }
table.ta-t.six th:nth-child(4), table.ta-t.six td:nth-child(4) { border-left: 2px solid var(--border-strong); }

/* ---------- Side chips: which side of which statement ---------- */
.side {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--bg-code);
  color: var(--text-muted);
  white-space: nowrap;
}
.side.dr { color: var(--exam-text); border-color: var(--exam-border); background: var(--exam-bg); }
.side.cr { color: var(--case-text); border-color: var(--case-border); background: var(--case-bg); }
.side.bs { color: var(--info-text); border-color: var(--info-border); background: var(--info-bg); }
.side.pl { color: var(--warn-text); border-color: var(--warn-border); background: var(--warn-bg); }
.side.none { opacity: 0.6; }

/* ---------- Account dictionary table ---------- */
table.dict { font-size: 13px; }
table.dict td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
table.dict td { vertical-align: top; }
table.dict .note { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-faint); }

/* ---------- Rule card: the three golden rules ---------- */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.rule-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 3px;
  padding: 16px 16px 14px;
}
.rule-card > .rc-type {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rule-card > .rc-rule {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 10px;
}
.rule-card > .rc-rule b { color: var(--exam-text); font-weight: 600; }
.rule-card > .rc-eg { font-size: 12.5px; line-height: 1.6; color: var(--text-faint); }

/* ---------- Step ladder for a fixed solving routine ---------- */
ol.ladder { counter-reset: lad; list-style: none; padding-left: 0; margin: 12px 0 18px; }
ol.ladder > li {
  counter-increment: lad;
  position: relative;
  padding: 0 0 12px 38px;
  border-left: 1px solid var(--border);
  margin-left: 11px;
  font-size: 14px;
  line-height: 1.65;
}
ol.ladder > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.ladder > li::before {
  content: counter(lad);
  position: absolute;
  left: -11px;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.ladder > li b { color: var(--text); font-weight: 500; }

@media (max-width: 860px) {
  table.je-t td.amt { width: 78px; font-size: 12.5px; }
  table.je-t tr.cr td:first-child { padding-left: 28px; }
}

/* ===========================================================
   SUBJECT DOCUMENTS — every source file for the subject, grouped
   by type, under "On This Page". Each item opens in the viewer.
   On ≤1200px the right rail is hidden, so the same list shows at
   the foot of the left sidebar instead (.sb-docs).
   =========================================================== */
.doc-list {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}
.doc-list-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.doc-group-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  opacity: 0.8;
  margin: 16px 0 6px;
}
.doc-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 5px 0 5px 10px;
  background: none;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.doc-item:hover {
  color: var(--text);
  border-left-color: var(--text-muted);
}
.doc-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.doc-mod,
.doc-count {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.doc-name {
  flex: 1;
  min-width: 0;
}
.sb-docs { display: none; }
.sidebar .doc-list {
  margin: 14px 8px 0;
  padding-top: 14px;
}
.sidebar .doc-list-label { padding-left: 2px; }
@media (max-width: 1200px) {
  .sb-docs { display: block; }
}
/* Pages with no outline (Overview, Exam Questions): the list leads the rail. */
.page-toc #toc-mount:empty + .doc-list {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
