@font-face{font-family:NoorUI;src:url('./assets/fonts/ui.woff2') format('woff2');font-weight:400 700;font-display:swap}
@font-face{font-family:NoorQuran;src:url('./assets/fonts/quran.woff2') format('woff2');font-weight:400;font-display:swap}
:root{color-scheme:light;--bg:#e9e7de;--surface:#f8f6ef;--paper:#fff;--text:#253c33;--muted:#6e776e;--accent:#245744;--accent-soft:#e5ece2;--gold:#a18046;--line:#dcded2;--shadow:0 14px 45px #26382a13;--highlight:#d2ab3548;--playing:#56a5815c;--brightness:1;--warmth:0;--night-filter:brightness(1);font-family:NoorUI,Tahoma,Arial,sans-serif;font-size:15px}
:root[data-theme=night]{color-scheme:dark;--bg:#151d1b;--surface:#202b26;--paper:#1c211c;--text:#e2e9d8;--muted:#a6b09e;--accent:#b9d3b4;--accent-soft:#334139;--gold:#c9ac73;--line:#3b453d;--highlight:#d4b25745;--playing:#7fcba64a;--shadow:0 16px 45px #0004;--night-filter:invert(.87) hue-rotate(155deg) saturate(.45)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overscroll-behavior:none}body{background:var(--bg);color:var(--text)}button,input,select{font:inherit;color:inherit}button,select,input[type=range]{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.35}button{border:0;background:none}a{color:var(--accent);text-underline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--gold);outline-offset:3px}input,select{accent-color:var(--accent)}input[type=range]{width:100%;cursor:pointer}input[type=search]::-webkit-search-cancel-button{cursor:pointer}svg{width:21px;height:21px;display:block;flex-shrink:0}h1,h2,p{margin:0}h1{font-size:19px;font-weight:700;line-height:1.65}h2{font-size:20px;line-height:1.7}small{display:block;color:var(--muted);font-size:12px;line-height:1.9}[hidden]{display:none!important}.muted{color:var(--muted)}.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip:focus{position:fixed;z-index:50;background:var(--surface);padding:12px;inset:10px auto auto 10px}.eyebrow{font-size:12px;color:var(--gold);letter-spacing:.1px}.separator{width:1px;height:23px;background:var(--line);margin:0 4px}
#app{height:100dvh;min-height:350px;display:flex;flex-direction:column;overflow:hidden}.header{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:80px;padding:10px 26px;background:var(--surface);border-bottom:1px solid var(--line);flex-shrink:0}.identity{display:flex;gap:12px;align-items:center;min-width:0}.brand-symbol{width:42px;height:46px;color:var(--accent);display:grid;place-items:center;border:1px solid var(--line);border-radius:12px}.brand-symbol svg{width:27px;height:27px}.identity p{color:var(--muted);font-size:11px;white-space:nowrap}.header-actions{display:flex;align-items:center;gap:7px}.tool{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-width:44px;height:44px;border-radius:9px;color:var(--muted);transition:background .15s,color .15s}.tool:hover,.text-tool:hover{background:var(--accent-soft);color:var(--accent)}.tool.active,.tool[aria-pressed=true]{color:var(--accent);background:var(--accent-soft)}.tool.labeled{gap:8px;padding:0 13px;font-size:14px;color:var(--accent)}.count{position:absolute;top:0;right:0;min-width:18px;height:18px;background:var(--accent);color:var(--surface);font-size:10px;line-height:18px;border-radius:12px;padding:0 3px}.reading-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 26px;min-height:50px;flex-shrink:0;border-bottom:1px solid var(--line);background:var(--surface)}.reading-bar>div:first-child{display:flex;align-items:center;gap:12px;min-width:0}.reading-bar strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400}.reading-bar .muted{font-size:12px;white-space:nowrap}.status-dot{width:6px;height:6px;border-radius:50%;background:var(--gold);flex-shrink:0}.reading-tools{display:flex;gap:3px;align-items:center}.reading-tools .tool{height:40px}.text-tool{padding:0 7px;min-width:50px;height:40px;font-size:12px;border-radius:9px;color:var(--muted)}
#reader{display:flex;flex:1;min-height:0;outline:none}.stage-wrap{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.stage{flex:1;min-height:0;position:relative;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent;padding:16px 26px 9px;overscroll-behavior:contain;touch-action:pan-y pinch-zoom}.book{display:flex;direction:rtl;align-items:flex-start;justify-content:center;width:max-content;min-width:100%;gap:2px;margin:auto;perspective:1800px;min-height:100%;transform-origin:center center}.page{position:relative;flex-shrink:0;width:var(--page-width,390px);aspect-ratio:622/917;box-shadow:var(--shadow);background:var(--paper);user-select:none;touch-action:pan-y pinch-zoom;overflow:hidden;border-radius:2px}.book.double .page:first-child{box-shadow:7px 4px 20px #10221416}.book.double .page:last-child{box-shadow:-7px 4px 20px #10221416}.book.double .page:first-child:after{content:'';pointer-events:none;position:absolute;inset:0 auto 0 0;width:12px;background:linear-gradient(to right,#0002,transparent)}.book.double .page:last-child:after{content:'';pointer-events:none;position:absolute;inset:0 0 0 auto;width:12px;background:linear-gradient(to left,#0002,transparent)}.page-image{display:block;width:100%;height:100%;pointer-events:none;object-fit:fill;filter:var(--night-filter) sepia(var(--warmth)) brightness(var(--brightness))}.ayah-layer{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.ayah-hit{cursor:pointer;outline:none}.ayah-hit rect{fill:transparent;transition:fill .15s}.ayah-hit.selected rect{fill:var(--highlight)}.ayah-hit.playing rect{fill:var(--playing)}.ayah-hit:focus-visible rect{stroke:var(--gold);stroke-width:1.2;fill:var(--highlight)}@media(hover:hover){.ayah-hit:hover rect{fill:var(--highlight)}}.page-mark{position:absolute;top:0;right:10px;pointer-events:none;color:var(--accent);background:var(--surface);border:1px solid var(--line);border-top:0;clip-path:polygon(0 0,100% 0,100% 100%,50% 82%,0 100%);width:24px;height:38px;padding:4px 3px}.page-mark svg{width:16px;height:18px}.loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;font-size:14px;background:var(--bg);z-index:2;min-height:120px}.loader{border:2px solid var(--line);border-top-color:var(--gold);width:27px;height:27px;border-radius:50%;animation:spin .8s linear infinite}.error-box{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:18px;background:var(--bg);z-index:3}.error-box p{max-width:90%;text-align:center}.page-navigation{height:47px;display:flex;align-items:center;justify-content:center;gap:30px;flex-shrink:0;padding:0 18px 3px}.nav-page{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 12px;color:var(--muted);font-size:12px;border-radius:8px}.nav-page:hover{background:var(--accent-soft);color:var(--accent)}.nav-page svg{width:18px;height:18px}.page-position{height:44px;min-width:100px;font-size:14px}.page-position>span:first-child{font-weight:700;color:var(--accent)}
.tafsir-panel{width:335px;flex-shrink:0;border-right:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;min-height:0}.panel-heading,.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:17px 22px 14px;border-bottom:1px solid var(--line);flex-shrink:0}.panel-heading h2{font-size:18px}.tafsir-scroll{overflow:auto;overscroll-behavior:contain;flex:1;padding:18px 23px 25px}.verse-reference{font-size:13px;color:var(--gold);margin-bottom:12px}.quran-text{font-family:NoorQuran,serif;font-size:25px;line-height:1.95;direction:rtl;text-align:right}.small-rule{height:1px;width:40px;background:var(--gold);opacity:.45;margin:20px 0}.tafsir-text{font-size:16px;line-height:2.05;white-space:pre-line}.source-note{font-size:11px;line-height:1.9;color:var(--muted);margin-top:20px}.tafsir-actions{display:flex;gap:8px;padding:14px 20px;border-top:1px solid var(--line);flex-shrink:0}.secondary,.primary{min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:8px;padding:8px 14px;font-size:13px;line-height:1.8}.primary{background:var(--accent);color:var(--surface)}.secondary{border:1px solid var(--line);background:var(--surface);color:var(--accent)}.secondary:hover{background:var(--accent-soft)}.primary:hover{filter:brightness(.95)}.secondary svg{width:17px;height:17px}.tafsir-actions button{flex:1;white-space:nowrap}
.player{background:var(--surface);border-top:1px solid var(--line);padding:10px 26px max(7px,env(safe-area-inset-bottom));flex-shrink:0}.player-main{display:flex;align-items:center;justify-content:space-between;gap:15px;max-width:1150px;margin:auto}.reciter-picker{display:flex;align-items:center;gap:12px;width:280px}.reciter-picker label{font-size:11px;color:var(--gold)}select{background:transparent;border:1px solid var(--line);border-radius:8px;min-height:40px;padding:4px 10px;font-size:13px;max-width:100%;cursor:pointer}option{background:var(--surface);color:var(--text)}.reciter-picker select{flex:1;border-color:transparent;padding-right:0;min-width:0;font-size:14px}.transport{display:flex;align-items:center;gap:8px}.play-button{background:var(--accent);color:var(--surface);width:46px;height:46px;border-radius:50%;display:grid;place-items:center;transition:transform .15s;position:relative}.play-button:hover{transform:scale(1.04)}.play-button.busy:after{content:'';position:absolute;inset:-4px;border:2px solid transparent;border-top-color:var(--gold);border-radius:50%;animation:spin .8s linear infinite}.play-button svg{width:22px;height:22px}.play-options{width:280px;display:flex;align-items:center;justify-content:flex-end;gap:8px}.repeat-button span:last-child:not(:first-child){position:absolute;bottom:1px;left:3px;font-size:10px;background:var(--surface);line-height:14px;min-width:14px}.speed-picker select{width:73px;padding:4px 7px;min-height:35px}.player-timeline{display:flex;align-items:center;gap:12px;direction:ltr;max-width:1000px;margin:5px auto 0;height:21px;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.player-timeline span{min-width:33px;direction:ltr;white-space:nowrap}.player-timeline input{height:4px}.player-caption{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:3px auto 0;max-width:1150px;font-size:11px;color:var(--muted);min-height:20px}.player-caption button{font-size:11px;color:var(--gold);text-decoration:underline;text-underline-offset:3px;padding:3px 6px}.player-caption>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-caption .audio-failed{color:#ad4a3d}.exit-focus{position:fixed;top:max(10px,env(safe-area-inset-top));left:12px;z-index:10;box-shadow:var(--shadow);opacity:.85}.focus-mode .header,.focus-mode .reading-bar,.focus-mode .player{display:none}.focus-mode .stage{padding-top:max(12px,env(safe-area-inset-top));padding-left:12px;padding-right:12px}.focus-mode .page-navigation{height:44px}.toast{position:fixed;bottom:145px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--surface);font-size:13px;line-height:1.8;padding:10px 20px;border-radius:9px;box-shadow:var(--shadow);z-index:30;max-width:90%;text-align:center;pointer-events:none}
.dialog{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:16px;padding:0;box-shadow:0 30px 100px #10231f4d;width:460px;max-width:calc(100vw - 24px);max-height:85dvh;overflow:hidden}.dialog[open]{display:flex;flex-direction:column}.dialog::backdrop{background:#101e1899;backdrop-filter:blur(3px)}.dialog-heading h2{font-size:20px}.index-tabs{display:flex;gap:4px;padding:12px 16px 4px}.index-tabs button{font-size:13px;flex:1;min-height:43px;border-bottom:2px solid transparent;color:var(--muted)}.index-tabs button[aria-selected=true]{border-color:var(--gold);color:var(--accent)}.search-wrap{display:flex;align-items:center;gap:10px;margin:12px 20px;padding:2px 12px;border:1px solid var(--line);border-radius:8px;color:var(--muted)}.search-wrap svg{width:17px;height:17px}.search-wrap input{background:transparent;border:0;min-height:42px;min-width:0;width:100%;font-size:14px;outline-offset:1px}.index-results{overflow:auto;min-height:80px;max-height:48dvh;overscroll-behavior:contain;flex:1;padding:0 12px 12px}.index-row{border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;width:100%;text-align:right;padding:11px 10px;min-height:58px}.index-row:hover{background:var(--accent-soft)}.index-row .number{border:1px solid var(--line);border-radius:50%;width:30px;height:30px;display:grid;place-items:center;font-size:11px;flex-shrink:0;color:var(--gold)}.index-row>div{flex:1;min-width:0}.index-row strong{font-size:16px;font-weight:400}.index-row small{font-size:11px}.index-row .page-ref{font-size:12px;color:var(--gold);white-space:nowrap}.search-result-text{font-family:NoorQuran,serif;font-size:23px;line-height:1.8;display:block;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.goto-form{border-top:1px solid var(--line);padding:14px 20px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.goto-form label{flex:1;font-size:13px}.goto-form input{width:82px;min-height:42px;border:1px solid var(--line);background:transparent;border-radius:8px;text-align:center;font-size:14px}.goto-form p{font-size:12px;flex-basis:100%;color:#ad4a3d}.empty-state{text-align:center;padding:32px 18px;color:var(--muted);font-size:14px;line-height:2}.bookmark-row{display:flex;align-items:center;border-bottom:1px solid var(--line)}.bookmark-row .index-row{border:0;flex:1;width:0}.bookmark-row .tool{margin-left:6px}.dialog-note{font-size:12px;line-height:1.9;color:var(--muted);padding:14px 22px;border-top:1px solid var(--line)}.settings-body,.about-body{overflow:auto;overscroll-behavior:contain;padding:20px 24px}.settings-body fieldset{border:0;padding:0;margin:0 0 17px}.settings-body legend{font-size:14px;margin-bottom:10px}.theme-choices{display:flex;gap:10px}.theme-choice{flex:1;border:1px solid var(--line);border-radius:9px;padding:10px;display:flex;align-items:center;justify-content:center;gap:8px;min-height:50px;cursor:pointer;font-size:13px}.theme-choice:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}.theme-choice input{margin:0}.paper-swatch,.night-swatch{width:18px;height:23px;border-radius:3px;background:#f5ecda;border:1px solid #b6b1a3}.night-swatch{background:#17201a;border-color:#7c8a73}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding:16px 0;font-size:14px}.setting-row select{max-width:185px}.setting-row input[type=checkbox]{width:36px;height:22px;cursor:pointer}.range-setting{display:block;padding:15px 0;border-top:1px solid var(--line);font-size:14px}.range-setting>span{display:flex;justify-content:space-between;margin-bottom:10px}.range-setting output{color:var(--muted);font-size:12px;direction:ltr}.settings-body .dialog-note{padding:14px 0}.settings-body>.secondary{margin-top:12px;width:100%}.about-body p,.about-body li{font-size:14px;line-height:2.05}.about-body p+p{margin-top:15px}.about-body ul{padding-right:20px}.about-body li{margin:13px 0}.about-body .source-note{font-size:12px}
.zoomed .stage,.zoomed .page{touch-action:pan-x pan-y pinch-zoom}
@keyframes spin{to{transform:rotate(360deg)}}
@media(min-width:1600px){.header,.reading-bar{padding-right:40px;padding-left:40px}.stage{padding:20px 40px 10px}}
@media(max-width:1050px){.header{padding:8px 16px;min-height:70px}.reading-bar{padding:2px 15px}.tafsir-panel{width:300px}.reciter-picker,.play-options{width:220px}.player{padding-left:18px;padding-right:18px}.stage{padding-left:15px;padding-right:15px}}
@media(max-width:760px){:root{font-size:14px}.header{min-height:67px;padding:6px 10px;gap:6px}.brand-symbol{display:none}.identity{gap:0;min-width:118px}h1{font-size:17px}.identity p{font-size:10px}.identity p span{display:none}.header-actions{gap:0}.header-actions .labeled{padding:0;width:42px;min-width:42px}.header-actions .labeled>span:last-child{display:none}.header-actions .tool{min-width:42px;width:42px}.separator{display:none}.header svg{width:20px;height:20px}.reading-bar{padding:1px 10px;min-height:45px;gap:3px}.reading-bar>div:first-child{gap:7px;flex:1}.reading-bar strong{font-size:13px;max-width:145px}.reading-bar .muted{font-size:10px}.status-dot{display:none}.reading-tools{gap:0}.reading-tools .tool{width:38px;min-width:38px;height:40px}.reading-tools .zoom-tool,.desktop-tool{display:none!important}.reading-tools .text-tool{min-width:43px;padding:0 3px;font-size:10px}#reader{flex-direction:column}.stage{padding:9px 8px 5px}.page-navigation{height:44px;gap:23px;padding-bottom:0}.nav-page{padding:0 8px;font-size:12px}.tafsir-panel{width:100%;max-height:34dvh;min-height:155px;border-right:0;border-top:1px solid var(--line)}.panel-heading{padding:7px 15px;min-height:49px}.panel-heading>div{display:flex;align-items:center;gap:8px}.panel-heading h2{font-size:15px}.panel-heading .eyebrow{font-size:10px}.panel-heading .tool{width:40px;min-width:40px;height:36px}.tafsir-scroll{padding:10px 17px 16px}.verse-reference{font-size:12px;margin-bottom:5px}.quran-text{font-size:24px;line-height:1.8}.small-rule{margin:10px 0}.tafsir-text{font-size:15px;line-height:2}.tafsir-actions{padding:6px 15px;gap:10px}.tafsir-actions button{min-height:35px;padding:4px 10px;font-size:12px}.tafsir-scroll .source-note{margin-top:10px;font-size:10px}.player{padding:7px 10px max(5px,env(safe-area-inset-bottom))}.player-main{gap:2px;flex-wrap:wrap;position:relative}.reciter-picker{width:calc(100% - 92px);gap:7px;order:0;max-width:250px}.reciter-picker select{min-height:33px;font-size:13px;padding-left:3px}.reciter-picker label{font-size:10px}.transport{position:absolute;top:36px;left:50%;transform:translateX(-50%);gap:5px;order:2;height:44px}.transport .tool{width:40px;min-width:40px;height:40px}.play-button{width:42px;height:42px}.play-options{width:88px;gap:0;order:1}.play-options .tool{width:40px;min-width:40px;height:36px}.speed-picker select{width:48px;min-height:33px;font-size:11px;padding:0;border:0}.player-timeline{margin-top:49px;height:14px;gap:8px;font-size:10px}.player-caption{font-size:10px;margin-top:5px;min-height:16px}.player-caption button{font-size:10px}.toast{bottom:170px}.dialog{max-height:88dvh;max-width:calc(100vw - 20px);border-radius:14px}.dialog-heading{padding:14px 19px 10px}.dialog-heading h2{font-size:19px}.dialog-heading .eyebrow{font-size:11px}.index-results{max-height:45dvh}.index-tabs{padding-top:6px}.index-tabs button{font-size:12px}.settings-body,.about-body{padding:15px 20px}.focus-mode .stage{padding-top:7px}.focus-mode .page-navigation{height:40px}.focus-mode .tafsir-panel{max-height:35dvh}}
@media(max-width:360px){.header{padding-right:8px;padding-left:8px}.header-actions .tool{width:38px;min-width:38px}.identity{min-width:103px}h1{font-size:16px}.reading-bar .muted{display:none}.reading-bar strong{max-width:130px}.reciter-picker{max-width:220px}.page-navigation{gap:12px}}
@media(max-height:550px) and (min-width:761px){.header{min-height:57px;padding-top:4px;padding-bottom:4px}.reading-bar{min-height:40px}.reading-bar .tool,.reading-bar .text-tool{height:34px}.player{padding-top:4px}.player-caption{display:none}.player-timeline{margin-top:0}.player-main{height:42px}.stage{padding-top:6px}.page-navigation{height:38px}.tafsir-actions{padding:7px 12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
