:root{color-scheme:light;--bg:#f5f4ec;--surface:#fffefa;--text:#20352e;--muted:#52675c;--line:#dddccf;--accent:#126048;--selected:#e1eee4;--hero:#102e29;--gold:#edd799;font-family:system-ui,sans-serif}
:root[data-theme=dark]{color-scheme:dark;--bg:#14221e;--surface:#1c2d27;--text:#f2f4eb;--muted:#b9ccbf;--line:#3c5046;--accent:#a1dfbb;--selected:#2d493b}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--text)}
a{color:var(--accent)}
button,input{font:inherit}
button{cursor:pointer;border:1px solid var(--line);border-radius:.65rem;background:var(--surface);color:var(--text);padding:.55rem .85rem}
button:hover,button[aria-pressed=true]{background:var(--selected);color:var(--accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.skip{position:absolute;top:-5rem}.skip:focus{top:.5rem;background:var(--surface);padding:.5rem;z-index:2}
.top{display:flex;align-items:center;justify-content:space-between;padding:.85rem clamp(1rem,4vw,3rem);background:var(--surface);border-bottom:1px solid var(--line)}
.brand{display:flex;gap:.8rem;align-items:center;color:var(--text);text-decoration:none;font-weight:750;font-size:1.35rem;line-height:1}
.brand [lang=ar]{background:var(--hero);color:var(--gold);border-radius:.8rem;padding:.6rem;font-size:1.55rem}
.brand small{display:block;letter-spacing:.17em;font-size:.63rem;margin-top:.4rem;color:var(--muted)}
.layout{max-width:92rem;margin:auto;display:grid;grid-template-columns:minmax(14rem,19rem) minmax(0,1fr);gap:clamp(1rem,3vw,3rem);padding:clamp(1rem,4vw,3rem)}
aside{align-self:start;position:sticky;top:1rem;background:var(--surface);border:1px solid var(--line);border-radius:1rem;padding:1rem}
summary{font-weight:700;cursor:pointer;margin:.2rem 0 .8rem}
label{display:block;color:var(--muted);font-size:.875rem;margin-bottom:.35rem}
input{width:100%;padding:.65rem .7rem;border:1px solid var(--line);border-radius:.6rem;color:var(--text);background:var(--bg)}
#chapters{margin-top:.65rem;max-height:min(65vh,44rem);overflow:auto;scroll-padding:.3rem}
.chapter{display:grid;grid-template-columns:2rem 1fr auto;gap:.45rem;align-items:center;padding:.58rem .45rem;border-radius:.55rem;text-decoration:none;color:var(--text)}
.chapter:hover,.chapter[aria-current=page]{background:var(--selected);color:var(--accent)}
.chapter small{color:var(--muted);font-size:.82rem}
.hero{border-radius:1.3rem;background:var(--hero);color:#fffdf2;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:clamp(1.35rem,4vw,3rem);border-bottom:4px solid #b89a57}
.hero h1{font-family:Georgia,serif;font-size:clamp(2.1rem,5vw,4.1rem);font-weight:400;margin:.2rem 0}
.hero p{margin:.4rem 0}
.meta{color:var(--gold);font-size:.9rem}
.arabic-title{font-size:clamp(2.3rem,5vw,5rem);color:var(--gold)}
[lang=ar]{font-family:"Traditional Arabic","Amiri","Noto Naskh Arabic","Segoe UI",serif;font-weight:400}
.toolbar,.adjacent,.verse-head,.player>div{display:flex;align-items:center;justify-content:space-between;gap:.5rem;flex-wrap:wrap}
.toolbar{margin:1rem 0}.modes{display:flex;gap:.35rem;flex-wrap:wrap}
#listen{background:var(--hero);color:#fffdf2}
.opening{text-align:center;padding:1.2rem .4rem;color:var(--muted)}
.opening [lang=ar]{font-size:2.15rem;color:var(--accent);margin:0}
.opening p:last-child{margin:.45rem 0 0}
.verse{padding:clamp(1rem,3vw,2rem);background:var(--surface);border:1px solid var(--line);border-radius:.95rem;margin-bottom:.7rem;scroll-margin-top:1rem}
.verse:target,.verse.playing{border-color:var(--accent)}
.verse-head a{text-decoration:none;font-weight:650}
.verse-head button{font-size:.875rem}
.verse .ar{font-size:clamp(1.9rem,4vw,2.7rem);line-height:2;text-align:right;margin:.55rem 0;overflow-wrap:break-word}
.verse .fr{line-height:1.65;margin:.65rem 0 0}
.ar-only .fr,.ar-only .opening p:last-child{display:none}
#status:empty{display:none}
.player{border:1px solid var(--line);background:var(--surface);padding:.7rem;border-radius:.75rem}
audio{width:100%;margin-top:.4rem}
.adjacent,footer{margin-top:1.4rem}
footer{font-size:.88rem;color:var(--muted);line-height:1.6}
@media(max-width:700px){.layout{display:block}aside{position:static;margin-bottom:1rem}#chapters{max-height:15rem}details:not([open]) summary{margin:0}.hero{gap:.7rem}}
