:root {
  --paper: #f5efe3;
  --card: #fffcf6;
  --line: #e5dac7;
  --line-strong: #d3c4ab;
  --ink: #33291f;
  --muted: #86755f;
  --accent: #46705c;
  --accent-ink: #2f5242;
  --accent-soft: #e2ebe2;
  --star: #d39a35;
  --danger: #b0503b;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --sans: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.ic { display: block; flex: none; }

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(170px + env(safe-area-inset-bottom));
}

/* ---------- 공통 조각 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.brand { font-size: 25px; }
.tools { display: flex; gap: 4px; position: relative; }
.icon-btn {
  width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: rgba(70, 60, 40, 0.07); color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); padding: 8px 8px 8px 0; border: 0; background: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); white-space: nowrap;
}
.review-empty .btn { flex: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); border-color: #e3c1b6; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; }
.count { color: var(--muted); font-size: 14px; font-family: var(--sans); font-weight: 400; margin-left: 6px; }
.hint { color: var(--muted); font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; background: rgba(70, 60, 40, 0.07); color: var(--muted); white-space: nowrap;
}
.chip.reading { background: var(--accent-soft); color: var(--accent-ink); }
.chip.done { background: #f1e3c6; color: #7a5a1c; }
.chip.paused { background: #ece4da; color: #7b6a58; }
.chip.want { background: #e6e3ef; color: #5b5478; }

.stars { display: inline-flex; gap: 1px; color: var(--star); }
.stars .off { color: var(--line-strong); }
.stars svg { fill: currentColor; stroke-width: 1.2; }

/* ---------- 표지 ---------- */
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; overflow: hidden;
  background: var(--c, #d9cbb2); box-shadow: 0 1px 2px rgba(60, 40, 20, 0.18), inset 3px 0 0 rgba(0, 0, 0, 0.06);
}
.cover .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 12% 10%; font-family: var(--serif); color: #3a2f24; overflow: hidden;
}
.cover .ph span { font-size: clamp(11px, 2.6vw, 15px); line-height: 1.35; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.cover .ph small { font-family: var(--sans); font-size: 10px; opacity: 0.75; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.mini .ph span { font-size: 10px; }
.cover.mini .ph small { display: none; }

/* ---------- 잠금 ---------- */
.lock { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.lock-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.lock h1 { font-size: 28px; margin-top: 8px; }
.lock form { display: flex; gap: 8px; margin-top: 10px; width: min(340px, 100%); }
.lock input { flex: 1; min-width: 0; }
.lock .err { min-height: 1.6em; color: var(--danger); font-size: 14px; margin: 0; }

/* ---------- 입력 ---------- */
input[type="text"], input[type="password"], input[type="search"], input[type="date"], textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--card); outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70, 112, 92, 0.15); }
textarea { resize: vertical; line-height: 1.7; }
textarea.serif { font-family: var(--serif); font-size: 17px; }
label.field { display: block; margin-top: 16px; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 서재 ---------- */
.searchbar { margin-top: 6px; }
.today-quote {
  margin-top: 14px; padding: 20px 22px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); position: relative;
}
.today-quote .label { font-size: 13px; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.today-quote blockquote {
  margin: 8px 0 10px; font-family: var(--serif); font-size: 15.5px; line-height: 1.8; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;
}
.today-quote .src { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.today-quote .src a:hover { color: var(--ink); text-decoration: underline; }

.reading-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.reading-card {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.reading-card .info { display: flex; flex-direction: column; min-width: 0; }
.reading-card .t { font-family: var(--serif); font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reading-card .a { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading-card .m { font-size: 13px; color: var(--muted); margin-top: auto; }
.reading-card .quick { align-self: flex-start; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--accent); }

.filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; margin-top: 26px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 5px 13px; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters button svg { fill: currentColor; stroke-width: 1.2; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 18px 14px; }
.shelf a { display: block; min-width: 0; }
.shelf .t { margin-top: 7px; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf .stars { margin-top: 2px; }
.shelf.small { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 14px 10px; }

.empty { text-align: center; padding: 60px 10px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 20px; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

.fab {
  position: fixed; right: max(18px, calc(50vw - 362px)); bottom: calc(86px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 6px; height: 54px; padding: 0 22px 0 18px; border-radius: 999px;
  background: var(--accent); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(47, 82, 66, 0.3); font-size: 16px; z-index: 5;
}
.fab:hover { background: var(--accent-ink); }

.menu {
  position: absolute; right: 0; top: 46px; z-index: 10; min-width: 190px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(60, 40, 20, 0.16);
}
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-size: 15px; text-align: left; }
.menu button:hover, .menu a:hover { background: rgba(70, 60, 40, 0.06); }

.results .note-hit { display: block; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; }
.results .note-hit q { font-family: var(--serif); quotes: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.results .note-hit small { display: block; color: var(--muted); margin-top: 4px; }
mark { background: #f6df9c; color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- 책 ---------- */
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 20px; margin-top: 8px; align-items: start; }
.hero h1 { font-size: 23px; line-height: 1.4; word-break: keep-all; }
.hero .by { color: var(--muted); font-size: 15px; margin-top: 4px; }
.hero .dates { font-size: 14px; color: var(--muted); margin-top: 10px; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rate { display: flex; gap: 0; margin-top: 8px; margin-left: -6px; }
.rate button { border: 0; background: none; padding: 6px; color: var(--line-strong); }
.rate button.on { color: var(--star); }
.rate svg { fill: currentColor; stroke-width: 1.2; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.notes { display: flex; flex-direction: column; gap: 10px; }
.note { padding: 14px 18px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.note-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.note-meta .icon-btn { width: 34px; height: 34px; margin: -6px -10px -6px 0; }
.note blockquote { margin: 4px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.8; white-space: pre-line; }
.note .thought { margin: 4px 0 0; font-size: 15px; color: #5d4f40; white-space: pre-line; }
.note blockquote + .thought { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.note .thought::before { content: '내 생각'; display: block; font-size: 12px; color: var(--accent); margin-bottom: 2px; }
.page-badge { display: inline-block; min-width: 2.2em; padding: 0 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; text-align: center; margin-right: 6px; }

.note-form { padding: 16px; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); }
.note-form .row { margin-bottom: 10px; align-items: end; }
.note-form .row label { font-size: 13px; color: var(--muted); }
.note-form textarea { margin-bottom: 8px; }
.note-form .tip { font-size: 12.5px; color: var(--muted); margin: -2px 0 10px; display: flex; gap: 5px; align-items: flex-start; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

.review { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-line; line-height: 1.85; }
.review-empty { padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- 책 추가·고치기 ---------- */
.page-title { font-size: 22px; margin: 8px 0 4px; }
.find-row { display: flex; gap: 8px; margin-top: 14px; }
.find-row input { flex: 1; }
.found { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.found button {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; text-align: left; padding: 8px 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); align-items: center;
}
.found button:hover { border-color: var(--accent); }
.found .t { font-family: var(--serif); font-weight: 700; line-height: 1.35; }
.found .a { font-size: 13px; color: var(--muted); }
.cover-edit { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin-top: 18px; }
.cover-edit .btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 22px 0 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.save-bar { margin-top: 26px; display: flex; gap: 10px; }
.save-bar .btn.primary { flex: 1; }
.danger-zone { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }

/* ---------- 알림·확인 창 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 30; max-width: calc(100vw - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.overlay { position: fixed; inset: 0; background: rgba(40, 30, 20, 0.35); display: grid; place-items: center; z-index: 40; padding: 20px; }
.dialog { width: min(360px, 100%); background: var(--card); border-radius: 18px; padding: 22px 22px 16px; }
.dialog p { margin: 0 0 18px; line-height: 1.6; }
.dialog .form-actions { justify-content: flex-end; }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }

@media (min-width: 640px) {
  .hero { grid-template-columns: 150px 1fr; gap: 28px; }
  .hero h1 { font-size: 27px; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

/* ---------- 문장에 붙인 사진 ---------- */
.note-photo { display: block; width: 100%; margin: 10px 0 0; padding: 0; border: 0; background: #efe7d8; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.note-photo img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.note-photo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.note-photo-edit img { width: 100%; max-height: 260px; object-fit: contain; background: #efe7d8; border-radius: 10px; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(25, 20, 14, 0.92); display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 24px); object-fit: contain; border-radius: 6px; }
.lightbox .icon-btn { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; color: #fff; background: rgba(255, 255, 255, 0.12); }

/* ---------- 아래 탭 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: rgba(245, 239, 227, 0.95); border-top: 1px solid var(--line);
  padding: 4px 0 env(safe-area-inset-bottom); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tabbar .in { max-width: 520px; margin: 0 auto; display: flex; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 7px; font-size: 12px; color: var(--muted); }
.tabbar a[aria-current="page"] { color: var(--accent-ink); }
.tabbar a[aria-current="page"] .ic { stroke-width: 2.2; }

/* ---------- 밑줄 문장 모아보기 ---------- */
.brand .count { font-size: 15px; }
.quote-sort { margin: 22px 0 12px; }
a.qnote { display: block; color: inherit; }
a.qnote:hover { border-color: var(--line-strong); }
.qsrc { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 13px; color: var(--accent); }
.note-photo.small { cursor: inherit; }
.note-photo.small img { max-height: 220px; }
.group-head { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.group-head b { display: block; font-family: var(--serif); line-height: 1.35; }
.group-head small { color: var(--muted); font-size: 13px; }

/* ---------- 기록 ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile .tl { font-size: 13px; color: var(--muted); }
.tile .tv { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.2; }
.tile .tv small { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.tile .none { color: var(--line-strong); }
.tile .tn { font-size: 12px; color: var(--muted); line-height: 1.4; }
.bars {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; align-items: end; height: 190px;
  padding: 14px 8px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: relative;
}
.bars::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 26px; height: 1px; background: var(--line-strong); }
.bar-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; cursor: default; padding-bottom: 26px; }
.bar-col .bar { width: min(70%, 26px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-col .bar-val { font-size: 12px; color: var(--ink); margin-bottom: 3px; min-height: 1em; }
.bar-col .bar-m { position: absolute; bottom: 4px; font-size: 12px; color: var(--muted); }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--accent-ink); }
.bar-col .tip {
  position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); z-index: 3; width: max-content; max-width: 220px;
  background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.45; padding: 7px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.bar-col:nth-child(-n+3) .tip { left: 0; transform: none; }
.bar-col:nth-last-child(-n+3) .tip { left: auto; right: 0; transform: none; }
.bar-col:hover .tip, .bar-col:focus .tip { opacity: 1; }
.rank { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: r; }
.rank a { display: grid; grid-template-columns: 22px 40px 1fr; gap: 12px; align-items: center; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.rank li { counter-increment: r; }
.rank a::before { content: counter(r); font-family: var(--serif); font-weight: 700; color: var(--accent); text-align: center; }
.rank b { display: block; font-family: var(--serif); line-height: 1.35; }
.rank small { color: var(--muted); font-size: 13px; }
.done-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.done-list a { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.done-list .d { font-size: 13px; color: var(--muted); }
.done-list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.years { display: flex; flex-direction: column; gap: 8px; }
.yr { display: grid; grid-template-columns: 48px 1fr 44px; gap: 10px; align-items: center; font-size: 14px; }
.yr .y { color: var(--muted); }
.yr .track { height: 12px; background: rgba(70, 60, 40, 0.07); border-radius: 999px; overflow: hidden; }
.yr .track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.yr .n { text-align: right; }

/* ---------- 인증 카드 ---------- */
.card-preview { margin-top: 14px; }
.card-preview canvas { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(60, 40, 20, 0.12); }
.card-preview + .save-bar { max-width: 460px; margin-left: auto; margin-right: auto; }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; line-height: 1.6; cursor: pointer; }
.pick input { margin-top: 5px; accent-color: var(--accent); }
.pick:has(input:checked) { border-color: var(--accent); }

/* ---------- 한꺼번에 넣기 ---------- */
.note-adds { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.section-head:has(.note-adds) { align-items: center; }
.bulk-sum { margin: 0 0 10px; font-size: 15px; }
.bulk-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.bulk-list .note { padding: 10px 14px; background: var(--paper); }
.bulk-list .note blockquote { font-size: 16px; line-height: 1.7; }
.bulk-acts { display: flex; gap: 2px; margin-right: -8px; }
.bulk-acts .btn.small { min-height: 30px; padding: 0 9px; font-size: 13px; }
.page-badge.none { background: rgba(70, 60, 40, 0.07); color: var(--muted); }

/* ---------- 필사 책 ---------- */
.print-opts .opt { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; margin-bottom: 14px; }
.print-opts .opt > span { font-size: 14px; color: var(--muted); padding-top: 6px; }
.book-picks { display: flex; flex-direction: column; gap: 6px; }
.book-picks .row-btns { display: flex; gap: 4px; margin-left: -10px; }
.book-picks .pick small { color: var(--muted); font-size: 13px; margin-left: 4px; }
.print-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 16px; }
.sheets { display: flex; flex-direction: column; align-items: center; gap: 0; }
.sheet {
  width: 297mm; height: 210mm; padding: 14mm 0; box-sizing: border-box; position: relative; overflow: hidden;
  background: #fff; color: #2b2219; margin-bottom: 8mm; box-shadow: 0 2mm 8mm rgba(60, 40, 20, 0.16);
}
.sheet::before { content: ''; position: absolute; left: 148.5mm; top: 8mm; bottom: 8mm; border-left: 0.25mm dashed #d8ccb8; }
.prow { display: grid; grid-template-columns: 148.5mm 148.5mm; box-sizing: border-box; }
.prow .pl { padding: 0 10mm 0 14mm; overflow: hidden; }
.prow .pr { padding: 0 14mm 0 10mm; }
.lines > div { height: 8mm; border-bottom: 0.3mm solid #b9ad98; box-sizing: border-box; }
.pq .pp { font: 8.5pt var(--sans); color: #8a7b68; margin-bottom: 1mm; }
.pq .pt { font: 11pt/1.8 var(--serif); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.pq.big .pt { font-size: 13pt; line-height: 1.9; }
.pq .pth { font: 9pt/1.6 var(--sans); color: #6d5f4e; margin-top: 2.5mm; white-space: pre-line; }
.pq .pth b { color: var(--accent); font-weight: 400; margin-right: 1.5mm; }
.ph { border-bottom: 0.3mm solid #d3c4ab; padding-bottom: 1.5mm; display: flex; align-items: baseline; gap: 3mm; flex-wrap: wrap; }
.ph b { font: 700 12.5pt var(--serif); }
.ph span { font: 9pt var(--sans); color: #8a7b68; }
.pl .ph + .pq { margin-top: 5mm; }
.prow.is-head + .prow { margin-top: 0; }
.pcont { font: 9pt var(--sans); color: #a39580; padding-top: 2mm; }
.pno { position: absolute; left: 0; right: 0; bottom: 5mm; text-align: center; font: 8pt var(--sans); color: #a39580; }
.measure { position: absolute; left: -10000px; top: 0; width: 148.5mm; visibility: hidden; }
.measure > * { padding: 0 10mm 0 14mm; }

@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff; }
  body > :not(#app) { display: none !important; }
  #app { padding: 0; max-width: none; margin: 0; }
  .no-print, .tabbar, .fab, .measure { display: none !important; }
  .sheets { zoom: 1 !important; display: block; }
  .sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}

/* ---------- 오타 찾기 ---------- */
.head-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ai-box { margin: 14px 0 6px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.ai-box .hint { margin: 8px 0 0; font-size: 13.5px; }
.ai-box .err-text { margin: 8px 0 0; color: var(--danger); font-size: 14px; }
.typo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; font-size: 15px; }
.typo-list { display: flex; flex-direction: column; gap: 10px; }
.typo-card { padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.typo-src { display: block; font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.typo-row { padding: 8px 0; border-top: 1px dashed var(--line); }
.typo-src + .typo-row { border-top: 0; padding-top: 2px; }
.typo-row.done { opacity: 0.55; }
.typo-text { margin: 0; font-family: var(--serif); line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.typo-text del { color: var(--danger); text-decoration-thickness: 1.5px; background: #f7e4de; border-radius: 3px; padding: 0 2px; }
.typo-text ins { color: var(--accent-ink); text-decoration: none; background: var(--accent-soft); border-radius: 3px; padding: 0 3px; margin-left: 2px; font-weight: 700; }
.typo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.typo-acts { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.typo-acts .ok { color: var(--accent); display: inline-flex; align-items: center; gap: 3px; }
.typo-acts .muted { color: var(--muted); }
.typo-text .sp { display: inline-block; width: 0.5em; height: 0.9em; margin: 0 1px; border-bottom: 1.5px solid currentColor; vertical-align: -0.1em; }
.section-head .row-btns { display: flex; gap: 2px; margin-right: -10px; }
