*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f0f13;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.widget {
  width: 380px;
  background: #1a1a24;
  border: 1px solid #2e2e42;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.demo-banner {
  background: #2a1f00;
  color: #f0a500;
  font-size: 12px;
  text-align: center;
  padding: 7px 16px;
  border-bottom: 1px solid #3d2f00;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #12121a;
  border-bottom: 1px solid #2e2e42;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.widget-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #e2e2f0;
  letter-spacing: 0.3px;
}

.chat-window {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-window::-webkit-scrollbar { width: 4px; }
.chat-window::-webkit-scrollbar-track { background: transparent; }
.chat-window::-webkit-scrollbar-thumb { background: #2e2e42; border-radius: 4px; }

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.message.agent {
  background: #2e2e42;
  color: #c8c8e0;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.message.user {
  background: #5b4cf5;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #2e2e42;
  background: #12121a;
}

#userInput {
  flex: 1;
  background: #1a1a24;
  border: 1px solid #2e2e42;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: #e2e2f0;
  outline: none;
  transition: border-color 0.2s;
}

#userInput::placeholder { color: #4a4a6a; }
#userInput:focus { border-color: #5b4cf5; }

#sendBtn {
  background: #5b4cf5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

#sendBtn:hover { background: #4a3de0; }
#sendBtn:active { background: #3a2dd0; }
