/* ==========================================================================
   BPSC TRE 4.0 Computer Science — Master Dashboard Stylesheet
   Warm Light Eye-Care Mode (Default) + Night Mode (Dark)
   Engineered for multi-hour sustained student study sessions without eye fatigue
   ========================================================================== */

:root,
[data-theme="warm"],
[data-theme="light"] {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  /* Warm Light Eye-Care Study Palette (Default)
     Soft warm parchment/linen tone (like Kindle Sepia/Warm filter)
     Eliminates high-energy blue-light glare for prolonged reading */
  --bg-primary: #faf6ee;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3ede2;
  --bg-card: #ffffff;
  --bg-card-hover: #fdfbf7;
  --border-color: #e8dfd1;
  --border-highlight: rgba(99, 102, 241, 0.4);

  --text-primary: #231f1d;
  --text-secondary: #524a42;
  --text-muted: #786e64;
  --text-dim: #a39789;

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.12);

  --tier-1-color: #be123c;
  --tier-1-bg: #ffe4e6;
  --tier-1-border: #fecdd3;

  --tier-2-color: #b45309;
  --tier-2-bg: #fef3c7;
  --tier-2-border: #fde68a;

  --tier-3-color: #047857;
  --tier-3-bg: #d1fae5;
  --tier-3-border: #a7f3d0;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(35, 31, 29, 0.05);
  --shadow-md: 0 8px 24px rgba(35, 31, 29, 0.08);
  --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.12);

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Night Theme Overrides (Optional toggle for late night study) */
[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(148, 163, 184, 0.15);
  --border-highlight: rgba(99, 102, 241, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.25);

  --tier-1-color: #f43f5e;
  --tier-1-bg: rgba(244, 63, 94, 0.12);
  --tier-1-border: rgba(244, 63, 94, 0.35);

  --tier-2-color: #fbbf24;
  --tier-2-bg: rgba(251, 191, 36, 0.12);
  --tier-2-border: rgba(251, 191, 36, 0.35);

  --tier-3-color: #34d399;
  --tier-3-bg: rgba(52, 211, 153, 0.12);
  --tier-3-border: rgba(52, 211, 153, 0.35);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px var(--accent-glow);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Top Sticky Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 249, 0.94);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.94);
}

/* Navigation Tabs Bar (tre4ct.aiwazir.com style) */
.nav-tabs-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: sticky;
  top: 61px;
  z-index: 45;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-tabs-bar::-webkit-scrollbar {
  height: 3px;
}

.nav-tabs-bar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.nav-tabs-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.25rem;
}

.nav-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.85rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: transparent;
}

.nav-badge-pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 800;
}

/* Red Marked Text for Navigation Tabs and Cards */
.tab-red-mark {
  color: #dc2626 !important;
  font-weight: 800;
  display: inline;
}

[data-theme="dark"] .tab-red-mark {
  color: #ef4444 !important;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeInPane 0.2s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Teacher Cadre Ribbon (from tre4ct) */
.teacher-cadre-ribbon {
  background: linear-gradient(135deg, #f7f0e4, #fbf6ec);
  border: 1px solid #e5d7c3;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

[data-theme="dark"] .teacher-cadre-ribbon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
  border-color: rgba(99, 102, 241, 0.3);
}

.cadre-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cadre-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cadre-badge.highlight {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #047857;
}

[data-theme="dark"] .cadre-badge.highlight {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
}

.brand-icon img,
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--tier-1-bg);
  color: var(--tier-1-color);
  border: 1px solid var(--tier-1-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eye-care-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: #f4ece0;
  color: #78350f;
  border: 1px solid #e2d2be;
  margin-left: 0.5rem;
}

[data-theme="dark"] .eye-care-pill {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}

.btn-warm-active {
  background: #fbf5e6;
  border-color: #ebdcb9;
  color: #92400e;
}

.btn-icon {
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(180deg, #f4ede1 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 1.25rem 2rem;
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero-container {
  max-width: 1300px;
  margin: 0 auto;
}

.hero-header {
  text-align: center;
  max-width: 850px;
  margin: 0 auto 2rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: #efe4d3;
  color: #854d0e;
  border: 1px solid #dfcfb8;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .hero-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #1f1b18 20%, #4b4138 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-title {
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 3-Part Exam Framework Cards */
.exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.exam-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.exam-card.decisive {
  border-color: #fecdd3;
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
}

[data-theme="dark"] .exam-card.decisive {
  border-color: rgba(244, 63, 94, 0.4);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(244, 63, 94, 0.08) 100%);
}

.exam-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.exam-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exam-card-marks {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.exam-card.decisive .exam-card-marks {
  color: var(--tier-1-color);
}

.exam-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Master Progress Widget */
.progress-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-percentage {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-primary);
  line-height: 1;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-bar-track {
  flex: 1;
  min-width: 220px;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #e11d48);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Main Dashboard Layout */
.main-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Search & Filter Toolbar */
.toolbar-section {
  position: relative;
  background: var(--bg-primary);
  padding: 0.5rem 0 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.toolbar-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-main-heading {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.85rem;
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

/* Filter Pills */
.filter-pills-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.filter-pills-container::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 0.45rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}

.filter-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
}

.filter-pill.tier-1-pill.active {
  background: var(--tier-1-color);
  border-color: var(--tier-1-color);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(190, 18, 60, 0.3);
}

.filter-pill.tier-2-pill.active {
  background: var(--tier-2-color);
  border-color: var(--tier-2-color);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(180, 83, 9, 0.3);
}

.filter-pill.tier-3-pill.active {
  background: var(--tier-3-color);
  border-color: var(--tier-3-color);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(4, 120, 87, 0.3);
}

/* Unit Cards */
.units-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.unit-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.unit-card:hover {
  border-color: var(--border-highlight);
}

.unit-card.tier-1 {
  border-left: 5px solid var(--tier-1-color);
}

.unit-card.tier-2 {
  border-left: 5px solid var(--tier-2-color);
}

.unit-card.tier-3 {
  border-left: 5px solid var(--tier-3-color);
}

.unit-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg-secondary);
  transition: background-color 0.15s ease;
}

.unit-header:hover {
  background: var(--bg-card-hover);
}

.unit-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.unit-number-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.tier-1 .unit-number-badge {
  background: var(--tier-1-bg);
  color: var(--tier-1-color);
  border-color: var(--tier-1-border);
}

.tier-2 .unit-number-badge {
  background: var(--tier-2-bg);
  color: var(--tier-2-color);
  border-color: var(--tier-2-border);
}

.tier-3 .unit-number-badge {
  background: var(--tier-3-bg);
  color: var(--tier-3-color);
  border-color: var(--tier-3-border);
}

.unit-text-meta {
  flex: 1;
}

.unit-top-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.badge-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-tier-1 {
  background: var(--tier-1-bg);
  color: var(--tier-1-color);
  border: 1px solid var(--tier-1-border);
}

.badge-tier-2 {
  background: var(--tier-2-bg);
  color: var(--tier-2-color);
  border: 1px solid var(--tier-2-border);
}

.badge-tier-3 {
  background: var(--tier-3-bg);
  color: var(--tier-3-color);
  border: 1px solid var(--tier-3-border);
}

.badge-weightage {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-tre {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  font-weight: 800;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .badge-tre {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  font-weight: 800;
}

.unit-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.unit-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.unit-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.unit-progress-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.chevron-icon {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.unit-card.open .chevron-icon {
  transform: rotate(180deg);
}

/* Collapsible Content Area */
.unit-body {
  display: none;
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.unit-card.open .unit-body {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pedagogy Callout (Warm Paper / Golden honey in Light Mode) */
.pedagogy-callout {
  margin: 1.25rem 0 1rem;
  background: #fbf5e8;
  border: 1px solid #ebdcb9;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: #78350f;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

[data-theme="dark"] .pedagogy-callout {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* Chapters & Subtopics */
.chapter-block {
  margin-top: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.chapter-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topics-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.topic-item:hover {
  background: rgba(0, 0, 0, 0.035);
}

[data-theme="dark"] .topic-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.topic-checkbox {
  margin-top: 0.25rem;
  width: 17px;
  height: 17px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.topic-text {
  flex: 1;
  line-height: 1.45;
}

.topic-item.completed .topic-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* Quick Reference Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(35, 31, 29, 0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.75);
}

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

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Cutoff Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 1rem 0;
}

.data-table th, .data-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.data-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--accent-primary);
}

/* ==========================================================================
   NCERT Digital Companion Library Styles
   ========================================================================== */

.ncert-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--border-color);
}

.ncert-section-header {
  margin-bottom: 1.5rem;
}

.ncert-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.3;
}

.ncert-sub-title {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.ncert-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn-ncert-filter {
  padding: 0.45rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}

.btn-ncert-filter:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-ncert-filter.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
}

.ncert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.25rem;
}

.ncert-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.ncert-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.ncert-card-top {
  margin-bottom: 1rem;
}

.ncert-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.ncert-file-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
}

.ncert-badges-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-relevance {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-relevance-critical {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.badge-relevance-high {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-relevance-medium {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.badge-relevance-low {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.ncert-chapter-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.ncert-focus-box {
  background: #fbf5e8;
  border-left: 3px solid #b45309;
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: #78350f;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

[data-theme="dark"] .ncert-focus-box {
  background: rgba(99, 102, 241, 0.08);
  border-left-color: var(--accent-primary);
  color: #cbd5e1;
}

.ncert-topics-list {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.ncert-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
}

.ncert-class-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-open-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #ffffff;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-open-pdf:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-preview-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.btn-preview-pdf:hover {
  border-color: var(--text-muted);
}

/* PDF Modal Viewer */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(20, 18, 16, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.pdf-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 1000px;
  width: 100%;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.pdf-modal-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.pdf-modal-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* ==========================================================================
   NCERT Computer Science Master Handbook & Book Reader Styles
   ========================================================================== */

.book-reader-wrapper {
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--reader-border, rgba(255, 255, 255, 0.08));
  background-color: var(--reader-bg, #0b1120);
  color: var(--reader-text-primary, #f8fafc);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
  margin-bottom: 2.5rem;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

/* --- Themes --- */
/* Theme 1: Midnight Slate (Dark) */
.book-reader-wrapper.reader-theme-dark {
  --reader-bg: #0b1120;
  --reader-surface: #111c35;
  --reader-surface-elevated: #162444;
  --reader-border: rgba(255, 255, 255, 0.08);
  --reader-border-highlight: #38bdf8;
  --reader-text-primary: #f8fafc;
  --reader-text-secondary: #cbd5e1;
  --reader-text-muted: #94a3b8;
  --reader-accent: #38bdf8;
  --reader-accent-hover: #0284c7;
  --reader-code-bg: #060a12;
  --reader-code-border: #1e293b;
  --reader-code-color: #38bdf8;
  --reader-card-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  --reader-spine-shadow: inset 18px 0 25px -15px rgba(0, 0, 0, 0.5);
  --callout-trap-bg: rgba(245, 158, 11, 0.12);
  --callout-trap-border: #f59e0b;
  --callout-trap-text: #fde68a;
  --callout-insight-bg: rgba(16, 185, 129, 0.12);
  --callout-insight-border: #10b981;
  --callout-insight-text: #a7f3d0;
  --callout-mental-bg: rgba(99, 102, 241, 0.12);
  --callout-mental-border: #6366f1;
  --callout-mental-text: #c7d2fe;
}

/* Theme 2: Warm Sepia / Classic Paper */
.book-reader-wrapper.reader-theme-sepia {
  --reader-bg: #f8f1e0;
  --reader-surface: #f1e4cc;
  --reader-surface-elevated: #e8d7bb;
  --reader-border: #dec7a4;
  --reader-border-highlight: #c2410c;
  --reader-text-primary: #2c1a0e;
  --reader-text-secondary: #4a3422;
  --reader-text-muted: #7c624b;
  --reader-accent: #c2410c;
  --reader-accent-hover: #9a3412;
  --reader-code-bg: #e6d3b3;
  --reader-code-border: #d4bc94;
  --reader-code-color: #2b180d;
  --reader-card-shadow: 0 4px 14px rgba(60, 40, 20, 0.08);
  --reader-spine-shadow: inset 18px 0 25px -15px rgba(80, 50, 25, 0.2);
  --callout-trap-bg: #fef3c7;
  --callout-trap-border: #d97706;
  --callout-trap-text: #78350f;
  --callout-insight-bg: #ecfdf5;
  --callout-insight-border: #059669;
  --callout-insight-text: #064e3b;
  --callout-mental-bg: #eef2ff;
  --callout-mental-border: #4f46e5;
  --callout-mental-text: #312e81;
}

/* Theme 3: Paper White */
.book-reader-wrapper.reader-theme-paper {
  --reader-bg: #f8fafc;
  --reader-surface: #ffffff;
  --reader-surface-elevated: #f1f5f9;
  --reader-border: #e2e8f0;
  --reader-border-highlight: #2563eb;
  --reader-text-primary: #0f172a;
  --reader-text-secondary: #334155;
  --reader-text-muted: #64748b;
  --reader-accent: #2563eb;
  --reader-accent-hover: #1d4ed8;
  --reader-code-bg: #f1f5f9;
  --reader-code-border: #cbd5e1;
  --reader-code-color: #0f172a;
  --reader-card-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  --reader-spine-shadow: inset 18px 0 25px -15px rgba(0, 0, 0, 0.08);
  --callout-trap-bg: #fffbeb;
  --callout-trap-border: #f59e0b;
  --callout-trap-text: #92400e;
  --callout-insight-bg: #f0fdf4;
  --callout-insight-border: #16a34a;
  --callout-insight-text: #14532d;
  --callout-mental-bg: #e0e7ff;
  --callout-mental-border: #4338ca;
  --callout-mental-text: #1e1b4b;
}

/* --- Font Sizing --- */
.book-reader-wrapper.font-size-sm {
  --reader-font-base: 0.88rem;
  --reader-font-h1: 1.45rem;
  --reader-font-h2: 1.15rem;
  --reader-font-h3: 1rem;
  --reader-font-code: 0.82rem;
  --reader-line-height: 1.6;
}

.book-reader-wrapper.font-size-md {
  --reader-font-base: 1rem;
  --reader-font-h1: 1.7rem;
  --reader-font-h2: 1.25rem;
  --reader-font-h3: 1.05rem;
  --reader-font-code: 0.88rem;
  --reader-line-height: 1.7;
}

.book-reader-wrapper.font-size-lg {
  --reader-font-base: 1.12rem;
  --reader-font-h1: 1.95rem;
  --reader-font-h2: 1.4rem;
  --reader-font-h3: 1.18rem;
  --reader-font-code: 0.95rem;
  --reader-line-height: 1.8;
}

/* --- Reader Toolbar --- */
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background-color: var(--reader-surface);
  border-bottom: 1px solid var(--reader-border);
  gap: 1rem;
  flex-wrap: wrap;
}

.reader-toolbar-left,
.reader-toolbar-right,
.reader-toolbar-center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-reader-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  background: var(--reader-surface-elevated);
  border: 1px solid var(--reader-border);
  color: var(--reader-text-primary);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reader-action:hover {
  border-color: var(--reader-accent);
  color: var(--reader-accent);
}

.reader-book-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.reader-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--reader-accent);
  text-transform: uppercase;
}

.reader-current-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--reader-text-primary);
}

.reader-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 140px;
}

.reader-progress-track {
  flex: 1;
  height: 6px;
  background: var(--reader-surface-elevated);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--reader-border);
}

.reader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--reader-accent), #10b981);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.reader-progress-percent {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--reader-text-muted);
}

.reader-control-group {
  display: inline-flex;
  background: var(--reader-surface-elevated);
  border: 1px solid var(--reader-border);
  border-radius: var(--radius-sm, 6px);
  padding: 2px;
  gap: 2px;
}

.btn-reader-tool,
.btn-reader-theme,
.btn-reader-mode {
  padding: 0.3rem 0.65rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--reader-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reader-tool:hover,
.btn-reader-theme:hover,
.btn-reader-mode:hover {
  color: var(--reader-text-primary);
}

.btn-reader-tool.active,
.btn-reader-theme.active,
.btn-reader-mode.active {
  background: var(--reader-accent);
  color: #ffffff;
}

.reader-theme-sepia .btn-reader-theme.active,
.reader-theme-sepia .btn-reader-mode.active,
.reader-theme-sepia .btn-reader-tool.active {
  background: var(--reader-accent);
  color: #fff9ed;
}

/* --- Two-Column Book Desk --- */
.book-desk {
  display: flex;
  position: relative;
  min-height: 620px;
}

/* Sidebar TOC */
.book-toc-sidebar {
  width: 290px;
  flex-shrink: 0;
  background-color: var(--reader-surface);
  border-right: 1px solid var(--reader-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  overflow: hidden;
}

.toc-header {
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--reader-border);
  flex-shrink: 0;
  overflow: hidden;
}

.toc-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--reader-text-primary);
  margin: 0;
}

.btn-toc-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--reader-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.toc-subtitle {
  font-size: 0.75rem;
  color: var(--reader-text-muted);
  display: block;
  margin-top: 0.2rem;
}

.toc-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.btn-toc-filter {
  flex: 1 1 auto;
  padding: 0.28rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--reader-surface-elevated);
  border: 1px solid var(--reader-border);
  color: var(--reader-text-muted);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-toc-filter:hover {
  color: var(--reader-text-primary);
  border-color: var(--reader-accent);
}

.btn-toc-filter.active {
  background: var(--reader-accent);
  color: #ffffff;
  border-color: var(--reader-accent);
}

.reader-theme-sepia .btn-toc-filter.active {
  color: #fff8eb;
}

.toc-group-header {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--reader-accent);
  text-transform: uppercase;
  padding: 0.65rem 0.8rem 0.25rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.85;
}

.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  max-height: calc(100vh - 250px);
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm, 6px);
  color: var(--reader-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 0.2rem;
  border-left: 3px solid transparent;
}

.toc-item:hover {
  background: var(--reader-surface-elevated);
  color: var(--reader-text-primary);
}

.toc-item.active {
  background: var(--reader-surface-elevated);
  border-left-color: var(--reader-accent);
  color: var(--reader-accent);
  font-weight: 700;
}

.toc-num {
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  opacity: 0.7;
}

.toc-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
}

.toc-status-icon {
  font-size: 0.8rem;
  opacity: 0.4;
}

.toc-item.completed .toc-status-icon {
  opacity: 1;
  color: #10b981;
}

.toc-footer {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--reader-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--reader-text-muted);
  background: var(--reader-surface);
}

.btn-toc-reset {
  background: transparent;
  border: 1px solid var(--reader-border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--reader-text-muted);
  cursor: pointer;
}

.btn-toc-reset:hover {
  color: var(--reader-text-primary);
  border-color: var(--reader-accent);
}

/* Main Book Page Stage */
.book-page-stage {
  flex: 1;
  min-width: 0;
  padding: 2.25rem 2.75rem;
  background-color: var(--reader-bg);
  box-shadow: var(--reader-spine-shadow);
  display: flex;
  flex-direction: column;
}

.book-page-content {
  flex: 1;
  font-size: var(--reader-font-base);
  line-height: var(--reader-line-height);
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* Chapter Heading */
.book-chapter-header {
  border-bottom: 2px solid var(--reader-border);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.chapter-number-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--reader-accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.chapter-number-pill::before,
.chapter-number-pill::after {
  content: "—";
  opacity: 0.5;
}

.book-chapter-title {
  font-size: var(--reader-font-h1);
  font-weight: 900;
  color: var(--reader-text-primary);
  margin: 0.25rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.book-chapter-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--reader-text-muted);
}

.book-meta-badge {
  background: var(--reader-surface-elevated);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--reader-border);
  font-weight: 600;
  color: var(--reader-text-secondary);
}

.book-chapter-summary {
  margin-top: 0.75rem;
  color: var(--reader-text-secondary);
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.55;
}

/* Book Subcards */
.book-subcard {
  background-color: var(--reader-surface);
  border: 1px solid var(--reader-border);
  border-radius: var(--radius-md, 8px);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--reader-card-shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.book-subcard:hover {
  border-color: var(--reader-border-highlight);
}

.book-subcard-title {
  font-size: var(--reader-font-h2);
  font-weight: 800;
  color: var(--reader-accent);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.book-subcard-title::before {
  content: "§";
  opacity: 0.6;
  font-weight: 400;
}

/* Book Code & Snippet Blocks */
.book-code-wrapper {
  position: relative;
  margin: 1rem 0;
}

pre.code-block.book-code-surface {
  background-color: var(--reader-code-bg) !important;
  border: 1px solid var(--reader-code-border) !important;
  color: var(--reader-code-color) !important;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-mono, "SF Mono", Consolas, monospace);
  font-size: var(--reader-font-code);
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--reader-surface-elevated);
  border: 1px solid var(--reader-border);
  color: var(--reader-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.7;
}

.btn-copy-code:hover {
  opacity: 1;
  color: var(--reader-text-primary);
  border-color: var(--reader-accent);
}

/* Callout Styling */
.book-callout {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm, 6px);
  margin-top: 1rem;
  font-size: 0.9em;
  line-height: 1.55;
}

.book-callout-insight {
  background: var(--callout-insight-bg);
  border-left: 4px solid var(--callout-insight-border);
  color: var(--callout-insight-text);
}

.book-callout .callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.book-callout .callout-title {
  font-weight: 800;
  margin-bottom: 0.25rem;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Bottom Page Turner */
.book-page-turner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--reader-border);
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-turn-page {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  background: var(--reader-surface);
  border: 1px solid var(--reader-border);
  border-radius: var(--radius-md, 8px);
  color: var(--reader-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.btn-turn-page:hover:not(:disabled) {
  border-color: var(--reader-accent);
  background: var(--reader-surface-elevated);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-turn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.turn-arrow {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--reader-accent);
}

.turn-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.turn-sub {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--reader-text-muted);
}

.turn-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.page-indicator-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.page-number-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--reader-text-primary);
}

.mark-revised-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--reader-text-secondary);
  user-select: none;
}

.mark-revised-label input[type="checkbox"] {
  accent-color: #10b981;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.keyboard-nav-hint {
  font-size: 0.72rem;
  color: var(--reader-text-muted);
}

.keyboard-nav-hint kbd {
  background: var(--reader-surface-elevated);
  border: 1px solid var(--reader-border);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
}

/* Mobile responsive drawer */
.toc-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99;
}

@media (max-width: 900px) {
  .book-toc-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 300px;
    z-index: 100;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
  }

  .book-toc-sidebar.open {
    transform: translateX(0);
  }

  .toc-backdrop.open {
    display: block;
  }

  .btn-toc-close {
    display: block;
  }

  .book-page-stage {
    padding: 1.5rem 1.25rem;
  }

  .btn-turn-page {
    min-width: 140px;
    padding: 0.6rem 0.85rem;
  }

  .turn-title {
    max-width: 100px;
  }
}

@media (max-width: 600px) {
  .reader-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .reader-toolbar-left,
  .reader-toolbar-center,
  .reader-toolbar-right {
    justify-content: space-between;
    width: 100%;
  }

  .book-page-turner {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-turn-page {
    width: 100%;
    justify-content: center;
  }

  .btn-turn-prev {
    order: 2;
  }

  .page-indicator-center {
    order: 1;
    margin-bottom: 0.5rem;
  }

  .btn-turn-next {
    order: 3;
  }
}

/* Legacy cheatsheet compatibility classes */
.cheatsheet-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.cheatsheet-header {
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.cheatsheet-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.subcard {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
}

.subcard-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.65rem;
}

pre.code-block {
  background-color: #211c18;
  border: 1px solid #3c342d;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  color: #fbbf24;
  line-height: 1.5;
  margin-bottom: 0.65rem;
}

[data-theme="dark"] pre.code-block {
  background-color: #0b1120;
  border-color: #1e293b;
  color: #38bdf8;
}

.code-explanation {
  font-size: 0.84rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-primary);
  padding-left: 0.75rem;
  margin-top: 0.5rem;
  line-height: 1.45;
}

/* ==========================================================================
   Marathon (From Day 1) Styles
   ========================================================================== */

.marathon-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.marathon-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.marathon-progress-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.marathon-progress-bar-bg {
  width: 100%;
  height: 10px;
  background-color: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.marathon-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.marathon-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn-marathon-filter {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-marathon-filter:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-marathon-filter.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.marathon-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.marathon-day-card.day-completed {
  border-color: #10b981;
}

.marathon-day-header {
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.marathon-day-title-wrap {
  flex: 1;
  min-width: 250px;
}

.marathon-day-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.marathon-day-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

[data-theme="dark"] .marathon-day-badge {
  background: #1e1b4b;
  color: #a5b4fc;
  border-color: #3730a3;
}

.marathon-day-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.marathon-day-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.marathon-day-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-day-complete {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-day-complete:hover {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.btn-day-complete.completed {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.marathon-day-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Marathon Book Style Layout */
.marathon-day-card.marathon-book-style {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 2.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.marathon-day-card.marathon-book-style.day-completed {
  border-color: #10b981;
  box-shadow: 0 0 0 1px #10b981, var(--shadow-sm);
}

.marathon-book-style .marathon-book-header {
  padding: 1.5rem 1.75rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.marathon-book-style .marathon-book-body {
  padding: 1.75rem 1.75rem 2rem;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.marathon-book-style .book-subcard {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.marathon-book-style .book-subcard:hover {
  border-color: var(--accent-primary);
}

.marathon-book-style .book-subcard-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.marathon-book-style .book-subcard-title::before {
  content: "§";
  opacity: 0.6;
  font-weight: 400;
}

.marathon-book-style .book-code-wrapper {
  position: relative;
  margin: 0.85rem 0;
}

.marathon-book-style pre.code-block.book-code-surface {
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm, 8px);
  font-family: var(--font-mono, "SF Mono", Consolas, monospace);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

[data-theme="dark"] .marathon-book-style pre.code-block.book-code-surface {
  background-color: #070d19 !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
  color: #e2e8f0 !important;
}

.marathon-book-style .book-callout {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm, 8px);
  margin: 0.85rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.marathon-book-style .book-callout-insight {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-primary);
  color: var(--text-primary);
}

[data-theme="dark"] .marathon-book-style .book-callout-insight {
  background: rgba(56, 189, 248, 0.08);
  border-left: 4px solid #38bdf8;
  color: #bae6fd;
}

.marathon-book-style .book-callout .callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.marathon-book-style .book-callout .callout-title {
  font-weight: 800;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
}

[data-theme="dark"] .marathon-book-style .book-callout .callout-title {
  color: #38bdf8;
}

/* Marathon Targets Table Box */
.marathon-targets-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.marathon-targets-lead {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.marathon-targets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.marathon-targets-table th {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  font-weight: 800;
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.marathon-targets-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  line-height: 1.45;
}

.marathon-targets-table tr:last-child td {
  border-bottom: none;
}

.marathon-targets-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Marathon Part Headers */
.marathon-part-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
}

.marathon-part-pill {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Marathon Test Card */
.marathon-test-card {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-md, 14px);
  padding: 1.75rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-md);
}

.marathon-test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.marathon-test-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.marathon-test-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.25rem;
}

.marathon-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.marathon-keypoints-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.marathon-keypoints-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.marathon-keypoints-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.marathon-keypoints-list li {
  margin-bottom: 0.25rem;
}

.marathon-questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.marathon-q-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  transition: var(--transition);
}

.marathon-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.marathon-q-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.marathon-q-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  line-height: 1.5;
  white-space: pre-line;
}

.marathon-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.marathon-option-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  transition: var(--transition);
}

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

.marathon-option-label {
  font-weight: 700;
  min-width: 1.6rem;
  color: var(--text-secondary);
}

.marathon-option-btn.opt-correct {
  background-color: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
  font-weight: 600;
}

[data-theme="dark"] .marathon-option-btn.opt-correct {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
}

.marathon-option-btn.opt-wrong {
  background-color: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

[data-theme="dark"] .marathon-option-btn.opt-wrong {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

.marathon-q-explanation {
  background: #fdfaf3;
  border: 1px solid #ebd9b8;
  border-left: 4px solid #b45309;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #451a03;
  margin-top: 0.5rem;
  display: none;
}

[data-theme="dark"] .marathon-q-explanation {
  background: #1c1917;
  border-color: #44403c;
  border-left-color: #f59e0b;
  color: #fef3c7;
}

.marathon-q-explanation.show {
  display: block;
}

/* Print Styles */
@media print {
  .navbar, .toolbar-section, .btn, .footer, .chevron-icon {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .unit-body {
    display: block !important;
  }

  .unit-card {
    border: 1px solid #cccccc !important;
    break-inside: avoid;
    margin-bottom: 1.5rem;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.7rem;
  }
  .unit-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .unit-controls {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
  }
  .eye-care-pill {
    display: none;
  }
}

/* ==========================================================================
   Marathon Book Reader Theme Adaptations & Enhancements
   ========================================================================== */

#marathonReaderWrapper .marathon-day-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  margin-bottom: 0;
}

#marathonReaderWrapper .marathon-book-header {
  background: transparent;
  padding: 0 0 1.5rem 0;
  border-bottom: 1px solid var(--reader-border);
  margin-bottom: 1.5rem;
}

#marathonReaderWrapper .marathon-book-body {
  background: transparent;
  padding: 0;
}

/* Theme 2: Sepia Adaptations for Marathon Book Elements */
.reader-theme-sepia .marathon-targets-box,
.reader-theme-sepia .book-subcard,
.reader-theme-sepia .marathon-test-card {
  background: var(--reader-surface) !important;
  border-color: var(--reader-border) !important;
  color: var(--reader-text-primary) !important;
}

.reader-theme-sepia .marathon-targets-lead,
.reader-theme-sepia .marathon-test-title,
.reader-theme-sepia .book-subcard-title {
  color: var(--reader-accent) !important;
}

.reader-theme-sepia .marathon-targets-table th {
  background: var(--reader-surface-elevated) !important;
  color: var(--reader-accent) !important;
  border-color: var(--reader-border) !important;
}

.reader-theme-sepia .marathon-targets-table td {
  border-color: var(--reader-border) !important;
  color: var(--reader-text-secondary) !important;
}

.reader-theme-sepia .marathon-option-btn {
  background: var(--reader-surface-elevated) !important;
  border-color: var(--reader-border) !important;
  color: var(--reader-text-primary) !important;
}

.reader-theme-sepia .marathon-option-btn:hover {
  border-color: var(--reader-accent) !important;
  background: var(--reader-surface) !important;
}

.reader-theme-sepia pre.code-block.book-code-surface {
  background-color: #f1e4cc !important;
  border-color: #dec7a4 !important;
  color: #2c1a0e !important;
}

/* Theme 3: Paper White Adaptations for Marathon Book Elements */
.reader-theme-paper .marathon-targets-box,
.reader-theme-paper .book-subcard,
.reader-theme-paper .marathon-test-card {
  background: var(--reader-surface) !important;
  border-color: var(--reader-border) !important;
  color: var(--reader-text-primary) !important;
}

.reader-theme-paper .marathon-targets-lead,
.reader-theme-paper .marathon-test-title,
.reader-theme-paper .book-subcard-title {
  color: var(--reader-accent) !important;
}

.reader-theme-paper .marathon-targets-table th {
  background: var(--reader-surface-elevated) !important;
  color: var(--reader-accent) !important;
  border-color: var(--reader-border) !important;
}

.reader-theme-paper .marathon-targets-table td {
  border-color: var(--reader-border) !important;
  color: var(--reader-text-secondary) !important;
}

.reader-theme-paper .marathon-option-btn {
  background: var(--reader-surface) !important;
  border-color: var(--reader-border) !important;
  color: var(--reader-text-primary) !important;
}

.reader-theme-paper .marathon-option-btn:hover {
  border-color: var(--reader-accent) !important;
  background: var(--reader-surface-elevated) !important;
}

.reader-theme-paper pre.code-block.book-code-surface {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* View Mode Toggles for Marathon Book Reader */
#marathonReaderWrapper.view-mode-feed #marathonPageTurner {
  display: none !important;
}

#marathonReaderWrapper.view-mode-feed .book-page-stage {
  padding-bottom: 3.5rem;
}

/* ==========================================================================
   Razorpay Paywall & Modal Styling (Option A Jamstack Integration)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.25rem;
}

.modal-overlay.open {
  display: flex !important;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.1));
  color: var(--text-primary);
  transform: rotate(90deg);
}

.price-tag-ribbon {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.current-price {
  font-size: 2.75rem;
  font-weight: 900;
  color: #10b981;
  line-height: 1;
}

.original-price {
  font-size: 1.25rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.discount-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.paywall-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  text-align: left;
  padding: 0;
}

.paywall-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.btn-razorpay-pay {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  border: none;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  transition: all 0.2s;
}

.btn-razorpay-pay:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-2px);
}

.btn-restore-nav {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-primary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-restore-nav:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-primary);
}

/* Marathon Locked Card Banner in Reader Stage */
.locked-paywall-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.98));
  border: 2px dashed rgba(245, 158, 11, 0.6);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .locked-paywall-banner {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #f59e0b;
  color: #1e293b;
}

.btn-unlock-course {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a !important;
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
}

.btn-unlock-course:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* Practice Card Locked Styles */
.practice-card.is-locked {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(to bottom, var(--bg-card), rgba(245, 158, 11, 0.03));
}

.btn-practice-act.btn-practice-locked {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a !important;
  font-weight: 800;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.btn-practice-act.btn-practice-locked:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-1px);
}

/* ==========================================================================
   Enhanced Marathon Blocked vs Unblocked Styles
   ========================================================================== */
.toc-item.toc-item-free {
  border-left: 3px solid #10b981;
}

.toc-item.toc-item-locked {
  border-left: 3px solid #f59e0b;
}

.toc-badge-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.2px;
  margin-left: auto;
}

.toc-badge-pill.pill-free {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.toc-badge-pill.pill-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .toc-badge-pill.pill-free {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

[data-theme="dark"] .toc-badge-pill.pill-locked {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.marathon-locked-preview-wrapper {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.marathon-locked-gate {
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 5;
  padding: 0 1rem;
}

.marathon-locked-card {
  background: rgba(15, 23, 42, 0.94);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 2rem 1.75rem;
  max-width: 580px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .marathon-locked-card {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15), 0 0 25px rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .marathon-locked-card h3 {
  color: #0f172a !important;
}

[data-theme="light"] .marathon-locked-card p {
  color: #475569 !important;
}

/* ==========================================================================
   SEO FAQ ACCORDION STYLES
   ========================================================================== */
.faq-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item[open] {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .faq-icon {
  font-size: 0.8rem;
  color: var(--accent-primary);
  transition: transform 0.2s ease;
  display: inline-block;
}

.faq-item[open] summary .faq-icon {
  transform: rotate(180deg);
}

.faq-content {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   CANDIDATE SUPPORT PAGE STYLES
   ========================================================================== */
.support-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.support-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.support-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.support-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.support-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.support-channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.support-channel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.support-channel-card.whatsapp {
  border-top: 4px solid #10b981;
}

.support-channel-card.email {
  border-top: 4px solid var(--accent-primary);
}

.support-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  width: fit-content;
}

.support-channel-badge.whatsapp-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.support-channel-badge.email-badge {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.support-channel-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.support-channel-val {
  font-family: var(--font-mono, monospace);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-break: break-all;
}

.support-channel-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex: 1;
}

.btn-whatsapp-cta {
  background: #10b981;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
}

.btn-whatsapp-cta:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-email-cta {
  background: var(--accent-primary);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
}

.btn-email-cta:hover {
  background: var(--accent-hover, #4f46e5);
  transform: translateY(-1px);
}

.btn-copy-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-copy-chip:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
}





