/* ============================================================
   VENCANTO LEARNING CASA — STYLE.CSS
   Encanto Botanical Casa Design System
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Merienda:wght@400;700;900&family=Nunito:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── CSS Variables — Light Mode ───────────────────────────── */
:root {
  /* Primary */
  --pink:        #E84A8A;
  --purple:      #7B4FA3;
  --yellow:      #F6C445;

  /* Secondary */
  --jungle:      #3F8F5B;
  --leaf:        #79B84A;
  --sky:         #55B8D9;
  --orange:      #E9823A;

  /* Warm */
  --coral:       #E85D5A;
  --terracotta:  #B85C45;

  /* Backgrounds */
  --cream:       #FFF1D0;
  --surface:     #FFF9EA;
  --surface-2:   #FFFFFF;

  /* Text */
  --heading:     #3B2445;
  --body:        #55445A;
  --muted:       #806F82;
  --subtle:      #AA9BAA;

  /* Border */
  --border:      #E8D6BD;

  /* States */
  --success:       #3F8F5B;
  --success-light: #EAF5E8;
  --warning:       #F6C445;
  --warning-light: #FFF5CE;
  --danger:        #E85D5A;
  --danger-light:  #FCE9E7;
  --info:          #55B8D9;
  --info-light:    #E4F5FA;

  /* Sidebar */
  --sidebar-w: 260px;
  --topbar-h:  64px;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Radius */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px;
  --r-xl: 28px; --r-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 4px rgba(59,36,69,.07);
  --shadow-md: 0 4px 16px rgba(59,36,69,.10);
  --shadow-lg: 0 8px 32px rgba(59,36,69,.13);
  --shadow-glow-pink:   0 0 24px rgba(232,74,138,.18);
  --shadow-glow-purple: 0 0 24px rgba(123,79,163,.18);

  /* Transitions */
  --t-fast: 160ms ease;
  --t-base: 260ms ease;
  --t-slow: 400ms ease;

  /* Fonts */
  --font-display: 'Merienda', cursive;
  --font-body:    'Nunito', sans-serif;
  --font-data:    'DM Sans', sans-serif;

  /* Current theme markers */
  --bg-main: var(--cream);
  --bg-surface: var(--surface);
  --bg-surface-2: var(--surface-2);
  --text-heading: var(--heading);
  --text-body:   var(--body);
  --text-muted:  var(--muted);
  --sidebar-bg:  #FEF5DC;
}

/* ── Dark Mode Variables ──────────────────────────────────── */
body.dark {
  --bg-main:      #17151C;
  --bg-surface:   #211D27;
  --bg-surface-2: #29232F;
  --text-heading: #FFF4D8;
  --text-body:    #E9DDE8;
  --text-muted:   #BFAFC0;
  --border:       #3A3040;
  --sidebar-bg:   #1D1923;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --shadow-glow-pink:   0 0 32px rgba(232,74,138,.28);
  --shadow-glow-purple: 0 0 32px rgba(123,79,163,.28);
}

/* ── No Animations ────────────────────────────────────────── */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 8%  10%, rgba(232,74,138,.07)  0%, transparent 22%),
    radial-gradient(circle at 92% 8%,  rgba(123,79,163,.07)  0%, transparent 22%),
    radial-gradient(circle at 50% 90%, rgba(246,196,69,.06)  0%, transparent 20%),
    radial-gradient(circle at 80% 50%, rgba(85,184,217,.05)  0%, transparent 18%);
  min-height: 100vh;
  line-height: 1.75;
  overflow-x: hidden;
  transition: background-color var(--t-base), color var(--t-base);
}

::selection { background: rgba(123,79,163,.2); color: var(--purple); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea { font-family: var(--font-body); }
ul, ol { list-style: none; }
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--text-heading); line-height: 1.25; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(123,79,163,.25); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(123,79,163,.45); }

/* ============================================================
   APP LAYOUT
   ============================================================ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--t-base), background var(--t-base);
  overflow: hidden;
}

/* Botanical corner decoration on sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 140px; height: 140px;
  background-image:
    radial-gradient(circle at 80% 80%, rgba(123,79,163,.09) 0%, transparent 60%),
    radial-gradient(circle at 20% 20%, rgba(232,74,138,.06) 0%, transparent 50%);
  pointer-events: none;
}

/* Leaf SVG decoration top-right of sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: -10px;
  width: 90px; height: 90px;
  background: radial-gradient(circle at 70% 30%, rgba(63,143,91,.10) 0%, transparent 60%);
  pointer-events: none;
}

/* Sidebar Logo */
.sidebar-logo {
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border-bottom: 1.5px solid var(--border);
  position: relative;
}

.logo-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: radial-gradient(circle, rgba(246,196,69,.2) 0%, rgba(232,74,138,.1) 70%);
  padding: 2px;
  box-shadow: 0 0 16px rgba(246,196,69,.25);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.logo-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(232,74,138,.4);
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
  filter: drop-shadow(0 2px 6px rgba(59,36,69,.15));
}

.logo-icon svg { width: 44px; height: 44px; }

.logo-text { flex: 1; min-width: 0; }

.logo-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--purple);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.logo-tagline {
  font-size: .7rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.3;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  overflow-y: auto;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  margin-top: var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .875rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
  cursor: pointer;
  position: relative;
  border: 1.5px solid transparent;
}

.nav-item:hover {
  background: rgba(123,79,163,.07);
  color: var(--purple);
  border-color: rgba(123,79,163,.1);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(232,74,138,.12), rgba(123,79,163,.12));
  color: var(--purple);
  border-color: rgba(123,79,163,.18);
  box-shadow: var(--shadow-sm);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -var(--sp-3); left: -12px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: linear-gradient(to bottom, var(--pink), var(--purple));
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: .65rem;
  font-family: var(--font-data);
  font-weight: 700;
  background: var(--pink);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--r-full);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1.5px solid var(--border);
}

.sidebar-footer-text {
  font-size: .72rem;
  color: var(--subtle);
  font-family: var(--font-data);
  text-align: center;
  line-height: 1.6;
}

/* Botanical vine divider in sidebar */
.sidebar-divider {
  height: 2px;
  margin: var(--sp-2) var(--sp-3);
  background: linear-gradient(to right, transparent, rgba(123,79,163,.15), rgba(232,74,138,.15), transparent);
  border-radius: var(--r-full);
  position: relative;
}

.sidebar-divider::before {
  content: '🌿';
  position: absolute;
  left: 50%; transform: translateX(-50%) translateY(-50%);
  font-size: .7rem;
  background: var(--sidebar-bg);
  padding: 0 4px;
}

/* ── Main Layout ──────────────────────────────────────────── */
.main-layout {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,241,208,.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  position: sticky;
  top: 0; z-index: 90;
  transition: background var(--t-base);
}

body.dark .topbar {
  background: rgba(23,21,28,.88);
}

.topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.topbar-title .breadcrumb-sep {
  opacity: .4;
  margin: 0 var(--sp-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  transition: all var(--t-fast);
}

.topbar-btn:hover {
  background: rgba(123,79,163,.1);
  border-color: rgba(123,79,163,.2);
  color: var(--purple);
  transform: scale(1.04);
}

.topbar-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-color: transparent;
}

/* Hamburger (mobile) */
.topbar-hamburger {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: var(--sp-8);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ── Bottom Nav (Mobile) ──────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,249,234,.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1.5px solid var(--border);
  padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom));
  display: none;
  align-items: center;
  justify-content: space-around;
}

body.dark .bottom-nav {
  background: rgba(29,25,35,.94);
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-muted);
  min-width: 52px;
  min-height: 44px;
}

.bnav-item.active {
  color: var(--purple);
}

.bnav-item.active .bnav-icon {
  background: linear-gradient(135deg, rgba(232,74,138,.15), rgba(123,79,163,.15));
  border-radius: var(--r-md);
}

.bnav-icon {
  font-size: 1.2rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}

.bnav-label {
  font-size: .62rem;
  font-weight: 700;
  font-family: var(--font-body);
}

/* ============================================================
   SIDEBAR OVERLAY (Mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(59,36,69,.4);
  backdrop-filter: blur(2px);
  z-index: 99;
}

/* ============================================================
   DECORATIVE SYSTEM — Botanical Elements
   ============================================================ */

/* Floating sparkle particles */
.sparkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0;
  animation: sparkle-float 6s infinite;
}

.sparkle:nth-child(1)  { left: 10%; top: 15%; animation-delay: 0s;   width: 4px; height: 4px; background: var(--pink); }
.sparkle:nth-child(2)  { left: 85%; top: 25%; animation-delay: 1.2s; width: 5px; height: 5px; background: var(--yellow); }
.sparkle:nth-child(3)  { left: 25%; top: 70%; animation-delay: 2.4s; width: 3px; height: 3px; background: var(--purple); }
.sparkle:nth-child(4)  { left: 70%; top: 60%; animation-delay: 0.6s; width: 6px; height: 6px; background: var(--leaf); }
.sparkle:nth-child(5)  { left: 50%; top: 35%; animation-delay: 3s;   width: 4px; height: 4px; background: var(--sky); }
.sparkle:nth-child(6)  { left: 92%; top: 80%; animation-delay: 1.8s; width: 5px; height: 5px; background: var(--pink); }

@keyframes sparkle-float {
  0%   { opacity: 0; transform: translateY(0) scale(.6) rotate(0deg); }
  20%  { opacity: .55; }
  80%  { opacity: .55; }
  100% { opacity: 0; transform: translateY(-40px) scale(1) rotate(180deg); }
}

body.dark .sparkle { opacity: 0; animation: sparkle-float-dark 6s infinite; }

@keyframes sparkle-float-dark {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  20%  { opacity: .25; }
  80%  { opacity: .25; }
  100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

/* Botanical corner decoration */
.botanical-corner {
  position: absolute;
  pointer-events: none;
}

/* Floral divider */
.flower-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-8) 0;
  opacity: .5;
}

.flower-divider::before,
.flower-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.flower-divider-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ============================================================
   PAGE SECTIONS & UTILITY
   ============================================================ */

.page-header {
  margin-bottom: var(--sp-8);
}

.page-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--pink);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  margin-bottom: var(--sp-2);
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }
  .page-header {
    margin-bottom: var(--sp-5);
  }
  .page-desc {
    font-size: .88rem;
  }
}

/* ── Grid Helpers ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-5); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: var(--sp-5); }

/* ============================================================
   CARD SYSTEM
   ============================================================ */

.card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  position: relative;
  overflow: hidden;
}

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

.card-white {
  background: var(--bg-surface-2);
}

.card-glass {
  background: rgba(255,249,234,.6);
  backdrop-filter: blur(12px);
}

body.dark .card-glass {
  background: rgba(33,29,39,.6);
}

/* Organic blob accent on cards */
.card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .06;
  transition: opacity var(--t-base);
  pointer-events: none;
}

.card-pink::before   { background: var(--pink); }
.card-purple::before { background: var(--purple); }
.card-green::before  { background: var(--jungle); }
.card-yellow::before { background: var(--yellow); }
.card-sky::before    { background: var(--sky); }
.card-orange::before { background: var(--orange); }

/* ── Pill / Badge ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 700;
  font-family: var(--font-data);
}

.badge-pink    { background: rgba(232,74,138,.12); color: var(--pink); }
.badge-purple  { background: rgba(123,79,163,.12); color: var(--purple); }
.badge-green   { background: var(--success-light); color: var(--success); }
.badge-yellow  { background: var(--warning-light); color: #996b00; }
.badge-sky     { background: var(--info-light);    color: #1a6e86; }
.badge-orange  { background: rgba(233,130,58,.12); color: var(--orange); }
.badge-coral   { background: var(--danger-light);  color: var(--coral); }

/* ── Button System ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-5);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1.5px solid transparent;
  white-space: nowrap;
  min-height: 44px;
}

.btn:hover   { transform: scale(1.02); }
.btn:active  { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(232,74,138,.35);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(232,74,138,.45); }

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--purple);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: rgba(123,79,163,.07);
  border-color: rgba(123,79,163,.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(123,79,163,.07);
  color: var(--purple);
}

.btn-green  { background: var(--jungle); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--heading); }
.btn-coral  { background: var(--coral);  color: #fff; }
.btn-sm { padding: 7px var(--sp-4); font-size: .8rem; min-height: 36px; }
.btn-lg { padding: 13px var(--sp-8); font-size: 1rem; min-height: 52px; }
.btn-full { width: 100%; justify-content: center; }
.btn-pill { border-radius: var(--r-full); }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-wrap {
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(to right, var(--jungle), var(--leaf), var(--yellow));
  transition: width .6s cubic-bezier(.25,.46,.45,.94);
}

.progress-bar-pink   { background: linear-gradient(to right, var(--pink), var(--purple)); }
.progress-bar-purple { background: var(--purple); }
.progress-bar-sky    { background: linear-gradient(to right, var(--sky), var(--purple)); }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--pink), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0;
}

/* ── Stat Number ──────────────────────────────────────────── */
.stat-num {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 2rem;
  color: var(--text-heading);
  line-height: 1;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================================
   HOME / DASHBOARD
   ============================================================ */

/* ── Greeting Card ────────────────────────────────────────── */
.greeting-card {
  background: linear-gradient(135deg, rgba(232,74,138,.08), rgba(123,79,163,.10));
  border: 1.5px solid rgba(123,79,163,.15);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}

.greeting-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246,196,69,.12) 0%, transparent 70%);
  pointer-events: none;
}

.greeting-content { flex: 1; }

.greeting-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--pink);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.greeting-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--sp-3);
  line-height: 1.2;
}

.greeting-subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: var(--sp-5);
}

.greeting-stats {
  display: flex;
  gap: var(--sp-6);
}

.greeting-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.greeting-stat-num {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--purple);
  line-height: 1;
}

.greeting-stat-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* CSS Casa Illustration */
.casa-illustration {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  position: relative;
}

.casa-illustration svg {
  width: 100%;
  height: 100%;
}

/* ── Journey Stepper ──────────────────────────────────────── */
.journey-section { margin-bottom: var(--sp-8); }

.journey-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-heading);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.journey-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding-bottom: var(--sp-2);
}

.journey-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
  position: relative;
  cursor: pointer;
}

.journey-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
  transition: background var(--t-base);
}

.journey-step.done:not(:last-child)::after {
  background: linear-gradient(to right, var(--jungle), var(--leaf));
}

.journey-step.current:not(:last-child)::after {
  background: linear-gradient(to right, var(--leaf) 30%, var(--border) 100%);
}

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  position: relative; z-index: 1;
  transition: all var(--t-base);
}

.journey-step.done .step-circle {
  background: var(--jungle);
  border-color: var(--jungle);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(63,143,91,.15);
}

.journey-step.current .step-circle {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(232,74,138,.2), var(--shadow-glow-pink);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 4px rgba(232,74,138,.2); }
  50%      { box-shadow: 0 0 0 8px rgba(232,74,138,.1); }
}

.step-label {
  margin-top: var(--sp-2);
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  max-width: 70px;
}

.journey-step.done  .step-label   { color: var(--jungle); }
.journey-step.current .step-label { color: var(--purple); }

/* ── Quick Access Banners ─────────────────────────────────── */
.quick-access {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.qa-card {
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
  position: relative;
  overflow: hidden;
  border: none;
  min-height: 130px;
}

.qa-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.qa-card-1 { background: linear-gradient(135deg, #8B5CF6 0%, var(--pink) 100%); }
.qa-card-2 { background: linear-gradient(135deg, var(--sky) 0%, #8B5CF6 100%); }
.qa-card-3 { background: linear-gradient(135deg, var(--orange) 0%, var(--yellow) 100%); }
.qa-card-4 { background: linear-gradient(135deg, var(--jungle) 0%, var(--leaf) 100%); }

.qa-card::before {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}

.qa-card::after {
  content: '';
  position: absolute;
  top: -15px; left: -15px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

.qa-icon {
  font-size: 1.8rem;
  line-height: 1;
  position: relative; z-index: 1;
}

.qa-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .875rem;
  color: #fff;
  position: relative; z-index: 1;
  line-height: 1.3;
}

.qa-desc {
  font-size: .72rem;
  color: rgba(255,255,255,.75);
  position: relative; z-index: 1;
  font-weight: 500;
}

/* ── Hero Continue Card ───────────────────────────────────── */
.hero-continue {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}

.hero-continue::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--pink), var(--purple), var(--yellow));
  border-radius: var(--r-full);
}

.hero-continue-info { flex: 1; }

.hero-continue-label {
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-1);
}

.hero-continue-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-heading);
  margin-bottom: var(--sp-2);
}

.hero-continue-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.hero-continue-progress .progress-wrap { flex: 1; }

.hero-continue-pct {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: .8rem;
  color: var(--jungle);
  white-space: nowrap;
}

/* ============================================================
   READING BAR (sticky, top of reader)
   ============================================================ */

.reading-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 80;
  height: 3px;
  background: var(--border);
  margin-bottom: 0;
}

.reading-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--pink), var(--purple), var(--yellow));
  transition: width .3s ease;
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

/* ============================================================
   MATERIAL READER
   ============================================================ */

.reader-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: var(--sp-8);
  align-items: start;
}

/* TOC Rail */
.toc-rail {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-4));
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}

.toc-title {
  font-family: var(--font-data);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1.5px solid var(--border);
}

.toc-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  border-left: 2px solid transparent;
}

.toc-item:hover { color: var(--purple); background: rgba(123,79,163,.06); }

.toc-item.active {
  color: var(--purple);
  border-left-color: var(--pink);
  background: rgba(123,79,163,.06);
}

/* Reader Content */
.reader-content {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-10);
}

.reader-content h2 {
  font-size: 1.5rem;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1.5px solid var(--border);
}

.reader-content h3 {
  font-size: 1.15rem;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
}

.reader-content p {
  margin-bottom: var(--sp-4);
  line-height: 1.85;
  color: var(--text-body);
}

/* Concept Cards */
.concept-card {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  margin: var(--sp-5) 0;
  border-left: 3px solid;
}

.concept-card .concept-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.concept-card strong { display: block; margin-bottom: var(--sp-1); font-weight: 700; }
.concept-card p { margin: 0; font-size: .875rem; line-height: 1.6; }

.concept-info    { background: var(--info-light);    border-color: var(--sky);    }
.concept-tip     { background: var(--success-light); border-color: var(--jungle); }
.concept-warning { background: var(--warning-light); border-color: var(--yellow); }
.concept-danger  { background: var(--danger-light);  border-color: var(--coral);  }
.concept-purple  { background: rgba(123,79,163,.08); border-color: var(--purple); }
.concept-blue    { background: var(--info-light);    border-color: var(--sky);    }
.concept-green   { background: var(--success-light); border-color: var(--jungle); }
.concept-orange  { background: rgba(233,130,58,.10); border-color: var(--orange); }

.concept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}

/* Step Cards */
.step-list { display: flex; flex-direction: column; gap: var(--sp-3); margin: var(--sp-5) 0; }

.step-item {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  background: var(--bg-surface);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  transition: border-color var(--t-fast);
}

.step-item:hover { border-color: rgba(123,79,163,.25); }

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.step-item strong { display: block; margin-bottom: var(--sp-1); font-weight: 700; color: var(--text-heading); }
.step-item p { font-size: .875rem; margin: 0; color: var(--text-muted); }

/* Trap Diagnostic */
.trap-diagnostic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin: var(--sp-6) 0;
}

.trap-wrong, .trap-correct {
  padding: var(--sp-5);
  border-radius: var(--r-md);
}

.trap-wrong {
  background: var(--danger-light);
  border: 1.5px solid rgba(232,93,90,.25);
}

.trap-correct {
  background: var(--success-light);
  border: 1.5px solid rgba(63,143,91,.25);
}

.trap-icon { font-size: 1.1rem; display: block; margin-bottom: var(--sp-2); }
.trap-wrong strong, .trap-correct strong { display: block; margin-bottom: var(--sp-2); font-size: .85rem; }
.trap-wrong p, .trap-correct p { font-size: .82rem; margin: 0; line-height: 1.6; }
.trap-wrong strong { color: var(--coral); }
.trap-correct strong { color: var(--jungle); }

/* Comparison Card */
.comparison-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-3);
  align-items: center;
  margin: var(--sp-6) 0;
}

.compare-left, .compare-right {
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
}

.compare-left  { border-color: rgba(123,79,163,.25); }
.compare-right { border-color: rgba(63,143,91,.25);  }

.compare-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 700;
  font-family: var(--font-data);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.compare-badge.purple { background: rgba(123,79,163,.15); color: var(--purple); }
.compare-badge.green  { background: var(--success-light); color: var(--jungle); }

.compare-left ul, .compare-right ul {
  list-style: disc;
  padding-left: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.compare-left li, .compare-right li {
  font-size: .85rem;
  color: var(--text-body);
}

.vs-badge {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* Vocab Table */
.vocab-table {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: var(--sp-5) 0;
}

.vocab-header {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  background: rgba(123,79,163,.08);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1.5px solid var(--border);
}

.vocab-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1.5px solid var(--border);
  transition: background var(--t-fast);
}

.vocab-row:last-child { border-bottom: none; }
.vocab-row:hover { background: rgba(123,79,163,.04); }

.vocab-col { font-size: .85rem; }
.vocab-header .vocab-col { font-weight: 700; font-size: .78rem; font-family: var(--font-data); color: var(--purple); }

.vocab-col.adoption   { color: var(--purple); font-weight: 600; }
.vocab-col.adaptation { color: var(--jungle); font-weight: 600; }
.vocab-col.translation { color: var(--orange); }

/* Manual Progress Buttons */
.progress-actions {
  display: flex;
  gap: var(--sp-3);
  margin: var(--sp-8) 0;
  flex-wrap: wrap;
}

.progress-check-btn {
  flex: 1;
  min-width: 200px;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  border: 2px dashed var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .875rem;
  color: var(--text-muted);
}

.progress-check-btn:hover {
  border-style: solid;
  border-color: var(--jungle);
  color: var(--jungle);
  background: var(--success-light);
}

.progress-check-btn.checked {
  border-style: solid;
  border-color: var(--jungle);
  background: var(--success-light);
  color: var(--jungle);
}

.progress-check-btn .check-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
}

/* Checkpoint progress */
.checkpoint-row {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-5);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  margin: var(--sp-6) 0;
}

.checkpoint-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
  min-width: 100px;
}

.checkpoint-label {
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--text-muted);
}

.checkpoint-val {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 1rem;
  color: var(--jungle);
}

/* ============================================================
   FLASHCARDS 3D
   ============================================================ */

.flashcard-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
}

.flashcard-counter {
  font-family: var(--font-data);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.flashcard-scene {
  width: 100%;
  max-width: 560px;
  height: 320px;
  perspective: 1200px;
  cursor: pointer;
}

.flashcard-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,.2,.2,1);
}

.flashcard-card.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  text-align: center;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.flashcard-face::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-xl);
  border: 1.5px solid rgba(255,255,255,.25);
  pointer-events: none;
}

/* Botanical corner for flashcard */
.flashcard-face::after {
  content: '✦';
  position: absolute;
  top: var(--sp-4); right: var(--sp-5);
  font-size: .8rem;
  opacity: .4;
  color: #fff;
}

.flashcard-front {
  background: linear-gradient(145deg, var(--purple) 0%, #9B6EC7 50%, var(--pink) 100%);
  color: #fff;
}

.flashcard-back {
  background: linear-gradient(145deg, #1A6E86 0%, var(--sky) 50%, var(--jungle) 100%);
  color: #fff;
  transform: rotateY(180deg);
}

.fc-category {
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--font-data);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: var(--sp-4);
}

.fc-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  max-width: 400px;
}

.fc-hint {
  margin-top: var(--sp-4);
  font-size: .75rem;
  opacity: .6;
  font-weight: 600;
}

.fc-answer-text {
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.7;
  white-space: pre-line;
  text-align: left;
  max-width: 420px;
}

/* FC decorative blob */
.fc-blob {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}

.flashcard-actions {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
}

.flashcard-nav {
  display: flex;
  gap: var(--sp-3);
}

.fc-nav-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}

.fc-nav-btn:hover { border-color: var(--purple); color: var(--purple); background: rgba(123,79,163,.07); }

.flashcard-mark-btns {
  display: flex;
  gap: var(--sp-3);
}

.fc-difficult {
  padding: 10px var(--sp-5);
  border-radius: var(--r-md);
  background: var(--warning-light);
  border: 1.5px solid rgba(246,196,69,.4);
  color: #7a5a00;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex; align-items: center; gap: var(--sp-2);
}

.fc-mastered {
  padding: 10px var(--sp-5);
  border-radius: var(--r-md);
  background: var(--success-light);
  border: 1.5px solid rgba(63,143,91,.4);
  color: var(--jungle);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex; align-items: center; gap: var(--sp-2);
}

.fc-difficult:hover { transform: scale(1.02); }
.fc-mastered:hover  { transform: scale(1.02); }

.flashcard-keyboard-hint {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.kbd-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: .75rem;
  color: var(--text-muted);
  font-family: var(--font-data);
}

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  border-bottom-width: 3px;
  font-size: .72rem;
  font-family: var(--font-data);
  font-weight: 700;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  min-width: 28px;
  justify-content: center;
}

/* Flashcard progress bar */
.fc-progress-wrap {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.fc-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-mastery-count {
  display: flex;
  gap: var(--sp-4);
}

.fc-mastery-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: .75rem;
  font-family: var(--font-data);
  font-weight: 600;
}

.fc-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.fc-dot-mastered  { background: var(--jungle); }
.fc-dot-difficult { background: var(--yellow); }
.fc-dot-unseen    { background: var(--border); }

/* ============================================================
   QUIZ — Baku vs Tidak Baku Arena
   ============================================================ */

.quiz-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
  max-width: 700px;
  margin: 0 auto;
}

.quiz-arena-header {
  text-align: center;
}

.quiz-arena-header h2 {
  font-size: 1.6rem;
  margin-bottom: var(--sp-2);
}

.quiz-question-prompt {
  font-size: .95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.arena-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: center;
  width: 100%;
}

.arena-card {
  background: var(--bg-surface-2);
  border: 2.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  min-height: 180px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.arena-card:hover {
  border-color: var(--purple);
  background: rgba(123,79,163,.04);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.arena-card.correct {
  border-color: var(--jungle);
  background: var(--success-light);
  box-shadow: 0 0 0 4px rgba(63,143,91,.15), 0 8px 32px rgba(63,143,91,.2);
  transform: scale(1.02);
}

.arena-card.wrong {
  border-color: var(--coral);
  background: var(--danger-light);
  box-shadow: 0 0 0 4px rgba(232,93,90,.15);
  opacity: .7;
}

.arena-card.dimmed { opacity: .35; filter: saturate(0.3); }

.arena-word {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
}

.arena-card.correct .arena-word { color: var(--jungle); }
.arena-card.wrong   .arena-word { color: var(--coral); }

.arena-result-label {
  font-size: .8rem;
  font-weight: 800;
  font-family: var(--font-data);
  letter-spacing: .05em;
  padding: 4px 14px;
  border-radius: var(--r-full);
  display: none;
}

.arena-card.correct .arena-result-label {
  display: block;
  background: var(--jungle);
  color: #fff;
}

.arena-card.wrong .arena-result-label {
  display: block;
  background: var(--coral);
  color: #fff;
}

.arena-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.arena-vs-badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}

/* Quiz Score Panel */
.quiz-score-panel {
  display: flex;
  gap: var(--sp-8);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-8);
  align-items: center;
}

.quiz-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.quiz-score-num {
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 1.8rem;
  line-height: 1;
}

.quiz-score-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-family: var(--font-data);
}

.score-purple { color: var(--purple); }
.score-yellow { color: #8a6200; }
.score-pink   { color: var(--pink); }
.score-green  { color: var(--jungle); }

/* Quiz Explanation Panel */
.quiz-explanation {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  display: none;
}

.quiz-explanation.visible { display: block; }

.quiz-explanation-title {
  font-family: var(--font-data);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--purple);
  margin-bottom: var(--sp-3);
}

.quiz-explanation-text {
  font-size: .875rem;
  line-height: 1.75;
  color: var(--text-body);
}

/* ============================================================
   QUICK CHECK — MCQ
   ============================================================ */

.qc-page {
  max-width: 640px;
  margin: 0 auto;
}

.qc-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
}

.qc-question-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  margin-bottom: var(--sp-5);
}

.qc-question-text {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}

.qc-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.qc-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-body);
}

.qc-option:hover {
  border-color: var(--purple);
  background: rgba(123,79,163,.04);
}

.qc-option.selected {
  border-color: var(--purple);
  background: rgba(123,79,163,.08);
  color: var(--purple);
}

.qc-option.correct {
  border-color: var(--jungle);
  background: var(--success-light);
  color: var(--jungle);
}

.qc-option.wrong {
  border-color: var(--coral);
  background: var(--danger-light);
  color: var(--coral);
}

.qc-option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  font-family: var(--font-data);
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.qc-option.selected .qc-option-letter { background: var(--purple); color: #fff; }
.qc-option.correct .qc-option-letter {
  background: var(--jungle);
  color: #fff;
}

.qc-option.wrong .qc-option-letter {
  background: var(--coral);
  color: #fff;
}

/* ============================================================
   PRACTICE LOBBY & SETUP SCREEN
   ============================================================ */

.practice-setup-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  margin-bottom: var(--sp-8);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.practice-setup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--yellow));
}

.setup-section-title {
  font-family: var(--font-data);
  font-size: .82rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.setup-pills-grid {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.setup-pill-btn {
  padding: 10px 18px;
  border-radius: var(--r-lg);
  border: 2px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-body);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast);
}

.setup-pill-btn:hover {
  border-color: var(--purple);
  background: rgba(123,79,163,.06);
  transform: translateY(-2px);
}

.setup-pill-btn.active {
  background: linear-gradient(135deg, rgba(232,74,138,.12), rgba(123,79,163,.15));
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 2px 10px rgba(123,79,163,.15);
}

.setup-pill-btn.difficulty-easy.active {
  background: var(--success-light);
  border-color: var(--jungle);
  color: var(--jungle);
}

.setup-pill-btn.difficulty-medium.active {
  background: var(--warning-light);
  border-color: #d49800;
  color: #8a6200;
}

.setup-pill-btn.difficulty-hard.active {
  background: var(--danger-light);
  border-color: var(--coral);
  color: var(--coral);
}

/* ============================================================
   CUSTOM BOTANICAL TOPIC PICKER
   ============================================================ */

.topic-picker-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: var(--sp-6);
}

.custom-topic-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.custom-topic-trigger:hover,
.custom-topic-trigger.open {
  border-color: var(--purple);
  box-shadow: 0 4px 18px rgba(123,79,163,.18);
  background: linear-gradient(135deg, rgba(232,74,138,.04), rgba(123,79,163,.06));
}

.custom-topic-trigger::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--pink), var(--purple));
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

.topic-trigger-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

.topic-trigger-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(232,74,138,.12), rgba(123,79,163,.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topic-trigger-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topic-trigger-eyebrow {
  font-size: .7rem;
  font-family: var(--font-data);
  font-weight: 800;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.topic-trigger-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-trigger-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.topic-trigger-badge {
  font-family: var(--font-data);
  font-size: .8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: rgba(123,79,163,.1);
  color: var(--purple);
  border: 1px solid rgba(123,79,163,.2);
}

.topic-trigger-arrow {
  font-size: .95rem;
  color: var(--text-muted);
  transition: transform var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-topic-trigger.open .topic-trigger-arrow {
  transform: rotate(180deg);
  color: var(--purple);
}

/* Dropdown Menu Popover */
.custom-topic-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 120;
  background: var(--bg-surface-2);
  border: 2px solid rgba(123,79,163,.25);
  border-radius: var(--r-xl);
  box-shadow: 0 12px 36px rgba(45,30,60,.22);
  padding: var(--sp-3);
  display: none;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 380px;
  backdrop-filter: blur(16px);
  animation: dropdown-pop .2s cubic-bezier(.16,1,.3,1) forwards;
  box-sizing: border-box;
}

.custom-topic-dropdown.open {
  display: flex;
}

@keyframes dropdown-pop {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.topic-search-wrap {
  position: relative;
  margin-bottom: 4px;
}

.topic-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 38px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-body);
  font-size: .88rem;
  font-family: var(--font-body);
  outline: none;
  transition: all var(--t-fast);
}

.topic-search-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123,79,163,.15);
}

.topic-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  opacity: .6;
  pointer-events: none;
}

.topic-options-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 300px;
  padding-right: 4px;
}

.topic-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.topic-option-item:hover {
  background: rgba(123,79,163,.08);
  border-color: rgba(123,79,163,.2);
  transform: translateX(3px);
}

.topic-option-item.active {
  background: linear-gradient(135deg, rgba(232,74,138,.12), rgba(123,79,163,.16));
  border-color: var(--purple);
}

.topic-opt-num {
  font-family: var(--font-data);
  font-size: .75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: rgba(123,79,163,.12);
  color: var(--purple);
  flex-shrink: 0;
}

.topic-option-item.active .topic-opt-num {
  background: var(--purple);
  color: #fff;
}

.topic-opt-text {
  flex: 1;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-heading);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-option-item.active .topic-opt-text {
  font-weight: 800;
  color: var(--purple);
}

.topic-opt-count {
  font-family: var(--font-data);
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.start-practice-btn {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 50%, #9B6EC7 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  padding: 14px 36px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232,74,138,.35);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  transition: all var(--t-fast);
}

.start-practice-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(123,79,163,.45);
}

/* ============================================================
   ACTIVE PRACTICE SESSION & COUNTDOWN TIMER
   ============================================================ */

.practice-active-header {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 10px 18px;
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 40;
  backdrop-filter: blur(12px);
  max-width: 100%;
  box-sizing: border-box;
}

.session-info-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.session-cat-title {
  font-size: .7rem;
  font-family: var(--font-data);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.session-main-title {
  font-size: .88rem;
  font-weight: 800;
  color: var(--purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.practice-timer-box {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--bg-surface);
  border: 2px solid var(--border);
  font-family: var(--font-data);
  font-weight: 800;
  font-size: .95rem;
  color: var(--purple);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.05);
  flex-shrink: 0;
}

.practice-timer-box.critical {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--danger-light);
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 8px rgba(232,93,90,.3); }
  100% { box-shadow: 0 0 20px rgba(232,93,90,.7); }
}

/* Palette Toggle Button */
.palette-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--purple);
  font-family: var(--font-data);
  font-weight: 800;
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.palette-toggle-btn:hover {
  border-color: var(--purple);
  background: rgba(123,79,163,.08);
  box-shadow: 0 2px 10px rgba(123,79,163,.15);
}

.palette-toggle-btn.open {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* Palette Popover Modal / Grid Sheet */
.palette-popover-modal {
  position: fixed;
  top: calc(var(--topbar-h) + 70px);
  right: var(--sp-6);
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(480px, 75vh);
  background: var(--bg-surface-2);
  border: 2px solid rgba(123,79,163,.25);
  border-radius: var(--r-xl);
  box-shadow: 0 16px 48px rgba(35,20,50,.28);
  padding: var(--sp-4);
  display: none;
  flex-direction: column;
  gap: var(--sp-3);
  z-index: 150;
  backdrop-filter: blur(16px);
  animation: dropdown-pop .2s cubic-bezier(.16,1,.3,1) forwards;
  box-sizing: border-box;
}

.palette-popover-modal.open {
  display: flex;
}

.palette-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.palette-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 6px;
}

.palette-legend-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.palette-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.palette-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.palette-grid-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 4px;
}

.palette-number-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-data);
  font-weight: 700;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.palette-number-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
  transform: scale(1.06);
}

.palette-number-btn.answered {
  background: rgba(63,143,91,.15);
  border-color: var(--jungle);
  color: var(--jungle);
  font-weight: 800;
}

.palette-number-btn.doubtful {
  background: #fdf3d6;
  border-color: #d97706;
  color: #8f5a00;
  font-weight: 800;
  position: relative;
}

.palette-number-btn.doubtful::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d97706;
  box-shadow: 0 0 4px rgba(217,119,6,.8);
}

.palette-number-btn.current {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(123,79,163,.3);
}

.palette-number-btn.doubtful.current {
  background: linear-gradient(135deg, var(--purple) 65%, #d97706 100%);
  border-color: #d97706;
  color: #fff;
}

.palette-number-btn.doubtful.current::after {
  background: #fef08a;
}

/* Flash highlight animation when jumping to question */
@keyframes question-flash {
  0% { box-shadow: 0 0 0 4px var(--pink); transform: scale(1.01); }
  50% { box-shadow: 0 0 24px rgba(232,74,138,.6); transform: scale(1.01); }
  100% { box-shadow: none; transform: scale(1); }
}

.question-highlight-flash {
  animation: question-flash 1.5s ease-out;
}

/* ============================================================
   PRACTICE — SINGLE QUESTION STEP-BY-STEP VIEW
   ============================================================ */

.practice-step-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  width: 100%;
}

.practice-progressbar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(123,79,163,.12);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: var(--sp-2);
}

.practice-progressbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--yellow));
  border-radius: var(--r-full);
  transition: width .3s ease;
}

.practice-step-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: step-fade .25s ease-out;
}

@keyframes step-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.practice-step-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) 0 var(--sp-10);
}

.step-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 2px solid transparent;
}

.step-nav-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.step-nav-prev {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-body);
}

.step-nav-prev:hover:not(:disabled) {
  border-color: var(--purple);
  color: var(--purple);
  transform: translateX(-3px);
  background: rgba(123,79,163,.06);
}

.step-nav-doubt {
  background: var(--bg-surface);
  border-color: rgba(217,119,6,.4);
  color: #a06300;
  font-weight: 800;
}

.step-nav-doubt:hover {
  background: rgba(246,196,69,.15);
  border-color: #d97706;
  color: #784500;
  transform: translateY(-2px);
}

.step-nav-doubt.active {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  border-color: #d97706;
  color: #451a03;
  box-shadow: 0 4px 16px rgba(245,158,11,.4);
}

.step-nav-next {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(232,74,138,.3);
}

.step-nav-next:hover:not(:disabled) {
  transform: translateX(3px);
  box-shadow: 0 6px 22px rgba(123,79,163,.4);
}

.step-nav-submit {
  background: linear-gradient(135deg, var(--jungle) 0%, #207a4a 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(63,143,91,.3);
}

.step-nav-submit:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 22px rgba(63,143,91,.45);
}

@media (max-width: 768px) {
  .practice-step-card {
    padding: var(--sp-5) var(--sp-4);
  }
  .practice-step-navbar {
    flex-direction: column;
    width: 100%;
  }
  .practice-step-navbar > * {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   PRACTICE — Split Screen & Question Cards
   ============================================================ */

.practice-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.practice-questions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  width: 100%;
  max-width: 100%;
}

.practice-question-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.practice-passage-box {
  background: var(--bg-surface);
  border: 1.5px solid rgba(123,79,163,.2);
  border-left: 4px solid var(--purple);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-body);
}

.practice-passage-label {
  font-size: .72rem;
  font-weight: 800;
  font-family: var(--font-data);
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.practice-passage-content {
  white-space: pre-line;
  color: var(--text-heading);
  font-style: normal;
}

.pq-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
  width: 100%;
}

.pq-num {
  font-size: .75rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  flex: 1 1 200px;
  max-width: 100%;
}

.pq-num span {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .practice-active-header {
    top: 65px;
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-3);
  }

  .session-cat-title { max-width: 160px; font-size: .65rem; }
  .session-main-title { max-width: 180px; font-size: .8rem; }

  .practice-timer-box {
    padding: 4px 10px;
    font-size: .85rem;
  }

  .palette-number-btn {
    width: 26px; height: 26px;
    font-size: .7rem;
  }

  .practice-setup-card {
    padding: var(--sp-5) var(--sp-4);
  }

  .setup-pill-btn {
    padding: 8px 12px;
    font-size: .82rem;
    white-space: normal;
    text-align: left;
  }

  .practice-question-card {
    padding: var(--sp-4);
  }

  .qc-question-text {
    font-size: .95rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .qc-option {
    padding: var(--sp-3) var(--sp-4);
    font-size: .85rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* ============================================================
   RESULT SCORE CARD
   ============================================================ */

.result-card {
  background: linear-gradient(145deg, rgba(123,79,163,.08), rgba(232,74,138,.06));
  border: 1.5px solid rgba(123,79,163,.2);
  border-radius: var(--r-xl);
  padding: var(--sp-10);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246,196,69,.1) 0%, transparent 70%);
}

.result-score-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-6);
  box-shadow: var(--shadow-glow-purple);
}

.result-score-num {
  font-family: var(--font-data);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.result-score-max {
  font-size: .75rem;
  color: rgba(255,255,255,.7);
  font-weight: 600;
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: var(--sp-2);
}

.result-subtitle { color: var(--text-muted); margin-bottom: var(--sp-6); }

.result-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

/* ============================================================
   MISTAKE BANK — Garden of Growth
   ============================================================ */

.mistake-hero {
  text-align: center;
  padding: var(--sp-10) 0 var(--sp-8);
  position: relative;
}

.mistake-hero-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: var(--sp-3);
}

.mistake-hero-desc { color: var(--text-muted); max-width: 460px; margin: 0 auto var(--sp-8); }

.mistake-counters {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: var(--sp-4);
  max-width: 500px;
  margin: 0 auto;
}

.mistake-counter-card {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  text-align: center;
  border: 1.5px solid;
}

.mcc-review  { background: var(--danger-light);  border-color: rgba(232,93,90,.25);  }
.mcc-working { background: var(--warning-light); border-color: rgba(246,196,69,.35); }
.mcc-done    { background: var(--success-light); border-color: rgba(63,143,91,.25);  }

.mcc-num {
  font-family: var(--font-data);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--sp-1);
}

.mcc-review  .mcc-num { color: var(--coral);  }
.mcc-working .mcc-num { color: #8a6200;       }
.mcc-done    .mcc-num { color: var(--jungle); }

.mcc-label {
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--text-muted);
}

/* Mistake Item */
.mistake-item {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: all var(--t-fast);
}

.mistake-item:hover { border-color: rgba(123,79,163,.2); box-shadow: var(--shadow-sm); }

.mistake-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.msd-new      { background: var(--coral);  }
.msd-review   { background: var(--yellow); }
.msd-mastered { background: var(--jungle); }

.mistake-content { flex: 1; }

.mistake-meta {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.mistake-question {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-heading);
  margin-bottom: var(--sp-2);
}

.mistake-actions { margin-left: auto; display: flex; gap: var(--sp-2); }

/* ============================================================
   PROGRESS & MASTERY
   ============================================================ */

.progress-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
  gap: var(--sp-4);
}

/* SVG Circular Ring */
.mastery-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.mastery-ring {
  position: relative;
  width: 180px; height: 180px;
}

.mastery-ring svg {
  width: 180px; height: 180px;
  transform: rotate(-90deg);
}

.ring-track { fill: none; stroke: var(--border); stroke-width: 12; }
.ring-fill  {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke: url(#ringGrad);
  transition: stroke-dashoffset .8s cubic-bezier(.25,.46,.45,.94);
}

.mastery-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mastery-pct {
  font-family: var(--font-data);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
}

.mastery-sub {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Per-chapter bars */
.chapter-bar-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.chapter-bar-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

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

.chapter-bar-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-body);
}

.chapter-bar-pct {
  font-family: var(--font-data);
  font-size: .8rem;
  font-weight: 700;
  color: var(--purple);
}

/* Garden Growth Metaphor */
.garden-stages {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-8) 0;
  flex-wrap: wrap;
}

.garden-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  opacity: .35;
  transition: opacity var(--t-base);
}

.garden-stage.reached { opacity: 1; }

.garden-stage-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: grayscale(1);
  transition: filter var(--t-base);
}

.garden-stage.reached .garden-stage-icon { filter: none; }

.garden-stage-name {
  font-family: var(--font-data);
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.garden-stage.reached .garden-stage-name { color: var(--jungle); }

/* ============================================================
   SEARCH MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(59,36,69,.45);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  padding: 80px var(--sp-5) var(--sp-5);
}

.modal-overlay.open {
  display: flex;
  animation: modal-fade-in var(--t-base) ease forwards;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-scale-in var(--t-base) cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(.94) translateY(-16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1.5px solid var(--border);
  gap: var(--sp-3);
}

.search-icon { font-size: 1rem; color: var(--text-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  font-family: var(--font-body);
}

.search-input::placeholder { color: var(--subtle); font-weight: 500; }

.search-shortcut {
  font-size: .7rem;
  font-family: var(--font-data);
  color: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.search-results {
  max-height: 380px;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-2);
}

.search-result-group-label {
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--font-data);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--subtle);
  padding: var(--sp-2) var(--sp-3);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
}

.search-result-item:hover {
  background: rgba(123,79,163,.07);
}

.sri-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: rgba(123,79,163,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

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

.sri-title {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sri-cat {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: var(--font-data);
}

.sri-arrow {
  color: var(--subtle);
  font-size: .8rem;
  flex-shrink: 0;
}

.search-empty {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  color: var(--text-muted);
}

.search-empty-icon { font-size: 2rem; margin-bottom: var(--sp-3); }

/* ============================================================
   SETTINGS MODAL
   ============================================================ */

.settings-box {
  max-width: 440px;
}

.settings-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-heading);
}

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

.modal-close-btn:hover { background: var(--danger-light); color: var(--coral); border-color: rgba(232,93,90,.3); }

.settings-body { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-5); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.setting-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-body);
}

.setting-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform var(--t-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider { background: var(--purple); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Range Input */
.range-input {
  width: 140px;
  accent-color: var(--purple);
}

/* ============================================================
   FLOATING FOCUS BAR
   ============================================================ */

.focus-bar {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-4);
  display: none;
  align-items: center;
  gap: var(--sp-4);
  box-shadow: var(--shadow-lg);
  z-index: 180;
  white-space: nowrap;
  animation: focus-bar-in var(--t-slow) cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes focus-bar-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.focus-mode .focus-bar { display: flex; }
body.focus-mode .sidebar   { transform: translateX(calc(-1 * var(--sidebar-w))); }
body.focus-mode .main-layout { margin-left: 0; }
body.focus-mode .topbar    { display: none; }

.focus-bar-title {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-heading);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-bar-btn {
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: var(--font-body);
}

.focus-bar-exit {
  background: var(--danger-light);
  color: var(--coral);
  border: 1.5px solid rgba(232,93,90,.25);
}

.focus-bar-exit:hover { background: var(--coral); color: #fff; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
  position: fixed;
  top: var(--sp-6);
  right: var(--sp-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-body);
  min-width: 240px;
  pointer-events: all;
  animation: toast-in .3s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.out {
  animation: toast-out .25s ease forwards;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(30px); }
}

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--jungle); }
.toast-error   { border-left: 3px solid var(--coral);  }
.toast-info    { border-left: 3px solid var(--sky);    }
.toast-warning { border-left: 3px solid var(--yellow); }

/* ============================================================
   DARK MODE GLOW EFFECTS
   ============================================================ */

body.dark .greeting-card {
  background: linear-gradient(135deg, rgba(232,74,138,.10), rgba(123,79,163,.12));
  border-color: rgba(123,79,163,.25);
}

body.dark .qa-card::before { opacity: .08; }
body.dark .qa-card::after  { opacity: .05; }

body.dark .journey-step.current .step-circle {
  box-shadow: 0 0 0 6px rgba(232,74,138,.15), 0 0 24px rgba(232,74,138,.3);
}

body.dark .flashcard-front {
  background: linear-gradient(145deg, #4A2875 0%, #7B4FA3 50%, #A03070 100%);
}

body.dark .flashcard-back {
  background: linear-gradient(145deg, #0E4C5A 0%, #1A6E86 50%, #2A5F3C 100%);
}

body.dark .arena-card {
  background: var(--bg-surface);
}

body.dark .topbar {
  border-bottom-color: rgba(255,255,255,.07);
}

/* Magical dark mode sparkle on headings */
body.dark h1,
body.dark .greeting-title,
body.dark .page-title {
  text-shadow: 0 0 40px rgba(246,196,69,.08);
}

/* ============================================================
   MATERIAL LIST PAGE
   ============================================================ */

.material-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.material-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.material-card:hover {
  transform: translateX(4px);
  border-color: rgba(123,79,163,.2);
  box-shadow: var(--shadow-md);
}

.material-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 0 var(--r-full) var(--r-full) 0;
  background: var(--border);
  transition: all var(--t-fast);
}

.material-card:hover::before { background: linear-gradient(to bottom, var(--pink), var(--purple)); }

.material-emoji {
  font-size: 2rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: rgba(123,79,163,.08);
  flex-shrink: 0;
}

.material-info { flex: 1; }

.material-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: var(--sp-1);
}

.material-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.material-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.material-xp {
  font-family: var(--font-data);
  font-size: .8rem;
  font-weight: 700;
  color: #8a6200;
  background: var(--warning-light);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.material-progress-wrap {
  width: 100px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: var(--sp-4); opacity: .6; }

.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-heading);
  margin-bottom: var(--sp-2);
}

.empty-desc { font-size: .9rem; margin-bottom: var(--sp-5); }

/* ============================================================
   SIDEBAR OVERLAY (mobile slide-in)
   ============================================================ */

/* ============================================================
   RESPONSIVE — TABLET (768–1199px)
   ============================================================ */

@media (max-width: 1199px) {
  .quick-access { grid-template-columns: repeat(2,1fr); }
  .reader-layout { grid-template-columns: 1fr; }
  .toc-rail { position: static; }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-stimulus { position: static; max-height: none; }
  .concept-grid { grid-template-columns: 1fr; }
  .garden-stages { gap: var(--sp-4); }
}

@media (max-width: 900px) {
  .main-content { padding: var(--sp-6); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .greeting-card { flex-direction: column; text-align: center; }
  .casa-illustration { display: none; }
  .greeting-stats { justify-content: center; }
}

/* ============================================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================================ */

@media (max-width: 767px) {
  :root { --sidebar-w: 260px; --topbar-h: 56px; }

  .sidebar {
    transform: translateX(-100%);
    z-index: 110;
  }

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

  .sidebar-overlay.open {
    display: block;
    animation: modal-fade-in .2s ease forwards;
  }

  .main-layout { margin-left: 0; }

  .topbar-hamburger { display: flex; }

  .bottom-nav { display: flex; }

  .main-content {
    padding: var(--sp-5);
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .quick-access { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

  .qa-card { min-height: 110px; padding: var(--sp-4); }

  .qa-icon { font-size: 1.4rem; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .arena-cards { grid-template-columns: 1fr; gap: var(--sp-3); }

  .arena-vs { flex-direction: row; }

  .greeting-title { font-size: 1.4rem; }

  .page-title { font-size: 1.5rem; }

  .trap-diagnostic { grid-template-columns: 1fr; }

  .comparison-card { grid-template-columns: 1fr; }

  .vs-badge { display: none; }

  .flashcard-scene { height: 260px; }

  .arena-word { font-size: 1.5rem; }

  .quiz-score-panel { gap: var(--sp-4); padding: var(--sp-4); flex-wrap: wrap; justify-content: center; }

  .reader-content { padding: var(--sp-6); }

  .reader-content h2 { font-size: 1.2rem; }

  .fc-text { font-size: 1rem; }

  .mistake-counters { grid-template-columns: 1fr; max-width: 100%; }

  .journey-stepper { gap: 0; }

  .journey-step { min-width: 64px; }

  .toast-container { top: var(--sp-3); right: var(--sp-3); left: var(--sp-3); }

  .material-header-card {
    padding: var(--sp-5) var(--sp-4);
  }

  .learning-goals-box {
    padding: var(--sp-4);
  }

  .section-card {
    padding: var(--sp-4);
  }

  .practice-active-header {
    top: calc(var(--topbar-h) + 4px);
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
  }

  .session-info-wrap {
    max-width: 140px;
  }

  .session-cat-title {
    font-size: .62rem;
  }

  .session-main-title {
    font-size: .78rem;
  }

  .pq-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .pq-num {
    font-size: .72rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    width: 100%;
  }

  .focus-bar {
    left: var(--sp-4); right: var(--sp-4);
    transform: translateX(0);
    bottom: calc(80px + env(safe-area-inset-bottom) + var(--sp-3));
    border-radius: var(--r-lg);
  }

  body.focus-mode .focus-bar { transform: none; }
}

/* ============================================================
   MATERIAL SECTIONS RENDERER SYSTEM & NAVIGATION
   ============================================================ */

.reader-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.reader-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  color: var(--purple);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
}

.reader-back-btn:hover {
  background: rgba(123,79,163,.1);
  border-color: var(--purple);
  transform: translateX(-3px);
}

.reader-step-indicator {
  font-family: var(--font-data);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
}

/* Material Bottom Navigation Footer */
.material-nav-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: stretch;
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1.5px dashed var(--border);
}

@media (max-width: 768px) {
  .material-nav-footer {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }
}

.mat-nav-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.mat-nav-card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.mat-nav-card.prev:hover {
  transform: translateX(-4px) translateY(-2px);
}

.mat-nav-card.next:hover {
  transform: translateX(4px) translateY(-2px);
}

.mat-nav-card.disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--bg-surface);
  border-color: var(--border);
}

.mat-nav-direction {
  font-size: .7rem;
  font-family: var(--font-data);
  font-weight: 800;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.mat-nav-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mat-nav-center-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--purple);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.mat-nav-center-btn:hover {
  background: rgba(123,79,163,.1);
  border-color: var(--purple);
}

/* TOC quick jump buttons */
.toc-quick-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.material-header-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-6);
  position: relative;
  overflow: hidden;
}

.material-header-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--yellow));
}

.material-meta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.priority-badge {
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--font-data);
  padding: 3px 10px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.priority-high {
  background: rgba(232,74,138,.12);
  color: var(--pink);
  border: 1px solid rgba(232,74,138,.25);
}

.priority-normal {
  background: rgba(85,184,217,.12);
  color: #1a6e86;
  border: 1px solid rgba(85,184,217,.25);
}

.learning-goals-box {
  background: linear-gradient(145deg, rgba(123,79,163,.06), rgba(246,196,69,.05));
  border: 1.5px dashed rgba(123,79,163,.25);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-6) 0;
}

.learning-goals-title {
  font-family: var(--font-data);
  font-size: .78rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.learning-goals-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
}

.learning-goal-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: .88rem;
  color: var(--text-body);
}

.learning-goal-item::before {
  content: '🌸';
  font-size: .8rem;
  flex-shrink: 0;
  margin-top: 3px;
}

/* Sections */
.reader-section {
  margin: var(--sp-6) 0;
}

.section-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  transition: transform var(--t-fast), border-color var(--t-fast);
}

.section-card:hover {
  border-color: rgba(123,79,163,.25);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.section-badge {
  font-size: .7rem;
  font-family: var(--font-data);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-heading);
  margin: 0;
}

.reading-passage-box {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-8);
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.85;
  color: var(--text-heading);
  position: relative;
  box-shadow: inset 0 2px 8px rgba(59,36,69,.03);
}

.reading-passage-box::before {
  content: '📖 Reading Passage';
  display: block;
  font-family: var(--font-data);
  font-size: .7rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1.5px dashed var(--border);
}

.reading-passage-box p {
  margin-bottom: var(--sp-4);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-3);
}

.analysis-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.analysis-word {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analysis-meaning {
  font-size: .88rem;
  color: var(--text-body);
  line-height: 1.5;
}

.analysis-clue {
  font-size: .78rem;
  color: var(--muted);
  background: rgba(85,184,217,.08);
  border-left: 2.5px solid var(--sky);
  padding: var(--sp-2) var(--sp-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.takeaway-card {
  background: linear-gradient(135deg, rgba(246,196,69,.12) 0%, rgba(232,74,138,.1) 100%);
  border: 1.5px solid rgba(246,196,69,.35);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
}

.takeaway-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.takeaway-content strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #8a6200;
  margin-bottom: var(--sp-1);
}

.takeaway-content p {
  margin: 0;
  font-size: .92rem;
  color: var(--text-heading);
  font-weight: 600;
}

/* ============================================================
   DICTIONARY HUB SYSTEM (11,000+ LEXICON)
   ============================================================ */

.dictionary-hero {
  background: linear-gradient(135deg, rgba(123,79,163,.12) 0%, rgba(232,74,138,.10) 50%, rgba(246,196,69,.08) 100%);
  border: 1.5px solid rgba(123,79,163,.2);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  margin-bottom: var(--sp-6);
  position: relative;
  overflow: hidden;
}

.dict-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,74,138,.15);
  color: var(--pink);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-family: var(--font-data);
  font-weight: 700;
  font-size: .75rem;
  margin-bottom: var(--sp-2);
}

.dict-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-5);
  gap: var(--sp-3);
  box-shadow: var(--shadow-md);
  margin-top: var(--sp-5);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.dict-search-box:focus-within {
  border-color: var(--purple);
  box-shadow: var(--shadow-glow-purple);
}

.dict-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  outline: none;
}

.dict-search-input::placeholder {
  color: var(--subtle);
  font-weight: 500;
}

/* Alphabet Bar */
.dict-alphabet-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: var(--sp-3) var(--sp-1);
  margin-bottom: var(--sp-5);
  scrollbar-width: thin;
}

.dict-letter-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-family: var(--font-data);
  font-weight: 700;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.dict-letter-btn:hover {
  background: rgba(123,79,163,.1);
  color: var(--purple);
  border-color: var(--purple);
  transform: translateY(-2px);
}

.dict-letter-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(232,74,138,.35);
  transform: scale(1.08);
}

/* Dictionary Controls & Stats */
.dict-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.dict-stats-label {
  font-size: .82rem;
  font-family: var(--font-data);
  font-weight: 600;
  color: var(--text-muted);
}

.dict-tabs {
  display: flex;
  gap: var(--sp-2);
}

.dict-tab-btn {
  padding: 6px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-surface-2);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dict-tab-btn.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* Dictionary Words Grid */
.dict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dict-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
}

.dict-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(123,79,163,.3);
}

.dict-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.dict-word-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple);
  margin: 0;
  line-height: 1.2;
}

.dict-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dict-action-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--t-fast);
}

.dict-action-btn:hover {
  background: rgba(123,79,163,.1);
  color: var(--purple);
  border-color: var(--purple);
  transform: scale(1.08);
}

.dict-action-btn.starred {
  color: #e6a100;
  background: rgba(246,196,69,.2);
  border-color: rgba(246,196,69,.5);
}

.dict-def-text {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
  flex: 1;
}

.dict-load-more {
  display: flex;
  justify-content: center;
  margin: var(--sp-6) 0 var(--sp-10);
}

/* Word of the Day Card */
.word-of-day-card {
  background: linear-gradient(145deg, rgba(232,74,138,.08), rgba(246,196,69,.08));
  border: 1.5px solid rgba(232,74,138,.2);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  position: relative;
  overflow: hidden;
}

.wod-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.wod-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--pink);
  margin-bottom: var(--sp-1);
}

.wod-meaning {
  font-size: .9rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   STUDY TIPS & QUICK REVIEW
   ============================================================ */

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.tip-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  transition: transform var(--t-fast), border-color var(--t-fast);
}

.tip-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple);
}

.tip-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--purple));
  color: #fff;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: var(--sp-1);
}

.tip-text {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.qr-card {
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
}

.qr-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--purple);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1.5px dashed var(--border);
}

.qr-points {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.qr-point-item {
  font-size: .88rem;
  color: var(--text-body);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.qr-point-item::before {
  content: '✨';
  font-size: .75rem;
  margin-top: 4px;
  flex-shrink: 0;
}

/* ============================================================
   PRINT / READING MODE
   ============================================================ */

@media print {
  .sidebar, .topbar, .bottom-nav, .focus-bar, .toast-container,
  .modal-overlay, .topbar-actions { display: none !important; }
  .main-layout { margin-left: 0; }
  .reader-content { box-shadow: none; border: none; }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-pink    { color: var(--pink);    }
.text-purple  { color: var(--purple);  }
.text-yellow  { color: var(--yellow);  }
.text-green   { color: var(--jungle);  }
.text-sky     { color: var(--sky);     }
.text-orange  { color: var(--orange);  }
.text-coral   { color: var(--coral);   }
.text-muted   { color: var(--text-muted); }
.text-heading { color: var(--text-heading); }
.text-center  { text-align: center; }

.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.font-data { font-family: var(--font-data); }
.font-display { font-family: var(--font-display); }

.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.separator {
  height: 1.5px;
  background: var(--border);
  border-radius: var(--r-full);
  margin: var(--sp-6) 0;
}

/* Focus visible ring */
*:focus-visible {
  outline: 2.5px solid var(--purple);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
