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

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #0b2c5f, #071a3a);
  -webkit-font-smoothing: antialiased;
}

/* =====================
   LAYOUT
===================== */
.page {
  min-height: 100dvh; /* FIX mobile address bar */
  display: flex;
}

/* MOBILE DEFAULT */
.chat-card {
  width: 100%;
  height: 100dvh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* =====================
   HEADER
===================== */
.header {
  padding: 14px 16px;
  background: linear-gradient(90deg, #0e3a7c, #0b2c5f);
  color: #fff;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.header p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: .85;
}

/* =====================
   CHAT AREA
===================== */
.chat-box {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, #0b2c5f, #071a3a);
  scroll-behavior: smooth;
}

/* =====================
   MESSAGE
===================== */
.message {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: fadeUp .2s ease;
}

.message.bot {
  background: #f1f5f9;
  color: #0f172a;
  border-top-left-radius: 6px;
}

.message.user {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  margin-left: auto;
  border-top-right-radius: 6px;
}

/* =====================
   INPUT
===================== */
.input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.input-area input {
  flex: 1;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  outline: none;
}

.input-area input:focus {
  border-color: #2563eb;
}

.input-area button {
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.input-area button:hover {
  background: #1d4ed8;
}

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

/* =====================
   MOBILE SMALL
===================== */
@media (max-width: 480px) {
  .message {
    max-width: 88%;
    font-size: 13.5px;
  }
}

/* =====================
   TABLET
===================== */
@media (min-width: 640px) {
  .chat-card {
    max-width: 720px;
    margin: auto;
    height: 100dvh;
  }
}

/* =====================
   DESKTOP
===================== */
@media (min-width: 1024px) {
  body {
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
  }

  .chat-card {
    max-width: 460px;
    height: 90vh;
    margin: auto;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0,0,0,.08);
    overflow: hidden;
  }
}
