/* Reference forms keep their own paper rules, including in the print window. */
.paper.customs-reference-paper { color: #20252a; font: 10px/1.45 Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
.customs-reference-paper table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 12px 0; }
.customs-reference-paper th, .customs-reference-paper td { border: 1px solid #777; padding: 7px 6px; vertical-align: top; overflow-wrap: anywhere; color: #20252a; }
.customs-reference-paper th { background: #f5f5f5; font-size: 9px; line-height: 1.4; font-weight: 600; text-align: left; }
.customs-reference-paper td { font-size: 10px; }
.customs-reference-paper small { display: block; margin-top: 4px; font-size: 9px; line-height: 1.45; color: #565c62; }
.customs-reference-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 16px; border-bottom: 2px solid #30363a; }
.customs-reference-heading > div:first-child { flex: 1 1 50%; min-width: 0; }
.customs-reference-heading > div:last-child { flex: 1 1 45%; min-width: 0; text-align: right; }
.customs-reference-heading b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.customs-reference-heading h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.25; letter-spacing: .02em; }
.customs-reference-heading h2 small { font-size: 13px; color: inherit; letter-spacing: .04em; }
.customs-reference-heading p { margin: 0; line-height: 1.7; }
.customs-signing-place, .customs-document-refs, .customs-trade-terms { margin: 12px 0; overflow-wrap: anywhere; }
.customs-parties th { width: 18%; }
.customs-contract-intro { margin: 14px 0; }
.customs-reference-goods th:nth-child(1) { width: 16%; }
.customs-reference-goods th:nth-child(2) { width: 44%; }
.customs-reference-goods td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.customs-reference-paper .total-row th, .customs-reference-paper .total-row td { background: #f1f1f1; font-weight: 600; }
.customs-amount-words { border: 1px solid #777; border-top: 0; padding: 9px; margin-top: -12px; line-height: 1.5; overflow-wrap: anywhere; }
.customs-contract-terms th { width: 19%; }
.customs-contract-terms td { width: 31%; }
.customs-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 55px; margin-top: 24px; }
.customs-signatures > div { position: relative; min-height: 65px; padding: 4px 8px 24px; overflow-wrap: anywhere; }
.customs-signatures > div > span { position: absolute; left: 0; right: 0; bottom: 0; padding-top: 6px; border-top: 1px solid #555; font-size: 10px; }
.customs-signature-image { display: block; max-width: 110px; max-height: 72px; object-fit: contain; }
.customs-invoice-buyer { padding: 12px 0; }
.customs-invoice-buyer p { margin: 4px 0 10px; }
.customs-pack-totals th, .customs-pack-totals td { font-size: 9px; padding: 7px 4px; }
.customs-invoice-signature { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-height: 70px; margin-top: 16px; }
.customs-origin-statement { margin-top: 16px; line-height: 1.6; }
.customs-reference-packing th:first-child { width: 40%; }
.customs-reference-packing td:not(:first-child) { text-align: right; vertical-align: middle; }
.customs-shipping-marks { margin-top: 18px; overflow-wrap: anywhere; }
.customs-official-title { margin: 0 0 14px; font-size: 20px; line-height: 1.3; text-align: center; letter-spacing: .07em; }
.customs-official-numbers { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 6px; overflow-wrap: anywhere; }
.customs-official-grid { margin: 0 !important; }
.customs-official-grid td { padding: 5px 6px; height: 39px; font-size: 9px; }
.customs-official-grid small { margin: 0 0 3px; font-size: 8px; color: #555; }
.customs-official-body { margin: 0 !important; }
.customs-official-body th { padding: 6px 4px; font-size: 8px; }
.customs-official-body td { padding: 7px 4px; font-size: 9px; }
.customs-official-body th:nth-child(1) { width: 3%; }
.customs-official-body th:nth-child(2) { width: 9%; }
.customs-official-body th:nth-child(3) { width: 25%; }
.customs-official-body th:nth-child(4) { width: 14%; }
.customs-official-body th:nth-child(5) { width: 12%; }
.customs-official-body th:nth-child(6) { width: 5%; }
.customs-official-body th:nth-child(7) { width: 8%; }
.customs-official-body small { font-size: 8px; }
.customs-official-confirm { border: 1px solid #777; border-top: 0; padding: 8px; font-size: 9px; }
.customs-official-confirm > p { margin: 0 0 8px; }
.customs-official-confirm > div { display: grid; grid-template-columns: 2.3fr 1fr 1fr; align-items: start; gap: 12px; }
.customs-official-confirm p { line-height: 1.7; overflow-wrap: anywhere; }
.customs-declarant-stamp { min-height: 60px; }
.customs-declarant-stamp span { display: block; color: #555; }
.customs-authority-stamp { min-height: 60px; border-left: 1px solid #777; padding-left: 10px; color: #555; }
.customs-reference-auxiliary { width: 1850px; }
.customs-reference-auxiliary th, .customs-reference-auxiliary td { font-size: 9px; padding: 6px 4px; }
.customs-reference-paper .customs-group-heading th { background: #edf0f2; font-weight: 600; }
.customs-stamp-preview { display: block; max-width: 110px; max-height: 75px; object-fit: contain; margin: 8px 0; }
@media print {
  .customs-reference-paper thead { display: table-header-group; }
  .customs-reference-paper tr, .customs-reference-heading, .customs-amount-words, .customs-signatures, .customs-official-confirm { break-inside: avoid; page-break-inside: avoid; }
  .customs-reference-paper .page-foot { margin-top: 18px; }
  .customs-reference-paper { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
