/* Bitech AI Chat widget — brand-scoped, self-contained (no external deps). */
.bx-aichat, .bx-aichat * { box-sizing: border-box; }

.bx-aichat {
  --bx-brand: #015EC2;
  --bx-brand-dark: #0149a0;
  --bx-bg: #ffffff;
  --bx-user: #015EC2;
  --bx-bot: #eef2f8;
  --bx-text: #1f2a3a;
  --bx-muted: #6b7a90;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* Floating launcher button */
.bx-aichat-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--bx-brand);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(1, 94, 194, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
.bx-aichat-btn:hover { background: var(--bx-brand-dark); transform: translateY(-2px); }
.bx-aichat-btn svg { width: 28px; height: 28px; }

/* Panel */
.bx-aichat-panel {
  position: absolute;
  right: 0; bottom: 74px;
  width: 370px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 110px);
  background: var(--bx-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 30, 60, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e4e9f2;
}
.bx-aichat.is-open .bx-aichat-panel { display: flex; }
.bx-aichat.is-open .bx-aichat-btn { background: var(--bx-brand-dark); }

.bx-aichat-header {
  background: var(--bx-brand);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.bx-aichat-header .bx-aichat-title { font-family: 'Nunito', system-ui, sans-serif; font-weight: 700; font-size: 15px; }
.bx-aichat-header .bx-aichat-sub { font-size: 11.5px; opacity: .85; }
.bx-aichat-header .bx-aichat-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
}
.bx-aichat-close {
  margin-left: auto; background: none; border: none; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; opacity: .85;
}
.bx-aichat-close:hover { opacity: 1; }

.bx-aichat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  background: #f7f9fc;
  display: flex; flex-direction: column; gap: 10px;
}
.bx-aichat-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.bx-aichat-msg.bot { background: var(--bx-bot); color: var(--bx-text); align-self: flex-start; border-bottom-left-radius: 4px; }
.bx-aichat-msg.user { background: var(--bx-user); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bx-aichat-msg a { color: inherit; text-decoration: underline; }
.bx-aichat-msg.bot a { color: var(--bx-brand); }

.bx-aichat-typing { display: flex; gap: 4px; align-items: center; padding: 12px 13px; }
.bx-aichat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa8bd; animation: bx-blink 1.2s infinite both; }
.bx-aichat-typing span:nth-child(2) { animation-delay: .2s; }
.bx-aichat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bx-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.bx-aichat-foot {
  padding: 10px; border-top: 1px solid #e9eef5; background: #fff;
  display: flex; gap: 8px; align-items: flex-end;
}
.bx-aichat-input {
  flex: 1; resize: none; border: 1px solid #d5deea; border-radius: 12px;
  padding: 9px 12px; font-size: 13.5px; font-family: inherit; max-height: 96px; outline: none;
  color: var(--bx-text);
}
.bx-aichat-input:focus { border-color: var(--bx-brand); }
.bx-aichat-send {
  width: 40px; height: 40px; border-radius: 12px; border: none;
  background: var(--bx-brand); color: #fff; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.bx-aichat-send:hover { background: var(--bx-brand-dark); }
.bx-aichat-send:disabled { opacity: .5; cursor: not-allowed; }
.bx-aichat-send svg { width: 18px; height: 18px; }

.bx-aichat-note { align-self: center; font-size: 11.5px; color: var(--bx-muted); background: #fff; border: 1px dashed #cdd8e6; padding: 6px 10px; border-radius: 10px; }
