/* ==========================================================================
   Meal Oku
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,600;0,7..72,700;1,7..72,400&family=Manrope:wght@400;500;600;700&family=Scheherazade+New:wght@400;600;700&display=swap');

:root {
  --primary: #1a5646;
  --primary-dark: #113c32;
  --primary-light: #306958;
  --primary-dim: #225d4c;
  --primary-soft: rgba(26, 86, 70, 0.08);
  --primary-subtle: rgba(26, 86, 70, 0.14);
  --primary-border: rgba(26, 86, 70, 0.22);
  --primary-container: #b3efd9;
  --on-primary: #e4fff3;

  --brass: #8b7340;
  --brass-soft: rgba(139, 115, 64, 0.14);
  --secondary: #725c2b;
  --secondary-container: #fedfa2;

  --bg-page: #f2f4f3;
  --bg-card: #ffffff;
  --bg-soft: #f1f4f3;
  --bg-pill: #eaefee;
  --bg-hero: #ffffff;

  --border-color: #d7ded9;
  --border-hover: #acb3b2;

  --text-primary: #14241e;
  --text-secondary: #5c6b64;
  --text-muted: #8a938e;

  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.1);
  --warning: #c45c12;
  --gold: #8b7340;
  --gold-soft: rgba(139, 115, 64, 0.12);

  --font-display: 'Literata', Georgia, 'Times New Roman', serif;
  --font-main: 'Manrope', system-ui, sans-serif;
  --font-arabic: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(20, 36, 30, 0.04);
  --shadow-md: 0 4px 20px -2px rgba(20, 36, 30, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 36, 30, 0.1);

  --transition: 160ms ease;
  --meal-font-size: 16px;
  --arabic-font-size: 26px;
  --header-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.octagon {
  clip-path: polygon(29% 0%, 71% 0%, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0% 71%, 0% 29%);
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon-badge {
  width: 36px;
  height: 36px;
  clip-path: polygon(29% 0%, 71% 0%, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0% 71%, 0% 29%);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(26, 86, 70, 0.16);
}

.logo-icon-badge .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary-container);
}

.logo-text-col { display: flex; flex-direction: column; }

.logo-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
}

.logo-tagline {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-btn:hover { color: var(--text-primary); background: var(--bg-soft); }

.nav-btn.active {
  color: var(--primary);
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--primary);
  border-radius: 0;
}

.nav-btn.nav-admin {
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-weight: 600;
  box-shadow: none;
}

.nav-btn.nav-admin:hover,
.nav-btn.nav-admin.active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(254, 223, 162, 0.28);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(139, 115, 64, 0.28);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover { background: var(--bg-soft); }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero-section {
  padding: 40px 0 8px;
}

.hero-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.hero-eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.hero-stat {
  background: var(--bg-soft);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.hero-seal {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin-left: auto;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.hero-seal::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(172, 179, 178, 0.7);
  border-radius: 12px;
  pointer-events: none;
}

.hero-seal-mark {
  width: 44px;
  height: 44px;
  clip-path: polygon(29% 0%, 71% 0%, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0% 71%, 0% 29%);
  background: #dde4e3;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  z-index: 1;
}

.hero-seal-ar {
  font-family: var(--font-arabic);
  font-size: 30px;
  color: var(--primary);
  line-height: 1.4;
  z-index: 1;
}

.hero-seal-label {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 6px;
  z-index: 1;
}

.hero-seal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  z-index: 1;
}

.search-wrapper {
  max-width: 820px;
  margin: -28px auto 0;
  position: relative;
  z-index: 2;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px 12px 10px 18px;
  box-shadow: var(--shadow-md);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-md);
}

.search-icon { color: var(--primary); display: flex; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  background: transparent;
}
.search-input::placeholder { color: var(--text-muted); }

.search-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-muted);
  display: none;
  align-items: center;
  justify-content: center;
}
.search-clear-btn:hover { background: var(--bg-pill); color: var(--text-primary); }

.search-action-btn {
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.search-action-btn:hover { background: var(--primary-dim); }

.search-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.suggestion-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.suggestion-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#announcementBanner {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ==========================================================================
   FILTERS + CARDS
   ========================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.tab-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.surah-counter {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.surah-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color var(--transition);
}
.surah-card:hover { border-color: var(--primary); }
.surah-card::before { display: none; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title-col { display: flex; align-items: center; gap: 12px; }

.surah-no-badge {
  width: 40px;
  height: 40px;
  clip-path: polygon(29% 0%, 71% 0%, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0% 71%, 0% 29%);
  background: var(--bg-pill);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.surah-card:hover .surah-no-badge {
  background: var(--primary-container);
  color: var(--primary-dark);
}

.surah-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.surah-card:hover .surah-name { color: var(--primary); }

.surah-subname { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.surah-arabic-title {
  font-family: var(--font-arabic);
  font-size: 24px;
  color: var(--primary);
  line-height: 1;
  direction: rtl;
}

.card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.pill-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-pill);
  color: var(--text-secondary);
}

.pill-place-mekke { background: var(--primary-soft); color: var(--primary); }
.pill-place-medine { background: rgba(62, 103, 91, 0.12); color: #3e675b; }
.pill-verse-count { background: var(--bg-pill); color: var(--text-secondary); }
.pill-notes-count { background: var(--brass-soft); color: var(--brass); }

.card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
}

.card-page-info { font-size: 12px; color: var(--text-muted); }

.card-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.methodology-banner {
  background: #eaefee;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 48px;
}

.methodology-kicker {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.methodology-banner h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 14px;
}

.methodology-banner blockquote {
  border-left: 2px solid var(--primary);
  padding-left: 16px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.7;
  max-width: 720px;
}

/* ==========================================================================
   READER
   ========================================================================== */

.reader-view,
.search-results-view,
.bookmarks-view {
  display: none;
  padding: 24px 0 60px;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.back-btn:hover { color: var(--primary); border-color: var(--primary-border); }

.surah-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.surah-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.sh-left h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.sh-left .sh-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }

.sh-right {
  font-family: var(--font-arabic);
  font-size: 42px;
  color: var(--primary);
  direction: rtl;
}

.surah-desc-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.reader-controls-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.mode-selector {
  display: flex;
  background: var(--bg-pill);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.mode-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.mode-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.font-controls { display: flex; align-items: center; gap: 6px; }
.font-size-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.font-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-pill);
  color: var(--text-primary);
  font-weight: 700;
}
.font-btn:hover { background: var(--primary-soft); color: var(--primary); }

.surah-quick-jump {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  outline: none;
}

.bismillah-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.bismillah-ar {
  font-family: var(--font-arabic);
  font-size: 34px;
  color: var(--primary-dark);
  line-height: 1.5;
  margin-bottom: 8px;
}

.bismillah-tr { font-size: 14px; color: var(--text-secondary); }

.ayah-list { display: flex; flex-direction: column; gap: 16px; }

.ayah-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  transition: border-color var(--transition);
}
.ayah-card:hover { border-color: var(--primary-border); }

.ayah-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.ayah-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.ayah-actions { display: flex; gap: 6px; }

.action-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.action-icon-btn:hover { background: var(--bg-pill); color: var(--text-primary); }
.action-icon-btn.bookmarked { color: var(--warning); background: rgba(196, 92, 18, 0.1); }

.ayah-arabic {
  font-family: var(--font-arabic);
  font-size: var(--arabic-font-size);
  line-height: 2;
  direction: rtl;
  text-align: right;
  margin-bottom: 16px;
}

.ayah-translation {
  font-size: var(--meal-font-size);
  line-height: 1.8;
}

.footnote-ref {
  display: inline-flex;
  align-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 6px;
  margin: 0 3px;
  cursor: pointer;
  vertical-align: middle;
}
.footnote-ref:hover { background: var(--primary); color: #fff; }

.surah-notes-card {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.sn-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.note-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.note-item:last-child { margin: 0; padding: 0; border: none; }

.note-no-badge {
  width: 24px;
  height: 24px;
  clip-path: polygon(29% 0%, 71% 0%, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0% 71%, 0% 29%);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.surah-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.surah-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 700;
}
.surah-nav-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-results-header { margin-bottom: 22px; }
.search-results-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 6px;
}
.search-query-tag { color: var(--primary); }
.search-results-list { display: flex; flex-direction: column; gap: 12px; }

.search-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  cursor: pointer;
}
.search-result-card:hover { border-color: var(--primary); }

.highlight {
  background: var(--primary-container);
  color: var(--primary-dark);
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-xl);
}
.empty-state-icon { font-size: 40px; margin-bottom: 10px; }

/* ==========================================================================
   MODALS / TOAST / FOOTER
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 15, 0.48);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-container {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.modal-close-btn:hover { background: var(--bg-pill); color: var(--text-primary); }
.modal-body {
  padding: 22px;
  overflow-y: auto;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: 200ms ease;
}
.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.site-footer {
  margin-top: auto;
  background: var(--bg-page);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.footer-brand { max-width: 360px; }
.footer-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.65;
}

.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.fl-col h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}
.fl-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.fl-col a { font-size: 13px; color: var(--text-secondary); }
.fl-col a:hover { color: var(--primary); }

.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-seal { margin: 0 auto; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.is-open { display: flex; }
  .nav-btn.active { box-shadow: none; background: var(--primary-soft); border-radius: var(--radius-sm); }
  .header-badge { display: none; }
}

@media (max-width: 768px) {
  .hero-panel { padding: 24px 20px; }
  .surah-grid { grid-template-columns: 1fr; }
  .reader-controls-bar { flex-direction: column; align-items: stretch; }
  .methodology-banner { padding: 24px; }
}
