/* Online reader for The Ai & WE Book — the book pages are shown exactly as in the FREE PDF parts. */
.reader-bar {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .5rem 1.2rem; margin: 1rem 0 0; padding: .6rem 1rem; background: rgba(5,11,30,.94);
  border-bottom: 1px solid rgba(244,198,79,.35); backdrop-filter: blur(6px);
}
.reader-bar .bar-link { font: 600 1rem/1.2 var(--display); color: var(--gold); text-decoration: none; padding: .45rem .2rem; }
.reader-bar .bar-link:hover { color: var(--gold-hi); text-decoration: underline; }
.reader-bar .toc-btn { font-size: clamp(1rem, 3.6vw, 1.25rem); min-width: 0; padding: .55em 1.1em; }
.reader-hint, .reader-status { text-align: center; margin: .7rem 1rem 0; font-size: .95rem; color: #d8ccb2; }
.reader-status:empty { display: none; }
.book { display: grid; gap: 14px; margin: 1rem auto 2.5rem; padding-inline: clamp(0px, 2vw, 12px); outline: none; }
.book-page {
  position: relative; aspect-ratio: 612 / 792; background: #fff; border-radius: 4px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.55); scroll-margin-top: calc(var(--reader-bar, 4rem) + 10px);
}
.book-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.book-page .pno { position: absolute; right: 6px; bottom: 4px; font: 600 11px/1 var(--body); color: #666; background: rgba(255,255,255,.8); padding: 2px 5px; border-radius: 4px; }
.book-page .links a { position: absolute; display: block; border-radius: 3px; }
.book-page .links a:hover, .book-page .links a:focus-visible { background: rgba(244,198,79,.28); outline: 2px solid var(--gold-mid); outline-offset: 0; }
.book-page.loading::after { content: "Loading page…"; position: absolute; inset: 0; display: grid; place-items: center; color: #777; font: 600 1rem var(--body); }
@media (max-width: 560px) {
  .reader-bar { flex-wrap: nowrap; justify-content: space-between; gap: .4rem; padding: .45rem .6rem; }
  .reader-bar .bar-link { font-size: .92rem; white-space: nowrap; }
  .reader-bar .long { display: none; }
  .reader-bar .toc-btn { font-size: .98rem; padding: .5em .85em; border-width: 2px; white-space: nowrap; }
}
