.root {
  --base-bottom-pos: 5.3125rem;
  --translate-y: 4.5rem;
  --unread-count-button-offset: 3.5rem;

  pointer-events: none;

  position: absolute;
  z-index: var(--z-scroll-down-button);
  right: max(1rem, env(safe-area-inset-right));
  bottom: var(--base-bottom-pos);
  transform: translate(0, var(--translate-y));

  opacity: 0;

  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;

  :global(body.no-page-transitions) & {
    --translate-y: 0 !important;

    transition: opacity 0.15s;
  }

  &.revealed {
    --translate-y: 0;

    opacity: 1;

    .unread {
      pointer-events: auto;
    }

    &.no-composer.no-extra-shift {
      --translate-y: 4rem;
    }
  }

  &.hide-scroll-down {
    --translate-y: var(--unread-count-button-offset);

    .unread {
      pointer-events: none;
      opacity: 0;
    }
  }

  @media (max-width: 600px) {
    right: 0.5rem;
    bottom: 4.5rem;

    :global(body:not(.keyboard-visible)) & {
      bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }
  }

  @media (max-width: 600px) {
    body.is-symbol-menu-open & {
      bottom: calc(var(--base-bottom-pos) + var(--symbol-menu-height));
    }
  }
}

.hidden {
  pointer-events: none;
  opacity: 0;
}

.unreadCountButton {
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.transformDown {
  transform: translateY(var(--unread-count-button-offset));
}

.transformDownDouble {
  transform: translateY(calc(var(--unread-count-button-offset) * 2));
}

.unread {
  pointer-events: none;
}
