/* Asistente virtual (asistente.js) */
.as[hidden] { display: none; }
.as { --as-c: #fb8500; --as-c2: #ffb703; font-family: "Montserrat", system-ui, sans-serif; }
.as[data-tipo="docente"] { --as-c: #2563eb; --as-c2: #4f8cff; }
.as-boton {
  position: fixed; right: 18px; bottom: 18px; z-index: 900; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px; border: 0; border-radius: 999px; background: linear-gradient(180deg, var(--as-c2), var(--as-c));
  color: #fff; font: 800 .92rem "Montserrat", sans-serif; cursor: pointer; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .55);
  transition: transform .15s;
}
.as:not([data-tipo="docente"]) .as-boton { color: #1c1300; }
.as-boton:hover { transform: translateY(-2px); }
.as-boton:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.as-boton-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-size: 1.05rem; }
.as.is-abierto .as-boton { display: none; }
.as-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 901; width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100dvh - 36px));
  display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: #fffdf7; color: #1c2433;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6); animation: as-entra .25s ease;
}
.as-panel[hidden] { display: none; }
@keyframes as-entra { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.as-cab { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: linear-gradient(135deg, #1d2b53, #34508f); color: #fff; }
.as-cab b { display: block; font-size: .95rem; }
.as-cab small { opacity: .8; font-size: .74rem; }
.as-cab > div { flex: 1; min-width: 0; }
.as-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #ffd166; font-size: 1.2rem; }
.as-cerrar { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; }
.as-lista { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: #f6f2e7; }
.as-msg { max-width: 88%; padding: 9px 12px; border-radius: 16px; font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere; }
.as-bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.as-yo { align-self: flex-end; background: var(--as-c); color: #fff; border-bottom-right-radius: 4px; }
.as:not([data-tipo="docente"]) .as-yo { color: #1c1300; }
.as-item { display: block; position: relative; padding-left: 14px; margin: 2px 0; }
.as-item::before { content: "•"; position: absolute; left: 2px; color: var(--as-c); font-weight: 800; }
.as-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.as-accion { padding: 6px 11px; border: 1.5px solid var(--as-c); border-radius: 999px; background: #fff; color: #1c2433; font: 700 .78rem "Montserrat", sans-serif; cursor: pointer; }
.as-accion:hover { background: #fff4e0; }
.as-sop { background: var(--as-c); color: #fff; }
.as:not([data-tipo="docente"]) .as-sop { color: #1c1300; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 2px; }
.as-chip { padding: 6px 11px; border: 0; border-radius: 999px; background: #e9e2cf; color: #1c2433; font: 700 .76rem "Montserrat", sans-serif; cursor: pointer; }
.as-chip:hover { background: #ddd3b8; }
.as-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee7d6; background: #fffdf7; }
.as-input { flex: 1; min-width: 0; padding: 10px 14px; border: 0; border-radius: 999px; background: #f1eee4; font: 500 .9rem "Montserrat", sans-serif; color: #1c2433; }
.as-input:focus { outline: 2px solid var(--as-c); background: #fff; }
.as-enviar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--as-c); color: #fff; font-size: 1rem; cursor: pointer; }
.as-soporte { display: flex; flex-direction: column; gap: 6px; width: 88%; }
.as-soporte textarea { width: 100%; padding: 8px 10px; border: 1px solid #e2dccb; border-radius: 10px; font: 500 .84rem "Montserrat", sans-serif; resize: vertical; }
.as-soporte small { color: #6b7385; font-size: .72rem; }
.as-error { color: #d43a3a; font-weight: 700; font-size: .78rem; }
.as-escribe { display: inline-flex; gap: 4px; padding: 4px 0; }
.as-escribe i { width: 7px; height: 7px; border-radius: 50%; background: #b9b2a0; animation: as-punto 1s infinite; }
.as-escribe i:nth-child(2) { animation-delay: .15s; }
.as-escribe i:nth-child(3) { animation-delay: .3s; }
@keyframes as-punto { 50% { opacity: .3; transform: translateY(-3px); } }
@media (max-width: 640px) {
  .as-boton-txt { display: none; }
  .as-boton { padding: 10px; }
  .as-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .as-panel, .as-escribe i { animation: none; } }
