/* ═══════════════════════════════════════════════════════════════
   Flow · Professional Design System
   Inspired by Duolingo / Coursera — Clean Light Mode
   Font: Plus Jakarta Sans (Display) + Inter (Body/Code)
═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@500;700;800;900&display=swap');

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

:root {
  /* ── Core Palette ── */
  --bg:       #F7F8FC;
  --white:    #FFFFFF;
  --surface:  #F0F2FA;
  --border:   #E5E8F4;
  --border2:  #CBD0E8;

  /* ── Text ── */
  --tx1: #111827;   /* headings */
  --tx2: #374151;   /* body */
  --tx3: #6B7280;   /* muted */
  --tx4: #9CA3AF;   /* placeholder */

  /* ── Brand Blue — primary action ── */
  --blue:    #4F46E5;
  --blue-h:  #4338CA;
  --blue-l:  #EEF2FF;
  --blue-d:  rgba(79,70,229,.12);

  /* ── Green — success / A1 ── */
  --green:   #22C55E;
  --green-h: #16A34A;
  --green-l: #F0FDF4;
  --green-d: rgba(34,197,94,.12);

  /* ── Orange — A2 / warning ── */
  --amber:   #F59E0B;
  --amber-l: #FFFBEB;
  --amber-d: rgba(245,158,11,.12);

  /* ── Red — B1 / error ── */
  --red:     #EF4444;
  --red-l:   #FEF2F2;

  /* ── Purple — B2 ── */
  --purple:  #8B5CF6;
  --purple-l:#F5F3FF;
  --purple-d:rgba(139,92,246,.12);

  /* ── Teal — listening ── */
  --teal:    #06B6D4;
  --teal-l:  #ECFEFF;

  /* ── Radius ── */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl:28px;
  --r-full:9999px;

  /* ── Shadows ── */
  --sh-xs: 0 1px 3px rgba(0,0,0,.06);
  --sh-sm: 0 2px 8px rgba(0,0,0,.07);
  --sh-md: 0 4px 16px rgba(0,0,0,.09);
  --sh-lg: 0 8px 32px rgba(0,0,0,.12);
  --sh-xl: 0 16px 48px rgba(0,0,0,.14);

  /* ── Typography ── */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Cairo', sans-serif;
  --font-ar:      'Tajawal', 'Cairo', sans-serif;
  --font-en:      'Inter', sans-serif;

  /* ── Topbar ── */
  --topbar-h: 68px;
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --topbar-zone-bg: rgba(248, 249, 253, 0.72);
  --topbar-action-bg: rgba(255, 255, 255, 0.94);

  /* ── Layout ── */
  --layout-max: 1440px;
  --layout-pad: 20px;

  color-scheme: light;
}

@media (prefers-reduced-motion: no-preference) {
  html.theme-changing,
  html.theme-changing *,
  html.theme-changing *::before,
  html.theme-changing *::after {
    transition-property: background-color, color, border-color, box-shadow, fill, stroke, opacity !important;
    transition-duration: .42s !important;
    transition-timing-function: ease !important;
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:       #0B0D12;
  --white:    #141824;
  --surface:  #1A2030;
  --border:   #2A3145;
  --border2:  #3A4460;

  --tx1: #F3F4F6;
  --tx2: #D1D5DB;
  --tx3: #9CA3AF;
  --tx4: #6B7280;

  --blue-l:  #1E1B4B;
  --blue-d:  rgba(99, 102, 241, 0.18);
  --green-l: #052E16;
  --amber-l: #451A03;
  --purple-l:#2E1065;
  --red-l:   #450A0A;
  --teal-l:  #083344;

  --sh-xs: 0 1px 3px rgba(0, 0, 0, 0.28);
  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.32);
  --sh-md: 0 4px 16px rgba(0, 0, 0, 0.36);
  --sh-lg: 0 8px 32px rgba(0, 0, 0, 0.42);
  --sh-xl: 0 16px 48px rgba(0, 0, 0, 0.48);

  --topbar-bg: rgba(11, 13, 18, 0.92);
  --topbar-zone-bg: rgba(26, 32, 48, 0.72);
  --topbar-action-bg: rgba(20, 24, 36, 0.96);
}

/* ════════════════════════ BASE ════════════════════════ */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--tx2);
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums tabular-nums;
}

.num, .num-en, [data-num] {
  font-family: var(--font-en);
  font-variant-numeric: lining-nums tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

button { font-family: var(--font-body); cursor: pointer; border: none; outline: none; background: none; }
input, textarea, select { font-family: var(--font-body); outline: none; }
a { color: inherit; text-decoration: none; }

.en  { font-family: var(--font-en); }
.ltr { direction: ltr; text-align: left; }

/* ════════════════════════ TOPBAR ════════════════════════ */
#topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 200;
  overflow: visible;
}

.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.05);
  overflow: visible;
}

.topbar-inner {
  height: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  overflow: visible;
}

.topbar-zone {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* ── Brand zone ── */
.topbar-brand-zone {
  flex-shrink: 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}
.topbar-logo:hover .logo-mark { transform: scale(1.04); }

.logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.32);
  transition: transform .18s ease;
}
.logo-mark span {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.logo-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--tx1);
  letter-spacing: -.4px;
  line-height: 1.1;
}
.logo-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx4);
  line-height: 1;
}

/* ── Nav zone ── */
.topbar-nav-zone {
  justify-content: center;
  padding: 0 2px;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topbar-nav-zone::-webkit-scrollbar { display: none; }
.topbar-nav-zone::before,
.topbar-nav-zone::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.topbar-nav-zone.is-scroll-start::before,
.topbar-nav-zone.is-scroll-end::after { opacity: 0; }
.topbar-nav-zone.is-scrollable::before {
  inset-inline-end: 0;
  background: linear-gradient(270deg, var(--topbar-bg) 20%, transparent 100%);
  opacity: 1;
}
.topbar-nav-zone.is-scrollable::after {
  inset-inline-start: 0;
  background: linear-gradient(90deg, var(--topbar-bg) 20%, transparent 100%);
  opacity: 1;
}

.topbar-nav-track {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  max-width: none;
  width: max-content;
  min-width: 100%;
  scroll-behavior: smooth;
}

.tnav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tx3);
  cursor: pointer;
  transition: color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
}
.tnav-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--white);
  transition: background .15s;
  flex-shrink: 0;
}
.tnav-label { line-height: 1; }
.tnav:hover { color: var(--tx1); background: var(--surface); }
.tnav.active {
  color: var(--blue);
  background: var(--blue-l);
  border-color: rgba(79, 70, 229, 0.16);
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.08);
}
.tnav.active .tnav-icon { background: rgba(79, 70, 229, 0.12); }

/* Nav groups (تعلّم · تمرين) */
.tnav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1;
}
.tnav-group.open { z-index: 320; }

.tnav-split {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.tnav-group:hover .tnav-split,
.tnav-group.open .tnav-split {
  background: var(--surface);
  border-color: var(--border);
}
.tnav-group.active .tnav-split {
  background: var(--blue-l);
  border-color: rgba(79, 70, 229, 0.18);
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.08);
}
.tnav-group.active.open .tnav-split {
  border-color: rgba(79, 70, 229, 0.28);
}

.tnav-group .tnav-parent {
  padding: 8px 4px 8px 14px;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
.tnav-group .tnav-parent:hover { background: transparent !important; color: var(--tx1); }
.tnav-group.active .tnav-parent,
.tnav-group.open .tnav-parent {
  color: var(--blue);
  background: transparent !important;
}

.tnav-drop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--tx4);
  cursor: pointer;
  border-radius: var(--r-full);
  transition: color .15s, background .15s;
  line-height: 0;
}
.tnav-drop-btn:hover {
  color: var(--blue);
  background: rgba(79, 70, 229, 0.08);
}
.tnav-group.active .tnav-drop-btn,
.tnav-group.open .tnav-drop-btn { color: var(--blue); }

.tnav-chevron { transition: transform .2s ease; flex-shrink: 0; }
.tnav-group.open .tnav-chevron,
.tnav-group:hover .tnav-chevron { transform: rotate(180deg); }

/* Dropdown panel */
.tnav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  inset-inline-start: auto;
  min-width: 272px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 20px 48px rgba(15, 23, 42, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top center;
  transition: opacity .2s ease, transform .22s cubic-bezier(.4, 0, .2, 1), visibility .2s;
  z-index: 400;
  overflow: hidden;
}
.tnav-group.open .tnav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.tnav-dropdown.is-fixed {
  position: fixed;
  inset-inline-end: auto;
  inset-inline-start: auto;
  top: auto;
  z-index: 500;
}
@media (hover: hover) and (pointer: fine) {
  .tnav-group:hover .tnav-dropdown:not(.is-fixed) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .tnav-group:hover .tnav-chevron { transform: rotate(180deg); }
}

.tnav-drop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--white) 100%);
}
.tnav-drop-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--blue-l);
  border: 1px solid rgba(79, 70, 229, 0.12);
  flex-shrink: 0;
}
.tnav-drop-head-copy { min-width: 0; }
.tnav-drop-head-title {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--tx1);
  line-height: 1.2;
}
.tnav-drop-head-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--tx4);
  margin-top: 3px;
  line-height: 1.4;
}

.tnav-drop-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  max-height: min(420px, 70vh);
  overflow-y: auto;
}

.tnav-sub {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tx2);
  text-decoration: none;
  transition: background .12s, color .12s, transform .12s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tnav-sub:hover {
  background: var(--surface);
  color: var(--tx1);
  transform: translateX(-2px);
}
.tnav-sub.active {
  background: var(--blue-l);
  color: var(--blue);
  border-color: rgba(79, 70, 229, 0.14);
}
.tnav-sub-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: color-mix(in srgb, var(--sub-accent, #6366F1) 12%, var(--white));
  border: 1px solid color-mix(in srgb, var(--sub-accent, #6366F1) 22%, transparent);
  flex-shrink: 0;
}
.tnav-sub-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}
.tnav-sub-label { line-height: 1.2; }
.tnav-sub-hint {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx4);
  line-height: 1.3;
  white-space: normal;
}
.tnav-sub.active .tnav-sub-hint { color: rgba(79, 70, 229, 0.65); }
.tnav-sub-go {
  font-size: 11px;
  color: var(--tx4);
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .12s, transform .12s;
  flex-shrink: 0;
}
.tnav-sub:hover .tnav-sub-go,
.tnav-sub.active .tnav-sub-go {
  opacity: 1;
  transform: translateX(0);
}

[data-theme="dark"] .tnav-dropdown {
  background: #1A2030;
  border-color: #3A4460;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .tnav-drop-head {
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, #1A2030 100%);
  border-color: #3A4460;
}
[data-theme="dark"] .tnav-group:hover .tnav-split,
[data-theme="dark"] .tnav-group.open .tnav-split {
  background: rgba(255, 255, 255, 0.04);
  border-color: #3A4460;
}
[data-theme="dark"] .tnav-group.active .tnav-split {
  background: rgba(79, 70, 229, 0.14);
  border-color: rgba(99, 102, 241, 0.28);
}
[data-theme="dark"] .tnav.active {
  background: rgba(79, 70, 229, 0.14);
  border-color: rgba(99, 102, 241, 0.24);
}

/* ── Actions zone ── */
.topbar-action-zone {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--tx2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.topbar-menu-btn:hover {
  background: var(--blue-l);
  border-color: rgba(79, 70, 229, .25);
  color: var(--blue);
}
.topbar-menu-btn[aria-expanded="true"] {
  background: var(--blue-l);
  border-color: var(--blue);
  color: var(--blue);
}

.topbar-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 200px;
  max-width: 248px;
}
.topbar-search-ico {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tx4);
  pointer-events: none;
  flex-shrink: 0;
}
.topbar-search {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 46px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 12.5px;
  font-family: var(--font-body);
  color: var(--tx1);
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search::placeholder { color: var(--tx4); opacity: .85; }
.topbar-search:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: 0 0 0 3px var(--blue-d);
}
.topbar-search-clear {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--tx4);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.topbar-search-wrap.has-value .topbar-search-clear { display: inline-flex; }
.topbar-search-wrap.has-value .topbar-search { padding-inline-end: 36px; }

[data-theme="dark"] .topbar-search { background: var(--white); }
[data-theme="dark"] .topbar-search:focus { border-color: rgba(99, 102, 241, 0.45); }

@media (max-width: 768px) {
  .topbar-search-wrap { display: none; }
}

.topbar-stats {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--white), var(--surface));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 11px;
  font-family: var(--font-en);
  background: transparent;
  border: none;
  box-shadow: none;
  transition: background .15s;
}
.stat-chip:hover { background: rgba(255, 255, 255, 0.72); }
.stat-chip + .stat-chip {
  border-inline-end: 1px solid var(--border);
  margin-inline-end: 2px;
  padding-inline-end: 14px;
}

.chip-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}
.chip-xp .chip-icon-wrap {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
.chip-streak .chip-icon-wrap {
  background: linear-gradient(135deg, #FFEDD5 0%, #FDBA74 100%);
  border: 1px solid rgba(234, 88, 12, 0.18);
}

.chip-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1;
}
.chip-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--tx1);
}
.chip-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx4);
  font-family: var(--font-en);
}
.chip-xp .chip-val { color: #92400E; }
.chip-streak .chip-val { color: #C2410C; }
[data-theme="dark"] .chip-xp .chip-val { color: #FCD34D; }
[data-theme="dark"] .chip-streak .chip-val { color: #FB923C; }
.stat-chip .chip-emoji { display: none; }

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

/* Theme switch */
.theme-switch {
  position: relative;
  flex-shrink: 0;
}

.theme-switch-hit {
  position: relative;
  width: 68px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: linear-gradient(180deg, var(--surface), var(--white));
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: border-color .2s, box-shadow .2s;
}
.theme-switch-hit:hover { border-color: var(--border2); box-shadow: var(--sh-xs); }
.theme-switch.is-animating .theme-switch-hit { box-shadow: 0 0 0 3px var(--blue-d); }

.theme-switch-bg {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--tx4);
  opacity: .55;
  transition: opacity .35s ease, color .35s ease, transform .46s cubic-bezier(.34, 1.35, .64, 1);
  pointer-events: none;
}
.theme-switch-bg .theme-ico { width: 100%; height: 100%; display: block; }
.theme-ico-sun { inset-inline-end: 10px; }
.theme-ico-moon { inset-inline-start: 10px; }
.theme-switch[data-active="light"] .theme-ico-sun { opacity: 0; transform: translateY(-50%) rotate(40deg) scale(.6); }
.theme-switch[data-active="dark"] .theme-ico-moon { opacity: 0; transform: translateY(-50%) rotate(-40deg) scale(.6); }

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, #fff 0%, #F8FAFF 100%);
  border: 1px solid rgba(79, 70, 229, 0.14);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18);
  transform: translateX(0) scale(1);
  transition: transform .46s cubic-bezier(.34, 1.45, .64, 1), background .35s ease, border-color .35s ease, box-shadow .35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform;
}
.theme-switch[data-active="dark"] .theme-switch-thumb {
  transform: translateX(32px) scale(1);
  background: linear-gradient(180deg, #1E2433 0%, #141824 100%);
  border-color: rgba(99, 102, 241, 0.32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}
.theme-switch.is-animating .theme-switch-thumb { transform: translateX(0) scale(1.08); }
.theme-switch[data-active="dark"].is-animating .theme-switch-thumb { transform: translateX(32px) scale(1.08); }

.theme-thumb-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F59E0B;
  transition: opacity .28s ease, transform .36s cubic-bezier(.4, 0, .2, 1);
}
.theme-thumb-face .theme-ico { width: 16px; height: 16px; }
.theme-thumb-moon { color: #A5B4FC; opacity: 0; transform: rotate(-70deg) scale(.4); }
.theme-switch[data-active="dark"] .theme-thumb-sun { opacity: 0; transform: rotate(70deg) scale(.4); }
.theme-switch[data-active="dark"] .theme-thumb-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-switch.is-animating .theme-thumb-sun,
.theme-switch.is-animating .theme-thumb-moon { animation: themeIconPop .42s ease; }

@keyframes themeIconPop {
  0% { transform: scale(.72) rotate(0); }
  55% { transform: scale(1.12) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.level-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-en);
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  align-items: center;
  box-shadow: var(--sh-xs);
}
.lp-a1 { background: linear-gradient(180deg, var(--green-l), rgba(220, 252, 231, 0.4)); color: var(--green-h); border: 1px solid rgba(34, 197, 94, 0.22); }
.lp-a2 { background: linear-gradient(180deg, var(--blue-l), rgba(224, 231, 255, 0.4)); color: var(--blue-h);  border: 1px solid rgba(79, 70, 229, 0.22); }
.lp-b1 { background: linear-gradient(180deg, var(--amber-l), rgba(254, 243, 199, 0.4)); color: #92400E;        border: 1px solid rgba(245, 158, 11, 0.22); }
.lp-b2 { background: linear-gradient(180deg, var(--purple-l), rgba(237, 233, 254, 0.4)); color: #6D28D9;        border: 1px solid rgba(139, 92, 246, 0.22); }
[data-theme="dark"] .lp-a1 { color: #86EFAC; }
[data-theme="dark"] .lp-a2 { color: #A5B4FC; }
[data-theme="dark"] .lp-b1 { color: #FCD34D; }
[data-theme="dark"] .lp-b2 { color: #C4B5FD; }
.lp-a1:hover,.lp-a2:hover,.lp-b1:hover,.lp-b2:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }

/* Account menu */
.account-menu { position: relative; }
.account-menu.open::before {
  content: '';
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 360px;
  z-index: 290;
}
.account-menu.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.account-menu.open .account-trigger {
  box-shadow: var(--sh-sm);
  border-color: rgba(79, 70, 229, 0.32);
  background: var(--blue-l);
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.account-trigger:hover { border-color: var(--border2); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-en);
  flex-shrink: 0;
}
.avatar.lg { width: 42px; height: 42px; font-size: 13px; }

.account-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.account-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--tx1);
  line-height: 1.1;
  white-space: nowrap;
}
.account-level {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx4);
  font-family: var(--font-en);
  line-height: 1;
}

.account-chevron {
  color: var(--tx4);
  transition: transform .18s ease;
  flex-shrink: 0;
}
.account-menu.open .account-chevron { transform: rotate(180deg); }

.account-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(79, 70, 229, 0.04);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transition: opacity .2s ease, transform .22s cubic-bezier(.4, 0, .2, 1), visibility .2s;
  z-index: 300;
  overflow: hidden;
}

.acct-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.acct-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #6366F1, #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  font-family: var(--font-en);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}
.acct-avatar.lp-ring-a1 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(34, 197, 94, 0.35); }
.acct-avatar.lp-ring-a2 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(99, 102, 241, 0.35); }
.acct-avatar.lp-ring-b1 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(245, 158, 11, 0.35); }
.acct-avatar.lp-ring-b2 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(168, 85, 247, 0.35); }

.acct-info { flex: 1; min-width: 0; }
.acct-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  justify-content: flex-end;
  text-align: end;
}
.acct-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--tx1);
  line-height: 1.2;
}
.acct-level {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-en);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.acct-level.lp-a1 { background: var(--green-l); color: var(--green-h); }
.acct-level.lp-a2 { background: var(--blue-l); color: var(--blue-h); }
.acct-level.lp-b1 { background: var(--amber-l); color: #B45309; }
.acct-level.lp-b2 { background: var(--purple-l); color: var(--purple); }

.acct-email {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx3);
  font-family: var(--font-en);
  direction: ltr;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-role {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--tx4);
  font-family: var(--font-en);
  margin-top: 2px;
  text-align: end;
}

.acct-profile-link {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: .15s;
}
.acct-profile-link svg { width: 16px; height: 16px; }
.acct-profile-link:hover {
  background: var(--blue-l);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--blue);
}

.acct-xp-card {
  margin: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--white) 100%);
  border: 1px solid var(--border);
}
.acct-xp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.acct-xp-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--tx2);
}
.acct-xp-val {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-en);
  color: var(--blue);
}
.acct-xp-track {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}
.acct-xp-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--blue), #818CF8);
  transition: width .35s ease;
}

.acct-metrics {
  display: flex;
  align-items: center;
}
.acct-metric {
  flex: 1;
  text-align: center;
}
.acct-metric-val {
  display: block;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 900;
  color: var(--tx1);
  line-height: 1.1;
}
.acct-metric-lbl {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--tx4);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.acct-metric-div {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.acct-nav {
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acct-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background .14s, transform .14s;
}
.acct-nav-item:hover {
  background: var(--surface);
  transform: translateX(-2px);
}
.acct-nav-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.acct-nav-ico svg { width: 18px; height: 18px; }
.acct-nav-ico.ico-blue { background: var(--blue-l); color: var(--blue); }
.acct-nav-ico.ico-purple { background: var(--purple-l); color: var(--purple); }
.acct-nav-ico.ico-green { background: var(--green-l); color: var(--green-h); }

.acct-nav-copy { flex: 1; min-width: 0; }
.acct-nav-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--tx1);
  line-height: 1.2;
}
.acct-nav-hint {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--tx4);
  margin-top: 2px;
}

.acct-footer {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.acct-footer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 11px;
  font-weight: 800;
  color: var(--tx2);
  font-family: var(--font-body);
  cursor: pointer;
  transition: .14s;
}
.acct-footer-btn:hover {
  border-color: var(--border2);
  color: var(--tx1);
  background: var(--surface);
}
.acct-footer-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.acct-footer-ico svg { width: 15px; height: 15px; }
.acct-footer-logout {
  color: #DC2626;
  border-color: rgba(239, 68, 68, 0.2);
  background: var(--red-l);
}
.acct-footer-logout:hover {
  background: #FEE2E2;
  border-color: rgba(239, 68, 68, 0.35);
  color: #B91C1C;
}

[data-theme="dark"] .account-dropdown {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.1);
}
[data-theme="dark"] .account-menu.open .account-trigger { background: var(--blue-l); }
[data-theme="dark"] .acct-xp-card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--white) 100%);
}
[data-theme="dark"] .acct-footer { background: rgba(0, 0, 0, 0.15); }
[data-theme="dark"] .acct-footer-logout { background: rgba(239, 68, 68, 0.1); }
[data-theme="dark"] .acct-footer-logout:hover { background: rgba(239, 68, 68, 0.18); }

.acct-footer-ico .theme-ico { width: 15px; height: 15px; }

/* ════════════════════════ HERO BANNER ════════════════════════ */
.hero-banner {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 45%, #4C1D95 100%);
  color: #fff;
  padding: 48px 40px 56px;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-banner::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.18) 0%, transparent 70%);
  top: -200px; left: -100px;
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto;
}
.hero-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: .5; margin-bottom: 10px;
  font-family: var(--font-en);
}
.hero-title {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 900;
  letter-spacing: -.6px; line-height: 1.15;
  margin-bottom: 10px;
}
.hero-sub { font-size: 16px; opacity: .65; margin-bottom: 32px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════ CONTENT ════════════════════════ */
.main {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 32px var(--layout-pad);
  width: 100%;
}

.page-title {
  font-family: var(--font-ar);
  font-size: 24px; font-weight: 800;
  color: var(--tx1); letter-spacing: 0;
  line-height: 1.45;
  margin-bottom: 4px;
}
.page-sub { font-size: 14px; color: var(--tx3); margin-bottom: 24px; line-height: 1.6; }

/* ════════════════════════ CARDS ════════════════════════ */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--sh-xs);
}
.card:hover { box-shadow: var(--sh-sm); }

/* ════════════════════════ BUTTONS ════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all .15s;
  border: none;
  white-space: nowrap;
}
.btn svg, .btn span.icon { font-size: 16px; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.28);
}
.btn-primary:hover {
  background: var(--blue-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,70,229,.38);
}
.btn-primary:active { transform: translateY(0); }

.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,.25);
}
.btn-green:hover { background: var(--green-h); transform: translateY(-1px); }

.btn-ghost {
  background: var(--white);
  color: var(--tx2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border2); color: var(--tx1); }

.btn-sm  { padding: 7px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg  { padding: 14px 28px; font-size: 15px; border-radius: var(--r-lg); }
.btn-xl  { padding: 16px 36px; font-size: 16px; border-radius: var(--r-xl); }
.btn-full { width: 100%; justify-content: center; }

/* Hero Button */
.btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: var(--r-lg);
  font-size: 15px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: .15s;
}
.btn-hero-outline {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.28);
  color: #fff;
}
.btn-hero-outline:hover { background: rgba(255,255,255,.2); }
.btn-hero-solid {
  background: #fff;
  color: var(--blue);
  border: 1.5px solid transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.btn-hero-solid:hover { background: #F5F3FF; transform: translateY(-1px); }

/* ════════════════════════ LEVEL BADGES ════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  font-size: 11px; font-weight: 700;
  font-family: var(--font-en);
  letter-spacing: .04em;
}
.badge-a1 { background: var(--green-l);  color: var(--green-h); }
.badge-a2 { background: var(--blue-l);   color: var(--blue-h);  }
.badge-b1 { background: var(--amber-l);  color: #92400E;        }
.badge-b2 { background: var(--purple-l); color: #6D28D9;        }

/* ════════════════════════ TABS ════════════════════════ */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tab {
  padding: 8px 18px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  color: var(--tx3);
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.tab:hover  { color: var(--blue); border-color: var(--blue); background: var(--blue-l); }
.tab.active { color: var(--blue); border-color: var(--blue); background: var(--blue-l); font-weight: 700; }

/* ════════════════════════ FILTER PILLS ════════════════════════ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.fpill {
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--tx3);
  cursor: pointer;
  transition: .15s;
}
.fpill:hover  { border-color: var(--blue); color: var(--blue); }
.fpill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ════════════════════════ QUIZ OPTION BUTTON ════════════════════════ */
.opt-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: .15s;
  font-size: 15px; font-weight: 500;
  font-family: var(--font-body);
  text-align: right;
}
.opt-btn:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-l);
}
.opt-btn.correct {
  border-color: var(--green);
  background: var(--green-l);
  color: var(--green-h);
}
.opt-btn.wrong {
  border-color: var(--red);
  background: var(--red-l);
  color: var(--red);
}
.opt-letter {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  font-family: var(--font-en);
  flex-shrink: 0;
  transition: .15s;
}
.opt-btn.correct .opt-letter { background: var(--green);  color: #fff; }
.opt-btn.wrong   .opt-letter { background: var(--red);    color: #fff; }
.opt-btn:hover:not(:disabled) .opt-letter { background: var(--blue); color: #fff; }

/* ════════════════════════ PROGRESS ════════════════════════ */
.prog-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width .6s ease;
}

/* ════════════════════════ SEARCH ════════════════════════ */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  transition: .15s;
}
.search-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-d); }
.search-wrap input {
  border: none; background: none;
  font-size: 14px; color: var(--tx1); flex: 1; min-width: 0;
}
.search-wrap input::placeholder { color: var(--tx4); }
.search-icon { color: var(--tx4); font-size: 16px; flex-shrink: 0; }

/* ════════════════════════ WAVE BARS ════════════════════════ */
.wave-bars { display: flex; align-items: center; gap: 3px; height: 36px; }
.wb { width: 3px; border-radius: 2px; background: var(--blue); opacity: .25; transition: opacity .3s; }
.wb.playing { opacity: 1; animation: wba .65s ease-in-out infinite alternate; }
@keyframes wba { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ════════════════════════ MIC BUTTON ════════════════════════ */
.mic-btn {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: .15s;
  box-shadow: 0 4px 16px rgba(79,70,229,.35);
}
.mic-btn:hover { transform: scale(1.06); }
.mic-btn.recording {
  background: var(--red);
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
  animation: pulse-mic 1.4s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%,100% { box-shadow: 0 0 0 0   rgba(239,68,68,.4); }
  50%      { box-shadow: 0 0 0 18px rgba(239,68,68,0); }
}

/* ════════════════════════ TOAST ════════════════════════ */

/* ════════════════════════ TOOLTIP (vocab) ════════════════════════ */
.vtip {
  position: fixed; z-index: 500;
  background: #1E1B4B;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
  min-width: 180px;
  box-shadow: var(--sh-xl);
  border: 1px solid rgba(255,255,255,.08);
}
.vtip.open { opacity: 1; }

/* ════════════════════════ DIVIDERS ════════════════════════ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}
.sh-title { font-size: 15px; font-weight: 800; color: var(--tx1); }
.sh-action { font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }

/* ════════════════════════ EMPTY STATE ════════════════════════ */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--tx3);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--tx2); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; }

/* ════════════════════════ RESPONSIVE ════════════════════════ */
@media (max-width: 1320px) {
  .topbar-inner { gap: 14px; }
  .tnav { padding: 7px 11px; font-size: 12px; gap: 6px; }
  .tnav-icon { width: 20px; height: 20px; font-size: 11px; }
}

@media (max-width: 1200px) {
  .topbar-inner { gap: 10px; }
  .tnav-group .tnav-parent { padding: 8px 4px 8px 10px; }
  .tnav { padding: 8px 10px; }
  .tnav-drop-btn { width: 24px; height: 24px; margin: 0 2px; }
}

@media (max-width: 1100px) {
  .topbar-inner { gap: 8px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .account-meta, .account-chevron { display: none; }
  .account-trigger { padding: 4px; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .logo-text { font-size: 15px; }
}

@media (max-width: 1024px) {
  .topbar-nav-zone { display: none !important; }
  .topbar-menu-btn { display: inline-flex; }
  .mobile-nav { display: block; }
  .main { padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  .home-main { padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 900px) {
  .hero-banner { padding: 32px 20px 40px; }
  .hero-title  { font-size: 26px; }
  .main        { padding: 20px 16px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding: 0 12px; gap: 8px; }
  .logo-sub { display: none; }
  .topbar-divider { display: none; }
  .topbar-brand-zone, .topbar-action-zone { padding: 0; border: none; background: transparent; box-shadow: none; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 22px; }
  .main { padding: 16px 14px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding: 0 10px; }
  .logo-text { font-size: 14px; }
  .logo-mark { width: 32px; height: 32px; }
  .topbar-menu-btn { width: 36px; height: 36px; border-radius: 10px; }
  .theme-switch-hit { width: 58px; height: 34px; }
  .avatar { width: 32px; height: 32px; font-size: 11px; }
}

/* ══ MOBILE BOTTOM NAV — Redesigned ══════════════════════ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.mobile-nav-inner {
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 0 4px;
}

/* Tab item */
.mn-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  padding: 10px 4px 8px;
  cursor: pointer; transition: .15s;
  text-decoration: none; color: var(--tx4);
  border: none; background: none; font-family: var(--font-body);
  position: relative; min-width: 0;
  -webkit-appearance: none;
}
.mn-tab.active { color: var(--tab-accent, var(--blue)); }
.mn-tab-ico { font-size: 20px; line-height: 1; transition: transform .2s; }
.mn-tab.active .mn-tab-ico { transform: scale(1.1); }
.mn-tab-lbl {
  font-size: 10px; font-weight: 700;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 68px;
  transition: color .15s;
}
/* Active indicator dot */
.mn-tab-dot {
  position: absolute; top: 6px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--tab-accent, var(--blue));
  animation: dotPop .2s ease;
}
@keyframes dotPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* More button dots icon */
.mn-more-dots {
  display: flex; gap: 3px; align-items: center;
}
.mn-more-dots span {
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; display: block;
}

/* ── More Sheet ── */
.mobile-more-sheet {
  position: fixed; inset: 0; z-index: 160; pointer-events: none;
}
.mobile-more-sheet.is-open { pointer-events: auto; }
.mobile-more-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 8, 30, .5);
  opacity: 0; transition: opacity .3s;
  backdrop-filter: blur(2px);
}
.mobile-more-sheet.is-open .mobile-more-backdrop { opacity: 1; }

.mobile-more-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.32,0,.18,1);
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 40px rgba(0,0,0,.12);
  max-height: 90vh; overflow-y: auto;
}
.mobile-more-sheet.is-open .mobile-more-panel { transform: translateY(0); }

/* Handle */
.mmp-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border2); margin: 12px auto 0;
}

/* User info row */
.mmp-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.mmp-avatar {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #fff; font-family: var(--font-en);
}
.mmp-user-info { flex: 1; min-width: 0; }
.mmp-user-name { font-size: 15px; font-weight: 900; color: var(--tx1); margin-bottom: 2px; }
.mmp-user-sub  { font-size: 11px; color: var(--tx3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmp-profile-btn {
  font-size: 12px; font-weight: 800; color: var(--blue);
  text-decoration: none; padding: 7px 14px;
  border-radius: 12px; background: var(--blue-l);
  border: 1px solid rgba(79,70,229,.15);
  white-space: nowrap; flex-shrink: 0; transition: .14s;
}
.mmp-profile-btn:hover { background: var(--blue); color: #fff; }

/* Grid label */
.mmp-grid-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--tx3);
  padding: 0 20px; margin-bottom: 12px;
}
.mmp-section-label {
  font-size: 11px; font-weight: 800; color: var(--tx2);
  padding: 14px 20px 8px;
  margin-top: 4px;
}
.mmp-section-label:first-of-type { margin-top: 0; }

/* More grid */
.mobile-more-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 0 16px 6px;
}
.mobile-more-link {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-decoration: none; color: var(--tx2);
  transition: .15s;
}
.mobile-more-link.active,
.mobile-more-link:hover {
  border-color: rgba(79,70,229,.3);
  background: var(--blue-l); color: var(--blue);
}
.mobile-more-icon { font-size: 24px; line-height: 1; }
@media (max-width: 1024px) {
  .mobile-more-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .mobile-more-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 12px; }
  .mobile-more-link { padding: 12px 4px; }
  .mobile-more-icon { font-size: 22px; }
  .mobile-more-label { font-size: 10px; }
}
.mobile-more-head { display: none; } /* removed in new design */
.mobile-more-close { display: none; }
body.mobile-more-open { overflow: hidden; }

/* (mobile nav visibility — see RESPONSIVE @1024px) */

.topbar-stats {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--white), var(--surface));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 11px;
  font-family: var(--font-en);
  background: transparent;
  border: none;
  box-shadow: none;
  transition: background .15s;
}
.stat-chip:hover { background: rgba(255, 255, 255, 0.72); }
.stat-chip + .stat-chip {
  border-inline-end: 1px solid var(--border);
  margin-inline-end: 2px;
  padding-inline-end: 14px;
}

.chip-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}
.chip-xp .chip-icon-wrap {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
.chip-streak .chip-icon-wrap {
  background: linear-gradient(135deg, #FFEDD5 0%, #FDBA74 100%);
  border: 1px solid rgba(234, 88, 12, 0.18);
}

.chip-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1;
}
.chip-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--tx1);
}
.chip-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx4);
  font-family: var(--font-en);
}
.chip-xp .chip-val { color: #92400E; }
.chip-streak .chip-val { color: #C2410C; }
[data-theme="dark"] .chip-xp .chip-val { color: #FCD34D; }
[data-theme="dark"] .chip-streak .chip-val { color: #FB923C; }
.stat-chip .chip-emoji { display: none; }

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

/* Theme switch */
.theme-switch {
  position: relative;
  flex-shrink: 0;
}

.theme-switch-hit {
  position: relative;
  width: 68px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: linear-gradient(180deg, var(--surface), var(--white));
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: border-color .2s, box-shadow .2s;
}
.theme-switch-hit:hover { border-color: var(--border2); box-shadow: var(--sh-xs); }
.theme-switch.is-animating .theme-switch-hit { box-shadow: 0 0 0 3px var(--blue-d); }

.theme-switch-bg {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--tx4);
  opacity: .55;
  transition: opacity .35s ease, color .35s ease, transform .46s cubic-bezier(.34, 1.35, .64, 1);
  pointer-events: none;
}
.theme-switch-bg .theme-ico { width: 100%; height: 100%; display: block; }
.theme-ico-sun { inset-inline-end: 10px; }
.theme-ico-moon { inset-inline-start: 10px; }
.theme-switch[data-active="light"] .theme-ico-sun { opacity: 0; transform: translateY(-50%) rotate(40deg) scale(.6); }
.theme-switch[data-active="dark"] .theme-ico-moon { opacity: 0; transform: translateY(-50%) rotate(-40deg) scale(.6); }

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, #fff 0%, #F8FAFF 100%);
  border: 1px solid rgba(79, 70, 229, 0.14);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18);
  transform: translateX(0) scale(1);
  transition: transform .46s cubic-bezier(.34, 1.45, .64, 1), background .35s ease, border-color .35s ease, box-shadow .35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform;
}
.theme-switch[data-active="dark"] .theme-switch-thumb {
  transform: translateX(32px) scale(1);
  background: linear-gradient(180deg, #1E2433 0%, #141824 100%);
  border-color: rgba(99, 102, 241, 0.32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}
.theme-switch.is-animating .theme-switch-thumb { transform: translateX(0) scale(1.08); }
.theme-switch[data-active="dark"].is-animating .theme-switch-thumb { transform: translateX(32px) scale(1.08); }

.theme-thumb-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F59E0B;
  transition: opacity .28s ease, transform .36s cubic-bezier(.4, 0, .2, 1);
}
.theme-thumb-face .theme-ico { width: 16px; height: 16px; }
.theme-thumb-moon { color: #A5B4FC; opacity: 0; transform: rotate(-70deg) scale(.4); }
.theme-switch[data-active="dark"] .theme-thumb-sun { opacity: 0; transform: rotate(70deg) scale(.4); }
.theme-switch[data-active="dark"] .theme-thumb-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-switch.is-animating .theme-thumb-sun,
.theme-switch.is-animating .theme-thumb-moon { animation: themeIconPop .42s ease; }

@keyframes themeIconPop {
  0% { transform: scale(.72) rotate(0); }
  55% { transform: scale(1.12) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.level-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-en);
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  align-items: center;
  box-shadow: var(--sh-xs);
}
.lp-a1 { background: linear-gradient(180deg, var(--green-l), rgba(220, 252, 231, 0.4)); color: var(--green-h); border: 1px solid rgba(34, 197, 94, 0.22); }
.lp-a2 { background: linear-gradient(180deg, var(--blue-l), rgba(224, 231, 255, 0.4)); color: var(--blue-h);  border: 1px solid rgba(79, 70, 229, 0.22); }
.lp-b1 { background: linear-gradient(180deg, var(--amber-l), rgba(254, 243, 199, 0.4)); color: #92400E;        border: 1px solid rgba(245, 158, 11, 0.22); }
.lp-b2 { background: linear-gradient(180deg, var(--purple-l), rgba(237, 233, 254, 0.4)); color: #6D28D9;        border: 1px solid rgba(139, 92, 246, 0.22); }
[data-theme="dark"] .lp-a1 { color: #86EFAC; }
[data-theme="dark"] .lp-a2 { color: #A5B4FC; }
[data-theme="dark"] .lp-b1 { color: #FCD34D; }
[data-theme="dark"] .lp-b2 { color: #C4B5FD; }
.lp-a1:hover,.lp-a2:hover,.lp-b1:hover,.lp-b2:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }

/* Account menu */
.account-menu { position: relative; }
.account-menu.open::before {
  content: '';
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 360px;
  z-index: 290;
}
.account-menu.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.account-menu.open .account-trigger {
  box-shadow: var(--sh-sm);
  border-color: rgba(79, 70, 229, 0.32);
  background: var(--blue-l);
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.account-trigger:hover { border-color: var(--border2); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-en);
  flex-shrink: 0;
}
.avatar.lg { width: 42px; height: 42px; font-size: 13px; }

.account-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.account-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--tx1);
  line-height: 1.1;
  white-space: nowrap;
}
.account-level {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx4);
  font-family: var(--font-en);
  line-height: 1;
}

.account-chevron {
  color: var(--tx4);
  transition: transform .18s ease;
  flex-shrink: 0;
}
.account-menu.open .account-chevron { transform: rotate(180deg); }

.account-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(79, 70, 229, 0.04);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transition: opacity .2s ease, transform .22s cubic-bezier(.4, 0, .2, 1), visibility .2s;
  z-index: 300;
  overflow: hidden;
}

.acct-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.acct-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #6366F1, #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  font-family: var(--font-en);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}
.acct-avatar.lp-ring-a1 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(34, 197, 94, 0.35); }
.acct-avatar.lp-ring-a2 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(99, 102, 241, 0.35); }
.acct-avatar.lp-ring-b1 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(245, 158, 11, 0.35); }
.acct-avatar.lp-ring-b2 { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px rgba(168, 85, 247, 0.35); }

.acct-info { flex: 1; min-width: 0; }
.acct-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  justify-content: flex-end;
  text-align: end;
}
.acct-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--tx1);
  line-height: 1.2;
}
.acct-level {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-en);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.acct-level.lp-a1 { background: var(--green-l); color: var(--green-h); }
.acct-level.lp-a2 { background: var(--blue-l); color: var(--blue-h); }
.acct-level.lp-b1 { background: var(--amber-l); color: #B45309; }
.acct-level.lp-b2 { background: var(--purple-l); color: var(--purple); }

.acct-email {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx3);
  font-family: var(--font-en);
  direction: ltr;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-role {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--tx4);
  font-family: var(--font-en);
  margin-top: 2px;
  text-align: end;
}

.acct-profile-link {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: .15s;
}
.acct-profile-link svg { width: 16px; height: 16px; }
.acct-profile-link:hover {
  background: var(--blue-l);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--blue);
}

.acct-xp-card {
  margin: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--white) 100%);
  border: 1px solid var(--border);
}
.acct-xp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.acct-xp-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--tx2);
}
.acct-xp-val {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-en);
  color: var(--blue);
}
.acct-xp-track {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}
.acct-xp-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--blue), #818CF8);
  transition: width .35s ease;
}

.acct-metrics {
  display: flex;
  align-items: center;
}
.acct-metric {
  flex: 1;
  text-align: center;
}
.acct-metric-val {
  display: block;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 900;
  color: var(--tx1);
  line-height: 1.1;
}
.acct-metric-lbl {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--tx4);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.acct-metric-div {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.acct-nav {
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acct-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background .14s, transform .14s;
}
.acct-nav-item:hover {
  background: var(--surface);
  transform: translateX(-2px);
}
.acct-nav-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.acct-nav-ico svg { width: 18px; height: 18px; }
.acct-nav-ico.ico-blue { background: var(--blue-l); color: var(--blue); }
.acct-nav-ico.ico-purple { background: var(--purple-l); color: var(--purple); }
.acct-nav-ico.ico-green { background: var(--green-l); color: var(--green-h); }

.acct-nav-copy { flex: 1; min-width: 0; }
.acct-nav-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--tx1);
  line-height: 1.2;
}
.acct-nav-hint {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--tx4);
  margin-top: 2px;
}

.acct-footer {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.acct-footer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 11px;
  font-weight: 800;
  color: var(--tx2);
  font-family: var(--font-body);
  cursor: pointer;
  transition: .14s;
}
.acct-footer-btn:hover {
  border-color: var(--border2);
  color: var(--tx1);
  background: var(--surface);
}
.acct-footer-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.acct-footer-ico svg { width: 15px; height: 15px; }
.acct-footer-logout {
  color: #DC2626;
  border-color: rgba(239, 68, 68, 0.2);
  background: var(--red-l);
}
.acct-footer-logout:hover {
  background: #FEE2E2;
  border-color: rgba(239, 68, 68, 0.35);
  color: #B91C1C;
}

[data-theme="dark"] .account-dropdown {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.1);
}
[data-theme="dark"] .account-menu.open .account-trigger { background: var(--blue-l); }
[data-theme="dark"] .acct-xp-card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--white) 100%);
}
[data-theme="dark"] .acct-footer { background: rgba(0, 0, 0, 0.15); }
[data-theme="dark"] .acct-footer-logout { background: rgba(239, 68, 68, 0.1); }
[data-theme="dark"] .acct-footer-logout:hover { background: rgba(239, 68, 68, 0.18); }

.acct-footer-ico .theme-ico { width: 15px; height: 15px; }

/* ════════════════════════ HERO BANNER ════════════════════════ */
.hero-banner {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 45%, #4C1D95 100%);
  color: #fff;
  padding: 48px 40px 56px;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-banner::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.18) 0%, transparent 70%);
  top: -200px; left: -100px;
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto;
}
.hero-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: .5; margin-bottom: 10px;
  font-family: var(--font-en);
}
.hero-title {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 900;
  letter-spacing: -.6px; line-height: 1.15;
  margin-bottom: 10px;
}
.hero-sub { font-size: 16px; opacity: .65; margin-bottom: 32px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════ CONTENT ════════════════════════ */
.main {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 32px var(--layout-pad);
  width: 100%;
}

.page-title {
  font-family: var(--font-ar);
  font-size: 24px; font-weight: 800;
  color: var(--tx1); letter-spacing: 0;
  line-height: 1.45;
  margin-bottom: 4px;
}
.page-sub { font-size: 14px; color: var(--tx3); margin-bottom: 24px; line-height: 1.6; }

/* ════════════════════════ CARDS ════════════════════════ */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--sh-xs);
}
.card:hover { box-shadow: var(--sh-sm); }

/* ════════════════════════ BUTTONS ════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all .15s;
  border: none;
  white-space: nowrap;
}
.btn svg, .btn span.icon { font-size: 16px; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.28);
}
.btn-primary:hover {
  background: var(--blue-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,70,229,.38);
}
.btn-primary:active { transform: translateY(0); }

.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,.25);
}
.btn-green:hover { background: var(--green-h); transform: translateY(-1px); }

.btn-ghost {
  background: var(--white);
  color: var(--tx2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border2); color: var(--tx1); }

.btn-sm  { padding: 7px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg  { padding: 14px 28px; font-size: 15px; border-radius: var(--r-lg); }
.btn-xl  { padding: 16px 36px; font-size: 16px; border-radius: var(--r-xl); }
.btn-full { width: 100%; justify-content: center; }

/* Hero Button */
.btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: var(--r-lg);
  font-size: 15px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: .15s;
}
.btn-hero-outline {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.28);
  color: #fff;
}
.btn-hero-outline:hover { background: rgba(255,255,255,.2); }
.btn-hero-solid {
  background: #fff;
  color: var(--blue);
  border: 1.5px solid transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.btn-hero-solid:hover { background: #F5F3FF; transform: translateY(-1px); }

/* ════════════════════════ LEVEL BADGES ════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  font-size: 11px; font-weight: 700;
  font-family: var(--font-en);
  letter-spacing: .04em;
}
.badge-a1 { background: var(--green-l);  color: var(--green-h); }
.badge-a2 { background: var(--blue-l);   color: var(--blue-h);  }
.badge-b1 { background: var(--amber-l);  color: #92400E;        }
.badge-b2 { background: var(--purple-l); color: #6D28D9;        }

/* ════════════════════════ TABS ════════════════════════ */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tab {
  padding: 8px 18px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  color: var(--tx3);
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.tab:hover  { color: var(--blue); border-color: var(--blue); background: var(--blue-l); }
.tab.active { color: var(--blue); border-color: var(--blue); background: var(--blue-l); font-weight: 700; }

/* ════════════════════════ FILTER PILLS ════════════════════════ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.fpill {
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--tx3);
  cursor: pointer;
  transition: .15s;
}
.fpill:hover  { border-color: var(--blue); color: var(--blue); }
.fpill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ════════════════════════ QUIZ OPTION BUTTON ════════════════════════ */
.opt-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: .15s;
  font-size: 15px; font-weight: 500;
  font-family: var(--font-body);
  text-align: right;
}
.opt-btn:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-l);
}
.opt-btn.correct {
  border-color: var(--green);
  background: var(--green-l);
  color: var(--green-h);
}
.opt-btn.wrong {
  border-color: var(--red);
  background: var(--red-l);
  color: var(--red);
}
.opt-letter {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  font-family: var(--font-en);
  flex-shrink: 0;
  transition: .15s;
}
.opt-btn.correct .opt-letter { background: var(--green);  color: #fff; }
.opt-btn.wrong   .opt-letter { background: var(--red);    color: #fff; }
.opt-btn:hover:not(:disabled) .opt-letter { background: var(--blue); color: #fff; }

/* ════════════════════════ PROGRESS ════════════════════════ */
.prog-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width .6s ease;
}

/* ════════════════════════ SEARCH ════════════════════════ */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  transition: .15s;
}
.search-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-d); }
.search-wrap input {
  border: none; background: none;
  font-size: 14px; color: var(--tx1); flex: 1; min-width: 0;
}
.search-wrap input::placeholder { color: var(--tx4); }
.search-icon { color: var(--tx4); font-size: 16px; flex-shrink: 0; }

/* ════════════════════════ WAVE BARS ════════════════════════ */
.wave-bars { display: flex; align-items: center; gap: 3px; height: 36px; }
.wb { width: 3px; border-radius: 2px; background: var(--blue); opacity: .25; transition: opacity .3s; }
.wb.playing { opacity: 1; animation: wba .65s ease-in-out infinite alternate; }
@keyframes wba { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ════════════════════════ MIC BUTTON ════════════════════════ */
.mic-btn {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: .15s;
  box-shadow: 0 4px 16px rgba(79,70,229,.35);
}
.mic-btn:hover { transform: scale(1.06); }
.mic-btn.recording {
  background: var(--red);
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
  animation: pulse-mic 1.4s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%,100% { box-shadow: 0 0 0 0   rgba(239,68,68,.4); }
  50%      { box-shadow: 0 0 0 18px rgba(239,68,68,0); }
}

/* ════════════════════════ TOAST ════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--tx1);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--r-lg);
  font-size: 14px; font-weight: 600;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  box-shadow: var(--sh-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--green-h); }
.toast.error   { background: var(--red); }

/* ════════════════════════ TOOLTIP (vocab) ════════════════════════ */
.vtip {
  position: fixed; z-index: 500;
  background: #1E1B4B;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
  min-width: 180px;
  box-shadow: var(--sh-xl);
  border: 1px solid rgba(255,255,255,.08);
}
.vtip.open { opacity: 1; }

/* ════════════════════════ DIVIDERS ════════════════════════ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}
.sh-title { font-size: 15px; font-weight: 800; color: var(--tx1); }
.sh-action { font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }

/* ════════════════════════ EMPTY STATE ════════════════════════ */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--tx3);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--tx2); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; }

/* ══ MOBILE BOTTOM NAV (global) ══════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--white); border-top: 1.5px solid var(--border);
  padding: 0 4px calc(6px + env(safe-area-inset-bottom));
}
.mobile-nav-inner {
  display: flex; justify-content: space-around; align-items: stretch;
}
.mn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 8px 2px 4px; gap: 3px;
  cursor: pointer; transition: .15s; text-decoration: none;
  color: var(--tx4); border-radius: var(--r-md); min-width: 0;
}
.mn-item:hover, .mn-item.active { color: var(--blue); }
.mn-item.active { background: var(--blue-l); }
.mn-icon  { font-size: 19px; line-height: 1; }
.mn-label { font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.mn-more-btn {
  border: none;
  background: none;
  font-family: var(--font-body);
  appearance: none;
  -webkit-appearance: none;
}
.mn-more-btn .mn-icon { font-size: 22px; letter-spacing: -2px; }

.mobile-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 160;
  pointer-events: none;
}
.mobile-more-sheet.is-open { pointer-events: auto; }
.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity .25s;
}
.mobile-more-sheet.is-open .mobile-more-backdrop { opacity: 1; }
.mobile-more-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(68px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}
.mobile-more-sheet.is-open .mobile-more-panel { transform: translateY(0); }
.mobile-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 800;
  font-size: 15px;
  color: var(--tx1);
}
.mobile-more-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx2);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mobile-more-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--tx2);
  transition: border-color .15s, background .15s, color .15s;
}
.mobile-more-link.active,
.mobile-more-link:hover {
  border-color: rgba(79, 70, 229, 0.35);
  background: var(--blue-l);
  color: var(--blue);
}
.mobile-more-icon { font-size: 22px; line-height: 1; }
.mobile-more-label { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.25; }
body.mobile-more-open { overflow: hidden; }

/* (topbar + mobile nav — see RESPONSIVE @1024px above) */

/* ══════════════════════════════════════════════════════
   FLOW v17 — MOBILE LAYER + VOCAB FIXES
══════════════════════════════════════════════════════ */

/* Z-Index hierarchy */
.mobile-nav         { z-index: 400 !important; }
.mobile-more-sheet  { z-index: 450 !important; }
#sw-overlay         { z-index: 9500 !important; }
#ob-overlay         { z-index: 9200 !important; }
#__ach-toast        { z-index: 9700 !important; }
.toast              { z-index: 9800 !important; }

/* main content: always clears mobile nav */
@media (max-width: 900px) {
  body { overflow-x: hidden !important; }
  .main { padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
}

/* ── Onboarding card on mobile ── */
@media (max-width: 767px) {
  #ob-card {
    position: fixed !important;
    left: 12px !important; right: 12px !important;
    bottom: calc(72px + env(safe-area-inset-bottom,0px)) !important;
    top: auto !important; width: auto !important;
    max-height: calc(70vh - 80px); overflow-y: auto;
  }
}

/* ── Setup wizard mobile ── */
@media (max-width: 600px) {
  #sw-overlay { overflow-y: auto !important; align-items: flex-start !important; padding: 20px 0 !important; }
}

/* ══ VOCABULARY WORD CARDS — MOBILE FIX ══ */
@media (max-width: 600px) {
  #words-container { display: flex !important; flex-direction: column !important; }
  .word-card { border-radius: 14px !important; margin-bottom: 8px !important; overflow: hidden !important; display: block !important; }
  .wc-header { display: flex !important; align-items: center !important; gap: 12px !important; padding: 14px 12px !important; min-height: 64px !important; cursor: pointer !important; }
  .wc-play-word { width: 42px !important; height: 42px !important; min-width: 42px !important; border-radius: 12px !important; font-size: 16px !important; flex-shrink: 0 !important; }
  .wc-info { flex: 1 1 auto !important; min-width: 0 !important; }
  .wc-en { font-size: 16px !important; font-weight: 800 !important; display: block !important; }
  .wc-ar-sub { font-size: 13px !important; color: var(--tx3) !important; display: block !important; }
  .wc-btns { display: flex !important; align-items: center !important; gap: 4px !important; flex-shrink: 0 !important; }
  .wc-icon-btn { width: 32px !important; height: 32px !important; border-radius: 8px !important; }
  .wc-chevron { width: 28px !important; height: 28px !important; }
  #words-section { width: 100% !important; min-width: 0 !important; }
  .wt-filters { display: flex !important; background: var(--surface) !important; border-radius: 10px !important; padding: 3px !important; gap: 2px !important; }
  .wt-filters .fpill { flex: 1 !important; text-align: center !important; padding: 8px 4px !important; font-size: 11px !important; }
  .wt-actions { display: flex !important; gap: 8px !important; }
  .wt-actions .mark-all-btn, .wt-actions .play-all-btn { flex: 1 !important; justify-content: center !important; }
}

/* ══ CHUNKS TOOLBAR — dark mode ══ */
[data-theme="dark"] .toolbar {
  background: rgba(17,17,27,.96) !important;
  border-color: rgba(255,255,255,.1) !important;
}
