.book-library,
.book-cover-page,
.book-reader-content,
.book-library-copy,
.book-cover-copy {
  min-width: 0;
}

.book-library-list,
.book-toc-list {
  display: grid;
  gap: .75rem;
}

.book-library-entry,
.book-cover-overview,
.book-reader-heading,
.book-toc-entry {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.book-library-cover {
  flex: 0 0 76px;
  width: 76px;
  height: 104px;
  object-fit: cover;
}

.book-cover-image {
  flex: 0 0 180px;
  width: 180px;
  max-width: 38%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.book-library-copy,
.book-cover-copy {
  flex: 1 1 auto;
}

.book-library-copy p,
.book-cover-copy p,
.book-reader-content,
.book-live-preview {
  overflow-wrap: anywhere;
  word-break: normal;
}

.book-toc-entry {
  align-items: center;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
}

.book-toc-entry:hover,
.book-toc-entry:focus-visible,
.book-chapter-link:hover,
.book-chapter-link:focus-visible,
.book-chapter-link.is-active {
  border-color: var(--cmsx0-accent-line, #d6922e);
  color: inherit;
}

.book-reader-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.book-reader-heading-actions,
.book-chapter-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.book-reader-heading-actions {
  justify-content: flex-end;
}

.book-reader-content {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: min(58vh, 38rem);
  margin-bottom: .75rem;
  white-space: pre-wrap;
  line-height: 1.78;
  font-size: clamp(1rem, .96rem + .2vw, 1.12rem);
}

.book-chapter-links {
  margin-bottom: .75rem;
}

.book-chapter-link {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.book-reader-pagination {
  max-width: 100%;
  overflow-x: auto;
}

.book-reader-pagination .pagination {
  flex-wrap: wrap;
}

.book-live-preview {
  white-space: pre-wrap;
}

[dir="rtl"] .book-library-entry,
[dir="rtl"] .book-cover-overview,
[dir="rtl"] .book-reader-heading,
[dir="rtl"] .book-toc-entry {
  text-align: right;
}

@media (max-width: 575.98px) {
  .book-cover-overview,
  .book-reader-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .book-cover-image {
    width: min(180px, 62vw);
    max-width: 100%;
    margin-inline: auto;
  }

  .book-reader-heading-actions {
    justify-content: space-between;
  }
}
