/* Layout only: the active WordPress theme owns the interface palette and typography. */
.jem-reader-shell{box-sizing:border-box;width:min(100%,var(--wp--style--global--wide-size,1100px));margin:clamp(1rem,3vw,2rem) auto;padding:12px 20px;color:inherit;font-family:inherit;background:transparent}
.jem-reader-shell .jem-reader-heading{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-bottom:1rem}
.jem-reader-shell .jem-reader-heading>a{font-size:.85em;flex-shrink:0}
.jem-reader-shell .jem-reader-heading h1{font-size:clamp(1.15em,2.5vw,1.8em);line-height:1.3;margin:0;overflow-wrap:anywhere}
.jem-reader-shell .jem-preview-banner{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 10px;font-size:.9em}
.jem-reader-shell .jem-buy{font-weight:600}
.jem-reader-shell .jem-reader-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 0}
.jem-reader-shell button,.jem-reader-shell select{font:inherit;min-height:44px;max-width:100%}
.jem-reader-shell button{cursor:pointer;white-space:nowrap}
.jem-reader-shell button:disabled{opacity:.5;cursor:wait}
.jem-reader-shell button:focus-visible,.jem-reader-shell select:focus-visible,.jem-reader-shell a:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.jem-reader-shell label{font-size:.9em;display:flex;gap:6px;align-items:center}
.jem-reader-shell #toc{max-width:260px}
.jem-reader-shell #status{font-size:.8em;line-height:1.4;min-height:1em;margin:3px 0 9px}
.jem-reader-shell #pages{height:max(400px,68vh);height:max(400px,68dvh);border:1px solid currentColor;border-radius:6px;overflow:hidden;background:transparent}
.jem-reader-shell .jem-pdf{display:block;width:100%;height:78vh;border:0}
@media(max-width:650px){.jem-reader-shell{padding:10px 12px}.jem-reader-shell .jem-reader-heading{gap:12px;align-items:flex-start}.jem-reader-shell .jem-reader-controls{gap:8px}.jem-reader-shell #toc{max-width:200px}.jem-reader-shell #pages{height:max(360px,64dvh)}}
@media(max-width:380px){.jem-reader-shell #toc{max-width:170px}.jem-reader-shell .jem-preview-banner{flex-wrap:wrap}.jem-reader-shell label{gap:4px}}
.jem-reader-shell .jem-appearance{display:flex;justify-content:flex-end;margin:8px 0}
.jem-reader-shell[data-color-mode="dark"]{color-scheme:dark;background:#171b20;color:#e7e9ec;border-radius:8px}
.jem-reader-shell[data-color-mode="dark"] a{color:#a8d7ff}
.jem-reader-shell[data-color-mode="dark"] button,.jem-reader-shell[data-color-mode="dark"] select{background:#2a323d;color:#f3f5f7;border:1px solid #778495}
.jem-reader-shell[data-color-mode="dark"] .jem-reader-heading h1,.jem-reader-shell[data-color-mode="dark"] label,.jem-reader-shell[data-color-mode="dark"] #status{color:inherit}
.jem-reader-shell[data-color-mode="light"]{color-scheme:light;background:#fff;color:#1b2026;border-radius:8px}
.jem-reader-shell[data-color-mode="light"] a{color:#17538a}
.jem-reader-shell[data-color-mode="light"] button,.jem-reader-shell[data-color-mode="light"] select{background:#f3f5f7;color:#1b2026;border:1px solid #778495}
.jem-reader-shell[data-color-mode="light"] .jem-reader-heading h1,.jem-reader-shell[data-color-mode="light"] label,.jem-reader-shell[data-color-mode="light"] #status{color:inherit}
/* Keep controls inside narrow theme containers and use a stable mobile viewport. */
.jem-reader-shell{min-width:0;max-width:100%}
.jem-reader-shell .jem-reader-heading>*{min-width:0;max-width:100%}
.jem-reader-shell .jem-reader-controls{display:grid;grid-template-columns:max-content max-content minmax(0,1fr) minmax(0,1.4fr)}
.jem-reader-shell .jem-reader-controls label{min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr)}
.jem-reader-shell .jem-reader-controls select{width:100%;min-width:0;box-sizing:border-box}
.jem-reader-shell .jem-reader-controls button{font-size:1rem;padding:.5em .8em;min-height:44px;box-sizing:border-box}
.jem-reader-shell .jem-appearance{gap:12px;flex-wrap:wrap}
.jem-reader-shell .jem-appearance label{min-width:0;max-width:100%}
.jem-reader-shell .jem-appearance select{min-width:0;max-width:100%;font-size:1rem}
.jem-reader-shell #pages{box-sizing:border-box;min-width:0;width:100%;height:68vh;height:68svh;min-height:320px;max-height:900px}
.jem-reader-shell #pages iframe{border:0!important;max-width:none!important}
@media(max-width:700px){.jem-reader-shell .jem-reader-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.jem-reader-shell .jem-reader-controls label{grid-template-columns:minmax(0,1fr);gap:4px}.jem-reader-shell #toc{width:100%;max-width:100%}.jem-reader-shell .jem-appearance{justify-content:flex-start}.jem-reader-shell #pages{height:64vh;height:64svh;min-height:300px}.jem-reader-shell .jem-preview-banner{flex-wrap:wrap}}
.jem-reader-shell[data-reading-flow="scroll"] #pages .epub-container{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y pinch-zoom}

/* Fullscreen keeps navigation and the exit button above the book. */
#reader.jem-is-fullscreen{position:fixed!important;inset:0!important;z-index:2147483647!important;box-sizing:border-box!important;width:100%!important;max-width:none!important;height:100vh!important;height:100dvh!important;margin:0!important;border-radius:0!important;padding:12px max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));display:flex;flex-direction:column;overflow:auto;background:var(--wp--preset--color--base,#fff);color:var(--wp--preset--color--contrast,#1b2026)}
#reader.jem-is-fullscreen[data-color-mode="dark"]{background:#171b20;color:#e7e9ec}
#reader.jem-is-fullscreen[data-color-mode="light"]{background:#fff;color:#1b2026}
#reader.jem-is-fullscreen>.jem-reader-heading{margin-bottom:4px;flex-shrink:0}
#reader.jem-is-fullscreen>.jem-appearance{flex-shrink:0}
#reader.jem-is-fullscreen>#pages,#reader.jem-is-fullscreen>.jem-pdf{flex:1 0 120px;height:auto!important;min-height:120px!important;max-height:none!important}
#reader.jem-is-fullscreen>.jem-appearance{position:sticky;top:0;z-index:2;background:inherit;padding:4px 0}

/* Free excerpt introduction and copyright, in every display mode. */
.jem-reader-shell .jem-excerpt-notice{font-size:.85em;line-height:1.5;margin:0 0 12px;color:inherit;overflow-wrap:anywhere}
.jem-reader-shell .jem-excerpt-notice p{margin:0 0 .4em;color:inherit}

/* 0.8.1: compact controls, independent of oversized theme button rules. */
.jem-reader-shell .jem-reader-heading{margin-bottom:8px;gap:12px}
.jem-reader-shell .jem-preview-banner{margin-bottom:6px}
.jem-reader-shell .jem-excerpt-notice{font-size:13px;line-height:1.4;margin-bottom:6px}
.jem-reader-shell .jem-appearance{justify-content:flex-start;align-items:center;gap:8px 12px;margin:6px 0}
.jem-reader-shell .jem-appearance label,.jem-reader-shell .jem-reader-controls label{font-size:14px;line-height:1.3;gap:6px}
.jem-reader-shell .jem-appearance button,.jem-reader-shell .jem-reader-controls button{font-size:14px!important;line-height:1.2!important;padding:8px 12px!important;min-height:44px!important;margin:0!important;width:auto;letter-spacing:normal}
.jem-reader-shell .jem-appearance select,.jem-reader-shell .jem-reader-controls select{font-size:14px!important;line-height:1.3;min-height:44px;padding:6px 26px 6px 8px;max-width:100%;box-sizing:border-box}
.jem-reader-shell .jem-appearance label{flex:0 1 auto}
.jem-reader-shell .jem-appearance select{width:auto}
.jem-reader-shell .jem-reader-controls{gap:8px;padding:4px 0;grid-template-columns:auto auto minmax(120px,1fr) minmax(160px,1.5fr)}
.jem-reader-shell .jem-reader-controls label{grid-template-columns:auto minmax(0,1fr)}
.jem-reader-shell #toc{max-width:none}
.jem-reader-shell #status{font-size:12px;margin:4px 0 6px}
@media(max-width:600px){
.jem-reader-shell .jem-reader-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.jem-reader-shell .jem-reader-controls label{grid-template-columns:auto minmax(0,1fr)}
.jem-reader-shell .jem-appearance{gap:6px 10px}
.jem-reader-shell .jem-appearance label{flex:1 1 150px}
.jem-reader-shell .jem-appearance select{flex:1;min-width:0}
}

/* 0.8.3: navigation inside reserved side gutters, clear of EPUB text. */
.jem-reader-shell .jem-reader-controls{grid-template-columns:minmax(120px,1fr) minmax(160px,2fr)}
.jem-reader-shell .jem-book-stage{position:relative;box-sizing:border-box;padding:0 44px;border:1px solid currentColor;border-radius:6px;min-width:0;overflow:hidden}
.jem-reader-shell .jem-book-stage #pages{border:0;border-radius:0}
.jem-reader-shell .jem-page-arrow{position:absolute!important;top:50%;transform:translateY(-50%);z-index:3;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:44px!important;min-width:44px!important;height:64px!important;min-height:44px!important;padding:0!important;margin:0!important;border:0!important;border-radius:6px;background:transparent!important;color:inherit!important;font-size:26px!important;line-height:1!important;cursor:pointer;box-shadow:none!important}
.jem-reader-shell .jem-page-prev{left:0}
.jem-reader-shell .jem-page-next{right:0}
.jem-reader-shell .jem-page-arrow:hover{background:rgba(127,127,127,.18)!important}
.jem-reader-shell .jem-page-arrow:disabled{opacity:.35;cursor:wait}
#reader.jem-is-fullscreen>.jem-book-stage{flex:1 0 120px;min-height:120px;display:flex}
#reader.jem-is-fullscreen>.jem-book-stage>#pages{flex:1;min-width:0;height:auto!important;min-height:120px!important;max-height:none!important}
@media(max-width:380px){.jem-reader-shell .jem-reader-controls{grid-template-columns:minmax(0,1fr)}.jem-reader-shell .jem-book-stage{padding:0 44px}}

/* 1.0.1: use available phone width and show complete control labels. */
@media(max-width:600px){
.jem-reader-shell{width:100%;padding:10px 8px}
.jem-reader-shell .jem-reader-heading h1{font-size:1.15em}
}
@media(max-width:480px){
.jem-reader-shell .jem-reader-controls{grid-template-columns:minmax(0,1fr)}
.jem-reader-shell .jem-reader-controls label{grid-template-columns:88px minmax(0,1fr)}
.jem-reader-shell .jem-appearance label{flex:1 1 100%;display:grid;grid-template-columns:88px minmax(0,1fr)}
.jem-reader-shell .jem-appearance select{width:100%}
.jem-reader-shell .jem-reader-controls select{width:100%}
}

/* 1.2.0: compact EPUB reading progress and current chapter. */
.jem-reader-shell .jem-reading-progress{margin:6px 0 10px;min-width:0;flex-shrink:0}
.jem-reader-shell .jem-progress-labels{display:flex;justify-content:space-between;gap:4px 12px;flex-wrap:wrap;font-size:12px;line-height:1.4;margin-bottom:4px;overflow-wrap:anywhere}
.jem-reader-shell .jem-progress-labels span{min-width:0;max-width:100%}
.jem-reader-shell #jem-reading-progress{display:block;width:100%;height:8px;box-sizing:border-box;accent-color:currentColor}

.jem-reader-shell .jem-speech[hidden]{display:none!important}.jem-reader-shell .jem-speech{margin:10px 0;padding:10px 0;border-top:1px solid currentColor;border-bottom:1px solid currentColor;color:inherit}.jem-speech-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.jem-speech-controls label{min-width:0;max-width:100%;flex-wrap:wrap}.jem-reader-shell #jem-speech-voice{max-width:min(100%,260px)}.jem-reader-shell .jem-speech p{font-size:.8em;line-height:1.4;margin:.5em 0}.jem-reader-shell .jem-speech button{padding:.4em .7em}
