:root{
  --green:#6f5433; --green2:#5d4527; --gold:#c8a048; --cream:#ece1cc;
  --ink:#33261a; --muted:#7d6b52; --card:#f4ebd6; --line:#d9caa9;
}
*{box-sizing:border-box; margin:0; padding:0}
body{font-family:'Tajawal',sans-serif; background:var(--cream); color:var(--ink); min-height:100vh}
.top{background:linear-gradient(135deg,var(--green),var(--green2)); color:#fff; padding:16px 18px; display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:3px solid var(--gold)}
.brand{display:flex; align-items:center; gap:12px}
.logo{font-size:30px}
.top h1{font-size:26px; font-weight:800; letter-spacing:.5px}
.tagline{font-size:12px; opacity:.85}
.hijri-chip{background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.3); border-radius:20px; padding:6px 12px; font-size:13px; white-space:nowrap}
.tabs{display:flex; overflow-x:auto; background:var(--green); position:sticky; top:0; z-index:10; scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs button{flex:1; min-width:70px; background:none; border:none; color:#ead9bd; font-family:inherit; font-size:14px; font-weight:700; padding:12px 6px; cursor:pointer; border-bottom:3px solid transparent}
.tabs button.active{color:#fff; border-bottom-color:var(--gold)}
main{max-width:760px; margin:0 auto; padding:14px}
.tab{display:none}
.tab.active{display:block}
.card{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px; margin-bottom:14px; box-shadow:0 1px 4px rgba(94,72,45,.08)}
.card h2{color:var(--green); font-size:19px; margin-bottom:12px; padding-bottom:8px; border-bottom:2px solid var(--gold); display:inline-block}
.hint{color:var(--muted); font-size:13px; margin:8px 0 12px}
.src-note{color:var(--muted); font-size:11.5px; margin-top:12px; line-height:1.6}
.btn{background:var(--green); color:#fff; border:none; border-radius:10px; padding:11px 18px; font-family:inherit; font-size:14px; font-weight:700; cursor:pointer; margin-top:10px}
.btn:active{background:var(--green2)}
.btn.ghost{background:transparent; color:var(--green); border:2px solid var(--green)}
.mini{background:none; border:1px solid var(--line); border-radius:16px; padding:4px 10px; font-family:inherit; font-size:12px; color:var(--green); cursor:pointer; font-weight:700}
.loc-line{display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:14px; font-weight:700}
.loc-search{display:flex; gap:6px; margin-top:8px}
.loc-search input{flex:1; font-family:inherit; font-size:13px; padding:7px 10px; border:1px solid var(--line); border-radius:16px; color:var(--ink)}
.next-box{text-align:center; padding:18px 0 8px}
.next-label{font-size:13px; color:var(--muted)}
.next-name{font-size:28px; font-weight:800; color:var(--green); margin:4px 0}
.next-count{font-size:20px; font-weight:700; color:var(--gold); font-variant-numeric:tabular-nums; direction:ltr}
.times-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px}
.time-cell{border:1px solid var(--line); border-radius:10px; padding:10px 6px; text-align:center}
.time-cell b{display:block; color:var(--green); font-size:14px}
.time-cell span{font-size:13px; color:var(--ink); font-variant-numeric:tabular-nums}
.time-cell.now{background:var(--green); border-color:var(--green)}
.time-cell.now b,.time-cell.now span{color:#fff}
.hijri-today{font-size:17px; font-weight:700; color:var(--green); margin-bottom:10px}
.hijri-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:4px; text-align:center; font-size:12px}
.hijri-grid .wd{font-weight:800; color:var(--muted); padding:4px 0}
.hijri-grid .d{padding:6px 0; border-radius:8px; border:1px solid transparent}
.hijri-grid .d.today{background:var(--green); color:#ffe9a8; font-weight:800; border-radius:50%; border:2px solid var(--gold); box-shadow:0 0 0 2px var(--cream), 0 0 8px rgba(200,160,72,.55)}
body.dark .hijri-grid .d.today{color:#ffe9a8; box-shadow:0 0 0 2px #191410, 0 0 8px rgba(200,160,72,.55)}
.quran-controls{display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap}
.view-toggle{display:flex; gap:8px; margin-bottom:14px}
.view-toggle button{flex:1; background:#e6d9ba; color:var(--green); border:1px solid var(--line); border-radius:10px; padding:9px; font-family:inherit; font-size:14px; font-weight:700; cursor:pointer}
.view-toggle button.active{background:var(--green); color:#fff}
.page-controls{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.page-ind{font-weight:800; color:var(--green); font-size:14px}
.page-jump{display:flex; gap:6px; margin-bottom:12px}
.page-jump input{flex:1; font-family:inherit; font-size:13px; padding:7px 10px; border:1px solid var(--line); border-radius:16px; color:var(--ink)}
.ayahs.mushaf{border:2px solid var(--gold); border-radius:12px; padding:16px 14px; background:#f5ecd4; touch-action:pan-y}
.swipe-hint{text-align:center; color:var(--muted); font-size:12px; margin-bottom:8px}
.page-flip{animation:flip .25s ease}
@keyframes flip{from{opacity:.3}to{opacity:1}}
.surah-banner{text-align:center; font-family:'Amiri',serif; font-weight:700; color:var(--green); border:1.5px solid var(--gold); border-radius:10px; background:#e9dcba; padding:6px 10px; margin:10px 0 8px; font-size:19px}
select{flex:1; min-width:180px; font-family:inherit; font-size:15px; padding:10px; border:1px solid var(--line); border-radius:10px; background:#faf3e2; color:var(--ink)}
.bismillah{font-family:'Amiri',serif; text-align:center; font-size:24px; color:var(--green); margin:10px 0 4px}
.ayahs{font-family:'Amiri',serif; font-size:22px; line-height:2.3; text-align:justify; color:var(--ink)}
.ayahs .aya{cursor:pointer; border-radius:8px; padding:0 2px}
.ayahs .aya:hover{background:#e7dab9}
.ayahs .aya.sel{background:#e2d2a8}
.ayahs .num{color:var(--gold); font-size:16px; margin:0 4px}
.tafsir-box{background:#eadfc4; border:1px solid var(--gold); border-radius:10px; padding:14px; margin-top:14px; font-size:15px; line-height:1.9}
.tafsir-box b{color:var(--green)}
.audio-now{margin:8px 0; font-size:13px; color:var(--muted)}
audio{width:100%; margin-top:8px}
.dhikr{border:1px solid var(--line); border-radius:12px; padding:14px; margin-bottom:10px; cursor:pointer; transition:background .15s}
.adhkar-search{width:100%; font-family:inherit; font-size:13px; padding:9px 12px; border:1px solid var(--line); border-radius:16px; color:var(--ink); margin-bottom:12px}
#adhkarCats{display:grid; grid-template-columns:repeat(2,1fr); gap:8px}
.cat-btn{background:#faf3e2; border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-family:inherit; font-size:13px; font-weight:700; color:var(--green); cursor:pointer; text-align:right; display:flex; justify-content:space-between; align-items:center; gap:6px}
.cat-btn span{color:var(--gold); font-size:12px; font-weight:800; white-space:nowrap}
.adhkar-cat-title{color:var(--green); font-size:17px; margin-bottom:10px}
.dhikr .txt{font-size:16.5px; line-height:2; font-family:'Amiri',serif}
.dhikr .count{display:flex; align-items:center; justify-content:space-between; margin-top:10px; font-size:13px; color:var(--muted)}
.dhikr .badge{background:var(--green); color:#fff; border-radius:16px; padding:3px 12px; font-weight:700; font-size:13px; min-width:52px; text-align:center}
.dhikr.done{background:#e5d8ba; border-color:var(--green2)}
.dhikr.done .badge{background:var(--gold)}
.hadith-text{font-size:17px; line-height:2.1; font-family:'Amiri',serif}
.hadith-src{color:var(--muted); font-size:13px; margin-top:10px}
footer{text-align:center; padding:10px 16px 30px}

/* ---------- header tools / logo ---------- */
.logo-img{width:44px; height:44px; border-radius:50%; border:2px solid var(--gold); background:#fff}
.hdr-side{display:flex; flex-direction:column; align-items:flex-end; gap:6px}
.hdr-tools{display:flex; gap:6px}
.hdr-btn{background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.3); color:#fff; border-radius:16px; padding:3px 10px; font-family:inherit; font-size:13px; cursor:pointer; font-weight:700}

/* ---------- dark mode ---------- */
body.dark{--cream:#191410; --ink:#ece1cd; --muted:#ab9a80; --card:#241c13; --line:#3d3122}
body.dark .card{box-shadow:0 1px 4px rgba(0,0,0,.35)}
body.dark select, body.dark .cat-btn, body.dark .loc-search input, body.dark .page-jump input, body.dark .adhkar-search{background:#2c2115; color:var(--ink); border-color:var(--line)}
body.dark .view-toggle button{background:#2c2115; color:var(--ink)}
body.dark .view-toggle button.active{background:var(--green2); color:#fff}
body.dark .ayahs.mushaf{background:#211a12}
body.dark .ayahs .aya:hover{background:#33281a}
body.dark .ayahs .aya.sel{background:#3d2f1d}
body.dark .surah-banner{background:#2c2115}
body.dark .tafsir-box{background:#2c2115}
body.dark .dhikr.done{background:#2a2013}
body.dark .mini{color:#d9bd8c; border-color:var(--line)}
body.dark .btn.ghost{color:#d9bd8c; border-color:#d9bd8c}
body.dark .wird-bar{background:#2c2115}

/* ---------- adhan ---------- */
.adhan-line{display:flex; align-items:center; gap:10px; margin-top:12px}

/* ---------- wird ---------- */
.wird-row{display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:14px; font-weight:700; color:var(--green)}
.wird-row select{flex:0 1 auto; min-width:120px; padding:6px 10px; font-size:13px}
.wird-bar{height:12px; background:#ddd0b0; border-radius:8px; margin:12px 0 8px; overflow:hidden}
.wird-fill{height:100%; width:0%; background:linear-gradient(90deg,var(--green),var(--gold)); border-radius:8px; transition:width .3s}
.wird-status{font-size:13px; color:var(--muted)}

/* ---------- bookmarks ---------- */
.bm-bar{display:flex; justify-content:flex-start; margin-bottom:10px}
.bm-list{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
.bm-item{display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--line); border-radius:10px; padding:8px 12px; background:transparent; font-family:inherit; font-size:13px; color:var(--ink); cursor:pointer; text-align:right}
.bm-item b{color:var(--green)}
body.dark .bm-item b{color:#d9bd8c}
.bm-del{background:none; border:none; color:var(--muted); cursor:pointer; font-size:13px; padding:2px 6px}
.bm-page-btn{display:block; margin:0 auto 10px}
.aya.bookmarked{border-bottom:2px dotted var(--gold)}

/* ---------- tasbih ---------- */
.tasbih-card{text-align:center}
.tasbih-card select{flex:none; min-width:0; width:100%; margin-bottom:12px}
.tasbih-tap{display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; width:100%; min-height:150px; background:linear-gradient(135deg,var(--green),var(--green2)); color:#fff; border:none; border-radius:16px; cursor:pointer; font-family:inherit; padding:18px}
.tasbih-tap:active{transform:scale(.985)}
.tasbih-dhikr{font-family:'Amiri',serif; font-size:22px}
.tasbih-num{font-size:44px; font-weight:800; color:var(--gold)}
.tasbih-hint{font-size:12px; opacity:.8}
.tasbih-row{display:flex; justify-content:center; margin-top:10px}
.tasbih-stats{margin-top:14px; border-top:1px solid var(--line); padding-top:12px; font-size:13px; color:var(--muted); text-align:right}
.tasbih-stats .tbar{display:flex; align-items:center; gap:8px; margin-top:4px}
.tasbih-stats .tbar .d{width:52px; font-weight:700; color:var(--ink)}
.tasbih-stats .tbar .track{flex:1; height:8px; background:#ddd0b0; border-radius:6px; overflow:hidden}
body.dark .tasbih-stats .tbar .track{background:#2c2115}
.tasbih-stats .tbar .fill{height:100%; background:var(--gold)}
.tasbih-stats .tbar .v{width:48px; text-align:left; font-variant-numeric:tabular-nums}

/* ---------- library ---------- */
.lib-nav{display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap}
.lib-btn.active{background:var(--green); color:#fff; border-color:var(--green)}
.names-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:8px}
.name-cell{border:1px solid var(--line); border-radius:10px; padding:12px 6px; text-align:center; font-family:'Amiri',serif; font-size:18px; color:var(--green); background:transparent}
body.dark .name-cell{color:#e3c99b}
.name-cell span{display:block; font-size:10px; color:var(--muted); font-family:'Tajawal',sans-serif; margin-top:2px}
.prophet-card{border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:10px}
.prophet-card h3{color:var(--green); font-size:16px; margin-bottom:4px}
body.dark .prophet-card h3{color:#d9bd8c}
.prophet-card p{font-size:13px; color:var(--muted); line-height:1.7; margin-bottom:8px}
.prophet-links{display:flex; flex-direction:column; gap:6px}
.yt-link{display:flex; align-items:center; gap:8px; text-decoration:none; font-size:13px; font-weight:700; color:#c00; border:1px solid var(--line); border-radius:10px; padding:8px 12px}
.yt-link span{color:var(--muted); font-weight:400}
.dua-item{border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:10px; font-family:'Amiri',serif; font-size:17px; line-height:2}
.dua-item span{display:block; font-family:'Tajawal',sans-serif; font-size:12px; color:var(--muted); margin-top:6px}

/* ---------- tafsir picker ---------- */
.tafsir-head{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; flex-wrap:wrap}
.tafsir-head b{color:var(--green); font-size:15px}
.tafsir-head select{flex:0 1 auto; min-width:170px; padding:6px 10px; font-size:13px}
body.dark .tafsir-head b{color:#d9bd8c}

/* Adhan audio */
.adhan-overlay{position:fixed;inset:0;background:rgba(30,22,12,.72);display:flex;align-items:center;justify-content:center;z-index:9999;padding:20px}
.adhan-card{background:#f4ebd6;border-radius:18px;padding:26px 22px;max-width:340px;width:100%;text-align:center;display:flex;flex-direction:column;gap:14px;box-shadow:0 18px 60px rgba(0,0,0,.4)}
.adhan-now{font-size:20px;font-weight:700;color:#8a6b4a}
.adhan-big{font-size:19px;padding:14px 18px;background:#8a6b4a;color:#fff;border-radius:14px}
.adhan-bar{position:fixed;bottom:14px;left:14px;right:14px;background:#8a6b4a;color:#fff;border-radius:14px;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;z-index:9998;box-shadow:0 10px 30px rgba(0,0,0,.35);font-weight:700}
.adhan-bar .mini{background:#c8a048;color:#3e2f22;border:none}
select.mini{padding:6px 10px;border-radius:10px;border:1px solid #e0d5bd;background:#fff;font-family:inherit}
.ayah-audio-row{display:flex;gap:8px;align-items:center;margin-top:10px;flex-wrap:wrap}

/* Madinah mushaf page layout */
.mushaf-frame{background:#f3e9d0;border:1px solid #e7dec6;border-radius:16px;padding:12px 12px 10px;box-shadow:inset 0 0 30px rgba(200,160,72,.08)}
.mushaf-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#6b5b2e;font-size:15px;padding:2px 6px 8px;border-bottom:2px solid #c8a048;margin-bottom:10px}
.mushaf-foot{display:flex;justify-content:center;margin-top:10px}
.mushaf-foot .pnum{border:2px solid #c8a048;border-radius:999px;padding:1px 20px;color:#6b5b2e;font-weight:700;background:#faf3e2;font-size:15px}
#pageAyahs.mushaf{direction:rtl;text-align:justify;line-height:2.05;color:#191919}
#pageAyahs.mushaf .aya{cursor:pointer;border-radius:6px;transition:background .15s}
#pageAyahs.mushaf .aya.sel{background:#f0dfae}
#pageAyahs .surah-banner{font-family:'ArefRuqaa',serif;text-align:center;color:#75573a;border:2px solid #c8a048;border-radius:12px;padding:4px 10px;margin:8px 0;font-size:20px;background:#faf3e2}
.lib-nav{display:flex;flex-wrap:wrap;gap:6px}

/* phone-friendly mushaf (v6) */
#pageAyahs.mushaf{overflow-x:auto}
#pageAyahs .qcf-line{white-space:nowrap;text-align:justify;text-align-last:justify}
#pageAyahs.mushaf.flow{line-height:2.15;text-align:justify;white-space:normal}
#pageAyahs .aya-mark{color:#8a6d1f;font-size:.85em}
.mushaf-tools{gap:6px;flex-wrap:wrap}
.mushaf-tools .zoom-ctl{display:inline-flex;gap:4px}
@media (max-width:600px){
  #tab-quran > *{padding-left:6px;padding-right:6px}
  .mushaf-frame{padding:8px 5px;border-radius:10px;margin:0 -4px}
  .ayahs.mushaf{padding:10px 6px}
  .mushaf-head{font-size:13px;padding:0 3px 6px}
  .swipe-hint{font-size:12px;margin:6px 0}
  .page-jump{gap:6px}
  #pageInput{flex:1;min-width:0}
}

/* full-screen mushaf */
body.mushaf-fs header.top, body.mushaf-fs nav.tabs{display:none}
body.mushaf-fs #tab-quran > *:not(.card:has(#pageView)):not(.src-note){display:none}
body.mushaf-fs #tab-quran > .card:has(#pageView){padding:0;border:none;background:none;box-shadow:none;margin:0}
body.mushaf-fs #pageView .bm-page-btn, body.mushaf-fs #pageView .page-jump, body.mushaf-fs #pageView .swipe-hint{display:none}
body.mushaf-fs #pageView{display:block !important;position:fixed;inset:0;z-index:55;background:var(--cream);overflow:auto;padding:52px 8px 12px}
body.mushaf-fs .mushaf-frame{max-width:720px;margin:0 auto}
#mushafFsExit{position:fixed;top:10px;inset-inline-start:10px;z-index:70;background:#8a6b4a;color:#fff;border:none;border-radius:999px;padding:8px 18px;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.3)}
body.mushaf-fs #tafsirBox{position:fixed;bottom:0;left:0;right:0;z-index:60;margin:0;border-radius:16px 16px 0 0;max-height:62dvh;overflow:auto;box-shadow:0 -4px 24px rgba(0,0,0,.25)}
.tasbih-row .tg{display:inline-flex;align-items:center;gap:5px;cursor:pointer}

.name-cell{cursor:pointer; transition:transform .15s}
.name-cell:active{transform:scale(.96)}
.name-cell.sel{background:var(--green); color:#fff}
.name-cell.sel span{color:#ffe9a8}
.name-card{background:#f4ebd6; border:1px solid #e8e0c8; border-radius:14px; padding:14px; margin-top:12px}
.name-card h3{color:var(--green); margin:0 0 8px; font-size:1.35em}
.name-meaning{font-size:1.05em; line-height:1.9; margin:0 0 8px}
.name-x summary{cursor:pointer; color:var(--blue, #75573a); font-weight:600; padding:6px 0}
.name-x p{line-height:2; color:#444; font-size:.95em}
.name-overlay{position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; display:flex; align-items:flex-end; justify-content:center}
.name-sheet{position:relative; width:100%; max-width:560px; max-height:82vh; overflow-y:auto; background:var(--bg,#fff); border-radius:18px 18px 0 0; padding:18px 14px 24px; box-shadow:0 -6px 24px rgba(0,0,0,.3); animation:nsUp .2s ease-out}
body.dark .name-sheet{background:#241c13}
.name-close{position:absolute; top:8px; left:10px; width:34px; height:34px; border:0; border-radius:50%; background:rgba(128,128,128,.2); font-size:16px; cursor:pointer; color:inherit}
.name-sheet .name-card{margin-top:10px}
@keyframes nsUp{from{transform:translateY(40px); opacity:.6}to{transform:none; opacity:1}}
.tafsir-sheet{font-size:15px; line-height:1.9}
.tafsir-sheet #tafsirBody{background:#eadfc4; border:1px solid var(--gold); border-radius:10px; padding:12px}
body.dark .tafsir-sheet #tafsirBody{background:#2c2115}
.wird-done-btn{display:block; width:100%; background:var(--green); color:#fff; border:2px solid var(--gold); border-radius:12px; padding:14px; font-family:inherit; font-size:17px; font-weight:800; cursor:pointer; margin:6px 0 10px; transition:transform .1s}
.wird-done-btn:active{transform:scale(.98)}
.wird-done-btn.done{background:var(--gold); color:var(--green); border-color:var(--green)}
.wird-cal{display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-top:10px}
.wc{aspect-ratio:1; border-radius:50%; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:11px; color:var(--muted); background:transparent}
.wc-done{background:var(--green); color:#ffe9a8; border-color:var(--gold); font-weight:800}
.wc-today{box-shadow:0 0 0 2px var(--gold)}
.wird-cal-legend{font-size:11px; color:var(--muted); margin-top:8px; display:flex; align-items:center; gap:6px}
.wird-cal-legend .wc-done{display:inline-block; width:12px; height:12px; border-radius:50%}
.hc-book-list{max-height:420px; overflow-y:auto; margin-top:10px}
.hc-book{display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px 8px; border-bottom:1px solid var(--line); cursor:pointer; font-size:14px}
.hc-book b{color:var(--green)}
body.dark .hc-book b{color:#d9bd8c}
.hc-book span{color:var(--muted); font-size:11px; white-space:nowrap}
.hc-book:active{background:#e3d6b6}
.hc-item{padding:10px 8px; border-bottom:1px solid var(--line); cursor:pointer; font-size:14px; line-height:1.8}
.hc-item b{color:var(--gold); margin-left:6px}
.hc-item:active{background:#e3d6b6}
.hc-book-title{color:var(--green); margin:10px 0 4px}
body.dark .hc-book-title{color:#d9bd8c}
.hc-goto{display:flex; gap:8px; margin-top:10px}
.hc-goto input{flex:1; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:13px}
.hc-filter{width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:13px; margin:8px 0}
.hc-sheet-body{background:#eadfc4; border:1px solid var(--gold); border-radius:10px; padding:14px; line-height:2}
body.dark .hc-sheet-body{background:#2c2115}
.wird-head{display:flex; align-items:center; gap:10px; width:100%; background:transparent; border:0; padding:4px 0; font-family:inherit; cursor:pointer; text-align:right}
.wird-head-title{color:var(--green); font-size:19px; font-weight:800; padding-bottom:8px; border-bottom:2px solid var(--gold)}
body.dark .wird-head-title{color:#d9bd8c}
.wird-head-status{flex:1; font-size:13px; color:var(--muted)}
.wird-head-chev{color:var(--muted); font-size:14px}
.wird-details{margin-top:12px}
.wird-rem-row{margin-top:10px}
.wird-rem-row input{padding:6px 10px; border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:13px}
.wird-cal-wrap{margin-top:12px}
.wird-cal-month{font-weight:800; color:var(--green); margin-bottom:8px; font-size:14px}
body.dark .wird-cal-month{color:#d9bd8c}
.wc-wd{text-align:center; font-size:10px; font-weight:800; color:var(--muted); padding:2px 0}
.wc-blank{aspect-ratio:1}
.wird-stats{display:flex; gap:8px; margin-top:10px}
.wird-stat{flex:1; text-align:center; border:1px solid var(--line); border-radius:10px; padding:10px 4px}
.wird-stat b{display:block; font-size:20px; color:var(--green)}
body.dark .wird-stat b{color:#d9bd8c}
.wird-stat span{font-size:11px; color:var(--muted)}
.wird-week{display:flex; gap:6px; margin-top:12px; justify-content:space-between}
.ww{flex:1; text-align:center}
.ww span{display:block; font-size:10px; color:var(--muted); margin-bottom:5px}
.ww i{display:block; width:14px; height:14px; margin:0 auto; border-radius:50%; border:1.5px solid var(--line); background:transparent}
.ww-done i{background:var(--green); border-color:var(--green)}
.ww-today i{box-shadow:0 0 0 2px var(--gold)}
.hc-reader{background:#eadfc4; border:1px solid var(--gold); border-radius:12px; padding:18px 14px; margin:12px 0; min-height:220px; touch-action:pan-y; user-select:none}
body.dark .hc-reader{background:#2c2115}
.hc-reader-num{color:var(--gold); font-weight:800; font-size:13px; margin-bottom:10px}
.hc-reader-text{font-size:17px; line-height:2.1}
.hc-reader-nav{display:flex; align-items:center; justify-content:space-between; gap:8px}
.hc-reader-ind{font-size:13px; color:var(--muted); font-weight:700}
.hc-book-coll{font-size:12px; color:var(--muted); font-weight:400}

/* ---------- bottom navigation ---------- */
:root{--nav-h:56px; --nav-safe:max(env(safe-area-inset-bottom,0px),14px)}
.tabs{position:fixed; top:auto; bottom:0; left:0; right:0; z-index:50; background:var(--green2); border-top:3px solid var(--gold); padding-bottom:var(--nav-safe); box-shadow:0 -3px 14px rgba(40,28,14,.28)}
.tabs button{color:#e3d0ae; padding:11px 4px 9px; font-size:14px; border-bottom:none; border-top:0; position:relative}
.tabs button.active{color:var(--gold)}
.tabs button.active::before{content:""; position:absolute; top:0; left:28%; right:28%; height:3px; border-radius:0 0 3px 3px; background:var(--gold)}
body{padding-bottom:calc(var(--nav-h) + var(--nav-safe) + 12px)}
.adhan-bar{bottom:calc(var(--nav-h) + var(--nav-safe) + 12px)}
body.mushaf-fs{padding-bottom:0}

/* ---------- no header: top bar inside prayer tab ---------- */
main{padding-top:calc(14px + env(safe-area-inset-top,0px))}
.topbar{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px}
.topbar .hijri-chip{background:var(--card); border:1px solid var(--line); color:var(--green); font-weight:700; font-size:14px; padding:7px 14px; border-radius:20px}
.gear-btn{width:40px; height:40px; border-radius:50%; background:var(--green); border:2px solid var(--gold); color:#fff; font-size:18px; cursor:pointer; line-height:1}
.gear-wrap{position:relative}
.gear-pop[hidden]{display:none}
.gear-pop{position:fixed; top:64px; inset-inline-end:10px; width:min(92vw,360px); max-height:calc(100vh - 150px); overflow-y:auto; -webkit-overflow-scrolling:touch; z-index:60; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:10px 14px; box-shadow:0 8px 26px rgba(40,28,14,.3)}
.gp-row{display:flex; align-items:center; justify-content:space-between; gap:14px; padding:6px 0; color:var(--ink); font-size:14px; font-weight:700}
.gp-row + .gp-row{border-top:1px solid var(--line)}
.gp-btns{display:inline-flex; gap:8px}
.gp-btn{background:var(--green); color:#fff; border:none; border-radius:10px; min-width:44px; padding:7px 12px; font-family:inherit; font-size:16px; font-weight:800; cursor:pointer}

.gp-sec{margin:12px 0 4px; padding-top:8px; border-top:1px solid var(--line); font-size:13px; font-weight:800; color:var(--gold)}
.gp-block{display:flex; flex-direction:column; gap:8px; align-items:stretch; font-size:13px}
.gp-block .loc-search{display:flex; gap:6px}
.gp-block .loc-search input{flex:1; min-width:0}
.gp-block .adhan-line{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.gp-block select{width:100%}
.gp-block .wird-row{flex-wrap:wrap}
.gear-pop .wird-bar{margin:4px 0}
#updBar{position:fixed; top:calc(10px + env(safe-area-inset-top)); left:10px; right:10px; z-index:90; display:flex; align-items:center; gap:10px; background:var(--green2); color:#fff; border:2px solid var(--gold); border-radius:14px; padding:10px 14px; box-shadow:0 8px 24px rgba(0,0,0,.35); font-weight:700; font-size:14px}
#updBar span{flex:1}
#updBar a{background:var(--gold); color:var(--green2); text-decoration:none; font-weight:800; padding:7px 14px; border-radius:10px}
#updBar button{background:none; border:none; color:#fff; font-size:18px; padding:2px 6px}

.hc-warn{background:#f1e2c0; border:1px solid var(--gold); border-radius:10px; padding:8px 12px; margin:8px 0; font-size:13px; font-weight:700; color:var(--green2); line-height:1.8}
body.dark .hc-warn{background:#2c2115}
.hc-grades{margin-top:14px; padding-top:10px; border-top:1px dashed var(--gold); font-size:13px; line-height:1.9; user-select:text}
.hc-grades div{display:flex; gap:8px}
.hc-grades span{font-weight:800; color:var(--green2); min-width:130px}
body.dark .hc-grades span{color:var(--gold)}
.hc-credit{margin-top:14px; line-height:1.9}

.hj-nav{display:flex; align-items:center; justify-content:space-between; margin:4px 0 8px}
.hj-nav b{color:var(--green); font-size:15px}
.hj-arrow{background:none; border:1px solid var(--line); color:var(--green); width:32px; height:32px; border-radius:50%; font-size:20px; line-height:1; cursor:pointer; font-family:inherit}
.hj-arrow:active{background:#e3d6b6}
#hijriBox{touch-action:pan-y}

@font-face{font-family:'ArefRuqaaWM'; src:url(/fonts/aref-ruqaa-wm.woff2) format('woff2'); font-weight:700; font-display:swap}
.brand-name{display:flex; align-items:center; gap:7px; line-height:1}
.brand-name .bn-t{font-family:'ArefRuqaaWM','Aref Ruqaa','Amiri',serif; font-weight:700; font-size:36px; line-height:1.3; color:#5d4527; text-shadow:0 1px 0 #f4ebd6}
.brand-name .bn-ico{flex:none; width:40px; height:40px; object-fit:contain}
body.dark .brand-name .bn-t{color:#ece1cd; text-shadow:none}

.off-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 0; font-size:14px; font-weight:700; color:var(--ink)}
.off-row + .off-row{border-top:1px solid var(--line)}
.off-row small{display:block; font-weight:400; font-size:11px; color:var(--muted)}


.page-audio{display:flex; align-items:center; gap:8px; margin:8px 0}
.page-audio select{flex:1; min-width:0}
.page-audio .mini{white-space:nowrap; padding:8px 12px}

.ayahs .aya.playing,#pageAyahs.mushaf .aya.playing{background:#e9cf84;box-shadow:0 0 0 2px #e9cf84}
body.dark .ayahs .aya.playing,body.dark #pageAyahs.mushaf .aya.playing{background:#5b4620;box-shadow:0 0 0 2px #5b4620}

.city-results{display:flex;flex-direction:column;gap:6px;margin:6px 0}
.city-res{font:inherit;text-align:right;padding:10px 14px;border-radius:14px;border:1px solid #d8c9a6;background:#f5ecd4;color:#5d4527;cursor:pointer}
body.dark .city-res{background:#211a12;border-color:#4a3a22;color:#e8d9b8}
