/* Consolidated V4 R3: single manuscript-first shell. All selectors opt-in. */
body.ixv4-r3{--v4-ink:#163e33;--v4-cream:#f8f3ea;--v4-paper:#fffefa;--v4-rule:#e4d9c8;overflow-x:hidden!important;background:var(--v4-cream)!important}
body.ixv4-r3 #app{background:var(--v4-cream)!important;overflow:visible!important}
body.ixv4-r3 .ixrs-grid{display:block!important;position:relative!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important}
body.ixv4-r3 .ixrs-navigation{display:none!important}
body.ixv4-r3 .ixrs-main{display:block!important;width:100%!important;max-width:none!important;margin:0 auto!important;padding:0 22px 35px!important;min-width:0!important;background:var(--v4-cream)!important}
body.ixv4-r3 .ixrs-main .reader-shell{width:100%!important;max-width:1120px!important;margin:0 auto!important;padding:0!important}
body.ixv4-r3 #ixv4-toolbar{display:flex!important;position:sticky!important;top:var(--ixv4-header-height,60px)!important;z-index:85!important;max-width:none!important;min-height:50px!important;margin:0!important;padding:6px clamp(14px,3vw,38px)!important;gap:10px!important;border:0!important;border-bottom:1px solid var(--v4-rule)!important;border-radius:0!important;background:#faf7f1!important;box-shadow:none!important;overflow-x:auto;scrollbar-width:none}
body.ixv4-r3 #ixv4-toolbar::-webkit-scrollbar{display:none}
body.ixv4-r3 #ixv4-toolbar button{white-space:nowrap!important;flex-shrink:0}
body.ixv4-r3 #ixv4-unified-chapter{max-width:1120px!important;margin:12px auto 13px!important;padding:0 4px!important}
body.ixv4-r3 .reader-heading{display:none!important}
body.ixv4-r3 #readingChamber{width:100%!important;max-width:990px!important;margin:0 auto!important;overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important}
body.ixv4-r3 #paper{position:relative!important;width:100%!important;max-width:990px!important;min-height:610px!important;box-sizing:border-box!important;margin:0 auto!important;padding:32px clamp(36px,6vw,82px) 44px!important;border:1px solid #e5dbca!important;border-radius:2px!important;background:var(--v4-paper)!important;box-shadow:0 12px 35px rgba(31,47,36,.07)!important}
body.ixv4-r3 #manuscriptBody{margin-top:24px!important;max-width:66ch!important}
body.ixv4-r3 .paper-edge,body.ixv4-r3 .chamber-shadow{display:none!important}
body.ixv4-r3 .reader-status{max-width:990px!important;margin:10px auto 12px!important}
body.ixv4-r3 #ixv4-pager{display:flex!important;position:relative!important;max-width:990px!important;width:100%!important;left:auto!important;right:auto!important;bottom:auto!important;transform:none!important;margin:10px auto 15px!important;z-index:2!important}
body.ixv4-r3 #editorialReadingControls{position:relative!important;max-width:990px!important;margin:10px auto 18px!important;bottom:auto!important;z-index:2!important;box-shadow:none!important}
body.ixv4-r3.ixv4-r3-paged #editorialReadingControls{display:none!important}
body.ixv4-r3:not(.ixv4-r3-paged) #ixv4-pager{display:none!important}
/* Contextual tools: one controlled workspace rather than permanent unused rail. */
body.ixv4-r3 .ixrs-private{display:none!important}
body.ixv4-r3.ixv4-r3-tools-open .ixrs-private{display:flex!important;position:fixed!important;inset:auto 0 0 auto!important;top:calc(var(--ixv4-header-height,60px) + 50px)!important;width:min(420px,100vw)!important;min-width:0!important;max-width:100vw!important;height:auto!important;max-height:none!important;min-height:0!important;padding:17px 18px 25px!important;overflow:auto!important;overscroll-behavior:contain!important;background:#fffdf8!important;border-left:1px solid var(--v4-rule)!important;box-shadow:-16px 0 34px rgba(15,38,31,.13)!important;z-index:78!important}
body.ixv4-r3.ixv4-r3-tools-open #selectionComposer{display:block;position:static!important;width:100%!important;max-width:none!important;max-height:none!important;height:auto!important;inset:auto!important;transform:none!important;overflow:visible!important;margin:12px 0!important;z-index:2!important}
body.ixv4-r3.ixv4-r3-tools-open #selectionComposer.hidden{display:none!important}
body.ixv4-r3.ixv4-r3-tools-open .ixrs-private:has(#selectionComposer:not(.hidden)) .ixrs-private-copy,
body.ixv4-r3.ixv4-r3-tools-open .ixrs-private:has(#selectionComposer:not(.hidden)) .ixrs-private-tabs,
body.ixv4-r3.ixv4-r3-tools-open .ixrs-private:has(#selectionComposer:not(.hidden)) .ixrs-select-prompt,
body.ixv4-r3.ixv4-r3-tools-open .ixrs-private:has(#selectionComposer:not(.hidden)) .ixrs-private-actions{display:none!important}
body.ixv4-r3.ixv4-r3-tools-open .ixrs-private:has(#selectionComposer:not(.hidden)) .ixrs-private-head h2{font-size:17px!important}
body.ixv4-r3 #selectionComposer header{position:relative!important;display:flex!important;align-items:start!important;justify-content:space-between!important;gap:12px!important}
body.ixv4-r3 #selectionComposer #closeComposer{flex:none!important;margin:0!important}
/* The same V4 toolbar owns actions; prevent the legacy floating row blocking saves. */
body.ixv4-r3 #ixrsPassageToolbar{z-index:65!important}
body.ixv4-r3 #ixv4-note-dialog{z-index:1100!important;max-height:83dvh!important;overflow:auto!important}
body.ixv4-r3 :is(.ixrs-private,#chapterDrawer,.chapter-list,.ixrs-main,#manuscriptBody){scrollbar-width:none!important;-ms-overflow-style:none!important}
body.ixv4-r3 :is(.ixrs-private,#chapterDrawer,.chapter-list,.ixrs-main,#manuscriptBody)::-webkit-scrollbar{display:none!important;width:0!important}
@media(min-width:1180px){body.ixv4-r3.ixv4-r3-tools-open .ixrs-main{padding-right:min(432px,31vw)!important}body.ixv4-r3.ixv4-r3-tools-open #readingChamber{max-width:850px!important}}
@media(max-width:700px){body.ixv4-r3 .ixrs-main{padding:0 10px 25px!important}body.ixv4-r3 #paper{padding:25px 22px 38px!important;min-height:65dvh!important}body.ixv4-r3.ixv4-r3-tools-open .ixrs-private{width:100vw!important;top:calc(var(--ixv4-header-height,60px) + 50px)!important}body.ixv4-r3 #ixv4-unified-chapter{margin:9px auto!important}body.ixv4-r3 #ixv4-uc-title{font-size:21px!important}}
