.progressList {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 1rem;

  ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 19.5rem;

    &:global(.fixed) {
      flex: 0 0 auto;
    }

    &:last-of-type {
      border-bottom: none;
    }
  }

  li {
    height: 2.75rem;
    border-radius: var(--rounded-default);
    display: flex;
    align-items: center;
    gap: 0.5rem;

    scroll-margin-top: 0.8rem;
    scroll-margin-bottom: 0.8rem;

    &.item:hover {
      background-color: var(--color-hover);
      &:has(label > a:focus),
      &:has(label > a:focus-visible) {
        background-color: transparent;
      }
    }

    &.overviewItem:global(.idle) {
      color: var(--gray-400);
    }

    &.addSpace {
      margin-top: var(--space-md);
    }

    &:global(.ruler) {
      min-height: 1rem;
      height: 1rem;
      padding: 0;
      background-color: transparent;
      &:hover {
        background-color: transparent !important;
      }
    }

    aside {
      display: flex;
      flex: 0 0 2rem;
      padding: 0.625rem 0 0.625rem 0.75rem;
      width: 1.5rem;
      svg {
        width: 1.5rem; /* needed for Safari to show the svg */
      }
      overflow: hidden;
    }

    label {
      flex: 1 0 0;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
      line-height: 1.5rem;
      margin-left: -2.5rem;
      max-height: 2.75rem;
      a {
        text-decoration: none;
        color: inherit;
        display: inline-block;
        width: 100%;
        padding: 0.625rem 0.75rem 0.625rem 2.5rem;
        vertical-align: middle;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        &:focus,
        &:focus-visible {
          outline: none;
          border-radius: var(--rounded-default);
          border: 4px solid var(--shadow-color-focus);
          max-height: 2.75rem;
          padding: calc(0.625rem - 4px) calc(0.75rem - 4px) calc(0.625rem - 4px) calc(2.5rem - 4px);
        }
        &:global(:hover) {
          color: inherit !important;
        }
      }
      > span {
        padding: 0.625rem 0.75rem 0.625rem 2.5rem;
      }
    }

    &:global(.empty) {
      aside {
        svg {
          fill: var(--menu-empty);
        }
      }
    }

    &:global(.warning) {
      aside {
        svg {
          fill: var(--menu-warning);
        }
      }
    }

    &:global(.accept) {
      aside {
        svg {
          fill: var(--menu-accept);
        }
      }
    }

    &:global(.current) {
      aside {
        svg {
          fill: var(--color-notify);
        }
      }
    }

    &:global(.unsaved) {
      aside {
        svg {
          fill: var(--menu-unsaved);
        }
      }
    }

    &:global(.error) {
      aside {
        svg {
          fill: var(--color-error-darker);
        }
      }
    }

    &:global(.disabled) {
      opacity: 0.5;
      &:hover {
        background-color: transparent !important;
      }
    }

    &:global(.active) {
      background-color: var(--color-hover);
      font-weight: bold;
      aside {
        svg {
          fill: var(--menu-active);
        }
      }
    }
  }
}

section.scroll {
  flex: 0 1 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;

  ul {
    width: 100%;
    flex: 1;
    overflow-y: auto;

    scrollbar-width: thin; /* Thin scrollbar */
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
  }

  &.hasScrolling {
    border-top: 1px solid var(--border-color-default);
    border-bottom: 1px solid var(--border-color-default);

    padding-top: 1rem;
    padding-bottom: 1rem;

    &::before,
    &::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0.5rem;
      height: 3rem; /* Height of the gradient */
      z-index: 1;
      pointer-events: none; /* So the gradient doesn't block interaction with the list */
      opacity: 0;
      transition: opacity 0.3s;
    }

    &::before {
      top: 0;
      background: linear-gradient(to bottom, var(--bg-gray) 0%, rgba(249, 250, 251, 0) 100%);
    }
    &::after {
      bottom: 0;
      background: linear-gradient(to top, var(--bg-gray) 0%, rgba(249, 250, 251, 0) 100%);
    }
  }

  &.showTopGradient {
    &::before {
      opacity: 1;
    }
  }
  &.showBottomGradient {
    &::after {
      opacity: 1;
    }
  }
}
