/* ── Chat Container ── */
.chatContainer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat {
  width: 100%;
  background: #0A0A0A;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

/* ── Header ── */
.chatHeader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.chatControls {
  display: flex;
  gap: 0.5rem;
  position: absolute;
  left: 1.25rem;
}

.chatButton {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.chatTitle {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #737373;
  letter-spacing: 0.02em;
}

/* ── Body ── */
.chatBody {
  padding: 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.5;
  height: 380px;
  overflow-y: auto;
  background: #0A0A0A;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Row alignment ── */
.rowRight {
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.3s ease-out;
}

.rowLeft {
  display: flex;
  justify-content: flex-start;
  animation: fadeIn 0.3s ease-out;
}

/* ── User bubble (right) ── */
.bubbleUser {
  max-width: 80%;
  padding: 0.625rem 0.875rem;
  border-radius: 14px 14px 4px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #e5e5e5;
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* ── MoM bubble (left) ── */
.bubbleMom {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Trace lines inside MoM bubble ── */
.trace {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.6875rem;
  line-height: 1.55;
  color: #4a4a4a;
  padding: 0.0625rem 0;
}

/* ── Response inside MoM bubble ── */
.response {
  color: #b0b0b0;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-top: 0.375rem;
  padding-top: 0.375rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Blocked inside MoM bubble ── */
.blocked {
  color: #6b6b6b;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-top: 0.375rem;
  padding-top: 0.375rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Typing indicator ── */
.typingDots {
  display: flex;
  gap: 4px;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px 14px 14px 4px;
  width: fit-content;
}

.typingDots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4a4a4a;
  animation: dotPulse 1.2s ease-in-out infinite;
}

.typingDots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typingDots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ── */
.chatBody::-webkit-scrollbar {
  width: 4px;
}

.chatBody::-webkit-scrollbar-track {
  background: transparent;
}

.chatBody::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ── Responsive ── */
@media (max-width: 996px) {
  .chat { border-radius: 14px; }
  .chatBody { height: 360px; font-size: 0.75rem; padding: 1rem; }
  .chatHeader { padding: 0.75rem 1rem; }
  .chatButton { width: 11px; height: 11px; }
  .bubbleUser { font-size: 0.75rem; }
  .trace { font-size: 0.625rem; }
  .response, .blocked { font-size: 0.75rem; }
}

@media (max-width: 768px) {
  .chat { border-radius: 12px; }
  .chatBody { height: 320px; font-size: 0.7rem; padding: 0.75rem; gap: 0.5rem; }
  .chatHeader { padding: 0.625rem 0.875rem; }
  .chatControls { left: 0.875rem; }
  .chatButton { width: 10px; height: 10px; }
  .bubbleUser { max-width: 85%; font-size: 0.7rem; padding: 0.5rem 0.75rem; }
  .bubbleMom { max-width: 90%; padding: 0.5rem 0.75rem; }
  .trace { font-size: 0.6rem; }
}

