:root{
  --cca-navy:#0b2545;
  --cca-navy-2:#13315c;
  --cca-gold:#f4b400;
  --cca-gold-dark:#d99e00;
  --cca-bg:#f7f9fc;
  --cca-user:#0b2545;
  --cca-ai:#ffffff;
  --cca-muted:#6b7a90;
}

/* ---------- Launcher button ---------- */
#cca-chat-launcher{
  position:fixed; right:22px; bottom:22px;
  width:62px; height:62px; border-radius:50%;
  background: linear-gradient(135deg, var(--cca-navy), var(--cca-navy-2));
  color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer; z-index:99998;
  box-shadow: 0 12px 30px rgba(11,37,69,.35);
  border: 2px solid var(--cca-gold);
  transition: transform .2s ease, box-shadow .2s ease;
  user-select:none;
}
#cca-chat-launcher:hover{
  transform: scale(1.06);
  box-shadow: 0 16px 38px rgba(11,37,69,.5);
}
#cca-chat-launcher:focus{ outline: 3px solid rgba(244,180,0,.6); outline-offset:2px; }
.cca-launcher-pulse{
  position:absolute; inset:-4px; border-radius:50%;
  border: 2px solid var(--cca-gold);
  animation: ccaPulse 2s ease-out infinite;
  pointer-events:none;
}
@keyframes ccaPulse{
  0%  { transform:scale(.9); opacity:.7; }
  70% { transform:scale(1.35); opacity:0; }
  100%{ transform:scale(1.35); opacity:0; }
}

/* ---------- Chat window ---------- */
#cca-chat-window{
  position:fixed; right:22px; bottom:100px;
  width:420px; max-width:calc(100vw - 32px);
  height:660px; max-height:calc(100vh - 140px);
  background: var(--cca-bg);
  border-radius:18px; overflow:hidden;
  box-shadow: 0 26px 70px rgba(11,37,69,.35);
  display:flex; flex-direction:column;
  z-index:99999;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans Bengali",sans-serif;
  animation: ccaPop .22s ease-out;
}
@keyframes ccaPop{
  from{ opacity:0; transform: translateY(14px) scale(.98); }
  to  { opacity:1; transform: none; }
}
.cca-hidden{ display:none !important; }

/* ---------- Header ---------- */
.cca-header{
  background: linear-gradient(135deg, var(--cca-navy), var(--cca-navy-2));
  color:#fff; padding: 12px 14px;
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  flex-shrink:0;
}
.cca-brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.cca-logo{
  width:38px; height:38px; border-radius:10px;
  background: var(--cca-gold); color: var(--cca-navy);
  font-weight:800; display:flex; align-items:center; justify-content:center;
  font-size:13px; letter-spacing:.5px; flex-shrink:0;
}
.cca-brand-text{ min-width:0; }
.cca-title{
  font-weight:700; font-size:14px; line-height:1.15;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cca-subtitle{
  font-size:11px; opacity:.85; display:flex; align-items:center; gap:6px;
  margin-top:2px;
}
.cca-dot{
  width:7px; height:7px; border-radius:50%; background:#4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.25);
}
.cca-header-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.cca-header-actions select{
  background: rgba(255,255,255,.12); color:#fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius:8px; font-size:12px; padding: 5px 7px; outline:none;
  cursor:pointer;
}
.cca-header-actions select option{ color:#000; }
.cca-header-actions button{
  background:transparent; border:0; color:#fff;
  font-size:18px; line-height:1; cursor:pointer;
  width:30px; height:30px; border-radius:8px;
  transition: background .15s ease;
}
.cca-header-actions button:hover{ background: rgba(255,255,255,.15); }

/* ---------- Messages ---------- */
.cca-messages{
  flex:1; overflow-y:auto; padding: 16px 14px;
  display:flex; flex-direction:column; gap:10px;
  background: var(--cca-bg);
  scroll-behavior: smooth;
}
.cca-msg{
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  word-wrap: break-word; white-space: pre-wrap;
  animation: ccaIn .18s ease-out;
}
@keyframes ccaIn{
  from{ opacity:0; transform: translateY(4px); }
  to  { opacity:1; transform: none; }
}
.cca-msg.user{
  align-self: flex-end;
  background: var(--cca-user); color:#fff;
  border-bottom-right-radius: 4px;
}
.cca-msg.ai{
  align-self: flex-start;
  background: var(--cca-ai); color:#111;
  border: 1px solid #e7ecf3;
  border-bottom-left-radius: 4px;
}
.cca-msg .cca-time{
  display:block; font-size:10px; color: var(--cca-muted);
  margin-top: 5px; opacity:.85;
}
.cca-msg.user .cca-time{ color: #c9d3e1; }

/* ---------- Typing indicator ---------- */
.cca-typing{
  display:flex; gap:4px; padding: 0 18px 8px;
  flex-shrink:0;
}
.cca-typing span{
  width:7px; height:7px; border-radius:50%;
  background: var(--cca-navy); opacity:.4;
  animation: ccaBounce 1.2s infinite;
}
.cca-typing span:nth-child(2){ animation-delay:.15s; }
.cca-typing span:nth-child(3){ animation-delay:.3s; }
@keyframes ccaBounce{
  0%,80%,100%{ transform: translateY(0);    opacity:.35; }
  40%        { transform: translateY(-5px); opacity:.9; }
}

/* ---------- Input ---------- */
.cca-input{
  display:flex; gap:8px; padding:10px;
  background:#fff; border-top: 1px solid #e7ecf3;
  align-items:flex-end; flex-shrink:0;
}
.cca-input textarea{
  flex:1; resize:none; border: 1px solid #dfe6ef;
  border-radius: 12px; padding: 10px 12px;
  font-size: 14px; max-height: 110px; outline:none;
  font-family: inherit; line-height:1.4;
}
.cca-input textarea:focus{ border-color: var(--cca-navy-2); }
.cca-input button{
  background: linear-gradient(135deg, var(--cca-navy), var(--cca-navy-2));
  color:#fff; border:0; width:42px; height:42px;
  border-radius: 12px; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  transition: transform .15s ease;
}
.cca-input button:hover{ transform: scale(1.04); }
.cca-input button:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

/* ---------- Mobile ---------- */
@media (max-width: 520px){
  #cca-chat-window{
    right:0; bottom:0; width:100vw; height:100vh;
    max-height: 100vh; border-radius:0;
  }
  #cca-chat-launcher{ right:16px; bottom:16px; }
  .cca-msg{ max-width: 88%; }
}