:host {
  --button-size: var(--size-16);
  display: block;
  position: sticky;
  align-self: flex-start;
  top: 0;
  overflow: auto;
  min-width: var(--button-size);
  z-index: var(--layer-1);
}

[role='tablist'] {
  display: flex;
  flex-direction: column;
  justify-content: center;

  border-right: var(--size-px) solid var(--pos-border-color);

  button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: var(--size-6);
    position: relative;
    overflow: hidden;
    outline: none;
    border: none;
    width: var(--button-size);
    min-width: var(--button-size);
    height: var(--button-size);
    min-height: var(--button-size);
    color: var(--pos-normal-text-color);
    background-color: var(--pos-background-color);

    &::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 0;
      height: 0;
      border-radius: 100%;
      background: color-mix(in srgb, var(--pos-primary-color), transparent 50%);
      transform: translate(-50%, -50%);
      opacity: 1;
    }

    &:active::after,
    &:focus::after {
      width: calc(var(--button-size) * 1.5);
      height: calc(var(--button-size) * 1.5);
      opacity: 0;
      transition:
        width 0.5s ease-out,
        height 0.5s ease-out,
        opacity 1s ease-out;
    }

    &:focus-visible {
      border: var(--size-px) solid var(--pos-primary-color);
    }

    @media (min-width: 640px) {
      &[aria-selected] {
        border-right: var(--size-1) solid var(--pos-primary-color);
      }
    }

    .text {
      font-size: var(--size-3);
      white-space: nowrap;
      text-overflow: ellipsis;
      width: 100%;
      overflow: hidden;
    }
  }
}

@media (max-width: 640px) {
  :host {
    position: fixed;
    top: unset;
    bottom: 0;
    width: 100dvw;
  }
  [role='tablist'] {
    flex-direction: row;
    background-color: var(--pos-background-color);

    border-top: var(--size-px) solid var(--pos-border-color);

    button {
      &[aria-selected] {
        border-top: var(--size-1) solid var(--pos-primary-color);
      }
    }
  }
}
