#faq-bot-root {
  --faq-bg: #fbf8f2;
  --faq-surface: #ffffff;
  --faq-ink: #1b2430;
  --faq-ink-soft: #5b6472;
  --faq-primary: #497872;
  --faq-primary-ink: #ffffff;
  --faq-accent: #f0a83a;
  --faq-user-bubble: #e8f3f0;
  --faq-border: #e4dfd3;

  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: inherit;
}

#faq-bot-root * {
  box-sizing: border-box;
}

#faq-bot-root #faq-bot-toggle {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--faq-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 36, 48, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#faq-bot-root #faq-bot-toggle img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}

#faq-bot-root .faq-bot-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 86px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: var(--faq-bg);
  border: 1px solid var(--faq-border);
  border-radius: 16px;
  overflow: hidden;
  color: var(--faq-ink);
  box-shadow: 0 8px 30px rgba(27, 36, 48, 0.22);
}

#faq-bot-root.faq-bot-open .faq-bot-panel {
  display: flex;
}

#faq-bot-root.faq-bot-open #faq-bot-toggle {
  box-shadow: 0 2px 8px rgba(27, 36, 48, 0.2);
}

#faq-bot-root .faq-bot-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  background: #f4d749;
  color: var(--faq-primary);
}

#faq-bot-root .faq-bot-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#faq-bot-root .faq-bot-call {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--faq-primary) !important;
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

#faq-bot-root .faq-bot-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--faq-primary);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#faq-bot-root .faq-bot-badge {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#faq-bot-root .faq-bot-badge img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

#faq-bot-root .faq-bot-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--faq-primary) !important;
}

#faq-bot-root .faq-bot-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--faq-primary) !important;
  opacity: 0.85;
}

#faq-bot-root .faq-bot-messages {
  height: 340px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--faq-surface);
}

#faq-bot-root .faq-msg {
  max-width: 82%;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  animation: faq-fade-in 0.18s ease-out;
  color: var(--faq-ink);
}

@keyframes faq-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

#faq-bot-root .faq-msg.bot {
  align-self: flex-start;
  background: var(--faq-bg);
  border: 1px solid var(--faq-border);
  border-bottom-left-radius: 4px;
}

#faq-bot-root .faq-msg.user {
  align-self: flex-end;
  background: var(--faq-user-bubble);
  border-bottom-right-radius: 4px;
}

#faq-bot-root .faq-msg.error {
  align-self: flex-start;
  background: #fbeeee;
  border: 1px solid #e6c6c6;
}

#faq-bot-root .faq-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.6rem 0.85rem;
}

#faq-bot-root .faq-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faq-ink-soft);
  animation: faq-bounce 1s infinite ease-in-out;
}

#faq-bot-root .faq-typing span:nth-child(2) { animation-delay: 0.15s; }
#faq-bot-root .faq-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes faq-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

#faq-bot-root .faq-bot-fallback {
  display: none;
  margin: 0 1.25rem 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fff6e8;
  border: 1px solid #f0dcae;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--faq-ink);
}

#faq-bot-root .faq-bot-fallback.visible {
  display: block;
}

#faq-bot-root .faq-bot-fallback a {
  color: var(--faq-primary);
  font-weight: 600;
}

#faq-bot-root .faq-bot-inputrow {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--faq-border);
  background: var(--faq-surface);
}

#faq-bot-root .faq-bot-inputrow input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--faq-border);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--faq-ink);
}

#faq-bot-root .faq-bot-inputrow input:focus {
  outline: 2px solid var(--faq-primary);
  outline-offset: 1px;
}

#faq-bot-root .faq-bot-inputrow button {
  padding: 0.6rem 1.1rem;
  background: var(--faq-primary);
  color: var(--faq-primary-ink);
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

#faq-bot-root .faq-bot-inputrow button:disabled {
  opacity: 0.6;
  cursor: default;
}

#faq-bot-root .faq-bot-inputrow button:focus-visible,
#faq-bot-root .faq-bot-fallback a:focus-visible {
  outline: 2px solid var(--faq-primary);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  #faq-bot-root { bottom: 14px; right: 14px; }
  #faq-bot-root .faq-bot-panel { width: calc(100vw - 28px); }
  #faq-bot-root .faq-bot-messages { height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  #faq-bot-root .faq-msg,
  #faq-bot-root .faq-typing span {
    animation: none;
  }
}