/* Shared operational UI tokens — GGC Design System v2.0.
   Module sheets retain layout; this layer owns common component dimensions. */
:root{
  --font-ui:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --text-meta:.75rem;--text-control:.8125rem;--text-body:.875rem;
  --text-card:1rem;--text-section:1.125rem;--text-stat:1.5rem;--text-page:1.75rem;
  --space-4:4px;--space-8:8px;--space-12:12px;--space-16:16px;--space-20:20px;
  --space-24:24px;--space-32:32px;--space-40:40px;--space-48:48px;--space-64:64px;
  --radius-xs:4px;--radius-control:8px;--radius-card:12px;--radius-dialog:16px;
  --radius:var(--radius-card);--control:var(--radius-control);
  --control-height:36px;--control-touch:44px;--sidebar-width:236px;--page-gutter:32px;
  --accent:#bc3044;--accent-fill:#bc3044;--accent-hover:#a32436;
  --accent-soft:#fbeef0;--accent-line:#e8bdc5;
  --canvas:#f3f5f4;--surface:#fff;--soft:#f7f8f7;--text:#202622;--muted:#626c66;--line:#dde3df;
  --success:#246d50;--success-soft:#edf6f1;--success-line:#c6dfd0;
  --warning:#805d1b;--warning-soft:#fcf5e7;--warning-line:#ead7ad;
  --info:#315e83;--info-soft:#edf4f9;--info-line:#c7dce9;
  --danger:#a52b3d;--danger-soft:#fceef0;--focus:#376faa;
  --shadow:0 1px 3px #20262206;--shadow-hover:0 8px 20px #20262212;
  --shadow-dialog:0 20px 64px #15211b33;
  --motion-fast:150ms ease;
}
html[data-theme=dark]{
  --canvas:#171b19;--surface:#232925;--soft:#29302b;--text:#f0f3f1;--muted:#adb9b1;--line:#3d4740;
  --accent:#fa98a6;--accent-soft:#3c282e;--accent-line:#76505a;--accent-hover:#a32436;
  --success:#8ed6b3;--success-soft:#20382c;--success-line:#3c6550;
  --warning:#e0be7d;--warning-soft:#3a3223;--warning-line:#6c5732;
  --info:#a4cdec;--info-soft:#213342;--info-line:#38566e;
  --danger:#ffa5b2;--danger-soft:#40282f;--focus:#8cb7ee;
  --shadow:0 1px 3px #0002;--shadow-hover:0 8px 20px #0003;--shadow-dialog:0 20px 64px #0007;
}
html{scroll-padding-top:80px}
body{font:var(--text-body)/1.5 var(--font-ui)}
button,input,select,textarea{font-family:var(--font-ui)}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
svg{width:18px;height:18px}
h1{font-size:var(--text-page);font-weight:600;line-height:1.2;letter-spacing:-.035em}
h2{font-size:var(--text-section);font-weight:600;line-height:1.35;letter-spacing:-.015em}
h3{font-size:var(--text-card);font-weight:600;line-height:1.4}
:is(button,a,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--focus);outline-offset:3px}
::placeholder{color:var(--muted);opacity:1}
:is(input,select,textarea):disabled{color:var(--muted);background:var(--soft)}
button:disabled{opacity:.55;cursor:not-allowed}
.office,html[data-theme=dark] .office{background:var(--canvas)}
.sidebar{width:var(--sidebar-width);padding:var(--space-20) var(--space-12);overflow-y:auto}
.stage{margin-left:var(--sidebar-width);min-width:0}
.sidebar .brand{margin-bottom:var(--space-24)}
.sidebar .brand b{font-size:24px}.sidebar .brand small{font-size:11px}
.nav-caption{font-size:var(--text-meta);letter-spacing:.06em}
.nav-item{gap:var(--space-12);font-size:var(--text-control);min-height:40px;padding:var(--space-8) var(--space-12);border-radius:var(--radius-control)}
.nav-item.selected{box-shadow:none;background:#723640;color:#fff}
.profile{padding:var(--space-12);border-radius:var(--radius-control)}
.profile strong{font-size:var(--text-control)}.profile small{font-size:var(--text-meta);color:#afb8b1}
.topbar{min-height:60px;padding:var(--space-8) var(--page-gutter);gap:var(--space-16)}
.department{min-width:180px;max-width:230px;border-radius:var(--radius-control);padding:var(--space-4) var(--space-8)}
.department>span{font-size:var(--text-meta);letter-spacing:0;text-transform:none;line-height:1.2}
.department select{font-size:var(--text-control);line-height:1.4;min-height:24px}
.global-search{min-height:var(--control-height);font-size:var(--text-control);padding:var(--space-8) var(--space-12);border-radius:var(--radius-control)}
.global-search kbd{font-size:var(--text-meta)}
.topbar-actions{gap:var(--space-8)}
.content{padding:var(--space-24) var(--page-gutter);max-width:1600px;min-width:0}
.workspace-footer{font-size:var(--text-meta);padding:0 var(--page-gutter) var(--space-16)}
.content .page-heading{display:flex;align-items:flex-start;flex-wrap:wrap;gap:var(--space-16);margin:0 0 var(--space-20)}
.content :is(.page-heading,.profile-heading,.work-hero) h1{font-size:var(--text-page);font-weight:600;line-height:1.2;letter-spacing:-.035em;margin:0 0 var(--space-8)}
.page-heading>div:first-child{min-width:0;flex:1}
.page-heading p,.work-detail .work-hero p{font-size:var(--text-body);line-height:1.5}
.heading-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-8);margin:0}
.content .page-heading .heading-actions{margin:0 0 0 auto;flex:0 1 auto;justify-content:flex-end}
.eyebrow,.field-caption{font-size:var(--text-meta);font-weight:600;letter-spacing:.035em}
.profile-breadcrumb,.work-detail>.profile-breadcrumb{margin:0 0 var(--space-12)}
.profile-breadcrumb button,.work-detail>.profile-breadcrumb button{font-size:var(--text-control);min-height:32px}

/* Shared controls and toolbars. */
body :is(.button,.primary,.icon-button,.avatar-button){min-height:var(--control-height);border-radius:var(--radius-control);font-size:var(--text-control);font-weight:500;line-height:1.4;padding:var(--space-8) var(--space-12);gap:var(--space-8);box-shadow:none;white-space:normal;transition:background var(--motion-fast),border-color var(--motion-fast),box-shadow var(--motion-fast)}
body :is(.button,.primary) svg{width:16px;height:16px}
body :is(.icon-button,.avatar-button){width:var(--control-height);min-width:var(--control-height);height:var(--control-height);padding:var(--space-8)}
body .language{width:auto;font-size:var(--text-control)}
body .primary{background:var(--accent-fill);border-color:var(--accent-fill);color:#fff}
body .primary:not(:disabled):hover{background:var(--accent-hover);border-color:var(--accent-hover)}
body .primary:not(:disabled):active{box-shadow:inset 0 2px 4px #0002}
body .button:not(:disabled):active{background:var(--line)}
body .text-button{font-size:var(--text-control);font-weight:500;line-height:1.4;min-height:32px;gap:var(--space-8)}
.text-button svg{width:16px;height:16px}
.text-button:hover{color:var(--accent)}
body .input-wrap{min-height:var(--control-height);padding:var(--space-8) var(--space-12);gap:var(--space-8);border-radius:var(--radius-control)}
body .input-wrap input{font-size:var(--text-body);line-height:1.4}
.input-wrap svg{width:16px;height:16px}
.input-wrap:focus-within,.filter-select:focus-within,.sort-select:focus-within{outline:2px solid var(--focus);outline-offset:2px}
body :is(.filters-panel,.directory-toolbar,.sub-toolbar,.work-toolbar,.collection-toolbar){padding:var(--space-16);border-radius:var(--radius-card)}
.work-toolbar{margin:0 0 var(--space-16)}
.directory-summary{font-size:var(--text-meta);gap:var(--space-12);margin:0 0 var(--space-16)}
.sub-toolbar-top,.search-pair{gap:var(--space-12);padding-bottom:var(--space-12)}
.sub-toolbar-bottom,.filter-row{gap:var(--space-12);padding-top:var(--space-12)}
.work-filter-row{align-items:end;gap:var(--space-12);margin-top:var(--space-12)}
.work-filter-row>label{font-size:var(--text-control);font-weight:500;gap:var(--space-4);min-width:0}
.work-filter-row select{min-height:var(--control-height);font-size:var(--text-control);padding:var(--space-8) var(--space-12);border-radius:var(--radius-control)}
body :is(.filter-select,.sort-select){min-height:var(--control-height);border-radius:var(--radius-control);gap:var(--space-8);padding:0 var(--space-12)}
body :is(.filter-select,.sort-select)>select{min-height:calc(var(--control-height) - 2px);font-size:var(--text-control);line-height:1.4;max-width:100%}
.filter-select>span{font-size:var(--text-meta)}
body .view-switch{gap:var(--space-4);padding:var(--space-4);border-radius:var(--radius-control);max-width:100%;flex-wrap:wrap}
body .view-switch button{min-height:28px;padding:var(--space-4) var(--space-8);font-size:var(--text-control);font-weight:500;gap:var(--space-8);border-radius:var(--radius-xs)}
.view-switch button svg{width:16px;height:16px}
.view-switch button.active{box-shadow:var(--shadow);color:var(--accent)}
.view-switch button>span,.record-count,.directory-totals,.directory-result-count,.work-filter-row>span{font-size:var(--text-meta)}
.toolbar-end,.filter-group{gap:var(--space-12)}

/* Cards: compact content, common leading edge and maximum three columns. */
.records-grid,.project-module .records-grid,.directory-grid{gap:var(--space-16);grid-template-columns:repeat(auto-fill,minmax(min(100%,max(18rem,calc((100% - 32px)/3))),1fr))}
.client-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.panel,.metric,.record-card,.directory-card{border-radius:var(--radius-card);box-shadow:var(--shadow)}
.record-card,.record-card.work-card{padding:var(--space-16);border-radius:var(--radius-card)}
.record-card-top,.work-card .record-card-top{margin-bottom:var(--space-12);align-items:center;gap:var(--space-8)}
.work-card .work-kind,.work-card .work-status,.status-badge,.work-status,.directory-status,.drive-status{font-size:var(--text-meta);font-weight:500;line-height:1.35}
.work-card .work-kind,.work-card .work-status,.status-badge,.work-status{padding:var(--space-4) var(--space-8);border-radius:var(--radius-control);min-height:24px}
.number-pair,.work-card .number-pair{gap:var(--space-12);margin-bottom:var(--space-12)}
.number-pair>div,.work-card .number-pair>div{padding:var(--space-8) var(--space-12);border-radius:var(--radius-control)}
.number-pair span,.work-card .number-pair span,.work-card .field-caption{font-size:var(--text-meta);font-weight:500;line-height:1.35;text-transform:none;letter-spacing:0}
.number-pair strong,.work-card .number-pair strong{font-size:var(--text-card);line-height:1.3;margin-top:var(--space-4)}
.work-card .record-name{padding-bottom:var(--space-12)}
.record-name h2,.work-card .record-name h2,.quote-card .record-name h2{font-size:var(--text-card);font-weight:600;line-height:1.35;letter-spacing:-.01em;margin:var(--space-4) 0 var(--space-8)}
.record-name p,.work-card .record-name p{font-size:var(--text-body);line-height:1.4;margin:var(--space-4) 0 0}
.work-card .record-name .work-card-address,.work-card .record-name .work-card-manager{font-size:var(--text-meta);line-height:1.4;gap:var(--space-4)}
.work-card .record-name .work-card-manager{margin-top:var(--space-4)}
.work-card-address svg,.work-card-manager svg{width:14px;height:14px;margin-top:2px}
.record-summary,.work-card .record-summary{padding:var(--space-12) 0;gap:var(--space-8);font-size:var(--text-control)}
.record-summary>span,.work-card .record-summary>div{gap:var(--space-8);min-height:20px}
.work-card .record-summary>div{grid-template-columns:16px minmax(0,1fr) auto}
.work-card .record-summary svg,.record-summary svg{width:16px;height:16px}
.work-card .record-summary strong{font-size:var(--text-control)}
.work-summary-pending{font-size:var(--text-meta);max-width:8rem;line-height:1.4}
.record-card footer,.work-card footer{font-size:var(--text-meta);padding-top:var(--space-12);gap:var(--space-8)}
.work-card-deadline>span{flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:var(--space-4)}
.work-card-deadline strong,.work-card footer .record-open,.record-open{font-size:var(--text-control);font-weight:500;line-height:1.4}
.record-card footer svg{width:16px;height:16px}
.quote-number{font-size:var(--text-stat);font-weight:600}
.quote-card .record-name{margin:var(--space-12) 0;min-height:0}
.quote-project{padding:var(--space-12);margin-bottom:var(--space-12);font-size:var(--text-meta);border-radius:var(--radius-control)}
.quote-project strong{font-size:var(--text-body);margin:var(--space-4) 0 var(--space-8)}
.quote-summary{gap:var(--space-8);padding:var(--space-12) 0}
.quote-summary span{font-size:var(--text-meta);text-transform:none}
.quote-summary strong{font-size:var(--text-body)}
.directory-card,.saved-card,.subcontractor-card,.client-grid .directory-card{min-height:96px;padding:var(--space-16);gap:var(--space-12);align-items:flex-start;transition:border-color var(--motion-fast),box-shadow var(--motion-fast),transform var(--motion-fast)}
.directory-info,.saved-card .directory-info{gap:var(--space-4)}
.directory-info strong,.saved-card .directory-info strong,.subcontractor-card .directory-info strong{font-size:var(--text-card);font-weight:600;line-height:1.4}
.directory-info>span,.directory-info small,.saved-card .directory-info span,.subcontractor-card .directory-info>span,.subcontractor-card .directory-info small{font-size:var(--text-meta);line-height:1.45}
.directory-avatar,.saved-card .directory-avatar,.subcontractor-card .directory-avatar{width:36px;height:36px;margin:0;font-size:var(--text-meta);border-radius:var(--radius-control)}
.directory-card-end{gap:var(--space-8);flex-shrink:0;align-self:center}
.subcontractor-card .directory-status{font-size:var(--text-meta)}
.directory-card:focus-visible,.work-card:focus-within{border-color:var(--accent);box-shadow:var(--shadow-hover)}
@media(hover:hover) and (pointer:fine){.directory-grid>.directory-card:hover,.record-card.work-card:hover{background:var(--surface);transform:translateY(-3px);border-color:var(--accent);box-shadow:var(--shadow-hover)}}

/* Shared headings, detail fields and tabs. */
.panel-heading,.profile-panel>header,.project-module .profile-panel>header{padding:var(--space-16);gap:var(--space-12);flex-wrap:wrap}
.panel-heading h2,.profile-panel>header h2,.project-module .profile-panel header h2{font-size:var(--text-section);font-weight:600}
.panel-heading p:last-child,.profile-panel>header p{font-size:var(--text-meta);line-height:1.5;margin-top:var(--space-4)}
.profile-hero{padding:var(--space-20);gap:var(--space-16)}
.profile-avatar{width:56px;height:56px;font-size:var(--text-stat);border-radius:var(--radius-card)}
.profile-subtitle{font-size:var(--text-meta);gap:var(--space-12);flex-wrap:wrap}
.profile-hero .heading-actions{margin-left:auto}
.profile-tabs{gap:var(--space-20);margin:var(--space-16) 0;scroll-padding-inline:var(--space-8)}
.profile-tabs button{font-size:var(--text-control);font-weight:500;min-height:40px;padding:var(--space-8) var(--space-4);gap:var(--space-8)}
.profile-columns,.profile-main,.profile-side,.deferred-grid,.connections-grid{gap:var(--space-16)}
.profile-fields,.identity-fields{padding:var(--space-16);gap:var(--space-20)}
.profile-field dt,.identity-fields dt,.work-facts dt,.work-clients small{font-size:var(--text-meta);text-transform:none;letter-spacing:0;margin-bottom:var(--space-4)}
.profile-field dd,.identity-fields dd,.work-facts dd{font-size:var(--text-body);line-height:1.5}
.identity-fields dd{margin:0;overflow-wrap:anywhere}
.profile-notes,.profile-empty,.company-relationship,.category-section{padding:var(--space-16);font-size:var(--text-body);line-height:1.6}
.related-contacts{padding:0 var(--space-16)}
.related-contacts .directory-card{padding:var(--space-12) 0;border-radius:0;min-height:80px;transform:none}
.profile-empty strong,.company-relationship strong{font-size:var(--text-body)}
.company-relationship small,.category-section>p,.category-chips>span{font-size:var(--text-meta)}
.connection-explainer{margin:var(--space-16);font-size:var(--text-meta);line-height:1.5}
.raw-fields{padding:0 var(--space-16)}.raw-fields>div{font-size:var(--text-meta);gap:var(--space-16)}
.work-detail .work-hero{padding:0;margin:0 0 var(--space-16);gap:var(--space-16);align-items:center}
.work-detail .work-hero>.primary{margin:0;box-shadow:none}
.work-detail-tabs{padding:var(--space-4);gap:var(--space-4);border-radius:var(--radius-card);margin-bottom:var(--space-16)}
.work-detail-tabs>button{min-height:52px;gap:var(--space-8);padding:var(--space-8);border-radius:var(--radius-control)}
.work-detail-tabs strong{font-size:var(--text-control);font-weight:500;line-height:1.4}
.work-detail-tabs small{font-size:var(--text-meta);line-height:1.35;margin-top:0}
.work-tab-icon{width:28px;height:28px;border-radius:var(--radius-control)}
.work-tab-icon svg{width:16px;height:16px}
.work-detail .work-information{margin-bottom:var(--space-16)}
.work-detail :is(.work-information,.work-notes-panel,.work-scope-panel)>header{padding:var(--space-16);gap:var(--space-12);min-height:0}
.work-section-heading{gap:var(--space-12)}
.work-section-heading h2{font-size:var(--text-card);font-weight:600;line-height:1.4}
.work-section-heading .eyebrow,.work-section-heading p:last-child{font-size:var(--text-meta);line-height:1.4;letter-spacing:0}
.work-section-icon,.work-detail-fact>span{width:28px;height:28px;border-radius:var(--radius-control)}
.work-detail-facts{padding:0 var(--space-16);gap:0}
.work-detail-fact{padding:var(--space-16) var(--space-12) var(--space-16) 0;gap:var(--space-8)}
.work-detail-fact dt{font-size:var(--text-meta);text-transform:none;letter-spacing:0;margin-bottom:var(--space-4)}
.work-detail-fact dd{font-size:var(--text-body);font-weight:500;line-height:1.4}
.work-detail .work-overview-grid{gap:var(--space-16)}
.work-notes-panel,.work-scope-panel{min-height:252px}
.work-notes-preview{min-height:96px;padding:var(--space-12) var(--space-16)}
.work-notes-empty strong,.work-notes-preview article p{font-size:var(--text-body)}
.work-notes-empty p,.work-notes-preview article time{font-size:var(--text-meta)}
.work-notes-panel>footer,.work-scope-panel>footer{margin:0 var(--space-16);padding:var(--space-12) 0;gap:var(--space-8);flex-wrap:wrap}
.work-notes-panel>footer small,.work-scope-panel>footer small{font-size:var(--text-meta)}
.work-scope-preview,.work-scope-preview.is-empty{min-height:100px;max-height:160px;margin:0 var(--space-16) var(--space-12);padding:var(--space-12);font-size:var(--text-body);line-height:1.5;border-radius:var(--radius-control)}
.work-detail .work-information .work-status{font-size:var(--text-meta)}
.work-facts{padding:0 var(--space-16) var(--space-16);gap:0 var(--space-20)}
.work-facts>div{padding:var(--space-16) 0}
.work-clients{gap:var(--space-16);padding:var(--space-16)}
.work-notice{margin:0 var(--space-16) var(--space-16);padding:var(--space-12);font-size:var(--text-meta)}

/* Tables, calendars, empty states and dashboards. */
.table-scroll{max-width:100%;overflow:auto;overscroll-behavior-x:contain}
body :is(.table-panel,.work-table,.drive-table,.pending-links-table) th{font-size:var(--text-meta);font-weight:600;line-height:1.4;text-transform:none;letter-spacing:0;padding:var(--space-12) var(--space-16);color:var(--muted);background:var(--soft)}
body :is(.table-panel,.work-table,.drive-table,.pending-links-table) td{font-size:var(--text-body);line-height:1.5;padding:var(--space-12) var(--space-16);vertical-align:middle}
.table-panel td[colspan]{padding:0}
.table-panel td strong,.table-name,.work-table .text-button{font-size:var(--text-body);line-height:1.4}
.work-table td small,.pending-links-table code{font-size:var(--text-meta)}
.work-table th:last-child,.drive-table th:last-child{white-space:nowrap}
.drive-table :is(th,td):nth-child(2){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.table-open{min-width:32px;min-height:32px;padding:var(--space-8)}
.work-pagination,.directory-pagination{gap:var(--space-16);margin:var(--space-20) 0 0;font-size:var(--text-meta);flex-wrap:wrap}
.directory-pagination>div{gap:var(--space-12);flex-wrap:wrap}
.metrics,.admin-panels,.finance-panels{gap:var(--space-16);margin-bottom:var(--space-16)}
.metric,.bid-metric{padding:var(--space-16);min-height:104px}
.metric>div,.bid-metric>div>span{font-size:var(--text-control);line-height:1.4}
.metric>strong,.bid-metric strong{font-size:var(--text-stat);font-weight:600;line-height:1.2;margin:var(--space-8) 0 var(--space-4)}
.metric>small,.bid-metric small{font-size:var(--text-meta);line-height:1.4;display:block}
.bid-metric{align-items:flex-start}
.bid-metric>div{text-align:left;min-width:0}
.bid-metric>div>span{display:block;min-height:36px}
.metric>div{min-height:36px;align-items:flex-start}
.bid-metric .metric-symbol{margin-top:var(--space-4)}
.metric-symbol{width:32px;height:32px;border-radius:var(--radius-control)}
.metric-symbol:is(.blue,.red,.green,.purple){background:var(--soft);color:var(--muted)}
.quick-links button{min-height:40px;font-size:var(--text-control);padding:var(--space-12) 0}
.admin-panels h2{padding:var(--space-16)}
.calendar-toolbar,.project-module .calendar-toolbar{padding:var(--space-12) var(--space-16);gap:var(--space-12);flex-wrap:wrap}
.calendar-controls{gap:var(--space-8);flex-wrap:wrap}
.calendar-controls strong{font-size:var(--text-control);min-width:8rem}
.segments{display:flex;flex-wrap:wrap;gap:var(--space-4);padding:var(--space-4);background:var(--soft);border:1px solid var(--line);border-radius:var(--radius-control)}
.segments button{font-size:var(--text-control);min-height:28px;padding:var(--space-4) var(--space-8);border:0;border-radius:var(--radius-xs);background:transparent;color:var(--muted)}
.segments button.active{background:var(--surface);color:var(--accent);box-shadow:var(--shadow)}
.calendar-week span,.work-weekdays>span{font-size:var(--text-meta);padding:var(--space-8);text-transform:none}
.calendar-day{min-height:88px;font-size:var(--text-meta);padding:var(--space-8)}
.calendar-day.outside{color:var(--muted)}
.work-agenda{padding:0 var(--space-16) var(--space-16)}
.work-event{padding:var(--space-12) var(--space-8);gap:var(--space-12)}
.work-event time,.work-event small{font-size:var(--text-meta)}
.work-event strong{font-size:var(--text-body)}
.work-event.compact strong{font-size:var(--text-meta);line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.work-weekdays>span,.work-day>span{font-size:var(--text-meta)}
.work-day{height:128px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:var(--space-8)}
.work-event.compact{background:var(--accent-soft);color:var(--text);padding:var(--space-4) var(--space-8);margin-top:var(--space-4)}
.empty,.est-empty,.bid-table .est-empty,.directory-loading,.work-loading{min-height:200px;padding:var(--space-32) var(--space-24)}
.empty strong,.est-empty h2{font-size:var(--text-card);font-weight:600}
.empty p,.est-empty p{font-size:var(--text-body);line-height:1.5;max-width:34rem;margin:var(--space-8) 0 var(--space-16)}
.empty-symbol{width:40px;height:40px;margin-bottom:var(--space-12);border-radius:var(--radius-card)}
.empty-symbol svg{width:22px;height:22px}
.est-empty small,.draft-footnote,.chart-message,.chart-legend,.workflow small{font-size:var(--text-meta)}
.workflow>button,.workflow>div{font-size:var(--text-control);padding:var(--space-12) 0}
.table-panel .est-empty{position:static;width:100%}

/* Forms and transient layers use the same control metrics in every module. */
.modal-backdrop{padding:var(--space-24)}
.modal{border-radius:var(--radius-dialog);box-shadow:var(--shadow-dialog);max-height:90dvh}
.modal>header{padding:var(--space-16) var(--space-20);gap:var(--space-16)}
.modal>header h2{font-size:var(--text-section);line-height:1.35;overflow-wrap:anywhere}
.modal>header>.icon-button{flex-shrink:0}
.form-modal{max-width:720px}
.estimation-form,.record-detail,.drive-modal-content{padding:var(--space-20)}
.form-grid{gap:var(--space-16)}
.form-field{font-size:var(--text-control);font-weight:500;gap:var(--space-8)}
body .form-field :is(input,select,textarea),.drive-modal-content :is(input,select){font:var(--text-body)/1.4 var(--font-ui);min-height:var(--control-height);padding:var(--space-8) var(--space-12);border-radius:var(--radius-control);border:1px solid var(--line);background:var(--surface);color:var(--text)}
body .form-field textarea{min-height:104px;resize:vertical}
.form-help,.form-note,.saved-form-note,.required-help,.form-error{font-size:var(--text-meta);line-height:1.5}
.form-note,.saved-form-note,.form-error{padding:var(--space-12);gap:var(--space-8);border-radius:var(--radius-control)}
.form-actions{gap:var(--space-8);margin-top:var(--space-20);padding-top:var(--space-16);flex-wrap:wrap}
.toast{font-size:var(--text-body);padding:var(--space-12) var(--space-16);border-radius:var(--radius-control);max-width:min(36rem,calc(100vw - 32px));line-height:1.5}
.search-results button{font-size:var(--text-body);min-height:44px;padding:var(--space-12)}
.search-results small{font-size:var(--text-meta)}
.login-heading h2{font-size:var(--text-page);font-weight:600;letter-spacing:-.035em}
.login-card{padding:var(--space-24);max-width:480px;border-radius:var(--radius-dialog)}
.login-heading{margin-bottom:var(--space-20);gap:var(--space-12)}
.login-heading p:last-child,.login-bottom small,.demo-note span{font-size:var(--text-meta)}
#demo-login>label,.demo-note strong,.login-bottom span{font-size:var(--text-control)}
#demo-login .input-wrap,.login-submit{height:auto;min-height:40px}
.story-content h1{font-size:2.25rem;line-height:1.15;letter-spacing:-.04em}
.story-content{padding:var(--space-40) 0}
.story-description,.story-feature strong{font-size:var(--text-body);line-height:1.6}
.story-feature small,.story-content>.eyebrow{font-size:var(--text-meta)}

/* Semantic colors also cover the document archive in dark appearance. */
.saved-indicator,.directory-status.is-active,.saved-form-note{color:var(--success)}
.saved-form-note{background:var(--success-soft);border-color:var(--success-line)}
.pending-indicator{color:var(--warning);background:var(--warning-soft);border-color:var(--warning-line)}
.form-error{color:var(--danger);background:var(--danger-soft)}
.neutral-badge,.status-badge,.work-status{color:var(--muted);background:var(--soft);border-color:var(--line)}
.status-badge.kind,.work-card .work-kind{color:var(--accent);background:var(--accent-soft)}
.status-badge.onhold,.status-badge.quote-type{color:var(--warning);background:var(--warning-soft);border-color:var(--warning-line)}
.status-badge.active,.status-badge.approved,.work-status.complete,.work-card .work-status.complete{color:var(--success);background:var(--success-soft);border-color:var(--success-line)}
.work-card .work-status{background:var(--soft);color:var(--muted);border-color:var(--line)}
.drive-panel{color:var(--text)}
.drive-header{padding:var(--space-16);gap:var(--space-16)}
.drive-header h2{font-size:var(--text-section);margin:var(--space-4) 0}
.drive-header p:last-child{font-size:var(--text-meta);line-height:1.5}
.drive-connection{padding:var(--space-12) var(--space-16);background:var(--warning-soft);border-color:var(--warning-line);color:var(--warning)}
.drive-connection.ready{background:var(--success-soft);border-color:var(--success-line);color:var(--success)}
.drive-connection p{color:inherit;font-size:var(--text-meta);line-height:1.5}
.drive-dot{background:var(--warning)}.ready .drive-dot{background:var(--success)}
.drive-toolbar{padding:var(--space-16);gap:var(--space-12)}
.drive-toolbar :is(input,select){min-height:var(--control-height);font-size:var(--text-body);padding:var(--space-8) var(--space-12);background:var(--surface);border-color:var(--line);color:var(--text);border-radius:var(--radius-control)}
.drive-breadcrumb{padding:var(--space-8) var(--space-16);border-color:var(--line);font-size:var(--text-control)}
.drive-breadcrumb button{color:var(--muted);min-height:32px}.drive-breadcrumb button[aria-current]{color:var(--text)}
.drive-results{padding:var(--space-16)}
.drive-section-title{margin-bottom:var(--space-12);gap:var(--space-12);flex-wrap:wrap}
.drive-section-title h3{font-size:var(--text-card)}
.drive-section-title>span,.drive-folder small,.drive-folder>span:last-child,.drive-file-name small,.drive-empty,.drive-loading,.drive-footer,.drive-plan li span,.drive-modal-content p,.drive-details dt,.drive-queue small{color:var(--muted)}
.drive-folder-grid{gap:var(--space-12);grid-template-columns:repeat(auto-fill,minmax(min(100%,15rem),1fr))}
.drive-folder{padding:var(--space-12);background:var(--surface);border-color:var(--line);color:var(--text);border-radius:var(--radius-control);gap:var(--space-12)}
.drive-folder:hover{background:var(--soft);border-color:var(--accent-line)}
.drive-folder-symbol{color:var(--muted);font-size:var(--text-stat)}
.drive-folder strong,.drive-file-name strong{font-size:var(--text-body);color:var(--text)}
.drive-folder small,.drive-file-name small{font-size:var(--text-meta);line-height:1.4}
.drive-table td,.drive-plan li,.drive-queue>div{color:var(--text);border-color:var(--line)}
.drive-file-symbol{color:var(--muted);background:var(--soft);border-color:var(--line);font-size:var(--text-meta);width:40px}
.drive-status{color:var(--muted);background:var(--soft);border-color:var(--line)}
.drive-status.verified{color:var(--success);background:var(--success-soft);border-color:var(--success-line)}
.drive-empty,.drive-loading{padding:var(--space-32) var(--space-16)}
.drive-empty h3{font-size:var(--text-card);color:var(--text)}
.drive-empty p{font-size:var(--text-body);line-height:1.5}
.drive-footer{padding:var(--space-12) var(--space-16);font-size:var(--text-meta);background:var(--soft);border-color:var(--line)}
.drive-alert{margin:var(--space-12) var(--space-16);background:var(--info-soft);color:var(--info)}
.drive-alert.error{color:var(--danger);background:var(--danger-soft)}
.drive-details{font-size:var(--text-body);gap:var(--space-12)}
.drive-template,.drive-queue{border-color:var(--line);padding:var(--space-16)}
.drive-panel button:disabled{opacity:.55}

@media(max-width:1200px){:root{--page-gutter:24px}.topbar{gap:var(--space-12)}.profile-hero .heading-actions{margin-left:0}.profile-columns{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}}
@media(max-width:1000px){.profile-columns{grid-template-columns:1fr}.profile-side{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-hero{flex-wrap:wrap}.profile-hero .heading-actions{width:100%}.work-detail-tabs{grid-auto-columns:minmax(190px,1fr)}}
@media(max-width:800px){:root{--page-gutter:20px}.stage{margin-left:0}.sidebar{width:var(--sidebar-width)}.topbar{padding:var(--space-8) var(--space-16);gap:var(--space-8);flex-wrap:wrap}.topbar .department{min-width:144px;max-width:none;flex:1}.topbar .global-search{flex:none;min-width:var(--control-height);width:var(--control-height);min-height:var(--control-height);padding:var(--space-8)}.topbar .global-search span,.topbar .global-search kbd{display:none}.topbar-actions{margin-left:0}.content{padding:var(--space-20) var(--page-gutter)}.content .page-heading .heading-actions{margin:0;justify-content:flex-start}.page-heading>div:first-child{flex-basis:100%}.work-detail .work-hero{align-items:flex-start;flex-wrap:wrap}.calendar-day{min-height:64px}.client-grid{grid-template-columns:1fr}.profile-fields{grid-template-columns:1fr}.heading-actions{max-width:100%}.filter-select{max-width:100%;min-width:0}.sub-toolbar-bottom>.filter-select:first-child{min-width:0}.directory-toolbar>.input-wrap{min-width:0}}
@media(max-width:600px){:root{--page-gutter:16px;--control-height:40px}.records-grid,.project-module .records-grid,.directory-grid{grid-template-columns:1fr}.content .page-heading{margin-bottom:var(--space-16)}.profile-side{display:flex}.profile-hero{padding:var(--space-16)}.profile-fields,.identity-fields{padding:var(--space-16)}.profile-avatar{width:48px;height:48px}.work-filter-row>label{flex:1 1 8rem}.work-filter-row .view-switch{margin-left:0}.work-filter-row>span{padding:0}.sub-toolbar-top .view-switch,.persistent-toolbar .view-switch{width:100%}.work-card footer{flex-wrap:wrap}.work-summary-pending{max-width:7rem}.work-detail .work-hero{flex-direction:column}.work-detail-tabs>button{min-height:52px}.modal-backdrop{padding:0;align-items:stretch}.modal,.form-modal{max-width:none;width:100%;max-height:100dvh;height:100dvh;border-radius:0}.modal>header{position:sticky;top:0;background:var(--surface);z-index:1;padding:var(--space-16)}.estimation-form,.record-detail,.drive-modal-content{padding:var(--space-16)}.form-grid{grid-template-columns:1fr}.form-actions .button,.form-actions .primary{min-height:var(--control-touch)}.table-panel table:has(.est-empty){min-width:0}.table-panel .est-empty{width:100%}.drive-toolbar>*{flex:1 1 100%;min-width:0}.drive-search{min-width:0}.drive-header{align-items:flex-start}.drive-header-actions{width:100%}.drive-row-actions{gap:var(--space-8)}.drive-details{grid-template-columns:1fr;gap:var(--space-4)}.calendar-controls strong{min-width:7rem}.login-access{padding:var(--space-64) var(--space-16) var(--space-24)}.login-card{padding:var(--space-20)}.story-content h1{font-size:var(--text-page)}.directory-card-end .directory-status{white-space:normal}.directory-pagination>div{width:100%}}
@media(pointer:coarse){body :is(.button,.primary,.icon-button,.avatar-button,.text-button,.view-switch button,.profile-tabs button,.table-open,.drive-breadcrumb button){min-height:var(--control-touch)}body :is(.icon-button,.avatar-button,.table-open){min-width:var(--control-touch)}body .input-wrap,.filter-select,.sort-select{min-height:var(--control-touch)}.form-field :is(input,select),.work-filter-row select,.drive-toolbar :is(input,select){min-height:var(--control-touch)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.record-card.work-card,.directory-grid>.directory-card{transform:none!important}}
@media(forced-colors:active){.panel,.record-card,.directory-card,.button,.primary,.view-switch,.work-detail-tabs{border:1px solid CanvasText}.primary,.nav-item.selected,.view-switch button.active{forced-color-adjust:auto}.work-card-link:focus-visible::after{outline-color:Highlight}.work-detail-tabs>button[aria-selected=true],.profile-tabs button[aria-selected=true]{outline:2px solid Highlight;outline-offset:-2px}}

/* Keep every utility reachable on small screens and off-canvas navigation out of the tab order. */
@media(max-width:800px){.office:not(.nav-open) .sidebar{visibility:hidden}.office.nav-open .sidebar{visibility:visible}}
@media(max-width:600px){.topbar{display:grid;grid-template-columns:var(--control-height) minmax(0,1fr) var(--control-height)}.topbar .department{min-width:0;width:100%;max-width:none}.topbar-actions{grid-column:1/-1;justify-content:flex-end;width:100%}.topbar .language,.topbar .avatar-button{display:inline-flex}.metric>div{min-height:40px}}

.saved-card .directory-card-end .directory-status{display:inline-flex}

.linked-quote-row{display:flex;align-items:center;gap:16px;width:100%;padding:14px 16px;border:0;border-top:1px solid var(--line);background:transparent;color:inherit;text-align:left;cursor:pointer}.linked-quote-row>span:first-child{flex:1}.linked-quote-row small{display:block;color:var(--muted);margin-top:4px}.linked-quote-row:hover{background:rgba(201,55,72,.05)}.linked-quote-row svg{width:16px;height:16px}

/* Project Quotes: reference register inside the persistent Office navigation. */
.office:has(.work-quotes-view){background:radial-gradient(ellipse at 70% 5%,#f3e8e8 0,transparent 43%),radial-gradient(ellipse at 8% 95%,#e7edef 0,transparent 35%),#f1f4f1}
.office:has(.work-quotes-view) .workspace-footer{display:none}
.office:has(.work-quotes-view) .topbar{min-height:70px;border-radius:0 0 20px 20px;padding:10px 26px;background:#ffffffdd;border-bottom:1px solid #e0e3e0}
.office:has(.work-quotes-view) .department{width:190px;max-width:190px;min-height:50px;border-radius:13px;padding:7px 11px}
.office:has(.work-quotes-view) .department>span{text-transform:uppercase;letter-spacing:.08em;font-size:10px;font-weight:700;color:#858d88}
.office:has(.work-quotes-view) .department select{font-size:13px;min-height:20px;padding:3px 0 0}
.office:has(.work-quotes-view) .global-search{max-width:420px;min-height:42px;border-radius:13px}
.office:has(.work-quotes-view) .topbar-actions{gap:8px}
.office:has(.work-quotes-view) .topbar-actions button{border-radius:12px}
.office:has(.work-quotes-view) .content{max-width:none;padding:30px 39px 56px}
.work-quotes-view>.profile-breadcrumb{margin:0 0 12px}
.work-quotes-view>.profile-breadcrumb button{min-height:20px;font-size:12px;font-weight:700;color:#bd2638}
.content .work-quotes-view .work-hero{margin-bottom:16px;gap:24px}
.content .work-quotes-view .work-hero h1{font-size:46px;font-weight:750;line-height:1.13;letter-spacing:-1.8px;margin-bottom:6px;color:#151815}
.content .work-quotes-view .work-hero p{font-size:12px;line-height:18px;color:#68716d}
.work-quotes-view .work-hero>.primary{min-height:42px;margin-bottom:8px;padding:0 16px;font-size:12px;font-weight:700;border-radius:12px;background:linear-gradient(145deg,#d83848,#d32e40);border:1px solid #d72b3a;box-shadow:0 9px 24px #d52c3930,inset 0 1px 0 #ffffff47}
.work-quotes-view .work-detail-tabs{min-height:66px;border-radius:17px;padding:6px;margin-bottom:12px;background:#ffffffb3;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;overflow:visible}
.work-quotes-view .work-detail-tabs>button{min-height:52px;padding:8px 10px;border-radius:11px;gap:10px}
.work-quotes-view .work-detail-tabs strong{font-size:10px;line-height:14px}
.work-quotes-view .work-detail-tabs small{font-size:9px;line-height:13px;margin-top:1px}
.work-quotes-view .work-tab-icon{width:30px;height:30px}
.work-quotes-view .work-tab-icon svg{width:16px;height:16px}
.work-quotes-view .work-detail-tabs>button[aria-selected=true]{background:#faedef;border:1px solid #e7bbc2;outline:2px solid #ed2944;outline-offset:2px;color:#a8293a}
html[data-theme=dark] .office:has(.work-quotes-view){background:var(--canvas)}
html[data-theme=dark] .office:has(.work-quotes-view) .topbar,html[data-theme=dark] .work-quotes-view .work-detail-tabs{background:var(--surface);border-color:var(--line)}
html[data-theme=dark] .content .work-quotes-view .work-hero h1{color:var(--text)}
html[data-theme=dark] .content .work-quotes-view .work-hero p{color:var(--muted)}
html[data-theme=dark] .work-quotes-view .work-detail-tabs>button[aria-selected=true]{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-line)}
@media(max-width:900px){
 .office:has(.work-quotes-view) .content{padding:24px 20px 40px}
 .work-quotes-view .work-detail-tabs{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(155px,1fr);overflow-x:auto;padding:7px}
 .content .work-quotes-view .work-hero h1{font-size:36px}
 .office:has(.work-quotes-view) .topbar{padding:10px 16px}
}
@media(max-width:600px){
 .office:has(.work-quotes-view) .content{padding:20px 16px 32px}
 .content .work-quotes-view .work-hero{flex-direction:column;align-items:flex-start;gap:14px}
 .content .work-quotes-view .work-hero h1{font-size:32px;letter-spacing:-1px;overflow-wrap:anywhere}
 .work-quotes-view .work-hero>.primary{margin:0}
 .office:has(.work-quotes-view) .topbar{padding:8px 12px}
 .office:has(.work-quotes-view) .department{min-width:130px;width:155px}
}
/* Keep the application shell outside every detailed workspace. */
html,body{max-width:100%;overflow-x:clip}
.office>.sidebar{position:fixed;left:0;top:0;bottom:0;flex-shrink:0}
.office>.stage{min-width:0;width:calc(100% - var(--sidebar-width));margin-left:var(--sidebar-width)}
.stage>.content{min-width:0;max-width:1600px;overflow-x:clip}
#quote-workspace,#admin-workspace{display:block;min-width:0;max-width:100%}
.session-loading{min-height:100dvh;display:grid;place-items:center;color:var(--muted)}
.workspace-signin{display:flex;margin-top:16px;justify-content:center;text-decoration:none}
.portal-preview-banner{position:sticky;top:0;z-index:100;min-height:44px;background:#bc2026;color:white;display:flex;align-items:center;gap:16px;padding:8px 18px;font-size:12px}
.portal-preview-banner button{margin-left:auto;border:1px solid #fff7;border-radius:6px;padding:6px 12px}
.is-preview{outline:3px solid #bc2026;outline-offset:-3px}.is-preview>.sidebar{top:44px}.is-preview .topbar{top:44px}
@media(min-width:801px){.office>.sidebar{display:flex;visibility:visible;transform:none}.office>.stage{margin-left:var(--sidebar-width)}}
@media(max-width:800px){.office>.stage{width:100%;margin-left:0}.portal-preview-banner small{display:none}}
