/* ── CHAT AREA ─────────────────────────── */
.chat-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--bg-channel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 8px 0;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: none;
  /* scrollbar-gutter: stable forces space for scrollbar, preventing layout shift */
  scrollbar-gutter: stable;
  /* Ensure scrollbar area is clipped by the flex parent's overflow:hidden */
  position: relative;
}
/* Scrollbar styling — contained within messages-area flex child */
.messages-area::-webkit-scrollbar {
  width: 4px;
}
.messages-area::-webkit-scrollbar-track {
  background: transparent;
  margin-top: 2px;
  margin-bottom: 2px;
}
.messages-area::-webkit-scrollbar-thumb {
  background: #3a3d44;
  border-radius: 4px;
}
.messages-area::-webkit-scrollbar-thumb:hover {
  background: #4e5058;
}

/* welcome state — empuja hacia abajo cuando no hay mensajes */
.welcome-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px 20px 28px;
  flex-shrink: 0;
  margin-top: auto;
}
.welcome-icon {
  width: 80px; height: 80px;
  background: #36393f;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.welcome-msg h2 {
  font-size: 1.75rem; font-weight: 800;
  color: #f2f3f5;
  margin-bottom: 10px;
  line-height: 1.2;
}
.welcome-msg p {
  font-size: 0.95rem;
  color: #C0C5CF;
  line-height: 1.5;
  max-width: 480px;
}

/* separador de fecha */
.date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 8px;
  user-select: none;
}
.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #25282E;
}
.date-divider span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #80848e;
  white-space: nowrap;
  letter-spacing: .02em;
}
