/* Existing A4 margins, paper shadow, 24px page gap and selected body font are retained. */
@font-face {
 font-family:"MES Print Serif";
 src:url("mes-print-serif-regular-v201.woff2") format("woff2");
 font-weight:400;font-style:normal;font-display:block;
}
.processing-contract-paper .contract-document:not(.ble-cl-contract):not(.sales-contract-document),
.processing-contract-paper .contract-document:not(.ble-cl-contract):not(.sales-contract-document) * {
 font-family:"MES Print Serif",SimSun,"宋体",serif!important;
 font-synthesis:none;
}
.contract-dimension-tail {white-space:nowrap;}
.processing-contract-paper .contract-document.contract-paginated {width:210mm;}
.contract-sheet {box-sizing:border-box;position:relative;width:210mm;height:297mm;padding:6mm 8mm;margin:0;}
.contract-sheet-body {display:flow-root;width:calc(194mm - 2px);}
.contract-continuation {display:flex;justify-content:space-between;align-items:baseline;gap:4mm;padding-bottom:2mm;margin-bottom:3mm;border-bottom:1.6px solid #000;font-size:var(--contract-font,14px);}
.contract-continuation span {overflow-wrap:anywhere;}
.contract-page-footer {position:absolute;bottom:6mm;left:8mm;right:8mm;display:flex;justify-content:center;gap:4mm;font-size:11px;line-height:1.45;color:#111;}
.contract-sheet .contract-terms {border-top:1.6px solid #000;}
.contract-sheet .contract-terms p {break-inside:avoid;page-break-inside:avoid;}
.contract-closing {break-inside:avoid;page-break-inside:avoid;}
.contract-sheet .contract-draft {display:none;}
/* Editable decorations have no layout height, so measured sheets match the PDF. */
.contract-paginated .contract-inline-field,.contract-paginated .contract-date-part {border:0!important;box-shadow:inset 0 -1px #aeb9cb;}
.contract-paginated .contract-inline-field {min-width:0;min-height:0;}
.contract-paginated .contract-inline-field:empty {min-width:3em!important;min-height:1em!important;}
.contract-paginated .contract-inline-field:empty::before {content:none!important;}
@media screen {
 .paper.processing-contract-paper:has(.contract-paginated) {padding:0;min-height:0;background:transparent;box-shadow:none;}
 .contract-paginated {display:flex;flex-direction:column;gap:24px;}
 .contract-sheet {background:#fff;box-shadow:var(--ui-paper-shadow,0 2px 12px rgba(0,0,0,.12));}
}
@media print {
 .processing-contract-paper .contract-document.contract-paginated {display:block;width:194mm;}
 .contract-sheet {width:194mm;height:284mm;padding:0;break-before:page;page-break-before:always;break-inside:avoid;page-break-inside:avoid;box-shadow:none;}
 .contract-sheet:first-child {break-before:auto;page-break-before:auto;}
 .contract-page-footer {bottom:0;left:0;right:0;}
 .contract-paginated .contract-inline-field,.contract-paginated .contract-date-part {box-shadow:none;}
}
/* Own the physical page instead of combining a 284mm sheet with the user's
   remembered browser margins. Keep margins inside the sheet and allow 1mm
   for driver rounding. Attachment pages keep their landscape page rule. */
@page mesProcessingContract {size:A4 portrait;margin:0;}
@media print {
 .processing-contract-paper .contract-document.contract-paginated:not(.sales-contract-document) {width:210mm;}
 .processing-contract-paper .contract-document:not(.sales-contract-document)>.contract-sheet {
  page:mesProcessingContract;width:210mm;height:296mm;padding:6mm 8mm;
 }
 .processing-contract-paper .contract-document:not(.sales-contract-document) .contract-page-footer {bottom:6mm;left:8mm;right:8mm;}
}

/* Fit ordinary contracts by reducing empty space, retaining the selected body font. */
.contract-document.contract-compact {line-height:1.3;}
.contract-compact h1 {margin-bottom:2mm;}
.contract-compact .contract-meta {margin-bottom:2mm;}
.contract-compact .contract-meta p {line-height:1.4;}
.contract-compact .contract-products th,.contract-compact .contract-products td {padding:.55mm .7mm;}
.contract-compact .contract-products th {height:8mm;}
.contract-compact .contract-products tbody tr:not(.contract-uppercase) {height:6mm;}
.contract-compact .contract-products .contract-uppercase td {height:5mm;}
.contract-compact .contract-blank {display:none;}
.contract-compact .contract-terms p {min-height:5mm;padding:.25mm 1mm;}
.contract-compact .contract-party {height:44mm;line-height:1.4;}
.contract-compact .contract-party>div {min-height:4.5mm;}
.contract-compact .contract-certification p {margin-top:5mm;}
