/* Scroll system shared by the public site, investor dashboard, and internal dashboard. */
:root {
  scrollbar-color: #aeb9c8 transparent;
  scrollbar-width: thin;
}

* {
  scrollbar-color: #aeb9c8 transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  min-height: 42px;
  background: #aeb9c8;
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #7f8da2;
}

/* Keep the brand, account identity, and status fixed. Only the menu list scrolls. */
.investor-sidebar,
.staff-sidebar {
  overflow: hidden !important;
}

.sidebar-nav-scroll {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  margin: 14px -5px 8px 0;
  isolation: isolate;
}

.sidebar-nav-scroll > nav {
  width: 100%;
  height: 100%;
  margin-top: 0 !important;
  padding: 4px 7px 16px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
  outline: none;
}

.sidebar-nav-scroll > nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav-scroll > nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav-scroll > nav::-webkit-scrollbar-thumb {
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.sidebar-nav-scroll:hover > nav,
.sidebar-nav-scroll > nav:focus-visible {
  scrollbar-color: #b4c0d0 transparent;
}

.sidebar-nav-scroll:hover > nav::-webkit-scrollbar-thumb,
.sidebar-nav-scroll > nav:focus-visible::-webkit-scrollbar-thumb {
  background: #b4c0d0;
}

.staff-sidebar .sidebar-nav-scroll:hover > nav,
.staff-sidebar .sidebar-nav-scroll > nav:focus-visible {
  scrollbar-color: rgb(151 173 207 / 62%) transparent;
}

.staff-sidebar .sidebar-nav-scroll:hover > nav::-webkit-scrollbar-thumb,
.staff-sidebar .sidebar-nav-scroll > nav:focus-visible::-webkit-scrollbar-thumb {
  background: rgb(151 173 207 / 62%);
}

.sidebar-nav-scroll > nav:focus-visible {
  border-radius: 11px;
  box-shadow: inset 0 0 0 2px rgb(7 95 216 / 24%);
}

.staff-sidebar .sidebar-nav-scroll > nav:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(126 173 244 / 30%);
}

/* Edge fades communicate that more menu items exist without a permanent track. */
.sidebar-nav-scroll::before,
.sidebar-nav-scroll::after {
  position: absolute;
  right: 7px;
  left: 0;
  z-index: 3;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  content: "";
  transition: opacity 160ms ease;
}

.sidebar-nav-scroll::before {
  top: 0;
  background: linear-gradient(#fff 8%, rgb(255 255 255 / 86%) 42%, transparent);
}

.sidebar-nav-scroll::after {
  bottom: 0;
  background: linear-gradient(transparent, rgb(255 255 255 / 86%) 58%, #fff 94%);
}

.staff-sidebar .sidebar-nav-scroll::before {
  background: linear-gradient(#0a1c3e 8%, rgb(10 28 62 / 88%) 42%, transparent);
}

.staff-sidebar .sidebar-nav-scroll::after {
  background: linear-gradient(transparent, rgb(7 23 51 / 88%) 58%, #071733 94%);
}

.sidebar-nav-scroll.has-overflow:not(.is-at-end)::after,
.sidebar-nav-scroll.is-scrolled::before {
  opacity: 1;
}

.sidebar-help,
.system-health {
  flex: 0 0 auto;
  margin-top: 0 !important;
}

/* Scrollable modal and assistant surfaces use the same quiet visual language. */
.modal-body,
.agent-messages {
  overscroll-behavior: contain;
}

.chips::-webkit-scrollbar,
.agent-prompts::-webkit-scrollbar {
  display: none;
}

.investor-mobile-nav {
  overflow: hidden;
}

@media (max-width: 960px) {
  .sidebar-nav-scroll {
    display: none;
  }

  .investor-mobile-nav {
    scrollbar-width: none;
  }

  .investor-mobile-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav-scroll > nav {
    scroll-behavior: auto;
  }

  .sidebar-nav-scroll::before,
  .sidebar-nav-scroll::after {
    transition: none;
  }
}
