:root {
  --tw-primary: #004d40;
  --tw-primary-dark: #00251a;
  --tw-accent: #d4af37;
  --tw-accent-light: #f5e6a3;
  --tw-bg: #fdfbf7;
  --tw-text: #1a1a1a;
  --tw-card-bg: #ffffff;
  --tw-border: rgba(0, 0, 0, 0.08);
  --tw-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --tw-radius: 14px;
  --tw-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --tw-transition-fast: 100ms var(--tw-ease);
  --tw-transition: 200ms var(--tw-ease);
  --tw-transition-slow: 300ms var(--tw-ease);
}

/* Scroll reading progress bar (lessons) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--tw-accent, #d4af37);
  z-index: 10000;
  transition: width 60ms linear;
  pointer-events: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-padding-top: 70px;
}

/* Do NOT override per-page layout (many pages set max-width + margin:auto on body). */
body {
  font-family:
    "Roboto",
    system-ui,
    -apple-system,
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(212, 175, 55, 0.8);
  outline-offset: 2px;
}

/* Screen-reader only (a11y) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip navigation link (a11y) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--tw-primary);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Subtle arabesque background overlay (safe, low-contrast) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23004d40' stroke-width='2'%3E%3Cpath d='M60 10 C75 25 95 25 110 10 C95 25 95 45 110 60 C95 45 75 45 60 60 C75 45 75 25 60 10 Z'/%3E%3Cpath d='M60 60 C45 75 25 75 10 60 C25 75 25 95 10 110 C25 95 45 95 60 110 C45 95 45 75 60 60 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}

/* Global links */
a {
  color: var(--tw-primary);
}
a:hover {
  color: var(--tw-primary-dark);
}

/* Arabic text scaling (controlled by font-size-control.js) */
:root {
  --tw-arabic-scale: 1;
}

/* Font size widget in toolbar */
.font-size-widget {
  display: flex;
  align-items: center;
  gap: 1px;
}
.fsw-btn {
  font-weight: 600;
}
.fsw-btn--minus {
  font-size: 13px;
}
.fsw-btn--plus {
  font-size: 15px;
  font-weight: 700;
}
.fsw-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  min-width: 36px;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}
.fsw-label:hover {
  color: white;
}

/* Apply Arabic scale to ALL Arabic text containers via CSS zoom.
   This overrides any inline font-size set by lesson.js renderers. */
.lesson-example__arabic,
.lesson-term__arabic,
.lesson-hadith__arabic,
.lesson-letter-forms__char,
.lesson-letter-forms__main,
.lesson-letter-grid__char,
.lesson-letter-audio__letter,
.lesson-letter-animation__char,
.lesson-letter-forms-api__form-char,
.lesson-letter-full-api__char,
.lesson-diagram__letter,
.lesson-waqf-sign__symbol,
.lesson-tajweed-api__example-arabic,
.lesson-rule__example .arabic,
.lesson-term__example .arabic,
.makhraj-diagram__letter,
.sun-moon-letter,
.meem-rule__letter {
  zoom: var(--tw-arabic-scale, 1);
}

/* Arabic text helper — Uthmanic Script (Mushaf Madinah) as primary */
.arabic,
.arabic-text,
.arabic-l,
.arabic-m,
.arabic-s,
.t-arab {
  font-family:
    "KFGQPC HAFS Uthmanic Script", "Amiri", "Scheherazade New", serif;
  font-size: calc(var(--tw-arabic-scale, 1) * 1em);
}

/* Salawat ligature ﷺ (U+FDFA) — shrink to reduce line spacing */
.salawat,
.sallam {
  font-size: 0.55em;
  vertical-align: baseline;
  display: inline-block;
  line-height: 1;
}

/* Clickable Arabic words — use outline instead of background/transition
   to avoid breaking Safari Arabic text shaping (see CLAUDE.md) */
.lesson-word-clickable {
  cursor: pointer;
}
.lesson-word-clickable:hover {
  outline: 2px solid rgba(76, 175, 80, 0.5);
  outline-offset: 2px;
  border-radius: 3px;
}

.arabic,
.arabic-text {
  font-size: calc(var(--tw-arabic-scale, 1) * 3em);
  line-height: 2.4;
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
}

/* Arabic example words inside lesson text — block only for standalone elements
   (NOT inside <p> or <li> with surrounding text like "Буква (ا)") */
.lesson-text > .arabic,
.lesson-text > .arabic-text,
.lesson-text .letter-forms .arabic,
.lesson-text p.arabic-text,
.lesson-text p.arabic {
  display: block;
  direction: rtl;
  text-align: center;
  margin: 0.2em 0;
}
/* Inside paragraphs and list items: stay inline */
.lesson-text p .arabic,
.lesson-text li .arabic {
  display: inline;
  direction: rtl;
  unicode-bidi: isolate;
  text-align: inherit;
  margin: 0;
}

/* Inline Arabic text within paragraphs */
.arabic-inline {
  font-family:
    "KFGQPC HAFS Uthmanic Script", "Amiri", "Scheherazade New", serif;
  font-size: calc(var(--tw-arabic-scale, 1) * 1.3em);
  line-height: 1.4;
  unicode-bidi: isolate;
  color: #004d40;
}

/* Uthmani orthographic marks (۟ ۠ ۡ) — hidden as in most printed Mushafs */
.uthmani-mark {
  display: none;
}
body.show-uthmani-marks .uthmani-mark {
  display: inline;
  font-size: 0.7em;
  opacity: 0.6;
  vertical-align: super;
}

/* Arabic calligraphy style variants */
body.font-uthmanic .arabic,
body.font-uthmanic .arabic-text,
body.font-uthmanic .arabic-l,
body.font-uthmanic .arabic-m,
body.font-uthmanic .arabic-s,
body.font-uthmanic .t-arab,
body.font-uthmanic .ia-arabic,
body.font-uthmanic .tw-ayah-word,
body.font-uthmanic .lesson-example__arabic,
body.font-uthmanic .arabic-inline {
  font-family: "KFGQPC HAFS Uthmanic Script", "Amiri", serif;
}
body.font-naskh .arabic,
body.font-naskh .arabic-text,
body.font-naskh .arabic-l,
body.font-naskh .arabic-m,
body.font-naskh .arabic-s,
body.font-naskh .t-arab,
body.font-naskh .ia-arabic,
body.font-naskh .tw-ayah-word,
body.font-naskh .lesson-example__arabic,
body.font-naskh .arabic-inline {
  font-family: "Amiri", "Scheherazade New", serif;
}
body.font-noto-naskh .arabic,
body.font-noto-naskh .arabic-text,
body.font-noto-naskh .arabic-l,
body.font-noto-naskh .arabic-m,
body.font-noto-naskh .arabic-s,
body.font-noto-naskh .t-arab,
body.font-noto-naskh .ia-arabic,
body.font-noto-naskh .tw-ayah-word,
body.font-noto-naskh .lesson-example__arabic,
body.font-noto-naskh .arabic-inline {
  font-family: "Noto Naskh Arabic", serif;
}
body.font-kufi .arabic,
body.font-kufi .arabic-text,
body.font-kufi .arabic-l,
body.font-kufi .arabic-m,
body.font-kufi .arabic-s,
body.font-kufi .t-arab,
body.font-kufi .ia-arabic,
body.font-kufi .tw-ayah-word,
body.font-kufi .lesson-example__arabic,
body.font-kufi .arabic-inline {
  font-family: "Reem Kufi", sans-serif;
}
body.font-nastaliq .arabic,
body.font-nastaliq .arabic-text,
body.font-nastaliq .arabic-l,
body.font-nastaliq .arabic-m,
body.font-nastaliq .arabic-s,
body.font-nastaliq .t-arab,
body.font-nastaliq .ia-arabic,
body.font-nastaliq .tw-ayah-word,
body.font-nastaliq .lesson-example__arabic,
body.font-nastaliq .arabic-inline {
  font-family: "Noto Nastaliq Urdu", serif;
  line-height: 3;
}
body.font-thuluth .arabic,
body.font-thuluth .arabic-text,
body.font-thuluth .arabic-l,
body.font-thuluth .arabic-m,
body.font-thuluth .arabic-s,
body.font-thuluth .t-arab,
body.font-thuluth .ia-arabic,
body.font-thuluth .tw-ayah-word,
body.font-thuluth .lesson-example__arabic,
body.font-thuluth .arabic-inline {
  font-family: "Aref Ruqaa", serif;
}
body.font-noto-kufi .arabic,
body.font-noto-kufi .arabic-text,
body.font-noto-kufi .arabic-l,
body.font-noto-kufi .arabic-m,
body.font-noto-kufi .arabic-s,
body.font-noto-kufi .t-arab,
body.font-noto-kufi .ia-arabic,
body.font-noto-kufi .tw-ayah-word,
body.font-noto-kufi .lesson-example__arabic,
body.font-noto-kufi .arabic-inline {
  font-family: "Noto Kufi Arabic", sans-serif;
}
body.font-thuluth-dt .arabic,
body.font-thuluth-dt .arabic-text,
body.font-thuluth-dt .arabic-l,
body.font-thuluth-dt .arabic-m,
body.font-thuluth-dt .arabic-s,
body.font-thuluth-dt .t-arab,
body.font-thuluth-dt .ia-arabic,
body.font-thuluth-dt .tw-ayah-word,
body.font-thuluth-dt .lesson-example__arabic,
body.font-thuluth-dt .arabic-inline {
  font-family: "DecoType Thuluth", serif;
}
body.font-diwani .arabic,
body.font-diwani .arabic-text,
body.font-diwani .arabic-l,
body.font-diwani .arabic-m,
body.font-diwani .arabic-s,
body.font-diwani .t-arab,
body.font-diwani .ia-arabic,
body.font-diwani .tw-ayah-word,
body.font-diwani .lesson-example__arabic,
body.font-diwani .arabic-inline {
  font-family: "Diwani Letter", serif;
}
body.font-maghribi .arabic,
body.font-maghribi .arabic-text,
body.font-maghribi .arabic-l,
body.font-maghribi .arabic-m,
body.font-maghribi .arabic-s,
body.font-maghribi .t-arab,
body.font-maghribi .ia-arabic,
body.font-maghribi .tw-ayah-word,
body.font-maghribi .lesson-example__arabic,
body.font-maghribi .arabic-inline {
  font-family: "Maghrebi", sans-serif;
}

/* Calligraphy lesson: style-specific demo fonts (immune to global font switcher) */
.cal-kufi {
  font-family:
    "Noto Kufi Arabic", "Noto Kufi Arabic Local", "Reem Kufi", sans-serif !important;
}
.cal-naskh {
  font-family: "Amiri", "Noto Naskh Arabic", serif !important;
}
.cal-sulus {
  font-family: "DecoType Thuluth", "Aref Ruqaa", serif !important;
}
.cal-nastaliq {
  font-family: "Noto Nastaliq Urdu", serif !important;
  line-height: 3 !important;
}
.cal-uthmanic {
  font-family: "KFGQPC HAFS Uthmanic Script", "Amiri", serif !important;
}
.cal-diwani {
  font-family: "Diwani Letter", "Diwani Bent", "Aref Ruqaa", serif !important;
}
.cal-maghribi {
  font-family: "Maghrebi", "Reem Kufi", sans-serif !important;
}
.cal-muhaqqaq,
.cal-raihan {
  font-family: "DecoType Thuluth", "Amiri", serif !important;
}
.cal-ruqaa {
  font-family: "Aref Ruqaa", serif !important;
}

/* Font switcher panel */
.font-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--tw-card-bg, #fff);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  padding: 12px;
  box-shadow: var(--tw-shadow);
  transition: opacity 0.3s;
  max-height: 70vh;
  overflow-y: auto;
}
.font-switcher__toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1002;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--tw-primary);
  color: #fff;
  border: none;
  font-size: 40px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.font-switcher__toggle:hover {
  background: var(--tw-primary-dark);
}
.font-switcher.is-open ~ .font-switcher__toggle {
  bottom: auto;
}
.font-switcher:not(.is-open) {
  display: none;
}
.font-switcher.is-open {
  bottom: 120px;
}
.font-switcher__btn {
  padding: 8px 14px;
  border: 1px solid var(--tw-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  text-align: right;
  direction: rtl;
  transition: background 0.2s;
  white-space: nowrap;
}
.font-switcher__btn:hover {
  background: #f0f0f0;
}
.font-switcher__btn.is-active {
  background: var(--tw-primary);
  color: #fff;
  border-color: var(--tw-primary);
}

/* Highlighted studied letter (alphabet lessons) — ambient glow */
/* Tajweed rule letter coloring — inline spans inside .tw-ayah-word */
.tw-rule-letter,
.tw-letter-hl {
  /* Preserve Arabic joining across span boundaries */
  display: contents;
}

/* Amiri fallback for words with inner tajweed spans —
   KFGQPC can't join letters across element boundaries.
   Only applies when no specific font class is set on body.
   When user selects a font via settings, body.font-* rules take priority. */
.tw-ayah-word:has(.tw-rule-letter) {
  font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
}
/* When user explicitly selects KFGQPC, still use Amiri for tajweed words */
body.font-uthmanic .tw-ayah-word:has(.tw-rule-letter) {
  font-family: "Amiri", "Scheherazade New", serif;
}

/* Tajweed rule labels above words */
.tw-word-has-label {
  position: relative;
}
.tw-tajweed-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Roboto", "Segoe UI", sans-serif;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.85;
  font-weight: 500;
  direction: ltr;
  text-align: center;
  margin-bottom: 1px;
}
/* Slightly larger on desktop */
@media (min-width: 769px) {
  .tw-tajweed-label {
    font-size: 10px;
  }
}
/* Dark theme: boost label opacity */
[data-theme="dark"] .tw-tajweed-label {
  opacity: 0.95;
}

.tw-letter-hl {
  color: #b71c1c;
  /* Soft glow via text-shadow only */
  text-shadow:
    0 0 6px rgba(183, 28, 28, 0.35),
    0 0 14px rgba(183, 28, 28, 0.2),
    0 0 28px rgba(183, 28, 28, 0.1);
}

/* Transliteration color coding */
.tr-long {
  color: #1565c0;
  font-weight: 600;
}
.tr-emph {
  color: #c62828;
  font-weight: 700;
}
.tr-pharyng {
  color: #e65100;
}
.tr-ha {
  color: #2e7d32;
  font-style: italic;
}
.tr-ayn {
  color: #6a1b9a;
  font-weight: 600;
}
.tr-qalq {
  color: #ef6c00;
  font-size: 0.8em;
  vertical-align: super;
}
.tr-idgham {
  color: #00838f;
  font-size: 0.8em;
}
.tr-ikhfa {
  color: #00838f;
  font-weight: 600;
}
.tr-madd {
  color: #1565c0;
  font-size: 0.7em;
  vertical-align: super;
  font-weight: 700;
}

[data-theme="dark"] .tr-long {
  color: #64b5f6;
}
[data-theme="dark"] .tr-emph {
  color: #ef5350;
}
[data-theme="dark"] .tr-pharyng {
  color: #ffb74d;
}
[data-theme="dark"] .tr-ha {
  color: #66bb6a;
}
[data-theme="dark"] .tr-ayn {
  color: #ce93d8;
}

/* Transliteration level selector */
.ia-translit-level {
  display: inline-flex;
  gap: 2px;
  margin-right: 4px;
  font-size: 0.7em;
}
.ia-translit-level button {
  padding: 1px 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9em;
  color: var(--tw-text, #1a1a1a);
}
.ia-translit-level button.active {
  background: var(--tw-primary, #004d40);
  color: white;
  border-color: var(--tw-primary, #004d40);
}

/* Settings Panel (⚙) */
#settings-panel-container {
  position: fixed;
  top: 48px;
  right: 8px;
  z-index: 1000;
  max-width: 320px;
  width: calc(100vw - 16px);
}
.settings-panel {
  background: var(--tw-bg, #fdfbf7);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--tw-radius, 14px);
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.settings-panel__title {
  margin: 0 0 12px;
  font-size: 1em;
  color: var(--tw-primary, #004d40);
}
.settings-panel__section {
  margin-bottom: 12px;
}
.settings-panel__label {
  font-size: 0.8em;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.settings-panel__select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  font-size: 0.9em;
  background: white;
}
.settings-panel__row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.settings-panel__row--wrap {
  flex-wrap: wrap;
}
.settings-panel__btn {
  padding: 4px 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-weight: 600;
}
.settings-panel__value {
  min-width: 40px;
  text-align: center;
  font-size: 0.85em;
  color: #666;
}
.settings-panel__level-btn {
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.82em;
  white-space: nowrap;
}
.settings-panel__level-btn.active {
  background: var(--tw-primary, #004d40);
  color: white;
  border-color: var(--tw-primary, #004d40);
}
.settings-panel__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  cursor: pointer;
}
.settings-panel__toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--tw-primary, #004d40);
}
[data-theme="dark"] .settings-panel {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .settings-panel__select,
[data-theme="dark"] .settings-panel__btn,
[data-theme="dark"] .settings-panel__level-btn {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Transliteration legend */
.translit-legend {
  padding: 12px 16px;
  background: var(--tw-bg, #fdfbf7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--tw-radius, 14px);
  font-size: 0.9em;
  max-width: 480px;
}
.translit-legend__title {
  margin: 0 0 10px;
  font-size: 1.05em;
  color: var(--tw-primary, #004d40);
}
.translit-legend__group {
  margin-bottom: 10px;
}
.translit-legend__category {
  font-weight: 600;
  font-size: 0.85em;
  color: var(--tw-primary, #004d40);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.translit-legend__table {
  width: 100%;
  border-collapse: collapse;
}
.translit-legend__table tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.translit-legend__symbol {
  font-weight: 700;
  font-size: 1.1em;
  padding: 4px 12px 4px 0;
  white-space: nowrap;
  color: var(--tw-primary, #004d40);
  width: 80px;
}
.translit-legend__meaning {
  padding: 4px 0;
  color: var(--tw-text, #1a1a1a);
}
[data-theme="dark"] .translit-legend {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .translit-legend__meaning {
  color: #e0e0e0;
}

/* Hover-highlight: rows with data-pattern get a hover style + cursor */
.translit-legend__row[data-pattern] {
  cursor: help;
  transition: background-color 0.12s ease;
}
.translit-legend__row[data-pattern]:hover {
  background: rgba(212, 175, 55, 0.12); /* gold tint matches --tw-accent */
}
[data-theme="dark"] .translit-legend__row[data-pattern]:hover {
  background: rgba(212, 175, 55, 0.18);
}

/* Collapsible "полные правила учителя" block */
.translit-legend__rules {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
}
.translit-legend__rules summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--tw-primary, #004d40);
  user-select: none;
  padding: 4px 0;
}
.translit-legend__rules[open] summary {
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}
.translit-legend__rules-body {
  font-size: 0.92em;
  line-height: 1.45;
  color: var(--tw-text, #1a1a1a);
}
.translit-legend__rules-body p {
  margin: 0.6em 0;
}
.translit-legend__rules-body i {
  color: var(--tw-primary-dark, #002f28);
  font-style: normal;
  font-family: "Amiri", serif;
}
[data-theme="dark"] .translit-legend__rules {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.35);
}
[data-theme="dark"] .translit-legend__rules summary {
  color: #d4af37;
}
[data-theme="dark"] .translit-legend__rules-body {
  color: #e0e0e0;
}
[data-theme="dark"] .translit-legend__rules-body i {
  color: #ffd86b;
}

/* Compare-mode: alternate transliteration row */
.mushaf-translit-compare {
  margin: 4px 0 8px;
  padding: 6px 10px;
  background: rgba(0, 77, 64, 0.04);
  border-left: 3px solid rgba(0, 77, 64, 0.3);
  border-radius: 4px;
  font-size: 0.95em;
}
.mushaf-translit-compare__label {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tw-primary, #004d40);
  opacity: 0.65;
  margin-bottom: 3px;
  font-weight: 600;
}
[data-theme="dark"] .mushaf-translit-compare {
  background: rgba(212, 175, 55, 0.06);
  border-left-color: rgba(212, 175, 55, 0.4);
}
[data-theme="dark"] .mushaf-translit-compare__label {
  color: #d4af37;
}
.mushaf-compare-btn.is-active {
  background: var(--tw-accent, #d4af37);
  color: #1a1a1a;
}

/* Per-word teacher-rule indicator: small golden dot above the word */
.mushaf-translit-word[data-rules] {
  position: relative;
}
.mushaf-translit-word[data-rules]::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--tw-accent, #d4af37);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3);
}
.mushaf-translit-word[data-rules]:hover::before {
  width: 6px;
  height: 6px;
  top: -5px;
}
[data-theme="dark"] .mushaf-translit-word[data-rules]::before {
  background: #ffd86b;
}

/* Highlighted match injected into transliteration text */
mark.ia-rule-hl {
  background: var(--tw-accent, #d4af37);
  color: #1a1a1a;
  padding: 0 2px;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35);
  /* Don't break Arabic shaping (via display: inline) */
  display: inline;
}
[data-theme="dark"] mark.ia-rule-hl {
  background: #d4af37;
  color: #1a1a1a;
}

/* Shared top navigation (injected on pages) */
.tw-topbar {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(
    135deg,
    var(--tw-primary-dark),
    var(--tw-primary)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tw-topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tw-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-right: auto;
  color: white;
  text-decoration: none;
}

.tw-brand__title {
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.tw-brand__subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.tw-navbtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tw-navbtn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(245, 230, 163, 0.7);
  transform: translateY(-1px);
}

.tw-navbtn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.tw-pill {
  margin-left: 6px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: rgba(255, 255, 255, 0.95);
}

/* --- Interactive Ayah Component --- */
.interactive-ayah {
  border: 1px solid var(--tw-border);
  border-left: 4px solid var(--tw-accent);
  background-color: var(--tw-card-bg);
  border-radius: var(--tw-radius);
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--tw-shadow);
}

/* .ia-loading, .ia-error, .ia-translation are defined in
   js/components/interactive-ayah.js (component-local styles with
   dark theme overrides). Removed from common.css to avoid conflicts. */

.ia-arabic {
  font-family: "Amiri", serif;
  font-size: 3em;
  line-height: 2;
  text-align: right;
  margin-bottom: 20px;
}

.ia-controls {
  margin-top: 20px;
}

/* --- Quiz Engine Component --- */
.quiz-container {
  border: 1px solid var(--tw-border);
  border-top: 4px solid var(--tw-primary);
  background-color: #ffffff;
  border-radius: var(--tw-radius);
  padding: 30px;
  margin: 30px 0;
}

.quiz-question {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px dashed var(--tw-border);
}
.quiz-question:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px;
  margin: 8px 0;
  font-size: 1em;
  cursor: pointer;
  border: 2px solid var(--tw-border);
  background-color: #f8f9fa;
  border-radius: 10px;
  /* Specific properties instead of `all` — cheaper for repaint */
  transition:
    background-color 0.2s ease-in-out,
    border-color 0.2s ease-in-out,
    color 0.2s ease-in-out;
}

.quiz-option:hover {
  border-color: var(--tw-accent);
  background-color: var(--tw-accent-light);
}

.quiz-option.correct {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
  font-weight: bold;
}

.quiz-option.wrong {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
  opacity: 0.7;
}

.quiz-option[disabled] {
  cursor: not-allowed;
}

.quiz-results {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid var(--tw-primary);
  text-align: center;
  font-size: 1.4em;
  font-weight: bold;
  color: var(--tw-primary);
}

/* --- Main Navigation Panel --- */
.main-nav {
  padding: 20px;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  height: 100%;
  overflow-y: auto;
}
.main-nav .nav-title {
  font-family: "Cinzel", serif;
  color: var(--tw-primary);
  border-bottom: 2px solid var(--tw-accent);
  padding-bottom: 10px;
  margin-top: 0;
}
.main-nav ul {
  list-style: none;
  padding: 0;
}
.main-nav .nav-header {
  font-weight: bold;
  color: #6c757d;
  padding: 15px 0 5px;
  text-transform: uppercase;
  font-size: 0.8em;
}
.main-nav li a {
  display: block;
  padding: 10px 15px;
  color: var(--tw-primary, #004d40);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.main-nav li a:hover {
  background-color: #e9ecef;
}
.main-nav li a.active {
  background-color: var(--tw-accent);
  color: white;
  font-weight: bold;
}

/* Tongue Diagram Styles */
.tongue-diagram {
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  border: 2px solid #b0bec5;
  border-radius: 10px;
  background: white;
  padding: 20px;
  text-align: center;
}

.tongue-diagram__canvas {
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tongue-shape {
  width: 200px;
  height: 100px;
  border-top-left-radius: 100px;
  border-top-right-radius: 100px;
  margin: 0 auto;
  transition: all 0.3s ease;
  border: 3px solid #333;
  border-bottom: 0;
  position: relative;
  background: #b3e5fc;
}

.lesson-diagram__canvas--itbaq .tongue-shape {
  background: #263238;
  transform: scaleY(1.2);
}

.lesson-diagram__canvas--infitah .tongue-shape {
  background: #b3e5fc;
  height: 50px;
  margin-top: 50px;
}

.tongue-diagram__controls {
  margin-top: 15px;
}

.tongue-diagram__btn {
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  color: white;
  transition: all 0.2s;
}

.tongue-diagram__btn--itbaq {
  background: #263238;
}

.tongue-diagram__btn--itbaq:hover {
  background: #37474f;
}

.tongue-diagram__btn--infitah {
  background: #039be5;
}

.tongue-diagram__btn--infitah:hover {
  background: #0288d1;
}

.tongue-diagram__btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.tongue-diagram__text {
  margin-top: 15px;
  font-weight: bold;
  color: #37474f;
}

.tongue-diagram__description {
  text-align: center;
  font-size: 0.9em;
  margin-top: 10px;
  color: #78909c;
  font-style: italic;
}

/* Flow Grid Styles */
.lesson-flow-grid {
  margin: 30px 0;
}

.lesson-flow-grid__title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--tw-primary);
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.flow-card {
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flow-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flow-card--shidda {
  background: #c62828;
}

.flow-card--tawassut {
  background: #f9a825;
  color: black;
}

.flow-card--rakhawa {
  background: #2e7d32;
}

.flow-card__title {
  margin: 0 0 10px 0;
  font-size: 1.2em;
  font-weight: bold;
}

.flow-card__desc {
  margin: 10px 0;
  font-size: 0.95em;
}

.flow-card__arabic {
  font-size: 1.4em;
  margin: 15px 0;
  padding: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.flow-card--tawassut .flow-card__arabic {
  background: rgba(0, 0, 0, 0.1);
}

.flow-card__letters {
  display: block;
  margin-top: 10px;
  font-size: 0.85em;
  opacity: 0.9;
}

/* Qiraat Tree Diagram */
.qiraat-tree {
  margin: 20px 0;
}

.qiraat-tree__root {
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--tw-primary);
  margin-bottom: 30px;
  padding: 15px;
  background: var(--tw-accent-light);
  border-radius: var(--tw-radius);
}

.qiraat-tree__branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.qiraat-branch {
  background: var(--tw-card-bg);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  padding: 15px;
  box-shadow: var(--tw-shadow);
}

.qiraat-branch__header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tw-primary);
}

.qiraat-branch__name {
  margin: 0 0 5px 0;
  color: var(--tw-primary);
  font-size: 1.1em;
}

.qiraat-branch__location {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}

.qiraat-branch__transmitters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qiraat-transmitter {
  padding: 10px;
  background: #f8f8f8;
  border-radius: 8px;
  border-left: 3px solid var(--tw-accent);
}

.qiraat-transmitter__name {
  font-weight: bold;
  color: var(--tw-primary);
  margin-bottom: 5px;
}

.qiraat-transmitter__full-name {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 3px;
}

.qiraat-transmitter__description {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}

/* Isnad Chain Diagram */
.isnad-chain {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.isnad-link {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: var(--tw-card-bg);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  box-shadow: var(--tw-shadow);
  border-left: 4px solid var(--tw-primary);
}

.isnad-link__level {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tw-primary);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.1em;
}

.isnad-link__content {
  flex: 1;
}

.isnad-link__name {
  margin: 0 0 8px 0;
  color: var(--tw-primary);
  font-size: 1.1em;
}

.isnad-link__arabic {
  font-size: 1.2em;
  color: var(--tw-primary);
  margin: 5px 0;
}

.isnad-link__period {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
  margin: 5px 0;
}

.isnad-link__description {
  margin: 8px 0;
  color: #555;
}

.isnad-link__examples {
  margin-top: 10px;
  font-size: 0.9em;
}

.isnad-link__examples ul {
  margin: 5px 0 0 20px;
  padding: 0;
}

.isnad-conditions {
  margin-top: 30px;
  padding: 20px;
  background: #f8f8f8;
  border-radius: var(--tw-radius);
}

.isnad-conditions h5 {
  margin: 0 0 15px 0;
  color: var(--tw-primary);
}

.isnad-condition {
  margin-bottom: 20px;
}

.isnad-condition h6 {
  margin: 0 0 8px 0;
  color: var(--tw-primary);
}

.isnad-condition ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

/* Transmission Methods Diagram */
.transmission-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.transmission-method {
  background: var(--tw-card-bg);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  padding: 20px;
  box-shadow: var(--tw-shadow);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.transmission-method:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.transmission-method__header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tw-primary);
}

.transmission-method__name {
  margin: 0 0 5px 0;
  color: var(--tw-primary);
  font-size: 1.1em;
}

.transmission-method__arabic {
  font-size: 1.2em;
  color: var(--tw-primary);
  margin: 5px 0;
}

.transmission-method__priority {
  display: inline-block;
  padding: 3px 8px;
  background: var(--tw-accent-light);
  color: var(--tw-primary);
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: bold;
  margin-top: 5px;
}

.transmission-method__description {
  font-weight: bold;
  color: #333;
  margin: 10px 0;
}

.transmission-method__details {
  color: #555;
  margin: 8px 0;
  font-size: 0.95em;
}

.transmission-method__example {
  margin-top: 10px;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 6px;
  font-size: 0.9em;
  color: #666;
}

/* Rasm Rules Diagram */
.rasm-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.rasm-rule {
  background: var(--tw-card-bg);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  padding: 20px;
  box-shadow: var(--tw-shadow);
}

.rasm-rule__header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tw-primary);
}

.rasm-rule__name {
  margin: 0 0 5px 0;
  color: var(--tw-primary);
  font-size: 1.1em;
}

.rasm-rule__arabic {
  font-size: 1.2em;
  color: var(--tw-primary);
  margin: 5px 0;
}

.rasm-rule__description {
  color: #555;
  margin: 10px 0;
}

.rasm-rule__examples {
  margin-top: 15px;
}

.rasm-example {
  padding: 10px;
  background: #f8f8f8;
  border-radius: 8px;
  margin-bottom: 10px;
}

.rasm-example__word {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 1.1em;
}

.rasm-example__arrow {
  color: var(--tw-primary);
  font-weight: bold;
}

.rasm-example__rule {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
  margin-top: 5px;
}

/* Print-friendly styles */
@media print {
  nav,
  .tw-sidebar,
  .nav-toggle,
  #theme-toggle,
  #search-toggle,
  #font-size-container,
  .lesson-btn,
  .ia-play,
  .ia-btn,
  .ia-toggle-vis,
  .ia-controls,
  .ia-row--mem,
  .lp,
  .makhraj-animate-btn,
  .font-switcher,
  .font-switcher__toggle,
  .mushaf-controls,
  .mushaf-toggle-vis,
  .tw-tajweed-label,
  .tw-topbar,
  .quiz-option:after,
  audio,
  footer {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }
  .lesson-page {
    max-width: 100%;
    padding: 0;
  }
  .lesson-example__arabic {
    font-size: 24pt;
    color: #000;
  }
  .arabic,
  .arabic-text {
    color: #000;
  }
  /* Remove tajweed color highlights on print (ink-saving) */
  .tw-rule-letter {
    color: inherit !important;
  }
}

/* Bottom tab navigation (mobile only) */
.bottom-tabs {
  display: none;
}

@media (max-width: 768px) {
  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--tw-bg, #fff);
    border-top: 1px solid var(--tw-border, #e0e0e0);
    z-index: 999;
    padding: 4px 0 env(safe-area-inset-bottom, 4px);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  }
  .bottom-tabs__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    text-decoration: none;
    color: var(--tw-text, #666);
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.2s;
  }
  .bottom-tabs__item--active,
  .bottom-tabs__item:hover {
    opacity: 1;
    color: var(--tw-primary, #004d40);
  }
  .bottom-tabs__icon {
    font-size: 20px;
    line-height: 1;
  }
  .bottom-tabs__label {
    font-weight: 500;
  }
  /* Pad main content so it doesn't hide behind tabs */
  .tw-main-wrapper {
    padding-bottom: 64px;
  }
  /* Dark theme */
  [data-theme="dark"] .bottom-tabs {
    background: var(--tw-card-bg, #16213e);
    border-color: var(--tw-card-border, #2a2a4a);
  }
}

/* ══════════════════════════════════════════════════════════
   Общие анимации (единый источник для spin/pulse/shake/fadeIn).
   Убирает дублирование inline @keyframes в разных JS-файлах.
   ══════════════════════════════════════════════════════════ */
@keyframes tw-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes tw-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}
@keyframes tw-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}
@keyframes tw-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Обратная совместимость — старые имена без префикса */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════════════════════
   A-B Loop Controls (Mushaf playback)
   ══════════════════════════════════════════════════════════ */
.mushaf-ab-row {
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.mushaf-ab-btn {
  font-size: 0.8em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--tw-card-bg, #f5f5f5);
  border: 1px solid var(--tw-border, #ddd);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  font-weight: 600;
}
.mushaf-ab-btn:hover {
  background: rgba(0, 77, 64, 0.08);
}
.mushaf-ab-btn.active {
  background: var(--tw-primary, #004d40);
  color: #fff;
  border-color: var(--tw-primary, #004d40);
}
.mushaf-ab-btn--clear {
  color: #c62828;
  border-color: #c62828;
  background: transparent;
  font-size: 0.75em;
  padding: 3px 6px;
}
.mushaf-ab-btn--clear:hover {
  background: rgba(198, 40, 40, 0.08);
}
.mushaf-ab-label {
  font-size: 0.8em;
  color: var(--tw-text, #333);
  opacity: 0.7;
  min-width: 3em;
}
.mushaf-ab-settings {
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid var(--tw-border, #ddd);
  border-radius: 8px;
  background: var(--tw-card-bg, #fff);
  font-size: 0.85em;
}
.mushaf-ab-settings__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mushaf-ab-settings__row:last-child {
  margin-bottom: 0;
}
.mushaf-ab-settings__row label {
  min-width: 5em;
  font-weight: 500;
}
.mushaf-ab-settings__row select {
  flex: 1;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--tw-border, #ddd);
}

/* Dark theme overrides */
[data-theme="dark"] .mushaf-ab-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ccc;
}
[data-theme="dark"] .mushaf-ab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .mushaf-ab-btn.active {
  background: var(--tw-primary, #004d40);
  color: #fff;
}
[data-theme="dark"] .mushaf-ab-settings {
  background: var(--tw-card-bg, #1e293b);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ══════════════════════════════════════════════════════════
   Multi-Ayah Cards (Mushaf)
   ══════════════════════════════════════════════════════════ */
.mushaf-multi-ayah {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.mushaf-ayah-card {
  background: var(--tw-card-bg, #fff);
  border: 1px solid var(--tw-border, #e0e0e0);
  border-radius: 14px;
  padding: 16px 20px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.mushaf-ayah-card__num {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.7em;
  color: #aaa;
  background: var(--tw-bg, #f5f5f5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.mushaf-ayah-card__play {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--tw-accent, #d4af37);
  color: #fff;
  font-size: 0.75em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.mushaf-ayah-card__play:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.mushaf-ayah-card--active {
  border-color: var(--tw-accent, #d4af37);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
}
.mushaf-ayah-card .mushaf-ayah-card__arabic,
.mushaf-ayah-card .mushaf-ayah-card__arabic.arabic {
  font-size: calc(var(--tw-arabic-scale, 1) * 1.8em);
  line-height: 2.2;
  text-align: right;
  margin-bottom: 8px;
}
.mushaf-ayah-card__translit {
  font-size: 0.9em;
  color: var(--tw-primary, #004d40);
  font-weight: 500;
  margin-bottom: 6px;
}
.mushaf-ayah-card__translation {
  font-size: 0.9em;
  color: #555;
  font-style: italic;
  line-height: 1.5;
}
.mushaf-ayah-card--error {
  color: #c62828;
  text-align: center;
  padding: 16px;
}
.mushaf-nav__count-select {
  padding: 4px 8px;
  border: 1px solid var(--tw-border, #ddd);
  border-radius: 6px;
  font-size: 0.8em;
  background: var(--tw-bg, #f8f9fa);
  cursor: pointer;
}

/* Dark */
[data-theme="dark"] .mushaf-ayah-card {
  background: var(--tw-card-bg, #1e293b);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .mushaf-ayah-card__num {
  background: rgba(255, 255, 255, 0.06);
  color: #888;
}
[data-theme="dark"] .mushaf-ayah-card__translit {
  color: #66bb6a;
}
[data-theme="dark"] .mushaf-ayah-card__translation {
  color: #aaa;
}
