:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --bg: #f0fdfa;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #134e4a;
  --muted: #475569;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-text: #14532d;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-text: #7f1d1d;
  --border: #e2e8f0;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(15, 118, 110, 0.08);
  --nav-height: 74px;
}

body.dark {
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --primary-light: #134e4a;
  --accent: #f59e0b;
  --accent-light: #451a03;
  --bg: #0f172a;
  --card: #1e293b;
  --card-soft: #0f172a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --success: #22c55e;
  --success-bg: #14532d;
  --success-text: #bbf7d0;
  --danger: #ef4444;
  --danger-bg: #7f1d1d;
  --danger-text: #fecaca;
  --border: #334155;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
}

body {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  transition: background 0.25s, color 0.25s;
}

body.exam-locked {
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* Strict Arabic RTL block isolation with generous line-height for diacritics */
.ar {
  font-family: 'Amiri', 'Traditional Arabic', 'Geeza Pro', serif;
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 1.85;
  display: block;
}

.hidden {
  display: none !important;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* Header */
header {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #ffffff;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title h1 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
}

.header-ar {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
  color: #ccfbf1;
}

.header-title .subtitle {
  font-size: 0.77rem;
  opacity: 0.92;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.15s, background 0.15s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* Update & Install Banners */
.update-banner {
  background: var(--primary-light);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

#updateAppBtn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#installBanner {
  display: none;
  background: var(--accent-light);
  color: var(--accent);
  padding: 10px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.install-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#installBtn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Main Symmetrical Workspace */
.main-shell {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 12px 24px;
}

.container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  transition: max-width 0.2s ease;
}

.container.wide-mode {
  max-width: 960px;
}

/* Quick Auto-Speak Bar */
.auto-speak-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.quick-switch {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.quick-switch .switch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}

.quick-switch.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text);
}

.quick-switch.active .switch-dot {
  background: var(--primary);
}

/* Mode Pills */
.pill-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pill-btn {
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.pill-btn.challenge-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  padding: 11px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
}

.stat-item strong {
  color: var(--primary);
}

.combo-badge {
  background: var(--accent);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
  animation: popIn 0.25s ease;
}

.hearts {
  font-size: 1rem;
  letter-spacing: 2px;
}

/* Timer Bar */
.timer-wrap {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: var(--primary);
  transition: width 0.1s linear, background 0.2s;
}

.timer-fill.warn {
  background: var(--accent);
}

.timer-fill.danger {
  background: var(--danger);
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s;
}

.card-top-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.speaker-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
}

.shake {
  animation: shakeAnim 0.35s ease;
}

.pop {
  animation: popIn 0.25s ease;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes popIn {
  0% { transform: scale(0.92); opacity: 0.7; }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseWave {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.question-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.word-box {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 14px;
  margin-bottom: 16px;
}

.word-ar {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  text-align: center;
}

.word-hint {
  font-size: 0.96rem;
  color: var(--muted);
  margin-top: 6px;
}

.listening-panel {
  padding: 10px 6px 6px;
}

.listening-icon {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 6px;
}

.listening-icon.playing {
  animation: pulseWave 0.65s ease-in-out infinite;
}

.listening-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.listening-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.speak-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.speak-btn {
  background: var(--primary-light);
  color: var(--text);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

.speak-btn-soft {
  background: var(--card);
  border-color: var(--border);
  color: var(--muted);
}

.speak-btn:active {
  transform: scale(0.95);
}

/* Options */
.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.opt-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--card-soft);
}

.opt-btn.ar-opt {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.9rem;
  line-height: 1.7;
  padding: 8px 16px;
  direction: rtl;
}

.opt-btn.selected-opt {
  border-color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.opt-btn:active {
  transform: scale(0.98);
}

.opt-btn.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 700;
}

.opt-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.opt-btn:disabled {
  cursor: default;
}

/* Structured Bilingual Feedback */
.feedback {
  margin-top: 14px;
  padding: 14px 12px;
  border-radius: 14px;
  font-size: 0.94rem;
  display: none;
}

.feedback.show {
  display: block;
  animation: popIn 0.2s ease;
}

.feedback.ok {
  background: var(--success-bg);
  color: var(--success-text);
}

.feedback.err {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.fb-status {
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.fb-pair-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.fb-word-item {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 8px 6px;
  cursor: pointer;
  transition: transform 0.12s;
}

body.dark .fb-word-item {
  background: rgba(15, 23, 42, 0.45);
}

.fb-word-item:active {
  transform: scale(0.96);
}

.fb-ar {
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
}

.fb-th {
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 2px;
  text-align: center;
}

.fb-sep {
  font-size: 1rem;
  font-weight: 700;
}

/* Buttons */
.primary-btn {
  margin-top: 14px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.primary-btn:active {
  transform: scale(0.98);
}

.compact-primary {
  margin-top: 10px;
}

.compact-inline-btn {
  margin-top: 0;
  width: auto;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 0.88rem;
}

.toggle-btn {
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.toggle-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.compact-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Matching Grid */
.match-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.match-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  min-height: 86px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  transition: all 0.18s;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.match-card:hover:not(.matched) {
  border-color: var(--primary);
}

.match-card.ar-card {
  font-family: 'Amiri', serif;
  font-size: 1.55rem;
  line-height: 1.7;
  direction: rtl;
}

.match-card.th-card {
  font-size: 0.92rem;
  direction: ltr;
}

.match-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.03);
}

.match-card.matched {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success-text);
  opacity: 0.55;
  pointer-events: none;
  transform: scale(0.95);
}

.match-card.wrong-flash {
  border-color: var(--danger);
  background: var(--danger-bg);
  animation: shakeAnim 0.3s ease;
}

/* Stages */
.stage-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stage-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.stage-card.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.stage-info h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.stage-info p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.stage-stars {
  font-size: 1.15rem;
  margin-top: 5px;
  letter-spacing: 2px;
}

.stage-play-btn {
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.stage-play-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.result-stars {
  font-size: 2.8rem;
}

.result-title {
  margin: 8px 0 4px;
}

.result-desc {
  color: var(--muted);
  margin: 0 0 16px;
}

/* Vocab List */
.vocab-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.search-input {
  width: 100%;
  flex: 1;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.94rem;
  background: var(--card);
  color: var(--text);
}

.vocab-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.vocab-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.pair-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.pair-side {
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.pair-side:hover {
  background: var(--card-soft);
}

.pair-side:active {
  background: var(--primary-light);
}

.pair-ar {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}

.pair-th {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2px;
}

.pair-th.hidden-th {
  color: transparent;
  background: var(--border);
  border-radius: 6px;
  user-select: none;
}

.pair-code {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.75;
  margin-top: 4px;
}

.vs-badge {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-state .big-ico {
  font-size: 3rem;
  margin-bottom: 10px;
}

.empty-title {
  margin: 0 0 6px;
}

.empty-desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Bottom Navigation (6 Tabs) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.nav-btn:hover {
  background: var(--card-soft);
}

.nav-btn .nav-ico {
  font-size: 1.2rem;
}

.nav-btn.active {
  color: var(--primary);
}

.badge-count {
  position: absolute;
  top: 2px;
  right: 10%;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Modal & Voice Profiles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 100;
}

.modal-dialog {
  width: 100%;
  max-width: 500px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.modal-dialog.modal-wide {
  max-width: 780px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 5;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.04rem;
}

.modal-close {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: var(--card-soft);
  color: var(--text);
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.profile-chip {
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.setting-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.setting-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid var(--border);
}

.setting-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.setting-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.setting-checkbox {
  width: 24px;
  height: 24px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.test-voice-box {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.test-voice-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.test-voice-ar {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}

/* ================= DESKTOP & TABLET SYMMETRICAL LAYOUT ================= */
@media (min-width: 768px) {
  body {
    padding-bottom: 96px;
  }

  header {
    padding: 14px 24px;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .header-title h1 {
    font-size: 1.2rem;
  }

  .header-ar {
    text-align: left;
  }

  .main-shell {
    justify-content: center;
    padding: 24px 28px 36px;
  }

  .main-shell.align-top {
    justify-content: flex-start;
  }

  .container {
    max-width: 740px;
  }

  .container.wide-mode {
    max-width: 980px;
  }

  .pill-row.four-cols {
    grid-template-columns: repeat(4, 1fr);
  }

  .profile-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    padding: 26px 28px;
  }

  .card-top-meta {
    flex-direction: row;
    justify-content: space-between;
  }

  .options {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .match-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .match-card {
    min-height: 108px;
    padding: 14px 10px;
  }

  .match-card.ar-card {
    font-size: 1.85rem;
  }

  .match-card.th-card {
    font-size: 1rem;
  }

  .vocab-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 16px;
    width: min(780px, calc(100% - 32px));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  }

  .nav-btn {
    flex-direction: row;
    gap: 6px;
    font-size: 0.84rem;
    padding: 10px 6px;
  }

  .nav-btn.active {
    background: var(--primary-light);
  }

  .badge-count {
    position: static;
    margin-left: 2px;
  }
}

@media (min-width: 1120px) {
  .container.wide-mode {
    max-width: 1080px;
  }
}
