html:has(.book-reader[open]) { overflow: hidden; }

.book-reader {
  --reader-aqua: #8cf2f2;
  box-sizing: border-box;
  width: min(45rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(88dvh, 58rem);
  padding: 0;
  margin: auto;
  overflow: hidden;
  color: #e3edec;
  color-scheme: dark;
  background: #0a171b;
  border: 1px solid #497378;
  border-radius: 4px;
  box-shadow: 0 1.5rem 7rem #000b;
  text-align: start;
}

.book-reader[open] { display: flex; flex-direction: column; }
.book-reader::backdrop { background: rgb(0 8 12 / 86%); backdrop-filter: blur(6px); }
.book-reader :focus-visible { outline: 2px solid var(--reader-aqua); outline-offset: -2px; }
.reader-topline, .reader-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.reader-topline { flex: none; min-height: 3.75rem; padding: 0 .75rem 0 clamp(1.25rem, 5vw, 3.4rem); border-bottom: 1px solid #294247; }
.reader-title, .reader-edition, .reader-end {
  font: 500 .69rem/1.6 Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.reader-title { color: #b9cfce; }
.reader-close, .reader-return {
  box-sizing: border-box;
  color: var(--reader-aqua);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.reader-close { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border-radius: 2px; }
.reader-close:hover, .reader-return:hover { background: #142c31; color: white; }
.reader-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: #448086 transparent; }
.reader-page { padding: clamp(1.6rem, 5vw, 3.3rem); }
.reader-edition { margin: 0; color: var(--reader-aqua); }
.book-reader #reader-chapter {
  margin: .65rem 0 1.9rem;
  font: normal clamp(2.25rem, 5vw, 3.5rem)/1.12 Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
  text-transform: none;
}
.reader-prose p {
  margin: 0 0 .95em;
  color: #e0e9e8;
  font: normal clamp(1.063rem, 2vw, 1.22rem)/1.68 Georgia, "Times New Roman", serif;
  letter-spacing: normal;
  text-transform: none;
}
.reader-prose p:first-child { margin-bottom: .1rem; color: #a9bebd; font-style: italic; }
.reader-foot { flex-wrap: wrap; margin-top: 2rem; padding-top: 1.1rem; border-top: 1px solid #2a4348; }
.reader-end { color: #b0c4c2; }
.reader-return { min-height: 44px; padding: .6rem .75rem; font: 500 .88rem/1.4 Arial, sans-serif; }
@media (max-width: 480px) {
  .book-reader { width: calc(100% - 1rem); max-height: 94dvh; }
  .reader-page { padding: 1.65rem 1.25rem; }
  .reader-foot { gap: .3rem; }
}
