/* All shell changes are restricted to the customer route. Other screens retain their styles. */
body.crm-customer-route{--cw-navy:#14243f;--cw-blue:#1454ee;--cw-ink:#142036;--cw-muted:#66758f;--cw-border:#dfe6f0;--cw-bg:#f4f7fb;background:var(--cw-bg);color:var(--cw-ink)}
.crm-customer-route .layout{display:grid;grid-template-columns:208px minmax(0,1fr);gap:0;max-width:none;margin:0;padding:0;min-height:calc(100dvh - 64px)}
.crm-customer-route .layout>.nav{background:var(--cw-navy);color:#e1e9f7;border:0;border-radius:0;padding:16px 10px;min-width:0;align-self:stretch}
.crm-customer-route .nav button{color:#dfe8f8;background:transparent;border:0;border-radius:7px;min-height:44px;text-align:left;width:100%;font-size:14px}
.crm-customer-route .nav button:hover{background:#203758}.crm-customer-route .nav button.active{background:var(--cw-blue);color:white}
.crm-customer-route .nav-caption,.crm-customer-route .nav summary{color:#b0c2de}.crm-customer-route .nav-group{border-color:#31425d}
.crm-customer-route .layout>.main{min-width:0;max-width:none;background:var(--cw-bg);padding:0;margin:0;border:0}
#customer-workspace{width:100%;min-width:0;min-height:calc(100dvh - 64px);font-family:inherit;color:var(--cw-ink,#142036)}
#customer-workspace *{box-sizing:border-box}
#customer-workspace [hidden]{display:none!important}
#customer-workspace button,#customer-workspace input,#customer-workspace textarea,#customer-workspace select{font:inherit}
#customer-workspace button{cursor:pointer;min-height:42px;border:1px solid var(--cw-border,#dfe6f0);border-radius:6px;background:white;color:#405371;padding:9px 15px;font-weight:600}
#customer-workspace button:hover{background:#eef3fc}#customer-workspace button:active{background:#e3ebfa}
#customer-workspace button:disabled{cursor:not-allowed;opacity:.55}
#customer-workspace :is(button,input,textarea,select):focus-visible{outline:3px solid #81a7ff;outline-offset:2px}
#customer-workspace .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.cw-grid{display:grid;grid-template-columns:minmax(310px,30%) minmax(0,1fr);min-height:calc(100dvh - 64px)}
.cw-directory{min-width:0;border-right:1px solid #e1e7f0;background:#fff}
.cw-directory-head{padding:24px 22px 16px;background:linear-gradient(#f4f7fb,#fff)}
.cw-heading{display:flex;align-items:center;gap:10px;margin-bottom:19px}.cw-heading h1{margin:0;font-size:27px;letter-spacing:-1px;line-height:1.3;color:#111c2f}.cw-count{font-size:12px;color:#7787a0;background:#e9eef6;padding:3px 8px;border-radius:12px}
.cw-segments{display:grid;grid-template-columns:1fr 1fr;border:1px solid #d7e0ef;border-radius:7px;overflow:hidden;margin-bottom:18px}
#customer-workspace .cw-segments button{border:0;border-radius:0;background:#f7f9fc;padding:11px 6px}
#customer-workspace .cw-segments button[aria-selected=true]{background:var(--cw-blue,#1454ee);color:white;box-shadow:0 2px 4px #123d9920}
.cw-search{display:flex;align-items:center;gap:9px;border:1px solid #d4dfed;border-radius:6px;background:white;padding:0 12px;box-shadow:0 1px 2px #19355205}
.cw-search>span:first-child{font-size:25px;color:#7b8ca5;line-height:1}
#customer-workspace .cw-search input{border:0;min-width:0;width:100%;padding:13px 0;outline:0;background:transparent;color:#203047;font-size:14px}
.cw-directory-head>button{margin-top:10px;width:100%;font-size:12px}
.cw-list{padding:0 8px 12px;max-height:calc(100dvh - 245px);overflow-y:auto;overscroll-behavior:contain}
#customer-workspace .cw-row{width:100%;display:flex;align-items:center;gap:12px;text-align:left;border:0;border-bottom:1px solid #e9edf4;border-radius:0;padding:17px 13px;min-height:83px;background:white;position:relative;font-weight:400}
#customer-workspace .cw-row[aria-pressed=true]{background:#eef4ff;box-shadow:inset 3px 0 var(--cw-blue,#1454ee);border-radius:5px}
.cw-row-main{min-width:0;flex:1}.cw-row-main strong{display:block;font-size:15px;color:#18243a;overflow-wrap:anywhere}.cw-row-main small{display:block;margin-top:7px;font-size:13px;color:#6b7e99;overflow-wrap:anywhere}
.cw-avatar{flex:none;width:70px;height:70px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:linear-gradient(145deg,#f0f3f8,#e0e7f0);color:#8798ae;font-size:25px;font-weight:700;box-shadow:inset 0 0 0 1px #dfe6f1}
.cw-avatar-small{width:43px;height:43px;font-size:17px}
.cw-badge{display:inline-flex;align-items:center;justify-content:center;flex:none;max-width:130px;font-size:12px;font-weight:700;padding:6px 10px;border-radius:9px;color:#1e5fea;background:#e7efff;white-space:normal;line-height:1.4;overflow-wrap:anywhere}
.cw-row .cw-badge{max-width:85px;font-size:11px}
.cw-detail{min-width:0;padding:22px 20px 28px;max-height:calc(100dvh - 64px);overflow-y:auto;overscroll-behavior:contain}
.cw-profile{display:flex;align-items:center;justify-content:space-between;gap:18px;background:white;border:1px solid #e0e7f1;border-radius:11px;padding:22px;margin-bottom:16px;min-height:118px;box-shadow:0 2px 5px #182f4f02}
.cw-profile-main{display:flex;align-items:center;gap:18px;min-width:0}.cw-profile-name{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.cw-profile-name h2{font-size:26px;margin:0;color:#121c2e;letter-spacing:-.8px;overflow-wrap:anywhere}.cw-profile-main p{font-size:15px;color:#62738e;margin:10px 0 0}
.cw-profile-side{display:flex;flex-direction:column;align-items:flex-end;gap:11px;text-align:right}
.cw-sync{font-size:12px;font-weight:600;color:#6d7d93;display:flex;align-items:center;justify-content:flex-end;gap:6px;max-width:180px;line-height:1.6}
.cw-sync i{width:8px;height:8px;border-radius:50%;background:#a5b1c1;flex:none}.cw-sync[data-sync-state=applied]{color:#139750}.cw-sync[data-sync-state=applied] i{background:#17b965}
.cw-sync:is([data-sync-state=attention_required],[data-sync-state=conflict],[data-sync-state=unknown]){color:#9b6516}.cw-sync:is([data-sync-state=attention_required],[data-sync-state=conflict],[data-sync-state=unknown]) i{background:#da9b2b}
.cw-next-task{background:white;border:1px solid #e0e7f1;border-radius:10px;padding:18px 22px;margin-bottom:16px}.cw-next-task h3{margin:0 0 15px;font-size:17px}.cw-next-task>div{display:flex;justify-content:space-between;gap:15px;border:1px solid #dce4f0;padding:17px;border-radius:6px}.cw-next-task span{color:#72829a;font-size:13px}
.cw-consultation{background:white;border:1px solid #e0e7f1;border-radius:10px;overflow:hidden}
.cw-note-tabs{display:flex;align-items:center;gap:15px;min-height:55px;border-bottom:1px solid #e0e7f1;padding:0 21px}
#customer-workspace .cw-note-tabs button,.cw-note-tab{border:0;border-bottom:3px solid transparent;border-radius:0;background:none;min-height:55px;padding:16px 4px 13px;color:#6d7c94;font-weight:600}
#customer-workspace .cw-note-tabs button[aria-selected=true],.cw-note-tab.active{border-bottom-color:var(--cw-blue,#1454ee);color:var(--cw-blue,#1454ee)}
.cw-note-privacy{font-size:11px;color:#7b8799;margin-left:auto}
.cw-note-body{padding:22px 23px}.cw-note-body h3{margin:0 0 8px;font-size:19px;letter-spacing:-.4px}.cw-muted{font-size:13px;color:#6e7e96;margin:0 0 18px;line-height:1.7}
.cw-history{margin:20px 0 26px}.cw-history-entry{position:relative;border-left:2px solid #e0eaff;margin-left:7px;padding:0 0 18px 22px}
.cw-history-entry:last-child{padding-bottom:0}.cw-history-dot{position:absolute;left:-6px;top:4px;width:10px;height:10px;background:#2464ed;border-radius:50%;box-shadow:0 0 0 3px white}
.cw-history-entry header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px;color:#6a7b96;font-size:12px;line-height:1.6}.cw-history-entry header>span{font-size:11px;color:#8491a7}
.cw-history-text{background:#f4f7fb;border:1px solid #edf0f6;border-radius:5px;padding:13px 15px;font-size:14px;line-height:1.85;color:#3e4f69;white-space:pre-wrap;overflow-wrap:anywhere}
.cw-note-body form{border-top:1px solid #e4eaf3;padding-top:20px}
.cw-note-body form>label{display:block;font-weight:700;font-size:14px;margin:0 0 10px}
#customer-workspace textarea{resize:vertical;display:block;width:100%;min-height:150px;border:1px solid #d2ddec;border-radius:6px;padding:15px;color:#283951;background:white;font-size:15px;line-height:1.8}
#customer-workspace textarea::placeholder{color:#9aa9bf}
#customer-workspace textarea:disabled{background:#f5f7fa;color:#67768d}
.cw-composer-meta{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:10px;font-size:12px;color:#8a97ac}
.cw-composer-meta label{display:flex;align-items:center;gap:8px;color:#6a7a94;font-weight:400}
#customer-workspace .cw-composer-meta input,#customer-workspace .cw-composer-meta select{width:auto;min-width:0;min-height:34px;border:1px solid #d8e0ed;border-radius:4px;color:#596d89;padding:5px 7px;font-size:12px;background:white}
.cw-composer-footer{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-top:18px}
.cw-composer-footer>span{font-size:12px;color:#7b8aa1;line-height:1.7}
.cw-composer-footer>div{display:flex;gap:9px;flex:none}
#customer-workspace .cw-primary{background:var(--cw-blue,#1454ee);color:white;border-color:var(--cw-blue,#1454ee);min-width:116px}
#customer-workspace .cw-primary:hover{background:#1047d1}
#customer-workspace .cw-text-button{font-size:12px;padding:4px 7px;border:0;min-height:30px;background:transparent;color:#7687a0}
.cw-feedback{font-size:13px;line-height:1.8;color:#537095;overflow-wrap:anywhere}.cw-feedback:empty{display:none}
.cw-alert{background:#fff6e8;border:1px solid #f1d5a5;border-radius:6px;padding:11px;font-size:13px;line-height:1.75;color:#8e601b}
.cw-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:420px;text-align:center;color:#8191a8;padding:35px}.cw-empty-symbol{font-size:58px;color:#c6d3e7}.cw-empty h2{font-size:21px;color:#445c7c}.cw-empty p{font-size:14px;line-height:1.8}
.cw-list-empty{padding:30px 18px;color:#7c8ca3;line-height:1.8}.cw-list-empty h3{font-size:17px;color:#566c88}.cw-list-empty p{font-size:13px}
.cw-record-details{border:1px solid #e0e7f1;background:white;border-radius:7px;margin-top:14px;padding:12px 17px;color:#667a96;font-size:13px}
.cw-record-details>summary{cursor:pointer;min-height:25px;line-height:25px}.cw-record-details[open]>summary{margin-bottom:15px}
.cw-menu,.cw-back,.cw-nav-shade{display:none!important}
.cw-legacy{padding:20px;background:white;max-height:calc(100dvh - 64px);overflow:auto}
@media(min-width:901px) and (max-width:1250px){.crm-customer-route .layout{grid-template-columns:170px minmax(0,1fr)}.cw-grid{grid-template-columns:minmax(270px,35%) minmax(0,1fr)}.cw-directory-head{padding:22px 15px 15px}.cw-detail{padding:17px 13px}.cw-profile{padding:17px;gap:9px}.cw-avatar{width:50px;height:50px}.cw-avatar-small{width:36px;height:36px}.cw-profile-name h2{font-size:21px}.cw-profile-side{max-width:120px}.cw-note-body{padding:18px}.cw-row .cw-badge{max-width:70px}.cw-composer-footer{align-items:flex-start;flex-direction:column}.cw-composer-footer>div{align-self:flex-end}}
@media(max-width:900px){.crm-customer-route .layout{display:block;min-height:calc(100dvh - 60px)}.crm-customer-route .layout>.nav{position:fixed;inset:0 auto 0 0;width:280px;max-width:85vw;height:100dvh;overflow:auto;z-index:1000;transform:translateX(-110%);transition:transform .18s ease}.crm-customer-route.cw-menu-open .layout>.nav{transform:translateX(0)}.cw-menu-open #customer-workspace .cw-nav-shade{display:block!important;position:fixed;inset:0;z-index:999;border:0;border-radius:0;background:#10213b70}.cw-grid{display:block;min-height:calc(100dvh - 60px)}.cw-directory{border:0;min-height:calc(100dvh - 60px)}.cw-directory-head{padding:20px 18px 13px}.cw-heading h1{font-size:25px}#customer-workspace .cw-menu{display:inline-block!important;padding:5px 10px;min-height:40px;font-size:20px}.cw-list{max-height:none;overflow:visible;padding:0 10px 16px}.cw-grid[data-cw-detail=open]>.cw-directory{display:none}.cw-grid[data-cw-detail=closed]>.cw-detail{display:none}.cw-detail{max-height:none;overflow:visible;padding:14px 12px 24px}.cw-profile{padding:16px;flex-wrap:wrap;gap:13px}.cw-profile-main{gap:13px}.cw-profile-name h2{font-size:24px}.cw-profile-side{width:100%;flex-direction:row;justify-content:space-between;align-items:center;text-align:left}.cw-sync{justify-content:flex-start;max-width:none}#customer-workspace .cw-back{display:block!important;width:100%;text-align:left;padding:4px 0 11px;border:0;border-bottom:1px solid #e8edf5;border-radius:0;font-size:14px;color:#667f9e;min-height:38px;margin-bottom:2px;background:transparent}.cw-avatar{width:53px;height:53px;font-size:22px}.cw-avatar-small{width:43px;height:43px;font-size:17px}.cw-next-task{padding:16px}.cw-next-task>div{flex-wrap:wrap}.cw-note-tabs{padding:0 15px;gap:20px}.cw-note-body{padding:19px 16px}.cw-note-privacy{display:none}.cw-history-entry{padding-left:16px}.cw-history-entry header{align-items:flex-start;flex-direction:column;gap:3px}.cw-history-text{padding:12px;font-size:15px}.cw-composer-footer{flex-direction:column;align-items:stretch}.cw-composer-footer>div{display:grid;grid-template-columns:1fr 1.35fr}.cw-composer-footer button{min-height:46px}#customer-workspace textarea{font-size:16px;min-height:170px}.cw-composer-meta{font-size:12px;gap:8px}.cw-composer-meta label{flex-wrap:wrap}.cw-record-details{padding:12px}.cw-empty{min-height:320px}.cw-legacy{max-height:none}.cw-row-main strong{font-size:16px}}
@media(prefers-reduced-motion:reduce){.crm-customer-route .layout>.nav{transition:none}}
/* Existing sidebar-auto rules are intentionally retained; only this route wins. */
body.crm-ui.crm-sidebar-auto.crm-customer-route .frame>.layout>#main{padding:0!important;margin:0!important;border:0!important;min-width:0!important;background:#f4f7fb!important}
body.crm-ui.crm-sidebar-auto.crm-customer-route .frame>.layout{gap:0!important;max-width:none!important}
body.crm-ui.crm-sidebar-auto.crm-customer-route .layout>nav.nav{background:#14243f!important;color:#dfe8f8!important;border-color:#14243f!important}
body.crm-ui.crm-sidebar-auto.crm-customer-route .nav button{color:#dfe8f8!important;background:transparent!important}
body.crm-ui.crm-sidebar-auto.crm-customer-route .nav button.active{background:#1454ee!important;color:#fff!important}
#customer-workspace .cw-search-scope{margin:7px 0 0;font-size:11px;color:#8a98ad;line-height:1.6}
#customer-workspace .cw-pager{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8494aa;font-size:11px}
#customer-workspace .cw-pager button{font-size:11px;padding:5px 9px;min-height:32px}
#customer-workspace .cw-history{max-height:240px;overflow:auto;overscroll-behavior:contain}
@media(max-width:900px){#customer-workspace .cw-search input{font-size:16px}#customer-workspace .cw-history{max-height:280px}body.crm-ui.crm-sidebar-auto.crm-customer-route .layout>nav.nav{z-index:1000!important}}

/* Manager: verified full-shell customer compatibility. */
@media(min-width:901px){
  body.crm-ui.crm-customer-route .frame{display:flow-root}
  body.crm-ui.crm-customer-route .frame>.layout>#main.main{min-height:0!important}
  #customer-workspace .cw-grid{height:calc(100dvh - var(--crm-shell-top,64px));min-height:0}
  #customer-workspace .cw-directory{display:flex;flex-direction:column;max-height:100%;overflow:hidden}
  #customer-workspace .cw-directory-head{flex:0 0 auto}
  #customer-workspace .cw-list{flex:1;min-height:0;max-height:none}
  #customer-workspace .cw-detail{max-height:100%}
}
/* Scoped compatibility with the existing CRM shell and company forms. */
body.crm-ui.crm-customer-route{--crm-nav:#14243f!important;--crm-nav-hover:#203758!important}
body.crm-ui.crm-customer-route .frame>.layout>#main.main{padding:0!important;margin:0!important;background:#f4f7fb!important}
body.crm-ui.crm-sidebar-auto.crm-sidebar-auto.crm-customer-route .frame>.layout>nav.nav{background:#14243f!important}
#customer-workspace #company-customers-panel{margin:0;padding:0;border:0;border-radius:0;background:transparent;color:#142036;min-width:0}
body.crm-ui.crm-sidebar-auto.crm-customer-route .nav button:not(.active):hover{background:#203758!important}
#customer-workspace .cw-search{display:flex;flex-direction:row;align-items:center;gap:9px}
#customer-workspace .cw-search input{margin:0;height:44px;min-height:44px;padding:10px 0}
#customer-workspace .cw-note-body form{display:block;margin:0;padding-top:18px}
#customer-workspace .cw-note-body form>label{margin:0 0 10px}
#customer-workspace .cw-note-body textarea{height:150px;min-height:150px}
#customer-workspace .cw-composer-meta label{display:flex;flex-direction:row;align-items:center;gap:8px;font-weight:400}
#customer-workspace .company-private{border-top:0;margin-top:0}
#customer-workspace .company-warning{margin:12px 0 0;padding:10px 12px;font-size:11px;line-height:1.7;background:#fff8e9;border-color:#edd8a7;color:#80602e}
#customer-workspace .company-canonical,#customer-workspace .company-pending{background:#f4f7fb;border-color:#dfe6f0;color:#243043}
#customer-workspace .company-fields input{background:white;color:#243043;border-color:#cbd4df}
#customer-workspace .company-fields input:disabled{background:#f5f7fa;color:#67768d}
#customer-workspace .company-canonical dt,#customer-workspace .company-notes small{color:#66758f}
@media(max-width:900px){
  body.crm-ui.crm-sidebar-auto.crm-sidebar-auto.crm-customer-route.cw-menu-open:not(.crm-auth-screen):not(.crm-auth-pending) .frame>.layout>nav.nav{transform:none!important;visibility:visible!important;pointer-events:auto!important;z-index:1000!important}
  #customer-workspace .cw-note-body textarea{height:170px;min-height:170px}
  #customer-workspace .cw-note-body form>label{font-size:14px}
}
