/* Budget worksheet: dense desktop layout, bounded scrolling, explicit numbers. */
#modal.b575-dialog{width:min(98vw,1880px)!important;max-width:1880px!important;height:min(96dvh,1100px);max-height:96dvh;}
#modal.b575-dialog .modal-body{padding:12px 16px!important;overflow:auto;}
#modal.b575-dialog .modal-header{padding:12px 18px!important;min-height:50px;}
#modal.b575-dialog .modal-footer{padding:10px 16px!important;}
.b575-meta{margin:0 0 10px;border:1px solid #d9e3ec;border-radius:8px;padding:8px 12px;background:#f7fafc;}
.b575-meta summary{cursor:pointer;font-size:12px;color:#40596e;}
.b575-meta .budget528-grid{padding-top:10px;grid-template-columns:2fr 1fr 3fr;gap:10px;}
.b575-meta .budget528-wide{grid-column:auto;}
.b575-meta input,.b575-meta select{min-height:34px!important;padding:5px 8px!important;}
.b575-summary{position:sticky;top:-12px;z-index:5;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;background:#fff;border:1px solid #d6e3eb;border-radius:9px;box-shadow:0 3px 12px #1738490a;margin-bottom:10px;overflow:hidden;min-height:72px;}
.b575-summary>div{padding:10px 12px;border-right:1px solid #e4ebf0;min-width:0;}
.b575-summary>div:last-child{border:0;background:#f1f7f6;}
.b575-summary span{font-size:11px;color:#577083;display:block;font-weight:500;}
.b575-summary strong{font-size:clamp(15px,1.25vw,21px);line-height:1.5;white-space:nowrap;display:block;font-variant-numeric:tabular-nums;}
.b575-summary small{font-size:10px;line-height:1.3;display:block;color:#647b8c;}
.b575-summary.is-pending{min-height:72px;display:flex;align-items:center;padding:12px;background:#f6f9fb;}
.b575-summary>span{padding:16px;}
.b575-scroll{max-height:calc(96dvh - 290px);min-height:150px;overflow:auto;border:1px solid #d5e1e9;border-radius:8px;scrollbar-gutter:stable;overscroll-behavior:contain;}
.b575-table{border-collapse:separate!important;border-spacing:0!important;table-layout:fixed;min-width:1240px;width:100%;font-size:11px;line-height:1.3;}
.b575-table th,.b575-table td{box-sizing:border-box;border-bottom:1px solid #e5ebf1;border-right:1px solid #edf1f5;padding:6px 7px!important;vertical-align:middle;white-space:normal;}
.b575-table thead{position:sticky;top:0;z-index:4;}
.b575-table th{background:#eaf1f6;color:#29485d;font-size:10px;font-weight:650;text-align:right;height:28px;}
.b575-table .b575-bands th{background:#dfeaf1;text-align:center;letter-spacing:.02em;}
.b575-table .b575-bands th:nth-last-child(3){background:#dbece8;}
.b575-table tbody:nth-of-type(even)>tr:first-child>td{background-color:#fafcfd;}
.b575-table tbody>tr:first-child:hover>td{background-color:#f0f7fa;}
.b575-table .b575-index{width:29px;color:#6b8192;text-align:center;}
.b575-table .b575-name{width:242px;text-align:left;position:sticky;left:0;z-index:2;background:#fff;box-shadow:2px 0 0 #dde7ee;}
.b575-table th.b575-name{background:#dfeaf1;z-index:5;}
.b575-table .b575-name small{display:block;font-size:10px;color:#688194;white-space:normal;line-height:1.2;}
.b575-table .b575-group{width:90px;}
.b575-table .b575-quantity{width:82px;}
.b575-table .b575-unit{width:55px;}
.b575-table .b575-detail-col{width:36px;}
.b575-table tbody>tr:first-child>td{height:38px;}
.b575-table td.b575-calculated{background:#f5f8fb;}
.b575-number{font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap!important;font-size:11px;}
.b575-number small{display:block;font-size:9px;opacity:.82;}
.b575-table input,.b575-table select{width:100%;min-width:0;min-height:28px!important;height:28px;padding:3px 5px!important;font-size:11px!important;border:1px solid transparent!important;box-shadow:none;border-radius:4px;background:transparent;color:inherit;}
.b575-table input:focus,.b575-table select:focus{border-color:#0a7d8b!important;outline:2px solid #0a7d8b30;background:white;}
.b575-table input::placeholder{color:#7890a0;font-size:10px;}
.b575-table input[name=s_quantity],.b575-table input[data-c561-inline=quantity],.b575-table input[data-c561-inline=unitPrice]{text-align:right;font-variant-numeric:tabular-nums;}
.b575-table .b575-service-link,.b575-table .b575-name button{display:block!important;border:0!important;background:none!important;box-shadow:none!important;padding:0!important;min-height:22px!important;width:100%;text-align:left;line-height:1.3;color:#075a70;font-size:11px!important;font-weight:650;border-radius:3px;white-space:normal;}
.b575-table .b575-name button:hover{text-decoration:underline;}
.b575-table td:last-child>.btn{min-height:28px;padding:1px 8px;font-size:15px;}
.b575-stage{display:block;padding:3px 5px;border-radius:4px;font-size:10px;line-height:1.2;}
.b575-tone-0{background:#e1eff6!important;color:#25576c!important;}.b575-tone-1{background:#e7e8f6!important;color:#514b8a!important;}.b575-tone-2{background:#f5ead8!important;color:#7b5923!important;}.b575-tone-3{background:#e0f0e9!important;color:#2f6c50!important;}.b575-tone-4{background:#f2e4ee!important;color:#83466d!important;}.b575-tone-5{background:#e9eff1!important;color:#466575!important;}
.b575-positive{color:#116d51!important;}.b575-negative{color:#aa353b!important;}.b575-row-status{font-size:9px!important;color:#9a620d!important;}
.b575-table [data-b575-detail]>td{padding:12px 16px!important;background:#f8fbfd;}
.b575-table [data-b575-detail][hidden]{display:none!important;}
.b575-table .budget528-grid{display:grid;grid-template-columns:2fr 1fr 2fr;gap:10px;max-width:1050px;}
.b575-table .budget528-grid input,.b575-table .budget528-grid select{border:1px solid #ccdce6!important;background:#fff;min-height:34px!important;}
.b575-table .budget528-grid label{font-size:11px;}
.b575-table .budget528-wide{grid-column:1/-1;}
.b575-table .b574-line-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0;}
.b575-table .b574-line-actions .btn{min-height:30px;font-size:11px;padding:5px 10px;}
.b575-table tfoot{position:sticky;bottom:0;z-index:3;}
.b575-table tfoot td{background:#eaf2f5;font-size:10px;color:#486578;padding:8px 12px!important;}
.b575-note{font-size:10px;line-height:1.5;color:#607a8e;margin:8px 0;}
.b575-actions{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:8px 0;}
.b575-actions h3{font-size:14px;margin:0;}
.b575-actions .btn{font-size:11px;min-height:32px;padding:6px 10px;}
.b575-caption{font-size:11px;color:#526f83;margin:4px 0 8px;}
.b575-dialog .budget528-save{margin-top:10px;padding:8px 10px;background:#f8fafc;border-radius:8px;}
.b575-dialog .budget528-save textarea{min-height:46px;max-height:90px;}
.b575-dialog .budget528-check{font-size:11px;}
.b575-dialog .c561-stage{font-size:11px;margin:0 0 8px;}
.b575-dialog .c561-actions{gap:6px;margin:8px 0;}
.b575-dialog .c561-actions .btn{font-size:11px;min-height:32px;padding:5px 10px;}
.b575-dialog .b574-commercial-meta{margin:0 0 10px;}
.b575-dialog .c561-note{padding:8px 12px;font-size:11px;margin-bottom:8px;}
@media(max-width:1350px) and (min-width:761px){.b575-table{min-width:1160px;font-size:10px;}.b575-table .b575-name{width:205px;}.b575-table .b575-group{width:75px;}.b575-table th,.b575-table td{padding:5px!important;}.b575-number{font-size:10px;}.b575-summary>div{padding:8px;}}
@media(max-width:760px){#modal.b575-dialog{width:100vw!important;max-width:100vw!important;height:100dvh;max-height:100dvh;border-radius:0;margin:0;}#modal.b575-dialog .modal-body{padding:10px!important;}.b575-summary{position:relative;top:0;grid-template-columns:repeat(2,minmax(0,1fr));min-height:0;}.b575-summary strong{font-size:16px;}.b575-summary>div{padding:8px;min-height:65px;border-bottom:1px solid #e4ebf0;}.b575-scroll{max-height:55dvh;min-height:200px;}.b575-table{min-width:1360px;}.b575-table .b575-name{width:190px;}.b575-table tbody>tr:first-child>td{height:48px;}.b575-table input,.b575-table select{min-height:44px!important;height:44px;}.b575-table .b575-name button{min-height:44px!important;}.b575-table .budget528-grid{grid-template-columns:1fr;}.b575-meta .budget528-grid{grid-template-columns:1fr;}.b575-actions .btn,.b575-dialog .c561-actions .btn{min-height:44px;}.b575-table th small{font-size:9px;}}

/* Keep the worksheet stable while debounced read-only calculations resolve. */
.b575-dialog .fl26-launchbar,.b575-dialog .ux667-form-help{display:none!important}
.b575-summary>div{min-height:70px;min-width:0}
.b575-summary.is-pending{display:grid;min-height:84px}
.b575-summary strong{min-height:24px}
.b575-summary small{min-height:16px}
.b575-table .b575-unit{width:66px!important;min-width:66px}
.b575-table select{padding-left:4px!important;padding-right:17px!important;background-position:right 3px center!important}
.b575-totals th,.b575-totals td{font-weight:700;font-size:11px;white-space:nowrap;text-align:right;padding:6px 5px!important;background:#e7f1f4;color:#173b4c;border-top:2px solid #147888}
.b575-totals th{text-align:left}
.b575-totals small{display:block;font-size:9px;font-weight:400}
.b575-table .b575-name>small{display:none}
.b575-table .b575-name:hover>small,.b575-table .b575-name:focus-within>small{display:block;position:absolute;background:white;box-shadow:0 2px 6px #0002;padding:3px 5px;z-index:5}
@media(min-width:1100px){.b575-table [data-b575-row]>td{height:35px;padding-top:3px!important;padding-bottom:3px!important}.b575-table .b575-name button{font-size:11px!important;line-height:1.2!important}.b575-summary strong{font-size:19px}}

.b575-summary.is-pending{padding:0;align-items:stretch;min-height:72px}
.b575-summary>div{height:90px}
@media(max-width:760px){.b575-summary>div{height:88px}}

.b575-readonly .b575-summary{position:relative;top:0}.b575-readonly .b575-scroll{max-height:64vh}.b575-readonly{width:100%;min-width:0}.b575-readonly .b575-name b{color:#184a5a;font-size:11px}

.b575-table select{appearance:none!important;-webkit-appearance:none!important;background-size:10px!important}

/* The shared session shell applies its own dialog width after render. Match the
   actual commercial worksheet content, not only an impermanent shell class. */
#modal:has(#commercial561-dialog .b575-table){width:min(98vw,1880px)!important;max-width:1880px!important;height:min(96dvh,1100px)!important;max-height:96dvh!important}
#modal:has(#commercial561-dialog .b575-table) .modal-body{padding:12px 16px!important}
#modal:has(#commercial561-dialog .b575-table) .fl26-launchbar,#modal:has(#commercial561-dialog .b575-table) .ux667-form-help{display:none!important}
#modal:has(#commercial561-dialog .b575-table) .c561-actions{gap:6px;margin:8px 0}
#modal:has(#commercial561-dialog .b575-table) .c561-actions .btn{font-size:11px;min-height:32px;padding:5px 10px}
#modal:has(#commercial561-dialog .b575-table) .b574-commercial-meta{padding:7px 10px;margin:0 0 10px}
.b575-table .b575-number{overflow:visible!important;text-overflow:clip!important}
@media(max-width:760px){#modal:has(#commercial561-dialog .b575-table){width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0;border-radius:0}#modal:has(#commercial561-dialog .b575-table) .c561-actions .btn{min-height:44px}#modal:has(#commercial561-dialog .b575-table) .modal-body{padding:10px!important}}
