.fx-widget-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 10px 28px -6px rgba(37,99,235,0.55);
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.fx-widget-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px -6px rgba(37,99,235,0.7); }
.fx-widget-fab svg { width: 26px; height: 26px; }
.fx-widget-fab .fx-dot {
  position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; border-radius: 50%;
  background: #4ade80; border: 2px solid #fff; animation: fxPulse 2.4s ease-in-out infinite;
}
@keyframes fxPulse { 0%,100%{ opacity:1 } 50%{ opacity:.45 } }

.fx-widget-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 24px 60px -12px rgba(15,23,42,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.fx-widget-panel.open { display: flex; animation: fxSlideUp .2s ease; }
@keyframes fxSlideUp { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: translateY(0); } }

.fx-widget-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  border-bottom: 1px solid #1e3a8a;
}
.fx-widget-header .fx-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fx-widget-header .fx-avatar svg { width: 17px; height: 17px; color: #fff; }
.fx-widget-header .fx-title { font-weight: 700; font-size: 14px; color: #fff; }
.fx-widget-header .fx-subtitle { font-size: 11px; color: #bfdbfe; display: flex; align-items: center; gap: 5px; }
.fx-widget-header .fx-subtitle::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.fx-widget-close {
  margin-left: auto; background: none; border: none; color: #dbeafe; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.fx-widget-close:hover { background: rgba(255,255,255,0.15); }

.fx-widget-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f8fafc;
}
.fx-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.fx-msg.bot { align-self: flex-start; background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.fx-msg.user { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.fx-msg.typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.fx-msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: fxTyping 1.2s infinite ease-in-out; }
.fx-msg.typing span:nth-child(2) { animation-delay: .15s; }
.fx-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes fxTyping { 0%,60%,100%{ transform: translateY(0); opacity:.5 } 30%{ transform: translateY(-4px); opacity:1 } }

.fx-widget-footer {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e5e7eb;
  background: #fff;
}
.fx-widget-footer input {
  flex: 1; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 12px; color: #1f2937; font-size: 13.5px; font-family: inherit;
}
.fx-widget-footer input::placeholder { color: #94a3b8; }
.fx-widget-footer input:focus { outline: none; border-color: #2563eb; }
.fx-widget-footer button {
  background: #2563eb; border: none; border-radius: 10px;
  width: 40px; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, background .15s;
}
.fx-widget-footer button:hover { background: #1d4ed8; }
.fx-widget-footer button:disabled { opacity: .5; cursor: default; }
.fx-widget-footer button svg { width: 16px; height: 16px; }

@media (max-width: 420px) {
  .fx-widget-panel { right: 12px; left: 12px; width: auto; bottom: 84px; }
  .fx-widget-fab { right: 16px; bottom: 16px; }
}
