.book-reader {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  color: #315d4b;
}
.book-reader[data-active="false"] .book-toolbar,
.book-reader[data-active="false"] .book-page-controls {
  visibility: hidden;
  opacity: 0;
}
.book-projection {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 660px;
  transform-origin: 0 0;
  visibility: hidden;
  will-change: transform, opacity;
  backface-visibility: hidden;
  pointer-events: none;
}
.book-reader[data-active="true"] .book-projection { pointer-events: auto; }
.book-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  animation: book-ink-arrive 760ms cubic-bezier(.2,.6,.2,1) both;
}
@keyframes book-ink-arrive {
  0%, 38% { opacity: 0; transform: perspective(1400px) rotateY(-11deg); }
  64% { opacity: .4; }
  100% { opacity: 1; transform: perspective(1400px) rotateY(0deg); }
}
.book-reader[data-quiet="true"] .book-spread { animation: none; }
.book-leaf {
  position: relative;
  min-width: 0;
  padding: 44px 46px 58px;
  overflow: hidden;
}
.book-leaf::before {
  content: "";
  position: absolute;
  inset: 22px 20px;
  border: 1px solid #a8915d36;
  pointer-events: none;
}
.book-leaf--left { padding-right: 48px; }
.book-leaf--right { padding-left: 48px; }
.book-entry { height: 100%; }
.book-cover {
  position: relative;
  height: 258px;
  padding: 8px;
  background: #e6deca;
  border: 1px solid #8c774940;
  box-shadow: 0 6px 14px #55472f15, inset 0 0 0 4px #fff8e6;
  overflow: hidden;
}
.book-cover img, .book-cover video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85);
}
.book-media-mark {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #8a8c65;
  background: radial-gradient(ellipse, #f3ecd8, #d9dfc9);
  font: italic 28px var(--serif);
}
.book-video-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid #fff8edaa;
  border-radius: 50%;
  background: #254c3b70;
  color: #fff8ed;
  font-size: 30px;
}
.book-date {
  display: block;
  margin: 23px 0 12px;
  color: #7b7863;
  font-size: 17px;
  letter-spacing: .8px;
}
.book-entry-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font: 500 36px/1.25 var(--serif);
  overflow-wrap: anywhere;
  color: #315744;
}
.book-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 16px;
  font-size: 21px;
  line-height: 1.65;
  color: #64705a;
  overflow-wrap: anywhere;
}
.book-folio {
  position: absolute;
  inset: auto 0 30px;
  text-align: center;
  font: 18px var(--serif);
  color: #8f805e;
  letter-spacing: 2px;
}
.book-story-link {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.book-flourish { color: #ad9460; font: 58px/1 var(--serif); margin-bottom: 52px; }
.book-read-story, .book-empty-title {
  font: italic 500 65px/.98 var(--serif);
  letter-spacing: -2px;
  color: #315d4b;
  text-align: center;
}
.book-read-story { display: block; padding: 20px 10px; text-decoration: none; }
.book-read-arrow { display: block; margin-top: 20px; font: 34px/1 var(--serif); color: #a28b57; }
.book-read-story:hover { color: #a18a55; }
.book-read-story:hover .book-read-arrow { transform: translate(3px, -3px); }
.book-read-story, .book-read-arrow { transition: color 220ms, transform 220ms; }
.book-story-count { margin-top: 40px; font: 22px var(--serif); color: #7b7d66; letter-spacing: 3px; }
.book-leaf .state-panel { min-height: 100%; padding: 24px 5px; color: #5d705a; font-size: 23px; }
.book-leaf .state-panel h3 { font: 32px var(--serif); }
.book-leaf .state-panel p { font-size: 20px; overflow-wrap: anywhere; }
.book-leaf .text-button { font-size: 22px; }
.book-leaf .form-error { font-size: 17px; }
.book-page-controls { position: absolute; inset: 52% 22px auto; display: flex; justify-content: space-between; }
.book-page-arrow {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #e2cf9e9c;
  border-radius: 50%;
  color: #ece4c9;
  background: #183e34a8;
  box-shadow: inset 0 1px #fff8e726, 0 4px 20px #0c241d26;
  backdrop-filter: blur(12px);
  font: 25px/1 var(--serif);
  pointer-events: auto;
  transition: background 180ms, opacity 180ms, transform 180ms;
}
.book-page-arrow:hover:not(:disabled) { background: #315d4bd9; transform: scale(1.05); }
.book-page-arrow:disabled { opacity: .28; cursor: default; }
.book-toolbar {
  position: absolute;
  inset: auto auto max(25px, env(safe-area-inset-bottom)) 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  max-width: calc(100vw - 32px);
  border: 1px solid #e1cd9d66;
  border-radius: 32px;
  background: #f9f3e2dc;
  box-shadow: inset 0 1px #fffdf2cc, 0 8px 30px #0c241d1f;
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transition: opacity 300ms;
}
.book-search { display: flex; align-items: center; gap: 8px; padding-left: 10px; min-width: 0; }
.book-search svg { flex-shrink: 0; }
.book-search input {
  width: 165px;
  min-width: 0;
  height: 36px;
  background: transparent;
  border: 0;
  color: #315d4b;
  font-size: 12px;
  outline-offset: 2px;
}
.book-search input::placeholder { color: #6c7f69; }
.book-filter, .book-publish {
  min-height: 36px;
  border: 1px solid #b8ad834d;
  border-radius: 24px;
  padding: 7px 12px;
  background: #fff9eb99;
  color: #315d4b;
  font-size: 12px;
  white-space: nowrap;
}
.book-read-story:focus-visible, .book-page-arrow:focus-visible,
.book-search input:focus-visible, .book-filter:focus-visible, .book-publish:focus-visible {
  outline: 2px solid #b29a5c;
  outline-offset: 5px;
}
.book-reader .fairy-dialog { pointer-events: auto; }
@media (max-width: 760px) {
  .book-leaf { padding: 43px 36px 56px; }
  .book-cover { height: 225px; }
  .book-date { font-size: 28px; margin: 20px 0 14px; letter-spacing: 0; }
  .book-entry-title { font-size: 49px; line-height: 1.2; }
  .book-excerpt { font-size: 34px; line-height: 1.5; -webkit-line-clamp: 2; margin-top: 14px; }
  .book-folio { font-size: 28px; }
  .book-flourish { font-size: 68px; margin-bottom: 42px; }
  .book-read-story, .book-empty-title { font-size: 78px; }
  .book-read-arrow { font-size: 48px; }
  .book-story-count { font-size: 34px; }
  .book-leaf .state-panel { font-size: 34px; }
  .book-leaf .state-panel h3 { font-size: 40px; }
  .book-leaf .state-panel p, .book-leaf .text-button { font-size: 30px; }
  .book-page-controls { inset-inline: 8px; top: 56%; }
  .book-page-arrow { width: 44px; height: 44px; }
  .book-toolbar { gap: 5px; padding: 6px; bottom: max(20px, env(safe-area-inset-bottom)); }
  .book-search { padding-left: 6px; gap: 5px; }
  .book-search input { width: 110px; font-size: 16px; height: 40px; }
  .book-filter, .book-publish { min-height: 40px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-read-story, .book-read-arrow, .book-page-arrow, .book-toolbar { transition: none; }
  .book-spread { animation: none; }
}
