/* ===================================================================
   المصحف الشريف - quran.css
=================================================================== */
.hidden{ display:none !important; }

.quran-wrap{ padding-top: 10px; padding-bottom: 60px; }

.trust-note{
  background: var(--surface); border:1px dashed color-mix(in srgb, var(--gold) 60%, var(--border)); border-radius: var(--radius);
  padding: 12px 16px; font-size:.8rem; color: var(--text-dim); margin: -4px 0 14px; line-height:1.9;
  animation: qFadeDown .25s ease both;
}
.trust-note a{ color: var(--gold-bright); font-weight:700; text-decoration: underline; }
[data-theme="light"] .trust-note a{ color: color-mix(in srgb, var(--gold-bright) 62%, #000); }
@keyframes qFadeDown{ from{ opacity:0; transform: translateY(-6px); } to{ opacity:1; transform:none; } }

/* -------- شريط الأدوات فوق قائمة السور -------- */
.quran-toolbar{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.q-search{ position:relative; display:block; }
.q-search .city-input{ width:100%; padding-inline-start:42px; border-radius:99px; box-sizing:border-box; }
.q-search-ico{ position:absolute; inset-inline-start:15px; top:50%; transform:translateY(-50%); font-size:.95rem; opacity:.75; pointer-events:none; }
.q-toggles{ display:flex; gap:8px; flex-wrap:wrap; }
.continuous-label{ display:flex; align-items:center; gap:8px; font-size:.8rem; color:var(--text-dim); cursor:pointer; }
.continuous-label input{ width:18px; height:18px; accent-color: var(--gold); }
.q-pill{
  position:relative;
  flex:1 1 0; min-width:130px; justify-content:center; gap:7px; padding:9px 12px; border-radius:99px;
  background: var(--surface); border:1px solid var(--border); font-weight:600; user-select:none;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.q-pill input{ position:absolute; opacity:0; width:1px; height:1px; pointer-events:none; }
.q-pill.on{
  background: var(--gold); color:#171203; border-color: var(--gold); font-weight:800;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--gold) 45%, transparent);
}
.q-pill.on span::after{ content:' · شغّال'; font-weight:700; }
.q-pill:has(input:focus-visible){ box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-bright) 45%, transparent); }
.q-actions{ display:flex; gap:8px; overflow-x:auto; padding:2px 1px 6px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; }
.q-actions .btn{ flex:none; white-space:nowrap; border-radius:99px; }

/* -------- كارت البداية: كمّل من حيث وقفت + نسبة القراءة -------- */
.q-hero{
  position:relative; display:flex; align-items:center; gap:14px; overflow:hidden;
  padding:18px 16px 16px; margin-bottom:14px; border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(130% 150% at 100% 0%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 62%),
    var(--surface);
  border:1px solid color-mix(in srgb, var(--gold) 60%, var(--border));
  box-shadow: var(--shadow);
}
.q-hero::after{
  content:''; position:absolute; width:150px; height:150px; inset-inline-start:-52px; bottom:-60px;
  border:1.5px solid color-mix(in srgb, var(--gold) 28%, transparent); border-radius:22px; transform:rotate(45deg); pointer-events:none;
}
.q-info-btn{
  position:absolute; top:9px; inset-inline-end:auto; left:9px; z-index:2;
  width:28px; height:28px; border-radius:50%; display:grid; place-items:center; padding:0;
  font-size:.95rem; line-height:1; cursor:pointer;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  border:1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold-bright);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.q-info-btn:hover{ transform:scale(1.08); }
.q-info-btn.on{ background: var(--gold); color:#171203; }
[data-theme="light"] .q-info-btn{ color: color-mix(in srgb, var(--gold-bright) 55%, #000); }
[data-theme="light"] .q-info-btn.on{ color:#171203; }

.resume-banner{
  position:relative; z-index:1; flex:1; min-width:0;
  display:flex; flex-direction:column; align-items:flex-start; gap:3px; text-align:start;
  background:none; border:0; padding:0; margin:0; font-size:inherit;
}
.rb-eyebrow{ font-size:.76rem; font-weight:700; color: var(--gold-bright); letter-spacing:.2px; }
.rb-title{ font-family: var(--font-display); font-weight:700; font-size:1.4rem; line-height:1.35; color: var(--text); }
.rb-title span{ font-size:1rem; color: var(--text-dim); font-weight:400; }
.rb-sub{ font-size:.75rem; color: var(--text-dim); line-height:1.6; }
.rb-btn{ margin-top:9px; padding:9px 20px; border-radius:99px; font-size:.85rem; font-weight:700; }
[data-theme="light"] .rb-eyebrow{ color: color-mix(in srgb, var(--gold-bright) 55%, #000); }

.completion-percent-card{
  position:relative; z-index:1; flex:none; width:88px; margin:0; padding:0; background:none; border:0; border-radius:0;
  display:flex; flex-direction:column; align-items:center; gap:3px; text-align:center;
}
.q-ring{ position:relative; width:76px; height:76px; }
.q-ring svg{ width:100%; height:100%; transform:rotate(-90deg); display:block; }
.q-ring circle{ fill:none; stroke-width:7; }
.q-ring-bg{ stroke: color-mix(in srgb, var(--text) 14%, transparent); }
.q-ring-fg{ stroke: var(--gold-bright); stroke-linecap:round; transition: stroke-dashoffset .9s cubic-bezier(.22,.8,.3,1); }
[data-theme="light"] .q-ring-fg{ stroke: color-mix(in srgb, var(--gold-bright) 75%, #b45309); }
.q-ring-num{ position:absolute; inset:0; display:grid; place-items:center; font-family: var(--font-display); font-size:1.05rem; font-weight:700; color: var(--text); }
.cp-label{ font-size:.66rem; color: var(--text-dim); line-height:1.3; }
.cp-text{ font-size:.66rem; color: var(--gold-bright); font-weight:700; line-height:1.3; }
[data-theme="light"] .cp-text{ color: color-mix(in srgb, var(--gold-bright) 55%, #000); }

/* -------- تبويبات الفهرس (سور/أجزاء/أحزاب) -------- */
.index-tabs{
  display:grid; grid-template-columns:repeat(3,1fr); gap:4px; padding:4px; margin-bottom:14px;
  background: var(--surface-2); border:1px solid var(--border); border-radius:99px;
}
.index-tabs .btn{ border-radius:99px; border-color:transparent; background:transparent; box-shadow:none; padding:9px 4px; font-size:.86rem; justify-content:center; }
.index-tabs .btn.primary{ background: var(--gold); color:#171203; box-shadow: 0 2px 10px color-mix(in srgb, var(--gold) 40%, transparent); }
.index-tabs .btn:not(.primary):hover{ background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--text); transform:none; box-shadow:none; }

/* -------- شبكة الأجزاء/الأحزاب -------- */
.juz-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(0,130px)); gap:12px; }
.juz-card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding: 16px 10px; text-align:center; cursor:pointer;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), border-color .25s ease, box-shadow .25s ease;
}
.juz-card:hover{ transform: translateY(-4px) scale(1.02); border-color: var(--gold); box-shadow: var(--shadow); }
.juz-num{
  width:36px; height:36px; margin:0 auto 8px; border-radius:50%; border:1.5px solid var(--gold);
  display:flex; align-items:center; justify-content:center; font-weight:700; color: var(--gold-bright); font-size:.85rem;
}
.juz-title{ font-family: var(--font-display); font-size:1rem; color: var(--text); font-weight:700; }
.juz-sub{ font-size:.7rem; color: var(--text-dim); margin-top:4px; }

/* -------- شبكة السور -------- */
.surah-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap:10px; }
.loading-box{ text-align:center; padding:40px 10px; color:var(--text-dim); grid-column: 1 / -1; }
.surah-card{
  --sc: var(--gold);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--sc) 11%, transparent), transparent 55%),
    var(--surface);
  border:1px solid var(--border); border-radius: var(--radius);
  padding: 12px 12px 12px 30px; display:flex; align-items:center; gap:11px; cursor:pointer; position:relative; overflow:hidden;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), border-color .25s ease, box-shadow .25s ease;
}
.surah-card.madani{ --sc: #4fa3c7; }
.surah-card:hover{ transform: translateY(-4px) scale(1.02); border-color: var(--sc); box-shadow: var(--shadow); }
.surah-card.done{ border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); }
.surah-fav-star{
  position:absolute; top:5px; left:5px; font-size:1rem; line-height:1; padding:4px; z-index:2;
  color: var(--text-dim); transition: transform .15s ease, color .15s ease;
}
.surah-fav-star:hover{ transform: scale(1.2); }
.surah-fav-star.active{ color: var(--star-color); }
.surah-fav-star.active:hover{ color: var(--star-color-hover); }
/* رقم السورة داخل نجمة (مربعين متداخلين) */
.surah-card .num{
  position:relative; isolation:isolate; flex:none; width:44px; height:44px; display:grid; place-items:center;
  font-weight:700; color: var(--text); font-size:.82rem; line-height:1;
}
.surah-card .num::before, .surah-card .num::after{
  content:''; position:absolute; inset:7px; z-index:-1; border-radius:5px;
  background: color-mix(in srgb, var(--sc) 24%, var(--surface));
  border:1.5px solid color-mix(in srgb, var(--sc) 78%, transparent);
}
.surah-card .num::after{ transform:rotate(45deg); }
[data-theme="light"] .surah-card .num::before, [data-theme="light"] .surah-card .num::after{ background: color-mix(in srgb, var(--sc) 20%, #fff); }
.surah-card .info{ flex:1; min-width:0; }
.surah-card .ar-name{ font-family: var(--font-display); font-size:1.2rem; line-height:1.3; color: var(--text); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.surah-card .meta{ display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:3px; font-size:.68rem; color: var(--text-dim); }
.sc-place{
  padding:1px 8px; border-radius:99px; font-weight:700; white-space:nowrap;
  color: color-mix(in srgb, var(--sc) 85%, var(--text)); background: color-mix(in srgb, var(--sc) 16%, transparent);
  border:1px solid color-mix(in srgb, var(--sc) 40%, transparent);
}
[data-theme="light"] .surah-card.makki .sc-place{ color: color-mix(in srgb, var(--gold-bright) 45%, #000); }
[data-theme="light"] .surah-card.madani .sc-place{ color: #1d6f93; }
.sc-verses{ white-space:nowrap; }
.sc-done{
  position:absolute; bottom:6px; left:7px; width:17px; height:17px; border-radius:50%; display:grid; place-items:center;
  font-size:.62rem; font-weight:900; line-height:1; color:#171203; background: var(--gold);
}
@media (max-width:480px){
  .surah-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); gap:8px; }
  .sc-ic{ display:none; }
  .surah-card{ padding:11px 9px 11px 26px; gap:8px; }
  .surah-card .num{ width:40px; height:40px; font-size:.76rem; }
  .surah-card .num::before, .surah-card .num::after{ inset:6px; }
  .surah-card .ar-name{ font-size:1.08rem; }
  .sc-place{ padding:1px 6px; }
}
@media (prefers-reduced-motion:reduce){ .q-ring-fg, .trust-note{ transition:none; animation:none; } }
[data-reduce-motion="1"] .q-ring-fg, [data-reduce-motion="1"] .trust-note{ transition:none; animation:none; }

/* -------- تصغير/تكبير خط المصحف -------- */
.font-size-ctrl{ display:flex; gap:6px; }
.font-size-ctrl .btn{ padding:6px 12px; font-family: var(--font-display); }

/* -------- شريط علوي ثابت: اسم السورة + الجزء + رقم الصفحة (زرار التسمية فوق) -------- */
.mushaf-topbar{
  position: sticky; top: 0; z-index: 30;
  background: var(--surface); border:1px solid var(--gold); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom:14px;
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  box-shadow: var(--shadow);
}
.mushaf-topbar-info{ display:none; }
.topbar-page-label{ font-family: var(--font-display); font-size:1rem; color: var(--gold-bright); font-weight:700; }
.mushaf-explain{
  font-size:.78rem; color: var(--text-dim); line-height:1.9; text-align:center;
  margin: -4px 0 16px; padding: 0 6px;
}
.mushaf-explain b{ color: var(--gold-bright); }
.page-jump{ display:flex; gap:6px; }
.page-jump input{
  width:100px; padding:7px 10px; border-radius:10px; border:1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family:inherit; text-align:center;
}
.reciter-note{ font-size:.72rem; color: var(--text-dim); flex-basis:100%; text-align:center; }

/* -------- شريط إجراء الآية (نسخ) -------- */
.ayah-action-bar{
  position: sticky; top: 74px; z-index: 20;
  display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap;
  background: var(--surface); border:1px solid var(--gold); border-radius: 30px;
  padding: 8px 18px; margin-bottom:10px; width:fit-content; margin-inline:auto;
  box-shadow: var(--shadow); font-size:.85rem; font-weight:700; color: var(--gold-bright);
}
.ayah-hint{ text-align:center; font-size:.75rem; color: var(--text-dim); margin-top:10px; }

/* -------- وضع التسميع -------- */
.tasmee-mode .ayah{
  filter: blur(7px);
  border-radius: 6px;
  transition: filter .2s ease;
}
.tasmee-mode .ayah.revealed{ filter: none; background: rgba(201,162,75,.14); }
.tasmee-mode .ayah.tasmee-correct{ background: rgba(63,165,120,.22); }
.tasmee-mode .ayah:active{ filter: blur(3px); }

.tasmee-listen-bar{
  display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap;
  margin: 10px 0; padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.tasmee-status{ font-size:.8rem; color: var(--text-dim); }

/* -------- تلميح ميزة المفضلة -------- */
.fav-hint{
  display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap;
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
  border:1px solid var(--gold); border-radius: 14px;
  padding: 10px 16px; margin-bottom:14px; font-size:.8rem; font-weight:700; color: var(--text);
  text-align:center;
}
.fav-hint-close{
  background:none; border:none; color: var(--text-dim); font-size:.9rem; cursor:pointer; padding:2px 6px;
}
.fav-hint.hidden{ display:none; }

/* -------- بانر إتمام قراءة السور (شهادة الختم) -------- */
.completion-banner{
  display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap;
  background: color-mix(in srgb, var(--gold) 18%, var(--surface));
  border:1px solid var(--gold); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom:14px; font-size:.9rem; font-weight:700; text-align:center;
}
.completion-banner.hidden{ display:none; }

/* -------- لون مميز لأزرار التحميل -------- */
.btn-download{ background: color-mix(in srgb, var(--green) 22%, var(--surface-2)); border-color: var(--green); }
.btn-download:hover{ background: var(--green); color:#fff; border-color: var(--green); }

/* -------- تنزيل نص المصحف أوفلاين -------- */
.offline-progress{ font-size:.78rem; color: var(--gold-bright); text-align:center; margin:-4px 0 8px; min-height:0; }
.offline-progress:not(:empty){ min-height:1.2em; margin-top:2px; }

/* -------- مودال إحصائيات السور -------- */
.stats-modal{ position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:400; display:flex; align-items:center; justify-content:center; padding:16px; }
.stats-modal.hidden{ display:none; }
.stats-modal-content{
  background: var(--surface); border:1px solid var(--gold); border-radius: var(--radius);
  padding: 24px; max-width: 95vw; max-height:90vh; overflow:auto; position:relative; text-align:center;
}
.stats-modal-content h2{ font-family: var(--font-display); color: var(--gold-bright); margin-bottom:14px; }
.stats-modal-close{ position:absolute; top:10px; left:14px; background:none; border:none; color:var(--text-dim); font-size:1.1rem; }
#surahStatsCanvas{ max-width:100%; }

/* -------- تسجيل وقارن (تقريبي) -------- */
.record-panel{
  background: var(--surface); border:1px solid var(--gold); border-radius: var(--radius);
  padding: 16px; margin-bottom:14px; text-align:center; font-size:.85rem;
}
.record-panel.hidden{ display:none; }
.record-panel .record-actions{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:10px; }
.record-panel .record-result{ margin-top:10px; font-weight:700; color: var(--gold-bright); }

/* -------- شريط أدوات صفحة القراءة -------- */
.reader-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.reader-nav{ display:flex; gap:8px; }

.reciter-bar{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom: 20px;
}
.reciter-bar label{ font-size:.85rem; font-weight:700; color: var(--gold-bright); white-space:nowrap; }

/* -------- قائمة القراء: قائمة معروضة ثابتة داخل الصفحة + بحث -------- */
.reciter-picker{ position:relative; }
.reciter-picker-toggle{ max-width: 260px; justify-content:space-between; }
.reciter-picker-toggle .caret{ transition: transform .2s ease; }
.reciter-picker.open .reciter-picker-toggle .caret{ transform: rotate(180deg); }
.reciter-picker-toggle span:not(.caret){ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:190px; display:inline-block; vertical-align:middle; }

.reciter-panel{
  margin-top:8px; width: min(360px, 90vw);
  background: var(--surface); border:1px solid var(--gold); border-radius: 14px;
  padding: 10px; box-shadow: var(--shadow);
}
.reciter-panel input{ width:100%; margin-bottom:8px; }
.reciter-list{
  display:flex; flex-direction:column; gap:4px; max-height: 260px; overflow-y:auto;
}
.reciter-item{
  text-align:right; padding:9px 12px; border-radius:10px; font-size:.85rem;
  background: var(--surface-2); transition: background .15s ease, color .15s ease;
}
.reciter-item:hover{ background: color-mix(in srgb, var(--gold) 16%, var(--surface-2)); }
.reciter-item.active{ background: var(--gold); color:#171203; font-weight:700; }

.reciter-empty{ text-align:center; padding:14px; color: var(--text-dim); font-size:.82rem; }
.player-controls{ display:flex; align-items:center; gap:10px; flex:1; min-width:220px; }
.round-btn{
  width:42px; height:42px; border-radius:50%; flex:none; font-size:1.1rem;
  background: var(--gold); color:#171203; display:flex; align-items:center; justify-content:center;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1); position:relative; overflow:hidden;
}
.round-btn:hover{ transform: scale(1.1); box-shadow: 0 0 16px 3px color-mix(in srgb, var(--gold) 65%, transparent); }
.round-btn:active{ transform: scale(.92); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--gold) 75%, transparent); }
.seek-wrap{ flex:1; min-width:120px; }
.seek-wrap input[type="range"]{ width:100%; accent-color: var(--gold); }
.time-row{ display:flex; justify-content:space-between; font-size:.68rem; color: var(--text-dim); margin-top:2px; }
.dl-progress{ font-size:.75rem; color: var(--gold-bright); font-weight:700; }

/* -------- صفحة المصحف (شكل ورقي فاخر) -------- */
.mushaf-page{
  --ayat-scale: 1;
  background: linear-gradient(180deg, #fbf3e6, #f6ead6);
  color: #2b1c0f;
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 30px 26px;
  box-shadow: 0 15px 40px rgba(0,0,0,.35), inset 0 0 0 6px rgba(201,162,75,.15);
  position: relative;
}
[data-theme="light"] .mushaf-page{ background: linear-gradient(180deg, #fffaf0, #fbf0da); }

/* -------- وضع القراءة الليلي: خط أكبر شوية وإضاءة أهدأ وأدفأ -------- */
body.night-reading .mushaf-page{
  --night-boost: 1.14;
  background: linear-gradient(180deg, #2a2014, #211a10) !important;
  color: #e8d9b8 !important;
  box-shadow: 0 15px 40px rgba(0,0,0,.5), inset 0 0 0 6px rgba(201,162,75,.1);
}
body.night-reading .mushaf-page-header{ color:#c9a24b; border-bottom-color:#7a5a18; }
body.night-reading .ayah-end{ color:#c9a24b; border-color:#7a5a18; background: rgba(201,162,75,.08); }
body.night-reading .ayah.active-ayah{ background: rgba(201,162,75,.18); }

/* -------- رأس الصفحة داخل الورقة: الجزء يمين/شمال + اسم السورة (زي المصحف المطبوع) -------- */
.mushaf-page-header{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom:20px; padding-bottom:12px; border-bottom: 1.5px solid #c9a24b;
  font-family: var(--font-display); font-size:1.05rem; color:#7a5a18; font-weight:700;
}
.mph-juz{
  display:inline-flex; align-items:center; gap:4px; background: rgba(201,162,75,.15);
  border:1px solid #c9a24b; border-radius:10px; padding:4px 12px; font-size:.85rem;
}

/* -------- تذييل الصفحة: علامة الحزب وربعه، زي المصحف المطبوع -------- */
.mushaf-page-footer{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:22px; }
.page-nav-btn{
  border:1.5px solid #c9a24b; border-radius:20px; padding:8px 16px;
  font-family: var(--font-body); font-size:.8rem; font-weight:700; color:#7a5a18;
  background: rgba(201,162,75,.12); cursor:pointer; white-space:nowrap;
  transition: transform .15s ease, background .15s ease;
}
.page-nav-btn:hover{ background: rgba(201,162,75,.22); transform: translateY(-1px); }
.page-nav-btn:active{ transform: translateY(0) scale(.96); }

.surah-frame{
  text-align:center; margin-bottom: 22px; padding: 14px 10px;
  border: 2px solid #c9a24b; border-radius: 14px;
  background: repeating-linear-gradient(135deg, rgba(201,162,75,.08) 0 10px, rgba(201,162,75,.02) 10px 20px);
}
.surah-frame .name{ font-family: var(--font-display); font-size: 1.8rem; color:#7a5a18; font-weight:700; }
.surah-frame .sub{ font-size:.78rem; color:#8a6d3c; margin-top:4px; }

.basmala{
  text-align:center; font-family: var(--font-display); font-size: 1.7rem; color:#3a2a12;
  margin-bottom: 20px;
}

.ayat-block{
  font-family: var(--font-display);
  font-size: calc(1.55rem * var(--ayat-scale, 1) * var(--night-boost, 1)); line-height: 2.6; text-align: justify; text-align-last: center;
  direction: rtl;
}
.ayah{ transition: background .25s ease, border-radius .25s ease; cursor:pointer; }
.ayah.active-ayah{ background: rgba(201,162,75,.28); border-radius: 6px; box-shadow: 0 0 14px 3px rgba(201,162,75,.35); transition: background .25s ease, box-shadow .4s ease; }
.word{ display:inline-block; padding: 0 1px; transition: color .15s ease, transform .15s ease; }
.word.active-word{ color:#a6291a; transform: scale(1.06); }
.ayah-end{
  display:inline-flex; align-items:center; justify-content:center;
  width: 30px; height:30px; border-radius:50%;
  border: 1.5px solid #c9a24b; color:#7a5a18; background: rgba(201,162,75,.12);
  font-size: .82rem; font-family: var(--font-body); font-weight:700;
  margin: 0 4px; vertical-align: middle;
}

@media (max-width: 640px){
  .ayat-block{ font-size: calc(1.25rem * var(--ayat-scale, 1) * var(--night-boost, 1)); line-height:2.4; }
  .mushaf-page{ padding: 20px 14px; }
  .player-controls{ order:3; width:100%; }
}

.voice-compare-panel{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding:14px 16px; margin-bottom:14px;
}
.voice-compare-panel .hint-text{ color: var(--text-dim); font-size:.82rem; margin-bottom:10px; line-height:1.7; }
.voice-compare-controls{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.voice-compare-status{ font-size:.78rem; color: var(--gold-bright); }

/* ===================== تظليل الآية اللي بتتقرأ دلوقتي ===================== */
.ayah.reciting-ayah{
  background: color-mix(in srgb, var(--gold) 26%, transparent);
  border-radius: 8px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent), 0 0 16px 2px color-mix(in srgb, var(--gold) 35%, transparent);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background .3s ease, box-shadow .3s ease;
}
.ayah.reciting-ayah .ayah-end{ background: var(--gold); color:#fff; border-color: var(--gold); }

/* ---------- علامات مرجعية ملونة ---------- */
.ayah[data-bm]{ background: color-mix(in srgb, var(--bmc) 22%, transparent); border-radius:6px; box-shadow: inset 0 -3px 0 var(--bmc); }
.bm-back{ position:fixed; inset:0; z-index:9500; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; padding:16px; direction:rtl; }
.bm-back.hidden{ display:none; }
.bm-box{ width:100%; max-width:400px; max-height:90vh; overflow:auto; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:20px; padding:18px; box-shadow:var(--shadow); }
.bm-wide{ max-width:520px; }
.bm-box h3{ font-family:var(--font-display); font-size:1.2rem; margin-bottom:8px; }
.bm-verse{ color:var(--gold-bright); font-weight:700; margin-bottom:10px; }
.bm-colors{ display:flex; gap:10px; justify-content:center; margin-bottom:12px; }
.bm-colors button{ width:36px; height:36px; border-radius:50%; border:3px solid transparent; background:var(--c); cursor:pointer; }
.bm-colors button.on{ border-color:var(--text); box-shadow:0 0 0 2px var(--surface) inset; }
#bmNote{ width:100%; padding:10px; border-radius:12px; border:1px solid var(--border); background:var(--surface-2); color:var(--text); font:inherit; resize:vertical; }
.bm-actions{ display:flex; gap:8px; margin-top:12px; align-items:center; }
.bm-actions button{ border:0; background:none; font:inherit; font-weight:700; color:var(--gold-bright); padding:8px 14px; border-radius:10px; cursor:pointer; }
.bm-actions button.main{ background:var(--gold-bright); color:#1a1a1a; }
.bm-actions button.del{ color:var(--danger, #c0524a); }
.bm-top{ display:flex; align-items:center; justify-content:space-between; }
.bm-xx{ border:0; background:var(--surface-2); color:var(--text); width:34px; height:34px; border-radius:50%; cursor:pointer; }
.bm-filters{ display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 12px; }
.bm-filters button{ border:1px solid var(--border); background:var(--surface-2); color:var(--text); font:inherit; font-size:.8rem; border-radius:99px; padding:5px 10px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.bm-filters button i{ width:12px; height:12px; border-radius:50%; background:var(--c); display:inline-block; }
.bm-filters button.on{ background:var(--gold-bright); color:#1a1a1a; font-weight:700; border-color:transparent; }
.bm-item{ border:1px solid var(--border); border-right:5px solid var(--c); border-radius:12px; padding:10px 12px; margin-bottom:8px; background:var(--surface-2); cursor:pointer; }
.bm-head{ display:flex; align-items:center; gap:8px; }
.bm-head i{ width:12px; height:12px; border-radius:50%; background:var(--c); flex:none; }
.bm-head b{ flex:1; font-size:.92rem; }
.bm-head span{ color:var(--text-dim); font-size:.75rem; }
.bm-x{ border:0; background:none; cursor:pointer; font-size:1rem; }
.bm-text{ font-family:var(--font-display); font-size:1.05rem; line-height:1.9; margin-top:4px; }
.bm-note{ margin-top:4px; font-size:.82rem; color:var(--text-dim); }
.bm-empty{ text-align:center; color:var(--text-dim); padding:20px 6px; line-height:2; }
