/* ==========================================================================
   أُنس — أنماط إضافية لنسخة PHP (تكملة لـ app.css)
   ========================================================================== */

/* إخفاء العناصر التي تُفتح بالجافاسكريبت */
.mobile-drawer[hidden], .audio-player[hidden], .nav-menu[hidden], [hidden] { display: none !important; }

/* أيقونات زر الوضع الليلي */
.theme-toggle .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: inline-flex; }
[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }

/* ---------------- قائمة السور ---------------- */
.quran-toolbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.quran-search { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .55rem .9rem; color: var(--muted); }
.quran-search input { flex: 1; border: 0; background: transparent; outline: none; font-size: .85rem; color: var(--ink); }
.quran-count { font-size: .72rem; color: var(--muted); font-weight: 700; }
.surah-number { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: .85rem; }
.surah-meta { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.surah-meta strong { font-size: .95rem; }
.surah-meta small { font-size: .65rem; color: var(--muted); }
.surah-arrow { color: var(--gold); flex: none; }

/* ---------------- قارئ السورة ---------------- */
.reader-container { padding-block: 1.2rem 2rem; }
.reader-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.reader-nav { display: flex; align-items: center; gap: .6rem; }
.reader-title { display: flex; flex-direction: column; line-height: 1.4; }
.reader-title span { font-weight: 800; }
.reader-title small { font-size: .68rem; color: var(--muted); }
.reader-tools { display: flex; gap: .4rem; flex-wrap: wrap; }
.surah-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1rem, 3vw, 2rem); }
.surah-head { text-align: center; padding-bottom: 1.2rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.surah-head-kicker { font-size: .68rem; color: var(--gold); font-weight: 700; letter-spacing: 0; }
.surah-head h1 { font-family: var(--font-quran); font-size: clamp(1.8rem, 5vw, 2.6rem); margin: .2rem 0 .3rem; }
.surah-head p { font-size: .72rem; color: var(--muted); }
.basmala { font-family: var(--font-quran); font-size: clamp(1.2rem, 3.5vw, 1.6rem); color: var(--green-700); margin-top: .9rem; }
[data-theme="dark"] .basmala { color: var(--gold-2); }

.ayat-list { display: grid; gap: .8rem; }
.ayah-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.ayah-body { position: relative; }
.ayah-text { font-family: var(--font-quran); font-size: clamp(1.25rem, 3.6vw, 1.6rem); line-height: 2.15; text-align: justify; color: var(--ink); margin: 0 0 .5rem; }
.ayah-actions { display: flex; align-items: center; gap: .3rem; }
.ayah-num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); font-size: .62rem; color: var(--gold); margin-inline-end: auto; }
.tafsir-panel { margin-top: .7rem; background: var(--green-soft); border: 1px solid rgba(29,106,78,.14); border-radius: 12px; padding: .7rem .9rem; }
[data-theme="dark"] .tafsir-panel { background: var(--surface-3); border-color: var(--line); }
.tafsir-panel summary { cursor: pointer; font-size: .72rem; font-weight: 700; color: var(--green-700); }
[data-theme="dark"] .tafsir-panel summary { color: var(--gold-2); }
.tafsir-panel p { font-size: .82rem; line-height: 2; color: var(--ink-2); margin-top: .5rem; }

/* ---------------- الأحاديث ---------------- */
.hadith-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.hadith-filters .field { display: flex; align-items: center; gap: .4rem; flex: 1; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .5rem .9rem; color: var(--muted); }
.hadith-filters .field input { flex: 1; border: 0; outline: none; background: transparent; font-size: .82rem; color: var(--ink); }
.hadith-filters select { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .5rem .8rem; font-size: .78rem; }
.hadith-list { display: grid; gap: .9rem; }
.hadith-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.hadith-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.hadith-text.large { font-size: clamp(1.2rem, 3vw, 1.5rem); }
.hadith-detail-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.hadith-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 1.2rem 0; }
.hadith-facts > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.hadith-facts dt { font-size: .62rem; color: var(--muted); margin-bottom: .15rem; }
.hadith-facts dd { margin: 0; font-size: .82rem; font-weight: 700; color: var(--ink); }
.source-link a { color: var(--gold); font-size: .75rem; font-weight: 700; }

/* ---------------- المقالات ---------------- */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.article-card { display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; transition: transform var(--transition), box-shadow var(--transition); }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.article-card h2 { font-size: 1.05rem; line-height: 1.6; }
.article-card p { font-size: .78rem; color: var(--muted); line-height: 1.9; flex: 1; }
.article-meta, .article-byline { font-size: .68rem; color: var(--muted); }
.article-cat { display: inline-flex; align-self: flex-start; font-size: .62rem; font-weight: 700; color: var(--gold); background: var(--gold-soft); border-radius: 999px; padding: .12rem .55rem; }
.article-wrap { max-width: 820px; }
.article-body h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .4rem; }
.article-body h2 { font-size: 1.2rem; margin: 1.4rem 0 .5rem; color: var(--green-800); }
[data-theme="dark"] .article-body h2 { color: var(--gold-2); }
.article-body ul { margin: .4rem 0 1rem; padding-inline-start: 1.2rem; }
.article-body li { font-size: .88rem; line-height: 2; color: var(--ink-2); }

/* ---------------- البحث ---------------- */
.search-form.large { max-width: 640px; margin-bottom: 1.4rem; }
.search-count { font-size: .8rem; color: var(--muted); margin-bottom: 1rem; }
.search-section { font-size: 1rem; margin: 1.4rem 0 .6rem; color: var(--green-800); }
[data-theme="dark"] .search-section { color: var(--gold-2); }
.search-results { display: grid; gap: .55rem; }
.search-item { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; transition: border-color var(--transition); }
.search-item:hover { border-color: var(--gold); }
.search-item p { font-size: .85rem; line-height: 1.9; color: var(--ink-2); margin: .2rem 0; }
.search-item .quran-line { font-family: var(--font-quran); font-size: 1.15rem; line-height: 2.1; }
.search-item small { font-size: .65rem; color: var(--muted); }
.search-type { display: inline-block; font-size: .58rem; font-weight: 700; color: var(--gold); border: 1px solid rgba(178,142,79,.3); border-radius: 999px; padding: 0 .5rem; }

/* ---------------- ترقيم الصفحات ---------------- */
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin-top: 1.6rem; }
.page-link { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; color: var(--ink-2); }
.page-link.active { background: var(--green-800); border-color: var(--green-800); color: #fff; }

/* ---------------- المفضلة ---------------- */
.favorites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.fav-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.fav-card h3 { font-size: .95rem; }
.fav-card p { font-size: .75rem; color: var(--muted); line-height: 1.8; flex: 1; }
.fav-actions { display: flex; gap: .35rem; }

/* ---------------- الدخول ---------------- */
.auth-wrap { display: grid; place-items: center; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); display: grid; gap: .7rem; }
.auth-card h1 { font-size: 1.2rem; display: flex; align-items: center; gap: .4rem; }
.auth-card > p { font-size: .78rem; color: var(--muted); }
.auth-form { display: grid; gap: .7rem; }
.auth-form label { display: grid; gap: .3rem; font-size: .74rem; font-weight: 700; color: var(--ink-2); }
.auth-form input { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; font-size: .85rem; background: var(--surface-2); outline: none; }
.auth-form input:focus { border-color: var(--gold); }

/* ---------------- تنبيهات ---------------- */
.alert { border-radius: 12px; padding: .7rem .9rem; font-size: .78rem; line-height: 1.8; }
.alert-error { background: rgba(168,77,77,.1); border: 1px solid rgba(168,77,77,.3); color: #a84d4d; }
.alert-warn { background: var(--gold-soft); border: 1px solid rgba(178,142,79,.35); color: #7a5b23; }
.alert-ok { background: rgba(47,127,87,.1); border: 1px solid rgba(47,127,87,.3); color: #2f7f57; }
.alert code { background: rgba(0,0,0,.06); padding: 0 .3rem; border-radius: 4px; }

/* ---------------- لوحة التحكم ---------------- */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.admin-head h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.admin-head p { font-size: .72rem; color: var(--muted); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-bottom: 1.6rem; }
.admin-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; display: flex; flex-direction: column; align-items: center; }
.admin-stats strong { font-size: 1.15rem; color: var(--gold); }
.admin-stats span { font-size: .62rem; color: var(--muted); }
.admin-section { font-size: 1rem; margin: 1.4rem 0 .6rem; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.admin-table th, .admin-table td { padding: .55rem .7rem; text-align: right; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--surface-2); font-size: .68rem; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-actions { display: flex; gap: .3rem; }
.admin-actions form { margin: 0; }
.btn.danger { color: #a84d4d; }

/* ---------------- الصلاة ---------------- */
.prayer-footnote { font-size: .65rem; color: rgba(247,241,227,.45); margin-top: 1rem; }
.prayer-extra { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.prayer-widget .prayer-sub { color: var(--muted); }

/* ---------------- المسبحة ---------------- */
.tasbih-picker { margin-top: 1rem; }

/* استجابة الموبايل */
@media (max-width: 700px) {
  .reader-topbar { gap: .5rem; }
  .ayah-text { font-size: 1.3rem; line-height: 2.2; }
  .hadith-filters .field { min-width: 100%; }
  .article-wrap { padding-inline: .2rem; }
  .admin-table { font-size: .72rem; }
}

/* زر تحميل التطبيق في الفوتر */
.footer-apk {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--gold-2) !important; font-weight: 700;
}
.footer-apk:hover { color: #fff !important; }

/* ==========================================================================
   إصلاح القصّ الأفقي على الشاشات الضيقة (الهيرو وأدوات البحث)
   ========================================================================== */
.hero-copy, .hero-grid, .hero-verse-wrap { min-width: 0; }
.hero h1 { overflow-wrap: break-word; }
.hero-trust { flex-wrap: wrap; }
.hero-stats { min-width: 0; }
.search-form { min-width: 0; }
.search-form input { flex: 1 1 auto; min-width: 0; }
.search-form .btn { flex: none; }

.quran-toolbar { min-width: 0; }
.quran-search { min-width: 0; flex: 1 1 180px; }
.quran-search input { width: 100%; min-width: 0; }

@media (max-width: 380px) {
  .hero h1 { font-size: 2.15rem; line-height: 1.35; }
  .hero-lead { font-size: .85rem; }
  .hero-badge { font-size: .68rem; padding: .3rem .7rem; }
  .quran-search input { font-size: .78rem; }
  .quran-count { font-size: .65rem; }
}

/* لوحة التفسير: شكل مضغوط بدل الشريط العريض */
.tafsir-panel {
  margin-top: .6rem;
  background: transparent;
  border: 1px solid rgba(29, 106, 78, .16);
  border-radius: 10px;
  padding: .45rem .75rem;
  animation: none;
}
.tafsir-panel[open] { background: var(--green-soft); padding-bottom: .7rem; }
.tafsir-panel summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; color: var(--green-700);
}
.tafsir-panel summary::-webkit-details-marker { display: none; }
.tafsir-panel summary::before { content: "▾"; font-size: .65rem; opacity: .7; }
.tafsir-panel[open] summary::before { content: "▴"; }
.tafsir-panel p {
  margin: .55rem 0 0; font-family: var(--font-naskh), serif; font-size: .92rem; line-height: 2; color: var(--ink);
}
[data-theme="dark"] .tafsir-panel { border-color: var(--line); background: transparent; }
[data-theme="dark"] .tafsir-panel[open] { background: var(--surface-3); }
[data-theme="dark"] .tafsir-panel summary { color: var(--gold-2); }

/* شريط تحميل التطبيق داخل الهيرو */
.app-strip {
  display: flex; align-items: center; gap: .8rem;
  margin: 1.1rem 0 .2rem; padding: .7rem .9rem;
  border-radius: 16px; text-decoration: none;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(212, 182, 125, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  max-width: 430px;
}
.app-strip:hover { transform: translateY(-2px); border-color: var(--gold-2); background: rgba(255, 255, 255, .1); }
.app-strip-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-2), #b28e4f); color: #12261d;
}
.app-strip-copy { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1 1 auto; }
.app-strip-copy strong { font-size: .86rem; color: #fff; font-weight: 700; }
.app-strip-copy small { font-size: .68rem; color: rgba(251, 245, 231, .68); line-height: 1.5; }
.app-strip-btn {
  flex: none; display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; color: #12261d;
  background: var(--gold-2); padding: .42rem .8rem; border-radius: 999px;
}
@media (max-width: 480px) {
  .app-strip { gap: .6rem; padding: .6rem .7rem; }
  .app-strip-icon { width: 34px; height: 34px; border-radius: 10px; }
  .app-strip-copy strong { font-size: .78rem; }
  .app-strip-copy small { font-size: .62rem; }
  .app-strip-btn { font-size: .66rem; padding: .38rem .6rem; }
}

/* ==========================================================================
   أنميشن شريط تحميل التطبيق (خفيف ومحترم لتقليل الحركة)
   ========================================================================== */
.app-strip {
  position: relative;
  overflow: hidden;
  animation:
    appStripIn .75s cubic-bezier(.22, 1, .36, 1) .18s both,
    appStripGlow 4.2s ease-in-out 1.2s infinite;
}

.app-strip-icon {
  animation: appIconFloat 3s ease-in-out infinite;
}

.app-strip-btn { position: relative; overflow: hidden; }
.app-strip-btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .65) 50%, transparent 75%);
  transform: translateX(-150%);
  animation: appShine 3.4s ease-in-out 1s infinite;
  pointer-events: none;
}

@keyframes appStripIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes appStripGlow {
  0%, 100% { border-color: rgba(212, 182, 125, .32); box-shadow: 0 0 0 0 rgba(212, 182, 125, 0); }
  50%      { border-color: rgba(212, 182, 125, .62); box-shadow: 0 0 22px -4px rgba(212, 182, 125, .28); }
}

@keyframes appIconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

@keyframes appShine {
  0%, 60%   { transform: translateX(-150%); }
  85%, 100% { transform: translateX(150%); }
}

@media (prefers-reduced-motion: reduce) {
  .app-strip, .app-strip-icon, .app-strip-btn::after { animation: none !important; }
}

/* ==========================================================================
   خلفية الهيرو الحيّة: هالات ضوء تنساب + نقشة تتحرك + شعاع يمر
   (transform/opacity فقط — بلا تأثير على الأداء)
   ========================================================================== */
.hero-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(70px); opacity: .5; will-change: transform; z-index: 0;
}
.hero-orb-1 {
  width: 520px; height: 520px; inset-inline-end: -130px; top: -170px;
  background: radial-gradient(circle at 42% 42%, rgba(212, 182, 125, .55), transparent 62%);
  animation: orbDrift1 26s ease-in-out infinite alternate;
}
.hero-orb-2 {
  width: 470px; height: 470px; inset-inline-start: -150px; bottom: -190px;
  background: radial-gradient(circle at 58% 50%, rgba(40, 130, 96, .62), transparent 66%);
  animation: orbDrift2 32s ease-in-out infinite alternate;
}

.hero-sweep {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(115deg, transparent 34%, rgba(212, 182, 125, .10) 47%, transparent 60%);
  mix-blend-mode: screen; will-change: transform, opacity;
  animation: heroSweep 16s ease-in-out infinite;
}

/* نقشة الخلفية تنساب ببطء (إزاحة بلاطة كاملة = بلا قطع) */
.hero::before { animation: heroPattern 90s linear infinite; }

/* الحلقات تتنفس */
.hero-halo-1 { animation: haloPulse 18s ease-in-out infinite; }
.hero-halo-2 { animation: haloPulse 22s ease-in-out infinite reverse; }

@keyframes orbDrift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-70px, 55px, 0) scale(1.12); }
}
@keyframes orbDrift2 {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(80px, -45px, 0) scale(.94); }
}
@keyframes heroSweep {
  0%, 100% { transform: translateX(-42%); opacity: .35; }
  50%      { transform: translateX(42%); opacity: .9; }
}
@keyframes heroPattern {
  from { background-position: 0 0; }
  to   { background-position: 210px 210px; }
}
@keyframes haloPulse {
  0%, 100% { transform: scale(1); opacity: .95; }
  50%      { transform: scale(1.09); opacity: .5; }
}

@media (max-width: 760px) {
  .hero-orb { filter: blur(46px); opacity: .42; }
  .hero-orb-1 { width: 340px; height: 340px; }
  .hero-orb-2 { width: 300px; height: 300px; }
  .hero-sweep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orb, .hero-sweep, .hero::before, .hero-halo-1, .hero-halo-2 { animation: none !important; }
}

/* نجوم/ذرّات ذهبية تنساب ببطء — تعطي إحساس "فيديو" هادئ */
.hero-particles {
  position: absolute; inset: -10% 0; pointer-events: none; z-index: 0;
  background-repeat: repeat;
  will-change: transform;
}
.hero-particles-1 {
  background-image: radial-gradient(circle, rgba(212, 182, 125, .75) 1px, transparent 1.7px);
  background-size: 150px 170px;
  opacity: .3;
  animation: particlesDrift 46s linear infinite;
}
.hero-particles-2 {
  background-image: radial-gradient(circle, rgba(255, 255, 255, .55) 1px, transparent 1.5px);
  background-size: 90px 110px;
  opacity: .18;
  animation: particlesDrift 30s linear infinite reverse;
}

@keyframes particlesDrift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-24px, -170px, 0); }
}

@media (max-width: 760px) {
  .hero-particles-1 { opacity: .22; background-size: 120px 140px; }
  .hero-particles-2 { opacity: .12; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-particles { animation: none !important; }
}


/* مشهد الهيرو: أفق مسجد عند الغسق (SVG بألوان الهوية) */
.hero-scene {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../images/hero-scene.svg") bottom center / 100% auto no-repeat;
  opacity: .8;
}
@media (max-width: 760px) {
  .hero-scene { opacity: .62; background-size: 100% auto; background-position: bottom center; }
}

/* حدود بطاقة آية اليوم حتى لا تطول الهيرو في الآيات الطويلة */
.hero-verse-wrap .verse-quran {
  max-height: clamp(190px, 30vh, 300px);
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  overflow-y: auto;
  padding-inline-end: .4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(178, 142, 79, .45) transparent;
}
.hero-verse-wrap .verse-quran::-webkit-scrollbar { width: 5px; }
.hero-verse-wrap .verse-quran::-webkit-scrollbar-thumb { background: rgba(178, 142, 79, .45); border-radius: 99px; }


/* مساحة للأفق أسفل صف الإحصاءات */
.hero { padding-bottom: clamp(86px, 8vw, 118px); }
@media (max-width: 760px) { .hero { padding-bottom: 74px; } }

/* أمان: أي نص حديث داخل حاوية فاتحة ياخد لون الحبر (مش لون الوضع الليلي) */
.hadith-card .hadith-text,
.hadith-detail .hadith-text,
.hadith-card-text { color: var(--ink-2); }
.hadith-card .hadith-meta,
.hadith-detail .hadith-meta { color: var(--muted); }
.hadith-card-text.large { font-size: clamp(1.2rem, 3vw, 1.5rem); line-height: 2.1; margin-bottom: 1.2rem; }

/* أزرار بطاقة الحديث: أيقونة فقط (النص مخفي) بلا تراكب */
.hadith-card-foot .action-btn { gap: 0; overflow: hidden; }
.hadith-card-foot .action-btn svg { flex: none; }
.hadith-card-foot .action-btn span { display: none; }


[data-splash="0"] .splash { display: none !important; }

/* زر «المزيد» لنصوص الأذكار الطويلة */
.azkar-more {
  margin: .35rem 0 .1rem; font-size: .7rem; font-weight: 700;
  color: var(--green-700); display: inline-flex; align-items: center; gap: .3rem;
}
.azkar-more svg { transition: transform .2s ease; }
.azkar-more[aria-expanded="true"] svg { transform: rotate(180deg); }
[data-theme="dark"] .azkar-more { color: var(--gold-2); }
.azkar-text.expanded { max-height: none; }

/* ==========================================================================
   توحيد بطاقات الأذكار والأدعية: صفوف متساوية وأقدام مثبّتة أسفل البطاقة
   ========================================================================== */
.azkar-card { display: flex; flex-direction: column; }
.azkar-card .azkar-text { min-height: calc(1.1rem * 2.1 * 2); }
.azkar-card .azkar-source { margin-top: auto; }
.azkar-card .azkar-card-foot { margin-top: .15rem; }

@media (min-width: 761px) {
  /* تدفّق عمودين متلاصقين (masonry) بلا فراغات ولا صفوف فارغة */
  .azkar-grid { display: block; columns: 2; column-gap: .85rem; }
  .azkar-card { break-inside: avoid; margin-bottom: .85rem; }
}

@media (max-width: 760px) {
  /* عمود واحد: ارتفاع طبيعي بلا فراغ */
  .azkar-card .azkar-text { min-height: 0; }
}

/* ==========================================================================
   صفحة الأذكار — إعادة تصميم v2 (شبكة متوازنة، كروت متساوية، أزرار مرتبة)
   مقيّدة بـ .azkar-page حتى لا تؤثر على بقية الصفحات
   ========================================================================== */
.azkar-page {
  --az-lines: 6;                 /* عدد أسطر النص قبل الطيّ */
  --az-gap: 20px;
  --az-pad: 22px;
  --az-radius: 20px;
}

.azkar-page .azkar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--az-gap);
  align-items: stretch;
}

.azkar-page .azkar-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--az-pad);
  border-radius: var(--az-radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.azkar-page .azkar-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.azkar-page .azkar-card.is-done {
  border-color: rgba(29,106,78,.35);
  background: linear-gradient(180deg, var(--green-soft), var(--surface) 55%);
}

/* الصف العلوي */
.azkar-page .azkar-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.azkar-page .azkar-card-head h3 {
  font-size: 1.05rem; font-weight: 800; line-height: 1.6; margin: 0 0 4px;
  color: var(--ink);
}
.azkar-page .azkar-grade {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: #2f7f57;
  background: rgba(47,127,87,.08);
  border: 1px solid rgba(47,127,87,.18);
  border-radius: 999px; padding: 2px 9px;
}
.azkar-page .azkar-grade svg { width: 13px; height: 13px; }

.azkar-page .azkar-repeat-pill {
  flex: none; font-size: 14px; font-weight: 800;
  color: var(--green-800); background: #efe6d2;
  border: 1px solid rgba(178,142,79,.28);
  border-radius: 999px; padding: 4px 12px; line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* النص */
.azkar-page .azkar-text {
  position: relative; overflow: hidden;
  margin-top: 12px;
  max-height: calc(2em * var(--az-lines));
  transition: max-height .3s ease;
}
.azkar-page .azkar-text::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 52px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none; transition: opacity .25s ease;
}
.azkar-page .azkar-text.expanded { max-height: 200em; }
.azkar-page .azkar-text.expanded::after { opacity: 0; }
.azkar-page .azkar-text p {
  font-family: var(--font-naskh), "Noto Naskh Arabic", serif;
  font-size: clamp(1.125rem, 0.55vw + 1rem, 1.375rem);
  line-height: 2; text-align: right; color: var(--ink-2);
  margin: 0; overflow-wrap: break-word;
}

.azkar-page .azkar-more {
  align-self: flex-start; margin: 6px 0 0;
  font-size: 13px; font-weight: 700; color: var(--gold);
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; padding: 3px 0; cursor: pointer;
}
.azkar-page .azkar-more svg { transition: transform .25s ease; }
.azkar-page .azkar-more[aria-expanded="true"] svg { transform: rotate(180deg); }

/* المصدر ملتصق بأسفل المحتوى */
.azkar-page .azkar-source {
  margin-top: auto; padding: 14px 0 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px; line-height: 1.8; color: var(--muted);
}

/* شريط الأزرار */
.azkar-page .azkar-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-top: 2px;
}
.azkar-page .azkar-actions { display: flex; align-items: center; gap: 10px; }

.azkar-page .azkar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line);
  cursor: pointer; transition: all .18s ease;
}
.azkar-page .azkar-btn:hover,
.azkar-page .azkar-btn:focus-visible {
  color: var(--gold); border-color: rgba(178,142,79,.55); background: var(--gold-soft);
}
.azkar-page .azkar-btn.is-active { color: #b8434d; border-color: rgba(184,67,77,.4); background: rgba(184,67,77,.06); }

/* العدّاد */
.azkar-page .zikr-counter {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 8px 5px 12px;
}
.azkar-page .counter-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: transparent;
  color: var(--green-800); font-size: 15px; font-weight: 800; cursor: pointer;
}
.azkar-page .counter-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.azkar-page .counter-ring-bg { fill: var(--surface); stroke: var(--line); stroke-width: 4; }
.azkar-page .counter-ring { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .25s ease; }
.azkar-page .counter-btn span { position: relative; z-index: 1; }
.azkar-page .counter-btn.done { color: #2f7f57; }
.azkar-page .counter-btn.done .counter-ring { stroke: #2f7f57; }
.azkar-page .zikr-counter-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.azkar-page .zikr-counter-label b { color: var(--ink-2); font-weight: 800; }
.azkar-page .zikr-reset { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.azkar-page .zikr-reset:hover { color: var(--gold); background: var(--gold-soft); }

/* التبويبات */
.azkar-page .azkar-tabs-wrap { margin-bottom: 18px; }
.azkar-page .azkar-tabs {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.azkar-page .azkar-tabs::-webkit-scrollbar { display: none; }
.azkar-page .azkar-tab {
  flex: 0 0 auto; min-width: 132px; justify-content: center;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  padding: 8px 14px; gap: 8px; text-align: center;
  transition: all .18s ease;
}
.azkar-page .azkar-tab.active {
  background: var(--green-800); color: #fff; border-color: var(--green-800);
  box-shadow: 0 12px 26px -18px rgba(6,31,23,.9);
}
.azkar-page .azkar-tab.active small { color: rgba(255,255,255,.7); }
.azkar-page .azkar-tab:hover { border-color: rgba(178,142,79,.5); }

/* الاستجابة */
@media (max-width: 768px) {
  .azkar-page { --az-pad: 16px; --az-gap: 14px; }
  .azkar-page .azkar-grid { grid-template-columns: 1fr; }
  .azkar-page .azkar-text p { font-size: 1.0625rem; }
  .azkar-page .azkar-btn { width: 44px; height: 44px; }
  .azkar-page .azkar-card-head h3 { font-size: 1rem; }
  .azkar-page .zikr-counter { padding: 4px 6px 4px 10px; }
  .azkar-page .counter-btn { width: 44px; height: 44px; }
}

/* الوضع الليلي */
[data-theme="dark"] .azkar-page .azkar-repeat-pill { background: rgba(255,255,255,.07); color: var(--gold-2); border-color: rgba(212,182,125,.3); }
[data-theme="dark"] .azkar-page .azkar-grade { color: #8ed5b3; background: rgba(142,213,179,.08); border-color: rgba(142,213,179,.2); }
[data-theme="dark"] .azkar-page .zikr-counter { background: var(--surface-3); }
[data-theme="dark"] .azkar-page .azkar-btn:hover { background: rgba(212,182,125,.1); }
[data-theme="dark"] .azkar-page .azkar-tab { background: var(--surface); }
[data-theme="dark"] .azkar-page .azkar-tab.active { background: var(--gold-2); color: #10251c; border-color: var(--gold-2); }

/* أداة إخفاء بصري (متاحة لقارئات الشاشة) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* زر المزيد يظهر فقط عند وجود نص مقصوص */
.azkar-page .azkar-more[hidden] { display: none !important; }

/* تأكيد النسخ: أيقونة ✓ في نفس الزر */
.is-copied { color: #2f7f57 !important; border-color: rgba(47,127,87,.45) !important; background: rgba(47,127,87,.08) !important; }

/* ==========================================================================
   تلميع الصفحة الرئيسية (v3) — مسافات/هيدر/هيرو/أقسام/مواقيت/مسبحة/فوتر
   ========================================================================== */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --section-gap: clamp(48px, 8vw, 96px);
  --header-h: 64px;
}

/* 1) الهيدر الثابت: خلفية معتمة + بلور 12px */
.site-header {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px -24px rgba(6, 31, 23, .45);
}
section[id], main[id], h1, h2, h3 { scroll-margin-top: calc(var(--header-h) + 20px); }

/* 2) زر التخطي: مخفي خارج الشاشة */
.skip-link {
  position: fixed; inset-inline-start: var(--sp-4); top: 0;
  transform: translateY(-200%); transition: transform .18s ease; z-index: 2000;
}
.skip-link:focus, .skip-link:focus-visible { transform: translateY(12px); }

/* 3) الهيرو */
.hero { padding-bottom: clamp(40px, 5vw, 64px); }
.hero-scene { opacity: .5; }
.verse-card::before { opacity: .028; }
.verse-card { min-height: 0; }
.home-page .search-form { border-radius: 18px; }
.home-page .app-strip { border-radius: 18px; margin-top: var(--sp-3); }

/* 4) شبكة الأقسام */
.home-page .category-grid { align-items: stretch; }
.home-page .category-card { display: flex; flex-direction: column; min-height: 172px; }
.home-page .category-card > div { display: flex; flex-direction: column; flex: 1 1 auto; }
.home-page .category-card p {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
}
.home-page .category-count { margin-top: auto; padding-top: var(--sp-3); }
.home-page .category-card::after { opacity: .3; }

/* 5) حديث اليوم */
.home-page .hadith-text { line-height: 2.1; margin-bottom: var(--sp-6); }
.home-page .hadith-meta { gap: var(--sp-2) var(--sp-3); }

/* 6) مواقيت الصلاة: 6 أعمدة */
.home-page .prayer-times { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-2); }
.home-page .prayer-time { padding: var(--sp-2) var(--sp-1); }
.home-page .prayer-time.is-next {
  background: rgba(212, 182, 125, .18);
  border-color: rgba(212, 182, 125, .45);
  box-shadow: inset 0 0 0 1px rgba(212, 182, 125, .18);
}
@media (max-width: 1024px) {
  .home-page .prayer-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .home-page .prayer-times { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .home-page .prayer-time strong { font-size: .72rem; }
}

/* 7) المسبحة المصغّرة */
.home-page .tasbih-card { padding: var(--sp-6) var(--sp-6) var(--sp-4); }
.home-page .dhikr-tabs { gap: var(--sp-1); padding: 4px; }
.home-page .dhikr-tabs button { font-size: .74rem; padding: .5rem .3rem; min-height: 34px; }
.home-page .dhikr-tabs button.active {
  background: var(--green-800); color: #fff; box-shadow: var(--shadow-sm);
}
.home-page .tasbih-circle { width: 168px; height: 168px; }
.home-page .tasbih-count { font-size: 3.1rem; }
.home-page .tasbih-label { font-size: .95rem; }
.home-page .tasbih-circle:active { transform: scale(.96); }
.home-page .tasbih-card-foot { font-size: .72rem; }
.home-page .tasbih-card-foot .text-btn,
.home-page .tasbih-card-foot .text-link { font-size: .72rem; padding: .35rem .2rem; }

/* 8) معاينة الأذكار */
.home-page .azkar-preview-grid { align-items: stretch; }
.home-page .azkar-preview-card p,
.home-page .azkar-preview-card .azkar-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.home-page .azkar-preview-card { display: flex; flex-direction: column; }
.home-page .azkar-preview-card .content-actions { margin-top: auto; }
.home-page .azkar-preview-card .action-btn { width: 38px; height: 38px; }

/* 9) المقالات */
.home-page .articles-preview-grid { align-items: stretch; }
.home-page .article-preview-card { display: flex; flex-direction: column; height: 100%; }
.home-page .article-preview-card h3 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.home-page .article-preview-card p {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.home-page .article-preview-card .article-link { margin-top: auto; padding-top: var(--sp-4); }
.home-page .article-preview-card.featured { position: relative; }
.home-page .article-preview-card.featured::before {
  content: "مقال مميّز"; position: absolute; top: var(--sp-4); inset-inline-start: var(--sp-4);
  font-size: .62rem; font-weight: 800; color: var(--gold-2);
  background: rgba(212, 182, 125, .14); border: 1px solid rgba(212, 182, 125, .35);
  border-radius: 999px; padding: 2px 10px;
}

/* 10) قسم CTA */
.home-page .home-cta { padding: clamp(28px, 4vw, 48px); }
.home-page .home-cta-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.home-page .home-cta-actions .btn { min-height: 48px; padding-inline: var(--sp-6); }

/* 11) الفوتر */
.site-footer .footer-inner { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.site-footer .footer-bottom { font-size: 13px; color: rgba(247, 241, 227, .62); gap: var(--sp-4); }
.site-footer .footer-bottom a { color: rgba(247, 241, 227, .78); }

/* أرقام موحّدة */
.home-page .prayer-time strong,
.home-page .tasbih-count,
.home-page .hero-stats b { font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .site-footer .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-footer .footer-inner { grid-template-columns: 1fr 1fr; }
  .home-page .home-cta-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* بطاقة آية اليوم: لا تمرير داخلي — البداية ظاهرة دائمًا مع تلاشٍ سفلي */
.home-page .hero-verse-wrap .verse-quran {
  overflow: hidden !important;
  max-height: clamp(180px, 26vh, 280px);
}

/* نص آية اليوم: كتلة نصية عادية (يبدأ من أول الآية ويُقصّ من الأسفل) */
.home-page .hero-verse-wrap .verse-quran {
  display: block !important;
  -webkit-box-orient: initial !important;
  text-align: center;
  overflow: hidden !important;
}

/* أهداف لمس ≥44px على الموبايل */
@media (max-width: 760px) {
  .action-btn,
  .icon-btn,
  .azkar-btn,
  .counter-btn,
  .text-btn,
  .nav-more-btn,
  .location-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .hadith-card-foot .action-btn,
  .azkar-card .content-actions .action-btn {
    width: 44px !important;
    height: 44px !important;
  }
  .hadith-card-foot .action-btn span { display: none; }
}

/* تبويبات المسبحة: هدف لمس 44px */
.home-page .dhikr-tabs button { min-height: 44px; }

/* تنبيه تثبيت iOS (Safari فقط) */
.ios-hint[hidden] { display: none !important; }
.ios-hint {
  position: fixed; z-index: 300; inset-inline: 12px; bottom: calc(74px + env(safe-area-inset-bottom));
  animation: riseIn .3s ease-out;
}
.ios-hint-inner {
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(178, 142, 79, .35); border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.ios-hint-ico {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green-800); color: var(--gold-2);
}
.ios-hint-copy { flex: 1 1 auto; min-width: 0; }
.ios-hint-copy strong { display: block; font-size: .82rem; color: var(--ink); }
.ios-hint-copy p { margin: 2px 0 0; font-size: .72rem; line-height: 1.7; color: var(--muted); }
.ios-hint-close {
  flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 1rem;
}
.ios-hint-close:hover { color: var(--ink); background: var(--surface-2); }
[data-theme="dark"] .ios-hint-inner { background: color-mix(in srgb, var(--surface) 92%, transparent); }

.ios-hint-copy .ios-share { vertical-align: -2px; color: var(--gold); }

/* ==========================================================================
   صفحة التثبيت /install
   ========================================================================== */
.install-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 860px) { .install-grid { grid-template-columns: 1fr; } }

.install-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px;
}
.install-head h2 { margin: 6px 0 0; font-size: 1.15rem; }
.install-badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 3px 11px; border: 1px solid transparent;
}
.install-badge.is-ios { color: #2f5f8a; background: rgba(47,95,138,.09); border-color: rgba(47,95,138,.2); }
.install-badge.is-android { color: #2f7f57; background: rgba(47,127,87,.09); border-color: rgba(47,127,87,.2); }
[data-theme="dark"] .install-badge.is-ios { color: #9dc2e4; background: rgba(157,194,228,.1); }
[data-theme="dark"] .install-badge.is-android { color: #8ed5b3; background: rgba(142,213,179,.1); }

.install-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; }
.install-steps li > b {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(178,142,79,.3);
}
.install-steps strong { display: block; font-size: .88rem; color: var(--ink); }
.install-steps span { display: block; font-size: .76rem; color: var(--muted); line-height: 1.8; }

.install-note {
  margin: 0; padding: 10px 12px; border-radius: 12px; font-size: .74rem; line-height: 1.8;
  background: rgba(184,67,77,.06); border: 1px solid rgba(184,67,77,.16); color: #8e4a51;
}
[data-theme="dark"] .install-note { color: #e3a5aa; }
.install-apk { align-self: flex-start; margin-top: auto; min-height: 46px; }

.install-share { margin-top: 28px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.install-share > p:first-child { margin: 0 0 10px; font-size: .84rem; font-weight: 700; color: var(--ink); }
.install-linkbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.install-linkbox code {
  flex: 1 1 220px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: .78rem; direction: ltr; text-align: left;
}
.install-hint { margin: 10px 0 0; font-size: .74rem; color: var(--muted); }

.install-card.is-recommended { border-color: rgba(178,142,79,.45); box-shadow: 0 18px 40px -30px rgba(6,31,23,.55); }
.install-card.is-recommended .install-head h2::after {
  content: "مقترح لهاتفك"; margin-inline-start: 8px; font-size: 10px; font-weight: 800;
  color: var(--gold); background: var(--gold-soft); border-radius: 999px; padding: 2px 8px; vertical-align: middle;
}

/* قسم التثبيت المتقدم (بروفايل iOS) */
.install-advanced {
  margin-top: 20px; padding: 20px; border-radius: 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%);
  border: 1px solid rgba(178, 142, 79, .3);
}
.install-advanced-copy { flex: 1 1 320px; min-width: 0; }
.install-advanced h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.install-advanced p { margin: 0 0 8px; font-size: .8rem; line-height: 1.9; color: var(--ink-2); }
.install-advanced-steps { margin: 0; padding-inline-start: 18px; font-size: .76rem; line-height: 2; color: var(--muted); }
[data-theme="dark"] .install-advanced { background: linear-gradient(180deg, rgba(212,182,125,.1), var(--surface) 70%); }

/* أزرار التطبيق: أندرويد + آيفون جنب بعض */
.app-strip { text-decoration: none; }
.app-strip-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.app-strip-btn {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
  font-size: .72rem; font-weight: 800; color: #12261d;
  background: var(--gold-2); padding: .45rem .7rem; border-radius: 999px;
  white-space: nowrap; transition: transform .15s ease, background .15s ease;
}
.app-strip-btn:hover { transform: translateY(-1px); background: #e4c791; }
.app-strip-btn.is-ios {
  background: rgba(255, 255, 255, .1); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(212, 182, 125, .55);
}
.app-strip-btn.is-ios:hover { background: rgba(255, 255, 255, .18); }

@media (max-width: 520px) {
  .app-strip { flex-wrap: wrap; }
  .app-strip-copy { flex: 1 1 100%; order: 2; }
  .app-strip-icon { order: 1; }
  .app-strip-actions { order: 3; flex: 1 1 100%; justify-content: stretch; gap: 8px; }
  .app-strip-actions .app-strip-btn { flex: 1 1 0; justify-content: center; min-height: 44px; }
}

/* مجموعة أزرار التطبيق داخل CTA تبقى ملتصقة وتنزل سطرًا واحدًا */
.home-page .home-cta-actions { row-gap: 10px; }
.home-page .cta-app-group { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
@media (max-width: 520px) {
  .home-page .cta-app-group { flex: 1 1 100%; gap: 8px; }
  .home-page .cta-app-group .btn { flex: 1 1 0; min-height: 48px; justify-content: center; padding-inline: 10px; font-size: .8rem; }
}

/* توحيد أزرار الهيدر: نفس الحجم والمسافات والتمركز */
.site-header .header-actions { gap: 6px; align-items: center; }
.site-header .header-actions .icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%; padding: 0; line-height: 0;
}
.site-header .header-actions .icon-btn svg { width: 19px; height: 19px; display: block; }
.site-header .header-actions .icon-btn .theme-icon-light,
.site-header .header-actions .icon-btn .theme-icon-dark { place-items: center; }

@media (max-width: 900px) {
  .site-header .header-actions { gap: 2px; }
  .site-header .header-actions .icon-btn { width: 44px; height: 44px; }
}

/* ==========================================================================
   قارئ السورة — تحسين الموبايل: نص بعرض كامل + شريط أدوات أفقي + تفسير مضغوط
   ========================================================================== */
@media (max-width: 760px) {
  .reader-container { padding-inline: 12px; }
  .reader-topbar { flex-wrap: wrap; gap: 10px; }
  .reader-title span { font-size: .95rem; }
  .reader-title small { font-size: .66rem; }

  .surah-sheet { padding: 14px 12px; border-radius: 18px; }
  .surah-head { padding-bottom: 1rem; margin-bottom: .4rem; }
  .surah-head h1 { font-size: 2rem; }

  .ayah-card {
    grid-template-columns: 1fr; gap: 10px;
    padding: 14px 12px; border-radius: 16px;
  }
  .ayah-body { order: 1; min-width: 0; }
  .ayah-rail {
    order: 2; flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
  }
  .ayah-number { width: 32px; height: 32px; font-size: .72rem; flex: none; }
  .ayah-rail .action-btn, .ayah-rail .action-btn.compact { width: 40px; height: 40px; }
  .ayah-text { font-size: 1.32rem; line-height: 2.2; text-align: right; }

  .tafsir-panel { margin-top: 8px; background: transparent; border: 0; padding: 0; }
  .tafsir-panel summary {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .74rem; font-weight: 700; color: var(--green-700);
    background: var(--green-soft); border: 1px solid rgba(29,106,78,.15);
    border-radius: 999px; padding: 6px 12px;
  }
  .tafsir-panel[open] summary { border-color: rgba(29,106,78,.3); }
  .tafsir-panel p {
    margin: 8px 0 0; padding: 10px 12px;
    background: var(--green-soft); border-radius: 12px;
    font-size: .92rem; line-height: 2;
  }
  [data-theme="dark"] .tafsir-panel summary { color: var(--gold-2); background: var(--surface-2); border-color: var(--line); }
  [data-theme="dark"] .tafsir-panel p { background: var(--surface-2); }

  .surah-end { flex-wrap: wrap; gap: 10px; }
  .surah-end-nav { width: 100%; justify-content: space-between; }
}

/* إشعار صغير (توست) */
.uns-toast {
  position: fixed; z-index: 500; inset-inline: 16px; bottom: calc(88px + env(safe-area-inset-bottom));
  margin: 0 auto; max-width: 420px; width: fit-content;
  background: var(--green-800); color: #fff;
  font-size: .78rem; font-weight: 600; line-height: 1.7; text-align: center;
  padding: 10px 16px; border-radius: 14px;
  box-shadow: 0 18px 40px -22px rgba(6, 31, 23, .8);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.uns-toast.is-on { opacity: 1; transform: translateY(0); }
@media (min-width: 761px) { .uns-toast { bottom: 24px; } }

/* ==========================================================================
   زر تحديث عائم أعلى الصفحة (تحت الهيدر)
   ========================================================================== */
.refresh-chip[hidden] { display: none !important; }
.refresh-chip {
  position: fixed; z-index: 120;
  top: calc(var(--header-h) + 10px); inset-inline: 0;
  margin-inline: auto; width: fit-content;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; min-height: 40px;
  border-radius: 999px; border: 1px solid rgba(212, 182, 125, .5);
  background: var(--green-800); color: #f7f1e3;
  font: inherit; font-size: .78rem; font-weight: 700;
  box-shadow: 0 14px 30px -20px rgba(6, 31, 23, .7);
  cursor: pointer;
  opacity: 0; transform: translateY(-12px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
}
.refresh-chip.is-on { opacity: 1; transform: translateY(0) scale(1); }
.refresh-chip:hover { background: var(--green-700); border-color: var(--gold-2); color: #fff; }
.refresh-chip-icon { display: grid; place-items: center; color: var(--gold-2); }
.refresh-chip.is-spinning .refresh-chip-icon svg { animation: spin .55s linear infinite; }
.refresh-chip.is-spinning { pointer-events: none; }

@media (max-width: 900px) {
  .refresh-chip { top: calc(var(--header-h) + 6px); min-height: 42px; font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .refresh-chip { transition: none; }
}
