/* Asistente virtual flotante de Sistemas Inteligentes */
.si-chatbot, .si-chatbot * { box-sizing: border-box; }
.si-chatbot { --si-chat-bg:#071321; --si-chat-panel:#0c1c2c; --si-chat-panel-2:#10243a; --si-chat-border:#294b68; --si-chat-text:#edf7ff; --si-chat-muted:#9eb4c9; --si-chat-cyan:#45d6ff; --si-chat-blue:#087de7; --si-chat-shadow:0 24px 70px rgba(0,0,0,.48); color:var(--si-chat-text); font-family:'DM Sans',Arial,sans-serif; }
.si-chat-launcher { position:fixed; z-index:80; right:22px; bottom:94px; width:62px; height:62px; border:1px solid rgba(113,222,255,.55); border-radius:19px; color:#fff; background:linear-gradient(145deg,#087de7,#12b9e8); box-shadow:0 12px 34px rgba(0,125,231,.34); display:grid; place-items:center; cursor:pointer; transition:transform .2s ease,box-shadow .2s ease; }
.si-chat-launcher:hover { transform:translateY(-3px); box-shadow:0 17px 38px rgba(0,125,231,.46); }
.si-chat-launcher:focus-visible,.si-chatbot button:focus-visible,.si-chatbot a:focus-visible,.si-chatbot input:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.si-chat-launcher svg { width:27px; height:27px; }
.si-chat-launcher-label { position:absolute; right:72px; white-space:nowrap; border:1px solid var(--si-chat-border); border-radius:8px; background:#0c2033; color:#dceeff; font-size:11px; font-weight:700; padding:8px 10px; box-shadow:0 8px 22px #0005; }
.si-chat-panel { position:fixed; z-index:81; right:22px; bottom:169px; width:min(390px,calc(100vw - 32px)); height:min(590px,calc(100dvh - 205px)); min-height:370px; display:flex; flex-direction:column; overflow:hidden; border:1px solid rgba(84,173,222,.45); border-radius:19px; background:var(--si-chat-panel); box-shadow:var(--si-chat-shadow); opacity:1; transform:translateY(0) scale(1); transform-origin:bottom right; transition:opacity .2s ease,transform .2s ease; }
.si-chat-panel[hidden] { display:none; }
.si-chat-panel:not([hidden]) { animation:siChatPanelIn .22s ease both; }
@keyframes siChatPanelIn { from { opacity:0; transform:translateY(12px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
.si-chat-head { flex:0 0 auto; min-height:76px; padding:14px 15px; display:flex; align-items:center; gap:11px; background:linear-gradient(120deg,#102e49,#0b1b2c); border-bottom:1px solid var(--si-chat-border); }
.si-chat-avatar { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:13px; color:#fff; font:800 14px 'Manrope',Arial,sans-serif; background:linear-gradient(140deg,#087de7,#19b9e7); box-shadow:0 5px 18px #087de744; }
.si-chat-title { min-width:0; flex:1; }
.si-chat-title strong { display:block; font:800 13px 'Manrope',Arial,sans-serif; color:#f4faff; }
.si-chat-status { display:flex; align-items:center; gap:6px; margin-top:4px; color:#a7c0d6; font-size:10px; }
.si-chat-status:before { content:''; width:7px; height:7px; border-radius:50%; background:#45dda0; box-shadow:0 0 9px #45dda0; }
.si-chat-head-actions { display:flex; gap:5px; }
.si-chat-icon-btn { width:33px; height:33px; display:grid; place-items:center; border:1px solid transparent; border-radius:8px; color:#b7cce0; background:transparent; font-size:17px; cursor:pointer; }
.si-chat-icon-btn:hover { border-color:#365a77; background:#ffffff0a; color:#fff; }
.si-chat-messages { flex:1 1 auto; min-height:0; overflow-y:auto; padding:16px 13px 13px; display:flex; flex-direction:column; gap:12px; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#31536f transparent; }
.si-chat-message { max-width:88%; display:flex; flex-direction:column; gap:5px; animation:siChatIn .18s ease both; }
.si-chat-message.bot { align-self:flex-start; }
.si-chat-message.user { align-self:flex-end; }
.si-chat-bubble { white-space:pre-wrap; overflow-wrap:anywhere; padding:11px 13px; border:1px solid #294761; border-radius:13px 13px 13px 4px; background:#122b43; color:#e6f3ff; font-size:14px; line-height:1.65; }
.si-chat-message.user .si-chat-bubble { border-color:#0b84df; border-radius:13px 13px 4px 13px; background:linear-gradient(140deg,#087de7,#0965ba); color:#fff; }
.si-chat-time { padding:0 4px; color:#7792aa; font-size:10px; }
.si-chat-message.user .si-chat-time { text-align:right; }
.si-chat-actions,.si-chat-suggestions { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.si-chat-action,.si-chat-suggestion { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:31px; padding:7px 10px; border:1px solid #2875a2; border-radius:8px; color:#a9e7ff; background:#0c2940; font:700 12px 'DM Sans',Arial,sans-serif; text-decoration:none; cursor:pointer; transition:background .15s ease,border-color .15s ease; }
.si-chat-action:hover,.si-chat-suggestion:hover { border-color:#54dafa; background:#123b59; color:#fff; }
.si-chat-suggestion { border-color:#34536d; color:#c5d8e9; background:#10263b; }
.si-chat-typing { align-self:flex-start; display:flex; align-items:center; gap:4px; padding:12px 14px; border:1px solid #294761; border-radius:12px 12px 12px 4px; background:#122b43; }
.si-chat-typing span { width:6px; height:6px; border-radius:50%; background:#6fcff0; animation:siChatBounce 1s infinite ease-in-out; }
.si-chat-typing span:nth-child(2) { animation-delay:.14s; }.si-chat-typing span:nth-child(3) { animation-delay:.28s; }
.si-chat-footer { flex:0 0 auto; padding:11px 12px 10px; border-top:1px solid var(--si-chat-border); background:#091827; }
.si-chat-form { display:flex; gap:8px; align-items:center; padding:5px 5px 5px 12px; border:1px solid #31536d; border-radius:11px; background:#0d2032; }
.si-chat-form:focus-within { border-color:#33bce9; box-shadow:0 0 0 2px #33bce91b; }
.si-chat-input { width:100%; min-width:0; height:35px; border:0 !important; outline:0 !important; color:#f0f8ff !important; background:transparent !important; box-shadow:none !important; padding:0 !important; font:14px 'DM Sans',Arial,sans-serif !important; }
.si-chat-input::placeholder { color:#829bb2; }
.si-chat-send { width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center; border:0; border-radius:9px; color:#fff; background:linear-gradient(135deg,#087de7,#13aee0); cursor:pointer; }
.si-chat-send:disabled { opacity:.5; cursor:not-allowed; }
.si-chat-send svg { width:17px; height:17px; }
.si-chat-legal { margin:8px 2px 0; color:#6f879d; font-size:10px; line-height:1.55; }
.si-chat-legal a { color:#83c9e8; text-decoration:underline; }
.si-chat-error { color:#ffb5b5; font-size:10px; margin:6px 2px 0; }
@keyframes siChatIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
@keyframes siChatBounce { 0%,60%,100% { transform:translateY(0); opacity:.55; } 30% { transform:translateY(-4px); opacity:1; } }
@media(max-width:600px) {
 .si-chat-launcher { right:16px; bottom:90px; width:58px; height:58px; border-radius:17px; }
 .si-chat-launcher-label { display:none; }
 .si-chat-panel { right:10px; bottom:158px; width:calc(100vw - 20px); height:min(590px,calc(100dvh - 178px)); min-height:330px; border-radius:16px; }
 .si-chat-action,.si-chat-suggestion { font-size:12px; min-height:36px; }
 .si-chat-messages { padding:13px 11px; }
 .si-chat-bubble { font-size:14px; }
}
@media(prefers-reduced-motion:reduce) { .si-chat-launcher,.si-chat-panel,.si-chat-message { transition:none; animation:none; } .si-chat-typing span { animation:none; } }

/* V2.8: legibilidad, acciones rápidas y estados de envío mejorados. */
.si-chat-launcher { animation:siChatPulse 3.8s ease-in-out infinite; }
.si-chat-launcher:focus-visible { outline-color:#70e5ff; }
.si-chat-panel { width:min(420px,calc(100vw - 32px)); height:min(640px,calc(100dvh - 205px)); border-color:#34749d; }
.si-chat-head { min-height:82px; }
.si-chat-title strong { font-size:14px; }
.si-chat-status { font-size:11px; }
.si-chat-messages { padding:18px 15px 15px; gap:14px; }
.si-chat-message { max-width:91%; }
.si-chat-bubble { font-size:13px; line-height:1.72; padding:12px 14px; }
.si-chat-time { font-size:10px; }
.si-chat-actions,.si-chat-suggestions { gap:7px; }
.si-chat-action,.si-chat-suggestion { min-height:35px; padding:8px 11px; font-size:11px; }
.si-chat-suggestions { padding-top:2px; }
.si-chat-input { font-size:13px !important; }
.si-chat-legal { font-size:10px; }
.si-chat-error { font-size:11px; }
.si-chat-whatsapp { color:#5ce5a5; font-size:18px; text-decoration:none; }
.si-chat-whatsapp:hover { color:#fff; }
@keyframes siChatPulse { 0%,82%,100% { box-shadow:0 12px 34px rgba(0,125,231,.34),0 0 0 0 rgba(69,214,255,0); } 90% { box-shadow:0 12px 34px rgba(0,125,231,.4),0 0 0 9px rgba(69,214,255,.11); } }
@media(max-width:600px) {
 .si-chat-panel { right:8px; bottom:156px; width:calc(100vw - 16px); height:min(650px,calc(100dvh - 174px)); }
 .si-chat-bubble { font-size:13.5px; }
}
@media(prefers-reduced-motion:reduce) { .si-chat-launcher { animation:none; } }
