/* ==========================================================================
   DUBURI PHYSICAL BOOKS SYSTEM (v57)
   1. Realistic 3D Hardcover Books Shelf (library.html)
   2. True Full-Screen Physical Book Reader (book.html — 100vw x 100dvh)
      - StPageFlip Grab-and-Curl
      - Dynamic Growing Left / Shrinking Right Page Stack
      - Real Interactive Dog-Ear Corner Folding + Jump Popover
      - Floating Reader Control Bar (Dark Mode, Text Size, EN / বাংলা)
   3. Manual Page-by-Page Admin Books & Page Manager (admin.html)
   ========================================================================== */

/* ==========================================================================
   1. REALISTIC 3D PHYSICAL BOOKS SHELF (library.html)
   ========================================================================== */
.books-shelf-wrap {
  margin-top: clamp(2.5rem, 4.5vw, 3.75rem);
}

.books-shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: clamp(2.5rem, 4.5vw, 3.75rem) clamp(1.75rem, 3.5vw, 3rem);
  align-items: end;
  justify-items: center;
}

@media (max-width: 520px) {
  .books-shelf-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.85rem;
  }
}

/* Individual 3D Standing Physical Book */
.book-3d-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 268px;
  text-decoration: none;
  color: inherit;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}

.book-3d-stage {
  position: relative;
  width: 100%;
  padding-right: 14px; /* space for realistic paper-edge thickness on the right */
  padding-bottom: 18px;
}

/* Grounded physical ambient shadow beneath the standing book */
.book-3d-shadow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 2px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(2, 24, 36, 0.34) 0%, rgba(2, 24, 36, 0.14) 55%, rgba(2, 24, 36, 0) 78%);
  filter: blur(5px);
  transition: transform 0.55s var(--ease-wave), opacity 0.45s ease;
  pointer-events: none;
}

.book-3d {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transform: rotateY(-10deg) rotateX(1.5deg);
  transform-origin: left center;
  transition: transform 0.58s var(--ease-wave), box-shadow 0.58s var(--ease-wave);
}

.book-3d-link:hover .book-3d,
.book-3d-link:focus-visible .book-3d {
  transform: rotateY(-18deg) rotateX(2.5deg) translateY(-10px);
}

.book-3d-link:hover .book-3d-shadow,
.book-3d-link:focus-visible .book-3d-shadow {
  transform: scale(0.94) translateX(-4px);
  opacity: 0.72;
}

/* Hardcover Front Face */
.book-3d__cover {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  border-radius: 3px 10px 10px 3px;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 24%, #085A75 0%, #033346 58%, #021C27 100%);
  box-shadow:
    -6px 8px 18px rgba(2, 22, 32, 0.28),
    10px 14px 28px rgba(2, 22, 32, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35);
}

.book-3d__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.95) contrast(1.03);
}

/* Subtle dark print-readability wash across the cover image */
.book-3d__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2, 22, 32, 0.52) 0%,
    rgba(2, 22, 32, 0.22) 34%,
    rgba(2, 20, 30, 0.26) 56%,
    rgba(2, 16, 25, 0.78) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Realistic Vertical Left Spine Crease & Binding Hinge */
.book-3d__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 24px;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(255, 255, 255, 0.22) 18%,
    rgba(0, 0, 0, 0.14) 36%,
    rgba(0, 0, 0, 0.34) 56%,
    rgba(255, 255, 255, 0.26) 66%,
    rgba(255, 255, 255, 0.0) 100%
  );
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* Printed-Directly-On-Cover Typography (Title + Author printed onto cloth/matte cover) */
.book-3d__print {
  position: relative;
  z-index: 3;
  height: 100%;
  padding: 1.55rem 1.35rem 1.45rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.book-3d__print-top {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.book-3d__imprint {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 232, 210, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.book-3d__rule {
  width: 30px;
  height: 1.5px;
  background: rgba(235, 166, 98, 0.85);
}

.book-3d__print-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.book-3d__title {
  font-family: var(--font-serif);
  font-size: clamp(1.28rem, 1.8vw, 1.52rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: rgba(252, 248, 239, 0.96);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 -0.5px 0 rgba(255, 255, 255, 0.16);
  margin: 0;
  mix-blend-mode: normal;
}

.book-3d__title-bn {
  font-family: var(--font-bn);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(235, 242, 244, 0.86);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.book-3d__author {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(252, 248, 239, 0.24);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(244, 236, 220, 0.90);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.52);
}

/* Realistic Lighting & Matte Paper Sheen Overlay OVER BOTH Image & Printed Text */
.book-3d__sheen {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.19) 0%,
      rgba(255, 255, 255, 0.06) 24%,
      rgba(255, 255, 255, 0.0) 46%,
      rgba(0, 0, 0, 0.06) 76%,
      rgba(0, 0, 0, 0.22) 100%
    );
  mix-blend-mode: soft-light;
}

.book-3d__grain {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset -2px 0 6px rgba(0, 0, 0, 0.28);
}

/* Soft Cream Paper-Block Thickness Visible on the Right Edge */
.book-3d__pages-edge {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: -13px;
  width: 15px;
  z-index: 2;
  border-radius: 0 3px 3px 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 6%, rgba(0, 0, 0, 0) 94%, rgba(0, 0, 0, 0.16) 100%),
    repeating-linear-gradient(
      90deg,
      #F7F3EA 0px,
      #F7F3EA 1.5px,
      #E3DCCF 1.5px,
      #E3DCCF 2.8px
    );
  box-shadow:
    inset 2px 0 4px rgba(0, 0, 0, 0.18),
    2px 4px 10px rgba(2, 22, 32, 0.16);
  transform: skewY(-1.5deg);
}

/* Hardcover Back Board Lip peeking behind the paper stack */
.book-3d__back-board {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 6px;
  right: -16px;
  z-index: 1;
  border-radius: 3px 9px 9px 3px;
  background: #02202E;
  box-shadow: 4px 10px 22px rgba(2, 22, 32, 0.28);
}

/* Quiet Subtle Open-Book Prompt (NO separate text box — just tiny subtle hover cue) */
.book-3d-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: #546F7C;
  transition: color 0.25s ease;
}

.book-3d-link:hover .book-3d-meta {
  color: #B83D06;
}

/* ==========================================================================
   2. FULL-SCREEN DEDICATED PHYSICAL BOOK READER (book.html — 100vw x 100dvh)
      - Mobile: Rock-solid 1:1 Finger-Following Page Peel & Slide (Forward & Back)
        + Dedicated Prev/Next Arrows Below the Book
      - Desktop: Cursor-Following Corner Peel Hover + 1:1 3D Tilt & Curl Flip
      - Smart Vertical Scrolling Inside .book-page__body When Text Overflows
   ========================================================================== */
html.book-reader-html,
body.page-book-reader {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  background: radial-gradient(ellipse at 50% 35%, #F4F0E8 0%, #E7E0D3 68%, #DDD4C4 100%);
  color: #22201D;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

body.page-book-reader.reader-theme-dark {
  background: radial-gradient(ellipse at 50% 35%, #1A2025 0%, #12161A 68%, #0C0F12 100%);
  color: #E8E3DA;
}

.book-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: calc(max(8px, env(safe-area-inset-top, 8px)) + 42px) 8px calc(max(10px, env(safe-area-inset-bottom, 10px)) + 54px);
  overflow: hidden;
  overscroll-behavior: none;
}

@media (min-width: 860px) {
  .book-viewport {
    padding: 58px 60px 76px;
    gap: 0;
  }
}

/* Minimal Subtle Top-Left Back Button (NO Navbar!) */
.book-back-btn {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 10px));
  left: clamp(10px, 2vw, 26px);
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  height: 36px;
  padding: 0 0.9rem 0 0.76rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(5, 74, 99, 0.14);
  color: #053244;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 20px -8px rgba(2, 26, 38, 0.18);
  transition: background-color 0.2s, transform 0.22s var(--ease-wave), color 0.2s;
  touch-action: manipulation;
}

.book-back-btn:hover {
  background: #FFFFFF;
  color: #B83D06;
  transform: translateX(-2px);
}

body.reader-theme-dark .book-back-btn {
  background: rgba(28, 34, 39, 0.88);
  border-color: rgba(232, 228, 220, 0.16);
  color: #E8E4DC;
}

body.reader-theme-dark .book-back-btn:hover {
  background: #2A3238;
  color: #FFA06E;
}

/* Subtle Top-Right Page Counter Pill */
.book-page-status {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: clamp(12px, 2vw, 26px);
  z-index: 140;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5C554B;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.3rem 0.74rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(34, 34, 34, 0.08);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

body.reader-theme-dark .book-page-status {
  background: rgba(28, 34, 39, 0.78);
  border-color: rgba(232, 228, 220, 0.12);
  color: #B6B1A8;
}

/* Physical Book Shell + Dynamic Left/Right Page Stacks */
.book-physical-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  max-width: 100%;
  --stack-left: 0px;
  --stack-right: 12px;
  --book-shift-x: 0%;
  transform: translateX(var(--book-shift-x));
  will-change: transform;
}

.book-desk-shadow {
  position: absolute;
  inset: 14px -8px -18px -8px;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 65%, rgba(28, 22, 14, 0.28) 0%, rgba(28, 22, 14, 0.12) 55%, rgba(28, 22, 14, 0) 80%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

body.reader-theme-dark .book-desk-shadow {
  background: radial-gradient(ellipse at 50% 65%, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 58%, rgba(0, 0, 0, 0) 80%);
}

/* Visible Dynamic Layered Paper Stacks (Left grows thicker, Right shrinks thinner) */
.book-stack {
  position: relative;
  z-index: 2;
  align-self: stretch;
  margin-block: 5px;
  flex-shrink: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  background-repeat: repeat;
}

.book-stack--left {
  width: var(--stack-left);
  border-radius: 4px 0 0 4px;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.16) 100%),
    repeating-linear-gradient(90deg, #DDD5C6 0px, #DDD5C6 1px, #F7F3EA 1px, #F7F3EA 2.5px);
  box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.14), -3px 4px 10px rgba(28, 22, 14, 0.18);
  border-left: 2px solid #043142;
}

.book-stack--right {
  width: var(--stack-right);
  border-radius: 0 4px 4px 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.16) 100%),
    repeating-linear-gradient(90deg, #F7F3EA 0px, #F7F3EA 1.5px, #DDD5C6 1.5px, #DDD5C6 2.5px);
  box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.14), 3px 4px 10px rgba(28, 22, 14, 0.18);
  border-right: 2px solid #043142;
}

.book-stack.is-empty {
  width: 0 !important;
  opacity: 0;
  border-width: 0;
  box-shadow: none;
}

body.reader-theme-dark .book-stack--left {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(90deg, #252B30 0px, #252B30 1px, #353D44 1px, #353D44 2.5px);
  border-left-color: #0E1418;
}

body.reader-theme-dark .book-stack--right {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(90deg, #353D44 0px, #353D44 1.5px, #252B30 1.5px, #252B30 2.5px);
  border-right-color: #0E1418;
}

/* ==========================================================================
   MOBILE BOTTOM PREV / NEXT ARROW BAR (DIRECTLY BELOW THE BOOK!)
   ========================================================================== */
.book-mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 440px;
  padding-inline: 4px;
  flex-shrink: 0;
  z-index: 25;
}

@media (min-width: 860px) {
  .book-mobile-nav {
    display: none;
  }
}

.book-mob-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  height: 36px;
  min-width: 92px;
  padding: 0 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(5, 74, 99, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: #053244;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 12px -4px rgba(2, 26, 38, 0.14);
  transition: background-color 0.18s, transform 0.18s, opacity 0.18s;
}

.book-mob-nav-btn:active:not(:disabled) {
  transform: scale(0.96);
  background: #EAF4F8;
}

.book-mob-nav-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.book-mob-page-pill {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: #655E53;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

body.reader-theme-dark .book-mob-nav-btn {
  background: rgba(28, 34, 39, 0.90);
  border-color: rgba(232, 228, 220, 0.16);
  color: #EAE6DE;
}

body.reader-theme-dark .book-mob-page-pill {
  color: #A8A39A;
}

body.page-book-reader.reader-theme-white .book-mob-nav-btn {
  background: #FFFFFF;
  border-color: rgba(17, 17, 17, 0.16);
  color: #111111;
}

body.page-book-reader.reader-theme-white .book-mob-page-pill {
  color: #555555;
}

/* ==========================================================================
   INTERACTIVE BOOK STAGE — PERSISTENT DOM DECK (ZERO REBUILD DURING DRAG!)
   - Mobile: Persistent .book-sheet deck with 1:1 finger tracking, subtle
     curved paper lift & gleaming paper-curl edge highlight
   - Desktop: Persistent 2-sided 3D .book-leaf spine deck with cursor-following
     hover corner peel + 1:1 3D X/Y drag lighting
   ========================================================================== */
.book-flip-stage {
  position: relative;
  z-index: 3;
  perspective: 2200px;
  transform-style: preserve-3d;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior-x: none;
}

.book-flip-stage.is-single {
  overflow: visible;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

.book-flip-stage.is-dragging {
  cursor: grabbing;
}

/* --- MOBILE PERSISTENT TRUE 3D FLIPPING PAGE DECK --- */
.book-mobile-deck {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-style: preserve-3d;
}

.book-sheet {
  position: absolute;
  inset: 0;
  display: none;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  --turn-sin: 0;
  --curl-y: 50%;
  --sheet-shadow: 0;
}

.book-sheet.is-visible {
  display: block;
}

.book-sheet__face {
  position: absolute;
  inset: 0;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 14px 36px rgba(18, 14, 8, calc(var(--turn-sin) * 0.36));
}

.book-sheet__face--front {
  transform: rotateY(0deg);
}

.book-sheet__face--back {
  transform: rotateY(180deg);
  background: linear-gradient(90deg, rgba(82, 68, 48, 0.14) 0%, #F7F2E8 16%, #EFE7D8 100%);
  border: 1px solid rgba(82, 68, 48, 0.16);
}

body.reader-theme-dark .book-sheet__face--back {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.48) 0%, #1F252A 16%, #181D21 100%);
  border-color: rgba(232, 228, 220, 0.10);
}

body.page-book-reader.reader-theme-white .book-sheet__face--back {
  background: linear-gradient(90deg, rgba(17, 17, 17, 0.08) 0%, #FFFFFF 16%, #F7F7F7 100%);
  border-color: rgba(17, 17, 17, 0.12);
}

/* Dynamic shadow cast onto underneath page while upper sheet flips in 3D */
.book-sheet__shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 14;
  opacity: var(--sheet-shadow);
  background: linear-gradient(
    to right,
    rgba(16, 12, 6, 0.56) 0%,
    rgba(16, 12, 6, 0.28) 32%,
    rgba(16, 12, 6, 0.06) 68%,
    rgba(16, 12, 6, 0) 100%
  );
}

/* --- DESKTOP PERSISTENT 3D TWO-SIDED LEAVES --- */
.book-desktop-deck {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.book-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
  --turn-sin: 0;
  --curl-y: 50%;
  --cast-front: 0;
  --cast-back: 0;
}

.book-leaf-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(18, 14, 8, calc(var(--turn-sin) * 0.34));
}

.book-leaf-face--front {
  transform: rotateY(0deg);
}

.book-leaf-face--back {
  transform: rotateY(180deg);
}

/* Cast shadow on resting leaves underneath the turning leaf */
.book-leaf-cast {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.book-leaf-cast--front {
  opacity: var(--cast-front);
  background: linear-gradient(
    to right,
    rgba(16, 12, 6, 0.54) 0%,
    rgba(16, 12, 6, 0.24) 26%,
    rgba(16, 12, 6, 0.05) 58%,
    rgba(16, 12, 6, 0) 100%
  );
}

.book-leaf-cast--back {
  opacity: var(--cast-back);
  background: linear-gradient(
    to left,
    rgba(16, 12, 6, 0.54) 0%,
    rgba(16, 12, 6, 0.24) 26%,
    rgba(16, 12, 6, 0.05) 58%,
    rgba(16, 12, 6, 0) 100%
  );
}

/* Dynamic Paper-Bend Lighting Sheen & Cursor-Following Curvature Shading */
.book-turn-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  opacity: calc(var(--turn-sin) * 0.78);
}

.book-turn-shade--front {
  background:
    radial-gradient(ellipse at 92% var(--curl-y), rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 56%),
    linear-gradient(
      90deg,
      rgba(24, 18, 10, 0.26) 0%,
      rgba(255, 255, 255, 0.24) 22%,
      rgba(255, 255, 255, 0.04) 55%,
      rgba(24, 18, 10, 0.24) 100%
    );
}

.book-turn-shade--back {
  background:
    radial-gradient(ellipse at 8% var(--curl-y), rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 56%),
    linear-gradient(
      270deg,
      rgba(24, 18, 10, 0.26) 0%,
      rgba(255, 255, 255, 0.22) 22%,
      rgba(255, 255, 255, 0.04) 55%,
      rgba(24, 18, 10, 0.24) 100%
    );
}

/* DESKTOP CURSOR-FOLLOWING CORNER PEEL HINT */
.book-hover-peel {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.book-hover-peel--right {
  right: 0;
  border-radius: 6px 0 0 0;
  background: linear-gradient(135deg, #EAE1CF 0%, #FAF6EE 48%, #D8CEBC 54%, rgba(28, 22, 14, 0.22) 100%);
  box-shadow: -4px -4px 14px rgba(24, 18, 10, 0.22);
}

.book-hover-peel--left {
  left: 0;
  border-radius: 0 6px 0 0;
  background: linear-gradient(225deg, #EAE1CF 0%, #FAF6EE 48%, #D8CEBC 54%, rgba(28, 22, 14, 0.22) 100%);
  box-shadow: 4px -4px 14px rgba(24, 18, 10, 0.22);
}

body.reader-theme-dark .book-hover-peel--right {
  background: linear-gradient(135deg, #2D353C 0%, #22282D 48%, #15191C 54%, rgba(0, 0, 0, 0.42) 100%);
}

body.reader-theme-dark .book-hover-peel--left {
  background: linear-gradient(225deg, #2D353C 0%, #22282D 48%, #15191C 54%, rgba(0, 0, 0, 0.42) 100%);
}

/* Subtle Side Navigation Arrows (Desktop) */
.book-edge-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(5, 74, 99, 0.14);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #053244;
  font-size: 1.15rem;
  display: none;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.22s, opacity 0.2s;
}

.book-edge-nav:hover:not(:disabled) {
  background: #FFFFFF;
  color: #CC470A;
  transform: translateY(-50%) scale(1.06);
}

.book-edge-nav:disabled {
  opacity: 0.24;
  cursor: default;
}

.book-edge-nav--prev { left: 14px; }
.book-edge-nav--next { right: 14px; }

@media (min-width: 960px) {
  .book-edge-nav {
    display: grid;
  }
}

body.reader-theme-dark .book-edge-nav {
  background: rgba(28, 34, 39, 0.80);
  border-color: rgba(232, 228, 220, 0.16);
  color: #E8E4DC;
}

/* Individual Physical Pages */
.book-page {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background: #FAF6EE;
  color: #24211D;
  border: 1px solid rgba(82, 68, 48, 0.14);
}

.book-page--left {
  border-radius: 6px 0 0 6px;
}

.book-page--right {
  border-radius: 0 6px 6px 0;
}

.book-flip-stage.is-single .book-page {
  border-radius: 4px 10px 10px 4px;
}

body.reader-theme-dark .book-page--interior {
  background: #1B2024;
  color: #E8E3DA;
  border-color: rgba(232, 228, 220, 0.10);
}

/* Subtle Center Spine Gutter Shadow */
.book-page--interior.book-page--left::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 30px;
  pointer-events: none;
  background: linear-gradient(to left, rgba(28, 22, 14, 0.15) 0%, rgba(28, 22, 14, 0.04) 48%, rgba(28, 22, 14, 0) 100%);
  z-index: 4;
}

.book-page--interior.book-page--right::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(28, 22, 14, 0.15) 0%, rgba(28, 22, 14, 0.04) 48%, rgba(28, 22, 14, 0) 100%);
  z-index: 4;
}

.book-flip-stage.is-single .book-page--interior::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 16px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(28, 22, 14, 0.12) 0%, rgba(28, 22, 14, 0.03) 50%, rgba(28, 22, 14, 0) 100%);
  z-index: 4;
}

body.reader-theme-dark .book-page--interior.book-page--left::after {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.12) 48%, rgba(0, 0, 0, 0) 100%);
}

body.reader-theme-dark .book-page--interior.book-page--right::before,
body.reader-theme-dark .book-flip-stage.is-single .book-page--interior::before {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.12) 48%, rgba(0, 0, 0, 0) 100%);
}

/* HARDCOVER FRONT & BACK COVERS INSIDE READER */
.book-page--cover {
  background: radial-gradient(ellipse at 30% 24%, #085A75 0%, #033346 58%, #021C27 100%);
  color: #FCF8EF;
  border: 1px solid rgba(191, 232, 240, 0.18);
  border-radius: 4px 12px 12px 4px;
}

.book-page--cover.book-page--left {
  border-radius: 12px 4px 4px 12px;
}

.book-cover-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.75rem, 4vw, 2.85rem) clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.75rem, 4vw, 2.85rem) clamp(2.1rem, 4.2vw, 3.1rem);
}

.book-cover-inner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.book-cover-inner__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2, 22, 32, 0.56) 0%,
    rgba(2, 22, 32, 0.24) 36%,
    rgba(2, 18, 28, 0.34) 56%,
    rgba(2, 15, 24, 0.84) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.book-cover-inner__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 26px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.42) 0%, rgba(255,255,255,0.20) 20%, rgba(0,0,0,0.32) 56%, rgba(255,255,255,0.22) 66%, transparent 100%);
}

.book-cover-inner__sheen {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.03) 34%, transparent 55%, rgba(0,0,0,0.22) 100%);
  mix-blend-mode: soft-light;
}

.book-cover-inner__top,
.book-cover-inner__bottom {
  position: relative;
  z-index: 2;
}

.book-cover-inner__kicker {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(242, 232, 210, 0.84);
  margin-bottom: 0.5rem;
}

.book-cover-inner__title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 500;
  line-height: 1.14;
  color: #FCF8EF !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  margin: 0 0 0.65rem;
}

.book-cover-inner__author {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(242, 232, 210, 0.90);
  padding-top: 0.75rem;
  border-top: 1px solid rgba(252, 248, 239, 0.25);
}

.book-cover-inner__hint {
  margin-top: 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: rgba(191, 232, 240, 0.84);
  letter-spacing: 0.03em;
}

/* Back Cover Colophon */
.book-back-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  background: radial-gradient(ellipse at 50% 35%, #064B63 0%, #032E3F 62%, #021C27 100%);
}

.book-back-inner__emblem {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(191, 232, 240, 0.26);
  display: grid;
  place-items: center;
}

.book-back-inner__emblem svg {
  width: 30px;
  height: 30px;
}

.book-back-inner__motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: #BFE8F0;
  margin: 0;
}

.book-back-inner__note {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.65;
  color: rgba(235, 248, 252, 0.78);
  max-width: 30ch;
  margin: 0;
}

.book-back-inner__btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  background: #D44B0D;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  pointer-events: auto;
  touch-action: manipulation;
}

.book-endpaper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0.42;
}

.book-endpaper svg {
  width: 36px;
  height: 36px;
}

/* INTERIOR PAPER PAGE LAYOUT (SMART VERTICAL SCROLL WHEN TEXT OVERFLOWS!) */
.book-page__inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(1rem, 2.2vh, 2.1rem) clamp(1.15rem, 2.8vw, 2.25rem) clamp(0.85rem, 1.8vh, 1.55rem);
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.book-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-right: 36px;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(82, 68, 48, 0.12);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7D7466;
  flex-shrink: 0;
}

body.reader-theme-dark .book-page__header {
  border-bottom-color: rgba(232, 228, 220, 0.10);
  color: #969188;
}

.book-page__header-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* SCROLLABLE ONLY WHEN TEXT EXCEEDS PAGE HEIGHT (e.g. Larger Font Sizes!) */
.book-page__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding-right: 0.25rem;
  font-family: var(--font-writing-body);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  line-height: 1.72;
  color: inherit;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 116, 102, 0.28) transparent;
}

.book-page__body.is-lang-bn {
  font-family: var(--font-bn) !important;
  line-height: 1.80;
}

/* Live Text Size Scaling Inside Physical Book Pages */
body.page-book-reader[data-reader-size="sm"]  .book-page__body { font-size: 0.88rem;  line-height: 1.66; }
body.page-book-reader[data-reader-size="md"]  .book-page__body { font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem); line-height: 1.72; }
body.page-book-reader[data-reader-size="lg"]  .book-page__body { font-size: 1.12rem;  line-height: 1.70; }
body.page-book-reader[data-reader-size="xl"]  .book-page__body { font-size: 1.24rem;  line-height: 1.68; }
body.page-book-reader[data-reader-size="2xl"] .book-page__body { font-size: 1.38rem;  line-height: 1.64; }
body.page-book-reader[data-reader-size="3xl"] .book-page__body { font-size: 1.56rem;  line-height: 1.60; }
body.page-book-reader[data-reader-size="4xl"] .book-page__body { font-size: 1.76rem;  line-height: 1.56; }
body.page-book-reader[data-reader-size="5xl"] .book-page__body { font-size: 1.98rem;  line-height: 1.52; }
body.page-book-reader[data-reader-size="6xl"] .book-page__body { font-size: 2.20rem;  line-height: 1.48; }

.book-page__body h2 {
  font-family: var(--font-writing-head);
  font-size: 1.22em;
  font-weight: 600;
  line-height: 1.26;
  color: #052634;
  margin: 0 0 0.72em;
}

.book-page__body.is-lang-bn h2 {
  font-family: var(--font-bn) !important;
}

body.reader-theme-dark .book-page__body h2 {
  color: #F2EDE4;
}

.book-page__body p {
  margin: 0 0 0.92em;
}

.book-page__body p:last-child {
  margin-bottom: 0;
}

.book-page__body blockquote {
  margin: 0.95em 0;
  padding: 0.65em 0.95em;
  border-left: 3px solid #CC470A;
  background: rgba(204, 71, 10, 0.055);
  border-radius: 0 10px 10px 0;
  font-family: var(--font-writing-head);
  font-style: italic;
  font-size: 0.96em;
  line-height: 1.54;
}

.book-page__body.is-lang-bn blockquote {
  font-family: var(--font-bn) !important;
  font-style: normal;
}

body.reader-theme-dark .book-page__body blockquote {
  background: rgba(255, 130, 67, 0.10);
  border-left-color: #FF8243;
}

.book-page__footer {
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(82, 68, 48, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-writing-head);
  font-size: 0.84rem;
  color: #7D7466;
  flex-shrink: 0;
}

body.reader-theme-dark .book-page__footer {
  border-top-color: rgba(232, 228, 220, 0.08);
  color: #969188;
}

/* ==========================================================================
   3. REAL "DOG-EAR" CORNER FOLDING ON INTERIOR PAGES + JUMP POPOVER
   ========================================================================== */
.book-dogear-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  z-index: 30;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  overflow: visible;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.book-dogear-btn::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 14px 14px 0;
  border-color: transparent rgba(204, 71, 10, 0.22) transparent transparent;
  transition: border-width 0.26s var(--ease-wave), border-color 0.24s ease;
}

.book-dogear-btn:hover::before {
  border-width: 0 22px 22px 0;
  border-color: transparent rgba(204, 71, 10, 0.36) transparent transparent;
}

.book-dogear-btn::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  opacity: 0;
  border-style: solid;
  border-width: 0 0 0 0;
  border-color: transparent transparent #E7DEC9 transparent;
  filter: drop-shadow(-3px 4px 4px rgba(24, 18, 10, 0.28));
  transition: border-width 0.30s var(--ease-wave), opacity 0.22s ease;
}

.book-dogear-btn.is-folded::before {
  border-width: 0 38px 38px 0;
  border-color: transparent #DDD4C4 transparent transparent;
}

.book-dogear-btn.is-folded::after {
  opacity: 1;
  border-width: 38px 0 0 38px;
  border-color: transparent transparent #EFE7D6 transparent;
}

body.reader-theme-dark .book-dogear-btn.is-folded::before {
  border-color: transparent #111518 transparent transparent;
}

body.reader-theme-dark .book-dogear-btn.is-folded::after {
  border-color: transparent transparent #2E363D transparent;
  filter: drop-shadow(-3px 4px 5px rgba(0, 0, 0, 0.55));
}

/* Dog-Ear Indicator Button & Popover Inside Floating Bar */
.rf-dogear-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rf-dogear-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #CC470A;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.rf-dogear-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 224px;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(5, 74, 99, 0.16);
  box-shadow: 0 18px 42px -8px rgba(2, 26, 38, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 200;
}

.rf-dogear-popover__head {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #546F7D;
  padding: 0.15rem 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(5, 74, 99, 0.10);
}

.rf-dogear-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #052634;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.rf-dogear-item:hover {
  background: #EAF4F8;
  color: #CC470A;
}

.rf-dogear-empty {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #6B7E8A;
  padding: 0.45rem 0.35rem;
  margin: 0;
  white-space: normal;
}

body.reader-theme-dark .rf-dogear-popover {
  background: rgba(26, 32, 36, 0.98);
  border-color: rgba(232, 228, 220, 0.16);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58);
}

body.reader-theme-dark .rf-dogear-popover__head {
  color: #A8A49B;
  border-bottom-color: rgba(232, 228, 220, 0.12);
}

body.reader-theme-dark .rf-dogear-item {
  color: #EFECE5;
}

body.reader-theme-dark .rf-dogear-item:hover {
  background: #2C353C;
  color: #FFA06E;
}

/* ==========================================================================
   4. MANUAL PAGE-BY-PAGE ADMIN BOOKS PANEL (admin.html)
   ========================================================================== */
.books-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 820px) {
  .books-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.book-admin-card {
  background: #FFFFFF;
  border: 1px solid rgba(5, 74, 99, 0.09);
  border-radius: 24px;
  padding: 1.35rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  box-shadow: 0 16px 40px -24px rgba(3, 38, 54, 0.14);
}

@media (max-width: 520px) {
  .book-admin-card {
    flex-direction: column;
  }
}

.book-admin-card__thumb {
  width: 96px;
  aspect-ratio: 2 / 3;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  background: #033346;
  flex-shrink: 0;
  box-shadow: -3px 5px 14px rgba(2, 22, 32, 0.24);
  position: relative;
}

.book-admin-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-admin-card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.book-admin-card__title {
  font-family: var(--font-writing-head);
  font-size: 1.28rem;
  font-weight: 600;
  color: #041D29;
  line-height: 1.25;
  margin: 0;
}

.book-admin-card__bn {
  font-family: var(--font-bn);
  font-size: 0.92rem;
  color: #5C7481;
  margin: 0;
}

.book-admin-card__meta {
  font-size: 0.84rem;
  color: #607885;
}

.book-admin-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

/* Manual Page Manager inside Book Editor */
.book-pages-mgr {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.book-pages-mgr__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.book-page-editor-card {
  background: #FAFBFD;
  border: 1px solid rgba(5, 74, 99, 0.13);
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.book-page-editor-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(5, 74, 99, 0.09);
}

.book-page-editor-card__num {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #A83705;
}

.book-page-lang-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: #E8F0F4;
}

.book-page-lang-tab {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  color: #365260;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.book-page-lang-tab.is-active {
  background: #04364A;
  color: #FFFFFF;
}

.book-page-editor-card__tools {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.book-page-textarea {
  min-height: 190px !important;
  border-radius: 0 0 10px 10px !important;
  font-family: var(--font-writing-body);
  font-size: 1rem !important;
  line-height: 1.75 !important;
  background: #FAF9F6 !important;
}

.book-page-textarea--bn {
  font-family: var(--font-bn) !important;
}

.book-page-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #5C7481;
  font-variant-numeric: tabular-nums;
}

.book-page-hint__fit {
  font-weight: 600;
  color: #0B6F57;
}

.book-page-hint__fit.is-full {
  color: #B83D06;
}

.book-token-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.95rem 1.2rem;
  border-radius: 16px;
  background: #F4F9FB;
  border: 1px solid rgba(5, 74, 99, 0.13);
  margin-bottom: 1.5rem;
}

.book-token-bar__input {
  flex: 1 1 220px;
  min-width: 0;
  height: 40px;
  padding: 0 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(5, 74, 99, 0.20);
  background: #FFFFFF;
  font-size: 0.88rem;
}
/* ==========================================================================
   3RD THEME: PURE BRIGHT WHITE MODE (book.html — Full #FFFFFF Bright White)
   ========================================================================== */
body.page-book-reader.reader-theme-white {
  background: #FFFFFF;
  color: #111111;
}

body.page-book-reader.reader-theme-white .book-desk-shadow {
  background: radial-gradient(ellipse at 50% 65%, rgba(15, 23, 30, 0.14) 0%, rgba(15, 23, 30, 0.05) 58%, rgba(15, 23, 30, 0) 80%);
}

body.page-book-reader.reader-theme-white .book-page--interior {
  background: #FFFFFF;
  color: #111111;
  border-color: rgba(17, 17, 17, 0.12);
}

body.page-book-reader.reader-theme-white .book-paper-reverse {
  background: linear-gradient(90deg, rgba(17, 17, 17, 0.06) 0%, #FFFFFF 14%, #FAFAFA 100%);
  border-color: rgba(17, 17, 17, 0.10);
}

body.page-book-reader.reader-theme-white .book-page__header,
body.page-book-reader.reader-theme-white .book-page__footer {
  border-color: rgba(17, 17, 17, 0.10);
  color: #555555;
}

body.page-book-reader.reader-theme-white .book-page__body h2 {
  color: #000000;
}

body.page-book-reader.reader-theme-white .book-page__body blockquote {
  background: #F7F7F7;
  border-left-color: #CC470A;
  color: #111111;
}

body.page-book-reader.reader-theme-white .book-stack--left {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.07) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.09) 100%),
    repeating-linear-gradient(90deg, #E2E2E2 0px, #E2E2E2 1px, #FFFFFF 1px, #FFFFFF 2.5px);
  border-left-color: #1C2730;
}

body.page-book-reader.reader-theme-white .book-stack--right {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.07) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.09) 100%),
    repeating-linear-gradient(90deg, #FFFFFF 0px, #FFFFFF 1.5px, #E2E2E2 1.5px, #E2E2E2 2.5px);
  border-right-color: #1C2730;
}

body.page-book-reader.reader-theme-white .book-dogear-btn.is-folded::before {
  border-color: transparent #EFEFEF transparent transparent;
}

body.page-book-reader.reader-theme-white .book-dogear-btn.is-folded::after {
  border-color: transparent transparent #F6F6F6 transparent;
}

body.page-book-reader.reader-theme-white .book-back-btn,
body.page-book-reader.reader-theme-white .book-page-status,
body.page-book-reader.reader-theme-white .book-edge-nav {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(17, 17, 17, 0.14);
  color: #111111;
}
/* ==========================================================================
   v66 — BOOK CUSTOM SPACING, NESTED LISTS, RESIZABLE INLINE IMAGES,
         FULL-PAGE MANGA/ILLUSTRATION PAGES & SOUND MUTE STATE
   ========================================================================== */
.book-page__body.has-custom-formatting {
  line-height: var(--bk-line-height, 1.72) !important;
}

.book-page__body.has-custom-formatting p {
  margin-bottom: var(--bk-para-space, 0.92rem);
  text-indent: var(--bk-text-indent, 0em);
}

.book-list {
  margin: 0 0 var(--bk-para-space, 0.95rem);
  padding-left: var(--bk-list-indent, 1.4rem);
  color: inherit;
}

.book-list--nested {
  margin: 0.35rem 0 0.25rem;
  padding-left: var(--bk-list-indent, 1.3rem);
}

.book-list li {
  margin-bottom: 0.42rem;
  line-height: inherit;
}

.book-list li:last-child {
  margin-bottom: 0;
}

.book-ul { list-style-type: disc; }
.book-ul .book-ul { list-style-type: circle; }
.book-ol { list-style-type: decimal; }
.book-ol .book-ol { list-style-type: lower-alpha; }

.book-list li::marker {
  color: #CC470A;
  font-weight: 600;
}

body.reader-theme-dark .book-list li::marker {
  color: #FF8E53;
}

/* Resizable Inline Images Between Writing on a Book Page */
.book-inline-figure {
  display: block;
  margin: 1rem auto;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.book-inline-figure--left {
  margin-left: 0;
  margin-right: auto;
}

.book-inline-figure--right {
  margin-left: auto;
  margin-right: 0;
}

.book-inline-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
}

.book-inline-figure figcaption {
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-align: center;
  color: #6B645A;
}

body.reader-theme-dark .book-inline-figure figcaption {
  color: #A09B92;
}

/* FULL-PAGE MANGA / DIGITAL ILLUSTRATION PAGE (Pure Visual Page — Zero Text!) */
.book-page--full-image {
  padding: 0 !important;
  background: #0F1418;
}

body.page-book-reader.reader-theme-white .book-page--full-image {
  background: #FFFFFF;
}

.book-full-img-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
}

.book-full-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.book-full-img.is-cover {
  object-fit: cover;
}

.book-full-img.is-contain {
  object-fit: contain;
}

/* Muted Sound Button Style */
.rf-btn.is-muted {
  opacity: 0.56;
}

/* ADMIN BOOK EDITOR: PAGE MODE TOGGLE, INLINE RESIZER & FULL-PAGE ART EDITOR */
.book-page-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.book-page-mode-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #46606D;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.book-page-preview-box {
  min-height: 190px;
  padding: 1.25rem;
  border-radius: 0 0 12px 12px;
  background: #FAF6EE;
  border: 1px solid rgba(5, 74, 99, 0.14);
  border-top: 0;
}

.bk-inline-resizers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 13px;
  background: #FFFFFF;
  border: 1px solid rgba(5, 74, 99, 0.12);
}

.bk-inline-resizers__head {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #054A63;
}

.bk-img-resizer-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(5, 74, 99, 0.08);
}

.bk-img-resizer-row:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.bk-img-resizer-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #E8F0F4;
  flex-shrink: 0;
}

.bk-img-resizer-ctrl {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bk-img-resizer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #365260;
}

.bk-img-resizer-ctrl input[type="range"] {
  width: 100%;
  accent-color: #CC470A;
}

.bk-img-resizer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bk-fullpage-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1rem;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid rgba(5, 74, 99, 0.12);
}

@media (min-width: 680px) {
  .bk-fullpage-editor {
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: start;
  }
}

.bk-fullpage-preview-frame {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 2 / 3;
  margin-inline: auto;
  border-radius: 10px;
  overflow: hidden;
  background: #0F1418;
  border: 1px solid rgba(5, 74, 99, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bk-fullpage-empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(235, 248, 252, 0.72);
}

.bk-fullpage-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bk-fullpage-resize-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

@media (min-width: 560px) {
  .bk-fullpage-resize-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
}
/* ==========================================================================
   v67 — LUXURY PRINTED BOOK PAGES, DEFAULT OFF-WHITE ARCHIVAL
         THEME, 4-COLOR PICKER, OPTIONAL EMPTY COVER & NEOMORPHIC READ BUTTON
   ========================================================================== */

:root {
  --font-book-page: var(--font-writing-body, 'Literata', Georgia, 'Times New Roman', serif);
  /* Whisper-subtle 0 KB fine-tooth archival paper grain overlay */
  --book-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.036'/%3E%3C/svg%3E");
}

/* 1. NEOMORPHIC BOOKS SHELF & SCULPTED READ BUTTON (library.html) */
.books-shelf-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #F3F6F8 0%, #EEF3F6 100%);
}

.book-3d-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 274px;
}

.book-3d__cover--clean {
  background: #02202E;
}

/* Tactile Neomorphic "Read" Button Directly Below Each 3D Book */
.book-neo-read-btn {
  margin-top: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 168px;
  height: 48px;
  padding: 0 0.55rem 0 1.25rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #F8FBFD 0%, #E7EEF2 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #053244;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow:
    -7px -7px 16px rgba(255, 255, 255, 0.96),
    7px 7px 18px rgba(4, 42, 58, 0.14),
    inset 1px 1px 1px rgba(255, 255, 255, 0.90);
  transition: transform 0.26s var(--ease-wave), box-shadow 0.26s ease, color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.book-neo-read-btn__ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #06526D;
  transition: color 0.22s ease;
}

.book-neo-read-btn__ic svg {
  width: 17px;
  height: 17px;
}

.book-neo-read-btn__label {
  flex: 1 1 auto;
  text-align: center;
}

.book-neo-read-btn__pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #EEF4F7 0%, #DCE6EC 100%);
  box-shadow:
    -3px -3px 7px rgba(255, 255, 255, 0.92),
    3px 3px 7px rgba(4, 42, 58, 0.13);
  color: #CC470A;
  font-size: 0.95rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: background 0.24s ease, color 0.24s ease, transform 0.26s var(--ease-wave), box-shadow 0.24s ease;
}

.book-neo-read-btn:hover,
.book-neo-read-btn:focus-visible {
  transform: translateY(-2px);
  color: #032230;
  box-shadow:
    -9px -9px 20px rgba(255, 255, 255, 1),
    9px 10px 22px rgba(4, 42, 58, 0.18),
    inset 1px 1px 1px rgba(255, 255, 255, 0.95);
}

.book-neo-read-btn:hover .book-neo-read-btn__pill {
  background: linear-gradient(145deg, #E25814 0%, #C64106 100%);
  color: #FFFFFF;
  transform: translateX(2px);
  box-shadow:
    0 4px 12px rgba(204, 71, 10, 0.32),
    inset 1px 1px 1px rgba(255, 255, 255, 0.28);
}

.book-neo-read-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 5px 5px 10px rgba(4, 42, 58, 0.14),
    inset -5px -5px 10px rgba(255, 255, 255, 0.94);
}

.book-3d-pages-hint {
  margin-top: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #6B828E;
}

/* 2. CLEAN IMAGE-ONLY FRONT COVER INSIDE READER (ZERO WRITING!) */
.book-cover-inner--clean {
  padding: 0;
}

/* 3. HIGH-CRAFT LUXURY PRINTED BOOK PAGES */
.book-page--interior {
  background-color: #F8F7F4;
  background-image: var(--book-paper-grain);
  color: #1D1C1A;
  border: 1px solid rgba(46, 42, 36, 0.13);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 0 34px rgba(104, 92, 74, 0.045);
}

/* Realistic Curved Book-Binding Gutter Shadows (Left & Right Spreads) */
.book-page--interior.book-page--left::after {
  width: 44px;
  background: linear-gradient(
    to left,
    rgba(24, 20, 14, 0.20) 0%,
    rgba(24, 20, 14, 0.09) 24%,
    rgba(24, 20, 14, 0.03) 56%,
    rgba(24, 20, 14, 0) 100%
  );
}

.book-page--interior.book-page--right::before {
  width: 44px;
  background: linear-gradient(
    to right,
    rgba(24, 20, 14, 0.20) 0%,
    rgba(24, 20, 14, 0.09) 24%,
    rgba(24, 20, 14, 0.03) 56%,
    rgba(24, 20, 14, 0) 100%
  );
}

.book-flip-stage.is-single .book-page--interior::before {
  width: 24px;
  background: linear-gradient(
    to right,
    rgba(24, 20, 14, 0.16) 0%,
    rgba(24, 20, 14, 0.05) 45%,
    rgba(24, 20, 14, 0) 100%
  );
}

/* Luxury Archival Inner Margins & Subtle Printed Book Framing */
.book-page__inner {
  padding: clamp(1.25rem, 2.8vh, 2.45rem) clamp(1.35rem, 3.2vw, 2.65rem) clamp(1rem, 2.2vh, 1.85rem);
}

.book-page__header {
  padding-bottom: 0.62rem;
  margin-bottom: 1.05rem;
  border-bottom: 1px solid rgba(46, 42, 36, 0.11);
  font-family: var(--font-writing-head, 'Lora', Georgia, serif);
  font-size: 0.82rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.05em;
  text-transform: none;
  color: #777167;
}

.book-page__body {
  font-family: var(--font-book-page);
  font-size: clamp(1.06rem, 1.01rem + 0.26vw, 1.18rem);
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: 0.004em;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  color: inherit;
}

/* Tuned 9-Step Book Page Size Scale Inside Physical Book Pages */
body.page-book-reader[data-reader-size="sm"]  .book-page__body { font-size: 0.96rem;  line-height: 1.66; }
body.page-book-reader[data-reader-size="md"]  .book-page__body { font-size: clamp(1.06rem, 1.01rem + 0.26vw, 1.18rem); line-height: 1.72; }
body.page-book-reader[data-reader-size="lg"]  .book-page__body { font-size: 1.24rem;  line-height: 1.70; }
body.page-book-reader[data-reader-size="xl"]  .book-page__body { font-size: 1.38rem;  line-height: 1.66; }
body.page-book-reader[data-reader-size="2xl"] .book-page__body { font-size: 1.54rem;  line-height: 1.62; }
body.page-book-reader[data-reader-size="3xl"] .book-page__body { font-size: 1.72rem;  line-height: 1.58; }
body.page-book-reader[data-reader-size="4xl"] .book-page__body { font-size: 1.92rem;  line-height: 1.54; }
body.page-book-reader[data-reader-size="5xl"] .book-page__body { font-size: 2.14rem;  line-height: 1.50; }
body.page-book-reader[data-reader-size="6xl"] .book-page__body { font-size: 2.38rem;  line-height: 1.46; }

.book-page__body h2 {
  font-family: var(--font-writing-head, 'Lora', Georgia, serif);
  font-size: 1.36em;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.012em;
  color: #0F1E26;
  margin: 0 0 0.78em;
  padding-bottom: 0.42em;
  position: relative;
}

.book-page__body h2::after {
  content: '';
  display: block;
  width: 34px;
  height: 1.5px;
  margin-top: 0.42em;
  background: rgba(204, 71, 10, 0.62);
}

.book-page__body p {
  margin: 0 0 0.96em;
}

.book-page__body strong {
  font-weight: 600;
}

.book-page__body blockquote {
  margin: 1.1em 0;
  padding: 0.72em 1.05em;
  border-left: 2.5px solid #B8420A;
  background: rgba(20, 42, 54, 0.032);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-writing-head, 'Lora', Georgia, serif);
  font-style: italic;
  font-size: 1.02em;
  line-height: 1.58;
}

.book-page__footer {
  padding-top: 0.62rem;
  margin-top: 0.65rem;
  border-top: 1px solid rgba(46, 42, 36, 0.09);
  font-family: var(--font-writing-head, 'Lora', Georgia, serif);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #777167;
  gap: 0.55rem;
}

.book-page__footer::before,
.book-page__footer::after {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.28;
}

/* Use matching writing font in Admin Book Page Textarea & Live Preview */
.book-page-textarea:not(.book-page-textarea--bn) {
  font-family: var(--font-book-page) !important;
  font-size: 1.1rem !important;
  line-height: 1.72 !important;
  background: #F8F7F4 !important;
}

.book-page-preview-box {
  background: #F8F7F4;
}

/* 4. FOUR DISTINCT BOOK COLOR THEMES (OFF-WHITE IS DEFAULT!) */

/* THEME 1 (DEFAULT): ARCHIVAL OFF-WHITE (#F8F7F4) */
body.page-book-reader,
body.page-book-reader.reader-theme-offwhite {
  background: radial-gradient(ellipse at 50% 35%, #F2F1EC 0%, #E7E5DE 68%, #DCD9D0 100%);
  color: #1D1C1A;
}

body.page-book-reader.reader-theme-offwhite .book-page--interior {
  background-color: #F8F7F4;
  color: #1D1C1A;
}

body.page-book-reader.reader-theme-offwhite .book-sheet__face--back {
  background: linear-gradient(90deg, rgba(46, 42, 36, 0.12) 0%, #F7F6F2 16%, #ECEAE3 100%);
}

body.page-book-reader.reader-theme-offwhite .book-stack--left {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.14) 100%),
    repeating-linear-gradient(90deg, #D9D7D0 0px, #D9D7D0 1px, #F8F7F4 1px, #F8F7F4 2.5px);
}

body.page-book-reader.reader-theme-offwhite .book-stack--right {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.14) 100%),
    repeating-linear-gradient(90deg, #F8F7F4 0px, #F8F7F4 1.5px, #D9D7D0 1.5px, #D9D7D0 2.5px);
}

body.page-book-reader.reader-theme-offwhite .book-dogear-btn.is-folded::before {
  border-color: transparent #E3E1DA transparent transparent;
}

body.page-book-reader.reader-theme-offwhite .book-dogear-btn.is-folded::after {
  border-color: transparent transparent #ECEAE3 transparent;
}

/* THEME 2: WARM CREAM PAPER / SEPIA (#F5EFE1) */
body.page-book-reader.reader-theme-paper {
  background: radial-gradient(ellipse at 50% 35%, #EFE7D6 0%, #E2D7C0 68%, #D6C8AC 100%);
  color: #28221B;
}

body.page-book-reader.reader-theme-paper .book-page--interior {
  background-color: #F6EFE1;
  color: #28221B;
  border-color: rgba(94, 74, 46, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 240, 0.65),
    inset 0 0 38px rgba(132, 98, 48, 0.08);
}

body.page-book-reader.reader-theme-paper .book-page__body h2 {
  color: #2B1F14;
}

body.page-book-reader.reader-theme-paper .book-page__header,
body.page-book-reader.reader-theme-paper .book-page__footer {
  color: #7D6D58;
  border-color: rgba(94, 74, 46, 0.13);
}

body.page-book-reader.reader-theme-paper .book-dogear-btn.is-folded::before {
  border-color: transparent #DECFA8 transparent transparent;
}

body.page-book-reader.reader-theme-paper .book-dogear-btn.is-folded::after {
  border-color: transparent transparent #EDE2CA transparent;
}

/* THEME 3: PURE BRIGHT WHITE (#FFFFFF) — Ensure archival grain stays spotless pure white */
body.page-book-reader.reader-theme-white .book-page--interior {
  background-color: #FFFFFF;
  background-image: none;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.04);
}

/* THEME 4: VELVET DARK MODE (#1A1F24) */
body.page-book-reader.reader-theme-dark .book-page--interior {
  background-color: #1A1F24;
  color: #EAE4DA;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 38px rgba(0, 0, 0, 0.25);
}

body.page-book-reader.reader-theme-dark .book-page__body h2::after {
  background: rgba(255, 138, 76, 0.65);
}

/* 5. 4-COLOR THEME PICKER POPOVER IN FLOATING BAR */
.rf-theme-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rf-theme-popover {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 12px);
  width: 176px;
  padding: 0.65rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(5, 74, 99, 0.16);
  box-shadow: 0 18px 42px -8px rgba(2, 26, 38, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  z-index: 205;
}

.rf-theme-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.65rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #06212E;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s;
}

.rf-theme-opt:hover {
  background: #EDF5F8;
}

.rf-theme-opt.is-active {
  background: #04364A;
  color: #FFFFFF;
}

body.reader-theme-dark .rf-theme-popover {
  background: rgba(26, 32, 36, 0.98);
  border-color: rgba(232, 228, 220, 0.16);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58);
}

body.reader-theme-dark .rf-theme-opt {
  color: #EFECE5;
}

body.reader-theme-dark .rf-theme-opt:hover {
  background: #2B343B;
}

body.reader-theme-dark .rf-theme-opt.is-active {
  background: #D44B0D;
  color: #FFFFFF;
}

/* 6. ADMIN LIVE 3D BOOK COVER PREVIEW & OPTIONAL COVER TEXT CONTROLS */
.admin-cover-uploader--book {
  align-items: start;
}

.bk-live-cover-thumb {
  position: relative;
  width: 100%;
  max-width: 146px;
  aspect-ratio: 2 / 3;
  margin-inline: auto;
  border-radius: 3px 10px 10px 3px;
  overflow: hidden;
  background: #032B3B;
  box-shadow: -5px 8px 20px rgba(2, 22, 32, 0.26);
}

.bk-live-cover-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bk-live-cover-thumb__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(2,22,32,0.45) 0%, rgba(2,20,30,0.25) 45%, rgba(2,16,25,0.78) 100%);
  z-index: 1;
}

.bk-live-cover-thumb__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 14px;
  z-index: 3;
  background: linear-gradient(90deg, rgba(0,0,0,0.4) 0%, rgba(255,255,255,0.22) 25%, rgba(0,0,0,0.28) 60%, transparent 100%);
}

.bk-live-cover-thumb__print {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0.75rem 0.65rem 0.75rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.22rem;
  color: #FCF8EF;
}

.bk-live-cover-thumb__title {
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.18;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.bk-live-cover-thumb__sub {
  font-family: var(--font-bn);
  font-size: 0.66rem;
  color: rgba(235, 244, 248, 0.88);
}

.bk-live-cover-thumb__author {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 236, 220, 0.90);
  margin-top: 0.15rem;
}

.bk-cover-text-box {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 13px;
  background: #F4F8FA;
  border: 1px solid rgba(5, 74, 99, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bk-cover-text-box__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #053244;
}

.bk-cover-text-box__head em {
  font-weight: 400;
  color: #546F7D;
}

.bk-cover-text-box__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
/* ==========================================================================
   v68 — LUXURY BIGGER & SCULPTED 3D BOOK COVER PREVIEW (MOBILE & DESKTOP)
         + LITERATA / LORA WRITING-MATCHED BOOK PAGE TYPOGRAPHY
   ========================================================================== */
.book-3d-item,
.book-3d-link {
  max-width: 288px;
}

@media (max-width: 640px) {
  .book-3d-item,
  .book-3d-link {
    width: min(82vw, 318px);
    max-width: 318px;
  }
}

.book-3d-stage {
  padding-right: 19px;
  padding-bottom: 24px;
}

.book-3d-shadow {
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 28px;
  background:
    radial-gradient(ellipse at 48% 50%, rgba(2, 20, 30, 0.42) 0%, rgba(2, 20, 30, 0.18) 52%, rgba(2, 20, 30, 0) 78%);
  filter: blur(7px);
}

.book-3d {
  transform: rotateY(-12deg) rotateX(1.8deg);
}

.book-3d-link:hover .book-3d,
.book-3d-link:focus-visible .book-3d {
  transform: rotateY(-20deg) rotateX(2.8deg) translateY(-11px);
}

.book-3d__cover {
  border-radius: 5px 13px 13px 5px;
  box-shadow:
    -9px 12px 24px rgba(2, 20, 30, 0.34),
    12px 18px 34px rgba(2, 20, 30, 0.24),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -2px 7px rgba(0, 0, 0, 0.40);
}

/* Deep Carved French-Groove Binding Spine Hinge */
.book-3d__spine {
  width: 32px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.54) 0%,
    rgba(255, 255, 255, 0.28) 10%,
    rgba(0, 0, 0, 0.10) 24%,
    rgba(0, 0, 0, 0.50) 42%,
    rgba(0, 0, 0, 0.26) 49%,
    rgba(255, 255, 255, 0.34) 55%,
    rgba(255, 255, 255, 0.08) 68%,
    rgba(255, 255, 255, 0.0) 100%
  );
  border-right: 0;
}

.book-3d__deboss {
  position: absolute;
  inset: 14px 14px 14px 30px;
  z-index: 2;
  border-radius: 6px;
  border: 1px solid rgba(252, 248, 239, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  pointer-events: none;
}

.book-3d__sheen {
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.0) 0%,
      rgba(255, 255, 255, 0.14) 16%,
      rgba(255, 255, 255, 0.04) 42%,
      rgba(0, 0, 0, 0.03) 76%,
      rgba(0, 0, 0, 0.24) 100%
    ),
    linear-gradient(
      126deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.05) 30%,
      rgba(255, 255, 255, 0) 52%,
      rgba(0, 0, 0, 0.20) 100%
    );
  mix-blend-mode: soft-light;
}

.book-3d__pages-edge {
  top: 5px;
  bottom: 5px;
  right: -18px;
  width: 20px;
  border-radius: 0 5px 5px 0;
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.18) 0%,
      rgba(0, 0, 0, 0) 7%,
      rgba(0, 0, 0, 0) 92%,
      rgba(0, 0, 0, 0.22) 100%
    ),
    linear-gradient(
      90deg,
      rgba(48, 38, 24, 0.18) 0%,
      rgba(255, 255, 255, 0) 24%,
      rgba(48, 38, 24, 0.08) 100%
    ),
    repeating-linear-gradient(
      90deg,
      #F9F6EE 0px,
      #F9F6EE 1.4px,
      #E1D9C8 1.4px,
      #E1D9C8 2.6px
    );
  box-shadow:
    inset 3px 0 6px rgba(0, 0, 0, 0.20),
    3px 6px 14px rgba(2, 20, 30, 0.20);
  transform: skewY(-1.8deg);
}

.book-3d__headband {
  position: absolute;
  top: 2px;
  right: -17px;
  width: 16px;
  height: 6px;
  z-index: 2;
  border-radius: 1px 3px 0 0;
  background: repeating-linear-gradient(90deg, #CC470A 0px, #CC470A 2px, #F6EFE1 2px, #F6EFE1 4px);
  opacity: 0.85;
  transform: skewY(-1.8deg);
  pointer-events: none;
}

.book-3d__back-board {
  top: 1px;
  bottom: 1px;
  left: 8px;
  right: -21px;
  border-radius: 5px 12px 12px 5px;
  background: linear-gradient(180deg, #053A4E 0%, #021B27 100%);
  box-shadow: 6px 14px 28px rgba(2, 20, 30, 0.34);
}

/* Refined Literata Optical Scale for Book Pages (Exact Match with Writings!) */
body.page-book-reader .book-page__body {
  font-family: var(--font-writing-body, 'Literata', Georgia, serif);
  font-size: clamp(0.98rem, 0.94rem + 0.22vw, 1.09375rem);
  line-height: 1.78;
}

body.page-book-reader[data-reader-size="sm"]  .book-page__body { font-size: 0.90rem;  line-height: 1.72; }
body.page-book-reader[data-reader-size="md"]  .book-page__body { font-size: clamp(0.98rem, 0.94rem + 0.22vw, 1.09375rem); line-height: 1.78; }
body.page-book-reader[data-reader-size="lg"]  .book-page__body { font-size: 1.15rem;  line-height: 1.76; }
body.page-book-reader[data-reader-size="xl"]  .book-page__body { font-size: 1.28rem;  line-height: 1.72; }
body.page-book-reader[data-reader-size="2xl"] .book-page__body { font-size: 1.44rem;  line-height: 1.68; }
body.page-book-reader[data-reader-size="3xl"] .book-page__body { font-size: 1.62rem;  line-height: 1.62; }
body.page-book-reader[data-reader-size="4xl"] .book-page__body { font-size: 1.82rem;  line-height: 1.56; }
body.page-book-reader[data-reader-size="5xl"] .book-page__body { font-size: 2.02rem;  line-height: 1.52; }
body.page-book-reader[data-reader-size="6xl"] .book-page__body { font-size: 2.24rem;  line-height: 1.46; }
/* ==========================================================================
   v75 — FULL-SCREEN BOOK READER LOGIN & PRIVATE ACCESS GATE (book.html)
   ========================================================================== */
.book-shell--gated {
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  transform: none !important;
}

.book-shell--gated .book-desk-shadow {
  display: none;
}

.book-shell--gated .book-flip-stage {
  width: 100% !important;
  height: auto !important;
  cursor: default;
}

.book-access-gate-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  align-items: center;
  justify-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
}

@media (min-width: 780px) {
  .book-access-gate-wrap {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: center;
  }
}

.book-access-gate-preview {
  width: min(210px, 56vw);
}

@media (min-width: 780px) {
  .book-access-gate-preview {
    width: 230px;
  }
}

.book-access-gate-card {
  width: 100%;
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(5, 74, 99, 0.14);
  box-shadow: 0 22px 54px -22px rgba(2, 26, 38, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
}

.book-access-gate-card--only {
  max-width: 560px;
  margin-inline: auto;
}

body.reader-theme-dark .book-access-gate-card {
  background: rgba(26, 32, 36, 0.96);
  border-color: rgba(232, 228, 220, 0.16);
}
