/* ── 토큰 ─────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --font-sans: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  --font-serif: 'Noto Serif KR', 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', serif;
  --read-size: 19px;
  --read-font: var(--font-serif);

  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #eee9df;
  --ink: #1d1f1e;
  --ink-2: #474b49;
  --muted: #7a7d78;
  --line: #e2dccf;
  --accent: #2f6a55;
  --accent-ink: #ffffff;
  --accent-soft: #e1eee7;
  --warn: #b0532a;
  --warn-soft: #f7e6da;
  --mark: #f9eab8;
  --sun: #c2453a;
  --sat: #3b64b0;
  --danger: #b3322a;
  --danger-ink: #ffffff;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 4px 16px rgb(40 30 10 / 6%);

  --radius: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141619;
    --surface: #1c1f23;
    --surface-2: #262a2f;
    --ink: #ebe8e2;
    --ink-2: #c3c0ba;
    --muted: #8e939a;
    --line: #2f3439;
    --accent: #7cc4a6;
    --accent-ink: #0d1a14;
    --accent-soft: #1d3a2e;
    --warn: #e6a074;
    --warn-soft: #3b2a1f;
    --mark: #4a3e1a;
    --sun: #ea877e;
    --sat: #93b3ec;
    --danger: #f08178;
    --danger-ink: #2a0f0c;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
  }
}

/* ── 기본 ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t)) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
  outline: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

code {
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
}

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

.boot-msg {
  color: var(--muted);
  text-align: center;
  margin-top: 30vh;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 화면이 바뀔 때 스크린 리더를 위해 main으로 포커스를 옮기지만 테두리는 그리지 않는다. */
main:focus-visible {
  outline: none;
}

/* ── 하단 탭 ──────────────────────────────────────────── */
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.booting .tabbar {
  visibility: hidden;
}

.tabbar a {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.tabbar svg {
  width: 24px;
  height: 24px;
}

.tabbar a[aria-current] {
  color: var(--accent);
}

/* ── 머리말 ───────────────────────────────────────────── */
.page-head {
  padding: 12px 0 18px;
}

.page-head h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.month-head {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  text-align: center;
}

.lead {
  margin: -6px 0 18px;
  color: var(--ink-2);
}

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.08s ease, background-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-done {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: var(--danger-ink);
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.btn-lg {
  min-height: 56px;
  font-size: 17px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  color: var(--ink-2);
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn.danger {
  font-size: 16px;
  color: var(--muted);
}

.link {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.link.danger {
  color: var(--danger);
  margin-top: 12px;
}

/* ── 카드·블록 ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.card p {
  margin: 0 0 10px;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  text-decoration: none;
}

.card-link b,
.card-link small {
  display: block;
}

.card-link small {
  color: var(--muted);
}

.chev {
  color: var(--muted);
  font-size: 22px;
}

.block {
  margin-top: 28px;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--ink-2);
}

.block-title .link {
  margin-left: auto;
}

.badge {
  min-width: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 15px;
}

.empty {
  text-align: center;
  padding: 40px 12px;
}

.empty h2 {
  font-size: 20px;
  margin: 12px 0 8px;
}

.empty p {
  color: var(--ink-2);
  margin: 0 auto 20px;
  max-width: 34em;
}

.empty-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.more-link {
  display: block;
  padding: 12px 4px 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

/* ── 오늘 ─────────────────────────────────────────────── */
.today-card {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.today-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.today-card.is-done {
  background: var(--accent-soft);
  border-color: transparent;
}

.today-card.is-rest::before {
  background: var(--line);
}

.today-meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.today-ref {
  font-family: var(--font-serif);
  font-size: 25px;
  letter-spacing: -0.01em;
}

.today-sub {
  margin: 6px 0 18px;
  color: var(--ink-2);
}

.today-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.today-actions .btn {
  flex: 1 1 140px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.stat b {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat b small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 1px;
}

.stat > span {
  font-size: 13px;
  color: var(--muted);
}

/* ── 올해의 말씀 · 오늘의 통독 · 오늘의 말씀 ───────────── */
.year-verse {
  position: relative;
  margin: 2px 0 22px;
  padding: 16px 48px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--surface) 75%);
  text-align: center;
}

.yv-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.yv-text {
  margin: 8px 0 0;
  font-family: var(--read-font);
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;
}

.yv-text::before {
  content: '“';
}

.yv-text::after {
  content: '”';
}

.yv-ref {
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.yv-empty {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 14.5px;
}

/* 상자 오른쪽 위의 바꾸기 버튼 */
.yv-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 38px;
  height: 38px;
}

.yv-edit svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.today-label {
  margin-top: 0;
}

.daily-verse {
  position: relative;
  padding: 22px 20px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.daily-verse::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--sat);
}

.dv-text {
  margin: 0;
  font-family: var(--read-font);
  font-size: 19px;
  line-height: 1.75;
  word-break: keep-all;
}

.dv-text.is-loading {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--muted);
  padding-bottom: 8px;
}

.dv-ref {
  margin: 10px 0 0;
  font-weight: 700;
  color: var(--ink-2);
}

.dv-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 6px;
}

.dv-actions .link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
}

.dv-actions svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 읽기 계획이 없을 때: 오늘의 말씀 아래에서 계획 만들기를 권한다 */
.plan-cta {
  margin-top: 16px;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  text-align: center;
}

.plan-cta h2 {
  font-size: 17px;
}

.plan-cta p {
  margin: 6px 0 14px;
  color: var(--ink-2);
  font-size: 14.5px;
}

/* 올해의 말씀 정하기 창 */
.yv-dialog {
  width: min(94vw, 420px);
  max-height: 92dvh;
  overflow-y: auto;
}

.yv-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 4px;
}

.yv-suggest .chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}

.yv-pick {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.yv-pick legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.yv-pick select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.yv-nums {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.yv-nums input {
  width: 52px;
  height: 40px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  font: inherit;
}

.yv-nums .btn {
  margin-left: auto;
}

.yv-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--read-font);
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}

.yv-form .field span small {
  font-weight: 500;
  color: var(--muted);
}

.yv-clear {
  margin-right: auto;
  color: var(--danger);
}

/* 설정: 개발자에게 커피 보내기 */
.coffee-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.coffee-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
}

.coffee-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coffee-text p {
  margin: 4px 0 0;
}

.coffee-links,
.coffee-setup {
  grid-column: 1 / -1;
}

/* Buy Me a Coffee 버튼 모양 (다크 모드에서도 같은 색) */
.coffee-link.is-bmc {
  background: #ffdd00;
  color: #000;
  border: 1.5px solid #000;
  font-weight: 800;
}

.coffee-link.is-bmc:hover {
  background: #ffe740;
}

.coffee-setup {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
}

/* 누르면 자세히 보기 창이 열린다 */
button.stat {
  position: relative;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button.stat:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

button.stat:active {
  transform: scale(0.96);
}

.stat-more {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.progress {
  height: 8px;
  margin-top: 12px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.progress.is-hidden {
  display: none;
}

/* ── 날짜 목록 ────────────────────────────────────────── */
.day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 10px;
}

.day-row + .day-row {
  border-top: 1px solid var(--line);
}

.day-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px 12px 14px;
  text-decoration: none;
}

.day-date {
  flex: none;
  width: 32px;
  text-align: center;
  line-height: 1.15;
}

.day-date b {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.day-date small {
  font-size: 12px;
  color: var(--muted);
}

.day-date.sun small {
  color: var(--sun);
}

.day-date.sat small {
  color: var(--sat);
}

.day-ref {
  flex: 1;
  min-width: 0;
}

.day-min {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.day-row.is-rest .day-ref {
  color: var(--muted);
}

.day-row.is-read .day-ref {
  color: var(--muted);
}

.day-row.is-missed .day-date b {
  color: var(--warn);
}

.day-row.is-today {
  background: var(--accent-soft);
}

/* 여러 달에 걸친 목록에서 달이 바뀌는 곳 */
.day-sep {
  padding: 6px 14px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check svg {
  width: 20px;
  height: 20px;
  stroke-width: 3;
}

.check:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.check.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ── 달력 ─────────────────────────────────────────────── */
.plan-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 15px;
}

.plan-summary span {
  color: var(--ink-2);
}

.cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-week span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0 6px;
}

.cal-week span:first-child {
  color: var(--sun);
}

.cal-week span:last-child {
  color: var(--sat);
}

.cal-cell {
  min-height: 64px;
  padding: 6px 4px;
  border-radius: 10px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg);
  border: 2px solid transparent;
}

.cal-cell b {
  font-size: 14px;
  padding-left: 2px;
  font-variant-numeric: tabular-nums;
}

.cal-cell.sun b {
  color: var(--sun);
}

.cal-cell.sat b {
  color: var(--sat);
}

.cal-cell small {
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.cal-cell.is-blank {
  background: transparent;
}

.cal-cell.is-rest {
  background: transparent;
  opacity: 0.6;
}

/* 이 날짜에는 계획이 없다 (기간을 정한 계획이 달 중간에 시작하거나 끝날 때) */
.cal-cell.is-off {
  background: transparent;
}

.cal-cell.is-off b {
  color: var(--muted);
}

.cal-cell.is-read {
  background: var(--accent);
}

.cal-cell.is-read b,
.cal-cell.is-read small {
  color: var(--accent-ink);
}

.cal-cell.is-missed {
  background: var(--warn-soft);
}

.cal-cell.is-today {
  border-color: var(--accent);
}

/* ── 새 계획 ──────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
}

.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.book + .book {
  border-top: 1px solid var(--line);
}

.book-row {
  display: flex;
  align-items: center;
}

.book-check {
  flex: none;
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
}

.book-check::before {
  content: '';
  position: absolute;
  inset: 13px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.book-check.all::before,
.book-check.some::before {
  border-color: var(--accent);
  background: var(--accent);
}

.book-check.all::after,
.book-check.some::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
}

.book-check.all::after {
  width: 10px;
  height: 5px;
  border: solid var(--accent-ink);
  border-width: 0 0 2.5px 2.5px;
  transform: translate(-50%, -70%) rotate(-45deg);
}

.book-check.some::after {
  width: 10px;
  height: 2.5px;
  background: var(--accent-ink);
  transform: translate(-50%, -50%);
}

.book-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px 0 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.book-name span:first-child {
  flex: 1;
}

.book-name small {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.book.has-sel .book-name small {
  color: var(--accent);
  font-weight: 700;
}

.book-name .chev {
  font-size: 13px;
  transition: transform 0.15s ease;
}

.book.is-open .book-name .chev {
  transform: rotate(180deg);
}

.chapter-panel {
  padding: 4px 12px 14px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  padding-top: 10px;
}

.ch {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.ch.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.range-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.range-row input {
  width: 64px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
}

.option input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.option small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.summary-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgb(0 0 0 / 12%);
}

.summary-text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
}

.summary-bar .btn-primary {
  min-width: 96px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* ── 본문 ─────────────────────────────────────────────── */
.reader-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: calc(-12px - var(--safe-t)) -16px 0;
  padding: calc(6px + var(--safe-t)) 8px 6px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.reader-title {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.reader-title small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.reader-title b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-ctl {
  display: flex;
}

.font-ctl .icon-btn {
  font-size: 16px;
  font-weight: 700;
}

.font-ctl sup {
  font-size: 11px;
}

.scripture {
  font-family: var(--read-font);
  font-size: var(--read-size);
  line-height: 1.85;
  padding-top: 8px;
}

.scripture .loading {
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 40px 0;
  text-align: center;
}

.chapter {
  padding: 18px 0 8px;
}

.chapter + .chapter {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.chapter-title {
  font-family: var(--font-sans);
  font-size: 1.2em;
  margin-bottom: 0.4em;
  letter-spacing: -0.01em;
}

.scripture .section {
  font-family: var(--font-sans);
  font-size: 0.82em;
  color: var(--accent);
  margin: 1.5em 0 0.3em;
}

.psalm-title {
  margin: 0.3em 0;
  font-size: 0.85em;
  color: var(--muted);
  font-style: italic;
}

.scripture p.prose,
.scripture p.poetry {
  margin: 0 0 0.6em;
}

.poetry .verse {
  display: block;
  padding-left: 1.6em;
  text-indent: -1.6em;
  margin-bottom: 0.35em;
}

.vn {
  font-family: var(--font-sans);
  font-size: 0.58em;
  font-weight: 700;
  color: var(--accent);
  vertical-align: 0.6em;
  line-height: 0;
  margin-right: 0.25em;
  font-variant-numeric: tabular-nums;
}

.poetry .vn {
  display: inline-block;
  width: 1.6em;
  margin-right: 0;
  text-indent: 0;
}

.notes {
  margin-top: 1em;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.notes summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 0;
}

.notes ol {
  margin: 6px 0 0;
  padding-left: 0;
  list-style: none;
}

.notes li {
  margin-bottom: 4px;
}

.notes b {
  color: var(--accent);
  margin-right: 4px;
}

.reader-foot {
  margin-top: 28px;
}

.done-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: var(--accent-soft);
}

.done-box > span:nth-child(2) {
  flex: 1;
}

.done-box b,
.done-box small {
  display: block;
}

.done-box small {
  color: var(--ink-2);
}

.done-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.done-mark svg {
  width: 22px;
  height: 22px;
  stroke-width: 3;
}

.day-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.day-nav a {
  padding: 10px 6px;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
}

.error {
  color: var(--danger);
  font-family: var(--font-sans);
  font-size: 16px;
}

/* ── 설정 ─────────────────────────────────────────────── */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.field-row + .field-row {
  border-top: 1px solid var(--line);
}

.field-row input[type='range'] {
  flex: 1;
  max-width: 220px;
  accent-color: var(--accent);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
}

.segmented button {
  min-width: 64px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 600;
  color: var(--muted);
}

.segmented button[aria-checked='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sample {
  margin: 12px 0 0 !important;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  font-family: var(--read-font);
  font-size: var(--read-size);
  line-height: 1.8;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row.is-center {
  justify-content: center;
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.plan-list li {
  display: flex;
  align-items: center;
  padding-right: 6px;
}

.plan-list li + li {
  border-top: 1px solid var(--line);
}

.plan-list a {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: baseline;
  padding: 12px 8px 12px 14px;
  text-decoration: none;
}

.plan-list a b {
  word-break: keep-all;
}

/* 첫 줄: 기간 · 읽은 날, 둘째 줄: 계획 이름 */
.plan-list a span {
  grid-column: 1 / -1;
  color: var(--ink-2);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-list small {
  color: var(--muted);
}

.about {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ── 계정 ─────────────────────────────────────────────── */
.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.account-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 45%;
  margin-top: 4px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
}

.account-chip > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip .chev {
  font-size: 11px;
}

.account-dialog {
  width: min(92vw, 420px);
}

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

.account-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.account-item .avatar {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.account-item.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.account-text b,
.account-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text small {
  color: var(--muted);
  font-size: 13px;
}

.account-text small.is-read {
  color: var(--accent);
  font-weight: 600;
}

.account-text small.is-todo {
  color: var(--ink-2);
}

.account-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.account-check svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.account-new {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.account-new input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.account-new .btn {
  min-height: 40px;
}

.account-manage {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.account-manage li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px 12px;
}

.account-manage li + li {
  border-top: 1px solid var(--line);
}

.account-name {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
}

.account-name:hover,
.account-name:focus {
  border-color: var(--line);
  background: var(--bg);
}

.tag {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.small {
  font-size: 14px;
  margin: 0 0 10px;
}

/* ── 절 선택·저장 ─────────────────────────────────────── */
.scripture .verse {
  cursor: pointer;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 0.15s ease;
}

.scripture .verse:focus-visible {
  outline-offset: 0;
}

.scripture .verse.is-saved {
  background: var(--mark);
}

.scripture .verse.is-selected {
  background: var(--accent-soft);
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 0.3em;
}

.vcount {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: 0.2em;
  font-family: var(--font-sans);
  font-size: 0.6em;
  font-weight: 700;
  color: var(--warn);
  vertical-align: 0.35em;
  line-height: 1;
}

.vcount:empty {
  display: none;
}

.vcount svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  stroke-width: 0;
}

.reader-hint {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.reader-hint a {
  color: var(--accent);
  font-weight: 700;
}

.select-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  z-index: 30;
  width: min(calc(100% - 24px), 560px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
}

.select-bar[hidden] {
  display: none;
}

.select-count {
  flex: 1;
}

.select-bar .btn svg {
  width: 18px;
  height: 18px;
}

/* ── 저장한 구절 ──────────────────────────────────────── */
.sort-tabs {
  display: flex;
  margin-bottom: 14px;
}

.sort-tabs button {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.saved-item {
  padding: 14px 16px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.saved-ref {
  color: var(--accent);
}

.times {
  flex: none;
  min-width: 42px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.times.is-many {
  background: var(--mark);
  color: var(--warn);
}

.saved-text {
  margin: 8px 0;
  font-family: var(--read-font);
  font-size: calc(var(--read-size) * 0.92);
  line-height: 1.75;
}

.saved-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.saved-foot summary {
  cursor: pointer;
  padding: 4px 0;
}

.saved-foot ol {
  margin: 4px 0;
  padding-left: 18px;
}

.saved-foot .link {
  margin-top: 0;
  font-size: 13px;
}

.saved-actions {
  flex: none;
  display: flex;
  gap: 14px;
}

.saved-actions .link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.saved-actions svg {
  width: 15px;
  height: 15px;
}

/* 선택 바가 떠 있으면 토스트가 바를 가리지 않도록 그 위에 띄운다. */
body:has(.select-bar:not([hidden])) .toast {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px);
}

.select-bar .select-clear {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

/* ── 병렬 읽기 ────────────────────────────────────────── */
.mode-tabs {
  display: flex;
}

.mode-tabs button {
  flex: 1;
  min-width: 0;
  padding: 0 4px;
}

.mode-help {
  margin: 8px 2px 0;
  color: var(--ink-2);
  font-size: 14px;
}

.mode-help + .notice {
  margin: 10px 0 0;
}

/* 읽는 방식 고르기: 이름·설명과, 기간 동안 어떻게 읽어 나가는지 보여 주는 작은 그림 */
.mode-cards {
  display: grid;
  gap: 8px;
}

.mode-cards + .notice {
  margin: 10px 0 0;
}

.mode-card {
  display: grid;
  grid-template-columns: auto 1fr 92px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 14px 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mode-card:hover {
  border-color: var(--accent);
}

.mode-card[aria-checked='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.mode-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
}

.mode-card[aria-checked='true'] .mode-radio {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 42%, var(--surface) 46%);
}

.mode-text b {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.mode-text small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}

/* 줄 하나가 날마다 읽는 한 군데, 줄 안의 칸은 첫날부터 차례로 읽는 책 */
.mode-art {
  display: grid;
  gap: 3px;
}

.lane {
  display: flex;
  gap: 2px;
  height: 15px;
}

.lane i {
  flex: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
}

.lane .k0 { background: #2f6a55; }
.lane .k1 { background: #3b64b0; }
.lane .k2 { background: #b0532a; }
.lane .k3 { background: #7a4fa3; }
.lane .k4 { background: #a3476b; }
.lane .k5 { background: #2f7f8f; }
.lane .k6 { background: #8a6d1f; }

.mode-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  font-size: 9px;
  color: var(--muted);
}

.mode-axis span:last-child::before {
  content: '→ ';
}

@media (max-width: 360px) {
  .mode-card {
    grid-template-columns: auto 1fr 78px;
    gap: 10px;
  }
}

/* ── 그룹으로 읽기 ────────────────────────────────────── */
.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.group-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.group-list li.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.group-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
}

.group-num {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 14px;
}

.is-active .group-num {
  background: var(--accent);
  color: var(--accent-ink);
}

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

.group-text b,
.group-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-text small {
  color: var(--muted);
  font-size: 13px;
}

/* 책 목록: 다른 그룹에 든 장이 있는 책 */
.group-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

/* 장 목록: 다른 그룹에 든 장 (누르면 지금 그룹으로 옮긴다) */
.ch.in-other {
  background: var(--surface-2);
  border-style: dashed;
  color: var(--muted);
}

/* ── 기간 ─────────────────────────────────────────────── */
.period-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.period-fields .field {
  margin-bottom: 0;
}

.period-fields input {
  min-width: 0;
  padding: 0 10px;
  -webkit-appearance: none;
  appearance: none;
}

#period-lengths .chips {
  margin-top: 12px;
}

.part-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.part-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.part-list li + li {
  border-top: 1px dashed var(--line);
}

.part-list a {
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

.part-list b {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.35;
}

.part-list small {
  color: var(--muted);
  font-size: 13px;
}

.part-list li.is-read b {
  color: var(--muted);
}

.today-card .part-list + .today-sub {
  margin-top: 10px;
}

.book-progress {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.book-progress li {
  display: grid;
  grid-template-columns: minmax(5.5em, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.bp-name {
  font-weight: 700;
}

.bp-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.bp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bp-count {
  color: var(--ink-2);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.book-progress li.is-done .bp-count {
  color: var(--accent);
  font-weight: 700;
}

.check.partial {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.partial-note {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.cal-cell.is-partial {
  background: var(--accent-soft);
}

.ref-line {
  display: block;
}

.track-summary {
  list-style: none;
  margin: 0 0 16px;
  padding: 4px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.track-summary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
}

.track-summary li + li {
  border-top: 1px solid var(--line);
}

.track-summary span {
  color: var(--ink-2);
}

.track {
  scroll-margin-top: 72px;
}

.track + .track {
  margin-top: 28px;
  border-top: 6px solid var(--surface-2);
}

.track-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 14px 0 0;
  font-family: var(--font-sans);
}

.track-head b {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
}

.track-head span {
  color: var(--muted);
  font-size: 14px;
}

.track-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 15px;
}

.track-foot:empty {
  display: none;
}

.track-done {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 700;
}

.track-done svg {
  width: 20px;
  height: 20px;
  stroke-width: 3;
}

/* ── 밀린 분량 다시 나누기 ────────────────────────────── */
.rebalance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-soft);
}

.rebalance p {
  flex: 1 1 200px;
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.day-row.is-moved .day-ref {
  color: var(--muted);
  font-style: italic;
}

.cal-cell.is-moved {
  background: transparent;
  border: 2px dashed var(--line);
  opacity: 1;
}

.cal-cell.is-moved small {
  color: var(--muted);
}

/* ── 묵상 메모 ────────────────────────────────────────── */
.memo-box {
  margin-top: 24px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.memo-box label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.memo-box small {
  color: var(--muted);
  font-size: 12px;
}

.memo-box textarea,
.verse-memo-form textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}

.verse-memo {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  font-size: 15px;
  white-space: pre-wrap;
}

.verse-memo-form {
  margin: 0 0 8px;
}

.verse-memo-form .button-row {
  margin-top: 8px;
}

.note-kind {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.note-passage {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.note-text {
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.note-item .saved-foot .link {
  text-decoration: none;
}

/* ── 구절 탭 하위 탭 ──────────────────────────────────── */
.subtabs {
  display: flex;
  gap: 4px;
  margin: -6px 0 16px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}

.subtabs a {
  flex: 1;
  padding: 8px 4px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.subtabs a[aria-current] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* ── 말씀 검색 ────────────────────────────────────────── */
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-box input {
  flex: 1 1 200px;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
}

.search-box select {
  flex: 1 1 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.search-status {
  margin: 14px 2px 10px;
  color: var(--ink-2);
  font-size: 15px;
}

.search-status small {
  color: var(--muted);
}

.search-empty {
  margin: 20px 2px;
}

mark {
  padding: 0 1px;
  border-radius: 3px;
  background: var(--mark);
  color: inherit;
  font-weight: 700;
}

.search-context {
  margin: 8px 0;
  font-family: var(--read-font);
  font-size: calc(var(--read-size) * 0.85);
  line-height: 1.7;
  color: var(--ink-2);
}

.search-context p {
  margin: 0 0 4px;
}

.search-context p.is-hit {
  color: var(--ink);
}

/* ── 소리로 듣기 ──────────────────────────────────────── */
svg.is-filled {
  fill: currentColor;
  stroke: none;
}

.listen-btn svg {
  width: 24px;
  height: 24px;
}

.tts-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  z-index: 31;
  width: min(calc(100% - 24px), 560px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 6px 6px 4px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
}

.tts-bar[hidden] {
  display: none;
}

.tts-bar .icon-btn {
  width: 40px;
  height: 40px;
}

.tts-bar .icon-btn svg {
  width: 20px;
  height: 20px;
}

.tts-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.tts-play svg {
  width: 22px;
  height: 22px;
}

.tts-play span {
  display: grid;
  place-items: center;
}

.tts-play .when-playing,
.tts-play.is-playing .when-paused {
  display: none;
}

.tts-play.is-playing .when-playing {
  display: grid;
}

.tts-now {
  flex: 1;
  min-width: 0;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-rate {
  flex: none;
  min-width: 48px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tts-bar .tts-close {
  font-size: 16px;
}

/* 플레이어 바가 떠 있으면 선택 바와 토스트를 그 위로 올린다. */
body:has(.tts-bar:not([hidden])) .select-bar {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 80px);
}

body:has(.tts-bar:not([hidden])) .toast {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px);
}

body:has(.tts-bar:not([hidden])):has(.select-bar:not([hidden])) .toast {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 150px);
}

/* 바에 가려지지 않게 본문 아래 여백을 늘린다. */
body:has(.tts-bar:not([hidden])) main {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 100px);
}

.scripture .verse.is-speaking {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.select {
  max-width: 60%;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.tts-note {
  margin-top: 10px !important;
}

/* ── 설정: 사용설명서 ─────────────────────────────────── */
.manual-link {
  margin: -4px 0 0;
  justify-content: flex-start;
}

.manual-link > span:nth-child(2) {
  flex: 1;
}

.manual-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.manual-icon svg {
  width: 22px;
  height: 22px;
}

/* ── 읽던 계획을 고칠 때: 지난 날짜 분량이 어떻게 되는지 ──── */
.notice-sub {
  display: block;
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.carry-notice p {
  margin: 0;
}

.is-preview .day-row.is-past .day-date {
  opacity: 0.55;
}

.carry-notice ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
}

.carry-notice li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.carry {
  flex: none;
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: 1px;
}

.carry-notice .carry {
  margin-left: 0;
}

.carry.is-kept {
  background: var(--accent-soft);
  color: var(--accent);
}

.carry.is-missed {
  background: var(--warn);
  color: var(--surface);
}

.carry.is-lost {
  background: var(--surface-2);
  color: var(--muted);
}

/* ── 진행 상황 자세히 보기 (아래에서 올라오는 창) ───────── */
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 860px);
  max-height: min(92dvh, 860px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 -12px 40px rgb(0 0 0 / 22%);
  overflow: hidden;
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.34s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.sheet::backdrop {
  background: rgb(10 14 12 / 45%);
  animation: fade-in 0.25s ease;
}

.sheet.is-closing {
  animation: sheet-out 0.2s ease-in forwards;
}

.sheet.is-closing::backdrop {
  animation: fade-out 0.2s ease-in forwards;
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

/* 넓은 화면에서는 가운데 뜨는 창 */
@media (min-width: 640px) {
  .sheet {
    margin: auto;
    border-radius: 24px;
  }

  .sheet[open] {
    animation-name: sheet-pop;
  }

  .sheet.is-closing {
    animation-name: fade-out;
  }
}

@keyframes sheet-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

.sheet-head {
  flex: none;
  padding: 8px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  touch-action: none;
}

.sheet-grip {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 3px;
  background: var(--line);
}

.sheet-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sheet-title-row .eyebrow {
  margin: 0;
}

.sheet-title-row h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.sheet-title-row .icon-btn {
  flex: none;
  width: 38px;
  height: 38px;
  margin: -2px -6px 0 0;
  font-size: 18px;
}

.sheet-tabs {
  display: flex;
  margin-top: 12px;
}

.sheet-tabs button {
  flex: 1;
  min-width: 0;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px calc(28px + var(--safe-b));
}

.sheet-hero {
  text-align: center;
  padding-bottom: 16px;
}

.hero-num {
  margin: 0;
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-num small {
  margin-left: 2px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
}

.hero-label {
  margin: 8px 0 0;
  font-weight: 700;
  color: var(--ink-2);
}

.hero-sub {
  margin: 4px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}

.sheet-sub {
  margin: 24px 0 10px;
  font-size: 15px;
  color: var(--ink-2);
}

.sheet-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.sheet-body .button-row {
  margin-top: 16px;
}

/* 범례 */
.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.mini-cal + .legend {
  margin: 12px 0 0;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* 날짜 칸 달력 */
.mini-cal {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mc-week,
.mc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.mc-week {
  margin-bottom: 6px;
}

.mc-week span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.mc-week span:first-child {
  color: var(--sun);
}

.mc-week span:last-child {
  color: var(--sat);
}

.mc-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

a.mc-cell:active {
  transform: scale(0.92);
}

.mc-month {
  position: absolute;
  top: 1px;
  left: 0;
  right: 0;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  opacity: 0.85;
}

.mc-cell.is-blank {
  visibility: hidden;
}

.mc-cell.is-read,
.swatch.is-read {
  background: var(--accent);
  color: var(--accent-ink);
}

.mc-cell.is-missed,
.swatch.is-missed {
  background: var(--warn-soft);
  color: var(--warn);
}

.swatch.is-missed {
  box-shadow: inset 0 0 0 1.5px var(--warn);
}

/* 여러 권 중 일부만 읽은 날은 반만 칠한다 */
.mini-cal,
.legend {
  --half-read: color-mix(in srgb, var(--accent) 42%, var(--surface));
}

.mc-cell.is-partial {
  background: linear-gradient(135deg, var(--half-read) 50%, var(--surface-2) 50%);
}

.mc-cell.is-missed.is-partial,
.swatch.is-partial {
  background: linear-gradient(135deg, var(--half-read) 50%, var(--warn-soft) 50%);
}

.mc-cell.is-upcoming,
.mc-cell.is-future {
  color: var(--muted);
}

.swatch.is-upcoming {
  background: var(--surface-2);
}

.mc-cell.is-today {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  font-weight: 800;
}

.mc-cell.is-read.is-today {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.mc-cell.is-rest,
.mc-cell.is-moved,
.swatch.is-rest {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--muted);
}

.mc-cell.is-moved {
  box-shadow: inset 0 0 0 1.5px var(--warn-soft);
}

.mc-cell.is-off {
  background: transparent;
  color: var(--line);
}

.mc-cell.is-future {
  background: transparent;
}

.mini-cal.is-streak .mc-cell {
  font-size: 13px;
  border-radius: 50%;
}

/* 연속 읽기 */
.flame {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.flame svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.flame .flame-core {
  fill: var(--surface);
  opacity: 0.55;
}

.streak-hero.is-on .flame {
  background: var(--warn-soft);
  color: var(--warn);
  animation: flame-glow 2.4s ease-in-out infinite;
}

@keyframes flame-glow {
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--warn-soft) 55%, transparent);
  }
}

.sheet-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sheet-card {
  padding: 12px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.sheet-card b {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sheet-card b small {
  margin-left: 1px;
  font-size: 12px;
  color: var(--muted);
}

.sheet-card span {
  font-size: 12.5px;
  color: var(--muted);
}

.milestone {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.milestone-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink-2);
}

.milestone-top b {
  color: var(--warn);
}

.milestone-bar,
.pace-bar {
  position: relative;
  height: 8px;
  margin-top: 8px;
  border-radius: 4px;
  background: var(--surface-2);
}

.milestone-bar span,
.pace-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.milestone-bar span {
  background: var(--warn);
}

/* 진행 */
.ring {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 11;
}

.ring-track {
  stroke: var(--surface-2);
}

.ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.ring-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-text b {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ring-text b small {
  font-size: 18px;
  color: var(--muted);
}

.ring-text span {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.pace {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pace-text {
  margin: 0;
  font-weight: 700;
}

.pace.is-ahead .pace-text,
.pace.is-done .pace-text {
  color: var(--accent);
}

.pace.is-behind .pace-text {
  color: var(--warn);
}

.pace-bar {
  height: 10px;
  margin-top: 12px;
}

.pace-bar span {
  background: var(--accent);
}

/* 오늘까지 읽을 예정인 곳 */
.pace-bar i {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--ink);
}

.pace-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 0;
}

.facts div {
  padding: 10px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.facts dt {
  font-size: 12.5px;
  color: var(--muted);
}

.facts dd {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}

.facts dd small {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .sheet[open],
  .sheet::backdrop,
  .streak-hero.is-on .flame {
    animation: none;
  }
}

/* ── 대화상자·토스트 ──────────────────────────────────── */
.dialog {
  width: min(92vw, 380px);
  padding: 22px 20px 16px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgb(0 0 0 / 30%);
}

.dialog::backdrop {
  background: rgb(0 0 0 / 40%);
}

.dialog h2 {
  font-size: 19px;
}

.dialog p {
  margin: 10px 0 0;
  color: var(--ink-2);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
  z-index: 50;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
