/* ============================================================
   QURAN PAGE - Al Muslim professional reader layout
   ============================================================ */

/* Same Uthmanic OTF Al Muslims uses - weight 700 = bold mushaf look */
@font-face{
  font-family: "UthmanicHafs";
  src: url("/public/fonts/uthmanic.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "AlQuranArabic";
  src: url("/public/fonts/alquran.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

body.quran-page{
  --qn-brown: #3C2415;
  --qn-mid: #6E4A36;
  --qn-gold: #C9A24A;
  --qn-cream: #F7F1E6;
  --qn-paper: #FFFCF7;
  --qn-line: #E6D9C4;
  --qn-muted: #7A6A58;
  --qn-ar-size: 40px;
  --qn-en-size: 16px;
  --qn-ar-leading: 1.55;
  --qn-ar-font: "UthmanicHafs", "Traditional Arabic", "Noto Naskh Arabic", serif;
  background: #F7F1E6;
  max-width: 100%;
  overflow-x: clip;
}
body.quran-page .app{
  min-height: 0;
  max-width: 100%;
  overflow-x: clip;
}
body.quran-page .qn-main{
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
  box-sizing: border-box;
  overflow-x: clip;
}
body.quran-page .qn-main > *:not(.qn-hero){
  width: 100%;
  max-width: min(1280px, 100%);
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 28px);
  box-sizing: border-box;
  min-width: 0;
}
body.quran-page .qn-main > .qn-hero{
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 0;
}

/* ---------- Breadcrumb + page intro (SEO) ---------- */
.qn-breadcrumb{
  padding-top: 4px;
  padding-bottom: 0;
}
.qn-breadcrumb-list{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.45;
}
.qn-breadcrumb-list li{
  display: flex;
  align-items: center;
  color: #9A8A7A;
}
.qn-breadcrumb-list li + li::before{
  content: "/";
  margin: 0 8px;
  color: #B8A898;
  font-weight: 400;
}
.qn-breadcrumb-list a{
  color: #9A8A7A;
  text-decoration: none;
  font-weight: 500;
  transition: color .12s;
}
.qn-breadcrumb-list a:hover{ color: #3C2415; }
.qn-breadcrumb-list [aria-current="page"]{
  color: #1A1D21;
  font-weight: 700;
}

.qn-page-intro h1{
  margin: 0 0 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  color: #3C2415;
}
.qn-page-intro p{
  margin: 0;
  max-width: 62ch;
  color: #6E5A4A;
  font-size: 15px;
  line-height: 1.55;
}

body.quran-page .qn-hero{
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: clamp(360px, 40vw, 480px);
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: #FFFCF7;
  box-sizing: border-box;
}
.qn-hero-visual{ position: absolute; inset: 0; }
.qn-hero-visual picture,
.qn-hero-visual img{
  width: 100%;
  height: 100%;
  display: block;
}
.qn-hero-visual img{
  object-fit: cover;
  object-position: 72% 58%;
  transform: none;
  filter: none;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.qn-hero-visual::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,252,247,.72) 0%, rgba(255,252,247,.28) 38%, transparent 64%);
  pointer-events: none;
}
.qn-hero-stage{
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 480px;
  padding: 108px clamp(20px, 4vw, 44px) 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}
.qn-hero-card{
  position: relative;
  width: min(560px, 92%);
  max-width: 100%;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  color: #3C2415;
  box-sizing: border-box;
}
.qn-hero-card::before{ display: none; }
.qn-hero-card h1{
  margin: 0 0 12px;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(2rem, 4.6vw, 3.15rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #3C2415;
  text-shadow: none;
  max-width: 14ch;
}
.qn-hero-card h1 span{ color: #A67C2A; }
.qn-hero-lead{
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  color: #3C2415;
  max-width: 42ch;
  text-shadow: none;
}
.qn-hero-feats{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.qn-hero-feats li{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #FFFCF7;
  font-size: 13.5px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(28,20,16,.35);
}
.qn-hero-feat-ico{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #E8C56A;
  background: rgba(42,26,16,.55);
  border: 1px solid rgba(232,197,106,.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.qn-hero-feat-ico svg{ width: 15px; height: 15px; display: block; }
.qn-hero-feats{ display: none !important; }
.qn-hero-start.qn-btn-gold{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  text-decoration: none;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(166,124,42,.38);
}
.qn-hero-quote,
.qn-hero-quote-ref{ display: none; }

body.quran-page:not(.qn-reading){
  padding-top: 0 !important;
}
body.quran-page:not(.qn-reading) .site-header{
  border-bottom: none !important;
  box-shadow: none !important;
}
body.quran-page:not(.qn-reading) .qn-hero{
  margin-top: 0;
}
body.quran-page:not(.qn-reading) .site-breadcrumb{
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 5;
  margin: var(--header-h, 72px) 0 0 !important;
  padding: 10px var(--page-pad-x, clamp(16px, 3vw, 32px)) !important;
  background: var(--crumb-bg, #F3E9D8) !important;
  border: none !important;
  border-bottom: 1px solid rgba(60, 36, 21, 0.12) !important;
  box-shadow: none !important;
  outline: 0;
  text-align: start !important;
}
body.quran-page:not(.qn-reading) .site-breadcrumb-list{
  color: #3C2415;
  text-shadow: none;
  justify-content: flex-start !important;
  margin: 0 !important;
  text-align: start !important;
}
body.quran-page:not(.qn-reading) .site-breadcrumb-list a{
  color: #3C2415;
}
body.quran-page:not(.qn-reading) .site-breadcrumb-list a:hover{
  color: #111111;
}
body.quran-page:not(.qn-reading) .site-breadcrumb-list [aria-current="page"]{
  color: #111111;
}
body.quran-page:not(.qn-reading) .site-breadcrumb-list li + li::before{
  color: #6E5A4A;
}
.qn-kicker{
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #C9A24A;
}

.qn-daily{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 22px 20px 20px !important;
  border-radius: 18px;
  background: linear-gradient(180deg, #F3E9D8 0%, #EFE3CD 100%);
  border: 1px solid rgba(201,162,74,.28);
  cursor: pointer;
}
.qn-daily .qn-daily-actions{ cursor: default; }
.qn-daily-kicker{
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #A67C2A;
}
.qn-daily-ar{
  margin: 4px 0 0;
  font-family: var(--qn-ar-font);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: #3C2415;
  line-height: 1.7;
}
.qn-daily-en{
  margin: 0;
  font-size: 14.5px;
  color: #6E5A4A;
  line-height: 1.5;
}
.qn-daily-ref{
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: #9A8A7A;
}
.qn-daily-actions{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.qn-daily-btn{
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  border: 1.5px solid rgba(60,36,21,.55);
  background: #fff;
  color: #3C2415;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.qn-daily-btn svg{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.qn-daily-btn:hover{
  border-color: #C9A24A;
  background: #FFFCF7;
}
.qn-daily-btn.is-on{
  background: linear-gradient(180deg, #FFF8E7, #F5E6A8);
  border-color: #C9A24A;
  color: #3C2415;
  box-shadow: 0 4px 12px rgba(166,124,42,.18);
}
.qn-daily-btn.is-on svg path{
  fill: currentColor;
}
.qn-daily-btn.is-done{
  border-color: #A67C2A;
  background: #FFF8E7;
}
.qn-btn-gold,
.qn-btn-ghost,
.qn-chip{
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 14.5px;
  border-radius: 999px;
  padding: 13px 24px;
  min-height: 48px;
  transition: transform .18s, background .18s, border-color .18s, box-shadow .18s;
}
.qn-btn-gold{
  background: linear-gradient(180deg, #E8C56A, #D4A84A);
  color: #3C2415;
  box-shadow: 0 10px 24px rgba(201,162,74,.35);
}
.qn-btn-gold:hover{ transform: translateY(-1px); box-shadow: 0 12px 28px rgba(201,162,74,.42); }
.qn-btn-ghost{
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.65);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.qn-btn-ghost:hover{ border-color: #E8C56A; color: #E8C56A; background: rgba(42,24,16,.35); }

/* ---------- Last read / continue ---------- */
.qn-last-read{
  width: 100%;
  max-width: 100%;
  margin: -8px auto 8px;
  box-sizing: border-box;
}
.qn-last-read[hidden]{ display: none !important; }
.qn-last-read-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(201, 162, 74, 0.5);
  background: linear-gradient(135deg, #3C2415 0%, #2A1A10 100%);
  box-shadow: 0 6px 18px rgba(60, 36, 21, 0.18);
}
.qn-last-read-ayah{
  flex-shrink: 0;
  width: 58px;
  min-height: 58px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(232, 197, 106, 0.16);
  border: 1px solid rgba(232, 197, 106, 0.45);
  color: #E8C56A;
}
.qn-last-read-ayah-label{
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(232, 197, 106, 0.85);
}
.qn-last-read-ayah strong{
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  color: #FCF9F1;
  font-variant-numeric: tabular-nums;
}
.qn-last-read-copy{
  min-width: 0;
  flex: 1 1 auto;
}
.qn-last-read-kicker{
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #E8C56A;
}
.qn-last-read-title{
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  color: #FCF9F1;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qn-last-read-meta{
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 650;
  color: rgba(252, 249, 241, 0.88);
}
.qn-last-read-btn{
  flex-shrink: 0;
  padding: 10px 18px;
  font-size: 13px;
}
@media (max-width: 560px){
  .qn-last-read{ width: 100%; margin-top: 0; }
  .qn-last-read-inner{ padding: 12px 14px; gap: 12px; }
  .qn-last-read-ayah{ width: 52px; min-height: 52px; }
  .qn-last-read-ayah strong{ font-size: 20px; }
  .qn-last-read-title{ font-size: 15px; white-space: normal; }
}

/* ---------- Browse tiles on hero bottom ---------- */
.qn-arches{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  align-items: stretch;
}
.qn-hero .qn-arches{
  z-index: 3;
  width: calc(100% - 32px);
  max-width: min(1280px, 96vw);
  margin: 0 auto 24px;
  flex: 0 0 auto;
  align-self: center;
}
.qn-arches::after{ display: none; }
.qn-arch{
  appearance: none;
  border: 1.5px solid rgba(201,162,74,.4);
  text-align: center;
  background: linear-gradient(165deg, #FFFCF7 0%, #FFF8EE 55%, #F5E6C8 100%);
  color: #3C2415;
  border-radius: 18px;
  padding: 16px 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 118px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 10px 26px rgba(20,12,8,.22);
  transition: transform .18s ease, box-shadow .18s ease;
  transform: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.qn-arch::before{
  content: "";
  position: absolute;
  left: 14px; right: 14px; top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #E8C56A, #C9A24A);
}
.qn-arch:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(20,12,8,.28);
}
.qn-arch strong{
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}
.qn-arch > span:last-child{
  font-size: 12px;
  color: #6E4A36;
  line-height: 1.3;
  font-weight: 600;
}
.qn-arch-icon{
  width: 56px; height: 56px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: 0 6px 14px rgba(60,36,21,.16);
  display: grid; place-items: center;
  margin: 2px 0 6px;
  color: #3C2415;
  flex-shrink: 0;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
  position: relative;
}
.qn-arch-icon img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 2px 6px rgba(60,36,21,.12));
}
.qn-arch#qnBrowseBookmarks .qn-arch-icon img{
  width: 100% !important;
  height: 100% !important;
}
.qn-arch-juz{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #3C2415;
}
.qn-arch-feature{
  grid-column: auto;
  background: linear-gradient(160deg, #E8C56A 0%, #C9A24A 42%, #A67C2A 100%);
  color: #FFFCF7;
  justify-content: center;
  padding: 14px 12px;
  border-color: rgba(255,252,247,.25);
  box-shadow: 0 12px 28px rgba(166,124,42,.4);
  min-height: 118px;
}
.qn-arch-feature::before{ height: 0; }
.qn-arch-feature:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(166,124,42,.48);
}

.qn-flash{
  outline: 2px solid #C9A24A;
  outline-offset: 4px;
  transition: outline-color .3s;
}
.qn-juz-box.qn-flash{
  border-radius: 12px;
  background: #FFF8EC;
}
.qn-arch-mark{
  font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", "Arabic Typesetting", serif;
  font-size: 16px;
  color: #FFF8EC;
  line-height: 1;
}
.qn-arch-ar{
  font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", "Arabic Typesetting", serif;
  font-size: 15px;
  line-height: 1.4;
  margin: 4px 0 4px;
  color: #FFFCF7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qn-arch-en{
  font-size: 11px;
  color: rgba(255,252,247,.92);
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qn-arch-feature strong{
  color: #FFF8EC;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* ---------- Explorer ---------- */
.qn-explorer{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.qn-search{
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--qn-line);
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 8px 20px rgba(60,36,21,.06);
  color: #6E4A36;
}
.qn-search svg{ width: 20px; height: 20px; flex-shrink: 0; }
.qn-search input{
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: #3C2415;
  outline: none;
}
.qn-explorer-actions{ display: flex; flex-wrap: wrap; gap: 8px; }
.qn-chip{
  background: #fff;
  border: 1px solid var(--qn-line);
  color: #3C2415;
  padding: 10px 16px;
}
.qn-chip:hover{ border-color: var(--qn-gold); color: #6E4A36; }
.qn-chip.is-on{
  background: linear-gradient(160deg, #E8C56A, #C9A24A 60%, #A67C2A);
  border-color: #C9A24A;
  color: #3C2415;
}

/* ---------- Index layout ---------- */
.qn-index-wrap{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
/* Reading Preferences card removed from layout - keep selects in DOM for JS */
.qn-options{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  display: block !important;
  visibility: hidden !important;
  pointer-events: none !important;
  background: none !important;
  box-shadow: none !important;
}
.qn-options-head{
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid rgba(201,162,74,.28);
  padding-bottom: 14px;
}
.qn-options-kicker{
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--qn-gold);
}
.qn-options-lead{
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--qn-muted);
  line-height: 1.45;
}
.qn-pref-fields{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qn-pref-field,
.qn-options label{
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 750;
  color: #6E4A36;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.qn-select{
  appearance: none;
  border: 1.5px solid rgba(201,162,74,.32);
  background: #FFFCF7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E4A36' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 14px no-repeat;
  border-radius: 14px;
  padding: 12px 36px 12px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  color: #3C2415;
  box-shadow: 0 1px 0 rgba(255,255,255,.85) inset, 0 4px 10px rgba(166,124,42,.05);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.qn-select:hover{
  border-color: rgba(201,162,74,.7);
}
.qn-select:focus{
  outline: none;
  border-color: #C9A24A;
  box-shadow: 0 0 0 3px rgba(201,162,74,.22);
}
.qn-juz-box{
  margin-top: 2px;
  padding: 14px 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(165deg, #FFFFFF 0%, #FFF8EC 100%);
  border: 1.5px solid rgba(201,162,74,.35);
  box-shadow: 0 6px 18px rgba(166,124,42,.08);
}
.qn-juz-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
}
.qn-juz-title{
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.qn-juz-title p,
.qn-juz-head p{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #3C2415;
  letter-spacing: .01em;
}
.qn-juz-meta{
  font-size: 11px;
  font-weight: 650;
  color: var(--qn-muted);
  letter-spacing: .04em;
}
.qn-clear-filters{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(201,162,74,.4);
  background: #FFFCF7;
  color: #6E4A36;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.qn-clear-filters:hover{
  border-color: #C9A24A;
  background: linear-gradient(180deg, #FFE9B8, #F0D48A);
  color: #3C2415;
  transform: translateY(-1px);
}
.qn-juz-box p{
  margin: 4px 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #4A3224;
}
.qn-juz-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.qn-juz-grid button{
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(201,162,74,.26);
  background: linear-gradient(165deg, #FFFFFF, #FFF9EF);
  border-radius: 50%;
  padding: 0;
  min-height: 42px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #5C4332;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.95) inset, 0 3px 8px rgba(166,124,42,.06);
  transition: transform .15s ease, border-color .15s, background .15s, box-shadow .15s, color .15s;
}
.qn-juz-grid button:hover{
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(201,162,74,.8);
  color: #3C2415;
  box-shadow: 0 8px 16px rgba(166,124,42,.16);
}
.qn-juz-grid button:focus-visible{
  outline: 2px solid #C9A24A;
  outline-offset: 2px;
}
.qn-juz-grid button.is-on{
  background: linear-gradient(160deg, #E8C56A 0%, #C9A24A 55%, #A67C2A 100%);
  border-color: #8B6914;
  color: #2A1810;
  box-shadow:
    0 1px 0 rgba(255,255,255,.4) inset,
    0 0 0 3px rgba(201,162,74,.25),
    0 10px 18px rgba(166,124,42,.3);
  transform: none;
}
.qn-juz-grid button.is-on:hover{
  transform: none;
  filter: brightness(1.05);
}

.qn-table-panel,
.qn-browse-panel{
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: auto;
  max-height: none;
  gap: 16px;
}
.qn-browse-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.qn-result-meta--bar{
  margin: 0;
  align-self: flex-start;
}
.qn-sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.qn-mode-tabs,
.qn-type-tabs{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}
.qn-mode-tab,
.qn-type-tab{
  appearance: none;
  border: 1px solid rgba(201,162,74,.35);
  background: #FFFCF7;
  color: var(--qn-mid);
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}
.qn-mode-tab:hover,
.qn-type-tab:hover{
  background: #FFF8EC;
  color: var(--qn-brown);
  border-color: rgba(201,162,74,.55);
}
.qn-mode-tab.is-on{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
  box-shadow: 0 6px 16px rgba(60,36,21,.16);
}
.qn-type-tab.is-on{
  background: #FFF8EC;
  border-color: var(--qn-gold);
  color: var(--qn-brown);
  box-shadow: none;
}
.qn-type-tabs[hidden]{ display: none !important; }
.qn-para-panel{
  padding: 4px 0 8px;
}
.qn-para-panel[hidden]{ display: none !important; }
.qn-para-grid{
  margin-top: 4px;
}
.qn-pcard{
  gap: 18px;
  min-height: 168px;
}
.qn-pcard .qn-scard-top{
  align-items: center;
  flex: 1 1 auto;
}
.qn-pcard .qn-scard-titles{ flex: 1 1 auto; }
.qn-pcard .qn-scard-ar{
  margin: 0 0 0 auto;
  text-align: right;
  font-size: clamp(24px, 2.4vw, 30px);
  color: var(--qn-gold);
  line-height: 1.2;
  flex-shrink: 0;
}
.qn-juz-box--inline{
  margin: 0;
  box-shadow: 0 10px 28px rgba(166,124,42,.08);
}

/* Surah / Para card grid - mock layout, site colors + scroll */
.qn-browse-scroll{
  flex: 1 1 auto;
  min-height: 280px;
  height: clamp(420px, 62vh, 720px);
  max-height: clamp(420px, 62vh, 720px);
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  outline: none;
  -webkit-overflow-scrolling: touch;
  border: 1.5px solid rgba(201, 162, 74, 0.28);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 252, 247, 0.9);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #C9A24A #F3E9D8;
}
.qn-browse-scroll:focus-visible{
  box-shadow: 0 0 0 2px rgba(201, 162, 74, 0.45);
}
.qn-browse-scroll::-webkit-scrollbar{ width: 10px; }
.qn-browse-scroll::-webkit-scrollbar-track{
  background: #F3E9D8;
  border-radius: 99px;
  margin: 6px 0;
}
.qn-browse-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, #E8C56A, #C9A24A 55%, #A67C2A);
  border-radius: 99px;
  border: 2px solid #F3E9D8;
  min-height: 48px;
}
.qn-browse-scroll::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, #E8C56A, #A67C2A);
}
.qn-surah-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.qn-surah-grid[hidden]{ display: none !important; }
.qn-scard{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: #FFFCF7;
  border: 1px solid rgba(201,162,74,.32);
  box-shadow: 0 8px 22px rgba(166,124,42,.07);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.qn-scard:hover,
.qn-scard:focus-visible,
.qn-scard.is-selected{
  transform: translateY(-2px);
  border-color: rgba(201,162,74,.55);
  box-shadow: 0 14px 28px rgba(166,124,42,.12);
  outline: none;
}
.qn-scard-top{
  display: flex;
  align-items: center;
  gap: 12px;
}
.qn-scard-num{
  flex-shrink: 0;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #F3E9D8;
  color: var(--qn-brown);
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.qn-scard-titles{
  min-width: 0;
  flex: 1 1 auto;
}
.qn-scard-en{
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #2A1A10;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.qn-scard-sub{
  margin: 3px 0 0;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--qn-muted);
}
.qn-scard-ar{
  margin: 0 0 0 auto;
  flex-shrink: 0;
  text-align: right;
  font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 500;
  color: var(--qn-gold);
  line-height: 1.2;
  direction: rtl;
}
.qn-scard-meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.qn-scard-ayahs{
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--qn-muted);
  white-space: nowrap;
}
.qn-scard-read{
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: #8B5E3C;
  color: #FCF9F1;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0;
  pointer-events: none;
}
.qn-scard-read:hover{
  background: #9A6B47;
  filter: none;
}
.qn-type{
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}
.qn-type.makki{
  background: #FFF1D6;
  color: #6E4A36;
  border: 1px solid rgba(201,162,74,.4);
}
.qn-type.madani{
  background: #F3E9D8;
  color: #3C2415;
  border: 1px solid rgba(166,124,42,.28);
}
@media (max-width: 980px){
  .qn-surah-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qn-browse-scroll{
    height: clamp(360px, 58vh, 640px);
    max-height: clamp(360px, 58vh, 640px);
  }
}
@media (max-width: 600px){
  .qn-surah-grid{ grid-template-columns: 1fr; }
  .qn-browse-bar{ gap: 10px; }
  .qn-mode-tab,
  .qn-type-tab{ padding: 8px 14px; font-size: 12.5px; }
  .qn-browse-scroll{
    height: clamp(320px, 55vh, 560px);
    max-height: clamp(320px, 55vh, 560px);
    padding: 10px;
  }
  .qn-scard-ar{ font-size: 26px; }
}
.qn-result-meta{
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(201,162,74,.14);
  border: 1px solid rgba(201,162,74,.28);
  font-size: 12.5px;
  font-weight: 650;
  color: #6E4A36;
}
.qn-table-scroll{
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  outline: none;
  -webkit-overflow-scrolling: touch;
  border: 1.5px solid rgba(201, 162, 74, 0.28);
  border-radius: 14px;
  margin: 0 14px 14px;
  background: rgba(255, 252, 247, 0.82);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #C9A24A #F3E9D8;
}
.qn-table-scroll::-webkit-scrollbar{ width: 10px; }
.qn-table-scroll::-webkit-scrollbar-track{
  background: #F3E9D8;
  border-radius: 99px;
  margin: 6px 0;
}
.qn-table-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, #E8C56A, #C9A24A 55%, #A67C2A);
  border-radius: 99px;
  border: 2px solid #F3E9D8;
  min-height: 48px;
}
.qn-table-scroll::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, #E8C56A, #A67C2A);
}
.qn-table-scroll:focus-visible{
  box-shadow: 0 0 0 2px rgba(201, 162, 74, 0.45);
}
.qn-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.qn-table th{
  position: sticky; top: 0;
  background: linear-gradient(180deg, #FBF4E6, #F3E9D8);
  color: #6E4A36;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(201,162,74,.35);
  z-index: 1;
}
.qn-table td{
  padding: 14px;
  border-bottom: 1px solid rgba(240,230,214,.9);
  color: #3C2415;
  vertical-align: middle;
}
.qn-table tr:hover td{
  background: rgba(255,248,236,.85);
}
.qn-num{
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: linear-gradient(160deg, #E8C56A, #C9A24A 60%, #A67C2A);
  color: #2A1810;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(166,124,42,.22);
}
.qn-name{ font-family: Inter, system-ui, sans-serif; font-weight: 700; }
.qn-name-en{ display: block; font-size: 14.5px; color: #3C2415; }
.qn-name-ar,
.qn-name-meta{ display: none; }
.qn-surah-row{ cursor: pointer; }
.qn-surah-row.is-selected td{
  background: rgba(201,162,74,.14);
}
.qn-ar{
  font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", "Arabic Typesetting", serif;
  font-size: 22px;
  color: #A67C2A;
  direction: rtl;
  font-weight: 600;
}
.qn-ayahs{
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #6E4A36;
}
.qn-type{
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .02em;
}
.qn-type.makki{
  background: linear-gradient(180deg, #FFF1D6, #F3E0B8);
  color: #6E4A36;
  border: 1px solid rgba(201,162,74,.4);
}
.qn-type.madani{
  background: linear-gradient(180deg, #F7F1E6, #E8D9B8);
  color: #3C2415;
  border: 1px solid rgba(166,124,42,.28);
}
.qn-row-actions{ display: flex; gap: 8px; justify-content: flex-start; }
.qn-row-actions button{
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1.5px solid rgba(201,162,74,.35);
  background: linear-gradient(165deg, #FFFFFF, #FFF8EC);
  cursor: pointer;
  color: #6E4A36;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: transform .15s, border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.qn-row-actions button svg{
  width: 16px;
  height: 16px;
  display: block;
}
.qn-row-actions button:hover{
  border-color: #C9A24A;
  background: linear-gradient(160deg, #E8C56A, #C9A24A);
  color: #2A1810;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(166,124,42,.2);
}
.qn-row-actions button.is-on{
  background: linear-gradient(160deg, #E8C56A, #C9A24A);
  border-color: #A67C2A;
  color: #2A1810;
}

/* ---------- Sections ---------- */
.qn-section-head{
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.qn-section-kicker{
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #C9A24A;
}
.qn-section-head h2{
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(24px, 2.6vw, 30px);
  color: #3C2415;
  letter-spacing: -0.02em;
}
.qn-section-head p{
  margin: 8px 0 0;
  color: var(--qn-muted);
  font-size: 14.5px;
  max-width: 46ch;
  line-height: 1.5;
}

.qn-subjects,
.qn-bookmarks,
.qn-resources,
.qn-related-tools,
.qn-seo-faq,
#surah-index,
#juz,
#options,
#index,
#search{
  scroll-margin-top: 100px;
}

/* Related faith tools */
.qn-related-tools{
  margin: 8px clamp(12px, 3vw, 28px) 0;
  padding: 22px 24px;
  border-radius: 16px;
  background: linear-gradient(165deg, #FFF9EE 0%, #F3E9D8 100%);
  border: 1px solid rgba(201,162,74,.35);
  width: auto;
  max-width: min(1280px, 100%);
  box-sizing: border-box;
}
.qn-related-tools h2{
  margin: 0 0 8px;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 750;
  color: var(--qn-brown);
  letter-spacing: -0.02em;
}
.qn-related-tools > p{
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--qn-muted);
  max-width: 62ch;
}
.qn-related-tools ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qn-related-tools a{
  color: var(--qn-mid);
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.qn-related-tools a:hover{
  color: var(--qn-brown);
  border-bottom-color: rgba(201,162,74,.55);
}

/* FAQ card - accordion */
.qn-seo-faq{
  margin: 4px 0 0;
}
.qn-faq-card{
  background: var(--qn-paper);
  border: 1px solid var(--qn-line);
  border-radius: 18px;
  border-left: 4px solid var(--qn-gold);
  padding: 22px 22px 8px;
  box-shadow: 0 10px 28px rgba(60,36,21,.05);
}
.qn-faq-head{
  margin-bottom: 6px;
  padding-bottom: 14px;
}
.qn-faq-kicker{
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #A67C2A;
}
.qn-faq-title-row{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.qn-faq-icon{
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--qn-brown);
  color: #FCF9F1;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.qn-faq-title-row h2{
  margin: 0 0 6px;
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 750;
  color: var(--qn-brown);
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.qn-faq-lead{
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--qn-muted);
  max-width: 56ch;
}
.qn-faq-list{
  display: flex;
  flex-direction: column;
}
.qn-faq-item{
  border-top: 1px solid var(--qn-line);
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.qn-faq-item summary{
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  font-weight: 700;
  font-size: 15px;
  color: var(--qn-brown);
}
.qn-faq-item summary::-webkit-details-marker{ display: none; }
.qn-faq-item summary::after{
  content: "";
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid rgba(60, 36, 21, 0.18);
  background: #FFFCF7;
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E4A36' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.qn-faq-item[open] summary::after{
  transform: rotate(180deg);
  background-color: #F3E9D8;
  border-color: rgba(201, 162, 74, 0.55);
}
.qn-faq-item summary:hover::after{
  border-color: rgba(201, 162, 74, 0.65);
}
.qn-faq-num{
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #F3E9D8;
  border: 1px solid rgba(201,162,74,.45);
  font-size: 12px;
  font-weight: 750;
  color: var(--qn-mid);
  letter-spacing: .02em;
}
.qn-faq-item[open] .qn-faq-num{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
}
.qn-faq-q{
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.qn-faq-a{
  margin: 0 0 16px;
  padding: 14px 16px;
  margin-left: 46px;
  border-radius: 12px;
  background: #FFF8EC;
  border: 1px solid rgba(201,162,74,.4);
}
.qn-faq-a p{
  margin: 0;
  color: var(--qn-mid);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 70ch;
}
@media (max-width: 600px){
  .qn-related-tools{ padding: 18px 16px; }
  .qn-faq-card{ padding: 18px 14px 4px; }
  .qn-faq-a{ margin-left: 0; }
  .qn-faq-title-row{ gap: 10px; }
  .qn-faq-icon{ width: 32px; height: 32px; font-size: 16px; }
}

.qn-juz-box.qn-juz-focus,
.qn-juz-focus{
  outline: 2px solid #C9A24A;
  outline-offset: 6px;
  border-radius: 14px;
  background: #FFF8EC;
  box-shadow: 0 0 0 6px rgba(201,162,74,.15);
}

.qn-table-panel.qn-flash,
.qn-subjects.qn-flash,
.qn-bookmarks.qn-flash,
.qn-juz-box.qn-flash{
  outline: 2px solid #C9A24A;
  outline-offset: 4px;
}

.qn-subject-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
}
.qn-subject{
  position: relative;
  border: 1.5px solid rgba(201,162,74,.45);
  background: #FFFCF7;
  border-radius: 14px;
  padding: 14px 14px 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(166,124,42,.08);
  transition: border-color .2s, box-shadow .2s;
  overflow: hidden;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}
.qn-subject::before{
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #C9A24A;
  opacity: .9;
}
.qn-subject::after{
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #C9A24A;
  pointer-events: none;
}
.qn-subject:hover{
  border-color: rgba(166,124,42,.75);
  transform: none;
  box-shadow: 0 6px 16px rgba(166,124,42,.12);
}
.qn-subject-ref{
  display: block;
  margin: 0 0 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #C9A24A;
}
.qn-subject strong{
  display: block;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #3C2415;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.qn-subject span{
  font-size: 12px;
  color: #7A6A58;
  line-height: 1.35;
}

.qn-bookmark-list{ display: grid; gap: 10px; }
.qn-bookmarks{
  position: relative;
  background: linear-gradient(165deg, #FFFCF7 0%, #FFF6E4 55%, #F5E6C8 100%);
  border: 1.5px solid rgba(201,162,74,.4);
  border-radius: 20px;
  padding: 20px 20px 18px;
  box-shadow: 0 8px 22px rgba(166,124,42,.1);
  overflow: hidden;
  width: auto;
  max-width: min(1280px, 100%);
  margin-inline: clamp(12px, 3vw, 28px);
  box-sizing: border-box;
}
.qn-bookmarks::after{
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #E8C56A, #C9A24A);
  pointer-events: none;
}
.qn-bookmarks .qn-section-head{
  margin-bottom: 14px;
  align-items: flex-start;
}
.qn-bookmarks .qn-empty{
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  background: rgba(255,252,247,.72);
  border: 1px dashed rgba(201,162,74,.45);
  border-radius: 14px;
  color: #6E4A36;
  font-size: 14px;
}
.qn-bookmark-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFCF7;
  border: 1.5px solid rgba(201,162,74,.35);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(166,124,42,.06);
}
.qn-bookmark-item strong{ font-family: Inter, system-ui, sans-serif; }
.qn-bookmark-item .muted{ color: var(--qn-muted); font-size: 13px; }

.qn-res-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 20px;
  width: 100%;
  max-width: 100%;
}
.qn-res{
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(165deg, #FFFCF7 0%, #FFF6E4 55%, #F5E6C8 100%) !important;
  border: 2px solid rgba(166,124,42,.55) !important;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  width: 100%;
  min-height: 0;
  box-shadow:
    0 10px 26px rgba(166,124,42,.16),
    0 2px 0 rgba(201,162,74,.35);
  transition: transform .2s, border-color .2s, box-shadow .2s;
  position: relative;
  isolation: isolate;
}
.qn-res::after{
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #E8C56A, #C9A24A, #A67C2A);
  pointer-events: none;
  z-index: 2;
}
.qn-res:hover{
  transform: translateY(-4px);
  border-color: rgba(166,124,42,.85) !important;
  box-shadow:
    0 16px 34px rgba(166,124,42,.22),
    0 2px 0 rgba(201,162,74,.45);
}
.qn-res img{
  width: 100%;
  height: 160px;
  min-height: 160px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-bottom: 1.5px solid rgba(201,162,74,.35);
}
.qn-res div{
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: transparent;
  flex: 1;
}
.qn-res em{
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #C9A24A;
  margin-bottom: 6px;
}
.qn-res strong{
  display: block;
  font-family: Inter, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #3C2415;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.qn-res span{
  font-size: 13px;
  color: #7A6A58;
  line-height: 1.45;
}

/* ---------- Reader (inline page flow) ---------- */
html.qn-modal-open,
html.qn-modal-open body,
html.qn-modal-open .app{
  overflow: hidden !important;
  overscroll-behavior: none;
  height: 100% !important;
  max-height: 100% !important;
}
html.qn-modal-open body{
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}
html.qn-modal-open .qn-table-scroll,
html.qn-modal-open .qn-main,
html.qn-modal-open .app{
  overflow: hidden !important;
  scrollbar-width: none !important;
}
html.qn-modal-open .qn-table-scroll::-webkit-scrollbar,
html.qn-modal-open .qn-main::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Instant deep-link shell - hide hub before deferred quran.js runs (no index flash) */
html.qn-route-reading .qn-hero,
html.qn-route-reading .qn-daily,
html.qn-route-reading .qn-arches,
html.qn-route-reading .qn-last-read,
html.qn-route-reading .qn-explorer,
html.qn-route-reading .qn-index-wrap,
html.qn-route-reading .qn-bookmarks,
html.qn-route-reading .qn-subjects,
html.qn-route-reading .qn-resources,
html.qn-route-reading .qn-related-tools,
html.qn-route-reading .qn-seo-faq,
html.qn-route-reading .qn-breadcrumb,
html.qn-route-reading .qn-page-intro,
html.qn-route-reading .site-subscribe,
html.qn-route-reading .site-footer{
  display: none !important;
}
html.qn-route-reading #qnReader,
html.qn-route-reading #qnReader[hidden]{
  display: block !important;
}
html.qn-route-reading #qnReaderIntro,
html.qn-route-reading #qnReaderIntro[hidden]{
  display: flex !important;
}

/* Focus mode: hide browse chrome while reading inline */
body.qn-reading .qn-hero,
body.qn-reading .qn-daily,
body.qn-reading .qn-arches,
body.qn-reading .qn-last-read,
body.qn-reading .qn-explorer,
body.qn-reading .qn-index-wrap,
body.qn-reading .qn-bookmarks,
body.qn-reading .qn-subjects,
body.qn-reading .qn-resources,
body.qn-reading .qn-related-tools,
body.qn-reading .qn-seo-faq,
body.qn-reading .qn-breadcrumb,
body.qn-reading .qn-page-intro,
body.qn-reading .site-subscribe,
body.qn-reading .site-footer{
  display: none !important;
}

body.qn-reading{
  --qn-tool-h: 43px;
}
html.qn-route-reading,
html.qn-route-reading body,
body.qn-reading{
  overflow-x: visible !important;
}
body.qn-reading .site-breadcrumb{
  display: block !important;
  background: #FFFCF7;
  border: 0;
  border-bottom: 0 !important;
  position: static;
  top: auto;
  z-index: auto;
  padding: 8px var(--page-pad-x, clamp(16px, 3vw, 32px)) 2px;
  margin: 0;
}

/* Edge-to-edge reading surface */
body.qn-reading{
  background: #FBF8F2;
}
body.qn-reading .qn-main{
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
  background: #FBF8F2;
}
body.qn-reading .qn-reader{
  margin: 0;
  width: 100%;
  max-width: none;
  background: #FBF8F2;
}
body.qn-reading .qn-reader-panel{
  width: 100%;
  max-width: none;
  min-height: calc(100dvh - var(--header-h, 72px));
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
  background: #FBF8F2;
}
body.qn-reading,
body.qn-reading .app,
body.qn-reading .qn-main{
  overflow: visible;
  overflow-x: visible;
}
body.qn-reading .qn-reader-intro[hidden] + .qn-reader-layout,
body.qn-reading .qn-reader-layout{
  padding-top: 14px;
}
body.qn-reading .qn-reader-settings{
  /* Keep below open-drawer z-index (5300); do not override open layout */
  z-index: 120;
}
body.qn-reading.qn-settings-open .qn-reader-settings,
body.qn-settings-open .qn-reader-settings{
  z-index: 5300;
}
body.qn-reading .qn-reader-layout{
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  gap: 20px;
  padding: 20px 16px 0 20px;
  grid-template-columns: 88px minmax(0, 1fr);
  background: #FBF8F2;
}
body.qn-reading .qn-reader-layout:has(.qn-ayah-nav--para){
  grid-template-columns: 96px minmax(0, 1fr);
}
body.qn-reading .qn-reader-intro{
  display: flex;
  position: relative;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: visible;
  justify-content: stretch;
  align-items: stretch;
  min-height: 180px;
  max-height: none;
  height: auto;
  flex-shrink: 0;
}
body.qn-reading .qn-reader-intro[hidden]{
  display: none !important;
}
body.qn-reading .qn-reader-main{
  padding: 0 24px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.qn-reading .qn-reader-body{
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: 0 12px 56px;
}
body.qn-reading .qn-reader-info{
  display: none;
}

.qn-reader{
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 8px 0 28px;
  padding: 0;
  background: transparent;
  overflow: visible;
  touch-action: auto;
}
.qn-reader[hidden]{ display: none !important; }
.qn-reader-panel{
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  min-height: 0;
  background: linear-gradient(165deg, #FFFDF9 0%, #FFF6E4 55%, #F3E4C4 100%);
  border: 1.5px solid rgba(201,162,74,.45);
  border-radius: 22px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 0 rgba(255,255,255,.65) inset,
    0 16px 36px rgba(166,124,42,.12);
  overscroll-behavior: auto;
  touch-action: auto;
}

/* Tool/info still uses a real modal overlay */
.qn-reader--modal{
  position: fixed; inset: 0;
  z-index: 3500;
  background: rgba(40,24,14,.72);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  margin: 0;
}
.qn-reader--modal[hidden]{ display: none !important; }
.qn-reader--modal .qn-reader-panel{
  width: min(860px, 100%);
  max-height: min(88vh, 920px);
  height: min(88vh, 920px);
}
.qn-reader--modal .qn-reader-body{
  max-height: none;
  overflow-y: auto;
}

.qn-reader-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #FFFCF7;
  color: #3C2415;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  z-index: 90;
  border-bottom: 1px solid var(--qn-line);
  border-radius: 22px 22px 0 0;
}
.qn-reader-toolbar{
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px var(--page-pad-x, clamp(16px, 3vw, 32px)) 10px;
  background: #FFFCF7;
  color: #3C2415;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h, 72px);
  z-index: 95;
  border: 0;
  border-top: 1px solid rgba(60, 36, 21, 0.08);
  border-bottom: 1px solid rgba(60, 36, 21, 0.12);
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(60, 36, 21, 0.06);
}
body.qn-reading .qn-reader-toolbar,
.qn-reader-toolbar:not([hidden]){
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
}
body.qn-reading .qn-reader-toolbar .qn-reader-back{
  justify-self: start;
  grid-column: 1;
  min-width: 0;
}
body.qn-reading .qn-reader-toolbar .qn-reader-progress{
  justify-self: center;
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 700;
  color: #3C2415;
  pointer-events: none;
}
body.qn-reading .qn-reader-toolbar .qn-reader-actions{
  justify-self: end;
  grid-column: 3;
  margin-left: 0;
  min-width: 0;
  display: flex !important;
  align-items: center;
  gap: 14px !important;
}
body.qn-reading .qn-reader-toolbar .qn-reader-actions > .qn-reader-lang,
body.qn-reading .qn-reader-toolbar .qn-reader-actions > .qn-icon-btn--settings{
  margin-inline-start: 2px;
}
.qn-reader-back{
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--qn-mid);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 2px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.qn-reader-back-ico{
  display: block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.qn-reader-back-label{ line-height: 1.2; }
.qn-reader-back:hover{ color: var(--qn-brown); }
.qn-reader-progress-wrap{
  flex: 0 1 auto;
  text-align: right;
  min-width: 0;
}
.qn-reader-progress{
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--qn-brown);
}
.qn-reader-surah-name{
  margin: 1px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--qn-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.qn-reading .qn-reader-toolbar .qn-reader-surah-name,
body.qn-reading .qn-reader-toolbar .qn-kicker,
body.qn-reading .qn-reader-surah-name{
  display: none !important;
}
.qn-reader-bar .qn-kicker{
  color: #3C2415;
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 700;
}
.qn-reader-bar h2{
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 700;
  line-height: 1.2;
}
.qn-reader-actions{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: 0;
  justify-content: flex-end;
}
.qn-reader-zoom{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.qn-zoom-btn{
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(60,36,21,.16);
  background: #FFFCF7;
  color: var(--qn-brown);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.qn-zoom-btn svg{ display: block; }
.qn-zoom-btn:hover:not(:disabled){ background: #F3E9D8; }
.qn-zoom-btn:disabled{
  opacity: .38;
  cursor: default;
}
.qn-reader-tool-btn{
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(60,36,21,.16);
  background: #FFFCF7;
  color: var(--qn-brown);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.qn-reader-tool-btn:hover{ background: #F3E9D8; }
.qn-reader-tool-btn.qn-reader-listen{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
  box-shadow: none;
  padding: 0 12px;
}
.qn-reader-tool-btn.qn-reader-listen:hover{
  filter: brightness(1.08);
  background: var(--qn-brown);
}
.qn-reader-tool-ico{
  font-size: 9px;
  line-height: 1;
}
.qn-icon-btn{
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid rgba(60,36,21,.16);
  background: #FFFCF7;
  color: #3C2415;
  cursor: pointer;
  font-size: 13px;
  display: inline-grid;
  place-items: center;
}
.qn-icon-btn:hover{ background: #F3E9D8; }
.qn-icon-btn--settings{
  position: relative;
  z-index: 91;
  pointer-events: auto;
}
.qn-icon-btn--settings svg{ display: block; }
.qn-reader-settings{
  display: none;
  gap: 0;
  box-sizing: border-box;
  background: #FFFFFF;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: auto;
  overflow: hidden;
  /* Never inherit page Arabic size into the drawer chrome */
  font-size: 16px;
  line-height: 1.4;
  --qn-ar-size: 40px;
}
.qn-reader-settings[hidden]{ display: none !important; }
.qn-rs-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--qn-line);
  flex: none;
  grid-row: 1;
  position: relative;
  z-index: 2;
  background: #FFFFFF;
}
.qn-reader-settings-title{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--qn-brown);
  letter-spacing: -0.02em;
}
.qn-rs-lead{
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--qn-muted);
  line-height: 1.4;
}
.qn-rs-close{
  appearance: none;
  flex-shrink: 0;
  border: 1px solid #D9D2C8;
  border-radius: 12px;
  background: #F7F4EF;
  color: #4A4036;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qn-rs-close:hover{ background: #EFE9E0; color: var(--qn-brown); }
.qn-rs-close-x{
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
}
.qn-rs-section{ display: grid; gap: 10px; flex: 0 0 auto; }
.qn-rs-section--reciters{
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 0;
}
.qn-rs-label{
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--qn-muted);
}
.qn-rs-toggle{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 12px;
  border: 1px solid #E8DCC8;
  border-radius: 12px;
  background: #FFFCF7;
  cursor: pointer;
  user-select: none;
}
.qn-rs-toggle input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.qn-rs-toggle-ui{
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin-top: 2px;
  border-radius: 999px;
  background: #D9CFC0;
  position: relative;
  transition: background .2s ease;
}
.qn-rs-toggle-ui::after{
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(40, 24, 12, .2);
  transition: transform .2s ease;
}
.qn-rs-toggle input:checked + .qn-rs-toggle-ui{
  background: #6E4A36;
}
.qn-rs-toggle input:checked + .qn-rs-toggle-ui::after{
  transform: translateX(18px);
}
.qn-rs-toggle-text{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.qn-rs-toggle-text strong{
  font-size: 14px;
  font-weight: 700;
  color: #3C2415;
}
.qn-rs-toggle-text small{
  font-size: 12px;
  line-height: 1.35;
  color: #7A6A58;
}
.qn-pref-field--check{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qn-pref-field--check input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: #6E4A36;
  cursor: pointer;
}
/* Arabic-only mode */
body.qn-hide-translation .qn-ayah-en{
  display: none !important;
}
body.qn-hide-translation .qn-reader-lang.is-trans-hidden{
  opacity: .72;
}
.qn-rs-reciters{
  display: grid;
  gap: 10px;
  flex: 0 0 auto !important;
  height: min(160px, 28vh) !important;
  max-height: min(160px, 28vh) !important;
  min-height: 96px !important;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 10px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: auto;
  scrollbar-gutter: stable;
  scrollbar-color: #8A8074 #E8E2D8;
}
.qn-rs-reciters::-webkit-scrollbar{ width: 10px; }
.qn-rs-reciters::-webkit-scrollbar-track{
  background: #E8E2D8;
  border-radius: 99px;
  margin: 4px 0;
}
.qn-rs-reciters::-webkit-scrollbar-thumb{
  background: #8A8074;
  border-radius: 99px;
  border: 2px solid #E8E2D8;
  min-height: 40px;
}

/* Full-height settings sidebar + dim backdrop (above site header z-index:1000) */
.qn-settings-backdrop{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5200;
  background: rgba(40, 24, 14, 0.42);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.qn-settings-open,
body.qn-settings-open{
  overflow: hidden !important;
  overscroll-behavior: none;
}
body.qn-settings-open .qn-settings-backdrop{
  display: block;
}
body.qn-settings-open .qn-reader-settings,
.qn-reader-settings:not([hidden]){
  /* Absolute chrome: head + footer pinned, only middle scrolls */
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  margin: 0 !important;
  width: min(400px, 100vw);
  max-width: 100vw;
  height: 100dvh !important;
  max-height: 100dvh !important;
  z-index: 5300;
  padding: 0 !important;
  border-left: 1px solid var(--qn-line);
  box-shadow: -18px 0 40px rgba(60,36,21,.18);
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow: hidden !important;
  transform: none !important;
  animation: none !important;
}
.qn-reader-settings:not([hidden]) > .qn-rs-head{
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  margin: 0;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}
.qn-reader-settings:not([hidden]) > .qn-rs-body{
  position: absolute !important;
  left: 0;
  right: 0;
  top: var(--qn-rs-head-h, 88px);
  bottom: 0;
  z-index: 1;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  margin: 0 !important;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 18px;
  align-items: stretch;
  justify-content: flex-start;
  scrollbar-width: thin;
  scrollbar-color: #C4B8A8 #F0EBE3;
}
.qn-rs-body::-webkit-scrollbar{ width: 6px; }
.qn-rs-body::-webkit-scrollbar-track{ background: #F0EBE3; border-radius: 99px; }
.qn-rs-body::-webkit-scrollbar-thumb{
  background: #C4B8A8;
  border-radius: 99px;
}
body.qn-settings-open .qn-rs-reciters{
  touch-action: pan-y;
  overscroll-behavior: contain;
  height: min(160px, 28vh) !important;
  max-height: min(160px, 28vh) !important;
  flex: 0 0 auto !important;
}

.qn-rs-reciter{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #E5E0D8;
  background: #FFFFFF;
  color: var(--qn-brown);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.qn-rs-reciter:hover{
  border-color: rgba(60,36,21,.28);
  background: #FFFCF7;
  box-shadow: 0 1px 4px rgba(60,36,21,.06);
}
.qn-rs-reciter.is-on{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
  box-shadow: none;
}
.qn-rs-reciter-avatar{
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #F3E9D8;
  color: var(--qn-brown);
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
}
.qn-rs-reciter-photo{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.qn-rs-reciter-fallback{
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.qn-rs-reciter.is-on .qn-rs-reciter-avatar{
  background: rgba(252,249,241,.18);
  color: #FCF9F1;
  box-shadow: inset 0 0 0 2px rgba(252,249,241,.35);
}
.qn-rs-reciter-copy{
  display: grid;
  gap: 2px;
  min-width: 0;
}
.qn-rs-reciter-copy strong{
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.25;
}
.qn-rs-reciter-copy small{
  font-size: 12.5px;
  font-weight: 550;
  opacity: .72;
}
.qn-rs-size{
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9A8F82;
  font-weight: 600;
  padding: 4px 0 2px;
}
.qn-rs-size-sm{
  font-size: 13px;
  line-height: 1;
  color: #9A8F82;
}
.qn-rs-size-lg{
  font-size: 22px !important;
  line-height: 1;
  color: var(--qn-brown);
  font-weight: 700;
}
.qn-rs-size input[type="range"]{
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--qn-brown) 0%,
    var(--qn-brown) var(--qn-size-pct, 40%),
    #E5E0D8 var(--qn-size-pct, 40%),
    #E5E0D8 100%
  );
  outline: none;
  cursor: pointer;
}
.qn-rs-size input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--qn-brown);
  border: 0;
  box-shadow: 0 2px 8px rgba(60,36,21,.28);
  cursor: pointer;
}
.qn-rs-size input[type="range"]::-moz-range-thumb{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--qn-brown);
  border: 0;
  box-shadow: 0 2px 8px rgba(60,36,21,.28);
  cursor: pointer;
}
.qn-rs-size input[type="range"]::-moz-range-track{
  height: 6px;
  border-radius: 99px;
  background: #E5E0D8;
}
.qn-rs-fonts{
  display: grid;
  gap: 10px;
}
.qn-rs-font{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #E5E0D8;
  background: #F7F4EF;
  color: var(--qn-brown);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.qn-rs-font:hover{
  border-color: rgba(60,36,21,.28);
  background: #FFFCF7;
}
.qn-rs-font.is-on{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
}
.qn-rs-font-preview{
  order: 2;
  font-size: 24px !important;
  line-height: 1.35 !important;
  color: var(--qn-brown);
  white-space: nowrap;
}
.qn-rs-font.is-on .qn-rs-font-preview{ color: #FCF9F1; }
.qn-rs-font strong{
  order: 1;
  font-size: 14px;
  font-weight: 650;
  font-family: Georgia, "Times New Roman", serif;
  color: #9A8F82;
  letter-spacing: 0.01em;
}
.qn-rs-font.is-on strong{ color: rgba(252,249,241,.78); }
.qn-reader-settings .qn-pref-field{
  display: grid;
  gap: 6px;
}
.qn-reader-settings .qn-pref-field--bare{ gap: 0; }
.qn-reader-settings .qn-pref-field span{
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--qn-muted);
}
.qn-rs-footer{
  flex: none !important;
  margin-top: 0 !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #EBE5DB;
  background: #FFFFFF;
  z-index: 2;
}
.qn-rs-btn{
  appearance: none;
  min-height: 48px;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.qn-rs-btn--reset{
  border: 1.5px solid var(--qn-brown);
  background: #FFFFFF;
  color: var(--qn-brown);
}
.qn-rs-btn--reset:hover{ background: #F7F1E6; }
.qn-rs-btn--save{
  border: 1.5px solid var(--qn-brown);
  background: var(--qn-brown);
  color: #FCF9F1;
}
.qn-rs-btn--save:hover{ background: #4A2F1C; border-color: #4A2F1C; }
.qn-reader-layout{
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 4px 16px 0 12px;
  flex: 1 1 auto;
}
.qn-reader-layout:has(.qn-ayah-nav[hidden]){
  grid-template-columns: minmax(0, 1fr);
}
.qn-ayah-nav[hidden]{ display: none !important; }
.qn-ayah-nav{
  position: relative;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 88px;
  max-height: calc(100vh - var(--header-h, 72px) - 100px);
  padding: 12px 8px 12px;
  border-radius: 16px;
  background: #FFFCF7;
  border: 1px solid var(--qn-line);
  box-shadow: 0 8px 20px rgba(166,124,42,.06);
  box-sizing: border-box;
}
body.qn-reading .qn-ayah-nav{
  position: sticky;
  top: calc(var(--header-h, 72px) + var(--qn-tool-h, 43px) + 6px);
  z-index: 40;
  max-height: calc(100dvh - var(--header-h, 72px) - var(--qn-tool-h, 43px) - 16px);
}
.qn-ayah-nav-label{
  margin: 0;
  text-align: center;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--qn-brown);
}
.qn-ayah-nav--para{
  width: 96px;
}
.qn-ayah-nav-group{
  margin: 10px 0 4px;
  padding: 0 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .03em;
  color: var(--qn-brown);
  line-height: 1.25;
}
.qn-ayah-nav-group:first-child{
  margin-top: 0;
}
.qn-ayah-nav-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #C9A24A #F3E9D8;
}
.qn-ayah-nav-scroll::-webkit-scrollbar{ width: 8px; }
.qn-ayah-nav-scroll::-webkit-scrollbar-track{
  background: #F3E9D8;
  border-radius: 99px;
}
.qn-ayah-nav-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, #E8C56A, #C9A24A 55%, #A67C2A);
  border-radius: 99px;
  border: 2px solid #F3E9D8;
  min-height: 36px;
}
.qn-ayah-nav-list{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2px 0 8px;
}
.qn-ayah-nav-btn{
  width: 40px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--qn-line);
  background: #FFFCF7;
  color: var(--qn-brown);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
.qn-ayah-nav-btn:hover{
  border-color: rgba(201,162,74,.55);
  background: #FFF8EC;
}
.qn-ayah-nav-btn.is-active{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
  box-shadow: 0 4px 12px rgba(60,36,21,.18);
}
.qn-reader-main{
  min-width: 0;
  padding: 0 12px 0 16px;
}
.qn-reader-intro{
  display: none;
  position: relative;
  flex-direction: row;
  justify-content: stretch;
  align-items: stretch;
  text-align: left;
  gap: 0;
  padding: 0;
  margin: 0;
  min-height: 180px;
  max-height: none;
  height: auto;
  overflow: visible;
  background: #2A1A10;
  flex-shrink: 0;
}
.qn-reader-intro:not([hidden]){ display: flex; }
.qn-reader-intro[hidden]{ display: none !important; }
.qn-reader-intro-bg{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
.qn-reader-intro-bg img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
  filter: brightness(0.7) saturate(1.04);
}
.qn-reader-intro-bg::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(42, 24, 16, 0.78) 0%,
      rgba(42, 24, 16, 0.42) 42%,
      rgba(42, 24, 16, 0.38) 58%,
      rgba(42, 24, 16, 0.7) 100%);
}
.qn-reader-intro-inner{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px 28px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px clamp(18px, 4vw, 40px);
  box-sizing: border-box;
  min-height: 180px;
}
.qn-reader-intro-en-col{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  min-width: 0;
  justify-self: start;
}
.qn-reader-intro-ar-col{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  padding-inline-end: 4px;
}
.qn-reader-intro-ar{
  margin: 0;
  font-family: var(--qn-ar-font, "UthmanicHafs", "Traditional Arabic", "Noto Naskh Arabic", serif);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 700;
  color: #FCF9F1;
  line-height: 1.45;
  direction: rtl;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
.qn-reader-intro-en{
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  color: #FCF9F1;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}
.qn-reader-intro-meaning{
  margin: 0;
  font-size: 15px;
  font-style: italic;
  font-weight: 500;
  color: rgba(252, 249, 241, 0.82);
  line-height: 1.35;
}
.qn-reader-intro-meta{
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(252, 249, 241, 0.72);
  line-height: 1.35;
}
.qn-reader-reciter-note[hidden]{ display: none !important; }
@media (max-width: 720px){
  .qn-reader-intro,
  body.qn-reading .qn-reader-intro{
    min-height: 160px !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible;
  }
  .qn-reader-intro-inner,
  body.qn-reading .qn-reader-intro-inner{
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 18px 26px !important;
    min-height: 160px;
    text-align: center;
    align-content: center;
  }
  .qn-reader-intro-en-col{
    align-items: center;
    text-align: center;
    order: 2;
    justify-self: center;
  }
  .qn-reader-intro-ar-col{
    order: 1;
    justify-content: center;
    justify-self: center;
    padding-inline-end: 0;
  }
  .qn-reader-intro-ar{
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1.5;
  }
  .qn-reader-actions .qn-reader-listen{
    padding: 0 10px;
    font-size: 12px;
  }
}
.qn-reader-info{
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #6E4A36;
  border: 0;
  background: transparent;
  flex-shrink: 0;
  margin: 0;
}
.qn-reader-body{
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 8px 8px 44px;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.qn-ayah-play{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px auto 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201,162,74,.45);
  background: #FFF8EC;
  color: var(--qn-mid);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.qn-ayah-play:hover{
  background: #F3E9D8;
  color: var(--qn-brown);
}
.qn-ayah{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px clamp(4px, 1vw, 10px) 10px;
  border-bottom: 1px solid #EDE0CC;
  border-radius: 0;
  transition: background .2s ease, box-shadow .2s ease, border-radius .2s ease;
}
.qn-ayah .qn-ayah-play{ align-self: center; }
.qn-ayah-row{
  display: flex;
  flex-direction: column;   /* number on top, then Arabic, then translation */
  align-items: flex-start;
  gap: 8px;                 /* tighter: number → Arabic */
  width: 100%;
}
.qn-ayah-row .qn-ayah-num{
  flex: 0 0 auto;
  margin-top: 0;
}
.qn-ayah-pair{
  display: flex;
  flex-direction: column;
  gap: 8px;                 /* tighter: Arabic → English */
  width: 100%;
  min-width: 0;
}
.qn-ayah-pair .qn-ayah-ar{
  float: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 2px 0 2px;
  line-height: 1.75 !important;
  text-align: right;
}
.qn-ayah-pair .qn-ayah-en{
  display: block;
  width: 100%;
  margin: 0;
  padding-top: 0;
  text-align: left;
}
.qn-ayah-head{
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 8px;
  width: 100%;
}
.qn-ayah-head .qn-ayah-ar{
  margin: 0;
  flex: 1 1 auto;
  text-align: right;
}
.qn-ayah-head .qn-ayah-num{
  margin-top: 6px;
  order: 0;
}
.qn-ayah-ar-row{
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
}
.qn-ayah-ar-row .qn-ayah-ar{ margin: 0; flex: 1 1 auto; }
.qn-ayah-actions{
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.qn-ayah-actions::-webkit-scrollbar{ display: none; }
.qn-ayah-act{
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #6E5A4A;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.qn-ayah-act:hover{ color: var(--qn-brown); }
.qn-ayah-act.is-on{ color: var(--qn-brown); font-weight: 700; }
.qn-ayah-act.is-done{ color: var(--qn-brown); font-weight: 700; }
.qn-ayah-act--play{
  padding: 7px 14px;
  border-radius: 999px;
  background: #F3E9D8;
  border: 0;
  color: var(--qn-brown);
  font-weight: 700;
}
.qn-ayah-act--play:hover{
  background: #E8D9B8;
  color: var(--qn-brown);
}
@media (max-width: 520px){
  .qn-ayah-actions{ gap: 6px 10px; }
  .qn-ayah-act{ font-size: 12px; gap: 4px; }
  .qn-ayah-act--play{ padding: 6px 10px; }
}
@media (max-width: 720px){
  .qn-reader-layout{
    grid-template-columns: 72px minmax(0, 1fr);
    padding-inline: 8px;
    gap: 16px;
  }
  .qn-ayah-nav{
    width: 72px;
  }
  .qn-reader-main{ padding-left: 12px; }
  .qn-ayah-nav-btn{ width: 34px; height: 32px; font-size: 12px; }
  body.qn-reading .qn-reader-toolbar{
    column-gap: 8px;
    padding: 10px 12px;
  }
  body.qn-reading .qn-reader-toolbar .qn-reader-progress{ font-size: 12px; }
  body.qn-reading .qn-reader-toolbar .qn-reader-actions{ gap: 8px !important; }
  body.qn-reading .qn-reader-toolbar .qn-zoom-btn{
    width: 30px;
    height: 30px;
    font-size: 11.5px;
  }
  body.qn-reading .qn-reader-toolbar .qn-reader-tool-btn{
    height: 30px;
    padding: 0 8px;
    font-size: 11.5px;
  }
  body.qn-reading .qn-reader-toolbar .qn-icon-btn{
    width: 30px;
    height: 30px;
  }
  body.qn-reading .qn-reader-toolbar .qn-reader-back-label{ display: none; }
}
@media (max-width: 420px){
  body.qn-reading .qn-reader-toolbar{
    column-gap: 6px;
    padding-inline: 10px;
  }
  body.qn-reading .qn-reader-toolbar .qn-reader-back{ padding: 4px; }
  body.qn-reading .qn-reader-toolbar .qn-reader-back-ico{
    width: 18px;
    height: 18px;
  }
  body.qn-reading .qn-reader-toolbar .qn-reader-tool-btn.qn-reader-listen{
    width: 30px;
    min-width: 30px;
    padding: 0;
    gap: 0;
    font-size: 0;
    justify-content: center;
  }
  body.qn-reading .qn-reader-toolbar .qn-reader-tool-btn.qn-reader-listen .qn-reader-tool-ico{
    font-size: 10px;
    line-height: 1;
  }
}
.qn-ayah.is-playing{
  background: linear-gradient(165deg, #F3E9D8 0%, #E8D9B8 100%);
  border-radius: 16px;
  border-bottom-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 4px 0 0 #C9A24A,
    0 8px 22px rgba(166,124,42,.14);
  margin: 8px 0;
  padding: 22px clamp(10px, 1.4vw, 18px) 18px;
  position: relative;
}
.qn-ayah.is-resume{
  box-shadow: inset 4px 0 0 #C9A24A;
  background: rgba(243, 233, 216, 0.55);
  transition: background .4s ease, box-shadow .4s ease;
}
.qn-ayah.is-playing .qn-ayah-num{
  background: var(--qn-brown);
  color: #FCF9F1;
}
.qn-ayah.is-playing .qn-ayah-play{
  background: var(--qn-brown);
  border-color: var(--qn-brown);
  color: #FCF9F1;
}

/* Bottom audio player */
.qn-audio-bar{
  position: fixed;
  left: var(--qn-audio-left, 12px);
  right: 12px;
  bottom: 12px;
  z-index: 80;
  pointer-events: none;
  transform: translateY(0);
  opacity: 1;
  transition: transform .28s ease, opacity .22s ease;
}
.qn-audio-bar[hidden]{ display: none !important; }
.qn-audio-bar.is-scroll-away{
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}
.qn-audio-bar-inner{
  pointer-events: auto;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #FFFCF7;
  border: 1px solid rgba(201,162,74,.4);
  box-shadow: 0 12px 32px rgba(60,36,21,.16);
}
.qn-audio-meta{
  min-width: 0;
}
.qn-audio-track{
  height: 3px;
  border-radius: 999px;
  background: #E6D9C4;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
}
.qn-audio-track i{
  display: block;
  height: 100%;
  width: 0%;
  background: var(--qn-brown);
  border-radius: inherit;
}
.qn-audio-label{
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  color: var(--qn-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qn-audio-controls{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.qn-audio-icon{
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--qn-mid);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.qn-audio-icon:hover{ background: #F3E9D8; color: var(--qn-brown); }
.qn-audio-play{
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--qn-brown);
  color: #FCF9F1;
  font-size: 15px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(60,36,21,.22);
}
.qn-audio-play:hover{ filter: brightness(1.08); }
.qn-audio-play.is-paused{ /* same */ }
.qn-audio-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.qn-audio-reciter{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--qn-line);
  background: #FFF8EC;
  color: var(--qn-brown);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.qn-audio-reciter span:nth-child(2){
  overflow: hidden;
  text-overflow: ellipsis;
}
.qn-audio-reciter-avatar{
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #F3E9D8;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.qn-audio-reciter-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qn-audio-time{
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--qn-muted);
  min-width: 7.5ch;
  text-align: right;
}
body.qn-reading.qn-audio-open .qn-reader-body{
  padding-bottom: 110px;
}
@media (max-width: 900px){
  .qn-audio-bar{ --qn-audio-left: 8px; left: 8px; }
}
@media (max-width: 720px){
  .qn-audio-bar{ left: 8px; right: 8px; bottom: 8px; }
  .qn-audio-bar-inner{
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }
  .qn-audio-right{ justify-content: space-between; }
  .qn-audio-reciter{ max-width: none; flex: 1; }
  .qn-audio-controls{ order: -1; }
}
.qn-ayah-num{
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin-top: 6px;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 750;
  color: var(--qn-brown);
  background: #F3E9D8;
  border-radius: 50%;
  border: 0;
  box-shadow: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}
button.qn-ayah-num:hover{
  background: #E8D9B8;
  border-color: transparent;
  color: var(--qn-brown);
}
button.qn-ayah-num:focus-visible{
  outline: 2px solid #C9A24A;
  outline-offset: 2px;
}
.qn-ayah-num.qn-ayah-num--bismi{
  cursor: default;
  padding: 2px 8px;
  margin-bottom: 10px;
  border-radius: 999px;
  width: auto;
  height: auto;
}
.qn-ayah-ar{
  font-family: var(--qn-ar-font, "UthmanicHafs", "Traditional Arabic", "Noto Naskh Arabic", serif);
  font-size: var(--qn-ar-size, 40px) !important;
  font-weight: 700;
  line-height: 1.75 !important;
  letter-spacing: 0;
  word-spacing: 0;
  direction: rtl;
  text-align: right;
  color: #3C2415;
  margin: 0 0 6px;
  padding: 2px 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
.qn-ayah-ar--bismi{
  text-align: center;
  margin: 4px 0 18px;
  padding: 8px 0 10px;
  font-size: calc(var(--qn-ar-size, 40px) * 1.06) !important;
  line-height: 2 !important;
  float: none;
}
.qn-ayah.is-bismi .qn-ayah-en{
  text-align: center;
  margin-top: 4px;
  padding-top: 6px;
}
.qn-ayah-en{
  margin: 0;
  color: #3A322C;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: var(--qn-en-size, 16px);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.qn-ayah-en.is-rtl{
  direction: rtl;
  text-align: right;
  font-family: "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", serif;
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 400;
  line-height: 1.95;
}
.qn-para-surah{
  margin: 18px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(201, 162, 74, 0.12);
  border: 1px solid rgba(201, 162, 74, 0.28);
}
.qn-para-surah-en{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #3C2415;
}
.qn-para-surah-ar{
  margin: 4px 0 0;
  font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", "Arabic Typesetting", serif;
  font-size: 22px;
  direction: rtl;
  text-align: right;
  color: #5A4636;
}
.qn-ayah.is-bismi .qn-ayah-num--bismi{
  font-size: 18px;
  line-height: 1;
  background: transparent;
  border: 0;
  color: #8B6A3E;
}
.qn-para-more-wrap{
  display: none;
}
.qn-reader-sentinel{
  width: 100%;
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.qn-reader-loading--more{
  padding: 16px 12px 8px;
  font-size: 13px;
}
.qn-para-end{
  text-align: center;
  color: #7A6A58;
  font-size: 12.5px;
  padding: 6px 8px 0;
  margin: 0;
}
.qn-reader-end{
  margin: 12px 0 32px;
  padding: 14px 0 0;
  border-top: 1px solid #EDE0CC;
}
.qn-reader-end-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.qn-reader-end-btn{
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  max-width: 200px;
  padding: 9px 11px 9px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(201, 162, 74, 0.55);
  background: linear-gradient(180deg, #FFFDF8 0%, #F6EDD8 100%);
  color: var(--qn-brown);
  cursor: pointer;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 2px 8px rgba(166, 124, 42, 0.12);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.qn-reader-end-btn--next{
  margin-left: auto;
  background: linear-gradient(180deg, #3C2415 0%, #2A1A10 100%);
  border-color: #3C2415;
  color: #FCF9F1;
  box-shadow: 0 4px 12px rgba(60, 36, 21, 0.22);
}
.qn-reader-end-btn--prev{
  margin-right: auto;
  background: #FFFCF7;
}
.qn-reader-end-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(166, 124, 42, 0.18);
}
.qn-reader-end-btn--next:hover{
  background: linear-gradient(180deg, #4A2E1C 0%, #3C2415 100%);
  box-shadow: 0 6px 16px rgba(60, 36, 21, 0.28);
}
.qn-reader-end-btn > span[aria-hidden="true"]{
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  background: rgba(201, 162, 74, 0.2);
  color: #A67C2A;
}
.qn-reader-end-btn--next > span[aria-hidden="true"]{
  background: rgba(252, 249, 241, 0.16);
  color: #E8C56A;
}
.qn-reader-end-btn-copy{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.qn-reader-end-btn-copy small{
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8B6A3E;
  line-height: 1;
}
.qn-reader-end-btn--next .qn-reader-end-btn-copy small{
  color: rgba(232, 197, 106, 0.95);
}
.qn-reader-end-btn-copy strong{
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #2A1A10;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  line-height: 1.2;
}
.qn-reader-end-btn--next .qn-reader-end-btn-copy strong{
  color: #FCF9F1;
}
.qn-reader-loading,
.qn-empty{
  padding: 40px 20px;
  text-align: center;
  color: var(--qn-muted);
}
/* Shimmer — mirrors real ayah card: num left, 3 ar lines, 4 en lines, 4 icons */
.qn-ayah-jump-cover{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(var(--header-h, 72px) + var(--qn-tool-h, 48px));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px clamp(16px, 4vw, 36px);
  margin: 0;
  box-sizing: border-box;
  background: #FBF8F2;
  pointer-events: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  /* Instant show/hide — no opacity fade (avoids empty cream flash). */
  visibility: hidden;
}
.qn-ayah-jump-cover.is-on{
  visibility: visible !important;
  pointer-events: auto !important;
}
.qn-ayah-jump-cover-inner{
  width: min(640px, 100%);
  margin: 0 auto;
}
.qn-ayah-shimmer-card{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px clamp(4px, 1vw, 10px) 10px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #EDE0CC;
  box-shadow: none;
  box-sizing: border-box;
}
.qn-ayah-shimmer-row{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
.qn-ayah-shimmer-num{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(90deg, #E8D9B8 0%, #F5EDE0 45%, #E0D0B0 90%);
  background-size: 200% 100%;
  animation: qn-ayah-shimmer 1.25s ease-in-out infinite;
}
.qn-ayah-shimmer-pair{
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.qn-ayah-shimmer-ar,
.qn-ayah-shimmer-en{
  display: flex;
  flex-direction: column;
  width: 100%;
}
.qn-ayah-shimmer-ar{
  align-items: flex-end;
  gap: 10px;
}
.qn-ayah-shimmer-en{
  align-items: flex-start;
  gap: 8px;
}
.qn-ayah-shimmer-line{
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #E8D9B8 0%, #F8F1E6 45%, #E0D0B0 90%);
  background-size: 200% 100%;
  animation: qn-ayah-shimmer 1.25s ease-in-out infinite;
}
.qn-ayah-shimmer-line--ar{
  height: 22px;
  border-radius: 10px;
}
.qn-ayah-shimmer-line--en{
  height: 13px;
}
.qn-ayah-shimmer-acts{
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 0;
  width: 100%;
  overflow: hidden;
}
.qn-ayah-shimmer-act{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qn-ayah-shimmer-act > i{
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, #E8D9B8 0%, #F8F1E6 45%, #E0D0B0 90%);
  background-size: 200% 100%;
  animation: qn-ayah-shimmer 1.25s ease-in-out infinite;
}
.qn-ayah-shimmer-act > b{
  display: block;
  width: 48px;
  height: 11px;
  border-radius: 5px;
  background: linear-gradient(90deg, #E8D9B8 0%, #F8F1E6 45%, #E0D0B0 90%);
  background-size: 200% 100%;
  animation: qn-ayah-shimmer 1.25s ease-in-out infinite;
}
@keyframes qn-ayah-shimmer{
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.qn-ayah-jump-cover .visually-hidden{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
body.qn-ayah-jumping .qn-ayah-nav{
  pointer-events: none;
  opacity: .55;
}
/* Soften real content under shimmer — do not blank the page */
body.qn-ayah-jumping .qn-reader-intro,
body.qn-ayah-jumping .qn-reader-layout{
  opacity: 0;
  pointer-events: none;
}
/* While measuring lines, keep layout for getClientRects but invisible */
body.qn-ayah-jumping.qn-ayah-measuring .qn-reader-intro,
body.qn-ayah-jumping.qn-ayah-measuring .qn-reader-layout{
  opacity: 1;
  visibility: hidden;
  pointer-events: none;
}


@media (max-width: 1100px){
  .qn-arches{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qn-arch-feature{ grid-column: auto; }
  .qn-res-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qn-subject-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  /* Keep 1024-style: sidebar + table side by side */
  .qn-index-wrap{
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    gap: 14px;
  }
  .qn-options{
    position: sticky;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }
  .qn-options-kicker{ grid-column: auto; }
  .qn-juz-box{ grid-column: auto; }
  .qn-juz-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .qn-juz-grid button{ min-height: 36px; font-size: 12px; border-radius: 10px; }
  .qn-select{ padding: 9px 28px 9px 10px; font-size: 12.5px; }
}
@media (max-width: 900px){
  /* Still like 1024 - do NOT stack preferences above table */
  .qn-index-wrap{
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr) ;
    gap: 12px;
  }
  .qn-options{
    position: sticky;
    top: 12px;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none ;
    gap: 11px;
    padding: 12px;
  }
  .qn-options-kicker,
  .qn-juz-box{ grid-column: auto ; }
  .qn-juz-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)) ; gap: 6px; }
  .qn-juz-grid button{ min-height: 34px; font-size: 11.5px; border-radius: 10px; }
  .qn-select{ padding: 8px 26px 8px 8px; font-size: 12px; }
  .qn-hero, .qn-hero-copy{ min-height: 0; }
  .qn-hero{
    min-height: 420px !important;
    height: auto !important;
    border-radius: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .qn-hero-stage{ padding: 88px 20px 28px !important; min-height: 420px; height: auto; flex-direction: column; justify-content: center; }
  .qn-hero-card{
    width: min(520px, 100%) !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
  }
  .qn-hero-card h1{ font-size: 28px; color: #3C2415; }
  .qn-hero-cta{ gap: 8px; }
  .qn-btn-gold, .qn-btn-ghost{ padding: 10px 14px; font-size: 13px; }
  body.quran-page .qn-main{ padding: 0 0 36px; gap: 16px; }
  .qn-section-head h2{ font-size: clamp(20px, 3.5vw, 26px); }
  .qn-arches{ grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    width: 100%;
  }
  .qn-arch{ padding: 10px 5px 8px; min-height: 0; }
  .qn-arch-icon{ width: 56px; height: 56px; padding: 0; }
  .qn-arch-icon img{ width: 100%; height: 100%; }
  .qn-arch strong{ font-size: 12px; }
  .qn-arch > span:last-child{ font-size: 10.5px; }
  .qn-arch-feature{ grid-column: auto; padding: 8px 6px; }
  .qn-arch-en{ display: none; }
  .qn-arch-ar{ font-size: 12.5px; }
  .qn-arch-mark{ font-size: 13px; }
  .qn-arch-feature strong{ font-size: 8.5px; }
  .qn-subject{ padding: 11px 11px 11px 13px; }
  .qn-subject strong{ font-size: 14px; }
  .qn-res img{ height: 110px; min-height: 110px; }
}
@media (max-width: 768px){
  /* Tablet = same structure as 1024; keep hero edge-to-edge */
  body.quran-page .qn-main{
    padding: 0 0 28px !important;
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }
  body.quran-page .qn-main > *:not(.qn-hero){
    padding-inline: 12px;
  }
  body.quran-page .qn-main > .qn-bookmarks,
  body.quran-page .qn-main > .qn-related-tools{
    margin-inline: 12px;
  }
  .qn-index-wrap{
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr) ;
    gap: 10px !important;
    align-items: start;
  }
  .qn-options{
    position: sticky !important;
    top: 10px;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none ;
    padding: 10px !important;
    gap: 10px !important;
  }
  .qn-options label{ font-size: 11.5px; gap: 4px; }
  .qn-options-kicker{ font-size: 10px; }
  .qn-juz-title p{ font-size: 12px; }
  .qn-juz-meta{ font-size: 10px; }
  .qn-juz-box{ padding: 12px 10px 10px; }
  .qn-juz-grid{
    grid-template-columns: repeat(5, minmax(0, 1fr)) ;
    gap: 5px !important;
  }
  .qn-juz-grid button{
    min-height: 32px !important;
    font-size: 11px !important;
    border-radius: 9px;
  }
  .qn-select{
    width: 100%;
    max-width: 100%;
    padding: 7px 24px 7px 8px !important;
    font-size: 11.5px !important;
  }
  .qn-arches{
    grid-template-columns: repeat(5, minmax(0, 1fr)) ;
    width: 100%;
    max-width: 100%;
    gap: 6px;
    padding: 8px;
  }
  .qn-arch{ min-width: 0; width: 100%; padding: 8px 3px 7px; }
  .qn-arch strong{ font-size: 11px; }
  .qn-arch > span:last-child{ font-size: 9.5px; }
  .qn-arch-icon{ width: 48px; height: 48px; padding: 0; }
  .qn-arch-icon img{ width: 100%; height: 100%; }
  .qn-arch-feature{ grid-column: auto ; width: 100%; padding: 8px 4px; }
  .qn-arch-en{ display: none; }
  .qn-arch-ar{ font-size: 11.5px; }
  .qn-arch-feature strong{ font-size: 8px; }
  .qn-table-panel{ min-width: 0; max-width: 100%; }
  .qn-explorer{ width: 100%; max-width: 100%; flex-wrap: wrap; }
  .qn-explorer-actions{
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    display: flex;
  }
  .qn-chip{ max-width: 100%; }
  .qn-table-panel,
  .qn-table-scroll,
  .qn-table{
    width: 100% !important;
    max-width: 100% !important;
  }
  .qn-subject-grid,
  .qn-res-grid{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    width: 100%;
    max-width: 100%;
  }
}
@media (max-width: 700px){
  body.quran-page .qn-main{ padding: 0 0 28px; gap: 14px; }
  /* Keep side-by-side until phone */
  .qn-index-wrap{
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr) ;
    gap: 8px !important;
  }
  /* Mobile: 2×2 + Featured full-width (not 5 squeezed) */
  .qn-arches{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    gap: 10px !important;
    padding: 12px !important;
  }
  .qn-arch{
    padding: 14px 10px 12px !important;
    min-height: 100px;
  }
  .qn-arch-icon{ width: 56px !important; height: 56px !important; padding: 0 !important; }
  .qn-arch-icon img{ width: 100% !important; height: 100% !important; }
  .qn-arch strong{ font-size: 14px !important; }
  .qn-arch > span:last-child{ font-size: 12px !important; }
  .qn-arch-feature{
    grid-column: 1 / -1 ;
    padding: 16px 14px !important;
  }
  .qn-arch-en{
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px !important;
  }
  .qn-arch-ar{ font-size: 16px !important; }
  .qn-arch-mark{ font-size: 16px !important; }
  .qn-arch-feature strong{ font-size: 10px !important; }
  .qn-options{
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
  }
  .qn-juz-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)) ; }
  .qn-res-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ; gap: 10px; }
  .qn-subject-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ; gap: 10px; }
  .qn-res img{ height: 88px; min-height: 88px; }
  .qn-res div{ padding: 8px 10px 12px; }
  .qn-res strong{ font-size: 14px; }
  .qn-res span{ font-size: 12px; }
  .qn-subject{ padding: 10px 10px 10px 12px; }
  .qn-subject-ref{ margin-bottom: 3px; font-size: 9.5px; }
  .qn-subject strong{ font-size: 13.5px; margin-bottom: 2px; }
  .qn-subject span{ font-size: 11.5px; }
}
@media (max-width: 980px){
  /* Full table like laptop - denser, no side-scroll */
  .qn-table-scroll{
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    -webkit-overflow-scrolling: touch;
  }
  .qn-table{
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 12px;
  }
  .qn-table th,
  .qn-table td{
    display: table-cell !important;
    vertical-align: middle;
  }
  .qn-name-ar,
  .qn-name-meta{ display: none !important; }
  .qn-table th{
    padding: 10px 4px;
    font-size: 9.5px;
    letter-spacing: .04em;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
  }
  .qn-table th:nth-child(1),
  .qn-table th:nth-child(2){ text-align: left; }
  .qn-table td{
    padding: 9px 3px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .qn-table td:nth-child(1),
  .qn-table td:nth-child(2){ text-align: left; }
  .qn-table th:nth-child(1),
  .qn-table td:nth-child(1){ width: 8%; padding-left: 8px; }
  .qn-table th:nth-child(2),
  .qn-table td:nth-child(2){ width: 22%; }
  .qn-table th:nth-child(3),
  .qn-table td:nth-child(3){ width: 18%; }
  .qn-table th:nth-child(4),
  .qn-table td:nth-child(4){ width: 10%; }
  .qn-table th:nth-child(5),
  .qn-table td:nth-child(5){ width: 14%; }
  .qn-table th:nth-child(6),
  .qn-table td:nth-child(6){ width: 28%; padding-right: 6px; }
  .qn-num{ width: 30px; height: 30px; font-size: 11px; }
  .qn-name-en{
    display: block;
    font-size: 12.5px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .qn-ar{
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .qn-ayahs{ font-weight: 700; font-variant-numeric: tabular-nums; }
  .qn-type{ padding: 3px 7px; font-size: 10px; }
  .qn-row-actions{
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
  }
  .qn-row-actions button{
    width: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 0;
  }
}
@media (max-width: 640px){
  /* Phone: stack options above table (tablet 768 stays side-by-side) */
  .qn-index-wrap{
    grid-template-columns: 1fr ;
    gap: 12px !important;
  }
  body.quran-page .qn-main{ padding: 0 0 24px; gap: 12px; }
  body.quran-page:not(.qn-reading) .site-breadcrumb{
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 5;
    padding: 10px var(--page-pad-x, 14px) !important;
    background: #F7F1E6 !important;
    border-bottom: 1px solid rgba(60, 36, 21, 0.12) !important;
    text-align: start !important;
  }
  .qn-hero{
    min-height: 0 !important;
    height: auto !important;
    border-radius: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    background: transparent !important;
  }
  .qn-hero-stage{
    padding: 28px 16px 24px !important;
    min-height: 0 !important;
    height: auto !important;
    justify-content: flex-end;
  }
  .qn-hero-card{
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
  }
  .qn-hero-card h1{ font-size: 26px; color: #3C2415; }
  .qn-hero-lead, .qn-hero-quote{ font-size: 15px; }
  .qn-kicker{ font-size: 10px; margin-bottom: 6px; }
  .qn-hero-meta{ font-size: 12px; margin-bottom: 10px; }
  .qn-hero-cta{ gap: 6px; }
  .qn-btn-gold, .qn-btn-ghost{
    padding: 8px 12px;
    font-size: 12.5px;
    border-radius: 10px;
  }
  .qn-arches{
    padding: 12px !important;
    gap: 10px !important;
    border-radius: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
  }
  .qn-arch{ padding: 14px 10px 12px !important; gap: 4px; border-radius: 14px; min-height: 96px; }
  .qn-arch-icon{ width: 56px !important; height: 56px !important; padding: 0 !important; }
  .qn-arch-icon img{ width: 100% !important; height: 100% !important; }
  .qn-arch strong{ font-size: 13.5px !important; }
  .qn-arch > span:last-child{ font-size: 11.5px !important; }
  .qn-arch-feature{
    padding: 16px 12px !important;
    grid-column: 1 / -1 ;
  }
  .qn-arch-ar{ font-size: 15px !important; }
  .qn-arch-en{
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px !important;
  }
  .qn-arch-mark{ font-size: 15px !important; }
  .qn-arch-feature strong{ font-size: 10px !important; }
  .qn-options{
    position: static !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    gap: 10px 12px;
    padding: 12px;
  }
  .qn-options-head,
  .qn-pref-fields,
  .qn-options-kicker,
  .qn-juz-box{ grid-column: 1 / -1 ; }
  .qn-pref-fields{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
  }
  .qn-juz-grid{ grid-template-columns: repeat(6, minmax(0, 1fr)) ; gap: 6px; }
  .qn-juz-grid button{ min-height: 36px; font-size: 12px; }
  .qn-search{ flex: 1 1 100%; }
  .qn-explorer{ flex-direction: column; align-items: stretch; gap: 8px; }
  .qn-explorer-actions{ flex-wrap: wrap; }
  .qn-table-head{ padding: 14px 12px 10px; flex-wrap: wrap; }
  .qn-table-head h2{ font-size: 18px; }
  .qn-table{ font-size: 10.5px; }
  .qn-table th{
    padding: 7px 2px;
    font-size: 8px;
    letter-spacing: .02em;
  }
  .qn-table td{ padding: 8px 4px; }
  .qn-table th:nth-child(1),
  .qn-table td:nth-child(1){
    width: 40px !important;
    min-width: 40px;
    padding-left: 8px !important;
    padding-right: 12px !important;
  }
  .qn-table th:nth-child(2),
  .qn-table td:nth-child(2){
    width: 22%;
    padding-left: 4px !important;
  }
  .qn-table th:nth-child(3),
  .qn-table td:nth-child(3){ width: 16%; }
  .qn-table th:nth-child(4),
  .qn-table td:nth-child(4){ width: 10%; }
  .qn-table th:nth-child(5),
  .qn-table td:nth-child(5){ width: 14%; }
  .qn-table th:nth-child(6),
  .qn-table td:nth-child(6){ width: 32%; }
  .qn-num{ width: 26px; height: 26px; font-size: 10px; }
  .qn-name-en{ font-size: 11px; padding-left: 2px; }
  .qn-ar{ font-size: 13px; }
  .qn-type{ padding: 1px 4px; font-size: 8.5px; }
  .qn-row-actions{ gap: 2px; }
  .qn-row-actions button{
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-radius: 6px;
  }
  .qn-res-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ; gap: 8px; }
  .qn-subject-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ; gap: 8px; }
  .qn-res, .qn-subject{ min-width: 0; max-width: 100%; }
  .qn-res img{ height: 72px !important; min-height: 72px !important; }
  .qn-res div{ padding: 6px 8px 10px; }
  .qn-res em{ font-size: 10px; }
  .qn-res strong{ font-size: 13px; }
  .qn-res span{ font-size: 11px; line-height: 1.35; }
  .qn-subject{ padding: 10px 10px 10px 12px !important; }
  .qn-subject strong{ font-size: 13.5px !important; }
  .qn-subject span{ font-size: 11.5px !important; }
  .qn-section-head{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
  }
  .qn-section-head h2{ font-size: clamp(18px, 5vw, 22px); }
  .qn-section-head p{ font-size: 13px; max-width: 100%; }
  .qn-empty{ padding: 18px 12px; font-size: 13px; }
}

/* Phone only - stack preferences above table */
@media (max-width: 640px){
  .qn-index-wrap{
    grid-template-columns: 1fr ;
    gap: 12px !important;
  }
  .qn-options{
    position: static !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    gap: 10px 12px !important;
  }
  .qn-options-head,
  .qn-pref-fields,
  .qn-options-kicker,
  .qn-juz-box{ grid-column: auto ; }
  .qn-juz-grid{ grid-template-columns: repeat(6, minmax(0, 1fr)) ; }
}

/* Phone ~320-380 */
@media (max-width: 380px){
  body.quran-page .qn-main{
    padding: 0 0 22px !important;
    gap: 10px;
  }
  .qn-hero{
    min-height: 0 !important;
    height: auto !important;
    border-radius: 0 !important;
    width: 100% !important;
    background: transparent !important;
  }
  .qn-hero-stage{
    padding: 80px 14px 20px !important;
    min-height: 0 !important;
    height: auto !important;
    justify-content: flex-end;
  }
  .qn-hero-card{
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .qn-hero-card h1{ font-size: 24px; color: #3C2415; }
  .qn-hero-cta{
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .qn-btn-gold, .qn-btn-ghost{ width: 100%; justify-content: center; }
  .qn-arches{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    padding: 10px !important;
    gap: 8px !important;
  }
  .qn-arch{
    padding: 12px 8px 10px !important;
    min-height: 90px;
  }
  .qn-arch strong{ font-size: 13px !important; }
  .qn-arch > span:last-child{ font-size: 11px !important; }
  .qn-arch-icon{ width: 52px !important; height: 52px !important; padding: 0 !important; }
  .qn-arch-icon img{ width: 100% !important; height: 100% !important; }
  .qn-arch-feature{
    grid-column: 1 / -1 ;
    padding: 14px 12px !important;
  }
  .qn-arch-ar{ font-size: 15px !important; }
  .qn-arch-en{
    display: -webkit-box !important;
    font-size: 11.5px !important;
  }
  /* Preferences: 1 column so nothing clips */
  .qn-options{
    grid-template-columns: 1fr ;
    padding: 10px;
    gap: 10px;
  }
  .qn-juz-grid{
    grid-template-columns: repeat(5, minmax(0, 1fr)) ;
    gap: 5px;
  }
  .qn-juz-grid button{
    min-height: 34px;
    font-size: 11px;
    border-radius: 9px;
  }
  .qn-explorer-actions{ gap: 6px; }
  .qn-chip{ padding: 8px 12px; font-size: 12px; }
  /* Themes + resources: single column - no right clip */
  .qn-subject-grid,
  .qn-res-grid{
    grid-template-columns: 1fr ;
    gap: 10px;
  }
  .qn-res img{ height: 120px !important; min-height: 120px !important; }
  /* Table: keep fit, hide Type to free space */
  .qn-table th:nth-child(5),
  .qn-table td:nth-child(5){ display: none !important; }
  .qn-table th:nth-child(2),
  .qn-table td:nth-child(2){ width: 24%; }
  .qn-table th:nth-child(3),
  .qn-table td:nth-child(3){ width: 18%; }
  .qn-table th:nth-child(6),
  .qn-table td:nth-child(6){ width: 34%; }
  .qn-row-actions button{ width: 22px; height: 22px; font-size: 9px; }
}

/* Mobile & smaller - never squeeze 5 arches in one row */
@media (max-width: 700px){
  .qn-arches{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    gap: 10px !important;
    padding: 12px !important;
  }
  .qn-arch-feature{
    grid-column: 1 / -1 ;
  }
  .qn-arch-en{
    display: -webkit-box !important;
  }
}

@media (max-width: 420px){
  .qn-arches{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
    gap: 8px !important;
    padding: 10px !important;
  }
  .qn-arch-feature{ grid-column: 1 / -1 ; }

  /* Space between # badge and English name */
  .qn-table th:nth-child(1),
  .qn-table td:nth-child(1){
    width: 36px !important;
    min-width: 36px;
    padding-left: 8px !important;
    padding-right: 10px !important;
  }
  .qn-table th:nth-child(2),
  .qn-table td:nth-child(2){
    padding-left: 6px !important;
    width: 28% !important;
  }
  .qn-num{
    width: 26px !important;
    height: 26px !important;
    font-size: 10px !important;
    margin: 0;
  }
  .qn-name-en{
    padding-left: 2px;
    line-height: 1.25;
  }
}
/* ===== Canonical responsive (owns arches / index stacking) ===== */
@media (max-width: 1023px){
  body.quran-page .qn-main{ padding-inline: 0; }
  body.quran-page .qn-main > *:not(.qn-hero){
    padding-inline: var(--page-pad-x, 16px);
  }
  body.quran-page .qn-main > .qn-bookmarks,
  body.quran-page .qn-main > .qn-related-tools{
    margin-inline: var(--page-pad-x, 16px);
    width: auto;
    max-width: none;
  }
  body.quran-page .qn-hero{
    width: 100%;
    padding-inline: 0;
    border-radius: 0;
    margin: 0;
  }
  .qn-index-wrap{
    grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
    gap: 12px;
  }
}
@media (max-width: 767px){
  .qn-arches{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
  .qn-arch-feature{ grid-column: 1 / -1; }
  .qn-arch-en{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .qn-index-wrap{ grid-template-columns: 1fr; gap: 12px; }
  .qn-options{
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
  }
  .qn-options-head,
  .qn-pref-fields,
  .qn-options-kicker,
  .qn-juz-box{ grid-column: 1 / -1; }
  .qn-pref-fields{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
  }
  .qn-table-panel{
    height: auto !important;
    max-height: none !important;
  }
  .qn-table-scroll{
    flex: none;
    height: clamp(280px, 52vh, 560px) !important;
    max-height: clamp(280px, 52vh, 560px) !important;
    margin: 0 10px 10px;
  }
}
@media (max-width: 479px){
  .qn-options{ grid-template-columns: 1fr; }
  .qn-subject-grid,
  .qn-res-grid{ grid-template-columns: 1fr; }
}

/* First-paint: skip layout of below-fold blocks */
.qn-bookmarks,
.qn-subjects,
.qn-resources,
.qn-related-tools,
.qn-seo-faq,
.site-subscribe,
.site-footer{
  content-visibility: auto;
  contain-intrinsic-size: 1px 520px;
}
.qn-hero{ contain: none; }
body.quran-page .site-subscribe{width:100%;padding:24px 16px;box-sizing:border-box}
body.quran-page .site-subscribe-inner{max-width:1120px;margin:0 auto;padding:28px 18px;text-align:center;border:1px solid #e0c98a;border-radius:16px;background:#fffaf2}
body.quran-page .site-subscribe-kicker{margin:0 0 8px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#a67c2a}
body.quran-page .site-subscribe h2{margin:0 0 8px;font-size:1.35rem;color:#3c2415}
body.quran-page .site-subscribe-lead{margin:0 auto 16px;max-width:480px;font-size:14px;color:#6e5a4a}
body.quran-page .site-subscribe-form{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
body.quran-page .site-subscribe-form input{flex:1 1 180px;min-height:42px;border:1px solid #e6d9c4;border-radius:10px;padding:8px 12px}
body.quran-page .site-subscribe-btn{border:0;border-radius:10px;padding:10px 16px;background:#c9a24a;color:#3c2415;font-weight:700}
body.quran-page .site-subscribe-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}

/* Reading Preferences sidebar permanently removed from layout (all breakpoints) */
.qn-index-wrap{
  grid-template-columns: minmax(0, 1fr) !important;
}
.qn-options{
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* Thematic Index removed from layout */
.qn-subjects{
  display: none !important;
}

/* Learning Resources removed from layout */
.qn-resources{
  display: none !important;
}
/* ===== RESPONSIVE FINAL - reader: ayah rail becomes a top strip, Arabic uses full width ===== */
@media (max-width: 900px){
  body.qn-reading .qn-reader-layout,
  body.qn-reading .qn-reader-layout:has(.qn-ayah-nav--para),
  .qn-reader-layout{ grid-template-columns: minmax(0, 1fr) !important; gap: 8px; padding: 0 12px 0 !important; }
  .qn-ayah-nav, .qn-ayah-nav--para{
    width: 100% !important; max-height: none; flex-direction: row; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 14px; box-sizing: border-box; min-width: 0;
  }
  body.qn-reading .qn-reader-toolbar{
    border-bottom: 0;
    box-shadow: none;
  }
  body.qn-reading .qn-ayah-nav,
  body.qn-reading .qn-ayah-nav--para{
    position: sticky;
    top: calc(var(--header-h, 72px) + var(--qn-tool-h, 43px));
    z-index: 40;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid rgba(60, 36, 21, 0.12);
    background: #FFFCF7;
    box-shadow: none;
  }
  .qn-ayah-nav-label{ margin: 0; flex: 0 0 auto; font-size: 10px; }
  .qn-ayah-nav-scroll{ flex: 1 1 auto; min-width: 0; overflow-x: auto !important; overflow-y: hidden !important; scrollbar-gutter: auto; padding: 0; -webkit-overflow-scrolling: touch; }
  .qn-ayah-nav-list{ flex-direction: row; align-items: center; gap: 6px; padding: 2px 0 6px; width: max-content; }
  .qn-ayah-nav-group{ margin: 0 4px; white-space: nowrap; }
  .qn-ayah-nav-btn{ flex: 0 0 auto; width: 38px; height: 34px; }
  .qn-reader-main{ padding: 0 !important; min-width: 0; }
  .qn-ayah-ar{ font-size: calc(var(--qn-ar-size, 40px) * .8) !important; line-height: 1.7 !important; overflow-wrap: break-word; }
  .qn-ayah-pair .qn-ayah-ar, .qn-ayah-head .qn-ayah-ar{ width: 100%; }
}
@media (max-width: 600px){
  .qn-ayah-ar{ font-size: calc(var(--qn-ar-size, 40px) * .68) !important; }
  .qn-ayah-ar--bismi{ font-size: calc(var(--qn-ar-size, 40px) * .72) !important; }
  .qn-ayah-row, .qn-ayah-head{ gap: 8px; }
  .qn-ayah-en{ font-size: min(var(--qn-en-size, 16px), 16px); }
}
/* intro sizing handled above in the shared 720px block */

/* Text on the hero photo needs a solid panel so it stays readable */
@media (max-width: 900px){
  body.quran-page .qn-hero-card{
    background: rgba(255,252,247,.92) !important;
    padding: 16px 16px 18px !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 28px rgba(28,20,16,.18) !important;
  }
  body.quran-page .qn-hero-card h1,
  body.quran-page .qn-hero-lead{
    color: #2A1A10 !important;
    text-shadow: none !important;
  }
  body.quran-page .qn-hero-card h1 span{ color: #8A6414 !important; }
}
