.topic-above-footer-buttons-outlet.presence {
  // slightly larger than avatars to prevent layout shift
  min-height: calc(var(--avatar-min-height) + 1px);
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  margin: var(--below-topic-margin) 0;
}

.presence-users {
  // ideally you don't want to add padding or margin here,
  // because you may cause a layout shift on presence appearance
  color: var(--primary-medium);
  display: flex;
  border-radius: var(--d-border-radius);

  span.presence-text {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    margin-left: 8px;
  }

  .presence-avatars {
    display: flex;
    overflow: hidden;
    flex-wrap: wrap;
  }

  .wave {
    display: inline-flex;
    flex: 0 0 auto;

    .dot {
      display: inline-block;

      @media (prefers-reduced-motion: no-preference) {
        animation: wave 1.8s linear infinite;
      }

      &:nth-child(2) {
        animation-delay: -1.6s;
      }

      &:nth-child(3) {
        animation-delay: -1.4s;
      }
    }
  }

  @keyframes wave {
    0%,
    60%,
    100% {
      transform: initial;
    }

    30% {
      transform: translateY(-0.2em);
    }
  }
}

.reply-to .presence-users {
  padding: unset;
}

// TMP: RTL overrides
.rtl {
  span.presence-text {
    margin-right: 8px;
  }
}

// Always hide the "Topic Presence" in the topic timeline
.topic-navigation.with-timeline .topic-navigation-bottom-outlet.presence {
  display: none;
}

// When topic progress is visible in the posts grid area and is sticky,
// adjust positioning so presence is on the same line
@media screen and (width <= 924px) {
  body:has(.topic-navigation.with-topic-progress)
    .topic-above-footer-buttons-outlet.presence {
    margin-top: -3.2em;
    margin-right: 8em;
  }
}
