/* Customer workspace: local display preferences and a responsive record pane.
   Domain fields, validation and permissions remain in the existing workflows. */
.customer-view-shortcuts{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.customer-view-shortcuts select{max-width:190px}
.workspace-preferences{display:grid;gap:8px}
.workspace-preference-top{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:8px}
.workspace-preference-top .field{width:160px}
.workspace-column-heading,.workspace-column-option{display:flex;justify-content:space-between;align-items:center;gap:16px}
.workspace-column-heading{font-size:12px;color:var(--work-secondary);padding:8px 0;border-bottom:1px solid var(--work-line)}
.workspace-column-option{min-height:38px}
.workspace-column-option>label{display:flex;align-items:center;gap:10px;cursor:pointer}
.workspace-column-option small{font-size:11px;font-weight:400;color:var(--work-secondary);margin-left:8px}
.workspace-column-option>input{width:86px;min-height:32px;padding:4px 8px;font-variant-numeric:tabular-nums}
.customer-workspace .customer-table-scroll .customer-list-v2{min-width:100%;table-layout:fixed}
.customer-workspace .customer-table-scroll{container-type:inline-size}
.customer-workspace #customer-results{container-type:inline-size}
.customer-workspace .customer-list-v2 [hidden]{display:none!important}
.customer-workspace .customer-list-v2 th{position:sticky;padding-right:14px}
.customer-workspace .customer-list-v2 :is(th,td){font-variant-numeric:tabular-nums}
.customer-workspace .customer-list-v2[data-density=compact] tbody td{height:56px;padding-block:6px}
.customer-workspace .customer-list-v2[data-density=comfortable] tbody td{height:68px;padding-block:10px}
.customer-workspace .customer-list-v2[data-density=compact] .summary-detail .legacy-preview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;max-height:20px}
.customer-workspace .customer-list-v2[data-density=compact] .summary-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:18px;margin-top:0}
.customer-workspace .customer-list-v2[data-density=compact] .next-step{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-height:20px;line-height:20px}
.customer-workspace .customer-list-v2[data-density=compact] .next-column .subline{display:inline;font-size:12px}
.customer-workspace .customer-list-v2[data-density=compact] .next-column .plan-link{display:inline-flex;margin-left:6px;line-height:20px;min-height:24px}
.customer-workspace .customer-list-v2 :is(.owner-column,.customer-note-preview){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.customer-workspace .customer-list-v2 .customer-persistent-actions{gap:6px}
.customer-workspace .customer-list-v2 .customer-persistent-actions .button{padding-inline:10px}
.customer-workspace .customer-list-v2 .customer-persistent-actions .customer-followup-action{min-width:80px}
.customer-workspace .customer-list-v2 .customer-persistent-actions .customer-archive-action{min-width:108px}
.customer-workspace .customer-list-v2 .customer-note-action{min-width:46px}
.customer-note-content{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;margin:0}
.customer-note-empty{margin:0;color:var(--work-secondary);font-size:13px}
.customer-workspace .customer-list-v2 .plan-sample-link .button{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.customer-workspace .customer-list-v2 tr.is-current-customer td{background:#e9f3ed}
.column-resize-handle{position:absolute;inset-block:0;right:0;width:10px;cursor:col-resize;touch-action:none;z-index:8}
.column-resize-handle::after{content:"";position:absolute;right:0;top:8px;bottom:8px;width:1px;background:var(--work-divider)}
.column-resize-handle:is(:hover,:focus-visible)::after{background:var(--accent);width:2px}
.column-resize-handle:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
.workspace-resizing,.workspace-resizing *{cursor:col-resize!important;user-select:none!important}
.drawer.customer-360{container-type:inline-size;box-sizing:border-box}
.drawer-context-toolbar{display:flex;justify-content:space-between;align-items:center;flex:none;min-height:36px;padding:4px 16px;border-bottom:1px solid var(--work-line);font-size:12px;color:var(--work-secondary);background:#f9fbf9}
.drawer-context-toolbar>div{display:flex;align-items:center;gap:4px}
.drawer-context-toolbar .icon-button{width:28px;height:28px}
.rotate-180{transform:rotate(180deg)}
.drawer-resize-handle{display:none}
.customer-360 .drawer-header{padding:18px 20px 16px;background:#f1f7f3}
.customer-360 .drawer-title-row h2{font-size:24px;line-height:32px;margin:0;font-weight:650}
.customer-360 .drawer-actions{margin-top:12px;gap:6px}
.drawer-more{position:relative}
.drawer-more>summary{display:flex;align-items:center;gap:6px;list-style:none;cursor:pointer}
.drawer-more>summary::-webkit-details-marker{display:none}
.drawer-more>summary svg{width:14px;height:14px}
.drawer-more-menu{position:absolute;right:0;top:calc(100% + 4px);width:188px;padding:6px;background:#fff;border:1px solid var(--work-divider);border-radius:6px;z-index:12;box-shadow:var(--work-shadow-popover)}
.drawer-more-menu .button{display:flex;width:100%;justify-content:flex-start;margin:0;padding:8px 10px;color:var(--ink)}
.drawer-more-menu .button:hover{background:var(--work-surface)}
.customer-360 .drawer-body .empty-state{padding:20px 12px}
.customer-360 .drawer-body{padding:16px 20px;background:#fff;overscroll-behavior:contain}
.customer-360 .tab-bar{padding-inline:20px;gap:20px}
.customer-360 .tab-button{min-height:40px;font-size:13px}
.customer-360 .customer-detail-layout{grid-template-columns:minmax(0,1fr)}
.customer-360 .customer-detail-layout .detail-section{border:0;border-bottom:1px solid var(--work-line);padding:16px 0;border-radius:0;margin-bottom:0;box-shadow:none}
.customer-360 .customer-detail-layout .customer-brief{padding:12px 0;background:#fff;border:0;border-radius:0}
.customer-360 .customer-detail-aside .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 20px}
.customer-360 .detail-section>h3{font-size:15px;margin-bottom:12px}
.related-shortcuts{display:flex;align-items:stretch;flex-wrap:wrap;border-block:1px solid var(--work-line);margin:8px 0 12px}
.related-shortcuts button{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 1 120px;padding:12px;background:transparent;border:0;border-right:1px solid var(--work-line);text-align:left;font:inherit;font-size:13px;color:var(--ink);cursor:pointer}
.related-shortcuts button:last-child{border-right:0}
.related-shortcuts button:hover{background:var(--work-surface)}
.related-shortcuts strong{font-size:15px;font-variant-numeric:tabular-nums}
.related-shortcuts button:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
.related-context{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--work-line);margin-bottom:12px}
.related-context p{font-size:12px;color:var(--work-secondary);margin:4px 0 0}
.related-section{padding:16px 0;border-bottom:1px solid var(--work-line);scroll-margin-top:12px}
.related-section>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.related-section h3{font-size:15px;margin:0}
.related-section:focus{outline:2px solid var(--ui-focus);outline-offset:4px}
.related-record{padding:12px 0;border-top:1px solid var(--work-line)}
.related-record:first-child{border-top:0;padding-top:0}
.related-record-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.related-record-head h4{font-size:14px;margin:0;line-height:22px;overflow-wrap:anywhere}
.related-record-head p{font-size:12px;color:var(--work-secondary);margin:4px 0 0;overflow-wrap:anywhere}
.related-record-head .button{white-space:nowrap;flex:none}
.related-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0}
.related-facts dt{font-size:12px;color:var(--work-secondary);margin-bottom:4px}
.related-facts dd{font-size:13px;margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.related-record-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.related-record-history{margin-top:12px;background:var(--work-surface);padding:8px 12px;border-radius:4px}
.related-record-history>summary{font-size:12px;cursor:pointer;color:var(--work-secondary);min-height:28px;line-height:28px}
.related-record-history .related-record{margin-top:12px}
.related-scope-note{font-size:12px;color:var(--work-secondary);margin:12px 0;line-height:1.6}
.customer-360 .chain-brief .business-actions{gap:6px}
@container (min-width:850px){
 .customer-360 .customer-detail-layout{grid-template-columns:minmax(0,1fr) 260px;gap:24px}
 .customer-360 .customer-detail-aside .detail-grid{grid-template-columns:minmax(0,1fr)}
}
@container (min-width:900px){
 .customer-workspace .customer-table-scroll{scroll-padding-inline-end:var(--customer-action-width,230px)}
 .customer-workspace .customer-table-scroll .customer-list-v2 td.actions-column{position:sticky;right:0;z-index:3;background:#fff;box-shadow:-1px 0 0 var(--work-divider)}
 .customer-workspace .customer-table-scroll .customer-list-v2 th.actions-column{right:0;z-index:9;box-shadow:-1px 0 0 var(--work-divider)}
 .customer-workspace .customer-table-scroll .customer-list-v2 tr.is-current-customer td.actions-column{background:#e9f3ed}
}
@media(min-width:1280px){
 body.customer-pane-docked .app-body{margin-right:var(--customer-pane-width)}
 body.customer-pane-docked .customer-workspace{padding-inline:16px}
 body.customer-pane-docked .page-heading{flex-wrap:wrap;gap:12px}
 body.customer-pane-docked .customer-filters{gap:8px}
 body.customer-pane-docked .customer-filters .filter-search{flex:1 1 100%;max-width:none}
 body.customer-pane-docked .customer-view-shortcuts{margin-left:0}
 .overlay[data-overlay=drawer].is-docked{position:fixed;inset:var(--work-topbar-height) 0 0 auto;width:var(--customer-pane-width);padding:0;background:transparent;backdrop-filter:none;align-items:stretch}
 .drawer.is-docked{width:100%;max-width:none;box-shadow:none;border-left:1px solid var(--work-divider);height:100%;animation:none}
 .drawer.is-docked .drawer-resize-handle{display:block;position:absolute;left:0;top:0;bottom:0;width:8px;z-index:10;cursor:col-resize;touch-action:none}
 .drawer-resize-handle:is(:hover,:focus-visible){background:#17665b14;outline:1px solid var(--ui-focus);outline-offset:-1px}
}
@media(max-width:1279px){.drawer-expand{display:none}}
@media(max-width:760px){
 .customer-view-shortcuts{margin-left:0}
 .drawer.customer-360{width:100%}
 .customer-360 :is(.drawer-header,.drawer-body){padding:12px 16px}
 .customer-360 .tab-bar{padding-inline:16px;gap:16px}
 .drawer-context-toolbar{padding-inline:16px}
 .customer-360 .drawer-actions .drawer-followup-action{min-width:112px}
 .related-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
 .related-shortcuts button{padding:10px 8px;flex-basis:90px}
 .related-record-head{gap:8px}
}
@media(pointer:coarse){.column-resize-handle{width:16px}.drawer-context-toolbar .icon-button{width:40px;height:40px}}

/* Customer-level actions share the same scope in sampling and inquiry views. */
.sp-customer-tools{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-wrap:wrap}
.sp-customer-actions{display:flex;align-items:center;gap:8px}
.sp-customer-actions .button{min-height:32px}
@media(max-width:760px){.sp-customer-tools{justify-content:flex-start;gap:12px}}

/* Edit a customer name in place without changing list density. */
.customer-name-edit{display:flex;align-items:center;gap:5px;max-width:100%;min-height:30px;border-radius:4px}
.customer-name-edit>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.customer-name-edit .name-edit-icon{width:12px;height:12px;opacity:0;color:var(--work-secondary);flex:none;fill:none;stroke:currentColor;stroke-width:1.7}
.customer-name-edit:is(:hover,:focus-visible){background:#17665b0d}
.customer-name-edit:is(:hover,:focus-visible) .name-edit-icon{opacity:1}
.anchored-overlay{background:#15213708;backdrop-filter:none}
.modal.anchored-modal{position:fixed;width:360px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);margin:0;border:1px solid var(--work-divider);border-radius:8px;box-shadow:var(--work-shadow-popover);animation:none}
.anchored-modal .modal-header{padding:14px 16px;align-items:flex-start}
.anchored-modal .modal-header h2{font-size:15px}
.anchored-modal .modal-header p{overflow-wrap:anywhere;font-size:12px}
.anchored-modal .modal-body{padding:16px}
.anchored-modal .modal-footer{padding:12px 16px;gap:8px}
.customer-name-fields{display:grid;grid-template-columns:minmax(0,1fr) 106px;gap:12px}
.customer-name-preview{display:flex;align-items:baseline;gap:12px;padding:12px 0;margin-top:6px;border-bottom:1px solid var(--work-line)}
.customer-name-preview>span{flex:none;font-size:12px;color:var(--work-secondary)}
.customer-name-preview>strong{font-size:15px;overflow-wrap:anywhere}
.customer-name-context{font-size:12px;line-height:1.6;color:var(--work-secondary);margin-top:10px}
@media(pointer:coarse){.customer-name-edit .name-edit-icon{opacity:.6}}
