/* Read-only purchase documents share the Word content and stay inside the ERP. */
dialog.purchase-preview-modal{width:min(1000px,96vw);max-height:calc(100dvh - 24px);overflow:hidden}
.purchase-preview-modal form{display:flex;flex-direction:column;min-height:0;max-height:calc(100dvh - 24px);margin:0}
.purchase-preview-modal .modal-head,.purchase-preview-modal .modal-foot{flex-shrink:0;background:#fff}
.purchase-preview-modal .modal-body{min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;background:#f1f3ef;padding:20px}
.purchase-preview-modal .modal-foot button{min-height:44px}
.purchase-document{max-width:920px;margin:0 auto;padding:28px;background:#fff;border:1px solid #dce3d9;border-radius:4px;color:#253c30;font-size:.875rem;line-height:1.55;overflow-wrap:anywhere}
.purchase-document-header{text-align:center;padding-bottom:16px;border-bottom:2px solid #506b58;margin-bottom:18px}
.purchase-document-header h2{font-size:1.3rem;line-height:1.5;letter-spacing:.08em;margin:0 0 8px}
.purchase-document-header p{margin:3px 0;color:#425949;font-size:.8125rem;white-space:pre-wrap}
.purchase-document-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 24px;margin:16px 0 22px}
.purchase-document-meta>div{display:grid;grid-template-columns:80px minmax(0,1fr);gap:8px;align-items:start;min-width:0}
.purchase-document-meta dt{color:#617265;font-weight:500}
.purchase-document-meta dd{margin:0;white-space:pre-wrap;min-width:0}
.purchase-document .purchase-document-items{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:.8125rem}
.purchase-document-items th,.purchase-document-items td{padding:10px 8px;border:1px solid #bccabd;vertical-align:top;white-space:normal;overflow-wrap:anywhere;line-height:1.6}
.purchase-document-items th{color:#344d3d;font-weight:600;background:#f2f5ef;font-size:.75rem;text-align:left}
.purchase-document-items td{white-space:pre-wrap}
.purchase-document-items th:nth-child(1){width:5%}
.purchase-document-items th:nth-child(2){width:11%}
.purchase-document-items th:nth-child(3){width:25%}
.purchase-document-items th:nth-child(4){width:9%}
.purchase-document-items th:nth-child(5){width:6%}
.purchase-document-items th:nth-child(6){width:12%}
.purchase-document-items th:nth-child(7){width:14%}
.purchase-document-items th:nth-child(8){width:18%}
.purchase-document .purchase-document-note{margin:18px 0 0;color:#425949;white-space:pre-wrap;line-height:1.7;font-size:.8125rem}
.purchase-document .purchase-document-signature{margin:32px 0 10px;break-inside:avoid}
.purchase-document-signature img{display:block;width:45mm;max-width:100%;height:auto;object-fit:contain}
@media(max-width:640px){
 dialog.purchase-preview-modal{width:calc(100% - 16px);max-height:calc(100dvh - 16px)}
 .purchase-preview-modal form{max-height:calc(100dvh - 16px)}
 .purchase-preview-modal .modal-body{padding:10px}
 .purchase-document{padding:16px 12px;font-size:.8125rem}
 .purchase-document-header{padding-bottom:12px;margin-bottom:14px}
 .purchase-document-header h2{font-size:1.1rem;letter-spacing:.04em}
 .purchase-document-meta{grid-template-columns:1fr;gap:9px;margin:14px 0 18px}
 .purchase-document-meta>div{grid-template-columns:72px minmax(0,1fr);gap:8px}
 .purchase-document .purchase-document-items,.purchase-document-items tbody{display:block;width:100%}
 .purchase-document-items thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .purchase-document-items tr{display:block;margin-bottom:12px;border:1px solid #bccabd;border-radius:6px;overflow:hidden}
 .purchase-document-items td{display:grid;grid-template-columns:66px minmax(0,1fr);gap:10px;align-items:start;border:0;border-top:1px solid #e2e8df;padding:9px 10px;min-width:0}
 .purchase-document-items td>span{min-width:0}
 .purchase-document-items td:first-child{border-top:0;background:#f2f5ef}
 .purchase-document-items td::before{content:attr(data-label);color:#617265;font-size:.75rem;white-space:normal}
 .purchase-document .purchase-document-signature{margin-top:30px}
}

.purchase-document-meta .purchase-document-meta-wide{grid-column:1/-1}
