/* Asistente de preguntas frecuentes — Docentes IA */
.asistente-boton {
  position: fixed; right: 20px; bottom: 20px; z-index: 1500;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border: 0; border-radius: 6px;
  background: var(--tinta); color: var(--blanco);
  font-family: var(--sans); font-weight: 700; font-size: 1.02rem; line-height: 1.2;
  cursor: pointer; box-shadow: 0 0 0 2px var(--papel), 0 6px 18px rgba(28, 43, 74, 0.3);
  transition: background 0.2s ease, transform 0.2s ease;
}
.asistente-boton:hover { background: var(--azul); }
.asistente-boton svg { width: 20px; height: 20px; flex: none; }
.asistente-boton[aria-expanded="true"] { display: none; }

.asistente-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1500;
  width: min(390px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 40px));
  display: none; flex-direction: column;
  background: var(--papel); color: var(--texto);
  border: 2px solid var(--tinta); border-radius: 8px;
  box-shadow: 0 0 0 2px var(--papel), 0 14px 40px rgba(28, 43, 74, 0.3); overflow: hidden;
}
.asistente-panel.abierto { display: flex; }

.asistente-cabecera {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px; background: var(--tinta); color: var(--blanco);
}
.asistente-cabecera h2 { font-size: 1.35rem; color: var(--blanco); letter-spacing: 0; }
.asistente-cabecera p { margin-top: 4px; font-size: 0.92rem; line-height: 1.35; opacity: 0.88; }
.asistente-cerrar {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 6px;
  background: transparent; color: var(--blanco); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.asistente-cerrar:hover { background: rgba(255,255,255,0.14); }

.asistente-cuerpo { padding: 16px 18px 6px; overflow-y: auto; flex: 1; }
.asistente-cuerpo:focus { outline: none; }
.asistente-lista { list-style: none; display: grid; gap: 8px; }
.asistente-pregunta {
  width: 100%; text-align: left; padding: 11px 14px;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 6px;
  font-family: var(--sans); font-size: 1rem; line-height: 1.3; color: var(--tinta); font-weight: 500; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.asistente-pregunta:hover { border-color: var(--lapiz); background: var(--papel2); }

.asistente-titulo-resp { font-family: var(--serif); font-weight: 800; font-size: 1.2rem; line-height: 1.2; color: var(--tinta); margin-bottom: 10px; }
.asistente-resp p { font-size: 1rem; line-height: 1.5; margin-bottom: 10px; }
.asistente-resp a { color: var(--lapiz-texto); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

.asistente-pie { padding: 12px 18px 16px; display: grid; gap: 10px; border-top: 1px solid var(--linea); background: var(--papel); }
.asistente-pie .boton { text-align: center; padding: 12px 18px; font-size: 1rem; }
.asistente-volver {
  border: 0; background: transparent; color: var(--azul); font-family: var(--sans);
  font-weight: 700; font-size: 1rem; cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px;
}
.asistente-boton:focus-visible, .asistente-panel button:focus-visible, .asistente-panel a:focus-visible {
  outline: 3px solid var(--marca); outline-offset: 2px;
}

@media (max-width: 520px) {
  .asistente-boton { right: 14px; bottom: 14px; width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .asistente-boton span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .asistente-boton svg { width: 24px; height: 24px; }
  .asistente-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}
@media print { .asistente-boton, .asistente-panel { display: none !important; } }
