/* Mindscape Reader Tools v1.3. Add after viewer.css. */
.reader-toolbar{position:absolute;top:12px;right:12px;z-index:15;display:flex;gap:7px;align-items:center}
.reader-tool-button{font:inherit;appearance:none;border:1px solid #ddd9d3;background:#fffcf9;color:#4a5153;min-height:36px;min-width:36px;border-radius:10px;padding:7px 11px;cursor:pointer;font-size:12px;font-weight:650;letter-spacing:.01em;box-shadow:0 2px 8px rgba(0,0,0,.055);touch-action:manipulation}
.reader-tool-button:hover:not(:disabled){background:#f1eee9}
.reader-tool-button:disabled{opacity:.35;cursor:default}
.reader-tool-button[aria-pressed="true"]{background:#e7e7e7;border-color:#969696;color:#222}
.reader-tool-button:focus-visible{outline:3px solid #a8795c;outline-offset:2px}
.reader-grayscale .catalog-page img,.reader-grayscale .reader-zoom-image{filter:grayscale(1)!important}
.reader-grayscale .stage{background:#f2f2f2}
.reader-grayscale .stage-glow{opacity:.25}
.reader-grayscale .track-fill{background:#767676}
.reader-overlay[hidden]{display:none!important}
.reader-overlay{position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;background:#eae9e6;color:#273033;overflow:hidden}
.reader-overlay-header{flex:0 0 auto;min-height:76px;padding:9px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:10px;background:#faf9f7;border-bottom:1px solid #dad8d4}
.reader-overlay-header>.reader-tool-button{justify-self:end}
.reader-page-counter{font-size:12px;font-weight:700;white-space:nowrap}
.reader-overlay-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px}
.reader-zoom-number{font-size:11px;font-weight:700;min-width:38px;text-align:center;font-variant-numeric:tabular-nums}
.reader-overlay-actions .reader-tool-button{min-width:34px;height:34px;padding:4px 8px;font-size:17px;box-shadow:none}
.reader-viewport{position:relative;flex:1;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none;cursor:zoom-in;overscroll-behavior:contain;background:#e9e8e5}
.reader-viewport.is-zoomed{cursor:grab}
.reader-viewport.is-zoomed:active{cursor:grabbing}
.reader-zoom-surface{display:flex;flex:0 0 auto;align-items:stretch;justify-content:center;transform-origin:center center;will-change:transform;box-shadow:0 4px 20px rgba(0,0,0,.12);background:white}.reader-zoom-image{display:block;min-width:0;width:100%;height:100%;object-fit:fill;pointer-events:none;-webkit-user-drag:none;user-select:none}.reader-zoom-image[hidden]{display:none!important}.reader-zoom-surface.is-spread .reader-zoom-image{width:50%}.reader-zoom-surface.is-spread .reader-zoom-image + .reader-zoom-image{border-left:1px solid rgba(0,0,0,.15)}
.reader-overlay-footer{height:52px;flex:0 0 52px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:9px;padding:5px 12px;background:#faf9f7;border-top:1px solid #dad8d4}
.reader-overlay-footer>.reader-tool-button:first-child{justify-self:start}
.reader-overlay-footer>.reader-tool-button:last-child{justify-self:end}
.reader-hint{font-size:11px;color:#6e7374;text-align:center;white-space:nowrap}
.reader-grayscale .reader-overlay,.reader-grayscale .reader-viewport{background:#efefef}
@media(max-width:520px){.reader-toolbar{top:9px;right:9px;gap:5px}.reader-toolbar .reader-tool-button{font-size:11px;min-height:34px;padding:5px 8px}.reader-overlay-header{padding:5px 7px;gap:3px}.reader-overlay-actions{gap:3px}.reader-overlay-actions .reader-tool-button{min-width:30px;padding:3px 6px}.reader-zoom-number{min-width:33px;font-size:10px}.reader-page-counter{font-size:11px}.reader-overlay-footer{padding:5px 7px}.reader-hint{font-size:10px;white-space:normal}.reader-overlay-footer .reader-tool-button{min-width:33px;padding:6px 9px}}

/* Title and instructions stay visible above the pages in either mode. */
.reader-has-instructions.viewer-header{height:auto!important;min-height:87px!important;flex:0 0 auto!important;padding-top:10px;padding-bottom:10px}
.reader-has-instructions .brand-titles{min-width:0}
.reader-has-instructions .header-help{display:none}
.reader-main-instructions,.reader-overlay-instructions{font-size:10px;font-weight:600;line-height:1.45;letter-spacing:.015em;color:#8f735e;white-space:normal}
.reader-main-instructions{margin-top:6px}
.reader-overlay-brand{min-width:0;display:flex;flex-direction:column;gap:4px}
.reader-overlay-title{font-size:clamp(14px,1.7vw,19px);font-weight:750;letter-spacing:-.025em;line-height:1.2;color:#273033;overflow-wrap:anywhere}
.reader-overlay-instructions{font-size:10px}
@media(max-width:650px){
 .reader-has-instructions.viewer-header{min-height:96px!important}
 .reader-main-instructions{font-size:9px;max-width:95%}
 .reader-overlay-header{grid-template-columns:minmax(0,1fr) auto;gap:7px;padding:8px 10px}
 .reader-overlay-brand{grid-column:1;grid-row:1}
 .reader-overlay-header>.reader-tool-button{grid-column:2;grid-row:1;align-self:start}
 .reader-page-counter{grid-column:1;grid-row:2;justify-self:start}
 .reader-overlay-actions{grid-column:2;grid-row:2;justify-self:end}
 .reader-overlay-title{font-size:15px}
 .reader-overlay-instructions{font-size:9px}
}

/* Fullscreen button and optional inline guidance */
.reader-toolbar{flex-wrap:wrap;justify-content:flex-end;max-width:calc(100% - 20px)}
.reader-tool-button[data-tool="fullscreen"]{white-space:nowrap}
.reader-overlay-actions .reader-tool-button[data-tool="fullscreen"]{font-size:17px;min-width:34px}
.reader-fullscreen-hint[hidden]{display:none!important}
.reader-fullscreen-hint{position:fixed;z-index:10001;bottom:70px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(90vw,510px);padding:12px 16px;border-radius:12px;background:#302f2d;color:white;font-size:13px;line-height:1.35;text-align:center;box-shadow:0 8px 30px #0003}
:root:fullscreen{width:100%;height:100%;overflow:hidden}
:root:fullscreen .viewer{height:100dvh;max-height:100dvh}
@media(max-width:520px){.reader-toolbar .reader-tool-button[data-tool="fullscreen"]{font-size:11px}}
