#roaya-chat-launcher{
  position:fixed;
  left:18px;
  bottom:80px;
  z-index:860;
  width:58px;
  height:58px;
  border-radius:50%;
  background:var(--gradient-brand);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 30px rgba(8,123,255,.45);
  transition:transform .3s ease, box-shadow .3s ease;
}
#roaya-chat-launcher:hover{ transform:scale(1.08); box-shadow:0 14px 40px rgba(25,217,255,.5); }
#roaya-chat-launcher svg{ width:26px; height:26px; }
#roaya-chat-launcher .pulse{
  position:absolute; inset:0; border-radius:50%;
  border:2px solid var(--cyan);
  animation:chat-pulse 2.4s ease-out infinite;
}
@keyframes chat-pulse{
  0%{ transform:scale(.9); opacity:.7; }
  100%{ transform:scale(1.6); opacity:0; }
}

#roaya-chat-panel{
  position:fixed;
  left:18px;
  bottom:150px;
  z-index:870;
  width:min(320px, calc(100vw - 28px));
  max-width:calc(100vw - 28px);
  height:min(430px, calc(100vh - 175px));
  height:min(430px, calc(100dvh - 175px));
  max-height:calc(100vh - 175px);
  max-height:calc(100dvh - 175px);
  box-sizing:border-box;
  border-radius:20px;
  background:rgba(3,20,61,.92);
  border:1px solid var(--glass-border);
  backdrop-filter:blur(20px);
  box-shadow:0 24px 70px rgba(0,0,0,.5);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  transform:translateY(16px) scale(.97);
  opacity:0;
  pointer-events:none;
  transition:transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}
#roaya-chat-panel.open{
  transform:translateY(0) scale(1);
  opacity:1;
  pointer-events:auto;
}

.chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:16px 18px;
  border-bottom:1px solid var(--glass-border);
  background:linear-gradient(90deg, rgba(8,123,255,.12), rgba(32,232,106,.06));
  min-width:0;
}
.chat-head-title{ display:flex; align-items:center; gap:10px; min-width:0; }
.chat-head-title > div{ min-width:0; }
.chat-head-dot{ width:9px; height:9px; border-radius:50%; background:var(--green); box-shadow:0 0 10px var(--green); }
.chat-head h4{ font-family:var(--font-ar-body); font-size:15.5px; color:var(--heading); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-head span{ display:block; font-size:11.5px; color:var(--body-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-close{ font-size:20px; color:var(--body-text); padding:4px 8px; border-radius:8px; }
.chat-close:hover{ color:var(--cyan); background:rgba(255,255,255,.05); }

.chat-body{
  flex:1;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.chat-msg{
  max-width:85%;
  padding:11px 14px;
  border-radius:14px;
  font-size:14px;
  line-height:1.7;
}
.chat-msg.bot{
  align-self:flex-start;
  background:rgba(255,255,255,.05);
  border:1px solid var(--glass-border);
  color:var(--body-text);
  border-bottom-left-radius:4px;
}
.chat-msg.user{
  align-self:flex-end;
  background:var(--gradient-brand);
  color:#03143D;
  font-weight:600;
  border-bottom-right-radius:4px;
}
.chat-msg.typing{ display:flex; gap:5px; align-items:center; }
.chat-msg.typing span{
  width:6px; height:6px; border-radius:50%; background:var(--cyan);
  animation:chat-typing 1.2s infinite ease-in-out;
}
.chat-msg.typing span:nth-child(2){ animation-delay:.15s; }
.chat-msg.typing span:nth-child(3){ animation-delay:.3s; }
@keyframes chat-typing{ 0%,60%,100%{ transform:translateY(0); opacity:.5; } 30%{ transform:translateY(-4px); opacity:1; } }

.chat-foot{
  display:flex;
  gap:8px;
  padding:14px;
  border-top:1px solid var(--glass-border);
  min-width:0;
  box-sizing:border-box;
}
.chat-foot input{
  flex:1;
  min-width:0;
  width:0;
  box-sizing:border-box;
  background:rgba(255,255,255,.05);
  border:1px solid var(--glass-border);
  border-radius:12px;
  padding:11px 14px;
  font-size:14px;
  color:var(--heading);
  touch-action:manipulation;
}
.chat-foot input::placeholder{ color:#7488B5; }
.chat-foot input:focus{ outline:none; border-color:var(--cyan); }
.chat-foot button{
  width:42px; height:42px;
  border-radius:12px;
  background:var(--gradient-brand);
  display:flex; align-items:center; justify-content:center;
  color:#03143D;
  flex-shrink:0;
}
.chat-foot button:hover{ filter:brightness(1.1); }
.chat-foot button svg{ width:18px; height:18px; transform:scaleX(-1); }

@media (max-width:560px){
  #roaya-chat-launcher{ left:12px; bottom:14px; }
  #roaya-chat-panel{ left:8px; bottom:0; width:calc(100vw - 16px); max-width:calc(100vw - 16px); height:min(68vh,460px); height:min(68dvh,460px); max-height:calc(100vh - 12px); max-height:calc(100dvh - 12px); border-radius:18px 18px 0 0; }
  .chat-foot input{ font-size:16px; }
  .built-by{ left:auto; right:12px; bottom:14px; }
}
