/* The library has one shared image/title/caption grid, separate from relay choices. */
.library-screen .book-view {
  left: 220px;
  right: 220px;
  top: 250px;
  bottom: 130px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 35px;
  gap: 18px;
}
.library-screen .chapter-grid {
  min-height: 0;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 24px 42px;
}
.library-screen .library-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 36px 27px;
  gap: 6px;
  padding: 0;
  text-align: center;
  align-content: start;
  border-radius: 2px;
  outline: 2px solid transparent;
  outline-offset: 8px;
  transition: outline-color .25s ease, background-color .25s ease;
}
.library-screen .library-card:is(:hover, :focus-visible) {
  outline-color: var(--red);
  background-color: #9845300c;
}
.library-screen .library-thumb {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  /* Raster alpha stretches to this card; the shared SVG letterboxes itself. */
  mask-image: url('/assets/ui/library-edge-alpha-v1.png');
  -webkit-mask-image: url('/assets/ui/library-edge-alpha-v1.png');
}
.library-screen .library-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: filter .3s;
}
.library-screen .library-card:hover img { filter: saturate(1.12); }
.library-screen .library-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: center;
  max-width: calc(100% - 136px);
  min-width: 0;
}
.library-screen .library-title h3 {
  min-width: 0;
  font-size: 29px;
  line-height: 36px;
  letter-spacing: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-screen .canonical-seal {
  position: absolute;
  left: calc(100% + 11px);
  top: 50%;
  color: #984530;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px 1px 3px 1px;
  padding: 1px 4px 2px 6px;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 2px;
  white-space: nowrap;
  transform: translateY(-50%) rotate(-3deg);
}
.library-screen .library-card > p {
  font-size: 19px;
  line-height: 27px;
  color: #8a8671;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-screen .pagination {
  position: static;
  height: auto;
}
