@import url('scrollbar.css');

/* 読み返し中に届いた返事の案内（static/js/chat_scroll_follow.js）。#chatMessages の親 .chat-messages-viewport に重ねる */
.chat-new-messages-btn {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 5;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--ui-primary, #5b7c99);
  color: var(--ui-text-on-primary, #fff);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(44, 52, 64, 0.22);
  cursor: pointer;
  animation: chat-new-messages-in 0.18s ease-out;
}

/* main.css の button:not(...) の display: inline-flex が詳細度で勝つため */
.chat-new-messages-btn[hidden] {
  display: none !important;
}

.chat-new-messages-btn:hover {
  background: var(--ui-primary-dark, #3d5a73);
}

.chat-new-messages-btn:focus-visible {
  outline: 2px solid var(--ui-accent, #c9846a);
  outline-offset: 2px;
}

.chat-new-messages-btn__arrow {
  font-size: 1rem;
}

@keyframes chat-new-messages-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-new-messages-btn {
    animation: none;
  }
}
