/* Redes Technology — AI site assistant widget (floating launcher + chat panel).
   Shares the site's color tokens (see style.css :root) so it looks native,
   not bolted on. Self-contained: only these two rules-blocks + chat-widget.js
   are needed on any page. */

#rt-chat-launcher{
  position:fixed;right:22px;bottom:22px;z-index:2000;
  width:60px;height:60px;border-radius:50%;
  background:linear-gradient(135deg,var(--blue-500),var(--cyan-400));
  box-shadow:0 12px 30px rgba(47,125,250,.45);
  border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:transform .2s ease,box-shadow .2s ease;
}
#rt-chat-launcher:hover{transform:translateY(-3px) scale(1.04);box-shadow:0 18px 38px rgba(47,125,250,.55);}
#rt-chat-launcher svg{width:26px;height:26px;color:#fff;}
#rt-chat-launcher .rt-chat-dot{
  position:absolute;top:-2px;right:-2px;width:14px;height:14px;border-radius:50%;
  background:var(--red-500);border:2px solid var(--navy-950);
}

#rt-chat-bubble{
  position:fixed;right:92px;bottom:34px;z-index:2000;
  max-width:220px;background:#fff;color:var(--ink-900);
  padding:12px 14px;border-radius:14px 14px 4px 14px;
  font-size:14px;font-weight:600;line-height:1.35;
  box-shadow:var(--shadow-lg);
  animation:rtChatPop .35s ease;
}
#rt-chat-bubble button{
  position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;
  background:var(--navy-900);color:#fff;border:none;cursor:pointer;font-size:12px;
  display:flex;align-items:center;justify-content:center;line-height:1;
}
@keyframes rtChatPop{from{opacity:0;transform:translateY(8px) scale(.96);}to{opacity:1;transform:translateY(0) scale(1);}}

#rt-chat-panel{
  position:fixed;right:22px;bottom:94px;z-index:2000;
  width:340px;max-width:calc(100vw - 32px);
  height:480px;max-height:calc(100vh - 140px);
  background:var(--navy-950);
  border-radius:18px;box-shadow:var(--shadow-lg);
  display:none;flex-direction:column;overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
}
#rt-chat-panel.open{display:flex;animation:rtChatPop .25s ease;}

#rt-chat-header{
  background:linear-gradient(135deg,var(--navy-900),var(--navy-800));
  padding:14px 16px;display:flex;align-items:center;gap:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
#rt-chat-header img{width:28px;height:28px;border-radius:8px;}
#rt-chat-header .rt-chat-title{color:#fff;font-weight:700;font-size:14.5px;line-height:1.2;}
#rt-chat-header .rt-chat-sub{color:#9fb3d9;font-size:11.5px;display:flex;align-items:center;gap:5px;}
#rt-chat-header .rt-chat-sub::before{content:"";width:7px;height:7px;border-radius:50%;background:#22c55e;display:inline-block;}
#rt-chat-close{margin-left:auto;background:none;border:none;color:#9fb3d9;cursor:pointer;font-size:18px;line-height:1;padding:4px;}
#rt-chat-close:hover{color:#fff;}

#rt-chat-messages{
  flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;
}
.rt-msg{max-width:85%;padding:10px 13px;border-radius:14px;font-size:14px;line-height:1.45;white-space:pre-wrap;}
.rt-msg.assistant{background:rgba(255,255,255,.08);color:#e6ecfa;align-self:flex-start;border-bottom-left-radius:4px;}
.rt-msg.user{background:linear-gradient(135deg,var(--blue-500),var(--cyan-400));color:#fff;align-self:flex-end;border-bottom-right-radius:4px;}
.rt-msg.system-note{align-self:center;color:#9fb3d9;font-size:12px;background:none;padding:2px 8px;}

#rt-chat-typing{align-self:flex-start;display:flex;gap:4px;padding:10px 13px;}
#rt-chat-typing span{width:6px;height:6px;border-radius:50%;background:#9fb3d9;animation:rtTypingBounce 1.2s infinite ease-in-out;}
#rt-chat-typing span:nth-child(2){animation-delay:.15s;}
#rt-chat-typing span:nth-child(3){animation-delay:.3s;}
@keyframes rtTypingBounce{0%,60%,100%{transform:translateY(0);opacity:.5;}30%{transform:translateY(-4px);opacity:1;}}

#rt-chat-form{
  display:flex;gap:8px;padding:12px;border-top:1px solid rgba(255,255,255,.08);
  background:var(--navy-950);
}
#rt-chat-input{
  flex:1;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);
  border-radius:10px;padding:10px 12px;color:#fff;font-size:14px;font-family:inherit;
  resize:none;max-height:70px;
}
#rt-chat-input:focus{outline:none;border-color:var(--blue-500);}
#rt-chat-input::placeholder{color:#7c8bab;}
#rt-chat-send{
  background:linear-gradient(135deg,var(--blue-500),var(--cyan-400));border:none;border-radius:10px;
  width:42px;height:42px;flex-shrink:0;cursor:pointer;display:flex;align-items:center;justify-content:center;
}
#rt-chat-send:disabled{opacity:.5;cursor:default;}
#rt-chat-send svg{width:18px;height:18px;color:#fff;}

@media(max-width:480px){
  #rt-chat-panel{right:12px;left:12px;width:auto;bottom:86px;}
  #rt-chat-launcher{right:16px;bottom:16px;}
  #rt-chat-bubble{right:16px;bottom:88px;max-width:calc(100vw - 100px);}
}
