/* ==========================================================================
   OB/GYN Emergency MCQ Rescue Hub — Calm Medical Study Design System (v2)
   Prioritizes Long-Duration Reading Comfort, Low Cognitive Load,
   Muted Obstetrics Teal & Gynecology Rose/Plum Accents, Reading Mode,
   and Mobile-First Touch Ergonomics (360px to 1440px+)
   ========================================================================== */

:root {
  /* Soft, low-glare warm alabaster & stone surfaces */
  --bg-primary: #f7f6f2;
  --bg-secondary: #efede7;
  --bg-card: #ffffff;
  --bg-elevated: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2dfd7;
  --border-subtle: #ebe8e0;

  /* Calm medical academic accents */
  --accent-primary: #0f766e;      /* Calm Clinical Teal */
  --accent-primary-hover: #115e59;
  --accent-primary-soft: #f0fdfa;
  --accent-secondary: #0369a1;    /* Soft Academic Blue */
  --accent-obs: #0e7490;          /* Muted Teal for Obstetrics */
  --obs-bg: #ecfeff;
  --obs-text: #155e75;
  --obs-border: #a5f3fc;
  --accent-gyn: #9d174d;          /* Muted Rose/Plum for Gynecology */
  --gyn-bg: #fdf2f8;
  --gyn-text: #831843;
  --gyn-border: #fbcfe8;

  /* Priority & status tokens */
  --badge-a-bg: #ecfdf5;
  --badge-a-text: #065f46;
  --badge-b-bg: #fffbeb;
  --badge-b-text: #92400e;
  --badge-c-bg: #f1f5f9;
  --badge-c-text: #475569;

  --correct-bg: #ecfdf5;
  --correct-border: #10b981;
  --correct-text: #065f46;
  --incorrect-bg: #fef2f2;
  --incorrect-border: #ef4444;
  --incorrect-text: #991b1b;
  --trap-bg: #fffbeb;
  --trap-border: #d97706;
  --trap-text: #78350f;
  --hint-bg: #f0f9ff;
  --hint-border: #0284c7;
  --hint-text: #0c4a6e;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --reading-width: 780px;
}

[data-theme="dark"] {
  /* Soft dark slate palette — zero harsh pure black */
  --bg-primary: #111827;
  --bg-secondary: #1a2333;
  --bg-card: #1e293b;
  --bg-elevated: #162032;
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-subtle: #263348;

  --accent-primary: #2dd4bf;
  --accent-primary-hover: #14b8a6;
  --accent-primary-soft: rgba(45, 212, 191, 0.12);
  --accent-secondary: #38bdf8;
  --accent-obs: #38bdf8;
  --obs-bg: rgba(14, 116, 144, 0.25);
  --obs-text: #7dd3fc;
  --obs-border: #0284c7;
  --accent-gyn: #f472b6;
  --gyn-bg: rgba(157, 23, 77, 0.25);
  --gyn-text: #f9a8d4;
  --gyn-border: #db2777;

  --badge-a-bg: rgba(6, 95, 70, 0.35);
  --badge-a-text: #6ee7b7;
  --badge-b-bg: rgba(146, 64, 14, 0.35);
  --badge-b-text: #fde68a;
  --badge-c-bg: #334155;
  --badge-c-text: #cbd5e1;

  --correct-bg: rgba(16, 185, 129, 0.16);
  --correct-border: #10b981;
  --correct-text: #6ee7b7;
  --incorrect-bg: rgba(239, 68, 68, 0.16);
  --incorrect-border: #f87171;
  --incorrect-text: #fca5a5;
  --trap-bg: rgba(217, 119, 6, 0.16);
  --trap-border: #f59e0b;
  --trap-text: #fde68a;
  --hint-bg: rgba(2, 132, 199, 0.18);
  --hint-border: #38bdf8;
  --hint-text: #bae6fd;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.28);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.72;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Accessible Focus States */
:focus-visible {
  outline: 3px solid var(--accent-secondary);
  outline-offset: 2px;
}

a {
  color: var(--accent-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-primary);
}

/* ==========================================================================
   Compact Sticky Header & Responsive Mobile Navigation
   ========================================================================== */
.site-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-subtitle {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links .nav-tab-btn {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links .nav-tab-btn:hover,
.nav-links .nav-tab-btn.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  padding: 7px 11px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================================================
   Standardized Buttons (Touch-Friendly >= 40px height on mobile)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff !important;
  border-color: var(--accent-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: #ffffff !important;
}

.btn-obs {
  background: var(--accent-obs);
  color: #ffffff !important;
  border-color: var(--accent-obs);
}

.btn-gyn {
  background: var(--accent-gyn);
  color: #ffffff !important;
  border-color: var(--accent-gyn);
}

.btn-success {
  background: #059669;
  color: #ffffff !important;
  border-color: #059669;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff !important;
  border-color: #dc2626;
}

.btn-sm {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 13px;
}

.btn-lg {
  min-height: 46px;
  padding: 11px 22px;
  font-size: 15.5px;
}

/* ==========================================================================
   Main Container & Distraction-Free Reading Mode
   ========================================================================== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.reading-column {
  max-width: var(--reading-width);
  margin-left: auto;
  margin-right: auto;
}

/* Distraction-Free Reading Mode */
body.reading-mode .site-navbar .nav-links,
body.reading-mode .no-reading-mode,
body.reading-mode footer.site-footer {
  display: none !important;
}

body.reading-mode .container {
  max-width: 820px;
  padding-top: 24px;
}

body.reading-mode {
  font-size: 18px;
  line-height: 1.78;
}

body.reading-mode .topic-grid {
  grid-template-columns: 1fr !important;
}

/* ==========================================================================
   Calm Hero & Section Typography
   ========================================================================== */
header.hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 8px;
}

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 780px;
  margin-bottom: 18px;
  line-height: 1.65;
}

section {
  margin-bottom: 38px;
}

h2.sec-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 18px;
  color: var(--text-primary);
}

h3.sub-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18.5px;
  margin: 22px 0 12px;
  color: var(--accent-primary);
}

p {
  margin-bottom: 14px;
}

/* ==========================================================================
   OB/GYN Rescue Camp (Guided Study Journey) Styles
   ========================================================================== */
.study-camp-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.camp-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
}

.camp-stage-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
}

.camp-stage-body {
  padding: 16px 20px;
  display: none;
  border-top: 1px solid var(--border-color);
}

.camp-stage-card.open .camp-stage-body {
  display: block;
}

.camp-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg-primary);
  flex-wrap: wrap;
}

.camp-step-row.step-done {
  background: var(--badge-a-bg);
  border-color: var(--correct-border);
}

.camp-step-row.step-current {
  border-left: 4px solid var(--accent-primary);
  background: var(--bg-card);
}

/* ==========================================================================
   Continue Studying Card & Focused KPI Summary
   ========================================================================== */
.continue-card {
  background: var(--accent-primary-soft);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.kpi-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-primary);
}

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==========================================================================
   Progress Bars & Independent Component Trackers
   ========================================================================== */
.progress-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: var(--bg-secondary);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.session-card.active-session {
  border-color: var(--accent-primary);
  border-width: 2px;
  background: var(--accent-primary-soft);
}

/* ==========================================================================
   Readable Medical Tables (Mobile & Desktop Scroll-Safe)
   ========================================================================== */
.table-responsive,
.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  font-size: 14.5px;
  line-height: 1.55;
}

th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: left;
  padding: 11px 14px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  font-size: 13.5px;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.04);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* ==========================================================================
   Calm Badges & Cards
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
}

.badge-a { background: var(--badge-a-bg); color: var(--badge-a-text); }
.badge-b { background: var(--badge-b-bg); color: var(--badge-b-text); }
.badge-c { background: var(--badge-c-bg); color: var(--badge-c-text); }
.badge-obs { background: var(--obs-bg); color: var(--obs-text); border: 1px solid var(--obs-border); }
.badge-gyn { background: var(--gyn-bg); color: var(--gyn-text); border: 1px solid var(--gyn-border); }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.hub-card.obs-accent { border-top: 3px solid var(--accent-obs); }
.hub-card.gyn-accent { border-top: 3px solid var(--accent-gyn); }
.hub-card.gold-accent { border-top: 3px solid #d97706; }
.hub-card.green-accent { border-top: 3px solid var(--accent-primary); }

.hub-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.hub-card p {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ==========================================================================
   Clinical Summary Cards (Readable, Calm, Individually Trackable)
   ========================================================================== */
.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-gyn);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.topic-card.obs-topic {
  border-left-color: var(--accent-obs);
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.topic-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 19.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.topic-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
}

.topic-box h4 {
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.topic-box ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.topic-box li {
  margin-bottom: 8px;
  font-size: 15.5px;
  line-height: 1.65;
}

.trap-callout {
  background: var(--trap-bg);
  border-left: 4px solid var(--trap-border);
  color: var(--trap-text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
}

.trap-callout strong {
  color: var(--trap-border);
}

.schedule-day {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 22px;
}

.schedule-day h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 19.5px;
  color: var(--accent-primary);
  margin-bottom: 14px;
}

/* ==========================================================================
   Distraction-Free Interactive MCQ & Examination Experience
   ========================================================================== */
.mcq-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-input, .form-select {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.mcq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.mcq-card.obs-border { border-left: 4px solid var(--accent-obs); }
.mcq-card.gyn-border { border-left: 4px solid var(--accent-gyn); }

.mcq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.mcq-stem {
  font-size: 17.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 18px;
  line-height: 1.65;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.mcq-option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15.5px;
  line-height: 1.55;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mcq-option-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.mcq-option-btn.selected-opt {
  border-color: var(--accent-secondary);
  border-width: 2px;
  background: var(--obs-bg);
}

.mcq-option-btn.correct-opt {
  background: var(--correct-bg) !important;
  border-color: var(--correct-border) !important;
  border-width: 2px;
  color: var(--correct-text) !important;
  font-weight: 600;
}

.mcq-option-btn.incorrect-opt {
  background: var(--incorrect-bg) !important;
  border-color: var(--incorrect-border) !important;
  border-width: 2px;
  color: var(--incorrect-text) !important;
}

.opt-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.hint-panel {
  background: var(--hint-bg);
  border-left: 4px solid var(--hint-border);
  color: var(--hint-text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14.5px;
  line-height: 1.6;
}

.explanation-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--correct-border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 16px;
  font-size: 15.5px;
  line-height: 1.68;
}

.takeaway-box {
  background: var(--badge-b-bg);
  color: var(--badge-b-text);
  border-left: 4px solid #d97706;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.6;
}

.discrepancy-alert {
  background: var(--trap-bg);
  border: 1px solid var(--trap-border);
  border-left: 5px solid var(--trap-border);
  color: var(--trap-text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.6;
}

/* Question Number Jump Grid */
.q-jump-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.q-jump-btn {
  min-width: 36px;
  height: 32px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}

.q-jump-btn.active-q {
  outline: 2px solid var(--accent-primary);
  font-weight: 800;
}
.q-jump-btn.status-correct { background: var(--correct-bg); color: var(--correct-text); border-color: var(--correct-border); }
.q-jump-btn.status-incorrect { background: var(--incorrect-bg); color: var(--incorrect-text); border-color: var(--incorrect-border); }
.q-jump-btn.status-bookmarked { box-shadow: inset 0 -3px 0 #d97706; }

/* Collapsible Directory Details */
details.secondary-directory {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

details.secondary-directory > summary {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Flashcard Interactive Component */
.flashcard-stage {
  max-width: 740px;
  margin: 0 auto 20px;
}

.flashcard-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

/* Custom Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

/* Footer */
footer.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 32px 20px;
  margin-top: 48px;
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

/* ==========================================================================
   Mobile & Tablet Responsive Ergonomics (360px, 390px, 430px, 768px, 1024px)
   ========================================================================== */
@media (max-width: 960px) {
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
  }
  .nav-links.mobile-open {
    display: flex;
  }
  .nav-links a,
  .nav-links .nav-tab-btn {
    padding: 10px 12px;
    font-size: 14.5px;
  }
  .nav-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
    line-height: 1.68;
  }
  .container {
    padding: 16px 14px 56px;
  }
  header.hero {
    padding: 20px 16px;
  }
  .topic-card,
  .mcq-card,
  .progress-panel,
  .study-camp-banner {
    padding: 18px 16px;
  }
  .topic-grid,
  .hub-grid,
  .session-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .btn {
    min-height: 42px;
  }
  .mcq-stem {
    font-size: 16.5px;
  }
  .mcq-option-btn {
    padding: 12px 14px;
    font-size: 15px;
  }
}
