/* Непрерывное чтение: главы подгружаются как отдельные страницы. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html { background: #020507; scroll-behavior: smooth; overflow-anchor: none; }
body.continuous { margin: 0; background: #020507; color: #fff; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Avenir Next", Arial, sans-serif; overflow-anchor: none; }
.book-nav {
  position: fixed; z-index: 10; top: max(12px, env(safe-area-inset-top)); left: 50%;
  display: flex; gap: 4px; max-width: calc(100vw - 24px); padding: 5px; overflow-x: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  background: rgba(3,8,12,.72); box-shadow: 0 8px 32px rgba(0,0,0,.28);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); scrollbar-width: none;
}
.book-nav::-webkit-scrollbar { display: none; }
.book-nav a { padding: 8px 13px; border-radius: 999px; color: #e8edf0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.book-nav a:hover, .book-nav a:focus-visible { background: rgba(255,255,255,.14); outline: none; }
.chapter-frame { position: relative; width: 100%; background: #020507; overflow-anchor: none; }
.chapter-frame iframe { display: block; width: 100%; height: 100vh; border: 0; background: #020507; }
.chapter-frame .loading { position: absolute; inset: 0; display: grid; place-items: center; min-height: 100vh; color: #a9b5bd; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.chapter-frame.ready .loading { display: none; }
@media (max-width: 560px) { .book-nav { top: auto; bottom: max(10px, env(safe-area-inset-bottom)); } .book-nav a { padding: 7px 9px; font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
