/* Long profile collections scroll inside their tab instead of stretching the profile page. */
.content-body.is-team-profile-open {
  overflow: hidden !important;
}

.content-body.is-team-profile-open > #view-team.is-viewing-profile,
.content-body.is-team-profile-open #team-subpanel-roster {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.content-body.is-team-profile-open #team-member-profile {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.content-body.is-team-profile-open .team-profile-section-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.content-body.is-team-profile-open .team-profile-section-panel.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.content-body.is-team-profile-open .team-profile-section-heading {
  flex: 0 0 auto;
}

.team-profile-section-panel [data-profile-scroll] {
  max-height: clamp(300px, calc(100dvh - 460px), 460px);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #69b5d2 transparent;
  scroll-behavior: smooth;
  padding-right: 8px !important;
}

.content-body.is-team-profile-open .team-profile-section-panel [data-profile-scroll] {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  align-content: start;
  grid-auto-rows: max-content;
}

.team-profile-section-panel [data-profile-scroll]:focus-visible {
  outline: 2px solid rgba(10, 164, 214, .72);
  outline-offset: 4px;
  border-radius: 10px;
}

.team-profile-section-panel [data-profile-scroll]::-webkit-scrollbar {
  width: 8px;
}

.team-profile-section-panel [data-profile-scroll]::-webkit-scrollbar-track {
  background: transparent;
}

.team-profile-section-panel [data-profile-scroll]::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #20afd5, #468bd0);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.team-profile-section-panel [data-profile-scroll]::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #079dc7, #3178c4);
  border: 2px solid transparent;
  background-clip: padding-box;
}

body.theme-dark .team-profile-section-panel [data-profile-scroll] {
  scrollbar-color: #278eb3 transparent;
}

@media (max-width: 680px) {
  .team-profile-section-panel [data-profile-scroll] {
    max-height: clamp(280px, 52dvh, 440px);
    padding-right: 4px !important;
  }
}
