/* Nexy widget — clean light theme.
   Brand colour comes from the --cb-primary CSS variable, which nexy.js
   sets from the site config (window.NexyConfig.primaryColor).
   Defaults below (cyan) apply if the variable is never set. */
#cb-fab {
  position: fixed; left: 22px; bottom: 22px; z-index: 2147483000;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--cb-primary, #22d3ee); color: #fff;
  box-shadow: 0 8px 28px var(--cb-primary-glow, rgba(34, 211, 238, .45)), 0 2px 8px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
#cb-fab:hover { transform: scale(1.06); }
#cb-fab svg { width: 26px; height: 26px; }
#cb-fab .cb-fab-close { display: none; }
#cb-fab.open .cb-fab-chat { display: none; }
#cb-fab.open .cb-fab-close { display: block; }

#cb-panel {
  position: fixed; left: 22px; bottom: 94px; z-index: 2147483000;
  width: min(384px, calc(100vw - 44px)); height: min(560px, calc(100dvh - 130px));
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.08);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
}
#cb-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.cb-head {
  background: #1d1d1f; color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.cb-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--cb-primary, #22d3ee); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.cb-head .cb-title { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.cb-head .cb-sub { font-size: 11.5px; color: #a1a1a6; display: flex; align-items: center; gap: 5px; }
.cb-dot { width: 7px; height: 7px; border-radius: 50%; background: #30d158; display: inline-block; }

#cb-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f5f5f7; }
.cb-msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.cb-msg a { color: var(--cb-primary, #0891b2); }
.cb-msg.bot { background: #fff; color: #1d1d1f; border-bottom-left-radius: 5px; align-self: flex-start; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.cb-msg.user { background: #1d1d1f; color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.cb-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #c7c7cc; animation: cb-blink 1.1s infinite; }
.cb-typing span:nth-child(2) { animation-delay: .18s; }
.cb-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes cb-blink { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }

.cb-inputbar { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #e8e8ed; }
#cb-input {
  flex: 1; border: 1px solid #e2e2e6; border-radius: 999px; padding: 10px 14px;
  font-size: 13.5px; font-family: inherit; outline: none; background: #f5f5f7; color: #1d1d1f;
}
#cb-input:focus { border-color: var(--cb-primary, #22d3ee); background: #fff; }
#cb-send {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: var(--cb-primary, #22d3ee); color: #fff; display: flex; align-items: center; justify-content: center;
}
#cb-send:disabled { opacity: .45; cursor: default; }
#cb-send svg { width: 17px; height: 17px; }
.cb-powered { text-align: center; font-size: 10.5px; color: #aeaeb2; padding: 6px 0 8px; background: #fff; }
@media (max-width: 480px) {
  #cb-fab { left: 16px; bottom: 16px; }
  #cb-panel { left: 12px; bottom: 86px; }
}
