.notes-access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notes-access { background: #241a21; }
.notebook {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(185px, 222px);
  align-items: start;
  gap: clamp(16px, 2.5vw, 32px);
  margin-top: 24px;
}
.book-reader { min-width: 0; }
.book-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.book-heading h3 { font: 400 clamp(1.4rem, 2.8vw, 2rem)/1.15 var(--serif); }
.book-heading p { flex-shrink: 0; font-size: .86rem; color: var(--muted); }
.book-binding {
  position: relative;
  padding: clamp(5px, 1vw, 11px);
  border: 1px solid #79584a;
  border-radius: 11px;
  background: linear-gradient(105deg, #38241f, #563426 48%, #211512 50%, #52342a 52%, #30201c);
  box-shadow: 0 11px 28px #09070999, inset 0 0 0 2px #211613;
}
.book-pages {
  isolation: isolate;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  aspect-ratio: 3 / 2;
  border-radius: 6px 6px 7px 7px;
  border: 1px solid #e6b98088;
  background: #4b3027;
  box-shadow: 0 2px 0 #bc915b, 0 4px 0 #6a4934, 0 5px 0 #a4774b;
  perspective: 1350px;
  overflow: clip;
  touch-action: pan-y pinch-zoom;
}
.book-pages:not(:disabled) { cursor: zoom-in; }
.book-pages > img { width: 100%; height: 100%; object-fit: contain; }
.book-pages::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 48.85%, #30201528 49.78%, #30201553 50%, #fff3d217 50.2%, transparent 51.2%);
  pointer-events: none;
}
.book-binding[data-portrait] {
  max-width: 34rem;
  margin-inline: auto;
  background: #4b3027;
}
.book-binding[data-portrait] .book-pages { aspect-ratio: 2 / 3; }
.book-binding[data-portrait] .book-pages::after { display: none; }
.book-leaf {
  position: absolute;
  z-index: 1;
  inset: 0 0 0 50%;
  transform-origin: left center;
  background: #d3a669;
  backface-visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  box-shadow: 6px 0 12px #120b0866;
}
.book-leaf[data-direction="back"] { inset: 0 50% 0 0; transform-origin: right center; box-shadow: -6px 0 12px #120b0866; }
.book-leaf img { position: absolute; inset: 0 0 0 auto; height: 100%; width: 200%; max-width: none; object-fit: contain; }
.book-leaf[data-direction="back"] img { inset: 0 auto 0 0; }
.book-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 12px; }
.book-controls .button { min-height: 38px; padding-block: 5px; }
.book-controls > :first-child { justify-self: start; }
.book-controls > :last-child { justify-self: end; }
.book-controls button:disabled { opacity: .42; cursor: default; }
.book-controls button:disabled:hover { background: #2a2028; }
.book-enlarge { background: none; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.book-message { font-size: .88rem; color: var(--muted); margin-top: 10px; }
.book-index { border: 1px solid #61454a; border-radius: 9px; background: #231a22; padding: 15px 13px; }
.book-index h3 { margin: 0 7px 10px; font: 1.3rem var(--serif); color: var(--gold); }
.book-index ol { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.book-index a { display: block; padding: 8px 9px; border: 1px solid transparent; border-radius: 5px; font-size: .9rem; color: var(--muted); text-decoration: none; }
.book-index a:hover { color: var(--ink); border-color: #745446; }
.book-index a[aria-current] { color: var(--ink); border-color: #8f6249; background: #392634; }
.book-transcription { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 12px; }
.book-transcription summary { color: var(--gold); font-size: .9rem; cursor: pointer; }
.book-transcription div { margin-top: 10px; color: var(--muted); max-width: 70ch; }
.book-transcription ul { padding-left: 1.25em; }
@media (max-width: 850px) {
  .notebook { grid-template-columns: minmax(0, 1fr); }
  .book-index { padding-block: 10px; }
  .book-index ol { grid-template-columns: repeat(auto-fit, minmax(133px, 1fr)); }
}
@media (max-width: 520px) {
  .notebook { margin-top: 18px; }
  .book-heading { flex-wrap: wrap; }
  .book-controls .button { padding-inline: 11px; }
}
