#print-sheet{display:none}

@media print{
  @page{size:A4;margin:16mm 15mm}
  html,body{background:#fff!important;color:#111!important}
  body.printing-document>*:not(#print-sheet){display:none!important}
  body.printing-document #print-sheet{display:block!important;width:100%;font-family:'Noto Sans TC',sans-serif;font-size:11pt;line-height:1.5;color:#111}
  .print-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20mm;padding-bottom:7mm;border-bottom:2px solid #222}
  .print-brand{font-size:10pt;letter-spacing:.12em;color:#555}
  .print-header h1{font-size:22pt;line-height:1.25;letter-spacing:.06em;margin:2mm 0 0;font-weight:700}
  .print-document{text-align:right;font-size:10pt;line-height:1.8;white-space:nowrap}
  .print-document span{color:#555;margin-right:3mm}
  .print-customer{display:grid;grid-template-columns:1fr 1fr;gap:0 9mm;margin:8mm 0 10mm}
  .print-parties{display:grid;grid-template-columns:1fr 1fr;gap:10mm;margin:7mm 0 9mm}
  .print-party{min-width:0;break-inside:avoid}
  .print-party h2{font-size:10pt;letter-spacing:.08em;margin:0 0 2mm;color:#444}
  .print-party .print-customer{display:block;margin:0}
  .print-party .print-field{grid-template-columns:22mm minmax(0,1fr);padding:1.6mm 0}
  .print-field{display:grid;grid-template-columns:24mm minmax(0,1fr);gap:3mm;align-items:start;padding:2.5mm 0;border-bottom:1px solid #d5d5d5;min-width:0;break-inside:avoid}
  .print-field.wide{grid-column:1/-1}
  .print-field span{color:#555}
  .print-field strong{font-weight:500;overflow-wrap:anywhere;white-space:pre-wrap}
  .print-items{width:100%;border-collapse:collapse;text-align:left;table-layout:fixed;white-space:normal}
  .print-items thead{display:table-header-group}
  .print-items tr{break-inside:avoid}
  .print-items th,.print-items td{font-size:10.5pt;padding:3mm 2mm;border-top:1px solid #ddd;border-bottom:1px solid #ddd;color:#111;background:transparent;overflow-wrap:anywhere}
  .print-items tbody tr:last-child td{border-bottom:1px solid #ddd}
  .print-items th{font-weight:600;background:#f1f1f1!important;border-top:1px solid #222;border-bottom:1px solid #222}
  .print-items th:first-child,.print-items td:first-child{width:46%}
  .print-items th:nth-child(2),.print-items td:nth-child(2){width:13%}
  .print-items th:nth-child(3),.print-items td:nth-child(3){width:19%}
  .print-items th:last-child,.print-items td:last-child{width:22%}
  .print-items.quote-items th:first-child,.print-items.quote-items td:first-child{width:40%}
  .print-items.quote-items th:nth-child(2),.print-items.quote-items td:nth-child(2){width:10%}
  .print-items.quote-items th:nth-child(3),.print-items.quote-items td:nth-child(3){width:9%}
  .print-items.quote-items th:nth-child(4),.print-items.quote-items td:nth-child(4){width:19%}
  .print-items .number{text-align:right;white-space:nowrap}
  .print-total{display:flex;justify-content:flex-end;align-items:baseline;gap:10mm;margin-top:6mm;padding-top:4mm;border-top:2px solid #222;break-inside:avoid}
  .print-total span{font-size:11pt}
  .print-total strong{font-size:17pt}
  .print-quote-bottom{display:grid;grid-template-columns:minmax(0,1fr) 76mm;align-items:start;gap:8mm;margin-top:6mm}
  .print-quote-notices{min-width:0;font-size:9pt;line-height:1.55;overflow-wrap:anywhere}
  .print-quote-notices h2{font-size:10pt;margin:0 0 2mm;font-weight:600}
  .print-quote-notices p{margin:0;white-space:pre-wrap}
  .print-quote-summary{width:76mm;max-width:100%;break-inside:avoid}
  .print-sale-summary{margin:6mm 0 0 auto}
  .print-quote-summary>div{display:flex;justify-content:space-between;align-items:baseline;gap:8mm;padding:1.4mm 0}
  .print-quote-summary>div span{color:#555}
  .print-quote-summary>div strong{font-weight:600;white-space:nowrap}
  .print-quote-summary .print-total{margin-top:2mm;padding-top:3mm;border-top:2px solid #222}
  .print-quote-summary .print-total span{color:#111}
  .print-signature{width:76mm;max-width:100%;margin:12mm 0 0 auto;padding-top:4mm;border-top:1px solid #ddd;break-inside:avoid}
  .print-signature h2{font-size:11pt;margin:0;font-weight:600}
  .print-signature-field{min-height:24mm;border-bottom:1px solid #333;margin-top:5mm}
  .print-signature-field span{color:#555;font-size:10pt}
  .print-sale-notices{margin-top:7mm;padding-top:3mm;border-top:1px solid #ddd;min-width:0;break-inside:auto}
  .print-sale-notices h2{font-size:10pt;margin:0 0 2mm;font-weight:600;break-after:avoid}
  .print-sale-notices p{font-size:9.5pt;line-height:1.55;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;orphans:2;widows:2}
  .print-note{margin-top:10mm;white-space:pre-wrap;overflow-wrap:anywhere;break-inside:avoid}
  .print-note span{color:#555;margin-right:4mm}
}
