:root {
  --bg: #f1f6f4;
  --bg-glow: radial-gradient(circle at 18% 0%, rgba(16, 122, 101, 0.1) 0%, rgba(241, 246, 244, 0) 52%);
  --surface: #ffffff;
  --surface-subtle: #f6faf8;
  --border: #dfeae5;
  --text: #11211c;
  --text-muted: #586e67;
  --accent: #0d5c4d;
  --accent-light: #e3f3ee;
  --accent-mid: #167a65;
  --hero-from: #083b32;
  --hero-via: #0e5a4b;
  --hero-to: #167a65;
  --hero-text: #ffffff;
  --hero-muted: rgba(236, 253, 245, 0.82);
  --warn-bg: #fef9ed;
  --warn-border: #f2dfb3;
  --warn-text: #b27216;
  --ok-bg: #dff3ec;
  --ok-text: #0b5345;
  --err-bg: #fdecec;
  --err-text: #b42318;
  --shadow-sm: 0 2px 12px rgba(10, 46, 38, 0.05);
  --shadow-md: 0 16px 38px rgba(9, 60, 51, 0.22);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --arabic-size: 1.65rem;
}

[data-theme="mutiara"] {
  --bg: #f6f3ee;
  --bg-glow: radial-gradient(circle at 20% 0%, rgba(184, 139, 58, 0.11) 0%, rgba(246, 243, 238, 0) 55%);
  --surface: #fffefb;
  --surface-subtle: #f8f5ef;
  --border: #e8e1d5;
  --text: #221e1a;
  --text-muted: #72685c;
  --accent: #9a6f28;
  --accent-light: #f6edd9;
  --accent-mid: #b88b3a;
  --hero-from: #231f1c;
  --hero-via: #352f29;
  --hero-to: #504538;
  --hero-text: #fdfaf5;
  --hero-muted: rgba(245, 235, 215, 0.8);
  --shadow-sm: 0 2px 12px rgba(35, 31, 28, 0.05);
  --shadow-md: 0 16px 38px rgba(35, 31, 28, 0.22);
}

[data-theme="senja"] {
  --bg: #fbf4ec;
  --bg-glow: radial-gradient(circle at 20% 0%, rgba(217, 119, 6, 0.13) 0%, rgba(251, 244, 236, 0) 55%);
  --surface: #fffdfb;
  --surface-subtle: #faf1e7;
  --border: #eddac7;
  --text: #27160f;
  --text-muted: #7f5f4e;
  --accent: #b84414;
  --accent-light: #fdebd8;
  --accent-mid: #d97706;
  --hero-from: #712310;
  --hero-via: #a83c14;
  --hero-to: #d97706;
  --hero-text: #fffdf9;
  --hero-muted: rgba(255, 243, 224, 0.85);
}

[data-theme="langit"] {
  --bg: #eef4fb;
  --bg-glow: radial-gradient(circle at 20% 0%, rgba(2, 132, 199, 0.12) 0%, rgba(238, 244, 251, 0) 55%);
  --surface: #ffffff;
  --surface-subtle: #f3f7fc;
  --border: #d8e5f3;
  --text: #0f1f38;
  --text-muted: #566c8c;
  --accent: #1d4ed8;
  --accent-light: #e0ecff;
  --accent-mid: #0284c7;
  --hero-from: #0f2757;
  --hero-via: #1d4ed8;
  --hero-to: #0284c7;
  --hero-text: #ffffff;
  --hero-muted: rgba(224, 242, 254, 0.85);
}

[data-theme="dark"] {
  --bg: #080f0e;
  --bg-glow: radial-gradient(circle at 22% 0%, rgba(16, 185, 129, 0.13) 0%, rgba(8, 15, 14, 0) 54%);
  --surface: #101b19;
  --surface-subtle: #152320;
  --border: #1e312d;
  --text: #edf7f4;
  --text-muted: #86a199;
  --accent: #34d399;
  --accent-light: rgba(52, 211, 153, 0.14);
  --accent-mid: #10b981;
  --hero-from: #0a2e27;
  --hero-via: #0f463b;
  --hero-to: #156051;
  --hero-text: #f3fcf9;
  --hero-muted: rgba(209, 250, 229, 0.78);
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(251, 191, 36, 0.28);
  --warn-text: #fbbf24;
  --ok-bg: rgba(52, 211, 153, 0.16);
  --ok-text: #6ee7b7;
  --err-bg: rgba(239, 68, 68, 0.16);
  --err-text: #fca5a5;
  --shadow-sm: 0 2px 14px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.52);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-glow);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.ar {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: var(--arabic-size);
  line-height: 1.75;
  direction: rtl;
  unicode-bidi: isolate;
}

.ar-lg { font-size: calc(var(--arabic-size) * 1.35); }
.ar-sm { font-size: calc(var(--arabic-size) * 0.88); }

body.hide-latin .latin-text { display: none !important; }

.app-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 14px 48px;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  display: inline-block;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 2px;
}
.brand-sub:hover { color: var(--accent); text-decoration: underline; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Theme Popover */
.theme-picker-wrap { position: relative; }
.theme-popover {
  position: absolute;
  right: 0;
  top: 46px;
  width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 60;
}
.theme-popover-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px 6px;
}
.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
}
.theme-option:hover { background: var(--surface-subtle); }
.swatch { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }

/* Learner Controls Strip */
.controls-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ctrl-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ctrl-pill.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.font-size-group {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.icon-pill { padding: 5px 9px; }

/* Main Tabs */
.main-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 6px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
}
.tab-badge {
  background: #f59e0b;
  color: #111;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

/* Hero Card */
.hero-card {
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-via) 52%, var(--hero-to) 100%);
  color: var(--hero-text);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.hero-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hero-muted);
  font-weight: 600;
}
.hero-title {
  margin: 4px 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}
.hero-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--hero-muted);
}

.streak-pill {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
  min-width: 66px;
}
.streak-num { display: block; font-size: 1.2rem; font-weight: 700; line-height: 1.1; }
.streak-label { font-size: 0.66rem; color: var(--hero-muted); }

.hero-progress-wrap { margin: 16px 0; }
.hero-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--hero-muted);
  margin-bottom: 6px;
}
.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fef08a, #34d399);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-hero-primary {
  flex: 1;
  min-width: 170px;
  border: none;
  background: #ffffff;
  color: #083b32;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
}
.btn-hero-ghost {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
}

/* Week Filter Pills */
.week-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.week-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.week-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Roadmap Cards */
.week-divider {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 8px;
}

.roadmap-list { display: flex; flex-direction: column; gap: 10px; }

.day-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.day-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.day-card.done { border-color: var(--accent-mid); background: var(--surface-subtle); }
.day-card.current { border: 2px solid var(--accent); }

.day-num-badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.day-card.done .day-num-badge {
  background: var(--accent);
  color: #fff;
}
.day-info { flex: 1; min-width: 0; }
.day-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.day-tag {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.day-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}
.day-sub {
  margin: 2px 0 0;
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* Generic Section Card */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-title { margin: 0 0 4px; font-size: 1.02rem; font-weight: 700; }
.section-sub { margin: 0 0 12px; font-size: 0.8rem; color: var(--text-muted); }

.mini-select, .full-select, .search-input {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: 11px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.82rem;
}
.full-select { width: 100%; }

/* Sub-tabs */
.sub-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.sub-tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 9px 8px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.sub-tab-btn.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* Audio Button */
.audio-btn {
  border: 1px solid var(--border);
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.audio-btn:hover { background: var(--accent); color: #fff; }

/* Hijaiyah Lab */
.hijaiyah-detail {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}
.hijaiyah-forms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
}
.form-box span { display: block; font-size: 0.68rem; color: var(--text-muted); }

.hijaiyah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  direction: rtl;
}
.hijaiyah-tile {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}
.hijaiyah-tile.active {
  border: 2px solid var(--accent);
  background: var(--accent-light);
}
.hijaiyah-tile.non-connect {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}
.hijaiyah-tile .h-name {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  direction: ltr;
}

.badge-warn {
  display: inline-block;
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.harakat-list { display: grid; gap: 8px; }
.harakat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Tashrif Lab */
.field-label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 6px; }
.pronoun-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.pronoun-chip {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.pronoun-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.tashrif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.tashrif-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.tashrif-label { font-size: 0.72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* Root Trees */
.roots-list { display: grid; gap: 12px; }
.root-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.root-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.root-word-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 10px;
  cursor: pointer;
}

/* SRS Flashcard */
.srs-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
}
.srs-reveal-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.srs-rating-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.rate-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.rate-again { background: var(--err-bg); color: var(--err-text); }
.rate-hard { background: var(--warn-bg); color: var(--warn-text); }
.rate-good { background: var(--ok-bg); color: var(--ok-text); }

/* Dictionary */
.dict-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.dict-search-row .search-input { flex: 1; }
.dict-stats { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 10px; }
.dict-list { display: grid; gap: 8px; }
.dict-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 13px;
}
.star-btn {
  border: none;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text-muted);
}
.star-btn.saved { color: #f59e0b; }

/* Modal Lesson Sheet */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 16, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 12px;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}

.modal-sheet {
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-eyebrow { font-size: 0.72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.modal-title { margin: 2px 0 0; font-size: 1.05rem; font-weight: 700; }

.lesson-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}
.step-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 7px 4px;
  font-size: 0.73rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.step-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.btn-primary, .btn-secondary {
  border-radius: 12px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-primary { border: none; background: var(--accent); color: #fff; }
.btn-secondary { border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* Lesson Internal Blocks */
.prof-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.prof-box h3 { margin: 0 0 8px; font-size: 0.96rem; color: var(--accent); }
.prof-box p { margin: 0 0 8px; font-size: 0.84rem; line-height: 1.6; }

.formula-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 12px;
}
.formula-item {
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.formula-item:last-child { border-bottom: none; }

.tip-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8rem;
}

.vocab-lesson-list { display: grid; gap: 10px; }
.vocab-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.vocab-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Dialogue & Roleplay */
.dialogue-bubble {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.dialogue-bubble.other { background: var(--surface-subtle); }
.dialogue-bubble.user { background: var(--accent-light); border-color: var(--accent); }

.choice-btn {
  display: block;
  width: 100%;
  text-align: right;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 8px;
  cursor: pointer;
  font-family: inherit;
}
.choice-btn.correct { background: var(--ok-bg); border-color: var(--accent); color: var(--ok-text); }
.choice-btn.wrong { background: var(--err-bg); border-color: var(--err-text); color: var(--err-text); }

/* Quiz & Word Builder */
.quiz-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  direction: rtl;
  margin-top: 10px;
}
.word-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}
.word-chip.used { opacity: 0.4; pointer-events: none; }
.answer-slot {
  min-height: 48px;
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  direction: rtl;
  margin-top: 8px;
}

/* Footer & Toast */
.app-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.app-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-muted { font-size: 0.72rem; margin-top: 4px; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hero-from);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
}
