:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #777777;
  --line: #dddddd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background: #ffffff;
}

a { color: inherit; }

.library-shell {
  width: min(calc(100% - 40px), 720px);
  margin: 0 auto;
  padding: 54px 0 80px;
}

.library-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid #111111;
}

.library-header h1 {
  margin: 0;
  font-family: "KoPub Batang", "Noto Serif KR", Batang, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.sync-status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.sync-status.is-ready { color: #315d59; }
.sync-status.is-error { color: #9b3029; }

.book-selector {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.book-selector label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.book-selector select {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 10px;
  border: 1px solid #bbbbbb;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  background: #ffffff;
}

.book-card {
  padding: 48px 0 34px;
  border-bottom: 1px solid #111111;
}

.book-card-body { min-width: 0; }

.book-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.book-card h2 {
  margin: 0 0 6px;
  font-family: "KoPub Batang", "Noto Serif KR", Batang, serif;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.book-author {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.book-progress {
  max-width: 360px;
  margin-top: 32px;
}

.book-progress-track,
.episode-progress-track {
  display: block;
  overflow: hidden;
  height: 2px;
  background: #e5e5e5;
}

.book-progress-fill,
.episode-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: #111111;
}

.book-progress > span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.continue-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #111111;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: transparent;
}

.continue-button:hover,
.continue-button:focus-visible {
  border-bottom-color: transparent;
}

.episode-section { margin-top: 38px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #111111;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.section-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.episode-list { display: block; }

.episode-card {
  display: grid;
  grid-template-columns: 42px 1fr 44px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.episode-card:hover,
.episode-card:focus-visible { background: #f6f6f6; }

.episode-number {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.episode-copy { min-width: 0; }

.episode-title {
  display: block;
  overflow: hidden;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-status {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.episode-card.is-complete .episode-status {
  color: #111111;
  font-weight: 750;
}

@media (max-width: 520px) {
  .library-shell {
    width: min(calc(100% - 28px), 680px);
    padding-top: 32px;
  }

  .book-card {
    padding-top: 38px;
  }

  .book-card h2 { font-size: 32px; }
  .continue-button { margin-top: 12px; }
}
