/* 인쇄(PDF) 전용. index.html에서 media="print"로 불러오고, PDF를 만들 때(?print=1)는 화면에도 적용해 쪽 나눔을 미리 잰다 */
html.pm body { width: 188mm; margin: 0; }
@page { size: A4; margin: 12mm 11mm 14mm; @bottom-center { content: counter(page); font: 8.5pt 'Nanum Gothic', 'Malgun Gothic', Arial, sans-serif; color: #9a9384; } }
@page :first { @bottom-center { content: none; } }
.reading { font-size: 12pt; line-height: 1.85; }
.reading h3 { font-size: 14pt; }
.reading p, .reading li { orphans: 3; widows: 3; }
.rp-tocpage { break-after: page; min-height: 262mm; display: flex; flex-direction: column; margin: 0; }
.rp-tocpage .rp-toc { flex: 1; align-content: space-evenly; max-width: none; padding: 8px 6mm 0; }
.rp-tocpage .rp-toc li { font-size: 13pt; } .rp-tocpage .rp-toc li small { font-size: 9pt; }
.rp-prologue { break-after: page; margin: 0; }
.rp-prologue .pl-grid, .pl-chart, .pl-how { break-inside: avoid; }
.rp-toc li { break-inside: avoid; }
.reading .gloss { break-inside: avoid; }
:root { --fs-lg: 11pt; --fs-md: 10pt; --fs-sm: 9.5pt; --fs-xs: 8.5pt; --lh: 1.6; }
body { background: #fff; font-size: 10.5pt; }
.top, #entry, .no-print, #tip, .site-foot, .pos-panel, .guide-btn, #dict { display: none !important; }
main { max-width: none; padding: 0; }
#result { padding: 0; }
.card { box-shadow: none; break-inside: auto; padding: 14px 18px; margin-bottom: 10px; border-radius: 4px; }
/* 카드가 길어져서 통째로 넘기면 빈 쪽이 생긴다 → 카드는 이어서 쪼개고, 제목은 다음 내용과 붙여 둔다 */
.card > h2, .sub-h, .reading h3 { break-after: avoid; page-break-after: avoid; }
.story, .summary, .cy-wrap, .pairs, .level, .scale { break-inside: avoid; }
.card > h2, .sec-title { font-size: 14pt; margin-bottom: 10px; break-after: avoid; }
.hero, .chart, .dwrap, .osin, .why, .power, .pairs, .sangsin, .structs, .now-block, .summary > div,
.years10 > div, .luck, .special, .expert li, .pro h3, .pro p, .gyeok, .legend { break-inside: avoid; }
.hero { grid-template-columns: 150px 1fr; gap: 20px; }
.emblem { width: 150px; height: 195px; }
.em-char { font-size: 76px; }
.hero .image { font-size: 17pt; }
.tile { width: 64px; }
.tile .c { font-size: 30px; }
.chart > div { padding: 5px 2px; }
.two { gap: 10px; margin-bottom: 10px; }
.dwrap { grid-template-columns: 120px 1fr; gap: 12px; }
/* 대운: 한 줄에 모두 (넘쳐서 하나만 다음 줄로 가지 않게) */
.luck { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; overflow: visible; padding: 0 0 6px; }
.luck .p { width: auto; padding: 6px 0; }
.luck .gz > span { width: 34px; height: 38px; }
.luck .gz .hz { font-size: 16px; }
.luck .yr { font-size: 7.5pt; }
.years10 { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.years10 > div { padding: 6px; gap: 2px 6px; }
.rp-cover { break-before: page; break-after: page; min-height: 240mm; display: flex; flex-direction: column; justify-content: center; }
.reading h2.chapter { break-before: page; }
.year-card, .concept, .reading blockquote.recap { break-inside: avoid; }
.reading > :last-child { break-before: avoid; page-break-before: avoid; } /* 마지막 한 줄만 새 쪽에 남지 않게 */
.reading h2.chapter { border-top: 2px solid var(--ink); padding-top: 14px; margin-top: 0; }
.ch-fig { break-inside: avoid; }
.reading h2, .reading h3 { break-after: avoid; }
.reading-card:has(.reading:empty) { display: none; }
details.more > *:not(summary) { display: block; }
.term { border-bottom: 0; }
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* 카드는 쪽 안에 통째로. 한 쪽보다 길면 나뉘되, 쪽마다 테두리가 닫힌 모양으로 */
.card { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.card.keep { break-inside: avoid; }
.reading section.sub.keep, .sub-fig { break-inside: avoid; }
/* 장 끝의 한두 줄이 새 쪽으로 넘어가지 않게, 필요한 장만 조금 촘촘하게 (paginate가 붙인다) */
.reading .tight { font-size: 11.4pt; line-height: 1.75; }
.reading .tighter { font-size: 11pt; line-height: 1.68; }
.reading .tightest { font-size: 10.6pt; line-height: 1.62; }
.reading .lean .concept, .reading .concept.lean { display: none; }
.reading section.sub.tight, .reading section.sub.tighter { margin-top: 18px; }
.reading section.sub.tightest { margin-top: 12px; }
.reading blockquote.recap.tightest { padding: 12px 18px; margin-bottom: 12px; }
