/* ============================================================
   دينيَ الإسلام — style.css  (v2 — هوية المصحف المُذهَّب)
   نظام تصميم: ليل المحراب (زمردي داكن) × رَقّ المخطوطة (بِرشمان)
   × تذهيب (ذهب) × تحمير المخطوطات (أحمر الرُّبريكا للعلامات)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@300;400;500;600;700&display=swap');

/* ── Scheherazade New — فونت القرآن العثماني ── */
@font-face {
  font-family: 'Scheherazade New';
  src: url('../fonts/scheherazade-new.woff2') format('woff2'),
       url('../fonts/scheherazade-new.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: block;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}
/* ── Amiri ── */
@font-face {
  font-family: 'Amiri';
  src: url('../fonts/amiri-400.woff2') format('woff2'),
       url('../fonts/amiri-400.woff')  format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Amiri';
  src: url('../fonts/amiri-700.woff2') format('woff2'),
       url('../fonts/amiri-700.woff')  format('woff');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Amiri Quran';
  src: url('../fonts/amiri-quran.woff2') format('woff2'),
       url('../fonts/amiri-quran.woff')  format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}

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

/* ===== TOKENS ===== */
:root {
  /* أسطح القراءة (رَقّ) */
  --bg-main:      #F8F3E6;
  --bg-card:      #F0E8D3;
  --bg-verse:     #FCF8EE;
  --panel:        #FFFFFF;

  /* الحبر */
  --ink:          #33291A;
  --ink-soft:     #6E5A3E;
  --brown-text:   var(--ink);        /* اسم قديم — يُحافَظ عليه */
  --brown-light:  var(--ink-soft);   /* اسم قديم — يُحافَظ عليه */

  /* الزمرد (الكروم الداكن) */
  --chrome:       #11382C;
  --chrome-2:     #0B2620;
  --chrome-3:     #071A15;
  --green-deep:   #11382C;
  --green-mid:    #1E5A45;
  --green-light:  #E2EFE6;
  --on-chrome:    #C7D8C9;

  /* الذهب (تذهيب) */
  --gold-dark:    #8A6B12;
  --gold-mid:     #B08A1E;
  --gold-light:   #CDA94B;
  --gold-pale:    #F4E8C5;

  /* الرُّبريكا — أحمر المخطوطات (التوقيع البصري) */
  --rubric:       #A23E2C;
  --rubric-pale:  #F7E6DE;

  --divider:      #D9C69E;
  --divider-soft: #EBE0C6;
  --shadow-warm:  rgba(138,107,18,.12);

  --radius-card:  16px;
  --radius-pill:  40px;
  --transition:   .3s cubic-bezier(.4,0,.2,1);

  /* مقياس خط القراءة (يتحكم فيه القارئ A−/A+) */
  --fs-scale: 1;
}

/* ===== الوضع الليلي — «قيام الليل» ===== */
html[data-theme="dark"] {
  --bg-main:      #0C1511;
  --bg-card:      #122019;
  --bg-verse:     #0F1B15;
  --panel:        #15251D;

  --ink:          #E9DEC4;
  --ink-soft:     #AC9A77;

  --chrome:       #0E2A21;
  --chrome-2:     #0A1F19;
  --chrome-3:     #061511;
  --green-deep:   #0E2A21;
  --green-mid:    #2A6B52;
  --green-light:  #18342A;
  --on-chrome:    #BACFBE;

  --gold-dark:    #D9BB66;
  --gold-mid:     #C7A23B;
  --gold-light:   #D6B65E;
  --gold-pale:    #2B2414;

  --rubric:       #D4795F;
  --rubric-pale:  #321B14;

  --divider:      #2C3E33;
  --divider-soft: #20302A;
  --shadow-warm:  rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-main);
  color: var(--ink);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

::selection { background: rgba(205,169,75,.35); }

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== TOP BORDER — سَفيفة التذهيب ===== */
.top-border {
  height: 5px;
  background:
    linear-gradient(90deg,
      var(--chrome-3) 0%, var(--gold-mid) 18%, var(--gold-light) 32%,
      var(--chrome-2) 50%, var(--gold-light) 68%, var(--gold-mid) 82%, var(--chrome-3) 100%);
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(180deg, var(--chrome) 0%, var(--chrome-2) 100%);
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 22px rgba(0,0,0,.3);
  border-bottom: 1px solid rgba(205,169,75,.22);
}
.site-header .logo {
  font-family: 'Amiri', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold-light);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(205,169,75,.25);
}
.site-header .logo::before {
  content: '';
  width: 18px; height: 18px;
  flex-shrink: 0;
  background-color: var(--gold-light);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l2.6 6.3L21 4.9l-1.4 6.5L24 12l-4.4.6L21 19.1l-6.4-1.4L12 24l-2.6-6.3L3 19.1l1.4-6.5L0 12l4.4-.6L3 4.9l6.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l2.6 6.3L21 4.9l-1.4 6.5L24 12l-4.4.6L21 19.1l-6.4-1.4L12 24l-2.6-6.3L3 19.1l1.4-6.5L0 12l4.4-.6L3 4.9l6.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.site-header nav { display: flex; gap: 22px; align-items: center; }
.site-header nav a {
  color: var(--on-chrome);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.site-header nav a:hover { color: var(--gold-light); border-bottom-color: rgba(205,169,75,.5); }

/* أدوات القارئ (تُحقَن بالجافاسكربت) */
.header-tools { display: flex; align-items: center; gap: 8px; }
.ht-btn {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(205,169,75,.35);
  color: var(--gold-light);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Cairo', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.ht-btn:hover { background: rgba(205,169,75,.18); transform: translateY(-1px); }
.ht-btn:active { transform: translateY(0); }
.ht-btn svg { width: 17px; height: 17px; display: block; }
.ht-fs { font-size: .8rem; letter-spacing: -1px; }

/* ===== HERO — محراب الصفحة ===== */
.hero {
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(205,169,75,.13) 0%, transparent 60%),
    linear-gradient(168deg, var(--chrome) 0%, var(--chrome-2) 55%, var(--chrome-3) 100%);
  text-align: center;
  padding: 72px 40px 62px;
  position: relative;
  overflow: hidden;
}
/* زخرفة النجمة الثُّمانية (خاتم) — نسيج هندسي خفيف */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23CDA94B' stroke-opacity='0.10' stroke-width='1'%3E%3Cpath d='M48 18l8.5 21.5L78 48l-21.5 8.5L48 78l-8.5-21.5L18 48l21.5-8.5z'/%3E%3Crect x='33' y='33' width='30' height='30' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='5'/%3E%3Cpath d='M0 0l10 10M96 0L86 10M0 96l10-10M96 96L86 86'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
  pointer-events: none;
}
/* إطار التذهيب الداخلي */
.hero::after {
  content: '';
  position: absolute; inset: 14px;
  border: 1px solid rgba(205,169,75,.22);
  border-radius: 10px;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero-subtitle {
  font-size: .92rem;
  letter-spacing: .14em;
  color: var(--gold-light);
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  margin-bottom: 18px;
  opacity: 0; animation: fadeUp .8s .1s forwards;
}
.hero-subtitle::before, .hero-subtitle::after { content: ' ◆ '; font-size: .6em; vertical-align: middle; opacity: .7; }
.hero-basmala {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  color: #F6F1E2;
  line-height: 1.7;
  margin-bottom: 14px;
  opacity: 0; animation: fadeUp .9s .25s forwards;
  text-shadow: 0 2px 26px rgba(205,169,75,.35);
}
.hero-title {
  font-family: 'Amiri', serif;
  color: #F6F1E2;
}
.hero-desc {
  font-size: .98rem; color: #93AF97;
  max-width: 560px; margin: 0 auto;
  opacity: 0; animation: fadeUp .9s .4s forwards;
}
.hero-ornament {
  margin: 30px auto 0;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  opacity: 0; animation: fadeUp .9s .55s forwards;
}
.ornament-line { width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-light), transparent); }
.ornament-diamond {
  width: 9px; height: 9px;
  background: var(--gold-light);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(205,169,75,.7);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 14px 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  font-size: .85rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--green-mid); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-dark); }
.breadcrumb .sep { color: var(--divider); }

/* ===== SURAH NAV BAR ===== */
.surah-nav-bar {
  display: flex;
  align-items: center;
  background: var(--bg-verse);
  border-bottom: 1px solid var(--divider);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 62px;
  z-index: 90;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.surah-nav-bar::-webkit-scrollbar { display: none; }
.surah-nav-bar .snb-label {
  font-family: 'Amiri', serif;
  font-size: .85rem;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 0 16px 0 8px;
  border-left: 1px solid var(--divider);
  margin-left: 4px;
  flex-shrink: 0;
}
.surah-nav-bar a {
  display: inline-flex;
  align-items: center;
  padding: 12px 14px;
  font-family: 'Amiri', serif;
  font-size: .88rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.surah-nav-bar a:hover { color: var(--green-mid); background: var(--green-light); }
.surah-nav-bar a.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold-mid);
  font-weight: 700;
  background: var(--gold-pale);
}

/* ===== MAIN ===== */
.main-container { max-width: 960px; margin: 0 auto; padding: 48px 24px 90px; }

/* ===== SURAH TITLE CARD — لوحة العنوان المُذهَّبة ===== */
.surah-title-card {
  background:
    radial-gradient(ellipse 70% 90% at 50% -20%, rgba(205,169,75,.16) 0%, transparent 60%),
    linear-gradient(165deg, var(--chrome) 0%, var(--chrome-2) 60%, var(--chrome-3) 100%);
  border-radius: var(--radius-card);
  padding: 46px 40px;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 44px rgba(7,26,21,.4);
  border: 1px solid rgba(205,169,75,.2);
}
.surah-title-card::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23CDA94B' stroke-opacity='0.09' stroke-width='1'%3E%3Cpath d='M48 18l8.5 21.5L78 48l-21.5 8.5L48 78l-8.5-21.5L18 48l21.5-8.5z'/%3E%3Crect x='33' y='33' width='30' height='30' transform='rotate(45 48 48)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
  pointer-events: none;
}
.surah-title-card::after {
  content: '';
  position: absolute; inset: 12px;
  border: 1px solid rgba(205,169,75,.22);
  border-radius: 10px;
  pointer-events: none;
}
.surah-title-card > * { position: relative; z-index: 1; }

.surah-number-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px;
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--gold-light);
  margin-bottom: 18px;
  position: relative;
  box-shadow: 0 0 0 5px rgba(205,169,75,.1), 0 0 24px rgba(205,169,75,.2);
}
.surah-arabic-name {
  font-family: 'Amiri', serif;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  color: #F6F1E2;
  margin-bottom: 4px;
  text-shadow: 0 2px 22px rgba(205,169,75,.3);
}
.surah-transliteration {
  font-size: 1rem; color: var(--gold-light);
  letter-spacing: .1em; margin-bottom: 18px;
}
.surah-meta-pills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pill {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(205,169,75,.35);
  color: var(--on-chrome);
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: 500;
}

/* ===== SECTION HEADING ===== */
.section-heading {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; margin-top: 48px;
}
.section-heading .icon {
  width: 40px; height: 40px;
  background: var(--gold-pale);
  border: 1px solid rgba(176,138,30,.3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.section-heading h2 {
  font-family: 'Amiri', serif; font-size: 1.5rem;
  color: var(--green-mid); font-weight: 700;
}
html[data-theme="dark"] .section-heading h2 { color: var(--gold-dark); }
.section-heading .line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--divider), transparent);
}

/* ===== INTRO / NAMES CARD ===== */
.intro-card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-right: 4px solid var(--gold-mid);
  border-radius: var(--radius-card);
  padding: 28px 32px; margin-bottom: 32px;
  font-family: 'Amiri', serif;
  font-size: calc(1.05rem * var(--fs-scale));
  line-height: 2;
  box-shadow: 0 2px 14px var(--shadow-warm);
}
.intro-card strong { color: var(--green-mid); font-weight: 700; }
html[data-theme="dark"] .intro-card strong { color: var(--gold-dark); }
.names-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.name-badge {
  background: var(--gold-pale); border: 1px solid var(--gold-light);
  color: var(--gold-dark); padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-family: 'Amiri', serif; font-size: .95rem; font-weight: 700;
}

/* ===== VIRTUE GRID ===== */
.virtue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.virtue-item {
  background: var(--bg-verse);
  border: 1px solid var(--divider-soft);
  border-top: 3px solid var(--gold-light);
  border-radius: 14px;
  padding: 22px 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.virtue-item:hover { transform: translateY(-3px); box-shadow: 0 8px 26px var(--shadow-warm); }
.virtue-item .v-icon { font-size: 1.5rem; margin-bottom: 10px; }
.virtue-item h4 {
  font-family: 'Amiri', serif; font-size: 1.08rem;
  color: var(--green-mid); margin-bottom: 8px;
}
html[data-theme="dark"] .virtue-item h4 { color: var(--gold-dark); }
.virtue-item p { font-size: .88rem; color: var(--ink-soft); line-height: 1.9; }

/* ===== VERSE CARDS — بطاقة الآية ===== */
.verse-group { display: flex; flex-direction: column; gap: 28px; margin-bottom: 16px; }
.verse-card {
  background: var(--bg-verse);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 3px 18px var(--shadow-warm);
  transition: box-shadow var(--transition), transform var(--transition);
  scroll-margin-top: 130px;
}
.verse-card:hover { box-shadow: 0 8px 32px rgba(138,107,18,.2); transform: translateY(-2px); }
html[data-theme="dark"] .verse-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.verse-card:target { border-color: var(--gold-light); box-shadow: 0 0 0 3px rgba(205,169,75,.25); }

.verse-header {
  background: linear-gradient(180deg, var(--chrome) 0%, var(--chrome-2) 100%);
  padding: 12px 22px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 2px solid var(--gold-mid);
}
/* رقم الآية — شمسة ثُمانية مُذهَّبة (توقيع التصميم) */
.verse-num {
  position: relative;
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Amiri', serif; font-size: 1.02rem; font-weight: 700;
  color: var(--gold-light);
}
.verse-num::before, .verse-num::after {
  content: '';
  position: absolute; inset: 4px;
  border: 1.5px solid rgba(205,169,75,.85);
  border-radius: 4px;
}
.verse-num::before { transform: rotate(45deg); }
.verse-header-title {
  font-size: .8rem; color: #93AF97; letter-spacing: .05em;
  flex: 1;
}
/* أزرار نسخ/مشاركة الآية (تُحقَن بالجافاسكربت) */
.verse-actions { display: inline-flex; gap: 6px; }
.va-btn {
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(205,169,75,.3);
  color: var(--gold-light);
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.va-btn:hover { background: rgba(205,169,75,.2); }
.va-btn svg { width: 15px; height: 15px; display: block; }

.verse-arabic {
  font-family: 'Scheherazade New', 'Amiri Quran', 'Amiri', serif;
  font-size: calc(1.7rem * var(--fs-scale));
  line-height: 2.4;
  text-align: center;
  padding: 30px 34px 26px;
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 100% at 50% 0%, rgba(205,169,75,.07) 0%, transparent 70%),
    var(--bg-verse);
  border-bottom: 1px solid var(--divider-soft);
}
.verse-body { padding: 24px 28px; }

/* ===== TAFSIR TABS ===== */
.tafsir-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--divider);
}
.tab-btn {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  color: var(--ink-soft);
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-family: 'Cairo', sans-serif;
  font-size: .84rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.tab-btn.active {
  background: var(--green-mid);
  border-color: var(--green-mid);
  color: #F6F1E2;
  box-shadow: 0 3px 10px rgba(30,90,69,.35);
}
.tab-btn:hover:not(.active) { background: var(--green-light); color: var(--green-mid); border-color: var(--green-mid); }
html[data-theme="dark"] .tab-btn:hover:not(.active) { color: var(--gold-dark); border-color: var(--gold-mid); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panelIn .3s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.tafsir-text {
  font-family: 'Amiri', serif;
  font-size: calc(1.05rem * var(--fs-scale));
  line-height: 2.15;
  color: var(--ink);
}
.tafsir-text p { margin-bottom: 14px; }
.tafsir-text strong { color: var(--green-mid); }
html[data-theme="dark"] .tafsir-text strong { color: var(--gold-dark); }
/* اسم العالم — بأحمر الرُّبريكا كعادة النُسّاخ */
.tafsir-text .scholar-name {
  display: inline-block;
  background: var(--rubric-pale);
  color: var(--rubric);
  border: 1px solid rgba(162,62,44,.25);
  border-radius: 8px;
  padding: 0 10px;
  font-size: .82em;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  vertical-align: 2px;
  margin: 0 2px;
}

.hadith-box {
  background: var(--gold-pale);
  border: 1px solid rgba(176,138,30,.35);
  border-right: 4px solid var(--gold-mid);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 18px 0 6px;
  font-size: calc(.98rem * var(--fs-scale));
  line-height: 2;
}
.hadith-box .hadith-label {
  font-family: 'Cairo', sans-serif;
  font-size: .74rem; font-weight: 700;
  color: var(--rubric);
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.tadabbur-box {
  background: var(--green-light);
  border: 1px solid rgba(30,90,69,.25);
  border-right: 4px solid var(--green-mid);
  border-radius: 12px;
  padding: 18px 22px;
}
.tadabbur-box .td-label {
  font-family: 'Cairo', sans-serif;
  font-size: .78rem; font-weight: 700;
  color: var(--green-mid);
  margin-bottom: 8px;
}
html[data-theme="dark"] .tadabbur-box .td-label { color: var(--gold-dark); }
.tadabbur-box p {
  font-family: 'Amiri', serif;
  font-size: calc(1rem * var(--fs-scale));
  line-height: 2.1;
  color: var(--ink);
  margin: 0;
}

/* ===== SUMMARY CARD ===== */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 32px 34px;
  box-shadow: 0 4px 22px var(--shadow-warm);
  position: relative;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-light), var(--gold-mid));
}
.summary-card h3 {
  font-family: 'Amiri', serif; font-size: 1.35rem;
  color: var(--green-mid); margin-bottom: 16px;
}
html[data-theme="dark"] .summary-card h3 { color: var(--gold-dark); }
.summary-card p, .summary-card li {
  font-family: 'Amiri', serif;
  font-size: calc(1.02rem * var(--fs-scale));
  line-height: 2.1; margin-bottom: 12px;
}
.summary-card strong { color: var(--green-mid); }
html[data-theme="dark"] .summary-card strong { color: var(--gold-dark); }
.summary-card ul { padding-right: 24px; margin-bottom: 16px; }
.summary-card li { margin-bottom: 8px; padding-right: 8px; }
.summary-card li::marker { color: var(--gold-mid); }
.highlight-quote {
  background: var(--bg-verse);
  border: 1px solid var(--divider-soft);
  border-right: 3px solid var(--rubric);
  border-radius: 10px;
  padding: 12px 18px;
  margin: 10px 0;
  font-family: 'Amiri', serif;
  font-size: calc(.98rem * var(--fs-scale));
  line-height: 2;
}

/* ===== FOOTER NAV ===== */
.page-footer-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--divider);
}
.nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-mid);
  color: #F6F1E2;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: 'Cairo', sans-serif;
  font-size: .88rem; font-weight: 600;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 3px 12px rgba(30,90,69,.3);
}
.nav-btn:hover { background: var(--chrome); color: var(--gold-light); transform: translateY(-2px); }
.nav-btn.disabled { background: var(--divider); color: var(--ink-soft); cursor: not-allowed; pointer-events: none; box-shadow: none; }
html[data-theme="dark"] .nav-btn[style] { background: var(--green-mid) !important; }
.page-indicator {
  font-family: 'Amiri', serif; font-size: 1.1rem;
  color: var(--ink-soft); text-align: center;
}
.page-indicator span {
  display: block; font-size: .75rem; color: var(--gold-mid);
  font-family: 'Cairo', sans-serif; margin-top: 2px;
}

/* ===== SITE FOOTER ===== */
.site-footer {
  background:
    radial-gradient(ellipse 80% 100% at 50% 120%, rgba(205,169,75,.1) 0%, transparent 60%),
    linear-gradient(180deg, var(--chrome-2) 0%, var(--chrome-3) 100%);
  text-align: center;
  padding: 44px 24px 90px;
  color: var(--on-chrome);
  font-size: .85rem;
  border-top: 3px solid var(--gold-mid);
}
.site-footer .footer-verse {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 1.35rem;
  color: var(--gold-light);
  margin-bottom: 10px;
  line-height: 2;
}

/* ===== INDEX PAGE ===== */
.index-hero { padding: 60px 40px 50px; }
.index-hero .hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #F6F1E2; margin-bottom: 10px;
  opacity: 0; animation: fadeUp .9s .2s forwards;
}
.surahs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 14px;
}
.surah-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-verse);
  border: 1px solid var(--divider-soft);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.surah-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow-warm); border-color: var(--gold-light); }
.surah-card .sc-num {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  font-family: 'Amiri', serif; font-size: .95rem; font-weight: 700;
  color: var(--gold-dark);
}
.surah-card .sc-num::before, .surah-card .sc-num::after {
  content: '';
  position: absolute; inset: 5px;
  border: 1.3px solid var(--gold-light);
  border-radius: 4px;
}
.surah-card .sc-num::before { transform: rotate(45deg); }
.surah-card .sc-info { flex: 1; min-width: 0; }
.surah-card .sc-name {
  font-family: 'Amiri', serif; font-size: 1.18rem;
  color: var(--ink); font-weight: 700;
}
.surah-card:hover .sc-name { color: var(--gold-dark); }
.surah-card .sc-meta { font-size: .74rem; color: var(--ink-soft); margin-top: 2px; }
.surah-card .sc-type {
  font-size: .68rem; font-weight: 700;
  border-radius: 10px; padding: 2px 9px;
  flex-shrink: 0;
}
.sc-type.makki  { background: var(--gold-pale);  color: var(--gold-dark);  border: 1px solid rgba(176,138,30,.4); }
.sc-type.madani { background: var(--green-light); color: var(--green-mid); border: 1px solid rgba(30,90,69,.35); }
html[data-theme="dark"] .sc-type.madani { color: #8FC4A8; }
/* شارة «قريباً» المضمَّنة inline */
html[data-theme="dark"] .surah-card .sc-type[style] {
  background: #1A2620 !important; color: #5E6F64 !important; border-color: #2C3E33 !important;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.filter-btn {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-verse);
  border: 1px solid var(--divider);
  color: var(--ink-soft);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Cairo', sans-serif;
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.filter-btn.active { background: var(--green-mid); color: #F6F1E2; border-color: var(--green-mid); }
.filter-btn:hover:not(.active) { border-color: var(--gold-light); color: var(--gold-dark); }
.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-verse);
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-family: 'Cairo', sans-serif;
  font-size: .88rem;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--ink-soft); opacity: .7; }
.search-input:focus { border-color: var(--gold-light); box-shadow: 0 0 0 3px rgba(205,169,75,.15); }

/* ===== PROGRESS ===== */
.progress-bar-wrap {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 18px 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 12px var(--shadow-warm);
}
.progress-bar-track {
  flex: 1; height: 9px;
  background: var(--divider-soft);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-light));
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(205,169,75,.5);
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.progress-text { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; }
.progress-count { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--gold-dark); font-weight: 700; }

/* ===== متابعة القراءة (تُحقَن) ===== */
.continue-card {
  display: flex; align-items: center; gap: 16px;
  background:
    radial-gradient(ellipse 60% 120% at 100% 50%, rgba(205,169,75,.12) 0%, transparent 60%),
    linear-gradient(135deg, var(--chrome) 0%, var(--chrome-2) 100%);
  border: 1px solid rgba(205,169,75,.3);
  border-radius: var(--radius-card);
  padding: 18px 24px;
  margin-bottom: 22px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(7,26,21,.3);
}
.continue-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(7,26,21,.4); }
.continue-card .cc-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 1.5px solid var(--gold-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.continue-card .cc-info { flex: 1; min-width: 0; }
.continue-card .cc-label {
  font-family: 'Cairo', sans-serif;
  font-size: .72rem; font-weight: 700;
  color: var(--gold-light);
  letter-spacing: .08em;
  margin-bottom: 2px;
}
.continue-card .cc-title {
  font-family: 'Amiri', serif;
  font-size: 1.15rem; font-weight: 700;
  color: #F6F1E2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue-card .cc-arrow { color: var(--gold-light); font-size: 1.3rem; flex-shrink: 0; }

/* ===== آية اليوم (تُحقَن) ===== */
.verse-of-day {
  background: var(--bg-verse);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 26px 30px;
  margin-bottom: 26px;
  text-align: center;
  position: relative;
  box-shadow: 0 3px 16px var(--shadow-warm);
  overflow: hidden;
}
.verse-of-day::before {
  content: '';
  position: absolute; inset: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--rubric), transparent);
}
.verse-of-day .vod-label {
  font-family: 'Cairo', sans-serif;
  font-size: .74rem; font-weight: 700;
  color: var(--rubric);
  letter-spacing: .1em;
  margin-bottom: 12px;
}
.verse-of-day .vod-text {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 2.3;
  color: var(--ink);
  margin-bottom: 10px;
}
.verse-of-day .vod-ref {
  display: inline-block;
  font-family: 'Cairo', sans-serif;
  font-size: .8rem; font-weight: 600;
  color: var(--gold-dark);
  text-decoration: none;
  border-bottom: 1px dashed var(--gold-light);
  transition: color var(--transition);
}
.verse-of-day .vod-ref:hover { color: var(--rubric); }

/* ===== شريط تقدم القراءة (أعلى صفحات السور) ===== */
#reading-progress {
  position: fixed;
  top: 0; right: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-light));
  z-index: 300;
  box-shadow: 0 0 8px rgba(205,169,75,.6);
}

/* ===== زر العودة لأعلى ===== */
#back-to-top {
  position: fixed;
  bottom: 92px;
  right: 18px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--chrome);
  border: 1px solid rgba(205,169,75,.4);
  color: var(--gold-light);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 190;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
}
#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: var(--green-mid); }

/* ===== Toast ===== */
#dia-toast {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--chrome);
  color: var(--gold-light);
  border: 1px solid rgba(205,169,75,.4);
  border-radius: var(--radius-pill);
  padding: 9px 22px;
  font-family: 'Cairo', sans-serif;
  font-size: .84rem; font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
  z-index: 400;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  white-space: nowrap;
}
#dia-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===== ABOUT PAGE ===== */
.about-section { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.scholar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-top: 20px;
}
.scholar-card {
  background: var(--bg-verse);
  border: 1px solid var(--divider-soft);
  border-radius: 14px;
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.scholar-card::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 44px; height: 44px;
  background: radial-gradient(circle at 100% 0%, var(--gold-pale) 0%, transparent 70%);
}
.scholar-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow-warm); }
.scholar-card h4 { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--green-mid); margin-bottom: 6px; }
html[data-theme="dark"] .scholar-card h4 { color: var(--gold-dark); }
.scholar-card p { font-size: .83rem; color: var(--ink-soft); line-height: 1.7; }
.scholar-card .years {
  font-size: .73rem; color: var(--rubric); font-weight: 700;
  margin-bottom: 8px;
  display: inline-block;
  text-decoration: none !important;
  border: none !important;
}

/* ===== COMING SOON ===== */
.coming-soon { text-align: center; padding: 70px 20px; }
.coming-soon .cs-icon { font-size: 3rem; margin-bottom: 16px; }
.coming-soon h2 { font-family: 'Amiri', serif; font-size: 1.7rem; color: var(--green-mid); margin-bottom: 10px; }
html[data-theme="dark"] .coming-soon h2 { color: var(--gold-dark); }
.coming-soon p { color: var(--ink-soft); margin-bottom: 18px; }
.coming-soon .cs-ayah {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 1.4rem; color: var(--gold-dark);
  margin-bottom: 26px;
}
.coming-soon .back-btn {
  display: inline-block;
  background: var(--green-mid); color: #F6F1E2;
  text-decoration: none;
  padding: 11px 26px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .9rem;
  transition: background var(--transition);
}
.coming-soon .back-btn:hover { background: var(--chrome); color: var(--gold-light); }

/* ===== FADE-IN ===== */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ===== GLOBAL SEARCH WIDGET ===== */
#global-search-fab {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(620px, calc(100vw - 32px));
}
#global-search-bar {
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(180deg, rgba(17,56,44,.96) 0%, rgba(11,38,32,.96) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(205,169,75,.45);
  border-radius: 50px;
  padding: 11px 18px 11px 14px;
  box-shadow:
    0 12px 40px rgba(0,0,0,.42),
    0 2px 8px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(205,169,75,.18);
  cursor: text;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
#global-search-bar:focus-within {
  border-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow:
    0 16px 48px rgba(0,0,0,.48),
    0 0 0 3px rgba(205,169,75,.22),
    inset 0 1px 0 rgba(205,169,75,.25);
}
#global-search-icon {
  color: var(--gold-light);
  flex-shrink: 0;
  display: inline-flex;
  filter: drop-shadow(0 0 6px rgba(205,169,75,.5));
}
#global-search-icon svg { width: 18px; height: 18px; }
#global-search-input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: #F6F1E2;
  font-family: 'Cairo', sans-serif;
  /* 16px على الأقل — أقل من كده يخلي iOS يعمل zoom تلقائي عند التركيز */
  font-size: max(16px, .93rem);
  direction: rtl;
}
#global-search-bar { touch-action: manipulation; }
#global-search-input::placeholder { color: rgba(186,207,190,.55); }
#global-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
#global-search-kbd {
  flex-shrink: 0;
  font-family: 'Cairo', sans-serif;
  font-size: .72rem; font-weight: 700;
  color: rgba(205,169,75,.75);
  border: 1px solid rgba(205,169,75,.35);
  border-radius: 7px;
  padding: 1px 8px 2px;
  background: rgba(205,169,75,.08);
}
@media (hover: none) { #global-search-kbd { display: none; } }

#global-search-results {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 18px;
  box-shadow: 0 -12px 48px rgba(0,0,0,.25);
  max-height: 58vh;
  overflow-y: auto; overflow-x: hidden;
}
#global-search-results.open { display: block; animation: gsrIn .22s cubic-bezier(.3,1.2,.4,1); }
@keyframes gsrIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.gsr-header {
  padding: 12px 18px 9px;
  font-family: 'Cairo', sans-serif;
  font-size: .76rem; font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: .03em;
  border-bottom: 1px solid var(--divider-soft);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
  background: var(--panel);
  z-index: 1;
}
.gsr-header .gsr-close {
  cursor: pointer; color: var(--ink-soft);
  font-size: 1rem; padding: 2px 8px;
  border-radius: 6px; border: none; background: transparent;
  transition: color var(--transition), background var(--transition);
}
.gsr-header .gsr-close:hover { color: var(--rubric); background: var(--rubric-pale); }

.gsr-item {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider-soft);
  border-right: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.gsr-item:last-child { border-bottom: none; }
.gsr-item:hover, .gsr-item.kb-active {
  background: var(--gold-pale);
  border-right-color: var(--gold-mid);
}
.gsr-item-soon { opacity: .55; cursor: default; }
.gsr-item-soon:hover { background: transparent; border-right-color: transparent; }

/* مقتطف البحث النصي — الآية بالتشكيل بخط المصحف، متمركزة */
.gsr-snippet {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 1.22rem;
  line-height: 2.5;
  color: var(--ink);
  direction: rtl;
  text-align: center;
  margin-bottom: 6px;
}
/* تمييز الكلمة المطابقة — وسادة ذهبية متمركزة على الكلمة نفسها */
.gsr-mark {
  background: rgba(205, 169, 75, .32);
  color: var(--gold-dark);
  border-radius: 8px;
  padding: 1px 7px 3px;
  margin: 0 1px;
  box-shadow: inset 0 0 0 1px rgba(176, 138, 30, .35);
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
html[data-theme="dark"] .gsr-mark {
  background: rgba(199, 162, 59, .26);
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px rgba(214, 182, 94, .4);
}

/* نص آية كامل (البحث الرقمي) — بخط المصحف */
.gsr-verse {
  font-family: 'Scheherazade New', 'Amiri', serif !important;
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 2.6;
  color: var(--ink);
  direction: rtl;
  margin-bottom: 5px;
}
.gsr-pending { color: var(--ink-soft); font-size: .8rem; font-family: 'Cairo', sans-serif !important; min-height: 1.2em; }

.gsr-meta {
  font-family: 'Cairo', sans-serif;
  font-size: .73rem; color: var(--ink-soft);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.gsr-surah-badge {
  background: var(--green-light); color: var(--green-mid);
  border-radius: 10px; padding: 1px 9px; font-weight: 700;
}
html[data-theme="dark"] .gsr-surah-badge { color: #8FC4A8; }
.gsr-more {
  padding: 12px 18px;
  font-family: 'Cairo', sans-serif;
  font-size: .78rem; font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  background: var(--bg-card);
}
.gsr-empty {
  padding: 30px 18px 26px;
  text-align: center;
  font-family: 'Amiri', serif; font-size: 1.02rem;
  color: var(--ink-soft);
}
.gsr-empty .gsr-empty-icon {
  display: block;
  font-size: 1.7rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.gsr-empty small {
  display: block;
  margin-top: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: .78rem;
  opacity: .8;
}
.gsr-done-badge {
  background: var(--green-light); color: var(--green-mid);
  border: 1px solid rgba(30,90,69,.3);
  border-radius: 10px; padding: 1px 7px;
  font-size: .68rem; font-weight: 700;
  font-family: 'Cairo', sans-serif;
}
html[data-theme="dark"] .gsr-done-badge { color: #8FC4A8; }
.gsr-soon-badge {
  background: var(--bg-card); color: var(--ink-soft);
  border: 1px solid var(--divider);
  border-radius: 10px; padding: 1px 7px;
  font-size: .68rem; font-weight: 600;
  font-family: 'Cairo', sans-serif;
}

/* ===== فاصل الخاتم الزخرفي ===== */
.khatam-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 34px 0 28px;
}
.khatam-divider .kd-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light));
}
.khatam-divider .kd-line-l {
  background: linear-gradient(270deg, transparent, var(--gold-light));
}
.khatam-divider .kd-star {
  color: var(--gold-mid);
  font-size: 1.5rem;
  line-height: 1;
  text-shadow: 0 0 14px rgba(205,169,75,.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 680px) {
  .site-header { padding: 11px 16px; }
  .site-header .logo { font-size: 1.18rem; }
  .site-header nav { gap: 12px; }
  .site-header nav a { font-size: .78rem; }
  .ht-btn { width: 31px; height: 31px; }

  .hero { padding: 50px 20px 44px; }
  .hero::after { inset: 9px; }
  .breadcrumb { padding: 12px 16px; }
  .main-container { padding: 32px 14px 80px; }
  .surah-title-card { padding: 34px 20px; }
  .verse-arabic { padding: 24px 18px 20px; font-size: calc(1.4rem * var(--fs-scale)); }
  .verse-body { padding: 18px 16px; }
  .summary-card { padding: 24px 18px; }
  .intro-card { padding: 20px 18px; }

  .surah-nav-bar { top: 54px; padding: 0 12px; }
  .surah-nav-bar a { padding: 10px 10px; font-size: .8rem; }
  .surah-nav-bar .snb-label { display: none; }

  .page-footer-nav { flex-direction: column; align-items: stretch; text-align: center; }
  .page-footer-nav > div[style] { align-items: center !important; }
  .nav-btn { justify-content: center; }

  #global-search-fab { bottom: 14px; width: calc(100vw - 20px); }
  #global-search-bar { padding: 9px 12px 9px 16px; }
  #global-search-input { font-size: .85rem; }
  #back-to-top { bottom: 78px; right: 12px; width: 38px; height: 38px; }
  #dia-toast { bottom: 76px; }

  .continue-card { padding: 14px 16px; }
  .verse-of-day { padding: 20px 16px; }
}

@media (max-width: 460px) {
  .site-header { padding: 10px 10px; gap: 8px; }
  .site-header .logo { font-size: 1.05rem; gap: 6px; }
  .site-header .logo::before { width: 13px; height: 13px; }
  .site-header nav { gap: 9px; }
  .site-header nav a { font-size: .73rem; }
  .site-header nav a:nth-child(3) { display: none; }
  .ht-btn { width: 29px; height: 29px; }
  .header-tools { gap: 5px; }
}

/* ===== الموشن: انتقالات الصفحات + الظهور التدريجي ===== */
@media (prefers-reduced-motion: no-preference) {

  /* دخول الصفحة — أنيميشن CSS خالص، لا يعتمد على الجافاسكربت إطلاقاً */
  body { animation: pageEnter .5s ease backwards; }
  @keyframes pageEnter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
  /* مغادرة الصفحة */
  html.page-leave body {
    opacity: 0; transform: translateY(-5px);
    transition: opacity .2s ease, transform .2s ease;
  }

  /* الظهور التدريجي عند التمرير (تُدار بالجافاسكربت — آمنة الفشل) */
  .reveal-init {
    opacity: 0;
    transform: translateY(22px);
  }
  .reveal-init.revealed {
    opacity: 1;
    transform: none;
    transition: opacity .65s cubic-bezier(.22,.8,.36,1), transform .65s cubic-bezier(.22,.8,.36,1);
  }

  /* وميض ذهبي بطيء على سَفيفة التذهيب العلوية */
  .top-border {
    background-size: 220% 100%;
    animation: borderSheen 9s linear infinite;
  }
  @keyframes borderSheen {
    from { background-position: 0% 0; }
    to   { background-position: 220% 0; }
  }

  /* نبض معيَّنة الزخرفة */
  .ornament-diamond { animation: diamondPulse 3.2s ease-in-out infinite; }
  @keyframes diamondPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(205,169,75,.55); }
    50%      { box-shadow: 0 0 22px rgba(205,169,75,.95); }
  }

  /* وهج عند الوصول لآية عبر رابط */
  .verse-card:target { animation: targetGlow 1.6s ease 1; }
  @keyframes targetGlow {
    0%   { box-shadow: 0 0 0 6px rgba(205,169,75,.45); }
    100% { box-shadow: 0 0 0 3px rgba(205,169,75,.25); }
  }

  /* لمعة تمر على بطاقة السورة عند المرور */
  .surah-card { overflow: hidden; }
  .surah-card::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 55%;
    right: -80%;
    background: linear-gradient(105deg, transparent 0%, rgba(205,169,75,.14) 50%, transparent 100%);
    transform: skewX(-18deg);
    transition: right .55s ease;
    pointer-events: none;
  }
  .surah-card:hover::after { right: 130%; }

  /* ضغطة الأزرار */
  .nav-btn:active, .tab-btn:active, .filter-btn:active, .ht-btn:active, .va-btn:active {
    transform: scale(.96);
  }
}

/* ===== بطاقة مميزة (آية الكرسي / آية الدَّين / الخواتيم) ===== */
.verse-card-featured {
  border: 1.5px solid var(--gold-light);
  box-shadow:
    0 0 0 4px rgba(205,169,75,.12),
    0 8px 34px rgba(138,107,18,.22);
  position: relative;
}
html[data-theme="dark"] .verse-card-featured {
  box-shadow: 0 0 0 4px rgba(205,169,75,.1), 0 8px 34px rgba(0,0,0,.5);
}
.verse-card-featured .verse-header {
  background:
    radial-gradient(ellipse 70% 130% at 50% -30%, rgba(205,169,75,.22) 0%, transparent 60%),
    linear-gradient(180deg, var(--chrome) 0%, var(--chrome-2) 100%);
}
.verse-card-featured .verse-arabic {
  background:
    radial-gradient(ellipse 70% 100% at 50% 0%, rgba(205,169,75,.12) 0%, transparent 70%),
    var(--bg-verse);
}

/* ===== معاني كلمات الآية — داخل تبويب الجامع ===== */
.wm-sec {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--gold-light);
}
.wm-sec-title {
  font-family: 'Cairo', sans-serif;
  font-size: calc(.82rem * var(--fs-scale));
  font-weight: 800;
  color: var(--gold-dark);
  letter-spacing: .02em;
  margin-bottom: 10px;
}
.wm-line {
  margin: 0 0 8px !important;
  line-height: 2.1;
}
.wm-line .wm-w {
  color: var(--green-mid);
  font-weight: 700;
}
html[data-theme="dark"] .wm-line .wm-w { color: #8FC4A8; }

/* ===== نافذة التبليغ عن خطأ ===== */
.report-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 30, 24, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 400;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.report-overlay.open { display: flex; animation: gsrIn .2s ease; }
.report-modal {
  background: var(--panel);
  border: 1px solid var(--gold-light);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
  width: min(480px, 100%);
  overflow: hidden;
}
.report-head {
  background: linear-gradient(180deg, var(--chrome) 0%, var(--chrome-2) 100%);
  color: #F6F1E2;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 8px;
}
.report-body { padding: 16px 18px 18px; }
.report-ref {
  font-family: 'Cairo', sans-serif;
  font-size: .78rem; font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold-pale);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 6px 12px;
  display: inline-block;
  margin-bottom: 12px;
}
.report-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Cairo', sans-serif;
  font-size: max(16px, .88rem);
  color: var(--ink);
  direction: rtl;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.report-textarea:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(205,169,75,.18);
}
.report-actions {
  display: flex; gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.report-btn {
  appearance: none; -webkit-appearance: none;
  border: none; cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-weight: 700; font-size: .85rem;
  border-radius: 12px;
  padding: 9px 18px;
  transition: transform var(--transition), background var(--transition);
}
.report-btn:active { transform: scale(.97); }
.report-btn-primary {
  background: linear-gradient(180deg, var(--green-mid), var(--green-dark));
  color: #F6F1E2;
  box-shadow: 0 4px 14px rgba(20,60,45,.35);
}
.report-btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--divider);
}
.report-btn-ghost:hover { background: var(--bg-card); }

/* ===== قائمة اللغات ===== */
.lang-wrap { position: relative; display: inline-flex; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0,0,0,.25);
  padding: 6px;
  display: none;
  min-width: 170px;
  z-index: 300;
}
.lang-menu.open { display: block; animation: gsrIn .18s ease; }
.lang-menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  font-family: 'Cairo', sans-serif;
  font-size: .83rem; font-weight: 600;
  transition: background var(--transition);
}
.lang-menu a:hover { background: var(--gold-pale); }
.lang-menu .lm-note {
  font-size: .66rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 6px 8px 4px;
  border-top: 1px dashed var(--divider-soft);
  margin-top: 4px;
}

/* ===== PRINT ===== */
@media print {
  .site-header, .surah-nav-bar, #global-search-fab, #back-to-top,
  .page-footer-nav, .site-footer, .header-tools, .verse-actions,
  #reading-progress, .top-border { display: none !important; }
  body { background: #fff; color: #000; }
  .verse-card, .intro-card, .summary-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tab-panel { display: block !important; border-top: 1px dashed #ccc; padding-top: 10px; margin-top: 10px; }
  .tafsir-tabs { display: none; }
  .verse-header { background: #eee !important; color: #000; }
  .hero { background: none; color: #000; padding: 20px; }
  .hero-basmala, .hero-title { color: #000; text-shadow: none; }
}

/* ===== صفحة المتشابهات ===== */
.ms-quote {
  background: var(--bg-verse);
  border: 1px solid var(--divider-soft);
  border-right: 3px solid var(--gold-mid);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ms-label {
  font-family: 'Cairo', sans-serif;
  font-size: .72rem; font-weight: 800;
  color: var(--gold-dark);
  margin-bottom: 6px;
}
.ms-verse {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: calc(1.18rem * var(--fs-scale));
  line-height: 2.4;
  color: var(--ink);
  text-align: center;
}
.ms-verse .ms-diff {
  background: rgba(205, 169, 75, .3);
  color: var(--gold-dark);
  border-radius: 7px;
  padding: 1px 6px 3px;
  box-shadow: inset 0 0 0 1px rgba(176,138,30,.3);
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
html[data-theme="dark"] .ms-verse .ms-diff {
  background: rgba(199,162,59,.24);
  color: var(--gold-light);
}
.ms-ref {
  font-family: 'Cairo', sans-serif;
  font-size: .74rem; font-weight: 700;
  color: var(--green-mid);
  text-align: left;
  margin-top: 4px;
}
html[data-theme="dark"] .ms-ref { color: #8FC4A8; }
.ms-dabit {
  background: var(--gold-pale);
  border: 1px dashed var(--gold-light);
  border-radius: 12px;
  padding: 13px 16px;
  margin: 14px 0;
}
.ms-dabit-label {
  font-family: 'Cairo', sans-serif;
  font-size: .76rem; font-weight: 800;
  color: var(--gold-dark);
  margin-bottom: 5px;
}
.ms-dabit p { margin: 0 !important; }
