:root {
  --wms-primary: #2563eb;
  --wms-primary-dark: #1d4ed8;
  --wms-bg: #ffffff;
  --wms-text: #0f172a;
  --wms-muted: #64748b;
  --wms-border: #e2e8f0;
  --wms-bubble-user: linear-gradient(135deg, #2563eb, #1d4ed8);
  --wms-bubble-bot: #f1f5f9;
  --wms-shadow: 0 20px 50px rgba(2, 6, 23, 0.18);
}
#wms-chatbot-root { position: fixed; bottom: 20px; right: 20px; z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
#wms-chatbot-toggle {
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--wms-bubble-user); color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease;
}
#wms-chatbot-toggle:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 36px rgba(37,99,235,.55); }
#wms-chatbot-window[hidden] { display: none !important; }
#wms-chatbot-window {
  position: absolute; bottom: 78px; right: 0;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 110px);
  background: var(--wms-bg); color: var(--wms-text);
  border-radius: 18px; box-shadow: var(--wms-shadow);
  display: flex; flex-direction: column; overflow: hidden;
  animation: wms-pop .25s ease;
}
@keyframes wms-pop { from { opacity: 0; transform: translateY(12px) scale(.98);} to { opacity: 1; transform: none; } }
.wms-chatbot-header {
  background: var(--wms-bubble-user); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.wms-chatbot-header-info { display: flex; align-items: center; gap: 10px; }
.wms-chatbot-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.wms-chatbot-title { font-weight: 600; font-size: 14px; line-height: 1.2; }
.wms-chatbot-status { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.wms-chatbot-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.wms-chatbot-actions button {
  background: rgba(255,255,255,.15); color:#fff; border: none; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; margin-left: 4px; font-size: 14px;
  transition: background .2s;
}
.wms-chatbot-actions button:hover { background: rgba(255,255,255,.3); }
.wms-chatbot-messages {
  flex: 1; overflow-y: auto; padding: 16px; background: #fafbfc;
  display: flex; flex-direction: column; gap: 10px;
}
.wms-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; animation: wms-fade .2s ease; white-space: pre-wrap; }
@keyframes wms-fade { from { opacity:0; transform: translateY(4px);} to { opacity:1; transform:none;} }
.wms-msg.user { align-self: flex-end; background: var(--wms-bubble-user); color: #fff; border-bottom-right-radius: 4px; }
.wms-msg.bot  { align-self: flex-start; background: var(--wms-bubble-bot); color: var(--wms-text); border-bottom-left-radius: 4px; }
.wms-msg.error { background: #fee2e2; color: #991b1b; }
.wms-typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--wms-bubble-bot); border-radius: 14px; align-self: flex-start; }
.wms-typing span { width: 6px; height: 6px; background: var(--wms-muted); border-radius: 50%; animation: wms-blink 1.2s infinite; }
.wms-typing span:nth-child(2){ animation-delay: .2s; } .wms-typing span:nth-child(3){ animation-delay: .4s; }
@keyframes wms-blink { 0%,80%,100%{opacity:.3} 40%{opacity:1} }
.wms-chatbot-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: #fff; border-top: 1px solid var(--wms-border); }
.wms-chatbot-quick button {
  background: #f1f5f9; color: var(--wms-primary-dark); border: 1px solid var(--wms-border);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.wms-chatbot-quick button:hover { background: var(--wms-primary); color: #fff; border-color: var(--wms-primary); }
.wms-chatbot-form { display: flex; padding: 10px; border-top: 1px solid var(--wms-border); background: #fff; gap: 8px; }
.wms-chatbot-form input {
  flex: 1; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--wms-border);
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.wms-chatbot-form input:focus { border-color: var(--wms-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.wms-chatbot-form button {
  background: var(--wms-bubble-user); color: #fff; border: none;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.wms-chatbot-form button:hover { transform: scale(1.06); }
@media (max-width: 480px) {
  #wms-chatbot-window { width: calc(100vw - 24px); height: calc(100vh - 100px); bottom: 76px; }
}
#wms-chatbot-toggle.is-open { transform: scale(.92); opacity: .9; }
#wms-chatbot-toggle.is-open svg { display: none; }
#wms-chatbot-toggle.is-open::before { content: "✕"; font-size: 22px; font-weight: 600; line-height: 1; }
