/* FlowChatbot Widget */
#flowcb-root { position: fixed; z-index: 99999; }
#flowcb-root.pos-bottom-right { bottom: 24px; right: 24px; }
#flowcb-root.pos-bottom-left  { bottom: 24px; left: 24px; }

/* Launcher bubble */
#flowcb-launcher {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--flowcb-accent, #2563eb);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transition: transform .2s, box-shadow .2s;
  font-size: 1.5rem;
}
#flowcb-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,.3); }

/* Chat window */
#flowcb-window {
  position: absolute; bottom: 68px;
  width: 360px; max-width: calc(100vw - 48px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  overflow: hidden; max-height: 520px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: opacity .2s, transform .2s;
}
#flowcb-root.pos-bottom-right #flowcb-window { right: 0; }
#flowcb-root.pos-bottom-left  #flowcb-window { left: 0; }
#flowcb-window.hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

/* Header */
#flowcb-header {
  background: var(--flowcb-accent, #2563eb);
  color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
#flowcb-header .bot-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
#flowcb-header .bot-info .bot-name  { font-weight: 700; font-size: .95rem; }
#flowcb-header .bot-info .bot-status { font-size: .75rem; opacity: .85; }
#flowcb-close {
  margin-left: auto; background: none; border: none; color: #fff;
  font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 4px;
}

/* Messages */
#flowcb-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.flowcb-msg { display: flex; gap: 8px; }
.flowcb-msg.user  { flex-direction: row-reverse; }
.flowcb-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 18px;
  font-size: .875rem; line-height: 1.5; word-break: break-word;
}
.flowcb-msg.bot  .flowcb-bubble { background: #f3f4f6; color: #111; border-bottom-left-radius: 4px; }
.flowcb-msg.user .flowcb-bubble {
  background: var(--flowcb-accent, #2563eb); color: #fff; border-bottom-right-radius: 4px;
}
.flowcb-typing span {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #9ca3af; animation: flowcb-bounce .9s infinite ease-in-out;
  margin-right: 3px;
}
.flowcb-typing span:nth-child(2) { animation-delay: .15s; }
.flowcb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes flowcb-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

/* Input area */
#flowcb-input-area {
  padding: 10px 12px; border-top: 1px solid #e5e7eb;
  display: flex; align-items: center; gap: 8px;
}
#flowcb-input {
  flex: 1; border: 1px solid #d1d5db; border-radius: 24px;
  padding: 9px 14px; font-size: .875rem; outline: none;
  transition: border-color .2s;
}
#flowcb-input:focus { border-color: var(--flowcb-accent, #2563eb); }
#flowcb-send, #flowcb-mic {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: background .2s;
}
#flowcb-send { background: var(--flowcb-accent, #2563eb); color: #fff; }
#flowcb-send:hover { filter: brightness(1.1); }
#flowcb-mic { background: #f3f4f6; color: #374151; }
#flowcb-mic.recording { background: #fee2e2; color: #dc2626; animation: flowcb-pulse 1s infinite; }
#flowcb-mic.hidden { display: none; }
@keyframes flowcb-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* Error */
.flowcb-error { color: #dc2626; font-style: italic; }
