/* ================================================================
   Al-Quran – style.css
   Light / Dark theme using CSS custom properties
   ================================================================ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-100: #d1fae5;
  --gold:      #c9a227;
  --gold-light:#f0c040;

  /* Theme tokens (light) */
  --bg:           #f9fafb;
  --bg2:          #ffffff;
  --bg3:          #f3f4f6;
  --text:         #111827;
  --text2:        #374151;
  --text3:        #6b7280;
  --border:       #e5e7eb;
  --card-bg:      #ffffff;
  --sidebar-bg:   #ffffff;
  --navbar-bg:    #ffffff;
  --player-bg:    #ffffff;
  --shadow:       0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:    0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.05);

  /* Layout */
  --navbar-h:    64px;
  --player-h:    84px;
  --sidebar-w:   300px;
  --radius:       8px;
  --radius-lg:   14px;

  /* Arabic font sizes */
  --arabic-sm:   1.6rem;
  --arabic-md:   2rem;
  --arabic-lg:   2.6rem;
  --arabic-xl:   3.2rem;
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --bg2:          #1e293b;
  --bg3:          #0f172a;
  --text:         #f1f5f9;
  --text2:        #cbd5e1;
  --text3:        #94a3b8;
  --border:       #334155;
  --card-bg:      #1e293b;
  --sidebar-bg:   #1e293b;
  --navbar-bg:    #1e293b;
  --player-bg:    #1e293b;
  --shadow:       0 1px 3px rgba(0,0,0,.40);
  --shadow-md:    0 4px 6px rgba(0,0,0,.40);
  --shadow-lg:    0 10px 15px rgba(0,0,0,.50);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }
ul { list-style: none; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Loading overlay ──────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  transition: opacity .3s, visibility .3s;
}
.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--navbar-h);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center;
  padding: 0 12px;
  gap: 12px;
  transition: background .25s, border-color .25s;
}

.nav-start { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-center { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.nav-end   { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Brand */
.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; text-decoration: none; }
.brand-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.35rem;
  color: var(--green-700);
  font-weight: 700;
}
[data-theme="dark"] .brand-arabic { color: var(--green-500); }
.brand-latin { font-size: .65rem; color: var(--text3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

/* Icon buttons */
.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius);
  color: var(--text2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.icon-btn svg { width: 20px; height: 20px; }

/* Search */
.search-form {
  position: relative;
  width: 100%; max-width: 480px;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px;
  width: 16px; height: 16px;
  color: var(--text3); pointer-events: none;
}
.search-input {
  width: 100%; padding: 8px 100px 8px 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg3); color: var(--text);
  font-size: .88rem;
  transition: border-color .15s, background .15s;
}
.search-input:focus { outline: none; border-color: var(--green-600); background: var(--bg2); }
.search-btn {
  position: absolute; right: 6px;
  padding: 5px 14px;
  background: var(--green-700); color: #fff;
  border: none; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  transition: background .15s;
}
.search-btn:hover { background: var(--green-800); }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--navbar-h); left: 0; bottom: var(--player-h);
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .25s ease, background .25s, border-color .25s;
  overflow: hidden;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-title { font-size: 1rem; font-weight: 700; color: var(--green-700); }
[data-theme="dark"] .sidebar-title { color: var(--green-500); }

.surah-filter {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3); color: var(--text);
  font-size: .82rem; width: 100%;
}
.surah-filter:focus { outline: none; border-color: var(--green-600); }

.surah-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}

.surah-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
  user-select: none;
}
.surah-item:hover { background: var(--bg3); }
.surah-item.active {
  background: var(--green-100);
  border-left-color: var(--green-700);
}
[data-theme="dark"] .surah-item.active {
  background: rgba(5,150,105,.15);
  border-left-color: var(--green-500);
}
.surah-num {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--bg3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 600; color: var(--text3);
  transition: background .12s;
}
.surah-item.active .surah-num { background: var(--green-700); color: #fff; }
[data-theme="dark"] .surah-item.active .surah-num { background: var(--green-600); }

.surah-info { flex: 1; min-width: 0; }
.surah-name-en {
  font-size: .85rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.surah-meta { font-size: .72rem; color: var(--text3); display: flex; gap: 6px; align-items: center; }
.surah-badge {
  font-size: .62rem; padding: 1px 5px;
  border-radius: 3px; font-weight: 600;
  background: var(--bg3);
}
.badge-makki  { background: #fef3c7; color: #92400e; }
.badge-madani { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .badge-makki  { background: rgba(252,211,77,.15); color: #fde68a; }
[data-theme="dark"] .badge-madani { background: rgba(96,165,250,.15); color: #93c5fd; }

.surah-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.1rem; color: var(--text3);
  flex-shrink: 0;
}

/* ── Sidebar overlay (mobile) ─────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,.45); opacity: 0;
  transition: opacity .25s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ── Main content ─────────────────────────────────────────────── */
.app-layout { display: flex; }

.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--navbar-h);
  min-height: calc(100vh - var(--navbar-h) - var(--player-h));
  padding: 28px 24px;
  transition: margin-left .25s ease;
  flex: 1; min-width: 0;
}
.main-content.full-width { margin-left: 0; }

/* ── Home / Hero ──────────────────────────────────────────────── */
.home-hero {
  text-align: center; padding: 60px 20px 40px;
  background: linear-gradient(135deg, var(--green-900) 0%, #1a2a1a 100%);
  border-radius: var(--radius-lg);
  color: #fff; margin-bottom: 36px;
  position: relative; overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .5;
}
.hero-bismillah {
  font-family: 'Amiri Quran', 'Amiri', serif;
  font-size: 2.8rem; line-height: 1.6;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  margin-bottom: 16px; position: relative;
}
.hero-title {
  font-size: 1.9rem; font-weight: 700; margin-bottom: 8px; position: relative;
}
.hero-subtitle { color: rgba(255,255,255,.75); font-size: 1rem; position: relative; }
.hero-stats {
  display: flex; gap: 32px; justify-content: center;
  margin-top: 28px; position: relative;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.6rem; font-weight: 700; color: var(--gold-light); }
.hero-stat-label { font-size: .75rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.chapter-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  box-shadow: var(--shadow);
}
.chapter-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--green-600);
}
.chapter-card-num {
  width: 42px; height: 42px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: #fff;
}
.chapter-card-info { flex: 1; min-width: 0; }
.chapter-card-name { font-size: .9rem; font-weight: 600; }
.chapter-card-trans { font-size: .75rem; color: var(--text3); margin-bottom: 3px; }
.chapter-card-meta { font-size: .7rem; color: var(--text3); display: flex; gap: 6px; }
.chapter-card-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.35rem; color: var(--green-700); flex-shrink: 0;
}
[data-theme="dark"] .chapter-card-arabic { color: var(--green-500); }

/* ── Chapter view ─────────────────────────────────────────────── */
.chapter-header {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.chapter-header-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.chapter-header-left h1 {
  font-size: 1.7rem; font-weight: 700;
}
.chapter-header-left .chapter-translated-name {
  color: var(--text3); font-size: .95rem; margin-top: 2px;
}
.chapter-header-left .chapter-meta {
  display: flex; gap: 10px; align-items: center; margin-top: 8px;
}
.chapter-meta-badge {
  font-size: .72rem; padding: 2px 10px;
  border-radius: 999px; font-weight: 600;
}
.chapter-arabic-name {
  font-family: 'Amiri', serif;
  font-size: 3rem; line-height: 1.3;
  color: var(--green-700); text-align: right;
}
[data-theme="dark"] .chapter-arabic-name { color: var(--green-500); }

.chapter-header-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.bismillah-display {
  text-align: center;
  font-family: 'Amiri Quran', 'Amiri', serif;
  font-size: 2.4rem; line-height: 1.8;
  color: var(--green-800);
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
[data-theme="dark"] .bismillah-display { color: var(--green-400); }

/* ── Verse card ───────────────────────────────────────────────── */
.verses-container { display: flex; flex-direction: column; gap: 18px; }

.verse-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.verse-card:hover { border-color: var(--green-600); }
.verse-card.playing {
  border-color: var(--green-600);
  box-shadow: 0 0 0 2px rgba(5,150,105,.2), var(--shadow-md);
}

.verse-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.verse-number-badge {
  width: 32px; height: 32px;
  background: var(--green-700); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}
.verse-key { font-size: .75rem; color: var(--text3); }
.verse-page-info { font-size: .72rem; color: var(--text3); }
.verse-actions { display: flex; gap: 4px; }

.verse-card-body { padding: 20px 24px; }

.verse-arabic {
  font-family: 'Amiri Quran', 'Amiri', serif;
  line-height: 2.2;
  color: var(--text);
  text-align: right;
  direction: rtl;
  margin-bottom: 14px;
}
.verse-arabic[data-size="small"]  { font-size: var(--arabic-sm); }
.verse-arabic[data-size="medium"] { font-size: var(--arabic-md); }
.verse-arabic[data-size="large"]  { font-size: var(--arabic-lg); }
.verse-arabic[data-size="xlarge"] { font-size: var(--arabic-xl); }

.verse-transliteration {
  font-size: .88rem; color: var(--text3);
  font-style: italic; margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: 6px;
  line-height: 1.7;
}
.verse-translation {
  font-size: .93rem; color: var(--text2);
  line-height: 1.75;
  border-left: 3px solid var(--green-600);
  padding-left: 12px;
}

.verse-action-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-radius: var(--radius);
  color: var(--text3);
  transition: background .12s, color .12s;
}
.verse-action-btn:hover { background: var(--bg3); color: var(--text); }
.verse-action-btn.bookmarked { color: var(--gold); }
.verse-action-btn svg { width: 17px; height: 17px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border: none; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text2);
}
.btn-outline:hover { border-color: var(--green-600); color: var(--green-700); background: var(--bg3); }
.btn svg { width: 16px; height: 16px; }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 32px; padding-bottom: 20px;
}
.page-btn {
  min-width: 38px; height: 38px; padding: 0 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  background: var(--card-bg); color: var(--text2);
  border-radius: var(--radius); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.page-btn:hover { border-color: var(--green-600); color: var(--green-700); }
.page-btn.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Search results ───────────────────────────────────────────── */
.search-header {
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.search-header h2 { font-size: 1.3rem; }
.search-total { font-size: .85rem; color: var(--text3); }

.search-result {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px; margin-bottom: 14px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow);
}
.search-result:hover { border-color: var(--green-600); box-shadow: var(--shadow-md); }
.search-result-key {
  font-size: .8rem; font-weight: 700; color: var(--green-700);
  margin-bottom: 8px;
}
[data-theme="dark"] .search-result-key { color: var(--green-500); }
.search-result-arabic {
  font-family: 'Amiri Quran', 'Amiri', serif;
  font-size: 1.55rem; line-height: 2;
  text-align: right; direction: rtl; color: var(--text);
  margin-bottom: 8px;
}
.search-result-trans {
  font-size: .88rem; color: var(--text3); line-height: 1.6;
}
mark { background: rgba(201,162,39,.3); color: inherit; border-radius: 2px; }

/* ── Bookmarks ────────────────────────────────────────────────── */
.bookmarks-header { margin-bottom: 24px; }
.bookmarks-header h2 { font-size: 1.4rem; font-weight: 700; }
.bookmarks-header p { color: var(--text3); font-size: .9rem; margin-top: 4px; }

.empty-state {
  text-align: center; padding: 80px 20px;
  color: var(--text3);
}
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; color: var(--text2); margin-bottom: 6px; }

/* ── Audio Player ─────────────────────────────────────────────── */
.audio-player {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  height: var(--player-h);
  background: var(--player-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
  display: flex; align-items: center;
  padding: 0 16px; gap: 16px;
  transition: transform .3s ease, background .25s, border-color .25s;
}
.audio-player.hidden { transform: translateY(100%); }

.player-verse-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
}
.player-chapter { font-size: .82rem; font-weight: 600; color: var(--text2); }
.player-verse   { font-size: .72rem; color: var(--text3); }

.player-controls { display: flex; align-items: center; gap: 8px; }
.player-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 50%;
  color: var(--text2);
  transition: background .12s, color .12s;
}
.player-btn:hover { background: var(--bg3); color: var(--text); }
.player-btn svg { width: 20px; height: 20px; }
.player-btn.small svg { width: 17px; height: 17px; }
.player-play-btn {
  width: 44px; height: 44px;
  background: var(--green-700); color: #fff;
}
.player-play-btn:hover { background: var(--green-800); }
.player-btn.active { color: var(--green-600); }

.player-progress-area {
  flex: 2; display: flex; align-items: center; gap: 8px; min-width: 0;
}
.player-time { font-size: .72rem; color: var(--text3); white-space: nowrap; width: 36px; }
.progress-bar-wrap {
  flex: 1; cursor: pointer; padding: 8px 0;
}
.progress-bar-bg {
  height: 4px; background: var(--border);
  border-radius: 2px; position: relative;
}
.progress-bar-fill {
  height: 100%; background: var(--green-600);
  border-radius: 2px; width: 0%;
  transition: width .1s linear;
}
.progress-bar-wrap:hover .progress-bar-fill { background: var(--green-500); }

.player-extras {
  display: flex; align-items: center; gap: 8px;
}
.volume-wrap {
  display: flex; align-items: center; gap: 6px;
}
.volume-wrap svg { width: 17px; height: 17px; color: var(--text3); flex-shrink: 0; }
.volume-slider {
  width: 70px; cursor: pointer;
  accent-color: var(--green-600);
}

/* ── Settings Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  transition: opacity .2s;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  max-height: 90vh; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

.setting-group { display: flex; flex-direction: column; gap: 8px; }
.setting-label { font-size: .85rem; font-weight: 600; color: var(--text2); }
.setting-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3); color: var(--text);
  font-size: .9rem;
}
.setting-select:focus { outline: none; border-color: var(--green-600); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.toggle-row:last-child { border-bottom: none; }

.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 40px; height: 22px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background .2s;
}
.toggle-track::after {
  content: '';
  position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle-track { background: var(--green-600); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── Toast notification ───────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: calc(var(--player-h) + 16px); right: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: .85rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease, fadeOut .3s ease 2.7s forwards;
  pointer-events: auto;
}
@keyframes slideIn  { from { transform: translateY(20px); opacity:0; } to { transform: none; opacity:1; } }
@keyframes fadeOut  { to { opacity: 0; transform: translateY(-10px); } }

/* ── Error & info states ──────────────────────────────────────── */
.error-state {
  text-align: center; padding: 60px 20px; color: var(--text3);
}
.error-state h3 { color: #ef4444; font-size: 1.1rem; margin-bottom: 8px; }

/* ── Skeleton loader ──────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    z-index: 150;
    bottom: 0;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding: 16px; }
  .hero-bismillah { font-size: 2rem; }
  .hero-stats { gap: 20px; }
  .home-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
  .chapter-header-top { flex-direction: column; }
  .chapter-arabic-name { font-size: 2.2rem; }
  .player-verse-info { display: none; }
  .player-extras { display: none; }
  .volume-slider { display: none; }
  .brand-arabic { font-size: 1.1rem; }
  .brand-latin { display: none; }
}

@media (max-width: 480px) {
  .home-hero { padding: 40px 16px 28px; }
  .hero-title { font-size: 1.4rem; }
  .verse-card-body { padding: 14px 16px; }
  .navbar { padding: 0 8px; gap: 8px; }
  .search-form { max-width: 200px; }
  .chapter-header { padding: 18px 16px; }
  .bismillah-display { font-size: 1.8rem; }
}

/* ── Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.loading-text { text-align: center; padding: 40px; color: var(--text3); }

/* ── Surah progress indicator in sidebar ─────────────────────── */
.reading-progress {
  display: block; height: 2px;
  background: var(--green-500);
  position: absolute; bottom: 0; left: 0;
  transition: width .3s;
}

/* Juz badge inside verse card header */
.juz-badge {
  font-size: .65rem; padding: 2px 7px;
  background: rgba(201,162,39,.15);
  color: var(--gold);
  border-radius: 3px; font-weight: 600;
}

/* Pagination info label */
.pagination-info {
  font-size: .85rem; color: var(--text3); padding: 0 8px;
}
