
/* Basic reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: #0b0c10;
  color: #e8e8e8;
}

/* Floating chat button */
#chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  background: #111218;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
#chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
#chat-launcher img { width: 36px; height: 36px; }

/* Chat window */
#chat-window {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: min(420px, calc(100vw - 24px));
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #0f1117;
  border: 1px solid #1f2230;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  display: none;
  overflow: hidden;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #131623, #0f1117);
  border-bottom: 1px solid #1f2230;
}
.chat-header img { width: 24px; height: 24px; }
.chat-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.chat-header .controls {
  margin-left: auto;
  display: flex; gap: 8px;
}
.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px; border: 1px solid #23273a; background:#151829;
  color:#c9d1d9; cursor:pointer;
}
.icon-btn:hover { background:#1a1f36; }

/* Messages */
#messages {
  padding: 14px;
  height: calc(100% - 52px - 56px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.3;
  font-size: 14px;
  word-wrap: break-word;
}
.msg.bot { background: #151a28; border: 1px solid #1f2230; align-self:flex-start; }
.msg.user { background: #1b2a1f; border: 1px solid #223527; align-self:flex-end; }

/* Input */
.input-row {
  display:flex; gap:10px; padding: 10px; border-top: 1px solid #1f2230;
  background:#10141d;
}
.input-row input[type="text"] {
  flex:1; padding: 12px 12px; border-radius: 10px;
  background:#0c1020; border:1px solid #1f2230; color:#e8e8e8;
  outline: none;
}
.input-row button {
  padding: 0 14px; border-radius: 10px; border: 1px solid #23273a;
  background:#181c2f; color:#d6d9e0; cursor:pointer; font-weight:600;
}
.input-row button:hover { background:#1e2440; }

/* Accessibility helpers */
#chat-window[aria-hidden="true"] { display: none; }
#chat-window[aria-hidden="false"] { display: block; }

/* Mobile tweaks */
@media (max-width:520px) {
  #chat-window { right: 10px; bottom: 86px; width: calc(100vw - 20px); height: 70vh; }
  #chat-launcher { right: 12px; bottom: 12px; }
}
