/* One iPhone presentation language. The reading surface keeps its landmarks;
   temporary tools rise above it without moving the header or audio source. */
.sheet-grip{display:none}
dialog[data-navigation-popup]{position:fixed;inset:calc(var(--reading-header-height,100px) + 10px) 0 10px;margin:auto;max-height:calc(100dvh - var(--reading-header-height,100px) - 24px)}
dialog[data-navigation-popup]::backdrop{background:color-mix(in srgb,var(--ink) 22%,transparent);backdrop-filter:none;-webkit-backdrop-filter:none}
body:has(dialog[data-navigation-popup][open]) #reading{opacity:1}
.app-header[data-popup-header]{position:fixed;inset:0 0 auto;margin:0;overflow:visible;color:var(--ink);border:0;border-bottom:1px solid color-mix(in srgb,var(--line) 65%,transparent)}
@media(max-width:750px){
 dialog[data-phone-sheet]{position:fixed;inset:auto 8px max(10px,calc(100dvh - var(--phone-viewport-height,100dvh) - var(--phone-viewport-top,0px) + 10px));margin:0;width:calc(100% - 16px);max-width:none;max-height:calc(var(--phone-viewport-height,100dvh) - var(--reading-header-height,100px) - 20px);border:1px solid var(--line);border-radius:28px;padding:31px 20px 20px;background:var(--surface);box-shadow:0 -12px 70px color-mix(in srgb,var(--ink) 12%,transparent);overscroll-behavior:contain;scroll-padding-top:88px}
 dialog[data-phone-sheet] .sheet-grip{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;right:0;height:28px;color:var(--control-muted,var(--muted));touch-action:none;user-select:none;-webkit-user-select:none}
 .sheet-grip svg{width:40px;height:20px;opacity:.65;pointer-events:none}
 dialog[data-phone-sheet] .dialog-top{min-height:48px;margin:0 0 16px;align-items:center;touch-action:pan-x}
 dialog[data-phone-sheet] h2{font:500 24px/1.25 -apple-system,sans-serif;letter-spacing:-.6px}
 dialog[data-phone-sheet] .dialog-top>[data-close]{background:var(--selection);color:var(--control-muted,var(--muted));width:44px;height:44px;padding:13px}
 dialog[data-phone-sheet].library-panel{height:min(720px,calc(var(--phone-viewport-height,100dvh)*.90 - 10px))}
 dialog[data-phone-sheet] .library-panel-controls{padding-bottom:8px}
 dialog[data-phone-sheet] .library-panel-results{scroll-padding-block:12px;-webkit-overflow-scrolling:touch;padding-bottom:76px}
 dialog[data-phone-sheet] input[type=search]{border-radius:14px;font-size:17px;min-height:48px;padding:11px 14px;background:var(--paper)}
 dialog[data-phone-sheet] .book-row{min-height:57px;padding:4px 2px;border-color:color-mix(in srgb,var(--line) 65%,transparent)}
 dialog[data-phone-sheet] .book-row a{font-size:21px}
 dialog[data-phone-sheet] .chapter-grid{gap:8px}
 dialog[data-phone-sheet] .chapter-grid a{min-height:51px;border-radius:14px;font-size:20px}
 #options-dialog[data-phone-sheet]{height:calc(var(--phone-viewport-height,100dvh)*.90 - 10px);overflow:hidden;display:none;flex-direction:column}
 #options-dialog[data-phone-sheet][open]{display:flex}
 #options-dialog[data-phone-sheet]>.dialog-top{flex:none}
 #options-dialog[data-phone-sheet]>.settings-form{min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding:12px;padding:0 3px 12px;margin:0 -3px;-webkit-overflow-scrolling:touch}
 #options-dialog[data-phone-sheet] .settings-section-heading{min-height:80px}
 #options-dialog[data-phone-sheet] .settings-section-heading h3{font-size:17px}
 #options-dialog[data-phone-sheet] .settings-summary{font-size:12px}
 .connections.exegesis{border-radius:25px;background:var(--paper);box-shadow:0 8px 32px color-mix(in srgb,var(--ink) 9%,transparent)}
 .connections.exegesis .exegesis-toolbar{padding-top:12px}
 .connections.exegesis .study-view-menu{gap:4px;border:1px solid var(--line);border-radius:17px;background:var(--surface);padding:4px;margin:5px 0 9px}
 .connections.exegesis .study-view-choice{flex:1;min-width:0}
 .connections.exegesis .study-view-choice button{width:100%;height:46px;border-radius:12px}
 .connections.exegesis .study-view-choice button[aria-pressed=true]{box-shadow:none;background:var(--selection)}
 .connections.exegesis .study-view-heading{margin-bottom:8px}
 .player:not(.player-collapsed){border-color:color-mix(in srgb,var(--line) 65%,transparent);border-radius:23px;box-shadow:0 5px 22px color-mix(in srgb,var(--ink) 7%,transparent)}
 .player .transport{gap:0}
 .player:not(.player-collapsed){padding-left:2px;padding-right:2px}
 .player .transport>.play-button{width:52px;height:52px;margin:0}
 .player-disclosure-row #location{font-size:11px}
 button:not(:disabled):active{filter:brightness(.94)}
}
@media(prefers-reduced-motion:reduce){[data-phone-sheet],.connections.exegesis,.player{transition:none!important}}
@media(max-width:750px){
 #persistent-help[popover],#active-verse[popover]{bottom:calc(var(--audio-action-bottom) + max(0px,100dvh - var(--phone-viewport-height,100dvh) - var(--phone-viewport-top,0px)))}
}

#compact-location{display:none}
@media(max-width:750px){.listening-location #location{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.listening-location #compact-location{display:block;max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}}
/* Keep the established compact study layout when a phone rotates. */
@media(max-width:750px) and (max-height:500px){
 .connections.exegesis .exegesis-toolbar{padding:4px 0}
 .connections.exegesis .study-view-menu{margin:0;padding:0;gap:4px}
 .connections.exegesis .study-view-choice button{height:44px}
 .connections.exegesis .study-view-heading{margin-bottom:0}
}
/* Help owns the space below its caption even while a phone sheet is open. */
@media(max-width:750px){
 dialog[data-phone-sheet].help-caption-stacked,#options-dialog[data-phone-sheet].help-caption-stacked{top:var(--help-panel-top);bottom:auto;height:var(--help-panel-height);max-height:var(--help-panel-height)}
}

/* A single visual rhythm for browsing, reading and study. Color stays owned by
   the selected theme; no image, font, blur layer or new runtime dependency. */
dialog[data-navigation-popup]{box-shadow:0 18px 64px color-mix(in srgb,var(--ink) 14%,transparent)}
dialog[data-navigation-popup] .dialog-top{padding-bottom:12px;border-bottom:1px solid var(--line)}
.book-row:has(a[aria-current="page"]){background:var(--selection);border-radius:12px;box-shadow:inset 3px 0 var(--accent)}
.book-row a[aria-current="page"]{color:var(--accent);font-weight:600;padding-inline-start:12px}
.chapter-grid a[aria-current="page"]{background:var(--accent);color:var(--on-accent);border-color:var(--accent);box-shadow:0 2px 8px color-mix(in srgb,var(--ink) 10%,transparent)}
.chapter-grid a[aria-current="page"]:hover{background:var(--accent);color:var(--on-accent)}
.connections.exegesis #study-surface{gap:12px}
.connections.exegesis #study-surface>.passage-originals{margin-top:0}
.connections.exegesis #study-surface>#study-comparison{margin-top:0}
.connections.exegesis .study-view-menu{border-color:color-mix(in srgb,var(--line) 70%,transparent)}
.connections.exegesis .study-view-choice button[aria-pressed="true"]{box-shadow:inset 0 -2px var(--accent)}
.connections.exegesis .pane-eyebrow{letter-spacing:.14em;color:var(--control-muted,var(--muted))}
.library-panel-results{scrollbar-width:thin;scrollbar-color:var(--line) transparent}
@media(hover:hover){
 .book-row:hover{background:var(--selection);border-radius:12px}
 .chapter-grid a:not([aria-current="page"]):hover{border-color:var(--accent)}
}
@media(max-width:750px){
 /* Chapter headings breathe; action rows remain secondary and fully tappable. */
 .section-row{margin-block:22px 12px}
 .section-row>.section-heading{font-weight:500;letter-spacing:.015em;border-radius:12px}
 .section-row .section-heading>button{color:var(--control-muted,var(--muted))}
 .section-row .section-heading>button[aria-pressed="true"]{color:var(--accent)}
 .section-row .section-heading>a{line-height:1.5}
 .connections.exegesis{border-color:color-mix(in srgb,var(--line) 75%,transparent)}
 .connections.exegesis .study-view-menu{padding:3px;border-radius:16px}
 .connections.exegesis .study-view-choice button{border-radius:11px}
 .connections.exegesis .study-view-heading{margin-block:2px 8px}
 .connections.exegesis #study-surface>.passage-card{border-radius:18px}
 dialog[data-phone-sheet] .book-row{padding-inline:8px}
}
@media(prefers-reduced-motion:no-preference){
 .app-header button,.study-view-choice button,.chapter-grid a,.book-row{transition:box-shadow .14s ease-out}
}
