/* The book is the primary content. Reader controls share the catalogue's palette. */
body[data-library-view="reader"] .reader-hero {
  display: block;
  margin: 0 0 20px;
}
body[data-library-view="reader"] .reader-hero-copy {max-width: none;}
body[data-library-view="reader"] .reader-hero h1 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
body[data-library-view="reader"] .reader-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.book-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.book-navigation .reader-hero-actions {display: flex; flex: 0 0 auto; flex-wrap: nowrap; width: auto; gap: 8px; margin: 0;}
.book-navigation svg {width: 20px; height: 20px; flex: 0 0 20px;}
.app-shell--reader button.reader-back,
.app-shell--reader button.reader-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  box-shadow: none;
  font: 700 14px/1.5 var(--font-body);
  white-space: nowrap;
}
.app-shell--reader button.reader-back {padding-left: 0; border-color: transparent; font-weight: 600;}
.app-shell--reader button.reader-back:hover {background: transparent; border-color: transparent; color: #105f2d;}
.app-shell--reader button.reader-action:hover {background: #f7f7f7; border-color: #b1b1b1;}
.app-shell--reader button.reader-action[aria-pressed="true"] {background: #e8faee; color: #105f2d; border-color: #b8e5c7;}
.reader-action[aria-pressed="true"] svg {fill: currentColor;}
.app-shell--reader button.reader-action--primary {background: #22c55e; color: #102417; border-color: #22c55e;}
.app-shell--reader button.reader-action--primary:hover {background: #1bb652; border-color: #1bb652;}
.book-navigation button:focus-visible {outline: 3px solid #16803c; outline-offset: 3px;}
.book-navigation button:disabled {opacity: .55; cursor: not-allowed;}
body[data-library-view="reader"] .reader-grid {display: block;}
body[data-library-view="reader"] .reader-stage-card {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7f7f7;
  box-shadow: none;
}
body[data-library-view="reader"] .pdf-stage--reader {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f7f7f7;
}
body[data-library-view="reader"] .flipbook-frame {
  display: block;
  width: 100%;
  height: max(480px, calc(100svh - 280px));
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: white;
  box-shadow: none;
}
body[data-library-view="reader"] .viewer-status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 32px;
  background: #f7f7f7;
  color: var(--muted);
  font: 400 14px/1.6 var(--font-body);
  text-align: center;
}
body[data-library-view="reader"] .viewer-status[data-tone="error"] {background: #fff0ee; color: #a42d2d;}
body[data-library-view="reader"] .pdf-stage--reader:fullscreen {width: 100%; height: 100%; background: white;}
body[data-library-view="reader"] .pdf-stage--reader:fullscreen .flipbook-frame {height: 100%;}
@media (max-width: 767px) {
  body[data-library-view="reader"] .app-shell--reader .reader-main {padding-top: 16px !important;}
  body[data-library-view="reader"] .reader-hero {margin-bottom: 16px;}
  body[data-library-view="reader"] .reader-hero h1 {margin-top: 16px; font-size: 24px;}
  body[data-library-view="reader"] .reader-hero p {font-size: 13px;}
  .book-navigation {gap: 8px;}
  .book-navigation .reader-action-label {display: none;}
  .app-shell--reader .book-navigation button.reader-action {width: 44px; min-width: 44px; padding: 0;}
  .app-shell--reader button.reader-back {padding-right: 8px; font-size: 13px;}
  body[data-library-view="reader"] .flipbook-frame {height: max(420px, calc(100svh - 280px));}
  body[data-library-view="reader"] .reader-stage-card {border-radius: 12px;}
}
