/* Continuous rotation in the existing small catalogue slot; never a modal. */
.library-all-page .library-book--three-d .library-book-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  width: 100%;
  min-height: 44px;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 8px 13px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.library-book-rotator {
  position: relative;
  width: 100%;
  aspect-ratio: 644 / 900;
  perspective: 700px;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.library-book-rotator[data-dragging="true"] { cursor: grabbing; }
.library-book-rotator:focus-visible { outline: 2px solid #8fb3bc; outline-offset: 7px; border-radius: 3px; }
.library-book-object {
  --book-depth: 15px;
  --book-yaw: 32deg;
  --book-pitch: -5deg;
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 644 / 900;
  transform-style: preserve-3d;
  transform: rotateX(var(--book-pitch)) rotateY(var(--book-yaw));
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.library-book-object[data-smooth="true"] { transition: transform 220ms ease-out; }
.library-book-face {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.library-book-face--front,
.library-book-face--back {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 1px 2px 2px 1px;
  background: var(--book-tone, #dce9ec);
  box-shadow: 0 1px 2px #283a3a30;
}
.library-book-face--front { transform: translateZ(calc(var(--book-depth) / 2)); }
.library-book-face--back { transform: rotateY(180deg) translateZ(calc(var(--book-depth) / 2)); }
.library-book-face--front::after,
.library-book-face--back::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 1px 0 1px #ffffff50, inset -1px 0 1px #27393b24;
  background: linear-gradient(90deg, #192c4212, transparent 10%, #ffffff0b 82%, #ffffff16);
}
.library-book-face--spine {
  left: calc(var(--book-depth) / -2);
  top: 0;
  width: var(--book-depth);
  height: 100%;
  transform: rotateY(-90deg);
  background: var(--book-tone, #d1e1e5);
  box-shadow: inset 2px 0 2px #ffffff30, inset -2px 0 2px #1b2b3126;
}
.library-book-face--pages {
  right: calc(var(--book-depth) / -2 + 1px);
  top: 2px;
  width: calc(var(--book-depth) - 2px);
  height: calc(100% - 4px);
  transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #fffcee 0 1px, #d8d3c8 1px 1.4px, #f9f6e9 1.4px 2.4px);
}
.library-book-face--top,
.library-book-face--bottom {
  left: 1px;
  width: calc(100% - 2px);
  height: calc(var(--book-depth) - 2px);
  background: repeating-linear-gradient(0deg, #fffdf4 0 1px, #dcd7ca 1px 1.4px, #f4f0e3 1.4px 2.4px);
}
.library-book-face--top { top: calc((var(--book-depth) - 2px) / -2 + 1px); transform: rotateX(90deg); }
.library-book-face--bottom { bottom: calc((var(--book-depth) - 2px) / -2 + 1px); transform: rotateX(-90deg); }
.library-all-page .library-book--three-d .library-book-face > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: fill;
  border-radius: inherit;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.library-all-page .library-book--three-d h3 { margin-top: 6px; }
@media (min-width: 700px) { .library-book-object { --book-depth: 20px; } }
@media (prefers-reduced-motion: reduce) { .library-book-object[data-smooth="true"] { transition: none; } }
