/* ==========================================================================
   Arabic Journey — design system
   Emerald #16866B · Navy #172B4D · Warm white #FAFAF7 · Orange #F4A340
   ========================================================================== */
:root {
  --emerald: #16866B; --emerald-600: #117159; --emerald-700: #0c5a47; --emerald-50: #E8F5F0; --emerald-100: #CDEBDF;
  --navy: #172B4D; --navy-80: #2c4067; --navy-60: #5A6B87; --navy-40: #8B98AE;
  --cream: #FAFAF7; --white: #ffffff; --gray-50: #F4F5F1; --gray-100: #ECEEE8; --gray-200: #DDE1D8; --gray-300: #C7CCC1;
  --orange: #F4A340; --orange-600: #D9862A; --orange-50: #FEF4E6;
  --red: #E0533D; --red-50: #FDEDEA; --sky: #3E8BD6; --sky-50: #EAF3FC; --purple: #7B61C9;
  --radius-sm: 10px; --radius: 16px; --radius-lg: 24px; --radius-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(23,43,77,.06), 0 1px 1px rgba(23,43,77,.04);
  --shadow: 0 4px 14px rgba(23,43,77,.07), 0 1px 3px rgba(23,43,77,.05);
  --shadow-lg: 0 18px 50px rgba(23,43,77,.12);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Cairo', 'Noto Sans Arabic', 'Geeza Pro', 'Segoe UI', sans-serif;
  --header-h: 68px; --ease: cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--navy); background: var(--cream); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-700); }
button { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Arabic text */
.ar, [lang="ar"] { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; line-height: 1.9; }
.ar-xl { font-size: 3.2rem; line-height: 1.5; font-weight: 700; }
.ar-lg { font-size: 2rem; font-weight: 700; }
.ar-md { font-size: 1.45rem; font-weight: 600; }
.tr { color: var(--navy-60); font-style: italic; }
.muted { color: var(--navy-60); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* Layout */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.section { padding: 84px 0; }
.section-sm { padding: 48px 0; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--emerald); margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--orange); border-radius: 2px; }
.lead { font-size: 1.15rem; color: var(--navy-80); max-width: 640px; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250,250,247,.86); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--gray-200); }
.nav { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); font-size: 1.12rem; letter-spacing: -.02em; }
.logo-mark { width: 38px; height: 38px; flex: none; }
.logo small { display: block; font-size: .64rem; font-weight: 600; color: var(--navy-60); letter-spacing: .02em; margin-top: -3px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { color: var(--navy-80); font-weight: 600; font-size: .94rem; padding: 8px 12px; border-radius: 10px; }
.nav-links a:hover, .nav-links a.active { background: var(--emerald-50); color: var(--emerald-700); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--navy); }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .92rem; padding: 6px 10px; border-radius: 999px; background: var(--white); border: 1px solid var(--gray-200); }
.stat-pill.streak { color: var(--orange-600); }
.stat-pill.xp { color: var(--emerald-700); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--emerald), var(--navy)); color: #fff; display: grid; place-items: center; font-weight: 800; border: 0; cursor: pointer; font-size: .95rem; position: relative; }
.avatar .dot { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; background: var(--orange); border: 2px solid var(--cream); border-radius: 50%; }
.menu { position: absolute; right: 20px; top: calc(var(--header-h) - 6px); background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; min-width: 230px; display: none; z-index: 60; }
.menu.open { display: block; animation: pop .18s var(--ease); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--navy); font-weight: 600; background: none; border: 0; cursor: pointer; font-size: .94rem; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--gray-50); }
.menu hr { border: 0; border-top: 1px solid var(--gray-100); margin: 6px 0; }
.mobile-drawer { display: none; }

/* App sub-navigation (logged in) */
.app-nav { background: var(--white); border-bottom: 1px solid var(--gray-200); }
.app-nav .container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.app-nav a { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--navy-60); font-weight: 700; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.app-nav a.active { color: var(--emerald-700); border-bottom-color: var(--emerald); }
.app-nav a svg { width: 18px; height: 18px; }
.tabbar { display: none; }

/* Buttons */
.btn { --b: var(--emerald); --bd: var(--emerald-700); --c: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; font-weight: 800; font-size: .98rem; border-radius: 14px; border: 0; cursor: pointer; background: var(--b); color: var(--c); box-shadow: 0 4px 0 var(--bd); transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none; letter-spacing: .01em; line-height: 1.2; }
.btn:hover { filter: brightness(1.05); color: var(--c); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.btn[disabled], .btn.disabled { --b: var(--gray-200); --bd: var(--gray-300); --c: var(--navy-40); cursor: not-allowed; transform: none; filter: none; }
.btn-orange { --b: var(--orange); --bd: var(--orange-600); --c: var(--navy); }
.btn-navy { --b: var(--navy); --bd: #0b1830; }
.btn-red { --b: var(--red); --bd: #b23a27; }
.btn-ghost { --b: var(--white); --bd: var(--gray-200); --c: var(--navy); border: 2px solid var(--gray-200); box-shadow: 0 3px 0 var(--gray-200); }
.btn-ghost:hover { --c: var(--emerald-700); border-color: var(--emerald-100); }
.btn-link { background: none; border: 0; color: var(--emerald); font-weight: 700; cursor: pointer; padding: 6px; font-size: .95rem; }
.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 11px; box-shadow: 0 3px 0 var(--bd); }
.btn-lg { padding: 17px 30px; font-size: 1.06rem; border-radius: 16px; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 2px solid var(--gray-200); background: var(--white); cursor: pointer; color: var(--navy); transition: .15s; flex: none; }
.icon-btn:hover { border-color: var(--emerald-100); color: var(--emerald); background: var(--emerald-50); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.on { color: var(--orange-600); border-color: var(--orange); background: var(--orange-50); }
.play-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--emerald-50); color: var(--emerald-700); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: .15s; }
.play-btn:hover { background: var(--emerald); color: #fff; transform: scale(1.06); }
.play-btn.playing { animation: pulse 1s infinite; background: var(--emerald); color: #fff; }
.play-btn svg { width: 18px; height: 18px; }
.play-btn.lg { width: 84px; height: 84px; }
.play-btn.lg svg { width: 36px; height: 36px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; padding: 13px 15px; border: 2px solid var(--gray-200); border-radius: 13px; font: inherit; color: var(--navy); background: var(--white); transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-50); }
textarea.input { min-height: 120px; resize: vertical; }
textarea.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .84rem; min-height: 200px; direction: ltr; }
.input.invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: .85rem; margin-top: 4px; font-weight: 600; }
.hint { font-size: .84rem; color: var(--navy-60); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--emerald); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { border: 2px solid var(--gray-200); border-radius: 14px; padding: 14px; background: var(--white); cursor: pointer; text-align: left; font-weight: 700; color: var(--navy); display: flex; flex-direction: column; gap: 4px; transition: .15s; font-size: .95rem; }
.choice span { font-size: 1.6rem; }
.choice small { color: var(--navy-60); font-weight: 500; }
.choice.selected { border-color: var(--emerald); background: var(--emerald-50); box-shadow: 0 0 0 3px var(--emerald-50); }

/* Cards */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card-hover { transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--emerald-100); }
.card h3 { margin-bottom: 6px; }
.card-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: var(--emerald-50); margin-bottom: 16px; }
.card-icon.orange { background: var(--orange-50); }
.card-icon.navy { background: #e8ecf4; }
.card-icon svg { width: 26px; height: 26px; color: var(--emerald); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--gray-100); color: var(--navy-80); letter-spacing: .02em; }
.badge.green { background: var(--emerald-50); color: var(--emerald-700); }
.badge.orange { background: var(--orange-50); color: var(--orange-600); }
.badge.navy { background: var(--navy); color: #fff; }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.sky { background: var(--sky-50); color: var(--sky); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--gray-200); background: var(--white); font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--navy-80); white-space: nowrap; transition: .15s; }
.chip:hover { border-color: var(--emerald-100); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }

/* Progress */
.progress { height: 12px; background: var(--gray-100); border-radius: 999px; overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), #29a985); border-radius: 999px; transition: width .5s var(--ease); position: relative; }
.progress > span::after { content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); }
.progress.orange > span { background: linear-gradient(90deg, var(--orange), #f7bd6f); }
.progress.sm { height: 8px; }
.progress.sm > span::after { display: none; }
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--emerald) calc(var(--p) * 1%), var(--gray-100) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 12px; background: var(--white); border-radius: 50%; }
.ring > * { position: relative; text-align: center; }
.ring.orange { background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--gray-100) 0); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 8l9 23 23 9-23 9-9 23-9-23-23-9 23-9z' fill='none' stroke='%2316866B' stroke-opacity='.07' stroke-width='1.5'/%3E%3C/svg%3E"); mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; position: relative; }
.hero h1 span { color: var(--emerald); position: relative; white-space: nowrap; }
.hero h1 span::after { content: ''; position: absolute; left: 0; right: 0; bottom: .06em; height: .18em; background: var(--orange); opacity: .45; border-radius: 4px; z-index: -1; }
.hero .lead { margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 24px; margin-top: 34px; flex-wrap: wrap; }
.hero-trust div { font-size: .88rem; color: var(--navy-60); }
.hero-trust strong { display: block; font-size: 1.4rem; color: var(--navy); }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.float { animation: float 6s ease-in-out infinite; }
.float.d2 { animation-delay: -2s; } .float.d3 { animation-delay: -4s; }

/* Alphabet preview strip */
.letter-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; direction: rtl; }
.letter-tile { aspect-ratio: 1; border-radius: 18px; background: var(--white); border: 2px solid var(--gray-200); display: grid; place-items: center; cursor: pointer; position: relative; transition: .2s var(--ease); padding: 6px; }
.letter-tile .ar { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 700; color: var(--navy); line-height: 1; }
.letter-tile small { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: .66rem; font-weight: 700; color: var(--navy-40); direction: ltr; }
.letter-tile:hover { border-color: var(--emerald); transform: translateY(-3px); box-shadow: var(--shadow); }
.letter-tile:hover .ar { color: var(--emerald); }
.letter-tile.viewed { border-color: var(--emerald-100); background: var(--emerald-50); }
.letter-tile.viewed::after { content: '✓'; position: absolute; top: 6px; left: 8px; color: var(--emerald); font-size: .75rem; font-weight: 900; }

/* Path / course map */
.path-card { position: relative; overflow: hidden; }
.path-card .stripe { position: absolute; inset: 0 0 auto 0; height: 6px; }
.unit { margin-bottom: 36px; }
.unit-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--navy); color: #fff; margin-bottom: 18px; }
.unit-head .icon { font-size: 1.8rem; width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.unit-head h3 { color: #fff; margin: 0; }
.unit-head p { margin: 0; color: rgba(255,255,255,.75); font-size: .9rem; }
.unit-head .btn { margin-left: auto; }
.lesson-list { display: grid; gap: 10px; position: relative; }
.lesson-row { display: flex; align-items: center; gap: 16px; background: var(--white); border: 2px solid var(--gray-200); border-radius: 18px; padding: 14px 16px; transition: .2s var(--ease); color: var(--navy); }
.lesson-row:hover { border-color: var(--emerald-100); transform: translateX(4px); color: var(--navy); }
.lesson-node { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--gray-100); color: var(--navy-60); flex: none; box-shadow: 0 3px 0 var(--gray-200); }
.lesson-row.completed .lesson-node { background: var(--emerald); color: #fff; box-shadow: 0 3px 0 var(--emerald-700); }
.lesson-row.started .lesson-node { background: var(--orange); color: var(--navy); box-shadow: 0 3px 0 var(--orange-600); }
.lesson-row.next { border-color: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-50); }
.lesson-row .meta { font-size: .84rem; color: var(--navy-60); }
.lesson-row .go { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.coming-soon { border: 2px dashed var(--gray-300); border-radius: 18px; padding: 18px; color: var(--navy-60); text-align: center; font-weight: 600; }

/* Steps / how it works */
.step { position: relative; padding-left: 0; }
.step-num { width: 44px; height: 44px; border-radius: 14px; background: var(--orange); color: var(--navy); font-weight: 900; display: grid; place-items: center; margin-bottom: 14px; box-shadow: 0 4px 0 var(--orange-600); }

/* Feature band */
.band { background: var(--navy); color: #fff; border-radius: var(--radius-xl); padding: 56px; position: relative; overflow: hidden; }
.band h2, .band h3 { color: #fff; }
.band p { color: rgba(255,255,255,.78); }
.band::after { content: 'ع'; font-family: var(--font-ar); position: absolute; right: -20px; bottom: -110px; font-size: 380px; color: rgba(255,255,255,.04); line-height: 1; pointer-events: none; }
.gam-item { display: flex; gap: 14px; align-items: flex-start; }
.gam-item .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(255,255,255,.1); flex: none; }

/* FAQ */
.faq details { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; font-size: 1.4rem; color: var(--emerald); line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 12px 0 0; color: var(--navy-80); }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding: 64px 0 28px; margin-top: 40px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,.75); display: block; padding: 4px 0; font-size: .93rem; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .86rem; }
.site-footer .logo { color: #fff; }
.site-footer .logo small { color: rgba(255,255,255,.6); }

/* Page header */
.page-head { padding: 52px 0 36px; background: linear-gradient(180deg, var(--emerald-50), transparent); }
.page-head.navy { background: var(--navy); color: #fff; }
.page-head.navy h1 { color: #fff; }
.page-head.navy .lead { color: rgba(255,255,255,.8); }
.breadcrumb { font-size: .86rem; color: var(--navy-60); margin-bottom: 12px; }
.breadcrumb a { color: inherit; font-weight: 600; }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }

/* Auth */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--navy); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; }
.auth-side p { color: rgba(255,255,255,.78); }
.auth-side .big-ar { font-family: var(--font-ar); font-size: 5rem; color: var(--orange); line-height: 1.3; direction: rtl; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; }
.auth-form .card { width: 100%; max-width: 440px; padding: 36px; }
.alert { padding: 14px 16px; border-radius: 13px; font-weight: 600; font-size: .92rem; margin-bottom: 16px; }
.alert.error { background: var(--red-50); color: #a5321f; }
.alert.success { background: var(--emerald-50); color: var(--emerald-700); }
.alert.info { background: var(--sky-50); color: #245d94; }
.alert.warn { background: var(--orange-50); color: #8a5313; }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 22px; padding: 28px 0 48px; }
.welcome { background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-700) 100%); color: #fff; border-radius: var(--radius-lg); padding: 28px; position: relative; overflow: hidden; border: 0; }
.welcome h2 { color: #fff; font-size: 1.6rem; }
.welcome p { color: rgba(255,255,255,.85); }
.welcome .mascot { position: absolute; right: 20px; bottom: -6px; width: 120px; }
.welcome .btn { --b: #fff; --bd: #cfe9df; --c: var(--emerald-700); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; }
.kpi .v { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.kpi .l { font-size: .8rem; color: var(--navy-60); font-weight: 600; }
.kpi .e { font-size: 1.3rem; margin-bottom: 6px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar span { width: 100%; max-width: 38px; background: var(--emerald-100); border-radius: 8px 8px 4px 4px; min-height: 4px; transition: height .6s var(--ease); position: relative; }
.bars .bar.today span { background: var(--emerald); }
.bars .bar small { font-size: .72rem; color: var(--navy-60); font-weight: 700; }
.bars .bar em { font-style: normal; font-size: .7rem; font-weight: 800; color: var(--navy-60); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.list-plain li:last-child { border-bottom: 0; }
.ach { display: flex; align-items: center; gap: 12px; }
.ach .medal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: radial-gradient(circle at 30% 30%, #fff6e5, var(--orange)); box-shadow: 0 3px 0 var(--orange-600); flex: none; }
.ach.locked .medal { background: var(--gray-100); box-shadow: 0 3px 0 var(--gray-200); filter: grayscale(1); opacity: .55; }
.empty { text-align: center; padding: 30px 16px; color: var(--navy-60); }
.empty .mascot { width: 110px; margin: 0 auto 12px; }

/* Lesson player */
.player { min-height: 100vh; display: flex; flex-direction: column; background: var(--cream); }
.player-top { position: sticky; top: 0; z-index: 30; background: var(--cream); padding: 16px 0; }
.player-top .container { display: flex; align-items: center; gap: 16px; max-width: 900px; }
.player-top .progress { flex: 1; height: 16px; }
.player-body { flex: 1; padding: 18px 0 150px; }
.player-body .container { max-width: 760px; }
.stage-label { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--orange-600); margin-bottom: 8px; }
.ex-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 20px; }
.learn-block { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 26px; margin-bottom: 18px; }
.explain p, .explain li { font-size: 1.04rem; }
.explain .ar { font-size: 1.2em; font-weight: 600; color: var(--emerald-700); }
.ex-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.ex-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--gray-50); margin-bottom: 8px; }
.ex-row .ar { font-size: 1.5rem; font-weight: 700; min-width: 0; }
.ex-row .txt { flex: 1; min-width: 0; }
.ex-row .txt div:first-child { font-weight: 700; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.vcard { background: var(--white); border: 2px solid var(--gray-200); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.vcard .emoji { font-size: 1.6rem; position: absolute; top: 12px; left: 14px; }
.vcard .ar { font-size: 1.7rem; font-weight: 700; text-align: right; }
.vcard .en { font-weight: 700; }
.vcard .actions { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.vcard.learned { border-color: var(--emerald-100); }
.vcard .example { font-size: .86rem; color: var(--navy-60); border-top: 1px dashed var(--gray-200); padding-top: 8px; margin-top: 6px; }
.vcard .example .ar { font-size: 1.05rem; font-weight: 500; text-align: right; color: var(--navy); }

/* Exercises */
.prompt-ar { text-align: center; margin: 10px 0 24px; }
.prompt-ar .ar { font-size: 3rem; font-weight: 700; line-height: 1.5; }
.options { display: grid; gap: 12px; }
.options.cols2 { grid-template-columns: repeat(2, 1fr); }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 2px solid var(--gray-200); border-bottom-width: 4px; border-radius: 16px; background: var(--white); cursor: pointer; font-weight: 700; font-size: 1.05rem; color: var(--navy); text-align: left; transition: transform .08s, border-color .15s, background .15s; }
.opt:hover:not(:disabled) { background: var(--gray-50); }
.opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.opt .key { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--gray-200); display: grid; place-items: center; font-size: .8rem; color: var(--navy-60); flex: none; }
.opt .ar { font-size: 1.45rem; font-weight: 700; }
.opt .opt-text { flex: 1; display: flex; flex-direction: column; }
.opt .opt-text .tr { font-size: .86rem; font-weight: 500; }
.opt.selected { border-color: var(--sky); background: var(--sky-50); }
.opt.selected .key { border-color: var(--sky); color: var(--sky); }
.opt.correct { border-color: var(--emerald); background: var(--emerald-50); }
.opt.correct .key { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-50); animation: shake .35s; }
.opt:disabled { cursor: default; }
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf-row .opt { justify-content: center; font-size: 1.15rem; padding: 22px; }
.statement { font-size: 1.25rem; font-weight: 700; background: var(--white); border: 1px solid var(--gray-200); border-radius: 18px; padding: 22px; margin-bottom: 20px; text-align: center; }
.match-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.match-col { display: grid; gap: 10px; align-content: start; }
.mtile { padding: 14px; border: 2px solid var(--gray-200); border-bottom-width: 4px; border-radius: 14px; background: var(--white); cursor: pointer; font-weight: 700; text-align: center; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: .12s; color: var(--navy); font-size: 1rem; }
.mtile .ar { font-size: 1.5rem; }
.mtile.emoji { font-size: 2.2rem; }
.mtile.active { border-color: var(--sky); background: var(--sky-50); }
.mtile.paired { opacity: .95; }
.mtile.correct { border-color: var(--emerald); background: var(--emerald-50); }
.mtile.wrong { border-color: var(--red); background: var(--red-50); }
.mtile .pair-tag { font-size: .7rem; font-weight: 800; color: #fff; border-radius: 6px; padding: 1px 7px; margin-top: 4px; }
.answer-zone { min-height: 76px; border-bottom: 2px solid var(--gray-200); padding: 12px 4px; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; align-items: center; }
.answer-zone.rtl { direction: rtl; }
.word-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.word-bank.rtl { direction: rtl; }
.wchip { padding: 10px 16px; border: 2px solid var(--gray-200); border-bottom-width: 4px; border-radius: 13px; background: var(--white); cursor: pointer; font-weight: 700; font-size: 1.05rem; color: var(--navy); transition: .1s; }
.wchip.ar { font-size: 1.5rem; padding: 4px 18px; line-height: 1.8; }
.wchip.used { visibility: hidden; }
.wchip:active { transform: translateY(2px); }
.blank { display: inline-block; min-width: 90px; border-bottom: 3px solid var(--sky); color: var(--sky); padding: 0 8px; }
.sentence-box { background: var(--white); border: 1px solid var(--gray-200); border-radius: 18px; padding: 22px; text-align: center; margin-bottom: 20px; }
.sentence-box .ar { font-size: 1.9rem; font-weight: 700; }
.passage { background: var(--white); border: 1px solid var(--gray-200); border-left: 5px solid var(--orange); border-radius: 18px; padding: 22px; margin-bottom: 20px; }
.passage .ar { font-size: 1.45rem; line-height: 2.1; }
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.bubble { max-width: 85%; padding: 14px 16px; border-radius: 20px; background: var(--white); border: 1px solid var(--gray-200); position: relative; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--emerald-50); border-color: var(--emerald-100); border-bottom-right-radius: 6px; }
.bubble .who { font-size: .76rem; font-weight: 800; color: var(--navy-60); text-transform: uppercase; letter-spacing: .06em; }
.bubble .ar { font-size: 1.35rem; font-weight: 600; }
.bubble .en { font-size: .9rem; color: var(--navy-60); }
.bubble-row { display: flex; align-items: center; gap: 10px; }
.flashcard { perspective: 1200px; height: 280px; margin: 0 auto 20px; max-width: 460px; cursor: pointer; }
.flashcard .inner { position: relative; width: 100%; height: 100%; transition: transform .55s var(--ease); transform-style: preserve-3d; }
.flashcard.flipped .inner { transform: rotateY(180deg); }
.flashcard .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 26px; background: var(--white); border: 2px solid var(--gray-200); border-bottom-width: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; }
.flashcard .back { transform: rotateY(180deg); background: var(--navy); color: #fff; border-color: var(--navy); }
.flashcard .face .ar { font-size: 3rem; font-weight: 700; }
.flashcard .face .emoji { font-size: 2.4rem; }
.flashcard .back .en { font-size: 1.7rem; font-weight: 800; }
.flashcard .back .tr { color: rgba(255,255,255,.75); font-size: 1.1rem; }
.flash-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 12px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-200); }
.dots i.seen { background: var(--emerald-100); }
.dots i.cur { background: var(--emerald); width: 22px; border-radius: 6px; }
.listen-center { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 10px 0 26px; }
.trans-input { font-size: 1.15rem; padding: 18px; min-height: 110px; }
.display-letter { font-family: var(--font-ar); font-size: 6rem; font-weight: 700; line-height: 1.4; text-align: center; direction: rtl; color: var(--navy); background: var(--white); border: 2px solid var(--gray-200); border-radius: 28px; width: 190px; margin: 0 auto 24px; padding: 4px 0; }

/* Feedback bar */
.check-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--white); border-top: 2px solid var(--gray-200); padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); transition: background .2s; }
.check-bar .container { max-width: 900px; display: flex; align-items: center; gap: 16px; }
.check-bar .fb { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.check-bar .fb-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 1.6rem; flex: none; }
.check-bar .fb h4 { margin: 0; font-size: 1.2rem; }
.check-bar .fb p { margin: 2px 0 0; font-size: .92rem; }
.check-bar .fb .sol { font-weight: 700; }
.check-bar.ok { background: #DCF3E9; border-top-color: #bfe5d4; }
.check-bar.ok h4, .check-bar.ok p { color: var(--emerald-700); }
.check-bar.bad { background: #FCE4DF; border-top-color: #f5c9bf; }
.check-bar.bad h4, .check-bar.bad p { color: #a5321f; }
.check-bar .actions { display: flex; gap: 10px; }

/* Completion */
.complete { text-align: center; padding: 40px 0 120px; max-width: 560px; margin: 0 auto; }
.complete .mascot { width: 170px; margin: 0 auto 10px; }
.complete-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; }
.cstat { border-radius: 18px; border: 2px solid; padding: 4px; overflow: hidden; }
.cstat .h { font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #fff; padding: 4px; }
.cstat .b { background: var(--white); border-radius: 13px; padding: 14px 6px; font-size: 1.5rem; font-weight: 900; }
.cstat.o { border-color: var(--orange); background: var(--orange); } .cstat.o .b { color: var(--orange-600); }
.cstat.g { border-color: var(--emerald); background: var(--emerald); } .cstat.g .b { color: var(--emerald-700); }
.cstat.n { border-color: var(--navy); background: var(--navy); } .cstat.n .b { color: var(--navy); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }

/* Vocabulary page */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; color: var(--navy-40); }
.search .input { padding-left: 44px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 26px; align-items: center; }

/* Alphabet center */
.alpha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; direction: rtl; }
.alpha-grid .letter-tile { aspect-ratio: .9; }
.letter-detail { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.big-letter { font-family: var(--font-ar); font-size: 8rem; font-weight: 700; line-height: 1.3; text-align: center; color: var(--emerald); background: var(--emerald-50); border-radius: 28px; direction: rtl; }
.forms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; direction: rtl; }
.forms div { background: var(--gray-50); border-radius: 14px; padding: 10px 6px; text-align: center; }
.forms .ar { font-size: 2.2rem; font-weight: 700; display: block; line-height: 1.6; }
.forms small { direction: ltr; display: block; font-size: .72rem; color: var(--navy-60); font-weight: 700; }
.trace-wrap { position: relative; background: var(--white); border: 2px dashed var(--gray-300); border-radius: 22px; overflow: hidden; touch-action: none; }
.trace-wrap canvas { display: block; width: 100%; height: 260px; cursor: crosshair; }
.trace-ghost { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-ar); font-size: 190px; color: var(--gray-100); pointer-events: none; line-height: 1; direction: rtl; }
.game-box { text-align: center; }
.game-letter { font-family: var(--font-ar); font-size: 5rem; font-weight: 700; color: var(--navy); line-height: 1.4; }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; }
.lb-row:nth-child(odd) { background: var(--gray-50); }
.lb-row.me { background: var(--emerald-50); border: 2px solid var(--emerald-100); }
.lb-rank { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; background: var(--white); border: 2px solid var(--gray-200); }
.lb-row:nth-child(1) .lb-rank { background: #FFD66B; border-color: #e7b93a; }
.lb-row:nth-child(2) .lb-rank { background: #E4E8EE; border-color: #c4ccd8; }
.lb-row:nth-child(3) .lb-rank { background: #F2C29B; border-color: #d99d6d; }

/* Tabs */
.tabs { display: inline-flex; background: var(--gray-100); padding: 4px; border-radius: 14px; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 9px 16px; border-radius: 11px; font-weight: 700; cursor: pointer; color: var(--navy-60); font-size: .92rem; }
.tabs button.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }

/* Modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(23,43,77,.5); backdrop-filter: blur(3px); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { background: var(--white); border-radius: var(--radius-lg); max-width: 640px; width: 100%; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--gray-100); position: sticky; top: 0; background: var(--white); z-index: 2; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--white); }
.toasts { position: fixed; top: 84px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .93rem; animation: slidein .3s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast.error { background: var(--red); }
.toast.success { background: var(--emerald-700); }
.toast.ach { background: linear-gradient(135deg, var(--orange), #f7bd6f); color: var(--navy); }

/* Admin */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - var(--header-h)); }
.admin-side { background: var(--navy); color: rgba(255,255,255,.8); padding: 22px 14px; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; }
.admin-side h5 { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.45); margin: 18px 10px 8px; }
.admin-side a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.8); padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.admin-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side a.active { background: var(--emerald); color: #fff; }
.admin-main { padding: 28px; min-width: 0; }
.table-wrap { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-60); padding: 12px 14px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.table tr:hover td { background: #fbfcfa; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions button { margin-left: 4px; }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .86rem; }
.hbar .lbl { width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .trk { flex: 1; height: 10px; background: var(--gray-100); border-radius: 6px; overflow: hidden; }
.hbar .trk span { display: block; height: 100%; background: var(--emerald); border-radius: 6px; }
.hbar .num { width: 46px; text-align: right; font-weight: 700; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.spark span { flex: 1; background: var(--emerald-100); border-radius: 3px 3px 0 0; min-height: 2px; }
.spark span:hover { background: var(--emerald); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--gray-200); border-radius: 14px; padding: 10px; background: var(--white); font-size: .8rem; word-break: break-all; }
.media-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.media-item audio { width: 100%; margin-bottom: 8px; }
.multi-select { max-height: 220px; overflow: auto; border: 2px solid var(--gray-200); border-radius: 13px; padding: 8px; }
.multi-select label { display: flex; gap: 8px; align-items: center; padding: 4px 6px; font-size: .9rem; font-weight: 500; cursor: pointer; border-radius: 8px; }
.multi-select label:hover { background: var(--gray-50); }

/* Recording */
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; display: inline-block; }
.speak-card { text-align: center; padding: 34px 24px; }
.speak-card .ar { font-size: 2.6rem; font-weight: 700; }

/* Skeleton & loaders */
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 14px; }
.loader { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--emerald-100); border-top-color: var(--emerald); border-radius: 50%; animation: spin .8s linear infinite; }

/* Animations */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22,134,107,.4); } 50% { box-shadow: 0 0 0 10px rgba(22,134,107,0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.reveal { animation: rise .5s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Responsive */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .admin-side h5 { display: none; }
}
@media (max-width: 860px) {
  .nav-links, .nav-right .hide-m { display: none; }
  .nav-toggle { display: block; }
  .mobile-drawer.open { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: var(--cream); z-index: 45; padding: 20px; overflow-y: auto; animation: fade .2s; }
  .mobile-drawer a { display: block; padding: 14px 8px; font-size: 1.1rem; font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--gray-100); }
  .hero-grid, .auth-wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; margin: 0 auto; order: -1; }
  .auth-side { display: none; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 0; }
  .band { padding: 36px 24px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .letter-detail { grid-template-columns: 1fr; }
  .big-letter { font-size: 6rem; }
  .app-nav { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--gray-200); z-index: 35; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--navy-40); padding: 4px 6px; border-radius: 10px; min-width: 56px; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--emerald); }
  body.has-tabbar { padding-bottom: 70px; }
  body.has-tabbar .site-footer { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .letter-strip { grid-template-columns: repeat(4, 1fr); }
  .options.cols2 { grid-template-columns: 1fr; }
  .match-wrap { gap: 8px; }
  .mtile { padding: 10px 6px; font-size: .9rem; }
  .complete-stats { gap: 8px; }
  .check-bar .container { flex-direction: column; align-items: stretch; }
  .check-bar .actions .btn { flex: 1; }
  .unit-head { flex-wrap: wrap; }
  .unit-head .btn { margin-left: 0; width: 100%; }
  .lesson-row .go .badge { display: none; }
  .display-letter { font-size: 4.6rem; width: 150px; }
  .prompt-ar .ar { font-size: 2.4rem; }
  .flashcard { height: 240px; }
  .modal-body { padding: 18px; }
  .admin-main { padding: 18px 12px; }
  .toasts { left: 16px; right: 16px; max-width: none; }
  .stat-pill.xp { display: none; }
  .auth-form .card { padding: 24px; }
  .welcome .mascot { display: none; }
}

/* Hero scene */
.hero-scene { position: relative; aspect-ratio: 1; max-width: 520px; margin-left: auto; }
.hs-blob { position: absolute; inset: 8%; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--emerald-50) 45%, var(--emerald-100) 100%); border: 2px solid #fff; box-shadow: var(--shadow-lg); }
.hs-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.hs-mascot { position: absolute; left: 50%; top: 50%; width: 38%; transform: translate(-50%, -48%); }
.hs-mascot .mascot { width: 100%; }
.hs-card, .hs-chip { position: absolute; background: var(--white); border: 1px solid var(--gray-200); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 16px; display: flex; flex-direction: column; align-items: center; }
.hs-card .ar { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1.6; }
.hs-card small { font-size: .74rem; color: var(--navy-60); font-weight: 600; }
.hs-chip { flex-direction: row; gap: 6px; font-weight: 800; font-size: .9rem; border-radius: 999px; padding: 8px 14px; }
.hs-chip svg { width: 18px; height: 18px; }
.hs-card.c1 { left: 0; top: 18%; } .hs-card.c2 { right: 4%; top: 6%; padding: 8px 18px; color: var(--emerald); }
.hs-chip.c3 { right: 0; top: 48%; color: var(--emerald-700); } .hs-chip.c4 { left: 4%; bottom: 14%; color: var(--orange-600); }
.hs-card.c5 { right: 8%; bottom: 4%; gap: 6px; }
@media (max-width: 600px) { .hs-card .ar { font-size: 1.2rem; } .hs-chip { font-size: .76rem; padding: 6px 10px; } }
.ic { width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: -.2em; }
.btn .ic { width: 1.25em; height: 1.25em; }
.hero-art { width: 100%; }
@media (max-width: 860px) { .hero-scene { max-width: 360px; margin: 0 auto 8px; } .hero { padding-top: 24px; } }
@media (max-width: 600px) { .hs-card.c5 { display: none; } .hs-card.c1 { top: 8%; } }
.badge { white-space: nowrap; }
.site-footer a.logo { display: flex; }
