:root{color-scheme:light;--surface:#f3f2ef;--ink:#292824;--muted:#69675f;--line:#d4d2cb}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--surface);color:var(--ink);font-family:Arial,sans-serif}body{display:grid;grid-template-rows:68px minmax(0,1fr) 70px}header{display:flex;align-items:center;padding:0 34px;gap:22px}header a{font-family:Georgia,serif;font-size:16px;letter-spacing:.08em;color:inherit;text-decoration:none}header>span{color:var(--muted);font-size:9px;letter-spacing:.2em}header button{margin-left:auto}button{display:inline-flex;justify-content:center;align-items:center;border:0;background:transparent;color:inherit;width:44px;height:44px;padding:10px;cursor:pointer;border-radius:0}button:hover{background:#e7e5df}button:disabled{opacity:.28;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible{outline:1px solid var(--ink);outline-offset:3px}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}#stage{position:relative;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line) var(--surface);touch-action:pan-x pan-y;display:grid;place-items:center;padding:12px 28px}#book{position:relative;flex:none;perspective:2200px;user-select:none;isolation:isolate;cursor:pointer;touch-action:none}.page{position:absolute;top:0;width:50%;height:100%;overflow:hidden;background:#fff}.page canvas{display:block;width:100%;height:100%}.page.left{left:0}.page.right{right:0}.page.single{width:100%;left:0}.page.cover{width:50%;left:25%}.spread-layer{position:absolute;inset:0}.page.blank{background:#fff}.leaf{position:absolute;top:0;width:50%;height:100%;transform-style:preserve-3d;z-index:10}.leaf.forward{left:50%;transform-origin:left center}.leaf.backward{left:0;transform-origin:right center}.leaf.single{width:100%;left:0}.face{position:absolute;inset:0;backface-visibility:hidden;overflow:hidden;background:white}.face canvas{width:100%;height:100%;display:block}.face.reverse{transform:rotateY(180deg)}.face.blank{background:#fff}#status{position:fixed;top:76px;left:50%;transform:translateX(-50%);font-size:11px;color:var(--muted);padding:8px 12px;background:var(--surface);max-width:90vw;text-align:center;z-index:20}#status:empty{display:none}footer{display:flex;align-items:center;justify-content:center;position:relative;padding:0 26px}.navigation,.zoom-controls{display:flex;align-items:center;gap:7px}.zoom-controls{position:absolute;right:26px}#fit{font-size:11px;width:50px;font-variant-numeric:tabular-nums}.page-picker{position:relative;width:152px;text-align:center;font-size:11px;letter-spacing:.035em;font-variant-numeric:tabular-nums}.page-picker select{position:absolute;inset:-12px 0;opacity:0;width:100%;cursor:pointer}.page-picker:focus-within{outline:1px solid var(--ink);outline-offset:8px}::selection{background:#d4d2cb;color:#292824}@media(max-width:699px), (max-width:1100px) and (max-height:550px){body{grid-template-rows:55px minmax(0,1fr) 72px}header{padding:0 16px;gap:12px}header a{font-size:12px}header>span{font-size:8px}#stage{padding:8px 12px}footer{justify-content:space-between;padding:0 10px}.zoom-controls{position:static;gap:0}.navigation{gap:0}.page-picker{width:115px}button{width:40px;height:44px}#fit{width:42px}#status{top:58px}.leaf{width:100%;left:0!important}.leaf.forward{transform-origin:left center}.leaf.backward{transform-origin:right center}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}


/* Phone browser chrome and safe areas remain outside the original page artwork. */
body{height:100%;height:100dvh}
.face{-webkit-backface-visibility:hidden}
@media(max-width:699px), (max-width:1100px) and (max-height:550px){
  body{grid-template-rows:calc(50px + env(safe-area-inset-top)) minmax(0,1fr) calc(96px + env(safe-area-inset-bottom))}
  header{padding-top:env(safe-area-inset-top);padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));gap:10px}
  header a{font-size:11px}header>span{font-size:7px}
  #stage{padding:8px 12px;padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
  footer{flex-direction:column;justify-content:center;gap:0;padding:4px 8px calc(4px + env(safe-area-inset-bottom));}
  .navigation,.zoom-controls{justify-content:center;position:static;min-height:44px;gap:8px}
  button{width:44px;height:44px;flex-shrink:0;touch-action:manipulation}
  .page-picker{width:120px;font-size:12px}#fit{width:50px;font-size:12px}
  #status{top:calc(50px + env(safe-area-inset-top));font-size:12px}
}
@media(max-width:1100px) and (max-height:550px){
  body{grid-template-rows:calc(44px + env(safe-area-inset-top)) minmax(0,1fr) calc(52px + env(safe-area-inset-bottom))}
  footer{flex-direction:row;justify-content:center;gap:24px}
  #status{top:calc(44px + env(safe-area-inset-top))}
}
