.accounting-display-editor { grid-column:1/-1; min-width:0; width:100%; box-sizing:border-box; padding:12px; border:1px solid #c8dde5; border-radius:10px; background:#f4fafb; }
.accounting-display-editor p { color:#577585; font-size:12px; line-height:1.8; }
.accounting-editor-controls { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; }
.accounting-editor-controls label { display:grid; gap:5px; font-size:12px; }
.accounting-editor-controls input,.accounting-editor-controls select { min-width:0; width:100%; box-sizing:border-box; }
.accounting-editor-canvas { display:block; width:auto; max-width:100%; max-height:340px; margin:12px auto; object-fit:contain; background:#fff; border:1px solid #d4e2e7; }
.accounting-editor-actions,.accounting-print-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.accounting-editor-actions button { min-height:44px; white-space:normal; }
.accounting-print-tools select { flex:1; min-width:160px; }
.payment-file-row:has(.accounting-display-editor) { flex-wrap:wrap; }
.accounting-document-preview { display:grid; gap:16px; max-width:100%; overflow:auto; padding:10px; background:#eaf0f3; }
.accounting-screen-hint { font-size:12px; color:#5b7683; }
.accounting-measure-box,#accounting-print-root { position:fixed; left:-10000px; top:0; width:210mm; pointer-events:none; }
.accounting-sheet { font-family:'Vazirmatn','B Nazanin',Tahoma,serif; width:210mm; height:297mm; flex-shrink:0; margin:0 auto; padding:0; box-sizing:border-box; background:#fff; color:#172f47; font-size:10px; line-height:1.65; text-align:right; }
.accounting-sheet-content { height:269mm; overflow:visible; }
.accounting-sheet-header { display:flex; justify-content:space-between; align-items:center; height:13mm; box-sizing:border-box; border-bottom:1px solid #2b6475; margin-bottom:3mm; }
.accounting-sheet-header h1 { margin:0; font-size:18px; color:#163845; }
.accounting-document-blanks { display:grid; gap:1mm; font-size:10px; }
.accounting-cover-media { height:165mm; padding:2mm; box-sizing:border-box; border:1px solid #d0dde2; }
.accounting-cover-media img,.accounting-continuation-media img { display:block; width:100%; height:100%; object-fit:contain; object-position:center; }
.accounting-position-top img { object-position:center top; }
.accounting-position-bottom img { object-position:center bottom; }
.accounting-position-left img { object-position:left center; }
.accounting-position-right img { object-position:right center; }
.accounting-document-facts { display:flex; flex-wrap:wrap; gap:2mm 4mm; padding:2mm 0; border-bottom:1px solid #d0dde2; overflow-wrap:anywhere; }
.accounting-document-facts strong { width:100%; }
.accounting-approval-row { display:flex; gap:3mm; padding:0; }
.accounting-approval-card { flex:1; min-width:0; padding:2mm; border:1px solid #c9dbe2; display:block; box-sizing:border-box; overflow-wrap:anywhere; }
.accounting-approval-card img { width:100%; height:18mm; object-fit:contain; }
.accounting-approval-card small { font-size:9px; }
.accounting-no-signature { display:block; height:18mm; color:#6d8088; font-size:9px; }
.accounting-history-entry { margin:1mm 0; padding:1mm 2mm; border-bottom:1px solid #e0e8ec; overflow-wrap:anywhere; white-space:pre-wrap; }
.accounting-history-entry p { margin:0; font-size:10px; }
.accounting-section-title { font-size:12px; margin:2mm 0; }
.accounting-continuation-media { height:200mm; flex:0 0 200mm; min-height:0; }
.accounting-sheet-footer { height:6mm; border-top:1px solid #d0dde2; text-align:center; color:#637d88; font-size:9px; margin-top:2mm; box-sizing:border-box; }
/* Keep the page dimensions exact for pagination; only the preview scrolls on phones. */
.mantine-ui #editor:has(.accounting-document-preview) { width:min(880px,calc(100vw - 24px)); }
.payment-review-page .payment-review-header { margin-bottom:12px; padding-bottom:10px; gap:10px; }
.payment-review-page .payment-review-header h2 { margin:0; font-size:19px; }
.payment-review-page .payment-review-header p { display:none; }
.payment-review-page .payment-detail-card { padding:12px; border-radius:10px; }
.payment-review-page .payment-review-note textarea { min-height:84px; }
@media(max-width:600px) {
 .accounting-editor-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .accounting-editor-actions button { flex:1 1 130px; }
 .accounting-document-preview { padding:6px; }
 .payment-review-header .payment-actions { width:100%; }
 .payment-review-header .payment-actions button { flex:1; }
}
@media print {
 @page { size:A4 portrait; margin:0; }
 body:has(#accounting-print-root) { margin:0!important; padding:0!important; background:#fff!important; }
 body:has(#accounting-print-root) > *:not(#accounting-print-root) { display:none!important; }
 #accounting-print-root { position:static!important; width:210mm!important; display:block!important; pointer-events:auto; }
 #accounting-print-root .accounting-sheet { width:210mm!important; height:297mm!important; margin:0!important; break-after:page; break-inside:avoid; print-color-adjust:exact; }
 #accounting-print-root .accounting-sheet:last-child { break-after:auto; }
}
