/* Layout stability (CLS): main scroll, dashboard and top bar */

/* #main scrolls before PerfectScrollbar starts, with the native bar hidden (avoids the 15px width jump) */
#main.perfect-scroll:not(.ps) {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

#main.perfect-scroll:not(.ps)::-webkit-scrollbar {
  display: none;
}

/* Main rail visible whenever the page can scroll; :where() keeps the library hover styles */
:where(#main.ps--active-y) > .ps__rail-y {
  opacity: 0.6;
}

/* Zero-height strip: the progress bar overlays it without pushing the charts */
.dashboard > .dashboard-progress-strip {
  position: relative;
  height: 0;
  min-height: 0;
}

.dashboard-progress-strip #progress-processing {
  position: absolute;
  top: -22px;
  left: 15px;
  right: 15px;
  z-index: 2;
  margin-bottom: 0;
}

/* Full-width carousel from the start, so the arrows do not move when the image loads */
.banner-dashboard > #myCarousel {
  width: 100%;
}

/* Month slot as wide as the longest month: changing the month keeps the label size */
.month-label-slot {
  display: inline-grid;
}

.month-label-slot > .month-label-value,
.month-label-slot > .month-label-reserve {
  grid-area: 1 / 1;
  white-space: nowrap;
}

.month-label-slot > .month-label-reserve {
  visibility: hidden;
}

/* Fade in of My Account and Support (opacity only) */
@keyframes nextqs-top-bar-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.am-top-header .nav-account-item,
.am-top-header .nav-support-item {
  animation: nextqs-top-bar-fade-in 0.6s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .am-top-header .nav-account-item,
  .am-top-header .nav-support-item {
    animation: none;
  }
}
