.chat-container-wrapper {
  position: relative;
}

.scrollable-chat .chat-container {
  max-height: min(70vh, 750px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75em;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* Bottom fade */
.chat-container-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 10px;
  bottom: 0;
  height: 55px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.95)
  );
  pointer-events: none;
  border-radius: 0 0 12px 12px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Scroll hint */
.chat-container-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4em 1.2em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #555;
  font-size: .8em;
  font-weight: 600;
  white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
  z-index: 2;
  user-select: none;

  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;

  animation: chat-container-hint-pulse 2s ease-in-out infinite;
}

/* When we reach the bottom */
.chat-container-wrapper.is-at-bottom::after {
  opacity: 0;
}

.chat-container-wrapper.is-at-bottom .chat-container-scroll-hint {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

.chat-container-scroll-arrow {
  font-size: 1em;
  animation: chat-container-arrow-bounce 1.2s ease-in-out infinite;
}

@keyframes chat-container-hint-pulse {
  0%, 100% {
    opacity: 0.75;
  }

  50% {
    opacity: 1;
  }
}

@keyframes chat-container-arrow-bounce {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}