/* ==========================================================================
   Homeschool.lk — Ultra-Minimalist Academic Design System
   Inspired by SaveMyExams, Cognito, Linear, Brilliant.org & Apple HIG
   ========================================================================== */

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --border-hairline: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #f0fdfa;
  --accent-border: #99f6e4;

  --indigo-bg: #eef2ff;
  --indigo-text: #4338ca;
  --indigo-border: #c7d2fe;

  --amber-bg: #fffbeb;
  --amber-text: #b45309;
  --amber-border: #fde68a;

  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #6ee7b7;

  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --danger-border: #fecaca;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.09);

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans Sinhala', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-subtle: #0f172a;
  --bg-elevated: #111c2e;
  --bg-muted: #1e293b;
  --border-hairline: #1e293b;
  --border-strong: #334155;

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

  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-soft: rgba(20, 184, 166, 0.12);
  --accent-border: rgba(45, 212, 191, 0.35);

  --indigo-bg: rgba(99, 102, 241, 0.15);
  --indigo-text: #a5b4fc;
  --indigo-border: rgba(165, 180, 252, 0.3);

  --amber-bg: rgba(245, 158, 11, 0.14);
  --amber-text: #fcd34d;
  --amber-border: rgba(252, 211, 77, 0.3);

  --success-bg: rgba(16, 185, 129, 0.14);
  --success-text: #6ee7b7;
  --success-border: rgba(110, 231, 183, 0.35);

  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-text: #fca5a5;
  --danger-border: rgba(252, 165, 165, 0.35);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.55);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-lesson {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Top Sticky Minimalist Navbar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-hairline);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 17, 32, 0.9);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.22);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

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

.lang-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 2px;
  font-size: 0.75rem;
}

.lang-pill a {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.3;
}

.lang-pill a.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.mobile-nav-strip {
  display: none;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-page);
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-link {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mobile-nav-link.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ==========================================================================
   Buttons & Subtle Labels
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  white-space: nowrap;
}

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

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

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

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

.btn-soft {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.btn-soft:hover {
  background: var(--accent);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 0.82rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid transparent;
}

.badge-teal {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

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

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

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-hairline);
}

/* ==========================================================================
   Homepage — Ultra-Minimalist Level Router & Instant Search
   ========================================================================== */
.hero {
  padding: 52px 0 36px;
  background: radial-gradient(ellipse 75% 55% at 50% -15%, var(--accent-soft), transparent 72%);
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.hero-lead {
  margin: 0 auto 26px;
  max-width: 600px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.72;
}

.search-box-wrap {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.search-input-row {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.96rem;
  padding: 8px 10px;
}

.search-kbd {
  font-size: 0.74rem;
  color: var(--text-muted);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 8px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 10px;
  z-index: 80;
  max-height: 430px;
  overflow-y: auto;
}

.search-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 6px 10px 4px;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  transition: background 0.12s ease;
}

.search-result-item:hover {
  background: var(--bg-subtle);
}

/* 3 Large Calm Minimalist Academic Entry Cards */
.tier-entry-section {
  padding: 12px 0 56px;
}

.tier-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
}

.tier-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tier-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.tier-card-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.tier-card h2 {
  margin: 0 0 6px;
  font-size: 1.32rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.tier-card-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

.tier-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.14s ease;
}

.tier-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tier-chip-primary {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.tier-card-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* ==========================================================================
   Section Layout & Cards
   ========================================================================== */
.section {
  padding: 44px 0;
}

.section-alt {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.38;
  letter-spacing: -0.015em;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.grade-bands-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.grade-band-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.grade-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.grade-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.grade-pill-highlight {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

a.card:hover,
.card-interactive:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.45;
}

.card-en {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.card p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.91rem;
  line-height: 1.68;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
  font-size: 0.81rem;
  color: var(--text-muted);
}

/* Flagship A/L Biology Banner Card */
.flagship-hub-card {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-elevated) 75%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Breadcrumbs & Page Headers
   ========================================================================== */
.page-hero {
  padding: 30px 0 26px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.page-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.48rem, 2.6vw, 2rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.page-hero-en {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-pill {
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Subject NIE Term 1 / Term 2 / Term 3 Roadmap
   ========================================================================== */
.term-block {
  margin-bottom: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.term-header {
  padding: 15px 22px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.term-header h2 {
  margin: 0;
  font-size: 1.04rem;
}

.unit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.unit-row {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.unit-row:last-child {
  border-bottom: none;
}

.unit-num {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 2px;
}

.unit-lessons-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.unit-lesson-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.14s ease;
}

.unit-lesson-chip:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}

/* ==========================================================================
   Wider 1440px 3-Column Distraction-Free Lesson Reader Layout
   Left (240px) | Center Note Canvas (minmax(0, 920px)) | Right Tools (300px)
   ========================================================================== */
.lesson-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 292px;
  justify-content: space-between;
  gap: 28px;
  padding: 32px 0 72px;
  align-items: start;
}

.lesson-sidebar-left,
.lesson-sidebar-right {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 36px);
  overflow-y: auto;
}

.lesson-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.sidebar-box-compact {
  padding: 13px 12px;
}

.sidebar-unit-accordion {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-unit-group {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.sidebar-unit-group[open] {
  background: var(--bg-elevated);
  border-color: var(--border-hairline);
}

.sidebar-unit-group.is-current-unit {
  border-color: var(--accent-border);
}

.sidebar-unit-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text-secondary);
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar-unit-summary::-webkit-details-marker {
  display: none;
}

.sidebar-unit-summary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-unit-group[open] > .sidebar-unit-summary {
  color: var(--text-primary);
  font-weight: 700;
}

.sidebar-unit-group.is-current-unit > .sidebar-unit-summary {
  color: var(--accent);
}

.sidebar-unit-num {
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-unit-group.is-current-unit .sidebar-unit-num {
  background: var(--accent);
  color: #ffffff;
}

.sidebar-unit-name {
  flex: 1;
  min-width: 0;
}

.sidebar-unit-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.16s ease;
  flex-shrink: 0;
}

.sidebar-unit-group[open] .sidebar-unit-chevron {
  transform: rotate(180deg);
}

.sidebar-sublesson-list {
  list-style: none;
  margin: 0;
  padding: 2px 7px 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px dashed var(--border-hairline);
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav-item a {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.81rem;
  line-height: 1.42;
  color: var(--text-secondary);
  transition: all 0.12s ease;
}

.sidebar-nav-item a:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.sidebar-nav-item a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.sublesson-code {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.lesson-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.lesson-main {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.lesson-eyebrow-meta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Right Sidebar Action Cards (MCQ Drawer, Marking Scheme Drawer, Videos) */
.action-card-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.action-card-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.action-card-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 3px;
}

.action-card-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.action-card-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-bank-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.14s ease;
}

.sidebar-bank-link:hover {
  background: var(--accent);
  color: #ffffff;
}

/* Highlighted Hero Card for Featured DP Education Video */
.featured-dp-video-card {
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-elevated) 100%);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.featured-dp-video-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.featured-dp-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.featured-dp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.featured-dp-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
}

.featured-dp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-dp-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.featured-dp-info {
  padding: 0 2px;
}

.featured-dp-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-dp-meta {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 3px;
}

.other-videos-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 12px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-hairline);
}

.featured-dp-search-card {
  display: block;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--accent-border);
  background: var(--accent-soft);
  transition: border-color 0.14s ease;
}

.featured-dp-search-card:hover {
  border-color: var(--accent);
}

.sidebar-video-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.video-thumb-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.video-thumb-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.video-thumb-preview {
  position: relative;
  width: 84px;
  height: 48px;
  border-radius: 7px;
  overflow: hidden;
  background: #0f172a;
  flex-shrink: 0;
}

.video-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-pill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  color: #ffffff;
  font-size: 0.78rem;
}

.video-thumb-info {
  min-width: 0;
  flex: 1;
}

.video-thumb-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-thumb-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-subtle-footer {
  padding: 12px 4px 0;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-subtle-footer a {
  color: var(--text-secondary);
  transition: color 0.14s ease;
}

.sidebar-subtle-footer a:hover {
  color: var(--accent);
}

/* Concise Key Syllabus Summary Box */
.geo-summary-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 26px;
}

.geo-summary-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.geo-summary-box p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.geo-summary-en {
  margin-top: 8px !important;
  font-size: 0.86rem !important;
  color: var(--text-secondary) !important;
}

/* Clean SVG Diagram Card & Click-to-Zoom Indicators */
.diagram-card,
.bio-figure {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 26px 0;
  box-shadow: var(--shadow-xs);
}

.diagram-caption,
.bio-figure figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

[data-theme="dark"] .diagram-card svg,
[data-theme="dark"] .bio-figure svg,
[data-theme="dark"] .prose svg,
[data-theme="dark"] .iq-svg-stage svg {
  border-radius: 12px;
  background: #f8fafc;
  padding: 6px;
}

[data-zoomable] {
  position: relative;
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-zoomable]:hover {
  border-color: var(--accent);
}

.zoomable-media-wrap {
  position: relative;
  display: block;
  margin: 20px 0;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  cursor: zoom-in;
}

.zoom-corner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.74);
  color: #ffffff;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.3;
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0.78;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-zoomable]:hover .zoom-corner-badge {
  opacity: 1;
  transform: scale(1.03);
}

/* ==========================================================================
   Magazine-Grade Prose & Rich Biology/Science Callout Components
   ========================================================================== */
.prose {
  font-size: 1.04rem;
  line-height: 1.86;
  color: var(--text-primary);
}

.prose h2 {
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 1.34rem;
  line-height: 1.38;
  letter-spacing: -0.015em;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 1.13rem;
  line-height: 1.42;
}

.prose h4 {
  margin: 20px 0 8px;
  font-size: 1.02rem;
}

.prose p {
  margin: 0 0 16px;
}

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

.prose li {
  margin-bottom: 8px;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: 6px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.94rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: table;
}

.prose th, .prose td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-hairline);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:hover {
  background: var(--bg-subtle);
}

/* Rich Component 1: .mindmap-box */
.mindmap-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 28px 0;
}

.mindmap-box h3,
.mindmap-box h4 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.02rem;
}

.mindmap-center {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  margin: 0 auto 18px;
  max-width: 560px;
  box-shadow: var(--shadow-xs);
}

.mindmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.mindmap-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.mindmap-node strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.mindmap-node span {
  color: var(--text-secondary);
}

.mindmap-box ul {
  list-style: none;
  padding-left: 16px;
  margin: 10px 0 0;
  border-left: 2px solid var(--accent-border);
}

.mindmap-box li {
  position: relative;
  padding-left: 12px;
  margin-bottom: 8px;
}

.mindmap-box li::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 0.85em;
  width: 12px;
  height: 2px;
  background: var(--accent-border);
}

/* Rich Component 2: .flowchart-steps */
.flowchart-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 26px 0;
  padding: 18px 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
}

.flowchart-steps > ol,
.flowchart-steps > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prose sub,
.prose sup,
sub,
sup {
  font-size: 0.74em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  font-weight: 600;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }

.flowchart-steps > ol > li,
.flowchart-steps > ul > li {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0;
  font-size: 0.96rem;
  display: block;
}

.flowchart-steps > .flow-step {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 0;
  font-size: 0.97rem;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
}

.flow-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.flow-body {
  min-width: 0;
  line-height: 1.76;
}

.flow-body ul,
.flow-body ol {
  list-style: disc;
  margin: 10px 0 8px;
  padding-left: 22px;
  display: block;
}

.flow-body ol {
  list-style: decimal;
}

.flow-body li {
  display: list-item;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 7px;
  font-size: 0.95rem;
  line-height: 1.72;
}

/* Rich Component 3: .doctor-insight (Clinical Motivation Callout) */
.doctor-insight {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-elevated) 90%);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 28px 0;
}

.doctor-insight h3,
.doctor-insight h4,
.doctor-insight strong:first-child {
  color: var(--accent);
}

.doctor-insight p:last-child {
  margin-bottom: 0;
}

/* Rich Component 4: .exam-tip */
.exam-tip {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 0.95rem;
}

/* Rich Component 5: .bio-gallery */
.bio-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.bio-gallery figure,
.bio-gallery .bio-figure {
  margin: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bio-gallery img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 8px;
}

.bio-gallery figcaption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
}

/* ==========================================================================
   Slide-Over Practice Drawers & Cinema Video Lightbox Modal
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(700px, 100vw);
  height: 100%;
  background: var(--bg-page);
  border-left: 1px solid var(--border-hairline);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.12rem;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 40px;
}

.drawer-body .quiz-section {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.video-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 135;
  background: rgba(8, 13, 26, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-modal-card {
  width: 100%;
  max-width: 920px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.video-modal-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000000;
}

.video-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   Click-to-Zoom Fullscreen Diagram & Image Lightbox
   ========================================================================== */
.zoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  color: #f8fafc;
}

.zoom-toolbar {
  height: 58px;
  padding: 0 20px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 2;
}

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

.zoom-ctrl-btn {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.zoom-ctrl-btn:hover {
  background: #0d9488;
  border-color: #14b8a6;
}

.zoom-readout {
  min-width: 58px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #5eead4;
}

.zoom-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.zoom-viewport.is-dragging {
  cursor: grabbing;
}

.zoom-canvas {
  background: #ffffff;
  color: #0f172a;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
}

.zoom-canvas svg {
  width: min(84vw, 1080px);
  height: auto;
  max-height: 75vh;
  display: block;
}

.zoom-canvas img {
  max-width: 84vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.zoom-caption-bar {
  padding: 10px 20px;
  text-align: center;
  font-size: 0.84rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Interactive Auto-Marked MCQ Quiz Engine & Biology Past Paper Bank
   ========================================================================== */
.quiz-section {
  margin: 28px 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.mcq-bank-sticky-bar {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 30;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mcq-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.mcq-q {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 14px;
  line-height: 1.65;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mcq-opt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.55;
  cursor: pointer;
  transition: all 0.14s ease;
}

.mcq-opt-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mcq-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.mcq-opt-btn.is-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
  font-weight: 600;
}

.mcq-opt-btn.is-wrong {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.mcq-explanation {
  margin-top: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.quiz-score-banner {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Structured Q&A Marking-Scheme Accordion */
.qa-accordion {
  margin: 0;
}

.qa-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.qa-item summary {
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.96rem;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.qa-answer {
  padding: 12px 18px 16px;
  color: var(--text-secondary);
  font-size: 0.93rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
}

/* ==========================================================================
   Brilliant.org-Style Visual IQ Solver (/iq/:slug/)
   ========================================================================== */
.iq-solver-card {
  max-width: 760px;
  margin: 28px auto 56px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.iq-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.iq-progress-track {
  flex: 1;
  height: 9px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.iq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: var(--radius-pill);
  transition: width 0.28s ease;
}

.iq-svg-stage {
  margin: 18px 0 22px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  justify-content: center;
}

.iq-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.iq-result-badge-card {
  text-align: center;
  padding: 32px 24px;
  background: radial-gradient(circle at top, var(--accent-soft), transparent 70%);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
}

.iq-score-number {
  font-size: 3.1rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin: 8px 0;
}

/* ==========================================================================
   Social Community, Leaderboard & Forms
   ========================================================================== */
.community-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 26px;
  align-items: start;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-hairline);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 2.1rem;
}

.cheer-btn {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cheer-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.alert {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.mobile-syllabus-bar {
  display: none;
  margin-bottom: 16px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  padding: 44px 0 34px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 30px;
}

.footer-col h4 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1220px) {
  .lesson-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .lesson-sidebar-right {
    grid-column: 2;
    position: static;
    max-height: none;
    margin-top: 16px;
  }
  .tier-entry-grid,
  .cards-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .community-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .main-nav {
    display: none;
  }
  .mobile-nav-strip {
    display: flex;
  }
  .tier-entry-grid,
  .grade-bands-grid,
  .cards-grid-3,
  .cards-grid-2,
  .iq-options-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .container-lesson {
    padding: 0 18px;
  }
  .lesson-shell {
    grid-template-columns: 1fr;
    padding-top: 18px;
    gap: 24px;
  }
  .lesson-sidebar-left {
    display: none;
  }
  .lesson-sidebar-left.is-open {
    display: block;
    position: static;
    max-height: none;
  }
  .lesson-sidebar-right {
    grid-column: 1;
  }
  .mobile-syllabus-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .hero {
    padding: 36px 0 24px;
  }
  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.mobile-quick-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mobile-quick-btn {
  padding: 9px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-xs);
}

.mobile-quick-btn:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

@media (max-width: 600px) {
  html, body {
    overflow-x: clip;
  }
  .container,
  .container-narrow,
  .container-lesson {
    padding: 0 14px;
  }
  .header-inner {
    gap: 8px;
  }
  .brand {
    font-size: 0.98rem;
    gap: 7px;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .nav-link {
    display: none;
  }
  .header-actions .btn-sm {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .lang-pill a {
    padding: 3px 7px;
    font-size: 0.74rem;
  }
  .prose {
    font-size: 0.98rem;
    line-height: 1.78;
  }
  .prose h2 {
    font-size: 1.18rem;
    margin: 28px 0 12px;
  }
  .diagram-card,
  .bio-figure {
    padding: 10px;
    margin: 18px 0;
  }
  .zoom-corner-badge {
    top: 6px;
    right: 6px;
    font-size: 0.68rem;
    padding: 3px 8px;
  }
  .flowchart-steps {
    padding: 12px;
    margin: 20px 0;
  }
  .flowchart-steps > .flow-step {
    padding: 13px 12px;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 10px;
    font-size: 0.94rem;
  }
  .flow-num {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.78rem;
  }
  .flow-body ul,
  .flow-body ol {
    padding-left: 18px;
  }
  .mindmap-box {
    padding: 16px 14px;
    margin: 22px 0;
  }
  .mindmap-center {
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 14px;
  }
  .mindmap-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .doctor-insight,
  .exam-tip,
  .geo-summary-box {
    padding: 14px 16px;
    margin: 20px 0;
  }
  .drawer-header {
    padding: 14px 16px;
  }
  .drawer-body {
    padding: 16px 14px 32px;
  }
  .zoom-toolbar {
    height: auto;
    min-height: 50px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }
  .zoom-ctrl-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .zoom-viewport {
    padding: 10px;
  }
}

/* ==========================================================================
   Smart Dashboards, WhatsApp OTP, 1v1 MCQ Challenge, Image Occlusion & Sprint
   ========================================================================== */

.compact-school-league-card {
  margin-top: 24px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-xs);
}

.compact-school-league-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.compact-school-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-school-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 0.82rem;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.compact-school-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.school-rank-num {
  font-weight: 800;
  color: var(--accent);
}

.login-encourage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mcq-card-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.mcq-challenge-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.mcq-challenge-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.lesson-complete-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lesson-complete-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lesson-complete-btn.is-completed {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.sidebar-bank-link-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-hairline);
  color: var(--text-secondary);
}

/* Image Occlusion Diagram Toggle & Pill Masks */
.diagram-card[data-occlusion-container] {
  padding-top: 44px;
}

.occlusion-toggle-btn {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 5;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-border);
  background: var(--bg-elevated);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.14s ease;
}

.occlusion-toggle-btn:hover,
.occlusion-toggle-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.svg-occlusion-rect {
  fill: #0d9488;
  stroke: #ffffff;
  stroke-width: 1.5px;
  rx: 6px;
  ry: 6px;
  cursor: pointer;
  opacity: 0.96;
  transition: opacity 0.16s ease;
}

.svg-occlusion-rect:hover {
  fill: #0f766e;
}

.svg-occlusion-qmark {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Structured Q&A SaveMyExams Keyword Checker */
.qa-item-wrap {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
}

.qa-question-head {
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.qa-self-check-box {
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--accent-border);
  background: var(--bg-subtle);
  overflow: hidden;
}

.qa-self-check-box summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
}

.qa-self-check-box summary::-webkit-details-marker {
  display: none;
}

.qa-self-check-body {
  padding: 0 14px 14px;
}

.qa-check-feedback {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  font-size: 0.86rem;
}

.kw-hit {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  font-size: 0.78rem;
  font-weight: 600;
}

.kw-miss {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: var(--radius-pill);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
  font-size: 0.78rem;
  font-weight: 600;
}

/* WhatsApp OTP & Singlish School Dropdown */
.wa-otp-box {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1.5px solid var(--accent-border);
}

.wa-nirogi-notice {
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.otp-code-input {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-align: center;
}

.singlish-school-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 120;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.singlish-school-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.singlish-school-option:hover,
.singlish-school-option.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.school-opt-name {
  flex: 1;
  min-width: 0;
}

.school-opt-dist {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* 2-Step Low-Friction Auth & Profile Edit Styles */
.auth-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 0.8rem;
}

.auth-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
}

.auth-step strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border-hairline);
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.auth-step.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-strong);
}

.auth-step.is-active strong {
  background: var(--accent);
  color: #fff;
}

.auth-step.is-done {
  background: var(--accent-soft);
  color: var(--accent);
}

.auth-step-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.role-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 540px) {
  .role-choice-grid {
    grid-template-columns: 1fr;
  }
}

.role-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-hairline);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.role-choice-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.role-choice-card input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.role-choice-card span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role-choice-card strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.role-choice-card small {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap .form-control {
  padding-right: 42px;
}

.pw-toggle-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  line-height: 1;
  opacity: 0.75;
}

.pw-toggle-btn:hover {
  opacity: 1;
}

.btn-link-subtle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.form-hint {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-edit-drawer {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 10px 16px;
}

.profile-edit-drawer summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.avatar-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.avatar-pill {
  cursor: pointer;
}

.avatar-pill input {
  display: none;
}

.avatar-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1.15rem;
  border: 1.5px solid var(--border-hairline);
  background: var(--bg-subtle);
  transition: transform 0.12s, border-color 0.12s;
}

.avatar-pill input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
}

/* Student & Teacher Dashboards */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.79rem;
  color: var(--text-secondary);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  transition: width 0.25s ease;
}

.srs-boxes-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.srs-box-pill {
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.srs-box-pill strong {
  font-size: 1.1rem;
  color: var(--accent);
}

.srs-box-pill span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mistake-topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.pomodoro-clock-readout {
  font-size: 3.1rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.task-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 0.89rem;
}

.task-item.is-done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-del-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
}

.task-del-btn:hover {
  color: var(--danger-text);
}

.wa-friends-scroll {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.moderation-status-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
  font-size: 0.84rem;
  font-weight: 600;
}

.moderation-status-pill.is-preapproved {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.teacher-lessons-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.rev-diff-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.diff-line-added {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 0.81rem;
}

.diff-line-removed {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 0.81rem;
}

/* 1v1 MCQ Challenge Modal & Battle Page */
.challenge-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 170;
  background: rgba(11, 17, 32, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.challenge-modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}

.challenge-battle-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.battle-timer-pill {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.battle-winner-banner {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
}

@media (max-width: 980px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dashboard-kpi-grid,
  .srs-boxes-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SINGLE-QUESTION FOCUS WORKSPACE (LEARNING MODE & A/L EXAM MODE) + ANALYTICS
   ========================================================================== */
.mcq-setup-shell {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mcq-setup-step-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.mcq-setup-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 800;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.mcq-setup-heading {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
}

.mcq-setup-sub {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.mcq-mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mcq-mode-choice {
  text-align: left;
  background: var(--bg-subtle);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  font-family: inherit;
  color: var(--text-primary);
}

.mcq-mode-choice:hover {
  border-color: var(--accent-border);
  background: var(--bg-surface);
}

.mcq-mode-choice.is-selected {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mcq-mode-choice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mcq-mode-icon {
  font-size: 1.45rem;
}

.mcq-mode-choice h3 {
  margin: 0 0 6px;
  font-size: 1.03rem;
  font-weight: 800;
}

.mcq-mode-choice p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.mcq-exam-opts-bar {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px dashed var(--accent-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mcq-timer-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

.setup-units-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 410px;
  overflow-y: auto;
  padding-right: 4px;
}

.setup-unit-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
}

.setup-unit-group[open] {
  background: var(--bg-surface);
  border-color: var(--accent-border);
}

.setup-unit-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
}

.setup-unit-summary::-webkit-details-marker {
  display: none;
}

.setup-unit-cb-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.setup-unit-title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.setup-unit-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.setup-unit-lessons {
  border-top: 1px solid var(--border-hairline);
  padding: 8px 12px 10px 38px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setup-lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.setup-lesson-item:hover {
  background: var(--bg-subtle);
}

.setup-lesson-code {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 34px;
}

.setup-lesson-name {
  flex: 1;
  font-size: 0.87rem;
  color: var(--text-primary);
}

.setup-lesson-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.mcq-setup-launch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1.5px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.mcq-start-hero-btn {
  padding: 12px 28px;
  font-size: 1.02rem;
  font-weight: 800;
}

/* Single-Question Focus Workspace */
.mcq-workspace-shell {
  max-width: 1140px;
  margin: 0 auto;
}

.mcq-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}

.mcq-focus-card {
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.ws-card-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
}

.ws-q-counter-pill {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.ws-q-stem {
  font-size: 1.12rem;
  line-height: 1.75;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.ws-q-options .mcq-opt-btn {
  padding: 13px 16px;
  font-size: 0.98rem;
  line-height: 1.6;
}

.mcq-opt-btn.is-exam-selected {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  font-weight: 700;
}

.ws-explanation-box {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  line-height: 1.72;
}

.ws-exp-verdict {
  font-weight: 800;
  font-size: 0.96rem;
  margin-bottom: 8px;
}

.ws-exp-verdict.is-right {
  color: #059669;
}

.ws-exp-verdict.is-wrong {
  color: #dc2626;
}

.ws-exp-body {
  font-size: 0.94rem;
  color: var(--text-primary);
}

.ws-lesson-link-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.87rem;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ws-lesson-link-card:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.ws-bottom-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Progress Sidebar */
.mcq-workspace-sidebar {
  position: sticky;
  top: 78px;
}

.ws-sidebar-card {
  padding: 18px 18px;
}

.ws-timer-box {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 1.38rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.ws-timer-box.is-urgent {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.ws-live-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.ws-palette-details {
  border-top: 1px solid var(--border-hairline);
  padding-top: 12px;
}

.ws-palette-summary {
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.ws-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  padding: 2px;
}

.ws-palette-btn {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.ws-palette-btn:hover {
  border-color: var(--accent);
}

.ws-palette-btn.is-current {
  outline: 2px solid var(--text-primary);
  outline-offset: 1px;
  font-weight: 800;
}

.ws-palette-btn.is-correct {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.ws-palette-btn.is-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.ws-palette-btn.is-answered {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.ws-palette-btn.is-flagged {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.ws-palette-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Official Exam Result Report */
.mcq-exam-report-shell {
  max-width: 960px;
  margin: 0 auto;
}

.exam-report-hero {
  background: var(--bg-surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}

.exam-report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.exam-kpi-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}

.exam-kpi-box strong {
  display: block;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.exam-kpi-box span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Dashboard Category Breakdown */
.dashboard-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dash-cat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
}

@media (max-width: 960px) {
  .mcq-workspace-grid {
    grid-template-columns: 1fr;
  }
  .mcq-workspace-sidebar {
    position: static;
  }
  .ws-palette-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .dashboard-cat-grid,
  .exam-report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .mcq-mode-cards-grid,
  .dashboard-cat-grid,
  .exam-report-kpis {
    grid-template-columns: 1fr;
  }
  .mcq-focus-card {
    padding: 18px 16px;
  }
  .mcq-setup-step-card {
    padding: 16px;
    flex-direction: column;
    gap: 10px;
  }
  .ws-palette-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
