/* One phone header; desktop declarations are deliberately absent. */
.mh-brand,
.mh-title,
.mh-department {
  display: none;
}
#salesAiTopButton {
  display: none;
  width: 42px;
  height: 40px;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--archive-line, #e1e4e8);
  border-radius: 9px;
  color: var(--archive-navy-900, #122639);
  background: #fff;
}
#salesAiTopButton svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
#appView.full-ai-owner #salesAiTopButton {
  display: grid;
}
#appView.header-tools-hidden #salesAiTopButton {
  display: none !important;
}
@media (max-width: 760px) {
  #appView.mobile-unified-header #unifiedTopbar {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px !important;
    min-height: 72px;
    height: auto !important;
    padding: 12px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--archive-line, #e6e5e2);
    color: var(--archive-navy-900, #122639);
    position: relative;
    overflow: visible;
  }
  #appView.mobile-unified-header .topbar:before {
    display: none !important;
  }
  #appView.mobile-unified-header
    .topbar
    :is(.topbar-copy, .fm-brand, [data-ao-brand], #topUser, #dashboardTopSummary) {
    display: none !important;
  }
  #appView.mobile-unified-header :is(.gm-brand, .owner-brand) {
    display: none !important;
  }
  #appView.mobile-unified-header .mh-brand {
    display: none;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    flex: 1 1 160px;
    order: 1;
  }
  #appView.mobile-unified-header .mh-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: none;
  }
  #appView.mobile-unified-header .mh-brand strong {
    font-size: 20px;
    line-height: 1.3;
    white-space: nowrap;
    letter-spacing: 0;
    color: inherit;
  }
  #appView.mobile-unified-header.mh-workbench .mh-brand {
    display: flex;
  }
  #appView.mobile-unified-header.sales-mobile-user.mh-workbench .mh-brand {
    flex: 1 0 max-content;
    min-width: max-content;
  }
  #appView.mobile-unified-header.sales-mobile-user.mh-workbench .mh-brand strong {
    font-size: 17px;
  }
  #appView.mobile-unified-header.sales-mobile-user .mh-department {
    max-width: 54px;
    padding-inline: 3px;
    font-size: 10px;
  }
  #appView.mobile-unified-header .mh-title {
    display: block;
    flex: 1 1 140px;
    min-width: 0;
    margin: 0;
    font-size: 24px !important;
    line-height: 1.35;
    color: inherit;
    order: 1;
    overflow-wrap: anywhere;
  }
  #appView.mobile-unified-header.mh-workbench .mh-title {
    display: none;
  }
  #appView.mobile-unified-header #financeLanguageSwitcher {
    display: block !important;
    order: 2;
    flex: 0 0 44px;
    margin: 0 !important;
    position: relative;
  }
  #appView.mobile-unified-header #salesAiTopButton {
    order: 3;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
  }
  #appView.mobile-unified-header #financeLanguageButton {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 9px !important;
    border: 0;
    background: transparent;
    color: inherit;
  }
  #appView.mobile-unified-header #financeLanguageCurrent {
    display: none !important;
  }
  #appView.mobile-unified-header #financeLanguageMenu {
    inset-inline-end: 0;
    inset-inline-start: auto;
    max-width: calc(100vw - 24px);
  }
  #appView.mobile-unified-header .topbar .wb-reminder-bell {
    position: static !important;
    transform: none !important;
    order: 4;
    margin: 0 !important;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
  }
  #appView.mobile-unified-header .mh-department {
    display: block;
    order: 5;
    max-width: 92px;
    flex: 0 1 auto;
    padding: 5px 6px;
    border-radius: 6px;
    background: #f5f3ed;
    color: #596476;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
  }
  #appView.mobile-unified-header .topbar .health-indicator {
    position: static !important;
    order: 3;
    flex: none;
    margin: 0 !important;
  }
  #appView.mobile-unified-header #menuBtn {
    order: 0;
    flex: none;
  }
  #appView.mobile-unified-header
    :is(
      #salesMobileNav,
      #ownerMobileNav,
      #guideMobileNav,
      #financeMobileNav,
      .ao-tabs,
      .vo-mobile-nav
    ) {
    background: #fff;
    border-top: 1px solid var(--archive-line, #e6e5e2);
    color: var(--archive-navy-900, #122639);
  }
  #appView.mobile-unified-header
    :is(
      #salesMobileNav,
      #ownerMobileNav,
      #guideMobileNav,
      #financeMobileNav,
      .ao-tabs,
      .vo-mobile-nav
    )
    button {
    font-family: inherit;
  }
  #appView.mobile-unified-header
    :is(
      #salesMobileNav,
      #ownerMobileNav,
      #guideMobileNav,
      #financeMobileNav,
      .ao-tabs,
      .vo-mobile-nav
    )
    :is(.active, .is-active, [aria-current='page']) {
    color: var(--archive-gold-600, #bf861b);
  }
}
@media (max-width: 389px) {
  #appView.mobile-unified-header .mh-brand {
    flex-basis: 100%;
    margin-bottom: 2px;
  }
  #appView.mobile-unified-header.mh-workbench #financeLanguageSwitcher {
    margin-inline-start: auto !important;
  }
}
@media (max-width: 760px) {
  #appView.mobile-unified-header
    #unifiedTopbar
    :is(#topUser, .topbar-copy, .fm-brand, [data-ao-brand], #dashboardTopSummary) {
    display: none !important;
  }
  #appView.mobile-unified-header.guide-mobile-user #menuBtn {
    display: none !important;
  }
  #appView.mobile-unified-header #departmentAccountsButton {
    order: 6;
    margin-inline-start: auto;
    flex: none;
    font-size: 12px;
    min-height: 32px;
  }
}
@media (max-width: 760px) {
  #appView.mobile-unified-header #financeLanguageButton:after {
    display: none !important;
  }
  #appView.mobile-unified-header #financeLanguageButton svg {
    width: 22px;
    height: 22px;
    flex: none;
  }
}

@media (max-width: 760px) {
  #appView.mobile-unified-header #unifiedTopbar:has(.health-indicator) #financeLanguageSwitcher {
    margin-inline-start: auto !important;
  }
}
@media (max-width: 760px) {
  #appView.mobile-unified-header .mh-duplicate-title {
    display: none !important;
  }
  #appView.mobile-unified-header
    :is(.gm-heading, .pf-heading, .owner-title-row):has(> .mh-duplicate-title):not(
      :has(button, a, input, select, p)
    ) {
    display: none;
  }
}

.mh-page-actions {
  display: none;
}
@media (max-width: 760px) {
  #appView.mobile-unified-header .mh-page-actions {
    display: flex;
    order: 2;
    flex: 0 1 calc(65% - 4px);
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }
  #appView.mobile-unified-header .mh-page-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    max-width: 100%;
    padding: 8px 10px;
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid #d3aa5b;
    border-radius: 8px;
    background: #fff;
    color: #805716;
  }
  #appView.mobile-unified-header .mh-page-action svg {
    width: 18px;
    height: 18px;
    flex: none;
  }
  #appView.mobile-unified-header #unifiedTopbar:has(.mh-page-actions) .mh-title {
    flex: 1 1 calc(35% - 8px);
  }
  #appView.mobile-unified-header #unifiedTopbar:has(.mh-page-actions) #financeLanguageSwitcher {
    order: 3;
    margin-inline-start: auto !important;
  }
  #appView.mobile-unified-header.mh-personal .mh-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #appView.mobile-unified-header.mh-personal #financeLanguageSwitcher {
    margin-inline-start: auto !important;
  }
}
@media (max-width: 760px) {
  #appView.mobile-unified-header.mh-workbench:has(#mainContent [data-da-logout]) .mh-brand {
    flex-basis: calc(100% - 52px);
  }
  #appView.mobile-unified-header.mh-workbench:has(#mainContent [data-da-logout])
    #financeLanguageSwitcher {
    margin-inline-start: auto !important;
  }
}
@media (max-width: 760px) {
  #appView.mobile-unified-header.mh-personal :is(#financeLanguageSwitcher, .mh-department) {
    display: none !important;
  }
  #appView.mobile-unified-header.mh-personal #unifiedTopbar {
    min-height: 0;
    padding: 0 !important;
    border-bottom: 0;
  }
  #appView.mobile-unified-header.mh-personal .pf-card .pf-avatar-label {
    display: none !important;
  }
}
/* Personal settings keep their own language and avatar controls on every screen size. */
#appView:has(#mainContent [data-account-profile])
  :is(#financeLanguageSwitcher, .mh-department, .pf-card .pf-avatar-label) {
  display: none !important;
}
/* Guide roster keeps its title and existing add action in a single phone header row. */
#appView.mobile-unified-header:has(#mainContent .gm-roster)
  :is(#financeLanguageSwitcher, .mh-department) {
  display: none !important;
}
#appView.mobile-unified-header.mh-workbench #mainContent .gm-heading [data-gm-refresh] {
  display: none !important;
}
/* Workbench-only global controls apply to every department and both screen sizes. */
#appView.header-tools-hidden #unifiedTopbar :is(#financeLanguageSwitcher, .wb-reminder-bell) {
  display: none !important;
}

/* Shared home greeting on phone and desktop. Keep navigation and actions intact. */
#appView.wb-personal-home #pageTitle {
  display: none !important;
}
#appView.wb-personal-home [data-wb-welcome-title] {
  font-size: 26px !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  overflow-wrap: anywhere;
}
#appView.wb-personal-home [data-wb-welcome-date] {
  font-size: 13px;
  color: var(--text-muted, #697586);
  margin: 6px 0 0;
  line-height: 1.5;
}
#appView.wb-personal-home .wb-personal-heading {
  margin: 0 0 20px;
}
#appView.wb-personal-home
  :is(
    .ao-greeting,
    .ao-date,
    .vo-page .ao-page-head > div > p:not([data-wb-welcome-date]),
    .finance-page-heading > div > span,
    .finance-page-heading > div > p:not([data-wb-welcome-date]),
    .guide-operations-page .archive-page-toolbar > div > span,
    .od-workspace .od-heading > div > p:not([data-wb-welcome-date]),
    .owner-title-row > span:not([data-health-indicator])
  ) {
  display: none !important;
}
#appView.wb-personal-home .owner-title-row {
  flex-wrap: wrap;
}
#appView.wb-personal-home .owner-title-row > [data-wb-welcome-date] {
  order: 5;
  flex-basis: 100%;
}
@media (max-width: 760px) {
  #appView.wb-personal-home [data-wb-welcome-title] {
    font-size: 24px !important;
  }
}

#appView.sales-mobile-user .content-shell.archive-summary-active #topUser {
  display: none !important;
}
@media (max-width: 760px) {
  #appView.mobile-unified-header.sales-mobile-user #unifiedTopbar {
    gap: 0 !important;
    padding-inline: 8px !important;
  }
  #appView.mobile-unified-header.sales-mobile-user
    :is(#financeLanguageSwitcher, #salesAiTopButton) {
    flex-basis: 40px;
    width: 40px;
  }
  #appView.mobile-unified-header.sales-mobile-user #financeLanguageButton {
    min-width: 40px;
    width: 40px;
  }
}

@media (max-width: 760px) {
  #appView.mobile-unified-header.full-ai-owner.mh-workbench .mh-brand {
    flex-basis: 100%;
  }
}
