@layer ui.tablist {
  .container,
  .activeIndicator {
    display: flex;
    flex-shrink: 0;
    flex-wrap: nowrap;
    align-items: center;

    padding-block: 0.375rem;
    padding-inline: 0.25rem;
  }

  .container {
    --tab-radius: 1.25rem;

    user-select: none;
    scrollbar-width: none;

    position: relative;

    overflow-x: auto;

    border-radius: 1.5rem;

    opacity: 0;
    background-color: var(--color-background);
    box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.1);

    transition: opacity 150ms;

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

    &.ready {
      opacity: 1;
    }

    &.vertical {
      --tab-radius: 1.75rem;

      border-radius: 1.875rem;
    }
  }

  .centered {
    justify-content: center;
  }

  .activeIndicator {
    pointer-events: none;
    will-change: clip-path;

    isolation: isolate;
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    contain: layout style paint;
    overflow: hidden;

    width: fit-content;

    background-color: var(--color-primary-opacity);

    transition: clip-path var(--slide-transition);

    &.stretched {
      width: 100%;
    }
  }

  .tab {
    cursor: var(--custom-cursor, pointer);

    display: flex;
    flex-shrink: 0;
    gap: 0.25rem;
    align-items: center;

    padding: 0.375rem 1rem;
    border-radius: var(--tab-radius);

    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    white-space: nowrap;

    &:hover {
      opacity: 0.85;
    }

    .activeIndicator & {
      color: var(--color-primary);
    }

    &.vertical {
      flex-direction: column;
    }

    &.stretched {
      flex: 1;
      justify-content: center;
    }
  }

  .tabEmoji,
  .tabIcon {
    --custom-emoji-size: 1.25rem;

    font-size: 1.25rem;
    line-height: 1.25rem;
  }

  .lockIcon {
    font-size: 0.875rem;
  }

  .withFadeMask {
    position: relative;
    z-index: 10;
  }

  .fadeMaskWrapper {
    position: relative;
    flex-shrink: 0;

    &::after {
      pointer-events: none;
      content: "";

      position: absolute;
      z-index: 9;
      top: 50%;
      left: 0;

      width: 100%;
      height: var(--fade-mask-height, 50%);

      background: linear-gradient(to bottom, var(--fade-mask-color, var(--color-background)) 0%, transparent 100%);
    }
  }
}
