.est-info,.est-start{display:flex;gap:18px;flex-wrap:wrap;align-items:end}.est-info label,.est-start label{flex:1;min-width:180px}.est-info{margin:18px 0}.est-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:20px 0}.est-metrics>div{border:1px solid #cad6e3;border-radius:10px;padding:20px;background:white}.est-metrics span{display:block;font-size:13px;color:#52677b;margin-bottom:8px}.est-metrics strong{font-size:24px}.est-metrics .est-bid{background:#17364c;color:white}.est-bid span{color:#d6e5f1}.est-reference{background:#eaf2fb;border-left:4px solid #2866bd;padding:14px 18px;margin-bottom:20px}.est-reference p{font-size:13px;margin:8px 0 0}.est-table-scroll{overflow:auto;margin:16px 0}.est-table{width:100%;border-collapse:collapse;min-width:680px}.est-table th{background:#17364c;color:white;font-size:12px;text-align:left;padding:12px}.est-table td{border-bottom:1px solid #dce4ed;padding:8px;vertical-align:middle}.est-table td:first-child{min-width:210px}.est-table input,.est-table select{margin:0;width:100%;min-width:85px;padding:9px;font-size:14px}.est-table td:first-child input{min-width:230px}.est-list{display:flex;align-items:center;gap:20px;margin:14px 0}.est-list>div{flex:1}.est-list h2{font-size:18px}.est-list p{font-size:13px}.est-list>strong{font-size:22px}#est-status{min-height:24px;color:#195e9b}#estimating-page .tabs{overflow:auto}#estimating-page h1{font-size:30px}#estimating-page .heading{gap:20px;flex-wrap:wrap}@media(max-width:800px){.est-metrics{grid-template-columns:repeat(2,1fr)}.est-metrics>div{padding:14px}.est-metrics strong{font-size:20px}.est-list{flex-wrap:wrap}.est-list>div{flex-basis:100%}#estimating-page h1{font-size:24px}}
/* Spreadsheet workspace */
.shell:has(.est-open){grid-template-columns:1fr}.shell:has(.est-open)>.sidebar{display:none}.main:has(.est-open){padding:12px;max-width:none}.main:has(.est-open)>.app-footer{display:none}.worksheet-top{display:flex;gap:12px;align-items:center;margin:0 0 10px}.worksheet-top>strong{flex:1;font-size:15px}.worksheet-top #est-status{font-size:12px;max-width:320px}.worksheet-top button{padding:8px 14px}.worksheet{display:grid;grid-template-columns:270px minmax(0,1fr);height:calc(100dvh - 145px);min-height:530px;border:1px solid #9aabb9;background:white;box-shadow:0 3px 12px #16304414}.database-pane{display:flex;flex-direction:column;min-height:0;min-width:0;background:#f2f4f6;border-right:2px solid #aebcc8;padding:8px;gap:7px}.database-title{font-weight:700;font-size:14px;padding:3px}.database-pane input,.database-pane select{margin:0;padding:7px;font-size:12px;min-height:32px}.database-caption{font-size:11px;color:#556575;padding:3px}.database-pane #database-items{overflow:auto;flex:1;min-height:100px;border:1px solid #b7c4ce;background:white}.database-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #d3dae0;border-radius:0;padding:6px 8px;font-weight:400;font-size:12px;white-space:normal;line-height:1.2;background:white}.database-item small{display:block;font-size:10px;color:#667789;margin-top:3px}.database-item:hover{background:#e7eff7}.database-item.selected{background:#165fc0;color:white}.database-item.selected small{color:#e7f1ff}#database-selection{border-top:1px solid #bac9d6;padding:9px 2px;font-size:12px}#database-selection p{margin:6px 0}#database-selection small{display:block;color:#637587}#database-selection label{font-size:12px;margin:8px 0}#database-selection button{width:100%;padding:8px}.database-import{font-size:11px;border-top:1px solid #b7c4ce;padding-top:8px}.database-import summary{cursor:pointer}.database-import p{font-size:11px}.database-import input{max-width:100%}.database-import button{padding:6px;margin-top:5px;font-size:11px}.worksheet-main{display:flex;flex-direction:column;min-width:0;min-height:0}.takeoff-context{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px;padding:10px;background:#f4f6f8;border-bottom:1px solid #aebbc7}.takeoff-context>div{grid-column:1/-1}.takeoff-context>div,.takeoff-context>label{display:flex;align-items:center;gap:6px;margin:0;font-size:12px}.takeoff-context b{width:65px;flex-shrink:0;font-weight:600}.takeoff-context input{padding:4px 7px;margin:0;border-radius:0;font-size:12px;min-height:27px;background:white}.worksheet-caption{background:#dde3e7;display:flex;justify-content:space-between;padding:6px 10px;font-size:12px;border-bottom:1px solid #b4c0c9}.worksheet-caption span{font-size:11px}.worksheet-body{flex:1;min-height:0;overflow:auto;padding:0}.worksheet-body h2,.worksheet-body>p,.worksheet-body>.est-info{margin:12px;font-size:13px}.worksheet-body h2{font-size:15px}.worksheet-body>button{margin:8px 12px}.worksheet .est-table-scroll{margin:0;overflow:visible}.worksheet .est-table{min-width:760px;font-size:12px}.worksheet .est-table th{background:#e1e3d8;color:#203142;border:1px solid #b8c0b9;padding:6px;font-weight:600;white-space:nowrap;position:sticky;top:0;z-index:1}.worksheet .est-table td{padding:3px 6px;border:1px solid #d0d4ca;background:#ffffe0;white-space:nowrap;height:29px}.worksheet .est-table td:first-child{min-width:0}.worksheet .est-table td:nth-child(2){max-width:330px;overflow:hidden;text-overflow:ellipsis}.worksheet .est-table input,.worksheet .est-table select{padding:3px 4px;min-height:24px;font-size:12px;border:1px solid transparent;border-radius:0;background:transparent;min-width:65px}.worksheet .est-table input:focus,.worksheet .est-table select:focus{background:white;border-color:#1261be;outline:1px solid #1261be}.worksheet .est-table button{font-size:12px;padding:0 6px;min-height:24px;background:transparent;border:0}.worksheet .est-metrics{display:flex;justify-content:flex-end;margin:0;border-top:1px solid #a4b4bf;gap:0;background:#edf1f4}.worksheet .est-metrics>div{padding:7px 18px;border:0;border-left:1px solid #c8d2da;border-radius:0;background:transparent}.worksheet .est-metrics span{font-size:10px;margin:0 0 2px}.worksheet .est-metrics strong{font-size:16px}.worksheet .est-metrics .est-bid{background:#193a50}.worksheet-tabs{display:flex;overflow:auto;flex-shrink:0;background:#d5dce2;border-top:1px solid #9babb8;padding:3px 3px 0}.worksheet-tabs button{white-space:nowrap;border-radius:6px 6px 0 0;border:1px solid #9fadb8;background:#e7e9de;font-size:12px;padding:9px 15px;margin-right:3px;color:#243748}.worksheet-tabs button.active{background:white;border-bottom:3px solid #1767bf;font-weight:700}.estimate-notes{display:block;margin:12px;font-size:13px}.estimate-notes textarea{width:100%;height:320px;margin-top:10px}.worksheet .est-info{padding:6px}.worksheet .est-info label{font-size:12px}.worksheet .est-info input,.worksheet .est-info select{padding:7px;font-size:13px}.worksheet-help{font-size:12px;color:#526777}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@media(max-width:800px){.worksheet{grid-template-columns:190px minmax(0,1fr)}.worksheet-top{flex-wrap:wrap}.worksheet-top>strong{flex-basis:60%}.worksheet-top #est-status{flex:1}.takeoff-context{grid-template-columns:1fr}.worksheet .est-metrics>div{padding:6px}.worksheet .est-metrics strong{font-size:12px}.worksheet .est-metrics{flex-wrap:wrap}.worksheet{height:calc(100dvh - 170px)}}@media(max-width:500px){.worksheet{grid-template-columns:140px minmax(0,1fr)}.database-pane{padding:4px}.database-item{font-size:11px}.takeoff-context b{width:42px;font-size:10px}.worksheet-caption span{display:none}.worksheet-top>strong{font-size:12px}.worksheet .est-metrics>div{width:50%}.worksheet-tabs button{padding:8px}.worksheet .est-info label{min-width:120px}}
.database-breadcrumb{padding:8px;font-size:11px;background:#e5e9dc;border-bottom:1px solid #aab8bd}.database-breadcrumb b{display:block;margin-top:4px}.database-breadcrumb button{font-size:11px;padding:3px 5px}.category-item{background:#ffffe0;font-size:13px;padding:9px 7px}.category-item span{float:right;font-size:17px}.library-empty{padding:12px;font-size:12px;line-height:1.5}.measure-dialog{width:min(1200px,95vw);max-width:95vw;max-height:92dvh;border:1px solid #9cacb7;border-radius:5px;padding:18px;background:#f4f5f6;color:#182e3d}.measure-dialog::backdrop{background:#17283888}.measure-dialog header,.measure-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:12px}.measure-dialog header h2{margin:0;font-size:20px}.measure-dialog h3{font-size:16px}.measure-dialog footer{justify-content:flex-end;padding-top:14px}.measure-dialog label{font-size:12px;display:block;margin:9px 0}.measure-dialog input,.measure-dialog select{font-size:13px;padding:7px;margin:4px 0;min-width:60px}.measure-dialog input{width:100%}.measure-inputs{display:flex;gap:16px;flex-wrap:wrap}.measure-inputs label{flex:1;min-width:100px}.measure-dialog label[hidden]{display:none}.measure-dialog p{font-size:12px}.measure-table{overflow:auto;margin:14px 0;border:1px solid #adb7bb;max-height:48dvh}.measure-table table{width:100%;border-collapse:collapse;font-size:13px;min-width:650px}.measure-table th{background:#dedfd1;padding:9px;text-align:left;position:sticky;top:0}.measure-table td{border:1px solid #c4c9bb;padding:6px;background:#fffef0}.measure-table small{display:block;color:#657788;font-size:10px}.measure-table td:first-child{min-width:220px}.measure-table input{max-width:90px}.measure-dialog [role=status]{padding:10px;background:#e4edf5;font-weight:600;font-size:14px}
.extension-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:8px;background:#f1f4f7;font-size:12px}.extension-controls label{display:flex;align-items:center;gap:6px;margin:0}.extension-controls input,.extension-controls select{font-size:12px;padding:5px;margin:0}.extension-controls button{padding:6px 10px;font-size:12px}.extension-controls input[type=checkbox],.measure-dialog input[type=checkbox],.est-table input[type=checkbox]{width:16px;min-width:16px;min-height:16px;accent-color:#287953}.worksheet .est-table input.rate-override{color:#1465c4;font-weight:700}.worksheet .est-table td:has(input[type=checkbox]:checked){background:#e0f0df}.worksheet .est-table .extension-detail td{background:#edf3f8}.extension-detail small{display:block;color:#657989;font-size:10px}.extension-subtotal{font-size:12px;padding:12px;border-top:1px solid #b8c4cf}.worksheet .est-table .deleted-takeoff td{color:#8694a0;background:#eee;text-decoration:line-through}.worksheet-menu{display:flex;gap:4px;background:#e7ebef;border:1px solid #afbdc8;border-bottom:0;font-size:13px;height:31px}.worksheet-menu details{position:relative}.worksheet-menu summary{padding:7px 15px;cursor:pointer;list-style:none}.worksheet-menu details[open]{background:white;z-index:10}.worksheet-menu details>button{display:block;width:210px;text-align:left;background:white;border-radius:0;font-size:12px;padding:10px;border:1px solid #bfccd6}.worksheet-menu details>button:hover{background:#e5effb}.worksheet{height:calc(100dvh - 176px)}
.worksheet-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:5px 8px;background:#edf1f5;border:1px solid #aab9c6;border-top:0}
.worksheet-toolbar button{padding:4px 9px;min-height:28px;font-size:12px;border-radius:3px}
.worksheet-toolbar>span{height:22px;border-left:1px solid #bac6d1;margin:0 4px}
.est-open:has(.worksheet-toolbar) .worksheet{height:calc(100dvh - 225px)}
.worksheet.database-hidden{grid-template-columns:minmax(0,1fr)}
.worksheet.database-hidden>.database-pane{display:none}
.worksheet.comfortable .est-table td{height:38px;padding:7px 8px}
.worksheet.comfortable .est-table input,.worksheet.comfortable .est-table select{min-height:30px;font-size:14px}
#source-catalog .catalog-body{max-height:45vh;overflow:auto}

.worksheet-menu-items{display:none;position:absolute;top:100%;left:0;width:230px;max-height:70vh;overflow:auto;background:white;border:1px solid #aab9c6;box-shadow:0 5px 12px #16304425}.worksheet-menu details[open]>.worksheet-menu-items{display:block}.worksheet-menu-items>button{display:block;width:100%;text-align:left;border:0;border-radius:0;background:white;padding:10px;font-size:12px}.worksheet-menu-items>button:hover{background:#e5effb}

.analysis-comparison{display:flex;gap:24px;flex-wrap:wrap;padding:16px;background:#eaf2fa;border-top:2px solid #bccbd8;font-size:14px}
.main:has(.est-schedule){max-width:none;padding:12px}.main:has(.est-schedule)>.app-footer{display:none}
.bid-schedule{display:flex;flex-direction:column;height:calc(100dvh - 105px);min-height:620px;border:1px solid #aab6bd;background:white}
.bid-schedule header{display:flex;align-items:center;gap:20px;padding:9px 12px;background:#edf1f4}.bid-schedule header h1{font-size:21px!important;margin:0}.bid-schedule header span{font-size:12px;color:#596c7b}
.schedule-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:7px;background:#e5e9ed;border-bottom:1px solid #bbc4cb}.schedule-toolbar label{display:flex;align-items:center;gap:6px;margin:0;font-size:12px}.schedule-toolbar input,.schedule-toolbar select{padding:5px;margin:0;font-size:12px}.schedule-toolbar button{padding:6px 10px;font-size:12px}
#schedule-create{padding:6px 12px;font-size:12px;background:#f5f7f9}#schedule-create summary{cursor:pointer}#schedule-create .est-start{padding:12px 0}#schedule-message{margin:0;padding:6px 12px;font-size:12px;min-height:28px;color:#245778}
.schedule-grid{flex:1;min-height:160px;overflow:auto}.schedule-grid table{min-width:1750px;width:100%;border-collapse:collapse;font-size:12px}.schedule-grid th{position:sticky;top:0;background:#e1e1d2;z-index:1;text-align:left;white-space:nowrap}.schedule-grid th,.schedule-grid td{border:1px solid #bfc3b8;padding:3px 6px;height:30px}.schedule-grid td{background:#ffffe0}.schedule-grid td:first-child{background:#e1e1d2;text-align:right}.schedule-grid .numeric{text-align:right;white-space:nowrap}.schedule-grid input,.schedule-grid select{border:1px solid transparent;border-radius:0;background:white;font-size:12px;padding:4px;margin:0;min-height:25px;width:100%}.schedule-grid input:focus,.schedule-grid select:focus{border-color:#1763b4}.schedule-grid [data-track=notes]{min-width:200px}.schedule-grid [data-track=nextPrice]{width:110px;text-align:right}.schedule-grid button{padding:3px 6px;font-size:12px;white-space:nowrap}.schedule-grid th button,.schedule-job{border:0;background:transparent;text-align:left}.schedule-job{min-width:230px;color:#123a58}.schedule-grid tr:hover td{background:#edf4fb}

.schedule-totals{background:#e1e1d2;border-top:2px solid #aab4ae;padding:0 8px 6px;overflow:auto}.schedule-totals table{width:100%;border-collapse:collapse;font-size:12px}.schedule-totals th,.schedule-totals td{padding:3px 12px;border-bottom:1px solid #c1c6bd;text-align:right}.schedule-totals th:first-child{text-align:left}.schedule-totals caption{text-align:left;font-weight:bold;padding:6px}.schedule-totals small{display:block;margin:5px;font-size:12px}.schedule-grand{font-weight:bold;border-top:2px solid #8b9d9a}
.schedule-totals th{font-size:12px;font-weight:700;background:#e1e1d2}
.schedule-toolbar [data-schedule="template"]{background:#eff7f0;border-color:#d6e5d8}
.schedule-toolbar [data-schedule="template"]:hover{background:#e4f0e6;border-color:#b9d3be}
.schedule-grid th:last-child,.schedule-grid td:last-child{position:sticky;right:0;background:#ffffe0;box-shadow:-2px 0 2px #bfc3b850;white-space:nowrap}.schedule-grid th:last-child{z-index:2;background:#e1e1d2}

/* Prioritize the material list and offer a full-window browsing mode. */
.worksheet:not(.database-hidden){grid-template-columns:clamp(320px,30vw,520px) minmax(0,1fr)}
.database-pane{gap:4px}
.database-title{display:flex;align-items:center;justify-content:space-between;gap:8px}
.database-title button{font-size:11px;padding:4px 7px;min-height:26px}
.database-pane #database-items{flex:1 1 0;min-height:240px}
.database-pane .category-item{padding:5px 8px;font-size:12px;min-height:28px}
.database-pane .database-item{margin:0;line-height:1.2}
.database-pane .database-breadcrumb{position:sticky;top:0;padding:5px 8px;z-index:1}
.database-pane #database-selection{padding:2px;font-size:11px}
.database-pane>button{font-size:11px;padding:4px 8px;min-height:27px}
.database-pane.materials-expanded{position:fixed;inset:8px;z-index:40;border:1px solid #aebcc8;box-shadow:0 0 0 8px #f2f4f6;padding:10px}
.database-pane.materials-expanded #database-items{min-height:0}
.database-pane:has(#source-catalog details[open]) #source-catalog{flex:1;min-height:180px;display:flex;flex-direction:column}
.database-pane #source-catalog details[open]{display:flex;flex-direction:column;min-height:0;height:100%}
.database-pane #source-catalog .catalog-body{max-height:none;min-height:0;overflow:auto;flex:1}
.database-pane:has(#source-catalog details[open]) #database-items{flex:0 1 130px;min-height:70px}
@media(max-width:800px){.worksheet:not(.database-hidden){grid-template-columns:240px minmax(0,1fr)}}
@media(max-width:500px){.worksheet:not(.database-hidden){grid-template-columns:180px minmax(0,1fr)}.database-title{flex-wrap:wrap}.database-pane.materials-expanded{inset:4px}}

/* Compact the material browser filters by 20%. */
.database-pane #est-group,.database-pane #est-search,.database-pane #est-kind{font-size:9.6px;padding:5.6px;min-height:25.6px;border-radius:6px}

/* Keep native details content inside its own scrollport. */
.database-pane{overflow:auto}
.database-pane> :not(#database-items):not(#source-catalog){flex-shrink:0}
.database-pane:has(#source-catalog details[open]) #source-catalog{display:block;flex:1 1 180px;min-height:100px;overflow:auto;isolation:isolate}
.database-pane #source-catalog details[open]{display:block;height:auto;min-height:0}
.database-pane #source-catalog .catalog-body{display:block;max-height:none;overflow:visible}
.database-pane #source-catalog summary{position:sticky;top:0;z-index:1;background:#f2f4f6;padding:4px 0}
.database-pane #database-items{isolation:isolate}

/* Keep menus beside the job identity so the material browser starts higher. */
.worksheet-top{display:grid;grid-template-columns:auto minmax(120px,1fr) auto auto;gap:10px;align-items:center;margin-bottom:6px}
.worksheet-top>strong{min-width:0;overflow-wrap:anywhere}
.worksheet-top-tools{min-width:0}
.worksheet-top-tools .worksheet-menu{height:auto;border:0;background:transparent;gap:0}
.worksheet-top-tools .worksheet-menu summary{padding:5px 9px;white-space:nowrap}
.worksheet-top-tools .worksheet-toolbar{border:0;background:transparent;padding:2px 0;gap:3px}
.worksheet-top-tools .worksheet-toolbar button{padding:3px 7px;font-size:11px;min-height:26px;white-space:nowrap}
.worksheet-save{display:flex;gap:8px;align-items:center}
.worksheet-save #est-status{max-width:150px}
@media(max-width:1250px){.worksheet-top{grid-template-columns:auto minmax(100px,1fr) auto}.worksheet-top-tools{grid-row:2;grid-column:1/-1}.worksheet-save{grid-column:3;grid-row:1}.worksheet-top-tools .worksheet-toolbar{display:inline-flex}.worksheet-top-tools .worksheet-menu{display:flex;flex-wrap:wrap}}
@media(max-width:600px){.worksheet-top{grid-template-columns:auto minmax(0,1fr)}.worksheet-save{grid-row:2;grid-column:1/-1;justify-content:flex-end}.worksheet-top-tools{grid-row:3}.worksheet-top-tools .worksheet-menu summary{padding:5px 7px}.worksheet-save #est-status{max-width:none}}

.editable-takeoff{cursor:pointer}.worksheet .editable-takeoff:hover>td{background:#e9f2fc}.worksheet .est-table .takeoff-edit-name{text-align:left;color:#175da4;text-decoration:underline;text-underline-offset:3px;white-space:normal}

/* Dense assembly worksheets with one scrolling material table and visible actions. */
.measure-dialog.compact-takeoff{width:min(1500px,97vw);max-width:97vw;max-height:94dvh;padding:10px}
.compact-takeoff form{display:flex;flex-direction:column;max-height:calc(94dvh - 24px);gap:5px;min-height:0}
.compact-takeoff header,.compact-takeoff footer{flex-shrink:0;padding:0;gap:8px}
.compact-takeoff header h2{font-size:16px;margin:0}
.compact-takeoff h3{font-size:12px;margin:0}
.compact-takeoff p{margin:2px 0;font-size:11px;line-height:1.3}
.compact-takeoff .assembly-source{color:#647383;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compact-takeoff .assembly-name-row{display:flex;align-items:center;gap:10px;margin:2px 0;font-weight:600;flex-shrink:0}
.compact-takeoff .assembly-name-row input{flex:1;min-width:0}
.compact-takeoff input,.compact-takeoff select{padding:2px 5px;margin:0;min-height:25px;font-size:12px;border-radius:2px}
.compact-takeoff button{padding:4px 12px;min-height:28px;font-size:12px}
.compact-takeoff .measure-inputs{gap:12px;flex-shrink:0}
.compact-takeoff .measure-inputs label{display:flex;align-items:center;gap:6px;flex:0 1 auto;margin:2px 0;font-size:12px}
.compact-takeoff .measure-inputs input{width:85px}
.compact-takeoff .measure-table{flex:1 1 auto;min-height:90px;max-height:none;overflow:auto;margin:3px 0}
.compact-takeoff .measure-table table{font-size:12px;min-width:900px}
.compact-takeoff .measure-table th,.compact-takeoff .measure-table td{padding:3px 5px;line-height:1.2;height:25px}
.compact-takeoff .measure-table td:first-child{min-width:0}
.compact-takeoff .measure-table th{z-index:1}
.compact-takeoff .measure-table .rate-cell{white-space:nowrap}
.compact-takeoff .rate-cell input{width:78px;min-width:60px;margin-right:3px}
.compact-takeoff [role=status]{flex-shrink:0;margin:0;padding:4px 6px;font-size:12px}
.compact-takeoff [role=status]:empty{display:none}
@media(max-width:600px){.compact-takeoff .assembly-name-row{flex-wrap:wrap}.compact-takeoff .measure-inputs{gap:6px}.compact-takeoff .measure-inputs label{font-size:11px}}

#measure-more{margin-right:auto}.assembly-picker .picker-list{overflow:auto;min-height:200px;max-height:60dvh;border:1px solid #b7c4ce}.assembly-picker .picker-list button.database-item{padding:5px 8px}.compact-takeoff label[hidden]{display:none}
.worksheet .est-table td:has([data-field^="crew."]) small{display:block;font-size:10px;color:#647383;white-space:nowrap}
.worksheet .est-table select[data-field$=".fringeType"]{min-width:115px}
.worksheet .est-table input[data-field^="crew."]{min-width:70px}

.topbar:has(.estimate-header-identity){justify-content:flex-start;gap:18px;flex-wrap:wrap}
.topbar:has(.estimate-header-identity)>.row{margin-left:auto}
.estimate-header-identity{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.estimate-header-identity>button{padding:6px 12px;font-size:13px;white-space:nowrap}
.estimate-header-identity>strong{font-size:15px;overflow-wrap:anywhere;min-width:0}
.worksheet-top.identity-in-header{display:flex;justify-content:flex-end;flex-wrap:wrap}
.worksheet-top.identity-in-header .worksheet-top-tools{margin-right:auto}
@media(max-width:600px){.topbar:has(.estimate-header-identity){gap:8px}.estimate-header-identity{flex-basis:100%;gap:8px}.estimate-header-identity>strong{font-size:13px}}

/* A five-percent reduction across the estimating workspace and its dialogs. */
.shell:has(#estimating-page){zoom:.95}
body:has(#estimating-page) .measure-dialog{zoom:.95}

/* Adjustable divider between materials and the estimate worksheet. */
.worksheet:not(.database-hidden){grid-template-columns:var(--database-width,clamp(320px,30vw,520px)) 8px minmax(0,1fr);}
.database-resizer{position:relative;cursor:col-resize;touch-action:none;background:#e3e9ee;border-left:1px solid #aebcc8;border-right:1px solid #aebcc8;min-height:0;}
.database-resizer::after{content:'';position:absolute;top:50%;left:2px;width:2px;height:42px;transform:translateY(-50%);border-left:1px solid #68849a;border-right:1px solid #68849a;}
.database-resizer:hover,.database-resizer:focus-visible,.resizing-database .database-resizer{background:#bed8ee;outline:2px solid #367bb0;outline-offset:-2px;}
.resizing-database,.resizing-database *{cursor:col-resize!important;user-select:none!important;}
.worksheet.database-hidden>.database-resizer,.worksheet:has(.materials-expanded)>.database-resizer{display:none;}
.worksheet:has(.materials-expanded):not(.database-hidden){grid-template-columns:var(--database-width,clamp(320px,30vw,520px)) minmax(0,1fr);}
.worksheet:not(.database-hidden)>.worksheet-main{grid-column:3;grid-row:1;}
.worksheet:has(.materials-expanded):not(.database-hidden)>.worksheet-main{grid-column:2;}

/* Compact, optional job information. */
.worksheet .job-info{padding:4px 6px}
.worksheet .job-info .est-info{gap:8px;margin:0 0 5px;padding:0;align-items:center}
.worksheet .job-info .est-info label{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px;align-items:center;margin:0;font-size:12px;min-width:200px}
.worksheet .job-info .est-info input,.worksheet .job-info .est-info select{box-sizing:border-box;width:100%;min-width:0;height:25px;min-height:0;padding:2px 5px;margin:0;font-size:12px}
.job-info .job-info-hint{margin:4px 0 6px;font-size:11px;color:#586c7d}
.job-info-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:6px;align-items:start}
.job-info-groups details{min-width:0;margin:0;padding:5px 6px;border:1px solid #bac9d5;background:#f6f8fa}
.job-info-groups summary{font-weight:700;font-size:12px;padding:3px 0;cursor:pointer;user-select:none}
.job-info-groups summary:focus-visible{outline:2px solid #1767bf;outline-offset:2px}
.job-section-fields{padding-top:5px}
.job-info-groups label{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;gap:4px;margin:0 0 2px;font-size:12px;line-height:1.15}
.job-info-groups label:last-child{margin-bottom:0}
.job-info-groups input,.job-info-groups select{box-sizing:border-box;min-width:0;width:100%;height:24px;min-height:0;padding:1px 4px;font-size:12px;margin:0;border-radius:3px}
.worksheet .job-info-groups button.small{min-height:24px;padding:2px 6px;margin:0 0 4px;font-size:11px}
.job-info>p:last-child{font-size:11px;margin:6px 0 0}

.compact-takeoff .measurement-information{margin:8px 0 10px}
.compact-takeoff .measurement-information h4{font-size:12px;font-weight:500;margin:0 0 5px}
.compact-takeoff .measurement-information table{border-collapse:collapse;width:310px;max-width:100%;table-layout:fixed;font-size:12px}
.compact-takeoff .measurement-information th,.compact-takeoff .measurement-information td{border:1px solid #adb4aa;padding:2px 5px}
.compact-takeoff .measurement-information th{background:#e1e1d2;font-weight:500;text-align:left}
.compact-takeoff .measurement-information th:first-child{width:60%}
.compact-takeoff .measurement-information td:first-child{background:#ffffe8}
.compact-takeoff .measurement-information input{box-sizing:border-box;width:100%;min-width:0;min-height:0;height:23px;margin:0;padding:1px 3px;border:0;border-radius:0;background:transparent;text-align:right;font-size:12px}
.compact-takeoff .measurement-information input:focus{outline:2px solid #1767bf;background:white}

.compact-takeoff .measurement-heading{display:flex;align-items:center;gap:18px;margin-bottom:5px}
.compact-takeoff .measurement-heading h4{margin:0}
.compact-takeoff .measurement-heading .reverse-takeoff{display:flex;align-items:center;gap:5px;font-size:12px;margin:0}
.compact-takeoff .measurement-information .reverse-takeoff input{width:14px;height:14px;min-height:0;margin:0;accent-color:#1767bf}

.worksheet .est-table .reverse-takeoff-row>td{background:#fff0f0;color:#9c2424}
.worksheet .est-table .reverse-takeoff-row:hover>td{background:#ffe2e2}
.worksheet .est-table .reverse-takeoff-row .takeoff-edit-name,.worksheet .est-table .reverse-takeoff-row input{color:#9c2424}
.reverse-takeoff-badge{display:inline-block;margin-left:6px;padding:1px 5px;border:1px solid #e6a7a7;border-radius:3px;background:#ffe1e1;color:#922020;font-size:10px;font-weight:700;vertical-align:middle}

.measure-dialog.compact-takeoff{resize:both;overflow:auto;min-width:min(560px,95vw);min-height:450px;height:min(850px,94dvh);box-sizing:border-box}
.compact-takeoff form{height:100%;max-height:none;min-width:0}
.compact-takeoff .measure-table .component-number{width:34px;min-width:34px;text-align:center;background:#e1e1d2;padding:0}
.compact-takeoff .component-number button{padding:0;width:100%;min-height:25px;border:0;background:transparent;border-radius:0;color:inherit}
.compact-takeoff [data-component]{cursor:pointer}
.compact-takeoff .measure-table .component-selected>td{background:#cfe4fc;color:#143e68}
.compact-takeoff .component-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex-shrink:0;font-size:12px}
.compact-takeoff .component-actions small{color:#586c7d}
.compact-takeoff footer{padding-right:12px}

.worksheet .extension-grid{table-layout:fixed;border-collapse:collapse;min-width:0;font-size:12px}
.worksheet .extension-grid th{position:sticky;top:0;height:23px;padding:2px 5px;background:#e1e1d2;color:#152e40;text-transform:none;letter-spacing:0;font-weight:400;border:1px solid #aeb4a7;white-space:nowrap;overflow:visible}
.worksheet .extension-grid td{background:#ffffe0;height:22px;padding:0 3px;border:1px solid #b7bcaf;white-space:nowrap;overflow:hidden}
.worksheet .extension-grid td:first-child,.worksheet .extension-grid td:nth-child(2){min-width:0;max-width:none}
.worksheet .extension-grid input,.worksheet .extension-grid select{box-sizing:border-box;width:100%;min-width:0;height:22px;min-height:0;padding:1px 2px;font-size:12px;border:0;border-radius:0;margin:0;background:transparent}
.worksheet .extension-grid input[type=number]{text-align:right;appearance:textfield}
.worksheet .extension-grid input[type=number]::-webkit-inner-spin-button{appearance:none}
.worksheet .extension-grid input[type=checkbox]{width:14px;height:14px;min-height:0;display:block;margin:auto}
.worksheet .extension-grid input:focus,.worksheet .extension-grid select:focus{outline:2px solid #1767bf;background:white}
.worksheet .extension-grid input:invalid{outline:1px solid #b42323;background:#fff0f0}
.worksheet .extension-grid [data-ext-cell=materialTotal],.worksheet .extension-grid [data-ext-cell=hoursTotal],.worksheet .extension-grid [data-ext-cell=totalWeight]{text-align:right;background:#ffffe0}
.worksheet .extension-grid .extension-row-number{background:#e1e1d2;text-align:center}
.worksheet .extension-grid .extension-row-number button{padding:0 2px;min-height:20px;font-size:11px}
.extension-column-resizer{position:absolute;right:0;top:0;width:8px;height:100%;cursor:col-resize;touch-action:none;z-index:2}
.extension-column-resizer:hover,.extension-column-resizer:focus-visible{background:#1767bf55;outline:1px solid #1767bf}
.worksheet .extension-grid-scroll{margin:4px 0;overflow:auto}

/* Keep material descriptions visible while the other columns scroll. */
.worksheet .extension-grid tr>td:nth-child(2){position:sticky;left:0;z-index:2;background:#ffffe0;box-shadow:2px 0 0 #aeb4a7}
.worksheet .extension-grid tr.extension-detail>td:nth-child(2){background:#edf3f8}
.worksheet .extension-grid thead th:nth-child(2){left:0;z-index:4;box-shadow:2px 0 0 #aeb4a7}

/* Scroll the Extension grid in both directions under its fixed headings. */
.worksheet-body:has(>#extension-content){overflow:hidden}
#extension-content{height:100%;min-height:0;display:flex;flex-direction:column}
#extension-content>.extension-controls,#extension-content>.worksheet-help,#extension-content>.extension-subtotal{flex-shrink:0}
#extension-content>.extension-grid-scroll{flex:1;min-height:0;overflow:auto}
.worksheet .extension-grid thead th{position:sticky;top:0;z-index:3}
.worksheet .extension-grid thead th:nth-child(2){z-index:4}

.worksheet .extension-grid td[data-ext-cell="tradePrice"],.worksheet .extension-grid td[data-ext-cell="labor"]{background:#fff}
.worksheet .extension-grid td[data-ext-cell]:focus-within{background:#dcecff;box-shadow:inset 0 0 0 2px #4b8bd3}
.worksheet .extension-grid td[data-ext-cell] input:focus,.worksheet .extension-grid td[data-ext-cell] select:focus{background:transparent;outline:none}

/* Unsaved values use bold blue text without changing cell backgrounds. */
.worksheet .extension-grid td[data-ext-cell].extension-cell-changed,
.worksheet .extension-grid td[data-ext-cell].extension-cell-changed input,
.worksheet .extension-grid td[data-ext-cell].extension-cell-changed select{color:#175fc9;font-weight:700}

/* Compact direct labor worksheet. */
.direct-labor-grid .direct-labor-help{margin:4px 6px;font-size:11px;line-height:1.3}
.worksheet .direct-labor-grid .est-table{table-layout:fixed;min-width:1050px;font-size:12px}
.worksheet .direct-labor-grid .est-table th{height:22px;padding:1px 3px;font-weight:400;text-transform:none;letter-spacing:0;text-align:center;background:#e1e1d2}
.worksheet .direct-labor-grid .est-table td{height:22px;padding:0 3px;text-align:right;border:1px solid #b7bcaf;background:#ffffdf}
.worksheet .direct-labor-grid .est-table th:first-child{width:32px}
.worksheet .direct-labor-grid .est-table th:nth-child(2){width:15%}
.worksheet .direct-labor-grid .est-table th:nth-child(3){width:5%}
.worksheet .direct-labor-grid .est-table th:nth-child(9){width:95px}
.worksheet .direct-labor-grid .est-table th:last-child{width:64px}
.worksheet .direct-labor-grid .est-table td:first-child{background:#e1e1d2;text-align:center}
.worksheet .direct-labor-grid .est-table td:nth-child(2){text-align:left}
.worksheet .direct-labor-grid .est-table td:has(input),.worksheet .direct-labor-grid .est-table td:has(select){background:white}
.worksheet .direct-labor-grid .est-table input,.worksheet .direct-labor-grid .est-table select{width:100%;min-width:0;min-height:0;height:21px;box-sizing:border-box;padding:0 2px;margin:0;border:0;border-radius:0;font-size:12px}
.worksheet .direct-labor-grid .est-table input[type=number]{text-align:right;appearance:textfield}
.worksheet .direct-labor-grid .est-table input[type=number]::-webkit-inner-spin-button{appearance:none}
.worksheet .direct-labor-grid .est-table input::placeholder{color:#52677b;opacity:1}
.worksheet .direct-labor-grid .est-table td:focus-within{background:#dcecff}
.worksheet .direct-labor-grid .est-table button{min-height:0;height:21px;padding:0 3px;font-size:11px}
.direct-labor-actions{display:flex;gap:6px;padding:5px 6px}
.worksheet .direct-labor-actions button{min-height:25px;padding:3px 8px;font-size:11px;margin:0}

.worksheet .incidental-labor-grid .est-table{min-width:680px}
.worksheet .incidental-labor-grid .est-table th:nth-child(2){width:30%}
.worksheet .incidental-labor-grid .est-table th:nth-child(3){width:auto}

/* Column sizing shared by estimating tables; Extension retains its existing sizing. */
.worksheet .worksheet-body .worksheet-resizable-table{table-layout:fixed;min-width:0;max-width:none}
.worksheet .worksheet-body .worksheet-resizable-table th{position:sticky;width:auto;min-width:0;max-width:none;overflow:visible;padding-right:9px}
.worksheet .worksheet-body .worksheet-resizable-table td{min-width:0;max-width:none;overflow:hidden;text-overflow:ellipsis}
.worksheet .worksheet-body .worksheet-resizable-table td input,.worksheet .worksheet-body .worksheet-resizable-table td select{box-sizing:border-box;min-width:0;max-width:100%;width:100%}

.worksheet .worksheet-body td:has(input[type=number]:not(:disabled):not([readonly])):focus-within{background:#dcecff;box-shadow:inset 0 0 0 2px #4b8bd3}
.worksheet .worksheet-body td input[type=number]:focus{background:transparent;outline:none;border-color:transparent}

/* Unsaved numeric edits use text emphasis only, matching Extension. */
.worksheet input.worksheet-number-changed{color:#175fc9;font-weight:700}

.compact-takeoff .measurement-information td:has(input[type=number]){background:#fff}

.compact-takeoff .measure-table td:has([data-formula]),.compact-takeoff .measure-table td:has([data-factor]),.compact-takeoff .measure-table td:has([data-divisor]),.compact-takeoff .measure-table td:has([data-basis]){background:white}
.compact-takeoff .measure-table [data-formula],.compact-takeoff .measure-table [data-factor],.compact-takeoff .measure-table [data-divisor]{box-sizing:border-box;width:100%;min-width:55px;max-width:100px;margin:0;padding:1px 3px;height:24px;font-size:12px}

.compact-takeoff .rate-cell input[readonly]{border:0;background:transparent;box-shadow:none;color:inherit;pointer-events:none}

/* Keep aligned Extension totals at the bottom, even with a short material list. */
.worksheet .extension-grid{height:100%}
.worksheet .extension-grid thead tr,.worksheet .extension-grid tr[data-ext-row],.worksheet .extension-grid tfoot tr{height:24px}
.worksheet .extension-grid .extension-grid-spacer{height:auto}
.worksheet .extension-grid .extension-grid-spacer>td{height:auto;background:white;border:0;padding:0}
.worksheet .extension-grid tfoot td{position:sticky;bottom:0;z-index:3;background:#e1e1d2;border:1px solid #aeb4a7;border-top:2px solid #9ca897;text-align:right;font-weight:700;height:24px}
.worksheet .extension-grid tfoot td:nth-child(2){left:0;z-index:4;background:#e1e1d2;text-align:left}

/* Labor totals share the table columns and remain at the viewport bottom. */
.worksheet-body:has(>.direct-labor-grid){overflow:hidden}
.worksheet .direct-labor-grid{height:100%;min-height:0;display:flex;flex-direction:column}
.worksheet .direct-labor-grid>.est-table-scroll{flex:1;min-height:0;overflow:auto}
.worksheet .direct-labor-grid>.direct-labor-help,.worksheet .direct-labor-grid>.direct-labor-actions{flex-shrink:0}
.worksheet .direct-labor-grid .est-table{height:100%}
.worksheet .direct-labor-grid .est-table tr{height:22px}
.worksheet .direct-labor-grid .est-table .labor-grid-spacer{height:auto}
.worksheet .direct-labor-grid .est-table .labor-grid-spacer>td{height:auto;padding:0;border:0;background:white}
.worksheet .direct-labor-grid .est-table tfoot td{position:sticky;bottom:0;z-index:3;height:24px;background:#e1e1d2;border:1px solid #aeb4a7;border-top:2px solid #9ca897;font-weight:700;text-align:right}
.worksheet .direct-labor-grid .est-table tfoot td:nth-child(2){text-align:left}

.worksheet .general-expenses-grid .est-table{min-width:400px}
.worksheet .general-expenses-grid .est-table th:first-child{width:65%}
.worksheet .general-expenses-grid .est-table th:nth-child(2){width:auto}
.worksheet .general-expenses-grid .est-table th:last-child{width:64px}
.worksheet .general-expenses-grid .est-table tbody td:first-child{background:white;text-align:left}
.worksheet .general-expenses-grid .est-table td:nth-child(2){text-align:right}
.worksheet .general-expenses-grid .est-table tfoot td:first-child{text-align:left}
.worksheet .general-expenses-grid .est-table tfoot td:nth-child(2){text-align:right}

/* Takeoff totals exclude deleted items and include reverse takeoffs. */
.worksheet-body:has(>.takeoff-totals-grid){overflow:hidden}
.worksheet .takeoff-totals-grid{height:100%;min-height:0;display:flex;flex-direction:column}
.worksheet .takeoff-totals-grid>.extension-controls{flex-shrink:0}
.worksheet .takeoff-totals-grid>.est-table-scroll{flex:1;min-height:0;overflow:auto}
.worksheet .takeoff-totals-grid .est-table{height:100%}
.worksheet .takeoff-totals-grid .est-table tr{height:28px}
.worksheet .takeoff-totals-grid .est-table .labor-grid-spacer{height:auto}
.worksheet .takeoff-totals-grid .est-table .labor-grid-spacer>td{height:auto;padding:0;border:0;background:white}
.worksheet .takeoff-totals-grid .est-table tfoot td{position:sticky;bottom:0;z-index:3;height:24px;background:#e1e1d2;border:1px solid #aeb4a7;border-top:2px solid #9ca897;font-weight:700;text-align:left}

/* Pin each totals band as one row throughout vertical scrolling. Leave room
   for keyboard-focused cells so they cannot disappear behind the totals. */
.worksheet :is(.extension-grid-scroll,.direct-labor-grid>.est-table-scroll,.takeoff-totals-grid>.est-table-scroll){isolation:isolate;scroll-padding-bottom:32px;scroll-padding-top:32px}
.worksheet :is(.extension-grid,.direct-labor-grid .est-table,.takeoff-totals-grid .est-table)>tfoot{position:sticky;bottom:0;z-index:5;background:#e1e1d2}
.worksheet :is(.extension-grid,.direct-labor-grid .est-table,.takeoff-totals-grid .est-table)>tfoot td{box-shadow:inset 0 2px #9ca897;background:#e1e1d2}

.compact-takeoff .rate-cell input[data-missing-rate]{background:#fff;border:1px solid #b86b18;pointer-events:auto;min-width:80px}

.worksheet .incidental-labor-grid .est-table{min-width:1250px}
.worksheet .incidental-labor-grid .est-table th:nth-child(2){width:24%}

.worksheet .general-expenses-grid .est-table{min-width:1750px}
.worksheet .general-expenses-grid .est-table th:first-child{width:32px}
.worksheet .general-expenses-grid .est-table th:nth-child(2){width:270px}
.worksheet .general-expenses-grid .est-table th:nth-child(3){width:60px}
.worksheet .general-expenses-grid .est-table th:nth-child(5){width:120px}
.worksheet .general-expenses-grid .est-table th:nth-child(13){width:160px}
.worksheet .general-expenses-grid .est-table td:nth-child(2),.worksheet .general-expenses-grid .est-table tfoot td:nth-child(2){text-align:left}
.worksheet .general-expenses-grid .est-table tfoot td{text-align:right}
.worksheet .general-expenses-grid .est-table tr.expense-alarm td:nth-child(2){box-shadow:inset 3px 0 #ce7900;background:#fff2d8}

.additional-grid .est-table{min-width:1550px;table-layout:fixed;}
.additional-grid .est-table th:first-child{width:32px;}
.additional-grid .est-table th:nth-child(2){width:280px;}
.additional-grid .est-table th:last-child{width:64px;}
.additional-grid td:has([data-additional-result]){background:#ffffe8;text-align:right;}
.additional-grid input,.additional-grid select{background:white;}

.worksheet-body:has(.final-pricing-grid){overflow:hidden;}
.final-pricing-grid{height:100%;min-height:0;display:flex;flex-direction:column;}
.worksheet .final-pricing-grid .est-table-scroll{flex:1;min-height:0;overflow:auto;}
.worksheet .final-pricing-grid .est-table{min-width:1100px;table-layout:fixed;}
.worksheet .final-pricing-grid th:first-child{width:270px;}
.worksheet .final-pricing-grid th:nth-last-child(2){width:65px;}
.worksheet .final-pricing-grid th:last-child{width:85px;}
.worksheet .final-pricing-grid th,.worksheet .final-pricing-grid td{height:22px;padding:1px 4px;}
.worksheet .final-pricing-grid td{background:#ffffe8;}
.worksheet .final-pricing-grid td:has(input),.worksheet .final-pricing-grid td:has(select){background:white;}
.worksheet .final-pricing-grid input,.worksheet .final-pricing-grid select{width:100%;border:0;border-radius:0;min-height:20px;padding:0 2px;background:white;font-size:inherit;}
.worksheet .final-pricing-grid input[type=number],.worksheet .final-pricing-grid td:not(:first-child){text-align:right;}
.worksheet .final-pricing-grid input::placeholder{color:#253e4c;opacity:1;}
.final-pricing-grid .pricing-subtotal td{font-weight:700;border-top:1px solid #9aa899;}
.worksheet .final-pricing-grid tfoot td{position:sticky;bottom:0;background:#e1e1d2;font-weight:700;z-index:5;border-top:2px solid #9aa899;}
.pricing-gst{display:flex;gap:12px;padding:5px;}
.pricing-gst input{max-width:250px;}

.worksheet .final-pricing-grid .est-table input,.worksheet .final-pricing-grid .est-table select{min-height:0;height:20px;padding:0 2px;background:white;}
.worksheet .final-pricing-grid .est-table input[type=number]{appearance:textfield;}
.worksheet .final-pricing-grid input::-webkit-inner-spin-button{appearance:none;}
.worksheet .final-pricing-grid .est-table td:has(input),.worksheet .final-pricing-grid .est-table td:has(select){background:white;}
.worksheet .final-pricing-grid .est-table td,.worksheet .final-pricing-grid .est-table th{padding:0 4px;height:22px;}
.worksheet .final-pricing-grid .est-table tfoot td{background:#e1e1d2;}

/* Source-owned alarm indicators stay red, including while edits are highlighted. */
.est-table .alarm-cell-active,.est-table .alarm-active{background:#e32616!important;color:#fff!important;font-weight:700!important;}
.est-table span.alarm-active{display:block;text-align:center;}

/* Compact default-template editor, isolated from estimate worksheets. */
.estimate-template-dialog{width:min(1040px,96vw);max-height:92vh;overflow:auto;padding:14px;box-sizing:border-box;font-size:13px}
.estimate-template-dialog h2{font-size:18px;margin:0 0 8px}
.estimate-template-dialog h3{font-size:14px;margin:12px 0 6px}
.estimate-template-dialog p{margin:6px 0;line-height:1.4}
.estimate-template-dialog .template-help{color:#43596c;font-size:12px}
.estimate-template-dialog .template-table-wrap{overflow-x:auto}
.estimate-template-dialog table{width:100%;min-width:0;border-collapse:collapse;table-layout:fixed}
.estimate-template-dialog th,.estimate-template-dialog td{padding:5px 6px;height:auto;vertical-align:middle}
.estimate-template-dialog th{font-size:12px;letter-spacing:0;text-transform:none;text-align:left}
.estimate-template-dialog input,.estimate-template-dialog select{box-sizing:border-box;width:100%;min-width:0;min-height:28px;height:28px;margin:0;padding:3px 6px;font-size:13px}
.estimate-template-dialog button{min-height:28px;padding:4px 9px;font-size:12px;margin:0}
.estimate-template-dialog #template-add{margin-top:5px}
.estimate-template-dialog .template-crew-table th:first-child{width:24%}
.estimate-template-dialog .template-crew-table th:nth-child(6){width:16%}
.estimate-template-dialog .template-crew-table th:last-child{width:76px}
.estimate-template-dialog .template-pricing-table th:first-child{width:18%}
.estimate-template-dialog .template-pricing-table th:nth-child(2),.estimate-template-dialog .template-pricing-table th:nth-child(3){width:95px}
.estimate-template-dialog .template-description{font-size:12px;line-height:1.35;color:#43596c}
.estimate-template-dialog .template-actions{position:sticky;bottom:-14px;display:flex;gap:8px;justify-content:flex-end;background:#fff;padding:10px 0 4px;border-top:1px solid #d5dee5}
@media(max-width:680px){.estimate-template-dialog table{min-width:620px}}

.estimate-lock-notice{padding:5px 10px;background:#fff3cf;color:#604500;font-size:12px;border-bottom:1px solid #d6c99d}.estimate-in-use{display:block;color:#b45345;font-size:11.55px}

.commodity-dialog {width:min(1280px,96vw);max-width:96vw;max-height:94vh;padding:16px;color:#183447}.commodity-dialog h2{margin:0 0 8px}.commodity-dialog p{margin:8px 0;font-size:13px}.commodity-controls{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:10px 0}.commodity-controls label{display:flex;flex-direction:column;gap:4px;font-size:12px}.commodity-table-wrap{max-height:52vh;overflow:auto;border:1px solid #afbdc8}.commodity-dialog table{border-collapse:collapse;width:100%;font-size:12px}.commodity-dialog th,.commodity-dialog td{padding:5px 7px;border-bottom:1px solid #d6dde2;text-align:left}.commodity-dialog thead th{position:sticky;top:0;background:#e5e8dd;z-index:1}.commodity-dialog td input[type=number]{width:100px}.commodity-dialog input,.commodity-dialog select{padding:5px;min-height:28px}.commodity-dialog iframe{width:100%;height:65vh;border:0}.commodity-dialog .template-actions{position:sticky;bottom:0;background:white;padding:10px 0}.commodity-link-dialog{max-width:750px;max-height:85vh}.commodity-link{display:block;margin:8px 0}.commodity-dialog button{padding:6px 10px}

#commodity-source{width:320px}.commodity-dialog .template-actions{display:flex;gap:8px}.commodity-dialog td small{color:#617386}
/* Grouped display leaves number inputs, validation and saved values intact. */
.number-display{position:relative;display:inline-block;width:100%;min-width:0;vertical-align:middle}
.number-display>input{width:100%;box-sizing:border-box}
.number-display:not(:focus-within)>input{color:transparent!important;-webkit-text-fill-color:transparent}
.number-display:not(:focus-within)>input::placeholder{color:transparent!important}
.number-display-label{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-end;padding:0 5px;pointer-events:none;font:inherit;white-space:nowrap;overflow:hidden}
.number-display:focus-within>.number-display-label{display:none}
.number-display.number-placeholder>.number-display-label{color:#64748b}
.number-display:has(>.worksheet-number-changed)>.number-display-label,
.extension-cell-changed .number-display-label{color:#0066ff;font-weight:700}
.final-pricing-grid [data-pricing-result="overhead.calculatedRate"],
.final-pricing-grid [data-pricing-result="markup.calculatedRate"]{color:#0066ff;font-weight:700}

.designation-entry{display:flex;align-items:center;gap:4px}.designation-entry .database-item{flex:1;min-width:0}.designation-tools{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}

.measure-dialog.temporary-item-editor{height:auto;min-height:0;max-width:1000px}.temporary-item-editor .measure-inputs{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px 14px}.temporary-item-editor .measure-inputs label{display:block;min-width:0}.temporary-item-editor .measure-inputs input,.temporary-item-editor .measure-inputs select{width:100%;box-sizing:border-box}.temporary-item-editor output{display:block;padding:6px 0;font-weight:600}

/* Job-specific takeoff breakdown selectors. */
.takeoff-context.accubid-context{display:flex;flex-direction:column;gap:3px;padding:6px 10px}.accubid-context>div{display:grid;grid-template-columns:92px minmax(0,1fr);gap:8px}.accubid-context b{width:auto}.accubid-context button{padding:2px 5px;min-height:24px;font-size:11px;border-radius:0;background:#e1e3d8;text-align:left}.accubid-context select{width:100%;min-width:0;min-height:24px;padding:2px 6px;margin:0;font-size:11px;border-radius:0;background:white}.accubid-context select:disabled{opacity:1;color:#203142}.accubid-context small{font-size:10px;color:#526575}.context-options-dialog{width:min(600px,90vw)}.context-options-dialog textarea{width:100%;font-size:12px}

.measure-dialog.temporary-item-editor{width:min(760px,95vw);min-width:0;padding:12px;resize:both}
.temporary-item-editor header h2{font-size:17px}.temporary-item-editor form>p{margin:7px 0;font-size:11px}
.temporary-fields{max-height:72dvh;overflow:auto;background:white;border:1px solid #b5b8ad}
.temporary-fields table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:12px}
.temporary-fields th,.temporary-fields td{border:1px solid #c6c8bd;padding:0 5px;height:25px}
.temporary-fields thead th{background:#e2e3d4;text-align:left;position:sticky;top:0}
.temporary-fields th:first-child,.temporary-fields td:first-child{width:25px;text-align:right;background:#e2e3d4}
.temporary-fields th:nth-child(2){width:175px}.temporary-fields tbody th{font-weight:400;text-align:left;background:#ffffe7}
.temporary-item-editor .temporary-fields input,.temporary-item-editor .temporary-fields select{display:block;box-sizing:border-box;width:100%;min-width:0;height:24px;min-height:0;margin:0;padding:2px 3px;border:0;border-radius:0;font-size:12px;background:white;color:#142f43}
.temporary-item-editor .temporary-fields input:focus,.temporary-item-editor .temporary-fields select:focus{outline:2px solid #2466b5;outline-offset:-2px}
.temporary-item-editor .temporary-fields input[type=number]{text-align:right}.temporary-item-editor .temporary-fields output{padding:2px 3px;text-align:right;font-weight:400}
.temporary-item-editor [role=status]:empty{display:none}.temporary-item-editor footer{padding-top:8px}



.schedule-grid thead th{position:relative}.schedule-grid .schedule-column-resizer{position:absolute;right:-3px;top:0;bottom:0;width:7px;cursor:col-resize;z-index:5;touch-action:none}.schedule-grid .schedule-column-resizer:hover,.schedule-grid .schedule-column-resizer:focus{background:#4a8dc4;outline:0}.schedule-grid td{overflow:hidden;text-overflow:ellipsis}.schedule-grid [data-edit-job]{cursor:context-menu}.schedule-grid table{min-width:0}

/* Compact tabs wrap when needed so every section stays accessible. */
.worksheet-tabs{flex-wrap:wrap;gap:2px;overflow:visible;padding:2px;min-height:0}
.worksheet-tabs button{flex:0 1 auto;min-width:0;margin:0;padding:6px 8px;line-height:1.2}

/* Keep readable tab labels on one compact line. */
.worksheet-tabs{flex-wrap:nowrap;gap:1px;overflow-x:auto;overflow-y:hidden}
.worksheet-tabs button{flex:0 0 auto;padding:6px 5px;margin:0}

/* Shared numbered column for all takeoff category lists. */
.database-pane .database-item:has(>.assembly-category-number),.takeoff-library .library-results>button:has(>.assembly-category-number),.assembly-picker .picker-list button.database-item:has(>.assembly-category-number),.assembly-category-gap{position:relative;box-sizing:border-box;height:21px;min-height:21px;padding:0 7px 0 38px;line-height:20px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.assembly-category-number{position:absolute;left:0;top:0;bottom:0;display:flex;align-items:center;justify-content:center;width:30px;margin:0;border-right:1px solid #aca899;box-sizing:border-box;background:#e1e3d8;color:inherit;font-size:12px;font-weight:400;font-variant-numeric:tabular-nums}
.assembly-category-gap{padding-top:0;padding-bottom:0;border-bottom:1px solid #c9cdbf;background:#ffffe0;font-size:12px;box-sizing:border-box}
/* Temporary assembly editor: two compact database/component panes. */
dialog.temporary-assembly-editor{width:calc(100vw - 20px);max-width:none;height:calc(100dvh - 12px);max-height:none;padding:8px 10px;background:#f0f0f0;border:1px solid #aeb4b8;border-radius:8px;color:#000;font:12px Arial,sans-serif;resize:both;overflow:hidden}
.temporary-assembly-editor>form{height:100%;display:flex;flex-direction:column;gap:5px}
.temporary-assembly-editor header{padding:0;height:24px;min-height:24px}.temporary-assembly-editor header h2{font:12px Arial,sans-serif;margin:0;padding:0}
.temporary-assembly-columns{display:grid;grid-template-columns:40% minmax(0,60%);gap:10px;flex:1;min-height:0;padding-right:10px}
.temporary-assembly-browser,.temporary-assembly-components{min-width:0;min-height:0;display:flex;flex-direction:column}
.temporary-assembly-editor .temporary-assembly-name{display:flex;align-items:center;gap:5px;margin:0 0 5px;height:25px;font-size:12px}
.temporary-assembly-editor .temporary-assembly-name input{width:216px;height:21px;min-height:0;margin:0;padding:1px 4px;border-radius:0;font-size:12px;background:white}
.temporary-assembly-grid{flex:1;min-height:0;overflow:auto;border:1px solid #aca899;background:#ffffe0}
.temporary-assembly-grid table{width:100%;min-width:600px;table-layout:fixed;border-collapse:collapse;font:12px Arial,sans-serif}
.temporary-assembly-grid th,.temporary-assembly-grid td{height:21px;box-sizing:border-box;border:1px solid #aca899;padding:0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:20px}
.temporary-assembly-grid th{position:sticky;top:0;z-index:1;background:#e1e1d2;font-weight:400;text-align:center;text-transform:none;letter-spacing:0}
.temporary-assembly-grid td{background:#ffffe0}.temporary-assembly-grid td:first-child{background:#e1e1d2;text-align:center}.temporary-assembly-grid td:nth-child(n+3){background:white}.temporary-assembly-grid tr.selected td:nth-child(2){background:#e1e1d2}
.temporary-assembly-editor .temporary-assembly-grid input,.temporary-assembly-editor .temporary-assembly-grid select{display:block;width:100%;height:20px;min-height:0;max-width:none;padding:0 2px;margin:0;border:0;border-radius:0;font:12px Arial,sans-serif;background:transparent}
.temporary-assembly-editor button{font:11px Arial,sans-serif;min-height:21px;height:21px;padding:1px 14px;border:1px solid #ccc;border-radius:4px;background:#fafafa;color:#123654}
.temporary-assembly-actions{display:flex;gap:5px;margin-top:8px;height:24px}.temporary-assembly-editor footer{padding:0;justify-content:flex-end;gap:5px}.temporary-assembly-editor footer button{min-width:72px}.temporary-assembly-editor form>[role=status]{margin:0;padding:0;min-height:0;background:transparent;color:#a32a22}.temporary-assembly-editor form>[role=status]:empty{display:none}
.embedded-assembly-picker,.embedded-assembly-picker>section{display:flex;flex-direction:column;flex:1;min-height:0}
.temporary-assembly-editor .embedded-assembly-picker header,.embedded-assembly-picker>section>.measure-inputs:nth-of-type(2),.embedded-assembly-picker>section>p:not([role=status]){display:none}
.temporary-assembly-editor .embedded-assembly-picker .measure-inputs{display:flex;gap:8px;margin:0 0 5px;min-height:25px;align-items:center}
.temporary-assembly-editor .embedded-assembly-picker .measure-inputs label{display:flex;align-items:center;gap:5px;flex:1;min-width:0;font-size:11px;margin:0}
.temporary-assembly-editor .embedded-assembly-picker .measure-inputs input,.temporary-assembly-editor .embedded-assembly-picker .measure-inputs select{width:100%;min-width:0;min-height:21px;height:21px;padding:0 3px;font:12px Arial,sans-serif;margin:0;border-radius:0}
.embedded-assembly-picker .picker-breadcrumb{background:#e1e1d2;border:1px solid #aca899;min-height:21px;font-size:12px;white-space:nowrap;overflow:hidden}.temporary-assembly-editor .picker-breadcrumb button{border:0;background:transparent;padding:0 5px}
.temporary-assembly-editor .embedded-assembly-picker .picker-list{flex:1;min-height:0;max-height:none;background:repeating-linear-gradient(to bottom,#ffffe0 0px,#ffffe0 20px,#aca899 20px,#aca899 21px);border:1px solid #aca899;border-top:0}
.temporary-assembly-editor .embedded-assembly-picker .picker-list button.database-item{width:100%;height:21px;min-height:21px;border:0;border-bottom:1px solid #aca899;border-radius:0;text-align:left;font:12px Arial,sans-serif;line-height:20px;padding:0 4px;background:#ffffe0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.temporary-assembly-editor .embedded-assembly-picker .picker-list button.database-item:has(>.assembly-category-number){padding-left:44px}.temporary-assembly-editor .assembly-category-number{width:40px}.temporary-assembly-editor .embedded-assembly-picker .picker-list small{display:none}.embedded-assembly-picker .picker-list>p:empty{display:none}.temporary-assembly-editor .embedded-assembly-picker [role=status]{margin:0;padding:2px;font-size:11px;min-height:21px;background:transparent}
@media print{body.printing-temporary-assembly>*:not(.temporary-assembly-editor){display:none!important}body.printing-temporary-assembly .temporary-assembly-editor{position:static;display:block;width:100%;height:auto;border:0;overflow:visible}body.printing-temporary-assembly .temporary-assembly-browser,body.printing-temporary-assembly footer,body.printing-temporary-assembly .temporary-assembly-actions{display:none}body.printing-temporary-assembly .temporary-assembly-columns{display:block}body.printing-temporary-assembly .temporary-assembly-grid{overflow:visible}body.printing-temporary-assembly .temporary-assembly-grid tr:not([data-component]){display:none}}

.temporary-assembly-editor .embedded-assembly-picker label[hidden]{display:none}.temporary-browser-actions{display:flex;gap:5px;margin-top:8px;height:24px}.temporary-assembly-editor .embedded-assembly-picker .picker-list .picker-selected{background:#e1e1d2}.temporary-assembly-editor .embedded-assembly-picker .measure-inputs label{font-weight:400;flex:none}.temporary-assembly-editor .embedded-assembly-picker .measure-inputs select{width:218px}.temporary-assembly-editor .temporary-assembly-name{font-weight:400}
/* Classic estimating worksheet typography and contrast. */
.est-open,.bid-schedule,.measure-dialog,.estimate-template-dialog,.commodity-dialog{font-family:Arial,Helvetica,sans-serif;--ink:#000;color:#000}
.est-open :is(button,input,select,textarea),.bid-schedule :is(button,input,select,textarea),.measure-dialog :is(button,input,select,textarea),.estimate-template-dialog :is(button,input,select,textarea),.commodity-dialog :is(button,input,select,textarea){font-family:Arial,Helvetica,sans-serif}
.worksheet .est-table,.schedule-grid table,.schedule-totals table{font-family:Arial,Helvetica,sans-serif;font-size:12px;color:#000}
.worksheet .est-table th,.schedule-grid th,.schedule-totals th{color:#000;font-size:12px;letter-spacing:0;text-transform:none;font-weight:400;background:#e1e1d2}
.worksheet .est-table :is(td,th),.schedule-grid :is(td,th),.schedule-totals :is(td,th){border-color:#aca899}
.worksheet .est-table :is(input,select),.schedule-grid :is(input,select){font-family:Arial,Helvetica,sans-serif;color:#000;font-size:12px}
.worksheet .est-table .number-placeholder>.number-display-label,.worksheet .final-pricing-grid input::placeholder{color:#000;opacity:1}
.worksheet .est-table .worksheet-number-changed,.worksheet .est-table .extension-cell-changed,.worksheet .est-table .extension-cell-changed :is(input,select),.worksheet .est-table .number-display:has(>.worksheet-number-changed)>.number-display-label,.worksheet .est-table .extension-cell-changed .number-display-label{color:#0000ff}
.worksheet .final-pricing-grid td{background:#ffffe0}
.worksheet .final-pricing-grid td:has(input),.worksheet .final-pricing-grid td:has(select){background:#fff}
.worksheet .final-pricing-grid tfoot td{background:#e1e1d2}
.worksheet-tabs button{font-family:Arial,Helvetica,sans-serif;color:#000}

/* Collapse controls remain visible while database contents are tucked away. */
.takeoff-panel-controls{display:flex;justify-content:flex-end;gap:4px;flex-shrink:0}
.database-pane .takeoff-panel-controls button,.takeoff-library .takeoff-panel-controls button{width:27px;min-width:27px;min-height:25px;margin:0;padding:3px 0;text-align:center;font:12px Arial,sans-serif;border:1px solid #adbdc9;border-radius:3px;background:white;color:#000}
.takeoff-panel-collapsed>.database-pane>:not(.takeoff-panel-controls),.takeoff-panel-collapsed>.takeoff-library>:not(.takeoff-panel-controls){display:none!important}
.takeoff-panel-collapsed>.database-resizer,.takeoff-panel-collapsed>.takeoff-resizer{display:none}
.worksheet.takeoff-panel-collapsed:not(.database-hidden){grid-template-columns:76px minmax(0,1fr)}
.worksheet.takeoff-panel-collapsed:not(.database-hidden)>.worksheet-main{grid-column:2}

/* Accubid-style compact rows on both electrical and mechanical bid schedules. */
.bid-schedule .schedule-grid :is(th,td){box-sizing:border-box;height:22px;padding:0 4px;line-height:18px;white-space:nowrap;vertical-align:middle}
.bid-schedule .schedule-grid :is(input,select,button){box-sizing:border-box;height:20px;min-height:20px;max-height:20px;margin:0;padding:0 4px;font-size:12px;line-height:18px;border-radius:2px;vertical-align:middle}
.bid-schedule .schedule-grid th button{height:20px;min-height:20px}
.bid-schedule .schedule-totals :is(th,td){box-sizing:border-box;height:22px;padding:0 8px;line-height:20px;white-space:nowrap}
