* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #e9edf3;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 520px;
}

.chat-card {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  border: 1px solid #dfe5ee;
}

.chat-header {
  background: #ffffff;
  border-bottom: 1px solid #e6ebf2;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
}

.header-info h1 {
  font-size: 16px;
  color: #111827;
  margin-bottom: 3px;
}

.header-info p {
  font-size: 12px;
  color: #6b7280;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
}

.top-actions {
  background: #ffffff;
  padding: 10px 14px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  gap: 10px;
}

.mini-btn {
  flex: 1;
  border: 1px solid #d8e0ea;
  background: #f8fafc;
  color: #1f2937;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s ease;
}

.mini-btn:hover {
  background: #eef4ff;
  border-color: #bfd3ff;
}

.chat-body {
  height: 560px;
  overflow-y: auto;
  padding: 18px 14px;
  background: #f4f6f8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-divider {
  text-align: center;
  color: #6b7280;
  font-size: 12px;
  margin: 10px 0;
  font-weight: 600;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.bot-row {
  justify-content: flex-start;
}

.message-row.user-row {
  justify-content: flex-end;
}

.message-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}

.message-group.user-group {
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
}

.bubble-avatar.bot {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.bubble-avatar.user {
  background: linear-gradient(135deg, #111827, #374151);
}

.message {
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.45;
  white-space: pre-line;
  font-size: 14px;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.message.bot {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e6ebf2;
  border-bottom-left-radius: 8px;
}

.message.user {
  background: #0b7cff;
  color: #ffffff;
  border-bottom-right-radius: 8px;
}

.meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  padding: 0 4px;
}

.message-group.user-group .meta {
  text-align: right;
}

.chat-footer {
  background: #ffffff;
  border-top: 1px solid #e6ebf2;
  padding: 12px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  padding: 10px 12px;
  background: #ffffff;
}

.left-icon {
  font-size: 18px;
  color: #7c3aed;
}

.chat-footer input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #111827;
  background: transparent;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  font-size: 18px;
}

.send-btn {
  border: none;
  background: #0b7cff;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s ease;
}

.send-btn:hover {
  background: #0868d8;
}

@media (max-width: 600px) {
  body {
    padding: 0;
  }

  .app {
    max-width: 100%;
  }

  .chat-card {
    border-radius: 0;
    min-height: 100vh;
  }

  .chat-body {
    height: calc(100vh - 190px);
  }
}