/* Shared UI contract: semantic colors, comfortable controls and consistent focus. */
:root{--ui-font:"Segoe UI",Arial,sans-serif;font-family:"Segoe UI",Arial,sans-serif;--ink:#202c3a;--secondary:#526174;--canvas:#f5f7fa;--surface:#ffffff;--section:#f0f3f7;--soft:#f8fafc;--edge:#7d8b9b;--divider:#d5dce5;--accent:#9b420e;--selected:#fff1e6;--control-hover:#eef2f6;--primary:#9b420e;--primary-hover:#803409;--primary-edge:#9b420e;--focus:#146cc7;--success-text:#0d663d;--success-bg:#edf8f1;--warning-text:#875000;--warning-bg:#fff5dc;--danger-text:#b42318;--danger-bg:#fff0ee;--line:var(--divider);--muted:var(--secondary);--radius:6px;--control-height:44px}
:root[data-theme=dark]{--ink:#f2f5f9;--secondary:#b4c0ce;--canvas:#101820;--surface:#1a2533;--section:#223143;--soft:#202e3d;--edge:#8091a5;--divider:#394b5f;--accent:#ffc18f;--selected:#3e2c20;--control-hover:#2a3b4e;--primary:#9b420e;--primary-hover:#803409;--primary-edge:#e6a26b;--focus:#8fc5ff;--success-text:#8ce0b3;--success-bg:#173b2b;--warning-text:#f4ce7f;--warning-bg:#41331a;--danger-text:#ffb4ab;--danger-bg:#452523}
body{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;font-synthesis:none;line-height:1.5}button,input,select,textarea{font-family:inherit;letter-spacing:normal}h1,h2,h3,h4{letter-spacing:normal;text-wrap:pretty}button,.btn{line-height:1.5;letter-spacing:normal;border-width:1px;border-radius:var(--radius);text-align:center;max-width:100%}button:hover,.btn:hover{background:var(--control-hover);border-color:var(--edge)}button.primary,.btn.primary,#sideCreate{background:var(--primary);border-color:var(--primary-edge);color:#fff}button.primary:hover,.btn.primary:hover,#sideCreate:hover{background:var(--primary-hover);color:#fff}button:disabled,.btn[aria-disabled=true]{cursor:default;opacity:.55}
:focus-visible{outline:3px solid var(--focus)!important;outline-offset:3px}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{border-width:1px;border-radius:var(--radius);background:var(--surface);color:var(--ink);line-height:1.5;box-shadow:none}input::placeholder,textarea::placeholder{color:var(--secondary);opacity:1}
.card,.metric,.hcp-list-card,.home-summary-card,.list-surface,.line-form-card{border-width:1px;box-shadow:0 1px 3px #12203108}
.sidebar{border-right-width:1px}.sidebar nav>a,.sidebar nav summary{line-height:1.5;letter-spacing:normal}.sidebar nav>a.active,.hcp-subnav a.active{background:var(--selected);color:var(--accent)}.sidebar nav hr,.sidebar-bottom{border-width:1px}.brand>span:last-child{letter-spacing:normal;font-size:21px}.brand small{letter-spacing:normal}.sidebar-bottom>.btn,.user-footer{max-width:100%;white-space:normal;overflow-wrap:anywhere}
header{border-bottom-width:1px;gap:16px}.global-search{min-width:120px}.global-search input{height:44px;min-height:44px;margin:0;border:1px solid var(--edge);padding:10px 12px 10px 38px;background:var(--soft)}.global-search::before{top:5px}#topTools{gap:8px}#topTools .tool-icon,#topTools .theme-toggle{height:40px;min-height:40px;border-radius:6px;line-height:1.5}#topTools .theme-toggle{font-size:13px!important;border-width:1px;padding:8px 12px}
.record-tools,.catalog-tools,.list-toolbar,.list-pipeline-toolbar{gap:12px;align-items:center}.record-tools input,.record-tools select,.catalog-tools input,.catalog-tools select,.list-toolbar>input,.list-toolbar>select,.list-pipeline-toolbar>input{height:44px;min-height:44px;margin:0;padding:10px 12px}.list-toolbar button,.list-pipeline-toolbar button,.record-tools button,.record-tools .btn{min-height:44px;height:auto;padding:9px 14px;line-height:1.5}.hcp-list-search{height:44px;min-height:44px;border-width:1px}.hcp-list-search input{height:42px;min-height:42px;border:0;margin:0}.hcp-page-title{border-bottom-width:1px}.actions{row-gap:10px}.actions>*{flex-shrink:0}.list-page-heading,.hcp-section>.section-head,.hcp-section>h2{border-bottom-width:1px}
@media(max-width:900px){header{gap:12px;padding:10px 16px}.global-search{max-width:none}#topTools .theme-toggle{padding:8px 10px}}
@media print{:root,:root[data-theme=dark]{--ink:#111;--secondary:#333;--canvas:#fff;--surface:#fff;--section:#eee;--soft:#fff;--edge:#777;--divider:#aaa;--accent:#222;--selected:#eee}}

.list-toolbar .list-icon,.record-tools .square-tool{width:44px;min-width:44px;height:44px;padding:9px}.record-tools .primary{height:44px;min-height:44px}.list-toolbar button.primary:hover{background:var(--primary-hover);color:#fff}

/* Shared job/estimate chrome, including the unsaved and saved line-item workspace. */
.hcp-record-heading.record-heading{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px 24px;max-width:1330px;margin:0 auto 24px;position:static}
.record-heading-copy{flex:1 1 360px;min-width:0}
.hcp-record-heading.record-heading h1{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;font-size:28px!important;line-height:1.4!important;margin:0 0 8px;overflow-wrap:anywhere}
.record-heading .record-heading-actions{display:flex;flex:0 1 auto;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;margin:0;max-width:100%;min-width:0}
.record-heading-actions>button,.record-heading-actions>.btn{position:static;min-height:40px;height:auto;max-width:100%;white-space:normal;overflow-wrap:anywhere;padding:9px 14px}
.record-heading .record-heading-meta{display:flex;flex-wrap:wrap;gap:8px 14px}
.hcp-job-layout{align-items:start}
.hcp-job-layout>*{min-width:0}
.hcp-job-layout .section-head,.hcp-job-layout .scope-category{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.hcp-job-layout .section-head>h2,.hcp-job-layout .scope-category>h3{min-width:0;margin:0;overflow-wrap:anywhere}
.hcp-job-layout .section-head>h2{font-size:22px!important;font-weight:400!important;line-height:1.4!important}
.hcp-job-layout .section-head>.actions,.hcp-job-layout .scope-category>.actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin:0;min-width:0;max-width:100%}
.hcp-job-layout .table-wrap{max-width:100%;overflow-x:auto}
.hcp-job-layout .table-wrap table{width:100%;border-collapse:collapse}
.hcp-job-layout .table-wrap th,.hcp-job-layout .table-wrap td{padding:14px 18px;line-height:1.6;text-align:left;vertical-align:top}
.hcp-job-layout .table-wrap th{font-size:12px;background:var(--soft);color:var(--secondary)}
.hcp-job-layout .table-wrap td{font-size:13.125px;border-bottom:1px solid var(--divider)}
.hcp-job-layout .table-wrap td:nth-child(n+2){white-space:nowrap}
.hcp-job-layout .customer-name-row{flex-wrap:wrap;gap:10px}
.hcp-job-layout .customer-card-content{overflow-wrap:anywhere}
.hcp-job-layout .customer-card-footer{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.hcp-job-layout .line-view-toggle{display:flex;flex-wrap:wrap;max-width:100%}
.hcp-job-layout .line-view-toggle>button{white-space:normal}
.hcp-job-layout .estimate-option-heading{flex-wrap:wrap}
.hcp-job-layout .estimate-option-heading>div:first-child{flex:1 1 220px;min-width:0;overflow-wrap:anywhere}
.hcp-job-layout .estimate-option-heading>.actions{flex:0 1 auto;max-width:100%;margin:0;gap:8px}
.estimate-record-meta,.segment-switcher{max-width:1330px;margin-left:auto;margin-right:auto}
@media(max-width:1100px){.record-heading .record-heading-actions{flex-wrap:wrap;justify-content:flex-start}.hcp-record-heading.record-heading h1{font-size:26px!important}}

.record-totals{padding:20px;margin:0 0 0 auto;width:420px;max-width:100%}.record-totals>div{display:flex;justify-content:space-between;gap:20px;padding:9px 0;line-height:1.6}.record-totals dd{margin:0;font-weight:600;text-align:right}.record-grand-total{border-top:1px solid var(--divider);font-size:18px;margin-top:8px}.record-heading .job-options-button{float:none;flex:0 0 auto}

.hcp-job-body>.segment-switcher{margin:0 0 20px;padding:0 0 16px;border-bottom:1px solid var(--divider)}.hcp-job-body>.segment-switcher .segment-tab-wrap{min-width:150px}

.hcp-job-layout .estimate-options button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px}.hcp-job-layout .estimate-options button>b{width:100%;white-space:normal}.hcp-job-layout .estimate-options button>small{white-space:nowrap;margin:0}

.customer-summary-card>h2{flex-wrap:wrap;justify-content:space-between;gap:10px}.customer-summary-card>h2>span{display:flex;align-items:center;gap:9px}.customer-summary-card>h2>button{min-height:36px;padding:6px 10px}.hcp-job-body .segment-switcher>.segment-add{font-size:13.125px!important;line-height:20px;min-height:40px;padding:9px 12px}

/* Saved-job supporting panels live in the customer column. Keep narrow-card controls readable. */
.record-side-panels{display:grid;gap:20px;min-width:0}.hcp-job-layout .record-side-panels>.card{margin:0;min-width:0}.hcp-job-layout .record-side-panels .section-head{padding:14px 16px;min-height:56px;gap:10px}.hcp-job-layout .record-side-panels .section-head>h2{font-size:17px!important;line-height:1.4!important}.record-side-panels .section-head>button{min-height:36px;white-space:normal;max-width:100%}.record-side-panels .attachment-gallery{grid-template-columns:minmax(0,1fr);padding:16px}.record-side-panels .record-note{display:flex;flex-direction:column;align-items:flex-start;gap:8px;overflow-wrap:anywhere}.record-side-panels .record-note>button{float:none;margin:0;align-self:flex-end}.record-side-panels .record-note>p{margin:0}.record-side-panels .payment-history-row{display:flex;flex-direction:column;gap:12px;padding:16px;overflow-wrap:anywhere}.record-side-panels .payment-history-row>div{min-width:0;max-width:100%}.record-side-panels .payment-history-row .actions{display:flex;flex-wrap:wrap;gap:8px}.record-side-panels .payment-history-row .actions>button{white-space:normal;max-width:100%}.record-side-panels .hcp-section>p{overflow-wrap:anywhere}

/* Workspace identity: reuse the existing banner only on isolated data. */
@media screen{body[data-workspace-kind="review"] .pilot-banner,body[data-workspace-kind="isolated"] .pilot-banner{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px 16px;height:auto;min-height:42px;padding:8px 28px;font-size:13px;line-height:1.5;background:var(--surface,#fff);color:var(--ink,#26323b);border-bottom:2px solid var(--divider,#c5cbd1)}.pilot-banner>span{flex:1 1 320px;min-width:0}.pilot-banner>a{color:inherit;text-decoration:underline;white-space:nowrap}.pilot-banner>strong{font-size:13px;letter-spacing:0}.local-chip{white-space:nowrap}}

.track-fields [hidden]{display:none!important}.estimate-left-rail{display:grid;gap:18px;align-content:start;min-width:0}.estimate-left-rail>aside{min-width:0;max-width:100%}.estimate-left-rail .record-note,.estimate-left-rail .record-attachments{overflow-wrap:anywhere}.estimate-item-name small,.estimate-item-card>p{white-space:pre-line}.builder-line-note{font-size:12px;color:var(--secondary);margin:5px 0}.attachment-gallery article small{display:block;overflow-wrap:anywhere}
