/* ======================================================================
   contract-doc.css — 계약서 한 장(.cdoc). 관리자 미리보기 · 서명자 화면 · PDF 공용.
   ⚠️ PDF 렌더러(OpenHTMLtoPDF)는 CSS 2.1 + 일부만 안다 — flex/grid·var()·rem 쓰지 않는다(조용히 무시된다).
   글꼴: PDF 는 서버가 NanumGothic 을 임베드, 화면은 시스템 한글 글꼴.
   ====================================================================== */
.cdoc { font-family: 'NanumGothic', 'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    color: #111; font-size: 10.5pt; line-height: 1.6; word-break: keep-all; overflow-wrap: break-word; }
.cdoc b { font-weight: 700; }
.cdoc-title { font-size: 20pt; font-weight: 700; text-align: center; letter-spacing: 2px; margin: 0 0 18pt; }
.cdoc-preamble { margin: 0 0 12pt; text-align: justify; }
.cdoc-item { margin: 0 0 9pt; }
.cdoc-item-tight { margin-bottom: 3pt; }

.cdoc-pay { border-collapse: collapse; margin: 0 0 16pt; font-size: 9.5pt; }
.cdoc-pay th, .cdoc-pay td { border: 1px solid #111; padding: 2pt 7pt; text-align: center; white-space: nowrap; }
.cdoc-pay th { font-weight: 700; }
.cdoc-pay td.cdoc-num { text-align: right; }

.cdoc-art { margin: 0 0 10pt; page-break-inside: avoid; }
.cdoc-art-head { font-weight: 700; margin: 0 0 2pt; }
.cdoc-art-items { margin: 0; padding-left: 26pt; }
.cdoc-art-items li { margin: 0 0 1pt; text-align: justify; }

.cdoc-closing { margin: 18pt 0 12pt; text-align: justify; }
.cdoc-date { text-align: center; margin: 0 0 16pt; font-size: 11pt; }

.cdoc-party { border-collapse: collapse; margin: 0 0 12pt; page-break-inside: avoid; }
.cdoc-party td { padding: 1pt 4pt; vertical-align: top; }
.cdoc-party-role { width: 22pt; font-weight: 700; }
.cdoc-party-k { width: 64pt; white-space: nowrap; }
.cdoc-party-k:after { content: " :"; }
/* 서명 이미지는 '( 인 )' 위에 겹친다 — 도장 찍듯 */
.cdoc-seal { position: relative; display: inline-block; margin-left: 48pt; color: #444; }
.cdoc-sign-img { position: absolute; left: -16pt; top: -14pt; height: 40pt; width: auto; max-width: 110pt; }

.cdoc-footer { margin-top: 20pt; padding-top: 6pt; border-top: 1px solid #999; font-size: 7.5pt; color: #444; line-height: 1.5;
    page-break-inside: avoid; word-break: break-all; }

/* ---------- PDF ---------- */
@page { size: A4; margin: 18mm 18mm 16mm; }
body.cdoc-pdf { margin: 0; }

/* ---------- 화면(미리보기 · 서명자) ---------- */
body.cdoc-screen { margin: 0; background: #e5e7eb; }
.cdoc-bar { position: sticky; top: 0; z-index: 2; background: #0f172a; color: #e2e8f0; font: 13px/1.5 -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; padding: 10px 16px; }
.cdoc-paper { background: #fff; max-width: 210mm; margin: 16px auto; padding: 18mm; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); box-sizing: border-box; }
@media (max-width: 640px) {
    .cdoc-paper { margin: 0; padding: 20px 16px; box-shadow: none; }
    .cdoc { font-size: 14px; }
    .cdoc-title { font-size: 21px; }
    .cdoc-preamble, .cdoc-art-items li, .cdoc-closing { text-align: left; }   /* 좁은 폭에서 양쪽 맞춤은 띄어쓰기가 벌어진다 */
    .cdoc-pay { font-size: 11.5px; width: 100%; }
    .cdoc-pay th, .cdoc-pay td { padding: 4px 3px; white-space: nowrap; letter-spacing: -.02em; }
    .cdoc-art-items { padding-left: 20px; }
    .cdoc-seal { margin-left: 20px; }
}
@media print {
    body.cdoc-screen { background: #fff; }
    .cdoc-bar { display: none; }
    .cdoc-paper { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* 휴대폰 자동 전화번호 링크 무력화(사업자번호 등) */
a[href^="tel:"], a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; pointer-events: none; }
