/* ==========================================================================
   可乐手记 Kele Journal — Physical Open-Book Monochrome Chapbook
   Full-Viewport Desk & 3D Page-Turning Spread · 寒蝉活宋体
   ========================================================================== */

@font-face {
  font-family: "ChillHuoSong";
  src: url("assets/fonts/ChillHuoSong.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --desk: #e9e9e5;
  --paper: #fafaf8;
  --paper-soft: #f2f2ee;
  --pocket: #e4e4df;
  --ink: #151514;
  --ink-2: #52524e;
  --ink-3: #8a8a84;
  --ink-faint: rgba(21, 21, 20, 0.045);
  --ink-highlight: rgba(21, 21, 20, 0.095);
  --hairline: rgba(21, 21, 20, 0.11);
  --hairline-strong: rgba(21, 21, 20, 0.24);
  --book-shadow: 0 32px 72px -30px rgba(0, 0, 0, 0.22), 0 6px 18px -8px rgba(0, 0, 0, 0.09);
  --gutter-shadow: rgba(0, 0, 0, 0.09);
  --serif: "ChillHuoSong", "Songti SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --desk: #0d0e10;
  --paper: #18191b;
  --paper-soft: #1f2023;
  --pocket: #111214;
  --ink: #eeeeeb;
  --ink-2: #a5a59f;
  --ink-3: #70706a;
  --ink-faint: rgba(238, 238, 235, 0.06);
  --ink-highlight: rgba(238, 238, 235, 0.16);
  --hairline: rgba(238, 238, 235, 0.11);
  --hairline-strong: rgba(238, 238, 235, 0.24);
  --book-shadow: 0 36px 80px -24px rgba(0, 0, 0, 0.78), 0 8px 22px -6px rgba(0, 0, 0, 0.5);
  --gutter-shadow: rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--desk);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-synthesis: none;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.025em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Archival grain over desk & paper */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="dark"] .paper-grain {
  opacity: 0.05;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }

code {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 1px 5px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 3px;
  background: var(--paper-soft);
}

/* ==========================================================================
   Quiet Top & Bottom Desk Margins (Exact same width track as the open book)
   ========================================================================== */

.desk-top,
.desk-bottom {
  width: min(1060px, calc(100vw - 116px));
  margin: 0 auto;
  padding: 16px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.desk-top-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1;
  letter-spacing: 0.08em;
}

.desk-mini-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: block;
  flex-shrink: 0;
}

.desk-title {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.desk-sep,
.desk-sub {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-3);
}

.desk-top-right {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.desk-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline-strong);
  background: var(--paper);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.desk-top-right a,
.end-actions a {
  text-decoration: none;
}

.desk-pill:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.ink-dot-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  flex-shrink: 0;
}

.desk-bottom {
  padding: 12px 0 18px;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.desk-nav-arrows {
  display: flex;
  align-items: center;
  gap: 18px;
}

.desk-arrow {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 3px 6px;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.desk-arrow:hover:not(:disabled) {
  color: var(--ink);
}

.desk-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.desk-page-counter {
  color: var(--ink-2);
}

/* ==========================================================================
   Full-Viewport Physical Open-Book Assembly
   ========================================================================== */

.desk-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 6px;
}

.book-assembly {
  position: relative;
  width: min(1060px, calc(100vw - 116px));
  height: min(670px, 100%);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Layered paper edges on left and right sides of the open book */
.book-stack-left,
.book-stack-right {
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--paper) 0px,
    var(--paper) 2px,
    var(--hairline-strong) 2px,
    var(--hairline-strong) 3px
  );
  border-top: 0.5px solid var(--hairline-strong);
  border-bottom: 0.5px solid var(--hairline-strong);
  z-index: 1;
}

.book-stack-left {
  left: -8px;
  border-left: 0.5px solid var(--hairline-strong);
  border-radius: 3px 0 0 3px;
}

.book-stack-right {
  right: -8px;
  border-right: 0.5px solid var(--hairline-strong);
  border-radius: 0 3px 3px 0;
}

/* Clipped Spine Pocket keeps bookmark flush to book top edge even while 3D page turns */
.spine-ribbon-pocket {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 58px;
  overflow: hidden;
  z-index: 30;
  pointer-events: none;
}

.spine-ribbon {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  color: var(--ink);
  pointer-events: auto;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.spine-ribbon svg {
  width: 18px;
  height: 52px;
  display: block;
}

.spine-ribbon .ribbon-fill {
  fill: var(--paper);
  transition: fill 0.22s ease;
}

.spine-ribbon:hover {
  transform: translate(-50%, 3px);
}

.spine-ribbon.is-clipped {
  transform: translate(-50%, 9px);
}

.spine-ribbon.is-clipped .ribbon-fill {
  fill: var(--ink);
}

/* Physical Die-Cut Paper Index Tabs protruding from the right edge of the book */
.book-edge-tabs {
  position: absolute;
  left: calc(100% + 1px);
  top: 44px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

.edge-tab {
  width: 34px;
  padding: 10px 6px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--ink-3);
  background: var(--pocket);
  border: 0.5px solid var(--hairline-strong);
  border-left: none;
  border-radius: 0 5px 5px 0;
  transform: translateX(-4px);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.edge-tab:hover {
  transform: translateX(0);
  color: var(--ink-2);
}

.edge-tab.is-active {
  transform: translateX(2px);
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline-strong);
  box-shadow: 4px 2px 10px -6px rgba(0, 0, 0, 0.16);
}

/* Open Book Shell */
.open-book {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--paper);
  border: 0.5px solid var(--hairline-strong);
  border-radius: 4px;
  box-shadow: var(--book-shadow);
  overflow: hidden;
  z-index: 10;
}

/* Allow 3D curled paper arch to lift slightly toward the viewer without clipping mid-turn */
.open-book.is-turning {
  overflow: visible;
}

/* Realistic Center Spine Crease Shadow */
.book-gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 48px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 18;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ink-faint) 34%,
    var(--gutter-shadow) 49.5%,
    var(--hairline-strong) 50%,
    var(--gutter-shadow) 50.5%,
    var(--ink-faint) 66%,
    transparent 100%
  );
}

/* ==========================================================================
   Real 3D Curved Multi-Strip Paper-Turn Mesh (Flexible Paper Deformation)
   ========================================================================== */

.page-curl-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 26;
  perspective: 2100px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  display: none;
}

.page-curl-stage.is-active {
  display: block;
}

.curl-under-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  pointer-events: none;
  z-index: 1;
}

.curl-under-shadow.shadow-right {
  left: 50%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.08) 38%, transparent 100%);
}

.curl-under-shadow.shadow-left {
  left: 0;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.08) 38%, transparent 100%);
}

[data-theme="dark"] .curl-under-shadow.shadow-right {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.22) 40%, transparent 100%);
}

[data-theme="dark"] .curl-under-shadow.shadow-left {
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.22) 40%, transparent 100%);
}

.curl-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 2;
}

.curl-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--paper);
}

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

.curl-face-content {
  position: absolute;
  top: 0;
  height: 100%;
  pointer-events: none;
}

.curl-face-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Underlay half-page revealed smoothly during turn */
.curl-reveal-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: var(--paper);
  overflow: hidden;
  z-index: 0;
}

.curl-reveal-half.is-right {
  left: 50%;
}

.curl-reveal-half.is-left {
  left: 0;
}

/* Tactile Corner Dog-Ear Preview on Hover */
.dog-ear {
  position: absolute;
  bottom: 0;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 21;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dog-ear-right {
  right: 0;
  background: linear-gradient(
    315deg,
    var(--desk) 48%,
    var(--hairline-strong) 49.5%,
    var(--paper-soft) 51%,
    var(--paper) 82%
  );
  box-shadow: -4px -4px 12px -4px rgba(0, 0, 0, 0.16);
  transform-origin: bottom right;
  transform: scale(0.55);
}

.dog-ear-left {
  left: 0;
  background: linear-gradient(
    45deg,
    var(--desk) 48%,
    var(--hairline-strong) 49.5%,
    var(--paper-soft) 51%,
    var(--paper) 82%
  );
  box-shadow: 4px -4px 12px -4px rgba(0, 0, 0, 0.16);
  transform-origin: bottom left;
  transform: scale(0.55);
}

.dog-ear.is-peeking {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Spreads & Pages Interior Typography
   ========================================================================== */

.spread {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.spread.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page {
  height: 100%;
  padding: 28px 44px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.page-left {
  padding-right: 48px;
}

.page-right {
  padding-left: 48px;
}

.page-folio-top {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  min-height: 24px;
  flex-shrink: 0;
}

.page-folio-top--right {
  justify-content: flex-end;
}

.page-folio-top--between {
  justify-content: space-between;
}

.page-folio-bottom {
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.folio-num {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.corner-turn {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  padding: 4px 8px;
  border-radius: 3px;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.corner-turn:hover {
  color: var(--ink);
  background: var(--ink-faint);
}

.page-hairline {
  width: 100%;
  height: 0.5px;
  background: var(--hairline-strong);
}

.page-heading {
  margin: 0 0 18px;
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.book-prose-col {
  margin: auto 0;
  display: flex;
  flex-direction: column;
}

.book-prose-col p {
  margin: 0 0 15px;
  font-size: 14.5px;
  line-height: 1.98;
  color: var(--ink-2);
}

.paper-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 3px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: transparent;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.paper-mini-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--ink-faint);
}

.paper-mini-btn--ink,
.ink-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: opacity 0.18s ease;
}

.ink-btn:hover,
.paper-mini-btn--ink:hover {
  opacity: 0.88;
}

/* ==========================================================================
   SPREAD 0 · 扉页 (Vertical Book Slip + Poem + Pettable Kele)
   ========================================================================== */

.title-slip-wrap {
  margin: auto;
  display: flex;
  justify-content: center;
}

.title-slip {
  padding: 7px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.title-slip-inner {
  border: 0.5px solid var(--hairline-strong);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.vertical-title {
  margin: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0.34em;
  line-height: 1;
}

.vertical-seal {
  width: 22px;
  height: 22px;
  border: 0.8px solid var(--ink);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  opacity: 0.78;
}

.cover-poem-wrap {
  margin: auto 0;
  padding-top: 24px;
}

.cover-poem {
  font-size: 17px;
  line-height: 2.35;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.cover-poem p {
  margin: 0;
}

.cover-kele-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: auto;
  padding-bottom: 6px;
}

.kele-whisper {
  min-height: 22px;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.kele-sparkles {
  position: absolute;
  right: 12px;
  bottom: 42px;
  width: 150px;
  height: 54px;
  pointer-events: none;
}

.sparkle-mote {
  position: absolute;
  font-size: 12px;
  color: var(--ink);
  opacity: 0;
  animation: sparkleFloat 0.92s ease-out forwards;
}

@keyframes sparkleFloat {
  0% { opacity: 0; transform: translate(0, 5px) scale(0.65); }
  25% { opacity: 0.85; transform: translate(var(--dx), -10px) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--dx) * 1.3), -30px) scale(0.8); }
}

.kele-touch {
  padding: 0;
  margin-right: 10px;
  margin-bottom: -1.5px;
  line-height: 0;
}

/* Strictly isolated gentle breathing on Kele image ONLY */
.kele-img {
  width: 162px;
  height: auto;
  display: block;
  transform-origin: bottom center;
  animation: keleBreathe 5.4s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}

.kele-img.is-petted {
  animation: kelePurr 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .kele-img,
[data-theme="dark"] .veil-cat,
[data-theme="dark"] .sleep-cat-img {
  filter: drop-shadow(0 0 11px rgba(255, 255, 255, 0.14)) brightness(1.06);
}

@keyframes keleBreathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.022); }
}

@keyframes kelePurr {
  0% { transform: scale(1, 1); }
  35% { transform: scale(1.045, 0.955); }
  70% { transform: scale(0.985, 1.03); }
  100% { transform: scale(1, 1); }
}

/* ==========================================================================
   SPREAD 1 · 手记 (Four Signs + Living Diary Page)
   ========================================================================== */

.margin-notes {
  margin: 4px 0 0;
  padding: 12px 0 0;
  border-top: 0.5px solid var(--hairline);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.margin-notes li {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
  padding-left: 12px;
  position: relative;
}

.margin-notes li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--ink);
}

.margin-notes strong {
  font-weight: 400;
  color: var(--ink);
}

.four-signs {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 0.5px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.sign-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sign-svg {
  width: 18px;
  height: 18px;
}

.sign-cell strong {
  font-size: 13px;
  font-weight: 400;
}

.diary-live-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}

.diary-live-wrap[hidden],
.diary-closed-veil[hidden] {
  display: none;
}

.diary-date-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 0.5px solid var(--hairline);
}

.diary-big-num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 0.9;
}

.diary-entry-title {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.diary-sub-note {
  font-size: 11.5px;
  color: var(--ink-3);
}

.diary-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.diary-body p {
  margin: 0 0 11px;
  font-size: 13.8px;
  line-height: 1.88;
  color: var(--ink-2);
}

.ink-highlight {
  background: var(--ink-highlight);
  color: var(--ink);
  padding: 0 3px;
}

.diary-quote {
  margin: 12px 0;
  padding: 5px 12px;
  border-left: 1.5px solid var(--ink);
  font-size: 13.5px;
  color: var(--ink);
}

.diary-checks {
  margin: 10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.diary-check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-size: 13.4px;
  color: var(--ink);
  padding: 1px 0;
}

.ink-box,
.memo-check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  color: transparent;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.diary-check-row.is-done .ink-box,
.memo-check.is-done {
  background: var(--ink);
  color: var(--paper);
}

.diary-check-row.is-done span:last-child {
  color: var(--ink-3);
  text-decoration: line-through;
}

.visitor-lines p {
  color: var(--ink);
}

.diary-write-form {
  padding-top: 10px;
  border-top: 0.5px dashed var(--hairline-strong);
}

.diary-write-form input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
}

.diary-write-form input::placeholder {
  color: var(--ink-3);
}

.diary-closed-veil {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.veil-cat {
  width: 132px;
  height: auto;
  margin-bottom: 4px;
}

.veil-title {
  margin: 0;
  font-size: 16px;
}

.veil-sub {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 280px;
}

/* ==========================================================================
   SPREAD 2 · 纸条 (Directions Ledger + Slightly-Tilted Ruled Memo Slip)
   ========================================================================== */

.dir-ledger {
  margin-top: 20px;
  border-top: 0.5px solid var(--hairline);
}

.dir-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 0.5px solid var(--hairline);
  font-size: 13.5px;
}

.dir-star {
  color: var(--ink-3);
  font-size: 11px;
}

.dir-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
}

.memo-page-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.tucked-memo {
  width: 100%;
  max-width: 340px;
  background: var(--paper-soft);
  border: 0.5px solid var(--hairline-strong);
  padding: 20px 22px 16px;
  transform: rotate(0.9deg);
  box-shadow: 0 18px 34px -22px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.06);
  position: relative;
}

.mini-week-bar {
  width: 100%;
  max-width: 340px;
  padding: 9px 12px;
  border: 0.5px dashed var(--hairline-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
}

.week-pill {
  padding: 2px 6px;
  border: 0.5px solid var(--hairline);
  background: var(--paper-soft);
  color: var(--ink-2);
  white-space: nowrap;
}

.week-pill.is-now {
  border-color: var(--ink);
  color: var(--ink);
}

.memo-tape {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 44px;
  height: 13px;
  background: var(--paper);
  border: 0.5px solid var(--hairline-strong);
  opacity: 0.85;
}

.memo-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  padding-bottom: 9px;
  border-bottom: 0.5px solid var(--hairline-strong);
}

.memo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 230px;
  overflow-y: auto;
}

.memo-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--hairline);
  font-size: 13.5px;
  line-height: 1.45;
}

.memo-text {
  flex: 1;
  min-width: 0;
}

.memo-item.is-done .memo-text {
  color: var(--ink-3);
  text-decoration: line-through;
}

.memo-date {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.memo-form {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memo-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 12.8px;
  color: var(--ink);
  padding: 6px 0 2px;
}

.memo-form input::placeholder {
  color: var(--ink-3);
}

.memo-date-hint {
  font-family: var(--sans);
  font-size: 10.5px;
  padding: 1px 6px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 3px;
  white-space: nowrap;
}

/* Ink Ring + 4 Sparks Burst */
.ink-burst-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  pointer-events: none;
  animation: inkRing 0.42s ease-out forwards;
}

.ink-burst-spark {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  animation: inkSpark 0.44s ease-out forwards;
}

@keyframes inkRing {
  0% { transform: scale(0.5); opacity: 0.85; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes inkSpark {
  0% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0.2); opacity: 0; }
}

/* ==========================================================================
   SPREAD 3 & 4 · Balanced Annotated Photo Plates + Interactive Callouts ①②③
   ========================================================================== */

.plate-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.plate-controls {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-mount {
  position: relative;
  padding: 8px;
  background: var(--paper-soft);
  border: 0.5px solid var(--hairline-strong);
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-mount--mac {
  width: 100%;
  max-width: 424px;
}

.photo-mount:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px -22px rgba(0, 0, 0, 0.28);
}

.plate-media {
  position: relative;
  cursor: zoom-in;
  display: block;
  width: 100%;
}

.plate-foot-row {
  width: 100%;
  max-width: 424px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* 4 Classic Monochrome Photo Album Corner Tabs */
.photo-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--ink);
  opacity: 0.62;
  pointer-events: none;
}

.photo-corner.tl { top: -3px; left: -3px; border-right: none; border-bottom: none; }
.photo-corner.tr { top: -3px; right: -3px; border-left: none; border-bottom: none; }
.photo-corner.bl { bottom: -3px; left: -3px; border-right: none; border-top: none; }
.photo-corner.br { bottom: -3px; right: -3px; border-left: none; border-top: none; }

.mounted-phone-img {
  height: min(430px, 52vh);
  width: auto;
  display: block;
  border-radius: 13px;
  border: 0.5px solid var(--hairline);
}

.mounted-mac-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 0.5px solid var(--hairline);
}

/* Interactive Numbered Ink Callout Pins on Screenshots */
.plate-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  z-index: 4;
}

.plate-pin.is-lit {
  background: var(--ink);
  color: var(--paper);
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ink) 18%, transparent), 0 6px 14px rgba(0, 0, 0, 0.25);
}

/* Editorial Margin Callout List on Facing Page */
.callout-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.callout-item {
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0.5px solid var(--hairline);
  border-left: 2px solid transparent;
  background: transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.callout-item:hover,
.callout-item.is-lit {
  background: var(--ink-faint);
  border-color: var(--hairline-strong);
  border-left-color: var(--ink);
}

.callout-num {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  flex-shrink: 0;
}

.callout-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.45;
}

.callout-item span {
  display: block;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-3);
}

.kbd-margin-strip {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 0.5px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--ink-2);
}

.plate-caption {
  margin: 0;
  font-size: 11.8px;
  color: var(--ink-3);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   SPREAD 5 · 细目 (Classical Dotted-Leader Book Index + Interactive Year Dots)
   ========================================================================== */

.book-toc {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-toc li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.toc-label {
  color: var(--ink);
  white-space: nowrap;
}

.toc-dots {
  flex: 1;
  min-width: 16px;
  border-bottom: 1px dotted var(--hairline-strong);
  transform: translateY(-3px);
}

.toc-detail {
  color: var(--ink-2);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.year-mini-box {
  padding: 16px 18px;
  border: 0.5px solid var(--hairline-strong);
  background: var(--paper-soft);
}

.year-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--hairline);
}

#yearMiniWhisper {
  font-size: 11.5px;
  color: var(--ink-3);
}

.year-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 12px;
}

.ym-month-name {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.ym-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2.5px;
}

.ym-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.1;
  padding: 0;
  transition: transform 0.14s ease;
}

.ym-dot.lvl-1 { opacity: 0.34; }
.ym-dot.lvl-2 { opacity: 0.65; }
.ym-dot.lvl-3 { opacity: 0.96; }

.ym-dot:hover {
  transform: scale(1.7);
}

.memory-excerpt {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 1.5px solid var(--hairline-strong);
  background: var(--ink-faint);
  transition: opacity 0.2s ease;
}

.memory-excerpt.is-fading {
  opacity: 0;
}

.memory-excerpt p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink);
}

.memory-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ==========================================================================
   SPREAD 5 · 跋 (Privacy Pledge + Classical Book Colophon + Sleeping Kele)
   ========================================================================== */

.end-sketch-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 0.5px dashed var(--hairline-strong);
  display: flex;
  align-items: center;
  gap: 20px;
}

.end-notebook-sketch {
  width: 82px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.85;
  transition: filter 0.25s ease;
}

[data-theme="dark"] .end-notebook-sketch {
  filter: invert(0.92);
}

.end-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.colophon-card {
  margin: auto 0;
  border: 0.5px solid var(--hairline-strong);
  padding: 22px 24px;
  background: var(--paper-soft);
}

.colophon-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--hairline);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.colophon-icon {
  border-radius: 6px;
}

.colophon-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.colophon-dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.colophon-dl dt {
  color: var(--ink-3);
}

.colophon-dl dd {
  margin: 0;
  color: var(--ink-2);
}

.sleep-kele-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: auto;
  cursor: pointer;
}

.sleep-cat-img {
  width: 148px;
  height: auto;
  margin-right: 12px;
  margin-bottom: -1.5px;
  display: block;
  transform-origin: bottom center;
  animation: keleBreathe 6.4s ease-in-out infinite;
}

.zzz-motes {
  position: absolute;
  right: 8px;
  top: -8px;
  display: flex;
  gap: 4px;
  font-style: italic;
  color: var(--ink-3);
  pointer-events: none;
}

.zzz-motes span {
  font-size: 11px;
  opacity: 0;
  animation: zzzDrift 3.6s ease-in-out infinite;
}

.zzz-motes span:nth-child(2) { font-size: 13px; animation-delay: 1.1s; }
.zzz-motes span:nth-child(3) { font-size: 15px; animation-delay: 2.2s; }

@keyframes zzzDrift {
  0% { opacity: 0; transform: translate(0, 5px); }
  35% { opacity: 0.7; }
  100% { opacity: 0; transform: translate(7px, -14px); }
}

/* ==========================================================================
   Photo Lightbox, App Store Slip Modal & Quiet Toast
   ========================================================================== */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(14, 14, 13, 0.56);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-backdrop[hidden] {
  display: none;
}

.lightbox-frame {
  max-width: min(960px, 94vw);
  max-height: 90vh;
  background: var(--paper);
  border: 0.5px solid var(--hairline-strong);
  padding: 16px 20px 20px;
  box-shadow: var(--book-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.lightbox-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--ink);
}

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 0.5px solid var(--hairline);
  display: block;
}

.slip-modal {
  width: 100%;
  max-width: 420px;
  padding: 24px 28px;
  background: var(--paper);
  border: 0.5px solid var(--hairline-strong);
  box-shadow: var(--book-shadow);
}

.slip-modal h3 {
  margin: 10px 0 10px;
  font-size: 19px;
  font-weight: 400;
}

.slip-modal p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
}

.slip-modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 700;
  padding: 7px 16px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Dedicated Mobile Pocket-Notebook Edition (<= 860px)
   Single-Handed Stitch-Bound Pocket Journal + Bottom Hanging Bookmarks
   ========================================================================== */

@media (max-width: 860px) {
  body {
    overflow: hidden;
    height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--desk);
  }

  .desk-top {
    width: 100%;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px;
  }

  .desk-sub,
  .desk-sep,
  .desk-hint {
    display: none;
  }

  .desk-stage {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 4px 14px 6px;
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  .book-assembly {
    width: 100%;
    height: 100%;
    max-width: 480px;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  .book-stack-left,
  .book-stack-right,
  .book-gutter,
  .page-curl-stage,
  .dog-ear {
    display: none;
  }

  /* Move hanging silk bookmark cleanly to top-right corner of the pocket sheet */
  .spine-ribbon-pocket {
    left: auto;
    right: 22px;
    transform: none;
    height: 46px;
  }

  .spine-ribbon {
    top: -12px;
    height: 46px;
  }

  .spine-ribbon svg {
    height: 46px;
  }

  /* Open book becomes a single-column scrollable pocket diary folio with left stitch shadow */
  .open-book {
    flex: 1;
    min-height: 0;
    height: 100%;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  /* Subtle left stitch-binding crease inside pocket book */
  .open-book::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18px;
    pointer-events: none;
    z-index: 15;
    background: linear-gradient(
      90deg,
      var(--gutter-shadow) 0%,
      var(--ink-faint) 42%,
      transparent 100%
    );
  }

  /* Active spread fills the pocket card and scrolls gently inside if needed */
  .spread {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: left center;
    transition: opacity 0.26s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .spread.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) rotateY(0deg);
  }

  .spread.mobile-enter-next {
    animation: pocketFlipNext 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .spread.mobile-enter-prev {
    animation: pocketFlipPrev 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes pocketFlipNext {
    0% { opacity: 0.25; transform: translateX(26px) scale(0.985); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
  }

  @keyframes pocketFlipPrev {
    0% { opacity: 0.25; transform: translateX(-26px) scale(0.985); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
  }

  .page {
    height: auto;
    flex-shrink: 0;
    padding: 20px 20px 18px 24px;
    justify-content: flex-start;
  }

  .page-left {
    padding-right: 20px;
    border-bottom: 0.5px dashed var(--hairline-strong);
  }

  .page-right {
    padding-left: 24px;
  }

  /* Hide duplicate inner page-corner prev/next buttons on mobile (handled by bottom pocket bar) */
  .page-left .page-folio-bottom,
  .page-right .page-folio-bottom {
    display: none;
  }

  .page-folio-top {
    margin-bottom: 14px;
    font-size: 11px;
  }

  .page-folio-top--right {
    justify-content: flex-start;
  }

  .page-heading {
    font-size: 21px;
    margin-bottom: 12px;
  }

  .book-prose-col {
    margin: 0;
  }

  .book-prose-col p {
    font-size: 14px;
    line-height: 1.9;
    margin-bottom: 12px;
  }

  /* Cover Spread Mobile Balance */
  .title-slip-wrap {
    margin: 14px auto 12px;
  }

  .title-slip-inner {
    padding: 20px 15px 16px;
    gap: 14px;
  }

  .vertical-title {
    font-size: 32px;
  }

  .cover-poem-wrap {
    padding-top: 6px;
    margin: 0 0 18px;
  }

  .cover-poem {
    font-size: 15.5px;
    line-height: 2.15;
  }

  .kele-img {
    width: 142px;
  }

  /* Diary & Memo Spreads Mobile Polish */
  .diary-body {
    overflow: visible;
    padding-right: 0;
  }

  .diary-big-num {
    font-size: 36px;
  }

  .diary-entry-title {
    font-size: 16.5px;
  }

  .memo-page-center {
    gap: 14px;
  }

  .tucked-memo {
    max-width: 100%;
    transform: none;
    padding: 18px 16px 14px;
  }

  .memo-list {
    max-height: none;
  }

  .mini-week-bar {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  /* Real Screenshot Plates + Callouts Mobile Polish */
  .plate-stage {
    gap: 10px;
  }

  .photo-mount {
    padding: 6px;
  }

  .mounted-phone-img {
    height: auto;
    max-height: 360px;
    max-width: 210px;
  }

  .photo-mount--mac {
    max-width: 100%;
  }

  .plate-pin {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .plate-foot-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .callout-item {
    padding: 8px 10px;
  }

  .callout-item strong {
    font-size: 13px;
  }

  .callout-item span {
    font-size: 11.8px;
  }

  /* Spread 5 Book Index — Zero Horizontal Overflow on 375px! */
  .book-toc {
    gap: 10px;
  }

  .book-toc li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 0.5px dotted var(--hairline-strong);
  }

  .book-toc li:last-child {
    border-bottom: none;
  }

  .toc-dots {
    display: none;
  }

  .toc-detail {
    white-space: normal;
    text-align: left;
    font-size: 12px;
    line-height: 1.55;
  }

  .year-mini-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .end-sketch-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .end-actions {
    width: 100%;
  }

  .end-actions .ink-btn {
    width: 100%;
  }

  .sleep-cat-img {
    width: 132px;
  }

  /* Signature Mobile Bottom Physical Hanging Paper-Bookmark Bar (Moved cleanly below book!) */
  .book-edge-tabs {
    position: static;
    order: 3;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
    padding: 0 8px 8px;
    margin-top: -1px;
    background: var(--pocket);
    border: 0.5px solid var(--hairline-strong);
    border-top: 0.5px solid var(--hairline);
    border-radius: 0 0 8px 8px;
    z-index: 12;
  }

  .book-edge-tabs::-webkit-scrollbar {
    display: none;
  }

  .edge-tab {
    flex: 1 0 auto;
    min-width: 44px;
    width: auto;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: 0.08em;
    font-size: 11.5px;
    padding: 7px 6px 6px;
    border: 0.5px solid transparent;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: var(--paper-soft);
    color: var(--ink-3);
    transform: none;
    margin-top: -0.5px;
    text-align: center;
  }

  .edge-tab:hover {
    transform: none;
  }

  .edge-tab.is-active {
    transform: none;
    background: var(--paper);
    color: var(--ink);
    border-color: var(--hairline-strong);
    border-top: 0.5px solid var(--paper);
    padding-top: 9px;
    padding-bottom: 7px;
    box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.22);
  }

  /* Compact Bottom Page Controls + Safe Area Inset */
  .desk-bottom {
    width: 100%;
    padding: 6px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
  }

  .desk-nav-arrows {
    width: 100%;
    max-width: 480px;
    justify-content: space-between;
    gap: 10px;
  }

  .desk-arrow {
    font-size: 12.5px;
    padding: 5px 8px;
  }

  .desk-page-counter {
    font-size: 11.5px;
  }
}
