/* CPS_MERGED_HEADER_PLACEMENT_FIX_V2
   Corrects desktop alignment and prevents the page title/search/profile controls
   from colliding or clipping after the V1 header merge. */
header.top.cps-topbar.cps-merged-header-v1 {
  box-sizing: border-box !important;
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 82px !important;
  height: auto !important;
  padding: 10px 18px !important;
  overflow: visible !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand {
  flex: 0 1 285px !important;
  width: 285px !important;
  min-width: 220px !important;
  max-width: 310px !important;
  overflow: hidden !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title {
  box-sizing: border-box !important;
  flex: 0 1 275px !important;
  width: 275px !important;
  min-width: 220px !important;
  max-width: 300px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-self: stretch !important;
  padding: 5px 12px !important;
  overflow: hidden !important;
  border-left: 1px solid rgba(255,255,255,.24) !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title .breadcrumb {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  margin: 0 0 3px !important;
  font-size: 9px !important;
  line-height: 1.15 !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title .welcome-kicker {
  margin: 0 0 3px !important;
  font-size: 8px !important;
  line-height: 1.1 !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title h1 {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  font-size: clamp(14px,1.15vw,17px) !important;
  line-height: 1.18 !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title h1 .cps-welcome-title-line {
  display: inline !important;
  white-space: normal !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title p {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 3px 0 0 !important;
  font-size: 9px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
header.top.cps-topbar.cps-merged-header-v1 > #topSearchbar,
header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
  box-sizing: border-box !important;
  display: flex !important;
  flex: 1 1 250px !important;
  width: auto !important;
  min-width: 180px !important;
  max-width: none !important;
  margin: 0 !important;
}
header.top.cps-topbar.cps-merged-header-v1 > .top-right {
  box-sizing: border-box !important;
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
  min-width: max-content !important;
  margin: 0 0 0 auto !important;
  white-space: nowrap !important;
}
header.top.cps-topbar.cps-merged-header-v1 .top-profile-copy {
  display: flex !important;
  flex-direction: column !important;
  min-width: 72px !important;
}
header.top.cps-topbar.cps-merged-header-v1 .top-sync,
header.top.cps-topbar.cps-merged-header-v1 .top-signout {
  min-height: 34px !important;
  padding: 7px 9px !important;
  white-space: nowrap !important;
}
@media (max-width: 1250px) {
  header.top.cps-topbar.cps-merged-header-v1 { gap: 8px !important; padding-inline: 12px !important; }
  header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand {
    flex-basis: 225px !important; width: 225px !important; min-width: 190px !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title {
    flex-basis: 225px !important; width: 225px !important; min-width: 190px !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 .top-profile-copy { display: none !important; }
}
@media (max-width: 900px) {
  header.top.cps-topbar.cps-merged-header-v1 {
    flex-wrap: wrap !important;
    min-height: 0 !important;
    row-gap: 8px !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand {
    flex: 1 1 190px !important; width: auto !important; min-width: 175px !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title {
    order: 3 !important;
    flex: 1 1 100% !important; width: 100% !important; max-width: none !important;
    min-width: 0 !important; border-left: 0 !important;
    border-top: 1px solid rgba(255,255,255,.2) !important;
    padding: 7px 2px 2px !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 > #topSearchbar,
  header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
    order: 4 !important; flex: 1 1 100% !important; min-width: 0 !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 > .top-right {
    margin-left: auto !important;
  }
}
/* CPS_MERGED_HEADER_REMOVE_BLANK_BANNER_V3_1
   Hide the original Dashboard hero after its .welcome-copy has been moved
   into the global topbar. The global title remains visible in the topbar. */
body .app-content .welcome.cps-welcome.cps-finished-banner.cps-merged-source-v1 {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  inset: auto auto auto -100000px !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body .app-content .welcome.cps-welcome.cps-finished-banner.cps-merged-source-v1 > img.cps-welcome-banner-art,
body .app-content .welcome.cps-welcome.cps-finished-banner.cps-merged-source-v1 > .welcome-actions {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
/* CPS_MERGED_HEADER_SEARCH_COMPACT_V4_FIX1
   Search field uses a bounded desktop width. The right-side API/Sync/Profile/Sign-out
   group keeps its natural width. No IDs, input behavior or event handlers are changed. */
@media screen and (min-width: 901px) {
  header.top.cps-topbar.cps-merged-header-v1 #topSearchbar,
  header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 0 1 clamp(220px, 24vw, 340px) !important;
    width: clamp(220px, 24vw, 340px) !important;
    min-width: 205px !important;
    max-width: 340px !important;
    margin-left: auto !important;
    margin-right: 8px !important;
  }
  header.top.cps-topbar.cps-merged-header-v1 .top-right {
    flex: 0 0 auto !important;
    width: max-content !important;
    min-width: max-content !important;
    margin-left: 0 !important;
    justify-content: flex-end !important;
    white-space: nowrap !important;
  }
}
@media screen and (min-width: 901px) and (max-width: 1120px) {
  header.top.cps-topbar.cps-merged-header-v1 #topSearchbar,
  header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
    flex-basis: 225px !important;
    width: 225px !important;
    min-width: 185px !important;
    max-width: 245px !important;
  }
}
@media screen and (max-width: 900px) {
  header.top.cps-topbar.cps-merged-header-v1 #topSearchbar,
  header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 4px 0 0 !important;
  }
}
/* CPS_MERGED_HEADER_SEARCH_EXTRA_COMPACT_V5
   Further reduce only the desktop search field. Search ID, functionality and
   right-side status/profile controls are untouched. */
@media screen and (min-width: 901px) {
  header.top.cps-topbar.cps-merged-header-v1 #topSearchbar,
  header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
    flex: 0 1 225px !important;
    width: 225px !important;
    min-width: 175px !important;
    max-width: 245px !important;
    margin-left: auto !important;
    margin-right: 7px !important;
  }
}
@media screen and (min-width: 901px) and (max-width: 1120px) {
  header.top.cps-topbar.cps-merged-header-v1 #topSearchbar,
  header.top.cps-topbar.cps-merged-header-v1 .top-searchbar {
    flex-basis: 190px !important;
    width: 190px !important;
    min-width: 155px !important;
    max-width: 205px !important;
  }
}
/* CPS_DASHBOARD_HEADER_ALIGNMENT_FIX_V3
   Final desktop alignment layer for the audited live CPS topbar.
   Exact existing controls/IDs remain in place; app.js and merged-header JS are not changed. */
@media screen and (min-width: 901px) {
  body > header.top.cps-topbar.cps-merged-header-v1 {
    box-sizing: border-box !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 78px !important;
    min-height: 78px !important;
    padding: 8px 16px !important;
    overflow: visible !important;
  }

  /* Brand block */
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand {
    display: flex !important;
    flex: 0 0 198px !important;
    width: 198px !important;
    min-width: 178px !important;
    max-width: 210px !important;
    align-items: center !important;
    gap: 9px !important;
    overflow: hidden !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand > .logo {
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 11px !important;
    font-size: 15px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand > .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand .brand b {
    display: block !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand .brand small {
    display: block !important;
    margin-top: 3px !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  /* Dynamic page title: breadcrumb, title and subtitle use separate readable rows. */
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 0 1 245px !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-self: stretch !important;
    width: 245px !important;
    min-width: 205px !important;
    max-width: 255px !important;
    padding: 5px 10px !important;
    border-left: 1px solid rgba(255,255,255,.24) !important;
    overflow: hidden !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title .breadcrumb {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    margin: 0 0 3px !important;
    color: rgba(235,244,255,.76) !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title .eyebrow,
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title .welcome-kicker {
    margin: 0 0 2px !important;
    color: #d9e8ff !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
    letter-spacing: 1.1px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title #welcomeTitle {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 1px 0 2px !important;
    color: #fff !important;
    font-size: clamp(15px,1.25vw,18px) !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    letter-spacing: -.25px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title #welcomeTitle .cps-welcome-title-line {
    display: inline !important;
    white-space: nowrap !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title #welcomeSub {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 1px 0 0 !important;
    color: rgba(239,246,255,.86) !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: hidden !important;
    overflow-wrap: break-word !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  /* Search: fixed compact width, independent of page-title size. */
  body > header.top.cps-topbar.cps-merged-header-v1 > #topSearchbar:not(.hidden),
  body > header.top.cps-topbar.cps-merged-header-v1 > .top-searchbar:not(.hidden) {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 0 1 195px !important;
    width: 195px !important;
    min-width: 165px !important;
    max-width: 205px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 2px 0 auto !important;
    padding: 0 10px !important;
    gap: 7px !important;
    border-radius: 12px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #topSearchbar .search-icon {
    flex: 0 0 17px !important;
    width: 17px !important;
    height: 17px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #globalSearch {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #topSearchbar .search-shortcut {
    flex: 0 0 auto !important;
    font-size: 8px !important;
    white-space: nowrap !important;
  }

  /* API / Sync / Profile / Sign out remain together at the right. */
  body > header.top.cps-topbar.cps-merged-header-v1 > .top-right {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: max-content !important;
    min-width: max-content !important;
    margin: 0 0 0 3px !important;
    white-space: nowrap !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #network {
    padding: 5px 7px !important;
    border-radius: 20px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #refreshBtn,
  body > header.top.cps-topbar.cps-merged-header-v1 #logout {
    flex: 0 0 auto !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 6px 9px !important;
    border-radius: 9px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #topUserAvatar {
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 .top-profile-copy {
    display: flex !important;
    flex: 0 1 92px !important;
    flex-direction: column !important;
    min-width: 72px !important;
    max-width: 100px !important;
    overflow: hidden !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #topUserName {
    display: block !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #topUserRole {
    display: block !important;
    margin-top: 2px !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
  }
}

/* Narrow desktop/laptop: compress widths without clipping the actions. */
@media screen and (min-width: 901px) and (max-width: 1120px) {
  body > header.top.cps-topbar.cps-merged-header-v1 {
    gap: 6px !important;
    padding-inline: 10px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand {
    flex-basis: 170px !important;
    width: 170px !important;
    min-width: 158px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title {
    flex-basis: 205px !important;
    width: 205px !important;
    min-width: 180px !important;
    padding-inline: 7px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > #topSearchbar:not(.hidden),
  body > header.top.cps-topbar.cps-merged-header-v1 > .top-searchbar:not(.hidden) {
    flex-basis: 165px !important;
    width: 165px !important;
    min-width: 145px !important;
    max-width: 175px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 .top-right {
    gap: 4px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 .top-profile-copy {
    display: none !important;
  }
}

/* Tablet and smaller screens: keep all controls accessible in two clean rows. */
@media screen and (max-width: 900px) {
  body > header.top.cps-topbar.cps-merged-header-v1 {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 9px 12px !important;
    gap: 8px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-top-brand {
    flex: 1 1 190px !important;
    width: auto !important;
    min-width: 165px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .cps-inline-page-title {
    order: 3 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    align-self: auto !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(255,255,255,.22) !important;
    padding: 7px 2px 2px !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > #topSearchbar:not(.hidden),
  body > header.top.cps-topbar.cps-merged-header-v1 > .top-searchbar:not(.hidden) {
    order: 4 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 > .top-right {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    min-width: 0 !important;
  }
  body > header.top.cps-topbar.cps-merged-header-v1 #welcomeTitle {
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }
}