*{box-sizing:border-box}html{height:100%;background:#e8eef2;color:#0a3157;font:16px/1.4 Arial,Helvetica,sans-serif}body{margin:0;height:100%;height:100dvh;display:flex;flex-direction:column}header{background:#0a3157;color:#fff;display:flex;align-items:center;gap:26px;padding:15px 28px;flex-shrink:0}.brand{font-family:Georgia,serif;font-size:30px;font-weight:bold;text-decoration:none;color:white;white-space:nowrap}.brand span{font-family:Arial,sans-serif;font-size:12px;letter-spacing:2px}.title{font-size:15px;flex:1}.title strong{display:block;font-size:20px}.download{background:#fff;color:#0a3157;text-decoration:none;padding:9px 16px;border-radius:6px;font-size:14px;font-weight:bold}.download span{display:block;font-size:12px;font-weight:normal;opacity:.8}#stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:18px 24px;background:radial-gradient(ellipse at center,#f8fafc,#dce5ed)}#book{flex:none}.page{background:white;box-shadow:inset 0 0 1px #999;overflow:hidden}.page img{width:100%;height:100%;object-fit:contain;display:block;user-select:none;-webkit-user-drag:none}.stf__wrapper{filter:drop-shadow(0 10px 14px #0a315725)}#loading{position:absolute;top:45%;background:#fff;padding:12px 22px;border-radius:6px}footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 24px 6px;background:#fff;flex-shrink:0}.tools,form{display:flex;align-items:center;gap:8px}button{font:inherit;font-size:14px;color:#0a3157;background:#edf3f7;border:1px solid #d5e0e9;border-radius:5px;min-height:42px;padding:7px 14px;cursor:pointer}button:hover{background:#dbeaf4}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #168eca;outline-offset:3px}#previous,#next{font-size:28px;line-height:1;padding:2px 14px}#page{width:56px;border:1px solid #bdccd7;border-radius:4px;padding:8px 4px;font:inherit;text-align:center;height:40px}#page-count{font-size:14px;color:#516b7b;white-space:nowrap}.hint{margin:0;background:#fff;color:#5d7282;text-align:center;padding:6px 12px 10px;font-size:12px}.sr-only{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}dialog{border:0;border-radius:10px;padding:0;color:#0a3157;max-width:calc(100vw - 24px);width:1100px;max-height:calc(100dvh - 24px);background:#f0f4f7;box-shadow:0 20px 90px #0005}dialog::backdrop{background:#061b30c9}.dialog-bar{background:white;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 18px;position:sticky;top:0;z-index:2}.dialog-bar h2{font-size:18px;margin:0}.dialog-bar>div{display:flex;gap:6px}#thumb-grid{padding:20px;display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:14px}#thumb-grid button{padding:5px;background:white}#thumb-grid img{width:100%;aspect-ratio:1.414;object-fit:contain;display:block}#thumb-grid span{display:block;padding:4px}#thumb-grid [aria-current=page]{outline:3px solid #1386c9}#zoom-dialog{width:calc(100vw - 24px);height:calc(100dvh - 24px);overflow:hidden}#zoom-dialog[open]{display:flex;flex-direction:column}#zoom-scroll{overflow:auto;flex:1;min-height:0;padding:16px;touch-action:pan-x pan-y}#zoom-pages{display:flex;align-items:flex-start;width:100%;gap:6px}#zoom-pages img{display:block;min-width:0;flex:1;width:50%;height:auto;box-shadow:0 3px 12px #0003}.fallback{position:fixed;top:35%;left:10%;right:10%;background:white;padding:30px;z-index:100;text-align:center}@media(max-width:720px){header{padding:10px 12px;gap:12px}.brand{font-size:23px}.brand span{display:none}.title{font-size:12px}.title strong{font-size:15px}.download{padding:7px 9px;font-size:12px}.download span{font-size:10px}#stage{padding:10px}footer{padding:8px;gap:6px;flex-wrap:wrap;justify-content:center}.tools{gap:5px}footer button{padding:7px 10px}#navigation{order:-1;flex-basis:100%;justify-content:center}.hint{font-size:11px;padding-bottom:max(8px,env(safe-area-inset-bottom))}#layout{display:none}.dialog-bar{padding:10px}.dialog-bar h2{font-size:15px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.stf__wrapper{position:relative;width:100%;height:100%}

.brand{display:flex;align-items:center;flex-shrink:0}.brand img{display:block;width:125px;height:58px;object-fit:contain;filter:brightness(0) invert(1)}@media(max-width:720px){.brand img{width:83px;height:48px}}

#focus-controls[hidden]{display:none}#focus-controls{position:fixed;z-index:20;bottom:max(10px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:6px;white-space:nowrap;padding:6px;border-radius:8px;background:#0a3157e8;box-shadow:0 2px 16px #0003}#focus-controls button{min-height:44px;padding:6px 11px;background:#fff;color:#0a3157}.reading-mode{position:fixed;inset:0;overflow:hidden;height:100dvh}.reading-mode>header,.reading-mode>footer,.reading-mode>.hint{display:none}.reading-mode #stage{padding:env(safe-area-inset-top) 8px max(74px,calc(env(safe-area-inset-bottom) + 64px))}.reading-mode #focus-exit{font-size:13px}@media(max-height:500px){.reading-mode #stage{padding-bottom:64px}} 

#focus-controls{max-width:calc(100vw - 16px);white-space:normal}#focus-exit{max-width:150px;line-height:1.15}@media(max-width:420px){.brand img{width:67px}.download{white-space:nowrap}.title{min-width:0;font-size:12px}}

#focus-exit{white-space:nowrap}#focus-controls button{flex-shrink:0}

/* Preserve page geometry and show recovery controls while images load. */
.page,.zoom-page{position:relative}.page img[hidden],.zoom-page img[hidden],.image-state[hidden],.image-state button[hidden]{display:none}
#zoom-pages .zoom-page{flex:1;min-width:0;width:50%;aspect-ratio:2400/1697;background:white;box-shadow:0 3px 12px #0003}
#zoom-pages .zoom-page img{width:100%;height:auto;box-shadow:none}
.image-state{position:absolute;bottom:12px;left:12px;right:12px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;padding:10px;background:#fffffff2;border-radius:6px;color:#0a3157;font-size:14px;text-align:center;z-index:2}
.image-state button{background:#0a3157;color:white;touch-action:manipulation}
