/* User schematic: one small header, a book/context workspace, one bottom dock. */
body.is-reading #main{display:grid;grid-template-rows:44px minmax(0,1fr) 60px;gap:10px;width:100%;max-width:none;height:100dvh;max-height:100dvh;min-height:0;margin:0;padding:12px 20px max(10px,env(safe-area-inset-bottom));overflow:hidden}
.schematic-header{display:flex;align-items:center;gap:10px;min-width:0;direction:ltr}.schematic-book{display:flex;align-items:center;justify-content:center;width:30px;min-width:30px;color:var(--accent);text-decoration:none}.schematic-location{min-width:0;max-width:none;min-height:36px;padding:4px 0;border:0;background:transparent;text-align:start;color:var(--ink)}.schematic-location strong{font-size:17px;line-height:1.35;font-weight:550;white-space:normal}.schematic-page-status{flex:none;min-height:36px;padding:4px 2px;border:0;background:transparent;color:var(--muted);font-size:13px;white-space:nowrap;direction:ltr}.schematic-header-actions{display:flex;align-items:center;gap:6px;margin-inline-start:auto;flex:none}.schematic-header .icon-button{width:36px;min-width:36px;height:36px;min-height:36px;padding:7px;border:0;background:transparent;color:var(--muted)}.schematic-header [data-action=audio-toggle],.schematic-header .icon-button[aria-pressed=true]{color:var(--accent)}.schematic-header .icon-button:hover{background:var(--surface2);color:var(--ink)}
body.is-reading .reader-workspace[data-reading-mode=mushaf],body.is-reading .reader-workspace[data-reading-mode=mushaf].has-context{display:grid;grid-template-columns:minmax(0,1fr) var(--context-width);grid-template-rows:minmax(0,1fr);gap:14px;align-items:stretch;min-height:0;overflow:hidden;direction:ltr}
body.is-reading .reader-workspace[data-reading-mode=mushaf]:not(.tools-expanded)>.reader-rail{display:none}
body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded{grid-template-columns:260px minmax(0,1fr) var(--context-width)}
body.is-reading .reader-workspace[data-reading-mode=mushaf]>.reader-center{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-self:stretch;min-width:0;min-height:0;height:100%;max-width:none;margin:0;overflow:hidden}
body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded>.reader-center{grid-column:2}
body.is-reading .reader-workspace[data-reading-mode=mushaf]>.reader-rail{grid-column:1;grid-row:1;height:100%;max-height:100%;min-height:0;overflow:auto}
body.is-reading #reader-content.reader-paper.mode-mushaf{display:grid;flex:1;width:100%;height:100%;max-width:none;min-height:0;margin:0;padding:0;gap:12px;align-content:center;justify-content:center;border:0;background:transparent;box-shadow:none;direction:rtl;overflow:hidden}
body.is-reading .reader-workspace[data-reading-mode=mushaf]>#verse-context{grid-column:2;grid-row:1;position:relative;inset:auto;transform:none;align-self:start;width:100%;min-height:0;height:var(--book-height,100%);max-height:var(--book-height,100%);margin-block-start:var(--book-offset,0px);border-radius:12px;box-shadow:none;padding-bottom:0;background:#102b28}
body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded>#verse-context{grid-column:3}
body.is-reading #verse-context .context-head{order:0;padding:14px 18px;border:0}.context-head .eyebrow,.context-head .context-page-label{display:none}body.is-reading #verse-context .context-head h2{margin:0;font-size:14px;line-height:1.4;color:var(--accent);font-weight:500}body.is-reading #verse-context .context-scope{order:1;padding:0 16px 8px;gap:6px}body.is-reading #verse-context .context-scope button{font-size:11px;min-height:30px;padding:5px 8px;border-radius:8px}body.is-reading #verse-context .context-body{order:2;flex:1;min-height:0;padding:12px 20px 18px}body.is-reading #verse-context .context-tabs{order:3;padding:0 18px;border-top:1px solid var(--line);border-bottom:0;gap:18px}body.is-reading #verse-context .context-tabs button{min-height:36px;padding:7px 0;font-size:12px}body.is-reading #verse-context .context-footer{order:4;padding:6px 14px;border-top:0;background:transparent;max-height:36%;overflow:auto}body.is-reading #verse-context .context-footer button,body.is-reading #verse-context .context-more>summary{min-height:30px;padding:5px 8px;font-size:11px}
body.is-reading #verse-context .context-verse .arabic{font-size:26px;line-height:2.05;margin:0 0 18px}body.is-reading #verse-context .context-verse .translation{font-size:16px;line-height:1.9;margin:0 0 18px;padding-top:18px;border-top:1px solid #42605a77}body.is-reading #verse-context .context-body>.source{font-size:11px;color:var(--muted)}
.schematic-footer{display:grid;grid-template-columns:minmax(44px,110px) minmax(0,1fr) minmax(44px,110px);align-items:center;gap:12px;min-height:0;direction:ltr;border-top:1px solid #34504b66;padding-top:4px}.schematic-page-turn{display:flex;align-items:center;gap:6px;min-height:44px;padding:8px 4px;border:0;background:transparent;color:var(--muted);font-size:12px;white-space:normal}.schematic-page-turn svg{width:22px;height:22px;flex:none}.schematic-page-turn.next-page{justify-content:start;text-align:start}.schematic-page-turn.previous-page{justify-content:end;text-align:end}.schematic-page-turn:hover{color:var(--ink);background:var(--surface2)}
body.is-reading .schematic-footer #reader-audio-slot{position:relative;min-width:0;width:100%;height:52px;min-height:52px;margin:0}
body.is-reading .schematic-footer #reader-audio-slot #player{position:static;inset:auto;transform:none;visibility:visible;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-rows:52px;align-items:center;gap:16px;width:100%;max-width:none;min-width:0;height:52px;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;container-type:inline-size;direction:ltr}
body.is-reading .schematic-footer #player .player-left,body.is-reading .schematic-footer #player .player-center,body.is-reading .schematic-footer #player .player-right{display:flex;align-items:center;gap:12px;min-width:0;height:52px}
body.is-reading .schematic-footer #player .player-left{grid-column:1;grid-row:1;justify-content:start}body.is-reading .schematic-footer #player .player-center{grid-column:2;grid-row:1;justify-content:center}body.is-reading .schematic-footer #player .player-right{grid-column:3;grid-row:1;justify-content:end}
body.is-reading .schematic-footer #player .player-title{flex:1;min-width:0;max-width:320px;text-align:start}body.is-reading .schematic-footer #player .player-title strong{font-size:12px;line-height:15px;white-space:normal;overflow:visible}body.is-reading .schematic-footer #player .player-title small{display:block;font-size:11px;line-height:14px;white-space:normal;overflow:visible}
body.is-reading .schematic-footer #player .player-speed{display:block;flex:none}body.is-reading .schematic-footer #player .player-speed select{width:84px;min-width:84px;height:34px;min-height:34px;padding:5px 25px 5px 8px;background-position:right 7px center;font-size:13px}
body.is-reading .schematic-footer #player .player-controls{display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:4px;flex:none}body.is-reading .schematic-footer #player .player-controls button{width:32px;min-width:32px;min-height:34px;height:34px;padding:6px;border:0;background:transparent}body.is-reading .schematic-footer #player .player-controls [data-action=audio-toggle]{width:36px;min-width:36px;height:36px;min-height:36px;padding:8px;border-radius:50%;background:var(--accent);color:#102824}body.is-reading .schematic-footer #player .player-controls [data-action=audio-stop]{width:26px;min-width:26px;padding:5px}
body.is-reading .schematic-footer #player .player-progress{display:block;flex:none;width:110px;height:30px}body.is-reading .schematic-footer #player .player-times{display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;line-height:16px;color:var(--muted)}#audio-elapsed::after{content:' /';margin-inline-start:4px}body.is-reading .schematic-footer #player #player-seek{display:block;width:100%;height:14px;min-height:14px;margin:0}
body.is-reading .schematic-footer #player .volume-control{display:flex;align-items:center;gap:6px;min-width:0;width:auto;max-width:none}body.is-reading .schematic-footer #player .volume-control input{display:block;width:76px;min-width:40px;max-width:100px}body.is-reading .schematic-footer #player #volume-value{display:block;font-size:11px;min-width:30px}body.is-reading .schematic-footer #player .volume-control .icon-button,body.is-reading .schematic-footer #player .player-more{display:flex;align-items:center;justify-content:center;flex:none;width:32px;min-width:32px;height:34px;min-height:34px;padding:6px;border:0;background:transparent}
/* Strong contrast in both canonical Arabic surfaces, without changing glyph metrics. */
body.is-reading #reader-content .qword.word-playing,body.is-reading #verse-context .qword.word-playing{background:#ffe066;color:#19251f;box-shadow:0 0 0 2px #ffe066;border-radius:3px;text-shadow:none}
@media(max-width:1200px){body.is-reading #main{padding-inline:14px;gap:8px}:root{--context-width:clamp(320px,32vw,420px)}body.is-reading .schematic-footer #player .player-title{display:none}body.is-reading .schematic-footer #player{gap:10px}.schematic-footer{grid-template-columns:76px minmax(0,1fr) 76px;gap:8px}.schematic-page-turn{font-size:11px}.schematic-header-actions{gap:2px}}
@media(min-width:700px) and (max-width:1000px){body.is-reading .reader-workspace[data-reading-mode=mushaf],body.is-reading .reader-workspace[data-reading-mode=mushaf].has-context{grid-template-columns:minmax(0,1fr) min(330px,40vw)}body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded{grid-template-columns:190px minmax(0,1fr) min(300px,36vw)}body.is-reading #verse-context .context-body{padding:10px 14px}body.is-reading #verse-context .context-verse .arabic{font-size:24px}body.is-reading #verse-context .context-verse .translation{font-size:14px}body.is-reading .schematic-footer #player .volume-control input,body.is-reading .schematic-footer #player #volume-value{display:none}}
@media(max-width:699px){body.is-reading #main{grid-template-rows:44px minmax(0,1fr) 76px;gap:6px;padding:6px 10px max(6px,env(safe-area-inset-bottom))}.schematic-header{gap:6px}.schematic-book{width:22px;min-width:22px}.schematic-location strong{font-size:12px;line-height:1.25}.schematic-page-status{font-size:10px;min-height:30px}.schematic-header-actions{gap:0}.schematic-header .icon-button{width:28px;min-width:28px;height:32px;min-height:32px;padding:5px}.schematic-header-actions [data-action=audio-toggle]{display:none}body.is-reading .reader-workspace[data-reading-mode=mushaf],body.is-reading .reader-workspace[data-reading-mode=mushaf].has-context{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(100px,1.1fr) minmax(190px,1fr);gap:6px}body.is-reading .reader-workspace[data-reading-mode=mushaf]>.reader-center{grid-column:1;grid-row:1}body.is-reading .reader-workspace[data-reading-mode=mushaf]>#verse-context{grid-column:1;grid-row:2;height:100%;max-height:100%;margin:0}body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded{grid-template-columns:min(190px,52vw) minmax(0,1fr)}body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded>.reader-center{grid-column:2;grid-row:1}body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded>#verse-context{grid-column:2;grid-row:2}body.is-reading .reader-workspace[data-reading-mode=mushaf].tools-expanded>.reader-rail{grid-column:1;grid-row:1/-1}body.is-reading #reader-content.reader-paper.mode-mushaf{gap:8px}body.is-reading #verse-context .context-head{padding:7px 12px}body.is-reading #verse-context .context-head h2{font-size:12px}body.is-reading #verse-context .context-scope{padding:0 10px 4px;gap:4px}body.is-reading #verse-context .context-scope button{min-height:26px;padding:3px 5px;font-size:10px}body.is-reading #verse-context .context-body{padding:6px 12px}body.is-reading #verse-context .context-verse .arabic{font-size:23px;line-height:1.8;margin-bottom:10px}body.is-reading #verse-context .context-verse .translation{font-size:14px;line-height:1.7;padding-top:10px}body.is-reading #verse-context .context-tabs{padding:0 12px;gap:16px}body.is-reading #verse-context .context-tabs button{min-height:28px;font-size:11px;padding:4px 0}body.is-reading #verse-context .context-footer{padding:3px 8px}body.is-reading #verse-context .context-footer .row-actions{gap:4px}body.is-reading #verse-context .context-footer button,body.is-reading #verse-context .context-more>summary{font-size:10px;min-height:26px;padding:3px 5px}.schematic-footer{grid-template-columns:28px minmax(0,1fr) 28px;gap:4px;padding-top:2px}.schematic-page-turn{padding:8px 0;justify-content:center!important}.schematic-page-turn span{display:none}body.is-reading .schematic-footer #reader-audio-slot{height:72px;min-height:72px}body.is-reading .schematic-footer #reader-audio-slot #player{height:72px;grid-template-columns:72px minmax(0,1fr) 62px;grid-template-rows:36px 30px;gap:2px 4px}body.is-reading .schematic-footer #player .player-left{grid-column:1;grid-row:2;height:30px}body.is-reading .schematic-footer #player .player-center{grid-column:1/-1;grid-row:1;gap:8px;height:36px}body.is-reading .schematic-footer #player .player-right{grid-column:3;grid-row:2;gap:0;height:30px}body.is-reading .schematic-footer #player .player-title{display:none}body.is-reading .schematic-footer #player .player-progress{width:82px}body.is-reading .schematic-footer #player .player-times{font-size:10px}body.is-reading .schematic-footer #player .player-speed select{width:72px;min-width:72px;min-height:28px;height:28px;font-size:12px}body.is-reading .schematic-footer #player .volume-control input,body.is-reading .schematic-footer #player #volume-value{display:none}body.is-reading .schematic-footer #player .player-controls{gap:2px}body.is-reading .schematic-footer #player .player-controls button{width:28px;min-width:28px;height:32px;min-height:32px;padding:5px}body.is-reading .schematic-footer #player .player-controls [data-action=audio-toggle]{width:32px;min-width:32px;height:32px;min-height:32px;padding:6px}body.is-reading .schematic-footer #player .player-controls [data-action=audio-stop]{width:24px;min-width:24px;padding:4px}}
@media(max-height:480px) and (min-width:700px){body.is-reading #main{grid-template-rows:36px minmax(0,1fr) 48px;gap:5px;padding-block:5px}.schematic-header .icon-button{min-height:32px;height:32px}body.is-reading .schematic-footer #reader-audio-slot,body.is-reading .schematic-footer #reader-audio-slot #player{height:44px;min-height:44px}body.is-reading .schematic-footer #player .player-left,body.is-reading .schematic-footer #player .player-center,body.is-reading .schematic-footer #player .player-right{height:44px}body.is-reading #verse-context .context-head{padding-block:7px}body.is-reading #verse-context .context-verse .arabic{font-size:22px;line-height:1.8}}
body.is-reading #verse-context .context-tabs{padding-inline-end:104px;min-height:40px}
body.is-reading #verse-context .context-footer{position:absolute;right:10px;bottom:3px;max-width:92px;max-height:none;padding:0;overflow:visible;background:transparent}
body.is-reading #verse-context .context-footer:empty{display:none}
body.is-reading #verse-context .context-footer>.row-actions{display:flex;align-items:center;gap:2px;flex-wrap:nowrap}
body.is-reading #verse-context .context-footer .icon-button,body.is-reading #verse-context .context-more>summary{display:flex;align-items:center;justify-content:center;width:32px;min-width:32px;height:32px;min-height:32px;padding:6px;border:0;border-radius:7px;background:transparent;list-style:none}
body.is-reading #verse-context .context-more{position:relative;flex:none}
body.is-reading #verse-context .context-more>summary::-webkit-details-marker{display:none}
body.is-reading #verse-context .context-more[open]>.row-actions{position:absolute;right:0;bottom:40px;z-index:8;display:grid;width:220px;max-height:260px;overflow:auto;gap:6px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--bg);box-shadow:0 10px 32px #0007}
/* The original fit renderer owns leaf widths and grid tracks. Do not stretch paper panels. */


