/* =========================================================
   NAT 인적성검사 결과표 — 인쇄 / PDF 전용 스타일 (A4 최적화)
   media="print" 로 로드됩니다.

   동작 방식
   1) @page 로 A4(210×297mm) / 여백 12mm 를 지정하고
      .sheet(1시트)를 정확히 A4 1페이지 크기로 고정합니다.
   2) js/main.js 가 인쇄 직전 이 링크의 media 를 잠시 'all' 로 바꿔
      화면에서도 "똑같은 인쇄 레이아웃"으로 각 시트의 실제 높이를 측정합니다.
   3) A4 한 페이지를 넘는 시트만 자동으로 축소(scale)해 1장에 맞춥니다.
      (브라우저/폰트 차이가 있어도 페이지가 2장으로 쪼개지지 않습니다.)
   ========================================================= */

@page {
  size: A4 portrait;
  margin: 12mm;              /* 위·아래·좌·우 12mm */
}

:root {
  --page-w: 186mm;           /* 210mm - 12mm*2 */
  --page-h: 272mm;           /* 297mm - 12mm*2 - 1mm(반올림 여유) */
}

/* ---------- 브라우저 '잉크 절약' 모드에서도 차트 색상 유지 ---------- */
html, body, .sheet, .sheet * {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  font-size: 9.6pt;
  line-height: 1.55;
}

.toolbar, .to-top { display: none !important; }
.doc { display: block !important; max-width: none !important; margin: 0 !important; }
.fit-hint { display: none !important; }

/* =========================================================
   시트 = A4 1페이지
   ========================================================= */
.sheet {
  display: block;
  width: var(--page-w) !important;
  max-width: 100%;
  height: var(--page-h) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;                 /* JS 미동작 시에도 1장 유지(넘치는 부분 잘림) */
  background: #fff !important;
  break-after: page;
  page-break-after: always;
}
.sheet::before { display: none !important; }
.sheet:last-of-type { break-after: auto; page-break-after: auto; }

/* JS 맞춤 상태(.sheet.is-scaled)는 파일 하단에서 정의합니다. */

/* ---------- 페이지 나눔 안전장치 ---------- */
h1, h2, h3 { break-after: avoid-page; page-break-after: avoid; }
.block, .subblock, .plot,
.domain-card, .qlist__item, .findings__item, .trust__card, .subscale,
.compare__item, .rowchart__row, .statlist__row, .bar-chart, .crit-table,
.grade8, .bandtiers, .final, .quote, .analysis, .guideline, .trust,
.typespectrum, .rowchart {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* =========================================================
   타이포그래피 · 여백 압축
   ========================================================= */
.sheet__head {
  padding-bottom: 2.2mm; margin-bottom: 4mm;
  font-size: 7.4pt; letter-spacing: .09em;
}

.doc-title { font-size: 19pt; margin: 0 0 5mm; line-height: 1.14; }
.doc-title span { font-size: 8pt; margin-top: 2mm; letter-spacing: .2em; }

.idcard { margin-bottom: 6mm; }
.idcard__cell { padding: 2.4mm 2mm; }
.idcard__cell dt { font-size: 7.4pt; margin-bottom: 1mm; }
.idcard__cell dd { font-size: 9.4pt; }

.block { margin-bottom: 5mm; }
.block__title { font-size: 11pt; margin-bottom: 3mm; gap: 2.4mm; }
.block__title small { font-size: 8pt; }
.block__letter { min-width: 5.6mm; height: 5.6mm; font-size: 9pt; border-radius: 1.4mm; }

.subblock { margin-top: 4mm; }
.subblock__title { font-size: 9.4pt; margin-bottom: 2.4mm; padding-bottom: 1.4mm; }

/* ---------- A. 종합 판정 ---------- */
.verdict__score,
.verdict__cell { padding: 2.6mm 2.4mm; gap: 0.8mm; }
.verdict__label { font-size: 7.4pt; }
.verdict__value { font-size: 23pt; }
.verdict__value small { font-size: 10pt; }
.verdict__big { font-size: 20pt; }
.verdict__big small { font-size: 8.4pt; }
.verdict__big--text { font-size: 13pt; }
.verdict__meta { font-size: 7.2pt; line-height: 1.35; }

.note { margin-top: 2.4mm; padding: 2.4mm 3mm; font-size: 8.4pt; border-radius: 2mm; }
.note--strong { font-size: 8.8pt; }

/* ---------- B. 합격 판정 기준 표 ---------- */
.crit-table { font-size: 9pt; }
.crit-table thead th { padding: 2.2mm 2.6mm; font-size: 8pt; }
.crit-table thead th em { font-size: 7pt; }
.crit-table tbody th { padding: 2.4mm 2.6mm; font-size: 9pt; }
.crit-table tbody td { padding: 2.4mm 2.6mm; }
.crit-table td:nth-child(2) { min-width: 46mm; }
.crit-table td:nth-child(3) { font-size: 8pt; }

.gauge { width: 27mm; height: 2.4mm; }
.gauge::after { border-left-width: 1.4px; }
.val { font-size: 10.5pt; margin-left: 2mm; }
.pill { padding: 0.9mm 2.6mm; font-size: 7.8pt; }
.footnote { margin-top: 2.2mm; font-size: 7.6pt; }

/* ---------- C. 검사결과 분석 ---------- */
.analysis { padding: 3.4mm 3.8mm; }
.analysis__sub { font-size: 8.6pt; margin-bottom: 2mm; }
.analysis p { font-size: 9pt; line-height: 1.78; }

/* ---------- D. 추천 면접 질문 ---------- */
.qlist { gap: 2.4mm; }
.qlist__item { padding: 2.8mm 3.4mm; border-top-width: 2px; }
.qlist__head { margin-bottom: 1.6mm; gap: 2.4mm; }
.qlist__no { font-size: 8pt; padding: 0.5mm 2mm; }
.qlist__key { font-size: 8.6pt; }
.qlist__item p { font-size: 8.8pt; line-height: 1.7; }

/* ---------- 2p. 종합판정 결과표 ---------- */
.final { grid-template-columns: 54mm 1fr; gap: 5mm; padding: 4mm; }
.final__visual { gap: 2mm; }
.final__gauge { width: 32mm; height: 32mm; }
.final__gauge-val { font-size: 19pt; }
.final__gauge-cap { font-size: 7pt; margin-top: 1mm; }
.final__badge { font-size: 9pt; padding: 1.2mm 3.4mm; }
.final__rel { font-size: 7.4pt; }

.statlist__row { padding: 2mm 3.4mm; }
.statlist__row dt { font-size: 8.2pt; }
.statlist__row dt span { font-size: 7.2pt; }
.statlist__row dd { font-size: 8.8pt; }
.statlist__row dd b { font-size: 11.5pt; }

/* ---------- 인성 종합 결과표 카드 ---------- */
.domain-cards { gap: 2.4mm; margin-bottom: 3mm; }
.domain-card { padding: 2.6mm 2.6mm 2.2mm; border-top-width: 2px; }
.domain-card__head h3 { font-size: 8.8pt; }
.grade { font-size: 8.6pt; padding: 0.3mm 1.8mm; }
.domain-card__eval { font-size: 7.8pt; margin-top: 1mm; }
.domain-card__rank { font-size: 7.2pt; margin-bottom: 2mm; }
.domain-card__score { font-size: 11pt; margin-top: 1.2mm; }
.meter { height: 2.4mm; }

.cutline-legend { margin-bottom: 4mm; padding: 2.2mm 3mm; gap: 2mm 4mm; font-size: 7.8pt; border-radius: 2mm; }

/* ---------- 세로 막대 차트 ---------- */
.chart-box__cap { font-size: 7.8pt; margin-bottom: 2.6mm; }
.bar-chart {
  --pad-bottom: 9mm;
  height: 44mm; padding: 0 4mm var(--pad-bottom); gap: 4mm;
}
.bar-chart__col { max-width: 16mm; border-radius: 1.4mm 1.4mm 0 0; }
.bar-chart__val { font-size: 10pt; margin-bottom: 1.2mm; }
.bar-chart__name { font-size: 8pt; bottom: -7mm; }
.axis-scale { padding: 0 4mm; font-size: 7pt; }

/* ---------- 등급 구간 ---------- */
.bandtiers { gap: 2.4mm; margin-bottom: 4mm; }
.bandtier { padding: 2.4mm 3mm; border-top-width: 2px; border-radius: 2mm; }
.bandtier__name { font-size: 10pt; }
.bandtier__range { font-size: 8pt; margin: 0.6mm 0 0.8mm; }
.bandtier__codes { font-size: 9.4pt; }

.grade8 { gap: 1.5mm; }
.grade8 li { padding: 2mm 1mm; border-radius: 1.6mm; }
.grade8 b { font-size: 10pt; }
.grade8 span { font-size: 6.8pt; }

/* ---------- 3p. 수검자 태도 ---------- */
.trust { gap: 3mm; }
.trust__card { padding: 3mm 3.5mm 3mm 14mm; border-radius: 2mm; }
.trust__badge { left: 3mm; top: 3mm; width: 8mm; height: 8mm; font-size: 12pt; border-radius: 2mm; }
.trust__card h3 { font-size: 9.4pt; margin-bottom: 1mm; }
.trust__card h3 small { font-size: 8.8pt; }
.trust__card p { font-size: 8.4pt; line-height: 1.6; }

/* ---------- 적응 유형 스펙트럼 ---------- */
.typespectrum { gap: 1.4mm; margin-bottom: 3.4mm; }
.typespectrum li { padding: 3.4mm 1mm 2mm; font-size: 7.8pt; border-radius: 1.6mm 1.6mm 0.8mm 0.8mm; }
.typespectrum li::before { height: 1mm; }
.quote { padding: 3mm 3.5mm; font-size: 9pt; line-height: 1.72; border-left-width: 3px; }

/* ---------- 하위 세부 능력 ---------- */
.chart-legend { gap: 2mm 4mm; margin-bottom: 3.4mm; font-size: 7.8pt; }
.swatch { width: 2.4mm; height: 2.4mm; }
.subscale-groups { gap: 3mm; }
.subscale { padding: 2.6mm 3.2mm; border-radius: 2mm; }
.subscale__title { font-size: 9.4pt; margin-bottom: 2.2mm; padding-bottom: 1.6mm; }
.subscale__title small { font-size: 10pt; }
.subscale__list { gap: 1.5mm; }
.subscale__list li { grid-template-columns: 24mm 1fr 15mm; gap: 3mm; }
.subscale__name { font-size: 8.4pt; }
.subscale__list b { font-size: 10pt; }
.mini { height: 3.4mm; }
.mini::after { border-left-width: 1.4px; }
.axis-note { margin: 3mm 0 0.6mm; font-size: 6.8pt; }

/* ---------- 4p. 종합 소견 ---------- */
.findings { gap: 2.2mm; }
.findings__item { grid-template-columns: 9.5mm 1fr; gap: 2.8mm; padding: 2.6mm 3.4mm 2.6mm 2.6mm; border-radius: 2mm; }
.findings__no { width: 7.4mm; height: 7.4mm; font-size: 9pt; }
.findings__item p { font-size: 8.6pt; line-height: 1.72; }

/* ---------- F. 직무적성 결과표 ---------- */
.rowchart__head {
  grid-template-columns: 9mm 33mm 1fr 1.35fr;
  gap: 2.6mm; padding: 1.8mm 3mm; font-size: 8pt;
}
.rowchart__row {
  grid-template-columns: 9mm 33mm 1fr 1.35fr;
  gap: 2.6mm; padding: 1.8mm 3mm;
}
.rowchart__rank { width: 6.4mm; height: 6.4mm; font-size: 8pt; border-radius: 1.4mm; }
.rowchart__name { font-size: 8.4pt; }
.rowchart__bar-wrap { grid-template-columns: 1fr 12mm; gap: 2.6mm; }
.rowchart__bar { height: 2.8mm; }
.rowchart__bar-wrap b { font-size: 10pt; }
.rowchart__desc { font-size: 7.6pt; line-height: 1.5; }

/* ---------- 5p. 비교 분석 ---------- */
.compare { gap: 2.6mm; margin-bottom: 3.4mm; }
.compare__item { grid-template-columns: 27mm 1fr 16mm; gap: 3mm; padding: 2.6mm 3.4mm; border-radius: 2mm; }
.compare__name { font-size: 9pt; }
.compare__bars { gap: 1.4mm; }
.compare__bar { height: 4.4mm; border-radius: 1.4mm; padding: 0 2.2mm; }
.compare__bar span { font-size: 7.4pt; }
.compare__bar b { font-size: 9pt; }
.compare__delta { font-size: 14pt; }
.compare-legend { padding: 2.2mm 3mm; gap: 2mm 4mm; font-size: 7.8pt; border-radius: 2mm; }

/* ---------- 가이드라인 / 푸터 ---------- */
.guideline { padding: 3mm 3.6mm; border-radius: 2mm; }
.guideline p { font-size: 9pt; line-height: 1.8; margin-bottom: 2.4mm; }
.foot-note { margin-top: 5mm; padding-top: 3mm; font-size: 7.4pt; }

/* =========================================================
   페이지별 미세 압축
   ---------------------------------------------------------
   1페이지(수험자 정보+종합판정+기준표+분석+면접질문)와 3페이지는
   원본 PDF에서도 정보량이 가장 많은 면입니다. A4 한 장(272mm)에
   자연스럽게 들어가도록 이 두 페이지만 여백·글자를 조금 더 조입니다.
   (JS 자동 맞춤은 최후의 안전장치로 그대로 유지)
   ========================================================= */

/* ---------- 1페이지 ---------- */
#page-1 .doc-title { font-size: 15.5pt; margin-bottom: 3mm; }
#page-1 .doc-title span { font-size: 7pt; margin-top: 1.4mm; }
#page-1 .idcard { margin-bottom: 4mm; }
#page-1 .idcard__cell { padding: 1.8mm 1.6mm; }
#page-1 .idcard__cell dt { font-size: 6.8pt; margin-bottom: .6mm; }
#page-1 .idcard__cell dd { font-size: 8.8pt; }
#page-1 .block { margin-bottom: 3.6mm; }
#page-1 .block__title { font-size: 10pt; margin-bottom: 2.2mm; }

#page-1 .verdict__score,
#page-1 .verdict__cell { padding: 2.2mm 2mm; gap: .5mm; }
#page-1 .verdict__label { font-size: 6.8pt; }
#page-1 .verdict__value { font-size: 18pt; }
#page-1 .verdict__value small { font-size: 8.4pt; }
#page-1 .verdict__big { font-size: 16pt; }
#page-1 .verdict__big--text { font-size: 11.5pt; }
#page-1 .verdict__meta { font-size: 6.4pt; line-height: 1.3; }
#page-1 .note { margin-top: 1.8mm; padding: 1.8mm 2.6mm; font-size: 7.8pt; }

#page-1 .crit-table { font-size: 8.2pt; }
#page-1 .crit-table thead th { padding: 1.5mm 2.2mm; font-size: 7.2pt; }
#page-1 .crit-table thead th em { font-size: 6.4pt; }
#page-1 .crit-table tbody th,
#page-1 .crit-table tbody td { padding: 1.6mm 2.2mm; }
#page-1 .crit-table tbody th { font-size: 8.4pt; }
#page-1 .crit-table td:nth-child(2) { min-width: 40mm; }
#page-1 .crit-table td:nth-child(3) { font-size: 7.4pt; }
#page-1 .gauge { width: 25mm; height: 2.2mm; }
#page-1 .val { font-size: 9.8pt; margin-left: 1.8mm; }
#page-1 .pill { padding: .7mm 2.2mm; font-size: 7.2pt; }
#page-1 .footnote { margin-top: 1.6mm; font-size: 6.8pt; }

#page-1 .analysis { padding: 2.8mm 3.2mm; }
#page-1 .analysis__sub { font-size: 7.8pt; margin-bottom: 1.4mm; }
#page-1 .analysis p { font-size: 8.4pt; line-height: 1.68; }

#page-1 .qlist { gap: 1.8mm; }
#page-1 .qlist__item { padding: 2.2mm 3mm; }
#page-1 .qlist__head { margin-bottom: 1.2mm; }
#page-1 .qlist__no { font-size: 7.2pt; }
#page-1 .qlist__key { font-size: 7.8pt; }
#page-1 .qlist__item p { font-size: 8pt; line-height: 1.62; }

/* ---------- 3페이지 (하위 세부능력 목록) ---------- */
#page-3 .subscale { padding: 2.2mm 3mm; }
#page-3 .subscale__title { margin-bottom: 1.8mm; padding-bottom: 1.2mm; }
#page-3 .subscale__list { gap: 1.2mm; }
#page-3 .mini { height: 3.1mm; }
#page-3 .block { margin-bottom: 4mm; }

/* =========================================================
   JS 자동 맞춤이 적용된 시트 (최후 안전장치)
   zoom 으로 레이아웃 자체를 축소하므로 페이지 분할이 정확히 1장이 됩니다.
   ========================================================= */
.sheet.is-scaled {
  zoom: var(--fit-scale, 1);
  width: calc(var(--page-w) / var(--fit-scale, 1)) !important;
  height: calc(var(--page-h) / var(--fit-scale, 1)) !important;
  overflow: hidden;
}
