:root{
  --aibot-primary:#6d5efc;            /* fallback default */
  --aibot-secondary:#9a7bff;          /* fallback default */
  --aibot-primary-grad: linear-gradient(135deg, var(--aibot-primary), var(--aibot-secondary));

     --aibot-bg:#ffffff;
    --aibot-panel:#ffffff;
    --aibot-text:#0b0c14;
    --aibot-muted:rgba(11,12,20,.65);
    --aibot-border:rgba(11,12,20,.12);

  --aibot-shadow: 0 24px 70px rgba(0,0,0,.55);
  --aibot-radius:18px;
  --aibot-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}


/* ===== FORCE WIDGET TO FLOAT (THEME OVERRIDE SHIELD) ===== */
#aibot-root,
#aibot-root *{
  box-sizing:border-box !important;
}

#aibot-root{
  position:fixed !important;
  right:18px !important;
  bottom:18px !important;
  z-index:2147483647 !important;
  width:auto !important;
  max-width:none !important;
  font-family:var(--aibot-font) !important;
}

/* ✅ IMPROVED LAUNCHER BUTTON (like reference image) */
#aibot-btn#aibot-btn{
  display:inline-flex !important;
  align-items:center;
  gap:8px;
  width:auto !important;
  height:48px !important;
  padding:0 20px 0 16px !important;

  background:#ffffff;
  color:#0b0c14;
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
}

#aibot-btn:hover{ 
  transform: scale(1.08) translateY(-2px); 
  box-shadow: 0 12px 32px rgba(0,0,0,.25), 0 4px 12px rgba(0,0,0,.15);
}

#aibot-btn:active{ 
  transform: scale(1.02) translateY(0px); 
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

/* ✅ Icon styling */
#aibot-btn .aibot-launcher-ico{
  width:20px !important;
  height:20px !important;
  color: var(--aibot-primary) !important;
}

/* ✅ Hide text by default (icon-only button) */
#aibot-btn .aibot-launcher-text{
  display:none !important;
}

/* ✅ Pill shape (if user wants text shown) */
#aibot-btn[data-shape="pill"]{
  width:auto !important;
  border-radius:999px !important;
  padding:0 20px !important;
  height:56px !important;
  gap:8px;
}

#aibot-btn[data-shape="pill"] .aibot-launcher-text{
  display:block !important;
  font-weight:700;
  font-size:15px;
  letter-spacing:0.3px;
}

#aibot-btn[data-shape="pill"] .aibot-launcher-ico{
  width:24px !important;
  height:24px !important;
}

/* ✅ Circle shape (default - icon only) */
#aibot-btn[data-shape="circle"]{
  border-radius:50% !important;
  width:64px !important;
  height:64px !important;
  padding:0 !important;
}

/* ✅ Square shape (rounded square) */
#aibot-btn[data-shape="square"]{
  border-radius:20px !important;
  width:64px !important;
  height:64px !important;
  padding:0 !important;
}

/* ✅ CIRCULAR/BUBBLE CHAT PANEL */
#aibot-panel{
  width:380px;
  max-width:calc(100vw - 32px);
  height:580px;
  max-height:calc(100vh - 100px);

  background: var(--aibot-primary-grad);
  border:1px solid var(--aibot-border);
  border-radius: 40px; /* ✅ VERY rounded for circular look */
  box-shadow: var(--aibot-shadow);
  overflow:hidden;

  position:fixed !important;
  right:18px !important;
  bottom:90px !important;
  left:auto !important;
  top:auto !important;
  margin:0 !important;

  display:none;
}
#aibot-panel.open{ display:flex; flex-direction:column; }

/* Header */
#aibot-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 16px 14px;

  background:
    radial-gradient(1000px 220px at 20% -30%,
      color-mix(in srgb, var(--aibot-primary) 55%, transparent),
      transparent 60%);
  border-bottom:1px solid var(--aibot-border);
}

#aibot-title{ display:flex; align-items:center; gap:12px; }
#aibot-title img{
  width:32px;
  height:32px;
  border-radius:16px; /* ✅ very rounded */
  object-fit:cover;
  background:rgba(255,255,255,.12);
}
#aibot-title .t1{
  color:var(--aibot-text);
  font-weight:800;
  font-size:15px;
  line-height:1;
}
#aibot-title .t2{
  color:var(--aibot-muted);
  font-size:12px;
  margin-top:3px;
}

/* Close */
#aibot-close{
  border:1px solid var(--aibot-border);
  background:rgba(255,255,255,.06);
  color:var(--aibot-text);
  width:38px;
  height:38px;
  border-radius:12px;
  cursor:pointer;
}

/* Messages */
#aibot-messages{
  flex:1;
  padding:16px;
  overflow-y:auto;
  overflow-x:hidden;
  min-height:0;
}
.aibot-bubble{
  max-width: 86%;
  padding:12px 14px;
  border-radius: 24px; /* ✅ VERY rounded bubbles */
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.aibot-user{
  margin-left:auto;
  background: color-mix(in srgb, var(--aibot-primary) 22%, transparent);
  border:1px solid color-mix(in srgb, var(--aibot-primary) 35%, transparent);
  color:var(--aibot-text);
}
.aibot-bot{
  background: #f4f6ff;
  border:1px solid rgba(11,12,20,.10);
  color: var(--aibot-text);
}

.aibot-user{
  background: color-mix(in srgb, var(--aibot-primary) 14%, #ffffff);
  border:1px solid color-mix(in srgb, var(--aibot-primary) 30%, transparent);
  color: var(--aibot-text);
}


/* Typing */
#aibot-typing{
  display:none;
  color:var(--aibot-muted);
  font-size:12px;
  padding: 0 16px 12px;
}
#aibot-typing.show{ display:block; }

/* Footer */
#aibot-footer{
  background:#fff;
  padding:14px;
  flex-shrink:0;
}

#aibot-form{
  display:flex;
  gap:10px;
  align-items:flex-end;
}

#aibot-input{
  flex:1;
  width:100%;
  height:48px;
  max-height:48px;
  padding:12px 14px;
  border-radius:24px; /* ✅ very rounded */
  border:1px solid rgba(11,12,20,.12);
  background:#fff;
  color:#0b0c14;
  font-size:14px;
  line-height:1.4;

  resize:none;
  overflow-y:auto;
  overflow-x:hidden;
  white-space:pre-wrap;
  word-break:break-word;
}


/* ✅ IMPROVED SEND BUTTON */
#aibot-send{
  width:48px;
  height:48px;
  border-radius:50%; /* ✅ perfect circle */
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  background: var(--aibot-primary-grad);
  color:#fff;
  border:0;
  cursor:pointer;
  font-size:0;
  
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

#aibot-send:hover{
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

#aibot-send:active{
  transform: scale(1.02);
}

#aibot-send svg{
  width:20px;
  height:20px;
}


/* Quick Actions */
#aibot-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:10px 14px 0;
}
.aibot-action{
  border:1px solid var(--aibot-border);
  background:rgba(255,255,255,.05);
  color:var(--aibot-text);
  border-radius:999px;
  padding:7px 12px;
  font-size:12px;
  cursor:pointer;
  text-decoration:none;
}

/* Lead form */
#aibot-lead{
  display:none;
  margin-top:12px;
  border-top:1px dashed var(--aibot-border);
  padding-top:12px;
}
#aibot-lead.show{ display:block; }

#aibot-lead input,
#aibot-lead textarea{
  width:100%;
  border:1px solid var(--aibot-border);
  background: rgba(255,255,255,.05);
  color:var(--aibot-text);
  border-radius: 14px;
  padding:10px 12px;
  font-size: 13px;
  outline:none;
}
#aibot-lead textarea{ min-height:70px; resize:vertical; }

#aibot-lead button{
  width:100%;
  border:0;
  border-radius: 14px;
  padding:12px 14px;
  font-weight:800;
  cursor:pointer;
  background: rgba(255,255,255,.10);
  color:var(--aibot-text);
}
#aibot-lead button.primary{
  background: var(--aibot-primary-grad);
  color:white;
}

/* Email Button in Chat */
.aibot-btn-wrapper{
  margin-top:12px;
  display:flex;
}

.aibot-email-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 16px;
  border-radius:14px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7); /* Blue email color */
  color:#ffffff !important;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  border:0;
}

.aibot-email-btn:hover{
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.aibot-email-btn:active{
  transform: translateY(0px);
}

.aibot-bot .aibot-btn-wrapper{
  margin-top:10px;
}


/* Mobile */
@media (max-width: 420px){
  #aibot-root{
    right:12px !important;
    bottom:12px !important;
  }
  
  #aibot-btn{
    width:56px !important;
    height:56px !important;
  }
  
  #aibot-btn .aibot-launcher-ico{
    width:24px !important;
    height:24px !important;
  }
  
  #aibot-panel{
    width:calc(100vw - 24px) !important;
    max-width:calc(100vw - 24px) !important;
    height:calc(100vh - 80px) !important;
    max-height:calc(100vh - 80px) !important;
    right:12px !important;
    bottom:75px !important;
  }
  
  #aibot-messages{
    padding:12px !important;
  }
  
  .aibot-bubble{
    max-width:90% !important;
    font-size:12px !important;
  }
  
  #aibot-footer{
    padding:10px !important;
  }
  
  #aibot-input{
    height:44px !important;
    max-height:44px !important;
    font-size:13px !important;
  }
  
  #aibot-send,
  #aibot-mic{
    width:44px !important;
    height:44px !important;
  }

}

/* ✅ IMPROVED MIC BUTTON */
#aibot-mic{
  width:48px;
  height:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:24px; /* ✅ very rounded */
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);

  cursor:pointer;
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), filter .12s ease, background .12s ease, border-color .12s ease;
  padding:0;
}

#aibot-mic:hover{
  filter: brightness(1.08);
  transform: scale(1.06);
  border-color: rgba(255,255,255,.18);
}

#aibot-mic:active{
  transform: scale(1.01);
}

#aibot-mic:disabled{
  opacity:.6;
  cursor:not-allowed;
}

#aibot-mic .aibot-mic-ico{
  width:20px;
  height:20px;
}

#aibot-mic.listening{
  background: var(--aibot-primary-grad);
  border-color: color-mix(in srgb, var(--aibot-primary) 55%, rgba(255,255,255,.12));
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  position: relative;
}

#aibot-mic.listening::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:18px;
  border:1px solid color-mix(in srgb, var(--aibot-primary) 55%, transparent);
  opacity:.6;
  animation: aibotMicPulse 1.2s ease-out infinite;
  pointer-events:none;
}

@keyframes aibotMicPulse{
  0%{ transform: scale(.92); opacity:.75; }
  70%{ transform: scale(1.06); opacity:.15; }
  100%{ transform: scale(1.06); opacity:0; }
}

/* ✅ IMPROVED HEADER BUTTONS */
#aibot-newchat,
#aibot-close{
  width:40px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:20px; /* ✅ very rounded */
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);

  cursor:pointer;
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), filter .12s ease, background .12s ease, border-color .12s ease;
  padding:0;
}

#aibot-newchat:hover,
#aibot-close:hover{
  filter: brightness(1.08);
  transform: scale(1.06);
  border-color: rgba(255,255,255,.18);
}

#aibot-newchat:active,
#aibot-close:active{
  transform: scale(1.01);
}

#aibot-newchat .aibot-ico{
  width:18px;
  height:18px;
}

.aibot-color-dot{
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.aibot-color-dot::-webkit-color-swatch-wrapper{ padding: 0; }
.aibot-color-dot::-webkit-color-swatch{
  border: none;
  border-radius: 999px;
}
.aibot-color-dot::-moz-color-swatch{
  border: none;
  border-radius: 999px;
}
#aibot-lead { display:none; }
#aibot-lead.show { display:flex; }

/* Powered by bar */
#aibot-powered{
  padding: 12px 14px;
  display:flex;
  justify-content:center;
  background:#ffffff;
  border-top:1px solid rgba(0,0,0,.08);
}

#aibot-powered .aibot-powered-link{
  display:flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  font-weight:600;
  font-size:12px;
  color:#6b7280;
}

#aibot-powered .aibot-powered-link:hover{
  color:#111827;
}

#aibot-powered img{
  height:14px;
  width:auto;
  display:block;
}

/* =========================
   TABS
========================= */
#aibot-tabs{
  display:flex;
  gap:8px;
  padding:12px 14px;
  border-bottom:1px solid var(--aibot-border);
  background: rgba(0,0,0,.10);
}

.aibot-tab{
  flex:1;
  border:1px solid var(--aibot-border);
  background:rgba(255,255,255,.05);
  color:var(--aibot-text);
  border-radius:999px;
  padding:9px 12px;
  cursor:pointer;
  font-weight:800;
  font-size:13px;
  transition: transform .15s ease, background .15s ease;
}

.aibot-tab:hover{
  transform: translateY(-1px);
  background:rgba(255,255,255,.08);
}

.aibot-tab.active{
  border-color: color-mix(in srgb, var(--aibot-primary) 55%, transparent);
  background: color-mix(in srgb, var(--aibot-primary) 18%, rgba(255,255,255,.06));
}

#aibot-body{
  flex:1;
  display:flex;
  min-height:0;
  overflow:hidden;
}

#aibot-chatview,
#aibot-historyview{
  flex:1;
  display:none;
  flex-direction:column;
  min-height:0;
}

#aibot-chatview.active,
#aibot-historyview.active{
  display:flex;
}

/* History list */
#aibot-historylist{
  padding:12px 14px;
  overflow:auto;
}

.aibot-hitem{
  border:1px solid var(--aibot-border);
  background:rgba(255,255,255,.05);
  border-radius:24px; /* ✅ very rounded */
  padding:12px;
  margin:10px 0;
  cursor:pointer;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.aibot-hitem:hover{
  transform: translateY(-2px);
  filter:brightness(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.aibot-hrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.aibot-htitle{
  font-weight:900;
  color:var(--aibot-text);
  font-size:13px;
}

.aibot-htime{
  font-size:12px;
  color:var(--aibot-muted);
}

.aibot-hpreview{
  margin-top:6px;
  font-size:12px;
  color:var(--aibot-muted);
  line-height:1.4;
}

.aibot-hcurrent{
  border-color: color-mix(in srgb, var(--aibot-primary) 55%, transparent);
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}

/* =========================
   BIG COMPANY OVERRIDES
========================= */

/* Launcher - WHITE THEME */
#aibot-btn{
  background:#fff !important;
  color:#0b0c14 !important;
  border:1px solid rgba(0,0,0,.10) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.15) !important;
}

#aibot-btn:hover{ 
  box-shadow: 0 12px 32px rgba(0,0,0,.20) !important;
}

#aibot-btn .aibot-launcher-ico{
  color: var(--aibot-launcher-icon, #0b0c14) !important;
}

/* Panel = WHITE */
#aibot-panel{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.18) !important;
}

/* Header = WHITE */
#aibot-header{
  background:#fff !important;
  border-bottom:1px solid rgba(0,0,0,.08) !important;
}
#aibot-title .t1{ color:#0b0c14 !important; }
#aibot-title .t2{ color:rgba(11,12,20,.60) !important; }

/* Header buttons */
#aibot-newchat,
#aibot-close{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  color:#0b0c14 !important;
  border-radius:20px !important; /* ✅ keep rounded */
}
#aibot-newchat:hover,
#aibot-close:hover{
  background: rgba(0,0,0,.03) !important;
}

/* Tabs */
#aibot-tabs{
  background:#fff !important;
  border-bottom:1px solid rgba(0,0,0,.08) !important;
}
.aibot-tab{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  color:#0b0c14 !important;
}
.aibot-tab.active{
  border-color: color-mix(in srgb, var(--aibot-primary) 55%, rgba(0,0,0,.10)) !important;
  background: color-mix(in srgb, var(--aibot-primary) 10%, #ffffff) !important;
}

/* Messages */
#aibot-messages{ background:#fff !important; }
.aibot-bot{
  background:#f5f7fb !important;
  border:1px solid rgba(0,0,0,.08) !important;
}
.aibot-user{
  background: color-mix(in srgb, var(--aibot-primary) 12%, #ffffff) !important;
  border:1px solid color-mix(in srgb, var(--aibot-primary) 28%, rgba(0,0,0,.10)) !important;
}

/* Mic button */
#aibot-mic{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  color:#0b0c14 !important;
}
#aibot-mic:hover{ background: rgba(0,0,0,.03) !important; }
#aibot-mic.listening{
  background: var(--aibot-primary-grad) !important;
  color:#fff !important;
}

/* Powered by */
#aibot-powered{
  background:#fff !important;
  border-top:1px solid rgba(0,0,0,.08) !important;
}

/* ✅ COOL TYPING INDICATOR */
#aibot-typing{
  display:none;
  padding: 12px 16px;
  align-items:center;
  gap:6px;
}

#aibot-typing.show{ 
  display:flex; 
}

.aibot-typing-dot{
  width:8px;
  height:8px;
  background: var(--aibot-primary);
  border-radius:50%;
  animation: aibot-typing-bounce 1.4s infinite ease-in-out;
}

.aibot-typing-dot:nth-child(1){ animation-delay: 0s; }
.aibot-typing-dot:nth-child(2){ animation-delay: 0.2s; }
.aibot-typing-dot:nth-child(3){ animation-delay: 0.4s; }

@keyframes aibot-typing-bounce{
  0%, 60%, 100%{ transform: translateY(0); opacity:0.4; }
  30%{ transform: translateY(-10px); opacity:1; }
}
