:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #6d746f;
  --canvas: #e9ebe7;
  --paper: #fbfaf5;
  --forest: #183f36;
  --forest-soft: #28594e;
  --brass: #b9934b;
  --line: rgba(24, 32, 29, .15);
  --shadow: 0 22px 65px rgba(22, 32, 28, .12);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { max-width: 100%; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: .7rem;
  left: .7rem;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--forest);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.reading-progress {
  position: fixed;
  z-index: 90;
  inset: 0 0 auto;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brass), #f2d58f);
  box-shadow: 0 0 10px rgba(213,193,141,.45);
  transition: width .22s ease-out;
}

.reader-bar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: .7rem clamp(1rem, 3vw, 2.4rem);
  color: #f8f7f2;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(16, 45, 39, .96);
  backdrop-filter: blur(14px);
}
.reader-identity { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.reader-mark { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; color: var(--forest); background: var(--brass); font-family: Georgia, serif; font-size: 1.2rem; }
.reader-eyebrow { margin: 0 0 .15rem; color: #d5c18d; font-size: .62rem; font-weight: 800; letter-spacing: .16em; }
.reader-bar h1 { max-width: 48vw; margin: 0; overflow: hidden; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.reader-actions { display: flex; align-items: center; gap: .7rem; }
.sample-pill { padding: .45rem .75rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #f4e8c7; font-size: .75rem; font-weight: 700; }
.toc-trigger, .toc-close { min-width: 44px; min-height: 44px; color: inherit; border: 1px solid rgba(255,255,255,.28); background: transparent; cursor: pointer; }
.toc-trigger { display: none; padding: 0 .8rem; }
.toc-close { display: none; color: var(--ink); border-color: var(--line); font-size: 1.6rem; }

.reader-layout { display: grid; grid-template-columns: 270px minmax(0, 820px); gap: clamp(1.5rem, 3vw, 3.2rem); justify-content: center; padding: 2.5rem clamp(1rem, 3vw, 2.5rem) 5rem; }
.sample-toc { position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 130px); overflow: auto; border: 1px solid var(--line); background: rgba(251, 250, 245, .85); }
.toc-heading { display: flex; align-items: start; justify-content: space-between; padding: 1.35rem 1.2rem 1rem; border-bottom: 1px solid var(--line); }
.toc-heading p { margin: 0 0 .3rem; color: var(--brass); font-size: .62rem; font-weight: 800; letter-spacing: .14em; }
.toc-heading h2 { margin: 0; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: 1.15rem; }
.sample-toc nav { padding: .45rem 0; }
.sample-toc nav a { display: grid; grid-template-columns: 3.3rem 1fr; gap: .7rem; align-items: center; padding: .65rem 1rem; color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.sample-toc nav a:hover, .sample-toc nav a[aria-current="true"] { color: var(--forest); border-left-color: var(--brass); background: rgba(185, 147, 75, .09); }
.toc-number { color: var(--brass); font-family: Georgia, serif; font-size: .78rem; }
.toc-preview { position: relative; display: block; width: 3.1rem; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.toc-preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.toc-preview b { position: absolute; right: 0; bottom: 0; padding: .08rem .25rem; color: #fff; background: rgba(17, 35, 30, .82); font-family: Georgia, serif; font-size: .56rem; font-weight: 500; }
.toc-copy { min-width: 0; }
.toc-copy strong { display: block; overflow: hidden; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.toc-copy small { color: var(--muted); font-size: .66rem; }
.toc-lock-note { display: flex; gap: .7rem; margin: .8rem; padding: .9rem; color: #efe8d8; background: var(--forest); }
.toc-lock-note span { color: var(--brass); font-size: 1.2rem; }
.toc-lock-note p { margin: 0; font-size: .7rem; line-height: 1.6; }

.sample-pages { min-width: 0; }
.sample-cover, .sample-page, .sample-gate { margin: 0 0 2rem; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.sample-cover { display: grid; grid-template-columns: 1fr minmax(170px, 280px); gap: clamp(2rem, 5vw, 4rem); align-items: center; min-height: 520px; padding: clamp(2rem, 5vw, 4.5rem); overflow: hidden; }
.cover-kicker, .gate-kicker { margin: 0 0 1rem; color: var(--brass); font-size: .68rem; font-weight: 900; letter-spacing: .18em; }
.sample-cover h2 { max-width: 12ch; margin: 0; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: clamp(2.1rem, 5vw, 4.2rem); line-height: 1.16; letter-spacing: -.05em; }
.cover-author { margin: 1.1rem 0 0; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: 1.05rem; }
.cover-description { max-width: 42rem; margin: 2rem 0; color: var(--muted); line-height: 1.8; word-break: keep-all; }
.cover-facts { display: flex; gap: 2rem; margin: 2rem 0 0; }
.cover-facts div { padding-left: .8rem; border-left: 2px solid var(--brass); }
.cover-facts dt { color: var(--muted); font-size: .68rem; }
.cover-facts dd { margin: .22rem 0 0; font-weight: 800; }
.sample-cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; box-shadow: 16px 18px 0 rgba(24, 63, 54, .13); }

.sample-page { padding: clamp(1.4rem, 4vw, 3.5rem); }
.page-heading { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.page-heading p { margin: 0 0 .35rem; color: var(--brass); font-family: Georgia, serif; font-size: .72rem; letter-spacing: .1em; }
.page-heading h2 { margin: 0; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.4; }
.ocr-copy { font-family: "Noto Serif KR", "Nanum Myeongjo", Batang, serif; font-size: clamp(1rem, 1.7vw, 1.12rem); line-height: 2; word-break: keep-all; }
.ocr-copy p { margin: 0 0 1.45em; }
.scan-compare { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.scan-compare summary { padding: 1rem 0; color: var(--forest-soft); font-size: .82rem; font-weight: 800; cursor: pointer; }
.scan-compare img, .pdf-sheet { display: block; width: 100%; height: auto; background: #fff; }
.pdf-page { padding: clamp(.6rem, 2vw, 1.5rem); }
.pdf-page .page-heading { margin: .8rem .8rem 1.2rem; }

.sample-gate { padding: clamp(2rem, 6vw, 5rem); color: #f8f5ed; background: var(--forest); text-align: center; }
.sample-gate h2 { margin: 0; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: clamp(1.8rem, 4vw, 3rem); }
.sample-gate > p:not(.gate-kicker) { max-width: 36rem; margin: 1rem auto 2rem; color: #cad7d2; line-height: 1.7; }
.sample-gate a { display: inline-flex; min-height: 50px; align-items: center; padding: 0 1.4rem; color: var(--forest); background: var(--brass); font-weight: 900; text-decoration: none; }
.toc-scrim { display: none; }

@media (max-width: 760px) {
  html { scroll-padding-top: 5.4rem; }
  body.toc-open { overflow: hidden; }
  .reader-bar { min-height: 66px; padding: .55rem .7rem; }
  .reader-mark { flex-basis: 36px; width: 36px; height: 36px; }
  .reader-eyebrow, .sample-pill { display: none; }
  .reader-bar h1 { max-width: 52vw; font-size: .9rem; }
  .toc-trigger { display: inline-flex; align-items: center; justify-content: center; }
  .reader-layout { display: block; padding: .75rem .65rem 3rem; }
  .sample-toc { position: fixed; z-index: 80; inset: 0 0 0 auto; width: min(88vw, 360px); max-height: none; background: var(--paper); transform: translateX(102%); transition: transform .24s ease; }
  .sample-toc.is-open { transform: none; }
  .toc-close { display: grid; place-items: center; }
  .toc-scrim { position: fixed; z-index: 70; inset: 0; display: block; background: rgba(12, 21, 18, .58); }
  .toc-scrim[hidden] { display: none; }
  .sample-cover, .sample-page, .sample-gate { margin-bottom: .75rem; box-shadow: none; }
  .sample-cover { display: flex; min-height: 0; padding: 2rem 1.25rem 2.4rem; flex-direction: column-reverse; align-items: stretch; }
  .sample-cover img { width: min(68vw, 260px); align-self: center; }
  .sample-cover h2 { font-size: 2.15rem; }
  .cover-description { margin: 1.2rem 0; }
  .cover-facts { gap: 1rem; }
  .sample-page { padding: 1.15rem; }
  .pdf-page { padding: .4rem; }
  .pdf-page .page-heading { margin: .8rem; }
  .ocr-copy { line-height: 1.88; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sample-toc,
  .page-curl,
  .page-edge,
  .book-navigation button,
  .reading-progress span { transition: none !important; }
  .turn-hint { display: none; }
}

/* Book mode: a clean-room physical page interaction built for EPUBIA. */
.reader-home { display: block; color: inherit; text-decoration: none; }
.mode-trigger {
  min-height: 44px;
  display: inline-flex;
  gap: .48rem;
  align-items: center;
  justify-content: center;
  padding: 0 .82rem;
  color: #f8f7f2;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.mode-trigger:hover,
.mode-trigger:focus-visible { border-color: #d5c18d; background: rgba(213,193,141,.1); outline: none; }
.mode-trigger:active { transform: scale(.97); }
.mode-icon { color: #d5c18d; font-size: 1rem; }
.reader-workspace { min-width: 0; }
.book-stage-shell[hidden] { display: none; }
.book-stage-shell { min-width: 0; }

.reader-book-mode {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(255,255,255,.55), transparent 36rem),
    linear-gradient(135deg, #d8d4c8, #bdb9ad);
}
.reader-book-mode .reader-layout {
  height: calc(100dvh - 78px);
  grid-template-columns: 248px minmax(0, 900px);
  gap: clamp(1rem, 2vw, 2rem);
  align-items: stretch;
  padding: 1rem clamp(.8rem, 2vw, 1.8rem) 1.1rem;
}
.reader-book-mode .sample-toc { top: 0; height: 100%; max-height: none; box-shadow: 0 20px 50px rgba(35,31,24,.12); }
.reader-book-mode .reader-workspace { min-height: 0; }
.reader-book-mode .sample-pages { display: none; }

.book-desk {
  position: relative;
  height: calc(100dvh - 220px);
  min-height: 430px;
  max-height: 760px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(59,50,37,.2);
  border-radius: 30px 8px 30px 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px) 0 0 / 52px 52px,
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 52px 52px,
    radial-gradient(circle at 50% 46%, rgba(255,255,255,.76), transparent 44%),
    linear-gradient(145deg, #d8d0bf, #aaa493);
  box-shadow: inset 0 1px rgba(255,255,255,.55), inset 0 -25px 60px rgba(58,46,28,.11), 0 24px 70px rgba(43,36,25,.18);
  isolation: isolate;
}
.book-desk::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6% 8%;
  border-radius: 50%;
  background: rgba(52,42,28,.22);
  filter: blur(34px);
  transform: translateY(26px) scale(.82);
}
.desk-glow {
  position: absolute;
  top: -35%;
  left: 50%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,251,231,.5);
  filter: blur(60px);
  transform: translateX(-50%);
  pointer-events: none;
}
.book-stage {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 9rem), 860px);
  height: auto;
  max-height: calc(100% - 44px);
  aspect-ratio: 1.46 / 1;
  perspective: 1900px;
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: text;
}
.book-stage::before,
.book-stage::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 8px -7px -8px 8px;
  border-radius: 3px 14px 14px 3px;
  background: repeating-linear-gradient(90deg, #d7d0c0 0 1px, #f5efe2 1px 3px);
  box-shadow: 0 28px 54px rgba(40,30,18,.32);
}
.book-stage::after { inset: 4px -3px -4px 4px; z-index: -1; opacity: .75; }
.book-spine {
  position: absolute;
  z-index: 30;
  inset: 0 auto 0 50%;
  width: 18px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(32,24,15,.24) 38%, rgba(255,255,255,.22) 52%, rgba(37,28,18,.2) 64%, transparent);
  box-shadow: 0 0 15px rgba(42,31,17,.18);
  transform: translateX(-50%);
  pointer-events: none;
}
.book-blank-page {
  position: absolute;
  z-index: 1;
  inset: 0 50% 0 0;
  border: 1px solid rgba(78,65,45,.2);
  border-radius: 12px 2px 2px 12px;
  background:
    repeating-linear-gradient(0deg, rgba(106,86,53,.018) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 22% 8%, rgba(255,255,255,.75), transparent 18rem),
    var(--paper);
  box-shadow: inset -16px 0 28px rgba(70,55,34,.1);
  pointer-events: none;
}

.reader-book-mode .reader-leaf {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  height: 100%;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  border: 1px solid rgba(78,65,45,.2);
  border-radius: 3px 12px 12px 3px;
  background:
    repeating-linear-gradient(0deg, rgba(106,86,53,.018) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 78% 8%, rgba(255,255,255,.75), transparent 18rem),
    var(--paper);
  box-shadow: inset 12px 0 24px rgba(70,55,34,.07), inset -1px 0 rgba(255,255,255,.8);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  scrollbar-color: rgba(119,99,64,.35) transparent;
  scrollbar-width: thin;
}
.reader-book-mode .reader-leaf { visibility: hidden; opacity: 0; pointer-events: none; }
.reader-book-mode .reader-leaf.is-active { z-index: 2; visibility: visible; opacity: 1; pointer-events: auto; }
.reader-book-mode .reader-leaf.is-left-page {
  left: 0;
  border-radius: 12px 2px 2px 12px;
  box-shadow: inset -16px 0 28px rgba(70,55,34,.1), inset 1px 0 rgba(255,255,255,.8);
}
.reader-book-mode .reader-leaf.is-right-page {
  left: 50%;
  border-radius: 2px 12px 12px 2px;
  box-shadow: inset 16px 0 28px rgba(70,55,34,.08), inset -1px 0 rgba(255,255,255,.8);
}
.reader-book-mode .reader-leaf::after {
  content: "";
  position: sticky;
  z-index: 40;
  top: 0;
  right: 0;
  float: right;
  width: 26%;
  height: 100%;
  margin-left: -26%;
  background: linear-gradient(90deg, transparent, rgba(90,69,38,.055));
  pointer-events: none;
}
.reader-book-mode .sample-cover {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 1rem;
  align-items: center;
  padding: clamp(1.35rem, 3vh, 2.3rem);
  text-align: center;
}
.reader-book-mode .sample-cover > img {
  grid-row: 1;
  width: auto;
  height: min(100%, 250px);
  max-height: 100%;
  justify-self: center;
  align-self: center;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  box-shadow: 10px 12px 0 rgba(24,63,54,.12), 0 18px 35px rgba(43,34,22,.18);
}
.reader-book-mode .sample-cover .cover-copy { grid-row: 2; min-width: 0; align-self: center; }
.reader-book-mode .sample-cover h2 { max-width: 100%; font-size: clamp(1.35rem, 3.2vh, 2.25rem); line-height: 1.24; }
.reader-book-mode .sample-cover .cover-author { margin-top: .55rem; }
.reader-book-mode .sample-cover .cover-description { display: none; }
.reader-book-mode .sample-cover .cover-facts { justify-content: center; margin-top: .9rem; text-align: left; }
.reader-book-mode .sample-page { padding: clamp(1.4rem, 3.5vh, 3rem); }
.reader-book-mode .pdf-page { padding: .7rem; }
.reader-book-mode .pdf-sheet { height: calc(100% - 4.8rem); object-fit: contain; }
.reader-book-mode .sample-gate { min-height: 100%; display: grid; align-content: center; padding: clamp(2rem, 5vw, 4rem); }
.reader-book-mode .scan-compare[open] img { max-height: 70vh; object-fit: contain; }

/* Flexible page surface: nested narrow strips form one continuous paper arc. */
.page-curl {
  position: absolute;
  z-index: 22;
  top: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
}
.page-curl.is-forward { left: 50%; transform-origin: left center; }
.page-curl.is-backward { right: 50%; transform-origin: right center; }
.curl-strip {
  position: absolute;
  top: 0;
  width: calc(var(--curl-width) / var(--curl-strips));
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.page-curl.is-forward .curl-strip { transform-origin: left center; }
.page-curl.is-backward .curl-strip { transform-origin: right center; }
.page-curl.is-forward > .curl-strip { left: 0; }
.page-curl.is-backward > .curl-strip { right: 0; }
.page-curl.is-forward .curl-strip > .curl-strip {
  left: 100%;
  transform: rotateY(var(--curl-step, 0deg));
}
.page-curl.is-backward .curl-strip > .curl-strip {
  right: 100%;
  transform: rotateY(calc(-1 * var(--curl-step, 0deg)));
}
.curl-face {
  position: absolute;
  inset: 0 -1.2px 0 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}
.curl-face::before,
.curl-face::after {
  content: "";
  position: absolute;
  z-index: 50;
  inset: 0;
  pointer-events: none;
}
.curl-front::before {
  background: linear-gradient(90deg,
    rgba(60,44,22,var(--curl-a-near,0)),
    rgba(60,44,22,var(--curl-a-far,0)));
}
.curl-back {
  transform: rotateY(180deg) translateZ(.15px);
}
.curl-back::before {
  background: linear-gradient(90deg,
    rgba(60,44,22,var(--curl-a-far,0)),
    rgba(60,44,22,var(--curl-a-near,0)));
}
.curl-face::after {
  background: #fffaf0;
  opacity: calc(var(--curl-shade,0) * var(--curl-light,1) * var(--curl-light,1) * .2);
}
.curl-face-content {
  position: absolute !important;
  z-index: 1 !important;
  top: 0 !important;
  bottom: auto !important;
  right: auto !important;
  max-width: none !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  transform: none !important;
  backface-visibility: hidden;
}
.page-curl.is-forward .curl-strip.is-edge > .curl-face {
  border-radius: 0 12px 12px 0;
  box-shadow: inset -1px 0 rgba(94,72,42,.26);
}
.page-curl.is-backward .curl-strip.is-edge > .curl-face {
  border-radius: 12px 0 0 12px;
  box-shadow: inset 1px 0 rgba(94,72,42,.26);
}
.page-curl .curl-strip.is-edge > .curl-front::after {
  background:
    linear-gradient(90deg, transparent 20%, rgba(255,255,255,.5) 76%, rgba(74,52,24,.16)),
    #fffaf0;
  opacity: calc(.08 + var(--curl-shade,0) * .28);
}
.curl-cast-shadow {
  position: absolute;
  z-index: 18;
  top: 2%;
  bottom: 2%;
  width: 36%;
  border-radius: 45%;
  filter: blur(13px);
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.curl-cast-shadow.is-forward {
  left: 50%;
  background: linear-gradient(90deg, rgba(46,32,16,.34), rgba(46,32,16,.08) 58%, transparent);
  transform-origin: left center;
}
.curl-cast-shadow.is-backward {
  right: 50%;
  background: linear-gradient(270deg, rgba(46,32,16,.34), rgba(46,32,16,.08) 58%, transparent);
  transform-origin: right center;
}
.book-stage.is-curling .book-spine { box-shadow: 8px 0 20px rgba(42,31,17,.25); }
.book-stage.is-dragging { cursor: grabbing; user-select: none; }
.book-stage.is-dragging .reader-leaf { user-select: none; }

.page-edge {
  position: absolute;
  z-index: 10;
  top: 50%;
  width: 52px;
  height: 76px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #443a2c;
  border: 1px solid rgba(71,58,39,.22);
  border-radius: 50%;
  background: rgba(249,245,233,.72);
  box-shadow: 0 10px 25px rgba(46,36,23,.13);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}
.page-edge span { font: 300 2.3rem/1 Georgia, serif; transform: translateY(-2px); }
.page-edge:hover:not(:disabled) { background: #fffaf0; transform: translateY(-50%) scale(1.06); }
.page-edge:focus-visible { outline: 3px solid rgba(24,63,54,.3); outline-offset: 3px; }
.page-edge:disabled { opacity: .22; cursor: default; }
.page-edge-prev { left: 20px; }
.page-edge-next { right: 20px; }
.turn-hint {
  position: absolute;
  z-index: 8;
  right: 1.2rem;
  bottom: .7rem;
  margin: 0;
  color: rgba(54,45,33,.7);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .02em;
  pointer-events: none;
  transition: opacity .5s ease;
}
.turn-hint.is-dismissed { opacity: 0; }
.turn-hint span { margin-right: .35rem; color: var(--forest); }

.book-navigation {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(150px, 1.3fr) minmax(90px, 1fr);
  gap: 1rem;
  align-items: center;
  padding: .6rem .8rem 0;
}
.book-navigation button {
  min-height: 44px;
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  justify-content: center;
  color: #304039;
  border: 1px solid rgba(48,64,57,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
}
.book-navigation button:hover:not(:disabled) { background: rgba(255,255,255,.82); transform: translateY(-2px); }
.book-navigation button:focus-visible { outline: 3px solid rgba(24,63,54,.22); outline-offset: 2px; }
.book-navigation button:disabled { opacity: .28; cursor: default; }
.book-position { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; align-items: center; text-align: center; }
.book-position strong { overflow: hidden; color: #28352f; font-family: "Noto Serif KR", "Nanum Myeongjo", serif; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.book-position > span { color: #6b736d; font-size: .68rem; font-variant-numeric: tabular-nums; }
.book-position i { grid-column: 1 / -1; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(24,63,54,.13); }
.book-position i b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest), var(--brass)); transition: width .35s ease; }

@media (max-width: 900px) {
  .reader-book-mode .reader-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .book-stage { max-width: calc(100% - 7rem); }
  .page-edge { width: 44px; height: 64px; }
  .page-edge-prev { left: 12px; }
  .page-edge-next { right: 12px; }
}

@media (max-width: 760px) {
  .mode-trigger { min-width: 44px; padding: 0 .7rem; }
  .mode-trigger [data-mode-label] { display: none; }
  .reader-book-mode .reader-layout { height: calc(100dvh - 66px); display: block; padding: .45rem .35rem max(.6rem, env(safe-area-inset-bottom)); }
  .reader-book-mode .reader-workspace { height: 100%; }
  .reader-book-mode .book-stage-shell { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) 58px; }
  .reader-book-mode .sample-toc { height: auto; }
  .book-desk { width: 100%; height: auto; min-height: 0; max-height: none; border-radius: 18px 5px 18px 5px; }
  .book-stage { width: min(calc(100% - 1.8rem), 720px); height: auto; max-width: none; max-height: calc(100% - 1.15rem); aspect-ratio: 1.46 / 1; }
  .page-edge { top: auto; bottom: 8px; width: 40px; height: 40px; background: rgba(249,245,233,.84); transform: none; }
  .page-edge:hover:not(:disabled) { transform: scale(1.05); }
  .page-edge span { font-size: 1.8rem; }
  .page-edge-prev { left: 8px; }
  .page-edge-next { right: 8px; }
  .turn-hint { right: 50%; bottom: .68rem; width: max-content; font-size: .58rem; transform: translateX(50%); }
  .book-navigation { min-height: 58px; grid-template-columns: 70px minmax(110px, 1fr) 70px; gap: .45rem; padding: .45rem .15rem 0; }
  .book-navigation button { min-height: 40px; font-size: .72rem; }
  .book-navigation button span:first-child:last-child { display: inline; }
  .book-position strong { font-size: .72rem; }
  .reader-book-mode .sample-cover { display: grid; grid-template-rows: 1fr; padding: .55rem; place-items: center; }
  .reader-book-mode .sample-cover .cover-copy { display: none; }
  .reader-book-mode .sample-cover > img {
    grid-row: 1;
    width: auto;
    height: calc(100% - .35rem);
    max-width: calc(100% - .35rem);
    max-height: calc(100% - .35rem);
    align-self: center;
    justify-self: center;
    object-fit: contain;
    box-shadow: 5px 7px 0 rgba(24,63,54,.1), 0 10px 24px rgba(43,34,22,.16);
  }
  .reader-book-mode .sample-page { padding: 1.05rem; }
  .reader-book-mode .page-heading { margin-bottom: 1rem; }
  .reader-book-mode .page-heading h2 { font-size: 1.12rem; }
  .reader-book-mode .ocr-copy { font-size: .93rem; line-height: 1.8; }
  .reader-book-mode .sample-gate { padding: 1.4rem; }
}

@media (max-width: 420px) {
  .reader-actions { gap: .35rem; }
  .mode-trigger,
  .toc-trigger { min-width: 42px; padding: 0 .55rem; font-size: .7rem; }
  .book-stage { width: calc(100% - 1rem); max-height: calc(100% - .75rem); }
  .book-position > span { display: none; }
  .book-position { grid-template-columns: 1fr; }
  .book-navigation { grid-template-columns: 62px minmax(90px, 1fr) 62px; }
  .book-navigation button { gap: .2rem; font-size: .68rem; }
}
