/* Cover-only local refinement: mist-blue reserved books and a quiet catalogue entry. */
.library-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.library-featured-rail {
  position: relative;
  touch-action: pan-x pan-y pinch-zoom;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 18px;
  cursor: grab;
  user-select: none;
}
.library-featured-rail[data-dragging="true"] { cursor: grabbing; }
.library-featured-rail::before,
.library-featured-rail::after { content: ""; flex: 0 0 calc(50% - 65px); min-width: 0; pointer-events: none; }
.library-featured-book--pending .library-featured-front {
  background: #fff;
  border: 1px solid #b6cbd0;
  box-shadow: 3px 4px 7px #3b403c14;
}
.library-featured-book--pending .library-featured-front::after {
  content: none;
  position: absolute;
  inset: 12px 9px;
  border: 1px solid #ffffff54;
  pointer-events: none;
}
.library-featured-book--pending .library-featured-spine {
  background: #fff;
  border: 1px solid #b6cbd0;
  color: #3d4a50;
}
.library-featured-book--pending .library-featured-question,
.library-featured-book--pending .library-featured-spine > span { display: none; }
/* Only lift the warm lettering at the top of this cover, not the illustration. */
img[src$="/poison-apple-case/cover.webp"] { filter: url(#poison-apple-letter-light); }
/* The spine mask excludes the apple emblem and author credit. */
img[src$="/poison-apple-case/spine.webp"] { filter: url(#poison-apple-spine-letter-light); }
.library-featured-rail[data-dragging="true"] .library-featured-book { cursor: grabbing; }
.library-browse-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 17px 0;
  border-top: 1px solid #d3d9ce;
  color: #405c59;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .4px;
}
.library-browse-all svg { width: 24px; height: 24px; stroke-width: 1.3; color: #6b8079; }
.library-browse-all:hover { color: #294e4a; }
#featured-details .library-featured-meta { flex: 0 1 auto; }
#featured-details .library-browse-all {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
  gap: 5px;
  min-height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0;
  white-space: nowrap;
}
#featured-details .library-browse-all svg { width: 14px; height: 14px; }

/* Selected-book reading stays on this page. Half sheets preserve the supplied spread. */
#inline-reader { margin-top: 8px; padding: 0; }
#inline-book {
  position: relative;
  width: 100%;
  aspect-ratio: 2000 / 1417;
  background: #fffefa;
  border: 1px solid #d9ddd3;
  box-shadow: 0 3px 10px #314b3d16;
  perspective: 1400px;
  transform-style: preserve-3d;
  touch-action: pan-y pinch-zoom;
}
#inline-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
#inline-book::after {
  content: "";
  position: absolute;
  z-index: 6;
  inset: 0;
  background: linear-gradient(90deg, transparent 48.5%, #3e50430b 49.8%, #ffffff5c 50.1%, transparent 51.5%);
  pointer-events: none;
}
#inline-under,
#inline-sheet {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  display: none;
  pointer-events: none;
}
#inline-under { right: 0; z-index: 1; overflow: hidden; }
#inline-sheet { left: 50%; z-index: 4; transform-origin: left center; transform-style: preserve-3d; }
#inline-sheet > .front,
#inline-sheet > .back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fffefa;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
#inline-sheet > .front { transform: translateZ(.1px); }
#inline-sheet > .back { transform: rotateY(180deg) translateZ(.1px); }
#inline-under > img,
#inline-front,
#inline-back {
  position: absolute;
  top: 0;
  display: block;
  width: 200%;
  max-width: none;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}
#inline-under > img,
#inline-front { left: -100%; }
#inline-back { left: 0; }
#inline-sheet > .front::after,
#inline-sheet > .back::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
#inline-sheet > .front::after { background: linear-gradient(90deg, #374a4214, transparent 12%); }
#inline-sheet > .back::after { background: linear-gradient(270deg, #374a4214, transparent 12%); }
#inline-book[data-direction="previous"] #inline-under { left: 0; right: auto; }
#inline-book[data-direction="previous"] #inline-sheet { left: 0; transform-origin: right center; }
#inline-book[data-direction="previous"] #inline-under > img,
#inline-book[data-direction="previous"] #inline-front { left: 0; }
#inline-book[data-direction="previous"] #inline-back { left: -100%; }
#inline-book[data-flipping="true"] #inline-under,
#inline-book[data-flipping="true"] #inline-sheet { display: block; }
#inline-book[data-flipping="true"][data-direction="next"] #inline-sheet { animation: library-leaf-next 520ms cubic-bezier(.35, .02, .2, .98) both; }
#inline-book[data-flipping="true"][data-direction="previous"] #inline-sheet { animation: library-leaf-previous 520ms cubic-bezier(.35, .02, .2, .98) both; }
#inline-book[data-empty="true"] #inline-image,
#inline-book[data-empty="true"] #inline-under,
#inline-book[data-empty="true"] #inline-sheet { display: none; }
#inline-book[data-empty="true"]::after { display: none; }
#inline-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; font-size: 13px; line-height: 1.8; color: #667a70; text-align: center; }
#inline-reader > footer,
#inline-reader > .library-inline-controls { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 2px 0; }
#inline-caption { flex: 1; min-width: 0; margin: 0; font-size: 11px; line-height: 1.6; color: #667a70; }
#inline-reader button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 10px; border: 0; background: transparent; color: #47675c; }
#inline-reader button svg { width: 20px; height: 20px; }
#inline-reader button:disabled { opacity: .3; cursor: default; }
@keyframes library-leaf-next { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes library-leaf-previous { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
body[data-library-view="all"] .library-intro { padding-top: 24px; padding-bottom: 22px; }
body[data-library-view="all"] .library-intro h1 { font-size: 36px; }
body[data-library-view="all"] .library-collection { border-top: 0; padding-top: 0; }
body[data-library-view="all"] .library-search { margin-bottom: 25px; }
body[data-library-view="all"] .library-search > div {
  min-height: 48px;
  padding: 3px 4px 3px 12px;
  border-color: #d4dcd1;
  border-radius: 6px;
  background: #fffdf7;
}
body[data-library-view="all"] .library-search input { padding: 10px 0; font-size: 14px; }
body[data-library-view="all"] .library-search button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: 4px;
  background: transparent;
  color: #607b70;
}
body[data-library-view="all"] .library-search button svg { width: 18px; height: 18px; }
body[data-library-view="all"] article.library-book { cursor: default; }
body[data-library-view="all"] .library-book-cover { padding: 5px 3px 10px; border-bottom: 0; background: transparent; }
body[data-library-view="all"] .library-book-cover img { box-shadow: 2px 4px 7px #2d48541a; }
body[data-library-view="all"] .library-book h3 { font-weight: 600; }
body[data-library-view="all"] .library-book p { color: #65766d; }
@media (max-width: 700px) {
  .library-featured-book--pending .library-featured-front::after { inset: 10px 8px; }
  .library-browse-all { min-height: 54px; padding-top: 16px; padding-bottom: 16px; }
  body[data-library-view="all"] .library-intro { padding-top: 20px; padding-bottom: 20px; }
  body[data-library-view="all"] .library-intro h1 { font-size: 30px; }
  body[data-library-view="all"] .library-books { gap: 25px 14px; }
  #featured-details .library-browse-all { font-size: 11px; }
  body[data-library-view="featured"] .library-header { padding-top: 9px; padding-bottom: 9px; }
  body[data-library-view="featured"] .library-kicker { display: none; }
  body[data-library-view="featured"] .library-intro { padding-top: 14px; padding-bottom: 4px; }
  body[data-library-view="featured"] .library-featured { padding-bottom: 0; margin-bottom: 0; }
  body[data-library-view="featured"] .library-featured-stage,
  body[data-library-view="featured"] .library-featured-rail { min-height: 174px; }
  body[data-library-view="featured"] .library-featured-rail { padding-top: 6px; padding-bottom: 12px; }
  body[data-library-view="featured"] .library-featured-book { height: 156px; }
  body[data-library-view="featured"] .library-featured-solid { width: 111px; height: 156px; }
  body[data-library-view="featured"] .library-featured-book[aria-pressed="true"] { flex-basis: 113px; width: 113px; }
  body[data-library-view="featured"] #inline-reader { margin-top: 4px; }
}
@media (max-width: 350px) {
  #featured-details { column-gap: 8px; }
  #featured-details h2 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .library-featured-rail { scroll-behavior: auto; }
  #inline-book[data-flipping="true"] #inline-sheet { animation-duration: 1ms; }
}
