.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--app-bar-h);
  padding: 0 1.5rem;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  /* Pin the app bar to the top of the one document scroll. z above the page, the quickview (45), the menu's backdrop
     (46) and dialog scrims (50), so brand + menu button + account stay reachable; the menu itself (1250) starts under
     the bar, so the two never overlap; well below the sms overlays (~1300). Ladder: components/quickview.css. */
  position: sticky;
  top: 0;
  z-index: 60;
}

/* it-240: a band across the top of the app bar — a house .notice (the act-as notice). The bar grows by the band's
   height through --app-bar-h, so every offset that reads it (the drawer, full-bleed editors) follows. */
.has-app-bar-band { --app-bar-h: calc(var(--app-bar-base-h) + var(--app-bar-band-h)); }
.has-app-bar-band .site-header { padding-top: var(--app-bar-band-h); }
.site-header__band {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--app-bar-band-h);
  margin: 0;
  border-radius: 0;
  padding-block: 0;
  padding-inline: var(--space-6, 24px);
}
.site-header__band > div {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-header__band .btn { white-space: nowrap; }

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--md-sys-typescale-title-large-font);
  font-size: var(--md-sys-typescale-title-large-size);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}
.site-header__brand-mark {
  width: 28px;
  height: 28px;
  background: var(--md-sys-color-primary);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* The bar's buttons never give up width: squeezed below their own size, an icon is clipped to half a glyph and the
   row reads as one smear (fix-mobile-app-bar — an iPhone's 393px bar). */
.site-header > .icon-btn,
.site-header > form,
.site-header .lead-clock-hdr { flex-shrink: 0; }
.site-header__signout { display: flex; align-items: center; }
.site-header__signout-icon { display: none; } /* the button's icon slot — a phone's (below) */

/* A phone: the bar keeps the mark, the menu, its icons and Sign out — tighter gaps, the name and Sign out's words go. */
@media (max-width: 600px) {
  .site-header { gap: 0.25rem; padding: 0 0.75rem; }
  .site-header__brand { margin-right: 0.5rem; }
  .site-header__brand-name { display: none; }
  .site-header__signout-text { display: none; }
  .site-header__signout-icon { display: block; line-height: 1; font-size: 20px; }
  .site-header__signout-btn {
    --md-text-button-icon-size: 20px;
    --md-text-button-icon-color: var(--md-sys-color-on-surface-variant);
    --md-text-button-hover-icon-color: var(--md-sys-color-on-surface-variant);
    --md-text-button-focus-icon-color: var(--md-sys-color-on-surface-variant);
    --md-text-button-pressed-icon-color: var(--md-sys-color-on-surface-variant);
    --md-text-button-leading-space: 10px;
    --md-text-button-trailing-space: 10px;
  }
}

/* it-64: the old horizontal .site-header__nav (+ its links) moved to the left
   navigation drawer — see static/css/layouts/sidebar.css. */

/* ContactType switcher — the on-page control in the contacts toolbar that
   shows the active contactType and opens a menu to switch. Replaces the old
   nav-link hover dropdown. */
.contact-type-switcher {
  position: relative;
  display: inline-flex;
}

.contact-type-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem 0.35rem 0.6rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font: inherit;
  font-size: var(--md-sys-typescale-label-large-size);
  cursor: pointer;
}
.contact-type-switcher__trigger:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, transparent);
}

.contact-type-switcher__name {
  font-weight: 500;
}

.contact-type-switcher__all-icon {
  font-size: 1.1rem;
  color: var(--md-sys-color-on-surface-variant);
}

.contact-type-switcher__caret {
  font-size: 1.2rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: -0.1rem;
}

.contact-type-switcher__menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 220px;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium);
  box-shadow: var(--md-sys-elevation-level2);
  padding: 0.25rem 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
}

.contact-type-switcher__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: var(--md-sys-typescale-label-large-size);
}
.contact-type-switcher__item:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}
.contact-type-switcher__item.is-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
