/* 읽기 화면 — 글이 주인공. 색은 tokens.css의 원색 팔레트를 테마별로 연결 */

body.is-reading { overflow: hidden; }
/* 읽기 화면 뒤에 가려진 공통 헤더는 탭 이동/스크린리더에서도 숨김 */
body.is-reading .app-header { visibility: hidden; }

@keyframes reader-in { from { opacity: 0; } }
.reader {
  --reader-font-size: 18px;
  --reader-line-height: var(--lh-reading);
  --reader-pad-x: 28px;
  --reader-bar-h: 52px;

  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--r-bg);
  color: var(--r-text);
  font-family: var(--font-sans);
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  animation: reader-in var(--dur-base) var(--ease-out);
}

/* 테마: 라이트 / 다크 / 세피아 — 시스템 설정과 무관하게 독자가 고른 값 */
.reader[data-theme="light"] {
  --r-bg: var(--c-paper-l); --r-text: var(--c-ink-l); --r-muted: var(--c-pencil-l); --r-faint: var(--c-faint-l);
  --r-line: var(--c-rule-l); --r-accent: var(--c-accent-l); --r-on-accent: #fff; --r-surface: var(--c-sheet-l);
  --r-press: var(--c-wash-l); --r-scrim: rgb(20 21 25 / 0.35); --r-shimmer: rgb(255 255 255 / 0.6);
}
.reader[data-theme="dark"] {
  --r-bg: var(--c-paper-d); --r-text: var(--c-ink-d); --r-muted: var(--c-pencil-d); --r-faint: var(--c-faint-d);
  --r-line: var(--c-rule-d); --r-accent: var(--c-accent-d); --r-on-accent: #141519; --r-surface: var(--c-sheet-d);
  --r-press: var(--c-wash-d); --r-scrim: rgb(0 0 0 / 0.6); --r-shimmer: rgb(255 255 255 / 0.06);
}
.reader[data-theme="sepia"] {
  --r-bg: var(--c-sepia-paper); --r-text: var(--c-sepia-ink); --r-muted: var(--c-sepia-pencil); --r-faint: var(--c-sepia-pencil);
  --r-line: var(--c-sepia-rule); --r-accent: var(--c-sepia-accent); --r-on-accent: #fff; --r-surface: var(--c-sepia-sheet);
  --r-press: var(--c-sepia-wash); --r-scrim: rgb(60 40 10 / 0.3); --r-shimmer: rgb(255 255 255 / 0.5);
}

.reader-status {
  margin: auto;
  width: min(100%, 34rem);
  padding: var(--sp-6) var(--reader-pad-x);
  color: var(--r-muted);
  text-align: center;
}
.reader-status a { color: var(--r-accent); }
.reader .skel { background: var(--r-press); }
.reader .skel::after { background: linear-gradient(90deg, transparent, var(--r-shimmer), transparent); }

/* ---------- 상단 바: 최소한으로, 옅게 ---------- */
.reader-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0;
  height: calc(var(--reader-bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(4px, env(safe-area-inset-right)) 0 max(4px, env(safe-area-inset-left));
}
.reader-title {
  flex: 1;
  min-width: 0;
  margin: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-13);
  color: var(--r-faint);
}
.reader-count {
  flex: none;
  margin-right: 2px;
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  color: var(--r-faint);
}
.reader-icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r-muted);
  font: inherit;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.reader-icon-btn:hover { color: var(--r-text); }
.reader-icon-btn:active { transform: scale(0.9); background: var(--r-press); }
.reader-icon-btn svg,
.reader-nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.reader-aa { font-family: var(--font-serif); font-size: var(--fs-16); font-weight: 700; letter-spacing: 0; }

/* ---------- 진행바: 2px 군청 선, transform으로 부드럽게 증가 ---------- */
.reader-progress {
  flex: none;
  height: 2px;
  background: color-mix(in srgb, var(--r-line) 70%, transparent);
  overflow: hidden;
}
.reader-progress-fill {
  width: 100%;
  height: 100%;
  background: var(--r-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out);
}

/* ---------- 페이지 영역 (두 모드 공통) ---------- */
.reader-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.reader-track {
  position: relative;
  height: 100%;
  outline: none;
}
.reader-page {
  display: flex;
  flex-direction: column;
  padding: 32px max(var(--reader-pad-x), env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) max(var(--reader-pad-x), env(safe-area-inset-left));
}
.reader-text {
  /* margin:auto → 짧은 페이지는 세로 가운데, 긴 페이지는 위에서부터 (잘림 없음) */
  margin: auto;
  width: 100%;
  max-width: 33rem;
  font-family: var(--font-serif);
  /* 명조는 같은 크기에서 작아 보여서 1px 키움 (설정 단계는 그대로) */
  font-size: calc(var(--reader-font-size) + 1px);
  line-height: var(--reader-line-height);
  letter-spacing: -0.005em;
  text-align: left;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.reader-text p { margin: 0; }
.reader-text p + p { margin-top: 1.1em; }

/* 페이지가 바뀌면 글이 4px 아래에서 살짝 떠오르며 들어옴 */
@keyframes text-in { from { opacity: 0.25; transform: translateY(5px); } }
.reader-page[data-active] .reader-text { animation: text-in 300ms var(--ease-out) both; }

/* (a) 가로 넘기기 */
.reader[data-mode="swipe"] .reader-track {
  --index: 0;
  --drag: 0px;
  display: flex;
  touch-action: pan-y;
  transform: translate3d(calc(var(--index) * -100% + var(--drag)), 0, 0);
  transition: transform 340ms var(--ease-out);
  will-change: transform;
}
.reader[data-mode="swipe"] .reader-track.is-dragging,
.reader[data-mode="swipe"] .reader-track.no-anim { transition: none; }
.reader[data-mode="swipe"] .reader-page {
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.reader[data-mode="swipe"] .reader-page::-webkit-scrollbar { display: none; }
.reader[data-mode="swipe"] .reader-text { transition: opacity 340ms var(--ease-out); }
.reader[data-mode="swipe"] .reader-page[inert] .reader-text { opacity: 0.3; }
.reader[data-mode="swipe"] .reader-viewport { user-select: none; -webkit-user-select: none; }

/* (b) 세로 스크롤 — 같은 트랙이 스크롤러가 된다 */
.reader[data-mode="scroll"] .reader-track {
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* 위치는 진행바로 표시 */
}
.reader[data-mode="scroll"] .reader-track::-webkit-scrollbar { display: none; }
.reader[data-mode="scroll"] .reader-page {
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.reader[data-mode="scroll"] .reader-page + .reader-page { border-top: 1px solid color-mix(in srgb, var(--r-line) 60%, transparent); }

/* 데스크톱(마우스) 가로 모드에서만 좌우 화살표 버튼 */
.reader-nav {
  position: absolute;
  top: 50%;
  display: none;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  margin-top: -22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r-faint);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.reader-nav:hover { color: var(--r-text); background: var(--r-press); }
.reader-nav:active { transform: scale(0.92); }
.reader-nav-prev { left: 16px; }
.reader-nav-next { right: 16px; }
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .reader[data-mode="swipe"] .reader-nav { display: grid; }
}
.reader[data-at-start] .reader-nav-prev,
.reader[data-at-end] .reader-nav-next { opacity: 0; pointer-events: none; }

/* ---------- 끝 화면 ---------- */
/* "끝" 안내(화면 한 장 높이) 아래로 평가 영역이 이어지는 긴 페이지 */
.reader .reader-end { display: block; padding: 0; }
.reader-end-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: var(--reader-page-h, 100%);
  padding: 32px var(--reader-pad-x) calc(16px + env(safe-area-inset-bottom));
}
/* 책갈피: 끝 화면에 도착하면 위에서 내려와 꽂힘 (완료 연출) */
@keyframes ribbon-drop { from { transform: translateY(-110%); } 70% { transform: translateY(6%); } }
@keyframes end-in { from { opacity: 0; transform: translateY(8px); } }
.reader-ribbon {
  position: absolute;
  top: 0;
  right: 32px;
  width: 22px;
  height: 84px;
  background: var(--r-accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  transform: translateY(-110%);
}
.reader-end[data-active] .reader-ribbon { transform: none; animation: ribbon-drop var(--dur-slow) var(--ease-out) both; }
.reader-end-inner {
  margin: auto;
  width: 100%;
  max-width: 33rem;
  text-align: center;
}
.reader-end[data-active] .reader-end-inner > * { animation: end-in var(--dur-slow) var(--ease-out) both; }
.reader-end[data-active] .reader-end-inner > :nth-child(2) { animation-delay: 60ms; }
.reader-end[data-active] .reader-end-inner > :nth-child(3) { animation-delay: 140ms; }
.reader-end[data-active] .reader-end-inner > :nth-child(4) { animation-delay: 200ms; }
.reader-end-mark {
  margin: 0 0 var(--sp-5);
  font-family: var(--font-serif);
  font-size: var(--fs-16);
  color: var(--r-faint);
}
.reader-end-title {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-serif);
  font-size: var(--fs-25);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: var(--tracking-serif);
  color: var(--r-text);
  word-break: keep-all;
}
.reader-end-msg {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-8);
  color: var(--r-muted);
}
/* "다 읽었어요" 앞 체크 표시가 그려지듯 나타남 */
@keyframes check-in { from { opacity: 0; transform: scale(0.4) rotate(-20deg); } 60% { transform: scale(1.15); } }
.reader-end-msg::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--r-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.reader-end[data-active] .reader-end-msg::before { animation: check-in var(--dur-slow) var(--ease-spring) 240ms both; }
.reader[data-preview] .reader-end-msg::before { display: none; }
.reader-end-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  min-height: 48px;
  padding: 0 var(--sp-6);
  border-radius: var(--r-pill);
  background: var(--r-accent);
  color: var(--r-on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.reader-end-home:active { transform: scale(0.97); }
button.reader-end-home { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 85% { transform: translateY(3px); } }
.reader-end-more {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  align-self: center;
  min-height: var(--touch);
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--r-muted);
  font: inherit;
  font-size: var(--fs-14);
  cursor: pointer;
}
.reader-end-more span { font-size: 1.1em; animation: nudge 2.4s var(--ease-out) infinite; }

.reader-rating-slot {
  max-width: calc(33rem + 2 * var(--reader-pad-x));
  margin: 0 auto;
  padding: 0 var(--reader-pad-x);
  scroll-margin-top: 8px;
}
.reader-end-footer {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  margin: 0;
  padding: var(--sp-8) var(--reader-pad-x) calc(48px + env(safe-area-inset-bottom));
  font-size: var(--fs-14);
}
.reader-end-footer a, .reader-report {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--sp-2);
  border: 0;
  background: none;
  color: var(--r-faint);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* ---------- 평가 (공통 부품 모양과 같은 치수) ---------- */
.reader input, .reader textarea { user-select: text; -webkit-user-select: text; }

.review { padding: var(--sp-8) 0 0; border-top: 1px solid var(--r-line); }
.review-status { padding: var(--sp-8) 0; text-align: center; color: var(--r-muted); font-size: var(--fs-14); }
.review-link-btn {
  min-height: var(--touch);
  margin-top: var(--sp-2);
  padding: 0 var(--sp-4);
  border: 1px solid var(--r-line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--r-text);
  font: inherit;
  cursor: pointer;
}
.review-title {
  margin: 0 0 var(--sp-1);
  font-family: var(--font-serif);
  font-size: var(--fs-20);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: var(--tracking-serif);
  color: var(--r-text);
}
.review-sub { margin: 0 0 var(--sp-6); font-size: var(--fs-14); color: var(--r-muted); }
.review-field { margin-bottom: var(--sp-6); }
.review-label { display: block; margin: 0 0 var(--sp-2); font-size: var(--fs-14); font-weight: 600; }
.review-label span { margin-left: 4px; font-weight: 400; color: var(--r-faint); }

/* 태그 칩: 누르면 살짝 튀며 채워짐 */
@keyframes chip-pop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.review-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.review-chip {
  min-height: 40px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--r-line);
  border-radius: var(--r-pill);
  background: var(--r-surface);
  color: var(--r-text);
  font: inherit;
  font-size: var(--fs-14);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.review-chip:active { transform: scale(0.94); }
.review-chip[aria-pressed="true"] {
  border-color: var(--r-accent);
  background: var(--r-accent);
  color: var(--r-on-accent);
  font-weight: 600;
  animation: chip-pop 280ms var(--ease-spring);
}

/* 별점: 왼쪽부터 차례로 채워짐 */
@keyframes star-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.review-stars-row { display: flex; align-items: center; gap: var(--sp-3); }
.review-stars { display: flex; }
.review-star {
  display: grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.review-star svg {
  width: 30px;
  height: 30px;
  fill: var(--r-line);
  transition: fill var(--dur-fast) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}
.review-star.is-on svg { fill: var(--star); animation: star-pop var(--dur-base) var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 45ms); }
.review-star:active svg { transform: scale(0.88); }
.review-star-text { font-size: var(--fs-14); color: var(--r-muted); font-variant-numeric: tabular-nums; }

.review-input-wrap { position: relative; }
.review-input {
  width: 100%;
  height: 50px;
  padding: 0 64px 0 var(--sp-4);
  border: 1px solid var(--r-line);
  border-radius: var(--r-md);
  background: var(--r-surface);
  color: var(--r-text);
  font: inherit;
  font-size: 16px; /* 16px 미만이면 iOS가 확대함 */
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.review-input::placeholder { color: var(--r-faint); }
.review-input:focus { outline: none; border-color: var(--r-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r-accent) 15%, transparent); }
.review-counter {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: var(--fs-12);
  color: var(--r-faint);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.review-error { margin: 0 0 var(--sp-3); font-size: var(--fs-14); color: var(--danger); }
.review-submit {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--r-accent);
  color: var(--r-on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.review-submit:active { transform: scale(0.98); }
.review-submit:disabled { opacity: 0.3; cursor: default; transform: none; }
.review-submit[data-busy] { opacity: 0.7; }
.review-note { margin: var(--sp-3) 0 0; text-align: center; font-size: var(--fs-12); color: var(--r-faint); }

/* 결과 */
@keyframes result-in { from { opacity: 0; transform: translateY(10px); } }
.review-results { animation: result-in var(--dur-slow) var(--ease-out); }
.review-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.review-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-4);
  border: 1px solid var(--r-line);
  border-radius: var(--r-md);
  background: var(--r-surface);
}
.review-stat strong { font-family: var(--font-serif); font-size: var(--fs-25); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.review-stat span { font-size: var(--fs-12); color: var(--r-muted); }

/* 결과 막대: 공통 막대 부품과 같은 치수(.bar), 차례로 차오름 */
@keyframes review-grow { from { transform: scaleX(0); } }
.review-bars { margin: 0 0 var(--sp-8); padding: 0; list-style: none; }
.review-bar {
  display: grid;
  grid-template-columns: 4.5em 1fr 3em;
  align-items: center;
  gap: var(--sp-3);
  min-height: 34px;
  font-size: var(--fs-14);
}
.review-bar-name { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.review-bar-mine { font-style: normal; font-size: 11px; color: var(--r-accent); }
.review-bar-track { height: 8px; border-radius: var(--r-pill); background: var(--r-press); overflow: hidden; }
.review-bar-fill {
  display: block;
  width: calc(var(--ratio, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--r-muted) 55%, transparent);
  transform-origin: left;
  animation: review-grow var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(120ms + var(--i, 0) * var(--stagger));
}
.review-bar-pct { text-align: right; color: var(--r-muted); font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.review-bar.is-mine .review-bar-name { font-weight: 600; color: var(--r-accent); }
.review-bar.is-mine .review-bar-fill { background: var(--r-accent); }
.review-bar.is-mine .review-bar-pct { color: var(--r-accent); font-weight: 600; }

.review-subtitle { margin: 0 0 var(--sp-2); font-size: var(--fs-16); font-weight: 600; }
.review-empty { margin: 0; font-size: var(--fs-14); color: var(--r-muted); }
.review-comments { margin: 0; padding: 0; list-style: none; }
.review-comment { padding: var(--sp-3) 0; border-bottom: 1px solid var(--r-line); }
.review-comment:last-child { border-bottom: 0; }
.review-comment-meta { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 2px; font-size: var(--fs-12); color: var(--r-faint); }
.review-comment-nick { color: var(--r-text); font-weight: 600; }
.review-comment-rating { color: var(--star); font-weight: 600; }
.review-comment-text { margin: 0; font-size: var(--fs-16); line-height: 1.6; overflow-wrap: anywhere; }
.review-comment-hidden { color: var(--r-muted); font-style: italic; }
.review .content-actions .text-btn { color: var(--r-faint); margin: -12px 0; } /* 터치 영역 44px은 유지하고 줄 높이는 늘리지 않음 */
.review-login-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.review-note a { color: var(--r-accent); }
.reader-preview-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--r-accent);
  color: var(--r-on-accent);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- 설정 패널 (하단 시트) ---------- */
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes scrim-in { from { opacity: 0; } }
.reader-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--r-scrim);
  animation: scrim-in var(--dur-base) var(--ease-out);
}
.reader-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-6) calc(var(--sp-4) + env(safe-area-inset-bottom));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--r-surface);
  color: var(--r-text);
  box-shadow: var(--shadow-sheet);
  animation: sheet-in var(--dur-base) var(--ease-out);
}
/* 손잡이 */
.reader-sheet::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto var(--sp-5); border-radius: var(--r-pill); background: var(--r-line); }
.reader-scrim[hidden], .reader-sheet[hidden] { display: none; }
.reader-sheet-row { margin-bottom: var(--sp-6); }
.reader-sheet-label { display: block; margin-bottom: var(--sp-2); font-size: var(--fs-13); color: var(--r-muted); }
.reader-seg { display: flex; gap: var(--sp-2); }
.reader-seg button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 4px;
  border: 1px solid var(--r-line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--r-text);
  font-family: var(--font-serif);
  font-size: var(--fs-14);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.reader-seg button:active { transform: scale(0.95); }
.reader-seg button[aria-pressed="true"] {
  border-color: var(--r-accent);
  box-shadow: inset 0 0 0 1px var(--r-accent);
  color: var(--r-accent);
  font-weight: 700;
}
.reader-seg [data-theme-option] { font-family: var(--font-sans); }
.reader-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgb(0 0 0 / 0.15); }
.reader-swatch[data-swatch="light"] { background: var(--c-paper-l); }
.reader-swatch[data-swatch="dark"] { background: var(--c-paper-d); }
.reader-swatch[data-swatch="sepia"] { background: var(--c-sepia-paper); }
.reader-sheet-close {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--r-press);
  color: var(--r-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.reader-sheet-close:active { transform: scale(0.98); }

@media (min-width: 768px) {
  .reader { --reader-pad-x: 72px; }
  .reader-page { padding-top: 48px; padding-bottom: 80px; }
}
