/* ---------- GLOBAL ---------- */
:root {
  --accent: #0b84ff;
  --bot: #e9f6ff;
  --user: #e6fff0;
  --pill-border: rgba(11, 132, 255, 0.12);
  --muted: #6b7280;
  --bg: #f3f6fb;
  --chat-width: 360px;
  --chat-height: 560px;
  --radius: 14px;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---------- FLOATING LAUNCHER ---------- */
#launcher {
  position: fixed;
  right: 20px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  margin-bottom: 50px;
  margin-left: 2px;
  background: linear-gradient(180deg, var(--accent), #0073e6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(3, 17, 59, 0.2);
  z-index: 99999;
}

/* ---------- CHAT WINDOW ---------- */
#chat {
  position: fixed;
  right: 20px;
  bottom: 92px;
  width: var(--chat-width);
  height: var(--chat-height);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  top: 110px;
}

/* ---------- HEADER ---------- */
.chat-header {
  background: linear-gradient(180deg, var(--accent), #0a73e0);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header .logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.chat-header .title {
  font-weight: 700;
  font-size: 15px;
}

.chat-header .close {
  margin-left: auto;
  cursor: pointer;
  font-size: 18px;
}

/* ---------- MESSAGES ---------- */
.messages {
  padding: 14px;
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(12, 18, 30, 0.04);
  animation: fadeIn .25s ease forwards;
  opacity: 0;
  transform: translateY(6px);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot {
  background: var(--bot);
  align-self: flex-start;
}

.user {
  background: var(--user);
  align-self: flex-end;
}

/* ---------- TYPING ---------- */
.typing {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aac6e2;
  animation: blink 1.2s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.15s;
}
.dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blink {
  0% { opacity: .2; }
  50% { opacity: 1; }
  100% { opacity: .2; }
}

/* ---------- CONTROLS ---------- */
.controls {
  padding: 14px;
  border-top: 1px solid #eef3fb;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--pill-border);
  cursor: pointer;
  font-weight: 600;
  color: #083a8a;
  font-size: 13px;
}

.pill:hover {
  box-shadow: 0 8px 22px rgba(11, 132, 255, 0.08);
}

.input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.input-row input {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #dce6f7;
  font-size: 14px;
}

.send {
  padding: 10px 14px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

/* ---------- SUMMARY ---------- */
.summary {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef3fb;
  padding: 14px;
  box-shadow: 0 6px 20px rgba(12, 24, 48, 0.04);
  font-size: 13px;
}

.summary h4 {
  margin: 0 0 10px;
  color: var(--accent);
}

.row {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  gap: 8px;
}

.label {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  #chat {
    right: 10px;
    left: 10px;
    width: auto;
    height: 55vh;        /* shorter widget */
    max-height: 360px;   /* hard cap */
    bottom: 16px;
    border-radius: 12px;
  }

  .chat-header {
    padding: 8px 10px;
  }

  .messages {
    padding: 8px 10px;
  }

  .controls {
    padding: 8px 10px;
  }
}

