/* 정본형 인쇄 시트 — 화면 UX(.screen-only)와 분리 */

.print-sheet {
  display: none;
}

@media screen {
  .print-sheet {
    display: none !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 12mm 12mm;
  }

  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .screen-only,
  .dkj-form-header,
  .dkj-form-toolbar,
  .dkj-form-body,
  .dkj-panel.history,
  .site-header,
  .viewer-top,
  .viewer-tabs,
  .pdf-toolbar,
  .pill-btn {
    display: none !important;
  }

  .print-sheet {
    display: block !important;
  }

  .ps-page {
    font-family: "Noto Sans KR", "맑은 고딕", "Malgun Gothic", sans-serif;
    font-size: 9pt;
    color: #000;
    width: 100%;
  }

  .ps-org {
    text-align: right;
    font-size: 9pt;
    font-weight: 700;
    margin-bottom: 4pt;
  }

  .ps-meta,
  .ps-rev,
  .ps-info,
  .ps-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 6pt;
  }

  .ps-meta td,
  .ps-meta th,
  .ps-rev td,
  .ps-rev th,
  .ps-info td,
  .ps-info th,
  .ps-grid td,
  .ps-grid th {
    border: 0.5pt solid #000;
    padding: 3pt 4pt;
    vertical-align: middle;
  }

  .ps-title-cell {
    text-align: left;
    padding: 6pt 8pt !important;
  }

  .ps-docno {
    font-size: 8pt;
    color: #333;
    margin-bottom: 2pt;
  }

  .ps-title {
    font-size: 14pt;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .ps-apv-lab {
    width: 28pt;
    writing-mode: vertical-rl;
    text-align: center;
    font-size: 8pt;
  }

  .ps-apv {
    width: 48pt;
    text-align: center;
    font-size: 8pt;
    background: #e8e8e8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ps-sign {
    height: 36pt;
    text-align: center;
    font-size: 9pt;
  }

  .ps-rev th,
  .ps-info th,
  .ps-grid thead th {
    background: #d9d9d9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
    text-align: center;
    font-size: 8pt;
  }

  .ps-grid td.c,
  .ps-info td {
    text-align: center;
  }

  .ps-grid td.l {
    text-align: left;
  }

  .ps-foot {
    margin-top: 8pt;
    font-size: 9pt;
    line-height: 1.5;
  }

  .ps-note {
    margin-top: 6pt;
    font-size: 8pt;
    color: #222;
  }

  .ps-brand {
    margin-top: 14pt;
    text-align: right;
    font-size: 8pt;
    color: #444;
  }

  /* ===== 정본 HWP형 (CCP 등 고밀도) ===== */
  .off-ccp {
    font-family: "맑은 고딕", "Malgun Gothic", "Noto Sans KR", sans-serif;
    font-size: 8pt;
    color: #000;
    line-height: 1.25;
  }

  .off-ccp table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .off-ccp th,
  .off-ccp td {
    border: 0.6pt solid #000;
    padding: 1.5pt 2pt;
    vertical-align: middle;
  }

  .off-head {
    margin-bottom: 2pt;
  }

  .off-meta {
    width: 24%;
    padding: 0 !important;
    border: none !important;
  }

  .off-meta-in th {
    width: 38%;
    background: #fff !important;
    font-size: 7.5pt;
    font-weight: 700;
    text-align: center;
  }

  .off-meta-in td {
    font-size: 7.5pt;
    text-align: center;
  }

  .off-title-cell {
    width: 48%;
    text-align: center;
    border: 0.6pt solid #000 !important;
  }

  .off-title {
    font-size: 13pt;
    font-weight: 800;
    letter-spacing: -0.03em;
  }

  .off-sub {
    font-size: 11pt;
    font-weight: 700;
    margin-top: 2pt;
  }

  .off-apv-wrap {
    width: 28%;
    padding: 0 !important;
    border: none !important;
    vertical-align: top;
  }

  .off-apv th,
  .off-apv td {
    font-size: 7.5pt;
  }

  .off-apv-lab {
    width: 18pt;
    text-align: center;
    font-weight: 700;
    line-height: 1.1;
  }

  .off-apv .off-sign {
    height: 28pt;
    text-align: center;
    font-size: 8pt;
  }

  .off-date {
    margin: 2pt 0 3pt;
  }

  .off-date td {
    border: none !important;
    padding: 1pt 0 !important;
    font-size: 8.5pt;
  }

  .off-date .r {
    text-align: right;
  }

  .off-grid th.lab,
  .off-grid .lab {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
    text-align: center;
    font-size: 7.5pt;
  }

  .off-grid thead th,
  .off-mon thead th {
    background: #e8e8e8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
    text-align: center;
    font-size: 7pt;
    line-height: 1.15;
  }

  .off-grid .c { text-align: center; }
  .off-grid .l { text-align: left; padding-left: 3pt !important; }
  .off-grid .r { text-align: right; }
  .off-grid .strong { font-weight: 700; }
  .off-grid .tiny,
  .off-box.tiny,
  td.tiny {
    font-size: 6.5pt !important;
    line-height: 1.35;
    text-align: left;
  }

  .off-sec {
    text-align: center;
    font-weight: 800;
    font-size: 8.5pt;
    margin: 4pt 0 2pt;
  }

  .off-box {
    border: 0.6pt solid #000;
    padding: 3pt 4pt;
    margin-bottom: 3pt;
  }

  .off-mon td {
    height: 14pt;
    font-size: 7.5pt;
  }

  .off-foot {
    margin-top: 4pt;
    text-align: right;
    font-size: 7pt;
    color: #333;
  }

  .off-topmeta .pad0 {
    padding: 0 !important;
  }

  .off-nest {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
  }

  .off-nest th,
  .off-nest td {
    border: 0.5pt solid #000;
    padding: 1pt 2pt;
    font-size: 6.5pt;
  }

  .off-nest-hd th {
    background: #e8e8e8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
    text-align: center;
  }

  .off-correct th.vert {
    width: 12%;
    writing-mode: horizontal-tb;
    letter-spacing: 0;
    line-height: 1.35;
    font-size: 7.5pt;
    padding: 4pt 2pt !important;
  }

  /* ===== 유형 A: 항목 × 날짜 매트릭스 정본 ===== */
  /* 종이 정본은 A4 1쪽을 가득 채운다. 쪽을 flex 컬럼으로 두고
     본문 표가 남는 높이를 흡수하도록 해 원본과 같은 밀도를 만든다. */
  .off-matrix .mx-page {
    page-break-after: always;
    break-after: page;
    display: flex;
    flex-direction: column;
    min-height: 262mm;
  }

  .off-matrix .mx-grid {
    flex: 1 1 auto;
    height: 100%;
  }

  .off-matrix .mx-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .mx-head {
    table-layout: fixed;
    margin-bottom: 3pt;
  }

  .mx-mlab {
    width: 11%;
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 7.5pt;
    font-weight: 700;
    text-align: center;
  }

  .mx-mval {
    width: 14%;
    font-size: 7.5pt;
    text-align: center;
  }

  .mx-title-cell {
    width: 43%;
    text-align: center;
  }

  .mx-apv-lab {
    width: 4%;
    text-align: center;
    font-weight: 700;
    font-size: 7.5pt;
    line-height: 1.1;
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .mx-apv {
    width: 9.3%;
    text-align: center;
    font-size: 7.5pt;
    font-weight: 700;
    background: #e8e8e8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .mx-sign {
    height: 34pt;
    text-align: center;
    font-size: 9pt;
  }

  .mx-head .off-title,
  .off-matrix .off-title {
    font-size: 16pt;
    letter-spacing: -0.02em;
  }

  .mx-mlab,
  .mx-mval {
    height: 15pt;
  }

  .mx-grid {
    table-layout: fixed;
    margin-bottom: 4pt;
  }

  .mx-grid tbody td,
  .mx-grid tbody th {
    height: 26pt;                 /* 원본 종이와 동일한 행 밀도 */
  }

  .mx-grid thead th {
    height: 15pt;
  }

  /* 11열 합계 100% : 구분 5.8×2 + 점검사항 42 + 주기 4 + 날짜 5.4×6 + 비고 10 */
  .mx-grid .mx-div { width: 5.8%; }
  .mx-grid .mx-item { width: 42%; }
  .mx-grid .mx-freq { width: 4%; text-align: center; }
  .mx-grid .mx-day { width: 5.4%; font-size: 7.5pt; line-height: 1.15; }
  .mx-grid .mx-note { width: 10%; }

  .mx-dow {
    font-size: 6.5pt;
    font-weight: 500;
  }

  .mx-major,
  .mx-minor {
    text-align: center;
    font-weight: 700;
    font-size: 8.5pt;
    line-height: 1.2;
    background: #fff !important;
  }

  .mx-major {
    letter-spacing: 0.4em;        /* 원본과 같이 대분류는 세로쓰기 */
    writing-mode: vertical-rl;
    text-orientation: upright;
    padding: 2pt 0 !important;
  }

  .mx-minor { font-weight: 500; }

  .mx-label {
    font-size: 8.5pt;
    line-height: 1.3;
    padding-left: 4pt !important;
  }

  .mx-cell {
    font-size: 11pt;
    text-align: center;
  }

  .mx-grid .mx-note {
    font-size: 7.5pt;
    text-align: left;
  }

  .mx-signrow th {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    text-align: center;
    font-size: 7.5pt;
    font-weight: 700;
  }

  .mx-legendrow td {
    text-align: left;
    font-size: 6.5pt !important;
    padding: 3pt 4pt !important;
    line-height: 1.4;
  }

  .mx-inc {
    table-layout: fixed;
    margin-top: 3pt;
  }

  .mx-inc th,
  .mx-inc td {
    font-size: 8pt;
    height: 24pt;
  }

  .mx-inc-lab {
    width: 9%;
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
  }
}

@media print {
  /* ===== 유형 E(대장) 정본 ===== */
  .off-ledger .lg-info {
    table-layout: fixed;
    margin-bottom: 3pt;
  }

  .off-ledger .lg-ilab {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 8pt;
    font-weight: 700;
    text-align: center;
    width: 12%;
  }

  .off-ledger .lg-ival {
    font-size: 8pt;
    text-align: center;
  }

  .off-ledger .lg-grid {
    table-layout: fixed;
  }

  .off-ledger .lg-grid thead th {
    font-size: 7pt;
    line-height: 1.15;
    height: 14pt;
  }

  .off-ledger .lg-cell {
    font-size: 8pt;
    height: 22pt;
  }

  .off-ledger .lg-opt {
    color: #888;
    font-size: 6.5pt;
  }

  .off-ledger .lg-legend {
    margin-top: 4pt;
    font-size: 7pt;
  }
}

@media print {
  /* ===== 유형 F(보고서) 정본 ===== */
  .off-report .rp-page { min-height: auto; display: block; }

  .off-report .rp-pairs,
  .off-report .rp-text,
  .off-report .rp-table {
    table-layout: fixed;
    margin-bottom: 3pt;
  }

  .off-report .rp-lab {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 8pt;
    font-weight: 700;
    text-align: center;
    width: 15%;
    height: 18pt;
  }

  .off-report .rp-val {
    font-size: 8.5pt;
    text-align: center;
    height: 18pt;
  }

  .off-report .rp-sign {
    font-size: 8.5pt;
    text-align: center;
    height: 26pt;
  }

  .off-report .rp-checks { text-align: left; padding-left: 4pt !important; }

  .off-report .rp-opt {
    font-size: 8pt;
    margin-right: 10pt;
    color: #333;
  }

  .off-report .rp-tlab {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 8.5pt;
    font-weight: 700;
    text-align: center;
    height: 16pt;
  }

  .off-report .rp-tbody {
    font-size: 8.5pt;
    text-align: left;
    vertical-align: top;
    padding: 4pt 5pt !important;
    line-height: 1.5;
  }

  .off-report .rp-table thead th {
    font-size: 7.5pt;
    height: 16pt;
  }

  .off-report .rp-cell {
    font-size: 8pt;
    height: 22pt;
    line-height: 1.35;
  }
}
