:root{color-scheme:dark;--bg:#151916;--surface:#222723;--line:#343b35;--muted:#a6afa6;--green:#d0e7b0;--ink:#ecf0e8}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:Inter,"Helvetica Neue",Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}button{font:inherit;cursor:pointer}body{background:var(--bg);color:var(--ink)}.viewer-loading{height:100vh;display:grid;place-content:center;justify-items:center;gap:17px;color:#bdc9b8;font-size:12px;letter-spacing:.4px}.viewer-loader{height:29px;width:29px;border:2px solid #465146;border-top-color:#cce9a8;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.viewer-shell{height:100%;display:flex;flex-direction:column}.v-topbar{height:70px;flex-shrink:0;border-bottom:1px solid #303930;background:#1b211c;display:flex;align-items:center;justify-content:space-between;padding:0 27px;gap:15px}.v-identity{display:flex;align-items:center;gap:15px;min-width:0}.v-brand{font-weight:850;letter-spacing:-1px;font-size:21px;color:#f0f5e9;white-space:nowrap}.v-brand span{color:#d1eab0}.v-divider{height:23px;width:1px;background:#3d4a3e}.v-project{display:grid;gap:4px;min-width:0}.v-project b{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:360px}.v-project span{font-size:10px;color:#8f9c91;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.v-top-actions{display:flex;align-items:center;gap:7px}.v-icon-btn{display:grid;place-items:center;background:transparent;border:1px solid transparent;color:#a8b7a8;height:38px;min-width:38px;padding:0 10px;border-radius:8px}.v-icon-btn:hover{background:#2b342b;border-color:#3b483c;color:#eef5e8}.v-top-actions .v-textbutton{font-size:11px;display:flex;align-items:center;gap:8px;background:#d0e8af;color:#233327;border-radius:7px;border:0;font-weight:800;padding:11px 15px}.v-top-actions .v-textbutton:hover{background:#e6f6cf}.viewer-stage{min-height:0;flex:1;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:24px 32px 90px;background:radial-gradient(circle at 50% 25%,#242923,#141815 65%)}.page-host{max-width:100%;max-height:100%;position:relative;display:flex;align-items:center;justify-content:center;box-shadow:0 32px 90px #0009;transition:transform .2s}.page-host canvas{max-width:100%;max-height:100%;display:block;background:white;box-shadow:0 0 0 1px #ffffff22}.annotation-layer,.media-layer{position:absolute;inset:0;pointer-events:none}.link-hotspot{position:absolute;pointer-events:auto;cursor:pointer;background:transparent;border:1px solid transparent;border-radius:2px;outline:none}.link-hotspot:hover,.link-hotspot:focus-visible{background:#d0e8af26;border-color:#c5e8a780}.media-overlay{position:absolute;pointer-events:auto;overflow:hidden}.media-overlay img,.media-overlay video{display:block;width:100%;height:100%;object-fit:contain}.media-overlay video{background:#000}.viewer-frame{width:100%;height:100%;border:0;background:#fff;box-shadow:0 28px 90px #0008}.iframe-host{width:min(100%,1360px);height:100%;max-height:100%;min-height:0;position:relative}.iframe-host iframe{width:100%;height:100%;border:0;background:#fff}.embed-caption{position:absolute;top:-23px;left:0;font-size:10px;color:#a3aca2}.stage-side{position:absolute;z-index:5;top:50%;transform:translateY(-50%);width:44px;height:54px;border:1px solid #425044;background:#273129ae;border-radius:9px;color:#dce9da;display:grid;place-items:center;transition:all .2s}.stage-side:hover{background:#405442}.stage-side.prev{left:20px}.stage-side.next{right:20px}.stage-side:disabled{opacity:.25;cursor:default}.bottom-tools{height:63px;min-height:63px;position:absolute;bottom:18px;left:50%;transform:translateX(-50%);background:#262e27e8;backdrop-filter:blur(12px);border:1px solid #425044;border-radius:12px;display:flex;align-items:center;gap:18px;padding:0 16px;box-shadow:0 15px 60px #0008;z-index:8}.bottom-tools .v-icon-btn{height:34px;min-width:33px}.bottom-tools .v-icon-btn:disabled{opacity:.32;cursor:default}.bottom-tools .page-counter{min-width:75px;text-align:center;font-size:12px;color:#d8e4d3}.bottom-tools .page-counter strong{color:#f5fff0}.bottom-tools .tool-divider{height:20px;width:1px;background:#455145}.bottom-tools .zoom-readout{font-size:10px;min-width:42px;text-align:center;color:#b7c6b3}.bottom-tools .page-jump{background:#293429;border:1px solid #47584b;border-radius:5px;color:#e4f0df;width:42px;font-size:12px;text-align:center;padding:6px 3px;outline:none}.footer-trust{position:absolute;bottom:22px;right:25px;font-size:10px;color:#667569}.viewer-fallback{background:#2a332b;border:1px solid #465246;border-radius:10px;text-align:center;max-width:470px;padding:35px;line-height:1.8;font-size:12px;color:#b7c9b4}.viewer-fallback b{font-size:17px;color:#e1efda;display:block;margin-bottom:10px}.viewer-fallback a{display:inline-block;margin-top:15px;background:#cce6ae;color:#213827;padding:9px 14px;border-radius:6px;text-decoration:none;font-weight:700}.viewer-credit{font-size:10px;color:#839483;display:flex;align-items:center;gap:5px}.v-badge{border:1px solid #50604d;background:#2b382c;padding:6px 10px;border-radius:40px;color:#acc8a9;font-size:10px}.preview-popover{position:fixed;z-index:25;width:294px;border:1px solid #cad9c5;background:#f6faf3;color:#2c392e;border-radius:13px;padding:17px;box-shadow:0 22px 60px #0009;pointer-events:none;transition:opacity .1s}.preview-top{display:flex;align-items:center;gap:10px;margin-bottom:12px}.preview-icon{width:34px;height:34px;border:1px solid #e0e8dd;background:#fff;border-radius:8px;display:grid;place-items:center;font-size:18px;color:#648467;overflow:hidden}.preview-icon img{width:20px;height:20px;object-fit:contain}.preview-top span{display:grid;gap:4px;min-width:0}.preview-top b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview-top small{font-size:10px;color:#7a8b7c}.preview-url{font-size:10px;line-height:1.6;background:#edf3e9;border-radius:7px;padding:10px;color:#586b5c;overflow-wrap:anywhere}.preview-footer{font-size:10px;color:#789478;margin-top:11px;display:flex;justify-content:space-between;align-items:center}.consent-shade{position:fixed;inset:0;background:#101810a0;display:grid;place-items:end center;z-index:40;padding:20px}.consent-card{width:min(580px,100%);background:#f9fbf6;color:#28392c;border-radius:17px;padding:28px;box-shadow:0 30px 90px #0008}.consent-kicker{font-size:10px;letter-spacing:1.5px;font-weight:850;color:#6f8f6e;margin-bottom:11px}.consent-card h2{font-family:Georgia,serif;font-size:26px;font-weight:400;letter-spacing:-.5px;margin:0 0 10px}.consent-card p{font-size:12px;line-height:1.8;color:#758777;margin:0 0 20px}.consent-buttons{display:flex;gap:10px;justify-content:flex-end}.consent-buttons button{border:1px solid #cbdccc;padding:12px 17px;border-radius:8px;font-size:11px;font-weight:800;background:white;color:#46614a}.consent-buttons button.agree{background:#304c35;border-color:#304c35;color:white}.view-note{position:absolute;left:24px;bottom:28px;font-size:10px;color:#6c7d6d;z-index:2}.center-error{max-width:450px;text-align:center;padding:35px}.center-error h1{font-family:Georgia,serif;font-weight:400;font-size:30px}.center-error p{color:#9eb19d;line-height:1.8;font-size:12px}@media(max-width:700px){.v-topbar{padding:0 12px;height:60px}.v-identity{gap:9px}.v-brand{font-size:17px}.v-project b{font-size:10px;max-width:160px}.v-project span{font-size:9px}.v-top-actions .v-textbutton{padding:9px;white-space:nowrap;font-size:10px}.v-top-actions .v-textbutton span{display:none}.v-top-actions .v-textbutton svg{width:16px}.v-top-actions .v-icon-btn{display:none}.v-divider{height:20px}.viewer-stage{padding:15px 8px 95px}.stage-side{width:32px;height:44px}.stage-side.prev{left:3px}.stage-side.next{right:3px}.stage-side svg{width:17px}.bottom-tools{gap:5px;padding:0 6px;height:55px;min-height:55px;bottom:20px}.bottom-tools .v-icon-btn{min-width:28px;padding:0 4px}.bottom-tools .page-counter{min-width:63px;font-size:11px}.bottom-tools .zoom-readout{min-width:35px}.footer-trust,.view-note{display:none}.preview-popover{width:240px}.consent-card{padding:23px}.consent-buttons{flex-direction:column}.iframe-host{height:100%}}
/* FOLIO-controlled fixed-layout EPUB pages. XHTML is sandboxed without scripts. */
.page-host .epub-frame{position:absolute;top:0;left:0;border:0;background:white;display:block;max-width:none;max-height:none;box-shadow:0 0 0 1px #ffffff28}
@media (max-width:700px){.v-badge{display:none}}

/* v1.4: a real full-viewport canvas and a scrollable zoom surface.
   InDesign EPUB pages always preserve their authored aspect ratios. */
#viewer{width:100%;height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column}
#viewer .viewer-shell{width:100%;height:100%;min-height:0}
.page-scroll{position:absolute;inset:0;display:flex;overflow:auto;overscroll-behavior:contain;padding:12px 60px 92px;scrollbar-width:thin;scrollbar-color:#526352 transparent}
.page-scroll>.page-host{position:relative;flex:none;margin:auto;max-width:none;max-height:none;min-width:0;min-height:0}
.bottom-tools [aria-pressed="true"]{background:#3d523e;border-color:#6b8767;color:#ecf7e5}
@media(max-width:700px){.page-scroll{padding:8px 38px 84px}.bottom-tools{gap:3px}.bottom-tools .v-icon-btn{min-width:27px;padding:0 3px}}

/* v1.8: the *outer surface* is the only scaled layer.  EPUB iframe's
   layout viewport is always the native exported page dimensions. */
.page-host .epub-scaled-surface{position:absolute;top:0;left:0;display:block;overflow:visible;max-width:none;max-height:none;will-change:transform}
.page-host .epub-scaled-surface>.epub-frame{position:absolute;top:0;left:0;width:100%;height:100%;max-width:none;max-height:none;transform:none!important;overflow:hidden}

.consent-disclosure{font-size:11px;line-height:1.65;color:#758777;margin:-7px 0 18px}.consent-disclosure summary{cursor:pointer;text-decoration:underline;text-underline-offset:2px}.consent-disclosure p{font-size:11px;margin:8px 0 0}.consent-card>p{margin-bottom:19px}

/* v2.4 - clear Auto reset and drag-to-pan when zoomed */
.bottom-tools .zoom-reset{background:#354535;color:#e8f5df;border:1px solid #5b785a;padding:7px 11px;border-radius:7px;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}
.bottom-tools .zoom-reset:hover,.bottom-tools .zoom-reset.is-active{background:#d0e8af;color:#233327;border-color:#d0e8af}
.page-scroll.can-pan .page-host{cursor:grab}
.page-scroll.is-panning,.page-scroll.is-panning .page-host{cursor:grabbing!important;user-select:none}
@media(max-width:700px){.bottom-tools .zoom-reset{padding:7px 8px;font-size:10px}}

/* v2.6: Keep direct page entry without native browser increment/decrement arrows. */
.bottom-tools input.page-jump[type="number"]{-moz-appearance:textfield;appearance:textfield}
.bottom-tools input.page-jump[type="number"]::-webkit-inner-spin-button,
.bottom-tools input.page-jump[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

/* v2.8: overlay captures drag consistently above the EPUB iframe. */
.epub-pan-layer{position:absolute;inset:0;z-index:4;pointer-events:none;cursor:grab;touch-action:none;user-select:none}
.epub-pan-layer.enabled{pointer-events:auto}
.page-scroll.is-panning .epub-pan-layer{cursor:grabbing}
.bottom-tools .zoom-reset{padding-inline:12px}
.bottom-tools .pan-mode{font-size:10px;padding-inline:8px}
.stage-side[hidden]{display:none!important}
@media(max-width:700px){.bottom-tools .zoom-reset{font-size:9px;padding:7px 6px}}

/* v3.1: pan overlay is a stationary child of the stage, not the scrolling canvas. */
#stage>.epub-pan-layer.enabled{pointer-events:auto}

/* Optional treatment access gate, shown before the document is loaded. */
.access-screen{min-height:100dvh;background:radial-gradient(circle at top,#354939,#121a15 70%);display:grid;place-items:center;padding:24px;color:#253328;font-family:Arial,sans-serif}
.access-card{width:min(440px,100%);padding:34px;background:#f8faf6;border-radius:18px;box-shadow:0 40px 110px #0007;display:grid;gap:14px}
.access-brand{font-size:22px;font-weight:850;letter-spacing:-1px}.access-brand span{color:#76a15d}.access-eyebrow{font-size:10px;letter-spacing:2px;font-weight:750;color:#648369}.access-card h1{font-family:Georgia,serif;font-size:30px;line-height:1.1;margin:4px 0}.access-card p{margin:0;color:#6a776d;font-size:13px;line-height:1.6}.access-card label{display:grid;gap:7px;font-size:12px;font-weight:700}.access-card input{border:1px solid #cbd6c8;border-radius:8px;padding:13px;background:#fff;color:#263727;font-size:14px;min-width:0}.access-card small{font-size:11px;line-height:1.5;color:#6d786e}.access-card button{border:0;border-radius:9px;background:#304c35;color:white;padding:14px;font-size:13px;font-weight:750;cursor:pointer}.access-card button:disabled{opacity:.6}.access-card #access-error{font-size:12px;color:#ae4141}

.v-contact-link{color:#edf5e5;font-size:11px;text-decoration:none;border:1px solid #ffffff45;border-radius:7px;padding:10px 12px;white-space:nowrap}
.v-contact-link:hover{background:#ffffff20}
@media(max-width:850px){.v-contact-link{font-size:10px;padding:7px}}
@media(max-width:580px){.v-contact-link{max-width:75px;overflow:hidden;text-overflow:ellipsis}}

/* v5.1: consistent top actions and unobstructed download in bottom toolbar. */
.v-top-actions .v-contact-link,.v-top-actions .v-textbutton{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:0 15px;border-radius:7px;font-size:11px;font-weight:800;line-height:1;white-space:nowrap;box-sizing:border-box}
.v-top-actions .v-contact-link{border:1px solid #ffffff45;color:#edf5e5;text-decoration:none}
.v-top-actions .v-contact-link:hover{background:#ffffff20}
.bottom-tools .v-download-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;color:#e9f3e2;text-decoration:none;font-size:11px;font-weight:750;line-height:1;white-space:nowrap;border:1px solid #586d55;background:#354535;border-radius:7px;min-height:35px;padding:0 12px}
.bottom-tools .v-download-btn:hover,.bottom-tools .v-download-btn:focus-visible{background:#496348;color:#fff}
.bottom-tools .v-download-btn svg{flex:none;display:block}
.bottom-tools.embed-bottom-tools{width:auto}
.bottom-tools .v-icon-btn svg{display:block;flex:none}
@media(max-width:850px){.v-top-actions .v-contact-link,.v-top-actions .v-textbutton{min-height:36px;padding:0 9px;font-size:10px}}
@media(max-width:700px){.bottom-tools .v-download-btn{min-height:32px;padding:0 8px;font-size:10px}.bottom-tools{max-width:calc(100vw - 12px);overflow-x:auto;justify-content:flex-start;scrollbar-width:none}.bottom-tools::-webkit-scrollbar{display:none}}

/* Fit to Frame has no scrollable blank area. Zooming re-enables panning. */
.page-scroll.folio-no-empty-scroll{overflow:hidden;overscroll-behavior:none;}


/* Portrait-window layout: comfortable controls, not a compressed desktop toolbar. */
@media (max-width:760px), (max-aspect-ratio: 4/5) and (max-width:1050px){
 .v-topbar{height:auto;min-height:72px;padding:12px 15px;gap:10px;flex-wrap:wrap;align-content:center}
 .v-identity{flex:1 1 180px;min-width:0;gap:10px}
 .v-project{min-width:0}.v-project b{max-width:min(55vw,320px);font-size:12px}
 .v-project span{font-size:10px}
 .v-top-actions{flex:0 1 auto;min-width:0;gap:5px}
 .v-top-actions .v-contact-link{max-width:155px;overflow:hidden;text-overflow:ellipsis;min-height:36px}
 .v-top-actions .v-textbutton{min-height:38px}
 .viewer-stage{padding:12px 8px 126px}
 .page-scroll{padding:8px 12px 134px;overscroll-behavior:contain}
 .page-scroll.folio-no-empty-scroll{overflow:hidden}
 .stage-side{width:34px;height:45px;opacity:.8}
 .bottom-tools:not(.embed-bottom-tools){left:10px;right:10px;bottom:max(12px,env(safe-area-inset-bottom));transform:none;width:auto;max-width:none;height:auto;min-height:0;padding:8px 10px;display:flex;justify-content:center;flex-wrap:wrap;gap:5px 9px;border-radius:13px}
 .bottom-tools .tool-divider{display:none}
 .bottom-tools .v-icon-btn{min-height:36px;min-width:36px;padding:5px 7px}
 .bottom-tools .page-counter{min-width:72px}
 .bottom-tools .zoom-readout{min-width:36px;text-align:center}
 .bottom-tools .zoom-reset{font-size:11px;padding:9px 10px}
 .bottom-tools .v-download-btn{min-height:36px;padding:0 10px;font-size:11px}
 .bottom-tools.embed-bottom-tools{bottom:max(14px,env(safe-area-inset-bottom));max-width:calc(100vw - 24px)}
 .consent-shade{padding:12px;align-items:end}
 .consent-card{max-height:calc(100dvh - 24px);overflow-y:auto}
}
@media(max-width:440px){
 .v-topbar{padding:10px 12px}
 .v-identity{flex-basis:100%}
 .v-project b{max-width:calc(100vw - 110px)}
 .v-top-actions{width:100%;justify-content:flex-end}
 .v-top-actions .v-icon-btn{display:grid}
 .v-top-actions .v-textbutton span{display:inline}
 .viewer-stage{padding-bottom:144px}
 .page-scroll{padding-bottom:155px}
 .bottom-tools:not(.embed-bottom-tools){gap:4px 7px}
 .bottom-tools .zoom-reset{font-size:10px}
}
@media(max-height:560px) and (orientation:landscape){
 .viewer-stage{padding-bottom:84px}.page-scroll{padding-bottom:96px}
}


/* Mobile treatment controls: two deliberate rows instead of wrapping desktop UI. */
@media(max-width:760px), (max-aspect-ratio:4/5) and (max-width:1050px){
 .v-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;align-items:center;gap:8px;padding:11px 14px;min-height:64px;height:auto}
 .v-identity{grid-column:1;grid-row:1;display:flex;gap:10px;min-width:0;flex-basis:auto}
 .v-brand{font-size:18px;flex:none}
 .v-divider{height:26px}
 .v-project{min-width:0;overflow:hidden}
 .v-project b{font-size:12px;max-width:100%;display:block}
 .v-project span{font-size:10px;max-width:100%;display:block}
 .v-top-actions{grid-column:2;grid-row:1;display:flex;width:auto;align-items:center;gap:6px;min-width:0}
 .v-top-actions .v-contact-link{min-height:36px;max-width:132px;padding:0 9px;font-size:10px}
 .v-top-actions .v-textbutton{height:36px;min-width:36px;padding:0 10px;display:grid;place-items:center}
 .v-top-actions .v-textbutton span{display:none}
 .v-top-actions .v-icon-btn{display:none}
 .viewer-stage{padding:6px 8px 112px}
 .page-scroll{padding:6px 8px 116px}
 .stage-side{display:none!important}
 .bottom-tools:not(.embed-bottom-tools){
  display:grid;grid-template-columns:40px minmax(67px,1fr) 40px 1px 40px minmax(40px,1fr) 40px;
  grid-template-rows:42px 40px;align-items:center;justify-items:center;
  column-gap:5px;row-gap:5px;left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom));
  width:auto;height:auto;min-height:0;max-width:none;transform:none;padding:8px 10px;
  overflow:visible;border-radius:14px;box-shadow:0 7px 26px #0009
 }
 .bottom-tools:not(.embed-bottom-tools) .tool-divider{display:none}
 .bottom-tools:not(.embed-bottom-tools) #prev{grid-column:1;grid-row:1}
 .bottom-tools:not(.embed-bottom-tools) .page-counter{grid-column:2;grid-row:1;min-width:0;white-space:nowrap}
 .bottom-tools:not(.embed-bottom-tools) #next{grid-column:3;grid-row:1}
 .bottom-tools:not(.embed-bottom-tools) #zoom-minus{grid-column:5;grid-row:1}
 .bottom-tools:not(.embed-bottom-tools) .zoom-readout{grid-column:6;grid-row:1;text-align:center}
 .bottom-tools:not(.embed-bottom-tools) #zoom-plus{grid-column:7;grid-row:1}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{grid-column:1 / 4;grid-row:2;justify-self:stretch;min-height:38px;font-size:11px}
 .bottom-tools:not(.embed-bottom-tools) .v-download-btn{grid-column:5 / 8;grid-row:2;justify-self:stretch;min-width:0;min-height:38px;font-size:11px}
 .bottom-tools:not(.embed-bottom-tools) .v-download-btn span{overflow:hidden;text-overflow:ellipsis}
 .bottom-tools:not(.embed-bottom-tools) #fit,.bottom-tools:not(.embed-bottom-tools) #fit-width,
 .bottom-tools:not(.embed-bottom-tools) #fullscreen{display:none}
 .bottom-tools .v-icon-btn{height:38px;min-width:38px}
 .bottom-tools .zoom-reset{white-space:nowrap}
}
@media(max-width:480px){
 .v-topbar{grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:10px 12px}
 .v-top-actions{width:auto}
 .v-top-actions .v-contact-link{max-width:102px;font-size:10px;padding:0 7px}
 .v-top-actions .v-textbutton span{display:none}
 .v-project b{max-width:100%;font-size:12px}
 .viewer-stage{padding-bottom:115px}
 .page-scroll{padding-bottom:120px}
 .bottom-tools:not(.embed-bottom-tools){grid-template-columns:36px minmax(58px,1fr) 36px 1px 36px minmax(30px,1fr) 36px;column-gap:3px;padding:8px}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{font-size:10px}
 .bottom-tools:not(.embed-bottom-tools) .v-download-btn{font-size:10px;padding:0 5px}
}
@media(max-width:350px){.v-top-actions .v-contact-link{max-width:76px}.v-brand{font-size:16px}}

/* Small phones: intentional brand/action rows, rather than squeezed title and links. */
@media(max-width:520px){
 .v-topbar{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;row-gap:10px;padding:12px 14px}
 .v-identity{grid-column:1;grid-row:1;width:100%;min-width:0}
 .v-project b{max-width:calc(100vw - 130px)}
 .v-top-actions{grid-column:1;grid-row:2;width:100%;justify-content:flex-end}
 .v-top-actions .v-icon-btn{display:grid;min-width:36px;height:36px;margin-right:auto}
 .v-top-actions .v-contact-link{max-width:none;min-height:36px;font-size:11px}
 .v-top-actions .v-textbutton{min-width:36px}
}
@media(max-width:375px){
 .v-top-actions .v-contact-link{max-width:156px}
}
@media(max-width:760px), (max-aspect-ratio:4/5) and (max-width:1050px){
 .bottom-tools:not(.embed-bottom-tools):not(:has(.v-download-btn)) .zoom-reset{grid-column:1 / 8}
}

/* Parent-controlled touch hit area avoids iOS iframe gesture suppression. */
.folio-mobile-touch-layer{display:none}
@media(pointer:coarse){
 .viewer-stage>.folio-mobile-touch-layer{display:block;position:absolute;inset:0;z-index:5;touch-action:none;user-select:none;-webkit-user-select:none;background:transparent}
 .viewer-stage>.bottom-tools{z-index:8}
 .viewer-stage>.epub-pan-layer{pointer-events:none!important}
}


/* vMobile: purpose-built treatment header, not a compressed desktop navbar. */
@media(max-width:760px), (max-aspect-ratio:4/5) and (max-width:1050px){
 .v-topbar{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0!important;padding:0!important;background:#1b211c;border-bottom:1px solid #344034;min-height:0!important;height:auto!important}
 .v-topbar .v-identity{display:grid!important;grid-template-columns:auto 1px minmax(0,1fr);align-items:center;column-gap:12px;width:100%;min-width:0;padding:14px 16px 11px;margin:0;flex:none}
 .v-topbar .v-brand{font-size:21px!important;letter-spacing:-1px}
 .v-topbar .v-divider{display:block!important;width:1px;height:30px;background:#425044}
 .v-topbar .v-project{display:grid!important;gap:4px;min-width:0;overflow:hidden}
 .v-topbar .v-project b{display:block;max-width:100%!important;font-size:13px!important;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}
 .v-topbar .v-project span{display:block;max-width:100%;font-size:10px!important;color:#9dac9c}
 .v-topbar .v-top-actions{display:flex!important;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;width:100%;padding:8px 16px 12px;margin:0;border-top:1px solid #ffffff0c}
 .v-topbar .v-top-actions .v-icon-btn{display:grid!important;place-items:center;flex:none;margin:0!important;width:38px;min-width:38px;height:38px;border:1px solid #425044;background:#283329;color:#e8f3e4;border-radius:9px;padding:0}
 .v-topbar .v-top-actions .v-contact-link{display:inline-flex;align-items:center;justify-content:center;flex:0 1 auto;max-width:min(52vw,210px)!important;min-width:0!important;min-height:38px!important;padding:0 13px!important;border:1px solid #48594b;border-radius:9px;background:#283329;color:#e5f0e1;font-size:11px!important;overflow:hidden;text-overflow:ellipsis}
 .v-topbar .v-top-actions .v-textbutton{margin-left:auto;display:inline-flex!important;align-items:center;justify-content:center;gap:7px;flex:none;min-width:38px;height:38px;min-height:38px;padding:0 12px;border:0;border-radius:9px;background:#cfe7ba;color:#203321}
 .v-topbar .v-top-actions .v-textbutton span{display:inline!important;font-size:11px}
 .bottom-tools .v-download-btn{display:none!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{grid-column:1 / 8!important;justify-self:stretch}
 .bottom-tools.embed-bottom-tools{display:none!important}
 .viewer-stage{padding-bottom:76px}
 .page-scroll{padding-bottom:85px}
 .bottom-tools:not(.embed-bottom-tools){grid-template-rows:42px 40px}
}
@media(max-width:390px){
 .v-topbar .v-identity{padding:12px 12px 10px;column-gap:9px}
 .v-topbar .v-top-actions{padding:8px 12px 11px;gap:6px}
 .v-topbar .v-top-actions .v-contact-link{padding:0 9px!important}
 .v-topbar .v-top-actions .v-textbutton{padding:0 10px}
}
@media(pointer:coarse){
 #viewer.folio-mobile-fullscreen{position:fixed;inset:0;z-index:99999;width:100vw;height:100dvh;background:#121714}
 #viewer.folio-mobile-fullscreen .viewer-shell{height:100dvh}
 #viewer.folio-mobile-fullscreen .v-topbar{position:absolute;inset:0 0 auto auto;z-index:20;width:auto;border:0;background:none;padding:0!important;pointer-events:none}
 #viewer.folio-mobile-fullscreen .v-topbar .v-identity{display:none!important}
 #viewer.folio-mobile-fullscreen .v-topbar .v-top-actions{border:0;background:none;width:auto;padding:max(12px,env(safe-area-inset-top)) 14px 0 0;pointer-events:none}
 #viewer.folio-mobile-fullscreen .v-topbar .v-top-actions>*:not(#fullscreen-top){display:none!important}
 #viewer.folio-mobile-fullscreen .v-topbar #fullscreen-top{display:grid!important;pointer-events:auto;background:#1f2a22e8;border:1px solid #738470;color:white;box-shadow:0 4px 24px #0009}
 #viewer.folio-mobile-fullscreen .viewer-stage{padding:0 0 66px!important}
 #viewer.folio-mobile-fullscreen .page-scroll{padding:0 8px 76px!important}
 #viewer.folio-mobile-fullscreen .bottom-tools:not(.embed-bottom-tools){bottom:max(8px,env(safe-area-inset-bottom))}
}


/* Final mobile navigation: single masthead row and a dedicated fullscreen action. */
@media(max-width:760px), (max-aspect-ratio:4/5) and (max-width:1050px){
 .v-topbar{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;height:62px!important;min-height:62px!important;padding:0 12px!important}
 .v-topbar .v-identity{display:flex!important;align-items:center!important;flex:1 1 0!important;width:auto!important;min-width:0!important;gap:8px!important;padding:0!important;margin:0!important}
 .v-topbar .v-brand{font-size:18px!important;flex:none}
 .v-topbar .v-divider{height:24px!important;flex:none}
 .v-topbar .v-project{flex:1 1 auto;min-width:0!important}
 .v-topbar .v-project b{font-size:11px!important;max-width:100%!important}
 .v-topbar .v-project span{font-size:9px!important;max-width:100%!important}
 .v-topbar .v-top-actions{display:flex!important;flex:none!important;flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;width:auto!important;gap:5px!important;margin:0!important;padding:0!important;border:0!important}
 .v-topbar #fullscreen-top{display:none!important}
 .v-topbar .v-top-actions .v-reel-link{display:inline-flex!important;align-items:center;gap:4px;max-width:none!important;white-space:nowrap;flex:none;padding:0 9px!important;height:36px;min-height:36px!important;font-size:10px!important}
 .v-topbar .v-top-actions .v-reel-link svg{display:block;flex:none;width:13px;height:13px}
 .v-topbar .v-top-actions #share-button{display:grid!important;place-items:center!important;flex:none!important;margin:0!important;padding:0!important;width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important}
 .v-topbar .v-top-actions #share-button span{display:none!important}
 .v-topbar .v-top-actions .v-contact-link:not(.v-reel-link){display:none!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{grid-column:1 / 6!important;justify-self:stretch}
 .bottom-tools:not(.embed-bottom-tools) #fullscreen{display:grid!important;grid-column:6 / 8;grid-row:2;justify-self:stretch;width:100%;height:38px;background:#354535;border:1px solid #5b785a;color:#e8f5df}
 .bottom-tools:not(.embed-bottom-tools) #fullscreen svg{margin:auto}
 .viewer-stage{padding-bottom:78px}
 .page-scroll{padding-bottom:89px}
 /* A fit is quiet/dark; zoomed or width-mode pages display the action brightly. */
 .bottom-tools .zoom-reset:not(.is-active){background:#d0e8af!important;color:#233327!important;border-color:#d0e8af!important}
 .bottom-tools .zoom-reset.is-active{background:#354535!important;color:#e8f5df!important;border-color:#5b785a!important}
}
@media(max-width:390px){
 .v-topbar{padding:0 10px!important;gap:6px!important}
 .v-topbar .v-brand{font-size:16px!important}
 .v-topbar .v-identity{gap:6px!important}
 .v-topbar .v-top-actions .v-reel-link{font-size:9px!important;padding:0 7px!important}
}
@media(pointer:coarse){
 #viewer.folio-mobile-fullscreen .v-topbar{display:none!important}
 #viewer.folio-mobile-fullscreen .bottom-tools:not(.embed-bottom-tools) #fullscreen{display:grid!important}
}

/* Shared Copy Link feedback: brief pulse and check confirmation. */
@keyframes folio-copy-pop{0%{transform:scale(1)}35%{transform:scale(1.13)}65%{transform:scale(.96)}100%{transform:scale(1)}}
#share-button,#reel-copy{position:relative;transition:background .2s,color .2s,border-color .2s}
#share-button.is-copied,#reel-copy.is-copied{animation:folio-copy-pop .33s ease-out;background:#d8f1c4!important;color:#193721!important;border-color:#a2d88f!important}
#share-button.is-copied::after,#reel-copy.is-copied::after{content:"✓";position:absolute;right:-5px;top:-6px;display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:#528552;color:white;font-size:11px;font-weight:800;box-shadow:0 2px 8px #0005}
@media(prefers-reduced-motion:reduce){#share-button.is-copied,#reel-copy.is-copied{animation:none}}


/* Compact, vertically centered page selector with a clearly editable field. */
.bottom-tools .page-counter{
 display:inline-flex;align-items:center;justify-content:center;gap:7px;
 height:36px;min-width:94px;padding:0 7px;
 white-space:nowrap;line-height:1;font-variant-numeric:tabular-nums;
 color:#aebead;vertical-align:middle;
}
.bottom-tools .page-counter .page-jump{
 box-sizing:border-box;display:block;flex:none;
 width:39px;height:30px;margin:0;padding:0 4px;
 border:1px solid #586d57;border-radius:8px;
 background:#263329;color:#f2faeb;
 text-align:center;font:600 12px/30px inherit;
 font-family:inherit;font-size:12px;font-weight:600;line-height:normal;
 font-variant-numeric:tabular-nums;
 box-shadow:inset 0 1px 2px #0002;
 outline:0;transition:border-color .18s,background .18s,box-shadow .18s;
}
.bottom-tools .page-counter .page-jump:hover{border-color:#93ac85;background:#2e3c30}
.bottom-tools .page-counter .page-jump:focus{
 border-color:#cae8b5;background:#344634;
 box-shadow:0 0 0 2px #c7e5b52f;
}
.bottom-tools .page-counter strong{font-size:12px;font-weight:500;color:#c9d9c5}
@media(max-width:760px), (max-aspect-ratio:4/5) and (max-width:1050px){
 .bottom-tools:not(.embed-bottom-tools) .page-counter{
  width:100%;min-width:0;height:38px;padding:0 2px;gap:5px;
 }
 .bottom-tools:not(.embed-bottom-tools) .page-counter .page-jump{
  width:clamp(30px,9vw,38px);height:30px;font-size:12px;
 }
 .bottom-tools:not(.embed-bottom-tools) .page-counter strong{font-size:11px}
}

/* Phones rotated to landscape: compact left identity rail + right controls. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:620px){
 .viewer-shell{display:grid!important;grid-template-columns:104px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;height:100dvh!important;overflow:hidden}
 .v-topbar{grid-column:1;grid-row:1;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;align-items:stretch!important;width:104px!important;height:100dvh!important;min-height:0!important;padding:max(12px,env(safe-area-inset-top)) 7px 10px!important;gap:16px!important;border-right:1px solid #344034;border-bottom:0!important}
 .v-topbar .v-identity{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:7px!important;width:100%!important;padding:0!important;min-width:0}
 .v-topbar .v-brand{font-size:17px!important}
 .v-topbar .v-divider{display:none!important}
 .v-topbar .v-project{width:100%!important;min-width:0}
 .v-topbar .v-project b{font-size:10px!important;white-space:normal!important;overflow:hidden;max-height:44px;line-height:1.3}
 .v-topbar .v-project span{font-size:9px!important;white-space:normal!important;max-height:34px;overflow:hidden}
 .v-topbar .v-top-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:7px!important;width:100%!important;padding:0!important;margin:0!important}
 .v-topbar .v-top-actions .v-reel-link{height:33px!important;min-height:33px!important;padding:0 5px!important;font-size:9px!important;justify-content:center}
 .v-topbar .v-top-actions #share-button{height:34px!important;width:100%!important;min-width:0!important}
 .viewer-stage{grid-column:2;grid-row:1;position:relative;min-height:0!important;height:100dvh!important;padding:0 69px 0 4px!important;overflow:hidden}
 .page-scroll{height:100%!important;min-height:0!important;padding:4px!important}
 .bottom-tools:not(.embed-bottom-tools){position:absolute!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:6px!important;top:5px!important;bottom:5px!important;right:max(5px,env(safe-area-inset-right))!important;left:auto!important;transform:none!important;width:58px!important;max-height:none!important;min-height:0!important;padding:7px 4px!important;border-radius:12px!important;overflow-y:auto!important}
 .bottom-tools:not(.embed-bottom-tools) #prev,.bottom-tools:not(.embed-bottom-tools) #next,.bottom-tools:not(.embed-bottom-tools) #zoom-minus,.bottom-tools:not(.embed-bottom-tools) #zoom-plus,.bottom-tools:not(.embed-bottom-tools) #fullscreen{display:grid!important;width:36px!important;min-width:36px!important;height:34px!important;min-height:32px!important;flex:none}
 .bottom-tools:not(.embed-bottom-tools) .page-counter{display:flex!important;flex-direction:column!important;gap:3px!important;width:48px!important;height:auto!important;padding:3px!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter .page-jump{height:29px!important;width:39px!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter strong{font-size:10px}
 .bottom-tools:not(.embed-bottom-tools) .zoom-readout{font-size:10px!important;min-height:12px;line-height:1}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{width:48px!important;min-height:38px!important;font-size:9px!important;white-space:normal!important;padding:4px!important;line-height:1.15}
 .bottom-tools:not(.embed-bottom-tools) .tool-divider,.bottom-tools:not(.embed-bottom-tools) #fit,.bottom-tools:not(.embed-bottom-tools) #fit-width,.bottom-tools:not(.embed-bottom-tools) .v-download-btn{display:none!important}
 .bottom-tools:not(.embed-bottom-tools) #fullscreen{justify-self:auto!important}
 .footer-trust,.view-note{display:none!important}
 #viewer.folio-mobile-fullscreen .viewer-shell{display:block!important}
 #viewer.folio-mobile-fullscreen .viewer-stage{width:100vw!important;padding:0 65px 0 0!important}
}


/* Access-gated treatments: compact, keyboard-safe mobile layout. */
@media(max-width:760px), (max-aspect-ratio:4/5) and (max-width:1050px){
 .access-screen{box-sizing:border-box;display:flex;align-items:safe center;justify-content:center;min-height:100dvh;height:auto;max-height:none;overflow-y:auto;overscroll-behavior:contain;padding:max(16px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));}
 .access-card{box-sizing:border-box;width:min(440px,100%);min-width:0;max-height:none;margin:auto;padding:clamp(20px,5vw,28px);gap:12px;border-radius:16px;box-shadow:0 16px 56px #0007;}
 .access-card h1{font-size:clamp(23px,6vw,29px);line-height:1.17;overflow-wrap:anywhere;margin:0;}
 .access-card p{font-size:12px;line-height:1.45;overflow-wrap:anywhere;}
 .access-card input{box-sizing:border-box;width:100%;min-height:46px;font-size:16px;border-radius:9px;}
 .access-card button{min-height:46px;font-size:14px;}
}
@media (orientation:landscape) and (pointer:coarse) and (max-height:620px){
 .access-screen{min-height:100dvh;display:block;padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overflow-y:auto;}
 .access-card{width:min(720px,100%);margin:0 auto;padding:13px 20px;gap:7px;border-radius:12px;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;}
 .access-card .access-brand,.access-card .access-eyebrow,.access-card h1,.access-card>p,.access-card #access-error{grid-column:1 / -1;}
 .access-card .access-brand{font-size:17px;}
 .access-card .access-eyebrow{font-size:9px;}
 .access-card h1{font-size:19px;}
 .access-card>p{font-size:11px;}
 .access-card label{font-size:11px;min-width:0;}
 .access-card input{min-height:37px;padding:8px 10px;}
 .access-card button{grid-column:1 / -1;min-height:39px;padding:8px;}
}


/* Landscape v2: floating identity chip and genuinely reserved right toolbar space. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:620px){
 .viewer-shell{position:relative!important;display:block!important;width:100vw!important;height:100dvh!important;overflow:hidden!important}
 .v-topbar{position:absolute!important;z-index:12!important;top:max(8px,env(safe-area-inset-top))!important;left:max(8px,env(safe-area-inset-left))!important;right:auto!important;bottom:auto!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:7px!important;width:auto!important;max-width:min(43vw,260px)!important;height:auto!important;min-height:0!important;padding:6px 8px!important;border:1px solid #566d54!important;border-radius:11px!important;background:#1d2b22eb!important;box-shadow:0 5px 18px #0007!important;backdrop-filter:blur(10px)}
 .v-topbar .v-identity{display:flex!important;flex-direction:row!important;align-items:center!important;gap:7px!important;width:auto!important;min-width:0!important;padding:0!important}
 .v-topbar .v-brand{font-size:14px!important;flex:none!important}
 .v-topbar .v-divider{display:block!important;height:20px!important;width:1px!important}
 .v-topbar .v-project{min-width:0!important;max-width:110px!important}
 .v-topbar .v-project b{font-size:10px!important;line-height:1.15!important;max-height:27px!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important}
 .v-topbar .v-project span{display:none!important}
 .v-topbar .v-top-actions{display:flex!important;flex-direction:row!important;gap:4px!important;align-items:center!important;width:auto!important;margin:0!important;padding:0!important}
 .v-topbar .v-top-actions .v-reel-link{display:none!important}
 .v-topbar .v-top-actions #share-button{width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;padding:0!important}
 .viewer-stage{display:block!important;position:relative!important;width:100%!important;height:100dvh!important;min-height:0!important;margin:0!important;box-sizing:border-box!important;padding:0!important;overflow:hidden!important}
 /* Reserve the width at layout level: the iframe can never sit under the rail. */
 #page-viewport.page-scroll{position:absolute!important;inset:0 calc(66px + env(safe-area-inset-right)) 0 0!important;box-sizing:border-box!important;width:auto!important;height:100%!important;min-height:0!important;max-width:none!important;margin:0!important;padding:6px 6px!important;overflow:auto!important}
 .bottom-tools:not(.embed-bottom-tools){position:absolute!important;z-index:15!important;top:6px!important;bottom:6px!important;right:max(6px,env(safe-area-inset-right))!important;left:auto!important;width:54px!important;height:auto!important;min-height:0!important;max-height:none!important;transform:none!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:4px!important;padding:6px 3px!important;overflow-y:auto!important;border-radius:12px!important}
 .bottom-tools:not(.embed-bottom-tools) #prev,.bottom-tools:not(.embed-bottom-tools) #next,.bottom-tools:not(.embed-bottom-tools) #zoom-minus,.bottom-tools:not(.embed-bottom-tools) #zoom-plus,.bottom-tools:not(.embed-bottom-tools) #fullscreen{display:grid!important;flex:none!important;width:37px!important;min-width:37px!important;height:32px!important;min-height:32px!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter{display:flex!important;flex-direction:column!important;align-items:center!important;gap:2px!important;width:44px!important;height:auto!important;padding:1px!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter .page-jump{width:37px!important;height:29px!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-readout{min-height:12px!important;font-size:9px!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{width:44px!important;min-height:34px!important;max-width:44px!important;font-size:9px!important;padding:3px!important;white-space:normal!important;line-height:1.15!important}
 .bottom-tools:not(.embed-bottom-tools) .tool-divider,.bottom-tools:not(.embed-bottom-tools) #fit,.bottom-tools:not(.embed-bottom-tools) #fit-width,.bottom-tools:not(.embed-bottom-tools) .v-download-btn{display:none!important}
 #viewer.folio-mobile-fullscreen .viewer-stage{width:100%!important;padding:0!important}
 #viewer.folio-mobile-fullscreen #page-viewport.page-scroll{inset:0 calc(66px + env(safe-area-inset-right)) 0 0!important}
 #viewer.folio-mobile-fullscreen .v-topbar{display:none!important}
}


/* Tidy the landscape tool rail and surface the linked reel in the floating chip. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:620px){
 .v-topbar{max-width:min(57vw,350px)!important}
 .v-topbar .v-project{max-width:105px!important}
 .v-topbar .v-top-actions{gap:5px!important}
 .v-topbar .v-top-actions .v-reel-link{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;white-space:nowrap!important;flex:none!important;width:auto!important;height:28px!important;min-height:28px!important;padding:0 7px!important;font-size:10px!important;border-radius:7px!important}
 .v-topbar .v-top-actions .v-reel-link svg{width:12px!important;height:12px!important;flex:none}
 .bottom-tools:not(.embed-bottom-tools){align-items:center!important;justify-content:space-evenly!important;gap:2px!important;padding:7px 3px!important;border-radius:13px!important}
 .bottom-tools:not(.embed-bottom-tools) #prev,.bottom-tools:not(.embed-bottom-tools) #next,.bottom-tools:not(.embed-bottom-tools) #zoom-minus,.bottom-tools:not(.embed-bottom-tools) #zoom-plus,.bottom-tools:not(.embed-bottom-tools) #fullscreen{display:grid!important;place-items:center!important;justify-self:center!important;flex:0 0 30px!important;width:38px!important;min-width:38px!important;height:30px!important;min-height:30px!important;margin:0!important;padding:0!important;border-radius:8px!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;flex:none!important;width:44px!important;height:auto!important;min-height:43px!important;margin:0!important;padding:0!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter .page-jump{box-sizing:border-box!important;display:block!important;width:37px!important;height:27px!important;min-height:27px!important;margin:0!important;padding:0!important;text-align:center!important;line-height:normal!important}
 .bottom-tools:not(.embed-bottom-tools) .page-counter strong{font-size:10px!important;line-height:1!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-readout{display:block!important;flex:none!important;min-width:0!important;min-height:10px!important;font-size:9px!important;line-height:1!important;margin:0!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-reset{display:grid!important;place-items:center!important;justify-self:center!important;flex:0 0 36px!important;width:44px!important;max-width:44px!important;height:36px!important;min-height:36px!important;margin:0!important;padding:2px 3px!important;font-size:9px!important;line-height:1.1!important;border-radius:8px!important;text-align:center!important}
 .bottom-tools:not(.embed-bottom-tools) .tool-divider{display:block!important;width:29px!important;height:1px!important;min-height:1px!important;flex:0 0 1px!important;margin:0!important;background:#6b816a88!important}
}
@media (orientation:landscape) and (pointer:coarse) and (max-height:380px){
 .bottom-tools:not(.embed-bottom-tools){gap:1px!important;padding:4px 2px!important}
 .bottom-tools:not(.embed-bottom-tools) .zoom-readout,.bottom-tools:not(.embed-bottom-tools) .tool-divider{display:none!important}
}

/* True landscape presentation mode: fewer controls, more artboard space. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:620px){
 #viewer.folio-mobile-fullscreen{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;z-index:99999!important}
 #viewer.folio-mobile-fullscreen .viewer-shell{display:block!important;width:100vw!important;height:100dvh!important}
 #viewer.folio-mobile-fullscreen .viewer-stage{position:relative!important;width:100vw!important;height:100dvh!important;padding:0!important;margin:0!important}
 #viewer.folio-mobile-fullscreen #page-viewport.page-scroll{
  position:absolute!important;inset:0 calc(43px + env(safe-area-inset-right)) 0 0!important;
  width:auto!important;height:100%!important;padding:2px!important;max-width:none!important;
 }
 #viewer.folio-mobile-fullscreen .bottom-tools:not(.embed-bottom-tools){
  top:6px!important;bottom:auto!important;right:max(4px,env(safe-area-inset-right))!important;
  width:35px!important;height:42px!important;min-height:42px!important;
  padding:3px!important;overflow:visible!important;display:flex!important;
  align-items:center!important;justify-content:center!important;border-radius:9px!important;
 }
 #viewer.folio-mobile-fullscreen .bottom-tools:not(.embed-bottom-tools)>*:not(#fullscreen){display:none!important}
 #viewer.folio-mobile-fullscreen .bottom-tools:not(.embed-bottom-tools) #fullscreen{
  display:grid!important;place-items:center!important;width:30px!important;min-width:30px!important;
  height:34px!important;min-height:34px!important;padding:0!important;margin:0!important;
 }
}


/* Desktop parity with mobile: Fit to Frame is highlighted only when needed. */
@media (min-width:761px) and (pointer:fine){
 .bottom-tools .zoom-reset:not(.is-active){
  background:#d0e8af!important;color:#233327!important;border-color:#d0e8af!important;
 }
 .bottom-tools .zoom-reset.is-active{
  background:#354535!important;color:#e8f5df!important;border-color:#5b785a!important;
 }
}


/* Native hit targets for mobile hyperlinks, above the gesture-capturing pane. */
@media(pointer:coarse){
 .folio-mobile-touch-layer .folio-native-links{position:absolute;inset:0;pointer-events:none;}
 .folio-mobile-touch-layer .folio-native-link{
  position:absolute;display:block;pointer-events:auto;z-index:2;
  background:transparent;text-decoration:none;-webkit-tap-highlight-color:transparent;
  touch-action:none;user-select:none;-webkit-user-select:none;
 }
}


/* Lightweight floating chapter navigation; closed by default so artwork remains unobstructed. */
.folio-toc[hidden],.folio-toc-panel[hidden]{display:none!important}
.folio-toc{position:absolute;top:20px;right:22px;z-index:17;max-width:calc(100% - 36px);font-family:inherit}
.folio-toc-toggle{display:flex;gap:10px;align-items:center;justify-content:space-between;min-height:36px;padding:8px 13px;background:#1c2b21f0;border:1px solid #647b60;border-radius:10px;color:#e4f1db;font-size:12px;font-weight:650;box-shadow:0 8px 30px #0007;backdrop-filter:blur(14px)}
.folio-toc-toggle:hover{border-color:#d0e7b0;background:#2c402d}
.folio-toc-panel{position:absolute;right:0;top:44px;width:min(300px,calc(100vw - 40px));max-height:min(64dvh,520px);overflow:hidden;display:flex;flex-direction:column;border:1px solid #5c745b;border-radius:13px;background:#17261df7;box-shadow:0 22px 65px #000b;backdrop-filter:blur(16px)}
.folio-toc-heading{display:flex;align-items:center;justify-content:space-between;padding:17px 16px 12px;color:#c0d6b7;letter-spacing:.13em;font-size:10px;font-weight:700;border-bottom:1px solid #364a37}
.folio-toc-heading button{border:0;color:#cddfca;background:transparent;font-size:21px;line-height:1;padding:0 4px}
.folio-toc-items{padding:9px;overflow:auto;overscroll-behavior:contain}
.folio-toc-items button{width:100%;display:flex;align-items:start;gap:12px;text-align:left;padding:12px 13px;margin:2px 0;background:transparent;color:#c3d3c2;border:0;border-radius:9px;font-size:13px;line-height:1.35}
.folio-toc-items button:hover{background:#2c4330;color:#f3f9ed}
.folio-toc-items button.active{background:#d0e7b0;color:#1c3021;font-weight:700}
.folio-toc-page{min-width:22px;font-size:11px;opacity:.75}.folio-toc-title{flex:1}
@media(max-width:760px),(pointer:coarse){
 .folio-toc{top:10px;right:max(10px,env(safe-area-inset-right));z-index:19}
 .folio-toc-toggle{padding:8px 11px;min-height:34px;font-size:11px}
 .folio-toc-panel{max-height:54dvh}
}
@media (orientation:landscape) and (pointer:coarse) and (max-height:620px){
 .folio-toc{top:5px;right:calc(72px + env(safe-area-inset-right))}
 .folio-toc-panel{max-height:78dvh}
}


/* Mobile links must live ABOVE the full-size gesture layer, not inside it.
   Parent holder is click-through except for actual authored link rectangles. */
@media(pointer:coarse){
 .viewer-stage>.folio-native-links{
  position:absolute;inset:0;z-index:8;pointer-events:none;
 }
 .viewer-stage>.folio-native-links>.folio-native-link{
  position:absolute;display:block;z-index:1;pointer-events:auto;
  background:transparent;text-decoration:none;touch-action:none;
  -webkit-tap-highlight-color:transparent;
 }
}


/* Safari needs an ordinary anchor tap for target=_blank. Touch handling
   still lives on the parent stage for zoom/pan, not the link itself. */
@media(pointer:coarse){
 .viewer-stage>.folio-native-links>.folio-native-link{
  touch-action:manipulation!important;
  -webkit-user-select:none;
 }
}


/* Owner-only, in-viewer manual table of contents editing. */
.folio-toc-owner-controls{display:flex;flex-direction:column;gap:7px;padding:9px 9px 14px;border-bottom:1px solid #3c5542;margin-bottom:8px}
.folio-toc-owner-controls label{display:flex;gap:9px;align-items:center;font-size:12px;color:#d8e9d0}
.folio-toc-owner-controls input{accent-color:#d0e7b0;width:16px;height:16px}
.folio-toc-owner-controls button,.folio-toc-add{border:1px solid #668066;border-radius:8px;background:#304635;color:#eff7e8;font-size:12px;padding:9px!important;text-align:center!important;display:block;width:100%;cursor:pointer}
.folio-toc-add{border-style:dashed!important;margin-bottom:8px!important}
.folio-toc-row{display:flex;gap:3px;align-items:stretch;padding:2px 0}
.folio-toc-row>.folio-toc-jump{flex:1;min-width:0;overflow-wrap:anywhere}
.folio-toc-row>button:not(.folio-toc-jump){width:26px;flex:0 0 26px;padding:6px 2px;border:0;border-radius:6px;color:#dbe8d8;background:#314535;cursor:pointer}
.folio-toc-row>button:disabled{opacity:.3;cursor:default}
.folio-toc-empty{font-size:12px;color:#aebfac;padding:8px 10px}


/* Minimal inline owner TOC editor: page number, section name, delete. */
.folio-toc-simple-toggle{display:flex;align-items:center;gap:10px;padding:9px 9px 5px;color:#e0eadb;font-size:12px;font-weight:600}
.folio-toc-simple-toggle input{accent-color:#d0e7b0;width:16px;height:16px;margin:0}
.folio-toc-hint{padding:4px 9px 11px;color:#9bb49c;font-size:11px;line-height:1.45;margin:0}
.folio-toc-edit-row{display:grid;grid-template-columns:47px minmax(0,1fr) 24px;align-items:center;gap:7px;padding:4px 5px;border-radius:8px}
.folio-toc-edit-row:focus-within{background:#2a3e2e}
.folio-toc-edit-row.is-draft{grid-template-columns:47px minmax(0,1fr);border:1px dashed #5b785e;margin-top:7px}
.folio-toc-edit-row input{box-sizing:border-box;width:100%;min-width:0;border:1px solid transparent;border-radius:6px;padding:9px 7px;background:transparent;color:#ecf5e7;font:inherit;font-size:12px;outline:none}
.folio-toc-edit-row input:focus{border-color:#718b70;background:#17291d}
.folio-toc-edit-row input::placeholder{color:#87a18a}
.folio-toc-edit-row input[type=number]{text-align:center;appearance:textfield;-moz-appearance:textfield}
.folio-toc-edit-row input::-webkit-outer-spin-button,.folio-toc-edit-row input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.folio-toc-delete{width:24px;height:27px;border:none;border-radius:5px;background:transparent;color:#8aa08b;font-size:19px;line-height:1;cursor:pointer;padding:0}
.folio-toc-delete:hover{background:#3c4c3b;color:#f4f9ee}
.folio-toc-save-error{font-size:11px;color:#f4b9a6;padding:0 9px}


/* Mobile hit-test priority: links above navigation, gesture scrim and pan layer.
   The link container is transparent to events except its real rectangles. */
@media (pointer:coarse){
 .viewer-stage>.folio-mobile-touch-layer{z-index:5!important}
 .viewer-stage>.epub-pan-layer{z-index:4!important}
 .viewer-stage>.folio-native-links{
  position:absolute!important;inset:0!important;z-index:30!important;
  pointer-events:none!important;isolation:isolate;
 }
 .viewer-stage>.folio-native-links>.folio-native-link{
  pointer-events:auto!important;position:absolute!important;z-index:1!important;
  touch-action:manipulation!important;
 }
 .viewer-stage>.folio-toc{z-index:35}
}


/* Clean owner chapter manager with separate reading and editing modes. */
.folio-toc-panel{width:min(340px,calc(100vw - 32px));border-radius:15px;border-color:#506950;background:#18271ff7}
.folio-toc-items{padding:12px;scrollbar-width:thin}
.folio-toc-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:3px;margin-bottom:12px;background:#101e16;border:1px solid #314736;border-radius:10px}
.folio-toc-mode-switch button{display:block!important;width:auto!important;min-width:0;text-align:center!important;justify-content:center;align-items:center;margin:0!important;padding:9px 5px!important;border:0!important;border-radius:7px;color:#a7baa7;background:transparent;font-size:11px!important;font-weight:600;white-space:nowrap}
.folio-toc-mode-switch button.selected{color:#eef7e8;background:#344b37;box-shadow:0 1px 5px #0005}
.folio-toc-editor-rows{display:flex;flex-direction:column;gap:4px}
.folio-toc-edit-row{grid-template-columns:49px minmax(0,1fr) 25px;gap:5px;padding:4px 3px;border:1px solid transparent;border-radius:9px;transition:background .14s,border-color .14s}
.folio-toc-edit-row:focus-within{border-color:#45664c;background:#26392b}
.folio-toc-edit-row.is-draft{grid-template-columns:49px minmax(0,1fr);border:1px dashed #526e58;background:#1c2d22;margin-top:8px}
.folio-toc-edit-row input{font-size:12px;padding:9px 6px;border-radius:5px}
.folio-toc-edit-row input[type=number]{color:#b7cdb7;border-right:1px solid #3b5340;border-radius:0}
.folio-toc-edit-row input[type=text]{font-size:13px;font-weight:500}
.folio-toc-edit-row input:focus{background:#304635}
.folio-toc-delete{font-size:17px!important;padding:0!important;width:24px!important;min-width:24px;justify-content:center!important;align-items:center!important}
.folio-toc-hint{padding:0 4px 10px;line-height:1.5;font-size:11px}
.folio-toc-simple-toggle{padding:5px 4px 12px;justify-content:space-between;flex-direction:row-reverse;border-bottom:1px solid #364c3a;margin-bottom:12px}
.folio-toc-save-error{min-height:20px;padding:9px 4px 0;text-align:right;font-size:10px;color:#9bb49c}
.folio-toc-empty{line-height:1.6;padding:12px 8px 18px}

/* Keep the fitted treatment locked to its viewport across responsive layouts.
   Landscape touch layouts set overflow:auto!important above; this state-specific
   override must win without disabling normal scrolling for zoomed pages. */
#page-viewport.page-scroll.folio-no-empty-scroll,
#viewer #page-viewport.page-scroll.folio-no-empty-scroll,
#viewer.folio-mobile-fullscreen #page-viewport.page-scroll.folio-no-empty-scroll{
 overflow:hidden!important;
 overscroll-behavior:none!important;
}

/* Chapter manager: only the saved chapter list scrolls. The entry form,
   visibility toggle and mode switch stay anchored at the panel top. */
.folio-toc-items{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.folio-toc-heading{flex:none}
.folio-toc-mode-switch,.folio-toc-editor-top{flex:none}
.folio-toc-editor-top{border-bottom:1px solid #364c3a;padding-bottom:8px}
.folio-toc-editor-rows,.folio-toc-view-list{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.folio-toc-editor-rows{padding-top:8px}
.folio-toc-draft-area .folio-toc-edit-row.is-draft{margin-top:0}
.folio-toc-view-list{padding-bottom:6px}

/* Home navigation on the treatment viewer brand. */
a.v-brand{display:inline-flex;align-items:center;text-decoration:none;cursor:pointer}
a.v-brand:hover{opacity:.85}
a.v-brand:focus-visible{outline:2px solid #d1eab0;outline-offset:5px;border-radius:3px}
