/* One continuous header; measured height also positions verse and note targets. */
body:has(.eph-study-controls){max-width:70rem;padding-top:0;box-sizing:border-box}
.eph-reader-header.reader-top{position:sticky;top:0;z-index:30;isolation:isolate;box-sizing:border-box;width:100%;padding:8px 0 10px;margin:0 0 24px;background:var(--reader-bg,#faf8f3);border-bottom:1px solid var(--reader-line,#ddd)}
.eph-reader-header nav:first-child{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:center;margin:0 0 8px;font:14px/1.4 system-ui}
.eph-reader-header nav:first-child>a{text-decoration:none;min-height:36px;display:inline-flex;align-items:center}
.eph-reader-header nav:first-child>a:hover{text-decoration:underline}
.eph-reader-options{position:relative;margin-left:auto;font:14px/1.4 system-ui}
.eph-reader-options>summary{cursor:pointer;list-style:none;padding:9px 10px;min-height:36px;box-sizing:border-box}
.eph-reader-options>summary::-webkit-details-marker{display:none}
.eph-reader-options>summary::after{content:' ▾'}
.eph-reader-options .tools{position:absolute;z-index:40;top:100%;right:0;box-sizing:border-box;width:min(300px,calc(100vw - 32px));max-height:70dvh;overflow:auto;padding:16px;margin:0;display:flex;flex-direction:column;align-items:stretch;gap:14px;background:var(--reader-surface,#fffefa);border:1px solid var(--reader-line,#ccc);border-radius:12px;box-shadow:0 8px 24px #0002}
.eph-reader-options .tools label{font:14px/1.5 system-ui}.eph-reader-options .tools select{width:100%;font-size:16px;min-height:40px;box-sizing:border-box}.eph-reader-options .tools nav{display:flex;flex-wrap:wrap;gap:8px;margin:0}.eph-reader-options .tools button{font:14px system-ui;min-height:40px}.eph-reader-options .reader-theme-control{margin:0;display:flex;gap:8px;align-items:center}.eph-reader-options .tools a{font-size:14px}
.eph-study-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;position:static;padding:0;margin:0;border:0;min-width:0;font:14px/1.4 system-ui;background:var(--reader-bg,#faf8f3)}
.eph-study-controls button,.eph-study-controls select{box-sizing:border-box;min-height:40px;margin:0;padding:8px 10px;font:14px/1.4 system-ui;border-radius:7px;max-width:100%}
.eph-study-controls select#chapter{width:145px;min-width:0}.eph-study-controls>select{width:85px}.eph-chapter-label{display:block;margin:0;min-width:0}



.eph-study-controls>#top-position{margin-left:auto;white-space:nowrap;font-size:13px;text-decoration:none}
.eph-study-controls>span{font:14px system-ui;flex-basis:100%}.eph-study-controls>span:empty{display:none}
.reader-top>button{font:13px system-ui;margin:6px 0 0;min-height:32px}
.eph-verse,.eph-verse:target,.eph-commentary-panel,.eph-commentary-panel:target,a.noteref:target,main>section>h1{scroll-margin-top:calc(var(--eph-header-height,120px) + 18px)}
.eph-verse{position:relative;min-width:0}.eph-verse.eph-selected{border-left:3px solid var(--reader-accent,#285342);padding-left:14px}
.eph-note-button{display:block;font:13px system-ui;margin-top:8px;padding:4px 9px;min-height:32px}
.eph-commentary-panel{box-sizing:border-box;padding:20px;border:1px solid var(--reader-line,#c6cbbf);border-radius:14px;background:var(--reader-surface,#f2efe4);margin:18px 0;min-width:0}
.eph-commentary-panel[hidden]{display:none}.eph-commentary-panel>h2{font:bold 20px/1.4 Georgia;margin:0 0 12px}.eph-commentary-panel>button{font:13px system-ui;margin:0 8px 12px 0;min-height:36px}.eph-commentary-panel details{border-top:1px solid var(--reader-line,#ccc);padding:14px 0}.eph-commentary-panel summary{font:600 15px/1.5 system-ui;cursor:pointer}.eph-commentary-panel aside{font-size:1em;border:0;margin:0;padding:10px 0}.eph-commentary-panel aside h3{display:none}
@media(min-width:900px){main>section.eph-has-commentary:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:32px;align-items:start}main>section.eph-has-commentary>h1,main>section.eph-has-commentary>.eph-verse{grid-column:1}main>section.eph-has-commentary>.eph-commentary-panel{grid-column:2;grid-row:1/999;position:sticky;top:calc(var(--eph-header-height,120px) + 16px);max-height:calc(100dvh - var(--eph-header-height,120px) - 40px);overflow-y:auto;overscroll-behavior:contain}}
@media(max-width:600px){.eph-reader-header.reader-top{padding-top:max(6px,env(safe-area-inset-top));margin-bottom:20px}.eph-reader-header nav:first-child{gap:6px 12px;font-size:13px}.eph-reader-options{font-size:13px}.eph-study-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.eph-study-controls select#chapter{width:100%;max-width:220px}.eph-study-controls>#top-position{justify-self:end;margin:0}.eph-study-controls>span{grid-column:1/-1}.eph-commentary-panel{padding:15px}}
@media print{.eph-reader-header{display:none}}

