/* INKLYDT Reader V4 Unified R2 — style overrides only, opted in via ?readerV4=1 */
body.ixv4-unified{--ixv4-cream:#f8f3ea;--ixv4-paper:#fffefb;--ixv4-ink:#183e33;--ixv4-line:#e2d8c9;background:var(--ixv4-cream)!important}
/* One compact toolbar, no stray floating actions obstructing annotation saves. */
body.ixv4-unified #ixv4-toolbar{position:sticky!important;top:var(--ixv4-header-height,68px)!important;min-height:48px;gap:10px;padding:5px clamp(12px,3vw,38px);border-bottom:1px solid var(--ixv4-line);background:#faf7f1!important;z-index:72}
body.ixv4-unified #ixv4-toolbar #ixv4-status{display:none!important}
body.ixv4-unified #ixv4-toolbar button{min-height:35px;white-space:nowrap}
/* Living Book bottom strip is a duplicated control. Underlying buttons stay in DOM for the unified toolbar. */
body.ixv4-unified :is(#ixlb-create,#ixlb-show,#ixlb-margins){position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;border:0!important}
/* Dedicated compact chapter identification; remove oversized/redundant chapter actions. */
body.ixv4-unified .reader-heading{display:none!important}
body.ixv4-unified #ixv4-unified-chapter{display:flex;align-items:center;justify-content:space-between;gap:16px;width:min(100%,1060px);margin:10px auto 12px;padding:0 12px;color:var(--ixv4-ink)}
body.ixv4-unified #ixv4-uc-kicker{display:block;font:700 10px/1.6 system-ui,sans-serif;letter-spacing:.12em;color:#ad7949;text-transform:uppercase}
body.ixv4-unified #ixv4-uc-title{font:400 clamp(21px,2vw,27px)/1.2 Georgia,serif;margin:0;color:var(--ixv4-ink)}
body.ixv4-unified #ixv4-uc-chapters{border:0;background:transparent;color:#48695c;font:600 12px system-ui,sans-serif;cursor:pointer;padding:10px}
/* Manuscript-first layout; never alter its words, anchors or V2 permission mechanics. */
body.ixv4-unified .reader-shell{min-width:0!important;max-width:none!important;padding-top:2px!important}
body.ixv4-unified #readingChamber{max-width:990px!important;width:min(100%,990px)!important;margin:0 auto!important}
body.ixv4-unified #manuscriptBody{min-width:0!important}
/* The old left and right columns are closed by default, available from the unified toolbar. */
body.ixv4-unified .ixrs-sidebar{display:none!important}
body.ixv4-unified.ixv4-nav-open .ixrs-sidebar{display:block!important}
body.ixv4-unified .ixrs-private{display:none!important}
body.ixv4-unified.ixv4-tools-open .ixrs-private{display:flex!important;flex-direction:column;max-height:calc(100dvh - 125px);overflow:auto;overscroll-behavior:contain}
/* Dock the contextual composer into an unobstructed column and protect its buttons. */
body.ixv4-unified.ixv4-tools-open #selectionComposer{max-width:100%!important;max-height:none!important;position:relative!important;inset:auto!important;transform:none!important;z-index:2!important;overflow:visible!important}
body.ixv4-unified.ixv4-tools-open :is(#saveNoteButton,#saveAuditButton,#saveTagButton){position:relative;z-index:3}
/* Real display-page navigation belongs in reading flow, not a viewport-covering floating bar. */
body.ixv4-unified #ixv4-pager{position:relative!important;left:auto!important;bottom:auto!important;transform:none!important;margin:14px auto 28px!important;box-shadow:none!important;max-width:780px;min-height:47px;justify-content:space-between}
body.ixv4-unified.ixv4-has-display-pages #editorialReadingControls{display:none!important}
body.ixv4-unified:not(.ixv4-has-display-pages) #editorialReadingControls{position:relative!important;max-width:780px!important;margin:14px auto 30px!important;bottom:auto!important;z-index:3}
/* Modal opens above layout and does not compete with fixed button bars. */
body.ixv4-unified #ixv4-note-dialog{position:fixed!important;z-index:1000!important;max-height:85dvh;overflow:auto}
/* Invisible scrollbars but full keyboard, wheel and touch scrolling. */
body.ixv4-unified :is(.reader-shell,.ixrs-private,#manuscriptBody,#ixv4-note-dialog){scrollbar-width:none;-ms-overflow-style:none}
body.ixv4-unified :is(.reader-shell,.ixrs-private,#manuscriptBody,#ixv4-note-dialog)::-webkit-scrollbar{display:none;width:0;height:0}
@media(max-width:850px){body.ixv4-unified #ixv4-toolbar{overflow-x:auto}body.ixv4-unified #readingChamber{width:100%!important}body.ixv4-unified.ixv4-tools-open .ixrs-private{position:fixed!important;right:0;top:110px;bottom:0;width:min(420px,100vw)!important;max-height:none;z-index:80;background:#fffcf6;box-shadow:-12px 0 35px #142c2427}}
