/* Asistente flotante (wwwroot/js/asistente.js). Usa los tokens de color de site.css. */
.asis { position: fixed; right: 18px; bottom: 18px; z-index: 70; font-family: var(--f-texto); }
.con-asistente .cn-wa { bottom: 86px; width: 50px; height: 50px; right: 21px; }
.con-asistente .cn-wa svg { width: 26px; height: 26px; }

.asis-fab {
    display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 999px;
    background: var(--lago); color: #fff; font: 600 .95rem/1 var(--f-texto); cursor: pointer;
    box-shadow: 0 10px 26px rgba(11, 79, 108, .32); transition: transform .15s, background .15s;
}
.asis-fab:hover { background: var(--lago-2, #13658a); transform: translateY(-1px); }
.asis-fab:focus-visible { outline: 3px solid var(--rio-claro); outline-offset: 3px; }
.asis-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.asis.is-abierto .asis-fab { display: none; }

.asis-panel {
    position: absolute; right: 0; bottom: 0; width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100vh - 36px));
    display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(11, 40, 52, .28); border: 1px solid var(--borde);
}
.asis-panel[hidden] { display: none; }
@supports (height: 100dvh) { .asis-panel { height: min(600px, calc(100dvh - 36px)); } }

.asis-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: var(--lago); color: #fff; }
.asis-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.asis-avatar svg { width: 26px; height: 20px; }
.asis-head-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.asis-titulo { font-family: var(--f-titulo); font-size: 1.1rem; }
.asis-sub { font-size: .72rem; opacity: .85; }
.asis-langs { display: flex; gap: 2px; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 3px; }
.asis-langs button { border: 0; background: transparent; color: #fff; font: 600 .7rem/1 var(--f-texto); padding: 6px 8px; border-radius: 999px; cursor: pointer; opacity: .75; }
.asis-langs button.is-activo { background: #fff; color: var(--lago); opacity: 1; }
.asis-cerrar { border: 0; background: transparent; color: #fff; font-size: 1.7rem; line-height: 1; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.asis-cerrar:hover { background: rgba(255, 255, 255, .14); }

.asis-msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--espuma); display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.asis-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.5; color: var(--texto); overflow-wrap: anywhere; }
.asis-bot { background: #fff; border: 1px solid var(--borde); border-bottom-left-radius: 6px; align-self: flex-start; }
.asis-yo { background: var(--rio); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.asis-msg a { color: var(--rio); font-weight: 600; }
.asis-yo a { color: #fff; }
.asis-lista { margin: 6px 0; padding-left: 18px; }
.asis-lista li { margin: 4px 0; }
.asis-btn { display: inline-block; margin-top: 4px; padding: 5px 12px; border-radius: 999px; background: var(--lago); color: #fff !important; text-decoration: none; font-size: .8rem; }
.asis-btn:hover { background: var(--rio); }
.asis-mas { font-size: .82rem; }
.asis-escribiendo { display: flex; gap: 4px; padding: 13px 14px; }
.asis-escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .35; animation: asis-punto 1s infinite; }
.asis-escribiendo i:nth-child(2) { animation-delay: .15s; }
.asis-escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes asis-punto { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-3px); } }

.asis-chips { display: flex; gap: 6px; padding: 8px 12px; background: var(--espuma); overflow-x: auto; scrollbar-width: thin; }
.asis-chips:empty { display: none; }
.asis-chip { flex: 0 0 auto; border: 1px solid var(--borde); background: #fff; color: var(--lago); border-radius: 999px; padding: 7px 12px; font: 600 .78rem/1 var(--f-texto); cursor: pointer; white-space: nowrap; }
.asis-chip:hover { border-color: var(--rio); color: var(--rio); }

.asis-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--borde); background: #fff; }
.asis-form input { flex: 1; min-width: 0; border: 1px solid var(--borde); border-radius: 999px; padding: 11px 16px; font: 400 .9rem var(--f-texto); color: var(--texto); background: #fff; }
.asis-form input:focus { outline: 2px solid var(--rio-claro); outline-offset: 1px; border-color: var(--rio); }
.asis-form button { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--rio); color: #fff; cursor: pointer; display: grid; place-items: center; }
.asis-form button:hover { background: var(--lago); }
.asis-form button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 520px) {
    .asis { right: 12px; bottom: 12px; }
    .asis-fab { width: 56px; height: 56px; padding: 0; justify-content: center; }
    .asis-fab-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .asis-fab svg { width: 26px; height: 26px; }
    .asis.is-abierto { left: 0; right: 0; bottom: 0; }
    .asis-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: min(88vh, 640px); border-radius: 20px 20px 0 0; }
    @supports (height: 100dvh) { .asis-panel { height: min(88dvh, 640px); } }
    .con-asistente .cn-wa { bottom: 76px; right: 14px; }
}
@media (prefers-reduced-motion: reduce) { .asis-fab, .asis-escribiendo i { transition: none; animation: none; } }
@media print { .asis { display: none; } }
