/* ============================================================
   QURAN APP — COMPONENTS
   components.css · buttons · cards · forms · dropdowns · etc.
   ============================================================ */

/* ============================================================
   BUTTONS — rectangular, minimal arch (3px)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  height: 40px;
  padding: 0 var(--space-5);

  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);

  border-radius: var(--radius-sm);      /* ← 3px */
  border: 1px solid transparent;

  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;

  transition:
    background-color var(--duration-fast) var(--ease),
    border-color     var(--duration-fast) var(--ease),
    color            var(--duration-fast) var(--ease),
    box-shadow       var(--duration-fast) var(--ease),
    transform        var(--duration-fast) var(--ease);
}
.btn svg { width: 16px; height: 16px; }

/* Primary — Mudhamatan green, flat, sharp */
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-invert);
  border-color: var(--color-primary-active);
  box-shadow:
    var(--shadow-inset-top),
    0 1px 2px rgba(0, 0, 0, 0.08);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--mudhamatan-800);
  color: var(--color-text-invert);
}
.btn--primary:active {
  background: var(--color-primary-active);
  transform: translateY(1px);
  box-shadow: var(--shadow-inset-top);
}

.avatar {
  background: var(--avatar-bg, linear-gradient(135deg, var(--mudhamatan-500), var(--mudhamatan-700)));
}


/* Secondary — outlined, crisp */
.btn--secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover {
  background: var(--color-bg-subtle);
  border-color: var(--mudhamatan-400);
  color: var(--color-text);
}
.btn--secondary:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn--ghost:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

/* Outline — green outline only */
.btn--outline {
  background: transparent;
  color: var(--mudhamatan-700);
  border-color: var(--mudhamatan-500);
}
.btn--outline:hover {
  background: var(--mudhamatan-50);
  border-color: var(--mudhamatan-600);
  color: var(--mudhamatan-800);
}
[data-theme="dark"] .btn--outline {
  color: var(--mudhamatan-300);
}
[data-theme="dark"] .btn--outline:hover {
  background: rgba(46, 158, 91, 0.1);
  color: var(--mudhamatan-200);
}

/* Danger */
.btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: #b91c1c;
}
.btn--danger:hover { background: #b91c1c; color: #fff; }

/* Sizes */
.btn--sm {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-xs);
}
.btn--lg {
  height: 48px;
  padding: 0 var(--space-6);
  font-size: var(--text-md);
}
.btn--block { width: 100%; }
.btn--icon {
  width: 40px;
  padding: 0;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);      /* 4px */
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-base) var(--ease),
              box-shadow var(--duration-base) var(--ease),
              transform var(--duration-base) var(--ease);
}

.card--hover:hover {
  border-color: var(--mudhamatan-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
}
.form-label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 var(--space-4);

  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);       /* ← 3px */
  background: var(--color-bg-elevated);
  color: var(--color-text);

  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.form-control::placeholder { color: var(--color-text-subtle); }
.form-control:hover { border-color: var(--color-border-strong); }
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}
.form-control:disabled {
  background: var(--color-bg-subtle);
  color: var(--color-text-subtle);
  cursor: not-allowed;
}

textarea.form-control {
  height: auto;
  min-height: 104px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  line-height: 1.6;
}

select.form-control {
  appearance: none;
  padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6b5f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.form-error {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-danger);
}

/* Input group with icon */
.input-group { position: relative; }
.input-group .form-control { padding-left: var(--space-10); }
.input-group > svg,
.input-group .input-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--color-text-subtle);
  pointer-events: none;
}
.input-group .input-suffix {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}
.input-group .input-suffix:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  user-select: none;
}
.checkbox input {
  width: 16px; height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown { position: relative; }

.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;

  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);       /* 4px */
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);

  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              visibility var(--duration-fast) var(--ease);
}
.dropdown.is-open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);

  border-radius: var(--radius-xs);       /* 2px */
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: left;

  transition: background-color var(--duration-fast) var(--ease);
}
.dropdown__item:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}
.dropdown__item svg {
  width: 16px; height: 16px;
  color: var(--color-text-muted);
}

.dropdown__divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-1) 0;
}

.dropdown__header {
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-1);
}
.dropdown__name {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.dropdown__email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;

  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;

  border-radius: var(--radius-xs);       /* 2px — chip, not pill */
  border: 1px solid transparent;
}

.badge--primary {
  background: var(--mudhamatan-50);
  color: var(--mudhamatan-700);
  border-color: var(--mudhamatan-100);
}
.badge--success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.badge--warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.badge--danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.badge--info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.badge--gold {
  background: rgba(251, 191, 36, 0.12);
  color: var(--gold-700);
  border-color: rgba(251, 191, 36, 0.25);
}

[data-theme="dark"] .badge--primary {
  background: rgba(46, 158, 91, 0.12);
  color: var(--mudhamatan-300);
  border-color: rgba(46, 158, 91, 0.25);
}

/* ============================================================
   ALERT
   ============================================================ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);

  border-radius: var(--radius-md);       /* 4px */
  border: 1px solid transparent;

  font-size: var(--text-sm);
  line-height: 1.5;
}
.alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

.alert--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.alert--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.alert--warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

[data-theme="dark"] .alert--error {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}
[data-theme="dark"] .alert--success {
  background: rgba(46, 158, 91, 0.1);
  border-color: rgba(46, 158, 91, 0.3);
  color: var(--mudhamatan-300);
}
[data-theme="dark"] .alert--info {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #93c5fd;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin: var(--space-5) 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  min-width: 280px;
  max-width: 380px;
  padding: var(--space-4);

  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);      /* 4px */

  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--color-text);

  pointer-events: auto;
  animation: toast-in var(--duration-base) var(--ease-out);
}
.toast--success { border-left-color: var(--color-success); }
.toast--error   { border-left-color: var(--color-danger); }
.toast--warning { border-left-color: var(--color-warning); }

@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-bg-subtle) 25%,
    var(--color-border) 50%,
    var(--color-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   VERSE CARD — signature reading surface
   ============================================================ */
.verse-card {
  position: relative;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);       /* 4px */
  padding: var(--space-8) var(--space-8) var(--space-6);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease),
              box-shadow var(--duration-base) var(--ease);
}
.verse-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,
    var(--mudhamatan-400),
    var(--mudhamatan-700));
}
.verse-card:hover {
  border-color: var(--mudhamatan-300);
  box-shadow: 0 8px 24px rgba(31, 122, 68, 0.1);
}

.verse-card__arabic {
  font-family: var(--font-arabic);
  font-size: 2rem;
  line-height: 2.1;
  color: var(--mudhamatan-900);
  direction: rtl;
  text-align: right;
  margin-bottom: var(--space-5);
}
[data-theme="dark"] .verse-card__arabic {
  color: var(--mudhamatan-100);
}

.verse-card__translation {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  line-height: 1.75;
}

.verse-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 var(--space-3);

  border-radius: var(--radius-pill);     /* circle — traditional ayah marker */
  background: linear-gradient(135deg,
    var(--mudhamatan-500),
    var(--mudhamatan-700));
  color: var(--gold-300);

  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: var(--text-md);
  box-shadow: 0 4px 12px rgba(31, 122, 68, 0.25);
}

/* ============================================================
   SURAH LIST ITEM
   ============================================================ */
.surah-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);

  border: 1px solid transparent;
  border-radius: var(--radius-sm);       /* 3px */
  cursor: pointer;

  transition: background-color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}
.surah-item:hover {
  background: var(--mudhamatan-50);
  border-color: var(--mudhamatan-100);
}
[data-theme="dark"] .surah-item:hover {
  background: rgba(46, 158, 91, 0.08);
  border-color: rgba(46, 158, 91, 0.2);
}

.surah-item__number {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  background: var(--mudhamatan-100);
  color: var(--mudhamatan-700);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);

  /* 8-point star — traditional mushaf ayah marker */
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%,
                     70% 100%, 30% 100%, 0% 70%, 0% 30%);
}
[data-theme="dark"] .surah-item__number {
  background: rgba(46, 158, 91, 0.15);
  color: var(--mudhamatan-300);
}

.surah-item__name-ar {
  font-family: var(--font-arabic);
  font-size: var(--text-xl);
  color: var(--mudhamatan-800);
  line-height: 1.3;
}
[data-theme="dark"] .surah-item__name-ar {
  color: var(--mudhamatan-200);
}

.surah-item__name-en {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}

.surah-item__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* ============================================================
   BISMILLAH BANNER
   ============================================================ */
.bismillah-banner {
  text-align: center;
  padding: var(--space-8) var(--space-6);

  background: linear-gradient(135deg,
    var(--mudhamatan-800) 0%,
    var(--mudhamatan-900) 100%);
  border-radius: var(--radius-md);       /* 4px */
  border: 1px solid rgba(251, 191, 36, 0.2);

  color: var(--gold-300);
  font-family: var(--font-arabic);
  font-size: 1.75rem;
  line-height: 1.8;

  position: relative;
  overflow: hidden;
}
.bismillah-banner::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-xs);
  pointer-events: none;
}

/* ============================================================
   AUDIO PLAYER BAR
   ============================================================ */
.audio-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-toast);

  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);

  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);

  min-width: 340px;
  max-width: min(560px, calc(100vw - 32px));

  transition: transform var(--duration-base) var(--ease);
}

.audio-bar.is-active {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.audio-bar__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.audio-bar__label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-bar__progress {
  height: 3px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.audio-bar__progress-fill {
  height: 100%;
  width: 0;
  background: var(--mudhamatan-500);
  transition: width 200ms linear;
}

/* ============================================================
   TAFSIR PANEL
   ============================================================ */
.tafsir-panel {
  margin-top: var(--space-4);
  padding: var(--space-5);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-sm);
}
.tafsir-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.tafsir-panel__body {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-text);
}
.tafsir-panel__body p { margin-bottom: var(--space-3); }
.tafsir-panel__body p:last-child { margin-bottom: 0; }
.tafsir-panel__body .arabic {
  display: block;
  text-align: right;
  color: var(--mudhamatan-700);
  margin: var(--space-3) 0;
  font-size: 1.4em;
}
.tafsir-panel__source {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================================
   MEMORIZATION (HIFZ) MODE
   ============================================================ */
.memorize-toggle { display: none; margin-bottom: var(--space-4); }
body.hifz-active .memorize-toggle { display: none; }

.memorize-toolbar {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--mudhamatan-800), var(--mudhamatan-900));
  color: #fff;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  position: sticky;
  top: calc(var(--header-h) + var(--space-3));
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-lg);
}
body.hifz-active .memorize-toolbar { display: flex; }
body.hifz-active .memorize-toggle { display: none; }

.memorize-toolbar__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--gold-300);
  letter-spacing: var(--tracking-tight);
}

.memorize-toolbar__levels {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
  border-radius: var(--radius-sm);
  margin-left: auto;
}
.memorize-level {
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}
.memorize-level:hover { color: #fff; }
.memorize-level.is-active {
  background: var(--gold-400);
  color: var(--mudhamatan-900);
  font-weight: var(--font-semibold);
}

/* Blur levels applied to verse-card arabic */
body.hifz-active .verse-card__arabic {
  transition: filter var(--duration-base) var(--ease),
              color  var(--duration-base) var(--ease);
}
body.hifz-level-1 .verse-card__arabic { filter: blur(1.5px); }
body.hifz-level-2 .verse-card__arabic { filter: blur(4px); }
body.hifz-level-3 .verse-card__arabic { filter: blur(8px); }
body.hifz-level-4 .verse-card__arabic { color: transparent; user-select: none; }
body.hifz-level-4 .verse-card__arabic::selection { background: transparent; }

/* Reveal on tap */
body.hifz-active .verse-card__arabic:hover {
  filter: none !important;
  color: var(--mudhamatan-900) !important;
}
[data-theme="dark"] body.hifz-active .verse-card__arabic:hover {
  color: var(--mudhamatan-100) !important;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.pagination__pages {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-bg-subtle);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease),
              color            var(--duration-fast) var(--ease);
}

.pagination__page:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text);
}

.pagination__page.is-active {
  background: var(--color-primary);
  color: #fff;
  font-weight: var(--font-semibold);
}

.pagination__ellipsis {
  padding: 0 var(--space-2);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .pagination__pages { display: none; }
  .pagination { justify-content: space-between; }
}
/* ============================================================
   VERSE CARD — PLAYING STATE
   ============================================================ */
.verse-card.is-playing {
  border-color: var(--mudhamatan-400);
  background: linear-gradient(180deg,
    rgba(31, 122, 68, 0.04) 0%,
    var(--color-bg-elevated) 100%);
  box-shadow: 0 8px 24px rgba(31, 122, 68, 0.15);
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 80px); /* offset for sticky header */
}

.verse-card.is-playing::before {
  background: linear-gradient(180deg,
    var(--gold-400),
    var(--gold-600));
  width: 4px;
}

[data-theme="dark"] .verse-card.is-playing {
  background: linear-gradient(180deg,
    rgba(46, 158, 91, 0.08) 0%,
    var(--color-bg-elevated) 100%);
  border-color: var(--mudhamatan-500);
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}


/* ============================================================
   AUDIO TOOLBAR — mobile-first (iPhone 14 Pro = 393px)
   ============================================================ */

/* Reciter selector — compact, doesn't stretch */
#reciter-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 0.875rem;
    padding: 6px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* On larger screens, cap it so it doesn't look silly */
@media (min-width: 600px) {
    #reciter-select {
        width: auto;
        max-width: 260px;
        min-width: 200px;
    }
}

/* Translation selector — same treatment */
.page-header select[name="translation"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 0.875rem;
    padding: 6px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

@media (min-width: 600px) {
    .page-header select[name="translation"] {
        width: auto;
        max-width: 260px;
        min-width: 200px;
    }
}

/* ---------- Word-by-word morphology chips ---------- */
.word-chip__pos,
.word-chip__lemma,
.word-chip__root {
    display: block;
    font-size: 0.75rem;
    margin-top: 4px;
    line-height: 1.3;
}

.word-chip__pos {
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.word-chip__lemma {
    color: var(--mudhamatan-700);
    font-size: 0.9rem;
}

.word-chip__root {
    color: var(--gold-700, #8a6d1e);
    font-size: 0.8rem;
}
/* ============================================================
   STRENGTH METER — verification indicator
   ============================================================ */
.strength-meter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
}
.strength-meter::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.strength-meter--verified {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}
.strength-meter--verified::before { background: #10b981; }

.strength-meter--disputed {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}
.strength-meter--disputed::before { background: #f59e0b; }

.strength-meter--popular {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.3);
}
.strength-meter--popular::before { background: #3b82f6; }

[data-theme="dark"] .strength-meter--verified { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
[data-theme="dark"] .strength-meter--disputed { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .strength-meter--popular  { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
/* ============================================================
   TAFSIR TABS — language selector inside the tafsir panel
   ============================================================ */
.tafsir-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.tafsir-tab {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background-color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}

.tafsir-tab:hover {
  background: var(--mudhamatan-50);
  border-color: var(--mudhamatan-400);
}

.tafsir-tab.is-active {
  background: var(--mudhamatan-600);
  border-color: var(--mudhamatan-700);
  color: white;
}

.tafsir-tab__lang {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.tafsir-tab.is-active .tafsir-tab__lang {
  color: rgba(255, 255, 255, 0.85);
}

.tafsir-tab__name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
  margin-top: 2px;
}

.tafsir-tab.is-active .tafsir-tab__name {
  color: white;
}

/* ============================================================
   TAFSIR COUNT BADGE — small number next to "Tafsir" button
   ============================================================ */
.tafsir-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;

  font-size: 10px;
  font-weight: 700;
  line-height: 1;

  background: var(--gold-400);
  color: var(--mudhamatan-900);
  border-radius: 9px;
}

/* ============================================================
   TAFSIR PAGE — full-page dedicated view
   ============================================================ */
.tafsir-page {
  max-width: 800px;
  margin: 0 auto;
}

.tafsir-hero {
  background: linear-gradient(135deg,
    var(--mudhamatan-900) 0%,
    var(--mudhamatan-700) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
}
.tafsir-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(251, 191, 36, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 70%, rgba(251, 191, 36, 0.06) 0%, transparent 50%);
  pointer-events: none;
}
.tafsir-hero > * { position: relative; }

.tafsir-hero__surah {
  font-size: var(--text-sm);
  color: var(--gold-300);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.tafsir-hero__arabic {
  font-family: var(--font-arabic);
  font-size: 1.8rem;
  line-height: 2.1;
  color: rgba(255, 255, 255, 0.95);
  direction: rtl;
  text-align: right;
  margin-bottom: var(--space-4);
}

.tafsir-hero__translation {
  font-size: var(--text-md);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.tafsir-hero__source {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-style: normal;
  color: var(--gold-300);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tafsir-page__body {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.tafsir-page__header {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.tafsir-page__header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mudhamatan-800);
  margin: 0 0 var(--space-2);
  border: none;
  padding: 0;
}

.tafsir-page__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.tafsir-page__content {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--color-text);
}

.tafsir-page__content p { margin-bottom: var(--space-4); }
.tafsir-page__content p:last-child { margin-bottom: 0; }
.tafsir-page__content h2,
.tafsir-page__content h3,
.tafsir-page__content h4 {
  color: var(--mudhamatan-800);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  border: none;
  padding: 0;
}

.tafsir-page__footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

[data-theme="dark"] .tafsir-page__header h1,
[data-theme="dark"] .tafsir-page__content h2,
[data-theme="dark"] .tafsir-page__content h3,
[data-theme="dark"] .tafsir-page__content h4 {
  color: var(--mudhamatan-200);
}

/* Dark theme tweak */
[data-theme="dark"] .tafsir-tab:hover {
  background: rgba(46, 158, 91, 0.1);
}

/* Asbab tab — distinct gold accent */
.tafsir-tab--asbab {
  border-color: var(--gold-400);
  background: rgba(251, 191, 36, 0.08);
}
.tafsir-tab--asbab:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--gold-500);
}
.tafsir-tab--asbab.is-active {
  background: var(--gold-500);
  border-color: var(--gold-600);
  color: var(--mudhamatan-900);
}
.tafsir-tab--asbab.is-active .tafsir-tab__lang,
.tafsir-tab--asbab.is-active .tafsir-tab__name {
  color: var(--mudhamatan-900);
}

/* ============================================================
   DUAS — browse page + detail page
   ============================================================ */

.duas-page,
.dua-page {
  max-width: 900px;
  margin: 0 auto;
}

/* --- Hero --- */
.duas-hero {
  text-align: center;
  margin-bottom: var(--space-6);
}
.duas-hero h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.duas-hero__sub {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  max-width: 60ch;
  margin: 0 auto;
}

/* --- Search --- */
.duas-search {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.duas-search__input {
  flex: 1;
  height: 42px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.duas-search__input:hover {
  border-color: var(--color-border-strong);
}
.duas-search__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

/* --- Filter chips --- */
.duas-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.duas-filter {
  padding: 6px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease),
              border-color     var(--duration-fast) var(--ease),
              color            var(--duration-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.duas-filter:hover {
  border-color: var(--gold-400);
  color: var(--color-text);
  background: var(--color-bg-subtle);
}
.duas-filter.is-active {
  background: var(--gold-400);
  border-color: var(--gold-500);
  color: var(--mudhamatan-900);
  font-weight: var(--font-semibold);
}
.duas-filter__count {
  opacity: 0.75;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
.duas-filter.is-active .duas-filter__count {
  opacity: 0.9;
}

/* --- Grid --- */
.duas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* --- Card --- */
.dua-card {
  display: block;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration-base) var(--ease),
              box-shadow   var(--duration-base) var(--ease),
              transform    var(--duration-base) var(--ease);
}
.dua-card:hover {
  border-color: var(--gold-500);
  border-left-color: var(--gold-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.dua-card__ref {
  font-size: var(--text-xs);
  color: var(--gold-700);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.dua-card__cat {
  color: var(--color-text-subtle);
  font-weight: var(--font-normal);
  letter-spacing: normal;
  text-transform: none;
}
.dua-card__title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.35;
  letter-spacing: var(--tracking-tight);
}
.dua-card__preview {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* --- Detail page --- */
.dua-page__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-5);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--duration-fast) var(--ease);
}
.dua-page__back:hover {
  color: var(--color-primary);
}
.dua-page__hero {
  text-align: center;
  margin-bottom: var(--space-6);
}
.dua-page__ref {
  color: var(--gold-700);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.dua-page__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.2;
}
.dua-page__badges {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}
.dua-page__content {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
}
.dua-page__content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.dua-page__arabic {
  font-family: var(--font-arabic);
  font-size: 2rem;
  line-height: 2.2;
  text-align: right;
  direction: rtl;
  margin-bottom: var(--space-5);
  color: var(--mudhamatan-900);
}
[data-theme="dark"] .dua-page__arabic {
  color: var(--mudhamatan-100);
}
.dua-page__translit {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.85;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-xs);
}
.dua-page__translation {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.dua-page__context {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  line-height: 1.65;
}
.dua-page__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.dua-page__tags {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}
.tag-chip {
  display: inline-block;
  padding: 4px var(--space-3);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease),
              border-color     var(--duration-fast) var(--ease),
              color            var(--duration-fast) var(--ease);
}
.tag-chip:hover {
  background: var(--gold-400);
  border-color: var(--gold-500);
  color: var(--mudhamatan-900);
}
.dua-page__related {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.dua-page__related h2 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

/* --- Verse card "Dua" chip --- */
.verse-card__dua-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid var(--gold-400);
  border-radius: var(--radius-xs);
  color: var(--gold-700);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-decoration: none;
  margin-left: var(--space-2);
  transition: background-color var(--duration-fast) var(--ease),
              color            var(--duration-fast) var(--ease);
}
.verse-card__dua-chip:hover {
  background: var(--gold-400);
  color: var(--mudhamatan-900);
}
[data-theme="dark"] .verse-card__dua-chip {
  color: var(--gold-300);
}
[data-theme="dark"] .verse-card__dua-chip:hover {
  background: var(--gold-500);
  color: var(--mudhamatan-900);
}

/* ============================================================
   TAFSIRS — browse page, edition index, edition-surah view
   ============================================================ */

.tafsirs-page,
.tafsir-edition-page,
.tafsir-edition-surah {
  max-width: 1000px;
  margin: 0 auto;
}

/* --- Hero --- */
.tafsirs-hero {
  text-align: center;
  margin-bottom: var(--space-8);
}
.tafsirs-hero h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.tafsirs-hero__sub {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  max-width: 60ch;
  margin: 0 auto;
}

/* --- Editions grid --- */
.tafsirs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.tafsir-edition-card {
  display: block;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--mudhamatan-500);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration-base) var(--ease),
              box-shadow   var(--duration-base) var(--ease),
              transform    var(--duration-base) var(--ease);
}
.tafsir-edition-card:hover {
  border-color: var(--mudhamatan-400);
  border-left-color: var(--mudhamatan-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.tafsir-edition-card--asbab {
  border-left-color: var(--gold-400);
}
.tafsir-edition-card--asbab:hover {
  border-color: var(--gold-400);
  border-left-color: var(--gold-500);
}

.tafsir-edition-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.tafsir-edition-card__lang {
  color: var(--color-primary);
}
.tafsir-edition-card--asbab .tafsir-edition-card__lang {
  color: var(--gold-700);
}
.tafsir-edition-card__count {
  color: var(--color-text-subtle);
}

.tafsir-edition-card__name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.3;
  letter-spacing: var(--tracking-tight);
}
.tafsir-edition-card__author {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.tafsir-edition-card__preview {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.tafsir-edition-card__cta {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-primary);
}
.tafsir-edition-card--asbab .tafsir-edition-card__cta {
  color: var(--gold-700);
}

/* --- Edition index page --- */
.tafsir-edition-page__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-5);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--duration-fast) var(--ease);
}
.tafsir-edition-page__back:hover {
  color: var(--color-primary);
}

.tafsir-edition-page__hero {
  text-align: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.tafsir-edition-page__lang {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.tafsir-edition-page__hero h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.tafsir-edition-page__author {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.tafsir-edition-page__meta {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.tafsir-edition-page__surahs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-2);
}

.surah-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  text-decoration: none;
  color: inherit;
  transition: background-color var(--duration-fast) var(--ease),
              border-color     var(--duration-fast) var(--ease);
}
.surah-link:hover {
  background: var(--mudhamatan-50);
  border-color: var(--mudhamatan-200);
}
[data-theme="dark"] .surah-link:hover {
  background: rgba(46, 158, 91, 0.08);
  border-color: rgba(46, 158, 91, 0.2);
}
.surah-link__num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mudhamatan-100);
  color: var(--mudhamatan-700);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  border-radius: var(--radius-xs);
}
[data-theme="dark"] .surah-link__num {
  background: rgba(46, 158, 91, 0.15);
  color: var(--mudhamatan-300);
}
.surah-link__body {
  flex: 1;
  min-width: 0;
}
.surah-link__en {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}
.surah-link__ar {
  font-family: var(--font-arabic);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  direction: rtl;
}
.surah-link__count {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-weight: var(--font-medium);
  white-space: nowrap;
}

/* --- Edition-surah page --- */
.tafsir-edition-surah__hero {
  text-align: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.tafsir-edition-surah__edition {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.tafsir-edition-surah__hero h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.tafsir-edition-surah__ar {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  color: var(--color-text-muted);
}
.tafsir-edition-surah__meta {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.tafsir-edition-surah__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tafsir-ayah-block {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
}
.tafsir-ayah-block__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}
.tafsir-ayah-block__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  background: linear-gradient(135deg, var(--mudhamatan-500), var(--mudhamatan-700));
  color: var(--gold-300);
  font-family: var(--font-arabic);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  border-radius: var(--radius-pill);
}
.tafsir-ayah-block__link {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-primary);
  text-decoration: none;
}
.tafsir-ayah-block__link:hover {
  text-decoration: underline;
}
.tafsir-ayah-block__arabic {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  line-height: 2.1;
  color: var(--mudhamatan-900);
  text-align: right;
  direction: rtl;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
[data-theme="dark"] .tafsir-ayah-block__arabic {
  color: var(--mudhamatan-100);
}
.tafsir-ayah-block__body {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-text);
}

/* ============================================================
   SEARCH RESULT CARD — footer actions strip
   ============================================================ */
.verse-card__search-actions {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.verse-card__search-actions .btn {
  font-size: 11px;
  height: 28px;
  padding: 0 10px;
}

/* ============================================================
   TAFSIR LINKS — small inline links scattered across the app
   ============================================================ */
.tafsir-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease),
              border-color     var(--duration-fast) var(--ease),
              color            var(--duration-fast) var(--ease);
}
.tafsir-link:hover {
  border-color: var(--gold-400);
  background: rgba(251, 191, 36, 0.08);
  color: var(--gold-700);
}
.tafsir-link__label {
  letter-spacing: var(--tracking-tight);
}
.tafsir-link--icon-only {
  padding: 3px 5px;
}
.tafsir-link--compact {
  padding: 2px 7px;
  font-size: 11px;
}
[data-theme="dark"] .tafsir-link {
  background: var(--color-bg-subtle);
  border-color: var(--color-border);
}
[data-theme="dark"] .tafsir-link:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--gold-500);
  color: var(--gold-300);
}

/* ============================================================
   TAFSIR COMPARE — multi-edition side-by-side
   ============================================================ */

.tafsir-compare-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.tafsir-compare-bar__label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}
.tafsir-compare-bar__icon {
  font-size: 1.2em;
  line-height: 1;
}
.tafsir-compare-bar__hint {
  color: var(--color-text-muted);
  font-weight: var(--font-normal);
  font-size: var(--text-xs);
}

/* Picker dropdown (uses native <details> for zero JS) */
.tafsir-compare-picker { position: relative; }
.tafsir-compare-picker > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
}
.tafsir-compare-picker > summary::-webkit-details-marker { display: none; }

.tafsir-compare-picker__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 300px;
  max-width: 90vw;
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
}

.tafsir-compare-picker__option {
  display: block;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  text-decoration: none;
  color: inherit;
  transition: background-color var(--duration-fast) var(--ease),
              border-color     var(--duration-fast) var(--ease);
}
.tafsir-compare-picker__option:last-child { margin-bottom: 0; }
.tafsir-compare-picker__option:hover {
  border-color: var(--mudhamatan-400);
  background: var(--mudhamatan-50);
}
.tafsir-compare-picker__option--asbab {
  border-color: var(--gold-400);
}
.tafsir-compare-picker__option--asbab:hover {
  background: rgba(251, 191, 36, 0.08);
  border-color: var(--gold-500);
}
.tafsir-compare-picker__lang {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.tafsir-compare-picker__name {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* Compare grid — columns of tafsir */
.tafsir-compare-grid {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.tafsir-compare-grid--2 { grid-template-columns: 1fr 1fr; }
.tafsir-compare-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.tafsir-compare-grid--4 { grid-template-columns: 1fr 1fr; }
.tafsir-compare-grid--4 .tafsir-compare-col:nth-child(n+3) { grid-column: span 1; }

.tafsir-compare-col {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--mudhamatan-500);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tafsir-compare-col--asbab {
  border-left-color: var(--gold-400);
}

.tafsir-compare-col__header {
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}
.tafsir-compare-col__lang {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mudhamatan-600);
  margin-bottom: var(--space-1);
}
.tafsir-compare-col--asbab .tafsir-compare-col__lang {
  color: var(--gold-700);
}
.tafsir-compare-col__name {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-1);
  line-height: 1.3;
  border: none;
  padding: 0;
}
.tafsir-compare-col__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.tafsir-compare-col__body {
  flex: 1;
  padding: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-text);
  max-height: 60vh;
  overflow-y: auto;
}
.tafsir-compare-col__body p { margin-bottom: var(--space-3); }
.tafsir-compare-col__body p:last-child { margin-bottom: 0; }

.tafsir-compare-col__footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  text-align: right;
}
.tafsir-compare-col__link {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-primary);
  text-decoration: none;
}
.tafsir-compare-col__link:hover {
  text-decoration: underline;
}

/* Mobile — stack columns */
@media (max-width: 900px) {
  .tafsir-compare-grid--2,
  .tafsir-compare-grid--3,
  .tafsir-compare-grid--4 {
    grid-template-columns: 1fr;
  }
  .tafsir-compare-col__body {
    max-height: none;
  }
}

/* ============================================================
   MUSHAF PAGE — professional printed-Mushaf look
   ============================================================ */

.mushaf-page {
  direction: rtl;
  text-align: justify;
  text-align-last: center;
  line-height: 2.6;

  font-family: var(--font-arabic);
  font-size: 1.6rem;

  padding: var(--space-8) var(--space-6);
  margin: var(--space-4) auto;
  max-width: 900px;

  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);

  box-shadow:
    inset 0 0 0 1px var(--color-bg-elevated),
    inset 0 0 0 2px rgba(217, 119, 6, 0.15),
    0 2px 12px rgba(0, 0, 0, 0.04);

  position: relative;
  color: var(--mudhamatan-900);

  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

[data-theme="dark"] .mushaf-page {
  color: var(--mudhamatan-100);
  box-shadow:
    inset 0 0 0 1px var(--color-bg-elevated),
    inset 0 0 0 2px rgba(217, 119, 6, 0.2),
    0 2px 12px rgba(0, 0, 0, 0.5);
}

.mushaf-page::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(217, 119, 6, 0.12);
  border-radius: 2px;
  pointer-events: none;
}

[data-theme="dark"] .mushaf-page::before {
  border-color: rgba(217, 119, 6, 0.18);
}

/* ---------- Ayah inline flow ---------- */
.mushaf-page__ayah {
  display: inline;
  color: inherit;
}

/* ---------- Ayah marker — traditional gold ۝ ornament ---------- */
.mushaf-page__marker {
  display: inline-block;
  margin: 0 6px;
  padding: 0;
  color: var(--gold-600);
  font-family: var(--font-arabic);
  font-size: 1.05em;
  vertical-align: -2px;
  line-height: 1;
  font-weight: 400;
  text-shadow: 0 0 1px rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .mushaf-page__marker {
  color: var(--gold-400);
}

/* ---------- Sajda marker ---------- */
.mushaf-page__sajda {
  display: inline-block;
  margin: 0 6px;
  color: var(--gold-600);
  font-size: 1em;
  vertical-align: 0;
}

[data-theme="dark"] .mushaf-page__sajda {
  color: var(--gold-400);
}

/* ---------- Surah header — ornamental banner (NO Bismillah flourishes) ---------- */
.mushaf-page__surah-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);

  margin: var(--space-8) 0 var(--space-4);
  padding: var(--space-4) var(--space-6);

  font-family: var(--font-arabic);
  font-size: 1.3rem;
  font-weight: 700;

  color: var(--mudhamatan-800);

  background:
    linear-gradient(180deg,
      rgba(217, 119, 6, 0.04) 0%,
      rgba(217, 119, 6, 0.01) 100%);
  border-top: 1px solid rgba(217, 119, 6, 0.25);
  border-bottom: 1px solid rgba(217, 119, 6, 0.25);

  position: relative;
}

/* Decorative gold rules on either side — NO Bismillah glyph */
.mushaf-page__surah-header::before,
.mushaf-page__surah-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(217, 119, 6, 0.35) 50%,
    transparent 100%);
}

[data-theme="dark"] .mushaf-page__surah-header {
  color: var(--mudhamatan-200);
  background:
    linear-gradient(180deg,
      rgba(217, 119, 6, 0.06) 0%,
      rgba(217, 119, 6, 0.02) 100%);
}

.mushaf-page__surah-header .arabic {
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mushaf-page__surah-header .text-muted {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ---------- Bismillah — golden ornamental script ---------- */
.mushaf-page__bismillah {
  display: block;
  text-align: center;
  margin: var(--space-5) 0 var(--space-6);
  padding: var(--space-3) 0;
  position: relative;
}

.mushaf-page__bismillah-text {
  display: inline-block;
  font-family: var(--font-arabic);
  font-size: 1.85rem;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.01em;

  background: linear-gradient(180deg,
    #d4a91a 0%,
    #b8860b 45%,
    #a06b00 100%);

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  padding: 0 var(--space-4);
}

[data-theme="dark"] .mushaf-page__bismillah-text {
  background: linear-gradient(180deg,
    #fbbf24 0%,
    #d97706 50%,
    #a16207 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ornamental flourishes around the Bismillah */
.mushaf-page__bismillah::before,
.mushaf-page__bismillah::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(217, 119, 6, 0.4) 50%,
    transparent 100%);
}

.mushaf-page__bismillah::before {
  right: calc(50% + 130px);
}

.mushaf-page__bismillah::after {
  left: calc(50% + 130px);
}

@media (max-width: 640px) {
  .mushaf-page__bismillah::before,
  .mushaf-page__bismillah::after {
    width: 30px;
  }
  .mushaf-page__bismillah::before { right: calc(50% + 105px); }
  .mushaf-page__bismillah::after  { left:  calc(50% + 105px); }
}

/* ============================================================
   MUSHAF FOCUS MODE
   ============================================================ */

.mushaf-focus-exit {
  display: none;
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);

  align-items: center;
  gap: 6px;
  padding: 8px 12px;

  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);

  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  cursor: pointer;

  transition: background-color var(--duration-fast) var(--ease),
              color            var(--duration-fast) var(--ease);
}
.mushaf-focus-exit:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}
.mushaf-focus-exit svg { width: 14px; height: 14px; }

body.is-mushaf-focus .mushaf-focus-exit { display: inline-flex; }

/* Hide chrome in focus mode */
body.is-mushaf-focus .app-sidebar,
body.is-mushaf-focus .app-header,
body.is-mushaf-focus .app-footer,
body.is-mushaf-focus .sidebar-backdrop,
body.is-mushaf-focus .page-header {
  display: none !important;
}

body.is-mushaf-focus .app-shell {
  display: block;
  min-height: 100vh;
  grid-template-columns: 1fr;
  grid-template-areas: "main";
}

body.is-mushaf-focus .app-main {
  padding: var(--space-10) var(--space-6);
  max-width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
}

body.is-mushaf-focus .mushaf-page {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.85rem;
  line-height: 2.8;
}

@media (min-width: 1200px) {
  body.is-mushaf-focus .mushaf-page {
    font-size: 2rem;
    line-height: 2.9;
  }
}

@media (max-width: 640px) {
  body.is-mushaf-focus .app-main {
    padding: var(--space-6) var(--space-3);
  }
  body.is-mushaf-focus .mushaf-page {
    font-size: 1.4rem;
    line-height: 2.5;
    padding: var(--space-5) var(--space-3);
  }
  .mushaf-focus-exit {
    top: var(--space-3);
    right: var(--space-3);
    padding: 6px 10px;
  }
}

/* ============================================================
   MUSHAF PAGE FLIP — transition on swipe navigation
   ============================================================ */

body.is-page-next .mushaf-page {
  transform: translateX(-30px);
  opacity: 0;
}

body.is-page-prev .mushaf-page {
  transform: translateX(30px);
  opacity: 0;
}

body.is-page-flipping .page-header {
  opacity: 0.5;
  transition: opacity 180ms ease-out;
}

/* ============================================================
   MUSHAF SWIPE HINT — floating "→ Page 602" indicator
   ============================================================ */

.mushaf-swipe-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  background: rgba(15, 26, 18, 0.85);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: var(--z-toast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mushaf-swipe-hint[data-dir="next"] {
  animation: hint-fade-right 0.3s ease-out;
}
.mushaf-swipe-hint[data-dir="prev"] {
  animation: hint-fade-left 0.3s ease-out;
}

@keyframes hint-fade-right {
  from { opacity: 0; transform: translate(-30%, -50%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes hint-fade-left {
  from { opacity: 0; transform: translate(-70%, -50%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  .mushaf-page {
    font-size: 1.35rem;
    line-height: 2.5;
    padding: var(--space-6) var(--space-4);
    margin: var(--space-3) auto;
  }

  .mushaf-page__bismillah-text {
    font-size: 1.5rem;
  }

  .mushaf-page__surah-header {
    font-size: 1.1rem;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
  }

  .mushaf-page__marker {
    margin: 0 4px;
  }
}

/* ---------- Larger screens — Mushaf feel ---------- */
@media (min-width: 768px) {
  .mushaf-page {
    font-size: 1.75rem;
    line-height: 2.7;
    padding: var(--space-10) var(--space-8);
  }

  .mushaf-page__bismillah-text {
    font-size: 2rem;
  }
}

/* ============================================================
   SURAHS INDEX — compact grid of all 114 chapters
   ============================================================ */

.surahs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}

.surah-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--space-3);

  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--mudhamatan-500);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);

  text-decoration: none;
  color: inherit;

  transition: border-color var(--duration-fast) var(--ease),
              box-shadow   var(--duration-fast) var(--ease),
              transform    var(--duration-fast) var(--ease);
}
.surah-card:hover {
  border-color: var(--mudhamatan-400);
  border-left-color: var(--mudhamatan-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Number badge — traditional 8-point star */
.surah-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;

  background: var(--mudhamatan-100);
  color: var(--mudhamatan-700);

  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  font-feature-settings: "tnum";

  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%,
                     70% 100%, 30% 100%, 0% 70%, 0% 30%);
}
[data-theme="dark"] .surah-card__num {
  background: rgba(46, 158, 91, 0.15);
  color: var(--mudhamatan-300);
}

.surah-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.surah-card__en {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  line-height: 1.3;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surah-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.3;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surah-card__ar {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  color: var(--mudhamatan-700);
  line-height: 1;
  white-space: nowrap;
}
[data-theme="dark"] .surah-card__ar {
  color: var(--mudhamatan-300);
}

/* Mobile — 2 columns of tighter cards */
@media (max-width: 640px) {
  .surahs-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .surah-card {
    grid-template-columns: 32px 1fr;
    grid-template-areas:
      "num  ar"
      "body body";
    gap: 4px var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .surah-card__num {
    grid-area: num;
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .surah-card__ar {
    grid-area: ar;
    font-size: 0.95rem;
    text-align: right;
  }

  .surah-card__body {
    grid-area: body;
  }

  .surah-card__en {
    font-size: var(--text-xs);
  }

  .surah-card__meta {
    font-size: 10px;
  }
}

/* Larger desktop — 4 columns for the ultimate scan */
@media (min-width: 1400px) {
  .surahs-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}


/* ============================================================
   READING STREAK + DUA OF THE DAY — dashboard cards
   ============================================================ */

.home-streak-dua {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

@media (max-width: 640px) {
  .home-streak-dua {
    grid-template-columns: 1fr;
  }
}

/* Dua chip on verse cards (extends existing .verse-card__dua-chip) */
.verse-card .verse-card__dua-chip {
  font-size: 11px;
  padding: 3px 8px;
  height: 32px;
  display: inline-flex;
  align-items: center;
}

.mushaf-page__ayah span[data-play-ayah] {
  transition: background-color 0.2s ease, color 0.2s ease;
  border-radius: 4px;
  padding: 2px;
}

.mushaf-page__ayah span[data-play-ayah]:hover {
  background-color: var(--mudhamatan-50); /* Light green highlight */
  cursor: pointer;
}

[data-theme="dark"] .mushaf-page__ayah span[data-play-ayah]:hover {
  background-color: rgba(46, 158, 91, 0.15); /* Dark mode highlight */
}

/* Mobile — horizontal scroll for many tabs */
@media (max-width: 640px) {
  .tafsir-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    scrollbar-width: none;
  }
  .tafsir-tabs::-webkit-scrollbar { display: none; }
  .tafsir-tab {
    flex-shrink: 0;
  }
}