/* ============================================================
   HUDA PWA — Styles
   ============================================================ */

/* ── Uthmanic Hafs Font (self-hosted) ───────────────────────── */
@font-face {
  font-family: 'UthmanicHafs';
  src: url('/fonts/UthmanicHafs1Ver13.woff2') format('woff2'),
       url('/fonts/UthmanicHafs1Ver13.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --emerald: #059669;
  --emerald-dark: #047857;
  --emerald-light: #d1fae5;
  --gold: #FCD34D;
  --gold-dark: #F59E0B;
  --white: #FFFFFF;
  --off-white: #EAECEF;
  --gray-100: #DDE1E7;
  --gray-200: #CDD2D9;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --nav-height: 68px;
  --page-header-height: 64px; /* 16(pt) + 34(content) + 14(pb) */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--off-white);
  color: var(--gray-900);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation; /* prevents double-tap zoom on iOS */
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

/* ── App Shell ──────────────────────────────────────────────── */
#app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--off-white);
}

/* On wide screens, cap content width and centre it */
@media (min-width: 600px) {
  #app { max-width: 600px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.12); }
  #bottom-nav { max-width: 576px !important; }
  #install-banner { max-width: 580px !important; }
}

/* ── Desktop layout (sidebar nav) ───────────────────────────── */
@media (min-width: 900px) {
  body { background: #0f1117; }

  #app {
    max-width: 1140px;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    box-shadow: 0 0 60px rgba(0,0,0,0.4);
    border-radius: 0;
  }

  /* Left sidebar */
  #bottom-nav {
    order: -1 !important;
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 180px !important;
    max-width: 180px !important;
    height: 100vh !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 24px 0 24px !important;
    border-top: none !important;
    border-right: 1px solid var(--gray-200) !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    overflow-y: auto !important;
    align-self: flex-start !important;
  }
  html.dark #bottom-nav {
    border-right-color: #1f2937 !important;
    box-shadow: none !important;
  }

  /* Sidebar nav items — row layout */
  .nav-item {
    flex: none !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 20px !important;
    width: 100% !important;
    border-radius: 0 !important;
  }
  .nav-item.active {
    background: rgba(5,150,105,0.1) !important;
    border-left: 3px solid var(--emerald) !important;
    padding-left: 17px !important;
  }
  .nav-icon { font-size: 18px !important; width: 22px !important; height: 22px !important; }
  .nav-label { font-size: 13px !important; font-weight: 500 !important; }
  .nav-item.active .nav-label { font-weight: 700 !important; }

  /* Main content area */
  .tab-content {
    flex: 1 !important;
    min-width: 0 !important;
    padding-bottom: 40px !important;
    min-height: 100vh !important;
  }

  /* No safe-area offsets needed on desktop */
  .hero, .page-header, .prayer-hero, .learn-hero, .dhikr-header {
    padding-top: 32px !important;
  }
  .page-header {
    padding-top: 16px !important;
    padding-bottom: 14px !important;
  }

  /* Install banner: hide on desktop */
  #install-banner { display: none !important; }

  /* Dua reader: sidebar nav is a width not a height, so reset the flex layout */
  .dua-reader-layout {
    height: auto;
    flex: 1;
  }
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-content {
  display: none;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 32px);
  min-height: 100dvh;
}
.tab-content.active { display: block; }

/* ── Bottom Nav ─────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 576px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: calc(6px + var(--safe-bottom));
  margin-bottom: 12px;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 2px;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
}
.nav-item:active { transform: scale(0.92); }

.nav-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: color 0.2s;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-item.active .nav-icon { color: var(--emerald); }
.nav-item.active .nav-label { color: #059669; font-weight: 700 !important; font-size: 10px; }
.nav-item:not(.active) .nav-icon { color: var(--gray-400); }
.nav-item:not(.active) .nav-label { color: #94a3b8; font-weight: 500; font-size: 10px; }

/* ── Hero Banner ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #047857 0%, #065f46 100%);
  padding: 32px 20px 28px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -20px; left: -15px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.hero-arabic {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 4px;
  line-height: 1.4;
}
.hero-sub { font-size: 13px; opacity: 0.7; font-weight: 400; margin-bottom: 0; }
.hero-date-combined {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
  margin-bottom: 16px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 10px rgba(0,0,0,0.07);
  overflow: hidden;
}

.card-padded { padding: 16px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Page ───────────────────────────────────────────────────── */
.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--emerald);
  color: white;
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.page-header h2 { font-size: 17px; font-weight: 700; }

.mhdr-btn {
  background: rgba(255,255,255,0.25);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 14px;
  min-height: 36px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.mhdr-btn:active { background: rgba(255,255,255,0.4); }
.mhdr-btn:disabled { opacity: 0.3; cursor: default; }
.surah-overview-btn { font-size: 12px; border: 1px solid rgba(255,255,255,0.55); letter-spacing: 0.02em; }
@keyframes mpb-spin { to { transform: rotate(360deg); } }
.mpb-spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: mpb-spin 0.7s linear infinite;
  vertical-align: middle;
}
#surah-prev-btn, #surah-next-btn { font-size: 18px; padding: 3px 10px; }

/* ── Hadith Card ────────────────────────────────────────────── */
.hadith-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 14px;
  margin: 0 12px 10px;
}
.hadith-text {
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
  font-style: italic;
}
html.dark .hadith-text { color: #e2e8f0; }
.hadith-source {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-emerald { background: var(--emerald-light); color: var(--emerald-dark); }
.badge-gold { background: #fef3c7; color: #92400e; }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

/* ── Feature Grid ───────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 24px;
}
.feature-card {
  background: var(--white);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--gray-100);
  -webkit-tap-highlight-color: transparent;
}
.feature-card:active { transform: scale(0.97); box-shadow: 0 0 0 rgba(0,0,0,0); }
.feature-icon { font-size: 28px; }
.feature-title { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.feature-desc { font-size: 11px; color: var(--gray-500); line-height: 1.4; }

/* ── Surah List ─────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 5;
}
.search-input {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--gray-100);
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--emerald); background: white; }

.surah-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.surah-item:active { background: var(--gray-100); }
.surah-num {
  width: 36px; height: 36px;
  background: var(--emerald-light);
  color: var(--emerald);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.surah-num-reading { background: #d1fae5; }
.surah-item-reading { background: #f0fdf4; }
.surah-reading-pill {
  font-size: 9px;
  color: #059669;
  font-weight: 700;
  margin-top: 2px;
  text-align: right;
}
.surah-info { flex: 1; }
.surah-english { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.surah-meta { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.surah-arabic-name {
  font-size: 18px;
  font-weight: 500;
  color: #065f46;
  font-family: 'UthmanicHafs', 'Scheherazade New', serif;
}
.surah-bm-btn {
  background: none; border: none; font-size: 16px; padding: 4px 6px;
  cursor: pointer; flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s;
}
.surah-bm-btn:hover { opacity: 1; }

/* ── Saved Surahs (home) ────────────────────────────────────── */
.saved-surahs-list { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.saved-surah-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
  transition: transform 0.15s;
}
.saved-surah-row:active { transform: scale(0.98); }
.saved-surah-num {
  width: 32px; height: 32px; background: var(--emerald-light); color: var(--emerald-dark);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.saved-surah-info { flex: 1; }
.saved-surah-name { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.saved-surah-arabic { font-size: 18px; color: var(--emerald); font-family: 'UthmanicHafs', 'Scheherazade New', serif; }
.saved-surah-meta { font-size: 11px; color: var(--gray-400); white-space: nowrap; }
html.dark .saved-surah-row { background: #1e293b; border-color: #334155; }
html.dark .saved-surah-name { color: var(--gray-100); }

/* ── Quran Reader ───────────────────────────────────────────── */
#quran-reader { display: none; }
.bismillah {
  text-align: center;
  font-size: 22px;
  color: var(--emerald-dark);
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  text-rendering: optimizeLegibility;
  line-height: 2.4;
}
.ayah {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.ayah-arabic {
  font-size: 22px;
  line-height: 2.6;
  text-align: right;
  direction: rtl;
  color: var(--gray-900);
  margin-bottom: 8px;
  font-family: 'UthmanicHafs', 'Scheherazade New', serif;
}
.ayah-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: var(--emerald);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  flex-shrink: 0;
}
.ayah-english {
  font-size: 13px;
  line-height: 1.65;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.loading-state, .error-state {
  text-align: center;
  padding: 48px 24px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.retry-btn {
  background: var(--emerald);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

/* ── Prayer Times ───────────────────────────────────────────── */
.prayer-hero {
  background: linear-gradient(160deg, #047857 0%, #065f46 100%);
  padding: 28px 20px 24px;
  color: white;
  text-align: center;
}
.next-prayer-label { font-size: 11px; opacity: 0.75; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.next-prayer-name { font-size: 32px; font-weight: 800; margin-bottom: 2px; }
.next-prayer-arabic { font-size: 18px; opacity: 0.9; margin-bottom: 10px; }
.next-prayer-time { font-size: 15px; font-weight: 500; opacity: 0.8; letter-spacing: 0.5px; margin-bottom: 10px; }
.countdown-label { font-size: 10px; opacity: 0.65; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
.countdown { font-size: 42px; font-weight: 700; letter-spacing: 4px; font-variant-numeric: tabular-nums; opacity: 0.97; }
.location-label { font-size: 11px; opacity: 0.65; margin-top: 10px; }

.prayer-list { padding: 12px 16px; }
.prayer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  transition: all 0.3s;
}
.prayer-item.next-prayer {
  background: #f0fdf4;
  border-left: 3px solid #059669;
}
.prayer-item.next-prayer .prayer-name {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
}
.prayer-item.next-prayer .prayer-time-text {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
}
.prayer-next-badge {
  font-size: 10px;
  color: #059669;
  font-weight: 600;
  line-height: 1;
}
.prayer-item.past-prayer { opacity: 0.45; }
.prayer-icon { font-size: 22px; width: 32px; text-align: center; }
.prayer-name { flex: 1; font-size: 15px; font-weight: 600; }
.prayer-arabic-name { font-size: 13px; color: var(--gray-400); font-weight: 400; }
.prayer-time-text { font-size: 15px; font-weight: 700; color: var(--emerald-dark); font-variant-numeric: tabular-nums; }
.past-check { color: var(--emerald); font-size: 18px; }

.qibla-card {
  margin: 0 16px 16px;
  background: var(--white);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.qibla-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.qibla-icon-wrap {
  width: 44px; height: 44px;
  background: var(--emerald-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.qibla-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.qibla-info p { font-size: 13px; color: var(--gray-500); }
.qibla-btn {
  margin-left: auto;
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.qibla-btn:active { background: var(--emerald-dark); }
.qibla-compass-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.compass-outer {
  position: relative;
  width: 240px;
  height: 240px;
  filter: drop-shadow(0 4px 16px rgba(5,150,105,0.15));
}
#compass-disc {
  transform-origin: 120px 120px;
  transition: transform 0.15s ease-out;
}
.qibla-status {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s;
}
.qibla-status.qibla-on {
  background: #dcfce7;
  color: #15803d;
}
.qibla-status.qibla-off {
  background: rgba(0,0,0,0.05);
  color: var(--gray-500);
}
.qibla-stop-btn {
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--gray-500);
  cursor: pointer;
}

/* ── Dhikr ──────────────────────────────────────────────────── */
.dhikr-header {
  background: var(--emerald);
  padding: 14px 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dhikr-total { font-size: 13px; opacity: 0.9; }
.reset-all-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.dhikr-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }

.dhikr-card {
  background: var(--white);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.1s;
}
.dhikr-card.complete {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid var(--gold);
}

.dhikr-arabic { font-size: 22px; text-align: right; direction: rtl; color: var(--gray-900); margin-bottom: 4px; line-height: 1.6; }
.dhikr-transliteration { font-size: 13px; color: var(--emerald-dark); font-style: italic; margin-bottom: 3px; }
.dhikr-meaning { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }
.dhikr-source { font-size: 11px; color: var(--gray-400); margin-bottom: 8px; }
.dhikr-reward { font-size: 12px; color: var(--primary); background: rgba(5,150,105,0.08); border-left: 3px solid var(--primary); border-radius: 4px; padding: 8px 10px; margin-bottom: 12px; line-height: 1.5; }

.progress-bar-wrap { background: var(--gray-100); border-radius: 99px; height: 8px; margin-bottom: 14px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  background: var(--emerald);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.dhikr-card.complete .progress-bar-fill { background: var(--gold-dark); }

.dhikr-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dhikr-count { font-size: 14px; font-weight: 700; color: var(--gray-700); }
.dhikr-controls { display: flex; gap: 8px; }
.tap-btn {
  background: var(--emerald);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.tap-btn:active { transform: scale(0.94); }
.dhikr-card.complete .tap-btn { background: var(--gold-dark); }
.reset-btn {
  background: var(--gray-100);
  color: var(--gray-500);
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}
.reset-btn:active { background: var(--gray-200); }

/* ── Duas ───────────────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
}
.category-card {
  background: var(--white);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--gray-100);
}
.category-card:active { transform: scale(0.96); }
.category-icon { font-size: 26px; margin-bottom: 8px; }
.category-name { font-size: 12px; font-weight: 600; color: var(--gray-700); line-height: 1.4; }

#dua-reader { display: none; }
.dua-card {
  background: var(--white);
  margin: 12px 16px;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 10px rgba(0,0,0,0.07);
}
.dua-counter { font-size: 12px; color: var(--gray-400); margin-bottom: 8px; text-align: center; }
.dua-prophet { font-size: 13px; font-weight: 700; color: var(--emerald-dark); text-align: center; margin-bottom: 12px; }

/* ── Prophet list ────────────────────────────────────────────── */
.prophet-list { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.prophet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.1s;
}
.prophet-row:active { transform: scale(0.98); }
.prophet-row-icon {
  width: 44px; height: 44px;
  background: var(--emerald-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.prophet-row-info { flex: 1; }
.prophet-row-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.prophet-row-count { font-size: 12px; color: var(--gray-400); }
.prophet-row-arrow { font-size: 22px; color: var(--gray-300); }
.dua-arabic {
  font-size: 28px;
  direction: rtl;
  text-align: right;
  line-height: 2.8;
  color: var(--gray-900);
  margin-bottom: 18px;
  font-family: 'UthmanicHafs', 'Scheherazade New', serif;
}
.dua-transliteration {
  font-size: 16px;
  color: var(--emerald-dark);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 14px;
  border-left: 3px solid var(--emerald-light);
  padding-left: 12px;
}
.dua-meaning { font-size: 16px; color: var(--gray-600); line-height: 1.75; margin-bottom: 16px; }
.dua-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--emerald-light);
  color: var(--emerald-dark);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.dua-reader-layout {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--nav-height) - var(--safe-bottom) - var(--page-header-height));
}
.dua-reader-layout .dua-card {
  flex: 1;
  overflow-y: auto;
}
.dua-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  flex-shrink: 0;
  gap: 12px;
}
.dua-nav-btn {
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.dua-nav-btn:active { background: var(--gray-100); }
.dua-nav-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Learn Hub ──────────────────────────────────────────────── */
.learn-hero {
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  padding: 24px 20px 20px;
  color: white;
}
.learn-hero h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.learn-hero p { font-size: 13px; opacity: 0.85; line-height: 1.6; }
.disclaimer {
  margin: 0 16px 12px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.6;
}

.learn-cards { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.learn-card {
  background: var(--white);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid var(--gray-100);
  -webkit-tap-highlight-color: transparent;
}
.learn-card:active { transform: scale(0.98); }
.learn-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.learn-card-body { flex: 1; }
.learn-card-title { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.learn-card-desc { font-size: 12px; color: var(--gray-500); line-height: 1.5; }
.learn-card-arrow { color: var(--gray-300); font-size: 18px; }

/* ── Learn Sub-pages ────────────────────────────────────────── */
.lesson-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.lesson-item {
  background: var(--white);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.lesson-item:active { transform: scale(0.98); }
.lesson-num {
  width: 32px; height: 32px;
  background: var(--emerald);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.lesson-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--gray-700); }
.lesson-arrow { color: var(--gray-300); }

.lesson-content { padding: 16px; }
.lesson-arabic {
  text-align: center;
  font-size: 20px;
  color: var(--emerald-dark);
  direction: rtl;
  margin-bottom: 4px;
}
.lesson-transliteration {
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
  font-style: italic;
  margin-bottom: 16px;
}
.lesson-body {
  font-size: 14px;
  line-height: 1.85;
  color: var(--gray-700);
  white-space: pre-wrap;
}
.lesson-body strong {
  color: var(--emerald-dark);
  font-weight: 700;
}

/* ── Names of Allah ─────────────────────────────────────────── */
.names-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
}
.name-card {
  background: var(--white);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.name-card:active { transform: scale(0.96); }
.name-num { font-size: 10px; color: var(--gray-400); margin-bottom: 4px; }
.name-arabic { font-size: 20px; color: var(--emerald-dark); font-weight: 700; margin-bottom: 4px; direction: rtl; }
.name-trans { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 3px; }
.name-meaning { font-size: 11px; color: var(--gray-400); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.name-detail-card { padding: 20px 16px; }
.name-detail-arabic { font-size: 42px; color: var(--emerald-dark); text-align: center; direction: rtl; margin-bottom: 6px; }
.name-detail-trans { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.name-detail-en { font-size: 16px; color: var(--gray-500); text-align: center; margin-bottom: 16px; }
.name-detail-meaning {
  background: var(--emerald-light);
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 10px;
}

/* ── Hajj Guide ─────────────────────────────────────────────── */
.tab-switcher {
  display: flex;
  gap: 0;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 3px;
  margin: 12px 16px;
}
.tab-switch-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-500);
}
.tab-switch-btn.active {
  background: var(--white);
  color: var(--emerald-dark);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.hajj-steps { padding: 0 16px 16px; }
.hajj-step {
  background: var(--white);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-light);
  color: var(--emerald-dark);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.step-title { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.step-subtitle { font-size: 16px; color: var(--emerald-dark); direction: rtl; text-align: right; margin-bottom: 10px; }
.step-content { font-size: 14px; line-height: 1.75; color: var(--gray-600); margin-bottom: 14px; }
.step-supplication {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid var(--emerald-light);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.step-sup-arabic { font-size: 18px; direction: rtl; text-align: right; color: var(--gray-900); line-height: 1.8; margin-bottom: 6px; }
.step-sup-trans { font-size: 12px; color: var(--emerald-dark); font-style: italic; margin-bottom: 6px; }
.step-sup-meaning { font-size: 13px; color: var(--gray-600); }
.step-notes { font-size: 12px; color: var(--gray-500); background: var(--gray-100); border-radius: 8px; padding: 10px; line-height: 1.6; }

/* ── Zakat Calculator ───────────────────────────────────────── */
.zakat-form { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.zakat-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}
.zakat-field {
  background: var(--white);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
}
.zakat-field label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; }
.zakat-input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--gray-900);
  background: var(--gray-100);
  outline: none;
  transition: border-color 0.2s;
}
.zakat-input:focus { border-color: var(--emerald); background: white; }

.zakat-currency-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-100);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.zakat-currency-select:focus { outline: none; border-color: var(--emerald); }
.currency-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.currency-btn {
  padding: 8px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-100);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-600);
}
.currency-btn.active {
  background: var(--emerald);
  color: white;
  border-color: var(--emerald);
  box-shadow: 0 2px 8px rgba(5,150,105,0.35);
}

.nisab-type {
  display: flex;
  gap: 6px;
}
.nisab-btn {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-100);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.2s;
  text-align: center;
}
.nisab-btn.active { background: var(--emerald); color: white; border-color: var(--emerald); box-shadow: 0 2px 8px rgba(5,150,105,0.35); }

.calc-btn {
  background: var(--emerald);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: transform 0.1s;
}
.calc-btn:active { transform: scale(0.98); }

.zakat-result {
  background: var(--white);
  border-radius: 16px;
  margin: 0 16px 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}
.result-header {
  padding: 16px;
  text-align: center;
}
.result-header.eligible { background: linear-gradient(135deg, var(--emerald), var(--emerald-dark)); color: white; }
.result-header.not-eligible { background: var(--gray-100); }
.result-status { font-size: 13px; opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.result-amount { font-size: 36px; font-weight: 800; }
.result-rows { padding: 12px 16px; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row-label { color: var(--gray-500); }
.result-row-value { font-weight: 600; color: var(--gray-900); }
.result-dua {
  padding: 14px;
  text-align: center;
  background: var(--emerald-light);
  font-size: 18px;
  color: var(--emerald-dark);
  direction: rtl;
  border-top: 1px solid #bbf7d0;
}

/* ── Arabic Letters ─────────────────────────────────────────── */
.letters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 16px;
}
.letter-card {
  background: var(--white);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.letter-card:active { transform: scale(0.94); }
.letter-big { font-size: 32px; color: var(--emerald-dark); margin-bottom: 4px; direction: rtl; }
.letter-name { font-size: 11px; font-weight: 600; color: var(--gray-600); }
.letter-sound { font-size: 10px; color: var(--gray-400); }

/* ── Generic ────────────────────────────────────────────────── */
.p16 { padding: 16px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-400); }

/* ── Update Banner ──────────────────────────────────────────── */
#update-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 568px;
  background: #1d4ed8;
  color: white;
  padding: 14px 16px;
  z-index: 300;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  border-radius: 14px;
  border: 2px solid #93c5fd;
}
#update-banner.show { display: flex; }
.update-reload-btn {
  background: white;
  color: #1d4ed8;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  -webkit-tap-highlight-color: transparent;
}
.update-reload-btn:active { background: #dbeafe; }

/* ── Reminder Card ───────────────────────────────────────────── */
.reminder-card {
  margin: 0 16px 12px;
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
html.dark .reminder-card { background: #1e293b; }
.reminder-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reminder-card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
html.dark .reminder-card-title { color: #f1f5f9; }
.reminder-card-sub { font-size: 12px; color: var(--gray-400); }
.reminder-next-cd {
  font-size: 12px; color: var(--gray-500); margin: 8px 0 4px;
  display: flex; align-items: center; gap: 6px;
}
.reminder-next-cd span { font-size: 20px; color: var(--emerald); letter-spacing: 1px; }

/* ── Toast ──────────────────────────────────────────────────── */
#huda-toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #f1f5f9; padding: 10px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 0.3s, transform 0.3s;
  z-index: 9999; pointer-events: none; white-space: nowrap;
}
#huda-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.reminder-on-btn {
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.reminder-on-btn:active { background: var(--emerald-dark); }
.reminder-off-btn {
  background: transparent;
  color: var(--gray-400);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
html.dark .reminder-off-btn { border-color: #334155; color: #64748b; }
.reminder-off-btn:active { background: var(--gray-100); }
.reminder-intervals {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.ri-btn {
  flex: 1;
  padding: 7px 0;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
}
html.dark .ri-btn { border-color: #334155; color: #94a3b8; background: transparent; }
.ri-btn.active {
  background: var(--emerald-light);
  border-color: var(--emerald);
  color: var(--emerald-dark);
}
html.dark .ri-btn.active { background: #064e3b; border-color: var(--emerald); color: #6ee7b7; }
.ri-btn:active { opacity: 0.7; }

/* ── Install Banner ─────────────────────────────────────────── */
#install-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 460px;
  width: calc(100% - 32px);
  background: var(--gray-900);
  color: white;
  border-radius: 14px;
  padding: 14px 16px;
  z-index: 99;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  align-items: center;
  gap: 12px;
}
#install-banner.show { display: flex; }
.install-text { flex: 1; font-size: 13px; line-height: 1.5; }
.install-btn {
  background: var(--emerald);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.install-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
}

/* ── Mushaf ayah long-press flash ───────────────────────────── */
.mushaf-ayah-wrap { border-radius: 4px; }
@keyframes ayahFlash {
  0%   { background: transparent; }
  30%  { background: rgba(5,150,105,0.2); }
  100% { background: transparent; }
}
.ayah-flash { animation: ayahFlash 0.6s ease forwards; }

@keyframes ayahCardFlash {
  0%   { box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.04); }
  25%  { box-shadow: 0 0 0 3px rgba(5,150,105,0.4); border-color: #059669; }
  60%  { box-shadow: 0 0 0 3px rgba(5,150,105,0.2); border-color: #059669; }
  100% { box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.04); }
}
.ayah-card.flashing {
  animation: ayahCardFlash 1.2s ease forwards;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.3s ease forwards; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.dhikr-card.tapped { animation: pulse 0.15s ease; }

/* ── Seekbar ─────────────────────────────────────────────────── */
#mpb-seekbar {
  background: #064e3b;
  padding: 4px 12px 6px;
}
.mpb-seek-input {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.mpb-seek-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}
.mpb-seek-input::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
}
.mpb-seek-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}
html.dark #mpb-seekbar { background: #1e293b; }

/* ── Quran reader view toggle ───────────────────────────────── */
.reader-sticky-header {
  position: sticky;
  top: var(--page-header-height);
  z-index: 4;
  background: var(--white);
}
#reader-plan-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.reader-plan-track {
  flex: 1;
  height: 5px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.reader-plan-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.reader-plan-fill-done {
  background: linear-gradient(90deg, #065f46, #059669);
}
.reader-plan-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.reader-plan-done-btn {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: #059669;
  border: none;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.reader-plan-done-btn:active { background: #047857; }
html.dark .reader-plan-done-btn { background: #065f46; }
html.dark .reader-sticky-header { background: #1e293b; }
html.dark #reader-plan-bar { border-color: #334155; }
html.dark .reader-plan-track { background: #334155; }
html.dark .reader-plan-label { color: #94a3b8; }

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  gap: 6px;
}
.view-toggle-btn {
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.2s;
}
.view-toggle-btn.active {
  background: var(--emerald);
  color: white;
  border-color: var(--emerald);
}

.reciter-select {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  max-width: 140px;
}

/* ── Mushaf (Page View) ─────────────────────────────────────── */
#mushaf-page {
  background: #fff;
  overflow-y: auto;
}

.mushaf-sticky-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}
.mushaf-meta { font-size: 11px; color: #6b7280; font-weight: 600; }
.mushaf-meta-center {
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  font-size: 18px;
  color: #111827;
  direction: rtl;
}

.mushaf-audio-controls { display: flex; gap: 6px; }
.mushaf-audio-btn {
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 8px;
  width: 32px; height: 32px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.mushaf-audio-btn:active { background: var(--emerald-dark); }
html.dark .mushaf-audio-btn { background: var(--emerald-dark); }
html.dark .mushaf-audio-btn:active { background: #047857; }

.mushaf-hint {
  font-size: 11px;
  text-align: center;
  padding: 4px 0;
  color: #9ca3af;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

html.dark .mushaf-hint { background: #111827; color: #4b5563; border-color: #1f2937; }

.mushaf-scroll-body { padding: 0 0 60px; }

.mushaf-page-block {
  padding: 24px 28px 0;
  margin-bottom: 0;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.mushaf-bismillah {
  text-align: center;
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  font-size: 30px;
  color: #1c1c1c;
  direction: rtl;
  padding: 10px 0 18px;
  margin-bottom: 0;
  text-rendering: optimizeLegibility;
  line-height: 3.6;
}

.mushaf-arabic-page {
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  font-size: 28px;
  line-height: 3.8;
  direction: rtl;
  text-align: justify;
  text-align-last: right;
  color: #1c1c1c;
  text-rendering: optimizeLegibility;
}

/* Ayah number — small ornamental markers inline */
.mushaf-anum {
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  font-size: clamp(14px, 0.65em, 20px);
  color: #b5870a;
  margin: 0 2px;
  cursor: pointer;
  display: inline;
  transition: opacity 0.15s;
}
.mushaf-anum:active { opacity: 0.5; }
.mushaf-anum.maud-playing {
  color: #059669;
  animation: mushaf-pulse 0.8s ease infinite;
}
@keyframes mushaf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Verse mode playback highlight ─────────────────────────── */
.ayah-card.ayah-playing {
  background: rgba(5, 150, 105, 0.07);
  border-left: 3px solid #059669;
  padding-left: 11px;
  transition: background 0.3s, border-color 0.3s;
}
html.dark .ayah-card.ayah-playing {
  background: rgba(5, 150, 105, 0.12);
  border-left-color: #34d399;
}
.ayah-card.ayah-playing .ayah-num-badge-card {
  background: #059669;
  color: white;
}
html.dark .ayah-card.ayah-playing .ayah-num-badge-card {
  background: #34d399;
  color: #064e3b;
}

/* ── Mushaf word highlighting ───────────────────────────────── */
.mword {
  display: inline;
  border-radius: 4px;
  transition: background 0.08s, color 0.08s;
  padding: 0 1px;
}
.mword.active {
  background: rgba(5, 150, 105, 0.18);
  color: #065f46;
  border-radius: 4px;
}
html.dark .mword.active {
  background: rgba(52, 211, 153, 0.22);
  color: #34d399;
}

/* ── Ayatul Kursi play button ───────────────────────────────── */
.ak-play-btn {
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.ak-play-btn:active { background: var(--emerald-dark); }
html.dark .ak-play-btn { background: var(--emerald-dark); }
.ak-explain-btn {
  background: transparent;
  border: 1.5px solid #ddd6fe;
  color: #7c3aed;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ak-explain-btn:active { background: #f5f3ff; }
html.dark .ak-explain-btn { color: #a78bfa; border-color: #4c1d95; }
html.dark .ak-explain-btn:active { background: #1e1040; }
.ak-loop-btn {
  background: transparent;
  border: 1.5px solid var(--emerald);
  color: var(--emerald);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ak-reciter-select {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
html.dark .ak-reciter-select { border-color: rgba(255,255,255,0.15); }

.mushaf-page-divider {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  padding: 20px 0 24px;
  border-bottom: 1px solid #e5e7eb;
  letter-spacing: 2px;
  font-weight: 500;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.mushaf-page-block:last-child .mushaf-page-divider { border-bottom: none; }

/* ── Ayah play popup ─────────────────────────────────────────── */
#ayah-popup {
  position: fixed;
  z-index: 9999;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  padding: 14px 16px;
  min-width: 160px;
  display: none;
  text-align: center;
}
.ayah-popup-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.ayah-popup-play {
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.ayah-popup-play:active { background: var(--emerald-dark); }
.ayah-popup-study {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
}
.ayah-popup-study:active { background: var(--gray-100); }
.ayah-popup-explain {
  background: transparent;
  color: #7c3aed;
  border: 1.5px solid #ddd6fe;
  border-radius: 10px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
}
.ayah-popup-explain:active { background: #f5f3ff; }
html.dark #ayah-popup { background: #1e293b; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
html.dark .ayah-popup-label { color: #64748b; }
html.dark .ayah-popup-study { color: #94a3b8; border-color: #334155; }
html.dark .ayah-popup-study:active { background: #0f172a; }
html.dark .ayah-popup-explain { color: #a78bfa; border-color: #4c1d95; }
html.dark .ayah-popup-explain:active { background: #1e1040; }

/* ── Ayah Explanation Sheet ─────────────────────────────── */
#explain-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}
.explain-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.explain-box {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
}
.explain-box-open { transform: translateY(0); }
.explain-drag-handle {
  width: 36px; height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.explain-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.explain-ref {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.explain-arabic {
  font-family: 'UthmanicHafs', 'Amiri Quran', serif;
  font-size: 22px;
  direction: rtl;
  line-height: 1.7;
  color: var(--gray-800);
}
.explain-close {
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.explain-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 32px;
  flex: 1;
}
.explain-section {
  margin-bottom: 18px;
}
.explain-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #7c3aed;
  margin-bottom: 6px;
}
.explain-section-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray-700);
}
.explain-word-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.explain-word-row:last-child { border-bottom: none; }
.explain-word-ar {
  font-family: 'UthmanicHafs', 'Amiri Quran', serif;
  font-size: 20px;
  color: var(--gray-800);
  flex-shrink: 0;
}
.explain-word-root {
  font-size: 12px;
  color: var(--gray-400);
  font-style: italic;
  flex-shrink: 0;
}
.explain-word-def {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.5;
}
.explain-disclaimer {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: 10px;
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.5;
  border: 1px solid var(--gray-100);
}
.explain-error {
  padding: 24px 0;
  text-align: center;
  color: var(--gray-400);
  font-size: 15px;
  line-height: 1.6;
}
.explain-share-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  color: var(--gray-500);
  font-size: 14px;
  cursor: pointer;
}
.explain-share-btn:active { background: var(--gray-100); }
html.dark .explain-share-btn { border-color: #334155; color: #64748b; }
html.dark .explain-share-btn:active { background: #1e293b; }
.explain-key-messages {
  margin: 6px 0 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
}
.explain-key-messages li { margin-bottom: 6px; }
html.dark .explain-key-messages { color: #cbd5e1; }
/* Skeleton loading */
.explain-loading { padding: 8px 0; }
.explain-loading-label {
  font-size: 13px;
  color: var(--emerald);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
  animation: explain-pulse 1.6s ease-in-out infinite;
}
@keyframes explain-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.explain-skel {
  height: 14px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: explain-shimmer 1.4s infinite;
  border-radius: 7px;
  margin-bottom: 10px;
}
@keyframes explain-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Dark mode: explanation sheet ───────────────────────── */
html.dark .explain-box { background: #1e293b; }
html.dark .explain-skel { background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%); background-size: 200% 100%; }
html.dark .explain-drag-handle { background: #334155; }
html.dark .explain-header { border-color: #334155; }
html.dark .explain-ref { color: #64748b; }
html.dark .explain-arabic { color: #f1f5f9; }
html.dark .explain-close { background: #334155; color: #94a3b8; }
html.dark .explain-section-label { color: #a78bfa; }
html.dark .explain-section-text { color: #cbd5e1; }
html.dark .explain-word-row { border-color: #334155; }
html.dark .explain-word-ar { color: #f1f5f9; }
html.dark .explain-word-root { color: #475569; }
html.dark .explain-word-def { color: #94a3b8; }
html.dark .explain-disclaimer { background: #0f172a; border-color: #334155; color: #475569; }
html.dark .explain-error { color: #475569; }
html.dark .explain-skel {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
html.dark {
  --off-white: #0f172a;
  --white: #1e293b;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #94a3b8;
  --gray-700: #cbd5e1;
  --gray-900: #f1f5f9;
  --emerald-light: #064e3b;
}
html.dark body { background: #0f172a; color: #f1f5f9; }
html.dark #app { background: #0f172a; }
html.dark .hadith-card { background: #1e293b; border-color: #334155; box-shadow: none; }
html.dark .feature-card { background: #1e293b; border-color: #334155; }
html.dark .surah-item:active { background: #334155; }
html.dark .search-input { background: #334155; color: #f1f5f9; border-color: #475569; }
html.dark .search-input:focus { background: #1e293b; }
html.dark .prayer-item { background: #1e293b; }
html.dark .prayer-item.next-prayer { background: #0f2d1e; border-left-color: #059669; }
html.dark .dhikr-card { background: #1e293b; }
html.dark .dua-card { background: #1e293b; }
html.dark .category-card { background: #1e293b; border-color: #334155; }
html.dark .category-name { color: #f1f5f9; }
html.dark .learn-card { background: #1e293b; border-color: #334155; }
html.dark .learn-card-title { color: #f1f5f9; }
html.dark .name-card { background: #1e293b; }
html.dark .lesson-item { background: #1e293b; }
html.dark .hajj-step { background: #1e293b; }
html.dark .zakat-field { background: #1e293b; }
html.dark .zakat-input { background: #334155; color: #f1f5f9; border-color: #475569; }
html.dark .zakat-currency-select { background-color: #334155; color: #f1f5f9; border-color: #475569; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); }
html.dark .zakat-result { background: #1e293b; }
html.dark .currency-btn { background: #334155; border-color: #475569; color: #cbd5e1; }
html.dark .nisab-btn { background: #334155; border-color: #475569; color: #cbd5e1; }
html.dark .currency-btn.active { background: var(--emerald); border-color: var(--emerald); color: white; }
html.dark .nisab-btn.active { background: var(--emerald); border-color: var(--emerald); color: white; }
html.dark .letter-card { background: #1e293b; }
html.dark #bottom-nav { background: #1e293b; border-color: #334155; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
html.dark .search-bar { background: #1e293b; border-color: #334155; }
html.dark .ayah { border-color: #334155; }
html.dark .bismillah { border-color: #334155; }
html.dark .dua-nav-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
html.dark .dua-prophet { color: #34d399; }
html.dark .mushaf-arabic-page { color: #e8d5a3; }
html.dark #mushaf-page { background: #0d0d0d; }
html.dark .mushaf-sticky-header { background: #111111; border-color: #222; }
html.dark .mushaf-bismillah { color: #e8d5a3; }
html.dark .mushaf-anum { color: #c9952f; }
html.dark .mushaf-meta { color: #6b7280; }
html.dark .mushaf-meta-center { color: #e8d5a3; }
html.dark .mushaf-page-divider { color: #5a4a2a; border-color: #222; }
html.dark .tab-switch-btn.active { background: #334155; color: #d1fae5; }
html.dark .result-row { border-color: #334155; }
html.dark .disclaimer { background: #2d2200; border-color: #4a3800; color: #fcd34d; }
html.dark .reader-toolbar { background: #1e293b; border-color: #334155; }
html.dark .reciter-select { background: #334155; border-color: #475569; color: #e2e8f0; }
html.dark .view-toggle-btn { background: #334155; border-color: #475569; color: #94a3b8; }
html.dark .tab-switcher { background: #334155; }
html.dark .currency-btn { background: #334155; border-color: #475569; color: #94a3b8; }
html.dark .nisab-btn { background: #334155; border-color: #475569; color: #94a3b8; }
html.dark .reset-btn { background: #334155; color: #94a3b8; }
html.dark .install-banner { background: #0f172a; }
html.dark .continue-card { background: #1e293b; border-color: #334155; box-shadow: none; }
html.dark .ayatul-kursi-card { background: #1e293b; border-color: #064e3b; }
html.dark .ramadan-card { background: linear-gradient(135deg, #1a0a2e, #0d0518); }
html.dark .qibla-dir-value { color: #f1f5f9; }
html.dark .surah-num-reading { background: #064e3b; }
html.dark .surah-item-reading { background: #0f2d1e; }

/* ── Theme bar ──────────────────────────────────────────────── */
/* ── Home Live Cards (next prayer / next reminder) ───────────── */
.home-live-row { display: flex; gap: 12px; padding: 12px 16px 0; }
.home-live-card {
  flex: 1; background: var(--white); border: 1px solid var(--gray-100);
  border-radius: 14px; padding: 14px 14px 12px; cursor: pointer;
  transition: transform 0.15s;
}
.home-live-card:active { transform: scale(0.97); }
.home-live-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--emerald); font-weight: 700; margin-bottom: 4px; }
.home-live-name { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.home-live-time { font-size: 13px; font-weight: 600; color: var(--gray-500); font-variant-numeric: tabular-nums; }
html.dark .home-live-card { background: #1e293b; border-color: #334155; }
html.dark .home-live-name { color: var(--gray-100); }
html.dark .home-live-time { color: var(--gray-400); }

.theme-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}
.theme-bar-label { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.theme-toggle-track {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 5px 14px 5px 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
  user-select: none;
}
.theme-toggle-track:active { background: var(--gray-200); }
.theme-toggle-thumb {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-toggle-thumb.dark { background: #1e293b; }
.theme-toggle-text { font-size: 13px; font-weight: 600; color: var(--gray-700); }
html.dark .theme-bar { background: #1e293b; border-color: #334155; }
html.dark .theme-toggle-track { background: #334155; }
html.dark .theme-toggle-text { color: #94a3b8; }

/* ── Hero Hijri date ────────────────────────────────────────── */
.hero-hijri {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 3px;
}

/* ── Ramadan Card ───────────────────────────────────────────── */
.ramadan-card {
  background: linear-gradient(135deg, #1e0938, #0f0520);
  color: white;
  margin: 12px 16px 0;
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
}
.ramadan-label { font-size: 13px; opacity: 0.8; margin-bottom: 4px; }
.ramadan-countdown-label { font-size: 11px; opacity: 0.65; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.ramadan-time { font-size: 30px; font-weight: 300; letter-spacing: 2px; font-variant-numeric: tabular-nums; }

/* ── Continue Reading Card ──────────────────────────────────── */
.continue-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 14px;
  margin: 0 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.continue-card:active { transform: scale(0.98); }
.continue-icon-well {
  width: 38px; height: 38px;
  background: #f0fdf4;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.card-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}
.continue-icon { font-size: 28px; }
.continue-info { flex: 1; }
.continue-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--emerald); font-weight: 700; margin-bottom: 2px; }
.continue-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }

/* ── Bookmarks List ─────────────────────────────────────────── */
.bookmarks-list { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.bookmark-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
  transition: transform 0.15s;
}
.bookmark-row:active { transform: scale(0.98); }
.bookmark-badge {
  background: var(--emerald); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 7px; border-radius: 8px; white-space: nowrap; flex-shrink: 0;
}
.bookmark-info { flex: 1; min-width: 0; }
.bookmark-surah { font-size: 12px; font-weight: 700; color: var(--emerald); margin-bottom: 2px; }
.bookmark-preview { font-size: 14px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'UthmanicHafs', 'Scheherazade New', serif; direction: rtl; }
.bookmark-del { background: none; border: none; color: var(--gray-300); font-size: 14px; padding: 4px; cursor: pointer; flex-shrink: 0; }
.bookmark-del:hover { color: #ef4444; }
html.dark .bookmark-row { background: #1e293b; border-color: #334155; }
html.dark .bookmark-preview { color: var(--gray-400); }
html.dark .bookmark-del { color: #475569; }

/* ── Ayatul Kursi Card ──────────────────────────────────────── */
.ayatul-kursi-card {
  background: var(--white);
  margin: 4px 16px 12px;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 10px rgba(0,0,0,0.07);
  border: 1px solid var(--emerald-light);
}
.ak-arabic {
  font-family: 'UthmanicHafs', 'Scheherazade New', serif;
  font-size: 22px;
  direction: rtl;
  text-align: right;
  line-height: 2.8;
  color: var(--gray-900);
  margin-bottom: 10px;
}
.ak-translation { font-size: 13px; line-height: 1.7; color: var(--gray-500); }

/* ── Ayah Action Buttons ────────────────────────────────────── */
.ayah-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.ayah-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ayah-btn:active { background: var(--gray-200); }
.ayah-btn.playing { background: var(--emerald); color: white; border-color: var(--emerald); }
.ayah-btn.bookmarked { background: var(--emerald-light); color: var(--emerald-dark); border-color: var(--emerald-light); }
html.dark .ayah-btn { background: #1e293b; border-color: #334155; color: #64748b; }
html.dark .ayah-btn:active { background: #334155; }
html.dark .ayah-btn.playing { background: var(--emerald); color: white; border-color: var(--emerald); }
html.dark .ayah-btn.bookmarked { background: #064e3b; color: #6ee7b7; border-color: #065f46; }

/* ── Font Size Controls ─────────────────────────────────────── */
#font-ctrl {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.font-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--gray-700);
  transition: all 0.15s;
}
.font-btn:active { background: var(--emerald); color: white; }
html.dark .font-btn { background: #334155; border-color: #475569; color: #94a3b8; }

/* ── Share Dua Button ───────────────────────────────────────── */
.share-dua-btn {
  display: block;
  margin-top: 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.15s;
  width: 100%;
  text-align: center;
}
.share-dua-btn:active { background: var(--emerald); color: white; border-color: var(--emerald); }
html.dark .share-dua-btn { background: #334155; border-color: #475569; color: #94a3b8; }

/* ── Safe areas for iOS ─────────────────────────────────────── */
@supports (padding-top: env(safe-area-inset-top)) {
  .hero, .page-header, .prayer-hero, .learn-hero, .dhikr-header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .hero { padding-top: calc(32px + env(safe-area-inset-top)); }

  /* Track actual page-header height for layout calcs:
     wide phones (>390px): pt=16+safe, pb=14, content=34 → 64+safe */
  :root { --page-header-height: calc(64px + env(safe-area-inset-top)); }

  /* Small phones: tighter base + safe area (won't affect phones wider than 390px) */
  @media (max-width: 390px) {
    .page-header { padding-top: calc(10px + env(safe-area-inset-top)); }
    .prayer-hero { padding-top: calc(14px + env(safe-area-inset-top)); }
    .hero { padding-top: calc(20px + env(safe-area-inset-top)); }
    .learn-hero, .dhikr-header { padding-top: calc(12px + env(safe-area-inset-top)); }
    /* ≤390px: pt=10+safe, pb=8, content=30 → 48+safe */
    :root { --page-header-height: calc(48px + env(safe-area-inset-top)); }
  }
  @media (max-width: 375px) {
    .page-header { padding-top: calc(8px + env(safe-area-inset-top)); }
    /* ≤375px: pt=8+safe, pb=6, content=30 → 44+safe */
    :root { --page-header-height: calc(44px + env(safe-area-inset-top)); }
  }
}

/* ── Responsive: small phones (≤ 390px — iPhone 13, 14, SE) ─── */
@media (max-width: 390px) {
  /* Page header: tighter — use individual props to preserve safe-area padding-top */
  .page-header { padding-left: 12px; padding-right: 12px; padding-bottom: 8px; gap: 6px; }
  .page-header h2 { font-size: 14px; }
  .back-btn { width: 30px; height: 30px; font-size: 16px; }

  /* Hide the playing-info label — saves ~96px in the header */
  #mpb-info { display: none !important; }

  /* Header action buttons: compact */
  .mhdr-btn { padding: 4px 7px; font-size: 12px; }
  #surah-prev-btn, #surah-next-btn { font-size: 15px; padding: 3px 7px; }

  /* Reader toolbar: tighter */
  .reader-toolbar { padding: 5px 10px; gap: 4px; }
  .view-toggle-btn { padding: 5px 10px; font-size: 12px; }
  .reciter-select { font-size: 11px; max-width: 118px; }

  /* Hero: preserve safe-area padding-top, shrink sides/bottom */
  .hero { padding-left: 14px; padding-right: 14px; padding-bottom: 16px; }
  .hero-arabic { font-size: 24px; }
  .hero-sub { font-size: 12px; }

  /* Prayer hero: preserve safe-area padding-top */
  .prayer-hero { padding-left: 16px; padding-right: 16px; padding-bottom: 18px; }
  .countdown { font-size: 30px; }
  .next-prayer-name { font-size: 24px; }
  .next-prayer-arabic { font-size: 16px; }

  /* Mushaf header: tighter */
  .mushaf-sticky-header { padding: 5px 10px; }
  .mushaf-meta-center { font-size: 15px; }
  .mushaf-audio-btn { width: 28px; height: 28px; font-size: 12px; }

  /* Feature grid: less padding */
  .feature-grid { gap: 8px; padding: 0 12px 12px; }
  .feature-card { padding: 12px 10px; gap: 6px; }
  .feature-icon { font-size: 24px; }
  .feature-title { font-size: 12px; }
  .feature-desc { font-size: 10px; }

  /* Lists: less outer padding */
  .dhikr-list { padding: 10px 12px; }
  .dhikr-card { padding: 14px; }
  .learn-cards { padding: 10px 12px; }
  .learn-card { padding: 14px; gap: 12px; }
  .learn-card-icon { width: 44px; height: 44px; font-size: 24px; }
  .category-grid { padding: 10px 12px; gap: 8px; }
  .prayer-list { padding: 10px 12px; }
  .names-grid { padding: 10px 12px; gap: 8px; }
  .letters-grid { padding: 10px 12px; gap: 8px; }
  .zakat-form { padding: 10px 12px; }

  /* Cards: less inner padding */
  .dua-card { margin: 10px 12px; padding: 16px; }
  /* Dua reader: tighter text so content fits better */
  .dua-arabic { font-size: 24px; line-height: 2.4; margin-bottom: 12px; }
  .dua-transliteration { font-size: 14px; margin-bottom: 10px; }
  .dua-meaning { font-size: 14px; margin-bottom: 12px; }
  .dua-nav { padding: 8px 12px 12px; }
  .dua-nav-btn { padding: 8px 14px; font-size: 13px; }
  .hadith-card { padding: 14px; margin: 0 12px 12px; }
  .qibla-card { margin: 0 12px 12px; }
  .hajj-steps { padding: 0 12px 12px; }
  .lesson-list { padding: 10px 12px; }

  /* Bottom nav: slightly smaller icons */
  .nav-icon { font-size: 18px; width: 22px; height: 22px; }
  .nav-label { font-size: 9px; }

  /* Names detail page */
  .name-detail-arabic { font-size: 34px; }
  .name-detail-trans { font-size: 17px; }

  /* Section titles */
  .section-title { font-size: 15px; }

  /* Study view ayahs */
  .ayah { padding: 10px 14px; }
  .ayah-arabic { font-size: 20px; line-height: 2.4; margin-bottom: 6px; }
  .ayah-english { font-size: 12px; line-height: 1.6; }
  .bismillah { font-size: 20px; padding: 10px 16px; }
  .ayah-arabic-card { font-size: 20px; line-height: 2.6; }
  .mushaf-arabic-page { line-height: 3.4; } /* font-size is JS-controlled via inline style */
  .ayah-btn { padding: 3px 8px; font-size: 11px; }
  .ayah-actions { gap: 5px; margin-top: 4px; }
  .ayah-num-badge { width: 22px; height: 22px; font-size: 9px; }
}

/* ── Extra small phones (≤ 375px — iPhone SE, 13 mini) ──────── */
@media (max-width: 375px) {
  .hero-arabic { font-size: 22px; }
  .next-prayer-time { font-size: 32px; }
  .next-prayer-name { font-size: 22px; }
  .mhdr-btn { padding: 3px 6px; font-size: 11px; }
  #surah-prev-btn, #surah-next-btn { padding: 3px 5px; font-size: 14px; }
  /* preserve safe-area padding-top */
  .page-header { padding-left: 10px; padding-right: 10px; padding-bottom: 6px; gap: 4px; }
  .reciter-select { max-width: 105px; }
  .view-toggle-btn { padding: 5px 8px; font-size: 11px; }
  .feature-grid { padding: 0 10px 10px; }
  /* Dua reader: smallest size for SE/mini */
  .dua-arabic { font-size: 22px; line-height: 2.2; }
  .dua-transliteration { font-size: 14px; }
  .dua-meaning { font-size: 14px; }
}

/* ── Tasbeeh Counter ───────────────────────────────────────── */
.tasbeeh-card {
  position: relative;
  margin: 12px 16px;
  background: var(--white);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  -webkit-tap-highlight-color: transparent;
}
.tasbeeh-card:active { opacity: 0.85; transform: scale(0.98); }
.tasbeeh-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.tasbeeh-count {
  font-size: 64px;
  font-weight: 800;
  color: var(--emerald);
  line-height: 1;
}
.tasbeeh-reset {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
}

/* ── Dua Adab ──────────────────────────────────────────────── */
.dua-adab-section {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.dua-adab-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.dua-adab-icon { font-size: 20px; }
.dua-adab-title { font-size: 15px; font-weight: 800; color: var(--gray-900); }
.dua-adab-body {
  padding: 14px 16px 16px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--gray-700);
  white-space: normal;
}
.dua-adab-body em { font-style: italic; color: var(--emerald-dark); }
.dua-adab-body strong { color: var(--emerald-dark); font-weight: 700; }
html.dark .dua-adab-section { background: #1e293b; }
html.dark .dua-adab-header { background: #1e3a5f !important; }
html.dark .dua-adab-title { color: #f1f5f9; }
html.dark .dua-adab-body { color: #cbd5e1; }
html.dark .dua-adab-body strong { color: #34d399; }
html.dark .dua-adab-body em { color: #6ee7b7; }

/* ── Islamic Calendar ──────────────────────────────────────── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav-btn {
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-month-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  padding: 4px 0;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--white);
}
.cal-cell.cal-empty { background: transparent; }
.cal-cell.cal-today {
  background: var(--emerald);
}
.cal-cell.cal-today .cal-day-num { color: white; font-weight: 800; }
.cal-day-num { font-size: 13px; color: var(--gray-700); }
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e0b;
  margin-top: 2px;
}
.cal-cell.cal-today .cal-dot { background: white; }
.cal-legend {
  background: var(--white);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
  padding: 4px 0;
}
.cal-disclaimer {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 8px;
}
.cal-error {
  text-align: center;
  color: var(--gray-500);
  padding: 24px;
}
.cal-container { position: relative; }
.cal-cell.cal-key { background: rgba(245, 158, 11, 0.1); }

/* ── Tafsir ────────────────────────────────────────────────── */
.tafsir-btn {
  font-size: 11px;
  color: var(--emerald);
  border: 1px solid var(--emerald);
  border-radius: 6px;
  padding: 2px 8px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tafsir-box {
  margin-top: 8px;
  background: var(--off-white);
  border-left: 3px solid var(--emerald);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
}
html.dark .tafsir-box { background: var(--gray-800, #1f2937); }
.tafsir-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700);
  margin: 0;
}
html.dark .tafsir-text { color: var(--gray-300); }
.tafsir-error {
  font-size: 13px;
  color: var(--gray-400);
  margin: 0;
  font-style: italic;
}

/* ── Quran Search ──────────────────────────────────────────── */
#quran-search-view { display: none; }
.qs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--emerald);
  color: white;
}
.qs-header h2 { font-size: 18px; font-weight: 700; color: white; margin: 0; }
.qs-input-wrap {
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.qs-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  font-size: 15px;
  background: var(--off-white);
  color: var(--gray-900);
  outline: none;
}
.qs-input:focus { border-color: var(--emerald); }
.qs-results { padding: 8px 0; }
.qs-hint {
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
  padding: 24px 16px;
}
.qs-result {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.qs-result:active { background: var(--gray-100); }
html.dark .qs-result:active { background: var(--gray-800, #1f2937); }
.qs-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.qs-surah-name { font-size: 13px; font-weight: 600; color: var(--emerald); }
.qs-ayah-badge {
  background: var(--emerald);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
}
.qs-snippet {
  font-size: 18px;
  color: var(--gray-700);
  line-height: 2.4;
  font-family: 'UthmanicHafs', 'Scheherazade New', serif;
  direction: rtl;
  text-align: right;
}
html.dark .qs-snippet { color: var(--gray-300); }
.qs-truncated {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  padding: 12px 16px;
  font-style: italic;
}

/* ── Quran Category Tiles ─────────────────────────────────── */
.qcat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.qcat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.qcat-tile:active { transform: scale(0.94); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.qcat-icon { font-size: 22px; line-height: 1; }
.qcat-label { font-size: 10px; font-weight: 600; color: var(--cat-color); text-align: center; line-height: 1.2; }
html.dark .qcat-tile { background: #1e293b; border-color: #334155; }
html.dark .qcat-tile:active { background: #0f172a; }

/* ── Quran Category Verse View ───────────────────────────── */
#quran-category-view { display: none; background: var(--white); }
.cv-skeleton {
  height: 100px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: cvShimmer 1.4s infinite;
  border-radius: 12px;
  margin-bottom: 10px;
}
@keyframes cvShimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.cv-verse-card {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.cv-ref {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cv-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #059669;
  color: white;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cv-play-btn:active { transform: scale(0.9); }
.cv-play-btn.cv-playing { background: #047857; }
html.dark .cv-play-btn { background: #059669; }
html.dark .cv-play-btn.cv-playing { background: #047857; }
.cv-share-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(5,150,105,0.12); color: #059669;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cv-share-btn:active { transform: scale(0.9); background: rgba(5,150,105,0.24); }
html.dark .cv-share-btn { background: rgba(52,211,153,0.1); color: #34d399; }

/* Reciter dropdown in green page headers */
.cv-sz-group { display: flex; gap: 4px; flex-shrink: 0; }
.cv-sz-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cv-sz-btn:active { background: rgba(255,255,255,0.28); }
.hdr-reciter-select {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}
.hdr-reciter-select option { background: #065f46; color: white; }

.cv-arabic {
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  font-size: 20px;
  line-height: 2.6;
  color: #1e293b;
  text-align: right;
  direction: rtl;
  margin-bottom: 10px;
}
.cv-english {
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
}
html.dark .cv-verse-card { background: #1e293b; border-color: #334155; }
html.dark .cv-arabic { color: #f1f5f9; }
html.dark .cv-english { color: #94a3b8; }
html.dark .cv-skeleton { background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%); background-size: 200% 100%; }

/* ── Account Button ───────────────────────────────────────── */
.account-btn {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 10;
}


/* ── Auth Modal ───────────────────────────────────────────── */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-modal-box {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  position: relative;
}
html.dark .auth-modal-box { background: #1e293b; color: #f1f5f9; }
.auth-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--gray-400, #94a3b8);
}
.auth-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--emerald, #059669);
}
.auth-pass-wrap {
  position: relative;
  margin-bottom: 10px;
}
.auth-pass-wrap .auth-input {
  margin-bottom: 0;
  padding-right: 44px;
}
.auth-pass-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}
.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200, #e2e8f0);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 10px;
  box-sizing: border-box;
  background: var(--bg, #f8fafc);
  color: inherit;
}
html.dark .auth-input { background: #0f172a; border-color: #334155; }
.auth-btn-primary {
  width: 100%;
  padding: 12px;
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.auth-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-switch-link {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--gray-400, #94a3b8);
}
.auth-switch-link a { color: #059669; cursor: pointer; text-decoration: none; font-weight: 600; }
.auth-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 4px;
}
.auth-user-email {
  font-size: 14px;
  color: var(--gray-400, #94a3b8);
  margin-bottom: 16px;
  word-break: break-all;
}
.auth-btn-secondary {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1.5px solid var(--gray-200, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  color: inherit;
}
.sync-status {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400, #94a3b8);
  margin-top: 8px;
}

/* ── Jumu'ah Banner ───────────────────────────────────────── */
.jumuah-card {
  margin: 0 16px 16px;
  background: linear-gradient(135deg, var(--emerald-dark, #047857), var(--emerald, #059669));
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #fff;
}
.jumuah-content { flex: 1; }
.jumuah-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.jumuah-sub {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.5;
  margin-bottom: 12px;
}
.jumuah-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.jumuah-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Offline Download Banner ──────────────────────────────── */
.offline-banner {
  margin: 12px 16px 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.offline-banner-done {
  justify-content: center;
  color: #059669;
  font-weight: 600;
  font-size: 14px;
}
.offline-banner-text { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.offline-banner-icon { font-size: 22px; flex-shrink: 0; }
.offline-banner-title { font-size: 14px; font-weight: 600; color: #0f172a; }
.offline-banner-sub { font-size: 12px; color: #64748b; margin-top: 1px; }
.offline-banner-btn {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.offline-cancel-btn { background: #94a3b8; }
.offline-banner-progress-wrap { flex: 1; min-width: 0; }
.offline-progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.offline-progress-fill {
  height: 100%;
  background: #059669;
  border-radius: 2px;
  transition: width 0.3s ease;
}
html.dark .offline-banner { background: #1e293b; border-color: #334155; }
html.dark .offline-banner-title { color: #f1f5f9; }
html.dark .offline-banner-sub { color: #94a3b8; }
html.dark .offline-progress-bar { background: #334155; }

/* ── Share Sheet ──────────────────────────────────────────── */
#share-sheet-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: flex-end; justify-content: center;
}
.share-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
}
.share-sheet {
  position: relative;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 32px;
  width: 100%;
  max-width: 540px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.share-sheet.open { transform: translateY(0); }
.share-sheet-handle {
  width: 36px; height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin: 0 auto 16px;
}
.share-sheet-text {
  font-size: 14px;
  line-height: 1.7;
  color: #0f172a;
  white-space: pre-wrap;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  max-height: 200px;
  overflow-y: auto;
}
.share-sheet-arabic {
  font-family: 'UthmanicHafs', 'Amiri Quran', 'Scheherazade New', serif;
  font-size: 22px;
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: #0f172a;
  margin-bottom: 10px;
}
.share-sheet-english {
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 8px;
}
.share-sheet-ref {
  font-size: 12px;
  color: #059669;
  font-weight: 600;
}
html.dark .share-sheet-arabic { color: #f1f5f9; }
html.dark .share-sheet-english { color: #94a3b8; }
html.dark .share-sheet-ref { color: #34d399; }
.share-sheet-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.share-action-btn {
  flex: 1; padding: 11px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; color: #0f172a;
}
.share-action-primary {
  background: #059669;
  border-color: #059669;
  color: #fff;
}
.share-close-btn {
  width: 100%; padding: 11px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; color: #64748b;
}
html.dark .share-sheet { background: #1e293b; }
html.dark .share-sheet-handle { background: #334155; }
html.dark .share-sheet-text { background: #0f172a; color: #f1f5f9; }
html.dark .share-action-btn { background: #1e293b; border-color: #334155; color: #f1f5f9; }
html.dark .share-close-btn { border-color: #334155; color: #94a3b8; }

/* ── Copy Toast ───────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1100;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Help Screen ──────────────────────────────────────────── */
.help-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.help-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}
.help-back-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #059669;
  cursor: pointer;
  padding: 4px 0;
}
.help-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}
.help-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
}
.help-intro {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 4px;
}
.help-section {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
}
.help-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.help-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.help-list li {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}
.help-btn {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(52px + env(safe-area-inset-right, 0px));
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
html.dark .help-header { background: #0f172a; border-color: #334155; }
html.dark .help-title { color: #f1f5f9; }
html.dark .help-back-btn { color: #34d399; }
html.dark .help-body { background: #0f172a; }
html.dark .help-section { background: #1e293b; border-color: #334155; }
html.dark .help-section-title { color: #f1f5f9; }
html.dark .help-list li { color: #94a3b8; }
html.dark .help-intro { color: #94a3b8; }
/* ── Notification Banner ───────────────────────────────────── */
.notif-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 16px 0;
}
.notif-banner-text {
  flex: 1;
  font-size: 13px;
  color: #065f46;
  font-weight: 500;
}
.notif-banner-btn {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notif-banner-btn:active { background: #047857; }
.notif-banner-dismiss {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}
html.dark .notif-banner { background: #064e3b; border-color: #065f46; }
html.dark .notif-banner-text { color: #6ee7b7; }
html.dark .notif-banner-dismiss { color: #94a3b8; }

/* ── Settings Screen ─────────────────────────────────────────── */
.settings-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #f1f5f9;
}
.settings-section-label {
  padding: 12px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.settings-group {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 8px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 15px; font-weight: 500; color: #0f172a; }
.settings-subtitle { padding: 2px 16px 12px; font-size: 12px; color: #6b7280; }
.settings-value { font-size: 13px; color: #6b7280; }
.settings-value-on { font-size: 13px; font-weight: 600; color: #059669; }
.settings-value-off { font-size: 13px; font-weight: 600; color: #ef4444; }
.settings-enable-btn {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.settings-arrow { color: #9ca3af; font-size: 18px; }
.settings-select {
  font-size: 13px;
  color: #059669;
  border: none;
  background: none;
  cursor: pointer;
  text-align: right;
  max-width: 160px;
  -webkit-appearance: none;
  appearance: none;
}
.settings-font-row { display: flex; align-items: center; gap: 12px; }
.settings-font-btn {
  background: none;
  border: none;
  color: #059669;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}
.settings-font-val { font-size: 13px; color: #6b7280; min-width: 36px; text-align: center; }
.settings-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.settings-toggle.on { background: #059669; }
.settings-toggle.off { background: #d1d5db; }
.settings-toggle::after {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.settings-toggle.on::after { left: 22px; }
.settings-toggle.off::after { left: 2px; }
html.dark .settings-screen { background: #0f172a; }
html.dark .settings-group { background: #1e293b; border-color: #334155; }
html.dark .settings-row { border-color: #1e293b; }
html.dark .settings-label { color: #f1f5f9; }
html.dark .settings-section-label { color: #94a3b8; }
html.dark .settings-subtitle { color: #64748b; }
html.dark .settings-select { color: #34d399; }
html.dark .settings-font-btn { color: #34d399; }
html.dark .settings-value-on { color: #34d399; }
html.dark .settings-enable-btn { background: #059669; }
html.dark .settings-value { color: #94a3b8; }
html.dark .settings-value-off { color: #f87171; }

/* ── Onboarding ──────────────────────────────────────────────── */
.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 32px calc(40px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(160deg, #059669 0%, #065f46 100%);
  text-align: center;
}
.onboarding-icon { font-size: 72px; margin-bottom: 16px; }
.onboarding-title { font-size: 40px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.onboarding-subtitle { font-size: 17px; color: rgba(255,255,255,0.85); margin-bottom: 48px; }
.onboarding-location-btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  width: 100%;
  max-width: 280px;
  line-height: 1.4;
}
.onboarding-start-btn {
  background: #fff;
  color: #059669;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
}
.onboarding-skip {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  background: none;
  border: none;
}

/* ── Hero Prayer Pill (home screen) ───────────────────────── */
.hero-prayer-pill {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  position: relative;
}
.hero-pill-label {
  font-size: 10px;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.hero-pill-name { font-size: 16px; font-weight: 700; }
.hero-pill-right { text-align: right; }
.hero-pill-time { font-size: 18px; font-weight: 700; }
.hero-pill-countdown { font-size: 10px; opacity: 0.65; }
.hero-prayer-pill-empty { font-size: 13px; opacity: 0.6; text-align: center; padding: 8px; }
.hero-streak {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 4px 12px;
  margin-top: 8px;
  display: inline-block;
}

/* ── Prayer screen redesign ────────────────────────────────── */
.prayer-hero-city {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 10px;
}
.prayer-hero-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.prayer-hero-time {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 2px;
  margin: 4px 0;
}
.prayer-countdown-pill {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  margin-top: 6px;
}

/* ── Qibla card redesign ───────────────────────────────────── */
.qibla-tappable {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 12px;
  background: white;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qibla-icon-well {
  width: 38px; height: 38px;
  background: #f0fdf4;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.qibla-dir-label {
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.qibla-dir-value {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 1px;
}
.qibla-arrow-icon { font-size: 12px; color: #94a3b8; margin-left: auto; }

/* ── Quran Reader — Ayah Cards ─────────────────────────────── */
.ayah.ayah-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 8px;
  margin-left: 0; margin-right: 0;
}
.ayah-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ayah-num-badge-card {
  width: 28px; height: 28px;
  background: #f0fdf4;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  flex-shrink: 0;
}
.ayah-card-actions { display: flex; gap: 6px; overflow-x: auto; }
.ayah-card-btn {
  background: #f0fdf4;
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #059669;
}
.ayah-card-btn.bookmarked { background: #d1fae5; }
.ayah-card-btn.explain-btn { background: #f5f3ff; color: #7c3aed; }
.ayah-card-btn.explain-btn:active { background: #ede9fe; }
html.dark .ayah-card-btn.explain-btn { background: #1e1040; color: #a78bfa; }
html.dark .ayah-card-btn.explain-btn:active { background: #2e1065; }
.ayah-arabic-card {
  font-size: 22px;
  text-align: right;
  line-height: 2.8;
  color: #1a1207;
  font-family: 'UthmanicHafs', 'me_quran', 'Scheherazade New', serif;
  margin-bottom: 10px;
  text-rendering: optimizeLegibility;
}
.ayah-english-card {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}
/* Playing state */
.ayah.ayah-card.maud-playing-card {
  border: 1.5px solid #bbf7d0;
  box-shadow: 0 2px 10px rgba(5,150,105,0.12);
}
.ayah.ayah-card.maud-playing-card .ayah-num-badge-card {
  background: #059669;
  color: white;
}
.ayah.ayah-card.maud-playing-card .ayah-card-btn[data-play] {
  background: #059669;
  color: white;
}
#reader-content { padding: 8px; background: #f8fafc; }
html.dark #reader-content { background: #0f172a; }
#surah-search::placeholder { color: rgba(255,255,255,0.5); }
#dua-search::placeholder { color: rgba(255,255,255,0.6); }

/* ── Dhikr Counter Redesign ────────────────────────────────── */
.dhikr-header-new {
  background: linear-gradient(160deg, #047857 0%, #065f46 100%);
  padding: calc(14px + env(safe-area-inset-top,0px)) 18px 14px;
  color: white;
  text-align: center;
}
.dhikr-header-label {
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dhikr-header-arabic {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}
.dhikr-counter-area {
  background: white;
  text-align: center;
  padding: 0;
}
.dhikr-counter-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 10px;
}
.dhikr-counter-foot {
  padding: 0 16px 16px;
  text-align: left;
}
.dhikr-nav-bar {
  position: sticky;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  z-index: 2;
}
html.dark .dhikr-nav-bar {
  background: #111827;
  border-color: #1f2937;
}
.dhikr-counter-text {
  font-size: 28px;
  color: #065f46;
  font-family: 'UthmanicHafs', 'Scheherazade New', serif;
  margin-bottom: 2px;
  line-height: 1.5;
}
.dhikr-counter-transliteration {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 14px;
}
.dhikr-counter-number {
  font-size: 64px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 4px;
}
.dhikr-counter-of {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 14px;
}
.dhikr-progress-bar {
  width: 100px;
  height: 7px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto 16px;
}
.dhikr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #047857);
  border-radius: 4px;
  transition: width 0.2s;
}
.dhikr-tap-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(160deg, #059669, #047857);
  border: none;
  color: white;
  font-size: 28px;
  box-shadow: 0 6px 20px rgba(5,150,105,0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}
.dhikr-tap-btn:active { transform: scale(0.95); }
.dhikr-tap-btn.dhikr-hold {
  animation: dhikr-hold-fill 0.7s linear forwards;
}
@keyframes dhikr-hold-fill {
  0%   { box-shadow: 0 6px 20px rgba(5,150,105,0.35), 0 0 0 0px rgba(239,68,68,0.4); }
  100% { box-shadow: 0 6px 20px rgba(5,150,105,0.35), 0 0 0 28px rgba(239,68,68,0); background: linear-gradient(160deg,#dc2626,#b91c1c); }
}
.dhikr-hint { margin-top: 10px; font-size: 12px; color: #94a3b8; }
.dhikr-tabs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 12px 12px;
}
.dhikr-tab-btn {
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e8edf2;
  background: white;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}
.dhikr-tab-btn.active {
  background: #059669;
  color: white;
  border-color: #059669;
  font-weight: 700;
}

/* Dark mode — UI Polish additions */
html.dark .hero-prayer-pill { background: rgba(255,255,255,0.10); }
html.dark .nav-item:not(.active) .nav-label { color: #64748b; }
html.dark .qibla-tappable { background: #1e293b; }
html.dark .surah-item-reading { background: #0f2d1e; }
html.dark .ayah.ayah-card { background: #1e293b; border-color: #334155; box-shadow: none; }
html.dark .ayah-card-btn { background: #0f2d1e; color: #6ee7b7; }
html.dark .ayah-card-btn.bookmarked { background: #0f2d1e; }
html.dark .ayah-arabic-card { color: #f1f5f9; }
html.dark .ayah-english-card { color: #94a3b8; border-color: #334155; }
html.dark .ayah-num-badge-card { background: #0f2d1e; }
html.dark .dhikr-counter-area { background: #1e293b; }
html.dark .dhikr-counter-text { color: #6ee7b7; }
html.dark .dhikr-counter-number { color: #f1f5f9; }
html.dark .dhikr-tabs-grid { background: transparent; }
html.dark .dhikr-counter-foot .dhikr-source { color: #64748b; }
html.dark .dhikr-tab-btn { background: #1e293b; border-color: #334155; color: #64748b; }
html.dark .dhikr-tab-btn.active { background: #059669; color: white; border-color: #059669; }
html.dark .dhikr-progress-bar { background: #334155; }

/* Dhikr complete state */
.dhikr-counter-area.dhikr-complete .dhikr-counter-number { color: #D97706; }
.dhikr-counter-area.dhikr-complete .dhikr-counter-of { color: #D97706; }
.dhikr-counter-area.dhikr-complete .dhikr-progress-fill {
  background: linear-gradient(90deg, #F59E0B, #D97706);
}
.dhikr-counter-area.dhikr-complete .dhikr-tap-btn {
  background: linear-gradient(160deg, #F59E0B, #D97706);
  box-shadow: 0 8px 24px rgba(245,158,11,0.35);
}
/* dark mode */
html.dark .dhikr-counter-area.dhikr-complete .dhikr-counter-number { color: #FCD34D; }
html.dark .dhikr-counter-area.dhikr-complete .dhikr-counter-of { color: #FCD34D; }

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE POLISH
   All rules below are light-mode-only (no html.dark prefix).
   They override earlier defaults to give the app a professional,
   layered look with proper elevation, hierarchy, and rhythm.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Background — distinct page vs surface layering ───────── */
body, #app { background: #eef2f7; }

/* ── 2. Bottom nav — pill active indicator ───────────────────── */
#bottom-nav {
  background: #ffffff;
  border: none;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04), 0 -4px 24px rgba(0,0,0,0.07);
}
.nav-icon { position: relative; }
.nav-item.active .nav-icon {
  background: rgba(5,150,105,0.10);
  border-radius: 10px;
  padding: 2px 8px;
  color: #059669;
}
.nav-item.active .nav-label { color: #059669; font-weight: 700; }
.nav-item:not(.active) .nav-icon { color: #94a3b8; }
.nav-item:not(.active) .nav-label { color: #94a3b8; }

/* ── 3. Elevated cards — consistent multi-layer shadow ────────── */
.card,
.hadith-card,
.feature-card,
.home-live-card,
.continue-card,
.ayatul-kursi-card,
.bookmark-row,
.saved-surah-row {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.05);
}
.prayer-item {
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}
.dhikr-card,
.dua-card,
.learn-card,
.lesson-item,
.prophet-row,
.hajj-step,
.tasbeeh-card,
.zakat-result,
.qibla-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.05);
}
.category-card,
.name-card,
.letter-card,
.zakat-field {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 3px 10px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
}

/* ── 4. Hero banners — richer gradient + tighter type ─────────── */
.hero {
  background: linear-gradient(150deg, #059669 0%, #047857 50%, #065f46 100%);
  box-shadow: 0 4px 24px rgba(5,150,105,0.20);
}
.prayer-hero {
  background: linear-gradient(150deg, #059669 0%, #047857 50%, #065f46 100%);
  box-shadow: 0 4px 24px rgba(5,150,105,0.20);
}
.learn-hero {
  background: linear-gradient(150deg, #059669 0%, #047857 50%, #065f46 100%);
  box-shadow: 0 4px 20px rgba(5,150,105,0.18);
}
.page-header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 2px 12px rgba(5,150,105,0.20);
}

/* ── 5. Surah list — refined separators & number badge ─────────── */
.surah-item {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}
.surah-item:active { background: #f0fdf4; }
.surah-num {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5,150,105,0.12);
  font-weight: 700;
}

/* ── 6. Prayer items — stronger next-prayer highlight ─────────── */
.prayer-item.next-prayer {
  background: #f0fdf4;
  border-left: 3px solid #059669;
  box-shadow: 0 2px 8px rgba(5,150,105,0.12), 0 6px 20px rgba(5,150,105,0.08);
}
.prayer-item.past-prayer { opacity: 0.38; }

/* ── 7. Section titles — stronger hierarchy ───────────────────── */
.section-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* ── 8. Hadith card — warmer border ───────────────────────────── */
.hadith-card {
  border-left: 3px solid #d1fae5;
}

/* ── 9. Feature cards — subtle green tint on icon area ─────────── */
.feature-card {
  border-radius: 16px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature-card:active {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* ── 10. Continue / bookmark rows ─────────────────────────────── */
.continue-card { border-radius: 18px; }
.bookmark-row { border-radius: 14px; }
.saved-surah-row { border-radius: 14px; }

/* ── 11. Ayah cards (study view) ─────────────────────────────── */
.ayah.ayah-card {
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 3px 12px rgba(0,0,0,0.05);
  border-radius: 16px;
  margin: 6px 12px;
}

/* ── 12. Home live cards ──────────────────────────────────────── */
.home-live-card { border-radius: 16px; }
.home-live-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* ── 13. Bismillah — slightly more presence ─────────────────────── */
.bismillah {
  color: #065f46;
  font-size: 24px;
  border-bottom: 1px solid #d1fae5;
  background: #f0fdf4;
}

/* ── 14. Dua cards & category grid ───────────────────────────── */
.dua-card { border-radius: 18px; }
.category-card { border-radius: 16px; }
.category-name { font-size: 12px; font-weight: 700; color: #1e293b; }

/* ── 15. Learn cards ──────────────────────────────────────────── */
.learn-card { border-radius: 18px; }
.learn-card-title { color: #0f172a; }

/* ── 16. Scrollbar refinement ────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── 17. Search input ────────────────────────────────────────── */
.search-bar {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.search-input {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.search-input:focus { background: #ffffff; border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,0.10); }

/* ── 18. Qibla card ──────────────────────────────────────────── */
.qibla-card { border-radius: 18px; }

/* ── 19. Prophet rows ────────────────────────────────────────── */
.prophet-row { border-radius: 16px; }

/* ── 20. Dua nav buttons ─────────────────────────────────────── */
.dua-nav-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.dua-nav-btn:active { background: #f0fdf4; border-color: #a7f3d0; }

/* ── Reading Plan Card ────────────────────────────────────────── */
.plan-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.07);
}
.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.plan-label {
  font-size: 11px;
  font-weight: 800;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan-range {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0 8px;
}
.plan-streak {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  background: #fef3c7;
  padding: 3px 8px;
  border-radius: 20px;
}
.plan-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.plan-status-behind {
  color: #b45309;
  background: #fef3c7;
}
.plan-stop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px;
}
.plan-stop-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.plan-stop-ref {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background: #f0fdf4;
  border: 1.5px solid #a7f3d0;
  border-radius: 8px;
  padding: 2px 10px;
}
html.dark .plan-stop-ref { background: #0f2d1e; border-color: #065f46; color: #34d399; }

/* Plan target marker — injected into Quran reader */
.plan-target-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 20px;
  padding: 0 4px;
}
.plan-target-marker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.plan-keep-reading-btn {
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.plan-keep-reading-btn:active { background: #e0f2fe; }
html.dark .plan-keep-reading-btn { background: #0c1a2e; border-color: #1e40af; color: #60a5fa; }
.plan-target-marker-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #059669, transparent);
}
.plan-target-marker-badge {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: #f0fdf4;
  border: 1.5px solid #a7f3d0;
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.plan-target-marker-continue {
  color: #0369a1;
  background: #f0f9ff;
  border-color: #bae6fd;
}
html.dark .plan-target-marker-line { background: linear-gradient(90deg, transparent, #065f46, transparent); }
html.dark .plan-target-marker-badge { background: #0f2d1e; border-color: #065f46; color: #34d399; }
html.dark .plan-target-marker-continue { background: #0c1a2e; border-color: #1e40af; color: #60a5fa; }

.plan-today-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.plan-day-count {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.plan-target-reached {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: #f0fdf4;
  padding: 2px 8px;
  border-radius: 20px;
}
.plan-progress-wrap {
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.plan-progress-today {
  height: 7px;
  margin-bottom: 6px;
}
.plan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.plan-fill-complete {
  background: linear-gradient(90deg, #065f46, #059669);
}
.plan-fill-overall {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}
.plan-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-pct {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
.plan-read-btn {
  background: #059669;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.plan-read-ahead-btn {
  background: none;
  color: #059669;
  border: 1.5px solid #a7f3d0;
}
.plan-read-btn:active { background: #047857; }
.plan-done-btn {
  background: #f0fdf4;
  color: #059669;
  border: 1.5px solid #a7f3d0;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.plan-done-btn:active { background: #d1fae5; }
.plan-cancel-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  -webkit-tap-highlight-color: transparent;
}
.plan-cancel-btn:active { color: #ef4444; }

/* Plan — today done state */
.plan-card-today-done { border-left: 3px solid #059669; }
.plan-done-check {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
  margin-bottom: 4px;
}
.plan-next-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

/* Plan — empty / setup prompt */
.plan-card-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.plan-card-empty:active { transform: scale(0.98); }
.plan-empty-icon { font-size: 28px; flex-shrink: 0; }
.plan-empty-title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.plan-empty-sub { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.plan-empty-arrow { font-size: 22px; color: #cbd5e1; margin-left: auto; flex-shrink: 0; }

/* Plan — finished state */
.plan-card-done {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-color: #a7f3d0;
}
.plan-done-icon { font-size: 28px; flex-shrink: 0; }
.plan-done-title { font-size: 15px; font-weight: 800; color: #065f46; margin-bottom: 2px; }
.plan-done-sub { font-size: 12px; color: #34d399; }

/* Plan setup modal */
#plan-setup-modal { display: none; position: fixed; inset: 0; z-index: 999; }
.plan-setup-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.plan-setup-box {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  max-width: 600px;
  margin: 0 auto;
}
.plan-setup-title { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.plan-setup-sub { font-size: 13px; color: #64748b; margin-bottom: 20px; }
.plan-setup-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.plan-option {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.plan-option:active { background: #f0fdf4; border-color: #6ee7b7; }
.plan-option-label { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.plan-option-sub { font-size: 13px; color: #64748b; }
.plan-setup-cancel {
  width: 100%;
  background: none;
  border: none;
  font-size: 14px;
  color: #94a3b8;
  padding: 10px;
  cursor: pointer;
}

/* Dark mode */
html.dark .plan-card { background: #1e293b; border-color: #334155; box-shadow: none; }
html.dark .plan-range { color: #f1f5f9; }
html.dark .plan-day-count { color: #94a3b8; }
html.dark .plan-target-reached { background: #0f2d1e; color: #34d399; }
html.dark .plan-status-behind { background: #2d1e0f; color: #fbbf24; }
html.dark .plan-empty-title { color: #f1f5f9; }
html.dark .plan-empty-sub { color: #64748b; }
html.dark .plan-empty-arrow { color: #334155; }
html.dark .plan-progress-wrap { background: #334155; }
html.dark .plan-fill-overall { background: linear-gradient(90deg, #334155, #475569); }
html.dark .plan-done-btn { background: #0f2d1e; border-color: #065f46; }
html.dark .plan-card-done { background: linear-gradient(135deg, #0f2d1e, #064e3b); border-color: #065f46; }
html.dark .plan-setup-box { background: #1e293b; }
html.dark .plan-setup-title { color: #f1f5f9; }
html.dark .plan-option { background: #0f172a; border-color: #334155; }
html.dark .plan-option:active { background: #0f2d1e; border-color: #059669; }
html.dark .plan-option-label { color: #f1f5f9; }
html.dark .plan-next-label { color: #64748b; }
html.dark .plan-cancel-box { background: #1e293b; }
html.dark .plan-cancel-title { color: #f1f5f9; }
html.dark .plan-cancel-sub { color: #64748b; }
html.dark .plan-goback-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
html.dark .plan-goback-btn:active { background: #0f172a; }
html.dark .plan-restart-btn { background: #0f2d1e; border-color: #065f46; color: #34d399; }
html.dark .plan-restart-btn:active { background: #064e3b; }
html.dark .plan-cancel-confirm-btn { background: #2d0f0f; border-color: #7f1d1d; color: #f87171; }
html.dark .plan-cancel-confirm-btn:active { background: #450a0a; }

/* ── Dhikr counter pop animation ─────────────────────────── */
@keyframes dhikr-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); color: #34d399; }
  100% { transform: scale(1); }
}
.dhikr-pop { animation: dhikr-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── Dhikr Stats Button (in header) ──────────────────────── */
.dhikr-stats-btn {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  color: white;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  white-space: nowrap;
}
.dhikr-stats-btn:active { opacity: 0.75; }

/* ── Dhikr Stats Screen ──────────────────────────────────── */
.dhikr-stats-header {
  background: linear-gradient(160deg, #047857 0%, #065f46 100%);
  padding: calc(20px + env(safe-area-inset-top,0px)) 18px 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dhikr-stats-back {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  color: white;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.dhikr-stats-back:active { opacity: 0.75; }
.dhikr-stats-title { font-size: 18px; font-weight: 700; }
.dhikr-stats-sub { font-size: 11px; opacity: 0.65; margin-top: 1px; }

.dhikr-stat-cards {
  display: flex;
  gap: 10px;
  padding: 16px;
}
.dhikr-stat-card {
  flex: 1;
  background: white;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.dhikr-stat-num {
  font-size: 30px;
  font-weight: 800;
  color: #059669;
  line-height: 1;
}
.dhikr-stat-icon { font-size: 18px; margin-bottom: 2px; }
.dhikr-stat-label {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dhikr-stat-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Calendar */
.dhikr-section-card {
  background: white;
  border-radius: 16px;
  margin: 0 16px 14px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.dhikr-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}
.dhikr-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dhikr-cal-month { font-weight: 700; font-size: 15px; color: #0f172a; }
.dhikr-cal-nav-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 30px; height: 30px;
  font-size: 16px;
  cursor: pointer;
  color: #059669;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.dhikr-cal-nav-btn:active { background: #e2e8f0; }
.dhikr-cal-nav-btn:disabled { color: #cbd5e1; cursor: default; opacity: 0.4; }
.dhikr-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dhikr-cal-header-cell {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
  padding: 2px 0 6px;
}
.dhikr-cal-day {
  aspect-ratio: 1;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  position: relative;
}
.dhikr-cal-day.lv0 { background: #f1f5f9; color: #cbd5e1; }
.dhikr-cal-day.lv1 { background: #d1fae5; color: #065f46; }
.dhikr-cal-day.lv2 { background: #6ee7b7; color: #065f46; }
.dhikr-cal-day.lv3 { background: #059669; color: white; }
.dhikr-cal-day.future { background: transparent; color: #e2e8f0; }
.dhikr-cal-day.empty { background: transparent; }
.dhikr-cal-day.is-today { outline: 2px solid #059669; outline-offset: 1px; }
.dhikr-cal-legend {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.dhikr-cal-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #64748b;
}
.dhikr-cal-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
}

/* Lifetime bars */
.dhikr-lifetime-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}
.dhikr-lifetime-row:last-child { margin-bottom: 0; }
.dhikr-lifetime-name {
  font-size: 11px;
  color: #475569;
  width: 82px;
  flex-shrink: 0;
  line-height: 1.3;
}
.dhikr-lifetime-bar-wrap {
  flex: 1;
  height: 7px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.dhikr-lifetime-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #047857);
  border-radius: 4px;
}
.dhikr-lifetime-count {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

/* Week view */
.dhikr-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.dhikr-week-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.dhikr-week-day-label { font-size: 9px; color: #94a3b8; font-weight: 700; text-transform: uppercase; }
.dhikr-week-dot {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.dhikr-week-dot.lv0 { background: #f1f5f9; }
.dhikr-week-dot.lv1 { background: #d1fae5; }
.dhikr-week-dot.lv2 { background: #6ee7b7; }
.dhikr-week-dot.lv3 { background: #059669; }
.dhikr-week-count { font-size: 10px; color: #94a3b8; font-weight: 600; }
.dhikr-week-col.today .dhikr-week-dot { outline: 2px solid #059669; outline-offset: 1px; }
.dhikr-week-col.today .dhikr-week-day-label { color: #059669; }

/* Dark mode */
html.dark .dhikr-stats-btn { background: rgba(255,255,255,0.15); }
html.dark .dhikr-stat-card { background: #1e293b; box-shadow: none; }
html.dark .dhikr-stat-num { color: #34d399; }
html.dark .dhikr-stat-label { color: #94a3b8; }
html.dark .dhikr-section-card { background: #1e293b; box-shadow: none; }
html.dark .dhikr-section-title { color: #f1f5f9; }
html.dark .dhikr-cal-month { color: #f1f5f9; }
html.dark .dhikr-cal-nav-btn { background: #334155; color: #34d399; }
html.dark .dhikr-cal-nav-btn:active { background: #475569; }
html.dark .dhikr-cal-nav-btn:disabled { color: #475569; opacity: 0.4; }
html.dark .dhikr-cal-day.lv0 { background: #334155; color: #475569; }
html.dark .dhikr-cal-day.future { background: transparent; color: #334155; }
html.dark .dhikr-cal-header-cell { color: #64748b; }
html.dark .dhikr-cal-legend-item { color: #94a3b8; }
html.dark .dhikr-lifetime-name { color: #94a3b8; }
html.dark .dhikr-lifetime-bar-wrap { background: #334155; }
html.dark .dhikr-lifetime-count { color: #34d399; }
html.dark .dhikr-week-dot.lv0 { background: #334155; }
html.dark .dhikr-week-day-label { color: #64748b; }
html.dark .dhikr-week-count { color: #64748b; }
html.dark .dhikr-week-col.today .dhikr-week-day-label { color: #34d399; }
html.dark .dhikr-week-col.today .dhikr-week-dot { outline-color: #34d399; }

/* ── Plan cancel sheet ────────────────────────────────────── */
#plan-cancel-sheet { display: none; position: fixed; inset: 0; z-index: 999; }
.plan-cancel-box {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  max-width: 600px;
  margin: 0 auto;
}
.plan-cancel-title { font-size: 18px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.plan-cancel-sub { font-size: 13px; color: #64748b; }
.plan-goback-btn {
  width: 100%;
  padding: 14px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plan-goback-btn:active { background: #e2e8f0; }
.plan-restart-btn {
  width: 100%;
  padding: 14px;
  background: #f0fdf4;
  border: 1.5px solid #a7f3d0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #059669;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plan-restart-btn:active { background: #d1fae5; }
.plan-cancel-confirm-btn {
  width: 100%;
  padding: 14px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #dc2626;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plan-cancel-confirm-btn:active { background: #fee2e2; }

/* ── Plan empty card — stronger tap affordance ────────────── */
.plan-card-empty {
  border: 1.5px solid rgba(5, 150, 105, 0.2);
}
.plan-card-empty:hover { border-color: rgba(5, 150, 105, 0.4); }

/* ── Plan: weekly calendar ───────────────────────────────── */
.plan-week-cal {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 4px;
  gap: 2px;
}
.plan-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}
.plan-week-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
}
.plan-week-dot-done {
  background: #059669;
  border-color: #059669;
  color: #fff;
}
.plan-week-name {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}
.plan-week-today .plan-week-dot {
  border-color: #059669;
  color: #059669;
}
.plan-week-today .plan-week-name { color: #059669; font-weight: 700; }

/* ── Plan: catch-up button ───────────────────────────────── */
.plan-catchup-btn {
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  border-radius: 8px;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 6px;
  text-align: left;
  width: 100%;
}
.plan-catchup-btn:active { background: #fef3c7; }

/* ── Plan: change pace button ────────────────────────────── */
.plan-change-pace-btn {
  background: #f0fdf4;
  border: 1.5px solid #6ee7b7;
  border-radius: 10px;
  color: #065f46;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plan-change-pace-btn:active { background: #d1fae5; }

/* ── Plan: "start from current" checkbox row ─────────────── */
.plan-start-from-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
  gap: 8px;
}
.plan-start-from-label { font-weight: 600; color: #334155; }
.plan-start-from-btn {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #059669;
  cursor: pointer;
  flex-shrink: 0;
}
.plan-start-from-btn:active { background: #e2e8f0; }
.plan-surah-search {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 8px;
  box-sizing: border-box;
  outline: none;
}
.plan-surah-search:focus { border-color: #059669; }
.plan-surah-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 12px;
}
.plan-surah-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.plan-surah-row:last-child { border-bottom: none; }
.plan-surah-row:active { background: #f0fdf4; }
.plan-surah-num { font-size: 12px; color: #94a3b8; width: 24px; flex-shrink: 0; }
.plan-surah-name { font-size: 14px; font-weight: 600; flex: 1; }
.plan-surah-arabic { font-size: 16px; color: #059669; direction: rtl; }

/* ── Plan: custom days input ─────────────────────────────── */
.plan-custom-input {
  width: 100%;
  padding: 12px;
  font-size: 20px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 12px;
  text-align: center;
  box-sizing: border-box;
  outline: none;
}
.plan-custom-input:focus { border-color: #059669; }

/* ── Dark mode: plan additions ───────────────────────────── */
html.dark .plan-week-dot { background: #334155; border-color: #475569; color: #64748b; }
html.dark .plan-week-dot-done { background: #059669; border-color: #059669; color: #fff; }
html.dark .plan-week-name { color: #64748b; }
html.dark .plan-week-today .plan-week-dot { border-color: #34d399; color: #34d399; }
html.dark .plan-week-today .plan-week-name { color: #34d399; }
html.dark .plan-catchup-btn { background: #2d2106; border-color: #92400e; color: #fbbf24; }
html.dark .plan-catchup-btn:active { background: #3d2e0a; }
html.dark .plan-change-pace-btn { background: #0f2d1e; border-color: #065f46; color: #34d399; }
html.dark .plan-start-from-label { color: #94a3b8; }
html.dark .plan-start-from-btn { background: #1e293b; border-color: #334155; color: #34d399; }
html.dark .plan-surah-search { background: #0f172a; border-color: #334155; color: #f1f5f9; }
html.dark .plan-surah-list { border-color: #334155; }
html.dark .plan-surah-row { border-bottom-color: #1e293b; }
html.dark .plan-surah-row:active { background: #0f2d1e; }
html.dark .plan-surah-name { color: #f1f5f9; }
html.dark .plan-surah-arabic { color: #34d399; }
html.dark .plan-custom-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
html.dark .plan-custom-input:focus { border-color: #059669; }

/* ── Sleep timer button — active state ───────────────────── */
#mpb-sleep-btn { font-size: 12px; min-width: 32px; letter-spacing: -0.3px; }
#mpb-sleep-btn.sleep-active { color: #fbbf24; }

/* ── Sleep timer sheet — full-screen modal container ──────── */
#sleep-timer-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* ── Plan: Khatm card ────────────────────────────────────── */
.plan-card-khatm {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 60%, #047857 100%);
  border-radius: 16px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
}
.plan-khatm-star {
  font-size: 28px;
  color: #fbbf24;
  margin-bottom: 6px;
  line-height: 1;
}
.plan-khatm-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.plan-khatm-arabic {
  font-size: 19px;
  color: #a7f3d0;
  font-family: 'Noto Naskh Arabic', serif;
  direction: rtl;
  margin: 6px 0 10px;
  line-height: 1.5;
}
.plan-khatm-sub {
  font-size: 13px;
  color: #6ee7b7;
  margin-bottom: 2px;
}

/* ── Plan: detail page sections ──────────────────────────── */
.pd-today {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin: 12px 14px 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.pd-today-done {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.pd-today-tick {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pd-today-title {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
}
.pd-today-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.pd-today-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.pd-today-range {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}
.pd-today-bar-wrap {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 5px;
}
.pd-today-bar-fill {
  height: 100%;
  background: #059669;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.pd-today-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}
.pd-today-actions {
  display: flex;
  gap: 8px;
}
.pd-read-btn {
  flex: 1;
  padding: 11px 0;
  border: none;
  border-radius: 10px;
  background: #059669;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.pd-read-btn:active { background: #047857; }
.pd-done-btn {
  flex: 1;
  padding: 11px 0;
  border: 2px solid #059669;
  border-radius: 10px;
  background: transparent;
  color: #059669;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.pd-done-btn:active { background: #f0fdf4; }

/* ── Plan: section wrappers ──────────────────────────────── */
.pd-section {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px 12px;
  margin: 6px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.pd-section-last { margin-bottom: 6px; }
.pd-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── Plan: juz progress grid ─────────────────────────────── */
.plan-juz-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.plan-juz-cell {
  border-radius: 8px;
  padding: 6px 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  justify-content: center;
  position: relative;
}
.juz-done {
  background: #059669;
}
.juz-partial {
  background: #d1fae5;
  border: 1.5px solid #6ee7b7;
}
.juz-upcoming {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
}
.juz-num {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.juz-done .juz-num { color: rgba(255,255,255,0.7); }
.juz-check {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
}
.juz-bar {
  width: 80%;
  height: 3px;
  background: #a7f3d0;
  border-radius: 99px;
  overflow: hidden;
}
.juz-bar-fill {
  height: 100%;
  background: #059669;
  border-radius: 99px;
}

/* ── Plan: stats row ─────────────────────────────────────── */
.pd-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pd-stat {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 8px 8px;
  text-align: center;
}
.pd-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}
.pd-stat-date {
  font-size: 11px !important;
}
.pd-stat-label {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Plan: heatmap ───────────────────────────────────────── */
.plan-heatmap-wrap {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  overflow-x: auto;
}
.hm-row-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 18px;
  flex-shrink: 0;
}
.hm-row-lbl {
  font-size: 9px;
  color: #94a3b8;
  height: 11px;
  line-height: 11px;
  text-align: right;
  width: 12px;
}
.plan-heatmap-months {
  display: flex;
  gap: 3px;
  margin-bottom: 3px;
  height: 15px;
}
.hm-month-lbl {
  width: 11px;
  font-size: 9px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: visible;
}
.plan-heatmap-grid {
  display: flex;
  gap: 3px;
}
.hm-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hm-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #e2e8f0;
}
.hm-done { background: #059669; }
.hm-future { background: #f1f5f9; opacity: 0.5; }
.hm-today { outline: 2px solid #059669; outline-offset: 1px; }

/* ── Plan: settings list ─────────────────────────────────── */
.pd-settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-setting-btn {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.pd-setting-btn:active { background: #f8fafc; }
.pd-setting-danger {
  color: #ef4444;
  border-color: #fecaca;
}
.pd-setting-danger:active { background: #fff5f5; }

/* ── Dark mode: plan detail ──────────────────────────────── */
html.dark .pd-today { background: #1e293b; box-shadow: none; }
html.dark .pd-today-range { color: #f1f5f9; }
html.dark .pd-today-sub { color: #94a3b8; }
html.dark .pd-today-meta { color: #64748b; }
html.dark .pd-today-bar-wrap { background: #334155; }
html.dark .pd-done-btn { border-color: #059669; color: #34d399; }
html.dark .pd-done-btn:active { background: #0f2d1e; }
html.dark .pd-section { background: #1e293b; box-shadow: none; }
html.dark .pd-section-label { color: #475569; }
html.dark .juz-upcoming { background: #0f172a; border-color: #334155; }
html.dark .juz-num { color: #94a3b8; }
html.dark .juz-partial { background: #0f2d1e; border-color: #059669; }
html.dark .juz-bar { background: #064e3b; }
html.dark .pd-stat { background: #0f172a; }
html.dark .pd-stat-value { color: #f1f5f9; }
html.dark .hm-cell { background: #334155; }
html.dark .hm-done { background: #059669; }
html.dark .hm-future { background: #1e293b; }
html.dark .hm-today { outline-color: #34d399; }
html.dark .pd-setting-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
html.dark .pd-setting-btn:active { background: #0f172a; }
html.dark .pd-setting-danger { color: #f87171; border-color: #7f1d1d; }
html.dark .pd-setting-danger:active { background: #1e0909; }

/* ── Prayer: approx location banner ─────────────────────── */
.approx-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 8px 16px 0;
  font-size: 12px;
  color: #713f12;
}
.approx-banner button {
  flex-shrink: 0;
  background: #fde047;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #713f12;
  cursor: pointer;
}
html.dark .approx-banner {
  background: #1c1a06;
  border-color: #713f12;
  color: #fde047;
}
html.dark .approx-banner button {
  background: #713f12;
  color: #fde047;
}

/* ── Prayer: city search ─────────────────────────────────── */
.city-search-form {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  max-width: 340px;
  margin: 0 auto;
}
.city-search-input {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 10px 14px;
  color: white;
  font-size: 14px;
  outline: none;
}
.city-search-input::placeholder { color: rgba(255,255,255,0.55); }
.city-search-input::-webkit-search-cancel-button { display: none; }
.city-results {
  margin: 8px auto 0;
  max-width: 340px;
  width: calc(100% - 32px);
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
}
.city-result-item {
  padding: 11px 14px;
  font-size: 13px;
  color: white;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.city-result-item:last-child { border-bottom: none; }
.city-result-item:hover { background: rgba(255,255,255,0.08); }
.city-result-item:active { background: rgba(255,255,255,0.1); }
.city-no-results { opacity: 0.6; cursor: default; }
.city-search-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin: 8px 0 0;
}

/* ── Share Card Modal ───────────────────────────────────────── */
#share-card-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: none; align-items: flex-end; justify-content: center;
}
.scm-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.75);
}
.scm-sheet {
  position: relative; width: 100%; max-width: 480px;
  background: #1e293b; border-radius: 20px 20px 0 0;
  padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.25s ease;
  max-height: 92vh; overflow-y: auto;
}
.scm-sheet.open { transform: translateY(0); }
.scm-handle {
  width: 36px; height: 4px; background: rgba(255,255,255,0.2);
  border-radius: 2px; margin: 0 auto 14px;
}
.scm-preview {
  width: 100%; border-radius: 12px; display: block; margin-bottom: 14px;
  transition: opacity 0.15s;
}
.scm-loading {
  text-align: center; padding: 48px 0; color: #94a3b8; font-size: 15px;
}
.scm-size-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.scm-btn-size { flex: none; width: 52px; padding: 10px; font-size: 15px; font-weight: 700; }
.scm-size-label { flex: 1; text-align: center; font-size: 13px; color: #94a3b8; }
.scm-actions { display: flex; gap: 10px; }
.scm-btn {
  flex: 1; padding: 13px 10px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,0.1); color: #fff;
}
.scm-btn-primary { background: #059669; }
.scm-btn-close { background: rgba(255,255,255,0.06); color: #94a3b8; }
.scm-btn-mode { flex: none; width: 44px; padding: 10px; font-size: 16px; background: rgba(255,255,255,0.08); }
html.dark .scm-sheet { background: #0f172a; }
