/* ============================================================
   paper.css — A4 문서 본체. 이 부분만 인쇄됩니다.

   인쇄 여백은 @page 가 담당하고 .pv 는 padding 을 0 으로 둡니다.
   둘 다 여백을 주면 내용이 밀려서 2페이지가 됩니다.
   ============================================================ */

.pv{
  width:210mm;min-height:297mm;padding:15mm 14mm;
  background:#fff;color:#000;
  box-shadow:0 1px 2px rgba(22,32,43,.10),0 10px 28px rgba(22,32,43,.14);
  font-size:9.5pt;line-height:1.45;
}
.pv--half{min-height:148.5mm;padding:12mm 14mm}

/* 문서 제목 — 한국 서식 관습대로 자간을 벌립니다 */
.pv__head{text-align:center;margin-bottom:7mm}
.pv__title{
  margin:0;font-size:19pt;font-weight:700;
  letter-spacing:.38em;text-indent:.38em;
}

.pv__meta{
  display:flex;justify-content:flex-end;gap:14px;flex-wrap:wrap;
  font-size:8.5pt;margin-bottom:3mm;
}
.pv__meta b{font-weight:600;margin-right:4px;color:#333}

/* 당사자 */
.pv__parties{display:grid;grid-template-columns:1fr 1fr;gap:4mm;margin-bottom:5mm}
.pv__parties--one{grid-template-columns:1fr;max-width:94mm}
.pv__party{width:100%;border-collapse:collapse;font-size:8.5pt}
.pv__party caption{text-align:left;font-weight:700;padding-bottom:1.6mm;font-size:9.5pt}
.pv__party th,.pv__party td{border:.3mm solid #000;padding:1.2mm 2mm}
.pv__party th{width:22mm;background:#F1F3F5;font-weight:500;text-align:center;white-space:nowrap}

/* 품목 표 */
.pv__items{width:100%;border-collapse:collapse;font-size:8.5pt;margin-bottom:3mm}
.pv__items th,.pv__items td{border:.3mm solid #000;padding:1.3mm 1.8mm}
.pv__items thead th{background:#ECEFF2;font-weight:600;text-align:center;white-space:nowrap}
.pv__items td.n{text-align:right;font-variant-numeric:tabular-nums}
.pv__items tbody tr{height:6.2mm}
.pv__items tfoot td{background:#F5F7F9;font-weight:600;text-align:center}
.pv__items tfoot td.n{text-align:right}
.pv__items tfoot tr.big td{
  background:#fff;font-size:10.5pt;padding:2mm 1.8mm;border-top:.6mm solid #000;
}
.pv__items tfoot tr.big td.n{color:#C0392B;font-weight:700}

/* 잔액 줄 */
.pv__ledger{width:100%;border-collapse:collapse;font-size:8.5pt;margin-bottom:5mm}
.pv__ledger th,.pv__ledger td{border:.3mm solid #000;padding:1.3mm 1.8mm}
.pv__ledger th{background:#F1F3F5;font-weight:500;white-space:nowrap}
.pv__ledger td.n{text-align:right;font-variant-numeric:tabular-nums}
.pv__ledger td.b{font-weight:700;color:#C0392B}

/* 영수증 금액 */
.pv__amount{
  border:.6mm solid #000;padding:4mm 5mm;margin-bottom:4mm;
  display:flex;justify-content:space-between;align-items:baseline;gap:7mm;
}
.pv__amount-h{font-size:13pt;font-weight:700}
.pv__amount-n{font-size:12pt;font-variant-numeric:tabular-nums;white-space:nowrap}

/* 라벨-값 표 */
.pv__fields{width:100%;border-collapse:collapse;font-size:8.5pt;margin-bottom:4mm}
.pv__fields caption{text-align:left;font-weight:700;padding-bottom:1.6mm;font-size:9.5pt}
.pv__fields th,.pv__fields td{border:.3mm solid #000;padding:1.5mm 2mm}
.pv__fields th{width:24mm;background:#F1F3F5;font-weight:500;white-space:nowrap}

/* 조항 */
.pv__clauses{margin-bottom:4mm}
.pv__clauses h3{margin:0 0 2mm;font-size:9.5pt;font-weight:700}
.pv__clauses ol{margin:0;padding-left:5.5mm}
.pv__clauses li{margin-bottom:1.4mm;text-align:justify}
.pv__clauses li::marker{font-weight:600}

/* 본문 */
.pv__body{margin-bottom:5mm}
.pv__body h3{margin:0 0 2mm;font-size:9.5pt;font-weight:700}
.pv__body p{margin:0;min-height:7mm;text-align:justify;white-space:pre-wrap}

/* 서명 */
.pv__sign{margin-top:8mm;text-align:center}
.pv__sign-lead{margin:0 0 6mm;font-size:9.5pt}
.pv__sign-date{margin:0 0 6mm;font-size:10.5pt;letter-spacing:.06em}
.pv__sign-lines{display:flex;flex-direction:column;gap:4mm;align-items:center}
.pv__sign-line{display:flex;align-items:baseline;gap:3.5mm;min-width:90mm;justify-content:flex-end}
.pv__sign-line .r{font-weight:600;min-width:19mm;text-align:right}
.pv__sign-line .v{
  min-width:46mm;border-bottom:.3mm solid #000;text-align:center;padding-bottom:.8mm;
}
.pv__sign-line .seal{color:#C0392B;font-size:8.5pt;min-width:11mm;text-align:left}


/* ══ 인쇄 ══════════════════════════════════════════════
   여백은 @page 하나만 담당합니다. .pv 의 padding 은 0.
   둘 다 주면 내용이 밀려 2페이지가 됩니다.
   ══════════════════════════════════════════════════════ */
@page{size:A4 portrait;margin:13mm 12mm}

@media print{
  html,body{
    background:#fff;margin:0;padding:0;height:auto;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  .top,.cats,.docs,.side,.intro,.reading,.site-foot,.home,.stage__h,.ad{display:none!important}

  .app{display:block!important;height:auto!important;overflow:visible!important}
  .stage{
    display:block!important;padding:0!important;margin:0!important;
    overflow:visible!important;height:auto!important;
  }
  .fit{transform:none!important;width:auto!important;height:auto!important}

  .pv{
    width:100%!important;max-width:none!important;
    min-height:0!important;height:auto!important;
    padding:0!important;margin:0!important;
    box-shadow:none!important;border:0!important;
    font-size:9pt;
  }
  .pv>*:last-child{margin-bottom:0!important}

  /* 여러 장이 될 때 표 머리글을 각 페이지에 반복합니다.
     tfoot 은 기본값이 table-footer-group 이라 매 페이지에 합계가 찍히므로 막습니다. */
  .pv__items thead{display:table-header-group}
  .pv__items tfoot{display:table-row-group}
  .pv__items tr,.pv__party,.pv__fields,.pv__ledger{page-break-inside:avoid}
  .pv__sign{page-break-inside:avoid}
}

/* 화면 축소 시 종이도 같이 */
@media screen and (max-width:860px){
  .pv{width:100%;min-height:auto;padding:8mm 6mm;font-size:9pt}
  .pv__title{font-size:15pt;letter-spacing:.2em;text-indent:.2em}
  .pv__parties{grid-template-columns:1fr}
}
