/* ==========================================================================
   DAY — Do AI Yourself | Nebula Design System
   Cosmic glassmorphism aesthetic with iridescent accents
   ========================================================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Fonts */
  --font-display: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  --font-body: 'DM Sans', -apple-system, 'Helvetica Neue', sans-serif;

  /* Palette — Apple Light */
  --void:       #f5f5f7;
  --deep:       #ffffff;
  --surface:    #ffffff;
  --surface-2:  #f5f5f7;
  --glass:      rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.9);

  /* Text */
  --text-1: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --text-4: #d2d2d7;

  /* Accent — Apple Blue */
  --accent:        #0071e3;
  --accent-dim:    rgba(0, 113, 227, 0.08);
  --accent-glow:   rgba(0, 113, 227, 0.2);

  /* Secondary — Warm Amber */
  --warm:          #ff9f0a;
  --warm-dim:      rgba(255, 159, 10, 0.1);

  /* Gradient */
  --grad-hero:     linear-gradient(135deg, #0071e3 0%, #5856d6 50%, #af52de 100%);
  --grad-card:     linear-gradient(135deg, rgba(0,113,227,0.04), rgba(88,86,214,0.04));
  --grad-border:   linear-gradient(135deg, rgba(0,113,227,0.2), rgba(88,86,214,0.2), rgba(175,82,222,0.2));

  /* Layout */
  --sidebar-w: 260px;
  --header-h:  56px;
  --max-w:     1200px;
  --card-pad:  28px;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 16px;
  --r-full: 980px;

  /* Shadows */
  --sh-sm:  0 1px 4px rgba(0,0,0,0.06);
  --sh-md:  0 4px 16px rgba(0,0,0,0.08);
  --sh-lg:  0 8px 30px rgba(0,0,0,0.12);
  --sh-glow: 0 0 0 rgba(0,0,0,0);

  /* Transitions */
  --ease-out:   cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:     0.2s var(--ease-out);
  --t-norm:     0.3s var(--ease-out);
  --t-slow:     0.5s var(--ease-out);

  /* Z */
  --z-base: 1;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
  --void:       #000000;
  --deep:       #1c1c1e;
  --surface:    #1c1c1e;
  --surface-2:  #2c2c2e;
  --glass:      rgba(28, 28, 30, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(28, 28, 30, 0.9);

  --text-1: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --text-4: #3a3a3c;

  --accent:        #0a84ff;
  --accent-dim:    rgba(10, 132, 255, 0.12);
  --accent-glow:   rgba(10, 132, 255, 0.25);

  --warm:          #ff9f0a;
  --warm-dim:      rgba(255, 159, 10, 0.12);

  --grad-hero:     linear-gradient(135deg, #0a84ff 0%, #5e5ce6 50%, #bf5af2 100%);
  --grad-card:     linear-gradient(135deg, rgba(10,132,255,0.06), rgba(94,92,230,0.06));
  --grad-border:   linear-gradient(135deg, rgba(10,132,255,0.25), rgba(94,92,230,0.25), rgba(191,90,242,0.25));

  --sh-sm:  0 1px 4px rgba(0,0,0,0.3);
  --sh-md:  0 4px 16px rgba(0,0,0,0.4);
  --sh-lg:  0 8px 30px rgba(0,0,0,0.5);
}

/* Dark mode element overrides */
[data-theme="dark"] body { background: var(--void); color: var(--text-1); }

[data-theme="dark"] .sidebar {
  background: var(--glass);
  border-right-color: var(--glass-border);
}

[data-theme="dark"] .mobile-header {
  background: var(--glass);
  border-bottom-color: var(--glass-border);
}

[data-theme="dark"] .hero { background: var(--void); }

[data-theme="dark"] .hero-stats {
  background: var(--surface);
  border-color: var(--glass-border);
  box-shadow: var(--sh-sm);
}

[data-theme="dark"] .filters-section {
  background: var(--glass);
  border-bottom-color: var(--glass-border);
}

[data-theme="dark"] .course-card {
  background: var(--surface);
  border-color: var(--glass-border);
  box-shadow: var(--sh-sm);
}

[data-theme="dark"] .course-card::after {
  background: linear-gradient(180deg, rgba(10,132,255,0.04) 0%, transparent 100%);
}

[data-theme="dark"] .custom-select-btn,
[data-theme="dark"] .search-input,
[data-theme="dark"] .clear-btn {
  background: var(--surface-2);
  border-color: var(--glass-border);
  color: var(--text-1);
}

[data-theme="dark"] .custom-select-dropdown,
[data-theme="dark"] .search-history-dropdown {
  background: var(--surface);
  border-color: var(--glass-border);
  box-shadow: var(--sh-lg);
}

[data-theme="dark"] .custom-select-option:hover { background: var(--surface-2); }

[data-theme="dark"] .domain-close-btn {
  background: var(--surface-2);
  border-color: var(--glass-border);
  color: var(--text-2);
}

[data-theme="dark"] .path-card {
  background: var(--surface-2);
  border-color: var(--glass-border);
}

[data-theme="dark"] .path-card:hover {
  background: var(--surface);
  border-color: rgba(10,132,255,0.2);
}

[data-theme="dark"] .paths-section {
  background: var(--void);
}

[data-theme="dark"] .paths-section::before {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
}

[data-theme="dark"] .footer {
  background: var(--surface);
  border-top-color: var(--glass-border);
}

[data-theme="dark"] .back-to-top {
  background: var(--surface);
  border-color: var(--glass-border);
}

[data-theme="dark"] .popular-course-chip {
  background: rgba(28, 28, 30, 0.6);
  border-color: var(--glass-border);
}

[data-theme="dark"] .popular-course-chip:hover {
  background: rgba(28, 28, 30, 0.9);
}

[data-theme="dark"] .popular-course-domain {
  background: var(--surface-2);
}

[data-theme="dark"] .tag {
  background: rgba(10,132,255,0.1);
}

[data-theme="dark"] .tag:hover {
  background: rgba(10,132,255,0.18);
}

[data-theme="dark"] .nav-count { background: var(--surface-2); }

[data-theme="dark"] .progress-btn {
  background: var(--surface-2);
  border-color: var(--glass-border);
}

[data-theme="dark"] .progress-track { background: var(--surface-2); }

[data-theme="dark"] .view-toggle {
  background: var(--surface-2);
  border-color: var(--glass-border);
}

[data-theme="dark"] .view-toggle-btn.active {
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

[data-theme="dark"] .sidebar-overlay.open {
  background: rgba(0,0,0,0.5);
}

[data-theme="dark"] ::selection {
  background: rgba(10,132,255,0.25);
  color: #f5f5f7;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #48484a; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #636366; }

[data-theme="dark"] .nav-item:hover { background: rgba(10,132,255,0.08); }
[data-theme="dark"] .nav-item.active { background: var(--accent-dim); }
[data-theme="dark"] .nav-toggle:hover { background: var(--accent-dim); color: var(--accent); }
[data-theme="dark"] .nav-course-item:hover { background: rgba(10,132,255,0.08); color: var(--accent); }

[data-theme="dark"] .search-hint {
  background: var(--surface-2);
  color: var(--text-3);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text-1);
  background: var(--void);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #0077ED; }

img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.8rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1em; line-height: 1.7; }
p:last-child { margin-bottom: 0; }

::selection { background: rgba(0,113,227,0.15); color: #1d1d1f; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #86868b; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--t-norm);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,113,227,0.3);
}

.btn-primary:hover {
  color: #fff;
  background: #0077ED;
  box-shadow: 0 4px 20px rgba(0,113,227,0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(0,113,227,0.06);
  color: var(--accent);
  border: 1.5px solid rgba(0,113,227,0.2);
}

.btn-secondary:hover {
  background: rgba(0,113,227,0.1);
  border-color: rgba(0,113,227,0.4);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Section Headers ---------- */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-eyebrow::before,
.section-eyebrow::after {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ==========================================================================
   SIDEBAR — Frosted glass navigation
   ========================================================================== */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-overlay);
  overflow-y: auto;
  transition: transform var(--t-norm);
  scrollbar-width: thin;
  scrollbar-color: var(--text-4) transparent;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity var(--t-fast);
}

.sidebar-logo:hover { opacity: 0.8; }

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}

.logo-icon {
  background: transparent;
  box-shadow: none;
  color: #fff;
  overflow: visible;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,113,227,0.25); }
  50% { box-shadow: 0 4px 16px rgba(0,113,227,0.35); }
}

.logo-info { display: flex; flex-direction: column; }

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 1rem 0.75rem 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  position: relative;
}

.nav-item:hover {
  background: var(--accent-dim);
  color: var(--text-1);
}

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

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item.active .nav-count {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}

.nav-emoji {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-size: 0.62rem;
  color: var(--text-3);
  font-weight: 600;
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  transition: all var(--t-fast);
  min-width: 22px;
  text-align: center;
}

/* Sidebar Expandable Course List */
.nav-item-wrapper { position: relative; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all var(--t-fast);
  color: var(--text-3);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-toggle svg {
  transition: transform var(--t-norm);
}

.nav-item-wrapper.expanded .nav-toggle svg {
  transform: rotate(180deg);
}

.nav-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 0.5rem 0 2.25rem;
}

.nav-item-wrapper.expanded .nav-children {
  /* max-height set dynamically by JS */
}

.nav-course-item {
  display: block;
  padding: 5px 10px;
  font-size: 0.72rem;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--t-fast);
  line-height: 1.5;
}

.nav-course-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.68rem;
  color: var(--text-3);
  flex-shrink: 0;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   MOBILE HEADER
   ========================================================================== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.mobile-logo .logo-mark { width: 28px; height: 28px; font-size: 0.85rem; }
.mobile-logo .logo-icon svg { width: 100%; height: 100%; }
.mobile-logo .logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.mobile-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hamburger {
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 5px; padding: 0;
}

.hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text-1);
  transition: all 0.3s;
  border-radius: 1px;
}

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: calc(var(--z-overlay) - 1);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}

.sidebar-overlay.open { display: block; }

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ==========================================================================
   HERO — Cosmic landing with particle canvas
   ========================================================================== */

.hero {
  min-height: 100vh;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Particle canvas */
#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Gradient orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  will-change: transform;
}

.hero-orb--cyan {
  width: 500px; height: 500px;
  background: rgba(0, 113, 227, 0.06);
  top: 15%; left: 20%;
  animation: orbFloat1 12s ease-in-out infinite;
}

.hero-orb--purple {
  width: 400px; height: 400px;
  background: rgba(88, 86, 214, 0.05);
  bottom: 20%; right: 15%;
  animation: orbFloat2 15s ease-in-out infinite;
}

.hero-orb--pink {
  width: 300px; height: 300px;
  background: rgba(175, 82, 222, 0.04);
  top: 50%; left: 60%;
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.05); }
  66% { transform: translate(25px, -15px) scale(0.9); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, -25px) scale(1.15); }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: heroReveal 0.8s var(--ease-out) 0.2s forwards;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: heroReveal 0.8s var(--ease-out) 0.4s forwards;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: -0.005em;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: heroReveal 0.8s var(--ease-out) 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroReveal 0.8s var(--ease-out) 0.8s forwards;
}

/* Stats glass bar */
.hero-stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-top: 4rem;
  padding: 1.5rem 2.5rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--r-lg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  opacity: 0;
  animation: heroReveal 0.8s var(--ease-out) 1s forwards;
}

.stat-item { text-align: center; }

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-top: 0.35rem;
  font-weight: 500;
}

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

/* ==========================================================================
   UNIFIED NEW-SECTION — Common styles for all 6 new feature modules
   ========================================================================== */

.new-section {
  padding: 0 2rem;
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
}

/* Gradient divider between sections */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--glass-border) 20%, var(--accent-glow) 50%, var(--glass-border) 80%, transparent 100%);
  margin-bottom: 2rem;
  opacity: 0.6;
}

/* Unified module header */
.module-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
  padding: 0;
  flex-wrap: wrap;
}

.module-header-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast);
}

[data-theme="dark"] .module-header-icon-wrap {
  background: rgba(10, 132, 255, 0.15);
}

.module-header-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.module-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.module-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.module-subtitle {
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
  line-height: 1.4;
}

/* Entrance animation for all new sections */
.new-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.new-section--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .new-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   DOMAIN HEADER
   ========================================================================== */

.domain-header {
  padding: 2rem 2rem 0;
  display: none;
}

.domain-header.show { display: block; }

.domain-header-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.domain-emoji { font-size: 2.8rem; }

.domain-info h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.domain-info p {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

.domain-close-btn {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f5f5f7;
  color: var(--text-3);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.domain-close-btn:hover {
  background: #e8e8ed;
  color: var(--text-1);
  border-color: rgba(0,0,0,0.12);
}

/* ==========================================================================
   FILTERS — Sticky glass bar
   ========================================================================== */

.filters-section {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0.75rem 2rem;
}

.filters-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  margin-right: auto;
  padding-left: 0.5rem;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Custom Select Dropdown — replaces native select */

/* Custom Select Dropdown */
.custom-select {
  position: relative;
  min-width: 105px;
}

.custom-select-btn {
  height: 38px;
  padding: 0 32px 0 12px;
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.custom-select-btn svg {
  position: absolute;
  right: 10px;
  color: #86868b;
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.custom-select.open .custom-select-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.custom-select.open .custom-select-btn svg {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: var(--z-overlay);
  display: none;
  overflow: hidden;
  padding: 4px;
}

.custom-select.open .custom-select-dropdown {
  display: block;
  animation: dropdownShow 0.2s var(--ease-out);
}

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

.custom-select-option {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.custom-select-option:hover {
  background: #f5f5f7;
}

.custom-select-option.active {
  background: rgba(0,113,227,0.08);
  color: var(--accent);
}

/* Search Input */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  height: 38px;
  width: 220px;
  padding: 0 12px;
  padding-right: 45px;
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  outline: none;
  transition: all var(--t-fast);
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
  width: 280px;
}

.search-hint {
  position: absolute;
  right: 10px;
  font-size: 0.7rem;
  color: var(--text-3);
  background: #f5f5f7;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.clear-btn {
  height: 38px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid #d2d2d7;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}

.clear-btn:hover {
  background: #f5f5f7;
  color: var(--text-1);
  border-color: #86868b;
}

.results-count {
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}

/* ==========================================================================
   COURSES GRID
   ========================================================================== */

.courses-section {
  padding: 2rem 2rem 6rem;
}

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

/* No results */
.no-results {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--text-3);
}

.no-results-icon { font-size: 3rem; margin-bottom: 1rem; }

.no-results-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

.no-results-hint { font-size: 0.9rem; color: var(--text-3); }

/* ==========================================================================
   COURSE CARD — Glass card with gradient border on hover
   ========================================================================== */

.course-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--r-xl);
  padding: var(--card-pad);
  transition: all 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Scroll reveal — start hidden */
.course-card.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.course-card.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gradient border glow on hover */
.course-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--grad-border);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  z-index: -1;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,113,227,0.15);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.course-card:hover::before {
  opacity: 1;
}

/* Inner glow on hover */
.course-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(0,113,227,0.03) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.course-card:hover::after { opacity: 1; }

/* Card internals */
.course-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.course-platform {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.difficulty-indicator { display: flex; gap: 3px; align-items: center; }

.difficulty-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--surface-2);
  transition: background var(--t-fast);
}

.difficulty-dot.filled { background: var(--accent); }

.course-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.course-title a { color: inherit; }
.course-title a:hover { color: var(--accent); }

.course-institution {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.course-description {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.65;
  letter-spacing: -0.005em;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags */
.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.tag {
  padding: 3px 10px;
  background: rgba(0,113,227,0.06);
  color: var(--accent);
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}

.tag:hover {
  background: rgba(0,113,227,0.12);
  border-color: rgba(0,113,227,0.15);
}

/* Card footer */
.course-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.course-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-duration {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 500;
}

.course-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--t-fast);
}

.course-link:hover { gap: 8px; color: #0077ED; }

.course-link::after {
  content: '→';
  font-size: 1rem;
  line-height: 1;
  transition: transform var(--t-fast);
}

.course-link:hover::after { transform: translateX(2px); }

/* Detail button */
.card-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.625rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2, rgba(0,0,0,0.04));
  border: 1px solid var(--glass-border, rgba(0,0,0,0.08));
  border-radius: var(--r-xs, 4px);
  cursor: pointer;
  transition: all 0.15s;
}
.card-detail-btn:hover {
  color: var(--accent);
  background: var(--accent-dim, rgba(0,113,227,0.08));
  border-color: var(--accent);
}
.card-detail-btn-text { font-weight: 600; }
.card-detail-btn-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
}

/* Course Quiz Buttons (inline in footer) */
.card-quiz-btns {
  display: flex;
  gap: 4px;
}
.card-quiz-btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid;
  border-radius: var(--r-xs, 4px);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  white-space: nowrap;
}
.card-quiz-btn--mid {
  color: #6366f1;
  border-color: #6366f1;
}
.card-quiz-btn--mid:hover {
  background: #6366f1;
  color: #fff;
}
.card-quiz-btn--final {
  color: #f59e0b;
  border-color: #f59e0b;
}
.card-quiz-btn--final:hover {
  background: #f59e0b;
  color: #fff;
}

/* Progress */
.course-progress { margin-top: 1rem; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.progress-label {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 500;
}

.progress-actions { display: flex; gap: 4px; }

.progress-btn {
  padding: 3px 10px;
  background: #f5f5f7;
  border: 1px solid #d2d2d7;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}

.progress-btn:hover {
  background: rgba(0,113,227,0.06);
  border-color: rgba(0,113,227,0.15);
  color: var(--accent);
}

.progress-track {
  height: 3px;
  background: #e8e8ed;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-hero);
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
}

/* ==========================================================================
   LEARNING PATHS — Dark section with gradient cards
   ========================================================================== */

.paths-section {
  padding: 6rem 2rem;
  background: #fff;
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.paths-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.paths-container {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.path-card {
  background: #f5f5f7;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--r-xl);
  padding: 2rem;
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.path-card:hover {
  background: #fff;
  border-color: rgba(0,113,227,0.15);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.path-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.path-card:nth-child(2) .path-icon { animation-delay: 0.3s; }
.path-card:nth-child(3) .path-icon { animation-delay: 0.6s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.path-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

.path-description {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Hits loading */
.hits-loading {
  display: inline-block;
  animation: hitPulse 1.5s ease-in-out infinite;
  color: var(--text-3);
}

@keyframes hitPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.hits-fallback {
  color: var(--text-3);
  font-size: 0.9em;
  cursor: help;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   FAVORITE BUTTON — Heart icon on course cards
   ========================================================================== */

.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  z-index: 2;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.favorite-btn svg {
  width: 16px;
  height: 16px;
  transition: all var(--t-fast);
}

.favorite-btn .heart-outline {
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
}

.favorite-btn .heart-filled {
  stroke: #ff453a;
  fill: #ff453a;
  display: none;
}

.favorite-btn:hover {
  background: rgba(255, 69, 58, 0.08);
  border-color: rgba(255, 69, 58, 0.2);
  transform: scale(1.1);
}

.favorite-btn:hover .heart-outline { stroke: #ff453a; }

.favorite-btn.active .heart-outline { display: none; }
.favorite-btn.active .heart-filled { display: block; }

.favorite-btn.active {
  background: rgba(255, 69, 58, 0.08);
  border-color: rgba(255, 69, 58, 0.2);
}

.favorite-btn.pop {
  animation: heartPop 0.3s var(--ease-spring);
}

[data-theme="dark"] .favorite-btn {
  background: rgba(28, 28, 30, 0.85);
  border-color: var(--glass-border);
}

/* ==========================================================================
   SEARCH HISTORY DROPDOWN
   ========================================================================== */

.search-history-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: var(--z-overlay);
  display: none;
  overflow: hidden;
}

.search-history-dropdown.show { display: block; }

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.search-history-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.search-history-clear {
  font-size: 0.7rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: all var(--t-fast);
}

.search-history-clear:hover {
  color: #0071e3;
  background: rgba(0,113,227,0.06);
}

.search-history-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.search-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background var(--t-fast);
}

.search-history-item:hover { background: #f5f5f7; }

.search-history-icon {
  color: var(--text-3);
  flex-shrink: 0;
  font-size: 0.85rem;
}

.search-history-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-history-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.75rem;
  opacity: 0;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.search-history-item:hover .search-history-remove { opacity: 1; }

.search-history-remove:hover {
  background: rgba(255, 69, 58, 0.08);
  color: #ff453a;
}

.search-history-empty {
  padding: 16px 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ==========================================================================
   VIEW TOGGLE — Grid/List switch
   ========================================================================== */

.view-toggle {
  display: flex;
  gap: 2px;
  background: #f5f5f7;
  border-radius: var(--r-sm);
  padding: 3px;
  border: 1px solid rgba(0,0,0,0.04);
}

.view-toggle-btn {
  width: 32px;
  height: 28px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--t-fast);
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.view-toggle-btn:hover { color: var(--text-2); }

.view-toggle-btn.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* List view mode */
.courses-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.courses-grid.list-view .course-card {
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.courses-grid.list-view .course-card-header {
  display: none;
}

.courses-grid.list-view .course-title {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.courses-grid.list-view .course-institution {
  margin-bottom: 0.4rem;
}

.courses-grid.list-view .course-description {
  -webkit-line-clamp: 2;
  margin-bottom: 0.5rem;
  flex: unset;
}

.courses-grid.list-view .course-tags {
  margin-bottom: 0.5rem;
}

.courses-grid.list-view .course-card-footer {
  border-top: none;
  padding-top: 0;
}

.courses-grid.list-view .course-progress {
  margin-top: 0.5rem;
  min-width: 180px;
  flex-shrink: 0;
}

.courses-grid.list-view .course-card:hover {
  transform: translateY(-2px);
}

.courses-grid.list-view .favorite-btn {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.courses-grid.list-view .favorite-btn:hover {
  transform: translateY(-50%) scale(1.1);
}

/* ==========================================================================
   POPULAR COURSES — Hero section
   ========================================================================== */

.popular-courses {
  margin-top: 2.5rem;
  max-width: var(--max-w);
  width: 100%;
}

.popular-courses-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-align: center;
}

.popular-courses-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
  -webkit-overflow-scrolling: touch;
}

.popular-courses-scroll::-webkit-scrollbar {
  height: 4px;
}

.popular-courses-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.popular-courses-scroll::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 2px;
}

.popular-course-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.popular-course-chip:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,113,227,0.15);
  transform: translateY(-2px);
}

.popular-course-rank {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,113,227,0.08);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popular-course-rank.top-3 {
  background: rgba(255,159,10,0.1);
  color: var(--warm);
}

.popular-course-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-1);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popular-course-chip:hover .popular-course-name { color: var(--accent); }

.popular-course-domain {
  font-size: 0.65rem;
  color: var(--text-3);
  padding: 1px 6px;
  background: #f5f5f7;
  border-radius: var(--r-full);
}

/* ==========================================================================
   SIDEBAR — Favorites nav item
   ========================================================================== */

.nav-item-favorites {
  position: relative;
}

.nav-item-favorites .nav-emoji {
  font-size: 1rem;
}

.nav-favorites-count {
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  background: rgba(255, 69, 58, 0.08);
  color: #ff453a;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.nav-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 6px 0.75rem;
}

/* ==========================================================================
   SCROLL PROGRESS BAR
   ========================================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--grad-hero);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

@media (max-width: 640px) {
  .scroll-progress { height: 2px; }
}

/* ==========================================================================
   THEME TOGGLE — Floating button (top-right)
   ========================================================================== */

.theme-toggle-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s var(--ease-spring);
  color: var(--text-2);
  box-shadow: var(--sh-sm);
}

.theme-toggle-fab:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: var(--sh-md);
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--glass-hover);
}

.theme-toggle-fab:active {
  transform: scale(0.95);
}

.theme-toggle-fab svg {
  width: 20px;
  height: 20px;
  transition: all 0.4s var(--ease-spring);
}

/* Show sun in light mode, moon in dark mode */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
.is-dark .theme-icon-sun { display: block; }
.is-dark .theme-icon-moon { display: none; }

.theme-toggle-icon {
  width: 28px;
  text-align: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-spring);
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

/* ==========================================================================
   DASHBOARD — Learning statistics section
   ========================================================================== */

.dashboard-section {
  padding: 2.5rem 2rem;
  background: var(--void);
}

.dashboard-container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.dashboard-card {
  background: var(--deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.4s var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-hero);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: rgba(0,113,227,0.15);
}

.dashboard-card:hover::before { opacity: 1; }

[data-theme="dark"] .dashboard-card {
  background: var(--surface);
  border-color: var(--glass-border);
}

[data-theme="dark"] .dashboard-card:hover {
  border-color: rgba(10,132,255,0.2);
}

.dashboard-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.dashboard-icon--completed { background: rgba(34, 197, 94, 0.1); }
.dashboard-icon--progress { background: rgba(0, 113, 227, 0.1); }
.dashboard-icon--favorites { background: rgba(255, 69, 58, 0.1); }
.dashboard-icon--hours { background: rgba(255, 159, 10, 0.1); }

[data-theme="dark"] .dashboard-icon--completed { background: rgba(34, 197, 94, 0.15); }
[data-theme="dark"] .dashboard-icon--progress { background: rgba(10, 132, 255, 0.15); }
[data-theme="dark"] .dashboard-icon--favorites { background: rgba(255, 69, 58, 0.15); }
[data-theme="dark"] .dashboard-icon--hours { background: rgba(255, 159, 10, 0.15); }

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

.dashboard-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.03em;
  line-height: 1;
}

.dashboard-label {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 4px;
}

/* ==========================================================================
   COURSE NOTES MODAL
   ========================================================================== */

.notes-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.notes-modal-overlay.show {
  display: flex;
  opacity: 1;
}

.notes-modal {
  background: var(--deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s var(--ease-spring);
}

.notes-modal-overlay.show .notes-modal {
  transform: scale(1) translateY(0);
}

[data-theme="dark"] .notes-modal {
  background: var(--surface);
}

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

.notes-modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.notes-modal-close:hover {
  background: rgba(255, 69, 58, 0.1);
  color: #ff453a;
  border-color: rgba(255, 69, 58, 0.2);
}

.notes-modal-course {
  padding: 0.75rem 1.5rem;
  background: var(--surface-2);
  font-size: 0.82rem;
  color: var(--text-2);
}

[data-theme="dark"] .notes-modal-course { background: var(--surface-2); }

.notes-modal-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.notes-textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-1);
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color var(--t-fast);
}

.notes-textarea::placeholder { color: var(--text-3); }

.notes-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.notes-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.notes-timestamp {
  font-size: 0.72rem;
  color: var(--text-3);
}

.notes-actions { display: flex; gap: 0.5rem; }

.notes-save-btn {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.notes-save-btn:hover {
  background: #0077ED;
  transform: translateY(-1px);
}

.notes-delete-btn {
  padding: 8px 16px;
  background: transparent;
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.2);
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.notes-delete-btn:hover {
  background: rgba(255, 69, 58, 0.08);
}

/* Note indicator on course card */
.note-indicator {
  position: absolute;
  top: 12px;
  right: 48px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm);
  z-index: 2;
  box-shadow: 0 0 0 2px #fff;
}

[data-theme="dark"] .note-indicator {
  box-shadow: 0 0 0 2px var(--surface);
}

/* ==========================================================================
   AI LEARNING PATH WIZARD
   ========================================================================== */

/* Overlay */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.wizard-overlay.show {
  display: flex;
  opacity: 1;
}

/* Modal */
.wizard-modal {
  background: var(--deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s var(--ease-spring);
  overflow: hidden;
}

.wizard-overlay.show .wizard-modal {
  transform: scale(1) translateY(0);
}

[data-theme="dark"] .wizard-modal {
  background: var(--surface);
  border-color: var(--glass-border);
}

/* Header */
.wizard-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.wizard-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard-progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: var(--grad-hero);
  border-radius: var(--r-full);
  transition: width 0.4s var(--ease-out);
  width: 0;
}

.wizard-progress-text {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 500;
  text-align: right;
}

.wizard-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-2);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.wizard-close:hover {
  background: var(--text-4);
  color: var(--text-1);
}

/* Body */
.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  min-height: 300px;
  transition: opacity 0.15s ease;
}

.wizard-fade-out {
  opacity: 0;
}

.wizard-fade-in {
  animation: wizardFadeIn 0.3s ease;
}

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

/* Footer */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
  gap: 1rem;
}

.wizard-footer .btn {
  min-width: 100px;
  justify-content: center;
}

.wizard-footer .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Welcome Page */
.wizard-welcome {
  text-align: center;
  padding: 1rem 0;
}

.wizard-welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.wizard-welcome-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 0.75rem;
}

.wizard-welcome-desc {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 2rem;
}

.wizard-welcome-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 380px;
  margin: 0 auto 2rem;
}

.wizard-welcome-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  color: var(--text-1);
  font-weight: 500;
}

.wizard-welcome-feature-icon {
  font-size: 1.1rem;
}

.wizard-welcome-hint {
  font-size: 0.8rem;
  color: var(--text-3);
}

/* Question Page */
.wizard-question {
  max-width: 520px;
  margin: 0 auto;
}

.wizard-question-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wizard-question-icon {
  font-size: 1.3rem;
}

.wizard-question-number {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-question-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.4rem);
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 1.5rem;
  line-height: 1.4;
}

/* Options */
.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wizard-option {
  position: relative;
  padding: 1rem 1.25rem;
  padding-right: 3rem;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  overflow: hidden;
}

.wizard-option:hover {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.03);
}

.wizard-option.selected {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.06);
  box-shadow: 0 0 0 1px var(--accent);
}

[data-theme="dark"] .wizard-option {
  background: var(--surface-2);
}

[data-theme="dark"] .wizard-option:hover {
  background: rgba(0, 113, 227, 0.08);
}

[data-theme="dark"] .wizard-option.selected {
  background: rgba(0, 113, 227, 0.12);
}

.wizard-option-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}

.wizard-option-desc {
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.4;
}

.wizard-option-check {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.wizard-option-check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--t-fast);
  color: #fff;
}

.wizard-option.selected .wizard-option-check {
  background: var(--accent);
  border-color: var(--accent);
}

.wizard-option.selected .wizard-option-check svg {
  opacity: 1;
  transform: scale(1);
}

/* Result Page */
.wizard-result {
  max-width: 560px;
  margin: 0 auto;
}

.wizard-result-header {
  text-align: center;
  margin-bottom: 2rem;
}

.wizard-result-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.wizard-result-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 0.75rem;
}

.wizard-result-summary {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}

/* Stats */
.wizard-result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.wizard-result-stat {
  text-align: center;
  padding: 1rem 0.5rem;
  background: var(--surface-2);
  border-radius: var(--r-md);
}

[data-theme="dark"] .wizard-result-stat {
  background: var(--surface);
}

.wizard-result-stat-value {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.wizard-result-stat-label {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
}

/* Phases */
.wizard-result-phases {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.wizard-phase {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

[data-theme="dark"] .wizard-phase {
  background: var(--surface-2);
}

.wizard-phase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.wizard-phase-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.wizard-phase-info {
  flex: 1;
  min-width: 0;
}

.wizard-phase-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 2px;
}

.wizard-phase-desc {
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 0;
}

.wizard-phase-meta {
  text-align: right;
  flex-shrink: 0;
}

.wizard-phase-time {
  display: block;
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 600;
}

.wizard-phase-hours {
  display: block;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 2px;
}

.wizard-phase-courses {
  padding: 0.5rem 0;
}

/* Course items in result */
.wizard-result-course {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  transition: background var(--t-fast);
}

.wizard-result-course:hover {
  background: var(--surface-2);
}

[data-theme="dark"] .wizard-result-course:hover {
  background: var(--surface);
}

.wizard-result-course-info {
  flex: 1;
  min-width: 0;
}

.wizard-result-course-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-result-course-meta {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 2px;
}

.wizard-result-course-dot {
  margin: 0 4px;
}

.wizard-result-course-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.wizard-result-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.wizard-result-badge--hours {
  background: var(--surface-2);
  color: var(--text-2);
}

[data-theme="dark"] .wizard-result-badge--hours {
  background: var(--surface);
}

.wizard-result-badge--diff {
  background: color-mix(in srgb, var(--diff-color, var(--accent)) 12%, transparent);
  color: var(--diff-color, var(--accent));
}

.wizard-result-course-link {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.wizard-result-course-link:hover {
  background: var(--surface-2);
  color: var(--accent);
}

[data-theme="dark"] .wizard-result-course-link:hover {
  background: var(--surface);
}

/* Skills */
.wizard-result-skills {
  margin-bottom: 2rem;
}

.wizard-result-skills-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 1rem;
}

.wizard-result-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wizard-skill-tag {
  padding: 6px 14px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 500;
}

[data-theme="dark"] .wizard-skill-tag {
  background: var(--surface);
}

/* Result Actions */
.wizard-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding-top: 0.5rem;
}

.wizard-result-actions .btn {
  min-width: 140px;
  justify-content: center;
}

/* Hero wizard trigger button */
.btn-wizard {
  position: relative;
  overflow: hidden;
}

.btn-wizard::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--grad-hero);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.btn-wizard:hover::before {
  opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
  .wizard-overlay {
    padding: 0;
  }

  .wizard-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }

  .wizard-body {
    padding: 1.5rem 1rem;
  }

  .wizard-header,
  .wizard-footer {
    padding: 0.75rem 1rem;
  }

  .wizard-welcome-features {
    grid-template-columns: 1fr;
  }

  .wizard-result-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .wizard-phase-header {
    flex-wrap: wrap;
  }

  .wizard-phase-meta {
    text-align: left;
    width: 100%;
    display: flex;
    gap: 0.75rem;
    padding-left: 2.25rem;
  }

  .wizard-result-course {
    flex-wrap: wrap;
  }

  .wizard-result-course-badges {
    order: 3;
    width: 100%;
    padding-left: 0;
  }

  .wizard-result-actions {
    flex-direction: column;
  }

  .wizard-result-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   WIZARD PERSISTENT RESULT CARD
   ========================================================================== */

.wpc-section {
  padding: 0 1.5rem 1.5rem;
}

.wpc-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: var(--max-w);
  margin: 0 auto;
  transition: box-shadow var(--t-norm);
}

.wpc-card:hover {
  box-shadow: var(--sh-md);
}

[data-theme="dark"] .wpc-card {
  background: var(--surface);
}

.wpc-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.wpc-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.wpc-card-title-group {
  flex: 1;
  min-width: 0;
}

.wpc-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.wpc-card-date {
  font-size: 0.72rem;
  color: var(--text-3);
}

.wpc-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
  border-radius: var(--r-full);
}

.wpc-card-body {
  padding: 1rem 1.5rem;
}

.wpc-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.wpc-stat {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.wpc-stat-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.wpc-stat-label {
  font-size: 0.78rem;
  color: var(--text-3);
}

.wpc-stat-divider {
  width: 1px;
  height: 16px;
  background: var(--text-4);
}

.wpc-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wpc-course-tag {
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

[data-theme="dark"] .wpc-course-tag {
  background: var(--surface-2);
}

.wpc-course-tag--more {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
  .wpc-section { padding: 0 1rem 1rem; }

  .wpc-card-header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .wpc-card-actions {
    width: 100%;
    padding-top: 0.5rem;
  }

  .wpc-card-actions .btn {
    flex: 1;
  }

  .wpc-card-body {
    padding: 0.75rem 1rem;
  }

  .wpc-stats {
    gap: 0.5rem;
  }

  .wpc-stat-divider {
    display: none;
  }

  .wpc-stat {
    flex-basis: calc(50% - 0.25rem);
  }
}

/* Print: hide wizard */
@media print {
  .wizard-overlay { display: none !important; }
  .wpc-section { display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wizard-modal,
  .wizard-progress-fill,
  .wizard-option,
  .wizard-option-check,
  .wizard-option-check svg,
  .wpc-card {
    transition: none;
  }

  .wizard-fade-in {
    animation: none;
  }
}

/* ==========================================================================
   COURSE CARD ACTION BUTTONS
   ========================================================================== */

.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.85rem;
}

[data-theme="dark"] .card-action-btn {
  background: rgba(28, 28, 30, 0.85);
  border-color: var(--glass-border);
}

.card-action-btn:hover {
  transform: scale(1.1);
}

.card-action-btn--share:hover {
  background: rgba(0, 113, 227, 0.1);
  border-color: rgba(0, 113, 227, 0.2);
}

.card-action-btn--notes:hover {
  background: rgba(255, 159, 10, 0.1);
  border-color: rgba(255, 159, 10, 0.2);
}

.card-action-btn--fav {
  background: rgba(255, 255, 255, 0.85);
}

.card-action-btn--fav .heart-outline {
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
}

.card-action-btn--fav .heart-filled {
  stroke: #ff453a;
  fill: #ff453a;
  display: none;
}

.card-action-btn--fav:hover .heart-outline { stroke: #ff453a; }

.card-action-btn--fav.active .heart-outline { display: none; }
.card-action-btn--fav.active .heart-filled { display: block; }

.card-action-btn--fav.active {
  background: rgba(255, 69, 58, 0.08);
  border-color: rgba(255, 69, 58, 0.2);
}

.card-action-btn svg {
  width: 14px;
  height: 14px;
}

.card-action-btn.pop {
  animation: heartPop 0.3s var(--ease-spring);
}

/* Completion celebration */
.course-card.completed {
  border-color: rgba(34, 197, 94, 0.2);
}

.course-card.completed::before {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.1));
  opacity: 1;
}

@keyframes celebratePop {
  0% { transform: scale(1); }
  30% { transform: scale(1.05); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.course-card.celebrate {
  animation: celebratePop 0.5s var(--ease-spring);
}

/* ==========================================================================
   LEARNING PATHS — Timeline style
   ========================================================================== */

.path-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.path-step {
  font-size: 0.85rem;
  color: var(--text-2);
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.4;
  transition: color var(--t-fast);
  position: relative;
}

.path-step:last-child { border-bottom: none; }

.path-step:hover { color: var(--text-1); }

.step-number {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,113,227,0.08);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0,113,227,0.1);
  transition: all var(--t-fast);
}

.path-step:hover .step-number {
  background: rgba(0,113,227,0.12);
  border-color: rgba(0,113,227,0.2);
}

[data-theme="dark"] .path-step {
  border-bottom-color: var(--glass-border);
}

.path-steps::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: rgba(0,113,227,0.1);
  border-radius: 1px;
}

[data-theme="dark"] .path-steps::before {
  background: rgba(10,132,255,0.15);
}

.path-step:hover ~ .path-step .step-number,
.path-step:hover .step-number {
  background: rgba(0,113,227,0.15);
  border-color: rgba(0,113,227,0.25);
}

/* Path card top gradient bar */
.path-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.path-card:nth-child(1)::after {
  background: linear-gradient(90deg, #0071e3, #5856d6);
}

.path-card:nth-child(2)::after {
  background: linear-gradient(90deg, #5856d6, #af52de);
}

.path-card:nth-child(3)::after {
  background: linear-gradient(90deg, #af52de, #ec4899);
}

.path-card:hover::after { opacity: 1; }

/* ==========================================================================
   ENHANCED FOOTER
   ========================================================================== */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem 2rem;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: var(--max-w);
  margin: 0 auto 2rem;
}

.footer-brand { }

.footer-brand-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 300px;
}

.footer-column-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.footer-column-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column-links a {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
  transition: color var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-text {
  font-size: 0.78rem;
  color: var(--text-3);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 1rem;
  transition: all var(--t-fast);
}

.footer-social-link:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,113,227,0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   BACK TO TOP — Progress ring
   ========================================================================== */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--deep);
  border: 1px solid var(--glass-border);
  color: var(--accent);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-norm);
  z-index: var(--z-sticky);
  box-shadow: var(--sh-md);
  overflow: visible;
}

.back-to-top svg.progress-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.back-to-top svg.progress-ring circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.back-to-top .back-to-top-arrow {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   TOAST — Improved styling
   ========================================================================== */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

#toast-container > div {
  pointer-events: auto;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-orb { display: none; }
  #particleCanvas { display: none; }
}

/* ==========================================================================
   INSPIRATIONAL QUOTE — Random quote display
   ========================================================================== */

#inspirationalQuote {
  /* inherits .new-section padding */
}

.iq-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 2rem 2.5rem;
  position: relative;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-norm), transform var(--t-norm);
  text-align: center;
  overflow: hidden;
}

.iq-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-hero);
  opacity: 0.6;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.iq-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.iq-icon {
  color: var(--accent);
  opacity: 0.4;
  margin-bottom: 0.75rem;
}

.iq-icon svg {
  display: inline-block;
  vertical-align: middle;
}

.iq-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.7;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.iq-author {
  font-size: 0.85rem;
  color: var(--text-3);
  font-weight: 500;
}

/* Dark mode */
[data-theme="dark"] .iq-card {
  background: var(--surface);
  border-color: var(--glass-border);
}

[data-theme="dark"] .iq-icon {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
  .iq-card {
    padding: 1.5rem 1.25rem;
  }
  .iq-text {
    font-size: 1rem;
  }
}

/* ==========================================================================
   YEAR TIMELINE — Annual progress bar
   ========================================================================== */

.yt-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-norm), transform var(--t-norm);
  position: relative;
}

.yt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-hero);
  opacity: 0.6;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  z-index: 1;
}

.yt-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.yt-header {
  /* deprecated — using .module-header */
  display: none;
}

.yt-header-left {
  /* deprecated */
}

.yt-header-icon {
  /* deprecated */
}

.yt-header-title {
  /* deprecated — using .module-title */
}

.yt-year {
  /* deprecated — using .module-subtitle */
}

.yt-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Info row */
.yt-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.yt-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.yt-info-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.yt-info-label {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
}

.yt-info-divider {
  width: 1px;
  height: 28px;
  background: var(--glass-border);
}

/* Track wrapper */
.yt-track-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

/* Season labels */
.yt-seasons-row {
  display: flex;
  position: relative;
  height: 22px;
  margin-bottom: 4px;
}

.yt-season-label {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
}

.yt-season-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.yt-season-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* Track bar */
.yt-track {
  position: relative;
  height: 10px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: visible;
}

.yt-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--grad-hero);
  border-radius: var(--r-full);
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(0, 113, 227, 0.25);
}

/* Month ticks */
.yt-months-row {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.yt-month-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.yt-month-tick-line {
  width: 1px;
  height: 10px;
  background: var(--glass-border);
}

[data-theme="dark"] .yt-month-tick-line {
  background: rgba(255, 255, 255, 0.1);
}

.yt-month-tick--current .yt-month-tick-line {
  background: var(--accent);
  width: 2px;
}

.yt-month-tick-label {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
}

.yt-month-tick--current .yt-month-tick-label {
  color: var(--accent);
  font-weight: 700;
}

/* Current date marker */
.yt-current-marker {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.yt-marker-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 113, 227, 0.15);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  white-space: nowrap;
  box-shadow: var(--sh-sm);
}

.yt-marker-arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(0, 113, 227, 0.15);
  margin-top: -1px;
}

.yt-marker-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent), 0 0 8px rgba(0, 113, 227, 0.3);
  margin-top: 1px;
}

/* Footer row */
.yt-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
}

.yt-footer-text {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 500;
}

.yt-footer-text strong {
  color: var(--text-2);
  font-weight: 700;
}

/* Pulse animation on marker dot */
@keyframes ytPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 8px rgba(0, 113, 227, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15), 0 0 12px rgba(0, 113, 227, 0.4); }
}

.yt-marker-dot {
  animation: ytPulse 2s ease-in-out infinite;
}

/* Dark mode adjustments */
[data-theme="dark"] .yt-card {
  background: var(--surface);
  border-color: var(--glass-border);
}

[data-theme="dark"] .yt-track {
  background: var(--surface-2);
}

[data-theme="dark"] .yt-marker-dot {
  border-color: var(--surface);
}

[data-theme="dark"] .yt-marker-label {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.2);
}

/* Responsive */
@media (max-width: 640px) {
  .yt-body { padding: 1rem; }

  .yt-info-row {
    gap: 0.75rem;
  }

  .yt-info-value { font-size: 1.1rem; }
  .yt-info-divider { height: 20px; }

  .yt-month-tick-label { font-size: 0.55rem; }

  .yt-marker-label { font-size: 0.62rem; }

  .yt-footer-row {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }
}

/* ==========================================================================
   DAILY NEWS — AI/Tech news feed
   ========================================================================== */

#dailyNews {
  /* inherits .new-section padding */
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 0.5rem 0;
  position: relative;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-norm), transform var(--t-norm);
  overflow: hidden;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-hero);
  opacity: 0.6;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.news-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.news-item {
  display: block;
  padding: 1rem 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
  animation: newsItemIn 0.4s var(--ease-out) both;
  animation-delay: calc(var(--delay, 0) * 1s);
}

.news-item:hover {
  background: var(--accent-dim);
}

.news-item + .news-item {
  border-top: 1px solid var(--glass-border);
}

.news-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.news-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--badge-color, var(--accent)) 12%, transparent);
  color: var(--badge-color, var(--accent));
  white-space: nowrap;
}

.news-item-time {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-left: auto;
}

.news-item-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 0.35rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-summary {
  font-size: 0.82rem;
  color: var(--text-2);
  margin: 0 0 0.5rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-3);
}

.news-item-source {
  font-weight: 500;
}

.news-item-dot {
  opacity: 0.5;
}

.news-item-readtime {
  opacity: 0.8;
}

/* Stale data badge */
.news-stale-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-full);
  font-size: 0.65rem;
  font-weight: 500;
  background: var(--warm-dim);
  color: var(--warm);
  margin-left: 0.5rem;
}

/* Skeleton loading */
.news-skeleton .skeleton-badge {
  width: 60px;
  height: 18px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

.news-skeleton .skeleton-time {
  width: 50px;
  height: 14px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  margin-left: auto;
  animation: skeletonPulse 1.5s ease-in-out infinite 0.1s;
}

.news-skeleton .skeleton-title {
  width: 85%;
  height: 16px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  margin-bottom: 0.5rem;
  animation: skeletonPulse 1.5s ease-in-out infinite 0.2s;
}

.news-skeleton .skeleton-summary {
  width: 100%;
  height: 14px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  margin-bottom: 0.5rem;
  animation: skeletonPulse 1.5s ease-in-out infinite 0.3s;
}

.news-skeleton .skeleton-source {
  width: 80px;
  height: 12px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  animation: skeletonPulse 1.5s ease-in-out infinite 0.4s;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

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

/* Fallback state */
.news-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  text-align: center;
}

.news-fallback-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.news-fallback-text {
  font-size: 0.9rem;
  color: var(--text-3);
  margin: 0 0 1rem;
}

.news-fallback-retry {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}

.news-fallback-retry:hover {
  background: var(--accent);
  filter: brightness(1.1);
  transform: scale(1.02);
}

/* Dark mode */
[data-theme="dark"] .news-card {
  background: var(--surface);
  border-color: var(--glass-border);
}

[data-theme="dark"] .news-item:hover {
  background: rgba(10, 132, 255, 0.08);
}

[data-theme="dark"] .news-category-badge {
  background: color-mix(in srgb, var(--badge-color, var(--accent)) 18%, transparent);
}

/* Responsive */
@media (max-width: 640px) {
  .news-item {
    padding: 0.875rem 1.25rem;
  }

  .news-item-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .news-item-time {
    margin-left: 0;
    width: 100%;
    order: -1;
  }

  .news-item-title {
    font-size: 0.9rem;
  }

  .news-item-summary {
    font-size: 0.78rem;
    -webkit-line-clamp: 2;
  }
}

/* ==========================================================================
   COURSE DETAIL EXPAND PANEL
   ========================================================================== */

.cd-panel {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s var(--ease-out), opacity 0.3s var(--ease-out), margin 0.3s var(--ease-out);
  margin-top: 0;
  border-radius: var(--r-xl);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--sh-md);
}

.cd-panel--open {
  max-height: 800px;
  opacity: 1;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.cd-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.cd-domain-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
}

.cd-platform {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.cd-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cd-section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  margin: 0;
}

.cd-description {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.7;
  letter-spacing: -0.005em;
  margin: 0;
}

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

.cd-list li {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}

.cd-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.cd-outcomes li::before {
  background: #22c55e;
  opacity: 0.6;
}

/* Related courses */
.cd-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.cd-related-empty {
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 0;
}

.cd-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  text-decoration: none;
  transition: all var(--t-fast);
  cursor: pointer;
}

.cd-related-card:hover {
  background: var(--glass-hover);
  border-color: rgba(0,113,227,0.15);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}

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

.cd-related-domain {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.cd-related-difficulty {
  font-size: 0.55rem;
  color: var(--text-3);
  letter-spacing: 1px;
}

.cd-related-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cd-related-meta {
  font-size: 0.7rem;
  color: var(--text-3);
}

/* Action buttons */
.cd-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
}

.cd-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.25rem;
  background: var(--grad-hero);
  color: #fff;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--t-fast);
  box-shadow: 0 2px 12px rgba(0,113,227,0.25);
}

.cd-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,113,227,0.35);
  color: #fff;
}

.cd-close-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}

.cd-close-btn:hover {
  color: var(--text-1);
  border-color: var(--text-3);
  background: var(--surface-2);
}

/* Detail button on card */
.card-action-btn--detail:hover {
  background: rgba(88, 86, 214, 0.1);
  border-color: rgba(88, 86, 214, 0.2);
}

/* Dark mode */
[data-theme="dark"] .cd-panel {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--sh-md);
}

[data-theme="dark"] .cd-related-card {
  background: var(--surface);
  border-color: var(--glass-border);
}

[data-theme="dark"] .cd-related-card:hover {
  background: var(--surface-2);
  border-color: rgba(10,132,255,0.2);
}

[data-theme="dark"] .cd-start-btn {
  box-shadow: 0 2px 12px rgba(10,132,255,0.3);
}

[data-theme="dark"] .cd-start-btn:hover {
  box-shadow: 0 4px 20px rgba(10,132,255,0.4);
}

[data-theme="dark"] .cd-close-btn {
  border-color: var(--glass-border);
  color: var(--text-3);
}

[data-theme="dark"] .cd-close-btn:hover {
  color: var(--text-1);
  border-color: var(--text-3);
  background: var(--surface-2);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .cd-content { padding: 1rem; gap: 1rem; }

  .cd-related {
    grid-template-columns: 1fr;
  }

  .cd-actions {
    flex-direction: column;
  }

  .cd-start-btn, .cd-close-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Print */
@media print {
  .cd-panel { display: none !important; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Mobile */
@media (max-width: 640px) {
  .theme-toggle-fab {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
  .theme-toggle-fab svg {
    width: 18px;
    height: 18px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 400;
  }

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

  .mobile-header { display: flex; }

  .main-content {
    margin-left: 0;
    padding-top: var(--header-h);
  }

  .hero {
    padding: 4rem 1rem;
    min-height: 85vh;
  }

  .hero-stats {
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
  }

  .stat-value { font-size: 2rem; }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .domain-header { padding: 2rem 1rem 0; }

  .domain-header-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .filters-section {
    padding: 0.75rem 1rem;
    position: static;
  }

  .filters-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-title { margin-right: 0; text-align: center; }

  .filter-controls {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .custom-select, .clear-btn { width: 100%; }

  .results-count { text-align: center; }

  .courses-section { padding: 1rem 1rem 4rem; }

  .courses-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .course-card { padding: 1.25rem; }

  .paths-section { padding: 4rem 1rem; }

  .paths-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .path-card { padding: 1.5rem; }

  .dashboard-section { padding: 1.5rem 1rem; }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .dashboard-card { padding: 1rem; }

  .dashboard-value { font-size: 1.4rem; }

  .dashboard-icon { width: 40px; height: 40px; font-size: 1.2rem; }


  .footer { padding: 2rem 1rem 1.5rem; }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-brand-desc { max-width: none; }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-social { justify-content: center; }

  .card-actions {
    top: 8px;
    right: 8px;
    gap: 4px;
  }

  .card-action-btn { width: 28px; height: 28px; font-size: 0.75rem; }

  .notes-modal { max-width: 100%; max-height: 90vh; }
  .notes-modal-overlay { padding: 1rem; }

  .back-to-top {
    bottom: 1rem; right: 1rem;
    width: 40px; height: 40px;
  }

  /* Unified new-section mobile */
  .new-section {
    padding: 0 1rem;
  }

  .section-divider {
    margin-bottom: 1.5rem;
  }

  .module-header {
    gap: 0.625rem;
    margin-bottom: 1rem;
  }

  .module-header-icon-wrap {
    width: 38px;
    height: 38px;
  }

  .module-header-icon {
    font-size: 1.15rem;
  }

  .module-title {
    font-size: 1.1rem;
  }

  .module-subtitle {
    font-size: 0.75rem;
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
  .hero { padding: 5rem 1.5rem; }

  .new-section {
    padding: 0 1.5rem;
  }
  .hero-stats { gap: 2rem; }
  .courses-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .paths-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-section { padding: 0.75rem 1.5rem; }
  .courses-section { padding: 1.5rem 1.5rem 5rem; }
  .dashboard-section { padding: 2rem 1.5rem; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
}

/* Desktop */
@media (min-width: 1025px) {
  .sidebar { transform: none !important; }
  .mobile-header { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* Large desktop */
@media (min-width: 1281px) {
  .courses-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .hero-content { max-width: 900px; }
}

/* XL */
@media (min-width: 1537px) {
  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
  }
  .paths-grid { gap: 1.5rem; }
}

/* ==========================================================================
   VISITOR MAP — World map with visitor dots
   ========================================================================== */

/* Landscape phones */
@media (max-width: 900px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 3rem 1rem; }
  .hero-stats { margin-top: 2rem; }
}

/* High DPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .sidebar, .filters-section, .footer, .course-card-footer {
    border-width: 0.5px;
  }
}

/* Print */
@media print {
  .sidebar, .mobile-header, .back-to-top, .filters-section, .hero-actions,
  #particleCanvas, .hero-orb, .scroll-progress, .dashboard-section,
  .notes-modal-overlay, .card-actions, .theme-toggle-fab { display: none !important; }
  .main-content { margin-left: 0; }
  .course-card { break-inside: avoid; opacity: 1 !important; transform: none !important; }
  .hero { min-height: auto; padding: 2rem 0; background: #fff; }
  body { color: #000; background: #fff; }
}

/* Touch */
@media (hover: none) {
  .course-card:hover, .path-card:hover, .btn:hover { transform: none; }
}

/* Safe area */
@supports (padding-top: env(safe-area-inset-top)) {
  .mobile-header { padding-top: env(safe-area-inset-top); }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   CODE PLAYGROUND — In-browser Python code exercises
   ========================================================================== */

/* Header bar with filters */
.cp-header-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cp-stats {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-right: auto;
}

.cp-filter-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cp-filter-btn,
.cp-diff-btn {
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.cp-filter-btn:hover,
.cp-diff-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,113,227,0.15);
}

.cp-filter-btn.active,
.cp-diff-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Exercise card grid */
.cp-exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Exercise card */
.cp-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
}

.cp-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--grad-border);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  z-index: -1;
}

.cp-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,113,227,0.15);
  box-shadow: var(--sh-md);
}

.cp-card:hover::before {
  opacity: 1;
}

.cp-card--completed {
  border-color: rgba(34, 197, 94, 0.2);
}

.cp-card--completed::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, #10b981);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.cp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.cp-card-domain {
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.cp-card-badge {
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.cp-card-badge--done {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.cp-card-badge--peeked {
  background: rgba(255, 159, 10, 0.1);
  color: var(--warm);
}

.cp-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.cp-card-desc {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cp-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
}

.cp-card-diff {
  display: flex;
  gap: 3px;
  align-items: center;
}

.cp-star {
  font-size: 0.5rem;
  color: var(--text-4);
  transition: color var(--t-fast);
}

.cp-star.filled {
  color: var(--accent);
}

.cp-card-time {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
}

.cp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
  font-size: 0.95rem;
}

/* Workspace */
.cp-workspace {
  animation: fadeInUp 0.3s var(--ease-out);
}

.cp-workspace-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cp-back-btn {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.cp-back-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(0,113,227,0.15);
}

.cp-workspace-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.cp-workspace-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.cp-meta-tag {
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
}

/* Editor area */
.cp-workspace-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cp-editor-section {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.cp-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #1e1e2e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cp-editor-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #cdd6f4;
  letter-spacing: 0.02em;
}

.cp-editor-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cp-btn {
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.cp-btn-hint {
  background: rgba(255, 159, 10, 0.15);
  color: #ffb340;
  border-color: rgba(255, 159, 10, 0.2);
}

.cp-btn-hint:hover {
  background: rgba(255, 159, 10, 0.25);
}

.cp-btn-reset {
  background: rgba(166, 173, 186, 0.12);
  color: #a6adc8;
  border-color: rgba(166, 173, 186, 0.15);
}

.cp-btn-reset:hover {
  background: rgba(166, 173, 186, 0.2);
}

.cp-btn-solution {
  background: rgba(137, 180, 250, 0.12);
  color: #89b4fa;
  border-color: rgba(137, 180, 250, 0.15);
}

.cp-btn-solution:hover {
  background: rgba(137, 180, 250, 0.22);
}

.cp-btn-run {
  background: #a6e3a1;
  color: #1e1e2e;
  border-color: transparent;
  font-weight: 700;
}

.cp-btn-run:hover {
  background: #94e2a0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(166, 227, 161, 0.3);
}

.cp-btn-run:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Code editor (textarea with line numbers) */
.cp-editor-wrap {
  display: flex;
  background: #181825;
  position: relative;
  min-height: 320px;
}

.cp-line-numbers {
  padding: 1rem 0.75rem;
  background: #11111b;
  color: #585b70;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
  min-width: 3rem;
  border-right: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.cp-editor {
  flex: 1;
  min-height: 320px;
  padding: 1rem;
  background: #181825;
  color: #cdd6f4;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  border: none;
  outline: none;
  resize: vertical;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}

.cp-editor::placeholder {
  color: #585b70;
}

.cp-editor::selection {
  background: rgba(137, 180, 250, 0.2);
  color: #cdd6f4;
}

/* Output panel */
.cp-output-section {
  border-left: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}

.cp-output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #1e1e2e;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.cp-output-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #cdd6f4;
  letter-spacing: 0.02em;
}

.cp-output-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--r-full);
}

.cp-status-success {
  background: rgba(166, 227, 161, 0.15);
  color: #a6e3a1;
}

.cp-status-error {
  background: rgba(243, 139, 168, 0.15);
  color: #f38ba8;
}

.cp-status-info {
  background: rgba(137, 180, 250, 0.12);
  color: #89b4fa;
}

.cp-output {
  min-height: 120px;
  max-height: 400px;
  overflow: auto;
  padding: 1rem;
  background: #181825;
  color: #a6adc8;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Hint panel */
.cp-hint-panel {
  margin-top: 0.75rem;
  background: rgba(255, 159, 10, 0.06);
  border: 1px solid rgba(255, 159, 10, 0.15);
  border-radius: var(--r-md);
  overflow: hidden;
}

.cp-hint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 159, 10, 0.08);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--warm);
}

.cp-hint-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--warm);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}

.cp-hint-close:hover {
  background: rgba(255, 159, 10, 0.15);
}

.cp-hint-content {
  padding: 1rem;
}

.cp-hint-text {
  font-size: 0.9rem;
  color: var(--text-1);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.cp-hint-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cp-hint-counter {
  font-size: 0.75rem;
  color: var(--text-3);
}

.cp-hint-next {
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warm);
  background: rgba(255, 159, 10, 0.1);
  border: 1px solid rgba(255, 159, 10, 0.2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.cp-hint-next:hover {
  background: rgba(255, 159, 10, 0.2);
}

/* Solution panel */
.cp-solution-panel {
  margin-top: 0.75rem;
  background: rgba(137, 180, 250, 0.06);
  border: 1px solid rgba(137, 180, 250, 0.15);
  border-radius: var(--r-md);
  overflow: hidden;
}

.cp-solution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(137, 180, 250, 0.08);
  font-size: 0.82rem;
  font-weight: 600;
  color: #89b4fa;
}

.cp-solution-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #89b4fa;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}

.cp-solution-close:hover {
  background: rgba(137, 180, 250, 0.15);
}

.cp-solution-code {
  margin: 0;
  padding: 1rem;
  background: #181825;
  color: #cdd6f4;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
}

/* Loading overlay */
.cp-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.cp-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cpSpin 0.8s linear infinite;
}

@keyframes cpSpin {
  to { transform: rotate(360deg); }
}

.cp-loading-text {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 500;
  margin: 0;
}

/* Dark mode adjustments */
[data-theme="dark"] .cp-card {
  background: var(--surface);
  border-color: var(--glass-border);
  box-shadow: var(--sh-sm);
}

[data-theme="dark"] .cp-filter-btn,
[data-theme="dark"] .cp-diff-btn {
  background: var(--surface-2);
  border-color: var(--glass-border);
  color: var(--text-2);
}

[data-theme="dark"] .cp-back-btn {
  background: var(--surface-2);
  border-color: var(--glass-border);
  color: var(--text-2);
}

[data-theme="dark"] .cp-meta-tag {
  background: var(--surface-2);
  color: var(--text-2);
}

[data-theme="dark"] .cp-hint-panel {
  background: rgba(255, 159, 10, 0.08);
  border-color: rgba(255, 159, 10, 0.2);
}

[data-theme="dark"] .cp-hint-header {
  background: rgba(255, 159, 10, 0.1);
}

[data-theme="dark"] .cp-solution-panel {
  background: rgba(137, 180, 250, 0.08);
  border-color: rgba(137, 180, 250, 0.2);
}

[data-theme="dark"] .cp-solution-header {
  background: rgba(137, 180, 250, 0.1);
}

/* Code playground responsive */
@media (max-width: 640px) {
  .cp-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cp-filter-group {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .cp-exercise-grid {
    grid-template-columns: 1fr;
  }

  .cp-workspace-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cp-workspace-meta {
    margin-left: 0;
  }

  .cp-editor-wrap {
    min-height: 240px;
  }

  .cp-editor {
    min-height: 240px;
    font-size: 0.75rem;
  }

  .cp-line-numbers {
    font-size: 0.75rem;
    min-width: 2.5rem;
    padding: 1rem 0.5rem;
  }

  .cp-editor-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .cp-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .cp-exercise-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* ==========================================================================
   Daily Tasks (dt-)
   ========================================================================== */
.dt-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--sh-md);
  overflow: hidden;
}
.dt-card-body { padding: var(--card-pad); }
.dt-stats-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1.25rem;
}
.dt-stat { display: flex; align-items: center; gap: 0.625rem; flex: 1; }
.dt-stat-icon { font-size: 1.5rem; line-height: 1; }
.dt-stat-info { display: flex; flex-direction: column; gap: 0.1rem; }
.dt-stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}
.dt-stat-unit { font-size: 0.75rem; font-weight: 400; color: var(--text-3); margin-left: 0.15rem; }
.dt-stat-label { font-size: 0.75rem; color: var(--text-3); line-height: 1.3; }
.dt-stat-divider { width: 1px; height: 2.25rem; background: var(--glass-border); flex-shrink: 0; }
.dt-progress-bar-wrap { margin-bottom: 1.25rem; }
.dt-progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.8rem; color: var(--text-2); }
.dt-progress-bar { height: 6px; background: var(--surface-2); border-radius: var(--r-full); overflow: hidden; }
.dt-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #5856d6); border-radius: var(--r-full); transition: width 0.6s var(--ease-out); }
[data-theme="dark"] .dt-progress-fill { background: linear-gradient(90deg, #0a84ff, #5e5ce6); }
.dt-tasks-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.dt-task-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--surface-2); border-radius: var(--r-sm); transition: background var(--t-fast); }
.dt-task-item:hover { background: var(--accent-dim, rgba(0,113,227,0.08)); }
.dt-task-icon { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.dt-task-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.dt-task-title { font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; color: var(--text-1); }
.dt-task-desc { font-size: 0.775rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-task-btn { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--glass-border); background: var(--surface); color: var(--text-3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--t-fast); flex-shrink: 0; }
.dt-task-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim, rgba(0,113,227,0.08)); }
.dt-log-form { display: flex; align-items: center; gap: 0.625rem; padding: 0.875rem 1rem; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 1rem; flex-wrap: wrap; }
.dt-log-label { font-size: 0.8rem; color: var(--text-2); white-space: nowrap; }
.dt-log-input { width: 72px; padding: 0.4rem 0.625rem; border: 1px solid var(--glass-border); border-radius: var(--r-xs); background: var(--surface); color: var(--text-1); font-family: var(--font-display); font-size: 0.85rem; outline: none; transition: border-color var(--t-fast); }
.dt-log-input:focus { border-color: var(--accent); }
.dt-log-submit, .dt-log-cancel { padding: 0.375rem 0.875rem; border-radius: var(--r-xs); font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all var(--t-fast); border: none; }
.dt-log-submit { background: var(--accent); color: #fff; }
.dt-log-submit:hover { opacity: 0.9; }
.dt-log-cancel { background: transparent; color: var(--text-2); border: 1px solid var(--glass-border); }
.dt-log-cancel:hover { background: var(--surface); }
.dt-actions { display: flex; justify-content: flex-end; }
.dt-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1.125rem; border-radius: var(--r-sm); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--t-fast); border: none; line-height: 1.4; }
.dt-btn-primary { background: var(--accent); color: #fff; }
.dt-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* ==========================================================================
   Learning Calendar (lc-)
   ========================================================================== */
:root { --lc-empty: #ebedf0; --lc-level-1: #9be9a8; --lc-level-2: #40c463; --lc-level-3: #30a14e; --lc-level-4: #216e39; }
[data-theme="dark"] { --lc-empty: #2c2c2e; --lc-level-1: #0e4429; --lc-level-2: #006d32; --lc-level-3: #26a641; --lc-level-4: #39d353; }
.lc-card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--sh-md); overflow: hidden; }
.lc-card-body { padding: var(--card-pad); }
.lc-calendar-wrap { overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
.lc-months-row { display: grid; grid-template-columns: 28px repeat(53, 14px); gap: 2px; margin-bottom: 0.25rem; }
.lc-months-spacer { width: 28px; }
.lc-month-label { font-size: 0.65rem; color: var(--text-3); font-family: var(--font-display); white-space: nowrap; }
.lc-grid { display: flex; flex-direction: column; }
.lc-grid-row { display: flex; align-items: center; }
.lc-day-label { width: 28px; font-size: 0.65rem; color: var(--text-3); font-family: var(--font-display); text-align: right; padding-right: 6px; height: 14px; line-height: 14px; flex-shrink: 0; }
.lc-cells-row { display: flex; gap: 2px; }
.lc-cell { width: 12px; height: 12px; border-radius: 2px; transition: transform 0.15s ease, box-shadow 0.15s ease; cursor: pointer; outline: 1px solid rgba(0,0,0,0.04); }
[data-theme="dark"] .lc-cell { outline: 1px solid rgba(255,255,255,0.04); }
.lc-cell:hover { transform: scale(1.6); z-index: 2; box-shadow: 0 0 6px rgba(0,0,0,0.2); }
.lc-cell--empty { visibility: hidden; cursor: default; }
.lc-cell--empty:hover { transform: none; box-shadow: none; }
.lc-cell--future { background: var(--lc-empty); opacity: 0.4; cursor: default; }
.lc-cell--future:hover { transform: none; box-shadow: none; }
.lc-legend { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 0.75rem; }
.lc-legend-label { font-size: 0.65rem; color: var(--text-3); margin: 0 0.25rem; }
.lc-legend-cell { width: 12px; height: 12px; border-radius: 2px; outline: 1px solid rgba(0,0,0,0.04); }
[data-theme="dark"] .lc-legend-cell { outline: 1px solid rgba(255,255,255,0.04); }
.lc-stats-row { display: flex; align-items: center; gap: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--glass-border); }
.lc-stat { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; flex: 1; text-align: center; }
.lc-stat-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.lc-stat-unit { font-size: 0.7rem; font-weight: 400; color: var(--text-3); margin-left: 0.1rem; }
.lc-stat-label { font-size: 0.725rem; color: var(--text-3); }
.lc-stat-divider { width: 1px; height: 2rem; background: var(--glass-border); flex-shrink: 0; }
.lc-tooltip { position: absolute; z-index: var(--z-modal); background: var(--deep); color: var(--text-1); border: 1px solid var(--glass-border); border-radius: var(--r-xs); padding: 0.4rem 0.625rem; font-size: 0.75rem; line-height: 1.5; box-shadow: var(--sh-md); pointer-events: none; white-space: nowrap; }
[data-theme="dark"] .lc-tooltip { background: var(--surface-2); }

/* ==========================================================================
   Achievements (ach-)
   ========================================================================== */
.ach-container { padding-bottom: 1rem; }
.ach-summary { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.ach-summary-text { display: flex; align-items: baseline; gap: 0.25rem; font-family: var(--font-display); white-space: nowrap; }
.ach-summary-count { font-size: 1.6rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.ach-summary-sep { font-size: 1rem; color: var(--text-4); font-weight: 400; }
.ach-summary-total { font-size: 1rem; font-weight: 600; color: var(--text-2); }
.ach-summary-label { font-size: 0.82rem; color: var(--text-3); font-weight: 500; margin-left: 0.25rem; }
.ach-progress-track { flex: 1; min-width: 120px; height: 6px; background: var(--surface-2); border-radius: var(--r-full); overflow: hidden; }
.ach-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #5856d6); border-radius: var(--r-full); transition: width 0.6s var(--ease-out); }
.ach-category { margin-bottom: 1.75rem; }
.ach-category:last-child { margin-bottom: 0; }
.ach-category-header { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 0.75rem; padding-left: 2px; }
.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.875rem; }
.ach-card { position: relative; border-radius: var(--r-md); overflow: hidden; transition: all 0.35s var(--ease-out); }
.ach-card-glow { position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity 0.35s var(--ease-out); pointer-events: none; }
.ach-card-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 0.75rem 1rem; border-radius: inherit; border: 1px solid var(--glass-border); background: var(--deep); transition: all 0.35s var(--ease-out); }
.ach-card--unlocked .ach-card-inner { border-color: transparent; background: linear-gradient(var(--deep), var(--deep)) padding-box, linear-gradient(135deg, var(--accent), #5856d6) border-box; }
.ach-card--unlocked .ach-card-glow { background: radial-gradient(ellipse at 50% 0%, rgba(0,113,227,0.2) 0%, transparent 70%); opacity: 0.35; }
.ach-card--unlocked:hover { transform: translateY(-4px); }
.ach-card--unlocked:hover .ach-card-glow { opacity: 0.6; }
.ach-card--unlocked:hover .ach-card-inner { box-shadow: var(--sh-md); }
.ach-card--locked .ach-card-inner { background: var(--surface-2); opacity: 0.55; }
.ach-card--locked .ach-icon { filter: grayscale(1) brightness(0.7); }
.ach-card--locked:hover { transform: translateY(-2px); }
.ach-card--locked:hover .ach-card-inner { opacity: 0.7; box-shadow: var(--sh-sm); }
.ach-icon { font-size: 2rem; line-height: 1; margin-bottom: 0.5rem; transition: transform 0.3s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1)); }
.ach-card--unlocked:hover .ach-icon { transform: scale(1.15); }
.ach-name { font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; color: var(--text-1); margin-bottom: 0.2rem; letter-spacing: -0.01em; }
.ach-desc { font-size: 0.72rem; color: var(--text-3); line-height: 1.4; margin-bottom: 0.4rem; }
.ach-date { font-size: 0.65rem; color: var(--accent); font-weight: 600; }
.ach-lock { font-size: 0.7rem; opacity: 0.5; margin-top: 0.15rem; }
.ach-card--celebrate { animation: achCelebrateCard 1.2s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes achCelebrateCard { 0% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(0.96); } 45% { transform: scale(1.05); } 60% { transform: scale(1); } 100% { transform: scale(1); } }
.ach-card--celebrate .ach-card-glow { opacity: 1 !important; animation: achCelebrateGlow 1.2s ease-out; }
@keyframes achCelebrateGlow { 0% { opacity: 0; } 20% { opacity: 0.9; } 100% { opacity: 0.35; } }
[data-theme="dark"] .ach-card--unlocked .ach-card-inner { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--accent), #5856d6) border-box; }
[data-theme="dark"] .ach-card--locked .ach-card-inner { background: var(--surface-2); opacity: 0.45; }

/* ==========================================================================
   Knowledge Hub & Quiz (kh-, quiz-)
   ========================================================================== */
.kh-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.kh-tab {
  padding: 0.6rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text-2);
}
.kh-tab:hover { background: var(--accent-dim, rgba(0,113,227,0.08)); color: var(--text-1); }
.kh-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.kh-panel { /* container for quiz/flashcard content */ }

.quiz-start { text-align: center; }
.quiz-start-header { margin-bottom: 1.5rem; }
.quiz-start-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--text-1); margin-bottom: 0.35rem; }
.quiz-start-desc { font-size: 0.85rem; color: var(--text-3); }
.quiz-domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.quiz-domain-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--t-fast);
}
.quiz-domain-card:hover { border-color: var(--accent); background: var(--accent-dim, rgba(0,113,227,0.08)); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.quiz-domain-icon { font-size: 1.5rem; }
.quiz-domain-name { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.quiz-domain-count { font-size: 0.7rem; color: var(--text-3); }
.quiz-stats-bar { display: flex; gap: 1.5rem; justify-content: center; padding: 0.75rem; background: var(--surface-2); border-radius: var(--r-sm); flex-wrap: wrap; }
.quiz-stats-item { font-size: 0.8rem; color: var(--text-2); }
.quiz-stats-item strong { color: var(--text-1); font-weight: 700; }
.quiz-session { max-width: 600px; margin: 0 auto; }
.quiz-progress-bar { height: 4px; background: var(--surface-2); border-radius: var(--r-full); margin-bottom: 0.5rem; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: var(--r-full); transition: width 0.4s var(--ease-out); }
.quiz-progress-text { font-size: 0.75rem; color: var(--text-3); text-align: right; margin-bottom: 1.25rem; }
.quiz-question-text { font-family: var(--font-body); font-size: 1.1rem; font-weight: 600; color: var(--text-1); line-height: 1.5; margin-bottom: 1.25rem; }
.quiz-options { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 1rem; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--glass-border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-1);
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-dim, rgba(0,113,227,0.08)); }
.quiz-option:disabled { cursor: default; }
.quiz-option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  color: var(--text-2);
  flex-shrink: 0;
}
.quiz-option--correct { border-color: #22c55e; background: rgba(34,197,94,0.08); }
.quiz-option--correct .quiz-option-letter { background: #22c55e; color: #fff; }
.quiz-option--wrong { border-color: #ff453a; background: rgba(255,69,58,0.08); }
.quiz-option--wrong .quiz-option-letter { background: #ff453a; color: #fff; }
.quiz-feedback { padding: 1rem; border-radius: var(--r-sm); background: var(--surface-2); margin-bottom: 1rem; }
.quiz-feedback-header { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text-1); }
.quiz-feedback-explain { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; margin-bottom: 0.75rem; }
.quiz-next-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.quiz-next-btn:hover { opacity: 0.9; }
.quiz-results { text-align: center; padding: 2rem 1rem; }
.quiz-results-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.quiz-results-score { font-family: var(--font-display); font-size: 3rem; font-weight: 800; color: var(--text-1); line-height: 1.1; }
.quiz-results-total { font-size: 1.5rem; color: var(--text-3); font-weight: 400; }
.quiz-results-msg { font-size: 1rem; color: var(--text-2); margin-bottom: 1.5rem; }
.quiz-results-stats { display: flex; gap: 2rem; justify-content: center; margin-bottom: 1.5rem; }
.quiz-results-stat { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.quiz-results-stat-value { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--text-1); }
.quiz-results-stat-label { font-size: 0.75rem; color: var(--text-3); }
.quiz-results-actions { display: flex; gap: 0.75rem; justify-content: center; }
.quiz-restart-btn, .quiz-back-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
}
.quiz-restart-btn { background: var(--accent); color: #fff; }
.quiz-restart-btn:hover { opacity: 0.9; }
.quiz-back-btn { background: transparent; color: var(--text-2); border: 1px solid var(--glass-border); }
.quiz-back-btn:hover { background: var(--surface); }

/* Course Quiz - Domain Sections */
.quiz-domain-section { margin-bottom: 0.75rem; border: 1px solid var(--glass-border); border-radius: var(--r-sm); overflow: hidden; }
.quiz-domain-header {
    display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1rem;
    background: var(--surface-2); cursor: pointer; user-select: none; transition: background 0.2s;
}
.quiz-domain-header:hover { background: var(--surface-3, var(--surface)); }
.quiz-domain-icon { font-size: 1.25rem; }
.quiz-domain-name { font-size: 0.9rem; font-weight: 600; color: var(--text-1); flex: 1; }
.quiz-domain-count { font-size: 0.75rem; color: var(--text-3); }
.quiz-domain-arrow { font-size: 0.7rem; color: var(--text-3); transition: transform 0.2s; }
.quiz-domain-section--collapsed .quiz-domain-arrow { transform: rotate(-90deg); }
.quiz-domain-section--collapsed .quiz-course-list { display: none; }

/* Course Quiz - Course Items */
.quiz-course-list { padding: 0.5rem; }
.quiz-course-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.625rem 0.75rem; border-radius: var(--r-xs); transition: background 0.15s;
}
.quiz-course-item:hover { background: var(--surface-2); }
.quiz-course-name { font-size: 0.82rem; color: var(--text-1); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-course-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }
.quiz-exam-btn {
    padding: 0.3rem 0.625rem; font-size: 0.72rem; font-weight: 600; border: 1px solid var(--glass-border);
    border-radius: var(--r-xs); cursor: pointer; transition: all 0.15s; background: var(--surface); color: var(--text-2);
}
.quiz-exam-btn--mid { border-color: #6366f1; color: #6366f1; }
.quiz-exam-btn--mid:hover { background: #6366f1; color: #fff; }
.quiz-exam-btn--final { border-color: #f59e0b; color: #f59e0b; }
.quiz-exam-btn--final:hover { background: #f59e0b; color: #fff; }

/* Course Quiz - Session Header */
.quiz-session-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.quiz-course-title { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.quiz-type-badge {
    padding: 0.2rem 0.5rem; font-size: 0.7rem; font-weight: 600; border-radius: var(--r-xs);
}
.quiz-type-badge--choice { background: rgba(99,102,241,0.12); color: #6366f1; }
.quiz-type-badge--fill { background: rgba(16,185,129,0.12); color: #10b981; }
.quiz-type-badge--code { background: rgba(245,158,11,0.12); color: #f59e0b; }

/* Course Quiz - Fill-in-blank */
.quiz-fill-area { margin-bottom: 1rem; }
.quiz-fill-input {
    width: 100%; padding: 0.625rem 1rem; font-size: 0.95rem;
    background: var(--surface); border: 2px solid var(--glass-border); border-radius: var(--r-sm);
    color: var(--text-1); outline: none; transition: border-color 0.2s;
}
.quiz-fill-input:focus { border-color: var(--accent); }
.quiz-fill-input--wrong { border-color: #ff453a; }
.quiz-submit-btn {
    margin-top: 0.625rem; padding: 0.5rem 1.25rem; font-size: 0.85rem; font-weight: 600;
    background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm);
    cursor: pointer; transition: opacity 0.15s;
}
.quiz-submit-btn:hover { opacity: 0.9; }
.quiz-submit-btn:disabled { opacity: 0.5; cursor: default; }

/* Course Quiz - Code Completion */
.quiz-code-area { margin-bottom: 1rem; }
.quiz-code-block {
    background: #1e1e2e; border-radius: var(--r-sm); padding: 1rem; margin-bottom: 0.75rem;
    overflow-x: auto;
}
.quiz-code-block pre {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.82rem; line-height: 1.6; color: #cdd6f4; white-space: pre-wrap; word-break: break-all;
}
.quiz-code-blank {
    background: rgba(245,158,11,0.2); color: #f59e0b; padding: 0.15rem 0.35rem;
    border-radius: 3px; font-weight: 700; border-bottom: 2px dashed #f59e0b;
}
.quiz-code-input-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-code-label { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.quiz-code-input {
    width: 100%; padding: 0.625rem 1rem; font-size: 0.85rem; font-family: monospace;
    background: var(--surface); border: 2px solid var(--glass-border); border-radius: var(--r-sm);
    color: var(--text-1); outline: none; resize: vertical; transition: border-color 0.2s;
}
.quiz-code-input:focus { border-color: var(--accent); }
.quiz-code-input--wrong { border-color: #ff453a; }

/* Course Quiz - Feedback extras */
.quiz-correct-answer { display: block; margin-top: 0.5rem; padding: 0.5rem; background: var(--surface); border-radius: var(--r-xs); font-size: 0.82rem; }
.quiz-answer-code {
    background: #1e1e2e; color: #cdd6f4; padding: 0.5rem; border-radius: var(--r-xs);
    font-family: monospace; font-size: 0.8rem; white-space: pre-wrap; margin-top: 0.25rem;
}

/* Course Quiz - Results extras */
.quiz-results-course { font-size: 0.85rem; color: var(--text-3); margin-bottom: 0.15rem; }
.quiz-results-exam { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 1rem; }
.quiz-other-exam-btn {
    padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600;
    background: var(--surface-2); color: var(--text-2); border: 1px solid var(--glass-border);
    border-radius: var(--r-sm); cursor: pointer; transition: all 0.15s;
}
.quiz-other-exam-btn:hover { background: var(--surface); color: var(--text-1); }

/* ==========================================================================
   Flashcards (fc-)
   ========================================================================== */
.fc-wrapper { /* wrapper */ }
.fc-domain-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.fc-domain-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text-2);
}
.fc-domain-tab:hover { border-color: var(--accent); color: var(--text-1); }
.fc-domain-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.fc-domain-count { font-size: 0.7rem; opacity: 0.7; }
.fc-content { min-height: 300px; }
.fc-empty { text-align: center; padding: 3rem 1rem; color: var(--text-3); font-size: 0.9rem; }
.fc-filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.fc-filter-btn {
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-xs);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-3);
}
.fc-filter-btn:hover { color: var(--text-1); border-color: var(--text-3); }
.fc-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.fc-counter { text-align: center; font-size: 0.8rem; color: var(--text-3); margin-bottom: 0.75rem; }
.fc-card {
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 1rem;
  min-height: 280px;
}
.fc-card-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
  transform-style: preserve-3d;
}
.fc-card--flipped .fc-card-inner { transform: rotateY(180deg); }
.fc-card-front, .fc-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  padding: 2rem var(--card-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.fc-card-front {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--sh-md);
}
.fc-card-back {
  background: var(--surface);
  box-shadow: var(--sh-md);
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
  overflow-y: auto;
}
.fc-card-domain {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: var(--r-xs);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.fc-card-concept {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.fc-card-hint { font-size: 0.82rem; color: var(--text-3); }
.fc-card-concept-back {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.75rem;
}
.fc-card-definition { font-size: 0.9rem; color: var(--text-2); line-height: 1.6; margin-bottom: 0.75rem; }
.fc-card-formula {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--surface-2);
  border-radius: var(--r-xs);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.fc-card-points { list-style: none; padding: 0; margin: 0; }
.fc-card-points li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
}
.fc-card-points li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.fc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.fc-nav-btn {
  padding: 0.4rem 0.875rem;
  border-radius: var(--r-xs);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text-2);
}
.fc-nav-btn:hover:not(:disabled) { background: var(--accent-dim, rgba(0,113,227,0.08)); color: var(--text-1); }
.fc-nav-btn:disabled { opacity: 0.4; cursor: default; }
.fc-nav-actions { display: flex; gap: 0.5rem; }
.fc-mark-btn {
  padding: 0.4rem 0.875rem;
  border-radius: var(--r-xs);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-3);
}
.fc-mark-btn:hover { color: var(--text-1); border-color: var(--text-3); }
.fc-mark-btn--mastered.active { background: rgba(34,197,94,0.1); border-color: #22c55e; color: #22c55e; }
.fc-mark-btn--review.active { background: rgba(255,159,10,0.1); border-color: #ff9f0a; color: #ff9f0a; }

/* ==========================================================================
   Mobile responsive: dt, lc, ach, quiz, fc
   ========================================================================== */
@media (max-width: 768px) {
  .dt-stats-row { flex-direction: column; gap: 0.75rem; align-items: stretch; }
  .dt-stat-divider { display: none; }
  .dt-stat { flex-direction: row; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--glass-border); }
  .dt-stat:last-child { border-bottom: none; }
  .dt-task-desc { white-space: normal; }
  .dt-log-form { flex-direction: column; align-items: stretch; }
  .lc-calendar-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lc-stats-row { flex-wrap: wrap; gap: 1rem; }
  .lc-stat-divider { display: none; }
  .lc-stat { flex: 0 0 calc(50% - 0.5rem); }
  .ach-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .ach-card-inner { padding: 1rem 0.625rem 0.875rem; }
  .ach-icon { font-size: 1.65rem; }
  .ach-name { font-size: 0.82rem; }
  .ach-summary { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .ach-progress-track { width: 100%; }
  .quiz-domain-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .quiz-results-stats { gap: 1.5rem; }
  .fc-card { min-height: 240px; }
  .fc-card-inner { min-height: 240px; }
  .fc-card-concept { font-size: 1.35rem; }
  .fc-nav { flex-wrap: wrap; justify-content: center; }
  .kh-tabs { flex-wrap: wrap; }
}

@media (max-width: 1024px) {
  .ach-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Print */
@media print {
  .cp-container, .kh-panel, .dt-card, .lc-card, .ach-container { display: none !important; }
}

/* Quiz Modal Overlay */
.quiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-overlay.show {
  opacity: 1;
  visibility: visible;
}

.quiz-modal {
  background: var(--surface-1, #fff);
  border-radius: 16px;
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.quiz-overlay.show .quiz-modal {
  transform: translateY(0);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.quiz-header-info {
  flex: 1;
}

.quiz-course-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1, #1a1a1a);
  margin-bottom: 0.25rem;
}

.quiz-exam-type {
  font-size: 0.85rem;
  color: var(--text-3, #666);
}

.quiz-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-3, #666);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.quiz-close-btn:hover {
  background: var(--surface-2, #f0f0f0);
  color: var(--text-1, #1a1a1a);
}

.quiz-progress {
  margin-bottom: 1.5rem;
}

.quiz-progress-bar {
  height: 4px;
  background: var(--surface-2, #e5e5e5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.quiz-progress-text {
  font-size: 0.8rem;
  color: var(--text-3, #666);
  text-align: right;
}

.quiz-question {
  margin-bottom: 1.5rem;
}

.quiz-question-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.quiz-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-1, #1a1a1a);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--surface-1, #fff);
  border: 1.5px solid var(--border-color, #e5e5e5);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.quiz-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.quiz-option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2, #f0f0f0);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2, #444);
  flex-shrink: 0;
}

.quiz-option.correct .quiz-option-label {
  background: #10b981;
  color: #fff;
}

.quiz-option.wrong .quiz-option-label {
  background: #ef4444;
  color: #fff;
}

.quiz-option-text {
  font-size: 0.95rem;
  color: var(--text-1, #1a1a1a);
  line-height: 1.4;
}

.quiz-fill {
  display: flex;
  gap: 0.75rem;
}

.quiz-fill-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color, #e5e5e5);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--surface-1, #fff);
  color: var(--text-1, #1a1a1a);
  transition: border-color 0.2s ease;
}

.quiz-fill-input:focus {
  outline: none;
  border-color: #6366f1;
}

.quiz-fill-input:disabled {
  opacity: 0.7;
}

.quiz-submit-btn {
  padding: 0.75rem 1.25rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quiz-submit-btn:hover:not(:disabled) {
  background: #4f46e5;
}

.quiz-submit-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.quiz-code {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-code-block {
  background: var(--surface-2, #f5f5f5);
  border: 1px solid var(--border-color, #e5e5e5);
  border-radius: 10px;
  padding: 1rem;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-1, #1a1a1a);
}

.quiz-code-blank {
  background: rgba(99, 102, 241, 0.2);
  color: #6366f1;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 700;
}

.quiz-code-input {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color, #e5e5e5);
  border-radius: 10px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  background: var(--surface-1, #fff);
  color: var(--text-1, #1a1a1a);
  resize: vertical;
  transition: border-color 0.2s ease;
}

.quiz-code-input:focus {
  outline: none;
  border-color: #6366f1;
}

.quiz-code-input:disabled {
  opacity: 0.7;
}

.quiz-feedback {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.quiz-feedback--correct {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.quiz-feedback--wrong {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.quiz-feedback-icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.quiz-feedback-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1, #1a1a1a);
  margin-bottom: 0.5rem;
}

.quiz-feedback-explanation {
  font-size: 0.85rem;
  color: var(--text-2, #444);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.quiz-next-btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-next-btn:hover {
  background: #4f46e5;
}

.quiz-results {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.quiz-results-score,
.quiz-results-accuracy,
.quiz-results-time {
  text-align: center;
}

.quiz-results-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1, #1a1a1a);
}

.quiz-results-total {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-3, #666);
}

.quiz-results-percent {
  font-size: 2rem;
  font-weight: 800;
  color: #10b981;
}

.quiz-results-minutes {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1, #1a1a1a);
}

.quiz-results-label {
  font-size: 0.8rem;
  color: var(--text-3, #666);
  margin-top: 0.25rem;
}

.quiz-results-breakdown {
  margin-bottom: 1.5rem;
}

.quiz-breakdown-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1, #1a1a1a);
  margin-bottom: 0.75rem;
}

.quiz-breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.quiz-breakdown-type {
  font-size: 0.85rem;
  color: var(--text-2, #444);
  min-width: 80px;
}

.quiz-breakdown-score {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1, #1a1a1a);
  min-width: 50px;
}

.quiz-breakdown-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2, #e5e5e5);
  border-radius: 6px;
  overflow: hidden;
}

.quiz-breakdown-fill {
  height: 100%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.quiz-results-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-action-btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-action-btn--retry {
  background: #6366f1;
  color: #fff;
}

.quiz-action-btn--retry:hover {
  background: #4f46e5;
}

.quiz-action-btn--other {
  background: var(--surface-2, #f0f0f0);
  color: var(--text-1, #1a1a1a);
}

.quiz-action-btn--other:hover {
  background: var(--surface-3, #e5e5e5);
}

.quiz-action-btn--close {
  background: transparent;
  color: var(--text-3, #666);
  border: 1px solid var(--border-color, #e5e5e5);
}

.quiz-action-btn--close:hover {
  background: var(--surface-2, #f0f0f0);
}

@media (max-width: 640px) {
  .quiz-modal {
    width: 95%;
    max-height: 90vh;
    padding: 1rem;
  }

  .quiz-results {
    gap: 1rem;
  }

  .quiz-results-number,
  .quiz-results-percent,
  .quiz-results-minutes {
    font-size: 1.5rem;
  }

  .quiz-fill {
    flex-direction: column;
  }

  .quiz-results-actions {
    flex-direction: column;
  }

  .quiz-action-btn {
    width: 100%;
  }
}

