:root {
  color-scheme: light;
  --paper: #fbfbfa;
  --paper-deep: #f6f6f2;
  --paper-edge: rgba(20, 20, 20, 0.045);
  --paper-breath: rgba(255, 255, 253, 0.76);
  --ink: #141414;
  --muted: #686862;
  --muted-strong: #4a4a45;
  --hairline: #d9d9d2;
  --hairline-soft: rgba(20, 20, 20, 0.09);
  --wash: #f2f2ee;
  --raised: #fffffd;
  --accent: #151515;
  --accent-soft: #e8e8e2;
  --green: #151515;
  --pressed-ink: rgba(20, 20, 20, 0.78);
  --focus: rgba(21, 21, 21, 0.24);
  --bar-bg: rgba(251, 251, 250, 0.88);
  --veil-bg: rgba(255, 255, 253, 0.84);
  --button-wash: rgba(20, 20, 20, 0.035);
  --shadow: rgba(0, 0, 0, 0.08);
  --chrome-shadow: rgba(0, 0, 0, 0.1);
  --highlight-bg: rgba(21, 21, 21, 0.06);
  --highlight-line: rgba(21, 21, 21, 0.34);
  --ui-font: "Gyeonggi Batang UI", "Gyeonggi Batang", "경기천년바탕", "경기청년바탕", Batang, serif;
  --body-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  --reader-font-size: 20px;
  --reader-line-height: 1.9;
  --reader-width-base: 720px;
  --reader-inline-padding: clamp(18px, 4.8vw, 56px);
  --reader-top-padding: clamp(64px, 10vh, 108px);
  --reader-bottom-padding: clamp(112px, 18vh, 188px);
  --reader-width: min(var(--reader-width-base), calc(100vw - (var(--reader-inline-padding) * 2)));
  --paragraph-gap: 1.15em;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0d0c;
  --paper-deep: #121210;
  --paper-edge: rgba(245, 244, 239, 0.05);
  --paper-breath: rgba(245, 244, 239, 0.035);
  --ink: #f5f4ef;
  --muted: #aaa79f;
  --muted-strong: #c7c3ba;
  --hairline: #2b2a27;
  --hairline-soft: rgba(245, 244, 239, 0.11);
  --wash: #1d1c1a;
  --raised: #141412;
  --accent: #f5f4ef;
  --accent-soft: #2a2925;
  --green: #d8d5ca;
  --pressed-ink: rgba(245, 244, 239, 0.84);
  --focus: rgba(245, 244, 239, 0.22);
  --bar-bg: rgba(13, 13, 12, 0.88);
  --veil-bg: rgba(18, 18, 16, 0.84);
  --button-wash: rgba(245, 244, 239, 0.06);
  --shadow: rgba(0, 0, 0, 0.46);
  --chrome-shadow: rgba(0, 0, 0, 0.54);
  --highlight-bg: rgba(245, 244, 239, 0.08);
  --highlight-line: rgba(245, 244, 239, 0.42);
}

@font-face {
  font-family: "Gyeonggi Batang UI";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/GyeonggiBatang-Bold.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  background: var(--paper-deep);
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, var(--paper-edge), transparent 18%, transparent 82%, var(--paper-edge)),
    linear-gradient(180deg, var(--paper-breath), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.reader-app {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}

.reader-surface {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.reader-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--paper-edge), transparent 15%, transparent 85%, var(--paper-edge)),
    linear-gradient(180deg, transparent 0%, var(--paper-breath) 48%, transparent 100%);
  opacity: 0.72;
}

.reader-bar {
  position: relative;
  z-index: 6;
  display: grid;
  align-items: center;
  min-height: 64px;
  border-color: var(--hairline);
  background: var(--bar-bg);
  color: var(--muted);
  font-family: var(--ui-font);
  font-weight: 700;
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.reader-topbar {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--hairline-soft);
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
}

.chapter-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.reader-bottombar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--hairline-soft);
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
}

.reading-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  height: 2px;
  opacity: 0.18;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.reader-surface.is-chrome-visible .reading-progress {
  opacity: 0.92;
}

.reading-progress:not(.has-started) {
  opacity: 0;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 140ms ease;
}

.reader-surface:not(.is-chrome-visible) .reader-bar {
  opacity: 0;
  pointer-events: none;
}

.reader-surface:not(.is-chrome-visible) .reader-topbar {
  transform: translateY(-12px);
}

.reader-surface:not(.is-chrome-visible) .reader-bottombar {
  transform: translateY(12px);
}

.chapter-label {
  margin: 0;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-context-label {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plain-button,
.solid-button,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--ui-font);
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.plain-button {
  color: var(--muted);
}

.plain-button:hover {
  border-color: transparent;
  background: var(--button-wash);
  color: var(--ink);
}

#accountButton {
  position: relative;
}

#accountButton.has-unread-dot::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.36;
}

.solid-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.08);
}

.solid-button:hover {
  background: var(--pressed-ink);
}

.quiet-button {
  border-color: var(--hairline-soft);
  background: linear-gradient(180deg, transparent, var(--button-wash));
}

.quiet-button:hover {
  border-color: var(--hairline);
  background: var(--button-wash);
}

.full-width-button {
  width: 100%;
}

.reader-content {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: max(var(--reader-top-padding), calc(env(safe-area-inset-top) + 28px));
  padding-right: max(var(--reader-inline-padding), env(safe-area-inset-right));
  padding-bottom: max(var(--reader-bottom-padding), calc(env(safe-area-inset-bottom) + 24px));
  padding-left: max(var(--reader-inline-padding), env(safe-area-inset-left));
  color: var(--ink);
  font-family: var(--reader-font-family, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  font-kerning: normal;
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
  scrollbar-width: thin;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}

.reader-content-inner {
  width: min(100%, var(--reader-width));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.reader-content h1 {
  position: relative;
  width: min(30ch, 100%);
  margin: 0 auto 3.3rem;
  padding-bottom: 0.95rem;
  color: var(--muted-strong);
  font-family: var(--ui-font);
  font-size: 1.08em;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  text-wrap: balance;
}

.reader-content h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(64px, 42%);
  height: 1px;
  transform: translateX(-50%);
  background: var(--hairline);
}

.reader-content h1[lang="en"] {
  overflow-wrap: break-word;
  hyphens: auto;
  hyphenate-limit-chars: 8 3 3;
}

.reader-content h1[lang="ja"] {
  line-break: strict;
}

.reader-content p {
  margin: 0 0 var(--paragraph-gap);
  min-width: 0;
  max-width: 100%;
  word-break: normal;
  overflow-wrap: anywhere;
  orphans: 2;
  widows: 2;
  text-wrap: pretty;
}

.reader-content p:last-child {
  margin-bottom: 0;
}

.reader-content[data-content-locale="en"],
.reader-content[data-content-locale="en"] p:not([data-reading-lang]) {
  overflow-wrap: break-word;
  hyphens: auto;
}

.reader-content[data-content-locale="en"] p:not([data-reading-lang]) .sentence {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.reader-content p[lang="en"] {
  overflow-wrap: break-word;
  hyphens: auto;
  hyphenate-limit-chars: 8 3 3;
}

.reader-content p[lang="en"] .sentence {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  hyphenate-limit-chars: 8 3 3;
}

.reader-content[data-content-locale="ja"] p:not([data-reading-lang]),
.reader-content[data-content-locale="ja"] p:not([data-reading-lang]) .sentence {
  line-break: strict;
}

.reader-content p[lang="ja"],
.reader-content p[lang="ja"] .sentence {
  line-break: strict;
}

.reader-content[data-content-locale="ja"] p:not([data-reading-lang]) .sentence {
  overflow-wrap: break-word;
  word-break: normal;
}

.reader-content p[lang="ja"] .sentence {
  overflow-wrap: break-word;
  word-break: normal;
}

.reader-content[data-content-locale="ko"] p:not([data-reading-lang]),
.reader-content[data-content-locale="ko"] p:not([data-reading-lang]) .sentence,
.reader-content p[lang="ko"],
.reader-content p[lang="ko"] .sentence,
.reader-content h1[lang="ko"] {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.reader-notice {
  margin-bottom: 1.6rem !important;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--muted-strong);
  font-family: var(--ui-font);
  font-size: 0.92em;
  font-weight: 700;
}

.reader-notice.is-transient {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.reader-notice.is-transient.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reader-notice-layer {
  position: absolute;
  top: max(var(--reader-top-padding), calc(env(safe-area-inset-top) + 18px));
  left: max(var(--reader-inline-padding), env(safe-area-inset-left));
  right: max(var(--reader-inline-padding), env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.reader-return-notice {
  width: min(100%, calc(var(--reader-width) - 16px));
  margin: 0;
  padding: 11px 15px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--veil-bg);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1.6;
  text-wrap: pretty;
  font-kerning: normal;
  box-shadow: 0 12px 34px var(--chrome-shadow);
  backdrop-filter: blur(16px) saturate(110%);
  -webkit-backdrop-filter: blur(16px) saturate(110%);
}

.reader-return-notice[data-notice-tone="manuscript"] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 14px 10px 12px;
  border-color: var(--hairline);
  border-radius: 8px;
  background: var(--veil-bg);
  color: var(--muted-strong);
  box-shadow: 0 16px 36px var(--shadow);
}

.reader-return-notice[data-notice-tone="manuscript"]::before {
  content: attr(data-notice-label);
  display: grid;
  align-self: stretch;
  place-items: center;
  min-width: 20px;
  padding-right: 10px;
  border-right: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.reader-return-notice[data-notice-tone="manuscript"][lang="en"]::before {
  align-self: center;
  min-width: 0;
  writing-mode: horizontal-tb;
}

.reader-return-notice[lang="en"] {
  overflow-wrap: break-word;
  hyphens: auto;
}

.reader-return-notice[lang="ja"] {
  line-break: strict;
}

.reader-return-notice[lang="ko"] {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.reader-return-notice.is-transient {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.reader-return-notice.is-transient.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.support-notice {
  margin: 0 0 14px;
  padding: 1px 0 1px 14px;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.7;
  text-wrap: pretty;
  font-kerning: normal;
}

.support-notice[lang="en"] {
  overflow-wrap: break-word;
  hyphens: auto;
}

.support-notice[lang="ja"] {
  line-break: strict;
}

.support-notice[lang="ko"] {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.support-notice.is-transient {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.support-notice.is-transient.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.author-gate-notice {
  margin-bottom: 16px;
}

.sentence {
  display: inline;
  max-width: 100%;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  vertical-align: bottom;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.sentence:hover,
.sentence.is-selected {
  background: var(--button-wash);
}

.sentence.is-return-focused {
  background: linear-gradient(transparent 68%, var(--accent-soft) 68%);
  box-shadow: inset 0 -1px 0 var(--focus);
}

.sentence.is-return-supported {
  background: linear-gradient(transparent 68%, var(--highlight-bg) 68%);
  box-shadow: inset 0 -2px 0 var(--highlight-line);
}

.sentence.has-support.is-highlight-visible {
  background: linear-gradient(transparent 68%, var(--highlight-bg) 68%);
  box-shadow: inset 0 -1px 0 var(--highlight-line);
}

.sentence.has-support.is-top-highlight.is-highlight-visible {
  box-shadow: inset 0 -2px 0 var(--highlight-line);
}

.reader-content.is-page-mode {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  touch-action: pan-x;
}

.reader-content.is-page-mode .reader-content-inner {
  width: var(--reader-width);
  max-width: var(--reader-width);
  height: 100%;
  column-width: var(--reader-width);
  column-gap: min(80px, 12vw);
  column-fill: auto;
}

.reader-content.is-page-mode p,
.reader-content.is-page-mode h1 {
  break-inside: avoid;
}

.highlight-summary {
  display: grid;
  gap: 10px;
  margin-top: 2.2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
}

.highlight-summary-eyebrow {
  color: var(--muted);
}

.highlight-ranking {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlight-ranking-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: start;
  color: var(--ink);
}

.highlight-ranking-item strong {
  grid-row: 1 / span 2;
  font-family: var(--ui-font);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.highlight-ranking-item span {
  overflow-wrap: anywhere;
}

.highlight-ranking-item small {
  color: var(--muted);
  font-size: 12px;
}

.locked-page {
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(640px, 100%);
  min-height: 62vh;
  margin: 0 auto;
  text-align: center;
}

.locked-page::before {
  content: "";
  width: 58px;
  height: 1px;
  justify-self: center;
  background: var(--hairline);
}

.locked-page h1 {
  margin-bottom: 0;
  line-height: 1.5;
}

.locked-page p {
  color: var(--muted-strong);
  width: min(42ch, 100%);
  margin: 0 auto;
  line-height: 1.82;
}

.locked-actions {
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  margin: 0 auto;
}

.locked-actions > * {
  width: 100%;
}

.reader-tap-zone {
  position: absolute;
  inset: 18% 20% 20%;
  z-index: 1;
  border: 0;
  background: transparent;
}

.reader-surface.is-chrome-visible .reader-tap-zone,
.drawer.is-open ~ .sentence-sheet {
  pointer-events: none;
}

.quiet-hint {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 5;
  width: min(360px, calc(100vw - 40px));
  transform: translateX(-50%);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  text-align: center;
  text-wrap: balance;
  opacity: 0.58;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.reader-surface.is-chrome-visible .quiet-hint,
.reader-surface.has-started .quiet-hint {
  opacity: 0;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(424px, 100vw);
  max-width: 100vw;
  border-left: 1px solid var(--hairline-soft);
  background:
    linear-gradient(180deg, var(--raised), var(--paper-deep)),
    var(--raised);
  font-family: var(--ui-font);
  font-weight: 700;
  box-shadow: -22px 0 56px var(--chrome-shadow);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border-bottom: 1px solid var(--hairline-soft);
  padding: max(22px, env(safe-area-inset-top)) 22px 18px;
}

.drawer-header > div {
  min-width: 0;
}

.drawer-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.drawer-header h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin-top: 10px;
  background: var(--hairline);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted-strong);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 700;
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 22px max(22px, env(safe-area-inset-bottom));
}

.drawer-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid var(--hairline-soft);
  padding-bottom: 20px;
}

.drawer p,
.drawer small,
.drawer strong,
.drawer label,
.drawer summary,
.drawer h3,
.drawer button {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.drawer-section.is-focused {
  border-color: var(--ink);
  background: linear-gradient(180deg, var(--button-wash), transparent 84%);
  transition: background 180ms ease, border-color 180ms ease;
}

.stat-list.is-focused {
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--button-wash), transparent 84%);
  padding: 8px;
  transition: background 180ms ease, border-color 180ms ease;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.button-row,
.amount-grid,
.settings-grid,
.work-list,
.chapter-list,
.stat-list,
.support-log {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.button-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reader-name-suggestions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reader-name-suggestions .quiet-button {
  min-height: 34px;
  padding: 6px 10px;
}

.amount-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.amount-option {
  width: 100%;
  min-height: 48px;
}

.amount-option.is-active {
  border-color: var(--ink);
  background: var(--paper);
}

.amount-readout {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 10px;
}

.amount-readout[data-support-kind="sentence"] {
  border-left: 1px solid var(--hairline-soft);
  border-bottom-color: var(--hairline-soft);
  padding-left: 12px;
}

.amount-readout-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.conditional-support-field {
  display: grid;
  gap: 10px;
}

.conditional-support-field.is-collapsed {
  display: none;
}

.amount-readout strong {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

.amount-readout small {
  color: var(--muted);
}

.support-level-seal {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 2px 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.support-level-mood {
  color: var(--muted-strong);
}

.sentence-amount-readout .support-level-seal {
  background: var(--button-wash);
}

.settings-grid {
  grid-template-columns: 1fr;
}

.work-list {
  gap: 20px;
}

.work-group {
  display: grid;
  gap: 10px;
}

.work-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: var(--ui-font);
  font-weight: 700;
  padding: 14px;
  text-align: left;
}

.work-item strong {
  font-size: 18px;
}

.work-item small {
  color: var(--muted);
}

.work-item.is-active {
  border-color: var(--ink);
}

.work-item:hover,
.chapter-list button:hover {
  background: var(--button-wash);
}

.work-item.is-planned {
  color: var(--muted);
}

.chapter-list button,
.stat-item,
.support-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.chapter-list button.is-active {
  border-color: var(--ink);
}

.support-item.is-selected {
  border-color: var(--ink);
  background: var(--paper);
}

.support-item.is-unread {
  background: var(--paper);
}

.reader-inbox {
  gap: 14px;
}

.reader-inbox-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.reader-inbox-header > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.reader-inbox-read-all-button {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  padding: 0 12px;
  justify-self: start;
  color: var(--muted);
}

.reader-inbox-read-all-button:hover {
  border-color: var(--hairline);
}

.reader-inbox-group {
  display: grid;
  gap: 8px;
}

.reader-inbox-label,
.reader-inbox-history-label {
  margin: 0;
  color: var(--muted);
}

.reader-inbox-panel {
  display: grid;
  gap: 10px;
}

.reader-inbox-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.reader-inbox-panel summary::-webkit-details-marker {
  display: none;
}

.reader-inbox-panel summary::after {
  content: " 펼치기";
}

.reader-inbox-panel[open] summary::after {
  content: " 접기";
}

.reader-inbox-panel-body {
  display: grid;
  gap: 10px;
}

.reader-notification-preference-item {
  gap: 0;
}

.reader-notification-preference-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.reader-notification-preference-header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.reader-notification-preference-header .quiet-button {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  padding: 0 12px;
  justify-self: start;
  white-space: nowrap;
}

.reader-notification-item {
  gap: 8px;
  background: var(--paper);
}

.reader-notification-context {
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.reader-notification-item.is-unread {
  background: var(--accent-soft);
}

.reader-notification-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.reader-notification-actions {
  grid-template-columns: auto;
  gap: 0;
  justify-content: start;
}

.reader-notification-open {
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 0 12px;
  justify-self: start;
}

@media (max-width: 720px) {
  .reader-inbox-header,
  .reader-notification-preference-header,
  .author-attention-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .reader-inbox-read-all-button,
  .reader-notification-preference-header .quiet-button,
  .reader-notification-open {
    width: fit-content;
    white-space: normal;
  }
}

.chapter-list small,
.stat-item small,
.support-item small {
  color: var(--muted);
}

.support-item button {
  justify-self: start;
}

.reader-checkpoint {
  gap: 6px;
}

.reader-checkpoint strong,
.reader-checkpoint small {
  line-height: 1.6;
}

.reader-checkpoint-quiet {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 0;
}

.reader-checkpoint-quiet strong {
  font-size: 13px;
}

.reader-checkpoint-quiet small {
  color: var(--muted);
}

.support-surface-note {
  font-size: 12px;
  line-height: 1.7;
}

.author-workbench-item {
  gap: 6px;
}

.author-operator-action-item,
.author-operator-note-item {
  gap: 6px;
}

.author-operator-action-item strong,
.author-operator-note-item strong {
  line-height: 1.55;
}

.author-operator-action-item-urgent {
  border-color: var(--ink);
  background: var(--paper);
}

.author-operator-action-item-watch {
  background: var(--wash);
}

.author-operator-step {
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 700;
}

.author-workbench-item .button-row {
  margin-top: 4px;
}

.author-overview-card {
  gap: 6px;
}

.author-notification-summary-item,
.author-notification-item {
  gap: 4px;
}

.author-release-work-item {
  gap: 6px;
}

.author-notification-summary-item strong,
.author-notification-item strong {
  line-height: 1.5;
}

.author-notification-summary-item small:last-child,
.author-notification-item small:last-child {
  font-family: var(--ui-font);
  font-size: 12px;
  line-height: 1.55;
}

.author-notification-panel {
  display: grid;
  gap: 8px;
}

.author-notification-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.author-notification-panel summary::-webkit-details-marker {
  display: none;
}

.author-notification-panel summary::after {
  content: " 펼치기";
}

.author-notification-panel[open] summary::after {
  content: " 접기";
}

.author-notification-panel-body,
.author-notification-event-list {
  display: grid;
  gap: 8px;
}

.author-operator-checklist-line {
  border-top: 1px solid var(--hairline);
  margin: 0;
  padding-top: 8px;
}

.author-operator-checklist-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.author-stat-details {
  display: grid;
  gap: 12px;
}

.author-stat-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--raised);
  padding: 12px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.author-stat-details summary::-webkit-details-marker {
  display: none;
}

.author-stat-details summary::after {
  content: "펼치기";
  color: var(--muted);
}

.author-stat-details[open] summary::after {
  content: "접기";
}

.author-stat-stack {
  display: grid;
  gap: 12px;
}

.author-attention-item {
  gap: 6px;
}

.author-attention-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.author-attention-action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
}

.author-attention-item-urgent {
  border-color: var(--ink);
  background: var(--paper);
}

.author-attention-item-watch {
  background: var(--wash);
}

.author-attention-label {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
}

.author-compare-card {
  gap: 6px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.author-danger-confirm {
  align-items: flex-start;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 12px;
}

.author-danger-confirm span {
  line-height: 1.5;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-family: var(--ui-font);
  font-weight: 700;
  padding: 11px 12px;
}

input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: var(--hairline);
  padding: 0;
  direction: ltr;
}

input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  -webkit-appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: var(--hairline);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.sentence-sheet {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 18;
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(360px, 50vh);
  overflow: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, calc(100% + 28px));
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background:
    linear-gradient(180deg, var(--raised), var(--paper-deep)),
    var(--raised);
  font-family: var(--ui-font);
  font-weight: 600;
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  box-shadow: 0 18px 46px var(--chrome-shadow);
  padding: 18px;
  transition: transform 220ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.sentence-sheet.is-open {
  transform: translate(-50%, 0);
}

.sentence-quote {
  margin: 0;
  border-left: 1px solid var(--accent);
  padding-left: 12px;
  font-family: var(--reader-font-family, var(--body-font));
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  font-kerning: normal;
}

.sentence-quote[lang="en"] {
  overflow-wrap: break-word;
  hyphens: auto;
  hyphenate-limit-chars: 8 3 3;
}

.sentence-quote[lang="ja"] {
  overflow-wrap: break-word;
  word-break: normal;
  line-break: strict;
}

.sentence-quote[lang="ko"] {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  width: min(440px, calc(100vw - 36px));
  min-height: 44px;
  transform: translate(-50%, 20px);
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font-family: var(--ui-font);
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  padding: 11px 14px;
  text-align: center;
  text-wrap: pretty;
  font-kerning: normal;
  box-shadow: 0 14px 38px var(--chrome-shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast[lang="en"] {
  overflow-wrap: break-word;
  hyphens: auto;
}

.toast[lang="ja"] {
  line-break: strict;
}

.toast[lang="ko"] {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.has-sentence-sheet-open .toast {
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + min(230px, 38vh));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .reader-topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .chapter-context-label {
    max-width: 180px;
    margin-left: auto;
    margin-right: auto;
  }

  .reader-bottombar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .reader-bottombar .plain-button {
    min-height: 34px;
    padding: 6px 4px;
    font-size: 12px;
    white-space: nowrap;
  }

  .reader-tap-zone {
    inset: 16% 12% 24%;
  }

  .drawer {
    width: 100vw;
    border-left: 0;
  }

  .work-item {
    min-height: 58px;
  }
}

@media (max-width: 480px) {
  :root {
    --reader-inline-padding: 24px;
    --reader-top-padding: clamp(58px, 8vh, 84px);
    --reader-bottom-padding: clamp(104px, 16vh, 148px);
  }

  .sentence-sheet {
    width: calc(100vw - 24px);
    max-height: min(420px, 58vh);
    gap: 12px;
    padding: 14px;
  }

  .sentence-sheet .button-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chapter-context-label {
    max-width: 140px;
  }

  .reader-content-inner {
    width: min(100%, calc(100vw - 72px));
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  :root {
    --reader-inline-padding: clamp(28px, 6vw, 64px);
    --reader-top-padding: clamp(36px, 8vh, 54px);
    --reader-bottom-padding: clamp(62px, 13vh, 92px);
  }

  .reader-bar {
    min-height: 50px;
  }

  .reader-topbar {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .reader-bottombar {
    padding-top: 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .reader-bottombar .plain-button {
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .reader-content h1 {
    margin-bottom: 1.7rem;
  }

  .quiet-hint {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (update: slow) {
  :root {
    --bar-bg: var(--paper);
    --shadow: transparent;
    --chrome-shadow: transparent;
    --button-wash: var(--wash);
  }

  .reader-content {
    scrollbar-width: none;
  }

  .reader-bar,
  .reading-progress span,
  .reader-notice.is-transient,
  .reader-return-notice.is-transient,
  .support-notice.is-transient,
  .sentence,
  .sentence-sheet,
  .drawer,
  .toast {
    transition: none !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #3f3f3b;
    --hairline: #9f9f98;
    --highlight-line: rgba(21, 21, 21, 0.62);
  }

  html[data-theme="dark"] {
    --muted: #d0cec6;
    --hairline: #77746c;
    --highlight-line: rgba(245, 244, 239, 0.7);
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  :root {
    --reader-inline-padding: clamp(28px, 5vw, 48px);
  }
}

@media (min-width: 1101px) {
  :root {
    --reader-inline-padding: clamp(36px, 5.2vw, 72px);
  }
}
