/* ==========================================================================
   ALBUM NHẠC KÝ ỨC (PHYSICALLY PERFECT 3D BOOK UNFOLD THEATER)
   1. Closed state: Single cover width (400px centered), hidden right page.
   2. Open state: Expands to double width (780px), cover flips 3D to left.
   ========================================================================== */

:root {
  --ink: #23170e;
  --ink-secondary: #5c4532;
  --parchment: #fcf8ee;
  --parchment-dark: #f4ebd9;
  --aged: #664d36;
  --leather: #6b3a1f;
  --deep-leather: #3d1f0a;
  --gold: #b8862d;
  --gold-light: #d4a85c;
  --shelf-wood: #3a2216;
  --shelf-light: #5a3824;

  --album-bg: #f7f4ed;
  --album-font-serif: 'Cormorant Garamond', serif;
  --album-font-handwriting: 'FleurDeLeah', 'Qwigley', cursive;
  --album-font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --album-font-mono: 'SFMono-Regular', Consolas, monospace;
}

html {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

body.album-page {
  background-color: var(--album-bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(220, 185, 140, 0.3) 0%, transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

.album-wrapper {
  font-family: var(--album-font-sans);
}

#cursorSpotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.1) 0%, rgba(119, 139, 235, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
}

#ambientBgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

.album-wrapper {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 20px 80px 20px;
}

/* ==========================================================================
   HERO SECTION (KHU VỰC TIÊU ĐỀ LÃNG MẠN & HOÀI NIỆM)
   ========================================================================== */
.album-hero {
  text-align: center;
  margin: 0 auto 55px auto;
  max-width: 960px;
  position: relative;
  padding: 46px 36px 40px 36px;
  background: radial-gradient(ellipse 70% 65% at 50% 35%, rgba(255, 255, 255, 0.95) 0%, rgba(248, 244, 236, 0.75) 60%, rgba(245, 239, 228, 0) 100%);
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 110, 0.25);
  box-shadow: 0 10px 40px rgba(184, 134, 45, 0.07), inset 0 0 50px rgba(255, 255, 255, 0.7);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.album-hero:hover {
  box-shadow: 0 16px 50px rgba(184, 134, 45, 0.12), inset 0 0 60px rgba(255, 255, 255, 0.9);
}

/* Vintage Corner Ornaments */
.hero-corner-decor {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border-color: rgba(184, 134, 45, 0.45);
  border-style: solid;
  transition: all 0.3s ease;
}

.album-hero:hover .hero-corner-decor {
  border-color: rgba(184, 134, 45, 0.85);
  width: 18px;
  height: 18px;
}

.hero-corner-decor.tl {
  top: 12px;
  left: 12px;
  border-width: 1.5px 0 0 1.5px;
}

.hero-corner-decor.tr {
  top: 12px;
  right: 12px;
  border-width: 1.5px 1.5px 0 0;
}

.hero-corner-decor.bl {
  bottom: 12px;
  left: 12px;
  border-width: 0 0 1.5px 1.5px;
}

.hero-corner-decor.br {
  bottom: 12px;
  right: 12px;
  border-width: 0 1.5px 1.5px 0;
}

/* Badge (Huy hiệu phong cách thư tịch cổ) */
.album-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  background: #ffffff;
  border: 1px solid rgba(184, 134, 45, 0.4);
  border-radius: 30px;
  margin-bottom: 16px;
  box-shadow: 0 3px 14px rgba(184, 134, 45, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.album-hero-badge:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 134, 45, 0.65);
  box-shadow: 0 6px 20px rgba(184, 134, 45, 0.18);
}

.badge-seal-icon {
  font-size: 13px;
  color: #b8862d;
  filter: drop-shadow(0 1px 2px rgba(184, 134, 45, 0.3));
}

.album-hero-badge .badge-text {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #7d5318;
}

.album-hero-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8862d;
  box-shadow: 0 0 8px #b8862d;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.4;
  }
}

/* Pretitle */
.album-hero-pretitle {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #9e7339;
  margin-bottom: 8px;
  font-weight: 500;
  opacity: 0.9;
}

/* Main Title */
.album-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 700;
  color: #1a1007;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  display: inline-block;
}

/* Flourish Ornamental Divider */
.hero-flourish-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 440px;
  margin: 0 auto 16px auto;
  color: #b8862d;
  opacity: 0.8;
}

.flourish-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 134, 45, 0.45), transparent);
}

.flourish-symbol {
  font-size: 13px;
  letter-spacing: 5px;
  color: #b8862d;
  user-select: none;
}

/* Subtitle */
.album-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(17px, 2.2vw, 21px);
  font-style: italic;
  color: #4a3523;
  max-width: 780px;
  margin: 0 auto 22px auto;
  line-height: 1.75;
  font-weight: 500;
}

.album-subtitle .subtitle-highlight {
  display: block;
  font-family: var(--album-font-sans);
  font-style: normal;
  font-size: 13.5px;
  font-weight: 500;
  color: #7d6044;
  margin-top: 8px;
  letter-spacing: 0.01em;
}

/* Experience Tags Under Hero */
.hero-tag-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.hero-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(212, 175, 110, 0.3);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: #5d4633;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(184, 134, 45, 0.05);
  transition: all 0.25s ease;
  user-select: none;
}

.hero-tag-item:hover {
  background: #ffffff;
  border-color: rgba(184, 134, 45, 0.6);
  color: #2b1c10;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(184, 134, 45, 0.14);
}

.hero-tag-item .tag-icon {
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .album-hero {
    padding: 32px 18px 26px 18px;
    margin-bottom: 35px;
    border-radius: 18px;
  }

  .album-title {
    font-size: 34px;
  }

  .album-subtitle {
    font-size: 16px;
    line-height: 1.6;
  }

  .hero-tag-pills {
    gap: 7px;
  }

  .hero-tag-item {
    font-size: 11.5px;
    padding: 5px 11px;
  }
}

/* ==========================================================================
   STUDIO CORNER (GÓC KÝ ỨC: KỆ SÁCH 3D & MÂM ĐĨA THAN TRÁI - PHẢI)
   ========================================================================== */
.studio-corner-section {
  margin-bottom: 70px;
  position: relative;
}

.studio-corner-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.studio-col {
  display: flex;
  flex-direction: column;
}

.studio-shelf-col .bookshelf {
  width: 100%;
  max-width: none;
  height: calc(100% - 40px);
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.studio-shelf-col .shelf-center-stage {
  padding: 0 20px 0 0;
}

.studio-deck-col {
  display: flex;
  flex-direction: column;
}

.studio-deck-col .audio-deck-container {
  height: calc(100% - 40px);
  margin-bottom: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  padding: 22px 24px;
}

.studio-deck-col .turntable-box {
  width: 200px;
  height: 200px;
}

.studio-deck-col .vinyl-record {
  width: 172px;
  height: 172px;
}

.studio-deck-col .vinyl-label {
  width: 62px;
  height: 62px;
  font-size: 8.5px;
}

.studio-deck-col .tonearm {
  top: 14px;
  right: 14px;
  width: 56px;
  height: 105px;
  transform-origin: 44px 10px;
}

.studio-deck-col .tonearm-arm {
  height: 85px;
  right: 8px;
  top: 10px;
}

.studio-deck-col .deck-track-title {
  font-size: 17px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.studio-deck-col .visualizer-box {
  height: 42px;
  margin: 10px 0 14px;
}

/* Audio Deck */
.audio-deck-container {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ec 60%, #f4ead7 100%);
  border: 1px solid #dfcfb8;
  border-radius: 28px;
  padding: 30px;
  box-shadow:
    0 10px 25px rgba(60, 40, 20, 0.06),
    0 20px 45px rgba(60, 40, 20, 0.06);
  margin-bottom: 55px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 35px;
  align-items: center;
}

.turntable-box {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #fcf9f2 0%, #ebe0cf 100%);
  border-radius: 24px;
  border: 2px solid #dfcfb8;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow:
    inset 0 4px 12px rgba(90, 60, 25, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.05);
}

.vinyl-record {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
      #0e0a06 0px,
      #241a10 2px,
      #0e0a06 4px,
      #1b130c 6px);
  border: 4px solid #050302;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-record.spinning {
  animation: spinVinyl 5s linear infinite;
}

@keyframes spinVinyl {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.vinyl-label {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c, #7a5a20);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  border: 3px solid #0b0805;
  text-align: center;
}

.tonearm {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 70px;
  height: 125px;
  pointer-events: auto;
  cursor: grab;
  transform-origin: 55px 12px;
  transform: rotate(-36deg);
  z-index: 15;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: filter 0.25s ease;
}

.studio-deck-col .tonearm {
  top: 14px;
  right: 14px;
  width: 56px;
  height: 105px;
  transform-origin: 44px 10px;
  pointer-events: auto;
  cursor: grab;
}

.tonearm.is-dragging {
  cursor: grabbing !important;
}

.tonearm:hover {
  filter: drop-shadow(0 4px 12px rgba(184, 134, 45, 0.45));
}

.tonearm:hover .tonearm-head {
  filter: brightness(1.25) drop-shadow(0 0 6px rgba(235, 196, 120, 0.8));
}

.vinyl-record {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.25s ease;
}

.vinyl-record:hover {
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

.tonearm-base {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, #aaa, #222);
  border-radius: 50%;
  position: absolute;
  right: 0;
  top: 0;
}

.tonearm-arm {
  width: 4px;
  height: 105px;
  background: linear-gradient(to bottom, #ccc, #666);
  position: absolute;
  right: 10px;
  top: 12px;
}

.tonearm-head {
  width: 14px;
  height: 20px;
  background: var(--gold);
  position: absolute;
  right: 5px;
  bottom: 0;
  border-radius: 3px;
}

.deck-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tag-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  background: rgba(184, 134, 45, 0.12);
  color: #8c601a;
  border: 1px solid rgba(184, 134, 45, 0.3);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  align-self: flex-start;
}

.deck-track-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 3vw, 30px);
  color: #1e130b;
  margin: 16px 0;
  font-weight: 700;
}

.deck-track-alias {
  font-size: 15px;
  color: #8c601a;
  font-style: italic;
}

.visualizer-box {
  width: 100%;
  height: 54px;
  background: rgba(184, 134, 45, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(184, 134, 45, 0.22);
  overflow: hidden;
}

#audioVisualizer {
  width: 100%;
  height: 100%;
  display: block;
}

.deck-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn-play-master {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8862d, #8f6319);
  border: none;
  color: #ffffff;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(184, 134, 45, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
}

.btn-play-master:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(184, 134, 45, 0.48);
}

.btn-play-master svg {
  display: block;
  pointer-events: none;
}

.ambient-toggle-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #dfcfb8;
  border-radius: 20px;
  font-size: 13px;
  color: #5c4532;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

.ambient-toggle-box.active {
  background: #b8862d;
  border-color: #b8862d;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(184, 134, 45, 0.25);
}

/* 3D Bookshelf Section */
.bookshelf-section {
  margin-bottom: 55px;
}

.section-shelf-title {
  text-align: center;
  font-family: var(--font-body);
  font-size: 19px;
  letter-spacing: 2px;
  color: #3d2719;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
}

/* Gợi ý tương tác phong cách hướng dẫn cho kệ sách 3D */
.shelf-interactive-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 5px 16px 5px 7px;
  margin: 0 auto 16px auto;
  font-size: 12.5px;
  color: #666;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  user-select: none;
  width: fit-content;
  max-width: 95%;
  box-sizing: border-box;
  text-align: center;
}

.shelf-interactive-hint .hint-label {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  text-transform: uppercase;
}

.shelf-interactive-hint .hint-text {
  font-weight: 500;
  color: #666;
  white-space: nowrap;
}

.bookshelf {
  background: radial-gradient(circle at 65% 20%, #fffdf8 0%, #f7f1e4 65%, #ede2cb 100%);
  border-top: 2px solid #e2d2ba;
  /* Vách thành tủ gỗ 2 bên dày dặn, tự nhiên để sách dựa vào */
  border-left: 14px solid #a87944;
  border-right: 14px solid #a87944;
  border-radius: 12px 12px 0 0;
  position: relative;
  max-width: 840px;
  margin: 0 auto;
  box-shadow:
    inset 4px 0 10px rgba(0, 0, 0, 0.08),
    inset -4px 0 10px rgba(0, 0, 0, 0.08),
    0 12px 35px rgba(60, 40, 20, 0.05),
    0 25px 60px rgba(60, 40, 20, 0.04);
  padding: 24px 0 0 0;
  overflow: visible;
}

/* Khoang mở trưng bày sách (Cozy Bookcase Interior) */
.shelf-center-stage {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 250px;
  padding: 0 16px 0 0;
  /* Sách chạm sát vào vách tủ bên trái và cuốn sách đặc biệt ở vách phải */
  position: relative;
}

/* Khay xếp sách - TỰA SÁT VÀO VÁCH TỦ TRÁI */
.books-container {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  min-height: 220px;
  margin-left: 0;
  position: relative;
  z-index: 3;
}

.books-container .book:first-child {
  margin-left: 0;
}

/* Cụm Decor ở giữa: Góc chill thư thái (Chậu sen đá + Tách cà phê dời sang trái) */
.shelf-decor-group {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 2px;
}

/* Decor Items on Shelf */
.shelf-decor {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -3px;
  user-select: none;
  position: relative;
  z-index: 2;
}

/* Tách cà phê dời sang trái nhẹ nhàng, tạo khoảng đệm duyên dáng với cuốn sách đặc biệt */
.shelf-decor.decor-coffee {
  margin-right: 18px;
  transition: transform 0.3s ease;
}

/* 4. QUYỂN SÁCH ĐẶC BIỆT Ở GÓC PHẢI KỆ SÁCH (SPECIAL MEMORY BOOK BY JENNY) */
.shelf-special-book {
  position: relative;
  cursor: pointer;
  transform-origin: bottom right;
  perspective: 800px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s ease;
  filter: brightness(0.97);
  margin-right: 2px;
  z-index: 3;
}

/* Nghiêng nhẹ tự nhiên tựa vào vách gỗ bên phải của kệ sách */
.shelf-special-book.book-tilted-right {
  transform: rotate(5.5deg) translate(2px, 2px);
  transform-origin: bottom right;
}

.shelf-special-book:hover {
  transform: translateY(-16px) rotate(0deg) scale(1.05);
  filter: brightness(1.15) drop-shadow(0 16px 26px rgba(90, 30, 48, 0.45));
  z-index: 6;
}

/* Ruy-băng bookmark trang nhã thò ra dưới chân sách */
.special-bookmark-ribbon {
  position: absolute;
  bottom: -10px;
  right: 11px;
  width: 7px;
  height: 15px;
  background: linear-gradient(180deg, #d8829d 0%, #b05470 100%);
  border-radius: 0 0 2px 2px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 4;
}

/* Chấm ánh sao lấp lánh nhẹ nhàng biểu thị đây là cuốn sách độc bản đặc biệt */
.special-book-glow {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #fad1dc;
  text-shadow: 0 0 8px rgba(250, 209, 220, 0.9), 0 0 14px rgba(216, 130, 157, 0.6);
  animation: specialBookSparkle 2.6s infinite ease-in-out;
  pointer-events: none;
}

@keyframes specialBookSparkle {
  0%, 100% {
    opacity: 0.45;
    transform: translateX(-50%) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.15);
  }
}

.special-author-badge {
  background: rgba(229, 197, 131, 0.2);
  border: 1px solid rgba(229, 197, 131, 0.4);
  border-radius: 2px;
  padding: 1px 4px !important;
  min-width: 14px;
  text-align: center;
}

.special-author-badge .spine-vol-text {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.decor-item-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
  cursor: default;
  position: relative;
}

.decor-item-wrap:hover {
  transform: translateY(-4px) scale(1.08);
}

.decor-icon-lg {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(60, 40, 20, 0.12));
}

.decor-contact-shadow {
  width: 28px;
  height: 5px;
  background: radial-gradient(ellipse, rgba(70, 45, 20, 0.28) 0%, transparent 75%);
  border-radius: 50%;
  margin-top: -1px;
}

/* Chiếc tách cà phê vẽ chiếu ngang phẳng (Side-View Orthographic Coffee Cup) */
.decor-cup-svg {
  width: 34px;
  height: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(60, 40, 20, 0.12));
}

.decor-cup-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Coffee Steam Micro-Animation (Cozy Reading Vibes) */
.coffee-steam-wrap {
  position: absolute;
  top: -12px;
  left: 45%;
  /* Căn giữa miệng cốc cà phê */
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}

.steam-line {
  width: 2.5px;
  height: 10px;
  background: linear-gradient(180deg, rgba(160, 130, 95, 0.5) 0%, rgba(200, 175, 145, 0.1) 100%);
  border-radius: 4px;
  filter: blur(0.5px);
  animation: coffeeSteam 2.4s infinite ease-in-out;
}

.steam-1 {
  animation-delay: 0s;
}

.steam-2 {
  animation-delay: 0.6s;
  height: 13px;
}

.steam-3 {
  animation-delay: 1.2s;
}

@keyframes coffeeSteam {
  0% {
    transform: translateY(2px) scaleX(1);
    opacity: 0;
  }

  30% {
    opacity: 0.75;
    transform: translateY(-4px) scaleX(1.3) skewX(-4deg);
  }

  70% {
    opacity: 0.35;
    transform: translateY(-10px) scaleX(1.7) skewX(4deg);
  }

  100% {
    transform: translateY(-16px) scaleX(2.2);
    opacity: 0;
  }
}

/* Bóng đổ chân sách */
.book-foot-shadow {
  position: absolute;
  bottom: -4px;
  left: 2px;
  right: 2px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(50, 30, 10, 0.35) 0%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* 3. SOLID NATURAL OAK FLOATING SHELF PLANK */
.shelf-plank-unit {
  position: relative;
  margin: 0 -14px;
  z-index: 4;
}

/* Mặt phẳng đợt kệ có chiều sâu thanh thoát */
.shelf-top-surface {
  height: 10px;
  background: linear-gradient(180deg, #dfbc90 0%, #ca9e6a 60%, #b88a53 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  border-radius: 4px 4px 0 0;
}

/* Mép trước thanh thoát bo góc mềm mại */
.shelf-plank-edge {
  height: 18px;
  background: linear-gradient(180deg, #bb8d56 0%, #9c6e37 50%, #7d5222 100%);
  border-top: 1px solid #f0d5ae;
  border-bottom: 2px solid #573412;
  border-radius: 0 0 5px 5px;
  box-shadow:
    0 10px 24px rgba(60, 35, 15, 0.16),
    0 3px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Pát đỡ kệ treo tường phong cách tối giản (Minimalist Steel Brackets) */
.shelf-brackets {
  position: absolute;
  top: 26px;
  left: 50px;
  right: 50px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.shelf-bracket {
  width: 14px;
  height: 20px;
  background: #3e332a;
  border-radius: 2px;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.15);
  position: relative;
}

.shelf-bracket::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 2px;
  width: 10px;
  height: 2px;
  background: #251d16;
}

.book {
  position: relative;
  cursor: pointer;
  transform-origin: bottom center;
  perspective: 800px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s ease;
  filter: brightness(0.94);
}

/* Tự nhiên: Cuốn cuối cùng hơi nghiêng tựa nhẹ */
.book.book-tilted {
  transform: rotate(-6.5deg) translate(14px, 3px);
  transform-origin: bottom left;
}

.book:hover {
  transform: translateY(-16px) scale(1.04) rotateX(2deg) rotateY(-4deg);
  filter: brightness(1.15) drop-shadow(0 16px 24px rgba(0, 0, 0, 0.4));
  z-index: 5;
}

.book.book-tilted:hover {
  transform: translateY(-16px) rotate(0deg) scale(1.04);
  filter: brightness(1.15) drop-shadow(0 16px 24px rgba(0, 0, 0, 0.4));
  z-index: 5;
}

.book-spine {
  width: var(--w, 36px);
  height: var(--h, 210px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px 3px 5px 3px;
  border-radius: 2px;
  background:
    /* Mép gập giấy gáy sách bìa mềm (paper hinge crease highlight & shadow) */
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.24) 0%,
      rgba(255, 255, 255, 0.12) 12%,
      rgba(255, 255, 255, 0.03) 48%,
      rgba(0, 0, 0, 0.06) 88%,
      rgba(0, 0, 0, 0.28) 100%),
    var(--spine-color, var(--color, #3d1f0a));
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.15),
    inset -1px 0 0 rgba(0, 0, 0, 0.2),
    2px 5px 12px rgba(40, 25, 10, 0.22);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  overflow: hidden;
  user-select: none;
}

/* Nếp gấp gáy sách bìa mềm (Paperback hinge lines) */
.book-spine::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.book-spine::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 2px;
  width: 1px;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* Bỏ hẳn các chi tiết bìa da cứng cổ điển */
.spine-headband,
.spine-rib {
  display: none !important;
}

.paperback-edge-fold {
  width: 65%;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 1px 0;
  opacity: 0.7;
}

/* Top Compartment (Ornament & Volume Cartouche cho bìa mềm) */
.spine-top-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 2px 0 1px;
  width: 100%;
}

.spine-ornament {
  font-size: 11px;
  color: #fff2d6;
  opacity: 0.9;
  line-height: 1;
}

.spine-vol-box {
  padding: 1px 4px;
  text-align: center;
  max-width: 90%;
}

.spine-vol-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  display: block;
  white-space: nowrap;
}

/* Standalone Single Book Spine Top Styles */
.spine-top-group.standalone {
  padding: 3px 0 2px;
  gap: 2px;
}

.spine-top-group.standalone .spine-ornament.lg {
  font-size: 12px;
  color: #fff4db;
  line-height: 1;
}

.spine-standalone-flourish {
  font-size: 6px;
  letter-spacing: 0.2em;
  color: #faebd2;
  opacity: 0.8;
}

/* Main Middle Compartment (Vertical Book Title cho bìa mềm) */
.spine-title-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  overflow: hidden;
  width: 100%;
}

.spine-main-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1.15;
}

.spine-main-title.multi-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 8.5px;
}

.spine-main-title .spine-col {
  white-space: nowrap;
  display: inline-block;
}

/* Bottom Compartment (Tail Imprint / Logo bìa mềm tối giản) */
.spine-tail-imprint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 2px 0 2px;
  opacity: 0.85;
}

.imprint-icon {
  font-size: 7px;
  color: #ffffff;
  line-height: 1;
}

.imprint-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 4px;
  letter-spacing: 0.16em;
  color: #ffffff;
  font-weight: 700;
}

/* Filter & Grid */
.filter-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  row-gap: 16px;
  margin-bottom: 35px;
  flex-wrap: wrap;
  position: relative;
  z-index: 5;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid #dfcfb8;
  border-radius: 20px;
  font-size: 13px;
  color: #5c4430;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.filter-pill.active,
.filter-pill:hover {
  background: #b8862d;
  border-color: #b8862d;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(184, 134, 45, 0.28);
}

#pinnedCountBadge {
  display: inline-block;
  background: rgba(184, 134, 45, 0.15);
  color: #8c601a;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}

.filter-pill.active #pinnedCountBadge {
  background: rgba(0, 0, 0, 0.22);
  color: #ffffff;
}

.search-box-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-box-wrap::before {
  content: '🔍';
  position: absolute;
  left: 13px;
  font-size: 12px;
  opacity: 0.5;
  pointer-events: none;
}

.search-input {
  padding: 9px 16px 9px 36px;
  background: #ffffff;
  border: 1px solid #dfcfb8;
  border-radius: 20px;
  color: #2c1f16;
  font-size: 13px;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 45, 0.15);
}

.search-input::placeholder {
  color: #a8947f;
}

/* ==========================================================================
   SECTION: NHỮNG TRANG GIẤY CHƯA ĐÓNG BÌA (LOOSE MANUSCRIPT DRAFTS)
   ========================================================================== */

.manuscript-section {
  max-width: 1040px;
  margin: 0 auto 80px auto;
  padding: 0 20px;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.manuscript-section .container {
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.section-drafts-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}

.drafts-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(184, 134, 45, 0.35);
  font-size: 22px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.drafts-main-heading {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: var(--desk-40, clamp(28px, 3.3vw, 40px));
  font-weight: 700;
  color: #1e130b;
  letter-spacing: normal;
  line-height: 1.25;
  margin-bottom: 12px;
  text-shadow: none;
}

.drafts-sub-heading {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: var(--desk-16, clamp(14px, 1.3vw, 16px));
  color: #634f3d;
  font-style: normal;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Filter Actions Right Container */
.filter-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* View Mode Toggle: Stream vs Grid */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #dfcfb8;
  border-radius: 24px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: transparent;
  border: none;
  border-radius: 18px;
  font-size: 12.5px;
  font-weight: 500;
  color: #6b523c;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-view-mode:hover {
  color: #2b1a0e;
}

.btn-view-mode.active {
  background: #b8862d;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(184, 134, 45, 0.3);
}

.btn-view-mode .mode-icon {
  font-size: 13px;
  line-height: 1;
}

/* ==========================================================================
   MANUSCRIPT DRAFT CARDS & VIEWPORT
   ========================================================================== */

.manuscript-viewport-wrap {
  position: relative;
  width: 100%;
}

/* Stream Mode (Mặc định: Dòng Chảy Bàn Viết Kéo Ngang Mênh Mang) */
.manuscript-grid.mode-stream {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  gap: 32px;
  padding: 24px 12px 38px 12px;
  margin-bottom: 8px;
  cursor: grab;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: #b8862d rgba(184, 134, 45, 0.1);
}

.manuscript-grid.mode-stream:active {
  cursor: grabbing;
}

.manuscript-grid.mode-stream .manuscript-sheet {
  flex: 0 0 310px;
  width: 310px;
  max-width: 310px;
  scroll-snap-align: start;
}

/* Custom Vintage Scrollbar for Stream Mode */
.manuscript-grid.mode-stream::-webkit-scrollbar {
  height: 8px;
}

.manuscript-grid.mode-stream::-webkit-scrollbar-track {
  background: rgba(184, 134, 45, 0.08);
  border-radius: 10px;
  margin: 0 30px;
}

.manuscript-grid.mode-stream::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #d4a85c, #b8862d, #d4a85c);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.manuscript-grid.mode-stream::-webkit-scrollbar-thumb:hover {
  background: #a17222;
}

/* Navigation Arrow Buttons for Stream Mode */
.stream-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(184, 134, 45, 0.38);
  color: #5c3f19;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.stream-nav-arrow:hover {
  background: #b8862d;
  color: #ffffff;
  border-color: #b8862d;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 8px 25px rgba(184, 134, 45, 0.32);
}

.stream-nav-arrow svg {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Optical micro-centering: chevron centroid compensation (luôn cố định ở tâm) */
.stream-nav-arrow.prev svg {
  transform: translateX(-1px);
}

.stream-nav-arrow.next svg {
  transform: translateX(1px);
}

.stream-nav-arrow.prev {
  left: -20px;
}

.stream-nav-arrow.next {
  right: -20px;
}

.stream-nav-arrow.is-disabled {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Hint bar below stream */
.stream-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--album-font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: #856d58;
  margin-bottom: 50px;
  opacity: 0.85;
  user-select: none;
  transition: opacity 0.3s ease;
}

.stream-hint-bar .hint-icon {
  font-style: normal;
  display: inline-block;
  animation: gentleBob 2s infinite ease-in-out alternate;
}

@keyframes gentleBob {
  0% { transform: translateX(-3px); }
  100% { transform: translateX(3px); }
}

/* Grid Mode (Chế độ xem toàn bộ dạng lưới) */
.manuscript-grid.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 36px;
  margin-bottom: 60px;
}

/* Hide navigation arrows and stream hint when in grid mode */
.manuscript-section.is-grid-mode .stream-nav-arrow,
.manuscript-section.is-grid-mode .stream-hint-bar {
  display: none !important;
}

/* Base Manuscript Sheet Paper */
.manuscript-sheet {
  background: linear-gradient(135deg, #fdfbf7 0%, #f7f0e3 50%, #f1e6d3 100%);
  color: #2c221a;
  border: 1px solid #dfcfb8;
  border-radius: 6px;
  padding: 32px 26px 22px 26px;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 4px 12px rgba(60, 40, 20, 0.06),
    0 12px 28px rgba(60, 40, 20, 0.09);
  transform-origin: center top;
}

/* Natural messy desk rotation */
.manuscript-sheet:nth-child(3n+1) {
  transform: rotate(-1.2deg);
}

.manuscript-sheet:nth-child(3n+2) {
  transform: rotate(1deg);
}

.manuscript-sheet:nth-child(3n+3) {
  transform: rotate(-0.6deg);
}

.manuscript-sheet:hover {
  transform: translateY(-8px) rotate(0deg) scale(1.015);
  border-color: #c99a4e;
  box-shadow:
    0 4px 0 rgba(201, 154, 78, 0.35),
    0 18px 36px rgba(60, 40, 20, 0.14),
    0 0 25px rgba(226, 176, 99, 0.2);
  z-index: 5;
}

/* Notebook Spiral Perforations at the top */
.sheet-spiral-edge {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 14px;
  display: flex;
  justify-content: space-around;
  padding: 0 16px;
  pointer-events: none;
}

.sheet-spiral-edge span {
  display: inline-block;
  width: 7px;
  height: 10px;
  background: #0f0b08;
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.8);
}

/* Metal Paperclip at top right */
.sheet-metal-clip {
  position: absolute;
  top: -10px;
  right: 28px;
  width: 16px;
  height: 38px;
  border: 3px solid #b8a688;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.4);
  transform: rotate(6deg);
  pointer-events: none;
  z-index: 3;
}

.sheet-metal-clip::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 2px;
  right: 2px;
  height: 24px;
  border: 2px solid #8e7c5f;
  border-top: none;
  border-radius: 0 0 6px 6px;
}

/* Pinned ribbon/badge */
.sheet-pinned-badge {
  position: absolute;
  top: 14px;
  right: -8px;
  background: linear-gradient(135deg, #d35400 0%, #a04000 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 3px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transform: rotate(4deg);
  z-index: 4;
}

/* Sheet Header */
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(184, 138, 68, 0.35);
}

.sheet-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(184, 138, 68, 0.14);
  border: 1px solid rgba(184, 138, 68, 0.35);
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #634316;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sheet-date-stamp {
  font-family: monospace, var(--album-font-sans);
  font-size: 11px;
  color: #8c6838;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: rgba(140, 104, 56, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Context Line */
.sheet-context-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #7d6550;
  font-style: italic;
  margin-bottom: 12px;
}

.context-pin {
  font-size: 12px;
}

/* Visuals: Polaroid vs Quote Box */
.sheet-photo-wrapper {
  margin-bottom: 14px;
}

.sheet-polaroid-clip {
  background: #ffffff;
  padding: 8px 8px 18px 8px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  border: 1px solid #eee5d8;
  transform: rotate(-0.8deg);
  transition: transform 0.3s ease;
}

.manuscript-sheet:hover .sheet-polaroid-clip {
  transform: rotate(0.5deg);
}

.sheet-polaroid-clip img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.sheet-photo-stamp {
  font-family: monospace;
  font-size: 9px;
  color: #99836e;
  text-align: right;
  margin-top: 6px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.sheet-quote-box {
  background: rgba(184, 138, 68, 0.08);
  border-left: 3px solid #b88a44;
  padding: 14px 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 14px;
  position: relative;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.sheet-quote-text {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-style: normal;
  font-size: 14.5px;
  color: #4a3219;
  line-height: 1.65;
  font-weight: 500;
}

/* Sheet Content: Title & Alias */
.sheet-content {
  margin-bottom: 12px;
}

.sheet-title {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 18.5px;
  font-weight: 700;
  color: #1a130e;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.sheet-alias {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 12px;
  color: #6d5744;
}

.alias-tag {
  color: #94682c;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  margin-right: 3px;
}

.alias-text {
  font-style: italic;
}

/* Marginalia (Dòng viết chì bên lề) */
.sheet-marginalia {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(110, 95, 80, 0.07);
  border-radius: 4px;
  padding: 7px 10px;
  margin-bottom: 14px;
  border-left: 2px solid #8e7862;
}

.pencil-icon {
  font-size: 12px;
  color: #7a6652;
  flex-shrink: 0;
  margin-top: 1px;
}

.marginalia-content {
  font-family: var(--album-font-handwriting);
  font-size: 18px;
  color: #534537;
  line-height: 1.25;
}

/* Sheet Footer */
.sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(184, 138, 68, 0.25);
  margin-top: auto;
}

.btn-sheet-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed rgba(140, 104, 56, 0.4);
  color: #6e522b;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-sheet-pin:hover,
.btn-sheet-pin.active {
  background: #6e522b;
  color: #fff;
  border-style: solid;
}

.btn-sheet-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: #2a1f18;
  border: 1px solid #3d2f24;
  border-radius: 16px;
  color: #f7eed9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.manuscript-sheet:hover .btn-sheet-read {
  background: #b88a44;
  border-color: #d4a85c;
  color: #fff;
  box-shadow: 0 4px 12px rgba(184, 138, 68, 0.4);
}

/* ==========================================================================
   LOOSE SHEET READER LIGHTBOX MODAL
   ========================================================================== */

.sheet-modal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(20, 13, 8, 0.94) 0%, rgba(4, 2, 1, 0.98) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.sheet-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet-modal-container {
  max-width: 680px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.sheet-modal-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.sheet-modal-pin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 168, 92, 0.15);
  border: 1px solid rgba(212, 168, 92, 0.35);
  color: #f0debe;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.sheet-modal-pin-btn:hover,
.sheet-modal-pin-btn.pinned {
  background: #c0392b;
  border-color: #e74c3c;
  color: #fff;
}

.sheet-modal-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #eedcc0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.sheet-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

/* Authentic Paper in Lightbox */
.loose-sheet-paper {
  background: linear-gradient(135deg, #fdfbf7 0%, #f7f1e4 60%, #f0e6d2 100%);
  color: #261b14;
  border-radius: 4px;
  border: 1px solid #d8c6ac;
  width: 100%;
  max-height: calc(92vh - 60px);
  overflow-y: auto;
  padding: 40px 36px 40px 42px;
  position: relative;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.7),
    0 25px 65px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(212, 168, 92, 0.15);
}

/* Custom Paper Scrollbar */
.loose-sheet-paper::-webkit-scrollbar {
  width: 6px;
}

.loose-sheet-paper::-webkit-scrollbar-track {
  background: rgba(184, 138, 68, 0.08);
  border-radius: 3px;
}

.loose-sheet-paper::-webkit-scrollbar-thumb {
  background: #cbb494;
  border-radius: 3px;
}

.modal-sheet-spiral {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
  pointer-events: none;
}

.modal-sheet-spiral span {
  display: inline-block;
  width: 8px;
  height: 11px;
  background: #110d0a;
  border-radius: 0 0 5px 5px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.85);
}

.modal-sheet-paperclip {
  position: absolute;
  top: -12px;
  right: 44px;
  width: 20px;
  height: 48px;
  border: 4px solid #b8a688;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: transparent;
  box-shadow: 2px 5px 8px rgba(0, 0, 0, 0.4);
  transform: rotate(4deg);
  pointer-events: none;
  z-index: 5;
}

.modal-sheet-paperclip::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 3px;
  right: 3px;
  height: 30px;
  border: 3px solid #8e7c5f;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.modal-sheet-meta-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(184, 138, 68, 0.3);
}

.modal-draft-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-draft-badge .badge-icon {
  font-size: 20px;
}

.modal-draft-badge .badge-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #7a5420;
  text-transform: uppercase;
}

.modal-draft-badge .badge-id {
  font-size: 11px;
  font-weight: 600;
  color: #997b53;
  background: rgba(184, 138, 68, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
}

.modal-draft-date-info {
  font-size: 12px;
  color: #725a45;
  text-align: right;
  line-height: 1.5;
}

.modal-draft-title {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: #19120c;
  margin-bottom: 8px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.modal-draft-alias {
  font-family: var(--font-body, 'Manrope', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 13px;
  color: #8c5e26;
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
}

.modal-paper-polaroid {
  float: right;
  margin: 0 0 16px 22px;
  max-width: 220px;
  background: #ffffff;
  padding: 8px 8px 14px 8px;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  border: 1px solid #ebd9be;
  position: relative;
  transform: rotate(1.5deg);
}

.polaroid-pin-icon {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
}

.modal-paper-polaroid img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  display: block;
}

.polaroid-caption-text {
  font-family: monospace;
  font-size: 9px;
  color: #8c735a;
  text-align: center;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.modal-draft-text-body {
  font-family: var(--album-font-serif);
  font-size: 16px;
  line-height: 1.85;
  color: #2c2118;
  margin-bottom: 26px;
}

.modal-draft-text-body p {
  margin-bottom: 16px;
  text-align: justify;
}

.modal-draft-pencil-note {
  background: rgba(184, 138, 68, 0.12);
  border-left: 3px solid #b88a44;
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin-top: 24px;
  margin-bottom: 20px;
  clear: both;
}

.pencil-label {
  font-size: 12px;
  font-weight: 700;
  color: #755121;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.pencil-text {
  font-family: var(--album-font-handwriting);
  font-size: 22px;
  color: #4b351d;
  line-height: 1.35;
}

.modal-draft-footer-note {
  text-align: center;
  font-family: var(--album-font-serif);
  font-size: 12px;
  font-style: italic;
  color: #947b63;
  padding-top: 14px;
  border-top: 1px dashed rgba(184, 138, 68, 0.3);
  clear: both;
}

/* ==========================================================================
   PHYSICALLY ACCURATE 3D BOOK UNFOLD THEATER
   ========================================================================== */

/* ==========================================================================
   PHYSICALLY ACCURATE 3D FLIPBOOK THEATER (MATCHING /3d-flipbook/*)
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(20, 13, 8, 0.94) 0%, rgba(4, 2, 1, 0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  padding: 1.5rem 1rem;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.overlay:not(.open) * {
  pointer-events: none !important;
}

.flipbook-theater {
  width: min(1080px, 96vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  user-select: none;
}

/* Topbar Controls */
.flipbook-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(28, 18, 12, 0.94) 0%, rgba(45, 28, 18, 0.92) 100%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(230, 190, 120, 0.45);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 235, 180, 0.12) inset;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.flipbook-meta-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.flipbook-meta-badge > div {
  min-width: 0;
  overflow: hidden;
}

.flipbook-meta-badge .badge-line {
  display: inline-block;
  width: 3.5px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fce0a2 0%, #c49646 100%);
  box-shadow: 0 0 10px rgba(245, 215, 150, 0.45);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.flipbook-book-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 700;
  color: #fffaf0;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 12px rgba(235, 196, 120, 0.35);
}

.flipbook-book-author {
  font-family: 'IM Fell English', serif;
  font-size: 12px;
  color: #ecd5b3;
  font-style: italic;
  letter-spacing: 0.02em;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 0;
}

.flipbook-audio-btn {
  background: linear-gradient(135deg, rgba(235, 196, 120, 0.15) 0%, rgba(184, 134, 45, 0.22) 100%);
  border: 1px solid rgba(230, 190, 120, 0.48);
  border-radius: 999px;
  padding: 6px 14px 6px 11px;
  color: #fff4dc;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.flipbook-audio-btn:hover {
  background: linear-gradient(135deg, rgba(245, 210, 140, 0.28) 0%, rgba(200, 145, 55, 0.32) 100%);
  border-color: #ffd88a;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(235, 196, 120, 0.4);
}

.flipbook-audio-btn:active {
  transform: scale(0.96);
}

.flipbook-audio-btn .audio-wave-bars {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
  width: 14px;
  justify-content: center;
}

.flipbook-audio-btn .audio-wave-bars .bar {
  display: inline-block;
  width: 2.2px;
  border-radius: 2px;
  background: #f6c878;
  box-shadow: 0 0 6px rgba(246, 200, 120, 0.6);
  transition: all 0.25s ease;
}

/* Đang phát nhạc: Thanh âm thanh nhún nhảy mềm mại */
.flipbook-audio-btn.is-playing .bar-1 {
  height: 6px;
  animation: flipbookWaveBounce 0.8s ease-in-out infinite alternate;
}

.flipbook-audio-btn.is-playing .bar-2 {
  height: 13px;
  animation: flipbookWaveBounce 1.1s ease-in-out infinite alternate 0.2s;
}

.flipbook-audio-btn.is-playing .bar-3 {
  height: 9px;
  animation: flipbookWaveBounce 0.9s ease-in-out infinite alternate 0.4s;
}

@keyframes flipbookWaveBounce {
  0% { height: 4px; }
  100% { height: 14px; }
}

/* Tạm dừng nhạc: Thanh âm thanh tĩnh lặng, màu sắc tối dịu */
.flipbook-audio-btn.is-paused {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(230, 190, 120, 0.22);
  color: #cbbba6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.flipbook-audio-btn.is-paused .audio-wave-bars .bar {
  height: 3px !important;
  animation: none !important;
  background: #9c8a77;
  box-shadow: none;
  opacity: 0.65;
}

.flipbook-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-flip-ctrl {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(230, 190, 120, 0.48);
  color: #fff8eb;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-flip-ctrl:hover {
  background: linear-gradient(180deg, rgba(235, 196, 120, 0.38) 0%, rgba(184, 134, 45, 0.3) 100%);
  border-color: #ffd88a;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(235, 196, 120, 0.4);
}

.btn-flip-ctrl.active {
  background: linear-gradient(180deg, #e4ba6f 0%, #b8862d 100%);
  color: #1a0f05;
  border-color: #ffe6aa;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(228, 186, 111, 0.6);
  text-shadow: none;
}

.flipbook-page-counter {
  background: rgba(235, 196, 120, 0.15);
  border: 1px solid rgba(235, 196, 120, 0.4);
  color: #fff0d0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 16px;
  min-width: 80px;
  text-align: center;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.close-btn {
  background: linear-gradient(180deg, rgba(220, 50, 50, 0.38) 0%, rgba(160, 30, 30, 0.5) 100%);
  border: 1px solid rgba(255, 140, 140, 0.65);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 3px 12px rgba(200, 30, 30, 0.4);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.close-btn:hover {
  background: linear-gradient(180deg, rgba(245, 60, 60, 0.65) 0%, rgba(190, 30, 30, 0.8) 100%);
  border-color: #ffb8b8;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 80, 80, 0.6);
  transform: translateY(-1.5px);
}

.close-btn-text-mob {
  display: none;
}

/* 3D Viewport */
.flipbook-viewport {
  width: 100%;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  perspective-origin: center 48%;
  overflow: visible;
  padding: 20px 0 35px;
}

/* ==========================================================================
   THE 3D BOOK (EXACT 1:1 LOGIC FROM /3d-flipbook/*)
   ========================================================================== */

.book-3d {
  position: relative;
  display: flex;
  margin: auto;
  width: clamp(280px, 34vw, 390px);
  height: clamp(430px, 56vh, 540px);
  pointer-events: none;
  transform-style: preserve-3d;
  transition: translate 0.9s cubic-bezier(0.25, 1, 0.5, 1), rotate 0.8s ease;
  translate: calc(min(var(--c, 0), 1) * 50%) 0%;
  /* Incline on the X axis for pages preview (like /3d-flipbook/*) */
  rotate: 1 0 0 22deg;
}

.book-3d.flat-angle {
  rotate: 1 0 0 0deg !important;
}

.book-3d.tilted-angle {
  rotate: 1 0 0 26deg !important;
}

/* Pages */
.book-3d .page {
  --thickness: 4;
  flex: none;
  display: flex;
  width: 100%;
  height: 100%;
  pointer-events: all;
  user-select: none;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition:
    transform 0.85s cubic-bezier(0.25, 1, 0.5, 1),
    rotate 0.85s ease-in calc((min(var(--i), var(--c, 0)) - max(var(--i), var(--c, 0))) * 45ms);
  translate: calc(var(--i) * -100%) 0px 0px;
  transform: translateZ(calc((var(--c, 0) - var(--i) - 0.5) * calc(var(--thickness) * 1.3px)));
  rotate: 0 1 0 calc(clamp(0, var(--c, 0) - var(--i), 1) * -180deg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}

/* Front & Back Faces */
.book-3d .front,
.book-3d .back {
  position: relative;
  flex: none;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.8rem 1.7rem 1.2rem;
  background-color: #faf5ec !important; /* Đảm bảo 100% đục, ngăn chặn thấu quang nhìn xuyên trang */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  color: #1a1208;
  border: 1px solid rgba(139, 100, 60, 0.22);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hoàn toàn loại bỏ thanh cuộn (scrollbar) để trang sách phẳng và thanh lịch như sách thật */
.book-3d * {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.book-3d *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Khắc phục triệt để lỗi Z-fighting và bóng chữ trang trước thấu qua trên Mobile (iOS Safari & Android Chrome) */
.book-3d .front {
  border-radius: 2px 8px 8px 2px;
  background-image: linear-gradient(to right, #ede4ce 0%, #fbf7ee 12%, #faf5ec 100%);
  box-shadow: inset -8px 0 18px rgba(0, 0, 0, 0.06);
  transform: translateZ(1px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.book-3d .back {
  translate: -100% 0;
  rotate: 0 1 0 180deg;
  border-radius: 8px 2px 2px 8px;
  background-image: linear-gradient(to left, #ede4ce 0%, #fbf7ee 12%, #faf5ec 100%);
  box-shadow: inset 8px 0 18px rgba(0, 0, 0, 0.08);
  transform: translateZ(1px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Đảm bảo toàn bộ chữ và hình ảnh bên trong trang hoàn toàn ẩn khi mặt trang quay lưng */
.book-3d .front *,
.book-3d .back * {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Page corner turn hint / edge hover */
.book-3d .page:hover .front {
  box-shadow: inset -12px 0 24px rgba(201, 168, 76, 0.15), 4px 0 12px rgba(0, 0, 0, 0.15);
}

.book-3d .page:hover .back {
  box-shadow: inset 12px 0 24px rgba(201, 168, 76, 0.15), -4px 0 12px rgba(0, 0, 0, 0.15);
}

.book-3d.mounting .page {
  transition: none !important;
}

/* Covers (Hardcover leather with embossed gold foil) */
.book-3d .cover {
  padding: 2.5rem 2rem;
  background-color: var(--book-color, #3d1f0a);
  background: var(--book-cover-bg, linear-gradient(135deg, #3d1f0a 0%, #1a0e08 100%));
  color: var(--gold-light, #fbf2dc);
  border: 2px solid var(--book-gold, #c9a84c);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.book-3d .cover::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid var(--book-gold, #c9a84c);
  opacity: 0.65;
  border-radius: 4px;
  pointer-events: none;
}

.book-3d .cover::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(201, 168, 76, 0.35);
  border-radius: 2px;
  pointer-events: none;
}

.book-3d .front.cover {
  border-left: 16px solid var(--book-spine, #120703);
  box-shadow: inset -10px 0 25px rgba(0, 0, 0, 0.7), 8px 12px 30px rgba(0, 0, 0, 0.6);
}

.book-3d .back.cover {
  border-right: 16px solid var(--book-spine, #120703);
  box-shadow: inset 10px 0 25px rgba(0, 0, 0, 0.7), -8px 12px 30px rgba(0, 0, 0, 0.6);
}

/* Front Cover Layout */
.cover-top-ornament {
  font-size: 32px;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(201, 168, 76, 0.6);
  line-height: 1;
}

.cover-volume-tag {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.cover-main-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 2.8vw, 26px);
  color: var(--gold-light);
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  margin-bottom: 12px;
}

.cover-sub-author {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--gold);
  opacity: 0.9;
}

.cover-open-hint {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: #f5eedc;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  background: rgba(22, 10, 8, 0.9);
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 20px;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Trang Hồi kết cuối sách */
.conclude-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: #3d210b;
  margin-bottom: 8px;
}

.conclude-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13.5px;
  color: #5a3819;
  line-height: 1.45; /* Đã giảm khoảng cách dòng */
  max-width: 90%;
  margin: 0 auto;
}

.conclude-publisher {
  margin-top: 14px;
  font-family: 'IM Fell English', serif;
  font-size: 11px; /* Đã giảm font size */
  color: #8c5b1d;
  opacity: 0.82;
  letter-spacing: 0.03em;
}

/* Inside Cover (Ex-Libris Vintage Bookplate) */
.inside-cover-bookplate {
  margin: auto;
  border: 2px solid rgba(139, 100, 60, 0.4);
  padding: 24px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  width: 90%;
}

.ex-libris-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.25em;
  color: #724c1c;
  margin-bottom: 8px;
}

.ex-libris-symbol {
  font-size: 26px;
  color: #8c5b1d;
  margin-bottom: 8px;
}

.ex-libris-name {
  font-family: 'IM Fell English', serif;
  font-size: 18px;
  color: #3b210c;
  font-weight: 700;
  border-bottom: 1px solid rgba(139, 100, 60, 0.3);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.ex-libris-desc {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  font-style: italic;
  color: #614424;
  line-height: 1.6;
}

/* Story Pages Inside */
.story-page-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.page-chapter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: #8c5b1d;
  text-transform: uppercase;
  margin-bottom: 5px;
  opacity: 0.85;
}

.page-heading {
  font-family: 'IM Fell English', serif;
  font-size: clamp(15px, 1.8vw, 18px);
  color: #3a1f0a;
  margin-bottom: 8px;
  line-height: 1.25;
}

.page-body-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(13px, 1.45vw, 14.5px);
  line-height: 1.52;
  color: #2b1b0d;
  text-align: justify;
}

.page-body-text p {
  margin-bottom: 0.6em;
}

.page-body-text p+p {
  margin-top: 0;
  text-indent: 1.2em;
}

.page-drop-cap::first-letter {
  float: left;
  font-size: 3.2em;
  line-height: 0.8;
  font-family: 'Cormorant Garamond', serif;
  color: #8c5b1d;
  margin-right: 0.08em;
  margin-top: 0.04em;
}

.page-photo-frame {
  margin: 12px 0;
  border: 4px solid #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.page-photo-frame img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.page-quote-callout {
  background: rgba(184, 138, 68, 0.12);
  border-left: 3px solid #b88a44;
  padding: 10px 14px;
  margin-top: 12px;
  font-style: italic;
  font-size: 13px;
  color: #5c3f19;
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
}

.page-footer-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  color: #8c5b1d;
  margin-top: 12px;
  opacity: 0.7;
}

.front .page-footer-num {
  text-align: right;
}

.back .page-footer-num {
  text-align: left;
}

/* Footer Hint */
.flipbook-footer-hint {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: #ffffff;
  opacity: 0.75;
  margin-top: 15px;
}

/* ==========================================================================
   INTIMATE DEDICATION BANNER (LỜI ĐỀ TẶNG CUỐI TRANG)
   ========================================================================== */

.dedication-section {
  max-width: 1040px;
  margin: 50px auto 95px auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.dedication-card {
  background: linear-gradient(135deg, #ffffff 0%, #faf4e8 50%, #f4e9d4 100%);
  border: 1px solid #d8c6ac;
  border-radius: 16px;
  padding: 44px 44px 38px 44px;
  position: relative;
  box-shadow:
    0 10px 25px rgba(60, 40, 20, 0.08),
    0 25px 50px rgba(60, 40, 20, 0.08),
    inset 0 0 40px rgba(184, 138, 68, 0.05);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Two-column Inner Layout */
.dedication-inner-layout {
  display: flex;
  align-items: center;
  gap: 44px;
  position: relative;
  z-index: 2;
}

/* Left Image Column: Vintage Polaroid Frame */
.dedication-image-column {
  flex: 0 0 320px;
  max-width: 320px;
  display: flex;
  justify-content: center;
  position: relative;
}

.dedication-polaroid-frame {
  position: relative;
  background: #ffffff;
  padding: 12px 12px 18px 12px;
  border-radius: 8px;
  border: 1px solid rgba(184, 138, 68, 0.35);
  box-shadow:
    0 10px 24px rgba(60, 40, 20, 0.12),
    0 2px 6px rgba(60, 40, 20, 0.06);
  transform: rotate(-2.5deg);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
}

.dedication-polaroid-frame:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.02);
  box-shadow:
    0 16px 36px rgba(60, 40, 20, 0.18),
    0 4px 12px rgba(60, 40, 20, 0.08);
}

/* Washi Tape on Top */
.polaroid-washi-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 80px;
  height: 22px;
  background: rgba(212, 168, 92, 0.45);
  backdrop-filter: blur(2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 2px dashed rgba(255, 255, 255, 0.4);
  border-right: 2px dashed rgba(255, 255, 255, 0.4);
  z-index: 3;
  pointer-events: none;
}

.polaroid-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #f4ede0;
  border: 1px solid rgba(184, 138, 68, 0.15);
}

.dedication-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.dedication-polaroid-frame:hover .dedication-img {
  transform: scale(1.05);
}

.polaroid-caption {
  margin-top: 10px;
  text-align: center;
}

.caption-handwritten {
  font-family: 'Cormorant Garamond', 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  font-weight: 600;
  color: #8c601a;
  letter-spacing: 0.04em;
}

/* Right Content Column */
.dedication-text-column {
  flex: 1;
  min-width: 0;
  text-align: center;
  position: relative;
}

@media (max-width: 880px) {
  .dedication-inner-layout {
    flex-direction: column;
    gap: 32px;
  }

  .dedication-image-column {
    flex: 0 0 auto;
    max-width: 280px;
    width: 100%;
  }

  .dedication-card {
    padding: 38px 24px 30px 24px;
  }
}

.dedication-card::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px dashed rgba(184, 138, 68, 0.35);
  border-radius: 8px;
  pointer-events: none;
}

.dedication-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 138, 68, 0.6);
  box-shadow:
    0 15px 35px rgba(60, 40, 20, 0.12),
    0 30px 60px rgba(60, 40, 20, 0.12),
    0 0 35px rgba(212, 168, 92, 0.2);
}

/* Vintage Corner Accents */
.dedication-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #b8862d;
  pointer-events: none;
  opacity: 0.75;
}

.dedication-corner.tl {
  top: 18px;
  left: 18px;
  border-top: 2px solid #b8862d;
  border-left: 2px solid #b8862d;
}

.dedication-corner.tr {
  top: 18px;
  right: 18px;
  border-top: 2px solid #b8862d;
  border-right: 2px solid #b8862d;
}

.dedication-corner.bl {
  bottom: 18px;
  left: 18px;
  border-bottom: 2px solid #b8862d;
  border-left: 2px solid #b8862d;
}

.dedication-corner.br {
  bottom: 18px;
  right: 18px;
  border-bottom: 2px solid #b8862d;
  border-right: 2px solid #b8862d;
}

/* Header Flourish */
.dedication-header-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.flourish-line {
  height: 1px;
  width: 70px;
  background: linear-gradient(90deg, transparent 0%, rgba(184, 134, 45, 0.5) 100%);
}

.dedication-header-flourish .flourish-line:last-child {
  background: linear-gradient(90deg, rgba(184, 134, 45, 0.5) 0%, transparent 100%);
}

.flourish-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(184, 138, 68, 0.12);
  border: 1px solid rgba(184, 138, 68, 0.35);
  padding: 5px 16px;
  border-radius: 16px;
}

.flourish-icon {
  color: #b8862d;
  font-size: 11px;
}

.flourish-title {
  font-family: var(--album-font-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #7a5420;
  text-transform: uppercase;
}

/* Watermark */
.dedication-watermark {
  position: absolute;
  top: 15px;
  left: 36px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 160px;
  line-height: 1;
  color: rgba(184, 138, 68, 0.08);
  pointer-events: none;
  user-select: none;
}

/* Quote */
.dedication-quote {
  font-family: var(--album-font-serif);
  font-size: clamp(20px, 2.7vw, 26px);
  font-style: italic;
  font-weight: 600;
  color: #1e130b;
  line-height: 1.55;
  margin: 0 auto 16px auto;
  max-width: 700px;
  letter-spacing: -0.01em;
  text-shadow: none;
  position: relative;
  z-index: 1;
}

/* Divider */
.dedication-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  color: #b8862d;
  font-size: 11px;
  letter-spacing: 0.4em;
}

/* Subtext */
.dedication-sub {
  font-family: var(--album-font-serif);
  font-size: clamp(14px, 1.5vw, 16px);
  color: #5c4532;
  line-height: 1.85;
  max-width: 640px;
  margin: 0 auto 30px auto;
  text-align: center;
  position: relative;
  z-index: 1;
  font-style: normal;
}

/* Sign-off with Wax Seal */
.dedication-signoff {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px dashed rgba(212, 168, 92, 0.28);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.signoff-wax-seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c0392b 0%, #962d22 50%, #681f17 100%);
  border: 2px solid rgba(231, 76, 60, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  transition: transform 0.35s ease;
}

.dedication-card:hover .signoff-wax-seal {
  transform: rotate(12deg) scale(1.06);
}

.seal-inner {
  font-family: var(--album-font-serif);
  font-size: 11px;
  font-weight: 800;
  color: #ffdedb;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.signoff-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 4px;
}

.signoff-name {
  font-family: var(--album-font-serif);
  font-size: 13px;
  font-weight: 700;
  color: #2c1f16;
  letter-spacing: 0.05em;
}

.signoff-date {
  font-size: 11px;
  color: #7d6550;
  font-style: italic;
}

@media (max-width: 992px) {
  .album-wrapper {
    padding: 30px 20px 60px 20px !important;
    max-width: 1040px !important;
    box-sizing: border-box !important;
  }

  .studio-corner-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    width: 100% !important;
    max-width: 100% !important;
  }

  .studio-shelf-col .bookshelf {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto;
    height: auto;
    box-sizing: border-box !important;
  }

  .studio-deck-col {
    margin-top: 10px;
  }

  .studio-deck-col .audio-deck-container {
    max-width: 100% !important;
    margin: 0 auto;
    width: 100% !important;
    height: auto;
    grid-template-columns: 240px 1fr;
    box-sizing: border-box !important;
  }

  .studio-deck-col .turntable-box {
    width: 230px;
    height: 230px;
  }

  .studio-deck-col .vinyl-record {
    width: 195px;
    height: 195px;
  }
}

@media (max-width: 600px) {
  .studio-deck-col .audio-deck-container {
    grid-template-columns: 1fr;
    padding: 24px 20px !important;
    border-radius: 16px !important;
    gap: 20px;
    text-align: center;
  }

  .studio-deck-col .turntable-box {
    width: min(220px, 68vw) !important;
    height: min(220px, 68vw) !important;
  }

  .studio-deck-col .vinyl-record {
    width: min(180px, 56vw) !important;
    height: min(180px, 56vw) !important;
  }

  .studio-deck-col .deck-now-playing {
    justify-content: center;
  }

  .studio-deck-col .deck-controls {
    justify-content: center;
  }

  .shelf-interactive-hint {
    font-size: clamp(10px, 2.7vw, 11.5px);
    padding: 4px 10px 4px 6px;
    gap: 6px;
    margin-bottom: 12px;
    max-width: 98%;
  }

  .shelf-interactive-hint .hint-label {
    font-size: 8.5px;
    padding: 2px 6px;
  }
}

/* Responsive Rules for Small Devices (Mobile Viewports) */
@media (max-width: 768px) {
  /* Đồng bộ padding tất cả các section như dedication-section */
  .album-wrapper {
    padding: 24px 20px 50px 20px !important;
    box-sizing: border-box !important;
  }

  .manuscript-section {
    padding: 0 20px !important;
    box-sizing: border-box !important;
  }

  .manuscript-section .container {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Kệ sách 3D trên Mobile: Viền thu gọn, các cuốn sách co giãn tự nhiên không tràn màn hình */
  .studio-shelf-col .bookshelf {
    border-left: 8px solid #a87944 !important;
    border-right: 8px solid #a87944 !important;
    border-radius: 10px 10px 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .shelf-plank-unit {
    margin: 0 -8px !important;
  }

  .shelf-center-stage {
    padding: 0 4px 0 0 !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .books-container {
    gap: 3px !important;
    margin-left: 0 !important;
  }

  .shelf-decor-group {
    transform: scale(0.65) !important;
    transform-origin: bottom center !important;
    margin: 0 -8px !important;
  }

  .shelf-special-book {
    margin-right: 2px !important;
  }

  /* Filter Pills Horizontal Scroll (Vuốt ngang mượt mà, không lệch padding) */
  .filter-section {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 25px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .filter-pills {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 4px 0 10px 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    scroll-snap-type: x proximity;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .filter-pills::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .filter-pill {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    scroll-snap-align: start;
    padding: 7px 14px;
    font-size: 12px;
  }

  .filter-actions-right {
    width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box !important;
  }

  .search-box-wrap {
    flex: 1;
  }

  .search-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .view-mode-toggle {
    flex-shrink: 0;
  }

  .btn-view-mode {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .stream-nav-arrow {
    display: none;
  }

  .manuscript-grid.mode-stream {
    padding: 16px 0 30px 0 !important;
    gap: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .manuscript-grid.mode-stream .manuscript-sheet {
    flex: 0 0 min(270px, 80vw);
    width: min(270px, 80vw);
    max-width: 270px;
    padding: 24px 18px 18px 18px;
    min-height: 350px;
  }

  .dedication-card {
    padding: 34px 20px 28px 20px;
  }

  .dedication-inner-layout {
    flex-direction: column;
    gap: 28px;
  }

  .dedication-image-column {
    flex: 0 0 auto;
    max-width: 260px;
    width: 100%;
  }

  .dedication-watermark {
    font-size: 80px;
    left: 12px;
    top: 8px;
  }

  .flipbook-theater {
    width: 98vw;
  }

  .flipbook-topbar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    border-radius: 16px;
    padding: 8px 12px;
    gap: 6px 10px;
    margin-bottom: 12px;
  }

  .flipbook-meta-badge {
    grid-column: 1 / 2;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    min-width: 0;
  }

  .flipbook-audio-btn {
    grid-column: 2 / 3;
    font-size: 10.5px;
    padding: 4px 10px 4px 8px;
    gap: 6px;
    justify-self: end;
    margin-left: 0;
  }

  .flipbook-audio-btn .audio-wave-bars {
    height: 12px;
    width: 12px;
    gap: 2px;
  }

  .flipbook-audio-btn .audio-wave-bars .bar {
    width: 1.8px;
  }

  .flipbook-controls {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid rgba(230, 190, 120, 0.18);
    padding-top: 6px;
    margin-top: 2px;
    gap: 4px;
  }

  .flipbook-book-title {
    font-size: 13px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-flip-ctrl {
    padding: 4px 10px;
    font-size: 11px;
  }

  .flipbook-viewport {
    min-height: 420px;
    padding: 8px 0;
  }

  .book-3d {
    width: min(44vw, 240px);
    height: clamp(380px, 52vh, 440px);
    rotate: 1 0 0 14deg;
  }

  .book-3d .front,
  .book-3d .back {
    padding: 1.2rem 1rem 0.8rem;
  }

  .page-body-text {
    font-size: 13px;
    line-height: 1.48;
  }

  .page-heading {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .cover-main-title {
    font-size: 17px;
  }
}

@media (max-width: 480px) {
  .flipbook-viewport {
    min-height: 375px;
    padding: 4px 0 10px;
    perspective: 1000px;
  }

  /* Khi mở sách, cả 2 trang (trái + phải) dàn đều 2 bên gáy sách */
  /* width 45vw x 2 = 90vw -> Toàn bộ cuốn sách mở ra luôn nằm trọn vẹn trong màn hình điện thoại */
  .book-3d {
    width: min(45vw, 185px);
    height: clamp(335px, 50vh, 370px);
    rotate: 1 0 0 10deg;
  }

  .book-3d.flat-angle {
    rotate: 1 0 0 0deg !important;
  }

  .book-3d.tilted-angle {
    rotate: 1 0 0 14deg !important;
  }

  .book-3d .front,
  .book-3d .back {
    padding: 0.8rem 0.65rem 0.5rem;
  }

  .story-page-content {
    overflow: hidden;
    max-height: 100%;
  }

  .page-chapter {
    font-size: 8px;
    margin-bottom: 2px;
    letter-spacing: 0.06em;
  }

  .page-heading {
    font-size: 11.5px;
    margin-bottom: 4px;
    line-height: 1.22;
  }

  .page-body-text {
    font-size: 11px;
    line-height: 1.25;
    padding-top: 6px;
  }

  .page-body-text p {
    margin-bottom: 5px;
  }

  .page-drop-cap::first-letter {
    font-size: 20px;
    margin-right: 2px;
    line-height: 1;
  }

  .page-quote-box {
    padding: 4px 6px;
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.35;
  }

  .page-photo-frame {
    margin: 5px 0 !important;
  }

  .page-photo-frame img {
    height: 65px !important;
  }

  .page-footer-num {
    font-size: 8.5px;
    opacity: 0.65;
  }

  /* Gáy sách trên mobile: thanh mảnh, tinh tế, không chiếm quá nhiều diện tích bìa */
  .book-3d .front.cover {
    border-left: 6px solid var(--book-spine, #120703) !important;
    box-shadow: inset -4px 0 10px rgba(0, 0, 0, 0.55), 4px 6px 14px rgba(0, 0, 0, 0.4) !important;
  }

  .book-3d .back.cover {
    border-right: 6px solid var(--book-spine, #120703) !important;
    box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.55), -4px 6px 14px rgba(0, 0, 0, 0.4) !important;
  }

  /* Khung viền và padding bìa sách trên Mobile: không để đường viền chèn vào nút gợi ý */
  .book-3d .cover {
    padding: 0.8rem 0.65rem 1.35rem !important;
  }

  .book-3d .cover::before {
    inset: 6px !important;
  }

  .book-3d .cover::after {
    inset: 9px !important;
  }

  /* Bìa sách trên Mobile */
  .cover-top-ornament {
    font-size: 14px;
    margin-bottom: 3px;
  }

  .cover-volume-tag {
    font-size: 7.5px;
    letter-spacing: 0.1em;
    padding: 2px 5px;
    margin-bottom: 5px;
  }

  .cover-main-title {
    font-size: 12.5px;
    line-height: 1.3;
    margin-bottom: 5px;
  }

  .cover-sub-author {
    font-size: 9px;
    margin-bottom: 5px;
  }

  .cover-open-hint {
    font-size: 8px;
    padding: 2.5px 8px;
    white-space: nowrap;
    position: relative;
    z-index: 10;
    background: rgba(22, 10, 10, 0.94) !important;
    border: 1px solid rgba(201, 168, 76, 0.6) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65) !important;
    margin-bottom: 2px;
  }

  /* Trang Hồi kết trên Mobile */
  .conclude-heading {
    font-size: 12.5px !important;
    margin-bottom: 4px !important;
  }

  .conclude-quote {
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    max-width: 95% !important;
  }

  .conclude-publisher {
    font-size: 8.5px !important;
    margin-top: 8px !important;
    opacity: 0.75 !important;
  }

  /* Hộp trích dẫn thơ/nhạc trên Mobile */
  .book-3d div[style*="border-left"] {
    padding: 6px 8px !important;
    margin: 6px 0 !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
  }

  /* Ex-Libris trong bìa trên mobile */
  .inside-cover-bookplate {
    padding: 8px 6px;
    border-width: 1px;
  }

  .ex-libris-title {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .ex-libris-symbol {
    font-size: 12px;
    margin: 2px 0;
  }

  .ex-libris-name {
    font-size: 9.5px;
    margin-bottom: 3px;
  }

  .ex-libris-desc {
    font-size: 8px;
    line-height: 1.3;
  }

  /* Controls trên topbar trên mobile */
  .flipbook-topbar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    padding: 8px 12px;
    gap: 6px 10px;
    margin-bottom: 8px;
    border-radius: 18px;
  }

  .flipbook-meta-badge {
    grid-column: 1 / 2;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    min-width: 0;
  }

  .flipbook-audio-btn {
    grid-column: 2 / 3;
    font-size: 10.5px;
    padding: 4px 10px 4px 8px;
    gap: 6px;
    justify-self: end;
    margin-left: 0;
  }

  .flipbook-audio-btn .audio-wave-bars {
    height: 12px;
    width: 12px;
    gap: 2px;
  }

  .flipbook-audio-btn .audio-wave-bars .bar {
    width: 1.8px;
  }

  .flipbook-controls {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(230, 190, 120, 0.18);
    padding-top: 6px;
    margin-top: 2px;
  }

  .flipbook-meta-badge .badge-line {
    width: 3px;
    height: 24px;
  }

  .flipbook-book-title {
    font-size: 13px;
    color: #fffaf0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
  }

  .flipbook-book-author {
    font-size: 10.5px;
    color: #ecd5b3;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.95;
    padding: 5px 0;
  }

  .flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  #btnToggle3DAngle #angleText {
    display: none;
  }

  .btn-flip-ctrl {
    padding: 4px 8px;
    font-size: 10px;
    gap: 3px;
    color: #fff8eb;
    border-radius: 14px;
    flex-shrink: 0;
  }

  .flipbook-page-counter {
    font-size: 10px;
    white-space: nowrap;
    min-width: auto;
    padding: 3px 8px;
    border-radius: 12px;
    color: #fff0d0;
    flex-shrink: 0;
  }

  .close-btn {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 14px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }

  .close-btn-text-desk {
    display: none;
  }

  .close-btn-text-mob {
    display: inline;
  }
}

@media (max-width: 360px) {
  .album-wrapper {
    padding: 20px 14px 40px 14px !important;
  }

  .manuscript-section {
    padding: 0 14px !important;
  }

  .dedication-section {
    padding: 0 14px !important;
  }

  .studio-shelf-col .bookshelf {
    border-left-width: 6px !important;
    border-right-width: 6px !important;
  }

  .shelf-plank-unit {
    margin: 0 -6px !important;
  }

  .books-container {
    gap: 1.5px !important;
  }

  .books-container .book {
    transform: scale(0.92);
    transform-origin: bottom left;
  }

  .shelf-decor-group {
    transform: scale(0.48) !important;
    margin: 0 -16px !important;
  }
}