/* ============================================================
   Talaqah 30 — Production UI/UX Stylesheet
   Laptop (>= 1100px) & iPad (768px - 1099px): Full Sidebar + Quick Access Bar
   Mobile (<= 767px): Compact Topbar + Frosted Bottom Tab Bar
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #f6f6fa;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-inset: #efeff6;
  --surface-hover: #e5e4f2;
  --border: rgba(20, 20, 38, 0.09);
  --border-strong: rgba(20, 20, 38, 0.18);

  --text: #141424;
  --text-muted: #52526d;
  --text-soft: #7b7b96;

  --primary: #5b45ff;
  --primary-hover: #4833e6;
  --primary-soft: rgba(91, 69, 255, 0.10);
  --primary-glow: rgba(91, 69, 255, 0.24);
  --primary-text: #4833e6;

  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.11);
  --accent-text: #b45309;

  --yt-red: #e11d48;
  --yt-red-hover: #be123c;
  --yt-red-soft: rgba(225, 29, 72, 0.10);
  --yt-red-text: #be123c;

  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.11);
  --success-text: #047857;

  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);

  --shadow-sm: 0 2px 10px rgba(20, 20, 38, 0.04);
  --shadow-md: 0 10px 30px rgba(20, 20, 38, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 20, 38, 0.18);

  --radius-xs: 0.5rem;
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.35rem;
  --radius-full: 9999px;

  --sidebar-w: 266px;
  --bottom-nav-h: 68px;
  --font-sans: 'IBM Plex Sans Arabic', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090910;
  --surface: rgba(20, 20, 34, 0.88);
  --surface-solid: #141422;
  --surface-inset: #1b1b2e;
  --surface-hover: #25253e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f5f5fa;
  --text-muted: #a6a6c2;
  --text-soft: #787896;

  --primary: #7c5cff;
  --primary-hover: #9175ff;
  --primary-soft: rgba(124, 92, 255, 0.16);
  --primary-glow: rgba(124, 92, 255, 0.34);
  --primary-text: #b7a4ff;

  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-text: #fcd34d;

  --yt-red: #f43f5e;
  --yt-red-hover: #fb7185;
  --yt-red-soft: rgba(244, 63, 94, 0.16);
  --yt-red-text: #fda4af;

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --success-text: #6ee7b7;

  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.16);

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.72);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 65% 40% at 15% 0%, var(--primary-soft), transparent 60%),
    radial-gradient(ellipse 50% 35% at 88% 4%, var(--accent-soft), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.25s var(--ease), color 0.2s var(--ease);
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon-xs { width: 14px; height: 14px; flex-shrink: 0; }
.icon-sm { width: 17px; height: 17px; flex-shrink: 0; }
.icon-md { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================================================
   App Shell: Laptop & iPad Sidebar + Quick Command Bar
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  padding: 1.15rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 50;
  overflow-y: auto;
}

.brand-row { display: flex; align-items: center; gap: 0.68rem; padding: 0.15rem 0.3rem; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px var(--primary-glow);
  flex-shrink: 0;
}
.brand-mark.is-logo {
  background: transparent;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(52, 53, 200, 0.32);
}
.brand-mark-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.brand-title { font-weight: 700; font-size: 1.04rem; line-height: 1.2; }
.brand-sub { font-size: 0.72rem; color: var(--text-soft); font-weight: 500; }

.account-pill {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.72rem 0.82rem;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
  text-align: right;
  transition: border-color 0.16s, background 0.16s;
}
.account-pill:hover { border-color: var(--primary); background: var(--surface-hover); }
.account-top { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; }
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.69rem;
  font-weight: 700;
}
.sync-row { display: flex; align-items: center; gap: 0.38rem; font-size: 0.71rem; color: var(--success-text); font-weight: 600; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.sync-dot.is-saving { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.side-section-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  padding: 0 0.5rem;
  letter-spacing: 0.02em;
}
.side-section-sub {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.side-nav { display: grid; gap: 0.28rem; }
.side-step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s var(--ease);
}
.side-btn.is-active .side-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.side-btn {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  width: 100%;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s var(--ease);
}
.side-btn:hover { background: var(--surface-inset); color: var(--text); }
.side-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-color: rgba(124, 92, 255, 0.25);
}
.side-badge {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.46rem;
  border-radius: var(--radius-full);
  background: var(--surface-inset);
  color: var(--text-muted);
}
.side-btn.is-active .side-badge { background: var(--primary); color: #ffffff; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.45rem;
}
.sidebar-tools { display: flex; gap: 0.38rem; }

/* Quick Service Dock at Top of Main Stage (Laptop + iPad) */
.quick-dock {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.quick-dock-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-dock-pills::-webkit-scrollbar { display: none; }
.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.36rem 0.78rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-inset);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.dock-pill:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }

/* Mobile Only Header & Bottom Nav */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 45;
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0.62rem 0.95rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: var(--surface);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--border);
  padding: 0.38rem 0.3rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
}
.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.36rem 0.2rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}
.bottom-tab.is-active { color: var(--primary-text); background: var(--primary-soft); }

/* Main Stage */
.main-stage {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.stage-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.45rem 1.4rem 3.5rem;
  display: grid;
  gap: 1.4rem;
}

.view-pane { display: none; gap: 1.35rem; }
.view-pane.is-active { display: grid; animation: viewIn 0.22s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Primitives
   ============================================================ */
.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-strong); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  user-select: none;
  transition: all 0.16s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { min-height: 35px; padding: 0.28rem 0.8rem; font-size: 0.79rem; }
.btn-xs { min-height: 30px; padding: 0.2rem 0.62rem; font-size: 0.73rem; }
.btn-icon { width: 37px; height: 37px; min-height: 37px; padding: 0; border-radius: var(--radius-full); }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #ffffff; box-shadow: 0 4px 14px var(--primary-glow); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: #ffffff; }
.btn-youtube { background: linear-gradient(135deg, var(--yt-red), var(--yt-red-hover)); color: #ffffff; }
.btn-success { background: var(--success); color: #ffffff; }
.btn-secondary { background: var(--surface-inset); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-danger-outline { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-armed { background: var(--danger); color: #ffffff; border-color: var(--danger); }

.input-field, .textarea-field {
  width: 100%;
  min-height: 40px;
  padding: 0.46rem 0.86rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-inset);
  color: var(--text);
  font-size: 0.87rem;
  min-width: 0;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.textarea-field { min-height: 88px; resize: vertical; line-height: 1.65; }
.input-field::placeholder, .textarea-field::placeholder { color: var(--text-soft); }
.input-field:focus, .textarea-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface-solid);
}
.ltr-input { direction: ltr; text-align: left; }
.ltr-input::placeholder { direction: rtl; text-align: right; }

.segmented {
  display: inline-flex;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg-btn {
  padding: 0.3rem 0.74rem;
  border-radius: var(--radius-full);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.seg-btn[aria-pressed="true"] { background: var(--primary); color: #ffffff; box-shadow: 0 2px 10px var(--primary-glow); }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; }
.page-kicker { font-size: 0.75rem; font-weight: 700; color: var(--accent-text); display: block; margin-bottom: 0.15rem; }
.page-header h1 { margin: 0; font-size: clamp(1.32rem, 1.05rem + 1vw, 1.8rem); font-weight: 700; line-height: 1.25; }
.page-header p { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.89rem; }

/* ============================================================
   Dashboard, Steps, Studios & Journey
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.kpi-card { padding: 1.05rem; display: grid; gap: 0.2rem; }
.kpi-label { font-size: 0.77rem; font-weight: 600; color: var(--text-muted); }
.kpi-val { font-size: 1.58rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-sub { font-size: 0.73rem; color: var(--text-soft); }

.mission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border: 1px solid var(--border-strong);
}
.mission-banner.is-done-all { background: linear-gradient(135deg, var(--success-soft), var(--primary-soft)); border-color: var(--success); }

.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.step-card { display: flex; flex-direction: column; gap: 0.88rem; }
.step-card.is-step-done { border-color: var(--success); box-shadow: 0 0 0 1px var(--success-soft), var(--shadow-sm); }
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; flex-wrap: wrap; }
.step-tag { display: inline-flex; align-items: center; padding: 0.2rem 0.66rem; border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary-text); font-size: 0.74rem; font-weight: 700; }
.step-check {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.24rem 0.66rem;
  border-radius: var(--radius-full); border: 1px solid var(--border-strong);
  background: var(--surface-inset); color: var(--text-muted); font-size: 0.73rem; font-weight: 700; cursor: pointer;
}
.step-check[aria-pressed="true"] { background: var(--success); border-color: var(--success); color: #ffffff; }
.step-card h3 { margin: 0; font-size: 1rem; line-height: 1.38; }
.step-desc { margin: 0; font-size: 0.84rem; color: var(--text-muted); }

.hub-box { background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.86rem; display: grid; gap: 0.58rem; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 0.34rem; align-items: center; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 0.28rem; padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full); border: 1px solid var(--border-strong);
  background: var(--surface-solid); color: var(--text-muted); font-size: 0.74rem; font-weight: 600; cursor: pointer;
}
.chip-btn:hover, .chip-btn.is-active { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.yt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.42rem; }
.inline-player { display: none; gap: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed var(--border); }
.inline-player.is-open { display: grid; }
.ratio-16-9 { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-sm); overflow: hidden; background: #000000; border: 1px solid var(--border-strong); }
.ratio-16-9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.timer-box { margin-top: auto; background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.82rem; display: grid; gap: 0.58rem; }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; flex-wrap: wrap; }
.timer-clock { font-family: var(--font-mono); font-size: 1.42rem; font-weight: 700; direction: ltr; line-height: 1.1; }
.timer-clock.is-running { color: var(--primary-text); }
.timer-clock.is-done { color: var(--success-text); }
.timer-track { height: 5px; border-radius: var(--radius-full); background: var(--bg); overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--primary), #a855f7); transition: width 0.35s linear; }
.timer-presets { display: flex; gap: 0.28rem; flex-wrap: wrap; }
.preset-btn { flex: 1; min-width: 40px; padding: 0.2rem 0.32rem; border-radius: var(--radius-xs); border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.preset-btn.is-selected { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }

/* Studio & Word Bank */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.95fr); gap: 1.1rem; align-items: start; }
.yg-stage { position: relative; width: 100%; min-height: 360px; border-radius: var(--radius-md); overflow: hidden; background: #0b0b14; border: 1px solid var(--border-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.yg-host { width: 100%; display: flex; justify-content: center; direction: ltr; }
.yg-host iframe { width: 100% !important; max-width: 100% !important; min-height: 390px; border: 0 !important; display: block; }
@media (min-width: 768px) {
  #view-pronounce .yg-host {
    max-height: 580px;
    overflow: hidden;
    align-items: flex-start;
  }
}
.yg-fallback { padding: 1.4rem; text-align: center; display: grid; gap: 0.65rem; justify-items: center; color: var(--text-muted); font-size: 0.87rem; max-width: 46ch; }
.yg-fallback strong { color: var(--text); font-size: 0.96rem; }
.yg-controls { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.yg-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; flex: 1; }
.yg-btns .btn { flex: 1; min-width: 78px; }

/* Unlimited Free Human Pronunciation & Shadowing Card */
.dict-card {
  display: grid;
  gap: 0.78rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-inset), var(--primary-soft));
  border: 1.5px solid var(--border-strong);
}
.dict-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.dict-word { font-size: 1.15rem; font-weight: 800; direction: ltr; color: var(--text); }
.dict-ipa { font-family: var(--font-mono); font-size: 0.82rem; color: var(--primary-text); direction: ltr; }
.dict-pos { font-size: 0.72rem; font-weight: 700; padding: 0.14rem 0.52rem; border-radius: var(--radius-full); background: var(--surface-solid); border: 1px solid var(--border); color: var(--text-muted); direction: ltr; }
.dict-free-badge { font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.58rem; border-radius: var(--radius-full); background: var(--success-soft); color: var(--success-text); }
.dict-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.dict-actions .btn { width: 100%; min-width: 0; }
.dict-def { font-size: 0.84rem; color: var(--text-muted); direction: ltr; text-align: left; padding: 0.52rem 0.72rem; border-radius: var(--radius-sm); background: var(--surface-solid); border: 1px solid var(--border); }
.dict-synonyms { display: flex; align-items: center; gap: 0.36rem; flex-wrap: wrap; }
.dict-syn-chip { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--primary-text); font-size: 0.75rem; font-weight: 700; direction: ltr; cursor: pointer; transition: all 0.14s; }
.dict-syn-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.dict-examples { display: grid; gap: 0.45rem; }
.flashcard-ipa { font-family: var(--font-mono); font-size: 0.86rem; color: var(--primary-text); direction: ltr; margin-top: -0.45rem; }
.word-ipa { font-family: var(--font-mono); font-size: 0.74rem; color: var(--primary-text); direction: ltr; margin-inline-start: 0.35rem; }
.word-meta-pill { font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.48rem; border-radius: var(--radius-full); background: var(--surface-solid); border: 1px solid var(--border); color: var(--text-soft); }
.word-meta-pill.is-carry { background: var(--accent-soft); border-color: rgba(245, 158, 11, 0.38); color: var(--accent-text); }
.word-meta-pill.is-mastered { background: var(--success-soft); border-color: rgba(16, 185, 129, 0.4); color: var(--success-text); }
.word-pillars { display: flex; align-items: center; gap: 0.32rem; flex-wrap: wrap; margin-top: 0.1rem; }
.pillar-pill {
  display: inline-flex; align-items: center; gap: 0.22rem;
  padding: 0.14rem 0.54rem; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong); background: var(--surface-solid);
  color: var(--text-soft); font-size: 0.69rem; font-weight: 700; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.pillar-pill:hover { border-color: var(--primary); color: var(--primary-text); }
.pillar-pill.is-done {
  background: var(--success-soft); border-color: rgba(16, 185, 129, 0.45);
  color: var(--success-text);
}
.queue-item.is-pron-done { opacity: 0.82; }
.dict-ex-row { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); background: var(--surface-solid); border: 1px solid var(--border); }
.dict-ex-txt { font-size: 0.85rem; color: var(--text); direction: ltr; text-align: left; flex: 1; line-height: 1.5; }
.queue-list { display: grid; gap: 0.48rem; max-height: 440px; overflow-y: auto; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.78rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-inset); cursor: pointer; }
.queue-item:hover, .queue-item.is-active { border-color: var(--primary); background: var(--primary-soft); }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.word-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; padding: 0.7rem 0.88rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-inset); }
.word-row.status-carry { border-color: rgba(245, 158, 11, 0.4); background: var(--accent-soft); }
.word-row.status-mastered { border-color: rgba(16, 185, 129, 0.35); background: var(--success-soft); }
.word-en { font-weight: 700; font-size: 0.96rem; direction: ltr; display: inline-block; }
.word-ar { font-size: 0.79rem; color: var(--text-muted); }

.flashcard {
  background: linear-gradient(145deg, var(--surface-inset), var(--surface-solid));
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 2rem 1.35rem; text-align: center; display: grid; gap: 0.85rem;
  min-height: 220px; align-content: center; cursor: pointer;
}
.flashcard:hover { border-color: var(--primary); }
.flashcard-word { font-size: 1.8rem; font-weight: 700; direction: ltr; color: var(--text); }
.flashcard-meaning { font-size: 1.04rem; color: var(--primary-text); font-weight: 600; }
.flashcard-example { font-size: 0.85rem; color: var(--text-muted); direction: ltr; }

.scenario-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.scenario-pill { padding: 0.44rem 0.88rem; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface-inset); color: var(--text-muted); font-size: 0.81rem; font-weight: 600; cursor: pointer; }
.scenario-pill[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #ffffff; box-shadow: 0 3px 12px var(--primary-glow); }
.prompt-box { margin: 0; padding: 1.05rem; border-radius: var(--radius-md); background: var(--surface-inset); border: 1px solid var(--border); white-space: pre-wrap; font-family: var(--font-sans); font-size: 0.89rem; line-height: 1.76; color: var(--text); }

.days-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.62rem; }
.day-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.18rem; min-height: 76px; padding: 0.48rem; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-inset); color: var(--text); cursor: pointer; transition: all 0.15s; }
.day-cell:hover { border-color: var(--primary); transform: translateY(-2px); }
.day-cell.is-current { border: 2px solid var(--primary); background: var(--primary-soft); }
.day-cell.is-milestone { background: var(--accent-soft); border-color: rgba(245, 158, 11, 0.4); color: var(--accent-text); }
.day-cell.is-done { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); border-color: var(--primary); color: #ffffff; }
.day-cell.is-milestone.is-done { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border-color: var(--accent); color: #ffffff; }
.day-cell.is-locked { opacity: 0.52; cursor: not-allowed; }
.day-cell.is-locked:hover { transform: none; border-color: var(--border); }

/* Modals & Toasts */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(7, 7, 14, 0.84); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: none; align-items: center; justify-content: center; padding: 1rem; overflow-y: auto;
}
.modal-backdrop.is-open { display: flex; }
.modal-card { width: min(94vw, 480px); max-height: 92vh; overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 1.45rem; box-shadow: var(--shadow-lg); display: grid; gap: 0.95rem; }
.modal-card.is-wide { width: min(94vw, 1020px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; background: var(--surface-inset); padding: 4px; border-radius: var(--radius-full); border: 1px solid var(--border); }
.auth-tab { border: 0; background: transparent; color: var(--text-muted); padding: 0.42rem; border-radius: var(--radius-full); font-weight: 700; font-size: 0.84rem; cursor: pointer; }
.auth-tab[aria-pressed="true"] { background: var(--primary); color: #ffffff; }
.error-banner { display: none; padding: 0.62rem 0.85rem; border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger); font-size: 0.82rem; font-weight: 600; }
.error-banner.is-visible { display: block; }

#confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }
.toast-stack { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); z-index: 220; display: grid; gap: 0.45rem; width: min(92vw, 430px); pointer-events: none; }
.toast { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); border-right: 4px solid var(--primary); border-radius: var(--radius-md); padding: 0.76rem 1rem; box-shadow: var(--shadow-md); font-size: 0.85rem; font-weight: 600; }
.toast.is-success { border-right-color: var(--success); }
.toast.is-accent { border-right-color: var(--accent); }

/* ============================================================
   Responsive Breakpoints:
   - iPad (768px - 1099px): KEEPS Laptop Sidebar + Quick Dock!
   - Mobile (<= 767px): Switches to Topbar + Bottom Tab Bar
   ============================================================ */
@media (max-width: 1180px) {
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-grid { grid-template-columns: 1fr; }
}

/* iPad Portrait & Landscape (768px to 1099px) — Laptop Experience! */
@media (min-width: 768px) and (max-width: 1099px) {
  :root { --sidebar-w: 224px; }
  .sidebar { padding: 1rem 0.75rem; }
  .stage-inner { padding: 1.25rem 1.1rem 3rem; }
  .quick-dock { padding: 0.55rem 1.1rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .days-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Mobile Only (<= 767px) */
@media (max-width: 767px) {
  .sidebar { display: none; }
  .quick-dock { display: none; }
  .main-stage { margin-right: 0; }
  .mobile-topbar { display: flex; }
  .bottom-nav { display: grid; }
  .stage-inner { padding: 1rem 0.85rem calc(var(--bottom-nav-h) + 1.9rem); gap: 1.15rem; }
  .card { padding: 1.05rem; border-radius: var(--radius-md); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .steps-grid, .two-col { grid-template-columns: 1fr; }
  .days-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .yt-actions { grid-template-columns: 1fr; }
  .kpi-val { font-size: 1.4rem; }
  .toast-stack { bottom: calc(var(--bottom-nav-h) + 0.95rem); }
}

/* Admin Panel Layout */
.admin-wrap { max-width: 980px; margin: 2rem auto; padding: 0 1rem 3rem; display: grid; gap: 1.25rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th, .admin-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: right; }
.admin-table th { color: var(--text-soft); font-size: 0.78rem; }
.code-mono { font-family: var(--font-mono); font-weight: 700; color: var(--primary-text); direction: ltr; display: inline-block; }

/* ============================================================
   Ambient Canvas & 5 Signature Themes (Dark + Light Palettes)
   ============================================================ */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.app-shell, .store-wrap, .admin-wrap { position: relative; z-index: 1; }

/* Theme 2: Sakura Garden */
[data-style="sakura"][data-theme="light"] {
  --bg: #fff5f8; --surface: rgba(255,255,255,0.88); --surface-inset: #ffedf4; --surface-hover: #fce0ec;
  --border: rgba(219,39,119,0.14); --border-strong: rgba(219,39,119,0.28);
  --text: #2c1024; --text-muted: #6e4560; --text-soft: #946b87;
  --primary: #db2777; --primary-hover: #be185d; --primary-soft: rgba(219,39,119,0.12); --primary-glow: rgba(219,39,119,0.26); --primary-text: #be185d;
}
[data-style="sakura"][data-theme="dark"] {
  --bg: #0c0512; --surface: rgba(24,13,34,0.84); --surface-solid: #180d22; --surface-inset: #231432; --surface-hover: #2f1b42;
  --border: rgba(244,180,220,0.14); --border-strong: rgba(244,180,220,0.28);
  --text: #fdf4ff; --text-muted: #cbb6db; --text-soft: #9b84b0;
  --primary: #ec4899; --primary-hover: #f472b6; --primary-soft: rgba(236,72,153,0.18); --primary-glow: rgba(236,72,153,0.34); --primary-text: #f9a8d4;
}

/* Theme 3: Emerald Oasis */
[data-style="emerald"][data-theme="light"] {
  --bg: #f2fbf7; --surface: rgba(255,255,255,0.9); --surface-inset: #e4f6ee; --surface-hover: #d4efe3;
  --border: rgba(5,150,105,0.14); --border-strong: rgba(5,150,105,0.28);
  --text: #0b241c; --text-muted: #396254; --text-soft: #648b7e;
  --primary: #059669; --primary-hover: #047857; --primary-soft: rgba(5,150,105,0.12); --primary-glow: rgba(5,150,105,0.26); --primary-text: #047857;
}
[data-style="emerald"][data-theme="dark"] {
  --bg: #05110d; --surface: rgba(11,28,22,0.86); --surface-solid: #0b1c16; --surface-inset: #122921; --surface-hover: #19382d;
  --border: rgba(52,211,153,0.14); --border-strong: rgba(52,211,153,0.28);
  --text: #ecfdf5; --text-muted: #a7d7c5; --text-soft: #6fa390;
  --primary: #10b981; --primary-hover: #34d399; --primary-soft: rgba(16,185,129,0.18); --primary-glow: rgba(16,185,129,0.34); --primary-text: #6ee7b7;
}

/* Theme 4: Desert Gold */
[data-style="desert"][data-theme="light"] {
  --bg: #fdf8ef; --surface: rgba(255,253,248,0.92); --surface-inset: #f6ecd9; --surface-hover: #eedfc2;
  --border: rgba(180,83,9,0.14); --border-strong: rgba(180,83,9,0.28);
  --text: #271a0b; --text-muted: #6c5134; --text-soft: #967a5b;
  --primary: #b45309; --primary-hover: #92400e; --primary-soft: rgba(180,83,9,0.12); --primary-glow: rgba(180,83,9,0.25); --primary-text: #92400e;
}
[data-style="desert"][data-theme="dark"] {
  --bg: #100c07; --surface: rgba(26,20,13,0.86); --surface-solid: #1a140d; --surface-inset: #261d12; --surface-hover: #342818;
  --border: rgba(251,191,36,0.15); --border-strong: rgba(251,191,36,0.30);
  --text: #fffbeb; --text-muted: #d6c29f; --text-soft: #a38e6d;
  --primary: #d97706; --primary-hover: #f59e0b; --primary-soft: rgba(217,119,6,0.20); --primary-glow: rgba(245,158,11,0.34); --primary-text: #fcd34d;
}

/* Theme 5: Deep Ocean */
[data-style="ocean"][data-theme="light"] {
  --bg: #f1f8fe; --surface: rgba(255,255,255,0.9); --surface-inset: #e2f1fc; --surface-hover: #cfe7fa;
  --border: rgba(2,132,199,0.14); --border-strong: rgba(2,132,199,0.28);
  --text: #0b1e2d; --text-muted: #3d6078; --text-soft: #678ba3;
  --primary: #0284c7; --primary-hover: #0369a1; --primary-soft: rgba(2,132,199,0.12); --primary-glow: rgba(2,132,199,0.25); --primary-text: #0369a1;
}
[data-style="ocean"][data-theme="dark"] {
  --bg: #050c18; --surface: rgba(11,22,38,0.86); --surface-solid: #0b1626; --surface-inset: #12233b; --surface-hover: #193152;
  --border: rgba(56,189,248,0.15); --border-strong: rgba(56,189,248,0.30);
  --text: #f0f9ff; --text-muted: #a6cde6; --text-soft: #6e99b5;
  --primary: #0ea5e9; --primary-hover: #38bdf8; --primary-soft: rgba(14,165,233,0.18); --primary-glow: rgba(14,165,233,0.34); --primary-text: #7dd3fc;
}

/* Theme Switcher Swatches */
.theme-swatches { display: flex; flex-wrap: wrap; gap: 0.42rem; }
.theme-swatch-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.34rem 0.68rem;
  border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--surface-inset); color: var(--text-muted); font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
.theme-swatch-btn.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.theme-swatch-btn.is-locked { opacity: 0.62; }
.swatch-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* Storefront Styles */
.store-wrap { max-width: 1140px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; display: grid; gap: 1.8rem; }
.store-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; }
.store-hero { text-align: center; display: grid; gap: 0.6rem; padding: 1rem 0 0.4rem; }
.store-hero h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.25; }
.store-hero p { margin: 0 auto; max-width: 60ch; color: var(--text-muted); font-size: 0.96rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.theme-product-card { display: flex; flex-direction: column; gap: 0.9rem; overflow: hidden; padding: 0; }
.theme-cover {
  position: relative; width: 100%; height: 195px; overflow: hidden;
  display: grid; place-items: center; border-bottom: 1px solid var(--border);
}
.theme-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.theme-cover-fallback {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.45rem; color: #ffffff; text-align: center; padding: 1rem;
}
.theme-card-body { padding: 1.15rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.price-tag { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--primary-text); }
.gallery-main { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface-inset); display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.2rem; }
.gallery-thumb { width: 78px; height: 50px; border-radius: var(--radius-xs); overflow: hidden; border: 2px solid transparent; cursor: pointer; flex-shrink: 0; padding: 0; background: none; }
.gallery-thumb.is-active { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.admin-pane { display: none; gap: 1.1rem; }
.admin-pane.is-active { display: grid; }
.img-preview-chip { position: relative; width: 92px; height: 60px; border-radius: var(--radius-xs); overflow: hidden; border: 1px solid var(--border-strong); }
.img-preview-chip img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-del { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.75); color: #fff; cursor: pointer; font-size: 12px; display: grid; place-items: center; }


/* Live Theme Preview Banner */
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 65;
  background: linear-gradient(135deg, var(--surface-solid), var(--primary-soft));
  border-bottom: 2px solid var(--primary);
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  box-shadow: var(--shadow-md);
}

/* Mobile-only Duolingo Helpers (100% hidden on Laptop & iPad >= 768px) */
.duo-mobile-home,
.duo-lesson-topbar,
.duo-lesson-footer,
.duo-words-switcher,
.duo-practice-hub-nav,
.duo-journey-snake {
  display: none;
}

/* Safe-Area Top Padding for iPhone PWA / Notch on Store & Preview Banner */
.preview-banner {
  padding-top: calc(0.6rem + env(safe-area-inset-top, 0px));
}
.store-wrap {
  padding-top: calc(1.3rem + env(safe-area-inset-top, 0px));
}

@keyframes duoBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes duoPulseRing {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.14); opacity: 0.14; }
}
@keyframes duoShimmer {
  0% { background-position: -180% 0; }
  100% { background-position: 180% 0; }
}

/* ============================================================
   FLAGSHIP DUOLINGO + iOS NATIVE MOBILE APP (Phones ONLY <= 767px)
   - Apple HIG 44px+ Touch Ergonomics & Zero Tap-Highlight Flash
   - Frosted iOS Top Bar & Bottom Bar with 100% Safe-Area Protection
   - Glossy 3D Tactile Pebble Nodes + Floating Bouncing "ابدأ" Callout
   - Native Distraction-Free Full-Screen Lesson Canvas
   - Horizontal Swipe Carousels (Word Queue & Conversation Scenarios)
   - 6-Color Duolingo Chapter Units for 30-Day Journey
   - Authentic iOS Bottom-Sheet Modals with Top Grabber Handle
   - Laptop & iPad (>= 768px) remain 100% untouched!
   ============================================================ */
@media (max-width: 767px) {
  html, body {
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
  }
  button, a {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
  input, textarea, select, .input-field, .textarea-field {
    font-size: 16px !important;
    touch-action: manipulation;
  }
  body {
    font-size: 15.5px;
    --duo-green: #58cc02;
    --duo-green-dark: #46a302;
    --duo-green-glow: rgba(88, 204, 2, 0.34);
    --duo-orange: #ff9600;
    --duo-blue: #1cb0f6;
    --duo-gold: #ffc800;
    --duo-gold-dark: #d99b00;
    --duo-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* 1. Frosted iOS Safe-Area Top Bar (ZERO overlap with iPhone clock/notch/battery) */
  .mobile-topbar {
    display: flex;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0.95rem 0.68rem;
    min-height: calc(60px + env(safe-area-inset-top, 0px));
    background: var(--surface);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    border-bottom: 1.5px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }
  .duo-top-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  .duo-brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 3px 0 rgba(0, 0, 0, 0.28);
  }
  .duo-brand-name {
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: -0.015em;
  }
  .duo-top-metrics {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }
  .duo-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.24rem;
    height: 36px;
    padding: 0 0.66rem;
    border-radius: 0.9rem;
    border: 1.5px solid var(--border-strong);
    border-bottom-width: 3px;
    background: var(--surface-solid);
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease;
  }
  .duo-stat-pill:active { transform: scale(0.94); }
  .duo-stat-pill.is-streak { color: var(--duo-orange); }
  .duo-stat-pill.is-xp { color: var(--duo-blue); }
  .duo-stat-ico { font-size: 0.96rem; line-height: 1; }
  .duo-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.9rem;
    border: 1.5px solid var(--border-strong);
    border-bottom-width: 3px;
    background: var(--surface-solid);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.12s ease;
  }
  .duo-icon-btn:active { transform: scale(0.94); }
  .duo-icon-btn.is-primary {
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    border-color: var(--primary-hover);
    color: #ffffff;
  }

  .stage-inner {
    padding: 0.95rem 0.95rem calc(var(--bottom-nav-h) + 2.8rem);
    gap: 1.05rem;
  }

  /* 2. Zero Clutter: Hide Heavy Desktop Headers, KPIs & Duplicate Cards */
  #view-today .page-header,
  #view-today .kpi-grid,
  #view-today .mission-banner,
  #view-today .steps-grid,
  #view-pronounce .page-header,
  #view-words .page-header,
  #view-prompts .page-header,
  #view-journey .page-header,
  #view-journey .desktop-days-card {
    display: none;
  }
  .page-kicker,
  .page-header p,
  .step-desc {
    display: none;
  }

  /* 3. Duolingo Home: Premium Unit Banner + Mascot Speech Bubble + Winding Path */
  .duo-mobile-home {
    display: grid;
    gap: 0.95rem;
  }
  .duo-unit-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border-bottom: 5px solid rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 12px 28px var(--primary-glow);
  }
  .duo-unit-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16), transparent 55%);
    pointer-events: none;
  }
  .duo-unit-kicker {
    display: block;
    font-size: 0.73rem;
    font-weight: 800;
    opacity: 0.9;
    letter-spacing: 0.02em;
  }
  .duo-unit-title {
    margin: 0.16rem 0 0;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.28;
  }
  .duo-guidebook-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.52rem 0.78rem;
    border-radius: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.32);
    border-bottom-width: 4px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s ease;
  }
  .duo-guidebook-btn:active { transform: translateY(2px); }

  /* Friendly Mascot Speech Bubble with Real Tail */
  .duo-mascot-tip {
    display: flex;
    align-items: center;
    gap: 0.78rem;
    padding: 0.82rem 0.95rem;
    border-radius: 1.2rem;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-bottom-width: 4px;
    box-shadow: var(--shadow-sm);
  }
  .duo-mascot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft));
    border: 2px solid var(--primary);
    display: grid;
    place-items: center;
    font-size: 1.55rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
  }
  .duo-mascot-bubble {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
  }
  .duo-mascot-bubble strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
  }
  .duo-mascot-bubble span {
    font-size: 0.79rem;
    color: var(--text-muted);
    line-height: 1.45;
  }

  /* Winding Vertical Snake Path with Glossy 3D Pebble Nodes */
  .duo-snake-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0 1.5rem;
    gap: 0.35rem;
  }
  .duo-snake-path.is-compact {
    padding: 0.9rem 0 0.45rem;
    gap: 0.3rem;
  }
  .duo-path-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.36rem;
    transition: transform 0.22s var(--duo-spring);
  }
  .duo-path-item.offset-0 { transform: translateX(0); }
  .duo-path-item.offset-left { transform: translateX(-48px); }
  .duo-path-item.offset-right { transform: translateX(48px); }

  .duo-path-connector {
    width: 5px;
    height: 26px;
    border-radius: 999px;
    background: repeating-linear-gradient(to bottom, var(--border-strong) 0 6px, transparent 6px 12px);
    opacity: 0.72;
  }
  .duo-path-connector.is-short { height: 18px; }

  /* Floating Bouncing "ابدأ" Tooltip */
  .duo-start-callout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.95rem;
    border-radius: 0.88rem;
    background: var(--surface-solid);
    color: var(--duo-green);
    border: 2px solid var(--border-strong);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin-bottom: 0.32rem;
    position: relative;
    animation: duoBounce 1.45s ease-in-out infinite;
  }
  .duo-start-callout::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 11px;
    height: 11px;
    background: var(--surface-solid);
    border-right: 2px solid var(--border-strong);
    border-bottom: 2px solid var(--border-strong);
  }
  .duo-start-callout.is-trophy { color: var(--duo-gold); }

  /* Glossy 3D Tactile Pebble Node (86x76px with Specular Top Highlight) */
  .duo-pebble {
    position: relative;
    width: 86px;
    height: 76px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(180deg, var(--surface-hover), var(--surface-inset));
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow:
      inset 0 3px 0 rgba(255, 255, 255, 0.16),
      0 8px 0 var(--border-strong),
      0 14px 24px rgba(0, 0, 0, 0.22);
    transition: transform 0.12s var(--duo-spring), box-shadow 0.12s ease;
  }
  .duo-pebble.is-sm {
    width: 70px;
    height: 62px;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.18),
      0 6px 0 var(--border-strong),
      0 10px 18px rgba(0, 0, 0, 0.18);
  }
  .duo-pebble:active {
    transform: translateY(6px) scale(0.97);
    box-shadow: 0 2px 0 var(--border-strong);
  }
  .duo-pebble-icon {
    width: 32px;
    height: 32px;
    stroke-width: 2.4;
    position: relative;
    z-index: 2;
  }
  .duo-day-num {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 900;
    position: relative;
    z-index: 2;
  }
  .duo-pebble-ring {
    display: none;
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 4px solid var(--duo-green);
    pointer-events: none;
    animation: duoPulseRing 1.8s ease-in-out infinite;
  }
  .duo-pebble.is-active {
    background: linear-gradient(180deg, #68df0b, var(--duo-green));
    color: #ffffff;
    box-shadow:
      inset 0 4px 0 rgba(255, 255, 255, 0.32),
      0 8px 0 var(--duo-green-dark),
      0 16px 32px var(--duo-green-glow);
  }
  .duo-pebble.is-active:active {
    box-shadow: 0 2px 0 var(--duo-green-dark);
  }
  .duo-pebble.is-active .duo-pebble-ring { display: block; }

  .duo-pebble.is-done {
    background: linear-gradient(180deg, #ffe047, var(--duo-gold));
    color: #2c1d00;
    box-shadow:
      inset 0 4px 0 rgba(255, 255, 255, 0.48),
      0 8px 0 var(--duo-gold-dark),
      0 14px 26px rgba(255, 200, 0, 0.3);
  }
  .duo-pebble.is-done:active { box-shadow: 0 2px 0 var(--duo-gold-dark); }

  .duo-pebble.is-trophy.is-active {
    background: linear-gradient(180deg, #ffd83d, var(--duo-orange));
    color: #241400;
    box-shadow:
      inset 0 4px 0 rgba(255, 255, 255, 0.45),
      0 8px 0 #b45309,
      0 16px 32px rgba(255, 150, 0, 0.38);
  }
  .duo-pebble.is-trophy.is-active .duo-pebble-ring { border-color: var(--duo-gold); }

  .duo-pebble-label {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
    margin-top: 0.25rem;
  }
  .duo-pebble-sub {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-soft);
  }

  /* 4. NATIVE FULL-SCREEN DISTRACTION-FREE LESSON CANVAS */
  body.duo-lesson-open .mobile-topbar,
  body.duo-lesson-open .bottom-nav,
  body.duo-lesson-open .duo-mobile-home {
    display: none !important;
  }
  body.duo-lesson-open .stage-inner {
    padding: calc(4.6rem + env(safe-area-inset-top, 0px)) 0.95rem calc(6.2rem + env(safe-area-inset-bottom, 0px));
  }
  body.duo-lesson-open #view-today .steps-grid {
    display: block;
  }
  .step-card {
    display: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    box-shadow: none;
    padding: 0.2rem 0;
    gap: 1.05rem;
  }
  body.duo-lesson-open .step-card.is-lesson-open {
    display: flex;
    animation: viewIn 0.22s var(--ease);
  }
  /* Hide redundant desktop badge & check button inside full-screen lesson mode */
  body.duo-lesson-open .step-card .step-top { display: none; }
  body.duo-lesson-open .step-card h3 {
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 0.1rem 0 0;
  }
  body.duo-lesson-open .hub-box,
  body.duo-lesson-open .timer-box {
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: 1.25rem;
    padding: 1.05rem;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
  }
  body.duo-lesson-open .timer-clock {
    font-size: 1.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  body.duo-lesson-open .timer-track { height: 8px; }
  body.duo-lesson-open .preset-btn { min-height: 36px; border-radius: 0.65rem; font-size: 0.8rem; }

  body.duo-lesson-open .duo-lesson-topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    align-items: center;
    gap: 0.8rem;
    padding: calc(0.8rem + env(safe-area-inset-top, 0px)) 0.95rem 0.78rem;
    background: var(--surface);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1.5px solid var(--border);
  }
  .duo-lesson-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface-inset);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .duo-lesson-progress-track {
    flex: 1;
    height: 16px;
    border-radius: 999px;
    background: var(--surface-inset);
    overflow: hidden;
    border: 1.5px solid var(--border);
  }
  .duo-lesson-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--duo-green), #89e219);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32);
    transition: width 0.35s var(--ease);
  }
  .duo-lesson-step-count {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--duo-green);
  }

  body.duo-lesson-open .duo-lesson-footer {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    background: var(--surface);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1.5px solid var(--border);
    padding: 0.85rem 0.95rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }
  .duo-cta-btn {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 1.05rem;
    background: linear-gradient(180deg, #64d809, var(--duo-green));
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 5px 0 var(--duo-green-dark), 0 10px 24px var(--duo-green-glow);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
  }
  .duo-cta-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--duo-green-dark);
  }

  /* 5. Pronunciation Studio on Mobile: Crisp 3-Col Human Audio + Swipe Word Carousel */
  #view-pronounce .studio-grid { gap: 0.9rem; }
  #view-pronounce .studio-grid > .card { padding: 1rem; border-radius: 1.25rem; }
  #view-pronounce .yg-stage { min-height: 290px; border-width: 1.5px; border-radius: 1.05rem; }
  #view-pronounce .yg-host iframe { min-height: 290px; }
  #view-pronounce .dict-card {
    border-radius: 1.25rem;
    padding: 1.05rem;
    gap: 0.85rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  }
  #view-pronounce .dict-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  #view-pronounce .dict-actions .btn {
    min-width: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.86rem;
    min-height: 46px;
  }
  #view-pronounce .queue-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.3rem;
    max-height: none;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  #view-pronounce .queue-list::-webkit-scrollbar { display: none; }
  #view-pronounce .queue-item {
    flex: 0 0 auto;
    min-width: 148px;
    scroll-snap-align: start;
    border-radius: 1rem;
    border-width: 1.5px;
    border-bottom-width: 3px;
  }

  /* 6. Mobile Words Studio: Focused 2-Tab Switcher + Tactile 3D Flashcards */
  .duo-words-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    background: var(--surface-inset);
    padding: 0.35rem;
    border-radius: 1.1rem;
    border: 1.5px solid var(--border-strong);
  }
  .duo-wtab {
    min-height: 44px;
    border: 0;
    border-radius: 0.85rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s var(--ease);
  }
  .duo-wtab.is-active {
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 4px 12px var(--primary-glow);
  }
  #view-words.mobile-tab-quiz .two-col > .card:first-child { display: none !important; }
  #view-words.mobile-tab-list .two-col > .card:last-child { display: none !important; }
  #view-words #wb-list { max-height: none !important; overflow-y: visible !important; }
  #view-words .card { padding: 1.05rem; border-radius: 1.25rem; }
  .flashcard {
    min-height: 270px;
    border-width: 2px;
    border-bottom-width: 6px;
    border-radius: 1.45rem;
    padding: 2.2rem 1.2rem;
    box-shadow: var(--shadow-md);
  }
  .flashcard-word { font-size: 2.05rem; font-weight: 800; letter-spacing: -0.02em; }
  #view-words .two-col > .card:first-child input[id="wb-search-in"] { width: 100% !important; }

  /* 7. Mobile AI Conversation Studio: Horizontal Scenario Carousel */
  #view-prompts .card { padding: 1.05rem; border-radius: 1.25rem; }
  #view-prompts .scenario-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }
  #view-prompts .scenario-tabs::-webkit-scrollbar { display: none; }
  #view-prompts .scenario-pill {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 0.45rem 0.95rem;
    font-weight: 800;
  }
  #view-prompts .prompt-box {
    font-size: 0.86rem;
    line-height: 1.75;
    border-radius: 1.05rem;
    max-height: 44vh;
    overflow-y: auto;
  }

  /* 8. Mobile 30-Day Duolingo Winding Journey: 6 Distinct Vibrant Chapter Units */
  .duo-journey-snake {
    display: grid;
    gap: 1.15rem;
  }
  .duo-journey-unit {
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-bottom-width: 4px;
    border-radius: 1.35rem;
    padding: 0.95rem;
    display: grid;
    gap: 0.55rem;
  }
  .duo-journey-unit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: 1.05rem;
    color: #ffffff;
    border-bottom: 4px solid rgba(0, 0, 0, 0.25);
  }
  .duo-journey-unit.unit-c1 .duo-journey-unit-head { background: linear-gradient(135deg, #10b981, #047857); }
  .duo-journey-unit.unit-c2 .duo-journey-unit-head { background: linear-gradient(135deg, #7c5cff, #5b45ff); }
  .duo-journey-unit.unit-c3 .duo-journey-unit-head { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
  .duo-journey-unit.unit-c4 .duo-journey-unit-head { background: linear-gradient(135deg, #f97316, #c2410c); }
  .duo-journey-unit.unit-c5 .duo-journey-unit-head { background: linear-gradient(135deg, #ec4899, #be185d); }
  .duo-journey-unit.unit-c6 .duo-journey-unit-head { background: linear-gradient(135deg, #f59e0b, #b45309); }

  .duo-journey-unit-head strong { font-size: 1rem; font-weight: 800; display: block; margin-top: 0.08rem; }
  .duo-unit-mini-bar {
    height: 6px;
    width: 140px;
    max-width: 100%;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.24);
    overflow: hidden;
    margin-top: 0.42rem;
  }
  .duo-unit-mini-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #ffffff;
    transition: width 0.35s var(--ease);
  }
  .duo-unit-pill {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 800;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    flex-shrink: 0;
  }

  /* 9. Tactile 3D Buttons & High-Craft Inputs Across All Tabs */
  .btn { min-height: 46px; font-size: 0.9rem; font-weight: 800; border-radius: 0.98rem; }
  .btn-sm { min-height: 44px; font-size: 0.85rem; }
  .btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 0 rgba(0, 0, 0, 0.28), 0 6px 14px var(--primary-glow); }
  .btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
  .btn-success { background: var(--duo-green); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 0 var(--duo-green-dark); }
  .btn-success:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--duo-green-dark); }
  .btn-accent { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.24); }
  .btn-youtube { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.26); }
  .input-field { min-height: 48px; font-size: 0.96rem; border-radius: 0.95rem; border-width: 1.5px; }

  /* 10. Authentic iOS Bottom-Sheet Modals with Top Grabber Handle */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-card, .modal-card.is-wide {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 1.65rem 1.65rem 0 0;
    padding: 1.55rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    border-bottom: 0;
  }
  .modal-card::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 4.5px;
    border-radius: 999px;
    background: var(--border-strong);
  }

  /* 11. Mobile Practice Hub 3-Pill Bar (الكلمات / النطق / المحادثة) */
  .duo-practice-hub-nav.is-visible {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.38rem;
    padding: 0.32rem;
    border-radius: 1.15rem;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
  }
  .duo-hub-pill {
    min-height: 40px;
    border: 0;
    border-radius: 0.85rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s var(--ease);
  }
  .duo-hub-pill.is-active {
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 4px 12px var(--primary-glow);
  }
  body.duo-lesson-open .duo-practice-hub-nav { display: none !important; }

  /* 12. Clean 3-Tab Frosted iOS + Duolingo Bottom Navigation Bar */
  .bottom-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    background: var(--surface);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: 1.5px solid var(--border);
    padding: 0.5rem 0.75rem calc(0.58rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.22);
  }
  .bottom-tab {
    position: relative;
    min-height: 52px;
    padding: 0.42rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.24rem;
    border-radius: 1.05rem;
    border: 1.5px solid transparent;
    transition: transform 0.15s var(--duo-spring), background 0.15s ease, color 0.15s ease;
  }
  .bottom-tab.is-active {
    border-color: rgba(124, 92, 255, 0.36);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
  }
  .bottom-tab.is-active::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
  }
  .bottom-tab:active { transform: scale(0.94); }

  /* 13. Flagship Mobile UX/UI Elevation */
  .duo-home-progress {
    height: 7px;
    width: 100%;
    max-width: 220px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
    margin-top: 0.5rem;
  }
  .duo-home-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
    transition: width 0.45s var(--ease);
  }
  /* Mobile Pronunciation Studio: Human Voice + Sentences Card FIRST above YouGlish */
  #view-pronounce .studio-grid > .card:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
  }
  #view-pronounce .studio-grid > .card:first-child > :nth-child(1) { order: 1; }
  #view-pronounce .studio-grid > .card:first-child > :nth-child(2) { order: 2; }
  #view-pronounce #dict-pronounce-card { order: 3; }
  #view-pronounce .yg-stage { order: 4; }
  #view-pronounce .yg-controls { order: 5; }

  .modal-backdrop.is-open .modal-card,
  .modal-backdrop.is-open .modal-card.is-wide {
    animation: iosSheetUp 0.28s var(--ease);
  }

  /* 14. Pro Mobile Craft: Toast Clearance, Locked Nodes, Celebration & Refined Glass */
  .toast-stack {
    bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    width: min(92vw, 390px);
  }
  .toast {
    background: rgba(15, 20, 34, 0.94);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-radius: 1.05rem;
    padding: 0.82rem 1rem;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
    animation: toastSlideUp 0.26s var(--ease);
  }
  [data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.96);
  }

  .duo-stat-pill, .duo-icon-btn:not(.is-primary) {
    border-width: 1px;
    border-bottom-width: 2px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  [data-theme="light"] .duo-stat-pill,
  [data-theme="light"] .duo-icon-btn:not(.is-primary) {
    background: var(--surface-solid);
  }
  .duo-icon-btn.is-primary,
  [data-theme="light"] .duo-icon-btn.is-primary,
  [data-theme="dark"] .duo-icon-btn.is-primary {
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    border-color: var(--primary-hover);
    color: #ffffff;
  }

  .duo-pebble.is-locked {
    opacity: 0.56;
    background: var(--surface-inset);
    color: var(--text-soft);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
  }
  .duo-pebble.is-locked:active {
    transform: scale(0.98);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  }
  .duo-lock-ico { width: 20px; height: 20px; stroke-width: 2.2; opacity: 0.78; }
  .duo-day-ico { width: 24px; height: 24px; stroke-width: 2.8; }
  .duo-pebble-sub.is-muted { opacity: 0.58; }
  .duo-path-connector.is-done {
    background: repeating-linear-gradient(to bottom, var(--duo-gold) 0 6px, transparent 6px 12px);
    opacity: 0.9;
  }
  .duo-pebble.is-just-completed,
  .duo-path-item.is-just-completed .duo-pebble {
    animation: dayUnlockPop 0.7s var(--duo-spring);
  }
  .duo-unit-mini-bar { width: 100%; max-width: 210px; height: 7px; }
  #view-pronounce .dict-ex-row {
    padding: 0.78rem 0.85rem;
    border-radius: 0.95rem;
    gap: 0.75rem;
  }
  #view-pronounce .dict-listen-btn {
    min-height: 38px;
    padding: 0.25rem 0.75rem;
    border-radius: 0.8rem;
    flex-shrink: 0;
  }
}

@keyframes iosSheetUp {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dayUnlockPop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* Human Pronunciation & Example Cards Polish */
.dict-ex-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-soft);
  margin-top: 0.1rem;
}
.dict-ex-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.14rem 0.52rem;
  border-radius: var(--radius-full);
  background: var(--success-soft);
  color: var(--success-text);
}
.dict-ex-row {
  transition: border-color 0.16s ease, background 0.16s ease;
}
.dict-ex-row.is-playing {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dict-ex-body {
  display: grid;
  gap: 0.22rem;
  flex: 1;
  min-width: 0;
}
.dict-ex-ar {
  font-size: 0.78rem;
  color: var(--text-muted);
  direction: rtl;
  text-align: right;
  line-height: 1.45;
}
.dict-ex-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--success-text);
  direction: rtl;
}
.dict-ex-meta.is-fallback {
  color: var(--text-soft);
}
