.reader-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.script-switch{display:flex;align-items:center;gap:9px;min-height:44px;padding:5px 6px 5px 14px;background:var(--soft);border-radius:999px;color:var(--muted);font-size:.875rem;font-weight:700}
.script-switch select{min-height:34px;max-width:100%;padding:4px 10px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--navy);font:inherit}
.script-switch select:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
@media(max-width:560px){.reader-controls{width:100%}.script-switch{max-width:100%}}
.hadith-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:end}
.hadith-controls label{display:grid;gap:5px;color:var(--navy);font-size:.85rem;font-weight:700}
.hadith-controls select{max-width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:white;color:var(--navy);font:inherit}
.quran-reader{min-width:0}
.quran-ayahs.script-uthmani.continuous,.quran-ayahs.script-tajweed.continuous,
.quran-ayahs.script-uthmani.verse .qtext,.quran-ayahs.script-tajweed.verse .qtext{font-family:'UthmanicHafs','Amiri',serif}
.qword{display:inline;padding:0 2px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;line-height:inherit;white-space:nowrap}
.qword.selected,.qword:focus-visible{background:#d6f2eb;outline:1px solid #81c8b6}
.word-meaning{position:fixed;z-index:9000;pointer-events:none;max-width:min(17rem,calc(100vw - 16px));background:#073b4c;color:#fff;border-radius:10px;padding:6px 12px;font:600 14px/1.4 'DM Sans',sans-serif;box-shadow:0 4px 16px #073b4c33}
.q-unavailable{font:500 14px/1.4 'DM Sans',sans-serif}
.tj-ham_wasl,.tj-laam_shamsiyah,.tj-slnt{color:#777}
.tj-madda_normal{color:#1662bd}
.tj-madda_permissible{color:#18609c}
.tj-madda_obligatory{color:#c62828}
.tj-madda_necessary{color:#8b2038}
.tj-qlq,.tj-qalaqah{color:#ad301b}
.tj-ghn,.tj-ghunnah,.tj-ikhf,.tj-ikhafa,.tj-ikhf_shfw,.tj-ikhafa_shafawi,.tj-idgh_ghn,.tj-idgham_w_ghunnah,.tj-idgham_ghunnah{color:#217240}
.tj-idgh_w_ghn,.tj-idgham_wo_ghunnah,.tj-idghm_shfw,.tj-idgham_shafawi,.tj-idgh_mus,.tj-idgham_mutajanisayn,.tj-idgham_mutaqaribayn{color:#7c3c90}
.tj-iqlb,.tj-iqlab{color:#126e77}
.hadith-controls{margin-bottom:18px}
.hadith-controls label{flex:1;min-width:min(100%,210px)}
.hadith-controls a{padding:8px 0;color:var(--teal);font-weight:700}
.hadith-heading,.hadith-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 26px}
.hadith-heading{padding:16px 20px;margin:18px 0 12px;border-radius:12px;background:var(--navy);color:white;align-items:center}
.hadith-heading h3{font:700 18px Manrope;margin:0}
.hadith-heading .arabic{font:700 23px/1.6 Amiri,serif;margin:0}
.hadith-card{margin-bottom:12px;padding:18px 20px;border:1px solid var(--line);border-radius:14px;background:#fff}
.hadith-card .arabic{font:400 24px/1.9 'Amiri',serif;white-space:pre-line}
.hadith-card p{margin:0}
.hadith-card strong{display:block;margin-bottom:8px;color:var(--navy)}
.hadith-card footer{grid-column:1/-1;border-top:1px solid var(--line);padding-top:10px;color:var(--muted);font-size:.85rem}
.hadith-pages:not([hidden]){display:flex;justify-content:center;align-items:center;gap:14px;margin-top:20px}
.calendar-shell .calendar-top{padding-bottom:16px;border-bottom:1px solid var(--line)}
.calendar-shell #qo-date{margin:4px 0;color:var(--teal);font-weight:700}
.calendar-shell .cal-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin:18px 0;text-align:center}
.calendar-shell .cal-grid>strong{color:var(--muted);font-size:.8rem}
.calendar-shell .cal-day{min-width:0;min-height:65px;padding:7px 2px;background:var(--soft);border:1px solid var(--line);color:var(--navy);border-radius:10px;display:grid;align-content:center;justify-items:center;gap:3px}
.calendar-shell .cal-day small{font-size:.73rem;white-space:normal;line-height:1.2;color:inherit}
.calendar-shell .cal-day[aria-current]{border-color:var(--teal)}
.calendar-shell .cal-day[aria-pressed="true"]{background:var(--teal);color:#fff}
.calendar-selection{padding:10px 14px;background:var(--mint-2);border-radius:10px;color:var(--navy);font-weight:700}
@media(max-width:600px){
  .hadith-card,.hadith-heading{grid-template-columns:1fr;padding:14px}
  .hadith-card .arabic,.hadith-heading .arabic{grid-row:1}
  .calendar-shell{padding:12px}
  .calendar-shell .cal-grid{gap:3px}
  .calendar-shell .cal-day{min-height:54px}
  .calendar-shell .cal-day small{font-size:.66rem}
  .quran-ayahs.continuous,.quran-ayahs.verse .qtext{font-size:26px}
}
.qword-glyph{display:none;font-size:1.04em;font-weight:400;line-height:inherit}
.qword-glyph.glyph-ready{display:inline}
.qword-original:has(+ .glyph-ready){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.script-tajweed .qword-glyph{font-palette:normal}
.quran-ayahs.mushaf-reading{container-type:inline-size;text-align:center}
.mushaf-line{display:flex;justify-content:center;align-items:baseline;column-gap:.12em;white-space:nowrap;min-height:1.7em;font-size:var(--line-size,clamp(19px,5.7cqw,42px));line-height:1.7}
.mushaf-line .qword,.mushaf-line .mushaf-marker{flex:none;padding-inline:0}
.mushaf-line .qword-glyph{font-size:1em}
.library-search{min-width:0;position:relative}
.library-search input[type=search],.surahlist .library-search input[type=search]{width:100%;min-height:44px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--navy);padding:9px 12px;font:inherit}
.surahlist .library-search{padding:10px;background:var(--soft)}
.search-empty{padding:12px}
.library-search input:focus,.hadith-controls select:focus{outline:2px solid var(--teal);outline-offset:2px}
.script-switch{padding:0 10px 0 14px;min-height:46px}
.script-switch select{appearance:none;min-height:42px;border:0;padding:8px 25px 8px 5px;background:transparent;color:var(--navy)}
.script-switch{position:relative}
.script-switch::after{content:'';position:absolute;right:19px;bottom:20px;width:6px;height:6px;transform:rotate(45deg);border:solid var(--teal);border-width:0 2px 2px 0;pointer-events:none}
.hadith-controls{background:var(--soft);border:1px solid var(--line);border-radius:16px;padding:14px}
.hadith-controls select{min-height:44px;border-radius:12px}
.hadith-card{border-block-start:3px solid var(--teal)}
.hadith-card-title{display:flex;align-items:center;gap:10px;grid-column:1/-1;border-bottom:1px solid var(--line);padding-bottom:8px;color:var(--navy);font-weight:700}
.hadith-number{background:var(--teal);color:#fff;padding:5px 10px;border-radius:999px;white-space:nowrap}
.hadith-card .arabic,.hadith-heading .arabic{font-family:'UthmanicHafs','Amiri',serif}
.hadith-card .arabic{color:var(--navy);overflow-wrap:anywhere}
.hadith-isnad{color:#42776e}
.hadith-matn{color:#123855}
@media(max-width:600px){.hadith-card .arabic{grid-row:2}.hadith-card-title{grid-row:1}}
.hadith-controls label{min-width:0;flex:1 1 210px}
.hadith-controls :is(select,input){min-width:0;width:100%}
@media(max-width:600px){.hadith-controls label{flex-basis:100%}}

/* V9 reader layout */
#ayahs{max-height: min(72vh,850px);overflow-y:auto;overscroll-behavior-y:auto;scrollbar-gutter:stable;min-width:0}
#ayahs.script-indopak.continuous{width:100%;margin-inline:0;padding:10px 4px;line-height:2.45}
#ayahs .ayah-end{display:inline-block;white-space:nowrap;font-family:Amiri,serif}
.library-search{min-width:0}.surahlist .library-search input{margin:0;box-sizing:border-box}
.surah-scroll button{display:grid;grid-template-columns:minmax(0,1fr) minmax(72px,auto);align-items:center;gap:12px}.surah-scroll .ar{text-align:right;direction:rtl;line-height:1.8}
.reading-layout[data-script=indopak] .ar,.reading-layout[data-script=indopak] #surahTitle::after{font-family:IndoPak,serif}
.reading-layout[data-script=uthmani] .ar,.reading-layout[data-script=tajweed] .ar,.reading-layout[data-script=uthmani] #surahTitle::after,.reading-layout[data-script=tajweed] #surahTitle::after{font-family:UthmanicHafs,serif}
#surahTitle::after{content:attr(data-arabic);display:block;font-size:.8em;line-height:1.8;color:var(--teal)}

/* V10: native IndoPak text and nested scrolling */
#ayahs.script-indopak{width:100%;margin-inline:0;box-sizing:border-box;}
#ayahs.script-indopak.continuous{max-width:100%;text-align:justify;font-size:clamp(24px,3.1vw,36px);line-height:2.45;word-spacing:normal;}
#ayahs.script-indopak .qword{padding-inline:0;}
#ayahs.script-indopak .ayah-circle{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:2.1em;height:2.1em;margin-inline:.2em;border:3px double currentColor;border-radius:50%;color:var(--teal);font:normal .62em/1 Amiri,serif;vertical-align:middle;direction:ltr;white-space:nowrap}
#ayahs .ayah-end{unicode-bidi:isolate;}
/* Hadith punctuation uses ordinary Arabic glyphs, not Quran-specific punctuation glyphs. */
.hadith-punctuation{font-family:Amiri,serif;}
