:root{--paper:#f4f5ed;--surface:#e8eee5;--ink:#1c2822;--muted:#526657;--line:#cbd9cc;--accent:#3c654b;--arabic-size:32px;--leading:2.3;color-scheme:light}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.6 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input{font:inherit}button,a,input{touch-action:manipulation}button{cursor:pointer;color:inherit}button{border:0;background:transparent}button:hover{background:var(--surface)}button:disabled{opacity:.35;cursor:default}a{color:inherit;text-underline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,#verses:focus-visible{outline:2px solid var(--accent);outline-offset:4px}input{color:var(--ink);border:1px solid var(--line);background:var(--paper);border-radius:6px;padding:10px 12px;min-width:0}input[type=range]{padding:0;accent-color:var(--accent)}.skip{position:fixed;left:20px;top:-80px;background:var(--ink);color:var(--paper);z-index:50;padding:10px}.skip:focus{top:10px}#sidebar{position:fixed;width:292px;inset:0 auto 0 0;border-right:1px solid var(--line);display:flex;flex-direction:column;background:var(--paper);z-index:20}.brand{display:flex;gap:13px;align-items:center;padding:33px 24px;text-decoration:none;font-family:Georgia,serif;font-size:23px;letter-spacing:-.6px;line-height:1.1}.brand small{display:block;font:12px/1.5 system-ui;letter-spacing:0;color:var(--muted);margin-top:7px}.brand-icon{display:grid;place-items:center;border:1px solid var(--accent);border-radius:50% 50% 12% 12%;width:36px;height:43px;font-size:26px;color:var(--accent)}.sidebar-body{overflow:auto;flex:1;padding:12px 16px}.side-label{display:flex;justify-content:space-between;font-size:12px;letter-spacing:1.4px;padding:5px 10px 16px}.side-label span{color:var(--muted);letter-spacing:.5px}.find{display:flex;gap:7px;align-items:center;background:var(--surface);border-radius:6px;padding:2px 10px;margin-bottom:17px}.find span{font-size:25px}.find input{border:0;background:none;width:100%;padding-left:0;font-size:14px}.surah{display:flex;text-align:left;align-items:center;width:100%;gap:12px;padding:12px 10px;border-radius:6px;margin:3px 0}.surah[aria-current=true]{background:var(--surface);box-shadow:inset 3px 0 var(--accent)}.surah-num{font-size:12px;color:var(--muted);width:24px}.surah-text{flex:1;font-size:15px}.surah-text small{display:block;color:var(--muted);font-size:12px;margin-top:1px}.surah-ar{font:23px/1.6 "Noto Naskh Arabic","Geeza Pro",serif}.sidebar-foot{padding:21px 26px;border-top:1px solid var(--line);font-size:14px}.sidebar-foot span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.continue{display:block;width:100%;background:var(--ink);color:var(--paper);text-align:left;border-radius:6px;padding:12px;font-size:14px;margin-bottom:15px}.continue:hover{background:var(--accent)}.continue span{display:block;opacity:.75;font-size:12px}.workspace{margin-left:292px}.toolbar{height:83px;position:sticky;top:0;z-index:10;background:var(--paper);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 44px;gap:16px}.crumb{display:flex;align-items:center;gap:16px;font-size:14px}.crumb>span{font-size:12px;letter-spacing:1.8px;color:var(--muted)}.crumb i{font-style:normal;color:var(--line)}.crumb strong{font-weight:500}.tools{display:flex;align-items:center;gap:8px}.tools button{min-height:44px;padding:8px 14px;border-radius:6px}.tools button:first-child span:first-child{font-size:22px}.tools #appearanceButton{font:22px Georgia,serif}.preview-dot{display:inline-block;border:1px solid var(--accent);width:6px;height:6px;border-radius:50%;vertical-align:middle;margin-left:4px}main{max-width:880px;padding:32px 66px 35px;margin:auto}.reading-top{display:flex;justify-content:space-between;color:var(--muted);font-size:13px}.eyebrow{font-size:12px;letter-spacing:2px}.edition span{margin:0 8px;color:var(--line)}.chapter-heading{position:relative;padding-top:46px}.chapter-number{font-size:12px;letter-spacing:2px;color:var(--accent);margin:0 0 13px}h1{font:normal clamp(42px,4.5vw,65px)/1.1 Georgia,serif;letter-spacing:-2px;margin:0;max-width:70%}.chapter-meaning{font:20px Georgia,serif;color:var(--muted);margin:14px 0 38px}.chapter-arabic{position:absolute;right:0;top:52px;font:46px/1.7 "Noto Naskh Arabic","Geeza Pro",serif;margin:0;max-width:35%}.chapter-detail{border-top:1px solid var(--line);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:12px 0;font-size:14px;gap:12px;color:var(--muted)}.chapter-detail label{display:flex;align-items:center;gap:10px}.chapter-detail input{width:70px;padding:5px 8px;border:0;background:var(--surface)}.chapter-detail button{width:34px;height:38px;color:var(--ink)}.status{color:var(--muted);font-size:14px}.status:empty{display:none}.verse{position:relative;padding:28px 0 23px 40px;scroll-margin-top:104px}.verse+.verse{border-top:1px solid color-mix(in srgb,var(--line) 40%,transparent)}.verse p{font-family:"Noto Naskh Arabic","Geeza Pro","Times New Roman",serif;font-size:var(--arabic-size);line-height:var(--leading);margin:0;text-align:right;direction:rtl;font-weight:400;overflow-wrap:break-word}.verse-ref{position:absolute;left:-3px;top:40px;min-width:30px;height:30px;display:grid;place-items:center;font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:50%;text-decoration:none}.verse:target{background:var(--surface);box-shadow:0 0 0 12px var(--surface);border-radius:3px}.chapter-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding-top:28px;margin-top:35px;font-size:14px}.chapter-nav button{padding:10px}.chapter-nav span{font-size:12px;color:var(--muted)}.reading-foot{margin-top:45px;border-top:1px solid var(--line);padding-top:20px;display:flex;justify-content:space-between;gap:14px;color:var(--muted);font-size:12px}.reading-foot button{font-size:12px;text-decoration:underline}.menu,.mobile-close{display:none}dialog{border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink);width:min(580px,calc(100% - 28px));max-height:85dvh;padding:28px;box-shadow:0 24px 100px #0003}dialog::backdrop{background:#211a145c;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:start;gap:20px;margin-bottom:22px}.dialog-head h2{font:normal 30px/1.2 Georgia,serif;margin:0}.dialog-head button{font-size:28px;min-width:40px;min-height:40px;border-radius:50%}.muted{color:var(--muted);font-size:14px}.search-label{display:block;font-size:14px;margin-bottom:8px}#verseQuery{width:100%}.result{display:block;width:100%;text-align:left;border-top:1px solid var(--line);padding:16px 4px}.result strong{font-size:14px;color:var(--accent)}.result p{font:24px/2 "Noto Naskh Arabic","Geeza Pro",serif;direction:rtl;text-align:right;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin:8px 0}.setting{display:block;margin-bottom:28px}.setting output{float:right}.setting input{display:block;width:100%;margin-top:20px}fieldset{border:0;padding:0}.theme-options{display:flex;gap:10px;flex-wrap:wrap;margin:15px 0}.theme-options label{border:1px solid var(--line);border-radius:8px;padding:12px}.about-card{background:var(--surface);padding:24px;border-radius:10px;margin:30px 0}.about-card h3{font:26px Georgia,serif;margin:15px 0}.download{display:flex;justify-content:space-between;background:var(--ink);color:var(--paper);text-decoration:none;padding:14px 17px;border-radius:6px}.about-card small{display:block;font-size:12px;color:var(--muted);margin-top:10px}body[data-theme=light]{--paper:#fff;--surface:#eef3ed;--line:#d7e2d6}body[data-theme=dark]{--paper:#141c18;--surface:#202d25;--ink:#eef4eb;--muted:#b4c3b5;--line:#405446;--accent:#a4d0aa;color-scheme:dark}[hidden]{display:none!important}@media(min-width:1600px){main{padding-top:45px}}@media(max-width:1100px){#sidebar{width:255px}.workspace{margin-left:255px}main{padding:28px 36px}.toolbar{padding:0 25px}.brand{padding:30px 20px;font-size:21px}.brand small{font-size:12px}.chapter-arabic{font-size:38px}.tools{gap:0}}@media(max-width:780px){#sidebar{transform:translateX(-100%);width:min(320px,86vw);transition:transform .2s}body.nav-open #sidebar{transform:none}.workspace{margin:0}.menu{display:block;font-size:20px;margin-left:-10px;min-height:44px;min-width:44px}.mobile-close{display:block;position:absolute;right:6px;top:4px;font-size:25px;width:40px;height:40px}#veil{position:fixed;inset:0;background:#0005;z-index:19}.toolbar{padding:0 18px;height:70px}.crumb{gap:8px}.crumb>span,.crumb i,.button-word{display:none}.tools button{padding:6px 10px}.tools .about-button{font-size:14px}main{padding:24px 24px 30px}.reading-top .eyebrow{font-size:11px;letter-spacing:1.1px}.edition{font-size:12px}.chapter-heading{padding-top:35px}h1{font-size:44px;max-width:70%}.chapter-arabic{font-size:34px;top:44px}.chapter-meaning{font-size:19px;margin-bottom:28px}.chapter-detail{font-size:13px}.verse{padding-left:27px}.verse-ref{left:-8px;font-size:11px;width:27px;min-width:27px;height:27px}.chapter-nav span{display:none}.reading-foot{flex-direction:column;align-items:start}.verse p{font-size:calc(var(--arabic-size) * .92)}.chapter-detail label{gap:6px}.chapter-detail input{width:60px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.side-actions,.action-row{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.side-actions button,.action-row button,dialog>button,.file-label{border:1px solid var(--line);border-radius:8px;padding:10px 12px;min-height:44px}dialog input,dialog select,dialog textarea{font:inherit;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:6px;padding:10px;max-width:100%;box-sizing:border-box}dialog textarea{width:100%;display:block;margin:10px 0}dialog label{display:block;margin:8px 0}.action-row label{flex:1;min-width:80px}.action-row label input{width:100%}.study-arabic{font-size:var(--arabic-size);line-height:var(--leading);text-align:right}.file-label input{display:block;max-width:200px;font-size:12px}#libraryItems .result{margin:10px 0;width:100%}#juzItems{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}#juzItems button{padding:12px;text-align:left}.verse-ref{cursor:pointer}button:disabled{opacity:.45}.side-actions{padding-bottom:8px}
.verse p.translation,.result p.translation{font-family:inherit;font-size:17px;line-height:1.7;direction:ltr;text-align:left;white-space:pre-line}.verse p.footnotes{font-size:14px;color:var(--muted)}#studyTranslation p{white-space:pre-line;font-size:16px}select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent)}

.verse.playing{background:var(--panel,#e8eee5);outline:2px solid var(--accent,#3c654b);border-radius:12px}#audioBar{position:fixed;z-index:15;bottom:0;left:320px;right:0;background:var(--bg,#f4f5ed);border-top:1px solid #3c654b;display:flex;gap:12px;align-items:center;padding:12px 24px;flex-wrap:wrap}#audioBar[hidden]{display:none}#audioBar audio{height:36px;flex:1;min-width:180px}body:has(#audioBar:not([hidden])) main{padding-bottom:150px}@media(max-width:780px){#audioBar{left:0;padding:10px}#nowPlaying{font-size:12px}}
.verse.playing{background:var(--surface)}#audioBar{left:292px;background:var(--paper);border-color:var(--line)}#libraryItems .result p{font:14px/1.6 system-ui;direction:ltr;text-align:left;white-space:pre-wrap}.verse p.translation{margin-top:16px}.study-arabic{font-family:"Noto Naskh Arabic","Geeza Pro","Times New Roman",serif}#studyTranslation{border-bottom:1px solid var(--line);padding-bottom:12px}@media(max-width:1100px){#audioBar{left:255px}}@media(max-width:780px){#audioBar{left:0}}@media(max-width:480px){h1{max-width:100%;font-size:40px;overflow-wrap:anywhere}.chapter-arabic{position:static;max-width:100%;text-align:right;margin:0 0 16px}.chapter-meaning{margin-bottom:12px}.dialog-head h2{font-size:26px}dialog{padding:20px}.chapter-detail{flex-wrap:wrap}.chapter-detail label{margin-left:auto}}

/* Reading controls and the ayah study panel */
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.tools #themeToggle{display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:999px;padding:6px 13px;font-size:13px;font-weight:600;white-space:nowrap}
.tools #themeToggle span[aria-hidden]{font-size:19px;line-height:1}
.tools #themeToggle[aria-pressed=true]{background:var(--surface);border-color:var(--accent)}
dialog{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
#studyDialog{width:min(720px,calc(100vw - 32px));padding:0;scrollbar-gutter:stable}
#studyDialog .dialog-head{position:sticky;top:0;z-index:2;align-items:center;margin:0;padding:18px 28px;background:var(--paper);border-bottom:1px solid var(--line)}
#studyDialog .dialog-head h2{font-size:26px}
#studyDialog .dialog-head button{display:grid;place-items:center;font-size:24px;line-height:1;border:1px solid var(--line)}
#studyDialog .study-content,#studyDialog .study-navigation,#studyDialog .study-tools,#studyDialog .study-section{margin-left:28px;margin-right:28px}
#studyDialog .study-content{padding:12px 0 18px}
#studyDialog .study-arabic{margin:12px 0 20px}
#studyTranslation{padding-bottom:8px;border:0}
#studyTranslation p{margin:12px 0}
#studyDialog button{transition:background-color .15s,border-color .15s}
.study-navigation{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:16px 0}
.study-navigation button,.study-tools button,.study-collection button,#studyDialog .primary-button{min-height:44px;border:1px solid var(--line);border-radius:9px;padding:9px 14px;font-size:14px;font-weight:600}
.study-navigation button{background:var(--surface)}
.study-tools{display:flex;flex-wrap:wrap;gap:8px;padding:0 0 24px}
.study-tools button{background:transparent}
.study-tools #listenAyah,.study-tools #bookmarkAyah{background:var(--surface)}
.study-tools #readAyah,#studyDialog .primary-button{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.study-tools #readAyah:hover,#studyDialog .primary-button:hover{background:var(--accent);border-color:var(--accent);color:var(--paper)}
.study-section{border-top:1px solid var(--line);padding:20px 0 24px}
.study-section h3{font:normal 22px/1.3 Georgia,serif;margin:0 0 12px}
.study-section label{font-size:13px;font-weight:600;color:var(--muted);margin:0 0 8px}
.study-collection{display:flex;gap:9px;margin:9px 0}
.study-collection select,.study-collection input{flex:1;min-width:0;width:100%}
.study-collection .quiet-button{border-color:transparent;color:var(--muted);font-weight:500}
.study-section textarea{margin:0 0 12px;min-height:110px;resize:vertical}
.study-section .muted{line-height:1.5;margin:12px 0 0}
#studyStatus{font-size:13px;color:var(--accent);margin:10px 0 0}
#studyStatus:empty{display:none}
body[data-theme=dark] dialog::backdrop{background:#0009}
@media(max-width:780px){.tools #themeToggle{padding:6px 10px}.theme-word{display:none}}
@media(max-width:480px){#studyDialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}#studyDialog .dialog-head{padding:14px 18px}#studyDialog .study-content,#studyDialog .study-navigation,#studyDialog .study-tools,#studyDialog .study-section{margin-left:18px;margin-right:18px}.study-tools button{flex:1 1 auto}.study-navigation button{flex:1}.study-collection button{white-space:nowrap}}

/* A restrained warm-gold accent alongside the forest-green reader palette. */
:root{--gold:#82602f}
body[data-theme=dark]{--gold:#d9ba79}
.brand-icon{color:var(--gold);border-color:var(--gold)}
.chapter-number{color:var(--gold)}
.preview-dot{border-color:var(--gold)}

/* Reader dialogs: clear controls, stable headings and useful empty states. */
#libraryDialog,#practiceDialog,#planDialog{width:min(640px,calc(100vw - 32px))}
#libraryDialog .dialog-head,#practiceDialog .dialog-head,#planDialog .dialog-head{position:sticky;top:0;z-index:2;background:var(--paper);padding:4px 0 14px;border-bottom:1px solid var(--line)}
.library-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(155px,195px);gap:12px;align-items:center;margin:18px 0}
.library-filters input,.library-filters select{width:100%;min-width:0;min-height:46px}
.library-backups{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0 12px}
.library-backups button,.library-backups .file-label{display:flex;align-items:center;justify-content:center;min-height:48px;width:100%;padding:10px 14px;border:1px solid var(--line);border-radius:9px;background:var(--surface);font-weight:600;cursor:pointer;text-align:center}
.library-backups .file-label input[type=file]{position:absolute;width:1px;height:1px;padding:0;border:0;opacity:0;pointer-events:none}
.library-backups .file-label:focus-within{outline:2px solid var(--accent);outline-offset:3px}
#libraryItems>p{margin:18px 0;padding:22px;background:var(--surface);border-radius:10px;color:var(--muted)}
.practice-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
.practice-fields label{display:block;font-size:13px;font-weight:600;color:var(--muted)}
.practice-fields input{display:block;width:100%;margin-top:6px;min-height:46px}
.primary-action{border:1px solid var(--ink);background:var(--ink);color:var(--paper);padding:11px 16px;border-radius:9px;min-height:46px;font-weight:600}
.primary-action:hover{background:var(--accent);border-color:var(--accent);color:var(--paper)}
.empty-panel{padding:22px;margin:18px 0 0;border-radius:10px;background:var(--surface);color:var(--muted)}
#practiceSession{margin-top:20px;padding-top:10px;border-top:1px solid var(--line)}
#practiceRef{font-weight:600}
.practice-controls{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.practice-controls button{border:1px solid var(--line);border-radius:9px;padding:10px 14px;min-height:44px}
#dailyProgress{padding:14px 16px;border-radius:10px;background:var(--surface);font-weight:600}
.target-form{display:grid;grid-template-columns:minmax(0,1fr) 86px auto;gap:12px;align-items:end;margin:20px 0}
.target-form label{font-weight:600}
.target-form label span{display:block;color:var(--muted);font-size:12px;font-weight:400}
.target-form input{width:100%;min-height:46px}
.target-form button{border:1px solid var(--line);border-radius:9px;min-height:46px;padding:9px 16px;font-weight:600;background:var(--surface)}
#planDialog hr{border:0;border-top:1px solid var(--line);margin:26px 0}
#juzDialog{width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
#juzDialog .dialog-head{position:sticky;top:0;z-index:2;align-items:center;margin:0;padding:18px 24px;background:var(--paper);border-bottom:1px solid var(--line)}
#juzItems{max-height:calc(100dvh - 130px);overflow-y:auto;overscroll-behavior:contain;align-content:start;gap:8px;padding:16px 24px 24px}
#juzItems button{min-height:52px;text-align:left;border:1px solid var(--line);border-radius:9px;background:var(--surface);padding:10px 14px}
#juzItems button:hover{border-color:var(--accent)}
@media(max-width:560px){.library-filters{grid-template-columns:1fr}.library-backups{grid-template-columns:1fr}.practice-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.practice-fields label:first-child{grid-column:1/-1}.target-form{grid-template-columns:minmax(0,1fr) 80px}.target-form button{grid-column:1/-1}.practice-controls button{flex:1 1 auto}#juzItems{grid-template-columns:1fr}}

/* Keep the sidebar actions aligned at both desktop and phone widths. */
.side-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0;padding-bottom:8px}
.side-actions button{width:100%;min-width:0;min-height:48px;padding:8px 10px;text-align:center;line-height:1.25;font-size:13px}
.side-actions button:last-child:nth-child(odd){grid-column:1/-1}

/* Place secondary tools below the scrollable surah list. */
.sidebar-foot{padding:10px 16px 14px}
#sidebarTools summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding:8px 10px;border-radius:8px;cursor:pointer;font-weight:600;list-style:none}
#sidebarTools summary::-webkit-details-marker{display:none}
#sidebarTools summary:hover,#sidebarTools[open] summary{background:var(--surface)}
#sidebarTools summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#sidebarTools summary span{display:inline;margin:0;color:var(--muted);font-size:18px;line-height:1;transform:rotate(180deg)}
#sidebarTools[open] summary span{transform:none}
#sidebarTools .side-actions{margin:8px 0 12px;padding-bottom:0}
.source-credit{border-top:1px solid var(--line);padding:10px 10px 0;font-size:12px}
.source-credit span{font-size:11px}

/* A drawn search icon keeps the glyph aligned across fonts and devices. */
.search-icon{display:block;width:18px;height:18px;flex:none}
.find .search-icon{margin-left:4px}
#searchButton{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}
