/* 내지 템플릿 서식의 근사 재현.
   수치 근거(템플릿 header.xml): 장 20pt KoPub돋움 Bold / 절 15pt KoPub돋움 Bold(위 25pt·아래 15pt)
   / 본문 12pt KoPub바탕 Light / 표 11pt. 페이지 여백은 pagePr(HWPUNIT/7200inch). */
@font-face { font-family: 'KoPub Dotum'; src: url("fonts/KoPub_Dotum_Light.36de70c0b6e9.ttf") format('truetype');
  font-weight: 300; }
@font-face { font-family: 'KoPub Dotum'; src: url("fonts/KoPub_Dotum_Medium.f0e25675ed69.ttf") format('truetype');
  font-weight: 500; }
@font-face { font-family: 'KoPub Dotum'; src: url("fonts/KoPub_Dotum_Bold.17d60bb35414.ttf") format('truetype');
  font-weight: 700; }
@font-face { font-family: 'KoPub Batang'; src: url("fonts/KoPub_Batang_Light.ce56dc2c9816.ttf") format('truetype');
  font-weight: 300; }
@font-face { font-family: 'KoPub Batang'; src: url("fonts/KoPub_Batang_Medium.0875f7a6aec6.ttf") format('truetype');
  font-weight: 500; }
@font-face { font-family: 'KoPub Batang'; src: url("fonts/KoPub_Batang_Bold.1b531cb2e7f9.ttf") format('truetype');
  font-weight: 700; }

.preview-layout { display: flex; gap: 20px; max-width: 1200px; margin: 20px auto; padding: 0 16px;
  align-items: flex-start; }
/* 고정 헤더(약 48px) 아래에 붙고, 챕터가 많으면 사이드바 안에서 자체 스크롤 */
.chapter-nav { flex: 0 0 220px; background: #fff; border: 1px solid #dde3ec; border-radius: 8px;
  padding: 14px 16px; position: sticky; top: 64px;
  max-height: calc(100vh - 80px); overflow-y: auto; }
.chapter-nav h3 { margin: 0 0 8px; font-size: 14px; }
.chapter-nav ul { list-style: none; margin: 0; padding: 0; }
.chapter-nav li { margin: 4px 0; font-size: 13px; }
.chapter-nav li.current a { font-weight: 700; color: #1c3f77; }
.chapter-nav a { color: #345; text-decoration: none; }
.preview-main { flex: 1; min-width: 0; }
/* 고정 헤더 아래에 붙어서 스크롤해도 현재 챕터·버튼이 보인다 */
.preview-toolbar { display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid #dde3ec; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px;
  position: sticky; top: 56px; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.preview-toolbar .spacer { flex: 1; }
.preview-toolbar form { margin: 0; }
.preview-warnings { background: #fdf3d8; border: 1px solid #e3c25e; border-radius: 6px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.preview-note { color: #778; font-size: 12px; margin: 0 0 12px; }

/* A4 시트: 여백 top 11055 / left·right 9921 / bottom 9637 HWPUNIT ≈ 39/35/34mm */
.page { width: 210mm; max-width: 100%; margin: 0 auto; background: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,.18); padding: 39mm 35mm 34mm;
  font-family: 'KoPub Batang', serif; font-weight: 300; font-size: 12pt; line-height: 1.8;
  color: #111; overflow-x: auto; }

.page .st-jang { font-family: 'KoPub Dotum', sans-serif; font-weight: 700; font-size: 20pt;
  margin: 0 0 24pt; line-height: 1.4; }
.page .st-jeol { font-family: 'KoPub Dotum', sans-serif; font-weight: 700; font-size: 15pt;
  margin: 25pt 0 15pt; line-height: 1.4; }
.page .st-h3 { font-family: 'KoPub Dotum', sans-serif; font-weight: 700; font-size: 13pt;
  margin: 18pt 0 10pt; }
.page .st-h4 { font-family: 'KoPub Dotum', sans-serif; font-weight: 500; font-size: 12pt;
  margin: 14pt 0 8pt; }
.page .st-h5 { font-family: 'KoPub Dotum', sans-serif; font-weight: 500; font-size: 12pt;
  margin: 12pt 0 6pt; }
.page .st-body { margin: 0 0 8pt; text-align: justify; text-indent: 1em; }
.page .st-bullets { margin: 0 0 8pt; padding-left: 1.4em; }
.page .st-bullet { margin: 2pt 0; }
.page .st-ref { margin: 0 0 6pt; padding-left: 2em; text-indent: -2em; font-size: 11pt; }
/* 내지 표 서식: 맨 위·아래 굵은 선, 내부 가는 선, 좌우 바깥선 없음, 머리행 #E5E5E5 */
.page .st-tbl-title { text-align: center; font-family: 'KoPub Dotum', sans-serif;
  font-weight: 700; font-size: 12pt; margin: 12pt 0 4pt; text-indent: 0; }
.page .st-fig-title { text-align: center; font-family: 'KoPub Dotum', sans-serif;
  font-weight: 500; font-size: 11pt; margin: 6pt 0 12pt; text-indent: 0; }
.page .st-table { border-collapse: collapse; width: 100%; margin: 4pt 0 10pt; font-size: 11pt;
  font-family: 'KoPub Dotum', sans-serif;
  border-top: 1.6pt solid #000; border-bottom: 1.6pt solid #000; }
.page .st-table th { font-weight: 500; background: #E5E5E5; }
.page .st-table th, .page .st-table td { border: 0.5pt solid #444; padding: 4pt 6pt;
  text-align: center; font-weight: 300; }
.page .st-table th:first-child, .page .st-table td:first-child { border-left: none; }
.page .st-table th:last-child, .page .st-table td:last-child { border-right: none; }
.page .st-table tr:last-child td { border-bottom: none; }
.page .st-table thead th, .page .st-table tr:first-child th { border-top: none; }
.page strong { font-weight: 700; }

.page .fn-ref { font-size: 8pt; }
.page .fn-ref a { color: #1c3f77; text-decoration: none; }
.page .st-footnotes { margin-top: 18pt; border-top: 1px solid #333; padding-top: 6pt; }
.page .st-footnotes ol { margin: 0; padding-left: 1.5em; font-size: 10pt; line-height: 1.6; }
.page .st-footnotes li { margin: 2pt 0; }
.page .fn-back { text-decoration: none; color: #8aa; font-size: 9pt; }

@media (max-width: 900px) {
  .preview-layout { flex-direction: column; }
  .chapter-nav { position: static; width: 100%; flex: none; }
  .page { padding: 12mm; width: 100%; }
}

/* 본문 그림 */
.st-figure { text-align: center; margin: 14px 0; }
.st-figure img { max-width: 100%; height: auto; }
