/* TJACCO Justina 1.0.1 (24-nov-2026). Estilos del motor de SIJAT (justina.css, 20-nov) + ajustes del portal.
   Los selectores con #justina / #justina-llamar ganan a las reglas de contraste del panel de accesibilidad. */
#justina {
  --js: 104px;
  position: fixed; left: 0; top: 0; width: var(--js); height: var(--js); z-index: 99990;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; visibility: hidden;
  font: 13.5px/1.45 Montserrat, Arial, sans-serif;
}
@media (max-width: 640px) { #justina { --js: 84px; } }
#justina.arrastrando { cursor: grabbing; }
#justina:focus { outline: none; }
#justina:focus-visible .j-body { outline: 3px solid #e6ba53; outline-offset: 2px; border-radius: 50%; }
#justina .j-tilt, #justina .j-squash, #justina .j-body { width: 100%; height: 100%; }
#justina .j-tilt { transform-origin: 50% 50%; }
#justina .j-squash { transform-origin: 50% 88%; }
#justina .j-body { animation: justina-flota 3.2s ease-in-out infinite; }
@keyframes justina-flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
#justina.arrastrando .j-body, #justina.volando .j-body, #justina.quieta .j-body { animation: none; }
/* portal.css da a todo svg 30 px, contorno y sin relleno: aquí se devuelven los valores normales. */
#justina svg { width: 100%; height: 100%; overflow: visible; display: block; filter: drop-shadow(0 6px 10px rgba(20, 40, 25, .22)); stroke: none; fill: #000; stroke-width: 1; }
#justina .j-ojos { transition: transform .18s ease-out; }
#justina .j-ojo, #justina .j-ceja { transform-box: fill-box; transform-origin: center; }
#justina .j-ceja { transition: transform .25s; }
#justina .j-balanza { transform-box: view-box; transform-origin: 200px 118px; transition: transform .4s; }
#justina .j-mazo { transform-box: fill-box; transform-origin: 50% 100%; }
#justina .j-ojos-felices { display: none; }
#justina[data-estado=feliz] .j-ojos-felices { display: inline; }
#justina[data-estado=feliz] .j-ojo { display: none; }
#justina[data-estado=error] .j-ceja-izq { transform: rotate(-16deg) translateY(4px); }
#justina[data-estado=error] .j-ceja-der { transform: rotate(16deg) translateY(4px); }
#justina[data-estado=pensando] .j-ceja-izq { transform: translateY(-6px); }
#justina[data-estado=pensando] .j-ceja-der { transform: rotate(10deg); }
#justina[data-estado=sorpresa] .j-ceja { transform: translateY(-10px); }
#justina[data-estado=pensando] .j-balanza { animation: justina-pesa 1.4s ease-in-out infinite; }
@keyframes justina-pesa { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
#justina[data-estado=error] .j-body { animation: justina-niega .35s 2; }
@keyframes justina-niega { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

#justina .j-globo {
  position: absolute; bottom: 82%; width: max-content; max-width: min(280px, calc(100vw - var(--js) - 24px));
  /* En SIJAT es blanco al 72 %; en el portal pasa sobre fotos (carrusel), así que va al 88 % para leerse bien. */
  background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(26, 92, 43, .12); color: #1d2333; border-radius: 14px; padding: 10px 28px 10px 13px;
  font-size: 13.5px; line-height: 1.45; text-align: left; box-shadow: 0 6px 20px rgba(20, 40, 25, .14); opacity: 0; transform: scale(.8);
  transition: opacity .18s, transform .18s, background-color .18s; pointer-events: none; cursor: default; white-space: normal;
}
#justina .j-globo.visible { opacity: .92; transform: scale(1); pointer-events: auto; }
#justina .j-globo.visible:hover, #justina .j-globo.visible:focus-within { opacity: 1; background: #fff; }
#justina .j-cerrar {
  position: absolute; top: 4px; right: 6px; width: 20px; height: 20px; border: 0; border-radius: 999px;
  background: transparent; color: #6b7280; font-size: 16px; line-height: 18px; cursor: pointer; padding: 0;
}
#justina .j-cerrar:hover { background: rgba(0, 0, 0, .06); color: #111827; }
#justina .j-globo.der { left: 82%; transform-origin: 0 100%; }
#justina .j-globo.izq { right: 82%; transform-origin: 100% 100%; }
#justina .j-globo.abajo { bottom: auto; top: 82%; }
#justina .j-opciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
#justina .j-opciones:empty { display: none; }
#justina .j-opciones.entrando { animation: justina-abre-opciones .3s ease-out both; overflow: hidden; }
#justina .j-opciones.entrando button { animation: justina-opcion .32s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes justina-abre-opciones { from { max-height: 0; margin-top: 0; opacity: 0; } to { max-height: 260px; margin-top: 10px; opacity: 1; } }
@keyframes justina-opcion { from { opacity: 0; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: none; } }
#justina .j-opciones button {
  border: 1.5px solid #1a5c2b; background: rgba(255, 255, 255, .6); color: #1a5c2b; border-radius: 999px; padding: 5px 11px;
  font: 600 13px/1.3 Montserrat, Arial, sans-serif; cursor: pointer;
}
#justina .j-opciones button:hover { background: #f0faf2; }
#justina .j-opciones button.principal { background: #1a5c2b; color: #fff; }
#justina .j-opciones button:focus-visible, #justina .j-cerrar:focus-visible { outline: 3px solid #e6ba53; outline-offset: 2px; }

.justina-foco {
  position: fixed; border-radius: 12px; pointer-events: none; z-index: 99985;
  box-shadow: 0 0 0 3px #e0a03c, 0 0 0 9999px rgba(10, 30, 15, .32); opacity: 0;
  transition: all .45s cubic-bezier(.5, 0, .3, 1);
}
.justina-foco.visible { opacity: 1; }
.justina-chispa { position: fixed; width: 8px; height: 8px; border-radius: 50%; background: #e0a03c; z-index: 99989; pointer-events: none; }

/* Botón para llamarla: en la esquina izquierda, encima del botón de accesibilidad (a la derecha están WhatsApp y «subir»). */
#justina-llamar {
  position: fixed; left: 16px; bottom: 88px; width: 58px; height: 58px; border-radius: 50%; border: 2px solid #fff;
  background: #1a5c2b; box-shadow: 0 6px 18px rgba(20, 40, 25, .3); z-index: 99990; display: none; padding: 8px; cursor: pointer;
}
#justina-llamar svg { width: 100%; height: 100%; display: block; stroke: none; fill: #000; stroke-width: 1; }
#justina-llamar.visible { display: block; animation: justina-pop .3s ease-out; }
#justina-llamar:focus-visible { outline: 3px solid #e6ba53; outline-offset: 2px; }
@keyframes justina-pop { from { transform: scale(0); } to { transform: scale(1); } }
@media (max-width: 640px) { #justina-llamar { left: 14px; bottom: 82px; width: 52px; height: 52px; } }

/* Mientras Justina está a la vista, el panel de accesibilidad se abre desde ella (o con Alt + A). */
html.justina-visible .acc2-btn { display: none; }

/* Contraste del panel de accesibilidad: sin fondos sobre la figura; en «Invertido» se ve con sus colores. */
html[class*="acc2-con-"] #justina, html[class*="acc2-con-"] #justina .j-tilt, html[class*="acc2-con-"] #justina .j-squash,
html[class*="acc2-con-"] #justina .j-body { background: none !important; box-shadow: none !important; border: 0 !important; }
html.acc2-con-3 #justina .j-tilt, html.acc2-con-3 #justina-llamar svg { filter: invert(1) hue-rotate(180deg); }
html.acc2-con-3 #justina .j-globo { filter: invert(1) hue-rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  #justina .j-body, #justina[data-estado=pensando] .j-balanza, #justina[data-estado=error] .j-body { animation: none; }
  .justina-foco { transition: none; }
  #justina .j-opciones.entrando, #justina .j-opciones.entrando button, #justina-llamar.visible { animation: none; }
}
html.acc2-ani-1 #justina .j-body, html.acc2-ani-1 #justina .j-balanza, html.acc2-ani-1 #justina .j-opciones,
html.acc2-ani-1 #justina .j-opciones button, html.acc2-ani-1 #justina-llamar { animation: none !important; }
@media print { #justina, #justina-llamar, .justina-foco { display: none !important; } }
