/* INKLYDT READER V4 R5 — unified visual ownership for the approved Reader shell.
   Loads after R3/R4; opt-in only; no changes to manuscript/Firestore. */
body.ixv4-r5{--ixv4-top:var(--ixv4-header-height,60px);--ixv4-bar:52px;--ixv4-paper:#fffefa;--ixv4-warm:#f8f3ea;--ixv4-line:#e5dac9;--ixv4-green:#174538;--ixv4-drawer-width:320px;background:var(--ixv4-warm)!important}
/* The global header remains authoritative; toolbar is one restrained app surface. */
body.ixv4-r5 #ixv4-toolbar{position:sticky!important;top:var(--ixv4-top)!important;z-index:110!important;display:flex!important;align-items:center!important;gap:clamp(8px,1.3vw,18px)!important;min-height:var(--ixv4-bar)!important;height:auto!important;padding:7px clamp(16px,3vw,45px)!important;background:#fffdf9!important;border-bottom:1px solid var(--ixv4-line)!important;box-shadow:0 3px 12px rgba(24,47,38,.035)!important;scrollbar-width:none!important}
body.ixv4-r5 #ixv4-toolbar button{font:600 12px/1.3 system-ui,sans-serif!important;border-radius:9px!important;min-height:33px!important;max-height:40px!important;padding:7px 11px!important;letter-spacing:0!important}
body.ixv4-r5 #ixv4-toolbar button:is(:hover,:focus-visible){background:#e7f0e9!important;color:#184b3a!important}
/* Central reading lane stays calm and appropriately sized. */
body.ixv4-r5 .ixrs-main{padding:0 clamp(12px,3vw,48px) 38px!important;max-width:none!important}
body.ixv4-r5 #ixv4-unified-chapter{max-width:900px!important;padding:0 5px!important;margin:15px auto 14px!important;min-height:53px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important}
body.ixv4-r5 #ixv4-uc-title{font:400 clamp(24px,2.25vw,32px)/1.2 Georgia,serif!important;color:#1b493a!important}
body.ixv4-r5 #readingChamber,body.ixv4-r5 #ixv4-pager,body.ixv4-r5 #editorialReadingControls,body.ixv4-r5 .reader-status{max-width:900px!important;width:100%!important}
body.ixv4-r5 #paper{max-width:900px!important;width:100%!important;margin:auto!important;background:var(--ixv4-paper)!important;padding:32px clamp(52px,8vw,96px) 44px!important;border:1px solid var(--ixv4-line)!important;box-shadow:0 14px 42px rgba(31,44,32,.07)!important}
body.ixv4-r5 #manuscriptBody{max-width:68ch!important;margin:22px auto 0!important}
/* Drawer is an actual navigation surface, not a legacy 2nd reading column. */
body.ixv4-r5 #chapterDrawer{position:fixed!important;left:0!important;top:calc(var(--ixv4-top) + var(--ixv4-bar))!important;bottom:0!important;height:auto!important;max-height:none!important;width:min(var(--ixv4-drawer-width),92vw)!important;z-index:205!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#fffdf9!important;border-right:1px solid var(--ixv4-line)!important;box-shadow:16px 0 40px rgba(21,38,31,.13)!important}
body.ixv4-r5:not(.chapters-open) #chapterDrawer{transform:translateX(-105%)!important;visibility:hidden!important;pointer-events:none!important}
body.ixv4-r5.chapters-open #chapterDrawer{transform:translateX(0)!important;visibility:visible!important;pointer-events:auto!important}
body.ixv4-r5 #chapterDrawer .drawer-head{min-height:66px!important;max-height:none!important;padding:12px 18px!important;background:#fffdf9!important;border-bottom:1px solid var(--ixv4-line)!important;display:flex!important;align-items:center!important;gap:10px!important}
body.ixv4-r5 #chapterDrawer .drawer-head strong{font:400 19px/1.2 Georgia,serif!important;color:var(--ixv4-green)!important;white-space:normal!important}
body.ixv4-r5 #chapterDrawer .drawer-head .micro{font:700 9px/1.3 system-ui,sans-serif!important;letter-spacing:.11em!important;color:#a17b4d!important}
body.ixv4-r5 #chapterDrawer #closeChapters{min-width:62px!important;min-height:32px!important;flex:none!important}
body.ixv4-r5 #ixv4-nav-tabs{display:grid!important;grid-template-columns:1fr 1fr!important;padding:10px 14px!important;gap:8px!important;background:#fffdf9!important}
body.ixv4-r5 #ixv4-nav-tabs button{min-height:39px!important;border-radius:9px!important;font:600 12px system-ui,sans-serif!important}
body.ixv4-r5 #chapterDrawer #chapterList,body.ixv4-r5 #chapterDrawer .drawer-tools{flex:1 1 auto!important;min-height:0!important;height:auto!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding:10px 14px 24px!important;background:#fffdf9!important;scrollbar-width:none!important}
body.ixv4-r5 #chapterDrawer #chapterList::-webkit-scrollbar,body.ixv4-r5 #chapterDrawer .drawer-tools::-webkit-scrollbar{display:none!important}
body.ixv4-r5 #chapterDrawer .drawer-tools{justify-content:flex-start!important;align-content:start!important;gap:10px!important}
body.ixv4-r5 #chapterDrawer .drawer-tools-label{display:none!important}
body.ixv4-r5 #chapterDrawer .ixv4-nav-description{margin:2px 0 10px!important;font:12px/1.5 system-ui,sans-serif!important}
body.ixv4-r5 #chapterDrawer .drawer-tools-grid{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;margin:0!important}
body.ixv4-r5 #chapterDrawer .drawer-tools button{min-height:43px!important;margin:0!important;padding:10px 14px!important;background:#f8f5ef!important;border:1px solid #e8dfd2!important;border-radius:9px!important;font:600 12px/1.35 system-ui,sans-serif!important;color:#25493e!important}
body.ixv4-r5 #chapterDrawer .drawer-tools button:hover{background:#e5eee8!important}
body.ixv4-r5 #chapterDrawer .drawer-tools [hidden],body.ixv4-r5 #chapterDrawer [hidden]{display:none!important}
body.ixv4-r5 #chapterDrawer #chapterList .chapter-item{min-height:65px!important;padding:11px 12px!important;margin:0!important}
body.ixv4-r5 #chapterDrawer #chapterList .chapter-item strong{font:400 15px/1.3 Georgia,serif!important}
body.ixv4-r5 #drawerScrim{display:block!important;position:fixed!important;top:calc(var(--ixv4-top) + var(--ixv4-bar))!important;left:0!important;right:0!important;bottom:0!important;z-index:198!important;background:rgba(16,31,26,.18)!important;backdrop-filter:blur(1px)!important}
body.ixv4-r5:not(.chapters-open) #drawerScrim{display:none!important;pointer-events:none!important}
body.ixv4-r5.chapters-open #drawerScrim{pointer-events:auto!important}
/* A book-edge mark never sits on a navigation drawer. */
body.ixv4-r5.chapters-open #ixlb-layer{visibility:hidden!important;pointer-events:none!important}
body.ixv4-r5 #ixlb-controls{display:none!important}
/* Tool panel is one contextual drawer, never permanent blank real estate. */
body.ixv4-r5:not(.ixv4-r3-tools-open) .ixrs-private{display:none!important}
body.ixv4-r5.ixv4-r3-tools-open .ixrs-private{position:fixed!important;top:calc(var(--ixv4-top) + var(--ixv4-bar))!important;right:0!important;bottom:0!important;height:auto!important;max-height:none!important;width:min(380px,100vw)!important;padding:16px 17px 25px!important;overflow-y:auto!important;z-index:180!important;background:#fffdf9!important;scrollbar-width:none!important}
body.ixv4-r5.ixv4-r3-tools-open .ixrs-private::-webkit-scrollbar{display:none!important}
body.ixv4-r5.ixv4-r3-tools-open #selectionComposer{max-width:100%!important;box-sizing:border-box!important}
body.ixv4-r5.ixv4-r3-tools-open #ixv4-unified-chapter,body.ixv4-r5.ixv4-r3-tools-open #readingChamber{margin-left:auto!important;margin-right:auto!important}
@media(min-width:1050px){body.ixv4-r5.ixv4-r3-tools-open .ixrs-main{padding-right:400px!important}}
@media(max-width:780px){body.ixv4-r5{--ixv4-drawer-width:310px}body.ixv4-r5 #paper{padding:26px 25px 40px!important}body.ixv4-r5 #ixv4-unified-chapter{margin:10px auto!important}body.ixv4-r5 #ixv4-toolbar{overflow-x:auto!important}body.ixv4-r5.ixv4-r3-tools-open .ixrs-private{width:min(420px,100vw)!important}body.ixv4-r5 .ixrs-main{padding:0 12px 24px!important}}
