.customer-ribbon[hidden]{display:none!important}
.portal-brand{display:flex;align-items:center;gap:16px;min-width:0}
.portal-heading{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0}
.portal-heading>[hidden]{display:none}
.portal-heading :is(#portal-user-name,#signed-user,#customer-portal-user){font-size:.875rem;font-weight:500;overflow-wrap:anywhere}
.portal-loading-dialog,.credential-reset-dialog{margin:auto;max-width:min(400px,calc(100% - 32px));padding:24px;border:0;border-radius:16px;background:#fff;color:#163d32}
.portal-loading-dialog::backdrop,.credential-reset-dialog::backdrop{background:rgba(15,42,32,.55)}
.office-cleanup-choice{display:flex;align-items:center;gap:8px;margin:8px 0}.office-cleanup-choice input{width:auto;margin:0}
.portal-loading-status{display:flex;align-items:center;gap:14px;margin:0}
.portal-loading-icon{display:inline-block;flex:none;width:min(160px,40vw);aspect-ratio:1;background:url("/coffee-loading-bug.webp") center/contain no-repeat}
.action-feedback .portal-loading-icon{width:min(112px,30vw)}
/* Advance one cell per frame across 32 columns and down 24 rows. */
@media(prefers-reduced-motion:reduce){.portal-loading-icon{background-image:url("/coffee-loading-bug-still.webp")}}
/* One mobile ribbon. Explicit columns keep the last item out of an implicit, clipped second row. */
@media screen and (max-width:800px){
 :root{--portal-ribbon-safe:max(20px,env(safe-area-inset-bottom,0px));--portal-ribbon-height:calc(80px + var(--portal-ribbon-safe));--mobile-nav-height:var(--portal-ribbon-height);--mobile-nav-safe-bottom:var(--portal-ribbon-safe)}
 body:not(.embedded)>aside{height:var(--portal-ribbon-height);min-height:var(--portal-ribbon-height);padding:8px max(6px,env(safe-area-inset-right,0px)) var(--portal-ribbon-safe) max(6px,env(safe-area-inset-left,0px));background:#163d32;overflow:visible;z-index:30;box-sizing:border-box}
 body:not(.embedded)>aside>nav,body[data-portal="office"]>aside>nav{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none;grid-template-rows:72px;align-items:stretch;gap:3px;height:72px;min-height:72px;width:100%;overflow:visible}
 body:not(.embedded)>aside>nav>:is(button,a),.customer-ribbon>:is(button,a){display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;min-width:0;min-height:72px;height:72px;max-width:100%;padding:6px 2px;white-space:normal;overflow-wrap:anywhere;font-size:clamp(10px,2.7vw,12px);line-height:1.15;text-align:center;color:#d5e1d9;background:transparent;border:0;border-radius:10px;text-decoration:none;box-sizing:border-box}
 body>aside>nav svg,.customer-ribbon svg{display:block;flex:none;width:24px;height:24px}
 body[data-portal="technician"] nav [data-nav="settings"]{display:flex;order:4}
 body>aside>nav #nav-more{display:none!important}
 body>aside>nav .nav-label-full{display:none}body>aside>nav .nav-label-short{display:block}
 body:not(.embedded)>aside>nav>:is(.active,[aria-current="page"]),.customer-ribbon>[aria-current="page"]{background:#315448;color:#fff}
 body:not(.embedded)>aside>nav>[hidden],body>aside>nav>[hidden]{display:none!important}
 /* Sales shares the staff viewport shell. Secondary actions stay in the More dialog. */
 html:has(body[data-portal="sales"]:not(.embedded)){height:100%;overflow:hidden}
 body[data-portal="sales"]:not(.embedded){height:var(--sales-viewport-height,100dvh);min-height:0;overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr) var(--portal-ribbon-height)}
 body[data-portal="sales"]:not(.embedded)>aside{position:relative;inset:auto;width:100%;grid-row:2;margin:0}
 body[data-portal="sales"]:not(.embedded)>aside>a{display:none}
 body[data-portal="sales"]:not(.embedded)>.workspace{grid-row:1;margin:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 body[data-portal="sales"]:not(.embedded)>.workspace>header{flex:none;flex-wrap:wrap;min-height:64px;padding:calc(10px + env(safe-area-inset-top,0px)) 12px 10px}
 body[data-portal="sales"]:not(.embedded)>.workspace>main{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding-bottom:24px}
 body[data-portal="sales"]>aside>nav>[data-mobile-secondary]{display:none!important}
 body[data-portal="sales"]>aside>nav>#sales-nav-more{display:flex}
 .customer-ribbon:not([hidden]){position:fixed;inset:auto 0 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));height:var(--portal-ribbon-height);padding:8px max(6px,env(safe-area-inset-right,0px)) var(--portal-ribbon-safe) max(6px,env(safe-area-inset-left,0px));background:#163d32;z-index:30;box-sizing:border-box}
 body[data-portal="customer"] .portal-shell{padding-bottom:calc(var(--portal-ribbon-height) + 24px)}
 body:not(.embedded)>aside>nav>:focus-visible,.customer-ribbon>:focus-visible{outline:3px solid #c3df8b;outline-offset:-3px}
}
@media screen and (min-width:801px){#sales-nav-more,.customer-ribbon{display:none!important}}
@media print{.customer-ribbon,body>aside{display:none!important}}

@media screen and (max-width:800px){
  body:not(.embedded) > .workspace > header:has(:is(#portal-user-name,#sign-out):not([hidden])){
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    grid-template-rows:auto auto;
    align-items:start;
    align-content:center;
    gap:1px 6px;
    height:auto;
    min-height:0;
    padding:calc(5px + env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) 5px max(10px,env(safe-area-inset-left,0px));
  }
  .workspace > header:has(:is(#portal-user-name,#sign-out):not([hidden])) :is(.tech-login,.sales-header-actions){display:contents}
  .workspace > header:has(:is(#portal-user-name,#sign-out):not([hidden])) > :first-child{grid-column:1;grid-row:1;min-width:0;align-self:center;line-height:1.15}
  .workspace > header:has(:is(#portal-user-name,#sign-out):not([hidden])) :is(#portal-user-name,#signed-user){
    text-align:left;min-width:0;overflow-wrap:anywhere;
    font-size:13px;line-height:1.15;
  }
  .workspace > header:has(:is(#portal-user-name,#sign-out):not([hidden])) :is(#profile,#sign-out):not([hidden]){
    grid-row:1 / 3;grid-column:3;align-self:start;
    display:inline-flex;align-items:center;justify-content:center;
    margin:0;width:auto;min-width:44px;height:auto;min-height:44px;
    padding:5px 9px;box-sizing:border-box;font-size:14px;line-height:1.15;
  }
  .workspace > header:has(:is(#portal-user-name,#sign-out):not([hidden])) #sales-portal-selection:not([hidden]){grid-column:2}
}

.staff-account{position:relative;align-self:flex-start}
.staff-account #portal-user-name{background:transparent;color:inherit;border:0;padding:5px 4px;margin:0;min-height:32px;width:auto;text-align:left;cursor:pointer}
#portal-user-name::after,#sales-account>summary::after{content:"";display:inline-block;margin:0 4px 3px 8px;width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
#sales-account>summary{list-style:none}
#sales-account>summary::-webkit-details-marker{display:none}
#portal-user-name[aria-expanded="true"]::after,#sales-account[open]>summary::after{transform:rotate(225deg);vertical-align:-3px}
#staff-account-options{position:absolute;top:100%;left:0;z-index:45;min-width:180px;padding:4px;background:white;color:#163d32;border:1px solid #dce4df;border-radius:8px;box-shadow:0 4px 12px #163d3226}
#staff-account-options button{display:block;width:100%;text-align:left;border:0;border-radius:4px;background:white;color:inherit;padding:9px 12px;min-height:40px}
#staff-account-options button:is(:hover,:focus-visible){background:#e9f1ed}
.staff-account button:focus-visible{outline:2px solid #176b50;outline-offset:1px}
.tech-login #profile[hidden],#staff-account-options[hidden]{display:none!important}
@media(max-width:800px){.staff-account #portal-user-name{min-height:44px}}



/* Signed-in workspace identity and navigation share the top row. */
body:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])){
 display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:auto;align-items:start;gap:4px;
}
.workspace>header:has(#portal-user-name:not([hidden]))>.portal-heading{
 grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:1px;overflow:visible;min-width:0;color:inherit;
}
.workspace>header:has(#portal-user-name:not([hidden])) #portal-title{order:0;white-space:nowrap;text-align:left}
.workspace>header:has(#portal-user-name:not([hidden])) .staff-account{order:1;overflow:visible}
.workspace>header:has(#portal-user-name:not([hidden])) #technician-site-name{order:2}
.workspace>header:has(#portal-user-name:not([hidden])) .tech-login{display:contents}
.workspace>header:has(#portal-user-name:not([hidden])) #workspace-back-row{grid-column:2;grid-row:1}
.workspace>header:has(#portal-user-name:not([hidden])) #profile:not([hidden]){grid-column:3;grid-row:1}
.workspace>header:has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])):has(#portal-user-name:not([hidden])) #profile{display:none}
@media(max-width:800px){
 .workspace>header:has(#portal-user-name:not([hidden])) #portal-title{font-size:clamp(12px,3.4vw,16px)}
 .workspace>header:has(#portal-user-name:not([hidden])) #profile:not([hidden]),
 .workspace>header:has(#portal-user-name:not([hidden])) #workspace-back-row button{font-size:12px;width:auto;min-width:0;padding:6px;min-height:44px}
}

@media screen and (min-width:801px){
 .workspace>header:has(#portal-user-name:not([hidden])) #workspace-back-row button{
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  min-width:7rem;min-height:44px;padding:8px 14px;margin:0;font-size:14px;line-height:1.2;
 }
}

@media screen and (min-width:801px){
 body:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])){
  grid-template-columns:auto minmax(0,1fr) auto;
  column-gap:16px;
 }
 .workspace>header:has(#portal-user-name:not([hidden])) #workspace-back-row:not([hidden]){grid-column:1}
 .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden]))>.portal-heading{grid-column:2}
}

@media (max-width:800px){
 body[data-portal="technician"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])){
  grid-template-columns:auto minmax(0,1fr) auto;
 }
 body[data-portal="technician"]>.workspace>header:has(#portal-user-name:not([hidden])):has(#office-search-trigger)>#workspace-back-row:not([hidden]){grid-column:1}
 body[data-portal="technician"]>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden]))>.portal-heading{grid-column:2}
 body[data-portal="technician"]>.workspace>header:has(#workspace-back-row:not([hidden])) #portal-title{white-space:normal}
}


/* Equal header actions keep the technician identity centred between them. */
body[data-portal="technician"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])){
 --portal-header-action-width:7rem;
 grid-template-columns:var(--portal-header-action-width) minmax(0,1fr) var(--portal-header-action-width);
 align-items:center;
}
body[data-portal="technician"]>.workspace>header:has(#portal-user-name:not([hidden]))>#workspace-back-row:not([hidden]){
 grid-column:1;grid-row:1;align-self:center;width:100%;margin:0;
}
body[data-portal="technician"]>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden]))>.portal-heading{
 grid-column:2;grid-row:1;align-items:center;text-align:center;
}
body[data-portal="technician"]>.workspace>header:has(#workspace-back-row:not([hidden])) :is(#portal-title,#portal-user-name){
 white-space:normal;text-align:center;
}
body[data-portal="technician"]>.workspace>header:has(#workspace-back-row:not([hidden])) .staff-account{align-self:center}
body[data-portal="technician"]>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])) #workspace-back-row button{
 display:flex;align-items:center;justify-content:center;align-self:center;
 box-sizing:border-box;width:100%;min-width:0;height:44px;min-height:44px;
 margin:0;padding:6px;font-size:14px;font-weight:700;line-height:1.15;white-space:nowrap;
}
@media(max-width:800px){
 body[data-portal="technician"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])){
  --portal-header-action-width:clamp(90px,24vw,104px);
 }
 body[data-portal="technician"]>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])) #workspace-back-row button{font-size:12px}
}


.service-history-heading { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:12px }
.service-history-heading button { flex:none; width:auto; margin:0 }
.service-history-heading h1 { margin-bottom:0 }
@media (max-width:800px) {
 body:not(.embedded)>.workspace>header:has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])):has(#portal-user-name:not([hidden])) {
   grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center;
 }
 .workspace>header:has(#staff-switch-portal:not([hidden])) #workspace-back-row:not([hidden]) { grid-column:1; align-self:center }
 .workspace>header:has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden]))>.portal-heading { grid-column:2; align-items:center; align-self:center; gap:0 }
 .workspace>header:has(#workspace-back-row:not([hidden])) #portal-title { line-height:1.1; margin:0 }
 .workspace>header:has(#workspace-back-row:not([hidden])) .staff-account { align-self:center }
 .workspace>header:has(#workspace-back-row:not([hidden])) .staff-account #portal-user-name { min-height:24px; padding:2px 4px; line-height:1.1 }
}



/* Technician identity stays left of the paired navigation actions. */
body[data-portal="technician"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])){
 grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;
}
body[data-portal="technician"] .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden]))>.portal-heading{
 grid-column:1;grid-row:1;align-items:flex-start;align-self:center;gap:0;
}
body[data-portal="technician"] .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])) #portal-title{
 white-space:normal;text-align:left;line-height:1.1;
}
body[data-portal="technician"] .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])) .staff-account{
 align-self:flex-start;
}
body[data-portal="technician"] .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])) #portal-user-name{
 text-align:left;line-height:1.1;padding:2px 0;min-height:24px;
}
body[data-portal="technician"] .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])) #workspace-back-row:not([hidden]){
 grid-column:2;grid-row:1;align-self:center;
}
body[data-portal="technician"] .workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row:not([hidden])):has(#staff-switch-portal:not([hidden])) #workspace-back-row button{
 display:inline-flex;align-items:center;justify-content:center;
 box-sizing:border-box;width:clamp(80px,23vw,112px);min-width:0;height:44px;min-height:44px;
 margin:0;padding:6px;font-size:12px;line-height:1.15;white-space:normal;
}

/* Keep the two identity lines within the navigation row. */
body:not(.embedded) :is(.workspace>header,body>header) .portal-heading{
 gap:0!important;line-height:1.1;
}
body:not(.embedded) :is(.workspace>header,body>header) .portal-heading>:is(b,strong){
 margin:0;line-height:1.1;
}
body:not(.embedded) :is(.workspace>header,body>header) :is(.staff-account,#sales-account){
 margin:0!important;line-height:1.1;
}
body:not(.embedded) :is(.workspace>header,body>header) :is(#portal-user-name,#signed-user,#customer-portal-user){
 min-height:20px!important;margin:0!important;padding:0!important;line-height:1.1!important;
}
body:not(.embedded) :is(.workspace>header,body>header) #sales-account>summary{
 margin:0;padding:0;line-height:1.1;
}
body:not(.embedded)>.workspace>header:has(:is(#portal-user-name,#signed-user):not([hidden])),
body[data-portal="customer"]>header{
 height:auto!important;min-height:0!important;
 padding-top:calc(5px + env(safe-area-inset-top,0px))!important;padding-bottom:5px!important;
 align-items:center;grid-template-rows:auto;
}
body[data-portal="customer"]>header .portal-brand{flex:1;gap:8px}
body[data-portal="customer"]>header .portal-brand img{width:40px;height:40px;flex:none}
@media(max-width:800px){
 body:not(.embedded)>.workspace>header:has(:is(#portal-user-name,#signed-user):not([hidden])) :is(#profile,#sign-out):not([hidden]){
  grid-row:1;align-self:center;
 }
 body[data-portal="customer"]>header{gap:8px}
 body[data-portal="customer"]>header .portal-brand img{width:32px;height:32px}
 body[data-portal="customer"]>header .actions{flex:none;gap:6px}
 body[data-portal="customer"]>header .actions :is(#customer-switch-portal,#customer-signout,#hosted-customer-signout){width:88px;min-width:88px;height:44px;min-height:44px;font-size:12px;line-height:1.15;padding:6px 8px}
}

/* Keep every staff account action inside one bounded dropdown panel. */
body :is(#sales-account-options,#staff-account-options){
 display:flex;flex-direction:column;gap:8px;box-sizing:border-box;
 position:absolute;inset:calc(100% + 6px) auto auto 0;z-index:45;
 width:min(280px,calc(100vw - 24px));min-width:0;max-width:calc(100vw - 24px);
 max-height:calc(100dvh - env(safe-area-inset-top,0px) - 100px);
 overflow-y:auto;padding:8px;background:#fff;color:#163d32;
 border:1px solid #dce4df;border-radius:10px;box-shadow:0 4px 12px #163d3226;
}
body #staff-account-options[hidden]{display:none!important}
body :is(#sales-account-options,#staff-account-options) #staff-location-status{
 position:static;inset:auto;display:flex;flex-direction:column;gap:8px;
 width:100%;min-width:0;padding:0;margin:0;border:0;border-radius:0;background:transparent;
 font-size:14px;line-height:1.3;
}
body :is(#sales-account-options,#staff-account-options) button{
 display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;
 width:100%;min-width:0;max-width:100%;height:auto;min-height:44px;
 margin:0;padding:10px 12px;border:1px solid #163d32;border-radius:8px;
 font:500 14px/1.3 system-ui,-apple-system,sans-serif;text-align:left;
 white-space:normal;overflow-wrap:anywhere;background:#163d32;color:#fff;
}
body:not(.embedded)>.workspace>header{
 background:#fff;backdrop-filter:none;-webkit-backdrop-filter:none;
}



/* Keep customer content scrolling below an opaque, stable browser header. */
body[data-portal="customer"]>header{
 background:#fff;backdrop-filter:none;-webkit-backdrop-filter:none;
}
@media screen and (max-width:800px){
 html:has(body[data-portal="customer"]:not(.portal-preview)){height:100%;overflow:hidden}
 body[data-portal="customer"]:not(.portal-preview){height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column}
 body[data-portal="customer"]:not(.portal-preview)>header{flex:none;position:relative}
 body[data-portal="customer"]:not(.portal-preview)>main.portal-shell{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
}

/* Desktop Sales Back shares the fixed header with the portal identity. */
@media screen and (min-width:801px){
 body[data-portal="sales"]:not(.embedded)>.workspace>header{
  position:sticky;top:0;display:grid;grid-template-columns:minmax(0,1fr) auto auto;
  column-gap:8px;flex-wrap:nowrap;
 }
 body[data-portal="sales"]:not(.embedded)>.workspace>header>#sales-back{
  grid-column:2;grid-row:1;min-width:7rem;min-height:44px;margin:0;
  padding:8px 14px;font-size:14px;line-height:1.2;
 }
 body[data-portal="sales"]:not(.embedded)>.workspace>header>.portal-heading{grid-column:1;grid-row:1}
 body[data-portal="sales"]:not(.embedded)>.workspace>header>.sales-header-actions{grid-column:3;grid-row:1;margin:0;flex-wrap:nowrap}
 body[data-portal="sales"]:not(.embedded) #sales-app :is(#back-list,#readonly-back,#test-back,#pricing-back,#practice-back,#tutorial-back,#preferences-back){display:none}
}

/* Sales mobile navigation: one stable row, with Back at the left edge. */
@media screen and (max-width:800px){
 body[data-portal="sales"]:not(.embedded)>aside>#sales-nav:not([hidden]){grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-flow:row;gap:3px}
 body[data-portal="sales"] #sales-nav>#sales-back{grid-column:1;grid-row:1}
 body[data-portal="sales"] #sales-nav>[data-page="new"]{grid-column:2;grid-row:1}
 body[data-portal="sales"] #sales-nav>[data-page="history"]{grid-column:3;grid-row:1}
 body[data-portal="sales"] #sales-nav>[data-page="commissions"]{grid-column:4;grid-row:1}
 body[data-portal="sales"] #sales-nav>button{font-size:clamp(9px,2.6vw,12px);white-space:normal;overflow-wrap:normal}
 body[data-portal="sales"] #sales-back:disabled{opacity:.5;cursor:default}
 body[data-portal="sales"]:not(.embedded) #sales-app :is(#back-list,#readonly-back,#test-back,#pricing-back){display:none}
}


/* Keep scrolling content beneath the opaque header in mobile browsers. */
body:not(.embedded) > .workspace > header,
body[data-portal="customer"] > header {
 position:relative;
 z-index:40;
 isolation:isolate;
 background:#fff;
 backdrop-filter:none;
 -webkit-backdrop-filter:none;
}
@media screen and (max-width:800px) {
 /* Authentication changes content, never the Sales header's row structure. */
 body[data-portal="sales"]:not(.embedded) > .workspace > header {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:44px!important;
  gap:6px;
  align-items:center;
  min-height:54px!important;
  padding:calc(5px + env(safe-area-inset-top,0px)) 10px 5px!important;
 }
 body[data-portal="sales"] .workspace > header > .portal-heading {
  grid-column:1;
  grid-row:1;
  min-width:0;
 }
 body[data-portal="sales"] .workspace > header .sales-header-actions {
  display:flex!important;
  flex-wrap:nowrap;
  width:auto;
  margin:0;
  grid-column:2;
  grid-row:1;
  gap:6px;
 }
 body[data-portal="sales"] .workspace > header .sales-header-actions :is(#sales-portal-selection,#sign-out):not([hidden]) {
  width:clamp(64px,19vw,88px);
  min-width:0;
  height:44px;
  min-height:44px;
  padding:5px 6px;
  font-size:12px;
  line-height:1.15;
 }
 body[data-portal="sales"] .workspace > header #portal-title {
  font-size:clamp(12px,3.4vw,16px);
  line-height:1.1;
 }
 body[data-portal="sales"] .workspace > header #signed-user {
  font-size:13px;
 }
}

/* Account actions keep readable contrast when highlighted with mouse or keyboard. */
body :is(#sales-account-options,#staff-account-options) button:is(:hover,:focus-visible) {
 background:#dce9d8; color:#163d32; border-color:#527d66;
 box-shadow:inset 0 0 0 1px #527d66;
}
/* Share Screen uses the Technician presentation regardless of portal page styles. */
dialog.staff-support-dialog {
 box-sizing:border-box;position:fixed;inset:0;margin:auto;
 width:min(580px,calc(100vw - 32px));max-width:calc(100vw - 32px);
 max-height:90dvh;overflow:auto;padding:28px;border:0;border-radius:17px;
 background:#fff;color:#202f2a;font:15px system-ui,-apple-system,sans-serif;
 line-height:normal;text-align:left;
}
dialog.staff-support-dialog::backdrop{background:#102c246b;backdrop-filter:blur(3px)}
.staff-support-dialog h2{margin:0;padding:0 30px 0 0;font-size:20px;line-height:normal;font-weight:700;color:#202f2a}
.staff-support-dialog .staff-support-field{display:grid;gap:10px;margin:20px 0 16px;font-size:12px;line-height:normal;font-weight:650}
.staff-support-dialog .staff-support-field select{
 box-sizing:border-box;margin:0;width:100%;min-width:0;max-width:100%;min-height:44px;
 padding:12px;border:1px solid #dfe4dc;border-radius:8px;background:#fff;color:#202f2a;
 font:15px system-ui,-apple-system,sans-serif;line-height:normal;
}
.staff-support-dialog p{margin:15px 0;color:#737d76;font-size:15px;line-height:1.6}
.staff-support-dialog .staff-support-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.staff-support-dialog .staff-support-actions > :is(button,a){
 box-sizing:border-box;margin:0;min-height:44px;padding:12px 17px;border-width:1px;
 border-style:solid;border-radius:9px;font:15px system-ui,-apple-system,sans-serif;
 line-height:normal;text-decoration:none;
}
.staff-support-dialog .staff-support-actions > a[data-join]:not([hidden]){
 display:inline-flex;align-items:center;justify-content:center;border-color:#163d32;
}
@media(max-width:800px){.staff-support-dialog .staff-support-field select{font-size:16px}}


/* Match the Sales Rep portal's selected item across the fixed desktop sidebars. */
@media screen and (min-width:801px) {
 body:not(.embedded)>aside>nav>:is(button,a):is(.active,[aria-current="page"]) {
  background:#eaf1e8;
  color:#163d32;
  border:2px solid #789582;
  font-weight:750;
 }
}

/* Office feature search shares the fixed header grid. */
#office-search-trigger{display:none}
body[data-portal=office]:not(.workspace-locked) #office-search-trigger{display:inline-flex;align-items:center;gap:.6rem;margin-inline-start:auto;background:#163d32;color:#fff;border:1px solid #163d32;border-radius:.6rem;padding:.45rem .75rem;white-space:nowrap}
#office-search-trigger kbd{font-size:.75rem;color:inherit}
body[data-portal=office] #office-search-trigger{grid-column:4;grid-row:1;align-self:center}
@media(max-width:800px){#office-search-trigger span,#office-search-trigger kbd{display:none}body[data-portal=office] #office-search-trigger{padding:.35rem;min-width:36px;min-height:40px;justify-content:center}}

/* Keep logout in the account menus; preserve the existing logout handlers. */
body[data-portal="sales"] .workspace>header #sign-out,
body[data-portal="office"] .workspace>header .tech-login>#profile{display:none!important}
/* The same ribbon serves Office home and its nested views. */
body[data-portal="office"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row):has(#office-search-trigger){
 display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;column-gap:6px;
}
body[data-portal="office"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row):has(#office-search-trigger)>.portal-heading{grid-column:1;grid-row:1;justify-self:start;align-items:flex-start;text-align:left}
body[data-portal="office"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row):has(#office-search-trigger) .staff-account{align-self:flex-start}
body[data-portal="office"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row):has(#office-search-trigger)>#workspace-back-row:not([hidden]){grid-column:2;grid-row:1;margin:0}
body[data-portal="office"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row):has(#office-search-trigger) #office-search-trigger{grid-column:3;grid-row:1;margin:0;min-height:44px;box-sizing:border-box}
@media screen and (min-width:801px){
 body[data-portal="office"]:not(.embedded)>.workspace>header:has(#portal-user-name:not([hidden])):has(#workspace-back-row):has(#office-search-trigger) :is(#office-search-trigger,#workspace-back-row button){height:46px;min-height:46px;align-self:center}
}
body[data-portal="office"] #modal .menu-navigation:has(.office-menu-search) .menu-back{margin-inline-start:auto;margin-inline-end:0}
body[data-portal="office"] #modal .menu-navigation .office-menu-search{margin-inline-start:0}

header :is(#sales-account>summary,#portal-user-name,.client-account>summary){
 border:0!important;background:transparent!important;box-shadow:none!important;
}
header #sales-account>summary::after{align-self:end;margin-bottom:6px}
#modal .menu-navigation button.close{box-sizing:border-box;width:44px!important;min-width:44px;height:44px!important;min-height:44px;flex:0 0 44px;padding:0!important;display:grid;place-items:center;text-align:center}
#modal:has(#my-employee-profile){box-sizing:border-box;width:min(32rem,calc(100% - 24px));max-height:86dvh;overflow:auto;border:1px solid #bdc8c1;border-radius:14px;padding:20px;color:#17392c;background:white}
#my-employee-profile section{border-top:1px solid #d7dfd8;padding:12px 0}
#my-employee-profile dl{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:6px 12px}
#my-employee-profile dd{margin:0;overflow-wrap:anywhere}
