/* Scoped to the detail preview: the bookshelf and its breakpoints stay intact. */
.bookplate__cover-column { min-width: 0; padding: 12px 0; align-content: center; }
.bookplate__cover-fallback small { color: var(--book-ink); }
.book-viewer { width: 100%; min-width: 0; }
.book-viewer__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 290px;
  perspective: 900px;
  overflow: clip;
  outline-offset: -3px;
  border-radius: 2px;
}
.book-viewer.is-interactive .book-viewer__stage {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.book-viewer.is-dragging .book-viewer__stage { cursor: grabbing; }
.book-viewer__stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 300ms ease;
}
.book-viewer.is-ready canvas { opacity: 1; }
.book-viewer.is-webgl .bookplate__cover-frame { visibility: hidden; }
.book-viewer .bookplate__cover-frame {
  --book-depth: var(--viewer-depth, 24px);
  --book-half-depth: calc(var(--book-depth) / 2);
  --book-cover-border: 0px;
  width: auto;
  height: 210px;
  aspect-ratio: var(--cover-aspect, .625);
  filter: none;
  isolation: auto;
  transform: var(--viewer-rotation, rotateX(-8deg) rotateY(-24deg)) scale(var(--viewer-scale, 1));
  transition: none;
}
.book-viewer .bookplate__book-front,
.book-viewer .bookplate__book-back { border: 0; border-radius: 0; box-shadow: none; }
.book-viewer .bookplate__book-back { background: var(--book-back, var(--book-binding, var(--plate-accent))); }
.book-viewer .bookplate__cover { user-select: none; -webkit-user-drag: none; }
.book-viewer__status {
  margin: 6px auto 10px;
  max-width: 30ch;
  color: var(--plate-muted);
  font-size: .72rem;
  line-height: 1.45;
  text-align: center;
}
.book-viewer__status:empty { display: none; }
.book-viewer__controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 180px;
  margin: 12px auto 0;
}
.book-viewer__controls[hidden] { display: none; }
.book-viewer__controls button {
  min-width: 0;
  min-height: 44px;
  padding: 4px;
  color: var(--plate-link);
  border: 1px solid var(--plate-rule);
  border-radius: 3px;
  background: var(--paper-50);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1.1;
}
.book-viewer__controls [data-viewer-action="reset"],
.book-viewer__controls [data-viewer-action="spin"] { font-family: var(--font-mono); font-size: .74rem; overflow-wrap: anywhere; }
.book-viewer__controls button:hover { background: var(--paper-50); }
.book-viewer__controls button[aria-pressed="true"] { background: var(--plate-link); color: var(--paper-50); }
.bookplate .book-viewer :focus-visible { outline: 2px solid var(--plate-focus); outline-offset: 2px; }
.bookplate .book-viewer__stage:focus-visible { outline-offset: -3px; }
@media (max-width: 760px) { .book-viewer__stage { height: 255px; } }
@media (max-width: 620px) {
  .book-viewer { max-width: 300px; margin-inline: auto; }
  .book-viewer__stage { height: clamp(210px, 28dvh, 255px); }
}
@media (prefers-reduced-motion: reduce) {
  .book-viewer__stage canvas { transition: none; }
}
