/* Bindr's estimate workspace: matching layer tones and a page-scrolling Visits header. */
@media screen {
 #excelEstimateWorkspace .excel-input-wrap{display:block;position:relative}
 #excelEstimateWorkspace .excel-overridden:after{content:"";position:absolute;right:0;top:0;border-top:6px solid #bc560c;border-left:6px solid transparent;pointer-events:none}
 #excelEstimateWorkspace .excel-reset{display:none;position:absolute;right:2px;top:2px;width:25px;min-height:27px;padding:0;border:0;border-radius:2px;background:#fff3e8;color:#8a3d05;cursor:pointer}
 #excelEstimateWorkspace .excel-overridden:focus-within .excel-reset{display:block}
 #excelEstimateWorkspace .excel-overridden:focus-within input{padding-right:28px}
 #excelEstimateWorkspace .excel-sheet td.excel-selected{background:#fff5e9;box-shadow:inset 0 0 0 1px #e6b88e}
 #excelEstimateWorkspace .excel-sheet td.excel-active{box-shadow:inset 0 0 0 2px #b34d00}
 #excelEstimateWorkspace .excel-sheet input[type=number]{appearance:textfield;-moz-appearance:textfield}
 #excelEstimateWorkspace .excel-sheet input::-webkit-inner-spin-button,#excelEstimateWorkspace .excel-sheet input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
 #excelEstimateWorkspace .excel-view-controls button:disabled{opacity:.4;cursor:default}
}
@media screen {
 #saveExitEstimate,#knockUpButton{display:none!important}
 .frozen-estimate.bindr-excel-open #estimateDetailsPanel{display:none}
 .frozen-estimate #estimateView .estimate-sticky-controls{position:static;box-shadow:none}
 .excel-column-name{font-size:.875rem!important;font-weight:650!important;color:inherit!important}
 .estimate-workspace-switch{display:flex;align-items:center;justify-content:center;width:max-content;max-width:100%;margin:12px auto 0;padding:6px 0;border:0;border-radius:0;background:transparent;box-shadow:none;position:sticky;top:var(--estimate-sticky-top,0px);z-index:4}
 .estimate-workspace-tabs{display:flex;align-items:center;justify-content:center;gap:6px}
 .estimate-workspace-switch .btn{background:#f7f9fb;color:var(--bindr-text);border-color:var(--bindr-border);min-height:36px}
 .estimate-workspace-switch .btn:hover{background:#e5eaf0}
 .estimate-workspace-switch .btn:focus-visible{outline:2px solid #b34d00;outline-offset:2px}
 .estimate-workspace-switch .btn[aria-pressed=true]{background:var(--bindr-accent);color:#181c23}
 /* Keep save announcements accessible without adding text beside the view buttons. */
 #estimateWorkspaceStatus{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
 #estimateView .estimate-sticky-controls{position:sticky;top:calc(var(--estimate-sticky-top,0px) + var(--estimate-switch-height,54px));z-index:3;background:#eef1f4;box-shadow:0 3px 6px rgba(31,42,53,.1)}
 .frozen-estimate .estimate-workspace-switch{display:none!important}
 body.bindr-excel-open .topbar{position:static!important}
 #excelEstimateWorkspace{min-width:0;max-width:100%;color:var(--bindr-text)}
 .excel-heading,.excel-view-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
 .excel-heading{margin:8px 0;gap:10px}.excel-heading h2{margin:0;font-size:1.125rem;flex:1 0 auto}
 .excel-segment{display:flex;gap:3px;padding:3px;background:#d3d9e1;border-radius:6px}
 .excel-segment button{font:600 .875rem/1.4 inherit;font-family:inherit;font-size:.875rem;font-weight:600;padding:8px 12px;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--bindr-text);cursor:pointer}
 .excel-segment button[aria-pressed=true]{background:white;border-color:#b4bdc9;box-shadow:inset 0 -2px var(--bindr-accent)}
 .excel-metrics,.excel-programme{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:white;border:1px solid var(--bindr-border);border-radius:8px;margin:12px 0;overflow:hidden}
 .excel-metrics>div,.excel-programme>div{padding:12px 16px;border-right:1px solid var(--bindr-border);min-width:0}
 .excel-metrics>div:last-child,.excel-programme>div:last-child{border-right:0}
 .excel-metrics span,.excel-programme span{display:block;font-size:.8125rem;color:var(--bindr-muted);margin-bottom:4px}
 .excel-metrics strong{font-size:1.375rem;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
 .excel-programme{grid-template-columns:repeat(5,minmax(0,1fr));background:#eef1f5}.excel-programme strong{font-size:1.0625rem;font-variant-numeric:tabular-nums}
 #excelEstimateWorkspace .excel-help{font-size:.8125rem;margin:8px 0 14px;color:var(--bindr-muted)}
 .excel-compare-panel{border:1px solid var(--bindr-border);border-radius:8px;background:white;margin:12px 0}
 .excel-compare-panel>summary{cursor:pointer;font-size:.875rem;font-weight:650;padding:10px 14px;background:#d7dce2;border-left:4px solid var(--bindr-accent);border-radius:6px}
 .excel-comparison-scroll{max-width:100%;overflow-x:auto}.excel-comparison{border-collapse:collapse;width:100%;font-size:.875rem;font-variant-numeric:tabular-nums;white-space:nowrap}
 .excel-comparison caption{text-align:left;padding:8px 12px;font-size:.8125rem;color:var(--bindr-muted)}
 .excel-comparison th,.excel-comparison td{padding:8px 12px;border-bottom:1px solid #dbe1e8;text-align:right}
 .excel-comparison th:first-child{text-align:left;min-width:180px}.excel-comparison thead th{background:#eef1f5;font-size:.8125rem;font-weight:600;color:#475363}
 .excel-comparison small{display:block;font-size:.75rem;color:var(--bindr-muted);font-weight:400}
 .excel-loss{color:#a52d27}
 .excel-sheet-toolbar{display:flex;align-items:start;gap:14px;flex-wrap:wrap;margin:14px 0 10px;font-size:.8125rem;color:var(--bindr-muted)}
 [data-excel-columns]{flex:0 1 550px;max-width:100%;background:#fff;border:1px solid var(--bindr-border);border-radius:6px}
 [data-excel-columns]>summary{padding:8px 12px;cursor:pointer;font-size:.875rem;font-weight:600;color:var(--bindr-text)}
 .excel-column-options{padding:10px 12px;display:flex;flex-wrap:wrap;gap:10px;align-items:end}
 .excel-column-options>label{display:flex;align-items:center;gap:10px}.excel-column-options>p{flex-basis:100%;font-size:.8125rem;margin:2px 0}
 .excel-column-options fieldset{flex-basis:100%;padding:8px;border:1px solid var(--bindr-border);min-width:0}
 .excel-column-options legend{font-size:.8125rem;font-weight:650;padding:0 5px}
 .excel-column-choice{display:flex;gap:6px;align-items:center;margin:5px 0}
 .excel-column-choice label{flex:1;display:flex;gap:8px;align-items:center;min-width:0;overflow-wrap:anywhere}
 .excel-column-choice input[type=checkbox]{width:16px;height:16px;flex-shrink:0}
 .excel-column-choice button{width:32px;min-height:30px;font:inherit;background:#edf0f4;border:1px solid var(--bindr-border);border-radius:4px;cursor:pointer}
 .excel-sheet-scroll{width:100%;max-height:none!important;overflow-x:auto;overflow-y:visible;border:1px solid #abb5c3;background:white;border-radius:7px}
 .excel-sheet{border-collapse:separate;border-spacing:0;table-layout:fixed;--excel-label-width:161px;--excel-layer-width:150.5px;width:calc(var(--excel-label-width) + var(--excel-layer-width) * var(--excel-column-count) + 126px);min-width:0;font-size:.875rem;font-variant-numeric:tabular-nums;color:var(--bindr-text)}
 .excel-sheet caption{text-align:left;padding:9px 12px;background:#f0f2f6;font-size:.8125rem;color:#4c5867}
 .excel-row-label{width:var(--excel-label-width)}.excel-layer-col{width:var(--excel-layer-width)}.excel-total-col{width:126px}
 .excel-width-compact{--excel-layer-width:122.5px}.excel-width-wide{--excel-layer-width:203px}
 .excel-sheet th,.excel-sheet td{position:static;vertical-align:middle;overflow-wrap:anywhere;border-right:1px solid #d6dde6;border-bottom:1px solid #d6dde6;padding:6px 9px;text-align:right;background:white;max-width:none}
 .excel-sheet tbody th{text-align:left;font-weight:550;background:#f3f5f8}
 .excel-sheet th>span{font-size:.75rem;font-weight:400;color:#637080}
 .excel-sheet small{display:block;font-size:.75rem;line-height:1.4;color:#5b6572;font-weight:400;margin-top:3px}
 .excel-sheet .excel-group-head th{background:var(--bindr-shell);color:#fff;text-align:left;border-right:2px solid #718096;border-bottom:3px solid var(--bindr-accent);padding:10px}
 .excel-sheet .excel-group-head small{color:#d7deea}
 .excel-group-title{display:flex;align-items:center;justify-content:space-between;gap:6px 12px;flex-wrap:wrap}
 .excel-group-days{font-size:.875rem;white-space:nowrap;font-variant-numeric:tabular-nums}
 .excel-sheet .excel-layer-head th{background:#edf0f4;text-align:left;vertical-align:top;padding:10px}
 .excel-sheet .excel-tone-base{background:#fff0e4!important;border-top:4px solid #d8752b}
 .excel-sheet .excel-tone-binder{background:#fff7ed!important;border-top:4px solid #e2a14a}
 .excel-sheet .excel-tone-surface{background:#edf7ee!important;border-top:4px solid #62a46a}
 .excel-sheet .excel-tone-regulating{background:#f9e7e8!important;border-top:4px solid #b65b61}
 .excel-sheet .excel-tone-planing{background:#f1edf6!important;border-top:4px solid #77658c}
 .excel-column-grip{display:block;text-align:left;background:transparent;border:0;font-family:inherit;font-size:.875rem;font-weight:650;color:inherit;padding:0;cursor:grab;white-space:normal;line-height:1.5}
 .excel-column-grip span{color:#606d7d}.excel-build-link{font-family:inherit;font-size:.75rem;background:transparent;color:#394b63;border:0;padding:5px 0 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
 #excelEstimateWorkspace .excel-sheet input,#excelEstimateWorkspace .excel-sheet select{width:100%;min-height:32px;padding:5px 7px;font-size:.875rem;border-radius:3px;border:1px solid #bcc7d6;background:#fffaf3;color:#1c2734}
 #excelEstimateWorkspace .excel-sheet input{text-align:right}#excelEstimateWorkspace .excel-sheet select{text-align:left}
 #excelEstimateWorkspace .excel-sheet :is(input,select):focus{outline:2px solid #b34d00!important;outline-offset:0}
 #excelEstimateWorkspace .excel-sheet input:disabled{background:#edf0f4;color:#6a7483}
 .excel-sheet .excel-section th,.excel-sheet .excel-section td{background:#d7dce2;font-weight:650;text-align:left;color:#293441;padding:8px 10px}
 .excel-sheet .excel-subtotal td,.excel-sheet .excel-subtotal th{background:#eef1f6;font-weight:650}
 .excel-sheet tr[data-excel-row=sell]>td,.excel-sheet tr[data-excel-row=sell]>th{background:#fff0e1;border-top:1px solid #d4955f;font-weight:700}
 .excel-sheet .excel-total{background:#f1f3f7;font-weight:650;border-left:2px solid #b7c2d0}
 .excel-na{color:#7c8796}.excel-empty{padding:30px;border:1px dashed var(--bindr-border);border-radius:8px;background:white}
 .excel-gang-overrides{margin:10px 12px;padding:10px;background:#fff6ec;border:1px solid #d5ac83;border-radius:6px;font-size:.875rem}
 .excel-gang-overrides summary{cursor:pointer;font-weight:650}.excel-gang-overrides p{font-size:.8125rem}
 .excel-gang-overrides label{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0}
 .excel-gang-overrides label span{flex:1;min-width:160px}.excel-gang-overrides input{width:115px}
 @media(max-width:950px){.excel-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.excel-programme{grid-template-columns:repeat(3,minmax(0,1fr))}.excel-metrics>div,.excel-programme>div{border-bottom:1px solid var(--bindr-border)}.excel-view-controls{justify-content:flex-start}}
 @media(max-width:600px){.excel-programme{grid-template-columns:repeat(2,minmax(0,1fr))}.excel-heading{align-items:flex-start}.excel-metrics strong{font-size:1.125rem}.excel-sheet{--excel-label-width:126px}.excel-column-options>label{flex-basis:100%}}
}
@media screen {
 .excel-heading .excel-metrics{display:grid;grid-template-columns:repeat(5,minmax(118px,1fr));gap:6px;flex:0 1 740px;margin:0;background:transparent;border:0;border-radius:0;overflow:visible}
 .excel-heading .excel-metrics>div{padding:6px 10px;border:1px solid #bdc7d3;border-radius:4px;background:#f7f9fb;min-width:0}
 .excel-heading .excel-metrics span{font-size:.75rem;line-height:1.25;margin:0 0 3px}
 .excel-heading .excel-metrics strong{font-size:1rem;line-height:1.25;white-space:nowrap}
 .excel-heading .excel-metric-2 strong{color:#386b13}
 .excel-heading .excel-metric-3{background:#e8f3fc;border-color:#3382bd}
 .excel-heading .excel-metric-3 strong{color:#205a80}
 #excelEstimateWorkspace>.excel-segment{display:inline-flex;padding:2px;margin:0 0 4px}
 #excelEstimateWorkspace>.excel-segment button{padding:4px 10px}
 .excel-compare-panel{margin:4px 0 8px}
 .excel-compare-panel>summary{padding:6px 10px}
 .excel-compare-panel>.excel-programme{margin:8px}
 .excel-compare-panel>.excel-help{padding:0 10px}
 @media(max-width:1100px){.excel-heading .excel-metrics{order:3;flex:1 1 100%;grid-template-columns:repeat(5,minmax(0,1fr))}}
 @media(max-width:650px){.excel-heading .excel-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.excel-heading .excel-view-controls{flex-wrap:wrap}.excel-heading .excel-metrics strong{white-space:normal}}
}
@media screen {
 #excelEstimateWorkspace .excel-sheet{--excel-label-width:118px;--excel-layer-width:112px;width:calc(var(--excel-label-width) + var(--excel-layer-width) * var(--excel-column-count) + 112px)}
 #excelEstimateWorkspace .excel-total-col{width:112px}
 #excelEstimateWorkspace .excel-sheet :is(th,td){padding-left:6px;padding-right:6px}
 #excelEstimateWorkspace .excel-sheet .excel-group-head th{background:#172b40;border:2px solid #9ab6cf;border-bottom:3px solid #4ca2e4;padding:8px}
 #excelEstimateWorkspace .excel-group-title{align-items:flex-start;gap:6px}
 #excelEstimateWorkspace .excel-group-days{display:inline-block;padding:4px 7px;border:1px solid #7eb8e6;border-radius:4px;background:#e5f3ff;color:#075b9b;font-weight:750;font-size:.875rem}
 #excelEstimateWorkspace .excel-sheet .excel-group-start{border-left:3px solid #6c99be}
 #excelEstimateWorkspace .excel-layer-head small{color:#41566e;font-weight:600}
}

@media screen {
 .excel-sheet .excel-section td{text-align:right;font-variant-numeric:tabular-nums}
 .excel-sheet .excel-section .excel-total{background:#cbd3dd;border-left:2px solid #a9b5c3}
}

@media screen {
 #excelEstimateWorkspace .excel-sheet tr[hidden]{display:none!important}
 #excelEstimateWorkspace .excel-section-toggle{display:flex;align-items:flex-start;gap:5px;width:100%;min-height:0;padding:3px 0;border:0;border-radius:3px;background:transparent;color:inherit;font:inherit;font-weight:700;text-align:left;white-space:normal;cursor:pointer}
 #excelEstimateWorkspace .excel-section-toggle:hover{background:#bcc8d6}
 #excelEstimateWorkspace .excel-section-toggle:focus-visible{outline:2px solid #276ba1;outline-offset:2px}
}

/* Opaque full-width backing for the frozen workspace switch. */
@media screen {
 #estimateView .estimate-workspace-switch {
  width:100%;box-sizing:border-box;margin:0!important;padding:4px 0!important;
  background:var(--bindr-bg,#eef1f4)!important;
 }
}


/* Compact, centred layer columns; calculations retain their original precision. */
@media screen {
 #excelEstimateWorkspace .excel-sheet{--excel-layer-width:96px}
 #excelEstimateWorkspace .excel-sheet :is(th,td){text-align:center;padding-left:4px;padding-right:4px}
 #excelEstimateWorkspace .excel-sheet input,#excelEstimateWorkspace .excel-column-grip{text-align:center}
 #excelEstimateWorkspace .excel-column-grip{width:100%;line-height:1.3}
 #excelEstimateWorkspace .excel-section-toggle{justify-content:center;text-align:center}
 #excelEstimateWorkspace .excel-group-title{justify-content:center;align-items:center;gap:4px}
 #excelEstimateWorkspace .excel-group-days{padding:3px 4px}
 #excelEstimateWorkspace .excel-sheet abbr{text-decoration:none}
 #excelEstimateWorkspace .excel-frozen-groups{position:fixed;z-index:3;overflow:hidden;pointer-events:none;box-shadow:0 3px 5px #172b4026}
 #excelEstimateWorkspace .excel-frozen-groups[hidden]{display:none}
 #excelEstimateWorkspace .excel-frozen-groups th{box-sizing:border-box}
 #excelEstimateWorkspace .excel-frozen-groups .excel-sheet{margin:0;min-width:0;table-layout:fixed}
}
@media print{.excel-frozen-groups{display:none!important}}

/* One orange outer ring surrounds both estimate workspace buttons. */
@media screen {
 body .app-shell #estimateView nav.estimate-workspace-switch div.estimate-workspace-tabs{padding:3px;border:1px solid var(--bindr-accent,#ff8a24);border-radius:99px;box-shadow:0 0 0 2px #ff8a2430,0 0 12px #ff8a2455;transition:box-shadow .15s ease}
 body .app-shell #estimateView nav.estimate-workspace-switch div.estimate-workspace-tabs:hover{box-shadow:0 0 0 2px #ff8a2450,0 0 16px #ff8a2470}
}


/* A compact numeric sheet for scanning costs across layers. */
@media screen {
 #excelEstimateWorkspace .excel-sheet{--excel-label-width:108px;--excel-layer-width:88px;width:calc(var(--excel-label-width) + var(--excel-layer-width) * var(--excel-column-count) + 104px);font-size:12px;line-height:1.25}
 #excelEstimateWorkspace .excel-total-col{width:104px}
 #excelEstimateWorkspace .excel-sheet :is(th,td){padding:4px;overflow-wrap:normal}
 #excelEstimateWorkspace .excel-sheet td{white-space:nowrap}
 #excelEstimateWorkspace .excel-sheet .excel-group-head th{padding:6px 4px}
 #excelEstimateWorkspace .excel-sheet .excel-layer-head th{position:relative;padding:6px 4px 25px;overflow-wrap:anywhere}
 #excelEstimateWorkspace .excel-column-grip{font-size:12px;line-height:1.25}
 #excelEstimateWorkspace .excel-build-link{position:absolute;bottom:2px;left:calc(50% - 12px);width:24px;height:22px;padding:0;text-decoration:none;font-size:15px;line-height:22px;border-radius:4px}
 #excelEstimateWorkspace .excel-build-link:hover{background:#ffeadb;color:#984b19}
 #excelEstimateWorkspace .excel-sheet small,#excelEstimateWorkspace .excel-sheet th>span{font-size:10px;line-height:1.2;margin-top:2px}
 #excelEstimateWorkspace .excel-sheet :is(input,select){min-height:24px;height:24px;padding:2px 4px;font-size:12px;line-height:1.25}
 #excelEstimateWorkspace .excel-reset{min-height:22px;height:22px;top:1px}
 #excelEstimateWorkspace .excel-sheet .excel-section :is(th,td){padding:5px 4px}
 #excelEstimateWorkspace .excel-section-toggle{padding:0;gap:3px;font-weight:650}
 #excelEstimateWorkspace .excel-comparison :is(th,td){padding:5px 8px;font-size:12px}
}

/* Draft actions left, workspace switch centre, quotation actions right. */
@media screen {
 body .app-shell #estimateView nav.estimate-workspace-switch{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:6px 12px;padding:8px 10px!important}
 #estimateView .estimate-workspace-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
 #estimateView .estimate-workspace-actions-end{justify-content:flex-end}
 #estimateView .estimate-workspace-actions .btn{min-height:32px;padding:6px 10px;border-radius:8px;font-size:12px;white-space:nowrap;background:#fff;color:var(--bindr-text);border:1px solid var(--bindr-border)}
 #estimateView .estimate-workspace-actions .btn.primary{background:var(--bindr-accent,#ff8a24);color:#181c23;border-color:var(--bindr-accent,#ff8a24)}
 #estimateView .estimate-workspace-actions .btn:hover{box-shadow:0 0 0 2px #ff8a2420;border-color:var(--bindr-accent,#ff8a24)}
 #estimateWorkspaceStatus{grid-column:1/-1;text-align:center}
 #estimateWorkspaceStatus:empty{display:none}
 @media(max-width:1100px){
  body .app-shell #estimateView nav.estimate-workspace-switch{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #estimateView .estimate-workspace-tabs{grid-column:1/-1;grid-row:1;justify-self:center}
  #estimateView .estimate-workspace-actions-start{grid-column:1;grid-row:2}
  #estimateView .estimate-workspace-actions-end{grid-column:2;grid-row:2}
 }
 @media(max-width:600px){
  body .app-shell #estimateView nav.estimate-workspace-switch{grid-template-columns:minmax(0,1fr)}
  #estimateView .estimate-workspace-actions-start{grid-column:1;grid-row:2;justify-content:center}
  #estimateView .estimate-workspace-actions-end{grid-column:1;grid-row:3;justify-content:center}
 }
}
/* Inputs sit flush inside a selected sheet cell, rather than a nested form box. */
@media screen {
 #excelEstimateWorkspace .excel-sheet td:has([data-excel-input]:not(:disabled):not([readonly])){cursor:cell;background:#fff7ed;box-shadow:inset 0 0 0 1px #efd2b4}
 #excelEstimateWorkspace .excel-sheet td:has([data-excel-input]:not(:disabled):not([readonly])):hover{background:#ffefd9}
 #excelEstimateWorkspace .excel-sheet td.excel-selected:has([data-excel-input]:not(:disabled):not([readonly])){background:#ffecd5}
 #excelEstimateWorkspace .excel-sheet input[data-excel-input]{border-color:transparent;border-radius:0;background:transparent;box-shadow:none;cursor:cell;caret-color:transparent}
 #excelEstimateWorkspace .excel-sheet input[data-excel-input]:focus{outline:none!important}
 #excelEstimateWorkspace .excel-sheet .excel-editing input[data-excel-input]{cursor:text;caret-color:currentColor}
 #excelEstimateWorkspace .excel-sheet td:not(.excel-editing) input[data-excel-input]::selection{background:transparent;color:inherit}
 #excelEstimateWorkspace .excel-sheet td.excel-active{outline:2px solid #df771f;outline-offset:-2px}
}

/* Centre the toggle itself, independent of the action groups' widths. */
@media screen {
 body[data-bindr-theme="evergreen"] .app-shell #estimateView nav.estimate-workspace-switch {width:100%;max-width:100%;box-sizing:border-box}
 body .app-shell #estimateView nav.estimate-workspace-switch > .estimate-workspace-tabs {justify-self:center;width:max-content;max-width:100%}
}
