/* ==============================================================
   QURAN READER  (qrd-)  — Views/Quran/Reader.cshtml
   The first part is the design's own stylesheet (quran-reader.html);
   the verse-by-verse additions for the database-driven reader follow.
   ============================================================== */
.qrd-page { background:#f6f8f7; }
body.dark.qrd-page { background:#0f1512; }

/* ---- Hero ---- */
.qrd-hero{
  position:relative;
  background:linear-gradient(135deg,var(--ip-area-deep) 0%,var(--ip-area-fill) 55%,var(--ip-area-fill) 100%);
  color:#fff; padding:2.5rem 0 2rem; overflow:hidden;
}
.qrd-hero::before{
  content:''; position:absolute; inset:0;
  background-image:radial-gradient(circle at 85% 15%,rgba(255,255,255,.08) 0,transparent 45%),
                   radial-gradient(circle at 10% 90%,rgba(230,184,92,.12) 0,transparent 45%);
  pointer-events:none;
}
.qrd-hero-inner{ position:relative; z-index:1; }
.qrd-hero h1{ font-size:2rem; font-weight:700; margin-bottom:.35rem; }
.qrd-hero p{ color:rgba(255,255,255,.85); max-width:620px; margin:0 auto; }
.qrd-hero-icon{
  width:60px;height:60px;border-radius:18px;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.14);backdrop-filter:blur(8px);font-size:1.7rem;margin-bottom:.8rem;
}

/* ---- Toolbar ---- */
.qrd-toolbar{
  position:sticky; top:0; z-index:200;
  background:rgba(255,255,255,.97); backdrop-filter:blur(14px);
  border-bottom:1px solid #e5e7eb; box-shadow:0 2px 16px rgba(0,0,0,.05);
  padding:.7rem 0;
}
body.dark .qrd-toolbar{ background:rgba(20,28,24,.97); border-bottom-color:#243029; }
.qrd-toolbar-row{ display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }
.qrd-tb-group{ display:flex; flex-direction:column; gap:2px; }
.qrd-tb-label{ font-size:.66rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ip-muted); padding-inline-start:2px; }
body.dark .qrd-tb-label{ color:var(--ip-muted); }
.qrd-select{
  border:1.5px solid #e1e5e9; border-radius:10px; padding:.45rem .7rem; font-size:.85rem; font-weight:600;
  background:#fff; color:#1f2937; cursor:pointer; min-width:140px; transition:border-color .15s,box-shadow .15s;
}
.qrd-select:focus{ outline:none; border-color:var(--ip-area-fill); box-shadow:0 0 0 3px color-mix(in srgb, var(--ip-area-fill) 15%, transparent); }
body.dark .qrd-select{ background:#16201b; border-color:#2b3833; color:#e7ece9; }

/* page nav */
.qrd-page-nav{ display:flex; align-items:center; gap:.4rem; }
.qrd-nav-btn{
  width:40px;height:40px;border-radius:10px;border:1.5px solid #e1e5e9;background:#fff;color:var(--ip-area-strong);
  display:inline-flex;align-items:center;justify-content:center;font-size:1.1rem;cursor:pointer;transition:.15s;
}
.qrd-nav-btn:hover{ background:var(--ip-area-fill); color:#fff; border-color:var(--ip-area-fill); }
.qrd-nav-btn:disabled{ opacity:.4; cursor:not-allowed; }
body.dark .qrd-nav-btn{ background:#16201b; border-color:#2b3833; }
.qrd-page-input{
  width:62px;text-align:center;border:1.5px solid #e1e5e9;border-radius:10px;padding:.45rem .3rem;
  font-weight:700;font-size:.9rem;background:#fff;color:#1f2937;
}
.qrd-page-input:focus{ outline:none;border-color:var(--ip-area-fill);box-shadow:0 0 0 3px color-mix(in srgb, var(--ip-area-fill) 15%, transparent); }
body.dark .qrd-page-input{ background:#16201b;border-color:#2b3833;color:#e7ece9; }
.qrd-page-total{ font-size:.8rem; font-weight:600; color:var(--ip-muted); }
body.dark .qrd-page-total{ color:var(--ip-muted); }

.qrd-tb-actions{ display:flex; gap:.4rem; align-items:center; margin-inline-start:auto; }
.qrd-icon-btn{
  height:40px; padding:0 .85rem; border-radius:10px; border:1.5px solid #e1e5e9; background:#fff;
  color:#374151; font-size:.82rem; font-weight:600; display:inline-flex; align-items:center; gap:.35rem; cursor:pointer; transition:.15s;
}
.qrd-icon-btn:hover{ border-color:var(--ip-area-fill); color:var(--ip-area-strong); }
.qrd-icon-btn.qrd-accent{ background:var(--ip-area-fill); color:#fff; border-color:var(--ip-area-fill); }
.qrd-icon-btn.qrd-accent:hover{ background:var(--ip-area-fill); color:#fff; }
body.dark .qrd-icon-btn{ background:#16201b; border-color:#2b3833; color:#d7ddda; }

/* ---- Layout: options sidebar + reading area ---- */
.qrd-layout{
  display:flex; align-items:flex-start; gap:1.6rem;
  max-width:1300px; margin:0 auto; padding:1.6rem 1rem 7rem;
}
.qrd-main{ flex:1; min-width:0; }

.qrd-sidebar{
  position:sticky; top:108px; flex:0 0 288px; width:288px;
  background:#fff; border:1px solid #e7eae8; border-radius:20px;
  box-shadow:0 10px 34px rgba(0,0,0,.07);
  padding:1.1rem 1.1rem 1.2rem; max-height:calc(100vh - 128px); overflow-y:auto;
}
body.dark .qrd-sidebar{ background:#131916; border-color:#26312b; box-shadow:0 10px 34px rgba(0,0,0,.4); }
.qrd-sb-head{
  display:flex; align-items:center; gap:.55rem; font-weight:700; font-size:1rem; color:var(--ip-area-deep);
  padding:.1rem .1rem .85rem; border-bottom:1px solid #eef1ef; margin-bottom:1rem;
}
.qrd-sb-head .qrd-sb-ic{
  width:30px;height:30px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,var(--ip-area-fill),var(--ip-area)); color:#fff; font-size:.95rem; flex-shrink:0;
}
body.dark .qrd-sb-head{ color:#e7ece9; border-bottom-color:#243029; }
.qrd-sb-close{
  margin-inline-start:auto; width:32px;height:32px;border:none;background:transparent;border-radius:8px;
  font-size:1.2rem; color:var(--ip-muted); cursor:pointer; display:none; align-items:center; justify-content:center;
}
.qrd-sb-close:hover{ background:#f1f3f2; color:#1f2937; }
body.dark .qrd-sb-close:hover{ background:#202b25; color:#e7ece9; }

.qrd-sb-section{ margin-bottom:1.15rem; }
.qrd-sb-section:last-child{ margin-bottom:0; }
.qrd-sb-title{
  font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.09em; color:var(--ip-area-strong);
  margin-bottom:.6rem; display:flex; align-items:center; gap:.4rem;
}
.qrd-sb-title i{ font-size:.85rem; }
body.dark .qrd-sb-title{ color:var(--ip-area-strong); }

.qrd-field{ margin-bottom:.75rem; }
.qrd-field:last-child{ margin-bottom:0; }
.qrd-field-label{
  display:flex; align-items:center; justify-content:space-between;
  font-size:.72rem; font-weight:600; color:var(--ip-muted); margin-bottom:.3rem;
}
body.dark .qrd-field-label{ color:var(--ip-muted); }
.qrd-field .qrd-select{ width:100%; min-width:0; }
.qrd-field .qrd-page-nav{ justify-content:space-between; }
.qrd-field .qrd-page-input{ flex:1; min-width:0; }
.qrd-field .qrd-page-total{ flex-shrink:0; }

/* text-size control */
.qrd-size-val{
  font-weight:700; color:var(--ip-area-strong); font-size:.78rem; background:var(--ip-area-soft); padding:.05rem .45rem; border-radius:20px;
}
body.dark .qrd-size-val{ color:var(--ip-area-strong); background:color-mix(in srgb, var(--ip-area) 14%, transparent); }
.qrd-size-row{ display:flex; align-items:center; gap:.5rem; }
.qrd-step{
  width:36px;height:36px;flex-shrink:0;border-radius:10px;border:1.5px solid #e1e5e9;background:#fff;
  color:var(--ip-area-strong);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:.15s;font-size:1rem;
}
.qrd-step:hover{ background:var(--ip-area-fill);color:#fff;border-color:var(--ip-area-fill); }
body.dark .qrd-step{ background:#16201b;border-color:#2b3833;color:var(--ip-area-strong); }
.qrd-range{
  -webkit-appearance:none; appearance:none; flex:1; min-width:0; height:6px; border-radius:6px;
  background:#e3e7e5; cursor:pointer; outline:none;
}
.qrd-range::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:18px;height:18px;border-radius:50%;
  background:var(--ip-area-fill); border:3px solid #fff; box-shadow:0 1px 5px rgba(0,0,0,.25); cursor:pointer; transition:.15s;
}
.qrd-range::-webkit-slider-thumb:hover{ background:var(--ip-area-fill); transform:scale(1.1); }
.qrd-range::-moz-range-thumb{
  width:18px;height:18px;border-radius:50%;background:var(--ip-area-fill);border:3px solid #fff;cursor:pointer;
}
body.dark .qrd-range{ background:#2b3833; }
body.dark .qrd-range::-webkit-slider-thumb{ background:var(--ip-area); border-color:#131916; }
body.dark .qrd-range::-moz-range-thumb{ background:var(--ip-area); border-color:#131916; }

/* stacked sidebar buttons */
.qrd-sb-actions{ display:flex; flex-direction:column; gap:.55rem; }
.qrd-sb-actions .qrd-tf-toggle,
.qrd-sb-actions .qrd-icon-btn{ width:100%; height:44px; justify-content:center; font-size:.85rem; }

/* mobile FAB + drawer backdrop */
.qrd-sb-fab{
  display:none; position:fixed; left:1rem; bottom:5.4rem; z-index:320;
  height:48px; padding:0 1.15rem; border-radius:26px; border:none;
  background:linear-gradient(135deg,var(--ip-area-fill),var(--ip-area)); color:#fff; font-weight:700; font-size:.85rem;
  align-items:center; gap:.5rem; box-shadow:0 10px 26px color-mix(in srgb, var(--ip-area-fill) 42%, transparent); cursor:pointer;
}
.qrd-sb-fab:active{ transform:scale(.96); }
.qrd-sb-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1040;
  opacity:0; visibility:hidden; transition:opacity .25s, visibility .25s;
}
.qrd-sb-backdrop.open{ opacity:1; visibility:visible; }

@media (max-width: 991.98px){
  .qrd-layout{ display:block; padding:1rem .8rem 7rem; }
  .qrd-sidebar{
    position:fixed; top:0; left:0; bottom:0; z-index:1050; width:310px; max-width:86%;
    border-radius:0 22px 22px 0; max-height:100vh; overflow-y:auto;
    transform:translateX(-105%); transition:transform .28s ease;
  }
  .qrd-sidebar.open{ transform:translateX(0); }
  .qrd-sb-close{ display:inline-flex; }
  .qrd-sb-fab{ display:inline-flex; }
}

/* ---- Mushaf sheet ---- */
.qrd-stage{ padding:1.6rem 0 7rem; }
.qrd-mushaf{
  max-width:900px; margin:0 auto; background:#fffdf7;
  border:1px solid #ece6d6; border-radius:20px; padding:1.4rem 1.4rem 1.8rem;
  box-shadow:0 10px 40px rgba(0,0,0,.07);
  position:relative;
}
.qrd-mushaf::before{
  content:''; position:absolute; inset:8px; border:1.5px solid #e6d9b8; border-radius:14px; pointer-events:none;
}
body.dark .qrd-mushaf{ background:#131916; border-color:#26312b; box-shadow:0 10px 40px rgba(0,0,0,.4); }
body.dark .qrd-mushaf::before{ border-color:#2f3a33; }

.qrd-page-corner{
  position:relative; z-index:2; text-align:center; font-size:.72rem; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:#b08d57; margin-bottom:.4rem;
}

/* surah header */
.qrd-surah-header{
  position:relative; z-index:2; display:flex; align-items:center; gap:1rem; justify-content:space-between;
  margin:1.2rem 0 .6rem; padding:.7rem 1rem;
  background:linear-gradient(135deg,var(--ip-area-fill),var(--ip-area)); border-radius:14px; color:#fff;
  box-shadow:0 6px 18px color-mix(in srgb, var(--ip-area-fill) 25%, transparent);
}
.qrd-surah-header:first-child{ margin-top:.2rem; }
.qrd-sh-main{ text-align:center; flex:1; }
.qrd-sh-arabic{ font-family:"Amiri Quran","Noto Naskh Arabic",serif; font-size:1.7rem; line-height:1.3; }
.qrd-sh-eng{ font-size:.74rem; opacity:.92; letter-spacing:.03em; margin-top:1px; }
.qrd-sh-badge{
  width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.18);display:inline-flex;
  align-items:center;justify-content:center;font-weight:700;font-size:.85rem;
}
.qrd-sh-play{
  width:38px;height:38px;border-radius:50%;border:none;background:rgba(255,255,255,.18);color:#fff;
  font-size:1.2rem;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:.15s;
}
.qrd-sh-play:hover{ background:#fff; color:var(--ip-area-strong); }

.qrd-bismillah{
  position:relative; z-index:2; text-align:center; font-family:"Amiri Quran","Noto Naskh Arabic",serif;
  font-size:1.9rem; color:var(--ip-area-strong); margin:.8rem 0 1rem; direction:rtl;
}
body.dark .qrd-bismillah{ color:var(--ip-area-strong); }

/* verses flow */
.qrd-verses{
  position:relative; z-index:2; direction:rtl; text-align:justify; line-height:var(--qrd-lh,2.5);
  font-family:var(--qrd-family,"Amiri Quran","Noto Naskh Arabic",serif); font-size:var(--qrd-font,30px);
  padding:.4rem .2rem;
}
.qrd-ayah{
  display:inline; border-radius:10px; padding:.08em .25em; cursor:default;
  transition:background .15s, box-shadow .15s; box-decoration-break:clone; -webkit-box-decoration-break:clone;
}
.qrd-ayah-text{ }
.qrd-ayah-num{
  display:inline-flex; align-items:center; justify-content:center; vertical-align:middle;
  width:1.35em; height:1.35em; margin:0 .12em; border:none; background:transparent; cursor:pointer;
  font-family:"Amiri Quran",serif; color:inherit; position:relative; border-radius:50%;
  font-size:.62em; line-height:1; transition:.15s;
}
.qrd-ayah-num .qrd-num-val{
  position:relative; z-index:1;
  display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;
  border-radius:50%; background:rgba(0,0,0,.04); border:1.5px solid currentColor; font-weight:600;
  font-family:"Noto Naskh Arabic","Scheherazade New",serif; line-height:1;
  font-size:.82em; padding-bottom:.04em;
}
.qrd-ayah-num .qrd-num-play{ display:none; position:absolute; inset:0; align-items:center; justify-content:center; }
.qrd-ayah-num:hover .qrd-num-val{ opacity:0; }
.qrd-ayah-num:hover .qrd-num-play{ display:flex; }

/* color palette (6 rotating tints) */
.qrd-c0{ color:var(--ip-area-strong); } .qrd-c0:hover,.qrd-c0.qrd-sel{ background:var(--ip-area-soft); }
.qrd-c1{ color:#5b3bb8; } .qrd-c1:hover,.qrd-c1.qrd-sel{ background:#efeafb; }
.qrd-c2{ color:#b45309; } .qrd-c2:hover,.qrd-c2.qrd-sel{ background:#fdf0e2; }
.qrd-c3{ color:#1d4ed8; } .qrd-c3:hover,.qrd-c3.qrd-sel{ background:#e7eefc; }
.qrd-c4{ color:#be1457; } .qrd-c4:hover,.qrd-c4.qrd-sel{ background:#fce7f0; }
.qrd-c5{ color:#3f7e1f; } .qrd-c5:hover,.qrd-c5.qrd-sel{ background:#eef7e6; }
body.dark .qrd-c0{ color:var(--ip-area-strong); } body.dark .qrd-c0:hover,body.dark .qrd-c0.qrd-sel{ background:color-mix(in srgb, var(--ip-area) 12%, transparent); }
body.dark .qrd-c1{ color:#b49bf5; } body.dark .qrd-c1:hover,body.dark .qrd-c1.qrd-sel{ background:rgba(180,155,245,.12); }
body.dark .qrd-c2{ color:#f0ad5b; } body.dark .qrd-c2:hover,body.dark .qrd-c2.qrd-sel{ background:rgba(240,173,91,.12); }
body.dark .qrd-c3{ color:#7da6f5; } body.dark .qrd-c3:hover,body.dark .qrd-c3.qrd-sel{ background:rgba(125,166,245,.12); }
body.dark .qrd-c4{ color:#f17bab; } body.dark .qrd-c4:hover,body.dark .qrd-c4.qrd-sel{ background:rgba(241,123,171,.12); }
body.dark .qrd-c5{ color:#8fce63; } body.dark .qrd-c5:hover,body.dark .qrd-c5.qrd-sel{ background:rgba(143,206,99,.12); }

/* currently playing */
.qrd-ayah.qrd-playing{
  background:#fff4d6 !important; box-shadow:inset 0 0 0 2px #e6b85c;
}
body.dark .qrd-ayah.qrd-playing{ background:rgba(230,184,92,.16) !important; box-shadow:inset 0 0 0 2px #e6b85c; }

/* loading / error */
.qrd-loading,.qrd-error{ position:relative; z-index:2; text-align:center; padding:4rem 1rem; color:var(--ip-muted); }
body.dark .qrd-loading,body.dark .qrd-error{ color:var(--ip-muted); }
.qrd-spinner{
  width:44px;height:44px;border:4px solid #e5e7eb;border-top-color:var(--ip-area-fill);border-radius:50%;
  margin:0 auto 1rem;animation:qrdspin .8s linear infinite;
}
@keyframes qrdspin{ to{ transform:rotate(360deg); } }

/* ---- Audio bar ---- */
.qrd-audiobar{
  position:fixed; left:0; right:0; bottom:0; z-index:300;
  background:rgba(255,255,255,.98); backdrop-filter:blur(16px);
  border-top:1px solid #e5e7eb; box-shadow:0 -4px 24px rgba(0,0,0,.08);
  padding:.55rem 0;
}
body.dark .qrd-audiobar{ background:rgba(18,25,21,.98); border-top-color:#26312b; }
.qrd-ab-row{ display:flex; align-items:center; gap:.8rem; }
.qrd-ab-info{ min-width:0; display:flex; align-items:center; gap:.6rem; flex:1; }
.qrd-ab-badge{
  width:42px;height:42px;border-radius:12px;flex-shrink:0;
  background:linear-gradient(135deg,var(--ip-area-fill),var(--ip-area));color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:1.2rem;
}
.qrd-ab-titles{ min-width:0; }
.qrd-ab-title{ font-weight:700; font-size:.88rem; color:#1f2937; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qrd-ab-sub{ font-size:.72rem; color:var(--ip-muted); white-space:nowrap; }
body.dark .qrd-ab-title{ color:#e7ece9; } body.dark .qrd-ab-sub{ color:var(--ip-muted); }
.qrd-ab-controls{ display:flex; align-items:center; gap:.4rem; }
.qrd-ab-btn{
  width:42px;height:42px;border-radius:50%;border:none;background:#f1f3f2;color:#1f2937;
  display:inline-flex;align-items:center;justify-content:center;font-size:1.1rem;cursor:pointer;transition:.15s;
}
.qrd-ab-btn:hover{ background:#e3e7e5; }
.qrd-ab-btn.qrd-ab-play{ width:52px;height:52px;background:var(--ip-area-fill);color:#fff;font-size:1.45rem; }
.qrd-ab-btn.qrd-ab-play:hover{ background:var(--ip-area-fill); }
body.dark .qrd-ab-btn{ background:#202b25; color:#e7ece9; }
body.dark .qrd-ab-btn:hover{ background:#2a362f; }
.qrd-ab-toggle{
  display:inline-flex; align-items:center; gap:.4rem; font-size:.76rem; font-weight:600; color:#374151; cursor:pointer; user-select:none;
}
body.dark .qrd-ab-toggle{ color:#cdd5d1; }
.qrd-switch{ position:relative; width:38px; height:22px; background:#cbd5d1; border-radius:20px; transition:.2s; flex-shrink:0; }
.qrd-switch::after{ content:''; position:absolute; top:2px; inset-inline-start:2px; width:18px; height:18px; background:#fff; border-radius:50%; transition:.2s; }
.qrd-switch.on{ background:var(--ip-area-fill); } .qrd-switch.on::after{ inset-inline-start:18px; }
.qrd-ab-progress{ height:4px; background:#e5e7eb; border-radius:4px; overflow:hidden; margin-top:.45rem; }
.qrd-ab-progress-bar{ height:100%; width:0; background:linear-gradient(90deg,var(--ip-area-fill),var(--ip-area)); transition:width .15s linear; }
body.dark .qrd-ab-progress{ background:#26312b; }

/* ---- Bookmarks offcanvas ---- */
.qrd-bm-item{
  display:flex; align-items:flex-start; gap:.7rem; padding:.8rem .9rem; border:1px solid #e5e7eb;
  border-radius:14px; margin-bottom:.6rem; transition:.15s; background:#fff;
}
.qrd-bm-item:hover{ border-color:var(--ip-area-fill); box-shadow:0 4px 14px color-mix(in srgb, var(--ip-area-fill) 10%, transparent); }
body.dark .qrd-bm-item{ background:#16201b; border-color:#2b3833; }
.qrd-bm-ico{
  width:38px;height:38px;border-radius:10px;flex-shrink:0;background:var(--ip-area-soft);color:var(--ip-area-strong);
  display:flex;align-items:center;justify-content:center;font-size:1.1rem;
}
body.dark .qrd-bm-ico{ background:color-mix(in srgb, var(--ip-area-fill) 18%, transparent); color:var(--ip-area-strong); }
.qrd-bm-body{ flex:1; min-width:0; cursor:pointer; }
.qrd-bm-name{ font-weight:700; font-size:.88rem; color:#1f2937; }
.qrd-bm-meta{ font-size:.72rem; color:var(--ip-muted); }
body.dark .qrd-bm-name{ color:#e7ece9; } body.dark .qrd-bm-meta{ color:var(--ip-muted); }
.qrd-bm-del{ border:none; background:transparent; color:var(--ip-muted); font-size:1rem; cursor:pointer; padding:.2rem; }
.qrd-bm-del:hover{ color:#dc2626; }
.qrd-bm-empty{ text-align:center; padding:3rem 1rem; color:var(--ip-muted); }

@media (max-width: 575.98px){
  .qrd-sh-arabic{ font-size:1.4rem; }
  .qrd-bismillah{ font-size:1.5rem; }
  .qrd-ab-info .qrd-ab-badge{ display:none; }
  .qrd-tb-actions{ width:100%; margin-inline-start:0; }
}

/* toolbar tafsir toggle */
.qrd-tf-toggle{
  height:40px; padding:0 .85rem; border-radius:10px; border:1.5px solid #e1e5e9; background:#fff;
  color:#374151; font-size:.82rem; font-weight:600; display:inline-flex; align-items:center; gap:.45rem; cursor:pointer; transition:.15s;
}
.qrd-tf-toggle:hover{ border-color:#7c3aed; color:#7c3aed; }
.qrd-tf-toggle.on{ background:#7c3aed; color:#fff; border-color:#7c3aed; }
body.dark .qrd-tf-toggle{ background:#16201b; border-color:#2b3833; color:#d7ddda; }
body.dark .qrd-tf-toggle.on{ background:#8b5cf6; border-color:#8b5cf6; color:#fff; }
.qrd-tf-toggle .qrd-switch{ background:#cbd5d1; }
.qrd-tf-toggle.on .qrd-switch{ background:rgba(255,255,255,.5); }
.qrd-tf-toggle.on .qrd-switch::after{ background:#fff; }

/* ==============================================================
   Verse-by-verse reading (database-driven reader)
   ============================================================== */

/* the page's sticky navbar sits above the sidebar */
.qrd-sidebar{ z-index:5; }
@media (max-width: 991.98px){ .qrd-sidebar{ z-index:1050; } }

.qrd-hero .breadcrumb, .qrd-hero .breadcrumb a, .qrd-hero .breadcrumb-item.active,
.qrd-hero .breadcrumb-item + .breadcrumb-item::before{ color:rgba(255,255,255,.8); }
.qrd-hero .breadcrumb a:hover{ color:#fff; }

.qrd-surah-meta{
  position:relative; z-index:2; display:flex; flex-wrap:wrap; justify-content:center; gap:.4rem;
  margin:.2rem 0 .6rem; font-size:.74rem; font-weight:600; color:var(--ip-muted);
}
.qrd-surah-meta span{ background:#f1f3f2; border-radius:20px; padding:.2rem .7rem; }
body.dark .qrd-surah-meta{ color:var(--ip-muted); }
body.dark .qrd-surah-meta span{ background:#1b2520; }

.qrd-ayah-list{ position:relative; z-index:2; }
.qrd-ayah-block{
  padding:1.1rem .7rem; border-bottom:1px solid #efe9da; border-radius:14px;
  scroll-margin-top:110px; transition:background .2s, box-shadow .2s;
}
.qrd-ayah-block:last-child{ border-bottom:none; }
body.dark .qrd-ayah-block{ border-bottom-color:#232d27; }
.qrd-ayah-block.qrd-playing{ background:#fff4d6; box-shadow:inset 0 0 0 2px #e6b85c; }
body.dark .qrd-ayah-block.qrd-playing{ background:rgba(230,184,92,.16); }
.qrd-ayah-block.qrd-target{ box-shadow:inset 0 0 0 2px var(--ip-area-fill); }

.qrd-ayah-head{ display:flex; align-items:flex-start; gap:.8rem; }
.qrd-ayah-badge{
  width:36px; height:36px; border-radius:50%; flex-shrink:0; margin-top:.5rem;
  background:color-mix(in srgb, var(--ip-area-fill) 10%, transparent); color:var(--ip-area-strong); font-weight:700; font-size:.8rem;
  display:inline-flex; align-items:center; justify-content:center;
}
body.dark .qrd-ayah-badge{ background:color-mix(in srgb, var(--ip-area) 14%, transparent); color:var(--ip-area-strong); }
.qrd-ayah-arabic{
  flex:1; min-width:0; margin:0; direction:rtl; text-align:right; color:var(--ip-area-strong);
  font-family:var(--qrd-family,"Amiri Quran","Noto Naskh Arabic",serif);
  font-size:var(--qrd-font,30px); line-height:var(--qrd-lh,2.5);
}
body.dark .qrd-ayah-arabic{ color:var(--ip-area-strong); }
.qrd-sajdah{
  display:inline-flex; align-items:center; gap:.25rem; font-family:Inter,system-ui,sans-serif; direction:ltr;
  font-size:.66rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:#b45309; background:#fdf0e2; border-radius:20px; padding:.15rem .6rem; vertical-align:middle;
}
body.dark .qrd-sajdah{ color:#f0ad5b; background:rgba(240,173,91,.12); }

.qrd-ayah-translit{ font-style:italic; font-size:.9rem; color:var(--ip-muted); margin-block: .5rem .25rem; margin-inline: 3.05rem 0; }
.qrd-ayah-translation{ font-size:1rem; line-height:1.75; color:#1f2937; margin-block: .4rem 0; margin-inline: 3.05rem 0; }
body.dark .qrd-ayah-translit{ color:var(--ip-muted); }
body.dark .qrd-ayah-translation{ color:#dfe5e2; }
.qrd-hide-translation .qrd-ayah-translation{ display:none; }
.qrd-hide-translit .qrd-ayah-translit{ display:none; }

.qrd-ayah-actions{ display:flex; flex-wrap:wrap; gap:.4rem; margin-block: .7rem 0; margin-inline: 3.05rem 0; }
.qrd-ayah-btn{
  height:34px; padding:0 .7rem; border-radius:9px; border:1.5px solid #e1e5e9; background:#fff; color:#374151;
  font-size:.78rem; font-weight:600; display:inline-flex; align-items:center; gap:.3rem; cursor:pointer; transition:.15s;
}
.qrd-ayah-btn:hover{ border-color:var(--ip-area-fill); color:var(--ip-area-strong); }
.qrd-ayah-btn:disabled{ opacity:.45; cursor:not-allowed; }
.qrd-ayah-btn.on{ background:var(--ip-area-fill); border-color:var(--ip-area-fill); color:#fff; }
.qrd-ayah-btn.qrd-tafsir-btn:hover{ border-color:#7c3aed; color:#7c3aed; }
.qrd-ayah-btn.qrd-tafsir-btn[aria-expanded="true"]{ background:#7c3aed; border-color:#7c3aed; color:#fff; }
body.dark .qrd-ayah-btn{ background:#16201b; border-color:#2b3833; color:#d7ddda; }

.qrd-ayah-tafsir-body{
  margin-block: .7rem 0; margin-inline: 3.05rem 0; padding:.8rem 1rem; border-radius:12px; border-inline-start:3px solid #7c3aed;
  background:#f3effb; color:#374151; font-size:.92rem; line-height:1.75; white-space:pre-line;
}
body.dark .qrd-ayah-tafsir-body{ background:rgba(124,58,237,.14); color:#dcd3f7; }

.qrd-empty{
  position:relative; z-index:2; text-align:center; padding:2.5rem 1rem; color:var(--ip-muted);
}
.qrd-empty i{ font-size:2.4rem; color:#b08d57; display:block; margin-bottom:.6rem; }
body.dark .qrd-empty{ color:var(--ip-muted); }

.qrd-surah-nav{ position:relative; z-index:2; display:flex; justify-content:space-between; gap:.6rem; margin-top:1.4rem; }

.qrd-ab-sub{ overflow:hidden; text-overflow:ellipsis; }
.qrd-ab-btn:disabled{ opacity:.4; cursor:not-allowed; }
.qrd-ab-note{ font-size:.72rem; color:#b45309; }

.qrd-bm-note{ font-size:.8rem; color:#4b5563; margin-top:.15rem; word-break:break-word; }
.qrd-ayah-tafsir-body [lang="ar"] { font-family: "Noto Naskh Arabic", serif; font-size: 1.25rem; line-height: 2; }
.qrd-surah-nav { align-items: center; flex-wrap: wrap; }
body.dark .qrd-bm-note{ color:#b9c3be; }
a.qrd-bm-body{ text-decoration:none; display:block; }

@media (max-width: 575.98px){
  .qrd-ayah-translit, .qrd-ayah-translation, .qrd-ayah-actions, .qrd-ayah-tafsir-body{ margin-inline-start:0; }
  .qrd-mushaf{ padding:1.1rem .8rem 1.4rem; }
}

/* ==============================================================
   Tafsir companion panel (offcanvas) — scope, read-aloud, speed
   ============================================================== */
.qrd-tf-panel{ max-width:440px; width:94%; }
.qrd-tf-panel .offcanvas-header{
  background:linear-gradient(135deg,#5b21b6,#7c3aed); color:#fff; padding:1rem 1.1rem .9rem;
}
.qrd-tf-panel .offcanvas-title{ font-weight:700; display:flex; align-items:center; gap:.5rem; }
.qrd-tf-panel .btn-close{ filter:invert(1) grayscale(1) brightness(2); }
.qrd-tf-head-row{ display:flex; flex-direction:column; gap:.7rem; }
.qrd-tf-ref{ font-size:.78rem; font-weight:600; opacity:.92; }

.qrd-tf-scope{ display:flex; background:rgba(255,255,255,.16); border-radius:10px; padding:3px; gap:2px; }
.qrd-tf-seg{
  flex:1; border:none; background:transparent; color:rgba(255,255,255,.85); font-size:.74rem; font-weight:700;
  padding:.4rem .2rem; border-radius:8px; cursor:pointer; transition:.15s; letter-spacing:.02em;
}
.qrd-tf-seg.on{ background:#fff; color:#5b21b6; box-shadow:0 2px 6px rgba(0,0,0,.15); }

.qrd-tf-edition{
  width:100%; border:none; border-radius:9px; padding:.45rem .6rem; font-size:.8rem; font-weight:600;
  background:rgba(255,255,255,.92); color:#3b0a6b; cursor:pointer;
}
.qrd-tf-edition:focus{ outline:none; box-shadow:0 0 0 3px rgba(255,255,255,.35); }

.qrd-tf-body{ flex:1; padding:1rem 1.1rem 1.1rem; overflow-y:auto; }
.qrd-tf-section{ margin-bottom:1.1rem; }
.qrd-tf-aya-head{
  display:flex; align-items:center; gap:.5rem; margin:0 0 .55rem; padding:.45rem .7rem;
  background:#f3effb; border-radius:10px; border-inline-start:3px solid #7c3aed;
}
body.dark .qrd-tf-aya-head{ background:rgba(124,58,237,.14); }
.qrd-tf-aya-badge{
  width:26px; height:26px; flex-shrink:0; border-radius:8px; background:#7c3aed; color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:700;
}
.qrd-tf-aya-label{ font-size:.78rem; font-weight:700; color:#5b21b6; }
body.dark .qrd-tf-aya-label{ color:#c4b1f9; }
.qrd-tf-aya-arabic{
  font-family:"Amiri Quran","Noto Naskh Arabic",serif; direction:rtl; text-align:right;
  font-size:1.4rem; line-height:2.1; color:var(--ip-area-strong); margin:.2rem 0 .6rem;
}
body.dark .qrd-tf-aya-arabic{ color:var(--ip-area-strong); }
.qrd-tf-aya-play{
  margin-inline-start:auto; border:none; background:transparent; color:#7c3aed; font-size:1.05rem; cursor:pointer;
  width:30px; height:30px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; transition:.15s;
}
.qrd-tf-aya-play:hover{ background:rgba(124,58,237,.14); }
body.dark .qrd-tf-aya-play{ color:#b49bf5; }

.qrd-tf-line{
  position:relative; display:block; width:100%; text-align:start; border:none; background:transparent;
  padding-block: .5rem .5rem; padding-inline: 2rem .7rem; margin-bottom:.3rem; border-radius:10px;
  font-size:.92rem; line-height:1.7; color:#374151; cursor:pointer; transition:background .15s;
}
.qrd-tf-line.qrd-tf-rtl{
  direction:rtl; text-align:right; padding:.5rem 2rem .5rem .7rem;
  font-family:"Noto Naskh Arabic","Amiri Quran",serif; font-size:1.05rem; line-height:2;
}
.qrd-tf-line::before{
  content:'\F4F6'; font-family:'bootstrap-icons'; position:absolute; inset-inline-start:.55rem; top:.55rem;
  font-size:.8rem; color:#c4b5e8; opacity:0; transition:opacity .15s;
}
.qrd-tf-line.qrd-tf-rtl::before{ left:auto; right:.55rem; }
.qrd-tf-line:hover{ background:#f5f2fc; }
.qrd-tf-line:hover::before{ opacity:1; }
.qrd-tf-line.active{ background:#ede4fd; box-shadow:inset 0 0 0 1.5px #b49bf5; color:#3b0a6b; }
.qrd-tf-line.active::before{ content:'\F4F2'; color:#7c3aed; opacity:1; }
body.dark .qrd-tf-line{ color:#cdd5d1; }
body.dark .qrd-tf-line:hover{ background:rgba(124,58,237,.1); }
body.dark .qrd-tf-line.active{ background:rgba(124,58,237,.2); color:#e7ddfb; box-shadow:inset 0 0 0 1.5px #8b5cf6; }

.qrd-tf-empty{ text-align:center; padding:3rem 1rem; color:var(--ip-muted); }
body.dark .qrd-tf-empty{ color:var(--ip-muted); }
.qrd-tf-credit{ font-size:.7rem; color:var(--ip-muted); text-align:center; margin-top:.6rem; }

.qrd-tf-foot{ border-top:1px solid #e5e7eb; background:#fff; padding:.7rem 1rem .8rem; }
body.dark .qrd-tf-foot{ background:#131916; border-top-color:#26312b; }
.qrd-tf-foot-row{ display:flex; align-items:center; justify-content:center; gap:.5rem; }
.qrd-tf-cbtn{
  width:42px; height:42px; border-radius:50%; border:none; background:#f1eefb; color:#5b21b6;
  display:inline-flex; align-items:center; justify-content:center; font-size:1.1rem; cursor:pointer; transition:.15s;
}
.qrd-tf-cbtn:hover{ background:#e6dcfa; }
.qrd-tf-cbtn.qrd-tf-cplay{ width:52px; height:52px; background:#7c3aed; color:#fff; font-size:1.45rem; }
.qrd-tf-cbtn.qrd-tf-cplay:hover{ background:#6b29d6; }
.qrd-tf-cbtn:disabled{ opacity:.45; cursor:not-allowed; }
body.dark .qrd-tf-cbtn{ background:#241a3a; color:#c4b1f9; }
body.dark .qrd-tf-cbtn:hover{ background:#2f2350; }
.qrd-tf-rate{ display:flex; align-items:center; gap:.5rem; margin-top:.6rem; font-size:.74rem; color:var(--ip-muted); }
body.dark .qrd-tf-rate{ color:var(--ip-muted); }
.qrd-tf-rate input[type=range]{ flex:1; accent-color:#7c3aed; }
.qrd-tf-opt{
  display:flex; align-items:center; justify-content:center; gap:.5rem; margin:.55rem auto 0; width:100%;
  border:none; background:transparent; font-size:.74rem; font-weight:600; color:#374151; cursor:pointer;
}
body.dark .qrd-tf-opt{ color:#cdd5d1; }
.qrd-tf-warn{ font-size:.7rem; color:#b45309; text-align:center; margin-top:.4rem; }
body.dark .qrd-tf-warn{ color:#f0ad5b; }

/* the verse the panel is explaining */
.qrd-ayah-block.qrd-tf-active{ box-shadow:inset 0 0 0 2px #7c3aed; }
body.dark .qrd-ayah-block.qrd-tf-active{ box-shadow:inset 0 0 0 2px #b49bf5; }

/* ---- resume banner (the place saved in this browser) ---- */
.qrd-resume{
  position:relative; z-index:3; display:flex; align-items:center; gap:.6rem; margin-bottom:.9rem;
  padding:.65rem .9rem; border-radius:12px; border:1.5px solid var(--ip-area-tint); background:var(--ip-area-soft);
  color:var(--ip-area-strong); font-size:.85rem; font-weight:600;
}
.qrd-resume i{ font-size:1.05rem; }
.qrd-resume-text{ flex:1; min-width:0; }
.qrd-resume-go{
  flex-shrink:0; text-decoration:none; background:var(--ip-area-fill); color:#fff; border-radius:9px;
  padding:.3rem .8rem; font-size:.78rem; font-weight:700;
}
.qrd-resume-go:hover{ background:var(--ip-area-fill); color:#fff; }
.qrd-resume-close{ flex-shrink:0; border:none; background:transparent; color:var(--ip-muted); cursor:pointer; padding:.2rem; }
.qrd-resume-close:hover{ color:#dc2626; }
body.dark .qrd-resume{ background:color-mix(in srgb, var(--ip-area-fill) 14%, transparent); border-color:#2b3833; color:var(--ip-area-strong); }

/* ==============================================================
   Lapis & Saffron layer (2026 redesign). Calm, plain reading surfaces for the Quran:
   ink Arabic in Amiri Quran on white / ink-navy, colour only in the controls.
   ============================================================== */
.qrd-layout { gap: 1.75rem; max-width: 1320px; padding: 2rem 1rem 8rem; }

/* Options sidebar: a soft card */
.qrd-sidebar {
  top: calc(var(--ip-header-h) + 1.25rem);
  max-height: calc(100vh - var(--ip-header-h) - 2.5rem);
  background: var(--ip-surface);
  border: 1px solid var(--ip-line);
  border-radius: var(--ip-radius-xl);
  box-shadow: var(--ip-shadow-md);
  padding: 1.15rem 1.15rem 1.3rem;
}
body.dark .qrd-sidebar { background: var(--ip-surface); border-color: var(--ip-line); box-shadow: var(--ip-shadow-md); }
.qrd-sb-head { color: var(--ip-ink); border-bottom-color: var(--ip-line); font-family: var(--ip-font-display); font-size: 1.1rem; font-weight: 600; }
body.dark .qrd-sb-head { color: var(--ip-ink); border-bottom-color: var(--ip-line); }
.qrd-sb-head .qrd-sb-ic { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill)); }
.qrd-sb-title { color: var(--ip-area-strong); letter-spacing: .1em; }
.qrd-field-label,
body.dark .qrd-field-label,
.qrd-page-total,
body.dark .qrd-page-total { color: var(--ip-muted); }
.qrd-select,
.qrd-page-input,
.qrd-nav-btn,
.qrd-step,
.qrd-icon-btn,
.qrd-tf-toggle,
.qrd-ayah-btn,
body.dark .qrd-select,
body.dark .qrd-page-input,
body.dark .qrd-nav-btn,
body.dark .qrd-step,
body.dark .qrd-icon-btn,
body.dark .qrd-tf-toggle,
body.dark .qrd-ayah-btn {
  background: var(--ip-surface);
  border: 1px solid var(--ip-line-strong);
  color: var(--ip-ink-2);
}
.qrd-select,
.qrd-page-input { border-radius: 12px; color: var(--ip-ink); }
.qrd-select:focus,
.qrd-page-input:focus { border-color: var(--ip-area); box-shadow: 0 0 0 4px var(--ip-area-soft); }
.qrd-nav-btn,
.qrd-step { color: var(--ip-area-strong); border-radius: 12px; }
.qrd-nav-btn:hover,
.qrd-step:hover,
body.dark .qrd-nav-btn:hover,
body.dark .qrd-step:hover { background: var(--ip-area-fill); border-color: var(--ip-area-fill); color: #fff; }
.qrd-icon-btn,
.qrd-tf-toggle { border-radius: var(--ip-radius-pill); }
.qrd-icon-btn:hover,
.qrd-tf-toggle:hover,
body.dark .qrd-icon-btn:hover,
body.dark .qrd-tf-toggle:hover { border-color: var(--ip-area); color: var(--ip-area-strong); background: var(--ip-area-soft); }
.qrd-tf-toggle.on,
body.dark .qrd-tf-toggle.on { background: var(--ip-area-fill); border-color: var(--ip-area-fill); color: #fff; }
.qrd-range,
body.dark .qrd-range { background: var(--ip-surface-3); }
.qrd-switch { background: var(--ip-line-strong); }
.qrd-switch.on { background: var(--ip-area-fill); }

/* The mushaf sheet: plain, calm, framed by a fine saffron rule */
.qrd-mushaf {
  max-width: 920px;
  background: var(--ip-surface);
  border: 1px solid var(--ip-line);
  border-radius: 28px;
  padding: 1.75rem 1.75rem 2rem;
  box-shadow: 0 30px 60px -40px rgba(20, 30, 80, .35), var(--ip-shadow-sm);
}
.qrd-mushaf::before { inset: 10px; border: 1px solid rgba(242, 168, 59, .35); border-radius: 20px; }
body.dark .qrd-mushaf { background: var(--ip-surface); border-color: var(--ip-line); box-shadow: var(--ip-shadow-md); }
body.dark .qrd-mushaf::before { border-color: rgba(255, 197, 107, .18); }
.qrd-page-corner { color: var(--ip-accent-strong); letter-spacing: .14em; }

/* Surah cartouche */
.qrd-surah-header {
  margin: .4rem 0 .75rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--ip-area) 22%, var(--ip-line));
  border-radius: 22px;
  color: var(--ip-ink);
  background:
    radial-gradient(60% 120% at 50% 0%, var(--ip-area-soft), transparent 70%),
    linear-gradient(180deg, var(--ip-surface), var(--ip-surface));
  box-shadow: none;
  overflow: hidden;
}
.qrd-surah-header::before,
.qrd-surah-header::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 168, 59, .7));
}
.qrd-surah-header::before { inset-inline-start: 4.25rem; }
.qrd-surah-header::after { inset-inline-end: 4.25rem; transform: scaleX(-1); }
.qrd-sh-main { position: relative; z-index: 1; }
.qrd-sh-arabic { font-family: var(--ip-font-quran); font-size: 2.1rem; line-height: 1.5; color: var(--ip-ink); }
.qrd-sh-eng { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ip-muted); opacity: 1; }
.qrd-sh-badge {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ip-area-soft);
  color: var(--ip-area-strong);
  font-weight: 700;
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}
.qrd-sh-play {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill));
  color: #fff;
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--ip-area-fill) 90%, transparent);
  transition: transform .25s var(--ip-spring), box-shadow .25s;
}
.qrd-sh-play:hover { background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill)); color: #fff; transform: scale(1.08); }
.qrd-surah-meta span,
body.dark .qrd-surah-meta span { background: var(--ip-surface-2); color: var(--ip-muted); padding: .25rem .8rem; }
.qrd-bismillah { font-family: var(--ip-font-quran); color: var(--ip-ink); font-size: 2.1rem; }
body.dark .qrd-bismillah { color: var(--ip-ink); }

/* Verses */
.qrd-ayah-block {
  padding: 1.35rem 1rem;
  border-bottom: 1px solid var(--ip-line);
  border-radius: 18px;
}
body.dark .qrd-ayah-block { border-bottom-color: var(--ip-line); }
.qrd-ayah-block:hover { background: color-mix(in srgb, var(--ip-surface-2) 55%, transparent); }
.qrd-ayah-block.qrd-playing,
body.dark .qrd-ayah-block.qrd-playing {
  background: color-mix(in srgb, var(--ip-saffron-500) 12%, var(--ip-surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ip-saffron-500) 70%, transparent);
}
.qrd-ayah-block.qrd-target { box-shadow: inset 0 0 0 2px var(--ip-area); }
.qrd-ayah-badge,
body.dark .qrd-ayah-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border-radius: 0;
  background: var(--ip-area-soft);
  color: var(--ip-area-strong);
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
  font-variant-numeric: tabular-nums;
}
.qrd-ayah-arabic,
body.dark .qrd-ayah-arabic { color: var(--ip-ink); font-family: var(--qrd-family, "Amiri Quran", "Amiri", "Noto Naskh Arabic", serif); }
.qrd-ayah-translit,
body.dark .qrd-ayah-translit { color: var(--ip-muted); }
.qrd-ayah-translation,
body.dark .qrd-ayah-translation { color: var(--ip-ink-2); font-size: 1.04rem; line-height: 1.8; }
.qrd-ayah-btn { height: 34px; border-radius: var(--ip-radius-pill); font-size: .8rem; padding: 0 .8rem; }
.qrd-ayah-btn:hover,
body.dark .qrd-ayah-btn:hover { border-color: var(--ip-area); color: var(--ip-area-strong); background: var(--ip-area-soft); }
.qrd-ayah-btn.on,
body.dark .qrd-ayah-btn.on { background: var(--ip-area-fill); border-color: var(--ip-area-fill); color: #fff; }
.qrd-ayah-btn.qrd-tafsir-btn:hover { border-color: var(--ip-violet-500); color: var(--ip-violet-700); background: var(--ip-violet-50); }
body.dark .qrd-ayah-btn.qrd-tafsir-btn:hover { color: #bba8ff; background: rgba(164, 139, 255, .12); }
.qrd-ayah-btn.qrd-tafsir-btn[aria-expanded="true"] { background: var(--ip-violet-600); border-color: var(--ip-violet-600); color: #fff; }
.qrd-ayah-tafsir-body { border-inline-start: 3px solid var(--ip-violet-500); border-left-width: 0; border-radius: 14px; background: var(--ip-violet-50); color: var(--ip-ink-2); }
body.dark .qrd-ayah-tafsir-body { background: rgba(164, 139, 255, .12); color: var(--ip-ink-2); }
.qrd-sajdah { background: var(--ip-saffron-50); color: var(--ip-saffron-700); }
.qrd-empty i { color: var(--ip-accent); }

/* Floating audio bar: a frosted pill above the page */
.qrd-audiobar,
body.dark .qrd-audiobar {
  inset-inline: 1rem;
  bottom: 1rem;
  max-width: 980px;
  margin-inline: auto;
  padding: .6rem .35rem .55rem;
  border: 1px solid var(--ip-line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--ip-bg-elevated) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 24px 50px -24px rgba(20, 30, 80, .45), var(--ip-shadow-sm);
}
.qrd-ab-badge { border-radius: 14px; background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill)); }
.qrd-ab-title,
body.dark .qrd-ab-title { color: var(--ip-ink); }
.qrd-ab-sub,
body.dark .qrd-ab-sub { color: var(--ip-muted); }
.qrd-ab-btn,
body.dark .qrd-ab-btn { background: var(--ip-surface-2); color: var(--ip-ink); transition: background-color .2s, transform .2s var(--ip-spring); }
.qrd-ab-btn:hover,
body.dark .qrd-ab-btn:hover { background: var(--ip-surface-3); transform: scale(1.06); }
.qrd-ab-btn.qrd-ab-play,
body.dark .qrd-ab-btn.qrd-ab-play {
  width: 54px;
  height: 54px;
  background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill));
  color: #fff;
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--ip-area-fill) 95%, transparent);
}
.qrd-ab-toggle,
body.dark .qrd-ab-toggle { color: var(--ip-ink-2); }
.qrd-ab-progress,
body.dark .qrd-ab-progress { height: 5px; background: var(--ip-surface-3); }
.qrd-ab-progress-bar { background: linear-gradient(90deg, var(--ip-area-fill), var(--ip-turquoise-500)); }
.qrd-sb-fab { bottom: 6.5rem; inset-inline-start: 1rem; left: auto; }

/* Bookmarks and tafsir panels */
.qrd-bm-item,
body.dark .qrd-bm-item { background: var(--ip-surface); border-color: var(--ip-line); }
.qrd-bm-name,
body.dark .qrd-bm-name { color: var(--ip-ink); }
.qrd-bm-meta,
body.dark .qrd-bm-meta { color: var(--ip-muted); }
.qrd-tf-panel .offcanvas-header { background: linear-gradient(135deg, var(--ip-violet-600), var(--ip-lapis-500)); }
.qrd-tf-foot,
body.dark .qrd-tf-foot { background: var(--ip-surface); border-top-color: var(--ip-line); }
.qrd-tf-aya-arabic,
body.dark .qrd-tf-aya-arabic { color: var(--ip-ink); }
.qrd-resume { border-radius: 16px; }
body.dark .qrd-resume { border-color: var(--ip-line); }
.qrd-resume-go { border-radius: var(--ip-radius-pill); }

@media (max-width: 991.98px) {
  .qrd-sidebar { top: 0; max-height: 100vh; border-radius: 0 24px 24px 0; }
  [dir="rtl"] .qrd-sidebar { border-radius: 24px 0 0 24px; }
}
@media (max-width: 575.98px) {
  .qrd-layout { padding: 1rem .75rem 8rem; }
  .qrd-mushaf { padding: 1.1rem .85rem 1.5rem; border-radius: 22px; }
  .qrd-surah-header::before,
  .qrd-surah-header::after { display: none; }
  .qrd-sh-arabic { font-size: 1.7rem; }
  .qrd-audiobar,
  body.dark .qrd-audiobar { inset-inline: .5rem; bottom: .5rem; border-radius: 20px; }
}
.qrd-ayah-btn, .qrd-ayah-btn:hover { text-decoration: none; }

/* ==============================================================
   The reading experience (2026, wave 2): the hero's continue card, tabbed options, the slim reading bar,
   verse progress while reciting, reveal and focus modes, the surah index and phone ergonomics.
   ============================================================== */
.qrd-layout { padding-top: 1.25rem; }

/* ---- Continue card on the hero ---- */
.qx-continue__row { display: flex; align-items: center; gap: .9rem; }
.qx-continue__text { min-width: 0; }
.qx-continue__text .qx-glass__title { overflow-wrap: anywhere; }
.qx-continue__actions { margin-top: .85rem; }
.qx-continue__count {
  min-width: 1.4rem;
  padding: 0 .4rem;
  border-radius: var(--ip-radius-pill);
  background: rgba(255, 255, 255, .18);
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}
.qx-continue__now {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .6rem;
  margin-top: .9rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .8rem;
  color: rgba(255, 255, 255, .75);
}
.qx-continue__now-label { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .68rem; color: #f1d59a; }
html[lang="ar"] .qx-continue__now-label,
html[lang="ur"] .qx-continue__now-label { letter-spacing: 0; font-size: .8rem; }
.qx-continue__now-ar { font-family: var(--ip-font-quran); font-size: 1.35rem; line-height: 1.2; color: #fff; }
.qx-continue__now-en { font-weight: 600; color: #fff; }

/* ---- Options panel: compact, tabbed ---- */
@media (min-width: 992px) {
  .qrd-sidebar { flex-basis: 292px; width: 292px; padding: .95rem; }
}
.qrd-sb-head { margin-bottom: .75rem; padding-bottom: .7rem; font-size: 1rem; }
.qrd-sb-close { margin-left: 0; margin-inline-start: auto; }
.qrd-live {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .75rem;
  padding: .55rem .7rem;
  border-radius: 14px;
  background:
    radial-gradient(80% 120% at 100% 0%, color-mix(in srgb, var(--ip-saffron-500) 14%, transparent), transparent 70%),
    var(--ip-area-soft);
}
.qrd-live .qx-ring__label { font-size: .74rem; }
.qrd-live__text { display: grid; min-width: 0; line-height: 1.3; }
.qrd-live__text strong { font-size: .88rem; color: var(--ip-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrd-live__text span { font-size: .76rem; color: var(--ip-muted); font-variant-numeric: tabular-nums; }
.qrd-sb-tabs { margin-bottom: .85rem; }
.qrd-sb-tabs [role="tab"] { flex-direction: column; gap: .1rem; min-height: 50px; padding: .35rem .2rem; font-size: .7rem; }
.qrd-sb-tabs [role="tab"] i { font-size: 1.05rem; }
.qrd-sb-tabs [role="tab"]:focus-visible { outline: 2px solid var(--ip-focus); outline-offset: 1px; }
.qrd-sb-section { margin-bottom: 0; }
.qrd-sb-section[hidden] { display: none; }
.qrd-field { margin-bottom: .7rem; }
.qrd-field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0 .6rem; }
.qrd-field-pair .qrd-field { margin-bottom: .7rem; }
.qrd-field-help { margin: .35rem 0 0; font-size: .72rem; color: var(--ip-muted); line-height: 1.45; }
.qrd-index-btn {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 44px;
  margin-bottom: .8rem;
  padding: .45rem .8rem;
  border: 1px dashed color-mix(in srgb, var(--ip-area) 45%, var(--ip-line-strong));
  border-radius: 12px;
  background: var(--ip-area-soft);
  color: var(--ip-area-strong);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s var(--ip-ease), border-color .2s var(--ip-ease);
}
.qrd-index-btn:hover,
.qrd-index-btn:focus-visible { background: var(--ip-area-tint); border-style: solid; }
.qrd-index-btn .qx-kbd { margin-inline-start: auto; }
.qrd-preview {
  margin: .55rem 0 0;
  padding: .35rem .6rem;
  border-radius: 10px;
  background: var(--ip-surface-2);
  font-family: var(--qrd-family, var(--ip-font-quran));
  font-size: min(var(--qrd-font, 30px), 34px);
  line-height: 1.8;
  text-align: center;
  color: var(--ip-ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.qrd-sb-actions { gap: .45rem; }
.qrd-sb-actions .qrd-tf-toggle,
.qrd-sb-actions .qrd-icon-btn { height: 40px; justify-content: flex-start; padding-inline: .8rem; }
.qrd-sb-actions .qrd-icon-btn .qx-kbd { margin-inline-start: auto; }
.qrd-sb-actions .qrd-tf-toggle .qrd-switch { order: 9; margin-inline-start: auto; }
.qrd-sidebar .qx-seg button { font-size: .76rem; min-height: 34px; }
.qrd-sidebar { scrollbar-width: thin; }

/* ---- The slim reading bar over the page ---- */
.qrd-readbar {
  position: sticky;
  top: calc(var(--ip-header-h) + .5rem);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .4rem;
  max-width: 920px;
  margin: 0 auto .85rem;
  padding: .35rem;
  border: 1px solid var(--ip-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--ip-bg-elevated) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--ip-shadow-sm);
}
.qrd-rb-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ip-ink-2);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ip-ease), color .2s var(--ip-ease);
}
.qrd-rb-btn:hover,
.qrd-rb-btn:focus-visible { background: var(--ip-area-soft); color: var(--ip-area-strong); }
.qrd-rb-btn[aria-pressed="true"] { background: var(--ip-area-fill); color: #fff; }
.qrd-rb-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
[dir="rtl"] .qrd-rb-btn .bi-chevron-left,
[dir="rtl"] .qrd-rb-btn .bi-chevron-right { display: inline-block; transform: scaleX(-1); }
.qrd-rb-surah {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  min-height: 38px;
  padding: .2rem .75rem;
  border: 0;
  border-radius: 11px;
  background: var(--ip-surface-2);
  color: var(--ip-ink);
  cursor: pointer;
  transition: background-color .2s var(--ip-ease);
}
.qrd-rb-surah:hover,
.qrd-rb-surah:focus-visible { background: var(--ip-area-soft); }
.qrd-rb-ar { font-family: var(--ip-font-quran); font-size: 1.15rem; line-height: 1; color: var(--ip-area-strong); }
.qrd-rb-en { font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrd-rb-surah .bi-chevron-down { font-size: .75rem; color: var(--ip-muted); }
.qrd-rb-progress { display: grid; gap: .25rem; flex: 1; min-width: 70px; padding-inline: .5rem; }
.qrd-rb-progress > span:first-child { font-size: .72rem; font-weight: 700; color: var(--ip-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrd-rb-progress .qx-bar { height: 4px; }
.qrd-rb-tools { display: flex; gap: .15rem; }
.qrd-ayah-block { scroll-margin-top: calc(var(--ip-header-h) + 5rem); }

/* ---- Verses: words light up under the pointer; the verse being recited glows and its number fills ---- */
.qrd-ayah-arabic .qw:hover { background: color-mix(in srgb, var(--ip-saffron-500) 20%, transparent); box-shadow: 0 0 0 .12em color-mix(in srgb, var(--ip-saffron-500) 20%, transparent); }
.qrd-ayah-badge { position: relative; }
.qrd-ayah-badge > span { position: relative; z-index: 1; }
.qrd-ayah-block.qrd-playing .qrd-ayah-badge,
body.dark .qrd-ayah-block.qrd-playing .qrd-ayah-badge {
  background: conic-gradient(var(--ip-saffron-500) calc(var(--qrd-ap, 0) * 1turn), color-mix(in srgb, var(--ip-saffron-500) 18%, var(--ip-surface)) 0);
  color: var(--ip-ink);
}
.qrd-ayah-block.qrd-playing .qrd-ayah-badge::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--ip-surface);
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}
.qrd-ayah-block.qrd-playing { position: relative; }
.qrd-ayah-block.qrd-playing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 16px 40px -22px rgba(230, 184, 92, .95);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .qrd-ayah-block.qrd-playing::after { animation: qrd-glow 2.4s ease-in-out infinite; }
}
@keyframes qrd-glow {
  50% { opacity: 1; }
}
.qrd-ayah-translit,
.qrd-ayah-translation,
.qrd-ayah-actions,
.qrd-ayah-tafsir-body { margin-left: 0; margin-inline-start: 3.05rem; }
.qrd-ayah-source { display: block; margin-top: .15rem; font-size: .75rem; }
.qrd-source { display: inline-flex; align-items: center; gap: .3rem; }
.qrd-ayah-actions { gap: .35rem; }
.qrd-ayah-btn { height: 32px; padding: 0 .7rem; font-size: .78rem; }
/* Verse tools stay quiet until the verse is hovered or focused, so the page reads as text. */
@media (hover: hover) and (min-width: 768px) {
  .qrd-ayah-actions .qrd-ayah-btn:not(.on):not([aria-expanded="true"]) { opacity: .9; transition: opacity .2s var(--ip-ease), background-color .2s, border-color .2s, color .2s; }
  .qrd-ayah-block:hover .qrd-ayah-btn,
  .qrd-ayah-block:focus-within .qrd-ayah-btn,
  .qrd-ayah-block.qrd-playing .qrd-ayah-btn { opacity: 1; }
}

/* Reveal mode: veiled words, shown on hover or tap. */
.qrd-reveal .qrd-ayah-arabic .qw:not(.is-shown):not(:hover) {
  color: transparent;
  text-shadow: 0 0 .32em color-mix(in srgb, var(--ip-ink) 60%, transparent);
}
.qrd-reveal .qrd-ayah-arabic .qw.is-shown { background: color-mix(in srgb, var(--ip-area) 10%, transparent); }
.qrd-reveal .qrd-ayah-arabic { cursor: help; }

/* ---- Previous / next surah cards ---- */
.qrd-surah-nav { margin-top: 1.6rem; gap: .75rem; }
.qrd-nav-card {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex: 1 1 240px;
  max-width: 420px;
  padding: .75rem .95rem;
  border: 1px solid var(--ip-line);
  border-radius: 16px;
  background: var(--ip-surface);
  color: var(--ip-ink);
  text-decoration: none;
  transition: transform .25s var(--ip-ease), box-shadow .25s var(--ip-ease), border-color .25s;
}
.qrd-nav-card:hover,
.qrd-nav-card:focus-visible { transform: translateY(-2px); box-shadow: var(--ip-shadow-md); border-color: color-mix(in srgb, var(--ip-area) 45%, var(--ip-line)); color: var(--ip-ink); }
.qrd-nav-card small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ip-muted); }
html[lang="ar"] .qrd-nav-card small,
html[lang="ur"] .qrd-nav-card small { letter-spacing: 0; font-size: .8rem; }
.qrd-nav-card strong { font-size: .95rem; }
.qrd-nav-card__ar { margin-inline-start: auto; font-family: var(--ip-font-quran); font-size: 1.4rem; color: var(--ip-area-strong); }
.qrd-nav-card--next { margin-inline-start: auto; text-align: end; }
.qrd-nav-card--next .qrd-nav-card__ar { margin-inline-start: 0; margin-inline-end: auto; }
.qrd-nav-card__arrow { font-size: 1.6rem; color: var(--ip-area-strong); }
[dir="rtl"] .qrd-nav-card__arrow { transform: scaleX(-1); }

/* ---- What next ---- */
.qrd-next { max-width: 920px; margin: 1.75rem auto 0; }

/* ---- Audio bar ---- */
.qrd-ab-options { display: none; }
.qrd-ab-repeat { position: relative; }
.qrd-ab-repeat.on,
body.dark .qrd-ab-repeat.on { background: var(--ip-area-soft); color: var(--ip-area-strong); box-shadow: inset 0 0 0 1.5px var(--ip-area); }
.qrd-ab-repeat-n {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  padding: 0 .25rem;
  border-radius: 9px;
  background: var(--ip-saffron-500);
  color: #2a1c00;
  font-size: .62rem;
  font-weight: 800;
  line-height: 18px;
}
.qrd-ab-repeat-n:empty { display: none; }
.qrd-toast-wrap { z-index: 1200; margin-bottom: 96px; }
/* The audio bar carries an Options button on phones, so the floating one is not needed beside it. */
body:has(#qrdAudioBar) .qrd-sb-fab { display: none !important; }

/* ---- Drawer mirrored for right-to-left ---- */
@media (max-width: 991.98px) {
  .qrd-sidebar { left: auto; inset-inline-start: 0; }
  [dir="rtl"] .qrd-sidebar { transform: translateX(105%); }
  [dir="rtl"] .qrd-sidebar.open { transform: translateX(0); }
  .qrd-ab-options { display: inline-flex; }
}
.qrd-sb-fab { left: auto; }

/* ---- Focus mode ---- */
body.qx-focus .ip-header,
body.qx-focus .ip-footer,
body.qx-focus .qx-hero,
body.qx-focus .qx-areanav,
body.qx-focus .qrd-sidebar,
body.qx-focus .qrd-next,
body.qx-focus .qrd-sb-fab,
body.qx-focus #goTopBtn,
body.qx-focus .qrd-resume { display: none !important; }
body.qx-focus { background-image: radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--ip-saffron-500) 10%, transparent), transparent 70%); }
body.qx-focus .qrd-layout { display: block; max-width: 980px; padding-top: 1.25rem; }
body.qx-focus .qrd-readbar { top: .75rem; }
body.qx-focus .qrd-mushaf { box-shadow: 0 40px 80px -50px rgba(13, 59, 41, .45), var(--ip-shadow-sm); }
body.qx-focus .qrd-ayah-block { scroll-margin-top: 5.5rem; }
.qrd-focus-exit {
  position: fixed;
  z-index: 1035;
  inset-block-start: .9rem;
  inset-inline-end: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border: 1px solid var(--ip-line);
  border-radius: var(--ip-radius-pill);
  background: color-mix(in srgb, var(--ip-bg-elevated) 90%, transparent);
  color: var(--ip-ink-2);
  font-size: .82rem;
  font-weight: 700;
  box-shadow: var(--ip-shadow-md);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.qrd-focus-exit[hidden] { display: none; }
.qrd-focus-exit:hover { color: var(--ip-area-strong); border-color: var(--ip-area); }
@media (max-width: 991.98px) {
  body.qx-focus .qrd-focus-exit { inset-block-start: auto; inset-block-end: 7.5rem; }
}

/* ---- Surah index dialog ---- */
.qx-index {
  width: min(1100px, calc(100% - 2rem));
  max-width: none;
  max-height: min(860px, calc(100vh - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--ip-line);
  border-radius: 24px;
  background: var(--ip-bg);
  color: var(--ip-ink);
  box-shadow: var(--ip-shadow-lg);
  overflow: hidden;
}
.qx-index[open] { display: flex; flex-direction: column; }
.qx-index::backdrop { background: rgba(4, 20, 13, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) {
  .qx-index[open] { animation: qx-index-in .3s var(--ip-ease); }
}
@keyframes qx-index-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
}
.qx-index__head {
  flex-shrink: 0;
  padding: 1rem 1.15rem .85rem;
  color: #fff;
  background: var(--ip-jewel);
}
.qx-index__top { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.qx-index__title { margin: 0; font-size: 1.2rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: .5rem; }
.qx-index__title i { color: #f1d59a; }
.qx-index__close {
  margin-inline-start: auto;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
}
.qx-index__close:hover,
.qx-index__close:focus-visible { background: rgba(255, 255, 255, .2); }
.qx-index__tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
@media (min-width: 768px) {
  .qx-index__tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.qx-index__tools .qx-search input { border-color: transparent; }
.qx-index__filter { background: rgba(255, 255, 255, .1); }
.qx-index__filter button { color: rgba(255, 255, 255, .85); padding-inline: .8rem; }
.qx-index__filter button:hover { color: #fff; }
.qx-index__filter button[aria-pressed="true"] { background: #fff; color: #16624f; }
.qx-index__juz {
  display: flex;
  gap: .3rem;
  align-items: center;
  margin-top: .7rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .1rem;
}
.qx-index__juz::-webkit-scrollbar { display: none; }
.qx-index__juz-label { flex-shrink: 0; margin-inline-end: .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f1d59a; }
.qx-index__juz a {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  padding: 0 .3rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.qx-index__juz a:hover,
.qx-index__juz a:focus-visible { background: #e6b85c; color: #2a1c00; }
.qx-index__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-content: start;
  gap: .5rem;
  margin: 0;
  padding: .9rem 1.15rem 1.15rem;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.qx-index__list li[hidden] { display: none; }
.qx-index__none { margin: 1rem 1.15rem 1.25rem; }
.qx-index__none[hidden] { display: none; }
.qx-surah {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  height: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--ip-line);
  border-radius: 14px;
  background: var(--ip-surface);
  color: var(--ip-ink);
  text-decoration: none;
  transition: border-color .2s var(--ip-ease), box-shadow .2s var(--ip-ease), transform .2s var(--ip-ease);
}
.qx-surah:hover,
.qx-surah:focus-visible { border-color: color-mix(in srgb, var(--ip-area) 50%, var(--ip-line)); box-shadow: var(--ip-shadow-sm); transform: translateY(-1px); color: var(--ip-ink); }
.qx-surah[aria-current="page"] { border-color: var(--ip-area); box-shadow: 0 0 0 3px var(--ip-area-soft); }
.qx-surah__num {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: var(--ip-area-soft);
  color: var(--ip-area-strong);
  font-size: .8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
  transition: transform .35s var(--ip-spring);
}
.qx-surah:hover .qx-surah__num { transform: rotate(22.5deg); }
.qx-surah:hover .qx-surah__num,
.qx-surah[aria-current="page"] .qx-surah__num { background: var(--ip-area-fill); color: #fff; }
.is-done .qx-surah__num { background: var(--ip-saffron-500); color: #2a1c00; }
.qx-surah__main { display: grid; min-width: 0; flex: 1; gap: .05rem; }
.qx-surah__main strong { font-size: .92rem; line-height: 1.25; }
.qx-surah__main small { font-size: .74rem; color: var(--ip-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qx-surah__bar { display: none; height: 3px; margin-top: .3rem; overflow: hidden; border-radius: 3px; background: var(--ip-surface-3); }
.is-started .qx-surah__bar { display: block; }
.qx-surah__bar > span { display: block; height: 100%; background: var(--ip-saffron-500); transform-origin: left center; transform: scaleX(var(--qx-p, 0)); }
[dir="rtl"] .qx-surah__bar > span { transform-origin: right center; }
.qx-surah__side { display: grid; justify-items: end; gap: .1rem; flex-shrink: 0; }
.qx-surah__ar { font-family: var(--ip-font-quran); font-size: 1.3rem; line-height: 1.3; color: var(--ip-area-strong); }
.qx-surah__place { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 600; color: var(--ip-muted); }
.qx-surah__place--meccan i { color: var(--ip-saffron-600); }
.qx-surah__place--medinan i { color: var(--ip-sky-600); }

/* ---- Phones ---- */
@media (max-width: 767.98px) {
  .qrd-rb-progress { display: none; }
  .qrd-rb-surah { flex: 1; justify-content: center; }
  .qrd-readbar { top: calc(var(--ip-header-h) + .25rem); margin-bottom: .6rem; }
  .qrd-ayah-actions .qrd-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .qrd-ayah-btn { width: 38px; height: 38px; padding: 0; justify-content: center; font-size: .95rem; }
  .qrd-ayah-actions { gap: .3rem; }
  .qrd-ab-row { gap: .4rem; }
  .qrd-ab-stop,
  .qrd-ab-info .qrd-ab-badge { display: none; }
  .qrd-ab-btn { width: 40px; height: 40px; }
  .qrd-ab-btn.qrd-ab-play,
  body.dark .qrd-ab-btn.qrd-ab-play { width: 48px; height: 48px; }
  .qrd-ab-sub { display: none; }
  .qrd-ab-title { font-size: .8rem; }
  .qrd-toast-wrap { margin-bottom: 84px; }
  .qrd-nav-card { max-width: none; }
  .qrd-nav-card--next { margin-inline-start: 0; }
}
@media (max-width: 575.98px) {
  .qrd-ayah-translit,
  .qrd-ayah-translation,
  .qrd-ayah-actions,
  .qrd-ayah-tafsir-body { margin-inline-start: 0; }
  .qrd-ab-toggle { display: none; }
  .qx-continue__row { gap: .7rem; }
  .qx-index { width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .qx-index__list { padding-inline: .75rem; }
}
@media print {
  .qrd-readbar,
  .qrd-focus-exit,
  .qrd-sidebar,
  .qrd-audiobar,
  .qrd-sb-fab { display: none !important; }
}
body.qx-focus.ip-body { background-image: none; }
body.qx-focus .qrd-layout::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(70% 45% at 50% 0%, color-mix(in srgb, var(--ip-saffron-500) 12%, transparent), transparent 70%);
}
@media (max-width: 575.98px) {
  .qx-continue__now { display: none; }
  .qx-continue .qx-ring { --qx-ring-size: 56px !important; }
  .qx-continue__actions { margin-top: .65rem; }
  .qx-hero--reader .qx-actions [data-qx-focus] { display: none; }
}
.qrd-rb-en,
.qrd-live__text strong,
.qx-continue__text .qx-glass__title { unicode-bidi: plaintext; }
@media (max-width: 575.98px) {
  .qrd-rb-en { display: none; }
  .qrd-rb-ar { font-size: 1.3rem; }
}

/* ===== Translations (Pickthall · Mufti Taqi Usmani English · Aasan Tarjuma Urdu) and Ma'arif al-Qur'an ===== */
.qrd-tr-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem;
  margin: .2rem auto 1rem;
  padding: .3rem;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--ip-radius-pill, 999px);
  background: var(--ip-surface-2);
  box-shadow: inset 0 0 0 1px var(--ip-line);
}
.qrd-tr-strip button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 36px;
  padding: .25rem .85rem .25rem .3rem;
  border: 0;
  border-radius: var(--ip-radius-pill, 999px);
  background: transparent;
  color: var(--ip-muted);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.qrd-tr-strip button:hover { color: var(--ip-ink); }
.qrd-tr-strip button:focus-visible { outline: 2px solid var(--ip-area); outline-offset: 2px; }
.qrd-tr-strip button[aria-pressed="true"] { background: var(--ip-surface); color: var(--ip-area-strong); box-shadow: var(--ip-shadow-sm, 0 2px 6px rgba(0, 0, 0, .08)); }
.qrd-tr-strip__badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 .35rem;
  border-radius: 50%;
  background: var(--ip-area-soft);
  color: var(--ip-area-strong);
  font-size: .66rem;
  letter-spacing: .04em;
}
.qrd-tr-strip button[aria-pressed="true"] .qrd-tr-strip__badge { background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill)); color: #fff; }
.qrd-tr-strip__badge:lang(ur),
.qrd-tr-strip__name:lang(ur),
.qrd-tr-opt[data-lang="ur"] .qrd-tr-opt__badge { font-family: var(--ip-font-urdu); font-weight: 400; }
.qrd-tr-strip__name:lang(ur) { font-size: 1rem; line-height: 1.2; }

.qrd-tr-pick { border: 0; padding: 0; margin: 0 0 .9rem; min-width: 0; }
.qrd-tr-pick legend { float: none; width: auto; margin-bottom: .45rem; }
.qrd-tr-opt {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .6rem;
  margin-bottom: .4rem;
  padding: .55rem .7rem;
  border-radius: 14px;
  background: var(--ip-surface);
  box-shadow: inset 0 0 0 1px var(--ip-line);
  cursor: pointer;
  transition: box-shadow .2s, background .2s;
}
.qrd-tr-opt:hover { box-shadow: inset 0 0 0 1px var(--ip-area); }
.qrd-tr-opt input { position: absolute; opacity: 0; pointer-events: none; }
.qrd-tr-opt:has(input:focus-visible) { outline: 2px solid var(--ip-area); outline-offset: 2px; }
.qrd-tr-opt:has(input:checked) { background: var(--ip-area-soft); box-shadow: inset 0 0 0 2px var(--ip-area); }
.qrd-tr-opt__badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ip-surface-2);
  color: var(--ip-area-strong);
  font-size: .7rem;
  font-weight: 800;
}
.qrd-tr-opt:has(input:checked) .qrd-tr-opt__badge { background: linear-gradient(140deg, var(--ip-area), var(--ip-area-fill)); color: #fff; }
.qrd-tr-opt__text { display: flex; flex-direction: column; min-width: 0; }
.qrd-tr-opt__text strong { font-size: .86rem; color: var(--ip-ink); }
.qrd-tr-opt__text small { font-size: .74rem; color: var(--ip-muted); overflow-wrap: anywhere; }
.qrd-tr-opt__tick { color: var(--ip-area); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.qrd-tr-opt:has(input:checked) .qrd-tr-opt__tick { opacity: 1; transform: none; }

/* Mufti Taqi Usmani's Urdu translation: right to left, in the site's Nastaleeq. */
.qrd-ayah-translation.qrd-tr-ur,
body.dark .qrd-ayah-translation.qrd-tr-ur {
  font-family: var(--ip-font-urdu);
  font-size: 1.32rem;
  line-height: 2.35;
  text-align: start;
  margin-inline: 0 3.05rem;
}
:root[dir="rtl"] .qrd-ayah-translation.qrd-tr-ur { margin-inline: 3.05rem 0; }
.qrd-tr-loading .qrd-ayah-translation { opacity: .4; transition: opacity .2s; }
.qrd-tr-loading #qrdTranslationStrip { cursor: progress; }
.qrd-source cite { font-style: normal; font-weight: 600; }

/* The one commentary, named in the Study tab and the companion panel. */
.qrd-tf-work {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ip-violet-50), var(--ip-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ip-violet-500) 35%, transparent);
}
body.dark .qrd-tf-work { background: rgba(164, 139, 255, .1); }
.qrd-tf-work__ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ip-violet-600); color: #fff; }
.qrd-tf-work__text { display: flex; flex-direction: column; min-width: 0; }
.qrd-tf-work__text strong { font-size: .86rem; color: var(--ip-ink); }
.qrd-tf-work__text small { font-size: .72rem; color: var(--ip-muted); }
.qrd-tf-work__ur { font-family: var(--ip-font-urdu); font-size: 1.15rem; color: var(--ip-violet-600); }
body.dark .qrd-tf-work__ur { color: #c4b1f9; }
.qrd-tf-edition--one { display: flex; align-items: center; gap: .4rem; cursor: default; }
.qrd-tf-aya-badge--range { width: auto; min-width: 26px; padding: 0 .45rem; }

/* A Ma'arif al-Qur'an passage under a verse. */
.qrd-maarif { font-size: .98rem; line-height: 1.75; }
.qrd-maarif__range {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .6rem;
  padding: .2rem .7rem;
  border-radius: var(--ip-radius-pill, 999px);
  background: var(--ip-violet-600);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
}
/* A long passage scrolls inside its box, so the verses after it stay close. */
.qrd-maarif__text { max-height: min(30rem, 68vh); overflow-y: auto; padding-inline-end: .5rem; overscroll-behavior: contain; scrollbar-width: thin; }
.qrd-maarif__text p { margin: 0 0 .7rem; }
.qrd-maarif__text ul,
.qrd-maarif__text ol { padding-inline-start: 1.3rem; margin-bottom: .7rem; }
.qrd-maarif__ar,
.qrd-maarif [lang="ar"] { font-family: var(--ip-font-quran); font-size: 1.35rem; line-height: 2.1; text-align: start; color: var(--ip-ink); }
.qrd-maarif__src { margin: .4rem 0 0; padding-top: .5rem; border-top: 1px dashed color-mix(in srgb, var(--ip-violet-500) 40%, transparent); font-size: .74rem; color: var(--ip-muted); }
.qrd-maarif__src i { color: var(--ip-violet-600); }
.qrd-maarif__see { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; font-size: .88rem; }
.qrd-maarif__see a { font-weight: 700; color: var(--ip-violet-700); }
body.dark .qrd-maarif__see a { color: #c4b1f9; }
.qrd-maarif__state { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--ip-muted); font-size: .88rem; }
.qrd-maarif__state--error { color: var(--ip-coral-700); }
.qrd-tf-body .qrd-maarif__src { margin-top: 1rem; }
/* The companion panel follows the dark theme (Bootstrap's offcanvas would stay white). */
body.dark .qrd-tf-panel,
body.dark .qrd-tf-body { background: var(--ip-surface); color: var(--ip-ink); }
.qrd-tf-body .qrd-maarif__state { padding: 1rem 0; }
@media (max-width: 575.98px) {
  .qrd-tr-strip { width: 100%; justify-content: space-between; }
  .qrd-tr-strip button { flex: 1 1 0; justify-content: center; padding-inline: .3rem .55rem; }
  .qrd-ayah-translation.qrd-tr-ur { margin-inline: 0; font-size: 1.22rem; }
}
@media (prefers-reduced-motion: reduce) {
  .qrd-tr-strip button,
  .qrd-tr-opt,
  .qrd-tr-opt__tick,
  .qrd-tr-loading .qrd-ayah-translation { transition: none; }
}
