.modal.builder-modal{width:min(1180px,calc(100vw - 40px));max-height:calc(100dvh - 32px);overflow:hidden;display:flex;flex-direction:column}
.builder-modal .modal-head{flex:0 0 auto;align-items:center;padding:20px 28px}.builder-modal .modal-head>div{min-width:0}.builder-modal .modal-head h2,.builder-modal .modal-head span{overflow-wrap:anywhere;line-height:1.35}
.builder-body{min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
.modal.builder-modal .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;padding:24px 28px;gap:20px 24px}
.builder-modal label,.builder-modal .template-controls>*{min-width:0}.builder-modal label>span,.builder-modal .template-controls span{display:block;white-space:normal;overflow-wrap:anywhere;line-height:1.45;min-height:17px;font-size:11px}
.builder-modal input,.builder-modal select,.builder-modal textarea{display:block;width:100%;min-width:0;max-width:100%;font-size:12px;line-height:1.45;color:var(--ink)}
.modal.builder-modal .form-grid input,.modal.builder-modal .form-grid select{height:44px;padding:0 12px}
.builder-modal textarea{min-height:72px;border:1px solid var(--line);border-radius:7px;padding:9px 10px;resize:vertical;background:#fff}
.builder-modal input:focus,.builder-modal select:focus,.builder-modal textarea:focus{outline:0;border-color:var(--blue);box-shadow:0 0 0 3px #159fc818}
.builder-modal .estimate-template{margin:2px 28px 22px;padding:18px}.builder-modal .template-title{gap:18px}.builder-modal .template-title h3,.builder-modal .template-title>b,.builder-modal .template-summary strong{white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.builder-modal .template-controls{grid-template-columns:minmax(0,1.35fr) minmax(260px,1fr)}
.builder-modal .fee-scenarios button{white-space:normal;line-height:1.3;padding:7px;min-height:42px;height:auto}
.builder-modal .items-title{padding:2px 28px 10px}.builder-modal .item-table{padding:0 28px;overflow-x:auto;scrollbar-gutter:stable}.builder-modal .item-head,.builder-modal .item-row{grid-template-columns:minmax(320px,1fr) 80px 115px 180px 38px;min-width:800px;gap:10px;align-items:center}
.builder-modal .item-row textarea{min-height:52px}.builder-modal .item-row input{width:100%;min-width:0}.builder-modal .item-row button{width:38px;margin:0}
.builder-modal .calc-area{grid-template-columns:minmax(0,1fr) minmax(320px,380px);gap:24px;padding:20px 28px}.builder-modal .tax-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.builder-modal .live-total{min-width:0;padding:13px 16px}.builder-modal .live-total p{gap:18px;align-items:flex-start;padding:7px 5px}.builder-modal .live-total span,.builder-modal .live-total b{white-space:normal;overflow-wrap:anywhere}.builder-modal .live-total b{text-align:right}
.modal.builder-modal .form-grid.notes{padding-top:18px;padding-bottom:20px}.builder-modal .form-grid.notes textarea{min-height:92px}.builder-modal .modal-actions{flex:0 0 auto;background:#fff;position:sticky;bottom:0;z-index:2;padding:16px 28px}.builder-modal .modal-actions button{white-space:normal;line-height:1.25;min-width:120px}
@media(max-width:900px){.modal.builder-modal{width:min(760px,calc(100vw - 24px))}.modal.builder-modal .form-grid{grid-template-columns:1fr;padding:20px;gap:15px}.builder-modal .form-grid label.wide{grid-column:auto}.builder-modal .template-controls,.builder-modal .calc-area{grid-template-columns:1fr}.builder-modal .template-summary{grid-template-columns:1fr}.builder-modal .live-total{width:100%}.builder-modal .estimate-template{margin-left:20px;margin-right:20px}.builder-modal .items-title,.builder-modal .item-table{padding-left:20px;padding-right:20px}.builder-modal .calc-area{padding-left:20px;padding-right:20px}}
@media(max-width:700px){.modal-backdrop:has(.builder-modal){padding:0}.modal.builder-modal{width:100vw;max-width:none;height:100dvh;max-height:100dvh;border-radius:0}.builder-modal .modal-head{padding:14px 16px}.modal.builder-modal .form-grid{padding:16px;gap:13px}.builder-modal .estimate-template{margin-left:16px;margin-right:16px}.builder-modal .items-title{padding-left:16px;padding-right:16px;gap:10px;align-items:flex-start}.builder-modal .items-title button{white-space:normal}.builder-modal .item-table{padding-left:16px;padding-right:16px}.builder-modal .calc-area{padding-left:16px;padding-right:16px}.builder-modal input,.builder-modal select,.builder-modal textarea{font-size:16px}.builder-modal .modal-actions{padding:12px 16px}}
.document-workspace .doc-paper{width:210mm;min-height:297mm;margin:0 auto;padding:17mm 16mm;background:#fff;box-shadow:0 8px 26px #173c5b16}.document-workspace .standard-finance-doc{font-family:Arial,"Helvetica Neue",sans-serif;font-size:9pt;line-height:1.2;color:#111}.document-workspace .doc-preview{overflow:auto;background:#eef3f6;padding:18px}.document-workspace .doc-paper table{break-inside:auto}.document-workspace .doc-paper tr{break-inside:avoid}
@media print{@page{size:A4 portrait;margin:0}html,body,.app-shell,.workspace,.content,.document-workspace,.doc-grid,.doc-preview,.print-doc{width:210mm!important;min-width:210mm!important;max-width:210mm!important;margin:0!important;padding:0!important;background:#fff!important;background-image:none!important;box-shadow:none!important}.sidebar,.topbar,.document-workspace>.doc-hero,.document-workspace>.doc-message,.doc-list,.doc-toolbar,.toast,.modal-backdrop{display:none!important}.content>*:not(.document-workspace){display:none!important}.content>.document-workspace,.doc-preview,.print-doc{display:block!important}.document-workspace .doc-paper{display:block!important;width:210mm!important;min-height:297mm!important;margin:0!important;padding:15mm 16mm!important;border:0!important;box-shadow:none!important;background:#fff!important;background-image:none!important;color:#000!important}.document-workspace .doc-paper *{text-shadow:none!important;box-shadow:none!important}.document-workspace .doc-parties,.document-workspace .receipt-box,.document-workspace .doc-items th,.document-workspace .doc-totals p:last-child{background:#fff!important;background-image:none!important;color:#000!important}.document-workspace .doc-parties,.document-workspace .receipt-box{border:1px solid #777!important}.document-workspace .doc-items th{border:1px solid #333!important}.document-workspace .doc-totals p:last-child{border-top:2px solid #111!important;border-bottom:2px solid #111!important}.document-workspace .standard-finance-doc{font-size:9pt!important;line-height:1.15!important}.document-workspace .doc-title h1{font-size:16pt!important}.document-workspace .doc-letterhead h2{font-size:13pt!important}}

