/* One shared page bar. Geometry is independent of card themes and filter count. */
html body #main .sectionhead.portal-page-bar,
html body #main #portal-home .welcome-page-bar,
.portal-preview-site .portal-page-bar {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  /* Lift the whole flare stacking context above later cards, keeping filter
     menus in front while remaining below the site navigation and dialogs. */
  z-index: 10;
  display: grid;
  grid-template-columns: var(--pageBarTitleWidth, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  width: 100%;
  height: var(--pageBarHeight, 140px) !important;
  min-height: var(--pageBarHeight, 140px);
  margin: 0 0 16px !important;
  padding: 14px 20px 14px 28px;
  border: 1px solid var(--pageBarBorder, #dce7f2) !important;
  border-radius: var(--pageBarRadius, 9px) !important;
  background: var(--pageBarBackground, #fff) !important;
  box-shadow: 0 4px 16px #102d5808 !important;
  color: var(--pageBarTitle, #102d58);
  overflow: visible;
}
/* Clip only the decorative layer, so filters and their menus remain usable. */
.portal-page-bar-flare {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.portal-page-bar-flare::before {
  content: '';
  position: absolute;
  top: var(--portal-page-bar-flare-top, 0);
  bottom: var(--portal-page-bar-flare-bottom, auto);
  right: 0;
  width: 100%;
  height: min(100%, var(--portal-page-bar-flare-height, 240px));
  background: var(--portal-page-bar-flare, none);
  background-size: var(--portal-page-bar-flare-spread, 100% 100%);
  background-position: var(--portal-page-bar-flare-position, 100% 0%);
  background-repeat: no-repeat;
  transform: var(--portal-page-bar-flare-transform, none);
  transform-origin: var(--portal-page-bar-flare-position, 100% 0%);
  -webkit-mask-image: var(--portal-page-bar-flare-edge-mask, none);
  -webkit-mask-composite: source-in;
  mask-image: var(--portal-page-bar-flare-edge-mask, none);
  mask-composite: intersect;
}
html body #main #portal-home .welcome-page-bar {
  margin-bottom: 0 !important;
}
/* The bar owns the gap to page content. Remove legacy leading margins only;
   spacing between cards and inside their contents remains page-owned. */
html body #main .sectionhead.portal-page-bar + *,
html body #main .sectionhead.portal-page-bar + [hidden] + *,
html body #main .sectionhead.portal-page-bar ~ #documentLibraryFolders,
html body #main .sectionhead.portal-page-bar ~ #adminBody > :first-child,
html body #main .sectionhead.portal-page-bar ~ #bioList > :first-child,
html
  body
  #main
  .sectionhead.portal-page-bar
  + :is(#customerCoverageMap319, .dd-workspace)
  > :first-child {
  margin-top: 0 !important;
}
html body #main #portal-home .welcome-page-bar:has(.welcome-weather) {
  grid-template-columns: var(--pageBarTitleWidth, 280px) minmax(0, 1fr) 116px;
}
/* Sales card rows use the same 16px gap as the page bar above them. */
html
  body
  #main
  :is(#performancePanel, #seller-opportunities, #forecast, #committed-pipeline, #orders)
  .performance-targets375 {
  row-gap: 16px;
  margin-block: 16px;
}
html body #main #performancePanel :is(.performance-layout376, #pillarPerformanceCharts435) {
  row-gap: 16px;
  margin-bottom: 16px;
}
html body #main .portal-page-bar::before,
html body #main #portal-home .welcome-page-bar::before,
.portal-preview-site .portal-page-bar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pageBarAccentWidth, 6px);
  border-radius: var(--pageBarRadius, 9px) 0 0 var(--pageBarRadius, 9px);
  background: var(--pageBarAccent, #08bada);
  pointer-events: none;
}
html body #main .portal-page-bar-heading,
html body #main #portal-home .welcome-hero-heading,
.portal-preview-site .portal-page-bar-heading {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  grid-row: auto;
  grid-column: 1;
  align-self: stretch;
  margin: 0;
  padding: 0 20px 0 0;
  border-right: var(--pageBarDividerWidth, 1px) solid var(--pageBarDivider, #d8e2ef);
}
html body #main .portal-page-bar-heading :is(h1, h2, h3),
html body #main #portal-home .welcome-hero-heading h1,
.portal-preview-site .portal-page-bar-heading h4 {
  margin: 0;
  color: var(--pageBarTitle, #102d58) !important;
  font: 700 20px/1.2 var(--site-font, 'Plus Jakarta Sans', sans-serif);
  letter-spacing: -0.5px;
  overflow-wrap: normal;
}
html body #main .portal-page-bar-heading p,
html body #main #portal-home .welcome-hero-heading p,
.portal-preview-site .portal-page-bar-heading p {
  margin: 5px 0 0;
  color: var(--pageBarSubtitle, #647b9b) !important;
  font: 400 11px/1.4 var(--site-font, 'Plus Jakarta Sans', sans-serif);
}
html body #main .portal-page-bar-controls {
  min-width: 0;
  width: 100%;
}
html
  body
  #main
  .portal-page-bar-controls
  :is(
    .bb-filter-bar,
    [data-shared-filter-bar],
    .sales-record-filters428,
    .pillar-search410,
    .catalogue-filters,
    .bio-filters,
    .database-filters420
  ),
.portal-preview-site .portal-page-bar-controls .portal-preview-filter {
  display: flex !important;
  align-items: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
html
  body
  #main
  .portal-page-bar-controls
  :is(label, .bb-field, .field, .filter-field, .search-field):not(details *) {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
  font-size: 11px;
}
html
  body
  #main
  .portal-page-bar-controls
  :is(input:not([type='checkbox']):not([type='radio']), select, .bb-select):not(details > div *) {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 6px 8px !important;
  font-size: 14px !important;
  text-overflow: ellipsis;
}
html body #main .portal-page-bar-controls :is(button, .bb-button):not(details *),
.portal-preview-site
  .portal-page-bar-controls
  :is(.portal-preview-primary, .portal-preview-reset, .portal-preview-input) {
  box-sizing: border-box;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  min-height: 36px !important;
  height: 36px !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  white-space: nowrap;
  margin: 0 !important;
}
html body #main .portal-page-bar-controls .bb-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  margin: 0;
}
html body #main .portal-page-bar-controls :is(#keyContactFilters400, #industryNewsFilters679) {
  margin: 0;
  padding: 0;
}
html body #main #portal-home .welcome-shortcuts {
  grid-column: auto;
  grid-row: auto;
  gap: 8px;
  flex-wrap: nowrap;
}
html body #main #portal-home .welcome-weather {
  grid-column: auto;
  grid-row: auto;
  border-color: var(--pageBarDivider, #d8e2ef);
  padding-left: 16px;
}
html body #main #portal-home .welcome-shortcuts .welcome-link {
  box-sizing: border-box;
  height: var(--welcome-action-height);
  min-height: var(--welcome-action-height);
  font-size: 12px;
  padding: 8px 10px;
  gap: 8px;
}
html body #main #portal-home .welcome-shortcuts .welcome-link strong {
  font-size: inherit;
}
/* On narrow screens the bar stays one line: only its controls scroll, never the page. */
@media (max-width: 1000px) {
  html body #main .sectionhead.portal-page-bar,
  html body #main #portal-home .welcome-page-bar,
  html body #main #portal-home .welcome-page-bar:has(.welcome-weather) {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 12px 12px 18px;
  }
  html body #main .portal-page-bar-heading,
  html body #main #portal-home .welcome-hero-heading {
    padding-right: 12px;
  }
  html body #main .portal-page-bar-heading :is(h1, h2, h3),
  html body #main #portal-home .welcome-hero-heading h1 {
    font-size: 17px;
  }
  html body #main .portal-page-bar-controls {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
  }
  html
    body
    #main
    .portal-page-bar-controls
    :is(label, .bb-field, .field, .filter-field, .search-field):not(details *) {
    min-width: 100px !important;
  }
  html body #main .portal-page-bar-controls :is(button, .bb-button):not(details *) {
    flex-shrink: 0 !important;
  }
  html body #main #portal-home .welcome-shortcuts {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    justify-content: flex-start;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    padding-bottom: 4px;
  }
  html body #main #portal-home .welcome-shortcuts .welcome-link {
    flex: none;
    white-space: nowrap;
  }
  html body #main #portal-home .welcome-weather {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    padding: 0;
    width: 100px;
  }
  html body #main #portal-home .welcome-weather [data-welcome-weather] {
    min-height: 40px;
  }
}

html body #main .portal-page-bar-controls .feature-controls-search-panel126 {
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
html body #main .portal-page-bar-controls .feature-controls-search-row126 {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}
html body #main .portal-page-bar-controls .feature-controls-search-row126 input {
  flex: 1;
  min-width: 0;
}

html body #main #performancePanel .sectionhead.portal-page-bar {
  height: var(--pageBarHeight, 140px) !important;
  min-height: var(--pageBarHeight, 140px) !important;
  margin: 0 0 16px !important;
  grid-template-rows: minmax(0, 1fr);
}
html body #main .portal-page-bar .page-bar-floating-menu {
  position: fixed !important;
  inset: auto !important;
  left: var(--page-menu-left) !important;
  top: var(--page-menu-top) !important;
  width: var(--page-menu-width) !important;
  max-height: var(--page-menu-height) !important;
  z-index: 200 !important;
  overflow-y: auto !important;
}

html body #main .portal-page-bar-heading > div:first-child {
  flex: 0 1 auto;
}
/* All page-bar filters share the Pipeline Period menu surface. Selection
   semantics stay with the original single-select or multi-select control. */
body .page-filter-options,
#main .portal-page-bar details[data-page-bar-menu] > summary + * {
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid var(--line, #d8e2ef);
  border-radius: 9px;
  background: #fff;
  color: var(--navy, #081e40);
  box-shadow: 0 8px 25px #081e4020;
  font: 400 13px/1.5 var(--site-font);
  text-align: left;
}
body .page-filter-options {
  position: fixed;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
body .page-filter-options .page-filter-option {
  display: block;
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  color: var(--navy, #081e40);
  font: inherit;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
body .page-filter-options .page-filter-option:is(:hover, :focus-visible, [aria-selected='true']) {
  background: var(--pale, #eef5ff);
}
body .page-filter-options .page-filter-option:focus-visible {
  outline: 2px solid var(--blue, #0963cf);
  outline-offset: -2px;
}
.page-filter-group {
  padding: 8px;
  font-weight: 600;
}
.page-search-results {
  right: auto;
  z-index: 200;
}

/* Match Add User's Role preset text without changing filter geometry. */
html
  body
  #main
  :is(.portal-page-bar-controls, .bb-filter-bar, [data-shared-filter-bar], .toolbar)
  :is(input:not([type='checkbox']):not([type='radio']), select, summary),
html body #main .portal-page-bar details[data-page-bar-menu] > summary + * :is(label, button, span),
html body .page-filter-options,
html body .page-filter-options .page-filter-option,
html body header.top #search,
html body input[type='search'] {
  font-size: 14px !important;
}
