/* ==========================================================================
   ATS — Al-Tariqah As-Sahlah (v1.0.0)
   Exact MyQuran Font Stack (AlQuran Neo v5x1 + Hanafi Madd U+06E4),
   Strict Arabic/Urdu Script Segregation, 6 Signature Themes, Mobile-First.
   ========================================================================== */

@font-face {
  font-family: 'AlQuran Neo v5x1';
  src: url('fonts/AlQuranNeo5x3.woff2') format('woff2'),
       url('fonts/AlQuranNeov5x1.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  ascent-override: 132%;
  descent-override: 56%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Noto Nastaliq Urdu';
  src: url('fonts/NotoNastaliqUrdu-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jameel Noori Nastaleeq';
  src: url('fonts/JameelNooriNastaleeq.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Material Symbols Rounded';
  src: url('fonts/MaterialSymbolsRounded.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.msr {
  font-family: 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 21px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  flex-shrink: 0;
}
.msr-sm { font-size: 17px; }
.msr-lg { font-size: 26px; }

/* ==========================================================================
   VARIABLES & 6 SIGNATURE MYQURAN THEMES
   ========================================================================== */
:root {
  --ar-fs: 28px;
  --ur-fs: 16px;
  --en-fs: 13.5px;
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 56px;
  --nav-h: 64px;
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --ok-border: rgba(34, 197, 94, 0.42);
  --err: #ef4444;
  --err-bg: rgba(239, 68, 68, 0.14);
  --err-border: rgba(239, 68, 68, 0.45);
  --warn: #f59e0b;
  --accent-soft: rgba(var(--accent-rgb), 0.14);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.12);
}

html { color-scheme: dark; }

/* 1. Dark Luxury (Default) */
html.theme-dark-luxury {
  --bg: #09090b;
  --surface: #141417;
  --surface-2: #1c1c21;
  --card: #18181c;
  --border: rgba(220, 165, 76, 0.20);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent: #dca54c;
  --accent-hover: #e8b663;
  --accent-rgb: 220, 165, 76;
  --accent-text: #09090b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --arabic: #fffdf5;
  --urdu: #f1ebd8;
  --english: #d4d4d8;
}

/* 2. Golden Glint (Warm Parchment Light) */
html.theme-golden-glint {
  color-scheme: light;
  --bg: #fcfbf7;
  --surface: #ffffff;
  --surface-2: #f4efe2;
  --card: #ffffff;
  --border: rgba(120, 88, 4, 0.24);
  --border-subtle: rgba(120, 88, 4, 0.12);
  --accent: #785804;
  --accent-hover: #634803;
  --accent-rgb: 120, 88, 4;
  --accent-text: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --arabic: #1c1917;
  --urdu: #292524;
  --english: #44403c;
  --ok: #15803d;
  --ok-bg: rgba(21, 128, 61, 0.10);
  --err: #b91c1c;
  --err-bg: rgba(185, 28, 28, 0.10);
}

/* 3. Forest Green (Emerald ATS Signature) */
html.theme-forest-green {
  --bg: #031718;
  --surface: #082324;
  --surface-2: #0d2f31;
  --card: #0a2729;
  --border: rgba(45, 212, 191, 0.22);
  --border-subtle: rgba(45, 212, 191, 0.10);
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-rgb: 45, 212, 191;
  --accent-text: #031718;
  --text: #f0fdfa;
  --muted: #99f6e4;
  --arabic: #ffffff;
  --urdu: #ccfbf1;
  --english: #a7f3d0;
}

/* 4. Mocha Night */
html.theme-mocha-night {
  --bg: #20161f;
  --surface: #2b1e2a;
  --surface-2: #372736;
  --card: #2e202d;
  --border: rgba(220, 165, 76, 0.22);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent: #dca54c;
  --accent-hover: #e8b663;
  --accent-rgb: 220, 165, 76;
  --accent-text: #20161f;
  --text: #faf5eb;
  --muted: #d4c5b5;
  --arabic: #fffdf5;
  --urdu: #ede3d2;
  --english: #d4c5b5;
}

/* 5. Classic Light */
html.theme-classic-light {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --card: #ffffff;
  --border: #cbd5e1;
  --border-subtle: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-rgb: 15, 118, 110;
  --accent-text: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --arabic: #0f172a;
  --urdu: #1e293b;
  --english: #334155;
  --ok: #15803d;
  --ok-bg: rgba(21, 128, 61, 0.10);
  --err: #b91c1c;
  --err-bg: rgba(185, 28, 28, 0.10);
}

/* 6. OLED Black */
html.theme-oled-black {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #141414;
  --card: #0e0e0e;
  --border: rgba(220, 165, 76, 0.24);
  --border-subtle: #262626;
  --accent: #dca54c;
  --accent-hover: #e8b663;
  --accent-rgb: 220, 165, 76;
  --accent-text: #000000;
  --text: #fafafa;
  --muted: #a3a3a3;
  --arabic: #ffffff;
  --urdu: #f5f5f5;
  --english: #d4d4d4;
}

/* ==========================================================================
   BASE RESET & STRICT SCRIPT TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Strict Arabic Exclusivity — AlQuran Neo v5x1 ONLY */
.ar {
  font-family: 'AlQuran Neo v5x1', serif !important;
  direction: rtl;
  unicode-bidi: isolate;
  color: var(--arabic);
  font-size: var(--ar-fs);
  line-height: 2.18;
  letter-spacing: 0 !important;
  word-spacing: 3px;
  font-feature-settings: "liga" 1, "mark" 1, "mkmk" 1;
}
.ar-sm { font-size: calc(var(--ar-fs) * 0.80); line-height: 1.95; }
.ar-lg { font-size: calc(var(--ar-fs) * 1.28); line-height: 2.05; }
.ar-inline {
  font-family: 'AlQuran Neo v5x1', serif !important;
  direction: rtl;
  unicode-bidi: isolate;
  color: var(--arabic);
  font-size: 1.20em;
  line-height: 1.85;
  padding: 0 3px;
  font-weight: normal;
  display: inline;
}

/* Strict Urdu Exclusivity — Noto Nastaliq Urdu ONLY */
.ur {
  font-family: 'Noto Nastaliq Urdu', serif !important;
  direction: rtl;
  unicode-bidi: isolate;
  color: var(--urdu);
  font-size: var(--ur-fs);
  line-height: 2.22;
}
.ur-sm { font-size: calc(var(--ur-fs) * 0.86); line-height: 2.15; }
.en {
  color: var(--english);
  font-size: var(--en-fs);
  line-height: 1.5;
  direction: ltr;
}
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 12.5px; }

/* Settings visibility toggles */
html[data-show-en="off"] .en-opt { display: none !important; }
html[data-show-ur="off"] .ur-opt { display: none !important; }

/* ==========================================================================
   APP SHELL, HEADER & BOTTOM NAV
   ========================================================================== */
.ats-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.ats-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ats-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
}
.ats-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  object-fit: cover;
}
.ats-brand-text { min-width: 0; overflow: hidden; }
.ats-brand-top { display: flex; align-items: center; gap: 7px; }
.ats-brand-code {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.7px;
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}
.ats-brand-ar {
  font-size: 18px !important;
  line-height: 1.4 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ats-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.ats-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pill-sep { opacity: 0.45; }

.ats-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.ats-icon-btn:hover, .ats-icon-btn:active {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: var(--accent);
  color: var(--accent);
}

.ats-main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 12px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 18px);
}

.ats-boot-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 16px;
  gap: 10px;
  text-align: center;
}
.ats-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ats-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 4px 4px env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.nav-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 10px;
  cursor: pointer;
  min-width: 0;
}
.nav-tab .msr { font-size: 21px; }
.nav-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.2px; line-height: 1.1; }
.nav-ur { font-size: 10.5px !important; line-height: 1.55 !important; opacity: 0.85; }
.nav-tab.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}
.nav-tab.active .nav-ur { color: var(--accent); opacity: 1; }

/* ==========================================================================
   COMMON CARDS, BUTTONS, CHIPS, INPUTS
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card-subtle {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}
.btn-err {
  background: var(--err-bg);
  color: var(--err);
  border-color: var(--err-border);
}
.btn-sm { padding: 5px 10px; font-size: 12px; min-height: 32px; border-radius: 8px; }
.btn-block { width: 100%; }

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.30);
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.badge-m { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border-color: rgba(56, 189, 248, 0.35); }
.badge-f { background: rgba(244, 114, 182, 0.14); color: #f472b6; border-color: rgba(244, 114, 182, 0.35); }
html.theme-golden-glint .badge-m, html.theme-classic-light .badge-m { color: #0369a1; }
html.theme-golden-glint .badge-f, html.theme-classic-light .badge-f { color: #be185d; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  margin-bottom: 10px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
  font-size: 14px;
  outline: none;
}
.search-box select {
  min-width: 0;
  max-width: 100%;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 8px;
}
.section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ==========================================================================
   TAB 1: HOME HERO & 20-LESSON ROADMAP
   ========================================================================== */
.hero-card {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), var(--card) 65%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.hero-greeting { text-align: right; margin-bottom: 4px; }
.hero-greeting .ar { font-size: calc(var(--ar-fs) * 0.85); line-height: 1.7; color: var(--accent); }
.hero-subtitle { text-align: right; margin: 0 0 12px; }
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.hero-stat {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.hero-stat-val { font-size: 16px; font-weight: 800; color: var(--accent); }
.hero-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

.level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px;
  margin: 14px 0 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.level-title { font-size: 13px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.4px; }

.lesson-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .lesson-grid { grid-template-columns: repeat(2, 1fr); }
}

.lesson-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.12s, border-color 0.15s;
}
.lesson-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.lesson-card.completed { border-color: var(--ok-border); }
.lesson-num-circle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-card.completed .lesson-num-circle {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}
.lesson-card-ar {
  font-size: calc(var(--ar-fs) * 0.78) !important;
  line-height: 1.65 !important;
  text-align: right;
}
.lesson-card-ur {
  text-align: right;
  font-size: calc(var(--ur-fs) * 0.92) !important;
  line-height: 2.0 !important;
}

/* ==========================================================================
   LESSON STUDIO (LEARN / TAMREENS / QUIZ)
   ========================================================================== */
.studio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.studio-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 12px;
}
.studio-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 8px 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.studio-tab.active {
  background: var(--accent);
  color: var(--accent-text);
}

.rule-card {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.10), var(--card));
  border: 1px solid var(--border);
  border-right: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 10px;
}
.rule-title-ar { text-align: right; color: var(--accent) !important; font-size: calc(var(--ar-fs) * 0.80) !important; }
.rule-body-ur { text-align: right; margin-top: 4px; }
.rule-body-en { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border-subtle); direction: ltr; text-align: left; }

.example-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  margin-bottom: 11px;
}
.example-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ar-reading-stage {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-right: 3.5px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: right;
  cursor: pointer;
}
.ar-reading-stage:hover { border-color: var(--border); border-right-color: var(--accent); }
.essay-mushaf-card {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), var(--card));
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 15px 14px;
  margin-bottom: 14px;
}
.essay-mushaf-flow {
  text-align: justify;
  text-align-last: right;
  direction: rtl;
  line-height: 2.38 !important;
  padding: 6px 2px;
}
.essay-sent {
  cursor: pointer;
  border-radius: 6px;
  padding: 1px 4px;
  transition: background 0.15s;
}
.essay-sent:hover { background: rgba(var(--accent-rgb), 0.15); }
.essay-sent.playing-now {
  background: rgba(var(--accent-rgb), 0.28);
  box-shadow: 0 0 0 1px var(--accent);
}
.example-icon-wrap {
  width: 62px;
  height: 62px;
  border-radius: 13px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 3px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}
.ats-illus-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 9px;
}
.flash-illus-wrap {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  padding: 6px;
}
.dict-illus-wrap {
  width: 52px;
  height: 52px;
  border-radius: 11px;
  padding: 3px;
}

/* Crisp Semantic Concept Cards for Adjectives, Verbs, Pronouns & Grammar Words */
.example-icon-wrap.is-badge {
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}
.ats-concept-card {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1.5px solid;
  padding: 3px;
}
.ats-concept-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0.92;
}
.tone-emerald { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.42); color: #10b981; }
.tone-gold    { background: rgba(220, 165, 76, 0.16); border-color: rgba(220, 165, 76, 0.48); color: #dca54c; }
.tone-blue    { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.44); color: #3b82f6; }
.tone-sky     { background: rgba(14, 165, 233, 0.14); border-color: rgba(14, 165, 233, 0.44); color: #0ea5e9; }
.tone-indigo  { background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.44); color: #818cf8; }
.tone-amber   { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.44); color: #f59e0b; }
.tone-rose    { background: rgba(244, 63, 94, 0.14);  border-color: rgba(244, 63, 94, 0.44);  color: #f43f5e; }
.tone-slate   { background: rgba(148, 163, 184, 0.16); border-color: rgba(148, 163, 184, 0.44); color: #94a3b8; }
html.theme-golden-glint .tone-emerald, html.theme-classic-light .tone-emerald { color: #047857; }
html.theme-golden-glint .tone-gold,    html.theme-classic-light .tone-gold    { color: #854d0e; }
html.theme-golden-glint .tone-blue,    html.theme-classic-light .tone-blue    { color: #1d4ed8; }
html.theme-golden-glint .tone-sky,     html.theme-classic-light .tone-sky     { color: #0369a1; }
html.theme-golden-glint .tone-indigo,  html.theme-classic-light .tone-indigo  { color: #4338ca; }
html.theme-golden-glint .tone-amber,   html.theme-classic-light .tone-amber   { color: #b45309; }
html.theme-golden-glint .tone-rose,    html.theme-classic-light .tone-rose    { color: #be123c; }
html.theme-golden-glint .tone-slate,   html.theme-classic-light .tone-slate   { color: #334155; }

/* Active Speaking Highlight & Quick Grammar Cheat Sheet */
.btn.speaking, .wbw-chip.speaking {
  border-color: var(--accent) !important;
  background: rgba(var(--accent-rgb), 0.22) !important;
  color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.28);
}
.example-card.playing-now {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.25);
}
.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 8px;
}
.ref-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 1px;
}
.ref-chip:hover { border-color: var(--accent); }
.example-ar-box {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.example-actions {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  justify-content: flex-end;
}
.wbw-grid {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}
.wbw-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  min-width: 64px;
}
.wbw-chip:hover { border-color: var(--accent); }
.wbw-ar { font-size: calc(var(--ar-fs) * 0.72) !important; line-height: 1.65 !important; }
.wbw-ur { font-size: calc(var(--ur-fs) * 0.78) !important; line-height: 1.9 !important; color: var(--muted) !important; }

/* ==========================================================================
   TAB 2: SOLVED TAMREENS VAULT
   ========================================================================== */
.tam-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.tam-head {
  padding: 13px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tam-head:hover { background: rgba(var(--accent-rgb), 0.05); }
.tam-body {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 14px;
  background: var(--surface);
}
.tam-item {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 9px;
}
.tam-item.mastered { border-color: var(--ok-border); }
.tam-q { text-align: right; margin-bottom: 8px; }
.tam-ans-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: 3px solid var(--accent);
  border-radius: 10px;
  padding: 10px 13px;
  text-align: right;
}
.tam-ans-box .ur { white-space: pre-line; }
.tam-hidden-mask {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.tam-tip {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.08);
  border-right: 3px solid var(--accent);
  text-align: right;
}

/* ==========================================================================
   TAB 3: PRACTICE ARENA (FLASHCARDS, BUILDER, BLANKS, GENDER/PLURAL)
   ========================================================================== */
.practice-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}
@media (min-width: 640px) {
  .practice-mode-grid { grid-template-columns: repeat(5, 1fr); }
}
.listen-opt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 10px;
}
.listen-opt-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  color: var(--text);
}
.listen-opt-card:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); }
.listen-opt-card.correct { border-color: var(--ok); background: var(--ok-bg); }
.listen-opt-card.wrong { border-color: var(--err); background: var(--err-bg); }
.plural-speak-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plural-speak-btn:hover { border-color: var(--accent); }
.pmode-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text);
  text-align: center;
}
.pmode-btn.active {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: var(--accent);
  color: var(--accent);
}

.flashcard {
  background: linear-gradient(145deg, var(--card), var(--surface-2));
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 24px 18px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  gap: 10px;
  margin-bottom: 12px;
}
.flashcard.flipped { border-color: var(--accent); }

.builder-zone {
  min-height: 68px;
  padding: 10px;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}
.builder-zone.ok { border-color: var(--ok); background: var(--ok-bg); }
.builder-zone.err { border-color: var(--err); background: var(--err-bg); }

.tile-bank {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}
.word-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--arabic);
  transition: transform 0.1s, border-color 0.15s;
}
.word-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.word-tile.used { opacity: 0.32; pointer-events: none; }
.word-tile.placed { background: rgba(var(--accent-rgb), 0.18); border-color: var(--accent); }

/* ==========================================================================
   TAB 4: QUIZZES & MOCK EXAMS
   ========================================================================== */
.exam-banner {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-opt {
  width: 100%;
  text-align: right;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  transition: all 0.15s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); }
.quiz-opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.quiz-opt.wrong { border-color: var(--err); background: var(--err-bg); }
.quiz-opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.quiz-lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 640px) {
  .quiz-lesson-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   TAB 5: 312-WORD DICTIONARY
   ========================================================================== */
.dict-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
@media (min-width: 640px) {
  .dict-grid { grid-template-columns: repeat(2, 1fr); }
}
.dict-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==========================================================================
   SETTINGS MODAL & TOAST
   ========================================================================== */
.ats-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.ats-modal-backdrop[hidden] { display: none !important; }
@media (min-width: 600px) {
  .ats-modal-backdrop { align-items: center; padding: 20px; }
}
.ats-modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 600px) {
  .ats-modal { border-radius: 18px; }
}
.ats-modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ats-modal-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--accent); }
.ats-modal-body {
  padding: 14px 16px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.theme-swatch {
  border: 2px solid var(--border);
  border-radius: 11px;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--card);
  color: var(--text);
}
.theme-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.25); }
.swatch-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.setting-slider { width: 100%; accent-color: var(--accent); }

.ats-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  background: var(--accent);
  color: var(--accent-text);
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 92vw;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.ats-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Mobile-extra narrow screen safety (320px) */
@media (max-width: 360px) {
  .ats-header { padding: env(safe-area-inset-top, 0px) 8px 0; }
  .ats-brand-ar { font-size: 15px !important; }
  .ats-stat-pill { padding: 3px 7px; font-size: 11px; }
  .ats-main { padding: 10px 8px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px); }
}


/* ==========================================================================
   VISUAL CONCEPT EXPLAINER GRAPHICS (All 20 Lessons • Theme-Aware & Touch-Ready)
   ========================================================================== */
.vg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.vg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.vg-head-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 160px;
}
.vg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}
.vg-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}
.vg-title-ur {
  color: var(--accent);
  text-align: right;
  font-size: 13px !important;
  line-height: 1.8 !important;
}
.vg-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vg-svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
  margin: 0 auto 2px;
}
.vg-svg-tall {
  max-width: 460px;
}
.vg-eq {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  direction: rtl;
}
.vg-op {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: var(--accent);
  padding: 0 3px;
  direction: ltr;
}
.vg-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.vg-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.vg-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 380px) {
  .vg-cols-2, .vg-cols-3 { grid-template-columns: 1fr; }
  .vg-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.vg-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.vg-box.vg-tone-ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.vg-box.vg-tone-accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.vg-box.vg-tone-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.vg-box-lbl {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.3;
}
.vg-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.vg-chip:hover { border-color: var(--accent); }
.vg-chip:active { transform: scale(0.97); }
.vg-chip.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.vg-chip.vg-tone-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.vg-chip.vg-tone-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.vg-chip.vg-tone-warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.vg-ar {
  font-size: 20px !important;
  line-height: 1.65 !important;
  color: var(--text);
  word-break: break-word;
}
.vg-ur {
  font-size: 11.5px !important;
  line-height: 1.65 !important;
  color: var(--muted);
}
.vg-en {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
  direction: ltr;
  unicode-bidi: isolate;
}
.vg-mini-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.vg-mini-lbl {
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 2px;
}
.vg-clash {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--err) 10%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--err) 45%, transparent);
  flex-wrap: wrap;
  direction: rtl;
}
.vg-clash-tag {
  font-family: 'AlQuran Neo v5x1', serif;
  font-size: 20px;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.vg-clash-x {
  font-size: 11px;
  font-weight: 900;
  color: var(--err);
  letter-spacing: 0.3px;
}
.vg-matrix {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}
.vg-m-col, .vg-m-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 5px 4px;
  line-height: 1.3;
}
.vg-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.vg-chk {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
}
.vg-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ==========================================================================
   v1.7.0 INTERACTIVE VISUAL LABS, THUMBNAILS, MINI-AUDIO PLAYER & QUIZ AUDIO
   ========================================================================== */
.vg-lab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
  direction: rtl;
}
.vg-pill {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.vg-pill:hover { border-color: var(--accent); }
.vg-pill:active { transform: scale(0.97); }
.vg-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.vg-thumb {
  display: inline-block;
  object-fit: contain;
  background: #ffffff;
  border-radius: 9px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}
.vg-chip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.vg-multi-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.vg-stage-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 2px;
  direction: rtl;
}
.vg-stage-row > .vg-thumb {
  align-self: center;
}
.vg-stage-box {
  flex: 1 1 88px;
  min-width: 0;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}
.vg-stage-box.vg-tone-ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); background: var(--ok-bg); }
.vg-stage-box.vg-tone-accent { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--accent-soft); }
.vg-mini-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.92;
  direction: ltr;
  unicode-bidi: isolate;
}
.vg-pill > span:not(.ar) {
  direction: ltr;
  unicode-bidi: isolate;
}
.vg-big-arrow {
  font-size: 17px;
  font-weight: 900;
  color: var(--accent);
  flex-shrink: 0;
  align-self: center;
  direction: ltr;
}
.vg-result-banner {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.vg-result-banner:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
.vg-result-banner:active { transform: scale(0.99); }
.vg-result-banner.vg-tone-ok { border-color: var(--ok); background: var(--ok-bg); }
.vg-result-banner.vg-tone-accent { border-color: var(--accent); background: var(--accent-soft); }
.vg-depth-stage {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 8px;
  direction: rtl;
}
.vg-depth-line {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  direction: ltr;
}
.vg-depth-near, .vg-depth-far {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  padding: 8px 6px;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.vg-depth-near { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.vg-depth-far { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); opacity: 0.94; }
.vg-clash-active {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}
.vg-clash-active .vg-clash-x { color: var(--ok); }
.vg-clash-tag.on {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 800;
}
.vg-clash-tag.off {
  opacity: 0.4;
  text-decoration: line-through;
}

/* Sticky Floating Mini-Audio Player Bar (Listen All) */
.ats-mini-player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  width: min(640px, calc(100vw - 16px));
  z-index: 95;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.ats-mini-player[hidden] { display: none !important; }
body.has-mini-player .ats-main {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 92px);
}
body.has-mini-player .ats-toast {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 84px);
}
.mp-progress {
  height: 3px;
  background: var(--border-subtle);
  width: 100%;
}
.mp-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}
.mp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
}
.mp-meta {
  flex: 1 1 0;
  min-width: 0;
}
.mp-sub {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.mp-ar {
  font-size: 16px !important;
  line-height: 1.45 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.mp-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mp-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.mp-btn:hover { border-color: var(--accent); color: var(--accent); }
.mp-btn-main {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.mp-btn-main:hover { color: var(--accent-text); filter: brightness(1.06); }
.mp-btn-spd {
  width: auto;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}
.mp-btn-spd.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Tap-to-Hear Arabic Quiz Option Row */
.quiz-opt-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 8px;
}
.quiz-opt-row .quiz-opt {
  flex: 1;
  margin-bottom: 0;
}
.quiz-opt-speak {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  border-radius: 12px;
  width: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.quiz-opt-speak:hover { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt-speak.speaking { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.22); }

/* ==========================================================================
   v1.8.0 PERFORMANCE CONTAINMENT, SCROLL UX, PINCH HUD, SLIDER & DEV SUPPORT
   ========================================================================== */

/* Modal Scroll Lock & Smooth Mobile Containment */
html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
.ats-modal-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.chip-row {
  -webkit-overflow-scrolling: touch;
}

/* CSS Containment for 60 FPS Scrolling & Pinch-to-Zoom on Long Lists */
.lesson-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 152px;
  contain: layout style;
}
.tam-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
  contain: layout style;
}
.dict-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 128px;
  contain: layout style;
}
.example-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 230px;
  contain: layout style;
}

/* Top Reading Scroll Progress Bar */
.ats-scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  width: 100%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  contain: strict;
  transition: opacity 0.18s ease;
}
.ats-scroll-progress.visible {
  opacity: 0.92;
}
@supports (animation-timeline: scroll()) {
  @keyframes atsScrollScale {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
  .ats-scroll-progress.visible {
    animation: atsScrollScale linear both;
    animation-timeline: scroll(root block);
  }
}

/* Hands-Free Auto-Scroll Floating Pill */
.ats-autoscroll-pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 96;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}
.ats-autoscroll-pill[hidden] { display: none !important; }
body.has-mini-player .ats-autoscroll-pill {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 84px);
}
.as-pill-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.as-pill-btn:hover { border-color: var(--accent); color: var(--accent); }
.as-pill-main {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.as-pill-main:hover { color: var(--accent-text); filter: brightness(1.06); }
.as-pill-close { width: 32px; padding: 0; }

/* Floating Scroll-to-Top FAB */
.ats-scroll-top-btn {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 88;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
  transition: transform 0.16s ease, opacity 0.18s ease, background 0.15s ease;
}
.ats-scroll-top-btn[hidden] { display: none !important; }
.ats-scroll-top-btn:hover { background: var(--accent); color: var(--accent-text); }
.ats-scroll-top-btn:active { transform: scale(0.94); }
body.has-mini-player .ats-scroll-top-btn {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 86px);
}

/* Live Floating Pinch-Zoom HUD Pill */
.ats-zoom-hud {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.94);
  z-index: 9998;
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.ats-zoom-hud.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Today's Daily Activity Strip in Hero */
.hero-today-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.10);
  border: 1px solid var(--border);
  font-size: 12px;
}
.hero-today-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--accent);
}
.hero-today-meta {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Modern Professional Swipeable Arabic Learning Carousel Slider (NO Next Button) */
.ats-tips-slider-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 12px;
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.12) 0%, var(--card) 48%, rgba(34, 197, 94, 0.06) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
html.theme-golden-glint .ats-tips-slider-card,
html.theme-classic-light .ats-tips-slider-card {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}
.ats-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px 7px;
  border-bottom: 1px solid var(--border-subtle);
}
.ats-slider-head-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  flex-wrap: wrap;
  min-width: 0;
}
.ats-slider-head-ur {
  font-size: 13px !important;
  line-height: 1.5 !important;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--urdu);
  opacity: 0.88;
}
.ats-slider-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ats-slider-track::-webkit-scrollbar { display: none; }
.ats-slider-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 10px 14px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ats-slide-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ats-slide-tag-en {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
}
.ats-slide-tag-ur {
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  color: var(--muted) !important;
}
.ats-slide-ar {
  font-size: calc(var(--ar-fs) * 0.82) !important;
  line-height: 1.9 !important;
  text-align: right;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 9px;
  background: var(--surface-2);
  border-right: 3px solid var(--accent);
  margin: 2px 0;
}
.ats-slide-ar:hover { border-color: var(--accent); }
.ats-slide-ur {
  text-align: right;
  font-size: calc(var(--ur-fs) * 0.86) !important;
  line-height: 1.85 !important;
}
.ats-slide-en {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--english);
}
.ats-slide-ref {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.ats-slider-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 13px 9px;
  border-top: 1px solid var(--border-subtle);
}
.ats-slider-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ats-slider-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.30);
  cursor: pointer;
  transition: width 0.22s ease, background-color 0.22s ease;
}
.ats-slider-dot.active {
  width: 22px;
  background: var(--accent);
}
.ats-slider-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Developer & Support Card inside Settings Modal */
.ats-dev-card {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: left;
}
.ats-dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ats-dev-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.ats-dev-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 5px;
}
.ats-dev-msg {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 10px;
}
.ats-fb-lbl {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 7px 0 4px;
}
.ats-fb-select,
.ats-fb-notes {
  width: 100%;
  box-sizing: border-box;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
  margin-bottom: 6px;
  outline: none;
}
.ats-fb-select:focus,
.ats-fb-notes:focus {
  border-color: var(--accent);
}
.ats-fb-notes {
  min-height: 64px;
  resize: vertical;
  line-height: 1.45;
}
.ats-fb-diag-note {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 9px;
}
.ats-dev-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ats-dev-mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.ats-dev-mail-btn:hover {
  background: rgba(var(--accent-rgb), 0.25);
}
.ats-dev-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ats-dev-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ==========================================================================
   ATS v2.0.0 — WORLD-#1 FLAGSHIP DESIGN SYSTEM, HELLO ENGLISH / DUOLINGO UX
   Layered Atmospheric Sanctuary • 6 WCAG-AA/AAA Heritage Themes • Dual Urdu Fonts
   ========================================================================== */
:root {
  --ur-font: 'Noto Nastaliq Urdu', serif;
  --ur-lh: 2.26;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius: 16px;
  --radius-sm: 11px;
  --header-h: 60px;
  --nav-h: 66px;
  --lvl1: #10b981;
  --lvl2: #38bdf8;
  --lvl3: #f59e0b;
  --lvl4: #c084fc;
}

html[data-ur-font="jameel"] {
  --ur-font: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
  --ur-lh: 1.98;
}

/* 1. Emerald Sanctuary (New Flagship Default Theme — WCAG AAA Text Contrast) */
html.theme-emerald-sanctuary {
  --bg: #061413;
  --bg-glow: radial-gradient(ellipse 85% 44% at 50% 0%, rgba(228, 184, 91, 0.12), rgba(20, 128, 108, 0.09) 55%, transparent 100%);
  --surface: rgba(10, 30, 28, 0.90);
  --surface-solid: #0b201e;
  --surface-2: #122e2b;
  --card: #0e2422;
  --card-elev: linear-gradient(165deg, #13312e 0%, #0b1f1d 100%);
  --stage: #081a18;
  --border: rgba(228, 184, 91, 0.20);
  --border-subtle: rgba(255, 255, 255, 0.085);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.065);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  --accent: #e4b85b;
  --accent-2: #2dd4bf;
  --accent-hover: #f2cb79;
  --accent-rgb: 228, 184, 91;
  --accent-text: #061413;
  --text: #f3f7f5;
  --muted: #9bc0b8;
  --arabic: #fffcf0;
  --urdu: #f1ecdf;
  --english: #d0e1dc;
}

/* Upgrade Existing Themes with Atmospheric Depth & WCAG >= 4.5:1 Contrast */
html.theme-dark-luxury {
  --bg-glow: radial-gradient(ellipse 80% 42% at 50% 0%, rgba(220, 165, 76, 0.11), transparent 100%);
  --surface: rgba(20, 20, 24, 0.90);
  --surface-solid: #141418;
  --card-elev: linear-gradient(165deg, #1d1d24 0%, #131318 100%);
  --stage: #101014;
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  --accent-2: #34d399;
  --muted: #b0b0ba;
}

html.theme-golden-glint {
  --bg: #f8f2e4;
  --bg-glow: radial-gradient(ellipse 85% 40% at 50% 0%, rgba(15, 92, 71, 0.09), rgba(180, 134, 42, 0.06) 55%, transparent 100%);
  --surface: rgba(255, 252, 245, 0.92);
  --surface-solid: #fffcf5;
  --surface-2: #f1e8d6;
  --card: #fffdf8;
  --card-elev: linear-gradient(165deg, #ffffff 0%, #fbf5e8 100%);
  --stage: #f5ecda;
  --border: rgba(133, 98, 28, 0.22);
  --border-subtle: rgba(44, 34, 26, 0.10);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --shadow: 0 6px 20px rgba(74, 52, 16, 0.07);
  --accent: #0f5c47;
  --accent-2: #9b6d16;
  --accent-hover: #0a4938;
  --accent-rgb: 15, 92, 71;
  --accent-text: #ffffff;
  --text: #1c1714;
  --muted: #5a4f44;
  --arabic: #14110f;
  --urdu: #211b17;
  --english: #383029;
  --lvl1: #0d7a56; --lvl2: #0369a1; --lvl3: #b45309; --lvl4: #7e22ce;
}

html.theme-forest-green {
  --bg: #080d1a;
  --bg-glow: radial-gradient(ellipse 80% 45% at 50% 0%, rgba(99, 134, 245, 0.15), rgba(230, 192, 104, 0.07) 55%, transparent 100%);
  --surface: rgba(15, 23, 42, 0.90);
  --surface-solid: #0f172a;
  --surface-2: #182542;
  --card: #111c34;
  --card-elev: linear-gradient(165deg, #172546 0%, #0f182e 100%);
  --stage: #0c1428;
  --border: rgba(230, 192, 104, 0.20);
  --border-subtle: rgba(148, 163, 184, 0.13);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --shadow: 0 8px 24px rgba(2, 6, 23, 0.44);
  --accent: #e6c068;
  --accent-2: #60a5fa;
  --accent-hover: #f3d284;
  --accent-rgb: 230, 192, 104;
  --accent-text: #080d1a;
  --text: #f1f5f9;
  --muted: #a3b4cc;
  --arabic: #fffdf5;
  --urdu: #eaf0f8;
  --english: #cbd5e1;
}

html.theme-mocha-night {
  --bg-glow: radial-gradient(ellipse 80% 42% at 50% 0%, rgba(220, 165, 76, 0.12), transparent 100%);
  --surface: rgba(43, 30, 42, 0.92);
  --surface-solid: #2b1e2a;
  --card-elev: linear-gradient(165deg, #352534 0%, #271b26 100%);
  --stage: #221721;
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  --accent-2: #34d399;
}

html.theme-classic-light {
  --bg: #f3f6f9;
  --bg-glow: radial-gradient(ellipse 80% 38% at 50% 0%, rgba(15, 118, 110, 0.08), transparent 100%);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-2: #edf2f6;
  --card-elev: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  --stage: #f1f5f9;
  --border: rgba(15, 118, 110, 0.20);
  --border-subtle: rgba(15, 23, 42, 0.09);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  --accent-2: #b45309;
  --muted: #475569;
  --lvl1: #0f766e; --lvl2: #0284c7; --lvl3: #b45309; --lvl4: #7c3aed;
}

html.theme-oled-black {
  --bg-glow: radial-gradient(ellipse 75% 36% at 50% 0%, rgba(228, 184, 91, 0.10), transparent 100%);
  --surface: rgba(10, 10, 12, 0.92);
  --surface-solid: #0a0a0c;
  --card-elev: linear-gradient(165deg, #131317 0%, #08080a 100%);
  --stage: #060608;
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  --accent-2: #2dd4bf;
  --muted: #b0b0b8;
}

/* Dual Urdu Font Binding */
.ur {
  font-family: var(--ur-font) !important;
  line-height: var(--ur-lh);
}

/* Ensure native [hidden] always hides flex/button elements cleanly */
[hidden] { display: none !important; }

/* WCAG 2.2 Accessibility: Skip Link, Focus-Visible Rings, Reduced Motion */
.ats-skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 9999;
  background: var(--accent);
  color: var(--accent-text);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: top 0.16s var(--ease);
}
.ats-skip-link:focus { top: 10px; outline: 3px solid var(--text); outline-offset: 2px; }

:focus-visible {
  outline: 2.5px solid var(--accent) !important;
  outline-offset: 2px !important;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

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

/* Ambient Dome Glow & Frosted Glass Header */
.ats-ambient-glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 360px;
  background: var(--bg-glow);
  pointer-events: none;
  z-index: 0;
}

.ats-shell { position: relative; }
.ats-main { position: relative; z-index: 1; padding: 14px 14px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 26px); }

.ats-header {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: env(safe-area-inset-top, 0px) 12px 0;
  gap: 6px;
}
.ats-header-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.ats-brand {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  gap: 7px;
  color: var(--text);
  text-align: left;
  min-width: 0;
  max-width: 100%;
}
.ats-brand-ar {
  font-size: 1.05rem !important;
  line-height: 1.45 !important;
  white-space: nowrap;
}
.ats-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ats-logo-img {
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}
.ats-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.ats-stat-pill {
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.12);
}

/* Sculpted Material-3 Glass Bottom Navigation (Zero Cramped Nastaliq!) */
.ats-bottom-nav {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px);
  gap: 2px;
}
.nav-tab {
  min-height: 48px;
  gap: 3px;
  padding: 2px;
  background: transparent !important;
  transition: color 0.16s var(--ease);
}
.nav-pill {
  width: 48px;
  height: 30px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), transform 0.16s var(--ease);
}
.nav-pill .msr { font-size: 22px; }
.nav-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.15px; line-height: 1.15; }
.nav-tab.active .nav-pill {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.30);
}
.nav-tab:active .nav-pill { transform: scale(0.92); }

/* Elevated Cards with Specular Highlight */
.card, .lesson-card, .tam-card, .dict-card, .example-card, .exam-banner, .vg-card {
  background: var(--card-elev, var(--card));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow, none), var(--specular, none);
}
.lesson-card:hover, .tam-card:hover, .dict-card:hover { border-color: var(--border); }

/* Softened Dark-Mode Illustration Medallions (No Harsh White Glare!) */
.example-icon-wrap, .vg-thumb {
  background: #f5f0e4;
  border: 1.5px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 4px 12px rgba(0, 0, 0, 0.24);
}
html.theme-golden-glint .example-icon-wrap,
html.theme-classic-light .example-icon-wrap,
html.theme-golden-glint .vg-thumb,
html.theme-classic-light .vg-thumb {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Fade-Masked Horizontal Chip Rails */
.chip-row {
  -webkit-mask-image: linear-gradient(to right, #000 91%, transparent 100%);
  mask-image: linear-gradient(to right, #000 91%, transparent 100%);
  padding: 2px 2px 6px;
}
.chip {
  min-height: 36px;
  padding: 6px 13px;
  border-color: var(--border-subtle);
  background: var(--card);
}
.chip.active {
  box-shadow: 0 3px 10px rgba(var(--accent-rgb), 0.25);
}

/* Primary Buttons & Touch Ergonomics */
.btn { min-height: 42px; border-radius: 12px; border-color: var(--border-subtle); }
.btn-sm { min-height: 36px; border-radius: 10px; }
.btn-primary { box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28); }
.btn:active { transform: scale(0.975); }

/* ==========================================================================
   HELLO ENGLISH + DUOLINGO COMPACT RESUME HERO & ABOVE-THE-FOLD DASHBOARD
   ========================================================================== */
.hero-v2 {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 13px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.16) 0%, var(--card) 56%, var(--surface-solid, var(--surface)) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow, none), var(--specular, none);
}
.hero-v2::after {
  content: '';
  position: absolute;
  top: -36px;
  right: -36px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 70%);
  pointer-events: none;
}
.hero-v2-top {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  z-index: 1;
}
.ats-ring-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ats-ring-svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ats-ring-bg { fill: none; stroke: rgba(var(--accent-rgb), 0.22); stroke-width: 5; }
.ats-ring-fg { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.5s var(--ease); }
.ats-ring-pct { position: absolute; font-size: 12.5px; font-weight: 800; color: var(--text); }

.hero-v2-meta { flex: 1; min-width: 0; }
.hero-v2-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.hero-v2-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-v2-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.hero-v2-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}
.hero-v2-pill {
  background: var(--stage, var(--surface-2));
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 7px 6px;
  text-align: center;
}
.hero-v2-pill strong { display: block; font-size: 14px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.hero-v2-pill span { font-size: 10.5px; color: var(--muted); font-weight: 600; }

/* Hello English Style Daily Action Duo (Word of the Day + Quick Grammar) */
.daily-duo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}
.daily-tile {
  background: var(--card-elev, var(--card));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--specular, none);
  border-radius: 15px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  text-align: left;
  color: var(--text);
  min-height: 106px;
  transition: transform 0.14s var(--ease), border-color 0.16s;
}
.daily-tile:active { transform: scale(0.975); }
.daily-tile:hover { border-color: var(--accent); }
.daily-tile-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.daily-word-ar {
  font-size: 22px !important;
  line-height: 1.7 !important;
  text-align: right;
  color: var(--arabic);
}
.daily-word-sub {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

/* Color-Coded 4-Level Lesson Cards (Duolingo/Busuu Proficiency Bands) */
.level-header {
  border-bottom: none;
  margin: 16px 2px 8px;
  padding: 0;
}
.lesson-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 14px 14px 13px;
}
.lesson-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--lvl-color, var(--accent));
}
.lesson-card[data-lvl="1"] { --lvl-color: var(--lvl1); }
.lesson-card[data-lvl="2"] { --lvl-color: var(--lvl2); }
.lesson-card[data-lvl="3"] { --lvl-color: var(--lvl3); }
.lesson-card[data-lvl="4"] { --lvl-color: var(--lvl4); }
.lesson-card .lesson-num-circle {
  background: color-mix(in srgb, var(--lvl-color, var(--accent)) 15%, transparent);
  color: var(--lvl-color, var(--accent));
  border-color: color-mix(in srgb, var(--lvl-color, var(--accent)) 35%, transparent);
}
.lesson-card.completed .lesson-num-circle {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}

/* Practice Arena — Perfectly Balanced 3x2 (6-Mode) Grid (ZERO Orphan Holes!) */
.practice-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
@media (min-width: 640px) {
  .practice-mode-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.pmode-btn {
  background: var(--card-elev, var(--card));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--specular, none);
  border-radius: 14px;
  padding: 10px 6px;
  min-height: 76px;
  transition: transform 0.14s var(--ease), border-color 0.16s, background 0.16s;
}
.pmode-btn:active { transform: scale(0.96); }
.pmode-btn.active {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.25);
}

/* Drops/Duolingo-Style Pair Match Board */
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 12px 0;
}
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-tile {
  appearance: none;
  width: 100%;
  min-height: 62px;
  border-radius: 13px;
  border: 1.5px solid var(--border-subtle);
  background: var(--card-elev, var(--card));
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  transition: transform 0.12s var(--ease), border-color 0.15s, background 0.15s, opacity 0.2s;
}
.match-tile:active { transform: scale(0.96); }
.match-tile.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.24);
}
.match-tile.matched {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  opacity: 0.55;
  pointer-events: none;
}
.match-tile.wrong {
  border-color: var(--err);
  background: var(--err-bg);
}

/* Rich Per-Lesson Quiz Cards */
.quiz-lesson-card {
  background: var(--card-elev, var(--card));
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--lvl-color, var(--accent));
  box-shadow: var(--specular, none);
  border-radius: 14px;
  padding: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  color: var(--text);
  min-height: 92px;
  transition: transform 0.14s var(--ease), border-color 0.16s;
}
.quiz-lesson-card:hover { border-color: var(--accent); }
.quiz-lesson-card:active { transform: scale(0.975); }
.quiz-lesson-card[data-lvl="1"] { --lvl-color: var(--lvl1); }
.quiz-lesson-card[data-lvl="2"] { --lvl-color: var(--lvl2); }
.quiz-lesson-card[data-lvl="3"] { --lvl-color: var(--lvl3); }
.quiz-lesson-card[data-lvl="4"] { --lvl-color: var(--lvl4); }

/* Settings Modal Elevated Sheet */
.ats-modal {
  background: var(--surface-solid, var(--surface));
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.48);
}
@media (min-width: 600px) { .ats-modal { border-radius: 22px; } }
.ats-modal-backdrop { backdrop-filter: blur(5px); }


/* ==========================================================================
   ATS v3.0.0 — HUGE VISUAL GRAPHICS, EFFORTLESS NAVIGATION & SECTION JUMPS
   ========================================================================== */

/* Header Compact Fit (Zero Arabic Title Clipping even with 3 action buttons!) */
.ats-header {
  padding: env(safe-area-inset-top, 0px) 10px 0;
  gap: 5px;
}
.ats-logo-img { width: 32px; height: 32px; flex-shrink: 0; }
.ats-brand-ar { font-size: 0.98rem !important; line-height: 1.4 !important; }
.ats-header-actions { gap: 5px; }
.ats-icon-btn { width: 35px; height: 35px; border-radius: 10px; }
.ats-icon-btn .msr { font-size: 19px; }
.ats-nav-trigger {
  border-color: var(--border);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}
.ats-stat-pill {
  height: 34px;
  padding: 0 8px;
  font-size: 11.5px;
  cursor: pointer;
  color: var(--accent);
}
@media (max-width: 355px) {
  .ats-brand-ar { font-size: 0.88rem !important; }
  .ats-stat-pill { padding: 0 6px; font-size: 11px; }
  .ats-icon-btn { width: 32px; height: 32px; }
}

/* Custom Modest Vector Hero Artwork */
.ats-hero-svg {
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

/* Hero Banner v3 with Huge Visual Art & Clickable Stat Shortcuts */
.hero-v3-row {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.hero-v3-art {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-v3-ring-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-solid, var(--surface));
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.hero-v3-copy { flex: 1; min-width: 0; }
.hero-v3-cta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hero-metric-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.16s, background 0.16s, transform 0.12s;
  min-height: 48px;
}
.hero-metric-btn:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.hero-metric-btn:active { transform: scale(0.97); }

/* Daily Word v3 with Crisp 56px Illustration */
.daily-word-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 2px;
}
.daily-word-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  padding: 4px;
  flex-shrink: 0;
}

/* Sticky Level & Section Quick-Jump Bars */
.level-jump-bar {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 36;
  margin: 0 -14px 12px;
  padding: 8px 14px 7px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}
.level-jump-bar .chip-row { margin-bottom: 0; padding-bottom: 2px; }
.lvl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 12px;
}
.lvl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Sticky In-Lesson Section Jump Rail (Visual • Rules • Examples • Words) */
.lesson-sec-jump {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 38;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -14px 12px;
  padding: 7px 14px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}
.lesson-sec-jump::-webkit-scrollbar { display: none; }
.sec-jump-pill {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--card);
  color: var(--text);
  border-radius: 99px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.sec-jump-pill:hover, .sec-jump-pill.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}
.sec-jump-pill:active { transform: scale(0.96); }
.lesson-sec-anchor { scroll-margin-top: 124px; }

/* Huge Visual Lesson Cards (Home Path) */
.lesson-card-v3 {
  display: flex;
  gap: 12px;
  align-items: center;
}
.lesson-art-box {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  padding: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible !important;
}
.badge { white-space: nowrap; flex-shrink: 0; }
.lesson-art-box img { width: 100%; height: 100%; object-fit: contain; }
.lesson-art-num {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  background: var(--lvl-color, var(--accent));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.lesson-card[data-lvl="1"] .lesson-art-num { background: var(--lvl1); }
.lesson-card[data-lvl="2"] .lesson-art-num { background: var(--lvl2); }
.lesson-card[data-lvl="3"] .lesson-art-num { background: var(--lvl3); }
.lesson-card[data-lvl="4"] .lesson-art-num { background: var(--lvl4); }
.lesson-card.completed .lesson-art-num { background: var(--ok); }
.lesson-card-body { flex: 1; min-width: 0; }

/* Enhanced Studio Bar with Lesson Picker & Prev/Next Quick Arrows */
.studio-nav-cluster {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.studio-lesson-picker {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 5px 10px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
}
.studio-lesson-picker:hover { border-color: var(--accent); }
.studio-hero-v3 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.studio-hero-art {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  padding: 7px;
  flex-shrink: 0;
}
.studio-hero-art img { width: 100%; height: 100%; object-fit: contain; }
.studio-tabs-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.studio-tabs-4 .studio-tab {
  padding: 8px 4px;
  font-size: 11.5px;
  flex-direction: column;
  gap: 2px;
}

/* Huge Example Card Artwork (84x84px!) */
.example-icon-lg {
  width: 82px !important;
  height: 82px !important;
  border-radius: 18px !important;
  padding: 6px !important;
}
.example-icon-lg img { width: 100%; height: 100%; object-fit: contain; }

/* Page Visual Hero Banners (Tamreens, Exams, Dictionary) */
.page-hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 15px;
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.15) 0%, var(--card) 62%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow, none), var(--specular, none);
}
.page-hero-copy { flex: 1; min-width: 0; }

/* Exam Banner v3 with Huge SVG Crest */
.exam-banner-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

/* Giant Drops-Style Flashcard & Practice Visuals */
.flash-illus-giant {
  width: 146px !important;
  height: 146px !important;
  border-radius: 26px !important;
  padding: 10px !important;
  margin: 4px auto 8px;
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.11), 0 10px 26px rgba(0, 0, 0, 0.28) !important;
}
.flash-illus-giant img { width: 100%; height: 100%; object-fit: contain; }

.listen-opt-card .listen-illus-lg {
  width: 88px !important;
  height: 88px !important;
  border-radius: 18px !important;
  padding: 6px !important;
}
.listen-opt-card .listen-illus-lg img { width: 100%; height: 100%; object-fit: contain; }

.prac-ctx-illus {
  width: 82px !important;
  height: 82px !important;
  border-radius: 18px !important;
  padding: 6px !important;
  flex-shrink: 0;
}
.prac-ctx-illus img { width: 100%; height: 100%; object-fit: contain; }

/* Gender Trainer 2-Column Visual Choice Cards (Zero Mixed-Script Clipping!) */
.gender-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.gender-choice-card {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--card-elev, var(--card));
  color: var(--text);
  border-radius: 16px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  min-height: 112px;
  transition: transform 0.12s, border-color 0.16s, background 0.16s;
}
.gender-choice-card:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.gender-choice-card.correct { border-color: var(--ok); background: var(--ok-bg); }
.gender-choice-card.wrong { border-color: var(--err); background: var(--err-bg); }
.gender-choice-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

/* Per-Lesson Quiz Cards with Lesson Artwork Medallion */
.quiz-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}
.quiz-card-art {
  width: 44px !important;
  height: 44px !important;
  border-radius: 11px !important;
  padding: 3px !important;
  flex-shrink: 0;
}
.quiz-card-art img { width: 100%; height: 100%; object-fit: contain; }

/* Visual Picture Dictionary Grid (Drops-Style 2-Column Giant Cards!) */
.dict-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dict-pic-card {
  background: var(--card-elev, var(--card));
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 12px 10px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow, none), var(--specular, none);
  transition: border-color 0.16s, transform 0.12s;
  min-width: 0;
}
.dict-pic-card:hover { border-color: var(--accent); }
.dict-pic-card:active { transform: scale(0.98); }
.dict-pic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2px;
}
.dict-pic-illus {
  width: 98px !important;
  height: 98px !important;
  border-radius: 20px !important;
  padding: 7px !important;
  margin: 2px auto 4px;
}
.dict-pic-illus img { width: 100%; height: 100%; object-fit: contain; }
.dict-pic-ar {
  font-size: calc(var(--ar-fs) * 0.88) !important;
  line-height: 1.75 !important;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.dict-pic-en {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.25;
}
.dict-view-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.dict-view-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  min-height: 30px;
}
.dict-view-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

/* Global Quick-Jump Navigator Drawer */
.ats-nav-modal { max-width: 520px; }
.nav-drawer-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}
.nav-drawer-tab {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 11px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  min-height: 52px;
}
.nav-drawer-tab.active {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: var(--accent);
  color: var(--accent);
}
.nav-lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.nav-lesson-tile {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  cursor: pointer;
  min-height: 60px;
  min-width: 0;
  transition: border-color 0.15s;
}
.nav-lesson-tile:hover, .nav-lesson-tile.current {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}
.nav-lesson-tile.done { border-color: var(--ok-border); }
.nav-lesson-ico {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  padding: 3px !important;
  flex-shrink: 0;
}
.nav-lesson-ico img { width: 100%; height: 100%; object-fit: contain; }
.nav-tam-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.nav-tam-pill {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  min-height: 42px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-tam-pill:hover { border-color: var(--accent); color: var(--accent); }
.nav-tam-pill.done { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.nav-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Word Spotlight Modal (Giant 164px Picture Poster) */
.word-spot-hero {
  text-align: center;
  padding: 10px 4px 4px;
}
.word-spot-illus {
  width: 164px !important;
  height: 164px !important;
  border-radius: 28px !important;
  padding: 12px !important;
  margin: 0 auto 12px;
  box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0.12), 0 12px 30px rgba(0, 0, 0, 0.30) !important;
}
.word-spot-illus img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 340px) {
  .lesson-art-box { width: 66px; height: 66px; }
  .dict-pic-illus { width: 82px !important; height: 82px !important; }
  .nav-tam-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* ==========================================================================
   ATS v3.1.0 — COGNITIVE-SCIENCE INSTRUCTIONAL ANIMATIONS & MICRO-UX
   Learner-Paced • Tap-Controlled • Strict prefers-reduced-motion Compliance
   ========================================================================== */
.vg-morph-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: rtl;
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 6px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  overflow: hidden;
}
.vg-morph-prefix {
  display: inline-block;
  font-size: 26px !important;
  line-height: 1.4 !important;
  color: var(--ok) !important;
  font-weight: 800;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease, max-width 0.36s ease;
}
.vg-morph-stage.is-indef .vg-morph-prefix {
  opacity: 0.22;
  transform: translateX(18px) scale(0.82);
  text-decoration: line-through;
}
.vg-morph-stage.is-def .vg-morph-prefix {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.vg-morph-stem {
  font-size: 28px !important;
  line-height: 1.4 !important;
  color: var(--arabic) !important;
}
.vg-morph-tanween {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  direction: ltr;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.vg-morph-tanween.active {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}
.vg-morph-tanween.dropped {
  background: var(--err-bg);
  color: var(--err);
  text-decoration: line-through;
}

/* Smooth SVG Seesaw Pivot (Lesson 20) */
.vg-seesaw-beam {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Live Audio Equalizer Bars (Only active during playback!) */
.ats-eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 13px;
  margin-right: 4px;
  vertical-align: middle;
}
.ats-eq-bars i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: var(--accent);
  font-style: normal;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes atsSlideIn {
    0% { opacity: 0; transform: translateX(-16px) scale(0.96); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
  }
  @keyframes atsPopConfirm {
    0% { opacity: 0.4; transform: scale(0.95); }
    60% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
  }
  @keyframes atsDualSplit {
    0% { opacity: 0.3; transform: scale(0.86); letter-spacing: -4px; }
    100% { opacity: 1; transform: scale(1); letter-spacing: 0; }
  }
  @keyframes atsArrowPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
  }
  @keyframes atsRadarPulse {
    0% { opacity: 0.85; transform: scale(0.92); }
    100% { opacity: 0.25; transform: scale(1.12); }
  }
  @keyframes atsShake {
    0%, 100% { transform: translateX(0); }
    22% { transform: translateX(-6px); }
    45% { transform: translateX(6px); }
    68% { transform: translateX(-4px); }
    85% { transform: translateX(3px); }
  }
  @keyframes atsEqBounce {
    0%, 100% { height: 4px; }
    50% { height: 13px; }
  }

  .vg-anim-slide-in { animation: atsSlideIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .vg-anim-pop { animation: atsPopConfirm 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .vg-anim-dual-split .vg-dual-pair img:first-child { animation: atsSlideIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .vg-anim-dual-split .vg-dual-pair img:last-child { animation: atsPopConfirm 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .vg-anim-arrow { animation: atsArrowPulse 0.65s ease-in-out 1; }
  .vg-morph-stage.is-def .vg-morph-prefix { animation: atsSlideIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .vg-radar-ring { transform-box: fill-box; transform-origin: center; animation: atsRadarPulse 1.4s ease-out infinite; }
  .vg-orb-active { transform-box: fill-box; transform-origin: center; animation: atsPopConfirm 0.32s ease-out both; }

  /* Tactile Practice Micro-Interactions */
  .flashcard.flipped { animation: atsPopConfirm 0.26s ease-out both; }
  .builder-zone .word-tile { animation: atsPopConfirm 0.22s ease-out both; }
  .match-tile.wrong, .quiz-opt.wrong, .gender-choice-card.wrong, .listen-opt-card.wrong {
    animation: atsShake 0.30s ease-in-out both;
  }
  .match-tile.matched, .quiz-opt.correct, .gender-choice-card.correct, .listen-opt-card.correct {
    animation: atsPopConfirm 0.28s ease-out both;
  }
  .ats-eq-bars i:nth-child(1) { animation: atsEqBounce 0.55s ease-in-out infinite; }
  .ats-eq-bars i:nth-child(2) { animation: atsEqBounce 0.55s 0.16s ease-in-out infinite; }
  .ats-eq-bars i:nth-child(3) { animation: atsEqBounce 0.55s 0.32s ease-in-out infinite; }
  .speaking { box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(var(--accent-rgb), 0.35) !important; }
}


/* ==========================================================================
   ATS v4.0.0 — 100/100 HUGE INTERACTIVE ANIMATED LESSON PLAYER & LAUNCHERS
   Full-Screen Guided Discovery • 260px+ Animated SVG Worlds • All-Ages Comfort
   WCAG 2.2 AA/AAA Contrast (All 6 Themes) • prefers-reduced-motion Compliant
   ========================================================================== */

.al-player-open { overflow: hidden !important; }

/* Luminous Launch Pills & Lesson Studio Animated Banner */
.al-glow-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #f59e0b 100%) !important;
  color: #061413 !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.34);
}
.al-card-play-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  min-height: 28px;
  transition: transform 0.14s var(--ease), background 0.16s;
}
.al-card-play-pill .msr { font-size: 15px; }
.al-card-play-pill:active { transform: scale(0.94); }

.al-studio-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin: 10px 0 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(234, 179, 8, 0.18) 100%);
  border: 1.5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.18s;
}
.al-studio-banner:active { transform: scale(0.985); }
.al-studio-banner-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eab308, #10b981);
  color: #061413;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.34);
}
.al-studio-banner-ico .msr { font-size: 28px; }
.al-studio-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: var(--accent);
  text-transform: uppercase;
}
.al-studio-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.al-studio-go {
  width: 38px;
  height: 38px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Confetti Canvas Overlay */
.ats-fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 12050;
}

/* Full-Screen Animated Lesson Player Shell */
.al-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.al-shell {
  width: 100%;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.al-top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
  flex-shrink: 0;
}
.al-ico-btn {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 12.5px;
}
.al-ico-btn:hover { border-color: var(--accent); color: var(--accent); }
.al-comfort-btn { width: auto; padding: 0 9px; font-size: 12px; }
.al-prog-segs {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.al-seg {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: var(--surface-2);
  transition: background 0.28s var(--ease), transform 0.25s;
}
.al-seg.done { background: #10b981; }
.al-seg.cur { background: linear-gradient(90deg, #eab308, #34d399); transform: scaleY(1.25); }
.al-combo-pill {
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid #f59e0b;
  color: #f59e0b;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.al-kicker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 14px 8px;
  gap: 8px;
  flex-shrink: 0;
}
.al-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.65px;
  color: var(--accent);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.al-step-num {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.al-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.al-stage-card {
  background: var(--card-elev, var(--card));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow, none);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.al-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.al-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
  padding: 4px 10px;
  border-radius: 99px;
}
.al-stage-lesson-tag {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text);
}
.al-stage-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.38;
  color: var(--text);
}
.al-stage-title .ar-inline {
  font-size: 1.08em !important;
  line-height: 1.3 !important;
}
.al-stage-ur {
  font-size: 15px !important;
  line-height: 1.95 !important;
  color: var(--accent) !important;
  text-align: right;
  margin-top: -2px;
}

/* Deep Theater Canvas for Animated 260px SVG Worlds (High Contrast in ALL 6 Themes!) */
.al-svg-frame {
  border-radius: 18px;
  background: linear-gradient(155deg, #06211c 0%, #0b332b 100%);
  border: 1.5px solid rgba(234, 179, 8, 0.42);
  padding: 6px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.32), 0 8px 22px rgba(0, 0, 0, 0.22);
}
.al-world-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 188px;
  max-height: 248px;
}
.al-svg-ar {
  font-family: 'AlQuran Neo v5x1', 'AlQuran Neo', serif;
  font-weight: 400;
  direction: rtl;
  unicode-bidi: plaintext;
}

/* Interactive Control Pills */
.al-pill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}
.al-world-pill {
  appearance: none;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 13px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.13s var(--ease), border-color 0.16s, background 0.16s;
}
.al-world-pill:active { transform: scale(0.95); }
.al-world-pill.active {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.25);
}
.ar-pill-txt { font-family: 'Outfit', system-ui, sans-serif; }
.al-world-pill .ar-inline { font-size: 1.15em !important; line-height: 1.3 !important; }
@media (max-height: 760px) {
  .al-world-svg { min-height: 158px; max-height: 204px; }
}

/* Live Audio Caption & Companion Guide Tip */
.al-live-caption {
  border-radius: 16px;
  background: var(--stage, var(--surface-2));
  border: 1px solid var(--border);
  padding: 11px 12px;
  cursor: pointer;
}
.al-live-cap-row { display: flex; align-items: center; gap: 10px; }
.al-spk-fab {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #10b981);
  color: #061413;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}
.al-live-ar { font-size: 25px !important; line-height: 1.65 !important; color: var(--arabic); }
.al-live-ur { font-size: 14px !important; line-height: 1.9 !important; color: var(--urdu); }
.al-live-en { font-size: 13px; font-weight: 600; color: var(--english, var(--muted)); text-align: left; margin-top: 2px; }

.al-guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.30);
}
.al-lantern-ico { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.al-tip-en { font-size: 12.5px; line-height: 1.45; color: var(--text); font-weight: 600; }
.al-tip-ur { font-size: 13px !important; line-height: 1.9 !important; color: var(--muted) !important; text-align: right; margin-top: 3px; }

/* Act 2: Spotlight & Word-by-Word Interactive Chips */
.al-spot-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.al-spot-art {
  width: 132px;
  height: 132px;
  border-radius: 24px;
  background: #ffffff;
  border: 2.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}
.al-spot-img { object-fit: contain; border-radius: 14px; }
.al-spot-audio-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.al-big-spk-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #061413;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
}
.al-slow-spk-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.al-spot-sentence {
  text-align: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--stage, var(--surface-2));
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}
.al-spot-ar { font-size: 31px !important; line-height: 1.75 !important; color: var(--arabic); }
.al-spot-ur { font-size: 15.5px !important; line-height: 2 !important; color: var(--accent) !important; }
.al-spot-en { font-size: 14.5px; font-weight: 700; color: var(--text); margin-top: 3px; }
.al-wbw-label { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.al-wbw-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.al-wbw-chip {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  min-width: 78px;
  border-radius: 15px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s, border-color 0.18s, background 0.18s;
}
.al-wbw-chip:active { transform: scale(0.94); }
.al-wbw-chip.lit {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.24);
}
.al-wbw-ar { font-size: 22px !important; line-height: 1.55 !important; color: var(--arabic); }
.al-wbw-ur { font-size: 12px !important; line-height: 1.7 !important; color: var(--muted) !important; }

/* Act 3: Build-a-Sentence Workshop */
.al-solved-chip {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 11.5px;
  font-weight: 800;
}
.al-build-prompt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--stage, var(--surface-2));
  border: 1px solid var(--border-subtle);
}
.al-build-art {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.al-build-img { object-fit: contain; border-radius: 10px; }
.al-build-en { font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.3; }
.al-build-ur { font-size: 14px !important; line-height: 1.9 !important; color: var(--accent) !important; text-align: right; margin-top: 2px; }

.al-drop-zone {
  min-height: 78px;
  padding: 12px;
  border-radius: 18px;
  border: 2px dashed var(--border);
  background: rgba(var(--accent-rgb), 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.al-drop-zone.is-ok { border-style: solid; border-color: #10b981; background: rgba(16, 185, 129, 0.14); }
.al-drop-placeholder { font-size: 13px; font-weight: 600; color: var(--muted); direction: ltr; text-align: center; }

.al-tile-bank { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; padding: 4px 0; }
.al-tile {
  appearance: none;
  padding: 10px 16px;
  min-height: 48px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--arabic);
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.13s var(--ease), opacity 0.18s;
}
.al-tile .ar { font-size: 24px !important; line-height: 1.45 !important; }
.al-tile:active { transform: translateY(2px) scale(0.96); }
.al-tile.is-used { opacity: 0.25; pointer-events: none; box-shadow: none; }
.al-tile-placed {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
}
.al-build-actions { display: flex; gap: 8px; }
.al-btn-ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  min-height: 46px;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.al-btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.al-btn-check {
  appearance: none;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  min-height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
}
.al-btn-check:disabled { opacity: 0.4; cursor: not-allowed; }

/* Act 4: Quick Visual / Audio Challenge */
.al-quiz-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px;
}
.al-audio-hero-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 20px;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.24), rgba(16, 185, 129, 0.2));
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.al-quiz-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.al-quiz-opt {
  appearance: none;
  width: 100%;
  min-height: 58px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.13s, border-color 0.16s, background 0.16s;
}
.al-quiz-opt:active { transform: scale(0.98); }
.al-quiz-opt.is-ok { border-color: #10b981; background: rgba(16, 185, 129, 0.2); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.28); }
.al-quiz-opt.is-try { border-color: #f59e0b; background: rgba(245, 158, 11, 0.16); }
.al-qopt-ar { font-size: 24px !important; line-height: 1.55 !important; color: var(--arabic); }
.al-qopt-en { font-size: 14px; font-weight: 700; color: var(--text); text-align: left; }
.al-qopt-ur { font-size: 13.5px !important; line-height: 1.85 !important; color: var(--muted) !important; text-align: right; }

/* Warm Encouraging Praise Banner */
.al-praise-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1.5px solid #10b981;
  background: rgba(16, 185, 129, 0.16);
}
.al-praise-banner.is-retry {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}
.al-praise-icon { font-size: 24px; flex-shrink: 0; }
.al-praise-ar { font-size: 20px !important; line-height: 1.5 !important; color: var(--accent); text-align: right; }
.al-praise-en { font-size: 13.5px; font-weight: 800; color: var(--text); }
.al-praise-ur { font-size: 13.5px !important; line-height: 1.85 !important; color: var(--urdu); text-align: right; }

/* Act 5: Grand Trophy Celebration */
.al-celebrate-card {
  background: var(--card-elev, var(--card));
  border: 1.5px solid var(--accent);
  border-radius: 24px;
  padding: 18px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.al-trophy-svg { width: 170px; height: 140px; }
.al-cel-ar { font-size: 26px !important; color: var(--accent); line-height: 1.6 !important; }
.al-cel-title { margin: 0; font-size: 22px; font-weight: 900; color: var(--text); }
.al-cel-ur { font-size: 15px !important; line-height: 1.95 !important; color: var(--urdu); }
.al-cel-stars { font-size: 30px; letter-spacing: 8px; color: #eab308; text-shadow: 0 2px 12px rgba(234, 179, 8, 0.45); }
.al-cel-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0;
}
.al-cel-stat {
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--stage, var(--surface-2));
  border: 1px solid var(--border-subtle);
}
.al-cel-stat strong { display: block; font-size: 17px; font-weight: 900; color: var(--accent); }
.al-cel-stat span { font-size: 11px; color: var(--muted); font-weight: 700; }
.al-cel-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* Sticky Bottom Continue Bar */
.al-foot-bar {
  display: flex;
  gap: 9px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface);
  flex-shrink: 0;
}
.al-btn-back {
  appearance: none;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.al-btn-next {
  appearance: none;
  flex: 1;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #061413;
  font-size: 15px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(234, 179, 8, 0.34);
}
.al-btn-next.locked { opacity: 0.42; box-shadow: none; cursor: not-allowed; }
.al-btn-grand { width: 100%; }

/* All-Ages Universal Comfort Text Scaling (A+ and A++ for Kids & Elders!) */
.al-overlay[data-comfort="1"] .al-stage-title { font-size: 18.5px; }
.al-overlay[data-comfort="1"] .al-live-ar { font-size: 29px !important; }
.al-overlay[data-comfort="1"] .al-spot-ar { font-size: 36px !important; }
.al-overlay[data-comfort="1"] .al-live-en,
.al-overlay[data-comfort="1"] .al-tip-en { font-size: 15px; }
.al-overlay[data-comfort="1"] .al-live-ur,
.al-overlay[data-comfort="1"] .al-stage-ur { font-size: 17px !important; }

.al-overlay[data-comfort="2"] .al-stage-title { font-size: 20.5px; }
.al-overlay[data-comfort="2"] .al-live-ar { font-size: 33px !important; }
.al-overlay[data-comfort="2"] .al-spot-ar { font-size: 40px !important; }
.al-overlay[data-comfort="2"] .al-live-en,
.al-overlay[data-comfort="2"] .al-tip-en,
.al-overlay[data-comfort="2"] .al-build-en { font-size: 17px; }
.al-overlay[data-comfort="2"] .al-live-ur,
.al-overlay[data-comfort="2"] .al-stage-ur { font-size: 19px !important; }
.al-overlay[data-comfort="2"] .al-tile .ar { font-size: 28px !important; }

/* Light-Theme Crystal-Clear High-Contrast Primary Controls */
html.theme-golden-glint .al-btn-next,
html.theme-classic-light .al-btn-next,
html.theme-golden-glint .al-glow-cta,
html.theme-classic-light .al-glow-cta,
html.theme-golden-glint .al-big-spk-btn,
html.theme-classic-light .al-big-spk-btn {
  background: linear-gradient(135deg, #0f766e 0%, #065f46 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 5px 16px rgba(15, 118, 110, 0.28);
}
html.theme-golden-glint .al-spk-fab,
html.theme-classic-light .al-spk-fab {
  background: linear-gradient(135deg, #0f766e 0%, #059669 100%) !important;
  color: #ffffff !important;
}

/* Pure CSS/SVG Micro-Animations (Respects prefers-reduced-motion!) */
@media (prefers-reduced-motion: no-preference) {
  .al-dash-flow { animation: alDashFlow 1.8s linear infinite; }
  .al-pulse-halo { animation: alPulseHalo 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .al-pop-in { animation: alPopIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both; transform-box: fill-box; transform-origin: center; }
  .al-slide-left { animation: alSlideLeft 0.38s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .al-slide-right { animation: alSlideRight 0.38s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .al-slide-up { animation: alSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .al-spin-gentle { animation: alSpinGentle 5.5s linear infinite; }
  .al-twinkle { animation: alTwinkle 2.2s ease-in-out infinite; }
  .al-drop-zone.is-shake { animation: alShake 0.36s ease; }
  .al-praise-banner { animation: alSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .al-tile-placed { animation: alPopIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both; }
}
@keyframes alDashFlow { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes alPulseHalo { 0%, 100% { opacity: 0.72; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes alPopIn { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }
@keyframes alSlideLeft { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes alSlideRight { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes alSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes alSpinGentle { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes alTwinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes alShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }


/* ==========================================================================
   ATS v4.1.0 — ZERO-FRICTION SINGULAR + PLURAL VISUAL DICTIONARY & SPOTLIGHT
   Instant Tap-to-Hear Singular & Plural Directly on Every Card • Zero Close/Reopen
   ========================================================================== */
.dict-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dict-pic-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.dict-g-badge {
  font-size: 10.5px !important;
  padding: 1px 6px !important;
  line-height: 1.45 !important;
}
.dict-l-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  white-space: nowrap;
}
.dict-pic-ar-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0 4px;
  margin: 0;
  cursor: pointer;
  max-width: 100%;
  border-radius: 8px;
  transition: background 0.14s;
}
.dict-pic-ar-btn:hover,
.dict-pic-ar-btn:active {
  background: rgba(var(--accent-rgb), 0.12);
}
.dict-pic-plural-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 5px;
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  padding: 3px 8px;
  margin: 2px 0 3px;
  border-radius: 11px;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-width: 0;
}
.dict-pic-plural-btn:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
}
.dict-pic-plural-btn:active {
  transform: scale(0.97);
}
.dict-pl-tag {
  font-family: var(--font-ur, 'Noto Nastaliq Urdu', serif);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
  border-radius: 6px;
  padding: 0 5px;
  line-height: 1.55;
  flex-shrink: 0;
}
.dict-pic-pl-ar {
  font-size: calc(var(--ar-fs) * 0.72) !important;
  line-height: 1.6 !important;
  color: var(--text);
  overflow-wrap: anywhere;
  min-width: 0;
}
.dict-pl-ico {
  font-size: 14px !important;
  color: var(--accent);
  flex-shrink: 0;
}
.dict-pic-nopl {
  font-size: 10.5px;
  padding: 4px 0 2px;
  opacity: 0.72;
}
.dict-pic-ur {
  line-height: 1.75 !important;
  max-width: 100%;
}
.dict-reveal-btn {
  appearance: none;
  border: 1px dashed rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  border-radius: 10px;
  padding: 5px 10px;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  cursor: pointer;
  min-height: 32px;
}
.dict-reveal-btn:hover {
  background: rgba(var(--accent-rgb), 0.16);
}

/* List View Twin Singular + Plural Bar */
.dict-list-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dict-morph-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  direction: rtl;
}
.dict-morph-pill {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 13px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
  min-width: 0;
  transition: border-color 0.15s, background 0.15s;
}
.dict-morph-pill.dict-morph-pl {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.09);
}
.dict-morph-pill:hover {
  border-color: var(--accent);
}
.dict-morph-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  direction: ltr;
}
.dict-morph-pl .dict-morph-lbl {
  color: var(--accent);
}
.dict-morph-ar {
  font-size: calc(var(--ar-fs) * 0.86) !important;
  line-height: 1.65 !important;
  overflow-wrap: anywhere;
}
.dict-morph-pill .dict-pl-ico {
  position: absolute;
  top: 6px;
  left: 7px;
}

/* Word Spotlight v4.1.0: Prev/Next Bar + Side-by-Side Singular & Plural + Book Examples */
.dict-spot-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.dict-spot-pos {
  font-weight: 800;
  font-size: 12px;
}
.dict-spot-morph {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 4px 0 6px;
  direction: rtl;
}
.dict-spot-morph.has-pl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dict-spot-form-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 10px 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.dict-spot-form-card.is-plural {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.09);
}
.dict-spot-form-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  direction: ltr;
}
.dict-spot-form-card.is-plural .dict-spot-form-lbl {
  color: var(--accent);
}
.dict-spot-ar {
  font-size: calc(var(--ar-fs) * 0.96) !important;
  line-height: 1.75 !important;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.dict-spot-audio-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  direction: ltr;
}
.dict-spot-audio-row .btn-sm {
  min-height: 30px;
  padding: 3px 8px;
  font-size: 11.5px;
}
.dict-spot-examples {
  text-align: left;
  margin: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dict-spot-ex-head {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dict-spot-ex-card {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 13px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  text-align: right;
  transition: border-color 0.15s;
}
.dict-spot-ex-card:hover {
  border-color: var(--accent);
}
.dict-spot-ex-ar {
  font-size: calc(var(--ar-fs) * 0.82) !important;
  line-height: 1.75 !important;
  width: 100%;
}

/* Light-Theme Crystal-Clear High Contrast for Plural Pills */
html.theme-golden-glint .dict-pic-plural-btn,
html.theme-classic-light .dict-pic-plural-btn,
html.theme-golden-glint .dict-morph-pill.dict-morph-pl,
html.theme-classic-light .dict-morph-pill.dict-morph-pl,
html.theme-golden-glint .dict-spot-form-card.is-plural,
html.theme-classic-light .dict-spot-form-card.is-plural {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.34);
}
html.theme-golden-glint .dict-pl-tag,
html.theme-classic-light .dict-pl-tag {
  background: rgba(15, 118, 110, 0.14);
  color: #0f5c47;
}

@media (max-width: 340px) {
  .dict-pic-card { padding: 9px 7px 9px; }
  .dict-pic-plural-btn { padding: 3px 5px; gap: 3px; }
  .dict-spot-morph.has-pl { grid-template-columns: 1fr; }
}
.ur-inline {
  font-family: var(--font-ur, 'Noto Nastaliq Urdu', serif);
  font-size: 1.05em;
  line-height: 1.5;
}

/* ATS v4.2.0 Interactive Plural Mastery Drill Card */
.dict-drill-card {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.08), var(--card-elev, var(--card)));
  margin-bottom: 12px;
}
.dict-drill-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.dict-drill-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dict-drill-opt {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 13px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  min-height: 52px;
  transition: border-color 0.14s, background 0.14s;
}
.dict-drill-opt:hover:not(:disabled) { border-color: var(--accent); }
.dict-drill-opt.is-ok { border-color: var(--ok); background: var(--ok-bg); }
.dict-drill-opt.is-err { border-color: var(--err); background: var(--err-bg); }
