.book-site { background: #101722; }
.book-shell {
  --book-paper: #f7efe1;
  --book-ink: #2c241e;
  --book-accent: #7a3f29;
  --book-rule: #cdb393;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 clamp(.85rem, 3vw, 2rem) 3rem;
}
.book-shell [hidden] { display: none !important; }
.book-reader-tools {
  display: flex;
  justify-content: space-between;
  gap: .6rem 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 1.1rem 0;
}
.book-reader-tools > div { display: flex; gap: .6rem 1rem; flex-wrap: wrap; }
.book-reader-tools a, .book-contents a { color: #d7dfed; }
.book-home { font: 1.16rem Georgia, serif; }
.book-spread {
  display: grid;
  grid-template-columns: minmax(220px, 265px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}
.book-contents { position: sticky; top: 4.4rem; scroll-margin-top: 5rem; min-width: 0; }
.book-contents details {
  background: #172130;
  border: 1px solid #2b394d;
  border-radius: .65rem;
  padding: 1rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
}
.book-contents summary { font: 1.25rem Georgia, serif; cursor: pointer; color: #edcc94; }
.book-toc-group { margin-top: 1rem; border-top: 1px solid #344157; padding-top: .65rem; }
.book-contents .book-part-label, .book-contents .book-part-link { font-weight: 650; color: #edcc94; margin: 0; }
.book-contents ul { padding: 0 0 0 .55rem; margin: .25rem 0 0; list-style: none; }
.book-contents a { display: block; padding: .28rem .4rem; text-decoration: none; border-radius: .25rem; font-size: .9rem; }
.book-contents a:hover, .book-contents a[aria-current="page"] { color: #ffe4b8; background: #2b3747; }
.book-title-page, .book-chapter {
  background: var(--book-paper);
  color: var(--book-ink);
  border-radius: .2rem .6rem .6rem .2rem;
  border: 1px solid #c6ad8e;
  border-left: .45rem solid #ad8863;
  box-shadow: 0 17px 40px #05070b85;
  font-family: Georgia, "Times New Roman", "Nirmala UI", serif;
}
.book-title-page {
  min-height: min(620px, 76vh);
  display: grid;
  align-items: stretch;
  padding: clamp(.9rem, 3.5vw, 2.8rem);
}
.title-page-inner {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(.7rem, 2.8vw, 2rem);
  border: 1px solid var(--book-rule);
  text-align: center;
}
.book-emblem { width: clamp(86px, 18vw, 146px); color: var(--book-accent); margin-bottom: 1.2rem; }
.book-title-page h1 { font-size: clamp(2.55rem, 6.8vw, 5.7rem); margin: 0; font-weight: 500; line-height: 1; }
.book-subtitle { color: var(--book-accent); font-size: clamp(1.06rem, 2.6vw, 1.45rem); margin: .9rem 0 1.6rem; }
.book-title-actions { display: flex; flex-wrap: wrap; gap: .85rem 1.2rem; justify-content: center; align-items: center; font: .93rem system-ui; }
.book-site .book-page-slot a { color: #74401e; }
.book-site .book-title-actions .book-begin { color: #fff5e7; background: #703c26; padding: .7rem .95rem; border-radius: .34rem; text-decoration: none; }
.book-chapter { padding: clamp(1.25rem, 5vw, 4.3rem); scroll-margin-top: 5rem; }
.book-chapter + .book-chapter { margin-top: 1.5rem; }
.book-shell.reading-one .book-chapter { margin-top: 0; }
.chapter-opener {
  max-width: 66ch;
  margin: 0 auto 2rem;
  padding-bottom: 1.1rem;
  text-align: center;
  border-bottom: 1px solid var(--book-rule);
}
.book-running-title { color: var(--book-accent); margin: 0 0 1.2rem; font: .77rem system-ui; letter-spacing: .16em; text-transform: uppercase; }
.chapter-opener h2 { margin: 0; font-size: clamp(1.9rem, 4.6vw, 3.55rem); font-weight: 500; line-height: 1.12; }
.chapter-opener h2:focus { outline: none; }
.book-part .chapter-opener { padding-top: 1.5rem; }
.chapter-body { max-width: 65ch; margin-inline: auto; font-size: clamp(1.03rem, 1.65vw, 1.19rem); line-height: 1.73; }
.chapter-body p { margin: .92em 0; white-space: pre-line; }
.chapter-body h3 {
  color: #633a26;
  font-size: 1.33em;
  line-height: 1.25;
  margin: 1.65em 0 .55em;
  font-weight: 600;
  scroll-margin-top: 5rem;
}
.chapter-body .chapter-inscription { text-align: center; color: var(--book-accent); }
.chapter-body ul, .chapter-body ol { padding-left: 1.45rem; }
.chapter-body li { margin: .24em 0; }
.book-figures {
  margin: 1.5rem auto;
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.book-figures img { display: block; max-width: min(100%, 520px); max-height: 29rem; object-fit: contain; }
.book-figures:has(img + img) img { max-width: min(100%, 16rem); }
.book-table { max-width: 100%; margin: 1.5rem 0; overflow-x: auto; border: 1px solid var(--book-rule); }
.book-table table { width: 100%; border-collapse: collapse; font: .85rem/1.45 system-ui; }
.book-table th, .book-table td { min-width: 3.2rem; padding: .48rem .6rem; border-bottom: 1px solid #dfcfba; text-align: left; vertical-align: top; }
.book-table th { background: #e9d9c2; }
.book-table tr:nth-child(even) td { background: #f0e5d4; }
.chapter-turns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .9rem;
  border-top: 1px solid var(--book-rule);
  margin: 2rem auto 0;
  padding-top: .85rem;
  font-size: clamp(.9rem, 2vw, 1.08rem);
}
.chapter-turns a:last-child { text-align: right; }
.chapter-turns span { display: block; color: var(--book-ink); font: .75rem system-ui; margin-bottom: .35rem; }
@media (max-width: 760px) {
  .book-spread { display: flex; flex-direction: column; }
  .book-page-slot, .book-contents { width: 100%; }
  .book-contents { position: static; order: 1; }
  .book-shell.reading-one:not(.at-cover) .book-contents { order: 0; }
  .book-contents details { max-height: none; }
  .book-title-page { min-height: min(575px, 76vh); }
}
@media print {
  .book-reader-tools, .book-contents, .chapter-turns, .site-footer { display: none !important; }
  .book-site, .book-title-page, .book-chapter { background: white; }
  .book-spread, .book-page-slot > [data-book-page][hidden] { display: block !important; }
  .book-title-page, .book-chapter { box-shadow: none; border: none; border-radius: 0; padding: 0; }
  .book-chapter { break-before: page; }
  .chapter-opener, .book-figures { break-inside: avoid; }
}
