/* ==========================================================================
   ACADEMIC EDUCATIONAL DESIGN SYSTEM
   Calibrated for high focus, reading endurance, cognitive flow & WCAG contrast.
   Based on educational psychology: Harvard / Stanford e-learning & Apple HIG.
   ========================================================================== */

:root,
[data-theme="academic"],
[data-theme="aurora"],
[data-theme="light"] {
  --bg-primary: #f8fafc;           /* Slate-50: Calm, restful neutral backdrop */
  --bg-secondary: #ffffff;
  --bg-surface: #ffffff;           /* Pure white card canvas */
  --bg-surface-elevated: #f1f5f9;  /* Slate-100: Soft contrast container */
  --bg-code: #0f172a;              /* Slate-900: High-contrast code background */
  --bg-code-header: #1e293b;       /* Slate-800: Code window titlebar */
  --text-primary: #0f172a;         /* Deep slate: 100% readable, zero eye strain */
  --text-secondary: #334155;       /* Slate-700 */
  --text-muted: #64748b;           /* Slate-500 */
  --text-code: #f8fafc;
  --border-color: #e2e8f0;         /* Slate-200: Crisp 1px border */
  --border-subtle: #f1f5f9;

  /* Scientifically calibrated educational palette */
  --accent-primary: #2563eb;       /* Academic Royal Blue: Promotes cognitive focus & calm */
  --accent-primary-hover: #1d4ed8;
  --accent-primary-soft: #eff6ff;  /* Blue-50 */
  --accent-primary-text: #1d4ed8;

  --accent-kotlin: #059669;        /* Android Forest Emerald */
  --accent-kotlin-soft: #ecfdf5;   /* Emerald-50 */
  --accent-kotlin-border: #a7f3d0;

  --accent-swift: #ea580c;         /* Apple Swift Sunset */
  --accent-swift-soft: #fff7ed;   /* Orange-50 */
  --accent-swift-border: #fed7aa;

  --accent-purple: #6366f1;        /* Soft Indigo */
  --accent-purple-soft: #eef2ff;
  --accent-cyan: #0284c7;
  --accent-cyan-soft: #f0f9ff;
  --accent-amber: #d97706;         /* Warm Gold for milestones & XP */
  --accent-amber-soft: #fef3c7;

  --accent-green: #10b981;
  --accent-green-soft: #ecfdf5;
  --accent-danger: #e11d48;
  --accent-danger-soft: #fff1f2;

  /* Cohesive, single-hue gradient & solid surfaces */
  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-hero: #ffffff;
  --gradient-shift: #f8fafc;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 6px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

/* Warm Paper / Reader Theme (Reduces Blue Light Strain) */
[data-theme="sepia"] {
  --bg-primary: #f7f5ee;           /* Warm unbleached paper */
  --bg-secondary: #fffdf8;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1ece1;
  --bg-code: #1c1917;              /* Warm stone dark */
  --bg-code-header: #292524;
  --text-primary: #292524;         /* Stone-800 */
  --text-secondary: #44403c;
  --text-muted: #78716c;
  --text-code: #f5f5f4;
  --border-color: #e7e2d3;
  --border-subtle: #f0ece1;

  --accent-primary: #0f766e;       /* Deep Scholar Teal */
  --accent-primary-hover: #115e59;
  --accent-primary-soft: #f0fdfa;
  --accent-primary-text: #0f766e;

  --gradient-brand: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  --gradient-hero: #ffffff;
  --gradient-shift: #f7f5ee;
}

/* Midnight Cosmos Theme (Xcode IDE Focus Dark) */
[data-theme="dark"] {
  --bg-primary: #0d1117;           /* GitHub/Xcode dark slate */
  --bg-secondary: #161b22;
  --bg-surface: #1e2430;
  --bg-surface-elevated: #262c3b;
  --bg-code: #0b0f19;
  --bg-code-header: #131c2e;
  --text-primary: #f0f6fc;
  --text-secondary: #cbd5e1;
  --text-muted: #8b949e;
  --text-code: #f1f5f9;
  --border-color: rgba(240, 246, 252, 0.12);
  --border-subtle: rgba(240, 246, 252, 0.06);

  --accent-primary: #38bdf8;       /* Calm Sky Blue */
  --accent-primary-hover: #0ea5e9;
  --accent-primary-soft: rgba(56, 189, 248, 0.14);
  --accent-primary-text: #38bdf8;

  --accent-kotlin: #34d399;
  --accent-kotlin-soft: rgba(52, 211, 153, 0.15);
  --accent-kotlin-border: rgba(52, 211, 153, 0.35);

  --accent-swift: #fb923c;
  --accent-swift-soft: rgba(251, 146, 60, 0.15);
  --accent-swift-border: rgba(251, 146, 60, 0.35);

  --gradient-brand: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --gradient-hero: #161b22;
  --gradient-shift: #1e2430;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.68;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes slideUpSpring {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(14px, -12px) scale(1.08); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}

@keyframes flowPacket {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes popScale {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Top Navbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  transition: transform 0.2s var(--spring-ease);
}

.brand:hover {
  transform: scale(1.02);
}

.brand-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pill {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pill-kotlin {
  background: var(--accent-kotlin-soft);
  color: var(--accent-kotlin);
  border: 1px solid var(--accent-kotlin-border);
}

.pill-swift {
  background: var(--accent-swift-soft);
  color: var(--accent-swift);
  border: 1px solid var(--accent-swift-border);
}

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

.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border: 1px solid #fcd34d;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  animation: popScale 0.4s var(--spring-ease);
}

[data-theme="dark"] .xp-pill {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.progress-bar-mini {
  width: 72px;
  height: 7px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-brand);
  width: 10%;
  transition: width 0.5s var(--spring-ease);
}

.theme-select {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s var(--spring-ease);
}

.btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff !important;
  border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Layout Shell */
.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Sidebar Navigation */
.sidebar {
  background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem 0.95rem;
  position: sticky;
  top: 59px;
  height: calc(100vh - 59px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-section-title {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
  padding: 0 0.6rem;
  margin-bottom: 0.45rem;
}

.week-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}

.week-nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.2s var(--spring-ease);
  font-family: inherit;
}

.week-nav-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  transform: translateX(4px);
}

.week-nav-btn.active {
  background: var(--accent-primary-soft);
  border-color: var(--accent-primary);
  color: var(--accent-primary-text);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.1);
}

.week-nav-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.week-num {
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
}

.week-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.32;
}

.week-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 0.15rem;
  background: var(--bg-surface);
  transition: all 0.25s var(--spring-ease);
}

.week-nav-btn.completed .week-check {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Main Content Area */
.main-content {
  padding: 2rem 2.5rem 4rem;
  max-width: 1060px;
}

/* Hero Banner - Clean Academic Card */
.hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 2rem 2.2rem;
  margin-bottom: 1.85rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  animation: slideUpSpring 0.35s var(--spring-ease) both;
}

.hero-card h1 {
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.22;
  margin-bottom: 0.55rem;
  color: var(--text-primary);
}

.hero-card p {
  color: var(--text-secondary);
  max-width: 760px;
  font-size: 0.98rem;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Mode Tabs inside Main Content */
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.9rem;
  margin-bottom: 1.6rem;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s var(--spring-ease);
}

.tab-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Cards & Staggered Entrance Animations */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.65rem 1.85rem;
  margin-bottom: 1.45rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--spring-ease), box-shadow 0.25s var(--spring-ease);
  animation: slideUpSpring 0.5s var(--spring-ease) both;
}

.section-card:nth-of-type(2) { border-top-color: #ea580c; animation-delay: 0.06s; }
.section-card:nth-of-type(3) { border-top-color: #059669; animation-delay: 0.12s; }
.section-card:nth-of-type(4) { border-top-color: #7c3aed; animation-delay: 0.18s; }
.section-card:nth-of-type(5) { border-top-color: #0891b2; animation-delay: 0.24s; }

.section-card:hover {
  box-shadow: var(--shadow-hover);
}

.section-card h2 {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 0.55rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.mental-shift-banner {
  background: var(--bg-surface-elevated);
  border-left: 4px solid var(--accent-primary);
  padding: 0.95rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.9rem 0 1.2rem;
  font-size: 0.93rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.mental-shift-banner strong {
  color: var(--text-primary);
}

/* Side-by-side Code Comparison with Dark Syntax Highlighting */
.code-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin: 1.1rem 0 0.25rem;
}

.code-pane {
  background: var(--bg-code);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s var(--spring-ease);
}

.code-pane:hover {
  transform: translateY(-2px);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: var(--bg-code-header);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.code-header-kotlin { color: #34d399; }
.code-header-swift { color: #fb923c; }

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

pre.code-block {
  padding: 1.05rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.81rem;
  line-height: 1.62;
  color: var(--text-code);
  margin: 0;
}

/* Syntax Highlighting Spans inside Code Blocks */
.tok-kw { color: #c084fc; font-weight: 600; }     /* Keywords: struct, func, let, var, guard, async, await */
.tok-type { color: #38bdf8; font-weight: 600; }   /* Types & Protocols */
.tok-attr { color: #fb923c; font-weight: 600; }   /* @State, @Observable, @Composable */
.tok-str { color: #4ade80; }                      /* Strings */
.tok-cmt { color: #64748b; font-style: italic; }  /* Comments */
.tok-num { color: #facc15; }                      /* Numbers */

/* Inline Code Snippets (High-Contrast, WCAG AAA Accessible) */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 0.14rem 0.44rem;
  border-radius: 6px;
  color: #1d4ed8; /* Deep Royal Navy: 8.2:1 contrast against light backgrounds */
  font-weight: 700;
}

[data-theme="dark"] :not(pre) > code {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}

[data-theme="sepia"] :not(pre) > code {
  background: #f1ece1;
  border-color: #dfd8c8;
  color: #0f766e;
}

/* High-Contrast Code Pills in Tables & Comparison Cards */
.code-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.32rem 0.75rem;
  border-radius: 6px;
  display: inline-block;
  line-height: 1.45;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-pill-android {
  background: #ecfdf5;
  color: #065f46; /* Deep Forest Emerald: 7.8:1 contrast */
  border: 1.5px solid #a7f3d0;
}

[data-theme="dark"] .code-pill-android {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
}

[data-theme="sepia"] .code-pill-android {
  background: #e6f4ea;
  color: #137333;
  border-color: #a8dab5;
}

.code-pill-ios {
  background: #fff7ed;
  color: #9a3412; /* Deep Apple Swift Sunset: 7.4:1 contrast */
  border: 1.5px solid #fed7aa;
}

[data-theme="dark"] .code-pill-ios {
  background: rgba(234, 88, 12, 0.16);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.45);
}

[data-theme="sepia"] .code-pill-ios {
  background: #fce8e6;
  color: #b3261e;
  border-color: #f6aea9;
}

/* Interactive ARC Simulator */
.arc-nodes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0 0.5rem;
  flex-wrap: wrap;
}

.arc-node {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.5rem;
  min-width: 215px;
  text-align: center;
  transition: all 0.35s var(--spring-ease);
}

.arc-node.leaked {
  border-color: var(--accent-danger);
  background: var(--accent-danger-soft);
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.25);
}

.arc-node.freed {
  border-color: var(--accent-green);
  background: var(--accent-green-soft);
  transform: scale(0.96);
}

.rc-badge {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.84rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: transform 0.25s var(--spring-ease);
}

/* Interactive Quiz & Code Challenge */
.quiz-option {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1.05rem;
  margin-bottom: 0.55rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.91rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s var(--spring-ease);
}

.quiz-option:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
  transform: translateX(4px);
}

.quiz-option.correct {
  border-color: var(--accent-green);
  background: var(--accent-green-soft);
  font-weight: 600;
  animation: popScale 0.35s var(--spring-ease);
}

.quiz-option.wrong {
  border-color: var(--accent-danger);
  background: var(--accent-danger-soft);
}

.feedback-box {
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-top: 0.65rem;
  font-size: 0.89rem;
  display: none;
  animation: slideUpSpring 0.3s var(--spring-ease);
}

.feedback-box.visible {
  display: block;
}

/* Rosetta Table */
.rosetta-search {
  width: 100%;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.94rem;
  font-family: inherit;
  margin-bottom: 1.1rem;
  transition: border-color 0.2s ease;
}

.rosetta-search:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.rosetta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}

.rosetta-table th,
.rosetta-table td {
  padding: 1rem 1.05rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: middle;
}

.rosetta-table td strong {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
}

.rosetta-table tr:hover td {
  background: var(--bg-surface-elevated);
}

.rosetta-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-surface-elevated);
}

/* LinkedIn Preview Box */
.linkedin-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.45rem;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.68;
}

/* Code Editor Challenge */
.code-editor-input {
  width: 100%;
  min-height: 215px;
  background: var(--bg-code);
  color: var(--text-code);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.05rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.58;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.code-editor-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Deep-Dive Details List */
.concept-details-list {
  margin: 0.8rem 0 1.2rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.concept-details-list li strong {
  color: var(--text-primary);
}

/* 3D Flip Flashcard Deck */
.flashcard-scene {
  perspective: 1000px;
}

.flashcard-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.85rem;
  min-height: 195px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.45s var(--spring-ease), box-shadow 0.25s ease;
  user-select: none;
  box-shadow: var(--shadow-card);
}

.flashcard-container:hover {
  transform: translateY(-4px) rotateX(2deg);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-hover);
}

.flashcard-container.flipped {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  animation: popScale 0.35s var(--spring-ease);
}

[data-theme="dark"] .flashcard-container.flipped {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
}

.flashcard-badge {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary-text);
  margin-bottom: 0.65rem;
}

.flashcard-text {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.58;
}

/* Quiz Scoreboard Banner */
.quiz-scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.quiz-score-pill {
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-primary);
}

/* Interactive Widget Box */
.interactive-widget {
  background: var(--bg-surface);
  border: 2px solid color-mix(in srgb, var(--accent-primary) 30%, var(--border-color));
  border-radius: var(--radius-md);
  padding: 1.6rem 1.85rem;
  margin-bottom: 1.55rem;
  box-shadow: var(--shadow-card);
  animation: slideUpSpring 0.45s var(--spring-ease) both;
}

.widget-stage {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.3rem;
  margin-top: 1.05rem;
}

.console-output {
  background: #090d16;
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-top: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.58;
  border-left: 4px solid #10b981;
}

/* Confetti Particle */
.confetti-piece {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  z-index: 9999;
  pointer-events: none;
  animation: confettiFall 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ==========================================================================
   DAILY MICRO-STEPS & ROADMAP ORIENTATION STYLES
   ========================================================================== */
.day-selector-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.4rem 0 0.9rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.day-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s var(--spring-ease);
}

.day-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.day-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.daily-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.65rem 1.85rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  animation: slideUpSpring 0.4s var(--spring-ease) both;
}

.daily-step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.daily-goal-pill {
  background: var(--accent-primary-soft);
  color: var(--accent-primary-text);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0.5rem 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Roadmap & Orientation Cards */
.phase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  animation: slideUpSpring 0.45s var(--spring-ease) both;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.phase-weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.phase-week-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.3rem;
  cursor: pointer;
  transition: all 0.22s var(--spring-ease);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.phase-week-box:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.xcode-guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.89rem;
}

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

.xcode-guide-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shortcut-kbd {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   ACADEMIC EDUCATIONAL UI DESIGN SYSTEM
   Modules, Curriculum Tree, Callouts, macOS Code Windows & Inline Checkpoints
   ========================================================================== */

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s var(--spring-ease);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Sidebar Search Box */
.sidebar-search-container {
  margin-bottom: 0.35rem;
}

.sidebar-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  transition: all 0.2s var(--spring-ease);
}

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

.search-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.course-search-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  width: 100%;
  outline: none;
}

.course-search-input::placeholder {
  color: var(--text-muted);
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.clear-search-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

/* Student Rank & Level Card */
.student-level-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.student-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-level-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.01em;
}

.student-level-xp {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.student-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Curriculum Tree & Module Groupings */
.curriculum-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.module-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.module-badge-header {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-week-item {
  display: flex;
  flex-direction: column;
}

.sidebar-days-list {
  list-style: none;
  margin-left: 0.85rem;
  padding-left: 0.65rem;
  border-left: 2px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.25rem;
  margin-bottom: 0.4rem;
  animation: slideDownFade 0.2s ease-out;
}

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

.sidebar-day-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.38rem 0.55rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
}

.sidebar-day-link:hover {
  background: var(--bg-surface-elevated);
  color: var(--accent-primary);
  transform: translateX(2px);
}

.sidebar-day-link.active {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  font-weight: 700;
}

.day-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  flex-shrink: 0;
}

.day-status-dot.completed {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

/* Search Results Dropdown */
.search-results-list {
  background: var(--bg-surface);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-result-item {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  background: var(--bg-surface-elevated);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: all 0.15s ease;
}

.search-result-item:hover {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  transform: translateX(3px);
}

.search-result-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.search-result-title {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Educational Breadcrumb Bar */
.lesson-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.crumb {
  cursor: pointer;
  transition: color 0.15s ease;
}

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

.crumb.active {
  color: var(--text-primary);
  font-weight: 700;
}

.crumb-separator {
  color: var(--border-color);
  font-size: 0.75rem;
}

.lesson-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.meta-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.xp-meta {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

[data-theme="dark"] .xp-meta {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Pedagogical Callout Cards */
.callout-card {
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.35rem;
  margin: 1.15rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.callout-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Android Mental Anchor Callout */
.callout-android {
  background: color-mix(in srgb, var(--accent-kotlin-soft) 40%, var(--bg-surface));
  border-left: 4px solid var(--accent-kotlin);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.callout-android .callout-header {
  color: var(--accent-kotlin);
}

/* Apple/Swift Way Callout */
.callout-apple {
  background: color-mix(in srgb, var(--accent-swift-soft) 40%, var(--bg-surface));
  border-left: 4px solid var(--accent-swift);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.callout-apple .callout-header {
  color: var(--accent-swift);
}

/* Common Pitfall / Trap Callout */
.callout-trap {
  background: color-mix(in srgb, #fff1f2 40%, var(--bg-surface));
  border-left: 4px solid #f43f5e;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.callout-trap .callout-header {
  color: #e11d48;
}

/* Objective / Action Callout */
.callout-action {
  background: color-mix(in srgb, var(--accent-primary-soft) 35%, var(--bg-surface));
  border-left: 4px solid var(--accent-primary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.callout-action .callout-header {
  color: var(--accent-primary);
}

/* Senior Engineer Pro-Tip & Hint Callout */
.callout-hint {
  background: color-mix(in srgb, #fef3c7 45%, var(--bg-surface));
  border-left: 4px solid #d97706;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.callout-hint .callout-header {
  color: #b45309;
}

[data-theme="dark"] .callout-hint {
  background: rgba(245, 158, 11, 0.12);
  border-left-color: #f59e0b;
}

[data-theme="dark"] .callout-hint .callout-header {
  color: #fbbf24;
}

/* In-Depth Tutorial Concept Card & Prose */
.tutorial-concept-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.tutorial-concept-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.tutorial-prose {
  padding: 1.25rem 1.45rem;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tutorial-prose p {
  margin-bottom: 0.95rem;
}

.tutorial-prose p:last-child {
  margin-bottom: 0;
}

.tutorial-prose strong {
  color: var(--text-primary);
  font-weight: 700;
}

.tutorial-prose code {
  background: var(--bg-code-pill);
  color: var(--accent-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  border: 1px solid var(--border-subtle);
}

.tutorial-subheading {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 1.15rem 0 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Best Practices: Do's and Don'ts Matrix */
.dos-donts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin: 1.35rem 0;
}

.dos-card {
  background: color-mix(in srgb, #ecfdf5 45%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, #10b981 35%, var(--border-color));
  border-top: 4px solid #059669;
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.3rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.04);
}

.dos-header {
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #047857;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.dos-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dos-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.dos-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #059669;
  font-weight: 900;
  font-size: 1rem;
}

.donts-card {
  background: color-mix(in srgb, #fff1f2 45%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, #f43f5e 35%, var(--border-color));
  border-top: 4px solid #e11d48;
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.3rem;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.04);
}

.donts-header {
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #be123c;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.donts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.donts-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.donts-list li::before {
  content: "✕";
  position: absolute;
  left: 0;
  top: 0;
  color: #e11d48;
  font-weight: 900;
  font-size: 1rem;
}

/* Dark theme overrides for Do's & Don'ts */
[data-theme="dark"] .dos-card {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  border-top-color: #10b981;
}

[data-theme="dark"] .dos-header {
  color: #34d399;
}

[data-theme="dark"] .dos-list li::before {
  color: #34d399;
}

[data-theme="dark"] .donts-card {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
  border-top-color: #f43f5e;
}

[data-theme="dark"] .donts-header {
  color: #fb7185;
}

[data-theme="dark"] .donts-list li::before {
  color: #fb7185;
}

/* macOS Terminal/Editor Code Frame */
.mac-code-window {
  background: var(--bg-code);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.15rem 0;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.3);
}

.mac-titlebar {
  background: var(--bg-code-header);
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mac-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.mac-dot.red { background: #ff5f56; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green { background: #27c93f; }

.mac-titlebar-label {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mac-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-mode-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Tabbed Code Header inside window */
.tabbed-code-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tabbed-code-tab {
  flex: 1;
  padding: 0.55rem 1rem;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.tabbed-code-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.tabbed-code-tab.active {
  color: #ffffff;
  border-bottom-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Inline Checkpoint Micro-Quiz */
.inline-checkpoint-card {
  background: var(--bg-surface);
  border: 2px solid color-mix(in srgb, var(--accent-primary) 30%, var(--border-color));
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin: 1.6rem 0 1rem;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.06);
}

.inline-checkpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.inline-checkpoint-badge {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.inline-checkpoint-xp {
  font-size: 0.74rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #fcd34d;
}

[data-theme="dark"] .inline-checkpoint-xp {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.inline-checkpoint-question {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
}

.inline-checkpoint-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.checkpoint-opt-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s var(--spring-ease);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

.checkpoint-opt-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  background: var(--accent-primary-soft);
}

.checkpoint-opt-btn.correct {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
  font-weight: 700;
}

[data-theme="dark"] .checkpoint-opt-btn.correct {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #a7f3d0;
}

.checkpoint-opt-btn.wrong {
  background: #ffe4e6;
  border-color: #f43f5e;
  color: #9f1239;
}

[data-theme="dark"] .checkpoint-opt-btn.wrong {
  background: rgba(244, 63, 94, 0.22);
  border-color: #fb7185;
  color: #fecdd3;
}

.checkpoint-feedback-box {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.45;
  display: none;
  animation: slideUpSpring 0.3s ease;
}

.checkpoint-feedback-box.visible {
  display: block;
}

/* Daily Lesson Action Bar / Footer */
.daily-lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border-color);
}

.mark-day-complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s var(--spring-ease);
}

.mark-day-complete-btn:hover {
  border-color: #10b981;
  color: #065f46;
  transform: translateY(-2px);
}

.mark-day-complete-btn.completed {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Quiz Stepper & Progress Dots */
.quiz-stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.quiz-stepper-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quiz-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--bg-surface);
  transition: all 0.2s ease;
}

.quiz-dot:hover {
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.quiz-dot.correct {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.quiz-dot.wrong {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #ffffff;
}

.quiz-dot.active-step {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
  color: var(--accent-primary);
}

/* Flashcard Mastery Bar */
.flashcard-mastery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 0.75rem;
}

.flashcard-rating-btn {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all 0.2s var(--spring-ease);
}

.flashcard-rating-btn:hover {
  transform: translateY(-2px);
}

.flashcard-rating-btn.mastered {
  border-color: #10b981;
  color: #065f46;
  background: #d1fae5;
}

[data-theme="dark"] .flashcard-rating-btn.mastered {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  border-color: #34d399;
}

/* Mobile & Responsive Rules */
@media (max-width: 960px) {
  .mobile-menu-btn {
    display: flex;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 59px;
    left: -320px;
    width: 300px;
    height: calc(100vh - 59px);
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg-secondary);
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .main-content {
    padding: 1.25rem 1rem 3rem;
  }
  .code-comparison {
    grid-template-columns: 1fr;
  }
  .inline-checkpoint-options {
    grid-template-columns: 1fr;
  }
  .dos-donts-grid {
    grid-template-columns: 1fr;
  }
}
