.cpb-ai-chat{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:900;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  font-family:Inter,Arial,sans-serif;
}

body.cpb-ai-chat-mounted #chatbot,
body.cpb-ai-chat-mounted .promo-chat{
  display:none!important;
}

.cpb-ai-chat-window{
  width:360px;
  max-width:calc(100vw - 32px);
  height:min(560px,calc(100vh - 110px));
  display:none;
  flex-direction:column;
  overflow:hidden;
  background:#07111f;
  border:1px solid rgba(125,211,252,.2);
  border-radius:8px;
  box-shadow:0 24px 80px rgba(0,0,0,.46);
}

.cpb-ai-chat-window.open{display:flex}

.cpb-ai-chat-window.expanded{
  position:fixed;
  top:16px;
  right:16px;
  bottom:16px;
  width:min(760px,calc(100vw - 32px));
  height:auto;
  max-height:none;
}

.cpb-ai-chat-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:13px 14px;
  background:linear-gradient(135deg,#07111f,#0d2428);
  border-bottom:1px solid rgba(125,211,252,.16);
}

.cpb-ai-chat-mark{
  width:32px;
  height:32px;
  border-radius:7px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  background:#7dd3fc;
  color:#05111c;
  font-size:13px;
  font-weight:900;
  letter-spacing:.04em;
}

.cpb-ai-chat-title{min-width:0;flex:1}
.cpb-ai-chat-title strong{display:block;color:#f8fafc;font-size:13px;line-height:1.1}
.cpb-ai-chat-title span{display:block;color:#93c5fd;font-size:10px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.cpb-ai-chat-icon{
  width:30px;
  height:30px;
  border:1px solid rgba(203,213,225,.18);
  border-radius:7px;
  background:rgba(255,255,255,.04);
  color:#dbeafe;
  cursor:pointer;
  font-size:12px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.cpb-ai-chat-reset{
  width:auto;
  padding:0 8px;
  font-size:10px;
  font-weight:800;
  letter-spacing:.02em;
}

.cpb-ai-chat-expand-btn span{
  width:12px;
  height:12px;
  border:1.5px solid currentColor;
  border-radius:2px;
  display:block;
  position:relative;
}

.cpb-ai-chat-window.expanded .cpb-ai-chat-expand-btn span{
  width:14px;
  height:2px;
  border:0;
  border-radius:0;
  border-top:2px solid currentColor;
}

.cpb-ai-chat-icon:hover{
  border-color:#7dd3fc;
  color:#7dd3fc;
}

.cpb-ai-chat-body{
  flex:1;
  min-height:0;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:9px;
  padding:14px;
  background:radial-gradient(circle at 100% 0%,rgba(45,212,191,.08),transparent 36%),#07111f;
}

.cpb-ai-chat-msg{
  max-width:88%;
  border-radius:8px;
  padding:10px 12px;
  font-size:12px;
  line-height:1.55;
  word-break:break-word;
}

.cpb-ai-chat-msg.bot{
  align-self:flex-start;
  background:rgba(125,211,252,.08);
  border:1px solid rgba(125,211,252,.13);
  color:#dbeafe;
  border-bottom-left-radius:2px;
}

.cpb-ai-chat-msg.user{
  align-self:flex-end;
  background:#7dd3fc;
  color:#05111c;
  font-weight:700;
  border-bottom-right-radius:2px;
}

.cpb-ai-chat-msg.thinking{
  width:auto;
  color:#93c5fd;
  opacity:.8;
}

.cpb-ai-chat-msg p{
  margin:0 0 8px;
}

.cpb-ai-chat-msg p:last-child,
.cpb-ai-chat-msg ul:last-child{
  margin-bottom:0;
}

.cpb-ai-chat-msg ul{
  margin:0 0 8px;
  padding-left:18px;
}

.cpb-ai-chat-msg li{
  margin:3px 0;
}

.cpb-ai-chat-msg a{
  color:#7dd3fc;
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
}

.cpb-ai-chat-msg.user a{
  color:#05111c;
}

.cpb-ai-chat-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  padding:10px 12px;
  border-top:1px solid rgba(148,163,184,.16);
  background:#081321;
}

.cpb-ai-chat-actions:empty{
  display:none;
}

.cpb-ai-chat-action{
  border:1px solid rgba(148,163,184,.24);
  background:rgba(125,211,252,.05);
  color:#dbeafe;
  border-radius:7px;
  padding:7px 9px;
  font-size:10px;
  font-weight:850;
  cursor:pointer;
  text-decoration:none;
  letter-spacing:.02em;
}

.cpb-ai-chat-action.primary{
  background:#7dd3fc;
  color:#05111c;
  border-color:#7dd3fc;
}

.cpb-ai-chat-action:hover{
  border-color:#7dd3fc;
  color:#7dd3fc;
}

.cpb-ai-chat-action.primary:hover{
  color:#05111c;
  background:#bae6fd;
}

.cpb-ai-chat-input{
  display:flex;
  gap:8px;
  padding:10px 12px;
  border-top:1px solid rgba(148,163,184,.16);
  background:#081321;
}

.cpb-ai-chat-input input{
  flex:1;
  min-width:0;
  background:#111927;
  border:1px solid rgba(148,163,184,.22);
  color:#f8fafc;
  border-radius:7px;
  padding:10px;
  font-size:12px;
  outline:none;
}

.cpb-ai-chat-input input:focus{
  border-color:#7dd3fc;
}

.cpb-ai-chat-send,
.cpb-ai-chat-toggle{
  background:#7dd3fc;
  border:0;
  color:#05111c;
  font-weight:900;
  cursor:pointer;
}

.cpb-ai-chat-send{
  width:38px;
  border-radius:7px;
}

.cpb-ai-chat-toggle{
  width:50px;
  height:50px;
  border:0;
  border-radius:8px;
  background:#2dd4bf;
  color:#05111c;
  box-shadow:0 10px 24px rgba(0,0,0,.26);
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  transform-origin:center;
  transition:transform .25s ease, box-shadow .25s ease;
  overflow:visible;
}

.cpb-ai-chat-toggle:hover{
  transform:scale(1.06);
  box-shadow:0 14px 30px rgba(0,0,0,.3);
}

.cpb-ai-chat-toggle::before{
  content:none;
}

.cpb-ai-chat-toggle::after{
  content:none;
}

.cpb-ai-toggle-logo{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
}

.cpb-ai-toggle-main{
  font-family:Inter,Arial,sans-serif;
  font-size:10px;
  font-weight:800;
  color:#05111c;
  letter-spacing:.04em;
}

.cpb-ai-toggle-line{
  width:18px;
  height:1px;
  background:#05111c;
  opacity:.35;
}

.cpb-ai-toggle-sub{
  font-family:Inter,Arial,sans-serif;
  font-size:6px;
  font-weight:700;
  color:#05111c;
  letter-spacing:.14em;
  opacity:.62;
  text-transform:uppercase;
}

.cpb-ai-chat-ping{
  position:absolute;
  top:-3px;
  right:-3px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#4ade80;
  border:2px solid #07111f;
  animation:cpb-ai-chat-ping 2s ease infinite;
}

.cpb-ai-chat.is-open .cpb-ai-chat-toggle{
  transform:none;
}

.cpb-ai-chat.is-open .cpb-ai-chat-toggle::before{
  animation:none;
  opacity:0;
}

.cpb-ai-chat-nudge{
  position:absolute;
  right:0;
  bottom:76px;
  width:max-content;
  max-width:min(260px,calc(100vw - 36px));
  padding:10px 12px;
  border:1px solid rgba(45,212,191,.26);
  border-radius:10px;
  background:linear-gradient(145deg,#07111f,#0b1f2d);
  color:#dbeafe;
  box-shadow:0 16px 42px rgba(0,0,0,.32);
  font-size:12px;
  font-weight:750;
  line-height:1.35;
  opacity:0;
  pointer-events:none;
  transform:translateY(8px) scale(.98);
  transition:opacity .24s ease, transform .24s ease;
}

.cpb-ai-chat-nudge::after{
  content:"";
  position:absolute;
  right:18px;
  bottom:-6px;
  width:10px;
  height:10px;
  border-right:1px solid rgba(125,211,252,.22);
  border-bottom:1px solid rgba(125,211,252,.22);
  background:#0b1f2d;
  transform:rotate(45deg);
}

.cpb-ai-chat-nudge span{
  display:block;
  position:relative;
  padding-right:10px;
}

.cpb-ai-chat-nudge span::after{
  content:"";
  position:absolute;
  right:0;
  top:.38em;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#2dd4bf;
  animation:cpb-ai-talk-dot 1s ease-in-out infinite;
}

.cpb-ai-chat.nudging:not(.is-open) .cpb-ai-chat-nudge{
  opacity:1;
  transform:translateY(0) scale(1);
}

@keyframes cpb-ai-chat-ping{
  0%,100%{transform:scale(1)}
  50%{transform:scale(1.25)}
}

@keyframes cpb-ai-talk-dot{
  0%,100%{opacity:.32;transform:scale(.8)}
  50%{opacity:1;transform:scale(1)}
}

@media(prefers-reduced-motion:reduce){
  .cpb-ai-chat-toggle,
  .cpb-ai-chat-toggle::before,
  .cpb-ai-chat-ping,
  .cpb-ai-chat-nudge span::after{
    animation:none!important;
  }
  .cpb-ai-chat-nudge{
    transition:none;
  }
}

@media(max-width:620px){
  .cpb-ai-chat{right:14px;bottom:14px}
  .cpb-ai-chat-window,
  .cpb-ai-chat-window.expanded{
    width:calc(100vw - 28px);
    height:min(640px,calc(100vh - 88px));
  }
  .cpb-ai-chat-window.expanded{
    top:14px;
    left:14px;
    right:14px;
    bottom:14px;
    height:auto;
  }
  .cpb-ai-chat-actions{max-height:96px;overflow:auto}
}
