[data-scope="scroll-area"][data-part="root"] {
  box-sizing: border-box;
  width: 24rem;
  height: 8.5rem;
  max-width: calc(100vw - 8rem);
}

[data-scope="scroll-area"][data-part="viewport"] {
  height: 100%;
  border-radius: 0.375rem;
  outline: 1px solid lightgray;
  outline-offset: -1px;
  overscroll-behavior: contain;

  /* hide scrollbar */
  scrollbar-width: none;
  &::-webkit-scrollbar {
    display: none;
  }

  &:focus-visible {
    outline: 2px solid blue;
  }
}

[data-scope="scroll-area"][data-part="content"] {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: 0.75rem;
  padding-inline-start: 1rem;
  padding-inline-end: 1.5rem;
}

[data-scope="scroll-area"][data-part="scrollbar"] {
  position: relative;
  background-color: lightgray;
  border-radius: 0.375rem;
  margin: 0.5rem;
  opacity: 0;
  transition: opacity 150ms 300ms;

  &[data-hover],
  &[data-scrolling] {
    opacity: 1;
    transition-duration: 75ms;
    transition-delay: 0ms;
  }

  /* Vertical scrollbar styles */
  &[data-orientation="vertical"] {
    width: 0.5rem;

    &::before {
      content: "";
      position: absolute;
      width: 1.25rem;
      height: 100%;
      left: 50%;
      transform: translateX(-50%);
    }

    &:not([data-overflow-y]) {
      display: none;
    }
  }

  /* Horizontal scrollbar styles */
  &[data-orientation="horizontal"] {
    height: 0.5rem;

    &::before {
      content: "";
      position: absolute;
      height: 1.25rem;
      width: 100%;
      top: 50%;
      transform: translateY(-50%);
    }

    &:not([data-overflow-x]) {
      display: none;
    }
  }
}

[data-scope="scroll-area"][data-part="thumb"] {
  border-radius: inherit;
  background-color: gray;

  /* Vertical scrollbar thumb */
  &[data-orientation="vertical"] {
    width: 100%;
  }

  /* Horizontal scrollbar thumb */
  &[data-orientation="horizontal"] {
    height: 100%;
  }
}
