/* Empresa bajo presión · estilos comunes (juego, panel e instalador) */
:root {
  --azul: #0b3d91;
  --azul-oscuro: #0a2540;
  --azul-claro: #e8f0fc;
  --texto: #1b2533;
  --gris: #5b6675;
  --borde: #dfe5ee;
  --fondo: #f3f6fa;
  --blanco: #ffffff;
  --rojo: #d64545;
  --naranja: #e8913a;
  --verde: #2e9d5b;
  --sombra: 0 2px 10px rgba(16, 38, 70, 0.08);
  --radio: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--texto); background: var(--fondo); font-size: 15px; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.15rem; margin-top: 1.4em; }
a { color: var(--azul); }
.oculto { display: none !important; }
.sub { color: var(--gris); margin-top: -.3em; }
.pequeno { font-size: .85em; color: var(--gris); }

/* Botones y formularios */
.boton { display: inline-block; background: var(--azul); color: #fff; border: 0; border-radius: 8px; padding: .6em 1.1em; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.boton:hover { filter: brightness(1.1); }
.boton:disabled { opacity: .5; cursor: default; }
.boton.secundario { background: var(--blanco); color: var(--azul); border: 1px solid var(--azul); }
.boton.peligro { background: var(--rojo); }
.boton.mini { padding: .3em .7em; font-size: .85em; }
.boton.grande { font-size: 1.1rem; padding: .9em 1.4em; width: 100%; }
.formulario label, .campo { display: block; margin-bottom: .8em; font-weight: 600; font-size: .9em; }
.formulario input, .formulario select, .formulario textarea, .campo input, .campo select, .campo textarea, .buscador {
  display: block; width: 100%; margin-top: .3em; padding: .55em .7em; border: 1px solid var(--borde); border-radius: 7px; font: inherit; font-weight: normal; background: #fff;
}
.formulario textarea, .campo textarea { min-height: 80px; resize: vertical; }
.campo .error-campo { color: var(--rojo); font-weight: normal; font-size: .85em; }
.acciones { display: flex; gap: .6em; flex-wrap: wrap; margin-top: 1em; }

/* Editor de texto */
.editor { border: 1px solid var(--borde); border-radius: 7px; margin-top: .3em; background: #fff; font-weight: normal; }
.editor-barra { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--borde); background: #f8fafc; border-radius: 7px 7px 0 0; }
.editor-barra button { border: 1px solid var(--borde); background: #fff; border-radius: 5px; padding: .25em .6em; font: inherit; font-size: .85em; cursor: pointer; }
.editor-barra button:hover { background: var(--azul-claro); }
.editor-area { min-height: 260px; padding: .8em 1em; outline: none; line-height: 1.5; }
.texto-legal { max-height: 55vh; overflow: auto; line-height: 1.5; }
.casilla { display: flex !important; gap: .6em; align-items: flex-start; font-weight: normal !important; }
.casilla input { width: auto !important; margin-top: .25em !important; }
.casilla.oculto { display: none !important; }

/* Avisos */
.aviso { padding: .7em 1em; border-radius: 8px; margin: .6em 0; }
.aviso.ok { background: #e5f5ec; color: #1d6b3d; }
.aviso.error { background: #fdeaea; color: #9b2c2c; }
.aviso.info { background: var(--azul-claro); color: var(--azul-oscuro); }

/* Páginas sencillas (login, instalador, pruebas) */
.pagina-simple { display: flex; justify-content: center; padding: 40px 16px; }
.tarjeta { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra); padding: 28px; width: 100%; max-width: 420px; }
.tarjeta.ancha { max-width: 900px; }
.checks { list-style: none; padding: 0; }
.checks li { padding: .25em 0; }
.checks .si, tr.si td:first-child { color: var(--verde); font-weight: 700; }
.checks .no, tr.no td:first-child { color: var(--rojo); font-weight: 700; }
tr.no { background: #fff4f4; }
.pestanas { display: flex; gap: .5em; margin-bottom: 1em; }
.pestanas button { flex: 1; background: none; border: 0; border-bottom: 3px solid var(--borde); padding: .6em; font: inherit; font-weight: 600; cursor: pointer; color: var(--gris); }
.pestanas button.activa { border-color: var(--azul); color: var(--azul); }
.marca { display: flex; align-items: center; gap: .6em; margin-bottom: 1em; }
.marca .logo { width: 42px; height: 42px; border-radius: 9px; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; background: #fff; }
.tabla th, .tabla td { padding: .55em .6em; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
.tabla th { font-size: .8em; text-transform: uppercase; letter-spacing: .03em; color: var(--gris); background: #f8fafc; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover { background: var(--azul-claro); }
.envoltura-tabla { overflow-x: auto; border: 1px solid var(--borde); border-radius: var(--radio); }

/* Estructura con menú lateral (panel y juego) */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.lateral { background: var(--azul-oscuro); color: #cfd9e8; padding: 18px 0; }
.lateral .titulo { color: #fff; font-weight: 800; padding: 0 18px 16px; font-size: 1.05rem; }
.lateral .titulo small { display: block; font-weight: 400; color: #9fb2cc; font-size: .78rem; }
.lateral button { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: .7em 18px; font: inherit; cursor: pointer; }
.lateral button:hover, .lateral button.activa { background: rgba(255,255,255,.08); color: #fff; border-left: 3px solid #5aa0ff; }
.contenido { padding: 22px; min-width: 0; }
.cabecera-seccion { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; margin-bottom: 1em; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px 16px; }
.kpi .etq { font-size: .78em; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 1.4rem; font-weight: 700; margin-top: 4px; }
.kpi .val.neg { color: var(--rojo); }
.kpi .val.pos { color: var(--verde); }

/* Juego */
.barra-superior { background: var(--azul-oscuro); color: #fff; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.barra-superior .nombre { font-weight: 800; letter-spacing: .02em; }
.barra-superior .nombre small { display: block; font-weight: 400; color: #9fb2cc; font-size: .78rem; }
.rejilla-juego { display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
.panel { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px; margin-bottom: 18px; }
.escena { position: relative; border-radius: var(--radio); background: linear-gradient(160deg, #dfeaf8, #f7fbff); margin-bottom: 18px; overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--sombra); }
.escena img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.escena .leyenda-escena { position: absolute; left: 10px; bottom: 8px; background: rgba(255,255,255,.85); border-radius: 6px; padding: 2px 8px; }
.marca-zona { position: absolute; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.94); border: 2px solid #8a94a3; border-radius: 999px; padding: 3px 8px 3px 10px; font: inherit; font-size: .8em; font-weight: 700; color: var(--texto); cursor: pointer; box-shadow: 0 2px 6px rgba(16,38,70,.25); white-space: nowrap; }
.marca-zona::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: inherit; }
.marca-zona.tranquila { opacity: .8; font-weight: 600; }
.marca-zona.verde { border-color: #2e9d5b; } .marca-zona.amarillo { border-color: #d49a00; } .marca-zona.rojo { border-color: #d64545; }
.marca-zona:hover, .marca-zona:focus-visible { transform: translate(-50%, -100%) scale(1.06); outline: none; }
.marca-zona .cuenta { border-radius: 999px; padding: 0 6px; font-size: .95em; }
.cuenta.verde { background: #dcf3e3; color: #17663a; } .cuenta.amarillo { background: #fff3bf; color: #7a5c00; } .cuenta.rojo { background: #fde0e0; color: #b42323; }
.cuenta.oportunidad { background: #e8f0fc; color: var(--azul); }
.marca-zona.latido { animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 0%, 100% { box-shadow: 0 2px 6px rgba(16,38,70,.25), 0 0 0 0 rgba(214,69,69,.5); } 50% { box-shadow: 0 2px 6px rgba(16,38,70,.25), 0 0 0 8px rgba(214,69,69,0); } }
@media (prefers-reduced-motion: reduce) { .marca-zona.latido { animation: none; } }
@media (max-width: 560px) { .marca-zona .nombre-zona { display: none; } }
.chip { display: inline-block; padding: .15em .55em; border-radius: 6px; font-weight: 700; font-size: .85em; }
.chip.alto { background: #fde3e3; color: #b42323; }
.chip.medio { background: #fdf0de; color: #a55d0c; }
.chip.bajo { background: #e1f4e8; color: #1d6b3d; }
/* Semáforo de significancia (probabilidad × impacto) */
.chip.verde { background: #dcf3e3; color: #17663a; }
.chip.amarillo { background: #fff3bf; color: #7a5c00; }
.chip.rojo { background: #fde0e0; color: #b42323; }
.lista-sucesos { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.lista-sucesos li { padding: .5em 0; border-bottom: 1px solid var(--borde); font-size: .9em; }
.lista-sucesos .imp { float: right; font-weight: 700; }
.acordeon details { border: 1px solid var(--borde); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.acordeon summary { padding: .7em .9em; cursor: pointer; display: flex; gap: .6em; align-items: center; }
.acordeon summary .nom { flex: 1; font-weight: 600; }
.acordeon .cuerpo { padding: 0 1em 1em; }
.tratamiento { border-left: 3px solid var(--azul); padding: .4em .8em; margin: .5em 0; background: #f8fafc; }

/* Ventana emergente */
.modal-fondo { position: fixed; inset: 0; background: rgba(10, 37, 64, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal h2 { margin-top: 0; }
.modal .cabecera-riesgo { border-left: 5px solid var(--rojo); padding-left: 12px; }
.modal .cabecera-oportunidad { border-left: 5px solid var(--verde); padding-left: 12px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { display: flex; overflow-x: auto; padding: 0; }
  .lateral .titulo { display: none; }
  .lateral button { white-space: nowrap; width: auto; }
  .rejilla-juego { grid-template-columns: 1fr; }
}

/* Tratamientos (v0.3) */
.chip.gris { background: #eceff3; color: #5b6676; }
.tratado { color: var(--verde); margin-top: .2em; }
.acciones-ficha { display: flex; flex-wrap: wrap; align-items: center; gap: .5em 1em; margin-top: .4em; }
.tabla.costes th { width: 45%; font-weight: 600; color: var(--gris); }
.tabla.costes td { font-weight: 600; }
.cuota { display: flex; gap: .7em; align-items: flex-start; padding: .6em 0; border-bottom: 1px solid var(--borde); cursor: pointer; }
.cuota input { margin-top: .25em; width: 1.1em; height: 1.1em; }
.aviso-flotante { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--texto); color: #fff; padding: .7em 1.2em; border-radius: 8px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.sin-salto { white-space: nowrap; }
.estudio { border: 1px solid var(--borde); border-radius: var(--radio); padding: 4px 16px 12px; margin-top: 14px; background: #fbfcfe; }
.kpi .chip { margin-top: 4px; display: inline-block; }

/* v0.4.2 · Editor con formato, Aula de formación y certificados */
.editor-barra select.editor-sel { width: auto; padding: 3px 4px; font-size: .85em; }
.editor-barra .editor-color { display: inline-flex; align-items: center; gap: 4px; font-size: .8em; color: var(--gris); }
.editor-barra .editor-color input { width: 28px; height: 24px; padding: 0; border: 1px solid var(--borde); }
.leyenda-sig { margin-top: 8px; }
.temas-aula { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tema-aula { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--blanco); border: 1px solid var(--borde); border-left: 5px solid var(--azul); border-radius: var(--radio); padding: 14px 16px; box-shadow: var(--sombra); cursor: pointer; font: inherit; color: inherit; }
.tema-aula:hover { border-color: var(--azul); }
.texto-aula { line-height: 1.6; max-width: 820px; }
.texto-aula h2 { margin-top: 1.2em; }
.texto-aula blockquote, .editor-area blockquote { border-left: 4px solid var(--borde); margin: 1em 0; padding: 4px 14px; color: var(--gris); }
.certificado-ficha.obtenido { border-left: 5px solid var(--verde); }
.certificado-ficha ul { padding-left: 1.2em; }
.barra-progreso { height: 6px; background: var(--borde); border-radius: 3px; margin: 4px 0 8px; max-width: 360px; overflow: hidden; }
.barra-progreso > div { height: 100%; background: var(--azul); }
.modal .cabecera-certificado { border-left: 5px solid var(--azul); padding-left: 12px; }

/* v0.5 · Portada con presentación paginada */
.portada { display: flex; gap: 24px; align-items: flex-start; justify-content: center; width: 100%; max-width: 1120px; flex-wrap: wrap; }
.portada { max-width: 1064px; }
.portada .presentacion { max-width: 620px; flex: 1 1 420px; display: flex; flex-direction: column; min-height: 420px; }
.portada #acceso { flex: 0 1 420px; }
.presentacion-texto { flex: 1; line-height: 1.6; }
.presentacion-texto h2:first-child { margin-top: 0; }
.paginador { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--borde); padding-top: 14px; margin-top: 14px; }
.paginador button:disabled { opacity: .4; cursor: default; }

/* v0.5 · Gráficos (SVG). Serie 1 azul, serie 2 naranja (paleta validada para daltonismo) */
.rejilla-graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.rejilla-graficos .panel { margin: 0; }
.grafico { margin: 0; }
.grafico figcaption { font-weight: 700; margin-bottom: 6px; }
.grafico-leyenda { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85em; color: var(--gris); margin-bottom: 4px; }
.grafico-leyenda > span { display: inline-flex; align-items: center; gap: 6px; }
.muestra { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #2a78d6; }
.muestra.s2, .muestra.negativa { background: #eb6834; }
.grafico-lienzo { position: relative; }
.grafico-svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico-svg .rejilla { stroke: #e6eaf0; stroke-width: 1; }
.grafico-svg .eje-cero { stroke: #8a94a3; stroke-width: 1; }
.grafico-svg .eje-texto { font-size: 11px; fill: var(--gris); }
.grafico-svg .linea { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico-svg .s1 { stroke: #2a78d6; } .grafico-svg .s2 { stroke: #eb6834; }
.grafico-svg .punto { stroke: #fff; stroke-width: 2; } .grafico-svg .punto.s1 { fill: #2a78d6; } .grafico-svg .punto.s2 { fill: #eb6834; }
.grafico-svg .barra.positiva, .grafico-svg .barra.s1 { fill: #2a78d6; } .grafico-svg .barra.negativa, .grafico-svg .barra.s2 { fill: #eb6834; }
.muestra.positiva { background: #2a78d6; }
.grafico-svg .guia { stroke: #8a94a3; stroke-width: 1; stroke-dasharray: 3 3; }
.grafico-ventana { position: absolute; top: 4px; background: var(--blanco); border: 1px solid var(--borde); border-radius: 8px; box-shadow: var(--sombra); padding: 8px 10px; font-size: .85em; pointer-events: none; white-space: nowrap; }
.grafico-ventana div { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.logo-portada { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 14px; }
.cabecera-portada { flex: 1 1 100%; aspect-ratio: 2 / 1; max-height: 340px; border-radius: var(--radio); background: #f6efe4 center right / cover no-repeat; box-shadow: var(--sombra); display: flex; align-items: center; padding: 0 4%; }
.titulo-portada h1 { font-size: clamp(1.6rem, 4vw, 2.8rem); color: var(--azul-oscuro); margin: 0 0 .2em; }
.titulo-portada p { margin: 0; color: var(--gris); font-size: clamp(.95rem, 1.6vw, 1.2rem); }
@media (max-width: 560px) { .cabecera-portada { aspect-ratio: 16 / 9; align-items: flex-start; padding-top: 16px; } }
/* v0.7 · Panel avanzado */
.lateral .usuario-menu { padding: 0 18px 12px; color: #cfd9e8; }
.lateral .separador-menu { border-top: 1px solid rgba(255,255,255,.12); margin: 8px 18px; }
.lateral .contador { display: inline-block; margin-left: 8px; background: #f0b429; color: #3d2c00; border-radius: 10px; padding: 0 .55em; font-size: .8em; font-weight: 700; }
.marca-borrador { margin-right: 6px; font-size: .75em; }
.tabla.comparacion td.antes { color: var(--gris); text-decoration: line-through; }
.tabla.comparacion td.despues { font-weight: 600; }
.borrador h2 { font-size: 1.05rem; margin: 0; }
.rejilla-simulador { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.rejilla-simulador .acciones { grid-column: 1 / -1; }
.acciones-fila { white-space: nowrap; }
@media (max-width: 760px) { .lateral .usuario-menu, .lateral .separador-menu { display: none; } }
.campo-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 4px 0 10px; }
.campo-check input { width: auto; margin: 0; }
.modal.ancho { max-width: 980px; }
.nowrap { white-space: nowrap; }
.grafico-svg .s3 { stroke: #2e9e5b; } .grafico-svg .s4 { stroke: #8a4fd1; } .grafico-svg .s5 { stroke: #d1a21f; } .grafico-svg .s6 { stroke: #7a8494; }
.grafico-svg .punto.s3 { fill: #2e9e5b; } .grafico-svg .punto.s4 { fill: #8a4fd1; } .grafico-svg .punto.s5 { fill: #d1a21f; } .grafico-svg .punto.s6 { fill: #7a8494; }
.muestra.s3 { background: #2e9e5b; } .muestra.s4 { background: #8a4fd1; } .muestra.s5 { background: #d1a21f; } .muestra.s6 { background: #7a8494; }
.campo.en-linea { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.campo.en-linea select { width: auto; }
#panel-actividad .rejilla-graficos .panel { box-shadow: none; padding: 0; }

/* ---------------------------------------------------------------- Avatares (v1.1) */
/* En los mensajes: en la esquina superior derecha, con la actitud que toca */
.avatar-mensaje { float: right; width: 112px; height: 112px; object-fit: cover; border-radius: 50%; margin: -6px -6px 10px 14px; border: 3px solid #fff; box-shadow: 0 3px 12px rgba(0,0,0,.18); background: #eef2f7; }
.estudio .avatar-mensaje { width: 88px; height: 88px; margin-top: 0; }
.elegir-avatar { border: 0; padding: 0; margin: 0; }
.elegir-avatar legend { padding: 0; margin-bottom: 6px; }
.avatares { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opcion-avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 2px solid transparent; border-radius: 12px; cursor: pointer; text-align: center; font-size: 12px; line-height: 1.2; }
.opcion-avatar input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-avatar img { width: 100%; max-width: 96px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: #eef2f7; }
.opcion-avatar:hover { background: #f3f6fa; }
.opcion-avatar:has(input:checked) { border-color: var(--azul, #0b3d91); background: #eef3fb; }
.opcion-avatar:has(input:focus-visible) { outline: 2px solid var(--azul, #0b3d91); outline-offset: 2px; }
.saludo { display: flex; align-items: center; gap: 14px; }
.boton-avatar { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; padding: 0; color: inherit; }
.boton-avatar img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.miniatura { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; vertical-align: middle; }
.campo-imagen { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.vista-imagen { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid #dde3ea; }
@media (max-width: 600px) {
  .avatar-mensaje { width: 72px; height: 72px; margin: -4px -4px 8px 10px; }
}

/* v1.2 · Tratamientos que dan un certificado */
.chip-certificado { margin-left: 8px; }
.modal .imagen-certificacion { display: block; width: 180px; max-width: 45%; height: auto; margin: 10px auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.modal .mensaje-certificacion { font-size: 1.15em; font-weight: 700; text-align: center; }
.lista-certificaciones { display: flex; flex-wrap: wrap; gap: 12px; }
.certificacion { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--borde, #ddd); border-radius: 8px; }
.certificacion img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
@media (max-width: 600px) { .modal .imagen-certificacion { width: 120px; } }

/* v1.3 · Primeros pasos (recorrido guiado) */
.guia-capa { position: fixed; inset: 0; z-index: 1000; background: transparent; transition: background .3s; }
.guia-capa.visible { background: rgba(10, 26, 52, .66); backdrop-filter: blur(2px); }
.guia-foco { position: fixed; z-index: 1001; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(10, 26, 52, .66); outline: 3px solid #ffd166; outline-offset: 0; transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; animation: guia-latido 1.8s ease-in-out infinite; }
@keyframes guia-latido { 0%, 100% { outline-color: rgba(255, 209, 102, 1); } 50% { outline-color: rgba(255, 209, 102, .35); } }
.guia-tarjeta { position: fixed; z-index: 1002; width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(5, 20, 45, .35), 0 2px 8px rgba(5, 20, 45, .15); transition: left .35s ease, top .35s ease; }
.guia-tarjeta.centrada { width: 460px; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.guia-tarjeta.entra { animation: guia-entra .32s ease-out; }
.guia-tarjeta.centrada.entra { animation: guia-entra-centro .32s ease-out; }
@keyframes guia-entra { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes guia-entra-centro { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
.guia-imagen { aspect-ratio: 16 / 9; overflow: hidden; background: var(--azul-claro); }
.guia-imagen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guia-cabecera { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; background: linear-gradient(135deg, var(--azul-oscuro), var(--azul)); color: #fff; }
.guia-cabecera h3 { margin: 2px 0 0; font-size: 1.15rem; color: #fff; }
.guia-avatar { width: 58px; height: 58px; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); background: #eef2f7; }
.guia-contador { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: #ffd166; font-weight: 700; }
.guia-texto { padding: 14px 20px 4px; line-height: 1.5; }
.guia-texto p { margin: 0 0 .7em; }
.guia-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 20px 16px; border-top: 1px solid var(--borde); margin-top: 6px; }
.guia-puntos { display: flex; gap: 6px; }
.guia-punto { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: var(--borde); cursor: pointer; transition: width .25s, background .25s; }
.guia-punto.hecho { background: #9db7e3; }
.guia-punto.activo { width: 24px; border-radius: 6px; background: var(--azul); }
.guia-botones { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.guia-salir { background: none; border: 0; color: var(--gris); font: inherit; cursor: pointer; padding: .6em .4em; text-decoration: underline; }
.guia-salir:hover { color: var(--texto); }
.ayuda-guia { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .guia-tarjeta, .guia-tarjeta.centrada { width: auto; left: 12px !important; right: 12px; top: auto !important; bottom: 12px; transform: none; max-height: 70vh; }
  .guia-tarjeta.centrada.entra, .guia-tarjeta.entra { animation: guia-entra .32s ease-out; }
  .guia-avatar { width: 46px; height: 46px; }
  body.con-guia { padding-bottom: 75vh; } /* para poder subir hasta arriba lo último de la página */
}
@media (prefers-reduced-motion: reduce) { .guia-foco, .guia-tarjeta.entra, .guia-tarjeta.centrada.entra { animation: none; } .guia-foco, .guia-tarjeta { transition: none; } }
