#floating-open {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  font-size: 22px;
  cursor: pointer;
  background: white;
}

#chat-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  max-width: calc(100% - 40px);
  height: 500px;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  transition: transform .2s ease, width .2s ease, height .2s ease;
}
#chat-widget.chat-closed { transform: scale(0); transform-origin: bottom right; }
#chat-widget.max { width: 720px; height: 70vh; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #111827; color: #fff; font-family: system-ui, sans-serif;
}
.chat-controls button { margin-left: 6px; background: transparent; border: none; color: #fff; font-size: 18px; cursor: pointer; }

.chat-body {
  flex: 1; overflow-y: auto; padding: 12px; background: #f9fafb;
}
.msg { display: flex; margin-bottom: 10px; font-family: system-ui, sans-serif; }
.msg .bubble {
  padding: 10px 12px; border-radius: 12px; max-width: 80%; 
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  white-space: pre-wrap; word-wrap: break-word;
}
.msg.user .bubble { margin-left: auto; background: #2563eb; color: white; }
.msg.assistant .bubble { margin-right: auto; background: #fff; color: #111827; }

.chat-footer {
  display: flex; gap: 8px; padding: 8px; border-top: 1px solid #e5e7eb; background: #fff;
}
#chat-input { flex: 1; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; font-size: 14px; }
#send-btn { background: #111827; border: none; color: #fff; padding: 10px 14px; border-radius: 10px; cursor: pointer; }