* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.chat-wrapper {
  width: 440px;
  height: 640px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ─────────────────────────────── */
.chat-header {
  background: #C8102E;
  color: #fff;
  padding: 12px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

#new-chat-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
#new-chat-btn:hover { background: rgba(255,255,255,0.35); }

/* ── Chat area ───────────────────────────── */
.chat-box {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-msg, .user-msg {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 14px;
  word-break: break-word;
}

.bot-msg {
  background: #f0f0f0;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.user-msg {
  background: #C8102E;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.bot-msg a {
  color: #C8102E;
  word-break: break-all;
}

.typing-indicator {
  opacity: 0.5;
  font-style: italic;
  letter-spacing: 3px;
}

/* ── Input bar ───────────────────────────── */
.chat-form {
  display: flex;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.chat-form input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 14px;
}

.chat-form input:disabled { background: #fafafa; }

.chat-form button[type="submit"] {
  background: #C8102E;
  color: #fff;
  border: none;
  padding: 0 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-form button[type="submit"]:hover { background: #a50d26; }

/* ── Footer disclaimer ───────────────────── */
.chat-footer {
  background: #fff8e1;
  color: #7a6300;
  font-size: 11px;
  text-align: center;
  padding: 6px 12px;
  border-top: 1px solid #f0e0a0;
  flex-shrink: 0;
  line-height: 1.4;
}