.sakoane-ai-chatbot {
  --sai-primary: #111827;
  --sai-accent: #B8860B;
  --sai-text: #111827;
  --sai-bg: #ffffff;
  --sai-muted: #64748b;
  --sai-border: rgba(17, 24, 39, 0.12);
  position: fixed;
  z-index: 99999;
  bottom: 24px;
  font-family: inherit;
  color: var(--sai-text);
}
.sakoane-ai-chatbot * { box-sizing: border-box; }
.sakoane-ai-chatbot.sakoane-ai-right { right: 24px; }
.sakoane-ai-chatbot.sakoane-ai-left { left: 24px; }
.sakoane-ai-chatbot.sakoane-ai-inline {
  position: relative;
  right: auto;
  left: auto;
  bottom: auto;
  width: 100%;
  max-width: 460px;
}
.sai-toggle {
  width: 68px;
  height: 68px;
  border: 3px solid var(--sai-accent);
  border-radius: 999px;
  background: var(--sai-primary);
  padding: 0;
  box-shadow: 0 14px 35px rgba(0,0,0,0.22);
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.sai-toggle:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(0,0,0,0.28); }
.sai-toggle img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}
.sai-pulse {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}
.sai-panel {
  position: absolute;
  bottom: 84px;
  width: min(420px, calc(100vw - 32px));
  height: min(670px, calc(100vh - 130px));
  background: var(--sai-bg);
  border: 1px solid var(--sai-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 65px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.sakoane-ai-left .sai-panel { left: 0; transform-origin: bottom left; }
.sakoane-ai-right .sai-panel { right: 0; }
.sakoane-ai-inline .sai-toggle { display: none; }
.sakoane-ai-inline .sai-panel {
  position: static;
  width: 100%;
  opacity: 1;
  visibility: visible;
  transform: none;
  height: 670px;
}
.sakoane-ai-chatbot.sai-open .sai-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.sai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, var(--sai-primary), #1f2937);
  color: #fff;
}
.sai-header img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sai-accent);
  flex: 0 0 auto;
}
.sai-header strong { display: block; font-size: 15px; line-height: 1.2; }
.sai-header span { display: block; font-size: 12px; opacity: .82; line-height: 1.2; margin-top: 2px; }
.sai-close,
.sai-transcript-btn {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.sai-transcript-btn { margin-left: auto; font-size: 15px; font-weight: 700; }
.sai-close { font-size: 24px; }
.sai-status {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 14px;
  color: var(--sai-muted);
  font-size: 11px;
  line-height: 1.35;
  border-bottom: 1px solid var(--sai-border);
  background: #fff;
}
.sai-status span { min-width: 0; }
.sai-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
}
.sai-message {
  display: flex;
  margin: 0 0 12px;
}
.sai-message.sai-user { justify-content: flex-end; }
.sai-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.sai-assistant .sai-bubble {
  background: #fff;
  color: var(--sai-text);
  border: 1px solid var(--sai-border);
  border-bottom-left-radius: 6px;
}
.sai-user .sai-bubble {
  background: var(--sai-primary);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.sai-actions,
.sai-related,
.sai-feedback,
.sai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.sai-quick-prompts {
  padding: 10px 12px 4px;
  margin: 0;
  background: #fff;
  border-top: 1px solid var(--sai-border);
}
.sai-action,
.sai-related a,
.sai-feedback button,
.sai-quick-prompts button {
  border: 1px solid var(--sai-accent);
  color: var(--sai-primary);
  background: #fff;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sai-feedback button {
  border-color: var(--sai-border);
  color: var(--sai-muted);
  padding: 6px 9px;
  font-weight: 600;
}
.sai-action:hover,
.sai-action:focus,
.sai-related a:hover,
.sai-related a:focus,
.sai-feedback button:hover,
.sai-feedback button:focus,
.sai-quick-prompts button:hover,
.sai-quick-prompts button:focus {
  background: var(--sai-accent);
  color: #fff;
  text-decoration: none;
  border-color: var(--sai-accent);
}
.sai-feedback button[disabled] { opacity: .65; cursor: default; }
.sai-related-title {
  width: 100%;
  color: var(--sai-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sai-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.sai-typing span {
  width: 6px;
  height: 6px;
  background: var(--sai-accent);
  border-radius: 50%;
  animation: saiTyping 1s infinite ease-in-out;
}
.sai-typing span:nth-child(2) { animation-delay: .15s; }
.sai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes saiTyping { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.sai-privacy {
  padding: 8px 14px;
  font-size: 11px;
  line-height: 1.35;
  color: #475569;
  border-top: 1px solid var(--sai-border);
  background: #fff;
}
.sai-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--sai-border);
}
.sai-input {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  border-radius: 14px;
  border: 1px solid var(--sai-border);
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: none;
}
.sai-input:focus { border-color: var(--sai-accent); box-shadow: 0 0 0 3px rgba(184,134,11,.14); }
.sai-send {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 0 15px;
  color: #fff;
  background: var(--sai-primary);
  font-weight: 700;
  cursor: pointer;
}
.sai-send:disabled { opacity: .55; cursor: not-allowed; }
.sai-lead-form,
.sai-transcript-form {
  background: #fff;
  border: 1px solid var(--sai-border);
  border-radius: 16px;
  padding: 12px;
  margin: 8px 0 14px;
}
.sai-lead-form label,
.sai-transcript-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0 4px;
}
.sai-lead-form input,
.sai-lead-form textarea,
.sai-transcript-form input,
.sai-transcript-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--sai-border);
  border-radius: 10px;
  padding: 9px;
  font: inherit;
  font-size: 13px;
}
.sai-lead-form button,
.sai-transcript-form button {
  margin-top: 10px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--sai-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.sai-error {
  margin-top: 8px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.35;
}
.sai-success {
  margin-top: 8px;
  color: #166534;
  font-size: 12px;
  line-height: 1.35;
}
.sai-hp { display:none !important; visibility:hidden !important; }
@media (max-width: 520px) {
  .sakoane-ai-chatbot { bottom: 16px; }
  .sakoane-ai-chatbot.sakoane-ai-right { right: 16px; }
  .sakoane-ai-chatbot.sakoane-ai-left { left: 16px; }
  .sai-panel {
    width: calc(100vw - 24px);
    height: min(650px, calc(100vh - 110px));
    bottom: 78px;
    border-radius: 18px;
  }
  .sai-status { flex-direction: column; gap: 3px; }
  .sai-bubble { max-width: 92%; }
  .sai-header { padding: 13px; }
}
.sai-clear {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.sai-clear:hover,
.sai-clear:focus { background: rgba(255,255,255,.2); }
.sai-confidence {
  display: inline-flex;
  width: auto;
  max-width: 92%;
  margin: -4px 0 10px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.3;
  border: 1px solid var(--sai-border);
  background: #fff;
  color: var(--sai-muted);
}
.sai-confidence-good { border-color: rgba(22, 101, 52, .22); color: #166534; }
.sai-confidence-low { border-color: rgba(185, 28, 28, .18); color: #92400e; }
.sai-consent {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500 !important;
  line-height: 1.35;
}
.sai-consent input {
  width: auto !important;
  margin-top: 2px;
}
