@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');
:root{--green:#104d42;--green2:#176958;--gold:#c39a56;--ink:#203931;--muted:#71827a;--bg:#f7f9f6;--line:#e0e9e1;--white:#fff;--shadow:0 16px 48px rgba(11,55,40,.06)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Cairo,system-ui,sans-serif;font-size:15px}a{color:inherit;text-decoration:none}button,input,textarea{font:inherit}.wrap{width:min(1160px,calc(100% - 36px));margin-inline:auto}.header{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}.top{display:flex;justify-content:space-between;align-items:center;min-height:82px;gap:20px}.brand{display:flex;align-items:center;gap:12px;font-weight:800;font-size:21px;color:var(--green);line-height:1.3}.brand small{display:block;color:var(--muted);font-size:10px;font-weight:600;margin-top:4px}.brandicon{display:grid;place-items:center;width:47px;height:47px;background:var(--green);color:#e6c78b;border-radius:13px;font-size:33px}nav{display:flex;gap:22px;align-items:center;font-weight:700;font-size:13px}nav a:hover{color:var(--green2)}nav .navbtn{background:var(--green);color:#fff;padding:10px 17px;border-radius:11px}nav .navbtn:hover{color:#fff;background:var(--green2)}nav .lang{border:1px solid var(--line);padding:7px 11px;border-radius:9px}.hero{text-align:center;background:radial-gradient(ellipse at 50% 0%,#e6f0e8 0%,#f7f9f6 60%);padding:100px 12px 75px}.eyebrow{font-size:12px;letter-spacing:.5px;color:var(--green2);font-weight:800}.hero h1{font-size:clamp(32px,5.5vw,54px);color:var(--green);line-height:1.5;margin:13px 0}.hero p{max-width:650px;line-height:2.2;margin:0 auto 29px;color:#596c61;font-size:17px}.actions{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap}.btn{border:1px solid var(--green);border-radius:12px;background:var(--green);color:#fff;padding:12px 23px;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;font-weight:800;transition:.2s;white-space:nowrap}.btn:hover{background:var(--green2);transform:translateY(-1px)}.btn.secondary{background:#fff;color:var(--green);border-color:#d3e0d6}.btn.secondary:hover{background:#edf5ef}.btn.danger{background:#a64242;border-color:#a64242}.btn.small{padding:8px 16px}.btn.wide{width:100%}.verse{margin:60px auto 0;border:1px solid #e4e7d8;border-radius:16px;max-width:600px;padding:20px;background:#fff9ed;color:#957342;font-size:21px;line-height:2}.verse small{display:block;font-size:12px}.features{display:grid;grid-template-columns:repeat(3,1fr);gap:19px;margin:0 auto 85px}.features article,.panel{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:26px}.features article span{font-size:28px;color:var(--gold)}.features h3{margin:8px 0}.features p,.panel p{color:var(--muted);line-height:2;margin-bottom:0}.pagehead{text-align:center;padding:55px 0 26px}.pagehead h1{font-size:35px;margin:10px 0;color:var(--green)}.pagehead p{color:var(--muted)}.form{max-width:650px;margin:0 auto 85px;padding:34px}.form label,.modal label{display:block;font-weight:700;margin-bottom:22px}.form label b{color:#b84040}.form input:not([type=checkbox]),.modal input,.modal textarea{width:100%;border:1px solid #dbe5dd;border-radius:10px;padding:12px 14px;outline:none;margin-top:8px;background:#fff;color:var(--ink)}.form input:focus,.modal input:focus,.modal textarea:focus{border-color:var(--green2);box-shadow:0 0 0 3px #d9ebdf}.form label.check{display:flex;gap:10px;align-items:center;font-weight:600;margin-bottom:14px}.form label.check input{accent-color:var(--green);width:17px;height:17px}.note{background:#f4f8f5;color:#5c7363;border:1px solid var(--line);padding:13px;border-radius:9px;margin:19px 0}.viewhead{padding:45px 0 28px;display:flex;align-items:center;justify-content:space-between;gap:20px}.viewhead h1{font-size:clamp(26px,4vw,37px);color:var(--green);margin:8px 0}.dedication{color:#766543;font-size:17px;margin:5px 0 10px}.meta{display:flex;align-items:center;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:13px}.statusbadge{background:#e3f4e9;color:#227851;border-radius:15px;padding:4px 12px}.sharetools{display:flex;gap:9px;flex-wrap:wrap}.statrow{display:grid;grid-template-columns:repeat(4,1fr);gap:15px}.statrow>div{background:#fff;border:1px solid var(--line);border-radius:15px;text-align:center;padding:20px 8px}.statrow strong{display:block;font-size:32px;color:var(--green)}.statrow span{font-size:13px;color:var(--muted)}.progress{height:12px;background:#e3eae2;border-radius:20px;margin-top:25px;overflow:hidden}.progress div{height:100%;background:linear-gradient(90deg,#1d7860,#c3a369);border-radius:20px}.progresslabel{font-size:13px;color:var(--muted);margin:7px 0 25px}.sectiontitle{font-size:24px;margin:35px 0 6px;color:var(--green)}.legend{display:flex;gap:18px;margin-bottom:20px;color:var(--muted);font-size:12px}.legend span{display:flex;gap:7px;align-items:center}.dot{width:9px;height:9px;display:inline-block;border-radius:50%}.dot.available{background:#37a46d}.dot.reserved{background:#d6a644}.dot.completed{background:#8a9b94}.juzgrid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:50px}.juz{background:#fff;border:1px solid #dfe9e1;border-radius:15px;padding:17px;min-height:168px;position:relative}.juz.available{border-top:3px solid #36a66b}.juz.reserved{border-top:3px solid #daa84e}.juz.completed{border-top:3px solid #a5b7ab;background:#f3f6f3}.juz-top{display:flex;justify-content:space-between;align-items:center;gap:5px;font-weight:800;color:var(--green)}.chip{font-weight:700;font-size:10px;background:#e5f6ec;color:#28774f;padding:3px 7px;border-radius:10px}.reserved .chip{background:#fff3d6;color:#9d762b}.completed .chip{background:#e6ebe7;color:#75887b}.pages{color:var(--muted);font-size:12px;margin:12px 0}.reader{font-size:11px;color:#5f725e;overflow-wrap:anywhere}.linkbutton,.subtle{padding:0;border:0;background:none;cursor:pointer;color:var(--green2);font-weight:800;text-align:start;font-size:12px}.linkbutton{margin-top:10px}.subtle{font-size:10px;color:#8b8b7d;margin-top:10px;text-decoration:underline}.admin{margin:40px 0}.admin h2{color:var(--green);margin:0}.admin .actions{justify-content:flex-start;margin-top:17px}.alert{padding:15px 20px;border-radius:12px;background:#e4f3e9;color:#1e6c47;margin:22px 0;line-height:1.8}.alert.error{background:#fff0eb;color:#923d39}.alert.important{background:#fff8e9;color:#6b562a;border:1px solid #eee1c2}.alert.complete-banner{text-align:center}.linkline{display:flex;gap:7px;margin:10px 0}.linkline input{width:100%;min-width:0;border:1px solid #e2d7b9;padding:9px;border-radius:9px;direction:ltr}.publicgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;min-height:280px;margin:0 0 90px}.publiccard{padding:23px;border:1px solid var(--line);background:#fff;border-radius:17px}.publiccard:hover{border-color:var(--green2)}.publiccard h3{color:var(--green);margin:12px 0}.publiccard p{color:var(--muted);min-height:30px}.publiccard small{color:var(--muted)}.mini-progress{background:#e8eee9;height:7px;border-radius:10px;overflow:hidden}.mini-progress i{display:block;background:var(--green2);height:100%}.modal[hidden]{display:none}.modal{position:fixed;inset:0;background:#0e251fb0;z-index:99;display:grid;place-items:center;padding:15px}.modalbox{background:#fff;border-radius:18px;padding:35px;width:min(460px,100%);position:relative;box-shadow:0 20px 65px #0002}.modalbox h2{color:var(--green);margin-top:0}.modalbox p{color:var(--muted);line-height:1.9}.x{position:absolute;top:10px;inset-inline-end:17px;border:0;background:transparent;font-size:27px;cursor:pointer;color:#798b7c}footer{border-top:1px solid var(--line);background:#fff;margin-top:45px;padding:26px 0;color:var(--muted);font-size:12px}footer .wrap{display:flex;justify-content:space-between}html[dir=ltr] .linkbutton{text-align:left}@media(max-width:900px){.juzgrid{grid-template-columns:repeat(3,1fr)}.features{grid-template-columns:repeat(3,1fr)}nav{gap:10px}}@media(max-width:650px){.top{align-items:flex-start;padding:12px 0;flex-direction:column;gap:13px}.brand{font-size:17px}.brandicon{width:37px;height:37px;font-size:26px}nav{width:100%;overflow-x:auto;gap:13px;white-space:nowrap;font-size:11px;padding-bottom:4px}nav .navbtn{padding:8px 10px}.hero{padding:65px 0 45px}.hero p{font-size:14px}.hero .actions{flex-direction:column}.hero .actions .btn{width:100%}.verse{margin-top:40px;font-size:15px}.features{grid-template-columns:1fr;margin-bottom:30px}.pagehead{padding-top:35px}.pagehead h1{font-size:27px}.form{padding:22px}.viewhead{align-items:stretch;flex-direction:column}.sharetools .btn{flex:1;font-size:12px;padding:10px}.statrow{gap:7px}.statrow>div{padding:12px 3px}.statrow strong{font-size:24px}.statrow span{font-size:10px}.juzgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.juz{padding:12px;min-height:155px}.juz-top{flex-wrap:wrap}.chip{font-size:9px}.publicgrid{grid-template-columns:1fr}.legend{gap:9px}.sectiontitle{font-size:21px}}

/* V2: prominent, fully clickable juz tiles modeled on the supplied layout. */
.juz-instruction{font-size:16px;line-height:2;color:#52685e;margin:7px 0 18px}
.tile-legend{display:flex;justify-content:flex-start;flex-wrap:wrap;align-items:center;gap:12px 24px;margin:20px 0 18px;font-size:15px}
.tile-legend>span{display:inline-flex;gap:8px;align-items:center;white-space:nowrap}
.tile-legend b{min-width:28px;text-align:center;font-weight:800}
.tile-key{height:19px;width:19px;display:inline-block;border-radius:3px;border:1px solid #0001}
.tile-available{background:#8dcc82}.tile-reserved{background:#ffea70}.tile-completed{background:#f57a89}
.juzgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;margin:0 0 40px;background:#fff;border-radius:12px;overflow:hidden}
.juz-tile{appearance:none;border:0;border-radius:0;cursor:pointer;display:grid;place-items:center;height:120px;min-width:0;transition:filter .15s,transform .15s;color:#20272b;font:800 clamp(28px,3.7vw,43px)/1 Cairo,system-ui,sans-serif}
.juz-tile.available{background:#8dcc82}.juz-tile.reserved{background:#ffea70}.juz-tile.completed{background:#f57a89}
.juz-tile:hover{filter:brightness(.95)}.juz-tile:focus-visible{outline:4px solid #195a4b;outline-offset:-5px;position:relative;z-index:1}
.juz-tile:active{filter:brightness(.9)}.tile-action-form{margin-top:12px}
@media(max-width:650px){.juzgrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}.juz-tile{height:78px;font-size:28px}.tile-legend{font-size:11px;gap:9px 12px}.tile-legend>span{gap:5px}.tile-key{width:13px;height:13px}.juz-instruction{font-size:13px}}
@media(max-width:350px){.juz-tile{height:66px;font-size:23px}}

/* Version 3: full-juz reader */
.reader-shell{margin:18px 0 40px;overflow:hidden;border-radius:12px;background:#fff3d7;border:1px solid #e5d3ab;box-shadow:0 12px 40px #231d1520;--reading-bg:#ffedc9}
.reader-shell:fullscreen{display:flex;flex-direction:column;border:0;border-radius:0;height:100vh}
.reader-top{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px 24px;background:#edfaf9;color:#243138;padding:12px 20px;font-size:18px;text-align:center;border-bottom:1px solid #d1dfde}
.reader-top b{font-variant-numeric:tabular-nums}
.reader-page{height:72vh;min-height:440px;overflow-y:auto;background:var(--reading-bg);padding:45px clamp(18px,6vw,95px) 70px;color:#10100e;scroll-behavior:smooth;text-align:justify}
.reader-shell:fullscreen .reader-page{height:auto;flex:1}
.reader-surah{text-align:center;font-family:'Amiri Quran','Amiri',serif;font-size:1.5em;font-weight:600;border-top:2px solid #bba16c;border-bottom:2px solid #bba16c;margin:40px auto 24px;max-width:650px;padding:12px 20px;line-height:1.9}
.reader-basmala{text-align:center;font:inherit;font-size:1.1em;margin:10px 0 35px;line-height:2}
.reader-verses{font-family:'Amiri Quran','Amiri','Noto Naskh Arabic',serif;font-size:38px;line-height:2.45;word-spacing:.11em}
.reader-ayah-number{color:#826d42;font-size:.72em;white-space:nowrap;vertical-align:middle}
.reader-loading{font-size:19px;text-align:center;padding:80px 0;line-height:2}
.reader-toolbar{position:relative;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#3e4654;color:#fff;padding:12px 16px;direction:ltr;min-height:77px}
.reader-tools-left,.reader-tools-right{display:flex;align-items:center;gap:9px}.reader-tools-left form{margin:0}
.reader-toolbar button{font:inherit;cursor:pointer;border:0;border-radius:7px;padding:12px 15px;color:white}
.reader-complete{background:#1eab52}.reader-cancel{background:#f15e68}.reader-icon-btn{background:#596677;min-width:49px;font-size:20px!important;font-weight:bold!important}.reader-page-mark{font-size:24px;color:#e4d4b2}
.reader-denied{margin:40px auto;text-align:center;padding:45px 18px}.reader-shell .modal{z-index:999}
@media(max-width:600px){.reader-top{font-size:14px;gap:4px 13px;padding:10px}.reader-page{height:75vh;padding:20px 16px 60px}.reader-verses{line-height:2.1}.reader-toolbar{padding:9px 7px;gap:6px}.reader-toolbar button{padding:10px 8px;font-size:13px}.reader-page-mark{display:none}.reader-tools-right,.reader-tools-left{gap:4px}}

/* V5: remember per-reservation reading position and navigate to surah */
.reader-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:10px 13px;padding:11px 16px;background:#fffaf1;border-bottom:1px solid #e8d9bb;color:#315447;font-size:13px}
.reader-navigation[hidden]{display:none}.reader-navigation label{font-weight:800}.reader-navigation select{max-width:230px;min-width:145px;border:1px solid #d4c8ab;border-radius:8px;background:#fff;color:#223931;padding:8px 12px;cursor:pointer}
.reader-resume{border:1px solid #b7cab9;background:#eaf7ed;color:#124a31;padding:8px 12px;border-radius:8px;font:inherit;font-weight:800;cursor:pointer}.reader-resume[hidden]{display:none}
.reader-marker-label{margin-inline-start:auto;color:#63766d;line-height:1.6}.reader-reading-progress{height:5px;background:#efe5cd}.reader-reading-progress span{display:block;height:100%;width:0;background:#258867;transition:width .2s}
.reader-ayah{scroll-margin-top:28px}.reader-ayah:target{background:#fff5a8}
@media(max-width:600px){.reader-navigation{gap:7px;padding:9px}.reader-navigation select{min-width:120px;max-width:160px}.reader-marker-label{width:100%;margin:0}.reader-resume{padding:8px}}

/* V6: Mushaf-inspired Tajweed reader. Rule colors match the AlQuran Cloud Tajweed guide. */
.reader-shell{--reading-bg:#fff9ec}
.reader-page{background:#fffdf5;padding:35px clamp(12px,5vw,80px) 70px}
.reader-verses{max-width:1000px;margin:0 auto;text-align:justify;line-height:2.65;word-spacing:.1em;color:#171414}
.reader-surah{color:#174e4a;position:relative;background:linear-gradient(90deg,#f4e7c3,#fffdf2,#f4e7c3);border:3px double #b09a56;border-radius:16px;max-width:830px;font-size:1.35em;margin-top:22px}
.reader-basmala{font-size:1.15em;color:#1a1b18}
.reader-ayah-number{display:inline-flex;align-items:center;justify-content:center;color:#075a60;background:#e6faf7;border:2px solid #379498;outline:1px solid #b5c9ac;outline-offset:2px;min-width:1.7em;height:1.7em;border-radius:42% 58% 46% 54%;font-size:.66em;margin:0 .23em;vertical-align:middle;line-height:1}
.mushaf-page-marker{text-align:center;font:700 14px system-ui,sans-serif;color:#826f44;margin:14px 0 8px;padding:7px;border-top:1px solid #d9c99e}
.tajweed-settings{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;padding:11px 18px;background:#f8f5e9;border-bottom:1px solid #e9dcc4;font-size:14px;color:#285249}
.tajweed-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-weight:800}.tajweed-switch input{width:19px;height:19px;accent-color:#11664b}
.tajweed-help{background:#fff;border:1px solid #cabca2;border-radius:8px;cursor:pointer;padding:7px 12px;color:#285249;font:inherit}
.tajweed-status{font-size:12px;color:#6a6551}.tajweed-legend[hidden]{display:none}
.tajweed-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 19px;padding:13px 22px;background:#fffbf1;font-weight:700}.tajweed-legend span{display:inline-block}.tajweed-legend small{width:100%;color:#6e6b60;font-weight:400}
.tajweed-rule{color:inherit}.tajweed-rule.ham_wasl,.tajweed-rule.slnt,.tajweed-rule.idgh_mus{color:#969696}
.tajweed-rule.madda_normal{color:#537fff}.tajweed-rule.madda_permissible{color:#4050ff}.tajweed-rule.madda_necessary{color:#000ebc}.tajweed-rule.madda_obligatory{color:#2144c1}
.tajweed-rule.qlq{color:#dd0008}.tajweed-rule.ikhf_shfw{color:#d500b7}.tajweed-rule.ikhf{color:#9400a8}.tajweed-rule.idghm_shfw{color:#58b800}.tajweed-rule.iqlb{color:#26bffd}.tajweed-rule.idgh_ghn{color:#169777}.tajweed-rule.idgh_w_ghn{color:#169200}.tajweed-rule.ghn{color:#ff7e1e}
.tajweed-disabled .tajweed-rule{color:inherit!important}
.tw-blue{color:#4050ff}.tw-red{color:#dd0008}.tw-magenta{color:#9400a8}.tw-green{color:#169200}.tw-orange{color:#ff7e1e}.tw-cyan{color:#26bffd}
@media(max-width:600px){.reader-page{padding:18px 12px 70px}.reader-verses{line-height:2.3}.reader-surah{font-size:1.1em}.tajweed-settings{font-size:12px;padding:9px}.reader-ayah-number{min-width:1.5em;height:1.5em}}

/* V7: page-by-page Mushaf presentation; page boundaries come from Quran metadata. */
.mushaf-page-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:12px;padding:12px;background:#f4ead5;border-top:1px solid #d7c59e;border-bottom:1px solid #d7c59e;color:#294b43;font-weight:700}
.mushaf-page-controls button,.mushaf-page-controls select{background:#fffdf5;color:#17483c;border:1px solid #bda979;border-radius:8px;padding:9px 12px;font:inherit;cursor:pointer}
.mushaf-page-controls button:disabled{opacity:.35;cursor:not-allowed}.mushaf-page-controls label{display:flex;align-items:center;gap:8px}.mushaf-page-controls select{min-width:72px}
.reader-page{background:#e9e1cd;padding:16px clamp(8px,4vw,65px) 30px;scroll-behavior:auto}
.reader-verses{max-width:940px;margin:auto;line-height:2.4}
.mushaf-sheet{background:#fffef9;color:#15140f;position:relative;margin:0 auto;min-height:620px;padding:22px clamp(20px,5vw,70px) 32px;border:13px double #ae8a58;outline:3px solid #2c807e;outline-offset:-21px;box-shadow:0 3px 20px #332d1b24,inset 0 0 0 4px #faf0d7,inset 0 0 0 8px #d7b86d;text-align:justify}
.mushaf-sheet[hidden]{display:none!important}
.mushaf-sheet:before,.mushaf-sheet:after{content:'❁';position:absolute;font-size:31px;color:#9c3d73;line-height:1;top:8px}.mushaf-sheet:before{right:13px}.mushaf-sheet:after{left:13px}
.mushaf-sheet-header{display:flex;justify-content:space-around;align-items:center;gap:12px;color:#2c6864;font-family:'Amiri',serif;font-size:19px;border-bottom:4px double #b89f6a;margin-bottom:16px;padding:5px 18px}
.mushaf-sheet-title{font-weight:bold}.mushaf-sheet-body{min-height:450px;line-height:2.45}
.mushaf-sheet-footer{text-align:center;font-size:22px;font-family:'Amiri',serif;color:#267b7e;border-top:3px double #af945c;margin-top:20px;padding-top:5px}
.mushaf-sheet .reader-surah{margin-top:18px;margin-bottom:15px;border:3px double #ae795d;background:linear-gradient(90deg,#d3e9e2,#fff2cb,#d3e9e2);border-radius:28px;font-size:1.28em;line-height:1.5;color:#175c5a}
.mushaf-sheet .reader-basmala{text-align:center;margin:18px auto 24px}
.mushaf-sheet .reader-ayah-number{background:#c7e9e5;color:#185e65;border-color:#328d92}
.reader-shell:fullscreen .reader-page{overflow-y:auto}
@media(max-width:600px){.mushaf-sheet{padding:16px 20px 22px;border-width:8px;outline-offset:-13px;min-height:400px}.mushaf-sheet:before,.mushaf-sheet:after{font-size:17px;top:5px}.mushaf-sheet:before{right:5px}.mushaf-sheet:after{left:5px}.mushaf-sheet-header{font-size:15px;padding:4px 8px}.mushaf-sheet-body{min-height:300px}.reader-page{padding:10px 8px}.reader-verses{line-height:2.2}.mushaf-page-controls{gap:6px;font-size:12px}}


/* V8 — full-bleed, mobile-first reading experience. Keep tools above the Quran. */
body.reading-mode{overflow-x:hidden;background:#fffdf7}
body.reading-mode > main.wrap{width:100%;max-width:none;margin:0;padding:0}
body.reading-mode > footer{display:none}
body.reading-mode .reader-shell{display:flex;flex-direction:column;margin:0;min-height:0;height:calc(100dvh - 83px);border:0;border-radius:0;box-shadow:none;background:#fffdf7;overflow:hidden}
body.reading-mode .reader-toolbar{order:0;flex:0 0 auto;position:relative;z-index:5;border:0;border-radius:0;min-height:56px;padding:7px clamp(9px,2vw,24px);gap:8px}
body.reading-mode .reader-top{order:1;flex:0 0 auto;padding:6px 12px;font-size:13px;gap:5px 15px}
body.reading-mode .reader-navigation{order:2;flex:0 0 auto;padding:7px 14px}
body.reading-mode .tajweed-settings{order:3;flex:0 0 auto;padding:6px 14px}
body.reading-mode .tajweed-legend{order:4;flex:0 0 auto}
body.reading-mode .mushaf-page-controls{order:5;flex:0 0 auto;padding:7px;gap:8px;font-size:13px}
body.reading-mode .reader-reading-progress{order:6;flex:0 0 auto}
body.reading-mode .reader-page{order:7;flex:1 1 auto;min-height:0;height:auto;overflow:auto;overscroll-behavior:contain;padding:0;background:#fffdf7;scrollbar-gutter:stable}
body.reading-mode .reader-verses{width:100%;max-width:none;margin:0;text-align:justify;line-height:2.28;word-spacing:.08em}
body.reading-mode .mushaf-sheet{min-height:100%;width:100%;max-width:none;margin:0;background:#fffdf7;border:0;outline:0;border-radius:0;box-shadow:none;padding:15px clamp(18px,5vw,86px) 45px;text-align:justify}
body.reading-mode .mushaf-sheet::before,body.reading-mode .mushaf-sheet::after{display:none}
body.reading-mode .mushaf-sheet-header{border:0;border-bottom:1px solid #d2c19e;margin:0 0 18px;padding:4px 5px 8px;font-size:16px}
body.reading-mode .mushaf-sheet-body{min-height:0;line-height:inherit}
body.reading-mode .mushaf-sheet-footer{font-size:17px;margin-top:24px;border-top:1px solid #c8b68f}
body.reading-mode .mushaf-sheet .reader-surah{max-width:760px;margin:18px auto 22px;padding:7px 14px;border:1px solid #b89c73;border-radius:14px;background:linear-gradient(90deg,#e3f1e8,#fff3d7,#e3f1e8)}
body.reading-mode .reader-toolbar button{padding:8px 11px;min-height:40px}
body.reading-mode .reader-icon-btn{min-width:40px}
body.reading-mode .reader-page-mark{font-size:14px}
body.reading-mode .reader-marker-label{font-size:11px}
body.reading-mode .reader-shell:fullscreen{height:100dvh}
body.reading-mode .reader-shell:fullscreen .reader-page{height:auto;flex:1 1 auto;min-height:0}
@media(max-width:650px){
 body.reading-mode .header .top{min-height:0;flex-direction:row;align-items:center;padding:6px 10px;gap:8px;flex-wrap:wrap}
 body.reading-mode .header .wrap{width:100%}
 body.reading-mode .header .brand{font-size:14px;gap:7px}
 body.reading-mode .header .brand small{display:none}
 body.reading-mode .header .brandicon{width:29px;height:29px;font-size:20px;border-radius:7px}
 body.reading-mode .header nav{width:auto;margin-inline-start:auto;padding:0;gap:8px;overflow:visible}
 body.reading-mode .header nav a:not(.lang){display:none}
 body.reading-mode .header nav .lang{padding:5px 9px}
 body.reading-mode .reader-shell{height:calc(100dvh - 43px)}
 body.reading-mode .reader-toolbar{padding:6px 8px;gap:5px;min-height:52px;flex-wrap:nowrap}
 body.reading-mode .reader-toolbar button{padding:7px 8px;font-size:11px;min-height:37px;white-space:nowrap}
 body.reading-mode .reader-toolbar .reader-complete{font-size:12px;font-weight:700}
 body.reading-mode .reader-toolbar .reader-icon-btn{min-width:32px;font-size:15px!important}
 body.reading-mode .reader-toolbar .reader-page-mark{display:none}
 body.reading-mode .reader-top{font-size:11px;padding:5px;gap:4px 10px}
 body.reading-mode .reader-name{display:none}
 body.reading-mode .reader-navigation{padding:5px 9px;gap:5px;font-size:11px}
 body.reading-mode .reader-navigation select{min-width:0;max-width:125px;padding:5px}
 body.reading-mode .reader-marker-label{display:none}
 body.reading-mode .reader-resume{font-size:11px;padding:6px}
 body.reading-mode .tajweed-settings{padding:5px 9px;gap:7px;font-size:11px}
 body.reading-mode .tajweed-switch input{width:15px;height:15px}
 body.reading-mode .tajweed-help{padding:4px 7px}
 body.reading-mode .tajweed-status{font-size:10px}
 body.reading-mode .mushaf-page-controls{padding:5px;gap:5px;font-size:11px}
 body.reading-mode .mushaf-page-controls button,body.reading-mode .mushaf-page-controls select{padding:6px 7px}
 body.reading-mode #mushafPageRange{display:none}
 body.reading-mode .reader-page{padding:0;scrollbar-gutter:auto}
 body.reading-mode .reader-verses{line-height:2.1;word-spacing:0;text-align:justify}
 body.reading-mode .mushaf-sheet{padding:12px 12px 34px}
 body.reading-mode .mushaf-sheet-header{font-size:13px;margin-bottom:12px}
 body.reading-mode .mushaf-sheet .reader-surah{font-size:1.15em;line-height:1.5;margin:13px auto 18px;padding:8px}
 body.reading-mode .reader-basmala{margin:10px auto 17px}
 body.reading-mode .reader-ayah-number{outline:0;margin:0 .12em}
}
@media(max-width:380px){
 body.reading-mode .reader-toolbar button{font-size:10px;padding:6px}
 body.reading-mode .reader-toolbar .reader-icon-btn{min-width:28px}
 body.reading-mode .reader-tools-left,body.reading-mode .reader-tools-right{gap:3px}
 body.reading-mode .reader-top{font-size:10px}
 body.reading-mode .mushaf-page-controls label{gap:3px}
}

/* V9: ONE naturally scrolling document. No fixed controls, iframe or inner scroll. */
html{scroll-behavior:smooth}
body.reading-mode{overflow-x:hidden;overflow-y:visible;background:#fffdf8}
body.reading-mode .header{position:static!important;top:auto!important}
body.reading-mode > main.wrap{width:100%;max-width:none;padding:0;margin:0}
body.reading-mode .reader-shell,body.reading-mode .reader-shell:fullscreen{
 display:flex;flex-direction:column;height:auto!important;min-height:0!important;max-height:none!important;
 overflow:visible!important;margin:0;border:0;border-radius:0;box-shadow:none;background:#fffdf8
}
body.reading-mode .reader-toolbar,body.reading-mode .reader-top,body.reading-mode .reader-navigation,
body.reading-mode .tajweed-settings,body.reading-mode .mushaf-page-controls{position:static!important;flex-shrink:0}
body.reading-mode .reader-toolbar{order:0}
body.reading-mode .reader-top{order:1}
body.reading-mode .reader-navigation{order:2}
body.reading-mode .tajweed-settings{order:3}
body.reading-mode .tajweed-legend{order:4}
body.reading-mode .mushaf-page-controls{order:5}
body.reading-mode .reader-reading-progress{order:6}
body.reading-mode .reader-page,body.reading-mode .reader-shell:fullscreen .reader-page{
 order:7;display:block;height:auto!important;min-height:0!important;max-height:none!important;
 overflow:visible!important;overscroll-behavior:auto!important;padding:0!important;scroll-behavior:auto;background:#fffdf8
}
body.reading-mode .reader-verses{max-width:none;width:100%;margin:0;text-align:justify;line-height:2.18;word-spacing:0.04em}
body.reading-mode .mushaf-sheet,body.reading-mode .mushaf-sheet[hidden]{
 display:block!important;width:100%;max-width:none;min-height:0;margin:0;padding:24px clamp(18px,4vw,74px) 30px;
 border:0;border-bottom:1px solid #e8ddc5;outline:0;box-shadow:none;background:#fffdf8;scroll-margin-top:12px
}
body.reading-mode .mushaf-sheet-body{min-height:0;line-height:inherit}
body.reading-mode .mushaf-sheet-header{font-size:17px;justify-content:space-between}
body.reading-mode .mushaf-sheet-footer{font-size:15px;padding-top:10px}
body.reading-mode .reader-ayah{scroll-margin-top:24px}
body.reading-mode .reader-toolbar button{min-height:38px}
@media(max-width:650px){
 body.reading-mode .header .top{padding:7px 12px}
 body.reading-mode .reader-toolbar{padding:6px 9px;flex-wrap:wrap}
 body.reading-mode .reader-top{padding:6px 10px;font-size:12px}
 body.reading-mode .reader-navigation{padding:7px 10px}
 body.reading-mode .tajweed-settings{padding:7px 10px}
 body.reading-mode .mushaf-page-controls{padding:8px 5px}
 body.reading-mode .reader-verses{line-height:2.26;word-spacing:0;text-align:justify}
 body.reading-mode .mushaf-sheet,body.reading-mode .mushaf-sheet[hidden]{padding:16px 13px 24px}
 body.reading-mode .mushaf-sheet-header{font-size:15px;margin-bottom:14px}
 body.reading-mode .mushaf-sheet .reader-surah{font-size:1.12em}
 body.reading-mode .reader-ayah-number{margin-inline:.12em}
}

/* V10: completion, cancel and reading position appear only after the final Quran page. */
body.reading-mode .reader-toolbar{justify-content:flex-end!important;min-height:42px}
body.reading-mode .reader-end-actions{order:8;display:flex;align-items:center;justify-content:space-between;gap:14px;direction:ltr;padding:22px clamp(12px,3vw,36px);background:#3e4654;color:#f7e3bb;min-height:84px;flex-wrap:wrap}
body.reading-mode .reader-end-actions .reader-tools-left{display:flex;align-items:center;gap:12px;direction:ltr;flex-wrap:wrap}
body.reading-mode .reader-end-actions .reader-tools-left form{margin:0}
body.reading-mode .reader-end-actions button{font:inherit;cursor:pointer;border:0;border-radius:8px;padding:12px 18px;color:#fff;font-weight:700}
body.reading-mode .reader-end-actions .reader-complete{background:#19a955}
body.reading-mode .reader-end-actions .reader-cancel{background:#f05d68}
body.reading-mode .reader-end-actions .reader-page-mark{display:block!important;position:static!important;font-size:clamp(15px,2vw,23px);text-align:center;flex:1;min-width:160px}
@media(max-width:650px){body.reading-mode .reader-end-actions{padding:16px 10px;gap:12px;justify-content:center}body.reading-mode .reader-end-actions .reader-tools-left{width:100%;justify-content:center}body.reading-mode .reader-end-actions .reader-page-mark{flex:0 0 100%;order:-1;font-size:17px}body.reading-mode .reader-end-actions button{padding:12px 13px;font-size:14px}}

/* V11: font/fullscreen controls live in the surah-navigation row, not in a dark bar. */
body.reading-mode .reader-navigation{direction:rtl;align-items:center;gap:10px}
body.reading-mode .reader-navigation-tools{display:flex;align-items:center;gap:7px;direction:ltr;margin-inline-start:auto;flex-shrink:0}
body.reading-mode .reader-navigation-tools .reader-icon-btn{background:#596677;color:#fff;border:0;border-radius:8px;min-width:46px;min-height:42px;padding:8px 11px;font-weight:800;font-size:19px;cursor:pointer}
body.reading-mode .reader-navigation-tools .reader-icon-btn:hover{background:#425164}
@media(max-width:650px){
 body.reading-mode .reader-navigation{gap:7px;flex-wrap:wrap}
 body.reading-mode .reader-navigation-tools{margin-inline-start:auto;gap:5px}
 body.reading-mode .reader-navigation-tools .reader-icon-btn{min-width:37px;min-height:37px;padding:6px 8px;font-size:16px}
 body.reading-mode .reader-marker-label{width:auto;flex:1 1 100%;order:3}
}

/* V12: remove the crossed-out surah jump and page-selector controls.
   Keep non-visual DOM hooks for existing reading/resume JavaScript. */
body.reading-mode #readerSurahSelect,
body.reading-mode #mushafPageControls{display:none!important}
body.reading-mode .reader-navigation{justify-content:space-between;padding-block:8px}
body.reading-mode .reader-navigation-tools{margin-inline-start:auto}
@media(max-width:650px){
 body.reading-mode .reader-navigation{padding:8px 12px;gap:8px}
 body.reading-mode .reader-navigation-tools{margin-inline-start:auto}
}

/* V13: exact verse bookmarks, without introducing a fixed reading panel. */
body.reading-mode .reader-ayah-number.bookmark-trigger{cursor:pointer;touch-action:manipulation;transition:background .15s,outline-color .15s;}
body.reading-mode .reader-ayah-number.bookmark-trigger:hover,body.reading-mode .reader-ayah-number.bookmark-trigger:focus-visible{background:#ffe5a0;outline:2px solid #b58c35;outline-offset:3px;}
body.reading-mode .reader-ayah.saved-verse{background:rgba(236,192,67,.21);border-radius:.18em;box-decoration-break:clone;-webkit-box-decoration-break:clone;}
body.reading-mode .reader-resume{display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:14px;padding:10px 15px;}
body.reading-mode .reader-resume[hidden]{display:none;}
body.reading-mode .reader-resume small{font-size:12px;font-weight:500;}
body.reading-mode .bookmark-notice{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#125c49;color:#fff;padding:12px 18px;border-radius:10px;box-shadow:0 5px 24px #0003;z-index:200;max-width:calc(100vw - 28px);text-align:center;font-size:14px;}
body.reading-mode .bookmark-notice[hidden]{display:none;}
@media(max-width:650px){body.reading-mode .reader-resume{font-size:13px;padding:9px 11px;}body.reading-mode .reader-resume small{font-size:11px;}body.reading-mode .bookmark-notice{bottom:12px;width:max-content;max-width:calc(100vw - 24px);}}

/* V14: reading-division selector and denser grids for 60/120 slots. */
.division-select{width:100%;min-height:52px;border:1px solid #cbded5;border-radius:12px;background:#fff;color:#12463d;padding:12px 14px;font:inherit;cursor:pointer}
.division-hint{display:block;margin-top:8px;color:#657a74;font-size:.85rem;line-height:1.7}
.juzgrid:has(.juz-tile:nth-child(60)){grid-template-columns:repeat(6,minmax(0,1fr))}
.juzgrid:has(.juz-tile:nth-child(120)){grid-template-columns:repeat(8,minmax(0,1fr))}
@media(max-width:700px){.juzgrid:has(.juz-tile:nth-child(60)),.juzgrid:has(.juz-tile:nth-child(120)){grid-template-columns:repeat(4,minmax(0,1fr))}.juzgrid:has(.juz-tile:nth-child(120)) .juz-tile{min-height:64px}}


/* V15 — merge reader navigation and Tajweed settings into ONE compact line. */
body.reading-mode .reader-unified-controls{
 display:flex!important;order:2;align-items:center;gap:10px 16px;
 width:100%;padding:9px clamp(12px,2vw,26px);background:#faf8ef;
 border-bottom:1px solid #e6dcc8;position:static!important;flex-wrap:wrap;
 min-height:56px;direction:rtl;
}
body.reading-mode .reader-unified-controls .reader-resume{order:0;flex-shrink:0}
body.reading-mode .reader-unified-controls .tajweed-settings{
 order:1;display:flex;align-items:center;gap:8px 11px;flex:0 1 auto;
 padding:0!important;margin:0;background:transparent;border:0;
 position:static!important;font-size:13px;
}
body.reading-mode .reader-unified-controls .reader-marker-label{
 order:2;display:inline!important;flex:0 1 auto;width:auto;margin:0;
 font-size:11px;line-height:1.5;min-width:0;
}
body.reading-mode .reader-unified-controls .reader-navigation-tools{
 order:3;margin-inline-start:auto;display:flex;align-items:center;gap:6px;
 direction:ltr;flex-shrink:0;
}
body.reading-mode .reader-unified-controls .reader-navigation-tools .reader-icon-btn{
 min-width:40px;min-height:40px;padding:7px 10px;font-size:18px;
 border-radius:8px;border:0;background:#596677;color:#fff;cursor:pointer;
}
body.reading-mode .reader-unified-controls .reader-navigation-tools .reader-icon-btn:hover{background:#425164}
body.reading-mode .reader-unified-controls select[hidden]{display:none!important}
@media(max-width:860px){
 body.reading-mode .reader-unified-controls{gap:9px 11px;padding:9px 12px}
 body.reading-mode .reader-unified-controls .tajweed-settings{font-size:12px}
 body.reading-mode .reader-unified-controls .reader-marker-label{display:none!important}
}
@media(max-width:600px){
 body.reading-mode .reader-unified-controls{justify-content:space-between;gap:9px;padding:9px 10px}
 body.reading-mode .reader-unified-controls .reader-resume{max-width:100%;flex:1 1 auto;justify-content:center;order:0}
 body.reading-mode .reader-unified-controls .tajweed-settings{order:2;flex:1 1 auto;justify-content:center;flex-wrap:wrap}
 body.reading-mode .reader-unified-controls .reader-navigation-tools{order:1;margin-inline-start:0}
 body.reading-mode .reader-unified-controls .reader-navigation-tools .reader-icon-btn{min-width:35px;min-height:36px;padding:6px 7px;font-size:16px}
}

/* V16 — Mobile Quran reader: genuine edge-to-edge document scrolling.
   The browser document is the only scrolling container; no floating bars or Mushaf frame. */
@media (max-width: 900px) {
  html:has(body.reading-mode) { height:auto; overflow-y:auto; scroll-behavior:smooth; }
  body.reading-mode { height:auto!important; min-height:100%; overflow-x:hidden!important; overflow-y:visible!important; margin:0; }
  body.reading-mode .header { position:static!important; inset:auto!important; transform:none!important; }
  body.reading-mode .header .top { position:static!important; }
  body.reading-mode > main.wrap { width:100%!important; max-width:none!important; margin:0!important; padding:0!important; }
  body.reading-mode .reader-shell { display:flex; flex-direction:column; height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important; border:0!important; border-radius:0!important; box-shadow:none!important; margin:0!important; }
  body.reading-mode .reader-top,
  body.reading-mode .reader-unified-controls,
  body.reading-mode .tajweed-legend,
  body.reading-mode .reader-reading-progress,
  body.reading-mode .reader-end-actions { position:static!important; transform:none!important; }
  body.reading-mode .reader-page { flex:none!important; width:100%!important; height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important; padding:0!important; margin:0!important; border:0!important; border-radius:0!important; box-shadow:none!important; }
  body.reading-mode .reader-verses { width:100%!important; max-width:none!important; padding:0!important; margin:0!important; font-size:clamp(29px,5vw,38px); line-height:2.1; word-spacing:normal; }
  body.reading-mode .mushaf-sheet,
  body.reading-mode .mushaf-sheet[hidden] { display:block!important; box-sizing:border-box; width:100%!important; max-width:none!important; min-height:0!important; height:auto!important; margin:0!important; padding:18px 12px 22px!important; background:#fffdf8!important; border:0!important; border-radius:0!important; outline:0!important; box-shadow:none!important; }
  body.reading-mode .mushaf-sheet::before,
  body.reading-mode .mushaf-sheet::after { display:none!important; }
  body.reading-mode .mushaf-sheet-header { padding:0 2px 6px; margin:0 0 12px; border-top:0; border-left:0; border-right:0; border-bottom:1px solid #e7dfcb; }
  body.reading-mode .mushaf-sheet-body { height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important; }
  body.reading-mode .mushaf-sheet-footer { margin:12px 0 0; padding:6px 0 0; }
  body.reading-mode .reader-end-actions { order:8; width:100%; margin:0!important; border-radius:0!important; }
}
@media (max-width: 600px) {
  body.reading-mode .header .top { padding:8px 10px; }
  body.reading-mode .reader-unified-controls { padding:8px 10px; }
  body.reading-mode .reader-verses { font-size:clamp(30px,7.4vw,39px); line-height:2.05; text-align:justify; }
  body.reading-mode .mushaf-sheet,
  body.reading-mode .mushaf-sheet[hidden] { padding:12px 7px 20px!important; }
  body.reading-mode .reader-surah { max-width:100%; margin:12px 0 16px; border-radius:11px; }
  body.reading-mode .reader-end-actions { padding:16px 10px 22px; }
  body.reading-mode .reader-end-actions .reader-tools-left { width:100%; }
  body.reading-mode .reader-end-actions .reader-tools-left button { min-height:44px; }
}

/* V17 - collapsible advanced create settings */
.extra-options{border:1px solid #cadbd4;border-radius:14px;overflow:hidden;background:#f8fbf9;margin:8px 0 18px}.extra-options summary{list-style:none;display:flex;justify-content:space-between;align-items:center;cursor:pointer;background:#e7f2ed;color:#105447;font-weight:800;font-size:1.06rem;padding:18px 20px;user-select:none}.extra-options summary::-webkit-details-marker{display:none}.extra-options summary:focus-visible{outline:3px solid #126c60;outline-offset:-3px}.extra-chevron{transition:transform .2s;font-size:1.5rem}.extra-options[open] .extra-chevron{transform:rotate(180deg)}.extra-options-content{padding:20px;display:flex;flex-direction:column;gap:15px}.extra-options-content label.check{display:flex;align-items:center;gap:12px;line-height:1.5}.extra-options-content label.check input{width:20px;height:20px;flex:0 0 20px}.extra-note{font-size:.86rem;color:#607b73;margin:0}@media(max-width:600px){.extra-options summary{padding:14px 16px}.extra-options-content{padding:14px;gap:12px}}
