.Root {
  color: var(--demo-neutral-fg);
  box-sizing: border-box;
  width: 24rem;
  height: 8.5rem;
  max-width: calc(100vw - 8rem);
}

.Viewport {
  height: 100%;
  border-radius: 0.5rem;
  outline: 1px solid var(--demo-border);
  outline-offset: -1px;
  overscroll-behavior: contain;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }

  &:focus-visible {
    outline: 2px solid var(--demo-coral-solid);
  }
}

.Content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: 0.75rem;
  padding-inline-start: 1rem;
  padding-inline-end: 1.5rem;
}

.Paragraph {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.375rem;
  color: var(--demo-neutral-fg);
}

.Scrollbar {
  display: flex;
  position: relative;
  background-color: var(--demo-neutral-muted);
  border-radius: 0.375rem;
  margin: 0.5rem;
  opacity: 0;
  transition: opacity 150ms;
  pointer-events: none;

  &::before {
    content: '';
    position: absolute;
  }

  &[data-scrolling] {
    transition-duration: 0ms;
  }

  &[data-hover],
  &[data-scrolling] {
    opacity: 1;
    pointer-events: auto;
  }

  &[data-orientation='vertical'] {
    width: 0.25rem;

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

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

  &[data-orientation='horizontal'] {
    height: 0.25rem;

    &::before {
      width: 100%;
      height: 1.25rem;
      left: 0;
      right: 0;
      bottom: -0.5rem;
    }

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

.Thumb {
  width: 100%;
  border-radius: inherit;
  background-color: var(--demo-neutral-solid);

  [data-orientation='horizontal'] & {
    width: unset;
    height: 100%;
  }
}

.Corner {
  background-color: transparent;
}
