:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #16162a;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --accent: #6c63ff;
  --accent2: #ff6584;
  --accent3: #43e97b;
  --accent4: #f7971e;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --sidebar-w: 260px;
  --header-h: 64px;
  --bottom-nav-h: 70px;
}

[data-theme="light"] {
  --bg-primary: #f0f0ff;
  --bg-secondary: #e8e8f8;
  --bg-card: rgba(255,255,255,0.8);
  --bg-card-hover: rgba(255,255,255,0.95);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aaa;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
}

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

html { scroll-behavior:smooth; }

body {
  font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
  background:var(--bg-primary);
  color:var(--text-primary);
  min-height:100vh;
  overflow-x:hidden;
  direction:rtl;
  line-height:1.6;
}

body::before {
  content:'';
  position:fixed;
  inset:0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(108,99,255,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255,101,132,0.1) 0%, transparent 50%);
  pointer-events:none;
  z-index:0;
}

#root { position:relative; z-index:1; }

/* Scrollbar */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:var(--bg-secondary); }
::-webkit-scrollbar-thumb { background:var(--accent); border-radius:3px; }

/* Layout */
.app-layout { display:flex; min-height:100vh; min-height:100dvh; }

.sidebar {
  width:var(--sidebar-w);
  background:var(--bg-secondary);
  border-left:1px solid var(--border);
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  overflow-y:auto;
  z-index:100;
  backdrop-filter:blur(20px);
  transition:transform var(--transition);
  display:flex;
  flex-direction:column;
}

.main-content {
  flex:1;
  margin-right:var(--sidebar-w);
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
}

/* Header */
.header {
  height:var(--header-h);
  background:rgba(var(--bg-secondary),0.8);
  backdrop-filter:blur(20px);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 24px;
  position:sticky;
  top:0;
  z-index:90;
}

/* Glassmorphism Card */
.glass-card {
  background:var(--bg-card);
  backdrop-filter:blur(20px);
  border:1px solid var(--border);
  border-radius:var(--radius);
  transition:all var(--transition);
}

.glass-card:hover {
  background:var(--bg-card-hover);
  transform:translateY(-2px);
  box-shadow:var(--shadow);
}

/* Sidebar Logo */
.sidebar-logo {
  padding:20px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:12px;
}
.sidebar-logo .logo-icon {
  width:42px; height:42px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; flex-shrink:0;
}
.sidebar-logo .logo-text { font-weight:700; font-size:16px; }
.sidebar-logo .logo-sub { font-size:11px; color:var(--text-muted); }

/* Sidebar Nav */
.sidebar-nav { flex:1; padding:16px 0; }
.sidebar-nav-item {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 20px;
  cursor:pointer;
  color:var(--text-secondary);
  transition:all var(--transition);
  border-radius:0;
  margin:2px 12px;
  border-radius:var(--radius-sm);
  font-size:14px;
  font-weight:500;
}
.sidebar-nav-item:hover { background:var(--bg-card); color:var(--text-primary); }
.sidebar-nav-item.active {
  background:linear-gradient(135deg,rgba(108,99,255,0.2),rgba(255,101,132,0.1));
  color:var(--accent);
  border:1px solid rgba(108,99,255,0.2);
}
.sidebar-nav-item .nav-icon { font-size:18px; width:24px; text-align:center; }
.sidebar-nav-item .nav-badge {
  margin-right:auto;
  background:var(--accent2);
  color:white;
  font-size:11px;
  padding:2px 7px;
  border-radius:10px;
  font-weight:600;
}

/* Sidebar bottom */
.sidebar-bottom { padding:16px; border-top:1px solid var(--border); }

/* User mini profile */
.sidebar-user {
  display:flex; align-items:center; gap:10px;
  padding:12px; border-radius:var(--radius-sm);
  background:var(--bg-card); cursor:pointer;
  transition:all var(--transition);
}
.sidebar-user:hover { background:var(--bg-card-hover); }
.sidebar-user .avatar {
  width:38px; height:38px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:16px; color:white; flex-shrink:0;
}
.sidebar-user .user-info .name { font-weight:600; font-size:13px; }
.sidebar-user .user-info .level { font-size:11px; color:var(--text-muted); }

/* Header controls */
.header-left { display:flex; align-items:center; gap:12px; }
.header-right { display:flex; align-items:center; gap:12px; }
.header-title { font-size:18px; font-weight:700; }

.btn-icon {
  width:38px; height:38px;
  border:none; background:var(--bg-card);
  border-radius:var(--radius-sm);
  cursor:pointer; color:var(--text-secondary);
  display:flex; align-items:center; justify-content:center;
  transition:all var(--transition);
  font-size:16px;
}
.btn-icon:hover { background:var(--bg-card-hover); color:var(--accent); transform:scale(1.05); }

/* Streak badge in header */
.streak-badge {
  display:flex; align-items:center; gap:6px;
  background:rgba(255,107,0,0.15);
  border:1px solid rgba(255,107,0,0.3);
  border-radius:20px; padding:6px 12px;
  font-size:13px; font-weight:600; color:#ff6b00;
}

/* XP badge */
.xp-badge {
  display:flex; align-items:center; gap:6px;
  background:rgba(108,99,255,0.15);
  border:1px solid rgba(108,99,255,0.3);
  border-radius:20px; padding:6px 12px;
  font-size:13px; font-weight:600; color:var(--accent);
}

/* Main page area */
.page-content { padding:24px; flex:1; }
.page-header { margin-bottom:24px; }
.page-header h1 { font-size:24px; font-weight:800; margin-bottom:4px; }
.page-header p { color:var(--text-secondary); font-size:14px; }

/* Dashboard Stats Grid */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card {
  padding:20px;
  position:relative; overflow:hidden;
}
.stat-card::before {
  content:'';
  position:absolute; top:-20px; left:-20px;
  width:80px; height:80px;
  border-radius:50%;
  opacity:0.1;
}
.stat-card.blue::before { background:var(--accent); }
.stat-card.red::before { background:var(--accent2); }
.stat-card.green::before { background:var(--accent3); }
.stat-card.orange::before { background:var(--accent4); }

.stat-icon { font-size:28px; margin-bottom:8px; }
.stat-value { font-size:32px; font-weight:800; line-height:1; margin-bottom:4px; }
.stat-value.blue { color:var(--accent); }
.stat-value.red { color:var(--accent2); }
.stat-value.green { color:var(--accent3); }
.stat-value.orange { color:var(--accent4); }
.stat-label { font-size:13px; color:var(--text-secondary); }

/* Progress Ring */
.progress-ring-container {
  display:flex; align-items:center; justify-content:center;
  gap:32px; padding:28px;
  margin-bottom:24px;
}
.progress-ring-wrap { position:relative; width:160px; height:160px; flex-shrink:0; }
.progress-ring-wrap svg { transform:rotate(-90deg); }
.progress-ring-center {
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
}
.progress-ring-pct { font-size:32px; font-weight:800; color:var(--accent); }
.progress-ring-sub { font-size:11px; color:var(--text-muted); }
.progress-ring-info { flex:1; }
.progress-ring-info h2 { font-size:20px; font-weight:700; margin-bottom:8px; }
.progress-ring-info p { color:var(--text-secondary); font-size:14px; margin-bottom:16px; }

/* Review alert */
.review-alert {
  display:flex; align-items:center; gap:16px;
  background:linear-gradient(135deg,rgba(108,99,255,0.15),rgba(255,101,132,0.1));
  border:1px solid rgba(108,99,255,0.25);
  border-radius:var(--radius); padding:16px 20px;
  margin-bottom:24px;
}
.review-alert .review-count { font-size:28px; font-weight:800; color:var(--accent); }
.review-alert .review-text { flex:1; }
.review-alert .review-text h3 { font-size:16px; font-weight:600; margin-bottom:2px; }
.review-alert .review-text p { font-size:13px; color:var(--text-secondary); }

/* Continue learning banner */
.continue-banner {
  display:flex; align-items:center; gap:16px;
  background:linear-gradient(135deg,var(--accent),rgba(108,99,255,0.6));
  border-radius:var(--radius); padding:20px 24px;
  margin-bottom:24px; color:white;
}
.continue-banner .banner-text h3 { font-size:16px; font-weight:700; margin-bottom:4px; }
.continue-banner .banner-text p { font-size:13px; opacity:0.85; }
.continue-banner .banner-icon { font-size:36px; }

/* Buttons */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 20px; border-radius:var(--radius-sm);
  font-weight:600; font-size:14px; cursor:pointer;
  border:none; transition:all var(--transition);
  text-decoration:none;
}
.btn-primary {
  background:linear-gradient(135deg,var(--accent),rgba(108,99,255,0.8));
  color:white;
}
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 4px 20px rgba(108,99,255,0.4); }
.btn-secondary {
  background:var(--bg-card); color:var(--text-primary);
  border:1px solid var(--border);
}
.btn-secondary:hover { background:var(--bg-card-hover); }
.btn-success { background:linear-gradient(135deg,var(--accent3),#00c9ff); color:#0a2a1a; }
.btn-danger { background:linear-gradient(135deg,var(--accent2),#ff4757); color:white; }
.btn-warning { background:linear-gradient(135deg,var(--accent4),#ffd200); color:#1a0a00; }
.btn-sm { padding:6px 14px; font-size:12px; }
.btn-lg { padding:14px 28px; font-size:16px; }
.btn:disabled { opacity:0.5; cursor:not-allowed; transform:none !important; }

/* Word Cards Section */
.words-filters {
  display:flex; gap:12px; flex-wrap:wrap;
  margin-bottom:20px; align-items:center;
}
.filter-select {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text-primary);
  padding:8px 14px; font-size:13px;
  cursor:pointer; appearance:none;
  outline:none;
}
.search-input {
  flex:1; min-width:200px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text-primary);
  padding:8px 16px; font-size:13px;
  outline:none; transition:all var(--transition);
}
.search-input::placeholder { color:var(--text-muted); }
.search-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(108,99,255,0.1); }

/* Words Grid */
.words-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; }

/* Word Card */
.word-card {
  padding:20px;
  cursor:pointer;
  position:relative;
}
.word-card .wc-header {
  display:flex; justify-content:space-between; align-items:flex-start;
  margin-bottom:12px;
}
.word-card .wc-dutch { font-size:22px; font-weight:800; color:var(--accent); line-height:1.2; }
.word-card .wc-article { font-size:13px; color:var(--accent2); font-weight:500; }
.word-card .wc-arabic { font-size:17px; font-weight:700; color:var(--text-primary); margin-bottom:8px; }
.word-card .wc-type {
  display:inline-block; font-size:11px;
  background:rgba(108,99,255,0.15); color:var(--accent);
  padding:3px 9px; border-radius:10px; margin-bottom:10px;
}
.word-card .wc-source-badge {
  display:inline-block; font-size:11px; font-weight:700;
  background:rgba(67,233,123,0.12); color:#32b86a;
  border:1px solid rgba(67,233,123,0.24);
  padding:3px 8px; border-radius:10px; margin:0 0 10px 6px;
  white-space:nowrap;
}
.word-card .wc-example {
  font-size:13px; color:var(--text-secondary);
  padding:10px; background:rgba(255,255,255,0.03);
  border-radius:var(--radius-sm); border-right:3px solid var(--accent);
  margin-bottom:10px; font-style:italic;
}
.word-card .wc-example-ar { font-size:12px; color:var(--text-muted); margin-top:4px; }
.word-card .wc-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.word-card .wc-thema {
  font-size:11px; color:var(--text-muted);
  padding:3px 8px; border-radius:10px;
  background:var(--bg-secondary);
}
.word-card .wc-mastery {
  height:4px; background:var(--bg-secondary);
  border-radius:2px; margin-top:10px; overflow:hidden;
}
.word-card .wc-mastery-fill {
  height:100%; border-radius:2px;
  background:linear-gradient(90deg,var(--accent3),var(--accent));
  transition:width var(--transition);
}
.word-card .wc-btns { display:flex; gap:6px; margin-right:auto; }
.wc-fav-btn {
  background:none; border:none; cursor:pointer;
  color:var(--text-muted); font-size:16px;
  transition:all var(--transition); padding:4px;
}
.wc-fav-btn.active { color:#ff6584; transform:scale(1.2); }
.wc-audio-btn {
  background:none; border:none; cursor:pointer;
  color:var(--accent); font-size:16px;
  transition:all var(--transition); padding:4px;
}
.wc-audio-btn:hover { transform:scale(1.1); }

/* Mastery status dots */
.status-dot {
  width:8px; height:8px; border-radius:50%;
  display:inline-block; margin-left:4px;
}
.status-new { background:#888; }
.status-learning { background:var(--accent4); }
.status-review { background:var(--accent2); }
.status-mastered { background:var(--accent3); }

/* Sections (Thema) Grid */
.sections-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.section-card { padding:24px; position:relative; overflow:hidden; }
.section-card::before {
  content:''; position:absolute;
  top:-30px; left:-30px;
  width:100px; height:100px;
  border-radius:50%; opacity:0.1;
}
.section-card .sc-emoji { font-size:32px; margin-bottom:12px; }
.section-card .sc-name { font-size:17px; font-weight:700; margin-bottom:4px; }
.section-card .sc-count { font-size:13px; color:var(--text-secondary); margin-bottom:14px; }
.section-card .sc-progress { margin-bottom:8px; }
.progress-bar-wrap { height:8px; background:var(--bg-secondary); border-radius:4px; overflow:hidden; }
.progress-bar-fill {
  height:100%; border-radius:4px;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  transition:width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.sc-pct { font-size:13px; color:var(--text-muted); text-align:left; margin-top:4px; }

/* Quiz / Flashcard */
.flashcard-container {
  max-width:600px; margin:0 auto;
}
.flashcard-wrap {
  perspective:1000px; height:320px; margin-bottom:24px;
}
.flashcard {
  width:100%; height:100%;
  position:relative; transform-style:preserve-3d;
  transition:transform 0.6s cubic-bezier(0.4,0,0.2,1);
  cursor:pointer;
}
.flashcard.flipped { transform:rotateY(180deg); }
.flashcard-face {
  position:absolute; inset:0;
  backface-visibility:hidden;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:32px;
  background:var(--bg-card);
  backdrop-filter:blur(20px);
  border:1px solid var(--border);
  border-radius:var(--radius);
  text-align:center;
}
.flashcard-back { transform:rotateY(180deg); }
.fc-hint { font-size:12px; color:var(--text-muted); margin-bottom:16px; }
.fc-word { font-size:36px; font-weight:800; color:var(--accent); margin-bottom:8px; }
.fc-article { font-size:14px; color:var(--accent2); margin-bottom:8px; }
.fc-type { font-size:12px; background:rgba(108,99,255,0.1); color:var(--accent); padding:4px 12px; border-radius:10px; }
.fc-translation { font-size:28px; font-weight:700; margin-bottom:8px; }
.fc-example { font-size:14px; color:var(--text-secondary); font-style:italic; margin-bottom:8px; }

/* SRS Buttons */
.srs-buttons { display:flex; gap:12px; justify-content:center; }
.srs-btn {
  flex:1; max-width:150px; padding:14px 16px;
  border:none; border-radius:var(--radius-sm);
  cursor:pointer; font-weight:700; font-size:14px;
  transition:all var(--transition);
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.srs-btn .srs-days { font-size:11px; opacity:0.8; }
.srs-hard { background:rgba(255,71,87,0.2); color:#ff4757; border:1px solid rgba(255,71,87,0.3); }
.srs-hard:hover { background:rgba(255,71,87,0.3); transform:translateY(-1px); }
.srs-ok { background:rgba(255,165,0,0.2); color:#ffa500; border:1px solid rgba(255,165,0,0.3); }
.srs-ok:hover { background:rgba(255,165,0,0.3); transform:translateY(-1px); }
.srs-easy { background:rgba(67,233,123,0.2); color:var(--accent3); border:1px solid rgba(67,233,123,0.3); }
.srs-easy:hover { background:rgba(67,233,123,0.3); transform:translateY(-1px); }

/* Progress in review */
.review-progress { margin-bottom:24px; }
.review-progress-text { display:flex; justify-content:space-between; font-size:13px; color:var(--text-secondary); margin-bottom:8px; }

/* Games */
.games-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:16px; margin-bottom:24px; }
.game-card {
  padding:24px; cursor:pointer; text-align:center;
  position:relative; overflow:hidden;
}
.game-card::after {
  content:''; position:absolute; inset:0;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  opacity:0; transition:opacity var(--transition);
}
.game-card:hover::after { opacity:0.05; }
.game-card .game-icon { font-size:40px; margin-bottom:12px; display:block; }
.game-card .game-name { font-size:17px; font-weight:700; margin-bottom:6px; }
.game-card .game-desc { font-size:13px; color:var(--text-secondary); margin-bottom:12px; }
.game-card .game-xp {
  display:inline-flex; align-items:center; gap:4px;
  background:rgba(108,99,255,0.15); color:var(--accent);
  padding:4px 10px; border-radius:10px; font-size:12px; font-weight:600;
}

/* Match Game */
.match-game { max-width:800px; margin:0 auto; }
.match-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.match-col h3 { font-size:14px; color:var(--text-secondary); margin-bottom:12px; text-align:center; }
.match-item {
  padding:12px 16px; border-radius:var(--radius-sm);
  background:var(--bg-card); border:2px solid var(--border);
  cursor:pointer; text-align:center; font-size:15px; font-weight:600;
  transition:all var(--transition); margin-bottom:8px;
  user-select:none;
}
.match-item:hover { border-color:var(--accent); background:var(--bg-card-hover); }
.match-item.selected { border-color:var(--accent); background:rgba(108,99,255,0.15); }
.match-item.correct { border-color:var(--accent3); background:rgba(67,233,123,0.15); color:var(--accent3); }
.match-item.wrong { border-color:var(--accent2); background:rgba(255,101,132,0.15); color:var(--accent2); }

/* MC Quiz */
.mc-quiz { max-width:600px; margin:0 auto; }
.mc-question { font-size:28px; font-weight:800; color:var(--accent); text-align:center; margin-bottom:8px; }
.mc-question-sub { font-size:14px; color:var(--text-secondary); text-align:center; margin-bottom:24px; }
.mc-options { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.mc-option {
  padding:16px; border-radius:var(--radius-sm);
  background:var(--bg-card); border:2px solid var(--border);
  cursor:pointer; font-size:16px; font-weight:600; text-align:center;
  transition:all var(--transition);
}
.mc-option:hover { border-color:var(--accent); background:var(--bg-card-hover); transform:translateY(-1px); }
.mc-option.correct { border-color:var(--accent3); background:rgba(67,233,123,0.2); color:var(--accent3); }
.mc-option.wrong { border-color:var(--accent2); background:rgba(255,101,132,0.2); color:var(--accent2); }
.mc-option:disabled { cursor:default; }

/* Timer */
.game-timer {
  display:flex; align-items:center; justify-content:center; gap:8px;
  font-size:20px; font-weight:700; margin-bottom:16px;
}
.timer-bar { height:6px; background:var(--bg-secondary); border-radius:3px; overflow:hidden; margin-bottom:24px; }
.timer-fill { height:100%; border-radius:3px; background:linear-gradient(90deg,var(--accent3),var(--accent4)); transition:width 1s linear; }
.timer-fill.danger { background:linear-gradient(90deg,var(--accent2),#ff4757); }

/* Score display */
.score-display {
  display:flex; align-items:center; gap:16px; justify-content:center;
  margin-bottom:16px;
}
.score-item { text-align:center; }
.score-val { font-size:24px; font-weight:800; }
.score-lbl { font-size:11px; color:var(--text-muted); }

/* Gamification */
.badges-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.badge-card {
  padding:16px; text-align:center;
  border-radius:var(--radius);
  background:var(--bg-card); border:1px solid var(--border);
  transition:all var(--transition);
}
.badge-card.earned { border-color:rgba(108,99,255,0.4); background:rgba(108,99,255,0.08); }
.badge-card.locked { opacity:0.4; filter:grayscale(1); }
.badge-card .badge-icon { font-size:32px; margin-bottom:8px; }
.badge-card .badge-name { font-size:12px; font-weight:600; }
.badge-card .badge-desc { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* Level display */
.level-card { padding:24px; text-align:center; margin-bottom:16px; }
.level-num { font-size:48px; font-weight:900; color:var(--accent); line-height:1; }
.level-title { font-size:16px; font-weight:600; margin:8px 0; }
.level-xp-bar { max-width:300px; margin:16px auto 0; }
.level-xp-text { display:flex; justify-content:space-between; font-size:12px; color:var(--text-muted); margin-bottom:6px; }

/* XP Animation */
@keyframes xp-pop { 0%{opacity:1;transform:translateY(0) scale(1)} 100%{opacity:0;transform:translateY(-40px) scale(1.3)} }
.xp-pop {
  position:fixed; pointer-events:none; z-index:9999;
  font-size:18px; font-weight:800; color:var(--accent);
  animation:xp-pop 1.2s ease-out forwards;
}

/* Confetti */
@keyframes confetti-fall { 0%{transform:translateY(-10px) rotate(0deg);opacity:1} 100%{transform:translateY(100vh) rotate(720deg);opacity:0} }
.confetti-piece {
  position:fixed; top:-10px; pointer-events:none; z-index:9999;
  width:8px; height:8px; border-radius:2px;
  animation:confetti-fall linear forwards;
}

/* Auth */
.auth-page {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:20px;
  background:var(--bg-primary);
}
.auth-card { width:100%; max-width:420px; padding:36px; }
.auth-logo { text-align:center; margin-bottom:24px; }
.auth-logo .logo-big {
  width:64px; height:64px; border-radius:18px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:inline-flex; align-items:center; justify-content:center;
  font-size:30px; margin-bottom:12px;
}
.auth-logo h1 { font-size:22px; font-weight:800; }
.auth-logo p { color:var(--text-secondary); font-size:14px; }
.auth-tabs { display:flex; background:var(--bg-secondary); border-radius:var(--radius-sm); padding:4px; margin-bottom:24px; }
.auth-tab {
  flex:1; padding:10px; border:none; background:none;
  color:var(--text-secondary); font-weight:600; font-size:14px;
  cursor:pointer; border-radius:6px; transition:all var(--transition);
}
.auth-tab.active { background:var(--accent); color:white; }
.form-group { margin-bottom:16px; }
.form-label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--text-secondary); }
.form-input {
  width:100%; padding:12px 16px;
  background:var(--bg-secondary); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text-primary);
  font-size:14px; outline:none; transition:all var(--transition);
  direction:ltr;
}
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(108,99,255,0.1); }
.form-input::placeholder { color:var(--text-muted); }
.form-error { color:var(--accent2); font-size:12px; margin-top:4px; }
.divider { display:flex; align-items:center; gap:12px; margin:20px 0; color:var(--text-muted); font-size:13px; }
.divider::before,.divider::after { content:''; flex:1; height:1px; background:var(--border); }
.btn-google {
  width:100%; padding:12px; border-radius:var(--radius-sm);
  background:white; border:1px solid #ddd; color:#333;
  display:flex; align-items:center; justify-content:center; gap:12px;
  cursor:pointer; font-weight:600; font-size:14px;
  transition:all var(--transition);
}
.btn-google:hover { background:#f5f5f5; box-shadow:0 2px 8px rgba(0,0,0,0.15); }
.auth-footer { text-align:center; font-size:13px; color:var(--text-secondary); margin-top:16px; }
.auth-link { color:var(--accent); cursor:pointer; font-weight:600; }

/* Profile Page */
.profile-header {
  display:flex; align-items:center; gap:20px;
  padding:28px; margin-bottom:20px;
}
.profile-avatar {
  width:80px; height:80px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex; align-items:center; justify-content:center;
  font-size:32px; font-weight:800; color:white; flex-shrink:0;
  border:3px solid rgba(108,99,255,0.4);
}
.profile-info h2 { font-size:22px; font-weight:800; margin-bottom:4px; }
.profile-info .p-email { font-size:13px; color:var(--text-muted); margin-bottom:8px; }
.profile-info .p-joined { font-size:12px; color:var(--text-muted); }
.profile-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:20px; }
.pstat { text-align:center; padding:16px; }
.pstat-val { font-size:22px; font-weight:800; color:var(--accent); }
.pstat-lbl { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* Mobile Bottom Nav */
.bottom-nav {
  display:none;
  position:fixed; bottom:0; left:0; right:0;
  height:var(--bottom-nav-h);
  background:var(--bg-secondary);
  border-top:1px solid var(--border);
  backdrop-filter:blur(20px);
  z-index:100;
  padding:0 8px;
  align-items:center;
  justify-content:space-around;
}
.bottom-nav-item {
  display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:8px 12px; cursor:pointer;
  color:var(--text-muted); transition:all var(--transition);
  border:none; background:none; font-size:10px; font-weight:600;
  min-width:56px;
}
.bottom-nav-item.active { color:var(--accent); }
.bottom-nav-item .bn-icon { font-size:20px; }

/* Mobile hamburger */
.hamburger {
  display:none; flex-direction:column; gap:5px;
  background:none; border:none; cursor:pointer; padding:4px;
}
.hamburger span { width:22px; height:2px; background:var(--text-primary); border-radius:2px; display:block; transition:all var(--transition); }

/* Sidebar overlay */
.sidebar-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.5); backdrop-filter:blur(4px);
  z-index:99;
}
.sidebar-overlay.visible { display:block; }

/* Toast notification */
.toast-container { position:fixed; bottom:calc(var(--bottom-nav-h) + 12px); left:50%; transform:translateX(-50%); z-index:9998; display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; }
@keyframes toast-in { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.toast {
  padding:12px 20px; border-radius:var(--radius-sm);
  font-size:13px; font-weight:600; color:white;
  backdrop-filter:blur(20px); pointer-events:auto;
  animation:toast-in 0.3s ease;
  white-space:nowrap;
}
.toast-success { background:rgba(67,233,123,0.9); color:#0a2a1a; }
.toast-error { background:rgba(255,101,132,0.9); }
.toast-info { background:rgba(108,99,255,0.9); }

/* Loading Spinner */
.spinner {
  width:40px; height:40px; border-radius:50%;
  border:3px solid var(--border);
  border-top-color:var(--accent);
  animation:spin 0.8s linear infinite;
  margin:40px auto;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* Empty state */
.empty-state { text-align:center; padding:60px 20px; color:var(--text-secondary); }
.empty-state .empty-icon { font-size:48px; margin-bottom:12px; }
.empty-state h3 { font-size:18px; margin-bottom:8px; }

/* Modal */
.modal-backdrop {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.6); backdrop-filter:blur(8px);
  z-index:200; display:flex; align-items:center; justify-content:center;
  padding:16px;
}
.modal {
  background:var(--bg-secondary); border:1px solid var(--border);
  border-radius:var(--radius); padding:28px;
  width:100%; max-width:560px; max-height:90vh; overflow-y:auto;
  animation:modal-in 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modal-in { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-header h2 { font-size:18px; font-weight:700; }
.modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-muted); }
.modal-close:hover { color:var(--text-primary); }

/* Word Detail in Modal */
.wd-dutch { font-size:36px; font-weight:900; color:var(--accent); margin-bottom:4px; }
.wd-article { font-size:16px; color:var(--accent2); font-weight:500; margin-bottom:4px; }
.wd-arabic { font-size:24px; font-weight:700; margin-bottom:12px; }
.wd-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; align-items:center; }
.wd-tag {
  font-size:12px; padding:4px 12px; border-radius:10px;
  background:rgba(108,99,255,0.1); color:var(--accent);
}
.wd-example-box {
  background:var(--bg-primary); border-radius:var(--radius-sm);
  padding:16px; border-right:4px solid var(--accent);
  margin-bottom:12px;
}
.wd-nl { font-size:16px; font-style:italic; margin-bottom:6px; }
.wd-ar { font-size:14px; color:var(--text-secondary); }
.wd-synonyms { display:flex; gap:8px; flex-wrap:wrap; }
.wd-syn { padding:4px 12px; background:var(--bg-primary); border-radius:10px; font-size:13px; }

/* AI Tutor */
.ai-tutor { max-width:700px; margin:0 auto; }
.ai-chat { height:380px; overflow-y:auto; padding:16px; background:var(--bg-primary); border-radius:var(--radius); border:1px solid var(--border); margin-bottom:16px; display:flex; flex-direction:column; gap:12px; }
.ai-msg { display:flex; gap:10px; align-items:flex-start; }
.ai-msg.user { flex-direction:row-reverse; }
.ai-bubble {
  max-width:80%; padding:12px 16px; border-radius:var(--radius-sm);
  font-size:14px; line-height:1.6;
}
.ai-msg.bot .ai-bubble { background:var(--bg-card); border:1px solid var(--border); }
.ai-msg.user .ai-bubble { background:linear-gradient(135deg,var(--accent),rgba(108,99,255,0.7)); color:white; }
.ai-avatar { width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,var(--accent2),var(--accent)); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.ai-input-row { display:flex; gap:8px; }
.ai-input {
  flex:1; padding:12px 16px;
  background:var(--bg-secondary); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text-primary); font-size:14px; outline:none; direction:ltr;
  transition:all var(--transition);
}
.ai-input:focus { border-color:var(--accent); }
.ai-correction { background:var(--bg-card); border-radius:var(--radius-sm); padding:12px; }
.ai-wrong { color:var(--accent2); text-decoration:line-through; font-size:14px; margin-bottom:4px; }
.ai-right { color:var(--accent3); font-size:14px; font-weight:600; margin-bottom:6px; }
.ai-explain { font-size:13px; color:var(--text-secondary); }

/* Listening Quiz */
.listen-quiz { max-width:500px; margin:0 auto; text-align:center; }
.listen-btn-big {
  width:100px; height:100px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  border:none; cursor:pointer; font-size:36px; color:white;
  margin:24px auto; display:flex; align-items:center; justify-content:center;
  transition:all var(--transition); box-shadow:0 0 0 0 rgba(108,99,255,0.4);
}
.listen-btn-big.playing { animation:pulse-ring 1s ease infinite; }
@keyframes pulse-ring { 0%{box-shadow:0 0 0 0 rgba(108,99,255,0.4)} 70%{box-shadow:0 0 0 20px rgba(108,99,255,0)} 100%{box-shadow:0 0 0 0 rgba(108,99,255,0)} }
.listen-input {
  width:100%; padding:14px; text-align:center; font-size:18px;
  background:var(--bg-secondary); border:2px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text-primary); outline:none;
  direction:ltr; margin-bottom:12px;
}
.listen-input:focus { border-color:var(--accent); }
.listen-input.correct { border-color:var(--accent3); background:rgba(67,233,123,0.1); }
.listen-input.wrong { border-color:var(--accent2); background:rgba(255,101,132,0.1); }

/* Sentence Builder */
.sb-game { max-width:600px; margin:0 auto; }
.sb-slots {
  min-height:60px; border:2px dashed var(--border);
  border-radius:var(--radius-sm); padding:12px;
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  margin-bottom:16px; background:var(--bg-primary);
}
.sb-word {
  padding:8px 16px; background:var(--bg-card);
  border:1px solid var(--border); border-radius:20px;
  cursor:pointer; font-size:15px; font-weight:600;
  transition:all var(--transition); user-select:none;
}
.sb-word:hover { border-color:var(--accent); background:rgba(108,99,255,0.1); transform:translateY(-1px); }
.sb-word.placed { background:rgba(108,99,255,0.15); border-color:var(--accent); color:var(--accent); }
.sb-word.correct-word { background:rgba(67,233,123,0.15); border-color:var(--accent3); color:var(--accent3); }
.sb-word.wrong-word { background:rgba(255,101,132,0.15); border-color:var(--accent2); color:var(--accent2); }

/* Responsive */
@media (max-width:768px) {
  .sidebar { transform:translateX(100%); }
  .sidebar.open { transform:translateX(0); }
  .main-content { margin-right:0; padding-bottom:var(--bottom-nav-h); }
  .bottom-nav { display:flex; }
  .hamburger { display:flex; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .mc-options { grid-template-columns:1fr; }
  .match-columns { grid-template-columns:1fr; }
  .progress-ring-container { flex-direction:column; text-align:center; }
  .profile-stats { grid-template-columns:repeat(2,1fr); }
  .sections-grid { grid-template-columns:1fr; }
  .words-grid { grid-template-columns:1fr; }
  .games-grid { grid-template-columns:repeat(2,1fr); }
  .page-content { padding:16px; }
  .srs-buttons { gap:8px; }
  .srs-btn { padding:10px 10px; font-size:13px; }
}

@media (max-width:480px) {
  .stats-grid { grid-template-columns:1fr 1fr; }
  .games-grid { grid-template-columns:1fr 1fr; }
  .header { padding:0 16px; }
  .header-title { font-size:15px; }
  .modal { padding:20px 16px; }
  .fc-word { font-size:28px; }
  .flashcard-wrap { height:260px; }
}

/* Animations */
@keyframes fade-in { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.animate-in { animation:fade-in 0.4s ease forwards; }

@keyframes slide-in-right { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }
.slide-in { animation:slide-in-right 0.3s ease forwards; }

@keyframes bounce-in { 0%{transform:scale(0.8);opacity:0} 60%{transform:scale(1.05)} 100%{transform:scale(1);opacity:1} }
.bounce-in { animation:bounce-in 0.4s cubic-bezier(0.4,0,0.2,1) forwards; }

/* Theme toggle */
.theme-toggle { display:flex; align-items:center; }

/* Tab system inside pages */
.page-tabs { display:flex; gap:4px; background:var(--bg-secondary); border-radius:var(--radius-sm); padding:4px; margin-bottom:20px; overflow-x:auto; }
.page-tab {
  padding:8px 16px; border:none; background:none;
  color:var(--text-secondary); font-weight:600; font-size:13px;
  cursor:pointer; border-radius:6px; transition:all var(--transition);
  white-space:nowrap;
}
.page-tab.active { background:var(--accent); color:white; }

/* Misc utility */
.flex { display:flex; } .flex-col { flex-direction:column; }
.items-center { align-items:center; } .justify-between { justify-content:space-between; }
.gap-8 { gap:8px; } .gap-12 { gap:12px; } .gap-16 { gap:16px; }
.mb-8 { margin-bottom:8px; } .mb-16 { margin-bottom:16px; } .mb-24 { margin-bottom:24px; }
.text-accent { color:var(--accent); } .text-muted { color:var(--text-muted); }
.font-bold { font-weight:700; } .font-black { font-weight:900; }
.text-sm { font-size:13px; } .text-xs { font-size:11px; }
.w-full { width:100%; } .text-center { text-align:center; }


/* === WORDFLOW PRO POLISH === */
/* Commercial-grade UX polish (touch targets, a11y, micro-interactions) */

/* Remove blue tap flash on mobile, keep taps crisp */
* { -webkit-tap-highlight-color: transparent; }

/* Accessible keyboard focus rings (Linear/Notion style) */
button:focus-visible, a:focus-visible, input:focus-visible,
.btn:focus-visible, .mc-option:focus-visible, .srs-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }

/* Satisfying press feedback on all primary controls (Duolingo-like) */
.btn, .btn-primary, .mc-option, .srs-btn, .game-card, .bottom-nav-item, .nav-item {
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active, .btn-primary:active, .mc-option:active, .srs-btn:active, .game-card:active {
  transform: translateY(1px) scale(0.985);
}

/* Slightly stronger contrast for muted text (better readability) */
:root { --text-muted: #8a8aa8; }

/* Smooth, momentum scrolling on touch devices */
html, body, .main-content, .page-content { -webkit-overflow-scrolling: touch; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Mobile: guarantee comfortable tap targets (>= 44px) and readable sizes */
@media (max-width: 768px) {
  .btn, .btn-primary { min-height: 46px; padding: 12px 18px; }
  .mc-option { min-height: 54px; font-size: 15px; }
  .srs-btn { min-height: 46px; font-size: 14px; }
  .btn-icon { width: 44px; height: 44px; }
  .bottom-nav-item { min-height: 52px; }
  .game-card { padding: 18px; }
}

/* Small phones: ensure quiz answer buttons never feel cramped */
@media (max-width: 480px) {
  .games-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stats-grid { gap: 10px; }
  .page-content { padding: 14px; }
  h1 { font-size: 20px; }
}

/* ═══════════════════════════════════════════════════════════
   NL2 — Modern Dynamic Dashboard (cards + progress system)
   ═══════════════════════════════════════════════════════════ */

/* Hero */
.nl2-hero { padding:26px 24px; margin-bottom:18px; position:relative; overflow:hidden; }
.nl2-hero::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(ellipse at 85% -20%, rgba(108,99,255,.22), transparent 55%),
             radial-gradient(ellipse at 10% 120%, rgba(255,101,132,.10), transparent 50%);
}
.nl2-hero-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; position:relative; }
.nl2-greet { font-size:22px; font-weight:800; }
.nl2-greet-sub { color:var(--text-secondary); font-size:14px; margin-top:4px; }
.nl2-chips { display:flex; gap:8px; flex-wrap:wrap; }
.nl2-chip {
  padding:7px 14px; border-radius:999px; font-size:13.5px; font-weight:700;
  background:var(--bg-card); border:1px solid var(--border);
}
.nl2-chip-fire { color:#fbbf24; }
.nl2-chip-xp { color:#818cf8; }
.nl2-chip-lvl { color:#a78bfa; border-color:rgba(167,139,250,.4); }

/* Goal */
.nl2-goal { margin:18px 0 16px; position:relative; }
.nl2-goal-row { display:flex; justify-content:space-between; font-size:14px; margin-bottom:8px; color:var(--text-secondary); }
.nl2-goal-done { margin-top:8px; font-size:13.5px; color:#4ade80; font-weight:700; animation:nl2-pop .4s ease; }

/* Bars */
.nl2-bar { height:8px; border-radius:5px; background:rgba(255,255,255,.07); overflow:hidden; }
[data-theme="light"] .nl2-bar { background:rgba(0,0,0,.08); }
.nl2-bar-lg { height:14px; border-radius:8px; }
.nl2-bar-fill { height:100%; border-radius:inherit; transition:width .7s cubic-bezier(.4,0,.2,1); }
.nl2-grad { background:linear-gradient(90deg,#6c63ff,#ff6584); }
.nl2-glow { box-shadow:0 0 14px rgba(108,99,255,.7); }

/* CTA */
.nl2-cta {
  display:flex; flex-direction:column; align-items:center; gap:4px;
  width:100%; padding:16px; border:none; border-radius:16px; cursor:pointer;
  background:linear-gradient(135deg,#6c63ff,#8b5cf6 55%,#ff6584);
  color:#fff; font-family:inherit; position:relative;
  box-shadow:0 10px 30px rgba(108,99,255,.4);
  transition:transform .15s ease, box-shadow .15s ease;
}
.nl2-cta:hover { transform:translateY(-2px); box-shadow:0 14px 38px rgba(108,99,255,.55); }
.nl2-cta:active { transform:scale(.98); }
.nl2-cta-main { font-size:19px; font-weight:800; }
.nl2-cta-sub { font-size:13px; opacity:.9; }

/* Stat cards */
.nl2-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.nl2-stat { padding:16px; }
.nl2-click { cursor:pointer; transition:transform .18s ease, border-color .18s ease; }
.nl2-click:hover { transform:translateY(-3px); border-color:rgba(108,99,255,.45); }
.nl2-stat-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.nl2-stat-ico {
  width:38px; height:38px; border-radius:11px; font-size:18px;
  display:flex; align-items:center; justify-content:center;
}
.nl2-stat-val { font-size:24px; font-weight:800; }
.nl2-stat-label { font-size:13px; color:var(--text-secondary); margin-bottom:10px; }

/* CEFR track */
.nl2-track-card { padding:20px; margin-bottom:18px; }
.nl2-sec-title { font-size:16px; font-weight:800; margin-bottom:14px; }
.nl2-sec-title-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.nl2-sec-title-row .nl2-sec-title { margin-bottom:0; }
.nl2-track { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
.nl2-lvl {
  background:var(--bg-card); border:1px solid var(--border); border-radius:14px;
  padding:14px 10px; text-align:center; position:relative;
  transition:transform .2s ease, border-color .2s ease;
}
.nl2-lvl.cur { border-color:rgba(167,139,250,.6); box-shadow:0 6px 24px rgba(139,92,246,.25); transform:translateY(-2px); }
.nl2-lvl.empty { opacity:.45; }
.nl2-lvl-badge {
  width:42px; height:42px; margin:0 auto 8px; border-radius:50%;
  border:2px solid var(--border); font-weight:800; font-size:15px;
  display:flex; align-items:center; justify-content:center;
}
.nl2-lvl-name { font-size:12px; color:var(--text-muted); margin-bottom:8px; font-weight:700; }
.nl2-lvl-nums { font-size:11.5px; color:var(--text-muted); margin-top:6px; }
.nl2-lvl-soon { font-size:12px; color:var(--text-muted); padding:6px 0; }
.nl2-lvl-cur-tag {
  position:absolute; top:-9px; right:50%; transform:translateX(50%);
  background:linear-gradient(90deg,#8b5cf6,#6c63ff); color:#fff;
  font-size:10px; font-weight:800; padding:2px 9px; border-radius:999px; white-space:nowrap;
}

/* Insight */
.nl2-insight { padding:20px; margin-bottom:18px; }
.nl2-insight-row {
  display:flex; align-items:center; gap:10px; font-size:14.5px;
  padding:11px 14px; border-radius:12px; margin-bottom:8px;
}
.nl2-insight-row:last-child { margin-bottom:0; }
.nl2-insight-row.good { background:rgba(74,222,128,.08); border:1px solid rgba(74,222,128,.25); }
.nl2-insight-row.bad { background:rgba(244,63,94,.07); border:1px solid rgba(244,63,94,.25); }
.nl2-insight-row .btn { margin-right:auto; }
.nl2-insight-ico { font-size:20px; }

/* Achievements */
.nl2-ach-card { padding:20px; margin-bottom:18px; }
.nl2-ach-strip { display:flex; gap:10px; overflow-x:auto; padding-bottom:6px; scrollbar-width:thin; }
.nl2-ach {
  min-width:86px; text-align:center; padding:12px 8px; border-radius:12px;
  background:var(--bg-card); border:1px solid var(--border);
  filter:grayscale(1); opacity:.45; transition:transform .2s ease;
}
.nl2-ach.got { filter:none; opacity:1; border-color:rgba(251,191,36,.4); }
.nl2-ach.got:hover { transform:translateY(-3px); }
.nl2-ach-ico { font-size:24px; display:block; margin-bottom:6px; }
.nl2-ach-name { font-size:11px; color:var(--text-secondary); font-weight:700; }

/* Quick actions + Today plan */
.nl2-quick { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.nl2-plan-row { display:flex; align-items:center; gap:14px; padding:16px 18px; margin-bottom:12px; }
.nl2-plan-row.dim { opacity:.55; }
.nl2-plan-ico { font-size:26px; }
.nl2-plan-txt { flex:1; }
.nl2-plan-txt h3 { font-size:15.5px; margin-bottom:3px; }
.nl2-plan-txt p { font-size:13px; }

@keyframes nl2-pop { 0%{transform:scale(.85);opacity:0} 100%{transform:scale(1);opacity:1} }

/* Responsive */
@media (max-width: 1024px) {
  .nl2-grid { grid-template-columns:repeat(2,1fr); }
  .nl2-track { grid-template-columns:repeat(5,1fr); gap:8px; }
}
@media (max-width: 640px) {
  .nl2-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
  .nl2-track { grid-template-columns:repeat(3,1fr); }
  .nl2-hero { padding:20px 16px; }
  .nl2-greet { font-size:19px; }
  .nl2-cta-main { font-size:17px; }
  .nl2-insight-row { flex-wrap:wrap; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE FIRST HARDENING — no horizontal scroll, tested widths:
   360px / 390px / 412px / 768px
   ═══════════════════════════════════════════════════════════ */

/* Kill horizontal scroll at the root */
html, body {
  max-width: 100%;
  /* AUDIT-FIXES S2-2 (2026-09-02): 'hidden' maakte van <body> een eigen
     scroll-container (computed overflow-y:auto) — daardoor bleef window.scrollY
     0 en werkte position:sticky nergens. 'clip' clipt wél, maar maakt géén
     scroll-container. */
  overflow-x: clip;
}
.app-layout, .main-content, .page-content {
  max-width: 100vw;
  min-width: 0;
  /* AUDIT-FIXES S2-2 (2026-09-02): 'clip' clips horizontal overflow WITHOUT
     creating a nested scroll container, so the document keeps ONE scroller
     and window.scrollTo()/scroll restoration work again. */
  overflow-x: clip;
}

/* Media must never exceed their container */
img, svg, video, canvas { max-width: 100%; height: auto; }

/* Grid/flex children: allow shrinking below content size */
.stats-grid > *, .nl2-grid > *, .nl2-track > *, .games-grid > *,
.about-features > *, .features > *, .steps > * { min-width: 0; }
.glass-card { min-width: 0; overflow-wrap: break-word; }

/* Long words/URLs never push the layout */
.page-content, .glass-card, .nl2-plan-txt, .setting-desc {
  word-break: break-word;
}

/* Wide tables scroll inside their card, not the page */
.glass-card table { display: block; max-width: 100%; overflow-x: auto; }

/* ── ≤768px (tablet) ── */
@media (max-width: 768px) {
  .page-content { padding: 14px 12px calc(var(--bottom-nav-h) + 20px); }
  .header { padding: 0 12px; gap: 8px; }
  .header-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-right { gap: 6px; flex-shrink: 0; }
  .streak-badge, .xp-badge { font-size: 12px; padding: 5px 9px; }
  .nl2-track { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .nl2-lvl { padding: 10px 6px; }
  .nl2-lvl-badge { width: 34px; height: 34px; font-size: 13px; }
}

/* ── ≤412px (large phones) ── */
@media (max-width: 412px) {
  .nl2-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .nl2-stat { padding: 12px; }
  .nl2-stat-val { font-size: 20px; }
  .nl2-hero { padding: 16px 14px; }
  .nl2-greet { font-size: 17.5px; }
  .nl2-chips { gap: 6px; }
  .nl2-chip { padding: 5px 10px; font-size: 12px; }
  .nl2-cta-main { font-size: 16px; }
  .nl2-cta-sub { font-size: 12px; }
  .nl2-track { grid-template-columns: repeat(3, 1fr); }
  .nl2-quick { gap: 8px; }
  .nl2-quick .btn { flex: 1 1 45%; font-size: 13px; padding: 10px 8px; }
  .nl2-plan-row { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .nl2-insight-row { font-size: 13.5px; padding: 10px; }
  .games-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .page-header h1 { font-size: 20px; }
  .header .btn { font-size: 12px; padding: 6px 10px; }
}

/* ── ≤390px ── */
@media (max-width: 390px) {
  .header-right .xp-badge { display: none; } /* keep streak, drop XP chip */
  .bottom-nav-item { font-size: 10px; }
  .bottom-nav-item .bn-icon { font-size: 16px; }
  .nl2-ach { min-width: 76px; padding: 10px 6px; }
}

/* ── ≤360px (small phones) ── */
@media (max-width: 360px) {
  .page-content { padding: 10px 8px calc(var(--bottom-nav-h) + 16px); }
  .nl2-greet { font-size: 16px; }
  .nl2-goal-row { font-size: 12.5px; }
  .nl2-lvl-cur-tag { font-size: 9px; padding: 2px 6px; }
  .nl2-stat-ico { width: 32px; height: 32px; font-size: 15px; }
  .streak-badge { font-size: 11px; padding: 4px 7px; }
  #pwa-install-btn { padding: 10px 14px !important; font-size: 13px !important; }
  .games-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   LEVEL SELECTION — onboarding, dashboard card & change modal
   Uses the app's design tokens; fully responsive & RTL-safe.
   ============================================================ */

/* Full-screen onboarding wrapper */
.lvl-onboard {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(108,99,255,0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255,101,132,0.16), transparent 45%),
    var(--bg-body, #0f0f1a);
}
.lvl-onboard-inner {
  width: 100%; max-width: 720px;
  padding: 32px 28px;
  text-align: center;
  animation: nlFadeUp 0.5s ease;
}
@keyframes nlFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lvl-onboard-logo {
  width: 68px; height: 68px; margin: 0 auto 14px;
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(108,99,255,0.4);
}
.lvl-onboard-welcome { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.lvl-onboard-q { font-size: 24px; font-weight: 800; margin: 0 0 8px; color: var(--text-primary); line-height: 1.3; }
.lvl-onboard-desc { font-size: 14.5px; color: var(--text-muted); margin: 0 0 22px; line-height: 1.6; }

/* Grid of level cards */
.lvlsel-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
.lvlsel-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: start;
  padding: 16px 16px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer; font-family: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.lvlsel-card:hover { transform: translateY(-3px); background: var(--bg-card-hover); box-shadow: var(--shadow, 0 12px 30px rgba(0,0,0,0.25)); }
.lvlsel-card.active { box-shadow: 0 10px 26px rgba(108,99,255,0.28); }
.lvlsel-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.lvlsel-badge {
  position: absolute; top: 14px; inset-inline-end: 14px;
  color: #fff; font-weight: 800; font-size: 12px;
  padding: 2px 9px; border-radius: 999px; letter-spacing: 0.5px;
}
.lvlsel-name { font-size: 16px; font-weight: 800; }
.lvlsel-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.lvlsel-check { position: absolute; bottom: 12px; inset-inline-end: 14px; font-size: 18px; font-weight: 900; }
.lvlsel-unknown { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.lvlsel-unknown .lvlsel-name { font-size: 15px; }

/* Niveautest (coming soon) */
.niveautest-ico { font-size: 46px; margin-bottom: 10px; }
.niveautest-soon {
  display: inline-block; margin: 4px 0 14px;
  padding: 6px 18px; border-radius: 999px;
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

/* Dashboard "current level" card */
.nl2-levelcard {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; margin-bottom: 16px;
}
.nl2-levelcard-info { display: flex; align-items: center; gap: 12px; }
.nl2-levelcard-badge {
  width: 44px; height: 44px; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none;
}
.nl2-levelcard-lbl { font-size: 12.5px; color: var(--text-muted); }
.nl2-levelcard-val { font-size: 22px; font-weight: 900; line-height: 1.1; }

/* Change-level modal */
.lvl-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 14px;
  background: rgba(6,6,16,0.6); backdrop-filter: blur(4px);
  animation: nlFadeIn 0.2s ease;
}
@keyframes nlFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lvl-modal {
  position: relative; width: 100%; max-width: 640px;
  max-height: 92vh; overflow-y: auto;
  padding: 26px 22px; text-align: center;
  animation: nlFadeUp 0.28s ease;
}
.lvl-modal-close {
  position: absolute; top: 12px; inset-inline-end: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lvl-modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.lvl-modal-cancel { margin-top: 16px; }

@media (max-width: 560px) {
  .lvlsel-grid { grid-template-columns: 1fr; }
  .lvl-onboard-inner { padding: 24px 18px; }
  .lvl-onboard-q { font-size: 21px; }
  .nl2-levelcard-val { font-size: 19px; }
}
.lvl-onboard-loader {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(108,99,255,0.4);
  animation: nlPulse 1.4s ease-in-out infinite;
}
@keyframes nlPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.nl2-done-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:18px; }
.nl2-done-actions .btn { flex:0 1 auto; }
@media (max-width:560px){ .nl2-done-actions { flex-direction:column; align-items:stretch; } }

/* ─── Verbs page ─────────────────────────────────────────────
   Scoped under .vb-* so nothing here can affect existing pages. */
.vb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.vb-card{background:var(--card,#1e1e2e);border:1px solid var(--border,#2e2e42);border-radius:14px;
  padding:14px 16px;cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
.vb-card:hover{transform:translateY(-2px);border-color:var(--accent,#6c63ff);box-shadow:0 6px 18px rgba(0,0,0,.18)}
.vb-card:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:2px}
.vb-card-open{border-color:var(--accent,#6c63ff)}
.vb-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.vb-inf{font-size:1.15rem;font-weight:700;color:var(--accent,#6c63ff)}
.vb-prefix{color:#38bdf8;text-decoration:underline dotted}
.vb-meaning{margin-top:4px;font-size:.98rem;opacity:.92}
.vb-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.vb-chip{font-size:.72rem;padding:3px 8px;border-radius:999px;border:1px solid transparent;white-space:nowrap}
.vb-audio{background:transparent;border:0;color:var(--accent,#6c63ff);cursor:pointer;padding:6px;
  border-radius:8px;font-size:.95rem;line-height:1}
.vb-audio:hover{background:rgba(108,99,255,.12)}
.vb-audio-sm{font-size:.8rem;padding:2px 6px;margin-inline-start:6px}
.vb-detail{margin-top:12px;border-top:1px dashed var(--border,#2e2e42);padding-top:10px;
  animation:vbFade .18s ease}
@keyframes vbFade{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.vb-table{display:flex;flex-direction:column;gap:6px}
.vb-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px;font-size:.88rem}
.vb-row-label{opacity:.7}
.vb-row-value{font-weight:600;color:var(--text,#e8e8f0)}
.vb-none{font-size:.85rem;opacity:.65;font-style:italic}
.vb-examples{margin-top:12px}
.vb-examples-title{font-size:.8rem;opacity:.7;margin-bottom:6px}
.vb-example{margin-bottom:8px;padding-inline-start:10px;border-inline-start:2px solid var(--accent,#6c63ff)}
.vb-example-nl{font-size:.9rem;display:flex;align-items:center;flex-wrap:wrap}
.vb-example-ar{font-size:.85rem;opacity:.8;margin-top:2px}
.vb-skeleton{pointer-events:none}
.vb-sk-line{height:12px;border-radius:6px;margin-bottom:10px;
  background:linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.13) 37%,rgba(255,255,255,.06) 63%);
  background-size:400% 100%;animation:vbShimmer 1.3s ease infinite}
.vb-sk-lg{height:18px;width:60%}
.vb-sk-sm{width:40%}
@keyframes vbShimmer{0%{background-position:100% 50%}100%{background-position:0 50%}}
@media (prefers-reduced-motion:reduce){
  .vb-card,.vb-detail,.vb-sk-line{transition:none;animation:none}
}


/* =====================================================================
   KLAAR VOOR NT2 — LEARNING STUDIO REDESIGN 2026
   A presentation-only system. Existing page IDs, data flows, and actions
   remain unchanged; this layer rebuilds the visual experience.
   ===================================================================== */
:root {
  --bg-primary:#f7f7fc;
  --bg-secondary:#ffffff;
  --bg-card:rgba(255,255,255,.92);
  --bg-card-hover:#ffffff;
  --text-primary:#1d1d37;
  --text-secondary:#66657b;
  --text-muted:#9998aa;
  --border:rgba(42,39,83,.10);
  --accent:#7456e8;
  --accent2:#ef7596;
  --accent3:#31c3b1;
  --accent4:#f4b33c;
  --shadow:0 18px 46px rgba(58,45,117,.10);
  --shadow-soft:0 9px 24px rgba(56,47,113,.08);
  --radius:28px;
  --radius-sm:16px;
  --sidebar-w:286px;
  --header-h:80px;
  --transition:180ms cubic-bezier(.23,1,.32,1);
}
[data-theme="dark"] {
  --bg-primary:#171729;
  --bg-secondary:#202038;
  --bg-card:rgba(39,39,66,.92);
  --bg-card-hover:#303050;
  --text-primary:#f7f6ff;
  --text-secondary:#c4c2d6;
  --text-muted:#9190aa;
  --border:rgba(235,232,255,.10);
  --shadow:0 22px 58px rgba(0,0,0,.30);
  --shadow-soft:0 10px 28px rgba(0,0,0,.18);
}
body {
  font-family:"Noto Sans Arabic","Segoe UI",system-ui,-apple-system,sans-serif;
  background:var(--bg-primary);
  color:var(--text-primary);
  letter-spacing:-.01em;
}
body::before {
  background:
    radial-gradient(circle at 7% 5%, rgba(116,86,232,.13) 0, transparent 23rem),
    radial-gradient(circle at 89% 6%, rgba(74,150,233,.14) 0, transparent 24rem),
    radial-gradient(circle at 68% 94%, rgba(49,195,177,.12) 0, transparent 26rem);
  opacity:1;
}
body::after {
  content:""; position:fixed; inset:0; pointer-events:none; z-index:0;
  background-image:radial-gradient(rgba(116,86,232,.14) .8px, transparent .8px);
  background-size:25px 25px; opacity:.24;
}
#root { min-height:100vh; min-height:100dvh; }
::selection { background:rgba(116,86,232,.20); color:var(--text-primary); }
::-webkit-scrollbar { width:9px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#d4cef7; border:3px solid var(--bg-primary); border-radius:20px; }

/* ── Global shell ─────────────────────────────────────────────── */
.app-layout { min-height:100vh; padding:14px; gap:14px; }
.sidebar {
  width:var(--sidebar-w); right:14px; top:14px; height:calc(100vh - 28px);
  background:rgba(255,255,255,.82); border:1px solid rgba(255,255,255,.82);
  box-shadow:var(--shadow); border-radius:30px; overflow:hidden;
  backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px);
}
[data-theme="dark"] .sidebar { background:rgba(32,32,56,.86); border-color:rgba(255,255,255,.08); }
.main-content { margin-right:calc(var(--sidebar-w) + 14px); min-width:0; }
.header {
  height:var(--header-h); margin:0 0 12px; padding:0 28px;
  background:rgba(255,255,255,.72); border:1px solid rgba(255,255,255,.88);
  border-radius:24px; box-shadow:0 8px 24px rgba(63,51,125,.06);
  backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px);
}
[data-theme="dark"] .header { background:rgba(32,32,56,.76); border-color:rgba(255,255,255,.08); }
.header-title { font-size:18px; font-weight:850; letter-spacing:-.03em; }
.header-left { gap:14px; }
.header-right { gap:8px; }
.hamburger { width:42px; height:42px; border-radius:14px; border:1px solid var(--border); background:var(--bg-card); }
.streak-badge,.xp-badge {
  border:1px solid transparent; box-shadow:none; padding:8px 12px; font-size:12px; font-weight:800;
}
.streak-badge { color:#c96c21; background:#fff2e5; border-color:#ffe1c5; }
.xp-badge { color:#6445d1; background:#f0edff; border-color:#e3ddff; }
[data-theme="dark"] .streak-badge { background:rgba(244,179,60,.15); border-color:rgba(244,179,60,.25); color:#ffd182; }
[data-theme="dark"] .xp-badge { background:rgba(116,86,232,.16); border-color:rgba(116,86,232,.25); color:#c6baff; }

/* ── Navigation ───────────────────────────────────────────────── */
.sidebar-logo { padding:23px 22px 19px; gap:12px; border-bottom:1px solid var(--border); }
.sidebar-logo .logo-icon { width:48px; height:48px; padding:3px; background:#fff; border-radius:17px; box-shadow:0 8px 17px rgba(112,83,224,.17); }
.sidebar-logo .logo-icon img { width:100%; height:100%; object-fit:cover; border-radius:13px; }
.sidebar-logo .logo-text { font-size:16px; letter-spacing:-.04em; font-weight:900; }
.sidebar-nav { padding:15px 10px; }
.sidebar-nav-item {
  min-height:48px; margin:4px 0; padding:11px 13px; border-radius:15px;
  color:var(--text-secondary); font-size:13.5px; font-weight:730; border:1px solid transparent;
}
.sidebar-nav-item:hover { background:rgba(116,86,232,.065); color:var(--text-primary); transform:translateX(-2px); }
.sidebar-nav-item.active {
  background:linear-gradient(135deg,#785be9,#6250d5); color:#fff; border-color:transparent;
  box-shadow:0 10px 18px rgba(104,79,218,.22);
}
.sidebar-nav-item .nav-icon { width:27px; font-size:16px; }
.sidebar-nav-item .nav-badge { background:#fff; color:#7255df; padding:3px 8px; border-radius:999px; font-weight:900; }
.sidebar-bottom { padding:14px; border-top:1px solid var(--border); }
.sidebar-bottom > .btn { border-radius:14px; background:#f2f1f8; border:0; font-weight:750; color:var(--text-secondary); }
.sidebar-user { padding:11px; border-radius:17px; background:rgba(116,86,232,.07); }
.sidebar-user:hover { background:rgba(116,86,232,.11); }
.sidebar-user .avatar { width:42px; height:42px; color:#fff; background:linear-gradient(135deg,#8063eb,#ec86a2); box-shadow:0 6px 14px rgba(116,86,232,.25); }
.sidebar-user .user-info .name { font-size:12.5px; font-weight:850; }

/* ── Shared surfaces ──────────────────────────────────────────── */
.page-content { max-width:1480px; width:100%; margin:0 auto; padding:26px 20px 38px; }
.page-header { margin:0 0 22px; }
.page-header h1 { font-size:clamp(25px,2.6vw,36px); font-weight:900; letter-spacing:-.055em; }
.page-header p { max-width:700px; color:var(--text-secondary); font-size:14px; }
.glass-card {
  background:var(--bg-card); border:1px solid rgba(255,255,255,.92); box-shadow:var(--shadow-soft);
  border-radius:var(--radius); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  transition:transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}
[data-theme="dark"] .glass-card { border-color:rgba(255,255,255,.08); }
.glass-card:hover { background:var(--bg-card-hover); transform:translateY(-3px); box-shadow:var(--shadow); }
.btn,.btn-primary,.btn-secondary,.btn-success,.btn-danger,.btn-warning {
  min-height:42px; border-radius:14px; border:0; padding:10px 17px; font-weight:820; letter-spacing:-.015em;
  transition:transform 150ms cubic-bezier(.23,1,.32,1), box-shadow 150ms cubic-bezier(.23,1,.32,1), filter 150ms;
}
.btn:active,.btn-primary:active,.btn-secondary:active,.btn-success:active,.btn-danger:active,.btn-warning:active { transform:scale(.97); }
.btn-primary { background:linear-gradient(135deg,#7c5bea,#654bd3); color:#fff; box-shadow:0 10px 22px rgba(105,78,216,.24); }
.btn-primary:hover { transform:translateY(-2px); filter:saturate(1.1); box-shadow:0 15px 28px rgba(105,78,216,.32); }
.btn-secondary { background:#f1f0f8; color:#494762; border:1px solid rgba(91,83,144,.09); }
.btn-secondary:hover { background:#e9e6f6; color:#493bb1; }
.btn-success { background:linear-gradient(135deg,#46d3be,#22ae9f); color:#083e38; }
.btn-warning { background:linear-gradient(135deg,#ffd16b,#efad30); color:#563804; }
.btn-danger { background:linear-gradient(135deg,#f58aa8,#e65c84); color:#fff; }
[data-theme="dark"] .btn-secondary { background:rgba(255,255,255,.08); color:var(--text-primary); border-color:rgba(255,255,255,.08); }
.btn-icon { border-radius:14px; border:1px solid var(--border); background:var(--bg-card); }

/* ── Dashboard hero and mode system ───────────────────────────── */
.nl3-dashboard { padding-top:6px; }
.nl3-hero {
  position:relative; overflow:hidden; min-height:278px; padding:31px clamp(24px,4vw,52px);
  background:linear-gradient(117deg,#f4f0ff 0%,#fff 50%,#eef9ff 100%); border:1px solid #fff;
  display:grid; grid-template-columns:minmax(0,1fr) 250px; gap:24px;
}
[data-theme="dark"] .nl3-hero { background:linear-gradient(117deg,#2e2654,#252646 55%,#203d53); }
.nl3-hero::before { content:""; position:absolute; width:400px; height:400px; border-radius:50%; background:rgba(116,86,232,.12); top:-245px; right:115px; }
.nl3-hero .nl2-hero-head,.nl3-hero .nl2-goal,.nl3-hero .nl2-cta { position:relative; z-index:1; grid-column:1; }
.nl2-hero-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.nl2-greet { font-weight:900; font-size:clamp(26px,3.1vw,40px); letter-spacing:-.06em; }
.nl2-greet-sub { margin-top:6px; color:var(--text-secondary); font-size:14px; max-width:540px; }
.nl2-chips { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-start; }
.nl2-chip { border-radius:999px; padding:7px 10px; font-size:11px; font-weight:850; border:1px solid transparent; background:#fff; box-shadow:0 5px 14px rgba(75,59,152,.08); }
.nl2-chip-fire { color:#bf672d; background:#fff1e7; border-color:#ffe1c8; }
.nl2-chip-xp { color:#6248ce; background:#f0edff; border-color:#e1dbff; }
.nl2-chip-lvl { color:#258778; background:#e5faf5; border-color:#ceeee6; }
.nl2-goal { margin-top:6px; max-width:570px; padding:16px 17px; border-radius:18px; background:rgba(255,255,255,.65); border:1px solid rgba(116,86,232,.08); }
[data-theme="dark"] .nl2-goal { background:rgba(255,255,255,.06); }
.nl2-goal-row { font-size:12px; color:var(--text-secondary); }
.nl2-bar { height:9px; background:rgba(87,76,152,.10); border-radius:99px; overflow:hidden; }
.nl2-bar-lg { height:10px; margin-top:10px; }
.nl2-bar-fill { border-radius:inherit; min-width:4px; }
.nl2-grad { background:linear-gradient(90deg,#7659e8,#58b4f2); }
.nl2-cta { align-self:start; width:max-content; min-width:250px; text-align:right; margin-top:3px; padding:13px 18px; border:0; border-radius:18px; color:#fff; background:linear-gradient(135deg,#785be9 0%,#5c8ee6 100%); box-shadow:0 14px 27px rgba(89,75,199,.28); }
.nl2-cta:hover { transform:translateY(-3px); }
.nl2-cta-main { display:block; font-size:15px; font-weight:900; }
.nl2-cta-sub { display:block; margin-top:3px; font-size:11px; opacity:.9; }
.nl3-hero-orbit { position:absolute; left:28px; top:17px; width:230px; height:230px; display:flex; align-items:center; justify-content:center; }
.nl3-hero-orbit img { position:relative; z-index:2; width:174px; height:174px; object-fit:contain; mix-blend-mode:multiply; filter:drop-shadow(0 17px 17px rgba(66,52,156,.17)); transform:rotate(-4deg); }
[data-theme="dark"] .nl3-hero-orbit img { mix-blend-mode:normal; border-radius:28px; }
.nl3-orbit-ring { position:absolute; inset:14px; border:1px dashed rgba(116,86,232,.34); border-radius:50%; animation:nl3Spin 20s linear infinite; }
.nl3-orbit-pill { position:absolute; z-index:3; bottom:3px; right:18px; padding:7px 10px; border-radius:999px; color:#5c4ac5; background:#fff; box-shadow:0 8px 18px rgba(69,53,152,.12); font-size:11px; font-weight:900; }

.nl3-modes { margin:26px 0 28px; }
.nl3-section-head { display:flex; align-items:end; justify-content:space-between; gap:18px; margin:0 3px 14px; }
.nl3-section-head h2 { margin:2px 0 0; font-size:22px; letter-spacing:-.045em; font-weight:900; }
.nl3-section-head p { margin:0; max-width:400px; color:var(--text-secondary); font-size:12px; }
.nl3-kicker { color:#7659e7; font-size:11px; font-weight:900; letter-spacing:.04em; }
.nl3-modes-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.nl3-mode-card {
  position:relative; isolation:isolate; min-height:185px; overflow:hidden; padding:20px; display:flex; align-items:flex-end;
  border:1px solid rgba(255,255,255,.75); border-radius:25px; text-align:right; cursor:pointer;
  box-shadow:var(--shadow-soft); transition:transform 200ms cubic-bezier(.23,1,.32,1), box-shadow 200ms, filter 200ms;
  animation:nl3Rise 500ms var(--transition) both; animation-delay:var(--mode-delay);
}
.nl3-mode-card:hover { transform:translateY(-6px) rotate(-.25deg); box-shadow:0 20px 30px rgba(66,56,133,.15); }
.nl3-mode-card:active { transform:translateY(-1px) scale(.98); }
.nl3-mode-violet { background:linear-gradient(135deg,#eee8ff 0%,#fbfaff 100%); color:#41308d; }
.nl3-mode-blue { background:linear-gradient(135deg,#e2f1ff 0%,#f7fbff 100%); color:#2668a6; }
.nl3-mode-amber { background:linear-gradient(135deg,#fff0cf 0%,#fffaf0 100%); color:#9c5d08; }
.nl3-mode-mint { background:linear-gradient(135deg,#dff8f2 0%,#f5fffc 100%); color:#187e70; }
.nl3-mode-copy { display:flex; position:relative; z-index:2; flex-direction:column; align-items:flex-start; max-width:58%; }
.nl3-mode-copy strong { font-size:21px; line-height:1.1; font-weight:950; letter-spacing:-.055em; }
.nl3-mode-copy small { margin-top:6px; min-height:34px; text-align:right; color:currentColor; opacity:.72; font-size:11px; line-height:1.55; }
.nl3-mode-num { margin-bottom:8px; font-size:10px; font-weight:950; opacity:.48; letter-spacing:.12em; }
.nl3-mode-link { margin-top:13px; font-size:11px; font-weight:900; }
.nl3-mode-visual { position:absolute; z-index:1; left:-12px; top:-20px; width:154px; height:154px; display:flex; align-items:center; justify-content:center; }
.nl3-mode-visual img { width:100%; height:100%; object-fit:contain; mix-blend-mode:multiply; filter:drop-shadow(0 12px 12px rgba(45,46,92,.12)); transform:rotate(4deg); transition:transform 250ms cubic-bezier(.23,1,.32,1); }
.nl3-mode-card:hover .nl3-mode-visual img { transform:rotate(-5deg) scale(1.09); }
[data-theme="dark"] .nl3-mode-visual img { mix-blend-mode:normal; border-radius:20px; }
.nl3-stat { border-radius:22px; padding:17px; box-shadow:0 9px 20px rgba(61,51,121,.06); }
.nl3-stat:hover { transform:translateY(-4px); }

/* ── Core learning pages ──────────────────────────────────────── */
.stats-grid,.nl2-grid { gap:14px; }
.nl2-levelcard,.nl2-track-card,.nl2-ach-card,.nl2-insight { border-radius:25px; }
.nl2-levelcard { padding:18px 20px; background:linear-gradient(110deg,var(--bg-card),rgba(231,245,255,.72)); }
.nl2-track-card { padding:23px; }
.nl2-sec-title { font-size:15px; font-weight:900; color:var(--text-primary); }
.nl2-track { gap:10px; }
.nl2-lvl { border-radius:18px; background:#fbfaff; border:1px solid rgba(97,78,181,.08); padding:12px 9px; }
[data-theme="dark"] .nl2-lvl { background:rgba(255,255,255,.04); }
.nl2-lvl.cur { box-shadow:0 10px 20px rgba(116,86,232,.17); }
.nl2-ach-card { padding:22px; }
.nl2-ach { border-radius:16px; background:#faf9ff; border:1px solid rgba(102,88,186,.08); }
[data-theme="dark"] .nl2-ach { background:rgba(255,255,255,.04); }
.nl2-quick { gap:10px; margin-top:20px; }

.words-filters { background:var(--bg-card); padding:14px; gap:10px; border:1px solid rgba(255,255,255,.88); border-radius:22px; box-shadow:var(--shadow-soft); }
.search-input,.filter-select { min-height:44px; border-radius:13px; border:1px solid var(--border); background:rgba(247,246,252,.9); color:var(--text-primary); font:inherit; font-size:13px; }
.search-input { padding:0 15px; }
.filter-select { padding:0 12px; }
[data-theme="dark"] .search-input,[data-theme="dark"] .filter-select { background:rgba(255,255,255,.06); }
.words-grid { gap:15px; }
.word-card { padding:19px; border-radius:23px; background:var(--bg-card); border:1px solid rgba(255,255,255,.94); box-shadow:0 8px 20px rgba(57,47,118,.065); }
.word-card:hover { border-color:rgba(116,86,232,.28); box-shadow:0 18px 30px rgba(58,47,121,.11); transform:translateY(-5px); }
.word-card .wc-dutch { color:#5d48ca; font-size:24px; letter-spacing:-.035em; }
.word-card .wc-arabic { font-size:17px; }
.word-card .wc-type { border-radius:999px; padding:4px 9px; background:#f0edff; color:#6b54d8; font-weight:800; }
.word-card .wc-source-badge { border-radius:999px; background:#e5faf5; color:#168170; }
.word-card .wc-example { background:#f7f6fc; border-radius:12px; border-right:3px solid #a99aef; }
[data-theme="dark"] .word-card,[data-theme="dark"] .words-filters { border-color:rgba(255,255,255,.08); }
[data-theme="dark"] .word-card .wc-example { background:rgba(255,255,255,.05); }

.review-card,.flashcard,.quiz-card,.mc-game,.match-game,.sentence-game,.listen-game { border-radius:30px !important; box-shadow:var(--shadow) !important; }
.review-progress { padding:13px 17px; background:var(--bg-card); border-radius:19px; box-shadow:var(--shadow-soft); }
.srs-btn { border-radius:16px !important; min-height:48px; font-weight:900; }
.game-card { border-radius:24px; box-shadow:var(--shadow-soft); border:1px solid rgba(255,255,255,.85); }
.game-card:hover { transform:translateY(-5px); box-shadow:var(--shadow); }

/* ── Course, modal, settings and profile ─────────────────────── */
.modal-overlay { background:rgba(28,24,53,.36); backdrop-filter:blur(8px); }
.modal,.word-modal { border-radius:30px !important; border:1px solid rgba(255,255,255,.85); box-shadow:0 25px 70px rgba(28,22,71,.25); }
.settings-section,.profile-section,.about-section { border-radius:25px; }
.empty-state { border-radius:28px; background:var(--bg-card); box-shadow:var(--shadow-soft); }

/* ── Authentication and onboarding ───────────────────────────── */
.auth-page { padding:28px; background:linear-gradient(135deg,#f1edff 0%,#f7fbff 52%,#e6faf5 100%); }
.auth-page::before { content:""; position:absolute; width:430px; height:430px; border-radius:50%; right:-170px; top:-160px; background:rgba(116,86,232,.14); filter:blur(2px); }
.auth-page::after { content:""; position:absolute; width:370px; height:370px; border-radius:50%; left:-160px; bottom:-160px; background:rgba(49,195,177,.16); }
.auth-card { position:relative; z-index:1; max-width:460px; padding:34px; border-radius:32px; background:rgba(255,255,255,.90); border:1px solid rgba(255,255,255,.92); box-shadow:0 28px 70px rgba(65,48,139,.18); }
.auth-logo .logo-big { width:74px; height:74px; border-radius:24px; box-shadow:0 14px 24px rgba(107,78,214,.18); }
.auth-logo h1 { font-size:26px; letter-spacing:-.055em; }
.auth-tabs { padding:5px; border-radius:16px; background:#f2f0fa; }
.auth-tab { border-radius:12px; font-weight:850; }
.auth-tab.active { background:#fff; color:#6248cf; box-shadow:0 4px 12px rgba(70,54,147,.10); }
.form-input { min-height:47px; border-radius:14px; background:#faf9fe; border:1px solid #e6e2f5; }

/* ── Mobile layout ───────────────────────────────────────────── */
.bottom-nav {
  left:14px; right:14px; bottom:14px; width:auto; height:72px; padding:7px 8px;
  border:1px solid rgba(255,255,255,.85); border-radius:24px; background:rgba(255,255,255,.88);
  box-shadow:0 16px 35px rgba(42,31,105,.16); backdrop-filter:blur(20px);
}
.bottom-nav-item { border-radius:16px; min-width:0; color:var(--text-muted); font-weight:800; font-size:10px; }
.bottom-nav-item.active { color:#fff; background:linear-gradient(135deg,#785be9,#6250d5); box-shadow:0 7px 14px rgba(100,75,212,.20); }
.bottom-nav-item .bn-icon { font-size:17px; }
@media (max-width:1024px) {
  .app-layout { padding:10px; }
  .sidebar { right:10px; top:10px; height:calc(100vh - 20px); }
  .main-content { margin-right:0; }
  .header { padding:0 18px; }
}
@media (max-width:768px) {
  .app-layout { padding:0; display:block; }
  .main-content { margin:0; padding-bottom:88px; }
  .header { height:66px; margin:0; border-radius:0 0 21px 21px; padding:0 15px; border-top:0; }
  .header-title { font-size:15px; }
  .header-right .streak-badge,.header-right .xp-badge { padding:6px 8px; font-size:10px; }
  .page-content { padding:20px 14px 26px; }
  .nl3-hero { min-height:0; grid-template-columns:1fr; padding:24px 20px 28px; border-radius:25px; }
  .nl3-hero-orbit { opacity:.17; left:-10px; top:-20px; transform:scale(.8); pointer-events:none; }
  .nl2-hero-head { display:block; }
  .nl2-chips { margin-top:12px; }
  .nl2-cta { min-width:100%; }
  .nl3-section-head { display:block; margin-top:4px; }
  .nl3-section-head p { margin-top:5px; }
  .nl3-modes-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .nl3-mode-card { min-height:165px; padding:15px; border-radius:21px; }
  .nl3-mode-visual { width:116px; height:116px; left:-16px; top:-16px; }
  .nl3-mode-copy { max-width:66%; }
  .nl3-mode-copy strong { font-size:18px; }
  .nl3-mode-copy small { min-height:31px; font-size:10px; }
  .words-grid { grid-template-columns:1fr; }
  .word-card { border-radius:20px; }
  .words-filters { border-radius:18px; }
  .auth-page { padding:16px; }
  .auth-card { padding:26px 20px; border-radius:27px; }
}
@media (max-width:390px) {
  .header-right .xp-badge { display:none; }
  .nl3-mode-card { min-height:155px; padding:13px; }
  .nl3-mode-visual { opacity:.78; }
  .nl3-mode-copy small { display:none; }
  .nl3-mode-link { margin-top:8px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
@keyframes nl3Spin { to { transform:rotate(360deg); } }
@keyframes nl3Rise { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }


/* ── Dedicated reading and review surfaces ───────────────────── */
.nl3-page-intro {
  min-height:144px; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between;
  padding:22px 30px; margin-bottom:17px; border-radius:27px; border:1px solid rgba(255,255,255,.92);
  background:linear-gradient(110deg,#f2efff 0%,#fff 57%,#edf8ff 100%); box-shadow:var(--shadow-soft);
}
.nl3-page-intro::after { content:""; position:absolute; width:220px; height:220px; left:85px; bottom:-160px; border-radius:50%; background:rgba(116,86,232,.12); }
.nl3-page-intro .page-header { position:relative; z-index:1; margin:0; }
.nl3-page-intro .page-header h1 { margin-top:3px; }
.nl3-page-intro > img { position:relative; z-index:1; width:142px; height:142px; object-fit:contain; mix-blend-mode:multiply; filter:drop-shadow(0 14px 14px rgba(66,52,156,.14)); transform:rotate(-4deg); }
[data-theme="dark"] .nl3-page-intro { background:linear-gradient(110deg,#302856,#282845 57%,#25415a); border-color:rgba(255,255,255,.08); }
[data-theme="dark"] .nl3-page-intro > img { mix-blend-mode:normal; border-radius:24px; }
.nl3-review-page .page-header { max-width:760px; margin:0 auto 17px; padding:2px 6px; }
.nl3-review-page .page-header h1 { margin-top:2px; }
.nl3-review-page .flashcard-container { max-width:760px; margin:0 auto; }
.nl3-review-page .review-progress { border:1px solid rgba(116,86,232,.10); }
.nl3-review-page .flashcard-wrap { perspective:1600px; }
.nl3-review-page .flashcard {
  min-height:370px; border-radius:32px; background:linear-gradient(135deg,#fbfaff,#f4f1ff);
  border:1px solid #fff; box-shadow:0 22px 45px rgba(69,52,152,.15);
}
.nl3-review-page .flashcard-face { padding:38px; border-radius:31px; }
.nl3-review-page .flashcard-back { background:linear-gradient(135deg,#e7f8f4,#f6fffd); }
.nl3-review-page .fc-hint { color:#8066dd; font-weight:850; letter-spacing:.01em; }
.nl3-review-page .fc-word { font-size:clamp(38px,6vw,62px); color:#523bbb; letter-spacing:-.055em; }
.nl3-review-page .fc-article,.nl3-review-page .fc-type { border-radius:999px; }
.nl3-review-page .progress-bar-wrap { background:#e7e3f7; border-radius:999px; overflow:hidden; }
.nl3-review-page .progress-bar-fill { background:linear-gradient(90deg,#7d5bea,#55b5f0); border-radius:inherit; }
@media (max-width:768px) {
  .nl3-page-intro { min-height:120px; padding:18px 20px; border-radius:22px; }
  .nl3-page-intro > img { width:104px; height:104px; margin-left:-10px; }
  .nl3-page-intro .page-header h1 { font-size:27px; }
  .nl3-review-page .flashcard { min-height:330px; border-radius:25px; }
  .nl3-review-page .flashcard-face { padding:28px 20px; }
}

/* ── Vocabulary memory experience ────────────────────────────── */
.nl3-memory-modes { margin:28px 0; }
.nl3-memory-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.nl3-memory-card {
  min-height:184px; position:relative; overflow:hidden; display:flex; flex-direction:column; align-items:flex-start;
  text-align:right; padding:20px; border:1px solid rgba(255,255,255,.9); border-radius:25px; cursor:pointer;
  background:linear-gradient(145deg,#fff,#f5f2ff); box-shadow:var(--shadow-soft); color:var(--text-primary);
  transition:transform 180ms var(--ease-out,cubic-bezier(.23,1,.32,1)),box-shadow 180ms var(--ease-out,cubic-bezier(.23,1,.32,1));
  animation:nl3Rise .4s var(--ease-out,cubic-bezier(.23,1,.32,1)) both; animation-delay:var(--mode-delay,0ms);
}
.nl3-memory-card::after { content:""; position:absolute; width:112px; height:112px; border-radius:50%; left:-38px; top:-38px; background:rgba(116,86,232,.10); }
.nl3-memory-card:hover:not(:disabled) { transform:translateY(-4px); box-shadow:var(--shadow); }
.nl3-memory-card:active:not(:disabled) { transform:scale(.97); }
.nl3-memory-card:focus-visible,.memory-session-tab:focus-visible,.memory-state-card:focus-visible { outline:3px solid rgba(91,68,205,.42); outline-offset:3px; }
.nl3-memory-card.is-disabled { opacity:.58; cursor:not-allowed; filter:saturate(.65); }
.nl3-memory-card.nl3-memory-coral { background:linear-gradient(145deg,#fff5f5,#fff9f4); }
.nl3-memory-card.nl3-memory-coral::after { background:rgba(244,63,94,.10); }
.nl3-memory-card.nl3-memory-blue { background:linear-gradient(145deg,#f1f7ff,#f9fcff); }
.nl3-memory-card.nl3-memory-blue::after { background:rgba(56,189,248,.12); }
.nl3-memory-card.nl3-memory-mint { background:linear-gradient(145deg,#f2fcf8,#f8fffd); }
.nl3-memory-card.nl3-memory-mint::after { background:rgba(34,197,94,.11); }
.nl3-memory-icon { position:relative; z-index:1; display:grid; place-items:center; width:43px; height:43px; margin-bottom:16px; border-radius:15px; background:rgba(255,255,255,.72); box-shadow:0 7px 15px rgba(56,46,119,.08); font-size:22px; }
.nl3-memory-copy { position:relative; z-index:1; display:flex; flex:1; flex-direction:column; align-items:flex-start; }
.nl3-memory-copy strong { font-size:18px; font-weight:900; letter-spacing:-.025em; }
.nl3-memory-copy small { min-height:38px; margin-top:6px; color:var(--text-muted); font-size:12px; line-height:1.65; }
.nl3-memory-link { margin-top:auto; color:#6248cf; font-size:12px; font-weight:850; }
.nl3-memory-orbit-icon { position:absolute; inset:0; display:grid; place-items:center; font-size:80px; filter:drop-shadow(0 15px 15px rgba(84,63,181,.22)); }
[data-theme="dark"] .nl3-memory-card { border-color:rgba(255,255,255,.09); background:linear-gradient(145deg,#322957,#292746); }
[data-theme="dark"] .nl3-memory-card.nl3-memory-coral { background:linear-gradient(145deg,#4b2c43,#352638); }
[data-theme="dark"] .nl3-memory-card.nl3-memory-blue { background:linear-gradient(145deg,#243b5a,#292b45); }
[data-theme="dark"] .nl3-memory-card.nl3-memory-mint { background:linear-gradient(145deg,#224940,#2a3547); }
[data-theme="dark"] .nl3-memory-icon { background:rgba(255,255,255,.09); }

.memory-session-tabs { max-width:760px; display:flex; flex-wrap:wrap; gap:8px; margin:0 auto 16px; padding:7px; border-radius:18px; background:rgba(116,86,232,.08); }
.memory-session-tab { flex:1 1 135px; min-height:38px; border:0; border-radius:12px; padding:8px 12px; background:transparent; color:var(--text-muted); font:inherit; font-size:12px; font-weight:800; cursor:pointer; transition:background 180ms var(--ease-out,cubic-bezier(.23,1,.32,1)),color 180ms var(--ease-out,cubic-bezier(.23,1,.32,1)),transform 150ms var(--ease-out,cubic-bezier(.23,1,.32,1)); }
.memory-session-tab.active { background:#fff; color:#5c42c7; box-shadow:0 5px 12px rgba(74,54,154,.12); }
.memory-session-tab:active { transform:scale(.97); }
[data-theme="dark"] .memory-session-tabs { background:rgba(255,255,255,.07); }
[data-theme="dark"] .memory-session-tab.active { background:#4b3b88; color:#fff; }
.fc-word-arabic { direction:rtl; font-size:clamp(30px,5vw,48px) !important; letter-spacing:0 !important; line-height:1.45; }
.fc-translation-dutch { direction:ltr; font-size:clamp(34px,5.4vw,56px); color:#16745b; font-weight:900; letter-spacing:-.045em; }

.wc-memory-state { display:inline-flex; align-items:center; gap:4px; margin:8px 0 0 6px; padding:4px 8px; border-radius:999px; font-size:10px; font-weight:850; white-space:nowrap; }
.memory-progress-panel { margin:0 0 16px; padding:24px !important; }
.memory-progress-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:17px; }
.memory-progress-head h2 { margin:3px 0 0; font-size:20px; font-weight:900; }
.memory-progress-total { padding:7px 10px; border-radius:999px; background:rgba(116,86,232,.10); color:#6248cf; font-size:12px; font-weight:850; white-space:nowrap; }
.memory-state-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; }
.memory-state-card { display:flex; min-height:102px; flex-direction:column; align-items:center; justify-content:center; gap:4px; border:1px solid rgba(116,86,232,.10); border-radius:17px; background:rgba(116,86,232,.035); color:var(--text-primary); font:inherit; cursor:pointer; transition:transform 160ms var(--ease-out,cubic-bezier(.23,1,.32,1)),box-shadow 160ms var(--ease-out,cubic-bezier(.23,1,.32,1)); }
.memory-state-card:hover { transform:translateY(-3px); box-shadow:0 10px 20px rgba(63,48,126,.10); }
.memory-state-card:active { transform:scale(.97); }
.memory-state-card strong { font-size:24px; line-height:1; }
.memory-state-card small { color:var(--text-muted); font-size:11px; font-weight:750; }
.memory-state-icon { font-size:18px; }
.memory-state-hard { border-color:rgba(244,63,94,.24); background:rgba(244,63,94,.055); }
.memory-state-mastered { border-color:rgba(34,197,94,.22); background:rgba(34,197,94,.05); }
.memory-progress-note { margin:15px 0 0; color:var(--text-muted); font-size:12px; line-height:1.75; }

@media (max-width:900px) { .nl3-memory-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .memory-state-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:520px) { .nl3-memory-grid { gap:10px; } .nl3-memory-card { min-height:154px; padding:16px; border-radius:20px; } .nl3-memory-copy strong { font-size:16px; } .nl3-memory-copy small { min-height:34px; font-size:10px; } .memory-session-tabs { gap:5px; padding:5px; border-radius:15px; } .memory-session-tab { flex-basis:calc(50% - 4px); font-size:11px; padding:8px 6px; } .memory-progress-panel { padding:18px !important; } .memory-state-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .memory-state-card:last-child { grid-column:span 2; } .memory-progress-head h2 { font-size:18px; } }

/* ═══════════════════════════════════════════════════════════════════
   AUDIT-FIXES · 2026-09-02 · S1-2 / S1-3 / S2-1 / S2-5 / S2-6
   Bewust achteraan geplaatst: gelijke specificiteit, later in het
   bestand => deze regels winnen van de eerdere definities.
   ═══════════════════════════════════════════════════════════════════ */

/* ── S1-2 · sectiepagina's: geen 1047px witruimte meer ─────────────
   .page-content heeft flex:1; twee .page-content-broers in dezelfde
   flex-kolom deelden de hoogte 50/50. De launcher-kaart krijgt nu
   haar eigen hoogte terug. */
.section-study-launcher { flex: 0 0 auto; }

/* ── S1-3 · contrast: alle tekst >= 4.5:1 t.o.v. de ECHTE achtergrond ── */
:root:not([data-theme="dark"]) {
  --text-muted:   #5c5a6e;   /* was #9998aa = 2.83:1 op wit  -> 5.6:1 */
  --srs-hard-fg:  #b02a37;   /* was #ff4757 = 1.00:1         -> 5.1:1 */
  --srs-ok-fg:    #8a5a00;   /* was #ffa500 = 1.00:1         -> 5.6:1 */
  --srs-easy-fg:  #0f6e60;   /* was #31c3b1 = 1.38:1         -> 5.6:1 */
  --fc-type-fg:   #4a32c4;   /* was #7456e8 = 1.15:1         -> 7.3:1 */
}
[data-theme="dark"] {
  --srs-hard-fg:  #ff8b96;
  --srs-ok-fg:    #ffc861;
  --srs-easy-fg:  #6ff0cf;
  --fc-type-fg:   #c6baff;
}
.srs-hard { color: var(--srs-hard-fg); }
.srs-ok   { color: var(--srs-ok-fg); }
.srs-easy { color: var(--srs-easy-fg); }
/* de interval-hint onder elke knop: 11px + opacity .8 -> 12px, vol contrast */
.srs-btn .srs-days { font-size: 12px; opacity: 1; font-weight: 700; }
.fc-type { color: var(--fc-type-fg); }
.memory-session-tab { color: var(--text-muted); font-size: 12px; }
/* geen tekst kleiner dan 12px in de header */
.header-right .xp-badge, .header-right .streak-badge { font-size: 12px; }

/* ── S2-1 · beoordelingsknoppen blijven in beeld ───────────────────
   Hogere specificiteit dan dashboard-redesign.css (.nl3-review-page
   .srs-buttons{position:relative}), dat later geladen wordt. */
.nl3-review-page .flashcard-container .srs-buttons {
  position: sticky;
  bottom: 0;
  z-index: 6;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg-primary) 76%, rgba(0,0,0,0));
}
/* compactere kaart: minder loze binnenruimte, antwoord + knoppen samen zichtbaar */
.flashcard-wrap { height: 280px; }
.flashcard-face { padding: 24px; overflow-y: auto; }

/* ── S2-5 · iPhone safe-area (viewport-fit=cover + fixed bottom-nav) ── */
.bottom-nav { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1024px) {
  .main-content { padding-bottom: calc(var(--bottom-nav-h) + 26px + env(safe-area-inset-bottom, 0px)); }
}

/* ── S2-6 · cijfers in RTL-tekst: altijd dezelfde volgorde ─────────── */
.xp-badge, .streak-badge, .word-notification-button span, .num {
  direction: ltr;
  unicode-bidi: isolate;
}
.num { display: inline-block; }

/* ── S2-1 / S2-4 / S2-8 · nieuwe elementen uit app.js ──────────────── */
/* Nederlands woord op de achterkant van de kaart (controle van je geheugen) */
.fc-back-dutch {
  margin-top: 2px; font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  color: var(--text-secondary); direction: ltr;
}
[data-theme="dark"] .fc-back-dutch { color: var(--text-secondary); }

/* Sessieregel + achterstandsnotitie op de reviewpagina */
.review-session-line { margin: 6px 0 0; font-size: 14px; color: var(--text-secondary); }
.review-session-line strong { color: var(--text-primary); }
.review-debt-note { color: var(--text-muted); font-size: 13px; }
.review-debt-btn { margin-top: 10px; }

/* Cijferbadges in RTL-context */
.nav-badge { direction: ltr; unicode-bidi: isolate; }

/* Error boundary (S2-4) */
.app-crash {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg-primary);
}
.app-crash-card {
  max-width: 420px; width: 100%; text-align: center; padding: 32px 26px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-secondary); box-shadow: var(--shadow);
}
.app-crash-icon { font-size: 44px; margin-bottom: 10px; }
.app-crash-card h1 { font-size: 22px; margin-bottom: 8px; color: var(--text-primary); }
.app-crash-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-bottom: 18px; }
.app-crash-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* S2-1 · op mobiel zweeft de bottom-nav over de onderkant: de sticky
   beoordelingsknoppen moeten daar bovenop blijven, niet erachter. */
@media (max-width: 768px) {
  .nl3-review-page .flashcard-container .srs-buttons {
    bottom: calc(var(--bottom-nav-h, 70px) + 20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ═══════════════════════════════════════════════════════════════════
   قسم العبارات والجمل (PhrasesPage) — 2026-09-03
   ═══════════════════════════════════════════════════════════════════ */
.ph-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:16px; }
.ph-stat {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:14px 8px; border:1px solid var(--border); border-radius:18px;
  background:var(--bg-card); box-shadow:var(--shadow-soft,none);
}
.ph-stat strong { font-size:22px; font-weight:900; color:var(--text-primary); }
.ph-stat span { font-size:12px; color:var(--text-secondary); }
.ph-stat-due strong { color:#b02a37; }
[data-theme="dark"] .ph-stat-due strong { color:#ff8b96; }

.ph-dir { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; font-size:13px; color:var(--text-secondary); }

.ph-cats { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; margin-bottom:18px; }
.ph-cat {
  display:flex; align-items:center; gap:9px; min-height:56px; padding:10px 14px;
  border:1px solid var(--border); border-radius:16px; background:var(--bg-card);
  color:var(--text-primary); font:inherit; font-size:14px; font-weight:700;
  cursor:pointer; text-align:start; transition:all var(--transition);
}
.ph-cat:hover { border-color:var(--accent); transform:translateY(-1px); }
.ph-cat.active { border-color:var(--accent); background:linear-gradient(135deg,#7456e8,#8b5cf6); color:#fff; }
.ph-cat-icon { font-size:18px; }
.ph-cat-label { flex:1; min-width:0; }
.ph-cat-count { font-size:12px; font-weight:800; opacity:.75; }

.ph-start-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:8px; }
.ph-start { font-size:16px; padding:14px 22px; }

/* بطاقة العبارة — بلا قلب ثلاثي الأبعاد: النص قد يطول */
.ph-card {
  padding:26px 22px; border:1px solid var(--border); border-radius:26px;
  background:linear-gradient(135deg,#fbfaff,#f4f1ff); box-shadow:0 18px 38px rgba(69,52,152,.12);
  text-align:center; cursor:pointer; margin-bottom:14px;
}
[data-theme="dark"] .ph-card { background:linear-gradient(135deg,#2e294d,#22243f); }
.ph-nl { font-size:clamp(19px,3.4vw,26px); font-weight:800; line-height:1.5; color:#1f7a63; letter-spacing:-.01em; }
[data-theme="dark"] .ph-nl { color:#6ff0cf; }
.ph-ar { font-size:clamp(19px,3.4vw,26px); font-weight:800; line-height:1.75; color:var(--text-primary); }
.ph-answer { margin-top:16px; padding-top:16px; border-top:1px dashed var(--border); }
.ph-ar-small { margin-top:10px; font-size:16px; line-height:1.8; color:var(--text-secondary); }
.ph-kern {
  display:flex; align-items:center; gap:8px; justify-content:center; flex-wrap:wrap;
  margin-top:14px; padding:9px 14px; border-radius:14px;
  background:rgba(116,86,232,.10); color:var(--text-primary); font-size:13.5px; font-weight:700;
}
.ph-kern span {
  padding:2px 8px; border-radius:8px; background:#4a32c4; color:#fff;
  font-size:11px; font-weight:800;
}
[data-theme="dark"] .ph-kern { background:rgba(255,255,255,.07); }
.ph-meta { margin-top:12px; font-size:12px; color:var(--text-muted); }
.ph-session-foot { margin-top:14px; text-align:center; }

.ph-done { text-align:center; padding:34px 24px; }
.ph-done-icon { font-size:46px; margin-bottom:6px; }
.ph-done-grid { display:flex; justify-content:center; gap:26px; margin:18px 0 22px; }
.ph-done-grid div { display:flex; flex-direction:column; }
.ph-done-grid strong { font-size:26px; font-weight:900; color:var(--text-primary); }
.ph-done-grid span { font-size:12px; color:var(--text-secondary); }
.ph-done-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }

@media (max-width:560px) {
  .ph-stats { grid-template-columns:repeat(2,1fr); }
  .ph-cats { grid-template-columns:repeat(2,1fr); }
  .ph-cat { min-height:52px; padding:9px 11px; font-size:13px; }
  .ph-card { padding:20px 16px; border-radius:22px; }
}
.ph-ar-answer { font-size:clamp(18px,3.2vw,23px); font-weight:800; line-height:1.8; color:var(--text-primary); }
.ph-meta { margin-bottom:6px; }

/* ── الأمثال والتعابير (ProverbsPage) — 2026-09-03 ───────────────── */
.pv-card { cursor: pointer; }
.pv-nl {
  font-size: clamp(20px,3.6vw,28px); font-weight: 800; line-height: 1.55;
  color: #1f7a63; letter-spacing: -.01em; direction: ltr;
}
[data-theme="dark"] .pv-nl { color: #6ff0cf; }
.pv-ar { font-size: clamp(18px,3.2vw,23px); font-weight: 800; line-height: 1.8; color: var(--text-primary); }
.pv-wanneer, .pv-lett {
  margin-top: 12px; padding: 11px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.85; text-align: start;
}
.pv-wanneer { background: rgba(116,86,232,.10); color: var(--text-primary); }
.pv-lett { background: rgba(0,0,0,.04); color: var(--text-secondary); font-size: 13px; }
[data-theme="dark"] .pv-wanneer { background: rgba(255,255,255,.07); }
[data-theme="dark"] .pv-lett { background: rgba(255,255,255,.04); }
.pv-wanneer span, .pv-lett span {
  display: inline-block; margin-inline-end: 8px; padding: 2px 9px; border-radius: 8px;
  background: #4a32c4; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle;
}
.pv-lett span { background: #5c5a6e; }


/* ═══ PERF-2026-09-03 · شاشة تحميل بيانات القسم ═══════════════════
   تظهر فقط في الأقسام التي لا معنى لها بلا بياناتها (العبارات، الأمثال،
   الامتحانات، Taalcompleet، الأفعال) وفي أول فتح فقط. */
.nlwf-dataload{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:16px; min-height:46vh; padding:32px 20px; text-align:center;
}
.nlwf-dataload-spin{
  width:38px; height:38px; border-radius:50%;
  border:3px solid rgba(108,99,255,.20); border-top-color:#6c63ff;
  animation:nlwf-dataload-spin .8s linear infinite;
}
@keyframes nlwf-dataload-spin{ to{ transform:rotate(360deg); } }
.nlwf-dataload-txt{ font-size:15px; color:var(--text-muted,#8a86a3); max-width:34ch; line-height:1.8; }
.nlwf-dataload .btn{ margin-top:4px; }
@media (prefers-reduced-motion:reduce){
  .nlwf-dataload-spin{ animation-duration:2.4s; }
}

/* ═══ LEZEN-2026-09-03 · قسم القراءة ══════════════════════════════
   يستخدم متغيّرات الثيم القائمة، فيعمل في الوضعين الفاتح والداكن. */
.lz-page, .lz-run, .lz-res { max-width: 1080px; margin: 0 auto; }

.lz-hero { text-align: center; margin-bottom: 22px; }
.lz-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
.lz-lede { color: var(--text-secondary); max-width: 60ch; margin: 0 auto; line-height: 1.85; font-size: 15px; }
.lz-hero-stats { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 14px; font-size: 13.5px; color: var(--text-muted); }
.lz-hero-stats b { color: var(--accent); font-size: 17px; margin-inline-end: 4px; }

.lz-modus { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; }
.lz-modus-label { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 10px; }
.lz-modus-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lz-modus-btn { display: flex; flex-direction: column; gap: 3px; text-align: start; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: inherit; }
.lz-modus-btn b { color: var(--text-primary); font-size: 14.5px; }
.lz-modus-btn span { font-size: 12.5px; line-height: 1.6; }
.lz-modus-btn.on { border-color: var(--accent); background: rgba(108,99,255,0.10); }
.lz-modus-btn:hover { border-color: var(--accent); }

.lz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lz-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: var(--transition); }
.lz-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }
.lz-card.done { border-color: rgba(67,233,123,0.35); }
.lz-card-top { display: flex; justify-content: space-between; align-items: center; }
.lz-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.lz-thema { font-size: 12px; color: var(--text-muted); }
.lz-card h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.lz-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.lz-new { font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.lz-best { font-size: 12.5px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 5px; }
.lz-bar { height: 6px; border-radius: 99px; background: rgba(128,128,160,0.22); overflow: hidden; }
.lz-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent3)); border-radius: 99px; }
.lz-bar-fill.zwak { background: linear-gradient(90deg, var(--accent4), var(--accent2)); }
.lz-start { margin-top: auto; }
.lz-bron { margin-top: 26px; font-size: 12.5px; color: var(--text-muted); line-height: 1.85; text-align: center; max-width: 68ch; margin-inline: auto; }

/* ── runner ── */
.lz-bar-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lz-stop { background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.lz-stop:hover { color: var(--accent2); border-color: var(--accent2); }
.lz-voortgang { flex: 1; height: 6px; border-radius: 99px; background: rgba(128,128,160,0.22); overflow: hidden; }
.lz-voortgang-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent3)); transition: width 0.3s ease; }
.lz-klok { font-size: 13.5px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lz-klok.krap { color: var(--accent2); }
.lz-klok.rustig { color: var(--text-muted); font-weight: 500; }

.lz-tabs { display: none; gap: 8px; margin-bottom: 12px; }
.lz-tabs button { flex: 1; padding: 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 13.5px; cursor: pointer; }
.lz-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.lz-split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }
.lz-tekst { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
  max-height: calc(100vh - 210px); overflow-y: auto; position: sticky; top: 12px; }
.lz-tekst-kop { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.lz-tekst-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.lz-tekst-kop h2 { font-size: 19px; font-weight: 700; margin-top: 4px; color: var(--text-primary);
  direction: ltr; text-align: start; unicode-bidi: isolate; }
.lz-tekst p { direction: ltr; text-align: start; unicode-bidi: isolate; font-size: 16px; line-height: 1.95; color: var(--text-primary); margin-bottom: 14px; }
.lz-tekst p:last-child { margin-bottom: 0; }

.lz-vragen { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.lz-q-kop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lz-q-nr { font-size: 12.5px; color: var(--text-muted); }
.lz-q-skill { font-size: 11.5px; background: rgba(108,99,255,0.14); color: var(--accent); padding: 2px 9px; border-radius: 999px; }
.lz-q-tekst { font-size: 16px; line-height: 1.85; color: var(--text-primary); margin-bottom: 14px; font-weight: 600; }
.lz-opts { display: flex; flex-direction: column; gap: 9px; }
.lz-opt { display: flex; gap: 11px; align-items: flex-start; text-align: start; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: transparent; color: var(--text-primary); cursor: pointer; font-family: inherit; font-size: 14.5px; line-height: 1.7; transition: var(--transition); }
.lz-opt:hover { border-color: var(--accent); background: rgba(108,99,255,0.06); }
.lz-letter { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: rgba(128,128,160,0.18); color: var(--text-secondary); }
.lz-opt-tekst { flex: 1; }
.lz-opt.gekozen { border-color: var(--accent); background: rgba(108,99,255,0.12); }
.lz-opt.goed { border-color: var(--accent3); background: rgba(67,233,123,0.12); }
.lz-opt.goed .lz-letter { background: var(--accent3); color: #06331c; }
.lz-opt.fout { border-color: var(--accent2); background: rgba(255,101,132,0.12); }
.lz-opt.fout .lz-letter { background: var(--accent2); color: #fff; }

.lz-uitleg { margin-top: 14px; padding: 13px 15px; border-radius: var(--radius-sm); background: rgba(255,101,132,0.10); border-inline-start: 3px solid var(--accent2); font-size: 14px; line-height: 1.85; color: var(--text-secondary); }
.lz-uitleg.ok { background: rgba(67,233,123,0.10); border-inline-start-color: var(--accent3); }
.lz-uitleg b { display: block; margin-bottom: 4px; color: var(--text-primary); }
.lz-nav { display: flex; gap: 10px; margin-top: 18px; }
.lz-nav .btn { flex: 1; }

/* ── resultaat ── */
.lz-score { text-align: center; padding: 26px 20px; border-radius: var(--radius); background: rgba(255,101,132,0.10); border: 1px solid rgba(255,101,132,0.28); margin-bottom: 18px; }
.lz-score.ok { background: rgba(67,233,123,0.10); border-color: rgba(67,233,123,0.30); }
.lz-score-pct { font-size: 44px; font-weight: 800; color: var(--text-primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.lz-score-sub { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }
.lz-score-msg { font-size: 13.5px; color: var(--text-muted); margin-top: 10px; }
.lz-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.lz-kpis > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 10px; text-align: center; }
.lz-kpis b { display: block; font-size: 19px; color: var(--text-primary); font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate; }
.lz-kpis span { font-size: 12px; color: var(--text-muted); }
.lz-vergelijk { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13.5px; color: var(--text-secondary); margin-bottom: 18px; }
.lz-skills { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.lz-skills h3, .lz-fouten h3 { font-size: 16px; font-weight: 700; margin-bottom: 13px; color: var(--text-primary); }
.lz-skill-rij { display: grid; grid-template-columns: 120px 1fr 44px; gap: 12px; align-items: center; margin-bottom: 9px; font-size: 13px; }
.lz-skill-nm { color: var(--text-secondary); }
.lz-skill-num { color: var(--text-muted); text-align: end; font-variant-numeric: tabular-nums; }
.lz-fouten { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.lz-fout { padding: 14px 0; border-bottom: 1px solid var(--border); }
.lz-fout:last-child { border-bottom: none; padding-bottom: 0; }
.lz-fout-bron { font-size: 11.5px; color: var(--accent); margin-bottom: 5px; }
.lz-fout-q { font-size: 14.5px; font-weight: 600; color: var(--text-primary); line-height: 1.8; margin-bottom: 8px; }
.lz-fout-a { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; margin-bottom: 8px; }
.lz-fout-a .bad { color: var(--accent2); }
.lz-fout-a .good { color: var(--accent3); }
.lz-fout-uitleg { font-size: 13.5px; line-height: 1.85; color: var(--text-secondary); }
.lz-perfect { text-align: center; padding: 22px; background: rgba(67,233,123,0.10); border-radius: var(--radius); font-size: 15px; color: var(--text-secondary); margin-bottom: 18px; }
.lz-res-nav { display: flex; gap: 10px; }
.lz-res-nav .btn { flex: 1; }

@media (max-width: 900px) {
  .lz-split { grid-template-columns: 1fr; }
  .lz-tabs { display: flex; }
  .lz-tekst { position: static; max-height: none; padding: 18px; }
  .lz-tekst.m-hide, .lz-vragen.m-hide { display: none; }
  .lz-modus-btns { grid-template-columns: 1fr; }
  .lz-kpis { grid-template-columns: repeat(2, 1fr); }
  .lz-skill-rij { grid-template-columns: 96px 1fr 40px; font-size: 12.5px; }
  .lz-hero h1 { font-size: 22px; }
  .lz-score-pct { font-size: 38px; }
  .lz-tekst p { font-size: 16.5px; line-height: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .lz-card:hover { transform: none; }
  .lz-voortgang-fill { transition: none; }
}

/* ═══ LUISTEREN-2026-09-04 · مشغّل الاستماع ═══════════════════════
   يعيد استخدام أنماط .lz-* من قسم القراءة، ويضيف ما يخصّ الصوت. */
.ls-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.ls-speler { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; position: sticky; top: 12px; }
.ls-speler.aan { border-color: rgba(108,99,255,0.45); }
.ls-frag-kop { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ls-frag-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700;
  direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ls-frag-kop h2 { font-size: 18px; font-weight: 700; margin-top: 5px; color: var(--text-primary);
  direction: ltr; text-align: start; unicode-bidi: isolate; }
.ls-setting { font-size: 13.5px; color: var(--text-muted); margin-top: 7px; line-height: 1.75; }

.ls-knoppen { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px 0 4px; }
.ls-play { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; border: none;
  border-radius: 999px; padding: 15px 34px; font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: 0 8px 22px rgba(108,99,255,0.35); transition: var(--transition); }
.ls-play:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(108,99,255,0.5); }
.ls-play:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.ls-play.bezig { background: linear-gradient(135deg, var(--accent2), var(--accent4)); }
.ls-teller { font-size: 12.5px; color: var(--text-muted); }

.ls-prep { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 10px; text-align: center; }
.ls-prep-nr { font-size: 46px; font-weight: 800; color: var(--accent); line-height: 1;
  font-variant-numeric: tabular-nums; direction: ltr; }
.ls-prep div:last-child { font-size: 13.5px; color: var(--text-muted); }

.ls-tekst-btn { margin-top: 14px; width: 100%; background: transparent; border: 1px dashed var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm); padding: 10px; font-family: inherit;
  font-size: 13.5px; cursor: pointer; transition: var(--transition); }
.ls-tekst-btn:hover { border-color: var(--accent); color: var(--accent); }
.ls-transcript { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(128,128,160,0.10); max-height: 300px; overflow-y: auto; }
.ls-transcript p { direction: ltr; text-align: start; unicode-bidi: isolate; font-size: 14.5px;
  line-height: 1.9; color: var(--text-primary); margin-bottom: 9px; }
.ls-transcript p:last-child { margin-bottom: 0; }
.ls-transcript b { color: var(--accent); font-weight: 700; }

.ls-warn { background: rgba(247,151,30,0.10); border: 1px solid rgba(247,151,30,0.32);
  border-radius: var(--radius); padding: 15px 18px; margin-bottom: 20px; }
.ls-warn b { display: block; color: var(--accent4); margin-bottom: 5px; font-size: 14.5px; }
.ls-warn p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.85; }

@media (max-width: 900px) {
  .ls-split { grid-template-columns: 1fr; }
  .ls-speler { position: static; padding: 18px; }
  .ls-play { width: 100%; padding: 16px; }
  .ls-transcript { max-height: 240px; }
}

/* ─── EXAMENMODUS: volledig examen, antwoordblad, 0–800-schaal ─── */
.lz-sec-kop { font-size: 17px; font-weight: 800; color: var(--text-primary); margin: 26px 0 12px; }
.lz-vol { background: linear-gradient(135deg, rgba(102,126,234,0.14), rgba(118,75,162,0.12));
  border: 1px solid rgba(102,126,234,0.32); border-radius: var(--radius); padding: 18px 18px 16px; margin-bottom: 8px; }
.lz-vol-kop { display: flex; gap: 14px; align-items: flex-start; }
.lz-vol-ico { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.lz-vol-txt b { display: block; font-size: 16.5px; color: var(--text-primary); margin-bottom: 6px; }
.lz-vol-txt p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.85; margin: 0; }
.lz-vol-rij { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 14px; }
.lz-vol-best { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lz-vol-start { white-space: nowrap; }

.lz-examen-strook { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }

.lz-vlag { background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; font-family: inherit; }
.lz-vlag.on { border-color: rgba(255,145,71,0.55); color: #ffa45c; background: rgba(255,145,71,0.12); }

.lz-blad-wrap { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 90; }
.lz-blad { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; width: min(520px, 100%); max-height: 86vh; overflow-y: auto; }
.lz-blad-kop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lz-blad-kop h3 { margin: 0; font-size: 16px; color: var(--text-primary); }
.lz-blad-x { background: transparent; border: none; color: var(--text-muted); font-size: 17px; cursor: pointer; }
.lz-blad-legenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.lz-blad-legenda .lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-inline-end: 5px; vertical-align: -1px; border: 1px solid var(--border); }
.lz-blad-legenda .lg.ok::before { background: rgba(67,233,123,0.55); }
.lz-blad-legenda .lg.leeg::before { background: transparent; }
.lz-blad-legenda .lg.vlag::before { background: rgba(255,145,71,0.55); }
.lz-blad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; direction: ltr; }
.lz-blad-nr { height: 42px; border-radius: 9px; border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  font-variant-numeric: tabular-nums; }
.lz-blad-nr.ok { background: rgba(67,233,123,0.16); border-color: rgba(67,233,123,0.38); color: var(--text-primary); }
.lz-blad-nr.vlag { border-color: rgba(255,145,71,0.55); box-shadow: inset 0 0 0 1px rgba(255,145,71,0.3); }
.lz-blad-nr.nu { outline: 2px solid var(--accent); outline-offset: 1px; }
.lz-blad-sam { font-size: 12.5px; color: var(--text-muted); margin: 12px 0; text-align: center; }
.lz-blad-lever { width: 100%; }
.lz-blad-open { white-space: nowrap; }

.lz-bevestig { max-width: 620px; margin-inline: auto; text-align: center; }
.lz-bevestig h2 { font-size: 22px; color: var(--text-primary); margin-bottom: 6px; }
.lz-bev-lede { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.lz-bev-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.lz-bev-kpis > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; }
.lz-bev-kpis b { display: block; font-size: 19px; color: var(--text-primary); direction: ltr; unicode-bidi: isolate;
  font-variant-numeric: tabular-nums; }
.lz-bev-kpis span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.lz-bev-waarschuw { font-size: 13px; color: #ffa45c; background: rgba(255,145,71,0.10);
  border: 1px solid rgba(255,145,71,0.28); border-radius: 12px; padding: 11px 13px; margin-bottom: 16px; line-height: 1.8; }

.lz-score.sc-top { background: rgba(67,233,123,0.13); border-color: rgba(67,233,123,0.34); }
.lz-score.sc-bijna { background: rgba(255,145,71,0.11); border-color: rgba(255,145,71,0.30); }
.lz-schaal { margin: 16px auto 4px; max-width: 380px; }
.lz-schaal-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(128,128,160,0.24);
  direction: ltr; }
.lz-schaal-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.lz-schaal-grens { position: absolute; top: -4px; left: 62.5%; width: 2px; height: 20px; background: var(--text-primary); opacity: 0.7; }
.lz-schaal-nums { position: relative; display: block; height: 16px; margin-top: 7px; direction: ltr;
  font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lz-schaal-nums span { position: absolute; top: 0; }
.lz-schaal-nums span:nth-child(1) { left: 0; }
.lz-schaal-nums span:nth-child(2) { left: 62.5%; transform: translateX(-50%); font-weight: 700; color: var(--text-secondary); }
.lz-schaal-nums span:nth-child(3) { right: 0; }
.lz-score-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; line-height: 1.8; }

@media (max-width: 560px) {
  .lz-vol-rij { flex-direction: column; align-items: stretch; }
  .lz-vol-start { width: 100%; }
}

/* ─── S2-7 · mobiel: zijbalk botste met de zwevende onderbalk ──────────
   De herontworpen zijbalk kreeg `overflow:hidden` en liep tot 14px boven
   de onderrand — precies waar de onderbalk zweeft. Met dertien menu-items
   vielen de laatste items (الضبط, الوضع الليلي, het gebruikerskaartje)
   achter die balk en waren ze niet bereikbaar: niet scrollbaar, niet
   klikbaar. Hier stopt de zijbalk boven de onderbalk, scrollt hij zelf en
   ligt hij erbovenop. Alleen onder 768px; de desktopweergave blijft gelijk.
   Onderbalk: bottom 14px + veilige zone, hoogte 72px, plus 10px lucht. */
@media (max-width: 768px) {
  .sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 120;
    height: calc(100vh - 110px - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - 110px - env(safe-area-inset-bottom, 0px));
  }
  /* de overlay dimt ook de onderbalk zolang het menu open is */
  .sidebar-overlay { z-index: 110; }
  .sidebar-nav { padding-bottom: 4px; }
  .sidebar-bottom { padding-bottom: 16px; }
}
