/* ============================================================================
 * ibn-thani-pro.css — v3.1.0 Pro additions
 * ----------------------------------------------------------------------------
 *  • Tafseer surah grid (يصلح صفحة tafseer-6.html)
 *  • Visual differentiation: تلاوة (ذهبي) vs تفسير (فيروزي)
 *  • Tools modals (8 أدوات)
 *  • Smart bottom-nav v3
 *  • Khatma card + detail modal
 *  • Hijri bar
 *  • Premium footer
 *  • Section cards (الكتب + الأقسام + إصدارات المصاحف)
 *  • Mini-player shrink (تقليل ارتفاع المشغّل)
 *
 * يُحمَّل بعد quran-interface.css ويوسّعه — لا يستبدله.
 * ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   0) Design tokens v3 — توسيع التوكنات الموجودة
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --q-teal:        #4A9D9C;   /* لون التفسير الجديد */
  --q-teal-soft:   rgba(74, 157, 156, 0.10);
  --q-teal-border: rgba(74, 157, 156, 0.32);
  --q-teal-glow:   rgba(74, 157, 156, 0.40);
  --q-gold-strong: #d4a574;
  --q-gold-deep:   #b48a48;
  --q-gold-soft:   rgba(229, 192, 122, 0.12);
  --q-shadow-soft: 0 2px 10px rgba(7, 29, 56, 0.06);
  --q-shadow-card: 0 4px 18px rgba(7, 29, 56, 0.08);
  --q-shadow-pop:  0 12px 38px rgba(7, 29, 56, 0.22);
  --q-radius-card: 18px;
  --q-radius-sm:   10px;
  --q-radius-pill: 999px;
  --q-ease:        cubic-bezier(.22, 1, .36, 1);
}

/* ──────────────────────────────────────────────────────────────────────────
   1) Hijri bar (شريط التاريخ الهجري في النافبار)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-hijri-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(229,192,122,0.18), rgba(229,192,122,0.08));
  border: 1px solid rgba(229,192,122,0.28);
  border-radius: var(--q-radius-pill);
  color: #f3d99a;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.ibn-hijri-bar::before {
  content: '🌙';
  font-size: 0.95em;
}
@media (max-width: 720px) {
  .ibn-hijri-bar { font-size: 0.72rem; padding: 4px 10px; }
  .ibn-hijri-bar::before { font-size: 0.8em; }
}

/* ──────────────────────────────────────────────────────────────────────────
   2) Tafseer surah grid (إصلاح صفحة التفسير)
   ────────────────────────────────────────────────────────────────────────── */
.tafseer-index-page {
  margin: 0 auto;
  max-width: 1200px;
  padding: 24px 16px 40px;
}
.tafseer-index-control {
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.08);
  border-radius: var(--q-radius-card);
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: var(--q-shadow-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tafseer-index-control label {
  font-weight: 600;
  color: var(--q-navy, #071d38);
  font-size: 0.95rem;
}
.tafseer-index-control select {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: var(--q-radius-sm);
  border: 1px solid rgba(7, 29, 56, 0.12);
  background: #fffdf8;
  font-size: 0.95rem;
  color: var(--q-navy, #071d38);
}
.tafseer-index-filter {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: var(--q-radius-sm);
  border: 1px solid rgba(7, 29, 56, 0.12);
  background: #fffdf8;
  font-size: 0.95rem;
}

.tafseer-surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tafseer-surah-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(74, 157, 156, 0.18);
  border-radius: var(--q-radius-card);
  text-decoration: none;
  color: var(--q-navy, #071d38);
  box-shadow: var(--q-shadow-soft);
  transition: transform 0.2s var(--q-ease), box-shadow 0.2s var(--q-ease), border-color 0.2s var(--q-ease);
  overflow: hidden;
}
.tafseer-surah-card::before {
  content: '';
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--q-teal), rgba(74,157,156,0.4));
  border-radius: 999px;
}
.tafseer-surah-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(74, 157, 156, 0.22);
  border-color: var(--q-teal);
}
.tafseer-surah-card .tafseer-surah-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--q-teal-soft);
  color: var(--q-teal);
  font-weight: 700;
  font-size: 0.95rem;
  flex: 0 0 auto;
}
.tafseer-surah-card .tafseer-surah-body {
  flex: 1;
  min-width: 0;
}
.tafseer-surah-card .tafseer-surah-name {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--q-navy, #071d38);
  margin-bottom: 2px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.tafseer-surah-card .tafseer-surah-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: rgba(7, 29, 56, 0.62);
}
.tafseer-surah-card .tafseer-surah-decoration {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--q-teal);
  opacity: 0.55;
  transition: transform 0.3s var(--q-ease), opacity 0.2s var(--q-ease);
}
.tafseer-surah-card:hover .tafseer-surah-decoration {
  opacity: 1;
  transform: rotate(6deg);
}

@media (max-width: 560px) {
  .tafseer-surah-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
  .tafseer-surah-card { padding: 12px 12px; }
  .tafseer-surah-card .tafseer-surah-name { font-size: 0.92rem; }
  .tafseer-surah-card .tafseer-surah-num { min-width: 30px; height: 30px; font-size: 0.85rem; }
}

/* ──────────────────────────────────────────────────────────────────────────
   3) التمييز البصري: المصحف ذهبي / التفسير فيروزي
   ────────────────────────────────────────────────────────────────────────── */
/* بطاقة المصحف (تلاوة) — تبقى ذهبية كما هي + لمسة موجة صوتية */
.quran-card .surah-decoration-icon {
  color: var(--q-gold-strong);
}

/* بطاقة التفسير */
body.is-tafseer-page .surah-card-name {
  color: var(--q-navy, #071d38);
}
body.is-tafseer-page .quran-card {
  border-left: 3px solid var(--q-teal);
}

/* ──────────────────────────────────────────────────────────────────────────
   4) Section cards (بطاقات الأقسام في الرئيسية)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  padding: 4px 0;
}
.ibn-section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 20px;
  background: linear-gradient(180deg, #fffdf6 0%, #fff8e7 100%);
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-card);
  text-decoration: none;
  color: var(--q-navy, #071d38);
  box-shadow: var(--q-shadow-soft);
  transition: transform 0.25s var(--q-ease), box-shadow 0.25s var(--q-ease);
  overflow: hidden;
}
.ibn-section-card::after {
  content: '';
  position: absolute;
  top: -20%;
  inset-inline-end: -20%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(229, 192, 122, 0.4), transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s var(--q-ease);
}
.ibn-section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(180, 138, 72, 0.22);
}
.ibn-section-card:hover::after { opacity: 1; }
.ibn-section-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b2447, #071d38);
  color: var(--q-gold-strong);
  box-shadow: 0 6px 16px rgba(7, 29, 56, 0.18);
  position: relative;
  z-index: 1;
}
.ibn-section-card-icon svg { width: 26px; height: 26px; }
.ibn-section-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--q-navy, #071d38);
  position: relative;
  z-index: 1;
}
.ibn-section-card-desc {
  font-size: 0.82rem;
  color: rgba(7, 29, 56, 0.62);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.ibn-section-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 4px 10px;
  background: var(--q-gold-soft);
  color: var(--q-gold-deep);
  border-radius: var(--q-radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ──────────────────────────────────────────────────────────────────────────
   5) Khatma card (في الرئيسية)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-khatma-card {
  background: linear-gradient(135deg, #fffdf6 0%, #fff5d8 100%);
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-card);
  padding: 28px;
  box-shadow: var(--q-shadow-card);
}
.ibn-khatma-empty {
  text-align: center;
  padding: 20px 10px;
}
.ibn-khatma-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 12px;
}
.ibn-khatma-empty h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--q-navy, #071d38);
}
.ibn-khatma-empty p {
  margin: 0 0 18px;
  color: rgba(7, 29, 56, 0.68);
  line-height: 1.6;
  font-size: 0.95rem;
}

.ibn-khatma-active {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "ring meta"
    "daily daily"
    "actions actions";
  gap: 20px 28px;
  align-items: center;
}
.ibn-khatma-ring-wrap {
  grid-area: ring;
  position: relative;
  width: 140px;
  height: 140px;
}
.ibn-khatma-ring {
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
}
.ibn-khatma-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ibn-khatma-percent {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--q-gold-deep);
  line-height: 1;
}
.ibn-khatma-percent span {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(180, 138, 72, 0.7);
}
.ibn-khatma-fraction {
  margin-top: 4px;
  font-size: 0.85rem;
  color: rgba(7, 29, 56, 0.7);
}
.ibn-khatma-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ibn-khatma-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(7, 29, 56, 0.08);
  font-size: 0.92rem;
}
.ibn-khatma-meta-row:last-child { border-bottom: 0; }
.ibn-khatma-meta-label {
  color: rgba(7, 29, 56, 0.62);
  font-size: 0.85rem;
}
.ibn-khatma-meta-value {
  font-weight: 700;
  color: var(--q-navy, #071d38);
}
.ibn-khatma-daily {
  grid-area: daily;
  padding: 14px 16px;
  background: rgba(229, 192, 122, 0.10);
  border-radius: var(--q-radius-sm);
  border: 1px solid rgba(229, 192, 122, 0.24);
}
.ibn-khatma-daily-label {
  font-weight: 700;
  color: var(--q-navy, #071d38);
  margin-bottom: 6px;
}
.ibn-khatma-daily-status .is-met {
  color: #15803d;
  font-weight: 700;
}
.ibn-khatma-daily-status .is-pending {
  color: rgba(7, 29, 56, 0.7);
}
.ibn-khatma-streak {
  margin-top: 8px;
  color: #c2410c;
  font-weight: 600;
  font-size: 0.92rem;
}
.ibn-khatma-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 620px) {
  .ibn-khatma-active {
    grid-template-columns: 1fr;
    grid-template-areas: "ring" "meta" "daily" "actions";
    justify-items: center;
    text-align: center;
  }
  .ibn-khatma-meta-row { width: 100%; }
}

/* ──────────────────────────────────────────────────────────────────────────
   6) Buttons (موحّدة عبر النظام)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--q-radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s var(--q-ease), box-shadow 0.2s var(--q-ease), background 0.2s var(--q-ease);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}
.ibn-btn svg { width: 18px; height: 18px; }
.ibn-btn-primary {
  background: linear-gradient(135deg, var(--q-gold-strong), var(--q-gold-deep));
  color: #fffdf6;
  box-shadow: 0 6px 18px rgba(180, 138, 72, 0.32);
}
.ibn-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(180, 138, 72, 0.42); }
.ibn-btn-ghost {
  background: #fff;
  border-color: rgba(7, 29, 56, 0.14);
  color: var(--q-navy, #071d38);
}
.ibn-btn-ghost:hover {
  background: rgba(7, 29, 56, 0.04);
  border-color: rgba(7, 29, 56, 0.24);
}
.ibn-btn-danger {
  background: #fff;
  border-color: rgba(220, 38, 38, 0.32);
  color: #dc2626;
}
.ibn-btn-danger:hover { background: rgba(220, 38, 38, 0.06); }
.ibn-btn-block { width: 100%; }
.ibn-btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* ──────────────────────────────────────────────────────────────────────────
   7) Tool Modal (Sheet)
   ────────────────────────────────────────────────────────────────────────── */
body.ibn-modal-open { overflow: hidden; }

.ibn-tool-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 19, 42, 0);
  backdrop-filter: blur(0);
  transition: background 0.25s ease, backdrop-filter 0.25s ease;
  padding: 20px;
}
.ibn-tool-overlay.is-open {
  background: rgba(4, 19, 42, 0.58);
  backdrop-filter: blur(8px);
}
.ibn-tool-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  background: linear-gradient(180deg, #fffdf6 0%, #fff8e7 100%);
  border-radius: 22px;
  border: 1px solid rgba(229, 192, 122, 0.4);
  box-shadow: var(--q-shadow-pop);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.32s var(--q-ease), opacity 0.25s ease;
  overflow: hidden;
}
.ibn-tool-overlay.is-open .ibn-tool-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.ibn-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(229, 192, 122, 0.22);
  background: linear-gradient(135deg, #0b2447, #071d38);
  color: #f3d99a;
}
.ibn-tool-title-wrap { display: inline-flex; align-items: center; gap: 12px; }
.ibn-tool-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(229, 192, 122, 0.12);
  border: 1px solid rgba(229, 192, 122, 0.32);
  color: var(--q-gold-strong);
}
.ibn-tool-title-icon svg { width: 20px; height: 20px; }
.ibn-tool-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.ibn-tool-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #f3d99a;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ibn-tool-close:hover { background: rgba(255, 255, 255, 0.16); }
.ibn-tool-close svg { width: 18px; height: 18px; }
.ibn-tool-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  color: var(--q-navy, #071d38);
}

@media (max-width: 560px) {
  .ibn-tool-overlay { padding: 0; align-items: flex-end; }
  .ibn-tool-sheet {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .ibn-tool-overlay.is-open .ibn-tool-sheet { transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────────────────────
   8) Form elements
   ────────────────────────────────────────────────────────────────────────── */
.ibn-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.ibn-field label {
  font-weight: 600;
  color: var(--q-navy, #071d38);
  font-size: 0.92rem;
}
.ibn-field-hint {
  font-size: 0.78rem;
  color: rgba(7, 29, 56, 0.55);
  margin-top: 2px;
}
.ibn-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--q-radius-sm);
  border: 1px solid rgba(7, 29, 56, 0.14);
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  color: var(--q-navy, #071d38);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ibn-input:focus {
  outline: none;
  border-color: var(--q-gold-strong);
  box-shadow: 0 0 0 3px rgba(229, 192, 122, 0.18);
}
.ibn-input-sm { padding: 7px 10px; font-size: 0.88rem; }

/* ──────────────────────────────────────────────────────────────────────────
   9) Spinner
   ────────────────────────────────────────────────────────────────────────── */
.ibn-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(229, 192, 122, 0.2);
  border-top-color: var(--q-gold-strong);
  border-radius: 50%;
  animation: ibn-spin 0.9s linear infinite;
  margin: 0 auto 14px;
}
@keyframes ibn-spin { to { transform: rotate(360deg); } }
.ibn-tool-loading { text-align: center; padding: 40px 0; color: rgba(7, 29, 56, 0.62); }

/* ──────────────────────────────────────────────────────────────────────────
  10) Tabs (داخل modals)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-zakat-tabs, .ibn-azkar-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(7, 29, 56, 0.05);
  border-radius: var(--q-radius-pill);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ibn-zakat-tabs::-webkit-scrollbar, .ibn-azkar-tabs::-webkit-scrollbar { display: none; }
.ibn-tab {
  flex: 1;
  min-width: max-content;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  border-radius: var(--q-radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(7, 29, 56, 0.62);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.ibn-tab.is-active {
  background: var(--q-navy, #071d38);
  color: var(--q-gold-strong);
}

/* ──────────────────────────────────────────────────────────────────────────
  11) Result blocks
   ────────────────────────────────────────────────────────────────────────── */
.ibn-result, .ibn-zakat-result > div, .ibn-age-result > div {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--q-radius-card);
  background: #fff;
  border: 1px solid rgba(229, 192, 122, 0.32);
}
.ibn-result-success { border-color: rgba(21, 128, 61, 0.32); background: rgba(21, 128, 61, 0.04); }
.ibn-result-info    { border-color: rgba(74, 157, 156, 0.32); background: rgba(74, 157, 156, 0.04); }
.ibn-result strong { display: block; font-size: 1.08rem; color: var(--q-navy, #071d38); margin-bottom: 8px; }
.ibn-result ul { margin: 8px 0; padding: 0 18px 0 0; list-style: none; }
.ibn-result li { margin-bottom: 4px; color: rgba(7, 29, 56, 0.78); font-size: 0.92rem; }
.ibn-result-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(7, 29, 56, 0.12);
  font-size: 0.82rem;
  color: rgba(7, 29, 56, 0.55);
  font-style: italic;
}

/* ──────────────────────────────────────────────────────────────────────────
  12) أداة القبلة — البوصلة
   ────────────────────────────────────────────────────────────────────────── */
.ibn-qibla-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ibn-compass-wrap {
  position: relative;
  width: 320px;
  max-width: 100%;
}
.ibn-compass { width: 100%; height: auto; display: block; }
.ibn-compass-wrap.is-aligned { filter: drop-shadow(0 0 14px rgba(74, 222, 128, 0.4)); }
.ibn-compass-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #f3d99a;
}
.ibn-compass-degree {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.ibn-compass-dir {
  font-size: 0.85rem;
  margin-top: 4px;
  letter-spacing: 0.1em;
  color: rgba(243, 217, 154, 0.75);
}

.ibn-qibla-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin: 10px 0;
}
.ibn-qibla-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(229, 192, 122, 0.22);
  border-radius: var(--q-radius-sm);
}
.ibn-qibla-info-icon {
  display: inline-flex;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  color: var(--q-gold-deep);
}
.ibn-qibla-info-icon svg { width: 20px; height: 20px; }
.ibn-qibla-info-label { font-size: 0.74rem; color: rgba(7, 29, 56, 0.6); }
.ibn-qibla-info-value { font-weight: 700; color: var(--q-navy, #071d38); }

.ibn-qibla-status {
  margin: 8px 0;
  padding: 10px 16px;
  background: rgba(7, 29, 56, 0.05);
  border-radius: var(--q-radius-pill);
  font-size: 0.92rem;
  color: rgba(7, 29, 56, 0.78);
  text-align: center;
  transition: background 0.3s ease, color 0.3s ease;
}
.ibn-qibla-status.is-aligned {
  background: rgba(21, 128, 61, 0.12);
  color: #166534;
  font-weight: 700;
}

.ibn-qibla-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}
.ibn-qibla-actions .ibn-btn { flex: 1; min-width: 140px; }

.ibn-qibla-tip {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: rgba(7, 29, 56, 0.6);
  text-align: center;
  line-height: 1.6;
}

.ibn-qibla-error {
  text-align: center;
  padding: 20px 10px;
}
.ibn-error-icon { font-size: 3rem; margin-bottom: 10px; }
.ibn-qibla-manual h3 { margin: 0 0 12px; }
.ibn-city-search { width: 100%; }
.ibn-city-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.ibn-city-btn {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-sm);
  color: var(--q-navy, #071d38);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.ibn-city-btn:hover {
  background: rgba(229, 192, 122, 0.12);
  transform: translateY(-1px);
}
.ibn-empty { padding: 20px; text-align: center; color: rgba(7, 29, 56, 0.5); }

/* ──────────────────────────────────────────────────────────────────────────
  13) مواقيت الصلاة
   ────────────────────────────────────────────────────────────────────────── */
.ibn-prayer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(7, 29, 56, 0.1);
  margin-bottom: 14px;
}
.ibn-prayer-loc { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ibn-prayer-loc svg { width: 18px; height: 18px; color: var(--q-gold-deep); }
.ibn-prayer-date { font-size: 0.88rem; color: rgba(7, 29, 56, 0.62); }

.ibn-prayer-next {
  text-align: center;
  padding: 18px;
  background: linear-gradient(135deg, #0b2447, #071d38);
  color: #f3d99a;
  border-radius: var(--q-radius-card);
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(7, 29, 56, 0.2);
}
.ibn-next-label { font-size: 0.84rem; opacity: 0.78; letter-spacing: 0.06em; }
.ibn-next-name  { font-size: 1.9rem; font-weight: 800; margin-top: 4px; }
.ibn-next-time  { font-size: 1.1rem; opacity: 0.9; margin-top: 2px; }
.ibn-next-countdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(229, 192, 122, 0.2);
  font-size: 0.94rem;
}
.ibn-next-countdown strong { color: #fff; }

.ibn-prayer-list { list-style: none; padding: 0; margin: 0; }
.ibn-prayer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.06);
  border-radius: var(--q-radius-sm);
  margin-bottom: 6px;
  transition: background 0.2s ease;
}
.ibn-prayer-row.is-next {
  border-color: var(--q-gold-strong);
  background: linear-gradient(90deg, var(--q-gold-soft), #fff);
}
.ibn-prayer-icon { font-size: 1.4rem; }
.ibn-prayer-name { font-weight: 700; color: var(--q-navy, #071d38); }
.ibn-prayer-time { font-weight: 700; color: var(--q-gold-deep); font-variant-numeric: tabular-nums; }
.ibn-prayer-source {
  text-align: center;
  font-size: 0.76rem;
  color: rgba(7, 29, 56, 0.5);
  margin: 14px 0 0;
}

/* ──────────────────────────────────────────────────────────────────────────
  14) عدّاد التسبيح
   ────────────────────────────────────────────────────────────────────────── */
.ibn-tasbeeh-zikr-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.ibn-tasbeeh-zikr-btn {
  padding: 7px 14px;
  background: #fff;
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-pill);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--q-navy, #071d38);
  transition: background 0.2s ease;
}
.ibn-tasbeeh-zikr-btn.is-active {
  background: var(--q-navy, #071d38);
  border-color: var(--q-navy, #071d38);
  color: var(--q-gold-strong);
}
.ibn-tasbeeh-display {
  text-align: center;
  margin-bottom: 20px;
}
.ibn-tasbeeh-current-zikr {
  font-size: 1.2rem;
  color: var(--q-gold-deep);
  font-weight: 700;
  margin-bottom: 10px;
}
.ibn-tasbeeh-count {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--q-navy, #071d38);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ibn-tasbeeh-target { color: rgba(7, 29, 56, 0.55); margin-top: 4px; }
.ibn-tasbeeh-progress {
  margin-top: 14px;
  height: 6px;
  background: rgba(7, 29, 56, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.ibn-tasbeeh-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--q-gold-strong), var(--q-gold-deep));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.ibn-tasbeeh-tap {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 90%;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e5c07a, #b48a48 70%);
  border: 0;
  color: #fffdf6;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(180, 138, 72, 0.42), inset 0 -8px 24px rgba(0,0,0,0.18);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.ibn-tasbeeh-tap:active {
  transform: scale(0.94);
  box-shadow: 0 6px 18px rgba(180, 138, 72, 0.42), inset 0 -6px 16px rgba(0,0,0,0.22);
}
.ibn-tasbeeh-tap.is-celebrate { animation: ibn-pulse 0.6s ease 2; }
@keyframes ibn-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); box-shadow: 0 20px 50px rgba(229, 192, 122, 0.6); }
}
.ibn-tasbeeh-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.ibn-tasbeeh-target-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ibn-tasbeeh-target-group label { font-size: 0.88rem; color: rgba(7, 29, 56, 0.7); margin-left: 6px; }
.ibn-target-btn {
  padding: 5px 12px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.12);
  border-radius: var(--q-radius-pill);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--q-navy, #071d38);
}
.ibn-target-btn.is-active {
  background: var(--q-gold-strong);
  border-color: var(--q-gold-strong);
  color: #fff;
}
.ibn-tasbeeh-sessions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgba(7, 29, 56, 0.1);
}
.ibn-tasbeeh-sessions h4 { margin: 0 0 10px; font-size: 0.95rem; }
.ibn-tasbeeh-sessions ul { list-style: none; padding: 0; margin: 0; }
.ibn-tasbeeh-sessions li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(7, 29, 56, 0.05);
  font-size: 0.9rem;
}
.ibn-tasbeeh-sessions strong { color: var(--q-gold-deep); }

/* ──────────────────────────────────────────────────────────────────────────
  15) أذكار الصباح والمساء
   ────────────────────────────────────────────────────────────────────────── */
.ibn-azkar-list { list-style: none; padding: 0; margin: 0; }
.ibn-azkar-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(229, 192, 122, 0.22);
  border-radius: var(--q-radius-card);
  margin-bottom: 10px;
  transition: opacity 0.3s ease, background 0.3s ease;
}
.ibn-azkar-item.is-done {
  background: rgba(21, 128, 61, 0.06);
  border-color: rgba(21, 128, 61, 0.24);
  opacity: 0.65;
}
.ibn-azkar-text { font-size: 1rem; line-height: 1.8; color: var(--q-navy, #071d38); }
.ibn-azkar-tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--q-gold-strong), var(--q-gold-deep));
  color: #fff;
  border: 0;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 6px 16px rgba(180, 138, 72, 0.32);
}
.ibn-azkar-tap:active { transform: scale(0.92); }
.ibn-azkar-tap svg { width: 26px; height: 26px; }
.ibn-azkar-item.is-done .ibn-azkar-tap {
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.28);
}
.ibn-azkar-num { font-size: 1.1rem; }
.ibn-azkar-of { font-size: 0.7rem; opacity: 0.75; }

/* ──────────────────────────────────────────────────────────────────────────
  16) التقويم الهجري
   ────────────────────────────────────────────────────────────────────────── */
.ibn-cal-today {
  text-align: center;
  padding: 22px;
  background: linear-gradient(135deg, #0b2447, #071d38);
  color: #f3d99a;
  border-radius: var(--q-radius-card);
  margin-bottom: 20px;
}
.ibn-cal-today-day { font-size: 0.95rem; opacity: 0.78; }
.ibn-cal-today-hijri { font-size: 1.5rem; font-weight: 800; margin: 6px 0 4px; }
.ibn-cal-today-greg { font-size: 0.88rem; opacity: 0.72; }
.ibn-cal-event {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(229, 192, 122, 0.10);
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-card);
  margin-bottom: 20px;
}
.ibn-cal-event-icon { font-size: 1.8rem; }
.ibn-cal-event-label { font-size: 0.78rem; color: rgba(7, 29, 56, 0.6); }
.ibn-cal-event-name { font-weight: 800; color: var(--q-navy, #071d38); font-size: 1.05rem; }
.ibn-cal-event-meta { font-size: 0.85rem; color: rgba(7, 29, 56, 0.7); margin-top: 2px; }

.ibn-cal-converter { margin-bottom: 20px; }
.ibn-cal-converter h3 { margin: 0 0 10px; font-size: 1rem; }
.ibn-cal-from label { display: block; font-size: 0.85rem; margin-bottom: 6px; }
.ibn-cal-result {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--q-gold-soft);
  border: 1px dashed rgba(229, 192, 122, 0.5);
  border-radius: var(--q-radius-sm);
  font-weight: 700;
  color: var(--q-gold-deep);
}
.ibn-cal-events h3 { margin: 0 0 10px; font-size: 1rem; }
.ibn-cal-events ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.ibn-cal-events li {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.06);
  border-radius: var(--q-radius-sm);
  font-size: 0.88rem;
}

/* ──────────────────────────────────────────────────────────────────────────
  17) Smart Bottom Nav v3
   ────────────────────────────────────────────────────────────────────────── */
.ibn-bottom-nav, .ibn-bottom-nav-final {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  max-width: 540px;
  margin: 16px auto 24px;
  padding: 8px;
  background: rgba(7, 29, 56, 0.95);
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(7, 29, 56, 0.25);
  backdrop-filter: blur(12px);
}
.ibn-bottom-nav a,
.ibn-bottom-nav button,
.ibn-bottom-nav-final a,
.ibn-bottom-nav-final button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  background: transparent;
  border: 0;
  color: rgba(243, 217, 154, 0.62);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  position: relative;
  border-radius: 14px;
}
.ibn-bottom-nav a:hover,
.ibn-bottom-nav button:hover,
.ibn-bottom-nav-final a:hover,
.ibn-bottom-nav-final button:hover {
  color: #f3d99a;
}
.ibn-bottom-nav a.is-active,
.ibn-bottom-nav button.is-active,
.ibn-bottom-nav-final a.is-active,
.ibn-bottom-nav-final button.is-active {
  color: var(--q-gold-strong);
}
.ibn-bottom-nav a.is-active::after,
.ibn-bottom-nav button.is-active::after,
.ibn-bottom-nav-final a.is-active::after,
.ibn-bottom-nav-final button.is-active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--q-gold-strong);
  border-radius: 999px;
}
.qnav-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}
.qnav-icon svg { width: 22px; height: 22px; }
.qnav-label { font-size: 0.74rem; }
.qnav-sub {
  display: block;
  font-size: 0.62rem;
  opacity: 0.78;
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qnav-sub:empty { display: none; }
.qnav-smart.is-live {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5 !important;
}
.qnav-smart.is-live .qnav-icon::before {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  top: 8px; right: 14px;
  animation: ibn-pulse-dot 1.2s ease infinite;
}
@keyframes ibn-pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%     { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.qnav-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 10px;
  padding: 2px 6px;
  background: var(--q-gold-strong);
  color: var(--q-navy, #071d38);
  font-size: 0.6rem;
  font-weight: 800;
  border-radius: 999px;
  line-height: 1.1;
}

/* قائمة آخر القراءات (long-press) */
.ibn-recent-menu {
  background: #fffdf6;
  border: 1px solid rgba(229, 192, 122, 0.4);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 14px 36px rgba(7, 29, 56, 0.32);
  z-index: 10000;
  min-width: 240px;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ibn-recent-menu.is-open { opacity: 1; transform: translateX(-50%) translateY(0); }
.ibn-recent-head {
  padding: 8px 12px 4px;
  font-size: 0.78rem;
  color: rgba(7, 29, 56, 0.55);
  font-weight: 700;
}
.ibn-recent-menu ul { list-style: none; padding: 0; margin: 0; }
.ibn-recent-menu li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--q-navy, #071d38);
  font-size: 0.92rem;
  transition: background 0.15s ease;
}
.ibn-recent-menu li a:hover { background: rgba(229, 192, 122, 0.14); }
.ibn-recent-name { font-weight: 700; }
.ibn-recent-time { font-size: 0.78rem; color: rgba(7, 29, 56, 0.5); }

/* ──────────────────────────────────────────────────────────────────────────
  18) Tools Drawer (من زر "أدوات")
   ────────────────────────────────────────────────────────────────────────── */
body.ibn-drawer-open { overflow: hidden; }
.ibn-tools-drawer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
.ibn-tools-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 19, 42, 0);
  transition: background 0.3s ease;
  pointer-events: auto;
}
.ibn-tools-drawer.is-open .ibn-tools-drawer-overlay { background: rgba(4, 19, 42, 0.55); }
.ibn-tools-drawer-sheet {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  background: linear-gradient(180deg, #fffdf6 0%, #fff8e7 100%);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(229, 192, 122, 0.4);
  box-shadow: 0 -10px 30px rgba(7, 29, 56, 0.18);
  transform: translateY(100%);
  transition: transform 0.32s var(--q-ease);
  pointer-events: auto;
  max-height: 80vh;
  overflow-y: auto;
  padding: 14px 18px 28px;
}
.ibn-tools-drawer.is-open .ibn-tools-drawer-sheet { transform: translateY(0); }
.ibn-tools-drawer-handle {
  width: 40px;
  height: 4px;
  background: rgba(7, 29, 56, 0.18);
  border-radius: 999px;
  margin: 0 auto 16px;
}
.ibn-tools-drawer-head h3 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--q-navy, #071d38);
}
.ibn-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.ibn-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: #fff;
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-card);
  font-family: inherit;
  cursor: pointer;
  color: var(--q-navy, #071d38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ibn-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(229, 192, 122, 0.28);
}
.ibn-tool-card-icon { font-size: 1.8rem; }
.ibn-tool-card-name { font-size: 0.78rem; font-weight: 700; text-align: center; }

/* ──────────────────────────────────────────────────────────────────────────
  19) Khatma detail modal — خريطة السور
   ────────────────────────────────────────────────────────────────────────── */
.ibn-kdetail-section { margin-bottom: 22px; }
.ibn-kdetail-section h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  color: var(--q-navy, #071d38);
}
.ibn-hint {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: rgba(7, 29, 56, 0.6);
}
.ibn-kdetail-goal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.ibn-kdetail-goal-btn {
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.12);
  border-radius: var(--q-radius-sm);
  font-family: inherit;
  cursor: pointer;
  color: var(--q-navy, #071d38);
  font-weight: 600;
  transition: background 0.2s ease;
}
.ibn-kdetail-goal-btn.is-active {
  background: var(--q-gold-strong);
  border-color: var(--q-gold-strong);
  color: #fff;
}
.ibn-kdetail-goal-value {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ibn-kdetail-goal-value label { flex: 1; font-size: 0.88rem; }
.ibn-kdetail-goal-value input { flex: 1; max-width: 100px; }

.ibn-kdetail-surahs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(7, 29, 56, 0.03);
  border-radius: var(--q-radius-sm);
}
.ibn-kdetail-surah {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.08);
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ibn-kdetail-surah:hover { background: rgba(229, 192, 122, 0.12); transform: scale(1.04); }
.ibn-kdetail-surah.is-done {
  background: rgba(21, 128, 61, 0.12);
  border-color: rgba(21, 128, 61, 0.32);
}
.ibn-kdetail-surah-num {
  font-size: 0.72rem;
  color: rgba(7, 29, 56, 0.55);
  font-weight: 600;
}
.ibn-kdetail-surah-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--q-navy, #071d38);
  text-align: center;
  line-height: 1.2;
}
.ibn-kdetail-surah.is-done .ibn-kdetail-surah-name { color: #166534; }

.ibn-kdetail-history { list-style: none; padding: 0; margin: 0; }
.ibn-kdetail-history li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(7, 29, 56, 0.05);
  font-size: 0.85rem;
}
.ibn-kdetail-history .is-completed { color: #166534; }
.ibn-kdetail-history .is-abandoned { color: rgba(7, 29, 56, 0.5); }

.ibn-kdetail-danger {
  text-align: center;
  border-top: 1px dashed rgba(220, 38, 38, 0.2);
  padding-top: 16px;
}

/* الاحتفال بإكمال الختمة */
.ibn-khatma-celebrate {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 19, 42, 0);
  transition: background 0.4s ease;
}
.ibn-khatma-celebrate.is-open { background: rgba(4, 19, 42, 0.7); }
.ibn-celebrate-content {
  text-align: center;
  padding: 36px 30px;
  max-width: 380px;
  background: linear-gradient(180deg, #fffdf6 0%, #fff5d8 100%);
  border-radius: 24px;
  box-shadow: var(--q-shadow-pop);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.4s var(--q-ease), opacity 0.3s ease;
}
.ibn-khatma-celebrate.is-open .ibn-celebrate-content { transform: scale(1); opacity: 1; }
.ibn-celebrate-emoji {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 14px;
  animation: ibn-celebrate-spin 1s ease 0.3s;
}
@keyframes ibn-celebrate-spin {
  0%   { transform: rotate(0deg) scale(0); opacity: 0; }
  60%  { transform: rotate(380deg) scale(1.2); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}
.ibn-celebrate-content h2 { margin: 0 0 8px; color: var(--q-gold-deep); }
.ibn-celebrate-prayer {
  margin: 14px 0 22px;
  font-style: italic;
  color: rgba(7, 29, 56, 0.7);
  line-height: 1.7;
}

/* ──────────────────────────────────────────────────────────────────────────
  20) Footer غني
   ────────────────────────────────────────────────────────────────────────── */
.ibn-footer-rich {
  background: linear-gradient(180deg, #071d38 0%, #04132a 100%);
  color: rgba(243, 217, 154, 0.78);
  padding: 36px 20px 18px;
  margin-top: 40px;
}
.ibn-footer-grid {
  max-width: 1100px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
}
.ibn-footer-col h4 {
  margin: 0 0 12px;
  color: var(--q-gold-strong);
  font-size: 1rem;
  font-weight: 700;
}
.ibn-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ibn-footer-col li { margin-bottom: 8px; }
.ibn-footer-col a {
  color: rgba(243, 217, 154, 0.68);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.ibn-footer-col a:hover { color: #f3d99a; }
.ibn-footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.ibn-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: rgba(229, 192, 122, 0.08);
  border: 1px solid rgba(229, 192, 122, 0.24);
  border-radius: 50%;
  transition: background 0.2s ease;
}
.ibn-footer-social a:hover { background: rgba(229, 192, 122, 0.2); }
.ibn-footer-social svg { width: 18px; height: 18px; }
.ibn-footer-bottom {
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid rgba(229, 192, 122, 0.18);
  font-size: 0.8rem;
  color: rgba(243, 217, 154, 0.5);
}
.ibn-footer-bottom strong { color: #f3d99a; }

/* ──────────────────────────────────────────────────────────────────────────
  21) تقليل ارتفاع مشغّل السور
   ────────────────────────────────────────────────────────────────────────── */
.ibn-liquid-inline-player {
  padding: 18px !important;
}
.ibn-liquid-inline-player .ibn-liquid-title {
  font-size: 1.4rem !important;
  margin-bottom: 4px !important;
}
.ibn-liquid-inline-player .ibn-liquid-reader {
  margin-bottom: 10px !important;
  font-size: 0.85rem !important;
}
.ibn-liquid-inline-player .ibn-liquid-progress {
  margin: 8px 0 6px !important;
}
.ibn-liquid-inline-player .ibn-liquid-time-row {
  margin-bottom: 12px !important;
  font-size: 0.78rem !important;
}
.ibn-liquid-inline-player .ibn-liquid-controls {
  gap: 10px !important;
  margin-bottom: 10px !important;
}
.ibn-liquid-inline-player .ibn-liquid-btn { width: 44px !important; height: 44px !important; }
.ibn-liquid-inline-player .ibn-liquid-btn-main { width: 58px !important; height: 58px !important; }
.ibn-liquid-inline-player .ibn-liquid-extras {
  padding-top: 8px !important;
  margin-top: 6px !important;
}

/* ──────────────────────────────────────────────────────────────────────────
  22) دعم رفع شفاف للمصاحف (تحسين بسيط للعرض)
   ────────────────────────────────────────────────────────────────────────── */
.spacer.quran-card[data-section="mushaf-versions"] .surah-decoration-icon {
  filter: drop-shadow(0 4px 8px rgba(180, 138, 72, 0.32));
}

/* ──────────────────────────────────────────────────────────────────────────
  23) Section title generic
   ────────────────────────────────────────────────────────────────────────── */
.ibn-section-title {
  margin: 24px 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--q-navy, #071d38);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--q-gold-soft);
}

/* ──────────────────────────────────────────────────────────────────────────
  24) Heir rows في حاسبة المواريث
   ────────────────────────────────────────────────────────────────────────── */
.ibn-inherit-intro {
  padding: 12px 14px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: var(--q-radius-sm);
  font-size: 0.88rem;
  color: rgba(7, 29, 56, 0.78);
  margin-bottom: 16px;
}
.ibn-inherit-heirs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}
.ibn-heir-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.08);
  border-radius: var(--q-radius-sm);
}
.ibn-heir-row label { font-size: 0.9rem; }
.ibn-heir-row input, .ibn-heir-row select { width: 80px; }

/* ──────────────────────────────────────────────────────────────────────────
  25) Animated age intro
   ────────────────────────────────────────────────────────────────────────── */
.ibn-age-intro {
  padding: 12px 14px;
  background: var(--q-gold-soft);
  border-radius: var(--q-radius-sm);
  margin-bottom: 16px;
  font-size: 0.92rem;
  color: rgba(7, 29, 56, 0.78);
}

/* ──────────────────────────────────────────────────────────────────────────
  26) Header quick buttons (بقايا تحسينات)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-quick-btn { position: relative; }
.ibn-quick-btn:hover { background: rgba(229, 192, 122, 0.15); }

/* ──────────────────────────────────────────────────────────────────────────
  27) Error card (لصفحات التفسير الفاشلة)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-error-card {
  max-width: 540px;
  margin: 32px auto;
  padding: 36px 28px;
  background: linear-gradient(180deg, #fffdf6 0%, #fff5d8 100%);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 22px;
  box-shadow: var(--q-shadow-card);
  text-align: center;
}
.ibn-error-card-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 14px;
  animation: ibn-error-wobble 0.6s ease;
}
@keyframes ibn-error-wobble {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-6deg); }
  75%      { transform: rotate(6deg); }
}
.ibn-error-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: var(--q-navy, #071d38);
}
.ibn-error-card p {
  margin: 0 0 18px;
  color: rgba(7, 29, 56, 0.72);
  font-size: 1rem;
  line-height: 1.7;
}
.ibn-error-card-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.ibn-error-card-meta span {
  padding: 5px 12px;
  background: rgba(7, 29, 56, 0.06);
  border: 1px solid rgba(7, 29, 56, 0.08);
  border-radius: var(--q-radius-pill);
  font-size: 0.82rem;
  color: rgba(7, 29, 56, 0.68);
  font-variant-numeric: tabular-nums;
}
.ibn-error-card .ibn-btn { display: inline-flex; }

/* ──────────────────────────────────────────────────────────────────────────
  28) Tools standalone page
   ────────────────────────────────────────────────────────────────────────── */
.ibn-tools-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}
.ibn-tools-hero {
  text-align: center;
  margin-bottom: 36px;
  padding: 32px 24px;
  background: linear-gradient(135deg, #0b2447, #04132a);
  color: #f3d99a;
  border-radius: 26px;
  position: relative;
  overflow: hidden;
}
.ibn-tools-hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto auto;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(229,192,122,0.25), transparent 60%);
  border-radius: 50%;
}
.ibn-tools-hero::after {
  content: '';
  position: absolute;
  inset: auto auto -40% -10%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(74,157,156,0.18), transparent 65%);
  border-radius: 50%;
}
.ibn-tools-hero h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.ibn-tools-hero p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.78;
  position: relative;
  z-index: 1;
}
.ibn-tools-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.ibn-tools-grid-page .ibn-tool-card-lg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 26px 22px;
  background: linear-gradient(180deg, #fffdf6 0%, #fff8e7 100%);
  border: 1px solid rgba(229, 192, 122, 0.32);
  border-radius: var(--q-radius-card);
  color: var(--q-navy, #071d38);
  cursor: pointer;
  font-family: inherit;
  text-align: start;
  transition: transform 0.25s var(--q-ease), box-shadow 0.25s var(--q-ease);
  position: relative;
  overflow: hidden;
}
.ibn-tools-grid-page .ibn-tool-card-lg::after {
  content: '';
  position: absolute;
  top: -30%;
  inset-inline-end: -20%;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(229, 192, 122, 0.32), transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ibn-tools-grid-page .ibn-tool-card-lg:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(180, 138, 72, 0.24);
}
.ibn-tools-grid-page .ibn-tool-card-lg:hover::after { opacity: 1; }
.ibn-tool-card-lg-icon {
  display: inline-flex;
  width: 56px; height: 56px;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b2447, #071d38);
  color: var(--q-gold-strong);
  border-radius: 16px;
  font-size: 1.8rem;
  box-shadow: 0 8px 18px rgba(7, 29, 56, 0.22);
  position: relative;
  z-index: 1;
}
.ibn-tool-card-lg h3 {
  margin: 0;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}
.ibn-tool-card-lg p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(7, 29, 56, 0.62);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ──────────────────────────────────────────────────────────────────────────
   صفحة الأدوات الموحّدة (tools.html)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-tools-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 28px);
}

.ibn-tools-hero {
  text-align: center;
  padding: 32px 20px 28px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(229, 192, 122, 0.12), rgba(7, 29, 56, 0.04));
  border-radius: 22px;
  border: 1px solid rgba(229, 192, 122, 0.25);
}
.ibn-tools-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 800;
  color: #071d38;
  letter-spacing: -0.02em;
}
.ibn-tools-subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  color: rgba(7, 29, 56, 0.65);
  line-height: 1.7;
}

.ibn-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.ibn-tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(7, 29, 56, 0.08);
  border-radius: 18px;
  cursor: pointer;
  text-align: right;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  width: 100%;
}
.ibn-tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(229, 192, 122, 0), rgba(229, 192, 122, 0.06));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ibn-tool-card:hover,
.ibn-tool-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(229, 192, 122, 0.4);
  box-shadow: 0 12px 28px -10px rgba(7, 29, 56, 0.18);
  outline: none;
}
.ibn-tool-card:hover::before,
.ibn-tool-card:focus-visible::before {
  opacity: 1;
}
.ibn-tool-card:active {
  transform: translateY(-1px);
}

.ibn-tool-card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(229, 192, 122, 0.18), rgba(229, 192, 122, 0.08));
  color: #b48a48;
  position: relative;
  z-index: 1;
}
.ibn-tool-card-icon svg {
  width: 28px;
  height: 28px;
}
.ibn-tool-card-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.ibn-tool-card-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #071d38;
  margin-bottom: 4px;
}
.ibn-tool-card-desc {
  display: block;
  font-size: 0.85rem;
  color: rgba(7, 29, 56, 0.62);
  line-height: 1.55;
}
.ibn-tool-card-arrow {
  flex-shrink: 0;
  font-size: 1.4rem;
  color: rgba(229, 192, 122, 0.7);
  transition: transform 0.25s ease;
  position: relative;
  z-index: 1;
}
.ibn-tool-card:hover .ibn-tool-card-arrow {
  transform: translateX(-4px);
  color: #b48a48;
}

.ibn-tools-help {
  background: linear-gradient(135deg, rgba(7, 29, 56, 0.03), rgba(229, 192, 122, 0.05));
  border: 1px solid rgba(7, 29, 56, 0.08);
  border-radius: 18px;
  padding: 24px;
}
.ibn-tools-help h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  color: #071d38;
  font-weight: 700;
}
.ibn-tools-help ul {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.ibn-tools-help ul li {
  position: relative;
  padding: 8px 22px 8px 0;
  color: rgba(7, 29, 56, 0.78);
  font-size: 0.93rem;
  line-height: 1.7;
}
.ibn-tools-help ul li::before {
  content: '◆';
  position: absolute;
  right: 0;
  top: 10px;
  color: rgba(229, 192, 122, 0.6);
  font-size: 0.7rem;
}
.ibn-tools-help ul li strong {
  color: #071d38;
}
.ibn-tools-help .ibn-tools-note {
  margin: 0;
  padding: 12px 16px;
  background: rgba(229, 192, 122, 0.1);
  border-radius: 12px;
  font-size: 0.85rem;
  color: rgba(7, 29, 56, 0.7);
  text-align: center;
  border-right: 3px solid #b48a48;
}

/* ──────────────────────────────────────────────────────────────────────────
   بطاقة خطأ التفسير المتقدّمة (.ibn-error-card)
   ────────────────────────────────────────────────────────────────────────── */
.ibn-error-card {
  max-width: 720px;
  margin: 40px auto;
  padding: 36px 28px;
  background: linear-gradient(135deg, rgba(255, 248, 230, 0.7), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(229, 192, 122, 0.35);
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 12px 28px -14px rgba(7, 29, 56, 0.15);
}
.ibn-error-card-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(229, 192, 122, 0.3));
}
.ibn-error-card-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #071d38;
}
.ibn-error-card-msg {
  margin: 0 0 22px;
  color: rgba(7, 29, 56, 0.72);
  line-height: 1.75;
  font-size: 0.98rem;
}
.ibn-error-card-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.ibn-error-card-meta span {
  padding: 6px 14px;
  background: rgba(7, 29, 56, 0.05);
  border-radius: 12px;
  font-size: 0.85rem;
  color: rgba(7, 29, 56, 0.7);
}
.ibn-error-card-meta strong {
  color: #b48a48;
  font-weight: 700;
}
.ibn-error-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ibn-error-card-actions .ibn-btn {
  min-width: 140px;
}

/* ──────────────────────────────────────────────────────────────────────────
   END
   ────────────────────────────────────────────────────────────────────────── */
