/* Labels retain the native li and sibling order; there is no added menu depth. */
.main-navigation .cp-catalogue-root .cp-menu-section-heading > .cp-menu-section-label {
  display: block;
  box-sizing: border-box;
  padding: 13px 20px 7px;
  color: var(--accent, #074799);
  background: var(--base-3, #fff);
  border-top: 1px solid var(--base, #e6ecf4);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: default;
}

.main-navigation .cp-catalogue-root .sub-menu > .cp-menu-section-heading:first-child > .cp-menu-section-label {
  border-top: 0;
  padding-top: 8px;
}

@media (min-width: 1025px) {
  /* Keep flyout ancestors open: scrolling the category list would clip its children. */
  #site-navigation .cp-catalogue-root > .sub-menu,
  #sticky-navigation .cp-catalogue-root > .sub-menu {
    overflow: visible;
  }

  /* Only terminal, third-level dropdowns become scroll containers. Existing widths remain. */
  #site-navigation .cp-catalogue-root > .sub-menu > li > .sub-menu,
  #sticky-navigation .cp-catalogue-root > .sub-menu > li > .sub-menu {
    box-sizing: border-box;
    max-height: calc(100vh - 12rem);
    max-height: var(--cp-catalogue-available-height, calc(100dvh - 12rem));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scroll-padding-block: 8px;
  }
}

/* The dark off-canvas panel owns mobile scrolling; avoid nested scroll traps. */
#generate-slideout-menu .cp-catalogue-root .cp-menu-section-heading > .cp-menu-section-label {
  color: var(--base-3, #fff);
  background: transparent;
  border-top-color: rgba(255, 255, 255, 0.25);
  border-left: 3px solid var(--accent-4, #009990);
  margin-left: 10px;
  padding: 16px 16px 8px 25px;
  font-size: 14px;
}

#generate-slideout-menu .cp-catalogue-root > .sub-menu > li > .sub-menu {
  max-height: none;
  overflow: visible;
}
