/* =========================
   RESET
========================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
  background: #0b141a;
  overflow: hidden;
}

/* =========================
   APP
========================= */
.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* =========================
   HEADER
========================= */
.header {
  background: #1f2c34;
  color: white;
  padding: 14px;
  text-align: center;
  font-weight: 600;
}

/* =========================
   CHAT
========================= */
#chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

/* =========================
   MESSAGE WRAPPER
========================= */
.message-wrapper {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.message-wrapper.user {
  align-items: flex-end;
}

.message-wrapper.bot {
  align-items: flex-start;
}

/* =========================
   SENDER LABEL (SUBTLE)
========================= */
.sender-label {
  font-size: 11px;
  color: #7d8b95;
  margin-bottom: 4px;
  margin-left: 6px;
}

/* =========================
   BUBBLES
========================= */
.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: fadeIn 0.2s ease-out;
}

.msg.user {
  background: #005c4b;
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  background: #1f2c34;
  color: #e9edef;
  border-bottom-left-radius: 4px;
}

/* =========================
   TYPING
========================= */
.msg.typing {
  font-style: italic;
  opacity: 0.7;
}

/* =========================
   ANIMATION
========================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   INPUT
========================= */
.inputBar {
  display: flex;
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: #1f2c34;
}

.inputBar input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 12px;
  font-size: 16px;
}

.inputBar button {
  margin-left: 8px;
  border: none;
  border-radius: 50%;
  background: #00a884;
  color: white;
  width: 44px;
  height: 44px;
}

/* =========================
   DESKTOP
========================= */
@media (min-width: 768px) {
  .app {
    max-width: 700px;
    margin: 0 auto;
  }
}
