body.rwbook-image-open{overflow:hidden!important}
.rwbook-image-viewer[open]{position:fixed!important;inset:0!important;margin:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;max-width:none!important;max-height:none!important;border:0!important;border-radius:0!important;padding:0!important;background:#090a0c!important;color:#fff;display:grid!important;place-items:center;overflow:hidden;touch-action:none;overscroll-behavior:contain}
.rwbook-image-viewer::backdrop{background:#090a0c}
.rwbook-image-viewer:not([open]){display:none!important}
.rwbook-image-viewer>img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;transform-origin:center;user-select:none;pointer-events:none}
.rwbook-image-viewer .rwbook-image-close{position:absolute;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));height:40px;width:40px;padding:0;border:1px solid #ffffff44;border-radius:50%;background:#111b;color:#fff;font:28px/1 system-ui;cursor:pointer;z-index:2}
.rwbook-image-viewer[open]{grid-template: minmax(0,1fr) / minmax(0,1fr)}
.rwbook-image-viewer>img{min-width:0;min-height:0;max-width:100vw!important;max-height:100vh!important;max-height:100dvh!important}

/* Minimal shared overlay; unobtrusive 18px glyph with a 44px touch target. */
#chapter-text img[data-rw-reader-image],#chapter-text .rwbook-illustration{cursor:zoom-in}
html:has(body.rwbook-image-open){scrollbar-gutter:stable}
.rwbook-image-viewer .rwbook-image-close{width:44px;height:44px;border:0!important;background:transparent!important;box-shadow:none!important;font:22px/1 system-ui;opacity:.62;text-shadow:0 1px 4px #000,0 0 2px #000;transition:opacity .15s;outline-offset:-4px}
.rwbook-image-viewer .rwbook-image-close:is(:hover,:focus-visible){opacity:1;background:#0004!important}
.rwbook-image-viewer .rwbook-image-error{position:absolute;left:12px;right:12px;top:50%;text-align:center;font:14px system-ui;color:#fff;pointer-events:none}
.rwbook-image-viewer .rwbook-image-error[hidden]{display:none!important}
