

/* UI fonts are local in the approved Zad Al-Khair repository. */
@font-face{font-family:"Alexandria";src:url("/fonts/alexandria-arabic-400-800.woff2") format("woff2");font-weight:400 800;font-style:normal;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"Alexandria";src:url("/fonts/alexandria-latin-400-800.woff2") format("woff2");font-weight:400 800;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Amiri";src:url("/fonts/amiri-arabic-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"Amiri";src:url("/fonts/amiri-latin-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Amiri";src:url("/fonts/amiri-arabic-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"Amiri";src:url("/fonts/amiri-latin-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Aref Ruqaa";src:url("/fonts/aref-ruqaa-arabic-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Aref Ruqaa";src:url("/fonts/aref-ruqaa-arabic-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}

@font-face{
  font-family:"QCF4_Hafs_01";
  src:url("/fonts/qcf4/QCF4_Hafs_01_W.woff2") format("woff2");
  font-display:block;
}
@font-face{
  font-family:"QCF4_QBSML";
  src:url("/fonts/qcf4/QCF4_QBSML.woff2") format("woff2");
  font-display:block;
}
@font-face{
  font-family:"QUL_SurahHeader";
  src:url("/fonts/qul/QCF_SurahHeader_COLOR-Regular.ttf") format("truetype");
  font-display:block;
}
:root{
  /* Zād al-Khayr design tokens — aligned with the approved index-final-v7 identity */
  --brand:#0F5C50; --brand-strong:#0A473E; --brand-soft:#DDF1EA;
  --green:#1B705F; --green-deep:#0A473E; --green-hi:#278573;
  --gold:#C59A4A; --gold-hi:#E4C980; --gold-soft:#F4E8CA; --red:#B95157;
  --paper:#F5F0E4; --quran:#0B1611; --ayah-number:#634314; --muted:#746F63; --page-label:#465044;
  --quran-stroke:.18px; --ayah-stroke:.24px;
  --chrome:#FFFCF4; --chrome-text:#18362F; --border:#DED3BD; --line:#DED3BD;
  --select:rgba(40,122,101,.12); --select-line:rgba(197,154,74,.30);
  --sheet:#FFFCF4; --shadow:rgba(0,0,0,.18);
  --surah-banner:#082D29;
  --ui-surface:#FFFCF4; --ui-surface-2:#F5F0E4; --ui-surface-3:#EAE1CF;
  --ui-text:#132823; --ui-muted:#746F63; --ui-line:#DED3BD;
  --ui-accent:#287A65; --ui-accent-soft:#E3EFE8; --ui-gold:#C59A4A;
  --night:#082D29; --night-2:#0D3C35; --night-3:#155449; --ivory:#FFF9EA;
}
html[data-theme="dark"]{
  /* الوضع الليلي مأخوذ من خلفية وهوية النسخة النهائية لزاد الخير */
  --green:#49A18C; --green-deep:#0A473E; --green-hi:#49A18C;
  --gold:#C59A4A; --gold-hi:#E4C980; --gold-soft:rgba(228,201,128,.12); --red:#D77B80;
  --paper:#061F1D; --quran:#FFF9EA; --ayah-number:#E4C980; --muted:rgba(255,249,234,.70); --page-label:#DED8C3;
  --quran-stroke:.12px; --ayah-stroke:.16px;
  --chrome:#082D29; --chrome-text:#FFF9EA; --border:rgba(228,201,128,.24); --line:rgba(228,201,128,.24);
  --select:rgba(73,161,140,.18); --select-line:rgba(228,201,128,.28);
  --sheet:#0D3C35; --shadow:rgba(0,0,0,.48);
  --surah-banner:#E4C980;
  --ui-surface:#0D3C35; --ui-surface-2:#082D29; --ui-surface-3:#155449;
  --ui-text:#FFF9EA; --ui-muted:rgba(255,249,234,.70); --ui-line:rgba(228,201,128,.22);
  --ui-accent:#49A18C; --ui-accent-soft:rgba(73,161,140,.13); --ui-gold:#C59A4A;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:var(--paper);font-family:Alexandria,system-ui,sans-serif;-webkit-tap-highlight-color:transparent}
button,select{font:inherit}
button{cursor:pointer}

/* ---------- Mushaf ---------- */
.reader{position:fixed;inset:0;background:var(--paper);overflow:hidden}
.track{
  position:absolute;left:0;top:0;width:60400vw;height:100%;
  display:flex;flex-direction:row-reverse;direction:ltr;
  will-change:transform;transition:transform .31s cubic-bezier(.2,.78,.2,1);
  touch-action:pan-y;
}
.page{
  flex:0 0 100vw;width:100vw;height:100%;direction:rtl;position:relative;
  background:var(--paper);color:var(--quran);overflow:hidden;
  padding:calc(18px + env(safe-area-inset-top)) 2px calc(18px + env(safe-area-inset-bottom));
}
.page-meta{
  position:relative;z-index:3;width:calc(100% - 24px);height:100%;
  display:flex;justify-content:space-between;align-items:flex-start;
  padding:calc(12px + env(safe-area-inset-top)) 3px 0;
  color:var(--page-label);font-family:"Aref Ruqaa",serif;font-size:var(--page-label-size,24px);line-height:1.15;
}
.page-meta-link{
  appearance:none;-webkit-appearance:none;border:0;background:transparent;padding:0;margin:0;
  color:inherit;font:inherit;line-height:inherit;cursor:pointer;touch-action:manipulation;
  border-radius:7px;transition:color .16s ease,background .16s ease,transform .12s ease;
}
.page-meta-link:active{transform:scale(.96);color:var(--gold)}
.page-meta-link:focus-visible{outline:2px solid color-mix(in srgb,var(--gold) 55%,transparent);outline-offset:3px}
/* The ribbon stays in the top margin so it never covers Quran text. */
.page-bookmark{
  position:absolute;z-index:4;left:calc(68px + var(--mk-i,0) * 28px);top:env(safe-area-inset-top,0px);
  width:24px;height:34px;color:var(--red);pointer-events:none;
}
/* أنواع العلامات: القراءة بلونها المعتاد، والحفظ ذهبي، والمراجعة أخضر */
.page-bookmark.mk-hifz,.mk-ribbon.mk-hifz,html .bottom #bookmarkBtn.marked[data-kind="hifz"]{color:var(--gold)}
.page-bookmark.mk-review,.mk-ribbon.mk-review,html .bottom #bookmarkBtn.marked[data-kind="review"]{color:var(--green-hi)}
.mk-ribbon{width:14px;height:19px;fill:currentColor;color:var(--red);flex:none;vertical-align:-3px;margin-inline-end:6px}
.mk-list{display:flex;flex-direction:column;gap:8px;padding:4px 0 8px}
.mk-row{display:flex;align-items:center;gap:12px;width:100%;text-align:start;font:inherit;color:inherit;background:var(--ui-surface-2,transparent);border:1px solid var(--ui-line,rgba(0,0,0,.1));border-radius:14px;padding:12px 14px;cursor:pointer}
.mk-row .mk-ribbon{width:20px;height:27px;margin:0}
.mk-row span{display:flex;flex-direction:column;gap:2px;flex:1}
.mk-row small{color:var(--ui-muted,#777);font-size:12px}
.mk-row em{font-style:normal;font-size:12.5px;color:var(--ui-accent,var(--green))}
.mk-row.on{border-color:currentColor}
.page-bookmark svg{display:block;width:100%;height:100%;fill:currentColor}
.page-stage{
  --page-head:calc(43px + env(safe-area-inset-top));
  --page-foot:calc(34px + env(safe-area-inset-bottom));
  position:absolute;inset:0;
  display:grid;grid-template-rows:var(--page-head) minmax(0,1fr) var(--page-foot);
  justify-items:center;overflow:hidden;
}
.page-stage.special{align-items:center}
.page-stage.full{align-items:center;padding-top:0}
.page-footer{position:relative;width:100%;height:100%}
.mushaf{
  --mushaf-fit-width:0;
  width:min(99.2vw,780px);max-width:100%;height:100%;direction:rtl;
  display:flex;flex-direction:column;align-items:stretch;justify-content:center;
  transform-origin:center center;
}
/* A touch tablet can use its reading area beyond the desktop's 780px column.
   The page fitter still checks both dimensions, including after rotation. */
@media (min-width:600px) and (min-height:600px) and (hover:none) and (pointer:coarse){
  .mushaf{width:min(calc(100vw - 32px),1120px)}
  .page-stage{--page-label-size:26px}
}
/* A rotated phone or tablet reads at the available width, with vertical
   scrolling for the rest of the page. Portrait retains the approved fit. */
@media (orientation:landscape) and (hover:none) and (pointer:coarse){
  .mushaf{--mushaf-fit-width:1;width:calc(100vw - 32px)}
}
.line{
  width:100%;display:flex;justify-content:center;align-items:center;
  white-space:nowrap;overflow:visible;direction:rtl;line-height:1.33;
}
.line-inner{
  display:inline-flex;align-items:center;justify-content:center;
  user-select:none;-webkit-user-select:none;
  direction:rtl;white-space:nowrap;line-height:1.33;
  font-family:"QCF4_Hafs_01";font-weight:400;font-synthesis:none;
}
.surah-line{
  font-family:"QCF4_QBSML";color:var(--green);
  line-height:1.08;min-height:1.12em;margin-bottom:.12em;
  position:relative;overflow:visible;
}
/* QUL surah header is rendered to a cropped canvas overlay. The hidden
   QCF4 title underneath preserves the original Mushaf line box, so the
   decorative header can never change ayah size, spacing, or page fitting. */
.surah-line.banner-ready{width:100%;}
.surah-metric{
  font-family:"QCF4_QBSML";visibility:hidden;white-space:nowrap;
}
.surah-banner{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  display:block;width:min(94vw,735px);max-width:96%;height:auto;
  pointer-events:none;user-select:none;-webkit-user-select:none;opacity:.94;
}
/* Keep every Surah header in its original line box. Only Al-Fatiha gets a
   very small visual lift; this does not affect Mushaf fitting or line height. */
.page[data-page="1"] .surah-banner{
  transform:translate(-50%,-50%) translateY(-4px);
}
html[data-theme="dark"] .surah-banner{opacity:.88}
html[data-theme="dark"] .surah-line{color:#57b7a0}
/* Visual nudge only: move the Bismillah a little lower without changing
   the QCF line metrics used by fitPage(). */
.bismillah-line{font-family:"QCF4_Hafs_01";line-height:1.25;margin:.04em 0 .12em;position:relative;color:var(--quran);transform:translateY(3px)}
.bismillah-original{display:inline}.bismillah-desktop{display:none}
.bismillah-original,.bismillah-desktop{-webkit-text-stroke:var(--quran-stroke) currentColor}
.verse-segment{
  display:inline-flex;direction:rtl;align-items:center;
  user-select:none;-webkit-user-select:none;touch-action:pan-y;
  border-radius:.18em;box-shadow:0 0 0 1px transparent inset;
  transition:background .13s,box-shadow .13s;
}
[data-ayah].selected{background:var(--select);box-shadow:0 0 0 1px var(--select-line) inset}
.word{
  display:inline-block;direction:rtl;color:var(--quran);
  line-height:1.33;position:relative;
  /* A small ink increase also reaches the diacritics and pause signs inside
     each source glyph, without changing its advance width or page fitting. */
  -webkit-text-stroke:var(--quran-stroke) currentColor;
}
.word.allah{color:var(--red)}
.word.end{color:var(--ayah-number);-webkit-text-stroke-width:var(--ayah-stroke)}
/* زر التجويد ودليل الأحكام (qcf-palettes.js). ألوان الحروف نفسها في مجموعات ألوان الخط، وهذه للدليل. */
:root{--tj-ghunna:#05A54C;--tj-tafkhim:#046D9C;--tj-silent:#9C9EA4;--tj-qalqala:#03ADF1;--tj-madd2:#FEB609;--tj-madd246:#FD8014;--tj-madd45:#E8038C;--tj-madd6:#B2016B}
html[data-theme="dark"]{--tj-ghunna:#46D97F;--tj-tafkhim:#6D9BFF;--tj-silent:rgba(255,249,234,.38);--tj-qalqala:#5CE6F2;--tj-madd2:#FFE45C;--tj-madd246:#FF8838;--tj-madd45:#FF7AB8;--tj-madd6:#C08CFF}
.tj-swatch.tj1{background:var(--tj-ghunna)}.tj-swatch.tj2{background:var(--tj-tafkhim)}.tj-swatch.tj3{background:var(--tj-silent)}.tj-swatch.tj4{background:var(--tj-qalqala)}
.tj-swatch.tj5{background:var(--tj-madd2)}.tj-swatch.tj6{background:var(--tj-madd246)}.tj-swatch.tj7{background:var(--tj-madd45)}.tj-swatch.tj8{background:var(--tj-madd6)}
.iconbtn.tj-btn{width:48px;padding:0;font:700 14px/1 "Aref Ruqaa",serif;letter-spacing:0}
/* الزر مفعّلًا بلون زر «استماع» نفسه: أخضر زاد نهارًا، وذهبي ليلًا. */
html .topbar .iconbtn.tj-btn.active{background:#082D29!important;border-color:#082D29;color:#FFF9EA;box-shadow:0 10px 22px -16px rgba(8,45,41,.50)}
html[data-theme="dark"] .topbar .iconbtn.tj-btn.active{background:#E4C980!important;border-color:#E4C980;color:#19332C;box-shadow:0 10px 22px -16px rgba(228,201,128,.40)}
/* دليل التجويد: بطاقة بحدود أزرار القارئ نفسها، عمودان يفصلهما خط ذهبي، وعنوان كل عمود بخط الرقعة. */
.tj-strip{display:none;grid-column:1/-1;grid-template-columns:auto 1px auto;justify-content:center;gap:0 12px;
  padding:7px 12px 8px;border:1px solid var(--border);border-radius:12px;
  background:color-mix(in srgb,var(--chrome-text) 6%,transparent);
  font:500 10.5px/1.25 Alexandria,system-ui,sans-serif;color:var(--chrome-text);direction:rtl}
html[data-tajweed="on"] .tj-strip{display:grid}
.tj-strip:before{content:"";grid-column:2;grid-row:1;background:color-mix(in srgb,var(--gold) 45%,transparent)}
.tj-col{display:grid;align-content:start;gap:4px}
.tj-col:first-child{grid-column:1;grid-row:1}
.tj-col:last-child{grid-column:3;grid-row:1}
.tj-col b{font:400 14px/1.1 "Aref Ruqaa",serif;color:var(--gold);margin-bottom:1px}
.tj-strip span{display:flex;align-items:center;gap:6px;white-space:nowrap}
.tj-swatch{width:14px;height:7px;border-radius:99px;flex:none}
.page-no{
  position:absolute;left:22px;bottom:calc(8px + env(safe-area-inset-bottom));
  color:var(--page-label);font-family:"Aref Ruqaa",serif;font-size:var(--page-label-size,24px);line-height:1;
  background:none;border:0;padding:0;cursor:pointer
}
.loading{
  position:fixed;inset:0;z-index:70;display:grid;place-items:center;
  background:var(--paper);color:var(--muted);font-size:11px;
}
.loading.hide{display:none}
.loading-error{display:grid;gap:12px;place-items:center;text-align:center;padding:24px;max-width:430px;line-height:1.8}
.loading-retry{border:1px solid var(--border);background:var(--brand);color:#fff;border-radius:12px;padding:9px 16px;font:600 12px Alexandria,system-ui,sans-serif}
.loading-retry:active{transform:scale(.97)}

/* ---------- Zād chrome ---------- */
.chrome{position:fixed;left:0;right:0;z-index:35;transition:opacity .18s,transform .18s}
.topbar{
  top:0;padding:calc(9px + env(safe-area-inset-top)) 13px 12px;
  display:flex;align-items:center;justify-content:space-between;
  background:linear-gradient(180deg,color-mix(in srgb,var(--chrome) 99%,transparent),color-mix(in srgb,var(--chrome) 90%,transparent),transparent);
}
.brand{font-family:"Aref Ruqaa",serif;font-size:29px;line-height:1;color:var(--chrome-text)}
.brand-home{text-decoration:none;cursor:pointer}
.top-actions{display:flex;gap:7px}
.iconbtn{
  width:42px;height:42px;border-radius:14px;border:1px solid var(--border);
  background:color-mix(in srgb,var(--chrome-text) 6%,transparent);color:var(--chrome-text);
  display:grid;place-items:center;padding:0
}
.iconbtn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.zad-return-btn{direction:ltr}
.zad-return-btn svg{direction:ltr;transform:none!important;transform-origin:center}

.bottom{
  bottom:-1px;
  padding:4px 7px calc(4px + env(safe-area-inset-bottom));
  display:grid;
  grid-template-columns:46px minmax(0,1fr) minmax(0,1fr) 46px;
  grid-template-areas:"next listen tafsir prev" "shortcuts shortcuts shortcuts shortcuts";
  gap:6px;align-items:center;direction:ltr;
  /* Solid near the bottom, gently translucent toward the Mushaf. */
  background:linear-gradient(
    0deg,
    color-mix(in srgb,var(--chrome) 99%,transparent) 0%,
    color-mix(in srgb,var(--chrome) 96%,transparent) 58%,
    color-mix(in srgb,var(--chrome) 70%,transparent) 82%,
    color-mix(in srgb,var(--chrome) 22%,transparent) 100%
  );
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
}
.tool,.navbtn{
  height:40px;min-width:0;border-radius:12px;border:1px solid var(--border);
  background:color-mix(in srgb,var(--chrome-text) 6%,transparent);color:var(--chrome-text)
}
.tool{
  display:flex;align-items:center;justify-content:center;gap:5px;padding:0 7px;font-size:10.25px;
  white-space:nowrap;overflow:hidden
}
.tool svg{width:17px;height:17px;flex:0 0 17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tool.primary{background:linear-gradient(145deg,#C59A4A,#9B702D);color:#FFF9EA;border-color:#D7B767}
.navbtn{display:grid;place-items:center;padding:0}
.navbtn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.navbtn:disabled{opacity:.24}
.bottom #prevBtn{grid-area:prev}
.bottom #tafsirBtn{grid-area:tafsir;direction:rtl}
.bottom #listenBtn{grid-area:listen;direction:rtl}
.bottom #nextBtn{grid-area:next}
.bottom .reader-shortcuts{grid-area:shortcuts;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:inherit;direction:rtl}
.bottom .tool{min-height:44px}
.reader-shortcuts .tool{white-space:normal;line-height:1.45}
.hidden-tools .chrome{opacity:0;pointer-events:none}
.hidden-tools .topbar{transform:translateY(-14px)}
.hidden-tools .bottom{transform:translateY(14px)}
.desktop-page-nav{display:none}

/* ---------- Long press toolbar ---------- */
.ayah-menu{
  position:fixed;z-index:80;display:none;direction:rtl;
  background:rgba(5,66,53,.96);color:white;border:1px solid rgba(228,201,128,.28);
  border-radius:15px;padding:5px;box-shadow:0 12px 36px rgba(0,0,0,.30);
  transform:translate(-50%,-116%);
}
.ayah-menu.show{display:flex}
.ayah-menu:after{
  content:"";position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);
  border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(5,66,53,.96)
}
.menu-btn{
  width:48px;height:48px;border:0;background:transparent;color:#fff;border-radius:10px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:0;
}
.menu-btn:active{background:rgba(255,255,255,.12)}
.menu-btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.menu-btn.play svg{fill:currentColor;stroke:none}
.menu-label{font-size:7px;line-height:1;opacity:.9}

/* ---------- Madinah-style collapsible audio ---------- */
.audio-fab{
  --audio-fab-size:54px;
  position:fixed;z-index:58;right:14px;bottom:calc(14px + env(safe-area-inset-bottom));
  width:var(--audio-fab-size);height:var(--audio-fab-size);border:0;border-radius:50%;
  background:linear-gradient(145deg,#C59A4A,#9B702D);
  color:#FFF9EA;display:none;align-items:center;justify-content:center;
  box-shadow:0 10px 28px rgba(0,0,0,.28),0 0 0 7px color-mix(in srgb,var(--gold) 11%,transparent);
  touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;
}
/* CSS keeps the last position reachable after rotation, including safe areas. */
.audio-fab.is-positioned{
  right:auto;bottom:auto;
  left:clamp(calc(14px + env(safe-area-inset-left)),var(--audio-fab-x),calc(100% - var(--audio-fab-size) - 14px - env(safe-area-inset-right)));
  top:clamp(calc(14px + env(safe-area-inset-top)),var(--audio-fab-y),calc(100% - var(--audio-fab-size) - 14px - env(safe-area-inset-bottom)));
}
.audio-fab.is-dragging{cursor:grabbing}
body.player-on:not(.player-expanded) .audio-fab{display:flex}
.wave{display:flex;align-items:center;gap:3px;height:24px}
.wave i{display:block;width:3px;border-radius:9px;background:currentColor;height:8px;opacity:.96}
body.audio-playing .wave i:nth-child(1){animation:wave .72s ease-in-out infinite}
body.audio-playing .wave i:nth-child(2){animation:wave .72s .12s ease-in-out infinite}
body.audio-playing .wave i:nth-child(3){animation:wave .72s .24s ease-in-out infinite}
body.audio-playing .wave i:nth-child(4){animation:wave .72s .36s ease-in-out infinite}
@keyframes wave{0%,100%{height:7px}50%{height:22px}}

.audio-panel{
  position:fixed;z-index:59;left:12px;right:12px;bottom:calc(9px + env(safe-area-inset-bottom));
  max-width:650px;margin:auto;display:none;
  background:color-mix(in srgb,var(--chrome) 98%,transparent);color:var(--chrome-text);
  border:1px solid var(--border);border-radius:28px;
  box-shadow:0 18px 50px var(--shadow);padding:22px 15px 14px;
  -webkit-backdrop-filter:blur(13px);backdrop-filter:blur(13px);
}
body.player-on.player-expanded .audio-panel{display:block}
.audio-collapse{
  position:absolute;top:-20px;left:50%;transform:translateX(-50%);
  width:70px;height:35px;padding:0;border:1px solid var(--border);border-bottom:0;
  border-radius:22px 22px 0 0;background:color-mix(in srgb,var(--chrome) 98%,transparent);
  color:var(--chrome-text);display:grid;place-items:center;
  box-shadow:0 -5px 14px color-mix(in srgb,var(--shadow) 55%,transparent);
}
.audio-collapse svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.audio-collapse:active{background:color-mix(in srgb,var(--chrome-text) 9%,var(--chrome))}
.audio-top{
  display:grid;grid-template-columns:42px 42px minmax(0,1fr) 42px 42px;gap:7px;align-items:center
}
.audio-round{
  width:42px;height:42px;border:0;border-radius:50%;
  background:color-mix(in srgb,var(--chrome-text) 8%,transparent);color:var(--chrome-text);
  display:grid;place-items:center;padding:0
}
.audio-round svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.audio-qari{
  height:42px;min-width:0;border:1px solid var(--border);border-radius:999px;
  background:color-mix(in srgb,var(--chrome-text) 5%,transparent);color:var(--chrome-text);
  padding:0 14px;outline:none;text-align:right
}
.audio-now{
  margin:11px 2px 3px;font-size:10px;opacity:.72;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.audio-progress-row{display:grid;grid-template-columns:42px minmax(0,1fr) 42px;gap:8px;align-items:center;direction:rtl!important}
.audio-progress-time{font-size:9px;line-height:1;color:var(--ui-muted);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:center;direction:ltr;unicode-bidi:isolate}
.audio-progress{position:relative;height:22px;direction:rtl!important;display:flex;align-items:center}
.audio-progress:before{content:"";position:absolute;left:0;right:0;top:50%;height:3px;transform:translateY(-50%);border-radius:99px;background:color-mix(in srgb,var(--chrome-text) 13%,transparent)}
.audio-progress i{position:absolute;right:0;left:auto;top:50%;height:3px;width:0;transform:translateY(-50%);border-radius:99px;background:var(--gold-hi);pointer-events:none}
.audio-progress input[type="range"]{position:absolute;inset:0;width:100%;height:22px;margin:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;touch-action:none}
.audio-progress input[type="range"]::-webkit-slider-runnable-track{height:22px;background:transparent;border:0}
.audio-progress input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:13px;height:13px;margin-top:4.5px;border-radius:50%;background:var(--gold-hi);border:2px solid var(--ui-surface);box-shadow:0 1px 5px rgba(0,0,0,.22)}
.audio-progress input[type="range"]::-moz-range-track{height:22px;background:transparent;border:0}
.audio-progress input[type="range"]::-moz-range-progress{background:transparent}
.audio-progress input[type="range"]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:var(--gold-hi);border:2px solid var(--ui-surface);box-shadow:0 1px 5px rgba(0,0,0,.22)}
.audio-progress input[type="range"]:focus-visible{outline:2px solid color-mix(in srgb,var(--gold) 45%,transparent);outline-offset:3px;border-radius:999px}
.audio-controls{
  margin-top:13px;display:grid;grid-template-columns:52px 1fr 66px 1fr 48px 56px;gap:6px;align-items:center
}
.audio-control{
  height:48px;border:0;border-radius:50%;background:color-mix(in srgb,var(--chrome-text) 7%,transparent);
  color:var(--chrome-text);display:grid;place-items:center;padding:0
}
.audio-control svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.audio-main{
  width:62px;height:62px;justify-self:center;background:var(--gold);color:#fff;font-size:22px
}
.audio-pill{
  height:46px;border:0;border-radius:999px;background:color-mix(in srgb,var(--chrome-text) 6%,transparent);
  color:var(--chrome-text);font-size:10px;padding:0 9px;white-space:nowrap
}
.audio-repeat.active,.audio-continuous.active{box-shadow:0 0 0 1px var(--gold-hi) inset;color:var(--gold-hi);background:color-mix(in srgb,var(--gold) 12%,transparent)}
.audio-continuous{font-size:8.5px;padding-inline:5px}
.audio-timer small{display:block;font-size:7px;margin-top:1px;opacity:.75}
@media(max-width:390px){
  .audio-panel{left:7px;right:7px;padding-inline:11px}
  .audio-top{grid-template-columns:39px 39px minmax(0,1fr) 39px 39px;gap:5px}
  .audio-round{width:39px;height:39px}
  .audio-controls{grid-template-columns:46px 1fr 58px 1fr 44px 52px;gap:4px}
  .audio-control{height:44px}.audio-main{width:58px;height:58px}
}

/* ---------- Sheets ---------- */
.backdrop{position:fixed;inset:0;z-index:95;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center}
.sheet{
  width:min(690px,100%);max-height:79vh;overflow:auto;background:var(--sheet);color:#263B35;
  border:1px solid rgba(197,154,74,.30);border-radius:27px 27px 0 0;
  padding:15px 16px calc(18px + env(safe-area-inset-bottom));box-shadow:0 -20px 55px rgba(0,0,0,.28)
}
.sheethead{display:flex;align-items:center;justify-content:space-between;padding-bottom:10px;border-bottom:1px solid #E5D6BA}
.sheethead h3{font-family:"Aref Ruqaa",serif;font-size:26px;color:var(--green);margin:0}
.close-sheet{border:0;border-radius:11px;background:#EEE4D3;color:#315C51;padding:8px 11px;font-size:11px}
.ref{font-size:11px;color:#8B7654;margin:11px 0 7px}
.tafsir{font-family:Amiri,serif;font-size:19px;line-height:2.05}
.source{font-size:9px;color:#837B70;border-top:1px solid #EADCC4;padding-top:8px;margin-top:11px}
.source-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.tafsir-more{border:0;background:transparent;color:var(--green);font:600 8px Alexandria,system-ui,sans-serif;padding:2px 0;text-decoration:underline;text-underline-offset:2px}
.tafsir-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:14px}
.tafsir-nav-btn{min-width:92px;height:34px;border:1px solid var(--ui-line);border-radius:999px;background:var(--ui-surface-2);color:var(--ui-text);padding:0 12px;font:500 9px Alexandria,system-ui,sans-serif;display:inline-flex;align-items:center;justify-content:center;gap:5px}
.tafsir-nav-btn:active{background:var(--ui-accent-soft)}
.tafsir-nav-btn:disabled{opacity:.32;cursor:default}
.author-bio{font-family:Amiri,serif;font-size:18px;line-height:2;margin-top:12px}
.author-note{margin-top:13px;padding:10px 12px;border-radius:14px;background:#F3E9D6;color:#695E4C;font-size:11px;line-height:1.8}
.author-note a{color:inherit;text-decoration:underline;text-underline-offset:2px;unicode-bidi:isolate}
.bookmark-sections{display:grid;gap:16px;margin-top:12px}
.bookmark-section{display:grid;gap:8px}
.bookmark-section+.bookmark-section{padding-top:13px;border-top:1px solid #E5D6BA}
.bookmark-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.bookmark-title h4{margin:0;font-family:"Aref Ruqaa",serif;font-size:21px;color:var(--green)}
.bookmark-title small{font-size:8px;color:#9A8B75}
.bookmark-list{display:grid;gap:8px}
.bookmark-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:7px;align-items:stretch}
.bookmark-row.recent{grid-template-columns:minmax(0,1fr)}
.bookmark-main,.bookmark-delete{border:1px solid #E6D5B7;background:#FFFAF1;color:#29493F;border-radius:14px}
.bookmark-main{padding:10px 12px;text-align:right;display:grid;gap:3px}
.bookmark-main b{font-family:"Aref Ruqaa",serif;font-size:20px}.bookmark-main small{font-size:9px;color:#8B7654}
.bookmark-main b.ayah-excerpt{font-family:Amiri,serif;font-size:19px;font-weight:700;line-height:1.65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bookmark-delete{display:grid;place-items:center;font-size:20px;color:#9A574E}
.empty-state{padding:12px 10px;text-align:center;color:#8B7654;font-size:11px;border:1px dashed #E5D6BA;border-radius:13px}
.menu-btn.wide{width:78px}
/* ---------- Full-screen Quran-style index ---------- */

.quran-index{
  --index-accent:var(--ui-accent);--index-accent-strong:var(--ui-accent);
  --index-dim:color-mix(in srgb,var(--ui-muted) 64%,transparent);
  --index-separator:color-mix(in srgb,var(--ui-gold) 7%,var(--paper));
  position:fixed;inset:0;z-index:105;background:var(--paper);color:var(--quran);
  display:flex;flex-direction:column;direction:rtl;
}
html[data-theme="dark"] .quran-index{--index-separator:color-mix(in srgb,var(--ui-gold) 8%,var(--paper))}
.quran-index-head{
  flex:0 0 auto;padding:calc(10px + env(safe-area-inset-top)) 16px 9px;min-height:62px;
  display:flex;align-items:center;justify-content:space-between;
  border-bottom:1px solid var(--ui-line);background:color-mix(in srgb,var(--paper) 96%,var(--ui-surface-2));
}
.quran-index-title{font-family:"Aref Ruqaa",serif;font-size:27px;line-height:1;color:var(--chrome-text)}
.quran-index-tabs{flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--ui-line);background:color-mix(in srgb,var(--paper) 97%,var(--ui-surface-2))}

.quran-index-tab{height:46px;border:0;background:transparent;color:var(--muted);font-size:12px;font-weight:600;position:relative}
.quran-index-tab.active{color:var(--index-accent-strong)}
.quran-index-tab.active:after{content:"";position:absolute;left:18%;right:18%;bottom:-1px;height:3px;border-radius:3px 3px 0 0;background:var(--ui-gold)}
.quran-index-scroll{flex:1 1 auto;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(14px + env(safe-area-inset-bottom));scrollbar-width:none;touch-action:pan-y}
.quran-index-scroll::-webkit-scrollbar{display:none}
/* No scroll bars on panels and lists, on phone or computer (as on home). A
   scrolling Mushaf page keeps its bar as a sign that the page continues. */
:not(.page-stage){scrollbar-width:none}
:not(.page-stage)::-webkit-scrollbar{display:none}
.quran-index-row{width:100%;min-height:78px;border:0;background:transparent;color:var(--quran);padding:9px 22px 9px 21px;display:grid;grid-template-columns:44px minmax(0,1fr) 48px;gap:11px;align-items:center;text-align:right}
.quran-index-row:active{background:var(--ui-accent-soft)}
.quran-index-row.current{background:linear-gradient(90deg,transparent,var(--ui-accent-soft),transparent)}
.quran-index-surah-num{font-family:"Aref Ruqaa",serif;font-size:20px;color:var(--muted);text-align:center}
.quran-index-main{min-width:0;display:grid;gap:2px}
.quran-index-name{font-family:"Aref Ruqaa",serif;font-size:22px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quran-index-meta{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quran-index-page{font-family:"Aref Ruqaa",serif;font-size:16px;color:var(--muted);text-align:left;direction:rtl}
.quran-index-row.current .quran-index-name,.quran-index-row.current .quran-index-surah-num{color:var(--index-accent-strong)}
.quran-index-juz-sep{min-height:51px;padding:0 23px 0 22px;background:var(--index-separator);color:var(--muted);display:grid;grid-template-columns:minmax(0,1fr) 52px;gap:11px;align-items:center;border-block:1px solid color-mix(in srgb,var(--ui-gold) 10%,transparent)}
.quran-index-juz-sep b{font-family:"Aref Ruqaa",serif;font-size:19px;font-weight:400;text-align:right;color:color-mix(in srgb,var(--chrome-text) 78%,var(--muted))}
.quran-index-juz-sep span{font-family:"Aref Ruqaa",serif;font-size:16px;text-align:left}
.quran-index-quarter-row{grid-template-columns:52px minmax(0,1fr) 48px;min-height:90px}
.hizb-ring{--portion:0%;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;position:relative;overflow:hidden;background:conic-gradient(from 0deg,color-mix(in srgb,var(--ui-accent) 62%,var(--paper)) 0 var(--portion),color-mix(in srgb,var(--ui-muted) 52%,var(--paper)) var(--portion) 100%);color:var(--ui-text);font-family:"Aref Ruqaa",serif;font-size:14px}
html[data-theme="dark"] .hizb-ring{color:#14201D}
.hizb-ring.start{background:color-mix(in srgb,var(--ui-accent) 72%,var(--paper))}
.hizb-ring.q1{--portion:25%}.hizb-ring.q2{--portion:50%}.hizb-ring.q3{--portion:75%}
.hizb-ring:after{content:"";position:absolute;inset:0;border-radius:50%;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-accent) 34%,transparent);pointer-events:none}
.quran-index-quarter-title{font-family:Amiri,serif;font-size:18px;line-height:1.45;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:390px){
  .quran-index-row{padding-inline:14px 15px;grid-template-columns:38px minmax(0,1fr) 42px;gap:8px;min-height:73px}
  .quran-index-quarter-row{grid-template-columns:47px minmax(0,1fr) 42px;min-height:84px}
  .hizb-ring{width:44px;height:44px;font-size:13px}.quran-index-name{font-size:20px}.quran-index-quarter-title{font-size:17px}
  .quran-index-juz-sep{padding-inline:17px;grid-template-columns:minmax(0,1fr) 45px;min-height:48px}
}
/* ---------- Zad visual identity: sheets, bookmarks and controls ---------- */
.sheet{background:var(--ui-surface);color:var(--ui-text);border-color:color-mix(in srgb,var(--ui-gold) 28%,transparent)}
.sheethead{border-bottom-color:var(--ui-line)}
.sheethead h3,.bookmark-title h4{color:var(--ui-accent)}
.close-sheet{background:var(--ui-surface-2);color:var(--ui-text);border:1px solid var(--ui-line)}
.ref,.source,.bookmark-title small,.empty-state{color:var(--ui-muted)}
.source,.bookmark-section+.bookmark-section{border-color:var(--ui-line)}
.tafsir-more{color:var(--ui-accent)}
.author-note{background:var(--ui-surface-2);color:var(--ui-muted)}
.bookmark-main,.bookmark-delete,.field select{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
.bookmark-main small,.field label{color:var(--ui-muted)}
.bookmark-delete{color:#B9675E}
.apply{background:linear-gradient(145deg,var(--green),#0B493F);color:#FFF9EA;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 24%,transparent)}
html[data-theme="dark"] .apply{background:linear-gradient(145deg,#164A41,#0A302A);color:#FFF9EA}

.settings{display:grid;gap:10px;margin-top:12px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.field{display:grid;gap:5px}.field label{font-size:10px;color:#786C59}.field select{height:43px;border:1px solid #DDCDAF;border-radius:12px;background:#FFFAF1;color:#29493F;padding:0 10px}
.apply{height:44px;border:0;border-radius:14px;background:var(--green);color:white}
.toast{
  position:fixed;z-index:110;left:50%;top:calc(14px + env(safe-area-inset-top));
  transform:translate(-50%,-7px);padding:8px 13px;border-radius:999px;
  background:rgba(3,28,24,.96);color:white;border:1px solid rgba(228,201,128,.27);
  font-size:10px;opacity:0;pointer-events:none;transition:.18s;white-space:nowrap
}
.toast.show{opacity:1;transform:translate(-50%,0)}
.notice{
  position:fixed;z-index:65;left:50%;top:50%;transform:translate(-50%,-35%);
  background:#202020;color:white;border-radius:17px;padding:12px 17px;
  font-family:"Aref Ruqaa",serif;font-size:18px;opacity:0;pointer-events:none;transition:.2s;
  box-shadow:0 14px 40px rgba(0,0,0,.3)
}
.notice.show{opacity:1;transform:translate(-50%,-50%)}
@media(max-width:390px){
  .bottom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 82px;padding-inline:5px}
  .tool{font-size:10px;padding-inline:5px}
}

/* ---------- Zād identity mapping · authoritative ---------- */
:root{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
.brand{color:var(--brand);font-weight:700}
.topbar{background:linear-gradient(180deg,color-mix(in srgb,var(--chrome) 99%,transparent),color-mix(in srgb,var(--chrome) 92%,transparent),transparent)}
.bottom{background:linear-gradient(0deg,color-mix(in srgb,var(--chrome) 99%,transparent) 0%,color-mix(in srgb,var(--chrome) 96%,transparent) 58%,color-mix(in srgb,var(--chrome) 72%,transparent) 82%,transparent 100%)}
.iconbtn,.tool,.navbtn{color:var(--brand);border-color:var(--line);background:color-mix(in srgb,var(--paper2,#FFFCF4) 76%,transparent)}
.tool.primary,.zad-identity .tool.primary,.audio-main,.audio-fab{background:linear-gradient(135deg,var(--gold-hi),var(--gold));color:#19332C;border-color:var(--gold);box-shadow:0 15px 32px -18px rgba(132,89,22,.48)}
.audio-panel{background:var(--ui-surface);border-color:color-mix(in srgb,var(--gold) 24%,var(--ui-line));color:var(--ui-text)}
.audio-collapse,.audio-round,.audio-control,.audio-pill,.audio-qari{background:color-mix(in srgb,var(--ui-surface) 88%,var(--ui-surface-2));color:var(--ui-text);border-color:var(--ui-line)}
.audio-progress:before{background:color-mix(in srgb,var(--ui-line) 62%,transparent)}
.audio-progress i{background:var(--gold-hi)}
.audio-repeat.active,.audio-continuous.active{color:var(--brand);background:var(--brand-soft);box-shadow:inset 0 0 0 1px rgba(15,92,80,.24)}
.ayah-menu{background:var(--brand-strong);border-color:rgba(228,201,128,.32)}
.ayah-menu:after{border-top-color:var(--brand-strong)}
.sheet{background:var(--ui-surface);color:var(--ui-text);border-color:rgba(197,154,74,.28)}
.sheethead h3,.bookmark-title h4,.quran-index-title{color:var(--brand)}
.close-sheet{background:var(--ui-surface-3);color:var(--brand-strong);border-color:var(--ui-line)}
.apply{background:linear-gradient(135deg,#278573,#145F51);color:#fff;box-shadow:none}
.quran-index{--index-accent:var(--brand);--index-accent-strong:var(--brand);--index-separator:var(--ui-surface-3);background:var(--paper);color:var(--ui-text)}
.quran-index-head,.quran-index-tabs{background:var(--ui-surface);border-color:var(--ui-line)}
.quran-index-tab.active{color:var(--brand)}
.quran-index-tab.active:after{background:var(--gold)}
.quran-index-row.current,.quran-index-row:active{background:var(--brand-soft)}
.quran-index-row.current .quran-index-name,.quran-index-row.current .quran-index-surah-num{color:var(--brand)}
.quran-index-juz-sep{background:var(--ui-surface-3);border-block-color:rgba(197,154,74,.22)}
.quran-index-juz-sep b{color:var(--brand-strong)}
.hizb-ring{background:conic-gradient(from 0deg,var(--brand) 0 var(--portion),color-mix(in srgb,var(--ui-muted) 34%,var(--paper)) var(--portion) 100%)}
.hizb-ring.start{background:var(--brand-soft);color:var(--brand-strong)}
.toast,.notice{background:var(--brand-strong);color:var(--ivory);border-color:rgba(228,201,128,.30)}
html[data-theme="dark"] .brand{color:var(--ivory)}
html[data-theme="dark"] .topbar{background:linear-gradient(180deg,rgba(8,45,41,.99),rgba(8,45,41,.92),transparent)}
html[data-theme="dark"] .bottom{background:linear-gradient(0deg,rgba(8,45,41,.99) 0%,rgba(8,45,41,.96) 60%,rgba(8,45,41,.74) 84%,transparent 100%)}
html[data-theme="dark"] .iconbtn,html[data-theme="dark"] .tool,html[data-theme="dark"] .navbtn{color:rgba(255,249,234,.82);border-color:rgba(255,249,234,.14);background:rgba(255,249,234,.045)}
html[data-theme="dark"] .tool.primary,html[data-theme="dark"] .audio-main,html[data-theme="dark"] .audio-fab{color:#19332C}
html[data-theme="dark"] .audio-collapse,html[data-theme="dark"] .audio-round,html[data-theme="dark"] .audio-control,html[data-theme="dark"] .audio-pill,html[data-theme="dark"] .audio-qari{background:rgba(255,249,234,.055);color:var(--ivory);border-color:rgba(228,201,128,.18)}
html[data-theme="dark"] .audio-repeat.active,html[data-theme="dark"] .audio-continuous.active{color:var(--gold-hi);background:rgba(228,201,128,.08);box-shadow:inset 0 0 0 1px rgba(228,201,128,.28)}
html[data-theme="dark"] .sheethead h3,html[data-theme="dark"] .bookmark-title h4,html[data-theme="dark"] .quran-index-title,html[data-theme="dark"] .quran-index-tab.active{color:var(--gold-hi)}
html[data-theme="dark"] .quran-index-tab.active:after{background:var(--gold-hi)}
html[data-theme="dark"] .quran-index-row.current,html[data-theme="dark"] .quran-index-row:active{background:rgba(228,201,128,.07)}
html[data-theme="dark"] .quran-index-row.current .quran-index-name,html[data-theme="dark"] .quran-index-row.current .quran-index-surah-num{color:var(--gold-hi)}
html[data-theme="dark"] .quran-index-juz-sep b{color:var(--ivory)}
html[data-theme="dark"] .hizb-ring{background:conic-gradient(from 0deg,var(--gold-hi) 0 var(--portion),rgba(255,249,234,.16) var(--portion) 100%);color:var(--ivory)}
html[data-theme="dark"] .hizb-ring.start{background:var(--gold-hi);color:#19332C}

/* ---------- final component contracts ---------- */
.surah-line{color:var(--surah-banner)}
html[data-theme="dark"] .surah-line{color:var(--surah-banner)}
.zad-identity .iconbtn,.zad-identity .tool,.zad-identity .navbtn{border-color:var(--ui-line);background:color-mix(in srgb,var(--ui-accent) 7%,transparent)}
.zad-identity .audio-panel{border-color:var(--ui-line)}
.zad-identity .ayah-menu{border-color:color-mix(in srgb,var(--ui-gold) 32%,transparent)}
.bookmark-delete{color:var(--ui-text)}
.field label{color:var(--ui-muted)}
.field select{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
.bookmark-main:active{background:var(--ui-accent-soft)}
.quran-index-head,.quran-index-tabs{border-bottom-color:var(--ui-line)}
.quran-index-row{color:var(--ui-text)}
.quran-index-surah-num,.quran-index-meta,.quran-index-page{color:var(--ui-muted)}
.quran-index-juz-sep{color:var(--ui-muted)}
.hizb-ring:after{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 36%,transparent)}
html[data-theme="dark"] .apply{background:linear-gradient(145deg,#174E43,#0B312B);color:#FFF9EA}
html[data-theme="dark"] .close-sheet{color:var(--ui-text)}

/* ---------- index · smooth two-pane + collapsible Juz ---------- */
.quran-index-viewport{flex:1 1 auto;min-height:0;overflow:hidden;position:relative;touch-action:pan-y;direction:ltr}
.quran-index-track{
  width:200%;height:100%;display:flex;direction:ltr;will-change:transform;
  transform:translate3d(-50%,0,0);
  transition:transform .26s cubic-bezier(.22,.72,.24,1);
}
.quran-index-pane{width:50%;height:100%;min-width:0;direction:rtl;overflow:hidden}
.quran-index-pane>.quran-index-scroll{height:100%;margin:0}
.quran-index-scroll{contain:layout paint;transform:translateZ(0)}
.quran-index-juz-list{padding:7px 0 calc(18px + env(safe-area-inset-bottom))}
.juz-accordion{border-bottom:1px solid var(--ui-line);background:transparent}
.juz-accordion-title{display:grid;gap:1px;min-width:0}
.juz-accordion-title b{font-family:"Aref Ruqaa",serif;font-size:19px;font-weight:400;line-height:1.25;color:var(--brand-strong)}
.juz-accordion-title small{font-size:9.5px;color:var(--ui-muted)}
.juz-accordion-chevron{width:21px;height:21px;display:grid;place-items:center;color:var(--ui-muted);transition:transform .22s ease}
.juz-accordion-chevron svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.juz-accordion.open .juz-accordion-chevron{transform:rotate(180deg)}
.juz-accordion-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .24s cubic-bezier(.2,.72,.24,1)}
.juz-accordion.open .juz-accordion-body{grid-template-rows:1fr}
.juz-accordion-body-inner{min-height:0;overflow:hidden;background:color-mix(in srgb,var(--ui-surface) 56%,transparent)}
.juz-accordion .quran-index-quarter-row{min-height:80px;padding-block:8px;border-top:1px solid color-mix(in srgb,var(--ui-line) 72%,transparent)}
.juz-accordion .quran-index-quarter-title{font-size:16.5px;line-height:1.7;padding-block:2px}
.juz-accordion .quran-index-meta{font-size:9.5px}
.juz-accordion .hizb-ring{width:40px;height:40px;font-size:12px}
.juz-accordion .quran-index-quarter-row{grid-template-columns:44px minmax(0,1fr) 42px}
.index-excerpt-placeholder{font-weight:400;color:var(--ui-muted)}
html[data-theme="dark"] .juz-accordion-title b{color:var(--ivory)}
@media(max-width:390px){
  .juz-accordion-title b{font-size:18px}
  .juz-accordion .quran-index-quarter-row{min-height:76px;grid-template-columns:41px minmax(0,1fr) 38px}
  .juz-accordion .hizb-ring{width:38px;height:38px}
  .juz-accordion .quran-index-quarter-title{font-size:16px}
}

/* ---------- v33 · calm night index ----------
   Visual-only refinement. Keep the Zād identity, reduce saturated green blocks,
   and reserve gold for focus/current state. */
html[data-theme="dark"] .quran-index{
  --idx-bg:#061F1D;
  --idx-chrome:#082D29;
  --idx-row:#0A2925;
  --idx-row-open:#0B302B;
  --idx-text:#FFF9EA;
  --idx-muted:rgba(255,249,234,.58);
  --idx-faint:rgba(255,249,234,.38);
  --idx-line:rgba(228,201,128,.105);
  --idx-gold:#C59A4A;
  --idx-gold-hi:#E4C980;
  background:var(--idx-bg);
  color:var(--idx-text);
}
html[data-theme="dark"] .quran-index-head{
  background:linear-gradient(180deg,#0A332E 0%,var(--idx-chrome) 100%);
  border-bottom-color:rgba(228,201,128,.12);
  box-shadow:0 8px 24px rgba(0,0,0,.10);
}
html[data-theme="dark"] .quran-index-tabs{
  background:var(--idx-chrome);
  border-bottom-color:rgba(228,201,128,.12);
}
html[data-theme="dark"] .quran-index-title{color:var(--idx-gold-hi)}
html[data-theme="dark"] .quran-index-tab{color:rgba(255,249,234,.54)}
html[data-theme="dark"] .quran-index-tab.active{color:var(--idx-gold-hi)}
html[data-theme="dark"] .quran-index-tab.active:after{
  left:26%;right:26%;height:2px;background:var(--idx-gold-hi);
  box-shadow:0 0 10px rgba(228,201,128,.12)
}
html[data-theme="dark"] .quran-index-scroll{background:var(--idx-bg)}
html[data-theme="dark"] .quran-index-row{
  color:var(--idx-text);
  border-bottom:1px solid rgba(255,249,234,.042);
  background:transparent;
}
html[data-theme="dark"] .quran-index-row:active{
  background:rgba(228,201,128,.045)
}
html[data-theme="dark"] .quran-index-row.current{
  background:linear-gradient(90deg,rgba(197,154,74,.035),rgba(197,154,74,.09),rgba(73,161,140,.035));
  box-shadow:inset -2px 0 0 rgba(228,201,128,.48)
}
html[data-theme="dark"] .quran-index-row.current .quran-index-name,
html[data-theme="dark"] .quran-index-row.current .quran-index-surah-num{color:var(--idx-gold-hi)}
html[data-theme="dark"] .quran-index-name,
html[data-theme="dark"] .quran-index-quarter-title{color:rgba(255,249,234,.94)}
html[data-theme="dark"] .quran-index-surah-num,
html[data-theme="dark"] .quran-index-meta,
html[data-theme="dark"] .quran-index-page{color:var(--idx-muted)}

/* Juz separators inside the Surah index: separators, not large green bands. */
html[data-theme="dark"] .quran-index-juz-sep{
  background:linear-gradient(90deg,rgba(197,154,74,.025),rgba(197,154,74,.065),rgba(197,154,74,.025));
  color:var(--idx-muted);
  border-block-color:var(--idx-line);
}
html[data-theme="dark"] .quran-index-juz-sep b{color:rgba(228,201,128,.88)}
html[data-theme="dark"] .quran-index-juz-sep span{color:var(--idx-faint)}

/* Collapsible Juz index: calm rows with very subtle opened content. */
html[data-theme="dark"] .juz-accordion{
  border-bottom-color:rgba(255,249,234,.055);
  background:transparent;
}
html[data-theme="dark"] .juz-accordion-title b{color:rgba(255,249,234,.91)}
html[data-theme="dark"] .juz-accordion-title small,
html[data-theme="dark"] .juz-accordion-chevron{color:var(--idx-muted)}
html[data-theme="dark"] .juz-accordion.open .juz-accordion-title b{color:var(--idx-gold-hi)}
html[data-theme="dark"] .juz-accordion.open .juz-accordion-chevron{color:rgba(228,201,128,.82)}
html[data-theme="dark"] .juz-accordion-body-inner{
  background:linear-gradient(180deg,rgba(255,249,234,.018),rgba(255,249,234,.008));
}
html[data-theme="dark"] .juz-accordion .quran-index-quarter-row{
  border-top-color:rgba(255,249,234,.05)
}
html[data-theme="dark"] .juz-accordion .quran-index-quarter-row:active{background:rgba(228,201,128,.04)}

/* Hizb markers: muted ivory body, restrained gold progress. */
html[data-theme="dark"] .hizb-ring{
  background:conic-gradient(from 0deg,rgba(228,201,128,.88) 0 var(--portion),rgba(255,249,234,.11) var(--portion) 100%);
  color:rgba(255,249,234,.82);
  box-shadow:0 0 0 1px rgba(228,201,128,.06);
}
html[data-theme="dark"] .hizb-ring:after{
  box-shadow:inset 0 0 0 1px rgba(228,201,128,.17)
}
html[data-theme="dark"] .hizb-ring.start{
  background:rgba(228,201,128,.90);
  color:#17352F;
  box-shadow:0 0 0 1px rgba(228,201,128,.22)
}

/* ---------- v35 · refined daylight index ----------
   Same Zād al-Khayr identity as the approved night index:
   warm ivory surfaces, deep green typography, restrained gold accents. */
html:not([data-theme="dark"]) .quran-index{
  --idxl-bg:#F4EFE3;
  --idxl-chrome:#FFFCF4;
  --idxl-row:#FFFDF7;
  --idxl-text:#18362F;
  --idxl-muted:#7B725F;
  --idxl-faint:#9A907D;
  --idxl-line:rgba(114,76,43,.105);
  --idxl-gold:#C59A4A;
  --idxl-gold-hi:#B98632;
  --idxl-green:#0F5C50;
  background:
    radial-gradient(circle at 10% 0%,rgba(197,154,74,.055),transparent 17rem),
    var(--idxl-bg);
  color:var(--idxl-text);
}
html:not([data-theme="dark"]) .quran-index-head{
  background:
    radial-gradient(circle at 88% -40%,rgba(197,154,74,.10),transparent 12rem),
    linear-gradient(180deg,#FFFDF8 0%,#FBF6EA 100%);
  border-bottom-color:rgba(197,154,74,.18);
  box-shadow:0 8px 26px -22px rgba(58,43,20,.46);
}
html:not([data-theme="dark"]) .quran-index-tabs{
  background:rgba(255,252,244,.96);
  border-bottom-color:rgba(197,154,74,.16);
}
html:not([data-theme="dark"]) .quran-index-title{color:var(--idxl-green)}
html:not([data-theme="dark"]) .quran-index-tab{color:#807563}
html:not([data-theme="dark"]) .quran-index-tab.active{color:var(--idxl-green)}
html:not([data-theme="dark"]) .quran-index-tab.active:after{
  left:26%;right:26%;height:2px;background:var(--idxl-gold);
  box-shadow:0 2px 7px rgba(197,154,74,.16)
}
html:not([data-theme="dark"]) .quran-index-scroll{
  background:transparent
}
html:not([data-theme="dark"]) .quran-index-row{
  color:var(--idxl-text);
  border-bottom:1px solid rgba(114,76,43,.075);
  background:rgba(255,253,247,.30);
}
html:not([data-theme="dark"]) .quran-index-row:active{
  background:rgba(197,154,74,.075)
}
html:not([data-theme="dark"]) .quran-index-row.current{
  background:
    linear-gradient(90deg,rgba(197,154,74,.035),rgba(197,154,74,.105),rgba(15,92,80,.045));
  box-shadow:inset -2px 0 0 rgba(197,154,74,.64)
}
html:not([data-theme="dark"]) .quran-index-row.current .quran-index-name,
html:not([data-theme="dark"]) .quran-index-row.current .quran-index-surah-num{
  color:var(--idxl-green)
}
html:not([data-theme="dark"]) .quran-index-name,
html:not([data-theme="dark"]) .quran-index-quarter-title{color:#18362F}
html:not([data-theme="dark"]) .quran-index-surah-num{
  color:color-mix(in srgb,var(--idxl-green) 70%,#8B806E)
}
html:not([data-theme="dark"]) .quran-index-meta,
html:not([data-theme="dark"]) .quran-index-page{color:var(--idxl-muted)}

/* Juz separators in the Surah list behave like elegant dividers, not blocks. */
html:not([data-theme="dark"]) .quran-index-juz-sep{
  background:
    linear-gradient(90deg,rgba(197,154,74,.02),rgba(197,154,74,.085),rgba(197,154,74,.02));
  color:var(--idxl-muted);
  border-block-color:rgba(197,154,74,.16)
}
html:not([data-theme="dark"]) .quran-index-juz-sep b{
  color:#87672F
}
html:not([data-theme="dark"]) .quran-index-juz-sep span{
  color:var(--idxl-faint)
}

/* Collapsible Juz list */
html:not([data-theme="dark"]) .juz-accordion{
  border-bottom-color:rgba(114,76,43,.085);
  background:rgba(255,253,247,.22)
}
html:not([data-theme="dark"]) .juz-accordion-title b{
  color:#21483F
}
html:not([data-theme="dark"]) .juz-accordion-title small,
html:not([data-theme="dark"]) .juz-accordion-chevron{
  color:var(--idxl-muted)
}
html:not([data-theme="dark"]) .juz-accordion.open .juz-accordion-title b{
  color:var(--idxl-green)
}
html:not([data-theme="dark"]) .juz-accordion.open .juz-accordion-chevron{
  color:#A77C34
}
html:not([data-theme="dark"]) .juz-accordion-body-inner{
  background:
    linear-gradient(180deg,rgba(255,252,244,.72),rgba(245,240,228,.42))
}
html:not([data-theme="dark"]) .juz-accordion .quran-index-quarter-row{
  border-top-color:rgba(114,76,43,.065)
}
html:not([data-theme="dark"]) .juz-accordion .quran-index-quarter-row:active{
  background:rgba(197,154,74,.055)
}

/* Hizb progress markers: parchment body + restrained antique-gold progress. */
html:not([data-theme="dark"]) .hizb-ring{
  background:
    conic-gradient(from 0deg,#CDA75E 0 var(--portion),#E8DFC9 var(--portion) 100%);
  color:#3D524B;
  box-shadow:0 4px 12px -10px rgba(63,44,17,.45)
}
html:not([data-theme="dark"]) .hizb-ring:after{
  box-shadow:inset 0 0 0 1px rgba(147,105,43,.18)
}
html:not([data-theme="dark"]) .hizb-ring.start{
  background:linear-gradient(145deg,#DFC783,#C59A4A);
  color:#19372F;
  box-shadow:0 5px 14px -10px rgba(103,69,20,.55),inset 0 0 0 1px rgba(255,255,255,.28)
}

/* ---------- v36 · desktop experience ----------
   Desktop gets its own interaction geometry while the approved mobile layout stays intact. */
@media (min-width:900px){
  .topbar{
    padding:18px 28px 34px;
  }
  .brand{font-size:33px}
  .top-actions{gap:10px}
  .iconbtn{
    width:46px;height:46px;border-radius:14px;
    transition:transform .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease;
  }
  .iconbtn:hover,.tool:hover,.navbtn:hover,.audio-round:hover,.audio-control:hover,.audio-pill:hover{
    transform:translateY(-1px);
    border-color:color-mix(in srgb,var(--gold) 42%,var(--ui-line));
    background:color-mix(in srgb,var(--ui-gold) 8%,var(--ui-surface));
    box-shadow:0 10px 24px -20px rgba(39,45,39,.58);
  }
  html[data-theme="dark"] .iconbtn:hover,
  html[data-theme="dark"] .tool:hover,
  html[data-theme="dark"] .navbtn:hover,
  html[data-theme="dark"] .audio-round:hover,
  html[data-theme="dark"] .audio-control:hover,
  html[data-theme="dark"] .audio-pill:hover{
    background:rgba(228,201,128,.085);
    border-color:rgba(228,201,128,.30)
  }
  .iconbtn:focus-visible,.tool:focus-visible,.navbtn:focus-visible,
  .audio-round:focus-visible,.audio-control:focus-visible,.audio-pill:focus-visible,
  .audio-qari:focus-visible{
    outline:3px solid color-mix(in srgb,var(--gold) 34%,transparent);
    outline-offset:3px;
  }

  /* Compact central command dock. Page navigation moves to the two Mushaf sides. */
  .bottom{
    left:50%;right:auto;bottom:18px;
    width:min(520px,calc(100vw - 300px));
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:"listen tafsir" "shortcuts shortcuts";
    gap:8px;padding:8px;
    border:1px solid color-mix(in srgb,var(--gold) 19%,var(--ui-line));
    border-radius:20px;
    transform:translateX(-50%);
    background:color-mix(in srgb,var(--ui-surface) 94%,transparent);
    box-shadow:0 18px 44px -28px rgba(28,31,28,.52);
    -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
  }
  .hidden-tools .bottom{transform:translate(-50%,14px)}
  .tool{height:48px;font-size:12px;border-radius:14px;gap:7px}
  .tool svg{width:19px;height:19px;flex-basis:19px}

  .bottom>.navbtn{display:none}
  .desktop-page-nav{
    position:fixed;z-index:37;left:50%;top:50%;
    width:min(1040px,calc(100vw - 48px));
    transform:translate(-50%,-50%);
    display:flex;justify-content:space-between;align-items:center;
    pointer-events:none;direction:ltr;
    transition:opacity .18s ease;
  }
  .desktop-page-btn{
    width:56px;height:82px;flex:0 0 56px;
    border:1px solid var(--ui-line);border-radius:20px;pointer-events:auto;
    display:grid;place-items:center;padding:0;color:var(--brand);
    background:color-mix(in srgb,var(--ui-surface) 84%,transparent);
    box-shadow:0 14px 38px -27px rgba(20,28,24,.64);
    -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
    transition:transform .16s ease,background .16s ease,border-color .16s ease,opacity .16s ease;
  }
  .desktop-page-btn svg{
    width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;
    stroke-linecap:round;stroke-linejoin:round
  }
  .desktop-page-btn:hover{
    transform:scale(1.035);
    border-color:color-mix(in srgb,var(--gold) 42%,var(--ui-line));
    background:color-mix(in srgb,var(--ui-gold) 8%,var(--ui-surface))
  }
  .desktop-page-btn:focus-visible{
    outline:3px solid color-mix(in srgb,var(--gold) 34%,transparent);outline-offset:4px
  }
  .desktop-page-btn:disabled{opacity:.20;cursor:default}
  html[data-theme="dark"] .desktop-page-btn{
    color:rgba(255,249,234,.84);background:rgba(8,45,41,.72);
    border-color:rgba(228,201,128,.18)
  }
  html[data-theme="dark"] .desktop-page-btn:hover{
    background:rgba(228,201,128,.08);border-color:rgba(228,201,128,.32)
  }
  .hidden-tools .desktop-page-nav{opacity:0;pointer-events:none}
  .hidden-tools .desktop-page-btn{pointer-events:none}

  /* Desktop player: information and reciter on one side, transport controls on the other. */
  .audio-panel{
    left:50%;right:auto;bottom:22px;
    width:min(900px,calc(100vw - 120px));max-width:none;
    transform:translateX(-50%);
    padding:23px 24px 18px;border-radius:24px;
  }
  body.player-on.player-expanded .audio-panel{
    display:grid;
    grid-template-columns:minmax(300px,.92fr) minmax(430px,1.25fr);
    grid-template-rows:auto auto auto;
    column-gap:28px;row-gap:8px;align-items:center;
  }
  .audio-collapse{top:-19px}
  .audio-top{
    grid-column:1;grid-row:1;
    grid-template-columns:46px 46px minmax(0,1fr) 46px 46px;gap:8px;
  }
  .audio-round{width:46px;height:46px}
  .audio-qari{
    height:46px;border-radius:14px;padding-inline:15px;
    font-size:12.5px;font-weight:500;
    cursor:pointer;
  }
  .audio-now{
    grid-column:1;grid-row:2;
    margin:3px 3px 1px;font-size:11.5px;line-height:1.6;
  }
  .audio-progress-row{
    grid-column:1/-1;grid-row:3;margin-top:5px;
  }
  .audio-progress:before,.audio-progress i{height:4px}
  .audio-controls{
    grid-column:2;grid-row:1/3;
    margin:0;display:grid;
    grid-template-columns:72px 58px 74px 58px 58px 78px;
    justify-content:center;gap:10px;
  }
  .audio-control{width:54px;height:54px;justify-self:center}
  .audio-main{width:68px;height:68px;font-size:24px}
  .audio-pill{height:48px;font-size:11px;padding-inline:12px}
  .audio-continuous{font-size:10px}

  /* Desktop dialogs become centered panels rather than phone bottom-sheets. */
  .backdrop{align-items:center;padding:28px}
  .sheet{
    width:min(760px,calc(100vw - 80px));max-height:min(780px,86vh);
    border-radius:26px;padding:20px 22px 22px;
    box-shadow:0 28px 80px -36px rgba(0,0,0,.52)
  }
  .sheethead h3{font-size:29px}
  .field select{min-height:48px;font-size:13px}
  .apply{min-height:50px;font-size:13px}

  /* Mouse affordance for clickable Mushaf metadata. */
  .page-meta-link:hover{
    color:var(--gold);background:color-mix(in srgb,var(--gold) 7%,transparent)
  }
}
@media (min-width:900px) and (max-width:1120px){
  .desktop-page-nav{width:calc(100vw - 30px)}
  .audio-panel{width:min(820px,calc(100vw - 70px))}
  body.player-on.player-expanded .audio-panel{
    grid-template-columns:minmax(280px,.85fr) minmax(390px,1.15fr);
    column-gap:18px
  }
  .audio-controls{gap:7px;grid-template-columns:66px 54px 70px 54px 54px 72px}
}

/* Touch readers turn pages by swiping; the two tool rows use the full dock. */
@media (hover:none) and (pointer:coarse){
  .bottom{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"listen tafsir" "shortcuts shortcuts"}
  .bottom>.navbtn,.desktop-page-nav{display:none}
}
/* A rotated phone has little height: the four tools share one row, in the
   same right-to-left order as the two portrait rows. */
@media (orientation:landscape) and (max-height:599px) and (hover:none) and (pointer:coarse){
  .bottom{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-areas:"shortcuts shortcuts listen tafsir"}
}
/* Larger touch screens get readable controls in either orientation. The
   short-side bounds keep ordinary phones and mouse-driven computers intact. */
@media (min-width:600px) and (min-height:600px) and (hover:none) and (pointer:coarse){
  .bottom{
    --tablet-tool-height:clamp(56px,6vmin,64px);
    --tablet-tool-icon:clamp(22px,2.4vmin,26px);
    gap:clamp(8px,1vmin,10px);
  }
  .bottom .tool{
    height:var(--tablet-tool-height);min-height:var(--tablet-tool-height);
    font-size:clamp(14px,1.5vmin,16px);border-radius:clamp(14px,1.6vmin,17px);
    gap:clamp(7px,.8vmin,10px);padding-inline:clamp(12px,1.5vmin,18px);
  }
  .bottom .tool svg{
    width:var(--tablet-tool-icon);height:var(--tablet-tool-icon);flex-basis:var(--tablet-tool-icon);
  }
  .bottom #listenBtn>span:first-child{font-size:var(--tablet-tool-icon);line-height:1}
}
@media (min-width:900px) and (min-height:600px) and (hover:none) and (pointer:coarse){
  .bottom{width:min(680px,calc(100vw - 80px))}
}

/* ---------- v37 · native reciter menu contrast ----------
   Native option popups are painted by the browser/OS, so give the option
   surface explicit colors instead of inheriting the player's night palette. */
.audio-qari{color-scheme:light}
.audio-qari option{
  background:#FFFCF4 !important;
  color:#132823 !important;
}
html[data-theme="dark"] .audio-qari{color-scheme:dark}
html[data-theme="dark"] .audio-qari option{
  background:#0D3C35 !important;
  color:#FFF9EA !important;
}

/* ---------- v42 · true glass player ----------
   Strongly transparent in light mode; controls keep a light veil
   for readability while the Mushaf remains clearly visible below. */
.audio-panel{
  background:rgba(255,252,244,.26) !important;
  -webkit-backdrop-filter:blur(22px) saturate(112%);
  backdrop-filter:blur(22px) saturate(112%);
  border-color:rgba(197,154,74,.18);
  box-shadow:0 18px 46px rgba(19,40,35,.13);
}
.audio-collapse,
.audio-round,
.audio-pill,
.audio-qari,
.audio-control:not(.audio-main){
  background:rgba(255,252,244,.36) !important;
  border-color:rgba(114,76,43,.13);
}
html[data-theme="dark"] .audio-panel{
  background:rgba(8,45,41,.56) !important;
  border-color:rgba(228,201,128,.16);
  box-shadow:0 18px 48px rgba(0,0,0,.25);
}
html[data-theme="dark"] .audio-collapse,
html[data-theme="dark"] .audio-round,
html[data-theme="dark"] .audio-pill,
html[data-theme="dark"] .audio-qari,
html[data-theme="dark"] .audio-control:not(.audio-main){
  background:rgba(255,249,234,.055) !important;
  border-color:rgba(228,201,128,.15);
}
@media (min-width:900px){
  .audio-panel{
    -webkit-backdrop-filter:blur(24px) saturate(114%);
    backdrop-filter:blur(24px) saturate(114%);
  }
}

/* ---------- v45 · play button follows surah-title identity ---------- */
#panelPlay.audio-main{
  background:#C08A2B !important;
  color:#FFF9EA !important;
  border-color:#C08A2B !important;
  box-shadow:0 15px 32px -18px rgba(192,138,43,.42);
}
html[data-theme="dark"] #panelPlay.audio-main{
  background:var(--gold-hi) !important;
  color:#19332C !important;
  border-color:var(--gold-hi) !important;
  box-shadow:0 15px 32px -18px rgba(228,201,128,.34);
}

/* ---------- v47 · Zād Alkhair identity polish ----------
   Repo-derived hierarchy:
   gold = spiritual/primary, green = active state, ink = everyday chrome.
   Mushaf composition, QCF metrics and all dark-mode contracts stay untouched.
*/
html:not([data-theme="dark"]) .brand{
  color:var(--brand);
}

/* Warm, nearly-paper chrome instead of green-tinted controls. */
html:not([data-theme="dark"]) .topbar{
  background:
    radial-gradient(circle at 50% -110%,rgba(197,154,74,.10),transparent 58%),
    linear-gradient(180deg,rgba(255,252,244,.99) 0%,rgba(255,252,244,.92) 62%,rgba(255,252,244,0) 100%);
}
html:not([data-theme="dark"]) .bottom{
  background:
    radial-gradient(circle at 50% 120%,rgba(197,154,74,.07),transparent 58%),
    linear-gradient(0deg,rgba(255,252,244,.99) 0%,rgba(255,252,244,.96) 58%,rgba(255,252,244,.70) 82%,rgba(255,252,244,.22) 100%);
}
html:not([data-theme="dark"]) .iconbtn,
html:not([data-theme="dark"]) .tool:not(.primary),
html:not([data-theme="dark"]) .navbtn{
  color:#18362F;
  border-color:#DDD2BD;
  background:rgba(255,253,247,.62);
}
html:not([data-theme="dark"]) .iconbtn:active,
html:not([data-theme="dark"]) .tool:not(.primary):active,
html:not([data-theme="dark"]) .navbtn:active{
  background:#F4E8CA;
  border-color:#D7B767;
}

/* "Listen" is a primary spiritual action: same mature gold language as the app. */
html:not([data-theme="dark"]) .tool.primary{
  color:#19332C;
  border-color:var(--gold);
  background:linear-gradient(135deg,var(--gold-hi),var(--gold));
  box-shadow:0 12px 26px -18px rgba(132,89,22,.56);
}

/* Player: glass remains transparent; controls become neutral paper/ink.
   Gold remains reserved for playback itself. */
html:not([data-theme="dark"]) .audio-panel{
  border-color:rgba(192,138,43,.20);
  box-shadow:0 22px 54px -30px rgba(80,55,20,.30);
}
html:not([data-theme="dark"]) .audio-collapse,
html:not([data-theme="dark"]) .audio-round,
html:not([data-theme="dark"]) .audio-pill,
html:not([data-theme="dark"]) .audio-qari,
html:not([data-theme="dark"]) .audio-control:not(.audio-main){
  color:#18362F;
  background:rgba(255,253,247,.34) !important;
  border-color:rgba(114,76,43,.12);
}
html:not([data-theme="dark"]) .audio-progress:before{
  background:rgba(114,76,43,.10);
}
html:not([data-theme="dark"]) .audio-progress i,
html:not([data-theme="dark"]) .audio-progress input[type="range"]::-webkit-slider-thumb{
  background:#C08A2B;
}
html:not([data-theme="dark"]) .audio-progress input[type="range"]::-moz-range-thumb{background:#C08A2B}
/* State controls use green only when they are actually active. */
html:not([data-theme="dark"]) .audio-repeat.active,
html:not([data-theme="dark"]) .audio-continuous.active{
  color:#287A65;
  background:#E3EFE8 !important;
  box-shadow:inset 0 0 0 1px rgba(40,122,101,.40);
}

/* Sheets follow the actual app: headings are ink, links/actions may carry green. */
html:not([data-theme="dark"]) .sheet{
  background:
    radial-gradient(circle at 8% 0%,rgba(197,154,74,.055),transparent 18rem),
    #FFFCF4;
}
html:not([data-theme="dark"]) .sheethead h3,
html:not([data-theme="dark"]) .sheet h3{
  color:#132823;
}
html:not([data-theme="dark"]) .close-sheet{
  color:#29493F;
  background:#F0E9DB;
}

/* Index: neutral structure, green only for "current/active", gold for the tab marker. */
html:not([data-theme="dark"]) .quran-index{
  background:
    radial-gradient(circle at 8% 0%,rgba(197,154,74,.050),transparent 20rem),
    var(--paper);
}
html:not([data-theme="dark"]) .quran-index-title{
  color:#132823;
}
html:not([data-theme="dark"]) .quran-index-tab.active{
  color:#287A65;
}
html:not([data-theme="dark"]) .quran-index-row.current .quran-index-name,
html:not([data-theme="dark"]) .quran-index-row.current .quran-index-surah-num{
  color:#287A65;
}

/* Preserve the repo-derived gold pairing for the two spiritual anchors. */
html:not([data-theme="dark"]) .surah-line{
  color:#082D29;
}
html:not([data-theme="dark"]) #panelPlay.audio-main{
  background:#C08A2B !important;
  color:#FFF9EA !important;
  border-color:#C08A2B !important;
}

/* ---------- v49 · unified identity anchors ----------
   Four anchor elements always share one exact identity tone per mode:
   Zād wordmark, Surah title, main Play button, and Listen button.
*/
html:not([data-theme="dark"]) .brand,
html:not([data-theme="dark"]) .surah-line{
  color:#082D29 !important;
}
html:not([data-theme="dark"]) #panelPlay.audio-main,
html:not([data-theme="dark"]) .tool.primary{
  background:#082D29 !important;
  border-color:#082D29 !important;
  color:#FFF9EA !important;
  box-shadow:0 14px 30px -19px rgba(8,45,41,.50);
}

html[data-theme="dark"] .brand,
html[data-theme="dark"] .surah-line{
  color:#E4C980 !important;
}
html[data-theme="dark"] #panelPlay.audio-main,
html[data-theme="dark"] .tool.primary{
  background:#E4C980 !important;
  border-color:#E4C980 !important;
  color:#19332C !important;
  box-shadow:0 14px 30px -19px rgba(228,201,128,.40);
}

/* ---------- Full verified tafsir ---------- */
.tafsir-fadl{
  margin-top:12px;border:1px solid color-mix(in srgb,var(--ui-gold) 22%,transparent);
  border-radius:14px;background:color-mix(in srgb,var(--ui-gold) 6%,var(--ui-surface));
  overflow:hidden
}
.tafsir-fadl summary{
  cursor:pointer;list-style:none;padding:9px 11px;color:var(--ui-accent);
  font:600 10px Alexandria,system-ui,sans-serif
}
.tafsir-fadl summary::-webkit-details-marker{display:none}
.tafsir-fadl summary::before{content:"◂";display:inline-block;margin-inline-end:7px;color:var(--ui-gold);transition:transform .18s}
.tafsir-fadl[open] summary::before{transform:rotate(-90deg)}
.tafsir-fadl-text{
  padding:0 11px 11px;font-family:Amiri,serif;font-size:17px;line-height:2;
  color:var(--ui-text);border-top:1px solid color-mix(in srgb,var(--ui-gold) 14%,transparent)
}
html[data-theme="dark"] .tafsir-fadl{
  background:rgba(228,201,128,.035);border-color:rgba(228,201,128,.15)
}
html[data-theme="dark"] .tafsir-fadl summary{color:var(--gold-hi)}
html[data-theme="dark"] .tafsir-fadl-text{border-top-color:rgba(228,201,128,.10)}

/* ---------- v78 · اكتمال الصفحة على أيّ شاشة ----------
   نموذج قراءة واحد لكل الأجهزة: الصفحة تُلاءم عرضًا وارتفاعًا معًا، فتبقى
   صفحةً كاملة كما في المصحف. أفقي اللمس يستفيد من العرض والتمرير، وتختار
   fitPage() المقياس المناسب لكل حالة.

   تُضاف .scrolls إلى صفحةٍ بعينها عند القراءة بعرض الشاشة في أفقي اللمس،
   أو حين تعجز عن الاكتمال بحجم مقروء. وتُنزع عنها متى عادت ملاءمة الصفحة
   كاملةً. لا تمسّ هذه الحالة أي صفحة أخرى. */
.page-stage.scrolls{
  display:block;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:color-mix(in srgb,var(--gold) 28%,transparent) transparent;
}
.page-stage.scrolls::-webkit-scrollbar{width:7px}
.page-stage.scrolls::-webkit-scrollbar-track{background:transparent}
.page-stage.scrolls::-webkit-scrollbar-thumb{
  background:color-mix(in srgb,var(--gold) 24%,transparent);
  border-radius:999px
}
/* بلا height:auto لا ينمو المصحف، فلا يجد المسرحُ ما يمرّره. */
.page-stage.scrolls .mushaf{
  height:auto;
  min-height:calc(100% - var(--page-head) - var(--page-foot));
  margin-inline:auto;
  padding-block:10px 26px;
}
.page-stage.scrolls>.page-meta{height:var(--page-head);margin-inline:auto}
.page-stage.scrolls>.page-footer{height:var(--page-foot)}

/* بسملة الحاسب: استبدال محرف أُقرّ سابقًا، لا علاقة له بتخطيط الصفحة،
   فيبقى على معياره كما هو.

   والمسافة حول البسملة تُقارَب هنا قليلًا: أكثرها فراغٌ داخل صندوق السطر
   لا هامشٌ بينه وبين ما جاوره، فيُقلَّص من الاثنين معًا. ولا يمسّ هذا صفحةً
   بلا عنوان سورة، لأن البسملة لا ترد إلا مع مطلع سورة. */
@media (hover:hover) and (pointer:fine){
  .bismillah-line{
    transform:none;
    line-height:1.14;
    margin:0 0 5px;
  }
  .surah-line{margin-bottom:.04em}
  .bismillah-original{display:none}
  .bismillah-desktop{display:inline}
}

/* ---------- v80 · Quran home ---------- */
.quran-home-link{appearance:none;border:0;background:transparent;padding:5px 7px;font:700 17px "Aref Ruqaa",serif;cursor:pointer}
.quran-index{z-index:125}
.quran-index-head{gap:10px;min-height:68px;padding-inline:14px}
.quran-index-head-actions{display:flex;align-items:center;gap:7px}
.quran-index-head-action{width:39px;height:39px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface-2);color:var(--ui-text);display:grid;place-items:center;padding:0}
.quran-index-head-action svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.quran-index-head-action:active{transform:scale(.96)}
.quran-index-tabs{grid-template-columns:repeat(3,1fr)}
.quran-index-track{width:300%}
.quran-index-pane{width:33.333333%}
.quran-index-row-with-actions{padding-inline:14px 12px;grid-template-columns:42px minmax(0,1fr) auto;gap:9px}
.quran-index-row-main{appearance:none;border:0;background:transparent;color:inherit;padding:7px 0;display:grid;grid-template-columns:minmax(0,1fr) 43px;gap:8px;align-items:center;text-align:right;min-width:0}
.quran-index-row-main:active .quran-index-name{opacity:.72}
.quran-index-actions{display:flex;gap:5px;direction:rtl}
.quran-index-action{width:37px;height:37px;border:1px solid var(--ui-line);border-radius:11px;background:var(--ui-surface-2);color:var(--ui-accent);display:grid;place-items:center;padding:0;flex:0 0 auto}
.quran-index-action.share{color:var(--ui-muted)}
.quran-index-action.download{color:var(--ui-gold)}
.quran-index-action.download.downloaded{color:var(--brand)}
.quran-index-action.download.downloading{font-size:8px;font-weight:800;letter-spacing:-.02em;color:var(--ui-gold)}
.quran-index-action.download:disabled{cursor:wait;opacity:.86}
.quran-index-action svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.audio-offline-message{margin:12px 0 4px;padding:15px 14px;border:1px solid var(--ui-line);border-radius:15px;background:var(--ui-surface-2);color:var(--ui-text);font-size:12px;line-height:1.9;text-align:center}
.audio-offline-message small{display:block;margin-top:4px;color:var(--ui-muted);font-size:9px}
.audio-offline-message ul{list-style:none;padding:0;margin:8px 0 2px;display:grid;gap:4px;color:var(--brand);font-weight:700}
html[data-theme="dark"] .audio-offline-message ul{color:var(--gold-hi)}
.audio-offline-prompt{margin:8px 0 12px;text-align:center;color:var(--ui-text);font:700 13px/1.9 Alexandria,system-ui,sans-serif}
.audio-qari-choices{display:grid;gap:7px}
.audio-qari-choice{appearance:none;width:100%;min-height:48px;padding:9px 12px;border:1px solid var(--ui-line);border-radius:13px;background:var(--ui-surface-2);color:var(--ui-text);display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:right;font:700 11px Alexandria,system-ui,sans-serif;cursor:pointer}
.audio-qari-choice small{font-size:8px;color:var(--ui-muted);font-weight:600;white-space:nowrap}
.audio-qari-choice.downloaded{border-color:color-mix(in srgb,var(--ui-gold) 42%,var(--ui-line));background:color-mix(in srgb,var(--ui-gold) 7%,var(--ui-surface-2))}
.audio-offline-more{appearance:none;border:0;background:transparent;color:var(--brand);font:700 9px Alexandria,system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px;margin-top:7px;cursor:pointer}
html[data-theme="dark"] .audio-offline-more{color:var(--gold-hi)}
.audio-offline-delete-list{display:grid;gap:7px;margin-top:10px}
.audio-offline-checkrow{min-height:46px;padding:8px 12px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface-2);display:flex;align-items:center;gap:10px;color:var(--ui-text);font:700 11px Alexandria,system-ui,sans-serif;cursor:pointer}
.audio-offline-checkrow.select-all{border-color:color-mix(in srgb,var(--ui-gold) 42%,var(--ui-line));background:color-mix(in srgb,var(--ui-gold) 7%,var(--ui-surface-2))}
.audio-offline-checkrow input{width:18px;height:18px;accent-color:var(--brand);flex:0 0 auto}
.audio-offline-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.audio-offline-actions button{appearance:none;min-height:44px;border-radius:12px;border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-text);font:700 11px Alexandria,system-ui,sans-serif;cursor:pointer}
.audio-offline-actions .delete{color:#8C532B;border-color:color-mix(in srgb,var(--ui-gold) 46%,var(--ui-line));background:color-mix(in srgb,var(--ui-gold) 8%,var(--ui-surface))}
.quran-index-action:active{transform:scale(.95);background:var(--ui-accent-soft)}
.quran-index-bookmarks{padding:10px 12px calc(18px + env(safe-area-inset-bottom))}
.quran-bookmark-group{margin-bottom:15px}.quran-bookmark-group h4{font:700 17px "Aref Ruqaa",serif;color:var(--ui-text);margin:8px 4px}
.quran-bookmark-empty{padding:19px 12px;text-align:center;color:var(--ui-muted);font-size:10px;border:1px dashed var(--ui-line);border-radius:14px}
.quran-bookmark-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:7px;align-items:center;border-bottom:1px solid var(--ui-line)}
.quran-bookmark-open,.quran-bookmark-del{appearance:none;border:0;background:transparent;color:var(--ui-text);padding:11px 7px;text-align:right}
.quran-bookmark-open{display:grid;gap:3px}.quran-bookmark-open b{font:700 16px Amiri,serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quran-bookmark-open small{font-size:9px;color:var(--ui-muted)}
.quran-bookmark-del{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;padding:0;color:var(--ui-muted);font-size:18px}
.quran-hub-menu{display:grid;gap:7px;margin-top:10px}.quran-hub-menu button{appearance:none;border:1px solid var(--ui-line);border-radius:13px;background:var(--ui-surface);color:var(--ui-text);min-height:46px;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:right}
.quran-hub-menu button small{font-size:9px;color:var(--ui-muted)}
.quran-search-wrap{display:grid;gap:10px;margin-top:12px}.quran-search-input{width:100%;height:48px;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-surface-2);color:var(--ui-text);padding:0 13px;font:500 15px Alexandria,system-ui,sans-serif;outline:none}
.quran-search-input:focus{border-color:color-mix(in srgb,var(--ui-accent) 55%,var(--ui-line));box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-accent) 12%,transparent)}
.quran-search-status{min-height:22px;color:var(--ui-muted);font-size:9.5px;padding-inline:3px}.quran-search-results{display:grid;max-height:52vh;overflow:auto}
.quran-search-result{appearance:none;border:0;border-bottom:1px solid var(--ui-line);background:transparent;color:var(--ui-text);padding:10px 5px;text-align:right;display:grid;gap:4px}
.quran-search-result b{font:700 17px Amiri,serif;line-height:1.7}.quran-search-result small{font-size:9px;color:var(--ui-muted)}
.backdrop{z-index:145}.toast{z-index:155}
.juz-accordion-head-v80{width:100%;min-height:64px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:5px 12px;border:0;background:transparent;color:var(--ui-text)}
.juz-accordion-head-v80.current{background:color-mix(in srgb,var(--ui-accent-soft) 58%,transparent)}
.juz-accordion-head-main{appearance:none;border:0;background:transparent;color:inherit;display:grid;grid-template-columns:minmax(0,1fr) auto 22px;gap:8px;align-items:center;text-align:right;padding:7px 4px;min-width:0}
.juz-accordion.open .juz-accordion-head-v80 .juz-accordion-chevron{transform:rotate(180deg)}
html[data-theme="dark"] .quran-index-head-action,html[data-theme="dark"] .quran-index-action{background:rgba(255,249,234,.05);border-color:rgba(228,201,128,.18);color:var(--ivory)}
html[data-theme="dark"] .quran-index-action.share{color:rgba(255,249,234,.60)}
html[data-theme="dark"] .quran-index-action.download{color:var(--gold-hi)}
html[data-theme="dark"] .quran-index-action.download.downloaded{color:var(--gold-hi)}
html[data-theme="dark"] .audio-offline-actions .delete{color:var(--gold-hi);background:rgba(228,201,128,.07);border-color:rgba(228,201,128,.22)}
@media(max-width:390px){
  .quran-index-head{padding-inline:10px}.quran-index-title{font-size:25px}.quran-index-head-actions{gap:5px}.quran-index-head-action{width:36px;height:36px;border-radius:11px}
  .quran-index-row-with-actions{grid-template-columns:36px minmax(0,1fr) auto;padding-inline:11px 9px}.quran-index-row-main{grid-template-columns:minmax(0,1fr) 38px}.quran-index-actions{gap:4px}.quran-index-action{width:34px;height:34px}
  .juz-accordion-head-v80{padding-inline:8px}.juz-accordion-head-main{gap:6px}
}

/* ---------- v82 · محاذاة أرقام صفحات فهرس السور ---------- */
.quran-index-row-with-actions .quran-index-row-main{grid-template-columns:minmax(0,1fr) 50px}
.quran-index-row-with-actions .quran-index-page{
  width:50px;min-width:50px;display:flex;align-items:center;justify-content:center;justify-self:end;
  text-align:center;direction:rtl;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap
}
@media(max-width:390px){
  .quran-index-row-with-actions .quran-index-row-main{grid-template-columns:minmax(0,1fr) 44px}
  .quran-index-row-with-actions .quran-index-page{width:44px;min-width:44px}
}

/* Icons used in v84: Hugeicons Stroke Rounded (MIT), Quran 01 + Book Open Text. */
/* ---------- v83 · unified page-number column + visible hub icons ---------- */
.quran-index-head-action svg{display:block;width:20px;height:20px;overflow:visible}
.quran-index-head-action .quran-more-icon{fill:currentColor;stroke:none}

/* Juz separators use exactly the same outer and inner columns as Surah rows.
   This keeps Surah start-page numbers and Juz start-page numbers on one axis. */
.quran-index-juz-sep{
  min-height:51px;padding:0 12px 0 14px;
  display:grid;grid-template-columns:42px minmax(0,1fr) 121px;gap:9px;align-items:center
}
.quran-index-juz-num-slot{width:42px;min-width:42px}
.quran-index-juz-main{
  min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 50px;gap:8px;align-items:center
}
.quran-index-juz-main b{min-width:0;text-align:right}
.quran-index-juz-page{
  width:50px;min-width:50px;display:flex;align-items:center;justify-content:center;justify-self:end;
  font-family:"Aref Ruqaa",serif;font-size:16px;text-align:center;direction:rtl;
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap
}
.quran-index-juz-actions-slot{width:121px;min-width:121px}
@media(max-width:390px){
  .quran-index-juz-sep{padding-inline:11px 9px;grid-template-columns:36px minmax(0,1fr) 110px;gap:9px;min-height:48px}
  .quran-index-juz-num-slot{width:36px;min-width:36px}
  .quran-index-juz-main{grid-template-columns:minmax(0,1fr) 44px;gap:8px}
  .quran-index-juz-page{width:44px;min-width:44px}
  .quran-index-juz-actions-slot{width:110px;min-width:110px}
}

/* ---------- v89 · reader polish + Zad options identity ---------- */
html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

/* First-time offline preparation: visible progress, then disappear. */
.quran-offline-setup{
  position:fixed;
  z-index:176;
  top:calc(76px + env(safe-area-inset-top));
  left:50%;
  width:min(430px,calc(100% - 24px));
  transform:translate(-50%,-10px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  direction:rtl;
  transition:opacity .2s ease,transform .2s ease,visibility .2s step-end;
}
.quran-offline-setup.show{
  opacity:1;
  visibility:visible;
  transform:translate(-50%,0);
  transition:opacity .2s ease,transform .2s ease,visibility 0s;
}
.quran-offline-card{
  border:1px solid color-mix(in srgb,var(--gold) 34%,var(--ui-line));
  border-radius:18px;
  background:
    radial-gradient(circle at 92% 0%,color-mix(in srgb,var(--gold) 9%,transparent),transparent 38%),
    color-mix(in srgb,var(--ui-surface) 96%,var(--paper));
  box-shadow:0 14px 38px -23px rgba(4,36,31,.56);
  padding:12px 13px 11px;
}
.quran-offline-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.quran-offline-title{
  min-width:0;
  color:var(--brand-strong);
  font:700 11px Alexandria,system-ui,sans-serif;
  line-height:1.65;
}
.quran-offline-percent{
  flex:0 0 auto;
  min-width:43px;
  color:var(--brand);
  font:700 13px "Aref Ruqaa",serif;
  text-align:left;
  direction:rtl;
}
.quran-offline-track{
  height:7px;
  margin-top:9px;
  overflow:hidden;
  border-radius:999px;
  background:color-mix(in srgb,var(--brand) 10%,var(--ui-surface-3));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--brand) 10%,transparent);
}
.quran-offline-fill{
  display:block;
  width:0%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--gold),var(--brand));
  transition:width .22s ease;
}
html[data-theme="dark"] .quran-offline-card{
  background:
    radial-gradient(circle at 92% 0%,rgba(228,201,128,.08),transparent 38%),
    #0D3C35;
  border-color:rgba(228,201,128,.25);
  box-shadow:0 18px 42px -22px rgba(0,0,0,.78);
}
html[data-theme="dark"] .quran-offline-title{color:var(--ivory)}
html[data-theme="dark"] .quran-offline-percent{color:var(--gold-hi)}
html[data-theme="dark"] .quran-offline-track{background:rgba(255,249,234,.09)}
html[data-theme="dark"] .quran-offline-fill{background:linear-gradient(90deg,var(--gold-hi),var(--green-hi))}
@media(min-width:760px){
  .quran-offline-setup{top:24px}
}

/* Quran index: dark green primary typography in daylight, app palette at night. */
html:not([data-theme="dark"]) .quran-index-title,
html:not([data-theme="dark"]) .quran-index-name,
html:not([data-theme="dark"]) .quran-index-quarter-title,
html:not([data-theme="dark"]) .juz-accordion-title b,
html:not([data-theme="dark"]) .quran-index-juz-main b{
  color:var(--brand-strong) !important;
}
html:not([data-theme="dark"]) .quran-index-tab{
  color:#5B756D;
}
html:not([data-theme="dark"]) .quran-index-tab.active{
  color:var(--brand) !important;
}
html:not([data-theme="dark"]) .quran-index-surah-num,
html:not([data-theme="dark"]) .quran-index-page,
html:not([data-theme="dark"]) .quran-index-juz-page{
  color:#47766A !important;
}
html:not([data-theme="dark"]) .quran-index-meta,
html:not([data-theme="dark"]) .juz-accordion-title small{
  color:#718178 !important;
}

/* Give Ruqaa names enough vertical breathing room for hamzas/diacritics. */
.quran-index-name{
  line-height:1.46 !important;
  padding-block:2px 3px;
}
.quran-index-row-main{
  padding-block:5px;
}

/* References: three related app-palette families instead of one flat color. */
.quran-bookmark-group{
  --ref-accent:var(--brand);
  --ref-tint:color-mix(in srgb,var(--brand) 6%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--brand) 20%,var(--ui-line));
  margin:0 0 13px;
  padding:9px 10px 7px;
  border:1px solid var(--ref-line);
  border-radius:17px;
  background:var(--ref-tint);
}
.quran-bookmark-group.ref-recent{
  --ref-accent:var(--brand);
  --ref-tint:color-mix(in srgb,var(--brand) 5%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--brand) 19%,var(--ui-line));
}
.quran-bookmark-group.ref-pages{
  --ref-accent:#9A6C20;
  --ref-tint:color-mix(in srgb,var(--gold) 8%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--gold) 28%,var(--ui-line));
}
.quran-bookmark-group.ref-ayahs{
  --ref-accent:#A34B50;
  --ref-tint:color-mix(in srgb,var(--red) 5%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--red) 17%,var(--ui-line));
}
.quran-bookmark-group h4{
  margin:3px 4px 7px !important;
  color:var(--ref-accent) !important;
  line-height:1.55;
}
.quran-bookmark-row{
  border-bottom-color:color-mix(in srgb,var(--ref-accent) 13%,var(--ui-line));
}
.quran-bookmark-row:last-child{border-bottom:0}
.quran-bookmark-open b{
  color:var(--ref-accent);
  line-height:1.75;
}
.quran-bookmark-open small{
  color:color-mix(in srgb,var(--ref-accent) 48%,var(--ui-muted));
}
.quran-bookmark-del{
  color:color-mix(in srgb,var(--red) 78%,var(--ui-muted));
}
.quran-bookmark-empty{
  background:color-mix(in srgb,var(--ui-surface) 74%,transparent);
}
html[data-theme="dark"] .quran-bookmark-group.ref-recent{
  --ref-accent:#72C6B1;
  --ref-tint:rgba(73,161,140,.055);
  --ref-line:rgba(73,161,140,.18);
}
html[data-theme="dark"] .quran-bookmark-group.ref-pages{
  --ref-accent:var(--gold-hi);
  --ref-tint:rgba(228,201,128,.05);
  --ref-line:rgba(228,201,128,.18);
}
html[data-theme="dark"] .quran-bookmark-group.ref-ayahs{
  --ref-accent:#E09296;
  --ref-tint:rgba(215,123,128,.045);
  --ref-line:rgba(215,123,128,.16);
}
html[data-theme="dark"] .quran-bookmark-open small{
  color:rgba(255,249,234,.62);
}

/* "خيارات": same vocabulary as the main app — paper, deep green, soft gold. */
.quran-options-sheet{
  overflow:hidden;
  padding:0 0 calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 90% -8%,color-mix(in srgb,var(--gold) 13%,transparent),transparent 36%),
    var(--ui-surface);
}
.quran-options-sheet .sheethead{
  position:relative;
  padding:17px 18px 13px;
  border-bottom:1px solid color-mix(in srgb,var(--gold) 24%,var(--ui-line));
}
.quran-options-sheet .sheethead:after{
  content:"";
  position:absolute;
  right:18px;
  bottom:-1px;
  width:58px;
  height:2px;
  border-radius:999px;
  background:var(--gold);
}
.quran-options-sheet .sheethead h3{
  color:var(--brand-strong) !important;
  font-size:29px;
  line-height:1.15;
}
.quran-options-sheet .close-sheet{
  min-width:54px;
  border:1px solid color-mix(in srgb,var(--brand) 12%,var(--ui-line));
  background:color-mix(in srgb,var(--brand) 5%,var(--ui-surface-2));
  color:var(--brand);
}
.quran-options-intro{
  display:flex;
  align-items:center;
  gap:8px;
  padding:11px 18px 1px;
  color:var(--ui-muted);
  font-size:9px;
}
.quran-options-intro:before{
  content:"";
  width:24px;
  height:1px;
  background:var(--gold);
  box-shadow:9px 0 0 -0.25px color-mix(in srgb,var(--gold) 52%,transparent);
}
.quran-hub-menu{
  display:grid;
  gap:10px;
  margin:9px 14px 4px;
}
.quran-hub-menu button{
  appearance:none;
  min-height:68px;
  padding:9px 11px;
  border:1px solid color-mix(in srgb,var(--brand) 12%,var(--ui-line));
  border-radius:18px;
  background:
    linear-gradient(115deg,color-mix(in srgb,var(--brand) 4%,var(--ui-surface)),var(--ui-surface));
  color:var(--brand-strong);
  display:grid;
  grid-template-columns:46px minmax(0,1fr) 18px;
  align-items:center;
  gap:11px;
  text-align:right;
  box-shadow:0 10px 24px -22px rgba(5,55,47,.65);
  transition:transform .14s ease,border-color .14s ease,background .14s ease;
}
.quran-hub-menu button:active{
  transform:scale(.985);
  border-color:color-mix(in srgb,var(--gold) 42%,var(--ui-line));
  background:color-mix(in srgb,var(--brand) 7%,var(--ui-surface));
}
.quran-option-icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  color:var(--brand);
  background:color-mix(in srgb,var(--brand) 8%,var(--ui-surface-2));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--brand) 12%,transparent);
}
.quran-option-icon.gold{
  color:#92681F;
  background:color-mix(in srgb,var(--gold) 11%,var(--ui-surface-2));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 18%,transparent);
}
.quran-option-icon svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.quran-option-copy{
  min-width:0;
  display:grid;
  gap:3px;
}
.quran-option-copy strong{
  color:var(--brand-strong);
  font:700 14px Alexandria,system-ui,sans-serif;
}
.quran-option-copy small{
  color:var(--ui-muted);
  font-size:9px;
  line-height:1.6;
}
.quran-option-arrow{
  color:var(--gold);
  display:grid;
  place-items:center;
}
.quran-option-arrow svg{
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
html[data-theme="dark"] .quran-options-sheet{
  background:
    radial-gradient(circle at 90% -8%,rgba(228,201,128,.08),transparent 38%),
    #0D3C35;
}
html[data-theme="dark"] .quran-options-sheet .sheethead{
  border-bottom-color:rgba(228,201,128,.16);
}
html[data-theme="dark"] .quran-options-sheet .sheethead h3{
  color:var(--gold-hi) !important;
}
html[data-theme="dark"] .quran-options-sheet .close-sheet{
  color:var(--ivory);
  background:rgba(255,249,234,.05);
  border-color:rgba(228,201,128,.17);
}
html[data-theme="dark"] .quran-hub-menu button{
  color:var(--ivory);
  border-color:rgba(228,201,128,.14);
  background:linear-gradient(115deg,rgba(73,161,140,.06),rgba(255,249,234,.025));
  box-shadow:none;
}
html[data-theme="dark"] .quran-option-copy strong{color:var(--ivory)}
html[data-theme="dark"] .quran-option-copy small{color:rgba(255,249,234,.60)}
html[data-theme="dark"] .quran-option-icon{
  color:#77C9B5;
  background:rgba(73,161,140,.10);
  box-shadow:inset 0 0 0 1px rgba(73,161,140,.15);
}
html[data-theme="dark"] .quran-option-icon.gold{
  color:var(--gold-hi);
  background:rgba(228,201,128,.08);
  box-shadow:inset 0 0 0 1px rgba(228,201,128,.13);
}
@media(max-width:390px){
  .quran-options-sheet .sheethead{padding-inline:15px}
  .quran-options-intro{padding-inline:15px}
  .quran-hub-menu{margin-inline:11px}
  .quran-hub-menu button{
    min-height:64px;
    grid-template-columns:43px minmax(0,1fr) 17px;
    gap:9px;
  }
  .quran-option-icon{width:41px;height:41px;border-radius:13px}
}

/* ---------- v90 · unified reference palette + selected Surah ---------- */
/* In daylight the current Surah mirrors the night treatment: gold, not green. */
html:not([data-theme="dark"]) .quran-index-row.current .quran-index-name,
html:not([data-theme="dark"]) .quran-index-row.current .quran-index-surah-num{
  color:var(--gold) !important;
}

/* One reference language everywhere: index tab and the sheet opened while reading. */
.quran-bookmark-group,
.bookmark-section{
  --ref-accent:var(--brand);
  --ref-tint:color-mix(in srgb,var(--brand) 5%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--brand) 19%,var(--ui-line));
}
.quran-bookmark-group.ref-recent,.bookmark-section.ref-recent{
  --ref-accent:var(--brand);
  --ref-tint:color-mix(in srgb,var(--brand) 5%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--brand) 19%,var(--ui-line));
}
.quran-bookmark-group.ref-pages,.bookmark-section.ref-pages{
  --ref-accent:#9A6C20;
  --ref-tint:color-mix(in srgb,var(--gold) 8%,var(--ui-surface));
  --ref-line:color-mix(in srgb,var(--gold) 28%,var(--ui-line));
}
.quran-bookmark-group.ref-ayahs,.bookmark-section.ref-ayahs{
  --ref-accent:#171A18;
  --ref-tint:color-mix(in srgb,#B8AA91 7%,var(--ui-surface));
  --ref-line:color-mix(in srgb,#8D806A 22%,var(--ui-line));
}
.bookmark-section{
  gap:7px;margin:0;padding:9px 10px 7px;border:1px solid var(--ref-line);border-radius:17px;background:var(--ref-tint);
}
.bookmark-section+.bookmark-section{padding-top:9px;border-top:1px solid var(--ref-line)}
.bookmark-title h4{color:var(--ref-accent) !important;line-height:1.55}
.bookmark-title small{color:color-mix(in srgb,var(--ref-accent) 45%,var(--ui-muted))}
.bookmark-list{gap:0}
.bookmark-row{border-bottom:1px solid color-mix(in srgb,var(--ref-accent) 13%,var(--ui-line));gap:7px}
.bookmark-row:last-child{border-bottom:0}
.bookmark-main,.bookmark-delete{background:transparent !important;border:0 !important;color:var(--ui-text);border-radius:11px}
.bookmark-main{padding:10px 7px}
.bookmark-main b{color:var(--ref-accent);line-height:1.75}
.bookmark-main small{color:color-mix(in srgb,var(--ref-accent) 46%,var(--ui-muted)) !important}
.bookmark-delete,.quran-bookmark-del{color:color-mix(in srgb,var(--ref-accent) 38%,var(--ui-muted)) !important}
.bookmark-delete:active,.quran-bookmark-del:active{background:color-mix(in srgb,var(--ref-accent) 8%,transparent) !important}

html[data-theme="dark"] .quran-bookmark-group.ref-recent,
html[data-theme="dark"] .bookmark-section.ref-recent{
  --ref-accent:#72C6B1;--ref-tint:rgba(73,161,140,.055);--ref-line:rgba(73,161,140,.18);
}
html[data-theme="dark"] .quran-bookmark-group.ref-pages,
html[data-theme="dark"] .bookmark-section.ref-pages{
  --ref-accent:var(--gold-hi);--ref-tint:rgba(228,201,128,.05);--ref-line:rgba(228,201,128,.18);
}
html[data-theme="dark"] .quran-bookmark-group.ref-ayahs,
html[data-theme="dark"] .bookmark-section.ref-ayahs{
  --ref-accent:var(--ivory);--ref-tint:rgba(255,249,234,.045);--ref-line:rgba(255,249,234,.15);
}
html[data-theme="dark"] .bookmark-main small,
html[data-theme="dark"] .quran-bookmark-open small{color:rgba(255,249,234,.62) !important}

/* v100 · light-mode menus follow the Zad Al-Khair identity, never neutral black. */
html:not([data-theme="dark"]) .sheet,
html:not([data-theme="dark"]) .sheethead,
html:not([data-theme="dark"]) .audio-qari-choice,
html:not([data-theme="dark"]) .audio-offline-prompt,
html:not([data-theme="dark"]) .audio-offline-message,
html:not([data-theme="dark"]) .audio-offline-checkrow,
html:not([data-theme="dark"]) .quran-hub-menu button,
html:not([data-theme="dark"]) .field select,
html:not([data-theme="dark"]) .audio-qari{color:#0F5C50}
html:not([data-theme="dark"]) .sheethead h3,
html:not([data-theme="dark"]) .quran-options-intro,
html:not([data-theme="dark"]) .audio-offline-prompt{color:#0A473E}
html:not([data-theme="dark"]) .audio-qari-choice small,
html:not([data-theme="dark"]) .audio-offline-message small,
html:not([data-theme="dark"]) .field label{color:#5F756E}
html:not([data-theme="dark"]) select option{color:#0F5C50;background:#FFFCF4}

/* ---------- v101 · unified Zad Al-Khair reader menus ----------
   Visual-only contract: all reader sheets, reciter/download dialogs and
   Quran-home actions share one ivory / deep-green / soft-gold language. */
html:not([data-theme="dark"]) .quran-index-head-action{
  color:var(--brand-strong) !important;
  background:color-mix(in srgb,var(--brand) 6%,var(--ui-surface-2));
  border-color:color-mix(in srgb,var(--gold) 24%,var(--ui-line));
}
html:not([data-theme="dark"]) .quran-index-head-action:active{
  background:color-mix(in srgb,var(--brand) 11%,var(--ui-surface-2));
  border-color:color-mix(in srgb,var(--gold) 48%,var(--ui-line));
}

/* One shell for every reader dialog. */
.sheet,
.quran-options-sheet{
  background:
    radial-gradient(circle at 88% -10%,color-mix(in srgb,var(--gold) 9%,transparent),transparent 18rem),
    var(--ui-surface);
  color:var(--ui-text);
  border-color:color-mix(in srgb,var(--gold) 30%,var(--ui-line));
}
.sheethead,
.quran-options-sheet .sheethead{
  position:relative;
  padding-bottom:12px;
  border-bottom:1px solid color-mix(in srgb,var(--gold) 24%,var(--ui-line));
}
.sheethead:after,
.quran-options-sheet .sheethead:after{
  content:"";
  position:absolute;
  right:0;
  bottom:-1px;
  width:52px;
  height:1.5px;
  border-radius:999px;
  background:var(--gold);
  opacity:.9;
}
.sheethead h3,
.quran-options-sheet .sheethead h3{
  color:var(--brand-strong) !important;
  font-weight:400;
}
.close-sheet,
.quran-options-sheet .close-sheet{
  color:var(--brand-strong);
  background:color-mix(in srgb,var(--brand) 5%,var(--ui-surface-2));
  border:1px solid color-mix(in srgb,var(--gold) 22%,var(--ui-line));
  font-weight:500;
}
.close-sheet:active,
.quran-options-sheet .close-sheet:active{
  background:color-mix(in srgb,var(--brand) 10%,var(--ui-surface-2));
}

/* One card language for options, reciters, downloads and ordinary selectors. */
.audio-qari-choice,
.audio-offline-checkrow,
.audio-offline-actions button,
.quran-hub-menu button,
.tafsir-nav-btn,
.field select,
.quran-search-input{
  border-color:color-mix(in srgb,var(--gold) 22%,var(--ui-line));
  background:color-mix(in srgb,var(--brand) 2.5%,var(--ui-surface-2));
  color:var(--brand-strong);
  box-shadow:none;
}
.audio-qari-choice,
.audio-offline-checkrow,
.audio-offline-actions button{
  border-radius:14px;
  font-weight:600;
}
.audio-qari-choice:active,
.audio-offline-checkrow:active,
.audio-offline-actions button:active,
.quran-hub-menu button:active,
.tafsir-nav-btn:active{
  background:color-mix(in srgb,var(--brand) 8%,var(--ui-surface-2));
  border-color:color-mix(in srgb,var(--gold) 42%,var(--ui-line));
}
.audio-qari-choice.downloaded,
.audio-offline-checkrow.select-all{
  background:color-mix(in srgb,var(--gold) 8%,var(--ui-surface-2));
  border-color:color-mix(in srgb,var(--gold) 45%,var(--ui-line));
}
.audio-offline-prompt{
  color:var(--brand-strong) !important;
  font-weight:600;
}
.audio-qari-choice small,
.audio-offline-message small,
.quran-hub-menu button small,
.field label{
  color:color-mix(in srgb,var(--brand-strong) 62%,var(--ui-muted));
}
.audio-offline-more{
  color:var(--brand);
  font-weight:600;
}
.audio-offline-actions .delete{
  color:#7A5A25;
  background:color-mix(in srgb,var(--gold) 8%,var(--ui-surface));
  border-color:color-mix(in srgb,var(--gold) 38%,var(--ui-line));
}

/* Bring the previously bespoke Options sheet back into the same system. */
.quran-options-sheet .sheethead{padding:15px 16px 12px}
.quran-options-sheet .sheethead:after{right:16px;width:52px;height:1.5px}
.quran-options-sheet .sheethead h3{font-size:27px}
.quran-options-intro{
  padding:10px 16px 0;
  color:var(--ui-muted);
  font-weight:500;
}
.quran-options-intro:before{width:20px;height:1px;box-shadow:none;background:var(--gold)}
.quran-hub-menu{gap:8px;margin:9px 12px 4px}
.quran-hub-menu button{
  min-height:60px;
  border-radius:15px;
  padding:8px 10px;
  grid-template-columns:42px minmax(0,1fr) 17px;
  gap:10px;
  background:color-mix(in srgb,var(--brand) 2.5%,var(--ui-surface-2));
}
.quran-option-icon{
  width:40px;height:40px;border-radius:12px;
  color:var(--brand);
  background:color-mix(in srgb,var(--brand) 7%,var(--ui-surface));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 17%,transparent);
}
.quran-option-icon.gold{
  color:#916A25;
  background:color-mix(in srgb,var(--gold) 9%,var(--ui-surface));
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 22%,transparent);
}
.quran-option-copy strong{color:var(--brand-strong);font-weight:600}
.quran-option-arrow{color:var(--gold)}

/* Native reciter/select controls: same identity even where the OS renders the popup. */
html:not([data-theme="dark"]) .audio-qari,
html:not([data-theme="dark"]) .field select{
  color:var(--brand-strong);
  background:color-mix(in srgb,var(--brand) 2.5%,var(--ui-surface));
  border-color:color-mix(in srgb,var(--gold) 22%,var(--ui-line));
}
html:not([data-theme="dark"]) select option{
  color:var(--brand-strong);
  background:#FFFCF4;
}

/* Dark mode is the same component system, translated to the night palette. */
html[data-theme="dark"] .sheet,
html[data-theme="dark"] .quran-options-sheet{
  background:
    radial-gradient(circle at 88% -10%,rgba(228,201,128,.07),transparent 18rem),
    var(--ui-surface);
  border-color:rgba(228,201,128,.20);
}
html[data-theme="dark"] .sheethead,
html[data-theme="dark"] .quran-options-sheet .sheethead{border-bottom-color:rgba(228,201,128,.16)}
html[data-theme="dark"] .sheethead:after,
html[data-theme="dark"] .quran-options-sheet .sheethead:after{background:var(--gold-hi)}
html[data-theme="dark"] .sheethead h3,
html[data-theme="dark"] .quran-options-sheet .sheethead h3{color:var(--gold-hi) !important}
html[data-theme="dark"] .audio-qari-choice,
html[data-theme="dark"] .audio-offline-checkrow,
html[data-theme="dark"] .audio-offline-actions button,
html[data-theme="dark"] .quran-hub-menu button,
html[data-theme="dark"] .tafsir-nav-btn,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .quran-search-input{
  color:var(--ivory);
  background:rgba(255,249,234,.045);
  border-color:rgba(228,201,128,.16);
}
html[data-theme="dark"] .audio-qari-choice:active,
html[data-theme="dark"] .audio-offline-checkrow:active,
html[data-theme="dark"] .audio-offline-actions button:active,
html[data-theme="dark"] .quran-hub-menu button:active,
html[data-theme="dark"] .tafsir-nav-btn:active{background:rgba(228,201,128,.07);border-color:rgba(228,201,128,.30)}
html[data-theme="dark"] .audio-qari-choice.downloaded,
html[data-theme="dark"] .audio-offline-checkrow.select-all{background:rgba(228,201,128,.07);border-color:rgba(228,201,128,.30)}
html[data-theme="dark"] .audio-offline-prompt{color:var(--ivory) !important}
html[data-theme="dark"] .audio-qari-choice small,
html[data-theme="dark"] .audio-offline-message small,
html[data-theme="dark"] .quran-hub-menu button small,
html[data-theme="dark"] .field label{color:rgba(255,249,234,.62)}
html[data-theme="dark"] .quran-option-copy strong{color:var(--ivory)}
html[data-theme="dark"] .quran-index-head-action{color:var(--ivory)}

/* Player transport and readable reciter name. Native select stays accessible. */
.audio-qari-wrap{position:relative;flex:1;min-width:0;overflow:hidden;height:38px;border-radius:10px;background:var(--brand-soft,rgba(15,92,80,.08))}
.audio-qari-wrap .audio-qari{position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:none}
/* اختيار القارئ بنافذة زاد الخير نفسها (openPanelReciters)، لا بقائمة الجهاز؛ والقائمة الأصلية
   مخفية تحفظ الاختيار لبقية الكود. */
.audio-qari-btn{position:absolute;inset:0;width:100%;height:100%;border:0;margin:0;padding:0;background:transparent;border-radius:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.audio-qari-btn:focus{outline:none}
.qari-marquee{position:absolute;inset:0 10px;overflow:hidden;display:flex;align-items:center;direction:rtl;pointer-events:none}
.qari-marquee span{display:block;flex-shrink:0;white-space:nowrap;font-size:12px}
.qari-marquee.moving span{animation:qari-scroll var(--qari-duration,14s) ease-in-out infinite}
@keyframes qari-scroll{0%,15%{transform:translateX(0)}75%,90%{transform:translateX(var(--qari-distance))}100%{transform:translateX(0)}}
.audio-qari-wrap:has(.audio-qari-btn:focus-visible){outline:2px solid var(--brand);outline-offset:2px}
.audio-repeat{position:relative}.audio-repeat small{position:absolute;bottom:1px;inset-inline-end:2px;font-size:10px;line-height:1}
.audio-panel{--player-accent:#082D29;--player-on-accent:#FFF9EA}
html[data-theme="dark"] .audio-panel{--player-accent:#E4C980;--player-on-accent:#19332C}
.audio-panel .audio-qari-wrap,
.audio-panel #continuousBtn,
html:not([data-theme="dark"]) .audio-panel #continuousBtn.active,
html[data-theme="dark"] .audio-panel #continuousBtn.active{
  background:var(--player-accent)!important;color:var(--player-on-accent)!important;border-color:var(--player-accent)!important;box-shadow:none;
}
.audio-panel #continuousBtn{font-weight:600}
.audio-panel #continuousBtn.active{outline:1px solid var(--player-accent);outline-offset:3px}
.audio-qari-wrap:has(.audio-qari-btn:focus-visible){outline-color:var(--player-accent)}
.audio-now-row{display:flex;align-items:center;gap:12px;margin:9px 2px 3px;min-width:0}
.audio-now-row .audio-now{flex:1;min-width:0;margin:0}
.audio-queue-link{position:relative;flex:0 0 34px;display:grid;place-items:center;width:34px;height:32px;border:0;border-radius:10px;background:transparent;color:var(--ui-muted);cursor:pointer;padding:5px}
.audio-queue-link:hover,.audio-queue-link:focus-visible{color:var(--player-accent);background:color-mix(in srgb,var(--player-accent) 8%,transparent)}
.audio-queue-link svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.audio-queue-link span{position:absolute;top:-3px;inset-inline-end:-3px;min-width:14px;height:14px;box-sizing:border-box;display:grid;place-items:center;background:var(--player-accent);color:var(--player-on-accent);border-radius:8px;padding:0 3px;font-size:8px;line-height:1}
.audio-queue-link span:empty{display:none}
@media(min-width:900px){.audio-now-row{grid-column:1;grid-row:2;margin:0}}
.queue-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-block:12px}
.queue-toolbar button,.queue-actions button{font:inherit;border:1px solid #8885;border-radius:9px;background:transparent;color:inherit;padding:8px;cursor:pointer}
.queue-list{display:grid;gap:8px;max-height:42vh;overflow:auto;padding:0;list-style:none;touch-action:pan-y}
.queue-row{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #8884;border-radius:12px}
.queue-row.current{border-color:var(--brand,#0f5c50);background:var(--brand-soft,rgba(15,92,80,.08))}
.queue-track{flex:1;min-width:0;text-align:right;background:none;border:0;color:inherit;font:inherit;cursor:pointer}
.queue-track small{display:block;opacity:.65;font-size:11px;margin-top:4px}
.queue-actions{display:flex;gap:4px}.queue-actions button{padding:7px;min-width:32px}.queue-actions button:disabled{opacity:.3;cursor:default}
.queue-handle{cursor:grab;touch-action:none;padding:8px;color:inherit;background:none;border:0;font-size:20px}
.queue-row.dragging{opacity:.55}.queue-empty,.player-hint{font-size:12px;line-height:1.9;opacity:.75}
.timer-digits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;direction:ltr;margin:18px 0}
.timer-column{text-align:center;min-width:0}.timer-column-title{font-size:12px;color:var(--ui-muted);margin-bottom:6px}
.timer-wheel-wrap{position:relative;border:1px solid var(--ui-line);border-radius:15px;overflow:hidden;background:var(--ui-surface-2)}
.timer-wheel-wrap:before{content:"";position:absolute;z-index:1;inset:44px 5px;border-block:1px solid color-mix(in srgb,var(--brand) 28%,transparent);border-radius:9px;background:color-mix(in srgb,var(--brand) 8%,transparent);pointer-events:none}
.timer-wheel{height:132px;box-sizing:border-box;overflow-y:auto;padding-block:44px;scroll-snap-type:y mandatory;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;position:relative;z-index:2}
.timer-wheel::-webkit-scrollbar{display:none}
.timer-value{height:44px;width:100%;display:block;flex-shrink:0;scroll-snap-align:center;border:0;padding:0;background:transparent;color:var(--ui-muted);font:500 24px Alexandria,system-ui,sans-serif;font-variant-numeric:tabular-nums;cursor:pointer;opacity:.55}
.timer-value[aria-selected="true"]{color:#082D29;font-weight:700;opacity:1}
html[data-theme="dark"] .timer-value[aria-selected="true"]{color:#E4C980}
html[data-theme="dark"] .timer-wheel-wrap:before{border-color:rgba(228,201,128,.3);background:rgba(228,201,128,.08)}
.timer-nudge{display:block;width:100%;height:30px;padding:0;border:0;background:transparent;color:var(--ui-muted);font-size:20px;cursor:pointer}
.timer-nudge:focus-visible,.timer-value:focus-visible{outline:2px solid var(--ui-gold);outline-offset:-3px;border-radius:8px}
.timer-presets{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.timer-presets button{flex:1;font:inherit;border:1px solid #8885;border-radius:10px;padding:9px;background:transparent;color:inherit;cursor:pointer}
@media(prefers-reduced-motion:reduce){.qari-marquee.moving span{animation:none}.qari-marquee{overflow:auto;pointer-events:auto}}

/* One ivory, emerald and brushed-gold surface system for the reader, player and every sheet. */
:root{
  color-scheme:light;
  --reader-surface:rgba(255,251,242,.94);--reader-raised:rgba(255,254,249,.78);
  --reader-well:rgba(230,216,184,.22);--reader-ink:#173E35;--reader-muted:#746C57;
  --reader-line:rgba(169,131,58,.30);--reader-gold:#96702D;
  --reader-selected:rgba(213,178,101,.18);--reader-shadow:rgba(69,52,21,.17);
  --reader-action:linear-gradient(135deg,#F1DFA8 0%,#D5B16A 60%,#C69B4B 100%);
  --reader-on-action:#253B2F;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --reader-surface:rgba(8,38,33,.95);--reader-raised:rgba(255,246,217,.045);
  --reader-well:rgba(0,0,0,.12);--reader-ink:#FFF5DC;--reader-muted:#C1BBA7;
  --reader-line:rgba(228,201,128,.23);--reader-gold:#E4C980;
  --reader-selected:rgba(228,201,128,.11);--reader-shadow:rgba(0,0,0,.34);
  --reader-action:linear-gradient(135deg,#F4E4B2 0%,#E4C980 65%,#C9A355 100%);
}
html #audioPanel{
  width:min(560px,calc(100vw - 24px));max-width:560px;left:50%;right:auto;transform:translateX(-50%);
  bottom:calc(12px + env(safe-area-inset-bottom));padding:20px 18px 16px;border-radius:26px;
  background:radial-gradient(ellipse at 50% 0%,rgba(228,201,128,.10),transparent 70%),var(--reader-surface)!important;
  color:var(--reader-ink);border:1px solid var(--reader-line);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 14px 48px -12px var(--reader-shadow);
  backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
}
html body.player-on.player-expanded #audioPanel{display:block}
body.player-on.player-expanded .bottom{opacity:0;visibility:hidden;pointer-events:none}
#audioPanel .audio-top{display:grid;grid-template-columns:40px 40px minmax(0,1fr) 40px 40px;gap:7px}
#audioPanel .audio-round{width:40px;height:40px}
#audioPanel .audio-round,#audioPanel .audio-control:not(.audio-main),#audioPanel .audio-pill,#audioPanel .audio-qari-wrap{
  background:var(--reader-raised)!important;color:var(--reader-gold)!important;
  border:1px solid var(--reader-line);border-color:var(--reader-line)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
#audioPanel .audio-qari-wrap{height:40px;border-radius:12px;color:var(--reader-ink)!important}
#audioPanel .qari-marquee{inset-inline:12px}
#audioPanel .qari-marquee span{font-size:11px;font-weight:500}
#audioPanel .audio-timer small{color:var(--reader-muted);opacity:1;font-size:8px}
#audioPanel .audio-collapse{width:54px;height:28px;top:-16px;border-radius:17px 17px 0 0;background:var(--reader-surface)!important;color:var(--reader-gold);border-color:var(--reader-line);box-shadow:none}
#audioPanel .audio-collapse svg{width:18px;height:18px}
#audioPanel .audio-now-row{position:relative;display:flex;align-items:center;justify-content:center;min-height:70px;margin:13px 0 9px;padding-inline:96px}
#audioPanel .audio-now-copy{min-width:0;text-align:center;display:grid;gap:5px}
#audioPanel .audio-eyebrow{display:flex;align-items:center;justify-content:center;gap:9px;color:var(--reader-gold);font-size:9px;font-weight:500;line-height:1.4}
#audioPanel .audio-eyebrow:before,#audioPanel .audio-eyebrow:after{content:"";height:1px;width:24px;background:var(--reader-line)}
#audioPanel .audio-now{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:9px;row-gap:2px;white-space:normal;overflow:visible;opacity:1;margin:0;line-height:1.7;color:var(--reader-ink)}
#audioPanel .audio-surah-title{font-size:19px;font-weight:600;letter-spacing:-.4px}
#audioPanel .audio-ayah-label{font-size:10px;color:var(--reader-muted)}
#audioPanel .audio-queue-tools{position:absolute;inset-inline-end:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:0}
#audioPanel .audio-queue-link{position:relative;inset:auto;top:auto;transform:none;flex:0 0 44px;width:44px;height:44px;border:1px solid transparent;color:var(--reader-muted);background:transparent;opacity:.7}
#audioPanel .audio-queue-link.active{color:var(--reader-gold);opacity:1}
#audioPanel .audio-queue-link:hover,#audioPanel .audio-queue-link:focus-visible{background:var(--reader-selected);opacity:1}
#audioPanel .audio-queue-link span{top:1px;inset-inline-end:0}
#audioPanel .audio-queue-toggle{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--reader-muted);cursor:pointer;flex:none}
#audioPanel .audio-queue-toggle:disabled{opacity:.35;cursor:default}
#audioPanel .audio-queue-toggle:focus-visible{outline:2px solid var(--reader-gold);outline-offset:1px}
#audioPanel .audio-queue-toggle-track{position:relative;width:30px;height:18px;border:1px solid var(--reader-line);border-radius:20px;background:var(--reader-line);transition:background .16s}
#audioPanel .audio-queue-toggle-track:after{content:"";position:absolute;top:2px;right:2px;width:12px;height:12px;border-radius:50%;background:var(--reader-surface);transition:transform .16s}
#audioPanel .audio-queue-toggle[aria-checked="true"] .audio-queue-toggle-track{background:var(--reader-action);border-color:var(--reader-gold)}
#audioPanel .audio-queue-toggle[aria-checked="true"] .audio-queue-toggle-track:after{transform:translateX(-12px)}
@media(prefers-reduced-motion:reduce){#audioPanel .audio-queue-toggle-track,#audioPanel .audio-queue-toggle-track:after{transition:none}}
#audioPanel .audio-queue-link span{background:var(--reader-line);color:var(--reader-muted);box-shadow:0 0 0 2px var(--reader-surface)}
#audioPanel .audio-queue-link.active span{background:var(--reader-gold);color:var(--reader-on-action)}
#audioPanel .audio-progress-row{margin:0 1px;gap:8px;grid-template-columns:38px minmax(0,1fr) 38px}
#audioPanel .audio-progress-time{font-size:9px;color:var(--reader-muted)}
#audioPanel .audio-progress:before{background:var(--reader-line);height:3px}
#audioPanel .audio-progress i{background:linear-gradient(90deg,#C69B4B,#E4C980);height:3px}
#audioPanel #progressSeek::-webkit-slider-thumb{background:#D5B16A;border-color:var(--reader-surface);width:12px;height:12px;box-shadow:0 0 0 1px var(--reader-line)}
#audioPanel #progressSeek::-moz-range-thumb{background:#D5B16A;border-color:var(--reader-surface)}
#audioPanel .audio-controls{display:grid;grid-template-columns:48px minmax(32px,1fr) 70px minmax(32px,1fr) 48px;gap:8px;align-items:center;margin-top:9px}
#audioPanel .audio-control{width:44px;height:44px;justify-self:center}
#audioPanel .audio-control svg{width:21px;height:21px}
html #audioPanel #panelPlay.audio-main{width:64px;height:64px;background:var(--reader-action)!important;color:var(--reader-on-action)!important;border:1px solid rgba(187,146,63,.5)!important;box-shadow:inset 0 1px 1px rgba(255,255,255,.6),0 6px 18px -8px rgba(167,120,29,.65);font-size:22px}
#audioPanel .audio-pill{height:38px;font-size:10px;padding-inline:8px}
html #audioPanel #continuousBtn,html #audioPanel #continuousBtn.active{
  background:var(--reader-raised)!important;color:var(--reader-muted)!important;border-color:var(--reader-line)!important;
  outline:none;box-shadow:none;font-size:9px;font-weight:500;position:absolute;inset-inline-start:0;top:50%;transform:translateY(-50%);width:58px;height:30px;
}
html #audioPanel #continuousBtn.active,html #audioPanel #repeatBtn.active{background:var(--reader-selected)!important;color:var(--reader-gold)!important;border-color:var(--reader-gold)!important;box-shadow:none}
#audioPanel button:focus-visible,#audioPanel .audio-qari-wrap:has(.audio-qari-btn:focus-visible){outline:2px solid var(--reader-gold);outline-offset:3px}
#audioPanel .audio-qari-btn:focus-visible{outline:none}
#audioPanel .audio-round:hover,#audioPanel .audio-control:not(.audio-main):hover,#audioPanel .audio-pill:hover{border-color:var(--reader-gold);background:var(--reader-selected)!important}
#audioPanel #stopPlayer{border-color:transparent;background:transparent!important;color:var(--reader-muted)!important}
.backdrop{background:rgba(3,22,18,.42);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
html .backdrop .sheet{background:radial-gradient(ellipse at 50% 0%,rgba(228,201,128,.08),transparent 70%),var(--reader-surface)!important;color:var(--reader-ink);border:1px solid var(--reader-line);box-shadow:inset 0 1px 0 rgba(255,255,255,.10),0 22px 65px -20px var(--reader-shadow)}
.backdrop .sheethead{border-color:var(--reader-line)}
html .backdrop .sheethead h3,html .backdrop .quran-options-sheet .sheethead h3{color:var(--reader-ink)!important}
.backdrop .sheethead:after{background:var(--reader-gold)}
html .backdrop .close-sheet,html .backdrop .quran-options-sheet .close-sheet,.backdrop .queue-toolbar button,.backdrop .queue-actions button,.backdrop .timer-presets button{
  background:var(--reader-raised);color:var(--reader-ink);border:1px solid var(--reader-line);border-radius:11px;
}
html .backdrop .field select{background:var(--reader-raised);color:var(--reader-ink);border-color:var(--reader-line)}
html .backdrop .field label,.backdrop .player-hint,.backdrop .timer-column-title,.backdrop .timer-nudge{color:var(--reader-muted);opacity:1}
html .backdrop .apply{background:var(--reader-action)!important;color:var(--reader-on-action)!important;border:1px solid var(--reader-line);box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 5px 16px -10px rgba(167,120,29,.5);font-weight:600}
.backdrop .queue-row{background:var(--reader-raised);border-color:var(--reader-line)}
.backdrop .queue-row.current{background:var(--reader-selected);border-color:var(--reader-gold)}
.backdrop .queue-track,.backdrop .queue-handle{color:var(--reader-ink)}
.backdrop .queue-track small{color:var(--reader-muted);opacity:1}
.backdrop .timer-wheel-wrap{background:var(--reader-well);border-color:var(--reader-line)}
html .backdrop .timer-wheel-wrap:before{background:var(--reader-selected);border-color:var(--reader-line)}
html .backdrop .timer-value{color:var(--reader-muted)}
html .backdrop .timer-value[aria-selected="true"]{color:var(--reader-ink)}
.backdrop .timer-presets button:hover,.backdrop .queue-toolbar button:hover{background:var(--reader-selected);border-color:var(--reader-gold)}
@media(max-width:390px){
  html #audioPanel{width:calc(100vw - 16px);padding-inline:12px}
  #audioPanel .audio-top{grid-template-columns:36px 36px minmax(0,1fr) 36px 36px;gap:5px}
  #audioPanel .audio-round{width:36px;height:36px}
  #audioPanel .audio-qari-wrap{height:36px}
  #audioPanel .audio-controls{grid-template-columns:40px minmax(28px,1fr) 62px minmax(28px,1fr) 40px;gap:5px}
  #audioPanel .audio-control{width:38px;height:40px}
  html #audioPanel #panelPlay.audio-main{width:58px;height:58px}
}
@media(max-width:380px){
  #audioPanel .audio-now-row{padding-inline:62px;min-height:88px}
  #audioPanel .audio-queue-tools{flex-direction:column}
}
@media(min-width:900px){html #audioPanel{bottom:24px;padding:20px 22px 18px}#audioPanel .audio-now-row{min-height:76px;margin:14px 0 8px}#audioPanel .audio-surah-title{font-size:22px}}

/* Shared sizing, states and content layout. Mushaf glyph composition is unchanged. */
html .backdrop .settings,html .backdrop .grid2,html .backdrop .field{min-width:0;max-width:100%}
html .backdrop .settings{grid-template-columns:minmax(0,1fr)}
html .backdrop .grid2{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
html .backdrop .field select,html .backdrop .field input{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box}
html .backdrop .field label{font-size:11px;line-height:1.6}
html .backdrop .close-sheet{min-height:38px;min-width:54px;font-size:11px;padding:7px 11px}
html .backdrop .audio-qari-choice,
html .backdrop .audio-offline-checkrow,
html .backdrop .audio-offline-actions button,
html .backdrop .quran-hub-menu button,
html .backdrop .tafsir-nav-btn,
html .backdrop .quran-search-input{
  background:var(--reader-raised);color:var(--reader-ink);border-color:var(--reader-line);
}
html .backdrop .audio-offline-prompt{color:var(--reader-ink)!important}
html .backdrop .audio-offline-message,html .backdrop .author-note{
  background:var(--reader-well);color:var(--reader-muted);border-color:var(--reader-line);
}
html .backdrop .quran-option-copy strong{color:var(--reader-ink)}
html .backdrop .quran-option-icon{background:var(--reader-selected);color:var(--reader-gold);box-shadow:inset 0 0 0 1px var(--reader-line)}
html .backdrop .quran-option-copy small,
html .backdrop .audio-qari-choice small,
html .backdrop .quran-search-status,
html .backdrop .quran-search-result small{color:var(--reader-muted);font-size:10.5px;line-height:1.7}
html .backdrop .quran-search-input:focus{border-color:var(--reader-gold);box-shadow:0 0 0 3px var(--reader-selected)}
html .backdrop .quran-search-result{color:var(--reader-ink);border-color:var(--reader-line)}
html .backdrop .quran-search-result:hover,html .backdrop .quran-search-result:focus-visible{background:var(--reader-selected)}
html .backdrop .tafsir-nav-btn{min-height:40px;font-size:11px}
html .backdrop .source{color:var(--reader-muted);font-size:10.5px;border-color:var(--reader-line)}
html .backdrop .bookmark-title small,html .backdrop .bookmark-main small{font-size:10.5px}
html .backdrop .queue-toolbar button,html .backdrop .timer-presets button{min-height:40px;font-size:12px}
html .backdrop .queue-actions button{min-width:38px;min-height:38px}
html .backdrop .audio-offline-actions button{min-height:42px}
html .backdrop .empty-state{color:var(--reader-muted);border-color:var(--reader-line);line-height:1.8}
html .backdrop button:disabled{opacity:.38;cursor:default;filter:saturate(.35);box-shadow:none}
html .backdrop button:disabled:hover{background:var(--reader-raised);border-color:var(--reader-line)}
html .backdrop button:focus-visible,html .backdrop select:focus-visible,html .backdrop input:focus-visible{
  outline:2px solid var(--reader-gold);outline-offset:3px;
}
html .backdrop .bookmark-delete,html .quran-index .quran-bookmark-del{color:#9F3C36!important}
html[data-theme="dark"] .backdrop .bookmark-delete,html[data-theme="dark"] .quran-index .quran-bookmark-del{color:#F0AAA0!important}
html .backdrop .audio-offline-actions button.delete{color:#9F3C36;background:rgba(159,60,54,.06);border-color:rgba(159,60,54,.25)}
html[data-theme="dark"] .backdrop .audio-offline-actions button.delete{color:#F0AAA0;background:rgba(240,170,160,.06);border-color:rgba(240,170,160,.25)}
html .ayah-menu{
  background:var(--reader-surface);color:var(--reader-ink);border-color:var(--reader-line);
  box-shadow:0 10px 30px -10px var(--reader-shadow);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
}
html .ayah-menu:after{border-top-color:var(--reader-surface)}
html .ayah-menu .menu-btn{width:54px;height:54px;color:var(--reader-ink);gap:4px}
html .ayah-menu .menu-btn.wide{width:88px}
html .ayah-menu .menu-btn.play{color:var(--reader-gold)}
html .ayah-menu .menu-label{font-size:10px;line-height:1.3;opacity:1}
html .ayah-menu .menu-btn:active{background:var(--reader-selected)}
html .ayah-menu .menu-btn:focus-visible{outline:2px solid var(--reader-gold);outline-offset:-2px}
html .quran-index .quran-index-head-action,html .quran-index .quran-index-action{
  background:var(--reader-raised);color:var(--reader-muted);border-color:var(--reader-line);
  width:40px;height:40px;border-radius:11px;
}
html .quran-index .quran-index-head-action{color:var(--reader-ink)!important}
html .quran-index .quran-index-action.play,html .quran-index .quran-index-action.download{color:var(--reader-gold)}
html .quran-index .quran-index-action.download.downloaded{color:var(--brand)}
html[data-theme="dark"] .quran-index .quran-index-action.download.downloaded{color:#A9D4C4;border-color:rgba(169,212,196,.35)}
html .quran-index .quran-index-action.download.downloading{font-size:10px}
html .quran-index .quran-index-head-action:hover,html .quran-index .quran-index-action:hover{background:var(--reader-selected);border-color:var(--reader-gold)}
html .quran-index .quran-index-head-action:focus-visible,html .quran-index .quran-index-action:focus-visible,html .quran-index-tab:focus-visible{
  outline:2px solid var(--reader-gold);outline-offset:2px;
}
html .quran-index .quran-index-action:disabled{opacity:.38;cursor:default}
html .quran-index .quran-index-action.downloading:disabled{opacity:.86;cursor:wait}
html .quran-index-meta,html .juz-accordion-title small,html .quran-bookmark-open small{font-size:10.5px}
html .toast,html .notice{
  background:var(--reader-surface);color:var(--reader-ink);border:1px solid var(--reader-line);
  box-shadow:0 8px 25px -10px var(--reader-shadow);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  max-width:calc(100vw - 32px);text-align:center;
}
html .toast{white-space:normal;line-height:1.7;font-size:11px}
@media(max-width:350px){
  html .quran-index-row-with-actions{padding-inline:9px;column-gap:6px;grid-template-columns:32px minmax(0,1fr) auto}
  html .quran-index .quran-index-actions{gap:4px}
  html .quran-index-row-main{grid-template-columns:minmax(0,1fr) 30px;gap:5px}
}

/* Verse context belongs to its own header cell; notifications sit below the toolbar. */
html .topbar{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;
  padding:calc(9px + env(safe-area-inset-top)) 13px 12px;
  background:linear-gradient(180deg,var(--reader-surface) 0%,var(--reader-surface) 70%,transparent 100%);
}
html .topbar .quran-home-link{grid-column:1;grid-row:1;color:var(--reader-ink)!important;white-space:nowrap}
html .topbar .top-actions{grid-column:3;grid-row:1;gap:7px;min-width:max-content}
html .topbar .iconbtn{width:40px;height:40px;background:var(--reader-raised)!important;color:var(--reader-gold);border-color:var(--reader-line);box-shadow:none}
html .topbar .iconbtn:focus-visible{outline:2px solid var(--reader-gold);outline-offset:3px}
html .topbar .iconbtn:active{background:var(--reader-selected)!important}
html .bottom #bookmarkBtn.marked{color:var(--red);border-color:var(--red)}
html .bottom #bookmarkBtn.marked svg{fill:currentColor}
.reader-context{
  grid-column:2;grid-row:1;justify-self:center;min-width:0;width:100%;max-width:190px;min-height:40px;
  display:grid;align-content:center;gap:1px;padding:4px 7px;border:1px solid var(--reader-line);border-radius:13px;
  background:var(--reader-raised);color:var(--reader-ink);text-align:center;pointer-events:none;
  opacity:0;transition:opacity .16s;overflow:hidden;
}
.reader-context.show{opacity:1}
.context-surah{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:500;line-height:1.4}
.context-ayah{display:block;font-size:9px;line-height:1.4;color:var(--reader-muted)}
html .toast{top:calc(70px + env(safe-area-inset-top))}
@media(max-width:350px){html .topbar{padding-inline:9px;column-gap:5px}html .topbar .top-actions{gap:5px}}
@media(min-width:900px){.context-surah{font-size:11px}.context-ayah{font-size:10px}}
@media(prefers-reduced-motion:reduce){.reader-context{transition:none}}

/* Low-page taps use the same tools below the header, away from the selected
   text. Their existing widths, button sizes and tab order remain in place. */
html body.reader-tools-top .bottom{
  top:var(--reader-tools-top);bottom:auto;
  padding-bottom:4px;
  background:linear-gradient(180deg,var(--reader-surface) 0%,var(--reader-surface) 70%,transparent 100%);
}
html body.reader-tools-top.hidden-tools .bottom{transform:translateY(-14px)}
@media(min-width:900px){
  html body.reader-tools-top .bottom{padding-bottom:8px}
  html body.reader-tools-top.hidden-tools .bottom{transform:translate(-50%,-14px)}
}

.queue-source{padding:14px;border:1px solid var(--reader-line);border-radius:15px;background:var(--reader-raised)}
.queue-source-label{position:relative;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:44px;cursor:pointer;font-size:13px;color:var(--reader-ink)}
.queue-source-label input{position:absolute;inset-inline-end:0;width:48px;height:44px;margin:0;opacity:0;cursor:pointer}
.queue-switch{width:44px;height:26px;flex:none;border:1px solid var(--reader-line);border-radius:20px;background:var(--reader-line);transition:background .16s;pointer-events:none;position:relative}
.queue-switch::after{content:"";position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;background:var(--reader-surface);box-shadow:0 1px 3px #0002;transition:transform .16s}
.queue-source-label input:checked+.queue-switch{background:var(--reader-action);border-color:var(--reader-gold)}
.queue-source-label input:checked+.queue-switch::after{transform:translateX(-18px)}
.queue-source-label input:focus-visible+.queue-switch{outline:2px solid var(--reader-gold);outline-offset:4px}
.queue-source-label input:disabled+.queue-switch{opacity:.4}
.queue-source .player-hint{margin:6px 0 0}
@media(prefers-reduced-motion:reduce){.queue-switch,.queue-switch::after{transition:none}}

.audio-verse-settings[hidden],.player-backdrop .field[hidden]{display:none!important}

/* Surah rows and Juz separators share one set of measurements, so their page
   numbers sit in a single column by construction at every width. The values are
   the ones Surah rows already used; separators reserve exactly the width of the
   three row actions (play, share, download). */
/* بين الأزرار ‎8px‎ لتتباعد عناوينها في الشريط فوقها؛ في أضيق الشاشات (‎350px‎ وأقل) تبقى ‎4px‎ كي لا تُقصّ أسماء السور. */
.quran-index{--ix-pad-left:12px;--ix-pad-right:14px;--ix-gap:9px;--ix-num:42px;--ix-page:50px;--ix-page-gap:8px;--ix-btn:40px;--ix-btn-gap:8px}
@media(max-width:390px){.quran-index{--ix-pad-left:9px;--ix-pad-right:11px;--ix-num:36px;--ix-page:44px}}
@media(max-width:350px){.quran-index{--ix-pad-right:9px;--ix-gap:6px;--ix-num:32px;--ix-page-gap:5px;--ix-btn-gap:4px}}
html body .quran-index .quran-index-row-with-actions,
html body .quran-index .quran-index-juz-sep{padding-left:var(--ix-pad-left);padding-right:var(--ix-pad-right);column-gap:var(--ix-gap);grid-template-columns:var(--ix-num) minmax(0,1fr) calc(3 * var(--ix-btn) + 2 * var(--ix-btn-gap))}
html body .quran-index .quran-index-row-main,
html body .quran-index .quran-index-juz-main{grid-template-columns:minmax(0,1fr) var(--ix-page);column-gap:var(--ix-page-gap)}
html body .quran-index .quran-index-page,
html body .quran-index .quran-index-juz-page{width:var(--ix-page);min-width:var(--ix-page)}
html body .quran-index .quran-index-actions{gap:var(--ix-btn-gap)}
html body .quran-index .quran-index-action{width:var(--ix-btn);height:var(--ix-btn)}

/* Zad's four sections under the Quran index (the same bar as on the home screen). */
/* Same box as the home bar (.zk-tabs): 72px tall plus the safe area, blurred ground. */
.reader-app-tabs{flex:none;position:relative;box-sizing:border-box;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:calc(72px + env(safe-area-inset-bottom));padding:0 10px env(safe-area-inset-bottom);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
  direction:rtl;border-top:1px solid rgba(169,131,58,.26);background:rgba(255,251,242,.94);font-family:"Alexandria",Tahoma,Arial,sans-serif;
  --app-tab:#6B6350;--app-tab-on:#0D3C35}
html[data-theme="dark"] .reader-app-tabs{border-top-color:rgba(228,201,128,.18);background:rgba(8,38,33,.94);--app-tab:#A9A390;--app-tab-on:#E4C980}
.reader-app-tabs a{position:relative;display:flex;transition:color .3s ease,background-color .3s ease;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:44px;padding:8px 2px;
  color:var(--app-tab);text-decoration:none;-webkit-tap-highlight-color:transparent}
.reader-app-tabs svg{width:23px;height:23px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.reader-app-tabs span{font-size:11px;line-height:1.3;text-align:center;font-weight:500}
.reader-app-tabs a[aria-current="page"]{color:var(--app-tab-on)}
.reader-app-tabs a[aria-current="page"] span{font-weight:650}
/* One marker that slides to the chosen tab, as on the home screen (RTL: counted from the right). */
.reader-app-dot{position:absolute;top:-1px;right:calc(10px + var(--app-tab-i,1) * (100% - 20px) / 5);width:calc((100% - 20px) / 5);display:flex;justify-content:center;
  pointer-events:none;transition:right .45s cubic-bezier(.3,.9,.3,1)}
.reader-app-dot::before{content:"";width:34px;height:3px;border-radius:0 0 3px 3px;background:var(--app-tab-on)}
.reader-app-tabs a:focus-visible{outline:2px solid #C59A4A;outline-offset:-4px;border-radius:12px}
@media (min-width:371px){.reader-app-tabs span{white-space:nowrap}}
@media (max-width:350px){.reader-app-tabs span{font-size:10px}}
/* On wide screens: a floating pill, never stretched across the window. */
@media (min-width:860px){
  .reader-app-tabs{align-self:center;display:flex;gap:4px;min-height:0;height:58px;margin:10px 0 18px;padding:6px;
    border:1px solid rgba(169,131,58,.26);border-radius:20px;box-shadow:0 18px 40px -20px rgba(69,52,21,.28)}
  html[data-theme="dark"] .reader-app-tabs{border-color:rgba(228,201,128,.18);box-shadow:0 18px 40px -20px rgba(0,0,0,.55)}
  .reader-app-tabs a{flex-direction:row;gap:8px;padding:0 16px;border-radius:14px}
  .reader-app-tabs span{font-size:14px}
  .reader-app-tabs a[aria-current="page"]{background:rgba(197,154,74,.14)}
  html[data-theme="dark"] .reader-app-tabs a[aria-current="page"]{background:rgba(228,201,128,.11)}
  .reader-app-dot{display:none}
}

/* Same as the home page: cross-fade between the two app pages; the tabs hold still. */
@view-transition{navigation:auto}
.reader-app-tabs{view-transition-name:zad-tabs}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}
/* As on the home bar: labels reserve their bold width, so nothing shifts when the current tab changes. */
@media (min-width:371px){
.reader-app-tabs span[data-label]{display:inline-grid;text-rendering:optimizeLegibility;font-kerning:normal;font-synthesis:none;font-variant-ligatures:normal;font-optical-sizing:auto}
.reader-app-tabs span[data-label]::after{content:attr(data-label);font-weight:650;height:0;visibility:hidden;pointer-events:none;white-space:nowrap}
}

/* ---------- تبويب «الاستماع» ---------- */
.zad-listen{--zl-ink:#173E35;--zl-muted:#6B6350;--zl-surface:#FFFBF2;--zl-line:rgba(169,131,58,.26);--zl-gold:#8E6A28;--zl-gold-2:#C59A4A;--zl-gold-3:#E4C980;
  position:fixed;inset:0;z-index:126;display:flex;flex-direction:column;direction:rtl;background:var(--paper);color:var(--zl-ink);font-family:Alexandria,system-ui,sans-serif;isolation:isolate}
.zad-listen::after{content:"";position:absolute;inset:0 0 auto;height:260px;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 50% -10%,rgba(228,201,128,.22),transparent 70%)}
html[data-theme="dark"] .zad-listen{--zl-ink:#FFF5DC;--zl-muted:#C1BBA7;--zl-surface:#0A2B26;--zl-line:rgba(228,201,128,.18);--zl-gold:#E4C980;--zl-gold-2:#E4C980}
html[data-theme="dark"] .zad-listen::after{background:radial-gradient(ellipse at 50% -10%,rgba(228,201,128,.08),transparent 70%)}
body.zl-open .audio-panel,body.zl-open .audio-fab{display:none!important}
/* المصحف تحت المشغّل لا يُرى، فلا يُرسم ولا يُعاد تلوينه مع كل تغيير (كالوضع الليلي).
   يُضبط من جديد عند العودة إليه (readerAfterListen في appearance.js). */
body.zl-open #reader{content-visibility:hidden}
.zad-listen button{font-family:inherit;-webkit-tap-highlight-color:transparent}
.zl-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:calc(14px + env(safe-area-inset-top)) 16px 28px}
.zl-scroll>*{max-width:560px;margin-inline:auto}
/* النقش في الخلفية كالرئيسية: ٤٪ نهارًا و٣٪ ليلًا، يجري ببطء. */
.zl-pattern{position:absolute;top:-60px;left:-60px;right:-320px;bottom:-220px;z-index:-1;pointer-events:none;opacity:.04;
  background:url("/icons/zad-rosette.svg") 0 0/496.31px 329.9px repeat;animation:zlFlow 60s linear infinite}
html[data-theme="dark"] .zl-pattern{opacity:.03}
.zad-listen{overflow:hidden}
@keyframes zlFlow{to{transform:translate(-248.16px,-164.95px)}}
.zl-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 4px 14px}
.zl-theme{flex:none;width:44px;height:44px;display:grid;place-items:center;padding:0;border:1px solid var(--zl-line);border-radius:14px;background:var(--zl-surface);color:var(--zl-gold-2);cursor:pointer}
.zl-theme svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.zl-sun{display:none}html[data-theme="dark"] .zl-sun{display:block}html[data-theme="dark"] .zl-moon{display:none}
.zl-head h1{margin:0;font:700 30px/1.7 "Aref Ruqaa",serif;color:var(--zl-ink)}

/* البطاقة: بطاقة الصلاة نفسها، والقوس تقدّم السورة */
.zl-card{position:relative;overflow:hidden;isolation:isolate;border-radius:26px;padding:16px 16px 0;color:#FFF9EA;
  background:radial-gradient(circle at 30% 30%,rgba(228,201,128,.14),transparent 18rem),linear-gradient(145deg,#0D3C35,#082D29);box-shadow:0 18px 40px -22px rgba(6,40,35,.65)}
.zl-card-pattern{position:absolute;top:-60px;left:-60px;right:-320px;bottom:-220px;z-index:-1;opacity:.056;pointer-events:none;
  background:url("/icons/zad-rosette.svg") 0 0/496.31px 329.9px repeat;animation:zlFlow 60s linear infinite;animation-play-state:paused}
/* النقش في البطاقة يجري مع التلاوة ويقف بوقوفها. */
.zl-card.playing .zl-card-pattern{animation-play-state:running}
.zl-eyebrow{display:flex;align-items:center;justify-content:center;gap:7px;min-height:18px;font-size:12px;color:rgba(255,249,234,.74)}
.zl-wave{display:inline-flex;align-items:flex-end;gap:2px;height:12px}
.zl-wave i{display:block;width:2.5px;height:4px;border-radius:2px;background:#E4C980}
.zl-wave.on i{animation:zlWave 1s ease-in-out infinite}
.zl-wave.on i:nth-child(2){animation-delay:-.3s}.zl-wave.on i:nth-child(3){animation-delay:-.6s}.zl-wave.on i:nth-child(4){animation-delay:-.15s}
@keyframes zlWave{0%,100%{height:4px}50%{height:12px}}
.zl-arc{position:relative;width:260px;height:138px;margin:6px auto 0;touch-action:none}
.zl-arc svg{display:block;width:100%;height:100%;overflow:visible}
.zl-arc-track{fill:none;stroke:rgba(255,249,234,.14);stroke-width:6;stroke-linecap:round}
.zl-arc-fill{fill:none;stroke:#E4C980;stroke-width:6;stroke-linecap:round;stroke-dasharray:301.6;stroke-dashoffset:301.6;transition:stroke-dashoffset .3s linear}
.zl-arc-hit{fill:none;stroke:transparent;stroke-width:34;cursor:pointer;pointer-events:stroke}
.zl-arc-knob{pointer-events:none;transition:transform .3s linear}
.zl-arc-knob .halo{fill:#E4C980;opacity:.22;transition:r .15s ease}
.zl-arc-knob .dot{fill:#FFF4CD}
.zl-arc svg.dragging .zl-arc-fill,.zl-arc svg.dragging .zl-arc-knob{transition:none}
.zl-arc svg.dragging .halo{r:17}
.zl-arc-label{position:absolute;inset:38px 8px 0;text-align:center;pointer-events:none}
.zl-name{font:700 34px/1.2 "Aref Ruqaa",serif;color:#E4C980;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.zl-ayah{margin-top:2px;font-size:14px;font-weight:500;font-variant-numeric:tabular-nums}
.zl-time{margin-top:3px;font-size:12px;color:rgba(255,249,234,.66);font-variant-numeric:tabular-nums}
.zl-controls{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;justify-items:center;margin:4px auto 0;max-width:330px}
.zl-ctl{position:relative;width:46px;height:46px;border:0;border-radius:50%;background:transparent;color:#FFF9EA;display:grid;place-items:center;padding:0;cursor:pointer}
.zl-ctl svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.zl-more svg{fill:currentColor;stroke:none}
.zl-ctl:active{background:rgba(255,249,234,.1)}
.zl-ctl.on{color:#E4C980;background:rgba(228,201,128,.14)}
.zl-repeat[data-badge]:not([data-badge=""])::after{content:attr(data-badge);position:absolute;top:5px;left:5px;min-width:14px;height:14px;border-radius:7px;background:#E4C980;color:#082D29;font-size:9px;font-weight:800;line-height:14px;text-align:center}
.zl-main{width:66px;height:66px;border:0;border-radius:50%;display:grid;place-items:center;padding:0;cursor:pointer;color:#19332C;
  background:linear-gradient(135deg,#F1D998,#C59A4A);box-shadow:0 14px 28px -14px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.4)}
.zl-main svg{width:28px;height:28px;fill:currentColor}
.zl-main:active{transform:scale(.96)}
.zl-qari{display:flex;align-items:center;gap:9px;max-width:100%;margin:12px auto 0;min-height:44px;padding:5px 8px 5px 14px;border-radius:999px;cursor:pointer;
  border:1px solid rgba(228,201,128,.24);background:rgba(255,249,234,.06);color:#FFF9EA;font-size:13px;font-weight:600}
.zl-qari-mono{flex:none;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:rgba(228,201,128,.18);color:#E4C980;font:700 17px "Aref Ruqaa",serif}
.zl-qari-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.zl-qari svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;opacity:.7}
.zl-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:14px -16px 0;border-top:1px solid rgba(228,201,128,.16)}
.zl-act{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:66px;padding:8px 4px;border:0;background:transparent;color:rgba(255,249,234,.86);font-size:11px;font-weight:500;cursor:pointer}
.zl-act+.zl-act{border-inline-start:1px solid rgba(228,201,128,.12)}
.zl-act>svg{width:21px;height:21px;fill:none;stroke:#E4C980;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.zl-act:active{background:rgba(255,249,234,.06)}
html body .zad-listen .zl-dl{width:30px;height:24px;border:0;background:transparent;border-radius:8px;color:#E4C980}
html body .zad-listen .zl-dl svg{width:21px;height:21px;stroke-width:1.7}
html body .zad-listen .zl-dl.downloading{font-size:10px;color:#E4C980}

/* الليل: البطاقة عاجية كبطاقة الصلاة */
html[data-theme="dark"] .zl-card{color:#173E35;border:1px solid rgba(228,201,128,.32);background:radial-gradient(circle at 100% 0%,rgba(197,154,74,.18),transparent 28rem),linear-gradient(135deg,#FFFEFA 0%,#F4EDDE 100%);box-shadow:0 22px 50px -26px rgba(0,0,0,.7)}
html[data-theme="dark"] .zl-eyebrow,html[data-theme="dark"] .zl-time{color:#6B6350}
html[data-theme="dark"] .zl-wave i{background:#C59A4A}
html[data-theme="dark"] .zl-arc-track{stroke:rgba(23,62,53,.12)}
html[data-theme="dark"] .zl-arc-fill{stroke:#C59A4A}
html[data-theme="dark"] .zl-arc-knob .halo{fill:#C59A4A}
html[data-theme="dark"] .zl-arc-knob .dot{fill:#96702D}
html[data-theme="dark"] .zl-name{color:#96702D}
html[data-theme="dark"] .zl-ctl{color:#173E35}
html[data-theme="dark"] .zl-ctl:active{background:rgba(23,62,53,.08)}
html[data-theme="dark"] .zl-ctl.on{color:#8E6A28;background:rgba(197,154,74,.16)}
html[data-theme="dark"] .zl-main{background:#0D3C35;color:#E4C980}
html[data-theme="dark"] .zl-qari{border-color:rgba(142,106,40,.28);background:rgba(23,62,53,.04);color:#173E35}
html[data-theme="dark"] .zl-qari-mono{background:#0D3C35;color:#E4C980}
html[data-theme="dark"] .zl-actions{border-top-color:rgba(142,106,40,.2)}
html[data-theme="dark"] .zl-act{color:#173E35}
html[data-theme="dark"] .zl-act+.zl-act{border-color:rgba(142,106,40,.16)}
html[data-theme="dark"] .zl-act>svg,html body[class] .zad-listen .zl-dl{color:#96702D}
html[data-theme="dark"] .zl-act>svg{stroke:#96702D}

/* الشريط الرفيع حين تُمرَّر البطاقة */
.zl-mini{position:absolute;z-index:3;inset:0 0 auto;display:flex;align-items:center;gap:8px;padding:calc(8px + env(safe-area-inset-top)) 14px 8px;
  background:rgba(8,45,41,.96);color:#FFF9EA;box-shadow:0 10px 24px -16px rgba(0,0,0,.6);transform:translateY(-110%);transition:transform .28s cubic-bezier(.3,.9,.3,1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
.zl-mini.show{transform:none}
.zl-mini-open{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:44px;border:0;background:transparent;color:inherit;text-align:right;padding:0;cursor:pointer}
.zl-mini-copy{min-width:0;display:flex;flex-direction:column}
.zl-mini-name{font:700 18px/1.3 "Aref Ruqaa",serif;color:#E4C980;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.zl-mini-ayah{font-size:11px;color:rgba(255,249,234,.72)}
.zl-mini-play{flex:none;width:44px;height:44px;border:0;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#F1D998,#C59A4A);color:#19332C;padding:0;cursor:pointer}
.zl-mini-play svg{width:20px;height:20px;fill:currentColor}
html[data-theme="dark"] .zl-mini{background:rgba(255,251,242,.97);color:#173E35;border-bottom:1px solid rgba(228,201,128,.32)}
html[data-theme="dark"] .zl-mini-name{color:#96702D}
html[data-theme="dark"] .zl-mini-ayah{color:#6B6350}
html[data-theme="dark"] .zl-mini-play{background:#0D3C35;color:#E4C980}
html[data-theme="dark"] .zl-mini .zl-wave i{background:#C59A4A}

/* مختارات */
.zl-picks{margin-top:20px}
.zl-picks h2,.zl-browse h2{margin:0 4px 9px;font-size:13px;font-weight:700;color:var(--zl-muted)}
.zl-chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin-inline:-16px;padding:0 16px 2px}
.zl-chips::-webkit-scrollbar{display:none}
.zl-chip{flex:none;min-height:40px;padding:0 15px;border-radius:999px;border:1px solid var(--zl-line);background:var(--zl-surface);color:var(--zl-ink);font-size:13px;font-weight:600;cursor:pointer}
.zl-chip.gold{border-color:var(--zl-gold-2);background:rgba(197,154,74,.14);color:var(--zl-gold)}
.zl-chip:active{transform:scale(.97)}

/* السور والأجزاء والمنزّلة */
.zl-browse{margin-top:20px}
.zl-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;border-radius:16px;border:1px solid var(--zl-line);background:var(--zl-surface)}
.zl-seg button{min-height:38px;border:0;border-radius:12px;background:transparent;color:var(--zl-muted);font-size:13px;font-weight:600;cursor:pointer}
.zl-seg button.on{background:#0D3C35;color:#FFF9EA}
html[data-theme="dark"] .zl-seg button.on{background:#E4C980;color:#082D29}
.zl-search{display:flex;align-items:center;gap:8px;margin-top:10px;min-height:46px;padding:0 13px;border-radius:14px;border:1px solid var(--zl-line);background:var(--zl-surface)}
.zl-search[hidden]{display:none}
.zl-search svg{flex:none;width:18px;height:18px;fill:none;stroke:var(--zl-muted);stroke-width:1.8;stroke-linecap:round}
.zl-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--zl-ink);font:500 14px Alexandria,system-ui,sans-serif}
.zl-search input::placeholder{color:var(--zl-muted)}
.zl-search input::-webkit-search-cancel-button{display:none}
.zl-list{margin-top:10px;border-radius:22px;border:1px solid var(--zl-line);background:var(--zl-surface);overflow:hidden}
.zl-row{display:grid;grid-template-columns:36px minmax(0,1fr) 40px 40px;align-items:center;gap:10px;min-height:64px;padding:8px 12px;border-bottom:1px solid var(--zl-line)}
.zl-row:last-child{border-bottom:0}
.zl-row[hidden]{display:none}
.zl-num{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;border:1px solid var(--zl-line);color:var(--zl-gold);font-size:12px;font-weight:700;font-variant-numeric:tabular-nums}
.zl-row-main{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0;min-height:48px;justify-content:center;border:0;background:transparent;color:var(--zl-ink);text-align:right;padding:0;cursor:pointer}
.zl-row-main b{font:700 18px/1.35 "Aref Ruqaa",serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.zl-row-main small{font-size:11px;color:var(--zl-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
html body .zad-listen .zl-row-dl{width:40px;height:40px;border-radius:12px;border:1px solid var(--zl-line);background:transparent;color:var(--zl-gold-2)}
html body .zad-listen .zl-row-dl.downloaded{background:rgba(197,154,74,.14);border-color:transparent;color:var(--zl-gold)}
html body .zad-listen .zl-row-dl.downloading{font-size:10px;color:var(--zl-gold)}
.zl-row-share{width:40px;height:40px;border-radius:12px;border:1px solid var(--zl-line);display:grid;place-items:center;background:transparent;color:var(--zl-muted);padding:0;cursor:pointer}
.zl-row-share svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.zl-row-share:active,html body .zad-listen .zl-row-dl:active{transform:scale(.95)}
.zl-row.now{background:rgba(197,154,74,.09)}
.zl-row.now .zl-num{background:#0D3C35;color:#E4C980;border-color:#0D3C35}
html[data-theme="dark"] .zl-row.now .zl-num{background:#E4C980;color:#082D29;border-color:#E4C980}
.zl-empty{display:flex;flex-direction:column;gap:5px;padding:26px 18px;text-align:center;color:var(--zl-muted);font-size:12px;line-height:1.8}
.zl-empty b{font:700 18px "Aref Ruqaa",serif;color:var(--zl-ink)}

/* النوافذ */
.zl-sheet .sheet{font-family:Alexandria,system-ui,sans-serif}
.zl-legend{display:flex;flex-wrap:wrap;gap:14px;margin:12px 2px 10px;font-size:11px;color:var(--ui-muted)}
.zl-legend span{display:inline-flex;align-items:center;gap:6px}
.zl-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#0F5C50;margin-inline-end:5px;vertical-align:middle}
.zl-dot.whole{background:#C59A4A}
html[data-theme="dark"] .zl-dot{background:#49A18C}
html[data-theme="dark"] .zl-dot.whole{background:#E4C980}
.zl-legend .zl-dot{margin:0}
.zl-qlist{display:flex;flex-direction:column;gap:2px;max-height:min(62vh,560px);overflow-y:auto;margin:0 -4px;padding:0 4px}
.zl-qrow{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;padding:8px 10px;border:1px solid transparent;border-radius:16px;background:transparent;color:var(--ui-text);text-align:right;cursor:pointer}
.zl-qrow.on{border-color:#C59A4A;background:rgba(197,154,74,.12)}
.zl-qmono{flex:none;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:rgba(197,154,74,.16);color:#8E6A28;font:700 20px "Aref Ruqaa",serif}
.zl-qrow.on .zl-qmono{background:#0D3C35;color:#E4C980}
html[data-theme="dark"] .zl-qmono{color:#E4C980}
.zl-qcopy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.zl-qcopy b{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.zl-qcopy small{font-size:11px;color:var(--ui-muted)}
.zl-qcheck svg{width:20px;height:20px;fill:none;stroke:#C59A4A;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.zl-more-sheet{display:flex;flex-direction:column;gap:8px}
.zl-more-block{padding:4px 2px 8px}
.zl-more-title{font-size:12px;font-weight:700;color:var(--ui-muted);margin-bottom:8px}
.zl-speeds{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.zl-speeds button{min-height:42px;border-radius:12px;border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-text);font-size:13px;font-weight:700;cursor:pointer}
.zl-speeds button.on{background:#0D3C35;border-color:#0D3C35;color:#E4C980}
html[data-theme="dark"] .zl-speeds button.on{background:#E4C980;border-color:#E4C980;color:#082D29}
.zl-more-row{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:9px 12px;border:1px solid var(--ui-line);border-radius:16px;background:var(--ui-surface-2);color:var(--ui-text);text-align:right;cursor:pointer}
.zl-more-row>svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;opacity:.55;transform:rotate(90deg)}
.zl-more-ico{flex:none;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:rgba(197,154,74,.14);color:#8E6A28}
html[data-theme="dark"] .zl-more-ico{color:#E4C980}
.zl-more-ico svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.zl-more-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.zl-more-copy b{font-size:13px;font-weight:700}
.zl-more-copy small{font-size:11px;color:var(--ui-muted);line-height:1.6}
.zl-switch{flex:none;position:relative;width:44px;height:26px;border-radius:13px;background:var(--ui-surface-3);transition:background .2s ease}
.zl-switch::after{content:"";position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s ease}
[aria-checked="true"]>.zl-switch{background:#0F5C50}
[aria-checked="true"]>.zl-switch::after{transform:translateX(-18px)}
.zl-more-row.danger{color:#B95157}
.zl-more-row.danger .zl-more-ico{background:rgba(185,81,87,.1);color:#B95157}
@media (min-width:860px){
  .zl-scroll{padding-top:calc(28px + env(safe-area-inset-top))}
  .zl-arc{width:300px;height:158px}
  .zl-arc-label{inset:46px 8px 0}
  .zl-name{font-size:40px}
}
@media (prefers-reduced-motion:reduce){.zl-pattern,.zl-card-pattern{animation:none}.zl-wave.on i{animation:none;height:8px}.zl-arc-fill,.zl-arc-knob,.zl-mini{transition:none}}

/* القلب: أعلى البطاقة، في الطرف المقابل لعنوانها */
.zl-heart{position:absolute;top:10px;left:10px;z-index:2;width:44px;height:44px;border:0;border-radius:50%;display:grid;place-items:center;padding:0;background:transparent;color:rgba(255,249,234,.7);cursor:pointer}
.zl-heart svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;transition:transform .2s ease}
.zl-heart.on{color:#E4C980}
.zl-heart.on svg{fill:currentColor}
.zl-heart:active svg{transform:scale(.85)}
html[data-theme="dark"] .zl-heart{color:#6B6350}
html[data-theme="dark"] .zl-heart.on{color:#B5873A}
/* شريط تقدّم المشغّل الرفيع */
.zl-mini-bar{position:absolute;inset:auto 0 0;height:3px;background:rgba(228,201,128,.18);overflow:hidden}
.zl-mini-bar i{display:block;height:100%;background:#E4C980;transform-origin:right center;transform:scaleX(0);transition:transform .3s linear}
html[data-theme="dark"] .zl-mini-bar{background:rgba(142,106,40,.16)}
html[data-theme="dark"] .zl-mini-bar i{background:#C59A4A}
/* الأسماء في سطر واحد تُقصّ عند الحاجة؛ لكن نقاط الياء تحت السطر لا تُقصّ معها. */
.zl-qari-name,.zl-qcopy b,.zl-row-main b,.zl-row-main small,.zl-mini-name,.zl-name{padding-block:.12em .32em;margin-block:-.12em -.32em}
/* اسم السورة في البطاقة كبير، وذيول حروف الرقعة (ج، ع، ح) تنزل حتى سطر الآية تحته؛
   فيُترك لها نصف تلك المسافة بدل أن يرتفع السطر التالي فوقها. */
.zl-arc-label .zl-name{margin-bottom:-.14em}

/* ═══════════ رأس الصفحات الموحّد: «القرآن العظيم» و«مشغّل التلاوة» ═══════════
   القاعدة نفسها في الرئيسية والمواقيت والختمات: العنوان بخط الرقعة ‎28px‎ يمينًا،
   وأزرار الصفحة ‎44px‎ بزاوية ‎14px‎ يسارًا، على أرضية الصفحة دون شريط مستقل.
   عدد الأزرار يتبع حاجة كل صفحة؛ الشكل والموضع هما الموحّدان. */
.quran-index{--hd-ink:#173E35;--hd-gold:#8E6A28;--hd-surface:#FFFBF2;--hd-line:rgba(169,131,58,.26)}
html[data-theme="dark"] .quran-index{--hd-ink:#FFF5DC;--hd-gold:#E4C980;--hd-surface:#0A2B26;--hd-line:rgba(228,201,128,.18)}
html .quran-index .quran-index-head{min-height:48px;gap:12px;padding:calc(18px + env(safe-area-inset-top)) 18px 12px;background:transparent;border-bottom:0;box-shadow:none}
html .quran-index .quran-index-title{font-family:"Aref Ruqaa",serif;font-weight:700;font-size:28px;line-height:1.3;color:var(--hd-ink)}
html .quran-index .quran-index-head-actions{gap:8px}
html .quran-index .quran-index-head-action{width:44px;height:44px;border-radius:14px;background:var(--hd-surface);border-color:var(--hd-line);color:var(--hd-gold)!important}
html .quran-index .quran-index-head-action svg{width:20px;height:20px}
@media(max-width:340px){
  html .quran-index .quran-index-head{padding-inline:14px}
  html .quran-index .quran-index-head-actions{gap:6px}
  html .quran-index .quran-index-head-action{width:40px;height:40px}
}
.zl-head{min-height:48px;padding:4px 2px 12px}
.zl-head h1{font:700 28px/1.3 "Aref Ruqaa",serif}

/* ═══════════ عناوين الأعمدة في فهرسي السور والأجزاء ═══════════
   شريط ثابت أعلى القائمة لا يتحرك معها: «السورة · الصفحة · تشغيل · مشاركة · تنزيل»،
   و«الجزء · تشغيل · مشاركة». صفّه يأخذ أعمدة الصفوف نفسها (متغيرات ‎--ix-*‎). */
.quran-index-pane{display:flex;flex-direction:column}
.quran-index-pane>.quran-index-scroll{flex:1 1 auto;height:auto;min-height:0}
html body .quran-index .quran-index-colhead{flex:none;min-height:0;padding-top:7px;padding-bottom:7px;
  border-bottom:1px solid var(--hd-line);background:transparent;cursor:default;
  font-family:Alexandria,system-ui,sans-serif;font-size:11px;font-weight:600;line-height:1.4;color:var(--hd-gold)}
html body .quran-index .quran-index-colhead .quran-index-row-main{padding:0}
html body .quran-index .quran-index-colhead .quran-index-main,
html body .quran-index .quran-index-colhead .quran-index-page,
html body .quran-index .quran-index-colhead .juz-accordion-title{font:inherit;color:inherit}
html body .quran-index .quran-index-colhead .quran-index-page{text-align:center}
html body .quran-index .quran-index-colhead .quran-index-action{height:auto;border:0;border-radius:0;background:none;color:inherit;white-space:nowrap}
html body .quran-index .quran-index-colhead .juz-accordion-head-main{padding-block:0}
/* صف الجزء بلا عمود صفحات: النطاق مكتوب تحت اسم الجزء («الصفحات ١–٢١»). */
.juz-accordion-head-main{grid-template-columns:minmax(0,1fr) 22px}

/* ═══════════ «ما تيسّر» ═══════════
   زر رابع في صف أدوات البطاقة، يتلوّن بالذهبي حين يكون الوضع مفعّلًا؛ ووسم صغير
   أعلى البطاقة، وسطر «التالي» فوق أزرار التحكم. */
.zl-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
.zl-act.zl-tayassur.on{color:#E4C980;background:rgba(228,201,128,.12)}
html[data-theme="dark"] .zl-act.zl-tayassur.on{color:#8E6A28;background:rgba(197,154,74,.16)}
.zl-tag{display:inline-flex;align-items:center;padding:1px 10px;border:1px solid currentColor;border-radius:999px;font-weight:600;color:#E4C980}
html[data-theme="dark"] .zl-tag{color:#8E6A28}
.zl-upnext{margin:6px 8px 0;text-align:center;font-size:12px;color:rgba(255,249,234,.74);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.zl-upnext[hidden]{display:none}
html[data-theme="dark"] .zl-upnext{color:#6B6350}
.zl-qrow:disabled{opacity:.45;cursor:default}
/* التنزيل معطّل في «ما تيسّر»؛ setAudioDownloadButton قد يعيد تفعيل الزر نفسه، فاللمس يُمنع من الحاوية. */
.zl-act-dl.off{opacity:.4;pointer-events:none}

/* ---------- الروايات: زر رأس الصفحة، ونافذة الاختيار، وأسطر DigitalKhatt ---------- */
/* رأس الصفحة: السورة والرواية والجزء بخط واحد وحجم واحد، والرواية في المنتصف تمامًا مهما اختلف
   طول اسم السورة عن الجزء. الحجم أصغر قليلًا من سطر المصحف ليبقى عنوانًا لا ينافس النص. */
.page-meta:has(.riwaya-btn){display:grid;grid-template-columns:1fr auto 1fr;align-items:start}
.page-meta:has(.riwaya-btn)>.page-meta-link:first-child{justify-self:start}
.page-meta:has(.riwaya-btn)>.page-meta-link:last-of-type{justify-self:end}
.page-stage{--page-label-size:clamp(17px,5.1vw,21px)}
@media (min-width:600px) and (min-height:600px) and (hover:none) and (pointer:coarse){.page-stage{--page-label-size:24px}}
.riwaya-btn{border:0;background:transparent;display:inline-flex;align-items:center;gap:4px;padding:0 6px;border-radius:999px;font:inherit;line-height:inherit;color:var(--gold,#8E6A28);cursor:pointer;white-space:nowrap}
.riwaya-btn svg{width:.5em;height:.5em;opacity:.8}
.riwaya-btn:active{background:var(--gold-soft,#F4E8CA)}
.riwaya-scrim{position:fixed;inset:0;z-index:146;background:rgba(8,45,41,.42)}
.riwaya-sheet{position:fixed;left:0;right:0;bottom:0;z-index:147;margin-inline:auto;max-width:640px;max-height:88vh;overflow-y:auto;background:var(--paper,#F5F0E4);color:var(--chrome-text,#18362F);border-radius:24px 24px 0 0;padding:10px 18px calc(18px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:9px;font-family:Alexandria,system-ui,sans-serif;direction:rtl}
.rs-grip{width:40px;height:4px;border-radius:4px;background:#D4C9AF;align-self:center}
.rs-head{display:flex;align-items:baseline;justify-content:space-between}.rs-head h2{margin:0;font:400 24px/1.3 "Aref Ruqaa",serif}.rs-head span{font-size:11.5px;opacity:.7}
.rs-row{display:flex;align-items:center;gap:8px}
.rs-imam{width:84px;flex:none;font:400 17px/1.2 "Aref Ruqaa",serif;color:var(--hd-gold,#8E6A28)}
.rs-r{flex:1;min-height:44px;border:1px solid var(--border,#DED3BD);border-radius:14px;background:var(--chrome,#FFFCF4);color:inherit;font:inherit;font-size:13.5px}
.rs-r.on{background:var(--brand,#0F5C50);border-color:var(--brand,#0F5C50);color:#FFF9EA;font-weight:600}
.rs-legend{display:flex;flex-wrap:wrap;gap:6px 12px;padding-top:6px;border-top:1px solid var(--border,#DED3BD);font-size:11px;opacity:.85}
.rs-legend span,.rs-legend button{display:inline-flex;align-items:center;gap:5px}.rs-legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.rs-legend button{font:inherit;color:inherit;background:none;border:0;padding:3px 2px;cursor:pointer;border-bottom:1px dotted currentColor;border-radius:0}
.rs-legend button.on{font-weight:700;border-bottom-style:solid}
.rs-term{margin-top:8px;padding:10px 12px;border-radius:10px;background:var(--ui-surface-2,rgba(0,0,0,.04));font-size:13px;line-height:1.8}
.rs-term b{display:block;margin-bottom:4px;color:var(--ui-accent,#0F5C46)}
.rs-term p{margin:0}
.rs-term blockquote{margin:0 0 4px;font-family:var(--font-quran-text,inherit)}
.rs-term a{display:block;margin-bottom:8px;font-size:11.5px;color:var(--ui-muted,#6b6b6b)}
.line-inner.dk{display:inline-flex}
.dk-line{display:block;height:1.33em;width:auto;overflow:visible;fill:var(--quran,#0B1611)}
.dk-end{fill:var(--ayah-number,#634314)}.dk-end.ghost{opacity:.28}
/* ألوان الخلاف: مشبعة ومتباعدة، والحرف الملوّن أثقل قليلًا ليُرى المختلف بمسح سريع.
   تظليل الحافظ مختلف عنها تمامًا (ألوان فاتحة مستطيلة خلف الكلمة)، فلا يلتبسان. */
.dk-line{--c1:#6D28D9;--c2:#C026D3;--c3:#1D63ED;--c4:#0E9F8E;--c5:#E86A00;--c6:#15A34A;--c7:#8B5E34;--c8:#D1203A;--snd:#B8913F;--waqf:#3F6E8C;--ayah-plus:#C2185B}
html[data-theme="dark"] .dk-line{--c1:#B794F4;--c2:#F08AE6;--c3:#7FA8FF;--c4:#4FD1C5;--c5:#FFA05C;--c6:#5EDB8A;--c7:#D9A574;--c8:#FF7A8A;--snd:#D9B86A;--waqf:#8FB8D6;--ayah-plus:#F48FB1}
.dk-c1{fill:var(--c1);stroke:var(--c1)}.dk-c2{fill:var(--c2);stroke:var(--c2)}.dk-c3{fill:var(--c3);stroke:var(--c3)}.dk-c4{fill:var(--c4);stroke:var(--c4)}
.dk-c5{fill:var(--c5);stroke:var(--c5)}.dk-c6{fill:var(--c6);stroke:var(--c6)}.dk-c7{fill:var(--c7);stroke:var(--c7)}.dk-c8{fill:var(--c8);stroke:var(--c8)}
.dk-line use[class^="dk-c"]{stroke-width:22;stroke-linejoin:round}
/* خط DigitalKhatt أنحف من QCF: حدّ بلون الحبر نفسه يغمّقه (اختيار أيمن من أربع عيّنات) */
.dk-line use:not([class^="dk-c"]){stroke:var(--quran,#0B1611);stroke-width:22;stroke-linejoin:round}
.dk-amp{fill:var(--ayah-plus)}
.dk-hit{fill:transparent}
.dk-line g[data-ayah].selected .dk-hit{fill:var(--select)}
/* «ألوان وتظليل»: خلفية بلون الخلاف نفسه */
.dk-hl{opacity:0}
html[data-qshade="on"] .dk-hl{opacity:.16}
html[data-theme="dark"][data-qshade="on"] .dk-hl{opacity:.24}
.dk-b1{fill:var(--c1)}.dk-b2{fill:var(--c2)}.dk-b3{fill:var(--c3)}.dk-b4{fill:var(--c4)}.dk-b5{fill:var(--c5)}.dk-b6{fill:var(--c6)}.dk-b7{fill:var(--c7)}.dk-b8{fill:var(--c8)}.dk-bap{fill:var(--ayah-plus)}
.dk-snd{stroke:var(--snd);stroke-width:46;stroke-dasharray:60 70;stroke-linecap:round;fill:none}
.dk-wq{stroke:var(--waqf);stroke-width:72;stroke-dasharray:1 105;stroke-linecap:round;fill:none}
.rs-seg{display:flex;gap:4px;padding:3px;border-radius:999px;background:var(--chrome,#FFFCF4);border:1px solid var(--border,#DED3BD)}
.rs-seg button{flex:1;min-height:36px;border:0;border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:13px}
.rs-seg button.on{background:var(--brand,#0F5C50);color:#FFF9EA;font-weight:600}
.rs-legend i.u{background:none;height:0;border-bottom:3px dashed #B8913F;border-radius:0}
.rs-legend i.wu{background:none;height:0;border-bottom:4px dotted #3F6E8C;border-radius:0}
.rs-legend i.ap{background:#C2185B;border-radius:50%}
.rs-legend i.ag{background:transparent;border:1.5px solid var(--ayah-number,#634314);opacity:.45;border-radius:50%}

/* التجويد لحفص وحده */
html[data-riwaya]:not([data-riwaya="hafs"]) #tajweedBtn{opacity:.38}
html[data-riwaya]:not([data-riwaya="hafs"]) #tajweedStrip{display:none!important}

/* قارئ الرواية وحده: لا اختيار للقارئ ولا تنزيل في غير حفص */
html.riwaya-audio #panelQariBtn,html.riwaya-audio #panelQari{pointer-events:none}

/* القائمة العائمة بسطرين: الآية، ثم الكلمة التي تحت الإصبع */
.ayah-menu.word.show{flex-direction:column}
.ayah-menu .menu-row{display:flex;justify-content:center}
.ayah-menu .word-row{border-top:1px solid var(--reader-line,rgba(228,201,128,.28));margin-top:3px;padding-top:3px}
.ayah-menu .hz-pick.on{background:var(--reader-selected,rgba(255,255,255,.12))}
.hz-sw{display:block;width:22px;height:22px;border-radius:6px;border:1px solid rgba(0,0,0,.12)}

/* تظليل الحافظ: ألوان فاتحة كقلم التظليل، مستطيلة على النصف السفلي من الكلمة، والحبر كما هو.
   مختلفة تمامًا عن ألوان القراءات (مشبعة، تلوّن الحرف، وتظليلها مستدير بلون الخلاف). */
:root{--hz1:#FBE27A;--hz2:#BFE8A6;--hz3:#B9DCF7;--hz4:#F7C6DA}
html[data-theme="dark"]{--hz1:rgba(251,226,122,.38);--hz2:rgba(191,232,166,.32);--hz3:rgba(185,220,247,.32);--hz4:rgba(247,198,218,.32)}
.hz-sw.hz-c1{background:var(--hz1)}.hz-sw.hz-c2{background:var(--hz2)}.hz-sw.hz-c3{background:var(--hz3)}.hz-sw.hz-c4{background:var(--hz4)}
.word.hz-c1{background:linear-gradient(transparent 30%,var(--hz1) 30%,var(--hz1) 92%,transparent 92%)}
.word.hz-c2{background:linear-gradient(transparent 30%,var(--hz2) 30%,var(--hz2) 92%,transparent 92%)}
.word.hz-c3{background:linear-gradient(transparent 30%,var(--hz3) 30%,var(--hz3) 92%,transparent 92%)}
.word.hz-c4{background:linear-gradient(transparent 30%,var(--hz4) 30%,var(--hz4) 92%,transparent 92%)}
.dk-line g.hz-c1 .dk-hit{fill:var(--hz1)}.dk-line g.hz-c2 .dk-hit{fill:var(--hz2)}.dk-line g.hz-c3 .dk-hit{fill:var(--hz3)}.dk-line g.hz-c4 .dk-hit{fill:var(--hz4)}
/* الكلمة التي عليها تعليق: نقطة ذهبية صغيرة فوقها */
.word.hz-note::after{content:"";position:absolute;top:.02em;inset-inline-start:50%;width:.16em;height:.16em;border-radius:50%;background:var(--ui-gold,#C59A4A);transform:translateX(50%)}
.dk-line g.hz-note .dk-hit{stroke:var(--ui-gold,#C59A4A);stroke-width:26;stroke-dasharray:4 70;stroke-linecap:round}
.hz-note-view{display:flex;flex-direction:column;gap:8px;padding-top:6px}
.hz-note-head{text-align:center;padding-bottom:4px;border-bottom:1px solid var(--ui-line)}
.hz-note-word{font:400 34px/1.5 Amiri,serif;color:var(--ui-accent)}
.hz-note-head .ref{margin:0 0 8px}
.hz-label{font:400 18px/1.3 "Aref Ruqaa",serif;color:var(--ui-gold);margin-top:6px}
.hz-swatches{display:flex;gap:6px}
.hz-swatch{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;min-height:58px;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-surface-2);color:var(--ui-text);font:500 11px Alexandria,system-ui,sans-serif;padding:8px 2px}
.hz-swatch .hz-sw{width:26px;height:16px;border-radius:5px}
.hz-swatch.on{border-color:var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent);font-weight:700}
.hz-sw.hz-none{background:repeating-linear-gradient(135deg,transparent 0 4px,var(--ui-line) 4px 5px);border:1px solid var(--ui-line)}
.hz-note-text{width:100%;box-sizing:border-box;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-surface-2);color:var(--ui-text);padding:10px 12px;font:15px/1.9 Alexandria,system-ui,sans-serif;resize:vertical;min-height:140px}
.hz-note-text:focus{outline:2px solid color-mix(in srgb,var(--ui-accent) 40%,transparent);outline-offset:1px}
.hz-note-meta{display:flex;justify-content:space-between;font-size:11px;color:var(--ui-muted)}
.hz-note-actions{display:flex;gap:8px;margin-top:4px}
.hz-note-actions button{min-height:44px;border-radius:999px;padding:0 20px;font:600 12.5px Alexandria,system-ui,sans-serif;border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-text)}
.hz-note-actions .hz-note-save{flex:1;background:var(--ui-accent);border-color:var(--ui-accent);color:#FFF9EA}
.hz-note-actions .hz-note-del{background:transparent;border-color:transparent;color:#B3261E}
html[data-theme="dark"] .hz-note-actions .hz-note-del{color:#F2A49E}
.hz-note-hint{font-size:11px;color:var(--ui-muted);text-align:center}
.hz-row .quran-bookmark-open b{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hz-row .hz-sw{width:14px;height:14px;border-radius:4px;flex:none}
.hz-row-word{font:400 20px/1.4 Amiri,serif}
.hz-row-ref{font-weight:400;font-size:11px;opacity:.75}

/* لا تحديد نص ولا قائمة نظام في المصحف: الضغط المطوّل على فراغ أو عنوان لا يستدعي «البحث بالنقر» من Google. */
#reader,#reader .page,#reader .page *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* الكلمة المحددة بالضغط المطوّل */
/* الكلمة المضغوطة مطوّلًا: حبرها بذهبي زاد الخير كما يُلوَّن لفظ الجلالة.
   خط QCF ملوّن فلا يتبع color، ولا override-colors (يُسقط Chromium): تُرسم الكلمة نفسها مرة ثانية
   فوقها (data-ink)، ومرشّح SVG يملأ شكل حروفها بالذهبي (#zk-gold في reading-tools.js). فيُلوَّن
   الحبر كله، بما خرج منه عن صندوق الكلمة من حركات وأطراف، ولا يمس ما حوله.
   وفي DigitalKhatt الحروف غير الملوّنة بالخلاف تصير ذهبية، ويبقى لون الخلاف ظاهرًا. */
.word.word-picked[data-ink]::before{content:attr(data-ink);position:absolute;inset:0;white-space:nowrap;pointer-events:none;filter:url(#zk-gold)}
html[data-theme="dark"] .word.word-picked[data-ink]::before{filter:url(#zk-gold-d)}
.dk-line g[data-gi].word-picked use:not([class^="dk-c"]){fill:var(--gold)}
html[data-theme="dark"] .dk-line g[data-gi].word-picked use:not([class^="dk-c"]){fill:var(--gold-hi)}

/* البحث: النص أو الجذر، وآخر ما بُحث عنه، و«انتقل إلى» */
.qs-modes{display:flex;gap:3px;padding:3px;border-radius:14px;background:var(--ui-surface-2);border:1px solid var(--ui-line)}
.qs-mode{flex:1;min-height:38px;border:0;border-radius:11px;background:transparent;color:var(--ui-muted);font:500 13px Alexandria,system-ui,sans-serif}
.qs-mode.on{background:var(--ui-surface);color:var(--ui-accent);font-weight:700;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.qs-recent{display:flex;flex-wrap:wrap;gap:6px}
.qs-chip{display:inline-flex;align-items:center;gap:6px;min-height:34px;border:1px solid var(--ui-line);border-radius:999px;background:var(--ui-surface-2);color:var(--ui-accent);padding:0 12px;font:500 13px Alexandria,system-ui,sans-serif}
.qs-chip small{font-size:10px;color:var(--ui-muted)}
.qs-jump{display:grid;gap:8px;border-top:1px solid var(--ui-line);padding-top:12px}
.qs-jump-h{font:400 18px/1.3 "Aref Ruqaa",serif;color:var(--ui-gold)}
.qs-jump-row{display:flex;gap:8px}
.qs-jump-row select,.qs-jump-row input{flex:1;min-width:0;height:44px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface-2);color:var(--ui-text);padding:0 10px;font:500 13px Alexandria,system-ui,sans-serif}
.qs-go{flex:none;min-height:44px;border:0;border-radius:12px;background:var(--ui-accent);color:#FFF9EA;padding:0 16px;font:600 12.5px Alexandria,system-ui,sans-serif}

/* دون اتصال: ما لم يُنزَّل باهت، والضغط عليه يشرح ما يفعله المستخدم (offline-packs.mjs) */
.ayah-menu.op-off [data-word]:not([data-word="highlight"]):not([data-word="note"]),.ayah-menu.op-off [data-act="tafsir"]{opacity:.38}
.rs-r.off{opacity:.38}
/* صفحة «التنزيل للقراءة دون اتصال» */
.op-page{display:flex;flex-direction:column;gap:10px;padding-top:8px}
.op-intro{font-size:13px;line-height:1.9;color:var(--ui-muted)}
.op-body{display:flex;flex-direction:column;gap:8px}
.op-loading{color:var(--ui-muted);font-size:13px;text-align:center;padding:16px 0}
.op-h{font:400 18px/1.3 "Aref Ruqaa",serif;color:var(--ui-gold);margin-top:6px}
.op-pack{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--ui-line);background:var(--ui-surface-2);border-radius:16px;padding:12px}
.op-pack.done{border-color:color-mix(in srgb,var(--ui-accent) 35%,var(--ui-line))}
.op-check{position:relative;flex:none;width:24px;height:24px;margin-top:2px}
.op-check input{position:absolute;inset:0;opacity:0;margin:0}
.op-check span{position:absolute;inset:0;border:1.5px solid var(--ui-line);border-radius:7px;background:var(--ui-surface)}
.op-check input:checked+span{background:var(--ui-accent);border-color:var(--ui-accent)}
.op-check input:checked+span::after{content:"";position:absolute;left:7px;top:3px;width:6px;height:12px;border:solid #FFF9EA;border-width:0 2px 2px 0;transform:rotate(45deg)}
.op-check input:disabled+span{opacity:.55}
.op-info{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.op-info b{font:600 14px Alexandria,system-ui,sans-serif;color:var(--ui-text)}.op-info b small{font-size:10.5px;font-weight:500;color:var(--ui-gold);border:1px solid var(--ui-gold);border-radius:8px;padding:0 6px;margin-inline-start:4px}
.op-info>small{font-size:12px;line-height:1.7;color:var(--ui-muted)}
.op-meta{display:flex;align-items:center;gap:10px;font-size:11.5px;margin-top:2px}
.op-size{font-weight:700;color:var(--ui-text)}
.op-state{color:var(--ui-muted)}.op-state.s-ready{color:var(--ui-accent);font-weight:600}.op-state.s-update,.op-state.s-partial{color:var(--ui-gold)}
.op-del{margin-inline-start:auto;border:0;background:transparent;color:#B3261E;font:600 11.5px Alexandria,system-ui,sans-serif;padding:4px 6px}
html[data-theme="dark"] .op-del{color:#F2A49E}
.op-progress{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--ui-muted);margin-top:4px}
.op-bar{height:8px;border-radius:99px;background:var(--ui-surface-3);overflow:hidden}.op-bar i{display:block;height:100%;background:var(--ui-accent);border-radius:99px;transition:width .25s ease}
.op-primary{min-height:48px;border:0;border-radius:999px;background:var(--ui-accent);color:#FFF9EA;font:600 13.5px Alexandria,system-ui,sans-serif;margin-top:6px}
.op-primary:disabled{opacity:.55}
.op-note{font-size:11.5px;line-height:1.8;color:var(--ui-muted);text-align:center}
.op-explain{display:flex;flex-direction:column;gap:8px;padding-top:8px}.op-explain p{margin:0;font-size:14px;line-height:1.9;color:var(--ui-text)}
.op-notice{position:fixed;left:12px;right:12px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:120;margin-inline:auto;max-width:560px;display:flex;align-items:center;gap:8px;background:var(--ui-surface,#FFFCF4);color:var(--ui-text,#18362F);border:1px solid var(--ui-line,#DED3BD);border-radius:16px;padding:10px 12px;box-shadow:0 8px 24px rgba(0,0,0,.14);font:500 12.5px/1.7 Alexandria,system-ui,sans-serif;direction:rtl}
.op-notice span{flex:1}
.op-notice-go{flex:none;min-height:36px;border:0;border-radius:999px;background:var(--ui-accent,#0F5C50);color:#FFF9EA;padding:0 14px;font:600 12px Alexandria,system-ui,sans-serif}
.op-notice-x{flex:none;width:32px;height:32px;border:0;background:transparent;color:var(--ui-muted,#6B7B74);font-size:20px}
.op-actions{display:flex;gap:8px;margin-top:6px}
.op-actions button{flex:1;min-height:46px;border-radius:999px;font:600 13px Alexandria,system-ui,sans-serif;border:1px solid var(--ui-line);background:var(--ui-surface-2);color:var(--ui-text)}
.op-actions .op-danger{background:#B3261E;border-color:#B3261E;color:#fff}
.op-size em{font-style:normal;font-weight:500;color:var(--ui-muted)}
.op-sizes{display:flex;flex-direction:column;gap:1px;font-size:12px;line-height:1.7;color:var(--ui-text)}
.op-sizes span:last-child{color:var(--ui-muted)}

/* تصفّح الصفحات */
.ps-scrim{position:fixed;inset:0;z-index:125;background:transparent}
.ps-sheet{position:fixed;z-index:126;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));max-width:620px;margin:0 auto;padding:14px 12px 12px;border-radius:22px;background:var(--ui-surface,#F7F1E4);color:var(--ui-text,#1d1d1d);border:1px solid var(--ui-line,rgba(0,0,0,.08));box-shadow:0 10px 40px rgba(0,0,0,.18);animation:ps-in .22s ease}
@keyframes ps-in{from{transform:translateY(16px);opacity:0}}
.ps-x{position:absolute;top:-14px;left:-6px;width:38px;height:38px;border-radius:50%;border:1.5px solid var(--green);background:var(--ui-surface,#F7F1E4);color:var(--green);display:grid;place-items:center;cursor:pointer}
.ps-x svg{width:18px;height:18px;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round}
.ps-title{text-align:center;font-family:"Aref Ruqaa",serif;font-size:22px;color:var(--green);min-height:30px}
.ps-row{display:flex;align-items:center;gap:4px}
.ps-juz{flex:none;width:34px;display:flex;flex-direction:column;align-items:center;gap:2px;background:none;border:0;color:var(--green);font:inherit;cursor:pointer;padding:4px 0}
.ps-juz svg{width:20px;height:20px;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round}
.ps-juz b{font-family:"Aref Ruqaa",serif;font-size:18px;line-height:1}
.ps-juz[hidden]{visibility:hidden;display:flex}
.ps-track{flex:1;display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding:6px calc(50% - 30px) 4px;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent)}
.ps-track::-webkit-scrollbar{display:none}
.ps-card{flex:none;width:60px;scroll-snap-align:center;display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:0;padding:0;font:inherit;color:var(--ui-muted,#888);cursor:pointer}
.ps-card i{display:block;width:56px;height:76px;border-radius:8px;border:1.5px solid var(--ui-line,rgba(0,0,0,.14));background:repeating-linear-gradient(180deg,transparent 0 11px,color-mix(in srgb,currentColor 28%,transparent) 11px 12.5px) center/70% 64% no-repeat,var(--ui-surface-2,rgba(255,255,255,.6));transition:transform .15s ease,border-color .15s ease}
.ps-card span{font-size:13px}
.ps-card.on{color:var(--green)}
.ps-card.on i{border-color:var(--green);border-width:2.5px;transform:scale(1.08)}
.ps-card.on span{font-weight:700}
.ps-slide{display:flex;align-items:center;gap:10px;padding:10px 6px 2px;font-size:13px;color:var(--ui-muted,#888)}
.ps-slide input{flex:1;accent-color:var(--green);height:28px}
.qs-page{padding:4px 2px 0}
.qs-page-label{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:13px}
.qs-page-label b{color:var(--green);font-size:15px}
.qs-page-label span{color:var(--ui-muted,#777)}
.qs-page input{width:100%;accent-color:var(--green);height:30px;margin:4px 0 0}
.qs-page-ends{display:flex;justify-content:space-between;font-size:11.5px;color:var(--ui-muted,#888)}

/* النوافذ السفلية فوق لوحة المفاتيح (--kb من reading-tools.mjs) */
.backdrop{padding-bottom:var(--kb,0px);transition:padding-bottom .18s ease}
.backdrop .sheet{max-height:min(79vh,calc(100dvh - var(--kb,0px) - 12px))}
.riwaya-sheet{bottom:var(--kb,0px);max-height:min(88vh,calc(100dvh - var(--kb,0px) - 12px))}
