.MessageSelectToolbar {
  position: absolute;
  z-index: 20;
  right: 0.5rem;
  bottom: 0.5rem;
  left: 0.5rem;

  justify-content: center;

  width: auto;
  margin: 0;

  opacity: 1;

  &::before {
    z-index: -1;
    right: auto;
    left: auto;

    width: 100%;
    max-width: calc(100% * var(--composer-hidden-scale));
  }

  .mask-image-disabled &::before {
    right: auto !important;
    left: auto !important;
  }

  .no-composer & {
    width: 100%;

    @media (max-width: 600px) {
      width: calc(100% - 1rem);
    }
  }

  & .MessageSelectToolbar-inner {
    transform: scaleX(1) translateX(0);
  }

  .no-composer .middle-column-footer-button-container + &,
  .no-composer .messaging-disabled + & {
    top: auto;
  }

  body.no-page-transitions & {
    transition: none !important;
  }

  &:not(.shown) {
    pointer-events: none;
    opacity: 0;

    .shown-inner {
      transform: scaleX(var(--toolbar-hidden-scale, 1));
    }

    &.with-composer .MessageSelectToolbar-inner {
      transform: scaleX(var(--toolbar-hidden-scale, 1)) translateX(var(--toolbar-translate-x, 0));
    }

    &:not(.with-composer) .MessageSelectToolbar-inner {
      transform: scaleX(var(--toolbar-unpin-hidden-scale)) translateX(0);
    }
  }

  &-inner {
    transform: scaleX(1);

    display: flex;
    align-items: center;

    width: 100%;
    max-width: calc(100% * var(--composer-hidden-scale));
    border-radius: var(--border-radius-messages);

    font-weight: var(--font-weight-medium);

    background: var(--color-background);
    box-shadow: 0 1px 2px var(--color-default-shadow);

    transition: transform var(--select-transition), opacity var(--select-transition);

    @media (max-width: 600px) {
      max-width: none;
      padding: 0;
    }
  }

  &-count {
    overflow: hidden;
    flex-grow: 1;

    margin-left: 1rem;

    text-overflow: ellipsis;
    white-space: nowrap;

    @media (max-width: 600px) {
      margin-right: 0.5rem;
    }
  }

  &-actions {
    display: flex;
    margin-left: auto;

    .item {
      --ripple-color: rgba(0, 0, 0, 0.08);

      cursor: var(--custom-cursor, pointer);

      position: relative;

      unicode-bidi: plaintext;
      overflow: hidden;
      display: flex;

      width: 100%;
      padding: 0.6875rem;
      border: none !important;
      border-radius: 50%;

      line-height: 1.5rem;
      color: var(--color-text);
      white-space: nowrap;

      background: none;
      outline: none !important;
      box-shadow: none !important;

      .icon {
        font-size: 1.5rem;
        color: var(--color-text-secondary);
      }

      &.destructive {
        color: var(--color-error);
        .icon {
          color: inherit;
        }
      }

      &.disabled {
        pointer-events: none;
        cursor: var(--custom-cursor, default);
        opacity: 0.5;
      }

      &:not(.disabled):active {
        background-color: var(--color-item-active);
        transition: none !important;
      }

      @media (hover: hover) {
        &:hover, &:focus {
          text-decoration: none;
          background-color: var(--color-chat-hover);
        }
      }
    }
  }

  @media (max-width: 600px) {
    bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }

  @media (min-width: 601px) {
    right: 1rem;
    bottom: 1.25rem;
    left: 1rem;

    .no-composer & {
      top: -4.75rem;
    }
  }
}
