/* Estilos de mensajería compartidos por web y MAUI; selectores limitados al prefijo msj-. */
.msj-area {
    position: fixed; left: 0; right: 0; bottom: 0;
    top: calc(var(--msj-barra, 56px) + env(safe-area-inset-top, 0px));
    z-index: 5; overflow: hidden; overscroll-behavior: contain;
}
@media (min-width: 1024px) {
    .msj-area { position: relative; inset: auto; z-index: auto; height: var(--msj-alto-escritorio, 100%); }
}
.msj-gesto { position: relative; }
.msj-microfono { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.msj-microfono > * { pointer-events: none; }
/* Grabando con pulsación larga: nada de la página se selecciona ni abre el menú de copiar. */
html.msj-voz-activa, html.msj-voz-activa * { user-select: none !important; -webkit-user-select: none !important; -webkit-touch-callout: none !important; }
/* «Compartir en chat»: se abre sobre pantallas de Tickets (modales en z-index 9999). */
.msj-compartir-fondo {
    position: fixed; inset: 0; z-index: 10020;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgb(0 0 0 / 50%); overscroll-behavior: contain;
}
.msj-compartir-dialogo {
    width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
    background: #fff; color: #111827; border-radius: 16px 16px 0 0; box-shadow: 0 20px 50px rgb(0 0 0 / 25%);
    padding-bottom: env(safe-area-inset-bottom);
}
html.dark .msj-compartir-dialogo { background: #1f2937; color: #f3f4f6; }
@media (min-width: 640px) {
    .msj-compartir-fondo { align-items: center; padding: 16px; }
    .msj-compartir-dialogo { max-width: 28rem; border-radius: 16px; }
}
/* Como página: tarjeta centrada en el flujo normal, sin capas encima de otros modales. */
.msj-compartir-pagina { display: flex; justify-content: center; padding: 16px 12px 96px; }
.msj-compartir-pagina .msj-compartir-dialogo { max-width: 32rem; max-height: none; border-radius: 16px; box-shadow: 0 4px 20px rgb(0 0 0 / 10%); }

/* Fila de reacciones en el menú del mensaje. */
.msj-menu-panel .msj-menu-reacciones { display: flex; gap: 2px; padding: 4px 6px 6px; border-bottom: 1px solid rgba(127, 127, 127, .2); margin-bottom: 4px; }
.msj-menu-panel .msj-menu-reacciones button { flex: 1 1 0; width: auto; min-width: 0; height: 34px; min-height: 34px; padding: 0; justify-content: center; font-size: 18px; border-radius: 9999px; }
.msj-menu-panel .msj-menu-reacciones button.msj-reaccion-mia { background: rgba(127, 127, 127, .25); }
.msj-voz-instruccion { transform: translateX(var(--msj-voz-arrastre, 0px)); }
.msj-voz-cancelando { color: #dc2626; }
.msj-gesto[data-responder="true"] { touch-action: pan-y pinch-zoom; }
/* Deslizar sobre una foto para responder: que el sistema no la "agarre" para arrastrarla. */
.msj-gesto img { -webkit-user-drag: none; -webkit-touch-callout: none; }
.msj-burbuja {
    position: relative;
    padding-right: 2rem;
    transform: none;
    transition: transform 160ms ease-out;
}
.msj-deslizando .msj-burbuja { transform: translateX(var(--msj-desplazamiento, 0px)); transition: none; }
.msj-respuesta-indicador {
    position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: #65756b; opacity: 0; pointer-events: none;
}
.msj-deslizando .msj-respuesta-indicador { opacity: 1; }
.msj-menu { position: absolute; top: 0; right: 0; z-index: 2; }
.msj-menu[open] { z-index: 50; }
.msj-menu-flecha {
    list-style: none; cursor: pointer; width: 32px; height: 32px;
    display: grid; place-items: center; border-radius: 0 10px 0 10px;
    color: inherit; font-size: 22px; opacity: .7;
}
.msj-menu-flecha::-webkit-details-marker { display: none; }
.msj-menu-flecha:hover, .msj-menu[open] .msj-menu-flecha { background: rgb(0 0 0 / 5%); opacity: 1; }
.msj-menu-flecha:focus-visible { outline: 2px solid #4a8d68; outline-offset: -3px; }
.msj-menu-panel {
    display: none; position: fixed; width: 208px; padding: 6px 0;
    border: 1px solid rgb(0 0 0 / 7%); border-radius: 12px;
    color: var(--msj-menu-texto, #25312b); background: var(--msj-menu-fondo, #fff);
    box-shadow: 0 4px 24px rgb(0 0 0 / 18%); overflow-y: auto; z-index: 100;
}
.msj-menu[open] > .msj-menu-panel { display: block; }
.msj-menu-panel button {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px;
    padding: 9px 15px; border: 0; background: transparent; color: inherit;
    text-align: left; font: inherit; font-size: 14px; cursor: pointer;
}
.msj-menu-panel button i { font-size: 18px; }
.msj-menu-panel button:hover, .msj-menu-panel button:focus-visible { background: var(--msj-menu-hover, #f1f4f2); outline: none; }
.msj-menu-panel button:disabled { opacity: .45; cursor: default; }
.msj-menu-panel .msj-menu-borrar { color: #b42318; }
@media (hover: hover) and (pointer: fine) {
    .msj-menu-flecha { opacity: 0; }
    .msj-gesto:hover .msj-menu-flecha, .msj-menu:focus-within .msj-menu-flecha,
    .msj-menu[open] .msj-menu-flecha { opacity: .8; }
}
@media (prefers-reduced-motion: reduce) { .msj-burbuja { transition: none; } }
