* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { color: #1b1b1b; background: #eceef1; font: 15px system-ui, sans-serif; }
main { height: 100%; display: flex; flex-direction: column; }
.toolbar { min-height: 60px; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: white; border-bottom: 1px solid #d4d8de; }
.pagination, .options, .view-options { display: flex; align-items: center; gap: 10px; }
.toolbar button, .toolbar a { min-height: 38px; padding: 7px 12px; border: 1px solid #c8cbd1; border-radius: 5px; background: white; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.toolbar button:hover, .toolbar a:hover { background: #f3f5f8; }
.toolbar button[aria-pressed="true"] { background: #eaf3fb; border-color: #86b1de; }
.toolbar button:disabled { opacity: .45; cursor: not-allowed; }
#current { width: 52px; height: 38px; border: 1px solid #c8cbd1; border-radius: 5px; text-align: center; font: inherit; }
#stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 12px; }
#status { grid-area: 1 / 1; }
#book { grid-area: 1 / 1; width: 100%; max-width: 1300px; }
.sheet { overflow: hidden; background: white; box-shadow: inset 0 0 0 1px #ddd; }
.sheet img { display: block; width: 100%; height: 100%; object-fit: contain; }
#zoom-dialog { width: min(96vw, 1250px); height: min(94dvh, 960px); max-width: none; max-height: none; padding: 0; border: 0; background: #f3f4f6; }
#zoom-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.zoom-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 9px; background: white; border-bottom: 1px solid #ddd; }
.zoom-bar button { width: 40px; height: 38px; border: 1px solid #ccc; background: white; cursor: pointer; font-size: 22px; }
#zoom-range { width: min(220px, 35vw); }
#zoom-close { margin-left: auto; }
#zoom-scroll { height: calc(100% - 57px); overflow: auto; }
#zoom-image { display: block; max-width: none; height: auto; margin: 0 auto; }
[hidden] { display: none !important; }
:fullscreen main { height: 100dvh; }
@media (max-width: 620px) {
  .toolbar { padding: 6px 8px; font-size: 13px; }
  .pagination, .options, .view-options { gap: 5px; }
  .toolbar button, .toolbar a { padding: 5px 7px; }
  #stage { padding: 4px; }
}

/* magnifier v7 */
#stage { position: relative; }
#catalog-lens {
  position: absolute; z-index: 30; display: none; width: 230px; height: 230px;
  border: 3px solid white; border-radius: 50%; pointer-events: none;
  background-color: white; background-repeat: no-repeat;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
#zoom-scroll { touch-action: pan-x pan-y; overscroll-behavior: contain; }
