* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4ede4;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
}

.chat-container {
  width: 100%;
  max-width: 480px;
  height: 80vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: #7a3b2e;
  color: #fff;
  padding: 16px 20px;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.3rem;
}

.chat-header p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.msg.assistant {
  background: #f0ebe4;
  color: #2b2b2b;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.user {
  background: #7a3b2e;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg.erro {
  background: #f8d7da;
  color: #842029;
  align-self: center;
  font-size: 0.85rem;
}

.form-mensagem {
  display: flex;
  border-top: 1px solid #eee;
  padding: 12px;
  gap: 8px;
}

#campo-mensagem {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 0.95rem;
  outline: none;
}

#campo-mensagem:focus {
  border-color: #7a3b2e;
}

.form-mensagem button {
  background: #7a3b2e;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  cursor: pointer;
}

.form-mensagem button:disabled {
  opacity: 0.6;
  cursor: default;
}
