.chat-toggle{
  position:fixed;
  right:1.25rem;
  bottom:1.25rem;
  z-index:120;
  border:none;
  border-radius:999px;
  padding:.9rem 1.1rem;
  background:linear-gradient(135deg,#4F46E5,#7C3AED);
  color:#fff;
  font:600 .9rem/1 Inter,sans-serif;
  box-shadow:0 14px 30px rgba(79,70,229,.28);
  cursor:pointer;
}

.chat-panel{
  position:fixed;
  right:1.25rem;
  bottom:5.25rem;
  width:min(380px,calc(100vw - 2rem));
  height:min(560px,70vh);
  z-index:121;
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:1rem;
  box-shadow:0 24px 60px rgba(15,23,42,.18);
  overflow:hidden;
}

.chat-panel[hidden]{
  display:none;
}

.chat-header{
  padding:1rem 1rem .9rem;
  background:#0F172A;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
}

.chat-title{
  font:700 .95rem/1.2 "Space Grotesk",sans-serif;
}

.chat-subtitle{
  margin-top:.2rem;
  font:400 .75rem/1.4 Inter,sans-serif;
  color:rgba(255,255,255,.72);
}

.chat-close{
  border:none;
  background:transparent;
  color:#fff;
  font-size:1.15rem;
  cursor:pointer;
}

.chat-messages{
  flex:1;
  padding:1rem;
  overflow:auto;
  background:#F8FAFC;
  display:flex;
  flex-direction:column;
  gap:.75rem;
}

.chat-msg{
  max-width:88%;
  padding:.8rem .9rem;
  border-radius:.9rem;
  font:.88rem/1.6 Inter,sans-serif;
  white-space:pre-wrap;
}

.chat-msg.user{
  align-self:flex-end;
  background:#EDE9FE;
  color:#312E81;
}

.chat-msg.bot{
  align-self:flex-start;
  background:#fff;
  color:#0F172A;
  border:1px solid rgba(15,23,42,.08);
}

.chat-footer{
  border-top:1px solid rgba(15,23,42,.08);
  background:#fff;
  padding:.85rem;
}

.chat-form{
  display:flex;
  gap:.55rem;
}

.chat-input{
  flex:1;
  min-width:0;
  border:1px solid rgba(15,23,42,.12);
  border-radius:.8rem;
  padding:.82rem .9rem;
  font:.88rem Inter,sans-serif;
  outline:none;
}

.chat-input:focus{
  border-color:#4F46E5;
  box-shadow:0 0 0 3px rgba(79,70,229,.12);
}

.chat-send{
  border:none;
  border-radius:.8rem;
  padding:.82rem 1rem;
  background:#0F172A;
  color:#fff;
  font:700 .85rem Inter,sans-serif;
  cursor:pointer;
}

.chat-send:disabled{
  opacity:.6;
  cursor:not-allowed;
}

.chat-note{
  margin-top:.55rem;
  font:.74rem/1.45 Inter,sans-serif;
  color:#64748B;
}

.chat-note a{
  color:#4338CA;
  text-decoration:none;
}

.chat-note a:hover{
  text-decoration:underline;
}

@media(max-width:640px){
  .chat-toggle{
    right:1rem;
    bottom:1rem;
    padding:.85rem 1rem;
  }

  .chat-panel{
    right:1rem;
    bottom:4.9rem;
    width:calc(100vw - 2rem);
    height:70vh;
  }
}
