.cabinet-book-fields {
  display: grid;
  gap: 19px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
html:has(.cabinet-modal[open] .cabinet-book) { overflow: hidden; }
.cabinet-modal:has(.cabinet-book) {
  width: min(1152px, calc(100% - 48px)); max-height: calc(100dvh - 40px);
  background: #1c1510; border: 1px solid #b4925d; border-radius: 18px;
}
.cabinet-modal:has(.cabinet-book) > header { position: relative; z-index: 2; padding: 0; }
.cabinet-modal:has(.cabinet-book) > header h2 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.cabinet-modal:has(.cabinet-book) > header button {
  position: absolute; right: 10px; top: 10px; width: 44px; height: 44px;
  background: #201914; color: #f5e5c8; border: 0; border-radius: 50%;
}
.cabinet-modal:has(.cabinet-book) .cabinet-modal-body { padding: 0; }
.cabinet-modal .cabinet-book { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; }
.cabinet-book-reader {
  align-self: stretch; min-width: 0; padding: 24px clamp(18px, 3vw, 48px) 18px;
  background: radial-gradient(ellipse at center, #39271d, #211813 78%);
}
.book-reader-heading {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 0 0 16px; color: #faebce; font: 20px/1.35 Georgia, serif; text-align: center;
}
.book-reader-heading::before, .book-reader-heading::after {
  content: ""; width: 38px; height: 1px; background: #a18047;
}
.cabinet-book-reader .book-reader-status { text-align: center; }
.cabinet-book-page-tabs { justify-content: center; margin: 14px 0 0; }
.cabinet-book-page-tabs button { min-width: 44px; min-height: 44px; color: #f4e4c5; border-color: #af8d58; font: 18px Georgia, serif; }
.cabinet-book-page-tabs button[aria-pressed="true"] { background: #e9bd77; color: #291a0d; border-color: #e9bd77; }
.cabinet-book-page-tabs label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cabinet-book-page-tabs select { min-height: 44px; min-width: 0; max-width: 100%; color: inherit; background: #201a14; border: 1px solid #79613b; border-radius: 6px; }
.cabinet-book-page:not(.is-text) { width: min(100%, max(220px, calc((100dvh - 245px) * 0.6667)), 400px); margin-inline: auto; border-radius: 3px; }
.cabinet-book-page-wait { min-height: 0; }
.cabinet-book-reader-actions { justify-content: center; margin-top: 5px; gap: 4px 14px; }
.cabinet-book-reader-actions .cabinet-text-link { min-height: 34px; }
.cabinet-book-reader-actions > span { margin-left: 0; }
.cabinet-book-info { align-self: center; min-width: 0; padding: 52px clamp(24px, 3.5vw, 52px) 36px; overflow-wrap: anywhere; }
.cabinet-book-info h3 { margin: 0 0 8px; font: 400 clamp(32px, 3.8vw, 53px)/1.1 Georgia, serif; }
.cabinet-book-info > p { font-size: 15px; }
.book-edition-description { margin: 26px 0; }
.book-edition-description strong { font: 400 clamp(27px, 2.7vw, 38px)/1.15 Georgia, serif; color: #f7e6c8; }
.book-edition-description p { margin: 6px 0 0; font-size: 15px; }
.book-cover-options { border-block: 1px solid #665238; margin: 0 0 22px; color: #ead6b1; }
.book-cover-options summary { padding: 15px 0; cursor: pointer; list-style: none; display: grid; grid-template-columns: 22px 1fr 18px; gap: 12px; }
.book-cover-options summary::-webkit-details-marker { display: none; }
.book-cover-options summary svg { width: 100%; color: #dfb676; }
.book-cover-options summary b { color: #faebce; font: 21px/1.25 Georgia, serif; }
.book-cover-options summary span span, .book-cover-options summary em { display: block; font-size: 13px; line-height: 1.5; margin-top: 3px; }
.book-cover-options summary em { color: #d0b99a; }
.book-cover-options[open] summary svg:last-child { transform: rotate(180deg); }
.book-cover-options[open] { padding-bottom: 16px; }
.book-order-lines { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 24px 0 18px; font: 17px/1.4 Georgia, serif; color: #ebdcc2; }
.book-order-lines dd { margin: 0; text-align: right; white-space: nowrap; }
.cabinet-book .book-purchase.is-primary {
  width: 100%; min-height: 48px; justify-content: center; border: 1px solid #e9bd77;
  border-radius: 8px; background: #e9bd77; color: #27190e; font: 600 19px/1.3 Georgia, serif;
}
.cabinet-book .book-purchase:enabled:hover { background: #f6ce8e; }
.cabinet-book-form input, .cabinet-book-form textarea, .cabinet-book-form select { min-width: 0; max-width: 100%; }
@media (max-width: 760px) {
  .cabinet-modal:has(.cabinet-book) { width: 100%; max-width: 100%; max-height: 100dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .cabinet-modal:has(.cabinet-book) > header { height: 46px; padding: 0 16px; background: #211813; border-bottom: 1px solid #493929; }
  .cabinet-modal:has(.cabinet-book) > header h2 { position: static; width: auto; height: auto; clip-path: none; font: 16px/1.3 Georgia, serif; }
  .cabinet-modal:has(.cabinet-book) > header button { top: 1px; right: 5px; }
  .cabinet-modal .cabinet-book { grid-template-columns: minmax(0,1fr); }
  .cabinet-book-reader { padding: 12px 16px 8px; }
  .book-reader-heading { margin: 0 0 10px; font-size: 17px; gap: 8px; }
  .book-reader-heading::before, .book-reader-heading::after { width: 18px; }
  .cabinet-book-page:not(.is-text) { width: min(74%, 27dvh, 280px); }
  .cabinet-book-info { display: flex; flex-direction: column; padding: 18px clamp(16px, 5vw, 30px) max(24px, env(safe-area-inset-bottom)); }
  .cabinet-book-info > .cabinet-text-link { align-self: start; }
  .book-edition-description { order: -1; margin: 0 0 18px; }
  .book-cover-options { margin-top: 16px; }
  .cabinet-book-info .cabinet-book-form label small { margin: 0; font-size: 12px; }
  .cabinet-book-reader-actions .cabinet-text-link { min-height: 44px; }
}

.book-page-reading-preview { padding: 8%; color: #33281c; }
.book-page-reading-preview h4 { margin: 0 0 .6em; font: 22px/1.25 Georgia, serif; }
.cabinet-book-page .book-page-reading-preview p { margin: 0; color: inherit; font: 16px/1.6 Georgia, serif; white-space: pre-line; }
