#devotionFocus[open]{grid-template-rows:auto auto minmax(0,1fr)}
#devotionFocus>.focusWorkspace{grid-row:3;width:100%}
#devotionFocus{--reader-width:48rem}
#devotionFocus>.focusTop,#devotionFocus>.focusChoice{width:min(100%,var(--reader-width));margin-inline:auto;min-width:0;box-sizing:border-box}
.previewBrand{font:26px var(--serif);letter-spacing:-1px}
#devotionFocus>.focusTop{border-bottom:0;gap:12px;padding-inline:clamp(12px,3vw,24px)}
#devotionFocus>.focusChoice{border-bottom:1px solid var(--line);padding:0 clamp(12px,3vw,24px)}
#passageTabs{gap:16px;padding:0}
#passageTabs button{position:relative;background:transparent;color:var(--muted);border:0;border-radius:0;padding:12px 2px 10px;min-height:44px}
#passageTabs button[aria-selected=true]{background:transparent;color:var(--ink);box-shadow:inset 0 -3px var(--gold)}
#passageTabs small{display:none}
#focusScroll{padding:0;overflow-y:auto}
#focusScroll .focusArt{height:auto;width:min(100%,var(--reader-width));margin-inline:auto;background:transparent}
#focusScroll .focusArt img{display:block;width:auto;height:auto;max-width:100%;max-height:52dvh;margin-inline:auto;object-fit:contain}
#focusWords{padding:clamp(20px,4vw,42px) 23px 50px;max-width:65ch}
#focusWords h2{font-size:clamp(30px,5vw,42px);letter-spacing:-.035em}
#focusWords p{font-size:calc(clamp(20px,2.4vw,24px) * var(--reader-scale,1));line-height:1.65}
#focusControls,#focusStatus{width:min(100%,820px);margin-inline:auto}
#focusControls{border-top:1px solid var(--line)}
@media(max-width:380px){#focusControls .listenControl{min-width:84px}#devotionFocus .focusTools{gap:5px}}
@media(max-width:480px){.previewBrand{font-size:22px}#devotionFocus>.focusTop{gap:5px}.focusDays button{width:32px}.focusDays input{max-width:126px;font-size:13px}#leaveFocus{padding-inline:4px}#passageTabs{gap:9px}#passageTabs strong{font-size:13px}#toggleArt{font-size:12px}}


/* Reader preferences stay inside the sheet; content keeps its own scrolling area. */
#devotionFocus[open]#devotionFocus{grid-template-rows:auto auto minmax(0,1fr)}
#devotionFocus#devotionFocus>.focusWorkspace{grid-row:3;min-height:0}
#devotionFocus#devotionFocus .focusTools{gap:4px}
#devotionFocus#devotionFocus .focusTools button{width:44px;height:44px;min-width:44px;min-height:44px}
#devotionFocus #focusWords p,#devotionFocus[data-art=compact] #focusWords p.prayerText{font-size:calc(1.35rem * var(--reader-scale,1));line-height:var(--reader-spacing,1.65)}
#devotionFocus .focusTitle{white-space:nowrap;font-size:.875rem}
#devotionFocus[data-mode=reading] #focusScroll .focusArt img{object-fit:contain}
.dialogHead button{width:44px;height:44px;min-width:44px;min-height:44px}
select:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.loadNotice,.resumePrayer{margin:16px 0;padding:16px 20px;border:1px solid var(--line-strong);border-radius:14px;background:var(--panel);color:var(--ink)}
.loadNotice p{margin-bottom:12px}.resumePrayer{display:block;width:100%;min-height:56px;text-align:left;font-weight:600}


.offlinePanel{margin-block:32px;padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--panel)}
.offlinePanel h2{font:28px var(--serif);margin:0 0 8px}.offlinePanel p{max-width:56ch}
#downloadsDialog{width:min(600px,calc(100% - 24px));max-height:85dvh;overflow:auto;padding:24px;background:var(--paper);color:var(--ink)}
#downloadsDialog button,#downloadsDialog a{min-height:44px;display:inline-flex;align-items:center;padding:8px 12px}
#downloadForm{display:grid;gap:16px}#downloadForm label{display:flex;align-items:center;gap:12px}#downloadForm input[type=date]{font:inherit;min-height:44px;max-width:100%}
#downloadForm input[type=checkbox]{width:24px;height:24px}#downloadList{list-style:none;padding:0}#downloadList li{display:flex;flex-wrap:wrap;align-items:center;gap:8px;border-top:1px solid var(--line);padding:12px 0}#downloadList span{flex:1 1 180px}
.routeNotice{position:fixed;z-index:100;bottom:100px;left:16px;right:16px;padding:16px;background:var(--raised);border:1px solid var(--line);border-radius:12px}.routeNotice button{min-height:44px;text-decoration:underline}
#relatedPage{padding-bottom:100px}#relatedPage main:not(.daily){padding-top:24px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.focusDays button{min-width:44px}
#downloadsDialog :is(button,a,input):focus-visible,.routeNotice button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}

/* One shared settings dock beneath the toolbar, with mutually exclusive sections. */
#readerSettingsDock{grid-row:2;width:min(100%,var(--reader-width));margin:0 auto;padding:0 var(--reader-pad) 12px;max-height:48dvh;overflow:auto;overscroll-behavior:contain}
.settingsCard{padding:18px 20px 8px;border:1px solid var(--line);border-radius:18px;background:var(--raised);box-shadow:0 6px 20px #00000006}
.settingsHeading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.settingsKicker{display:block;font-size:.75rem;color:var(--muted);margin-bottom:3px}
.settingsHeading h2{font:1.4rem/1.2 var(--serif);letter-spacing:-.025em;margin:0}
#closeReaderSettings{min-height:44px;padding:8px 14px;border-radius:24px;background:var(--chip);font-size:.875rem;font-weight:600}
#readerPreferences,#prayerAudioOptions{margin:0;padding:0;width:100%;background:none;border:0;max-height:none;overflow:visible}
.settingChoices{border:0;padding:0;margin:16px 0;min-width:0}
.settingChoices legend{font-size:.875rem;font-weight:600;margin-bottom:8px;padding:0}
.segmentedChoices{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.segmentedChoices button{flex:1;min-width:0;min-height:44px;padding:6px 4px;border:1px solid transparent;border-radius:9px;color:var(--ink-soft);font-size:.875rem;line-height:1.3}
.segmentedChoices button[aria-pressed=true]{background:var(--raised);border-color:var(--line-strong);color:var(--ink);box-shadow:0 2px 4px #0000000a;font-weight:700}
.settingsFoot{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:4px 0}
#preferenceStatus,.settingsNote{font-size:.8125rem;color:var(--muted);margin:8px 0;line-height:1.5}
#resetReader{min-height:44px;padding:8px;font-size:.875rem;text-decoration:underline;text-underline-offset:3px}
.audioOption{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:72px;cursor:pointer;border-bottom:1px solid var(--line);padding:12px 0}
.audioOption strong,.audioOption small{display:block}.audioOption strong{font-size:.9375rem;font-weight:600}.audioOption small{font-size:.8125rem;color:var(--muted);margin-top:3px;line-height:1.5}
.audioOption input[role=switch]{appearance:none;position:relative;flex:none;width:44px;height:26px;border-radius:20px;border:1px solid var(--line-strong);background:var(--line-strong);cursor:pointer;margin:0}
.audioOption input[role=switch]::after{content:'';position:absolute;width:18px;height:18px;border-radius:50%;top:3px;left:3px;background:var(--paper);box-shadow:0 1px 3px #00000024;transition:transform .15s}
.audioOption input[role=switch]:checked{background:var(--accent);border-color:var(--accent)}
.audioOption input[role=switch]:checked::after{transform:translateX(18px);background:var(--on-accent)}
.volumeSetting{padding:14px 0;border-bottom:1px solid var(--line)}
.musicLevel{display:flex;justify-content:space-between;gap:16px;font-size:.875rem;font-weight:600}
#musicLevel{color:var(--muted);font-weight:400;font-variant-numeric:tabular-nums}
#musicVolume{display:block;width:100%;height:32px;margin:4px 0 0;accent-color:var(--accent);cursor:pointer}
.volumeSetting:has(input:disabled){opacity:.5}
#devotionFocus#devotionFocus .focusTools .settingsTrigger{display:flex;gap:5px;justify-content:center;width:56px;min-width:56px;border-radius:14px}
#devotionFocus#devotionFocus .focusTools .settingsTrigger[aria-expanded=true]{background:var(--accent);border-color:var(--accent);color:var(--on-accent);box-shadow:0 0 0 2px var(--paper),0 0 0 3px var(--accent)}
.typeGlyph{font:600 1rem var(--serif)}.settingsTrigger svg{width:18px;height:18px}
.settingsChevron{width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .15s}
[aria-expanded=true]>.settingsChevron{transform:rotate(225deg) translate(-1px,-1px)}
#readerSettingsDock :is(button,input):focus-visible{outline:3px solid var(--focus);outline-offset:3px}
@media(max-width:480px){.settingsCard{padding:14px 14px 4px}.settingsHeading h2{font-size:1.25rem}#readerSettingsDock{padding-inline:12px}.audioOption{gap:12px}.segmentedChoices button{font-size:.8125rem}.settingsKicker{display:none}}
@media(forced-colors:active){.audioOption input[role=switch]{appearance:auto}.audioOption input[role=switch]::after{display:none}.segmentedChoices button[aria-pressed=true],.settingsTrigger[aria-expanded=true]{outline:2px solid Highlight}}

/* Keep the full context beside just two toolbar actions at every screen size. */
#devotionFocus#devotionFocus>.focusTop{flex-wrap:nowrap;gap:12px}
#devotionFocus .focusTitle{flex:1 1 auto;min-width:0;white-space:normal;overflow:visible;text-overflow:clip}
.readerTitleName,.readerTitleContext{display:block;overflow-wrap:anywhere}
.readerTitleName{font-weight:600;line-height:1.35}
.readerTitleContext{font-size:.8125rem;line-height:1.4;font-weight:400;color:var(--muted);margin-top:2px}
#devotionFocus#devotionFocus .focusTools{flex:0 0 auto;gap:6px;margin:0}
#devotionFocus#devotionFocus .focusTools .settingsTrigger{width:44px;min-width:44px;border-radius:50%}
.settingsTrigger svg{width:20px;height:20px}
.playbackSetting{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);font-size:.9375rem;font-weight:600}
.playbackSetting select{font:inherit;font-size:.875rem;min-height:44px;border:1px solid var(--line-strong);border-radius:10px;padding:8px 12px;background:var(--panel);color:var(--ink)}
.settingsSectionTitle{font:1.15rem var(--serif);margin:18px 0 0}
@media(max-width:600px){#devotionFocus#devotionFocus>.focusTop{padding-inline:16px;padding-bottom:8px;gap:10px}}

/* The panel chrome stays visible while only the options scroll. */
#readerSettingsDock{overflow:hidden}
#readerSettingsDock .settingsCard{display:flex;flex-direction:column;max-height:calc(48dvh - 12px);padding-bottom:0;overflow:hidden}
#readerSettingsDock .settingsHeading{flex:none}
#settingsScroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-inline:3px;margin-inline:-3px}
#settingsScrollFooter{position:relative;flex:none;border-top:1px solid var(--line);background:var(--raised)}
#readerSettingsDock[data-more=true] #settingsScrollFooter::before{content:'';position:absolute;bottom:100%;left:0;right:0;height:20px;background:linear-gradient(transparent,var(--raised));pointer-events:none}
#moreReaderSettings{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;width:100%;font-size:.875rem;font-weight:600;color:var(--ink-2)}
#moreReaderSettings svg{width:16px;height:16px;flex:none}
#moreReaderSettings[data-at-end=true] svg{transform:rotate(180deg)}
#settingsScroll:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}

/* Quiet, persistent orientation above multi-step prayer controls. */
#devotionFocus #prayerPageProgress{width:min(100%,var(--reader-width));margin-inline:auto;padding:10px var(--reader-pad) 0}
.prayerPageSegments{display:flex;gap:2px;height:4px;align-items:center}
.prayerPageSegments span{flex:1;min-width:0;height:2px;border-radius:2px;background:var(--line-strong)}
.prayerPageSegments .passed{background:var(--olive);opacity:.6}
.prayerPageSegments .current{height:4px;background:var(--accent)}
.prayerPageCaption{display:flex;justify-content:space-between;gap:10px;margin-top:6px;font-size:11px;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums}
@media(forced-colors:active){.prayerPageSegments span{background:GrayText}.prayerPageSegments .current{background:Highlight}}

/* A closing is a resting place, not another step in the prayer. */
#devotionFocus.prayerClosing #focusArt{display:none}
#devotionFocus.prayerClosing #focusScroll{display:flex;flex-direction:column}
#devotionFocus.prayerClosing #focusWords{width:100%;max-width:38rem;margin:auto;padding:20px 28px 32px}
.closingScene{text-align:center}
.closingCandle{display:block;width:min(100%,320px);height:auto;max-height:34dvh;margin:0 auto 12px;object-fit:contain}
.closingWords{animation:closing-words 2s .7s ease-out both}
#devotionFocus.prayerClosing #closingHeading{font-size:calc(clamp(30px,4vw,40px) * var(--reader-scale,1));line-height:1.2;text-wrap:balance;margin:0 0 18px;letter-spacing:-.025em}
#devotionFocus.prayerClosing #focusWords p{font-size:calc(1.15rem * var(--reader-scale,1));line-height:var(--reader-spacing,1.65);color:var(--ink-soft);max-width:30ch;margin:0 auto;text-wrap:pretty}
#closingHeading:focus{outline:none}
#devotionFocus.prayerClosing #focusControls{flex-direction:column;gap:4px;border:0;background:transparent;padding:12px 24px 0}
#devotionFocus.prayerClosing #focusControls button{min-width:180px;min-height:48px}
#devotionFocus.prayerClosing #closingPractice{background:transparent;color:var(--ink-soft);font-size:.875rem;text-decoration:underline;text-underline-offset:4px}
#closingPracticeNote{font-size:.8125rem;line-height:1.5;color:var(--muted);text-align:center;max-width:32ch;margin:0 0 8px;text-wrap:balance}
#devotionFocus.prayerClosing #focusStatus{padding-bottom:max(16px,env(safe-area-inset-bottom));color:var(--muted)}
.closingUtilityActions{display:flex;justify-content:center;flex-wrap:wrap;gap:4px 12px}
#devotionFocus.prayerClosing #focusStatus button{min-height:44px;padding:8px;font-size:.75rem;text-decoration:underline;text-underline-offset:3px}
#devotionFocus[data-hide-art=true] .closingCandle{display:none}
@keyframes closing-words{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-height:600px){.closingCandle{max-height:27dvh}#devotionFocus.prayerClosing #focusWords{padding-block:12px}#devotionFocus.prayerClosing #focusControls{padding-top:4px}}
@media(prefers-reduced-motion:reduce){.closingWords{animation:none}}
@media(forced-colors:active){.closingCandle{display:none}}
