.ChatBadge-transition {
  opacity: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  &:not(.open) {
    transform: scale(0);
    opacity: 0;
  }

  &:not(.shown) {
    display: none;
  }

  &.closing {
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  }

  body.is-macos & {
    height: 1.375rem;
  }
}

.ChatBadge-wrapper {
  display: flex;

  .ChatBadge {
    margin-inline-start: 0.5rem;
  }
}

.ChatBadge {
  flex-shrink: 0;

  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4375rem;
  border-radius: 0.75rem;

  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.5625rem;
  color: white;
  text-align: center;

  background: var(--color-gray);

  body.is-macos & {
    line-height: 1.5rem;
  }

  body.is-ios &:not(.unopened) {
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    line-height: 1.375rem;
  }

  body.is-ios,
  body.is-macos,
  &.miniapp {
    min-width: 1.5rem;
    height: 1.5rem !important;
    line-height: 1.5rem !important;
  }

  &.mention,
  &.unread:not(.muted),
  &.unopened:not(.muted) {
    color: var(--color-white);
    background: var(--color-green);
  }

  &.unopened {
    align-self: center;

    width: 0.5rem;
    min-width: auto;
    height: 0.5rem;
    min-height: auto;
    padding: 0;
  }

  &.pinned {
    width: 1.5rem;
    padding: 0;
    color: var(--color-list-icon);
    background: transparent;

    .icon {
      font-size: 1.5rem;
    }
  }

  &.reaction:not(.muted) {
    background: #ed504f;
  }

  &.mention, &.reaction {
    width: 1.5rem;
    padding: 0.25rem !important;

    .icon {
      font-size: 1rem;
      vertical-align: super;
    }

    body.is-ios & {
      width: 1.375rem;
      padding: 0.25rem;

      .icon {
        font-size: 0.875rem;
      }
    }
  }

  &.miniapp {
    z-index: calc(var(--z-chat-ripple) + 1);
    padding: 0 0.4375rem !important;
    font-size: 0.875rem !important;
  }
}
