:root {
  --azul: #355a96;
  --azul-oscuro: #263d63;
  --azul-claro: #e9f0fa;

  --blanco: #ffffff;

  --gris-fondo: #f3f5f8;
  --gris-claro: #eef1f5;
  --gris-borde: #d4dae2;
  --gris-texto: #475569;
  --gris-oscuro: #263445;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--gris-fondo);
  color: var(--gris-texto);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: 100%;
  max-width: 700px;
  height: 100vh;
  margin: 0 auto;

  display: flex;
  flex-direction: column;

  background: var(--blanco);
  overflow: hidden;

  box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
}

/* ENCABEZADO */

.encabezado {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 18px;

  background: var(--azul);
  color: var(--blanco);
}

.logo {
  width: 54px;
  height: 54px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 17px;

  background: var(--blanco);
  color: var(--azul);

  font-size: 20px;
  font-weight: 700;
}

.titulo {
  flex: 1;
}

.titulo h1 {
  margin: 0;

  font-size: 22px;
  font-weight: 700;
}

.titulo p {
  margin: 5px 0 0;

  font-size: 13px;

  opacity: 0.88;
}

#perfil {
  padding: 9px 13px;

  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 11px;

  background: rgba(255, 255, 255, 0.1);
  color: var(--blanco);

  cursor: pointer;
}

#perfil:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* CONEXIÓN */

.estado {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 16px;

  border-bottom: 1px solid var(--gris-borde);

  background: #f8fafc;

  font-size: 13px;
}

.punto {
  width: 9px;
  height: 9px;

  border-radius: 50%;

  background: #22c55e;
}

/* MENSAJES */

.mensajes {
  flex: 1;

  padding: 18px;

  overflow-y: auto;

  background: var(--gris-fondo);
}

.mensaje {
    position: relative;

    width: 78%;
    max-width: 620px;
    min-width: 0;

    padding: 7px 12px;
    margin-bottom: 14px;

    border: none;
    border-radius: 18px;
    box-sizing: border-box;

    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "texto hora";
    column-gap: 12px;
    align-items: end;
}

.mensaje.recibido {
  margin-right: auto;

  border: 1px solid var(--gris-borde);
  border-bottom-left-radius: 5px;

  background: var(--blanco);
}

.mensaje.enviado {
  margin-left: auto;

  border: 1px solid #ccd9ec;
  border-bottom-right-radius: 5px;

  background: var(--azul-claro);
}

.mensaje strong {
    display: none;
}

.mensaje p {
    grid-area: texto;

    margin: 0;
    padding: 0;

    color: var(--gris-oscuro);
    line-height: 1.25;

    overflow-wrap: anywhere;
}

.mensaje small {
    grid-area: hora;

    display: block;
    margin: 0;
    padding: 0;

    font-size: 10px;
    line-height: 1;
    white-space: nowrap;

    color: #7b8797;
}

/* BARRA DE MENSAJE */

.barra {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 11px;

  border-top: 1px solid var(--gris-borde);

  background: var(--blanco);
}

.barra input {
  flex: 1;
  min-width: 0;

  padding: 13px 16px;

  border: 1px solid var(--gris-borde);
  border-radius: 24px;

  outline: none;

  background: var(--gris-claro);
  color: var(--gris-oscuro);

  font-size: 16px;
}

.barra input:focus {
  border-color: var(--azul);
  background: var(--blanco);
}

.barra button {
  padding: 13px 19px;

  border: 0;
  border-radius: 22px;

  background: var(--azul);
  color: var(--blanco);

  font-weight: 700;

  cursor: pointer;
}

.barra button:hover {
  background: var(--azul-oscuro);
}

/* PERFIL */

.oculto {
  display: none !important;
}

.panel-perfil {
  position: fixed;
  inset: 0;

  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(20, 31, 48, 0.48);
}

.tarjeta-perfil {
  width: 100%;
  max-width: 430px;

  padding: 24px;

  border-radius: 20px;

  background: var(--blanco);

  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
}

.tarjeta-perfil h2 {
  margin: 0 0 20px;

  color: var(--azul-oscuro);
}

.tarjeta-perfil label {
  display: block;

  margin: 14px 0 7px;

  color: var(--gris-texto);

  font-size: 14px;
  font-weight: 700;
}

.tarjeta-perfil input,
.tarjeta-perfil select {
  width: 100%;

  padding: 12px 13px;

  border: 1px solid var(--gris-borde);
  border-radius: 11px;

  outline: none;

  background: var(--blanco);

  color: var(--gris-oscuro);

  font-size: 16px;
}

.tarjeta-perfil input:focus,
.tarjeta-perfil select:focus {
  border-color: var(--azul);
}

.acciones-perfil {
  display: flex;
  gap: 10px;

  margin-top: 22px;
}

.acciones-perfil button {
  flex: 1;

  padding: 12px;

  border: none;
  border-radius: 11px;

  cursor: pointer;

  font-weight: 600;
}

#cancelarPerfil {
  background: #e5e9ef;
  color: var(--gris-oscuro);
}

#guardarPerfil {
  background: var(--azul);
  color: var(--blanco);
}

#guardarPerfil:hover {
  background: var(--azul-oscuro);
}
.acciones-reaccion {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.acciones-reaccion button {
  border: 1px solid #d9dee5;
  border-radius: 16px;
  padding: 4px 8px;
  background: #ffffff;
  cursor: pointer;
  font-size: 16px;
}

.acciones-reaccion button:hover {
  background: #eef2f7;
}

.reacciones {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.reacciones span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 14px;
  background: #eef2f7;
  border: 1px solid #d9dee5;
  font-size: 13px;
}
.ocultar-reacciones {
  display: none !important;
}

.acciones-reaccion {
  margin-top: 8px;
  padding: 6px;
  gap: 4px;
  width: max-content;

  border: 1px solid #d4dae2;
  border-radius: 20px;

  background: #ffffff;

  box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.acciones-reaccion:not(.ocultar-reacciones) {
  display: flex;
}
.acciones-reaccion.ocultar-reacciones {
  display: none !important;
}

.acciones-reaccion:not(.ocultar-reacciones) {
  display: flex !important;
}
/* ===== BURBUJAS DE MENSAJES MÁS HORIZONTALES ===== */

.mensaje {
    position: relative;

    width: fit-content;
    min-width: 45%;
    max-width: 88%;

    padding: 12px 16px;
    margin-bottom: 14px;

    border: none;
    border-radius: 22px;

    box-sizing: border-box;
}

/* Mensajes recibidos */
.mensaje.recibido {
    margin-right: auto;
    margin-left: 20px;

    border: none;
    border-radius: 22px;

    background: #fff3c7;
}

/* Mensajes enviados */
.mensaje.enviado {
    margin-left: auto;
    margin-right: 20px;

    border: none;
    border-radius: 22px;

    background: #d9efff;
}

/* Punto de mensajes recibidos */
.mensaje.recibido::before {
    content: "";
    position: absolute;

    width: 10px;
    height: 10px;
    border-radius: 50%;

    background: #e0ae1b;

    left: -17px;
    top: 50%;

    transform: translateY(-50%);
}

/* Punto de mensajes enviados */
.mensaje.enviado::after {
    content: "";
    position: absolute;

    width: 10px;
    height: 10px;
    border-radius: 50%;

    background: #54aee8;

    right: -17px;
    top: 50%;

    transform: translateY(-50%);
}


/* Nombre */
.mensaje strong {
    display: none;
}

/* Texto */
.mensaje p {
    margin: 0;
    line-height: 1.4;
    
    /* Evita que una palabra larga deforme la burbuja */
    overflow-wrap: anywhere;
}

/* Hora */
.mensaje small {
    display: block;
    text-align: right;
    margin-top: 5px;
    white-space: nowrap;
}
/* ===== MENSAJES COMPACTOS ===== */

.mensaje {
    position: relative;

    width: fit-content;
    min-width: 130px;
    max-width: 65%;

    padding: 7px 11px 9px 11px;
    margin-bottom: 20px;

    border-radius: 12px;

    box-sizing: border-box;
}

/* Texto más compacto */
.mensaje p {
    margin: 2px 0;
    line-height: 1.25;
}

/* Hora compacta */
.mensaje small {
    display: block;
    text-align: right;
    margin-top: 3px;
    font-size: 11px;
}

/* ===== REACCIONES PEGADAS AL MENSAJE ===== */

.reacciones {
    position: absolute;

    bottom: -13px;
    left: 10px;

    display: flex;
    gap: 3px;

    z-index: 5;
}

/* En mis mensajes, reacción hacia la derecha */
.mensaje.enviado .reacciones {
    left: auto;
    right: 10px;
}

/* Cada reacción */
.reacciones span {
    background: white;
    border: 1px solid #d9dee5;
    border-radius: 12px;

    padding: 1px 6px;

    font-size: 13px;
    line-height: 18px;

    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
/* ===== MENSAJES COMPACTOS ===== */

.mensaje {
    position: relative;

    width: fit-content;
    min-width: 130px;
    max-width: 65%;

    padding: 7px 11px 9px 11px;
    margin-bottom: 20px;

    border-radius: 12px;

    box-sizing: border-box;
}

/* Texto más compacto */
.mensaje p {
    margin: 2px 0;
    line-height: 1.25;
}

/* Hora compacta */
.mensaje small {
    display: block;
    text-align: right;
    margin-top: 3px;
    font-size: 11px;
}

/* ===== REACCIONES PEGADAS AL MENSAJE ===== */

.reacciones {
    position: absolute;

    bottom: -13px;
    left: 10px;

    display: flex;
    gap: 3px;

    z-index: 5;
}

/* En mis mensajes, reacción hacia la derecha */
.mensaje.enviado .reacciones {
    left: auto;
    right: 10px;
}

/* Cada reacción */
.reacciones span {
    background: white;
    border: 1px solid #d9dee5;
    border-radius: 12px;

    padding: 1px 6px;

    font-size: 13px;
    line-height: 18px;

    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
/* ===== BURBUJAS LARGAS Y DELGADAS ===== */

.mensaje {
    position: relative;

    width: fit-content;
    min-width: 180px;
    max-width: 88%;

    padding: 7px 12px;
    margin-bottom: 12px;

    border-radius: 14px;
    box-sizing: border-box;
}

/* Recibidos a la izquierda */
.mensaje.recibido {
    margin-left: 12px;
    margin-right: auto;
}

/* Enviados a la derecha */
.mensaje.enviado {
    margin-left: auto;
    margin-right: 12px;
}

/* Nombre */
.mensaje strong {
    display: none;
}

/* Texto */
.mensaje p {
    margin: 0;
    padding: 0;

    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* Hora */
.mensaje small {
    display: inline;
    margin-left: 10px;
    padding: 0;

    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

/* ===== REACCIÓN FLOTANTE ===== */

.reacciones {
    position: absolute;

    bottom: -11px;
    left: 12px;

    display: flex;
    gap: 3px;

    z-index: 10;
}

/* Reacciones de mensajes enviados */
.mensaje.enviado .reacciones {
    left: auto;
    right: 12px;
}

.reacciones span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 20px;

    padding: 0 6px;

    background: white;
    border: 1px solid #d9dee5;
    border-radius: 12px;

    font-size: 12px;
    line-height: 18px;

    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
/* ===== AJUSTE PARA CELULARES ===== */

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

.app {
  height: 100dvh;
  min-height: 100dvh;
}

/* La zona de mensajes ocupa solo el espacio disponible */
.mensajes {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Barra siempre visible abajo */
.barra {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: #ffffff;
  padding-bottom: max(11px, env(safe-area-inset-bottom));
}
/* ===== VISTA LISTA DE CHATS ===== */

.vista-chats {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #f3f5f8;
  padding: 16px;
}

.cabecera-lista {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cabecera-lista h2 {
  margin: 0;
  color: #263d63;
  font-size: 21px;
}

#nuevoChat {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;

  background: #355a96;
  color: white;

  font-weight: 600;
  cursor: pointer;
}

/* Lista */

.lista-chats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cada conversación */

.item-chat {
  display: flex;
  align-items: center;
  gap: 12px;

  width: 100%;
  padding: 12px;

  border: 1px solid #e0e5eb;
  border-radius: 12px;

  background: white;
  cursor: pointer;
}

.avatar-chat {
  width: 44px;
  height: 44px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #355a96;
  color: white;

  font-weight: bold;
}

.info-chat {
  flex: 1;
  min-width: 0;
}

.nombre-chat {
  display: block;
  margin-bottom: 4px;

  color: #263445;
  font-weight: 700;
}

.ultimo-mensaje {
  display: block;

  color: #7b8797;
  font-size: 13px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== CONVERSACIÓN ===== */

.vista-conversacion {
  flex: 1;
  min-height: 0;

  display: flex;
  flex-direction: column;
}

.cabecera-conversacion {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 10px 14px;

  border-bottom: 1px solid #d4dae2;
  background: white;
}

#volverChats {
  border: none;
  background: transparent;

  color: #355a96;
  font-size: 24px;

  cursor: pointer;
}

.cabecera-conversacion strong,
.cabecera-conversacion small {
  display: block;
}

.cabecera-conversacion small {
  margin-top: 2px;
  color: #7b8797;
  font-size: 11px;
}
/* ===== MENÚ INFERIOR FIJO ===== */

.menu-inferior {
  position: fixed;
  left: 50%;
  bottom: 0;

  transform: translateX(-50%);

  width: 100%;
  max-width: 700px;

  display: flex;
  align-items: center;
  justify-content: space-around;

  padding: 8px 12px max(8px, env(safe-area-inset-bottom));

  background: rgba(255, 255, 255, 0.96);

  border-top: 3px solid transparent;

  border-image:
    linear-gradient(
      90deg,
      #ff4d6d,
      #ff9f1c,
      #ffe66d,
      #2ec4b6,
      #4d96ff,
      #845ec2
    ) 1;

  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);

  z-index: 2000;
}

.menu-inferior button {
  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 3px;

  border: none;
  background: transparent;

  color: #6b7280;

  font-size: 11px;

  cursor: pointer;
}

.icono-menu {
  font-size: 22px;
  line-height: 1;
}

.menu-inferior .menu-activo {
  color: #2d4f8c;
  font-weight: 700;
}

/* Espacio para que el contenido no quede detrás del menú */
.app {
  padding-bottom: 70px;
}
/* ===== ESPACIO SOCIAL ===== */

.vista-social {
  flex: 1;
  min-height: 0;
  overflow-y: auto;

  padding: 16px 16px 90px;

  background: #f3f5f8;
}

.cabecera-social {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 14px;
}

.cabecera-social h2 {
  margin: 0;

  color: #263d63;
  font-size: 22px;
}

.cabecera-social p {
  margin: 3px 0 0;

  color: #7b8797;
  font-size: 12px;
}

#nuevaPublicacion {
  border: none;
  border-radius: 12px;

  padding: 10px 14px;

  color: white;
  font-weight: bold;

  cursor: pointer;

  background:
    linear-gradient(
      120deg,
      #ff4d6d,
      #ff9f1c,
      #2ec4b6,
      #4d96ff,
      #845ec2
    );
}

.crear-publicacion {
  margin-bottom: 16px;
  padding: 14px;

  border-radius: 16px;

  background: white;

  box-shadow:
    0 3px 12px rgba(0, 0, 0, 0.06);
}

.crear-publicacion textarea {
  width: 100%;
  min-height: 80px;

  resize: vertical;

  border: 1px solid #d4dae2;
  border-radius: 12px;

  padding: 12px;

  outline: none;

  font: inherit;
}

.crear-publicacion textarea:focus {
  border-color: #4d96ff;
}

#publicar {
  display: block;

  margin-top: 10px;
  margin-left: auto;

  border: none;
  border-radius: 10px;

  padding: 9px 18px;

  background: #355a96;
  color: white;

  font-weight: bold;
  cursor: pointer;
}

.muro-social {
  display: flex;
  flex-direction: column;

  gap: 12px;
}

.publicacion {
  padding: 15px;

  border: 1px solid #e0e5eb;
  border-radius: 16px;

  background: white;

  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.05);
}

.publicacion-cabecera {
  display: flex;
  align-items: center;

  gap: 10px;
}

.avatar-publicacion {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  color: white;
  font-weight: bold;

  background:
    linear-gradient(
      135deg,
      #ff4d6d,
      #ff9f1c,
      #2ec4b6,
      #4d96ff,
      #845ec2
    );
}

.publicacion-cabecera strong,
.publicacion-cabecera small {
  display: block;
}

.publicacion-cabecera small {
  margin-top: 2px;

  color: #8b95a3;
  font-size: 11px;
}

.publicacion > p {
  margin: 14px 0;

  color: #344054;

  line-height: 1.45;
}

.acciones-publicacion {
  display: flex;

  gap: 8px;

  padding-top: 8px;

  border-top: 1px solid #eef1f5;
}

.acciones-publicacion button {
  border: none;

  background: transparent;

  color: #64748b;

  cursor: pointer;
}
.boton-like.like-activo {
  color: #e63946;
  font-weight: 700;
}

.contador-like {
  margin-left: 4px;
}

.zona-comentarios {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef1f5;
}

.lista-comentarios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comentario {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f5f7fa;
}

.comentario strong {
  display: block;
  color: #263d63;
  font-size: 13px;
}

.comentario p {
  margin: 3px 0;
  color: #344054;
}

.comentario small {
  color: #8b95a3;
  font-size: 10px;
}

.nuevo-comentario {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.nuevo-comentario input {
  flex: 1;
  min-width: 0;

  padding: 9px 11px;

  border: 1px solid #d4dae2;
  border-radius: 18px;
}

.nuevo-comentario button {
  border: none;
  border-radius: 18px;

  padding: 8px 14px;

  background: #355a96;
  color: white;

  cursor: pointer;
}
.modal-usuarios {
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 18px;

  background: rgba(20, 30, 50, 0.45);

  z-index: 5000;
}

.tarjeta-usuarios {
  width: 100%;
  max-width: 420px;

  max-height: 70vh;
  overflow-y: auto;

  padding: 18px;

  border-radius: 18px;

  background: white;

  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.18);
}

.cabecera-modal-usuarios {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cabecera-modal-usuarios h3 {
  margin: 0;

  color: #263d63;
}

#cerrarUsuarios {
  border: none;
  background: transparent;

  font-size: 20px;

  cursor: pointer;
}

.texto-usuarios {
  margin: 8px 0 14px;

  color: #7b8797;
  font-size: 13px;
}

#listaUsuariosChat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usuario-chat {
  display: flex;
  align-items: center;
  gap: 12px;

  width: 100%;

  padding: 11px;

  border: 1px solid #e0e5eb;
  border-radius: 12px;

  background: white;

  cursor: pointer;
}

.usuario-chat:hover {
  background: #f5f7fa;
}

.avatar-usuario {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 50%;

  background:
    linear-gradient(
      135deg,
      #ff4d6d,
      #ff9f1c,
      #2ec4b6,
      #4d96ff,
      #845ec2
    );

  color: white;
  font-weight: bold;
}

.datos-usuario {
  min-width: 0;
}

.datos-usuario strong,
.datos-usuario small {
  display: block;
}

.datos-usuario small {
  margin-top: 3px;

  color: #7b8797;
}
/* =========================
   PANTALLA DE ACCESO
========================= */

.pantalla-acceso {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(
      145deg,
      #eef3f9 0%,
      #f7f9fc 55%,
      #e8eef7 100%
    );
}

.pantalla-acceso.oculto {
  display: none;
}

.tarjeta-acceso {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 42px 34px;
  text-align: center;
  box-shadow:
    0 20px 60px rgba(30, 55, 90, 0.16);
}

.logo-acceso {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  border-radius: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #355a96;
  color: white;

  font-size: 28px;
  font-weight: 700;

  box-shadow:
    0 10px 25px rgba(53, 90, 150, 0.25);
}

.tarjeta-acceso h1 {
  margin: 0 0 8px;
  color: #17345f;
  font-size: 30px;
  font-weight: 750;
}

.tarjeta-acceso p {
  margin: 0 0 34px;
  color: #6b7788;
  font-size: 15px;
}

.tarjeta-acceso button {
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
}

#crearCuentaInicio {
  background: #355a96;
  color: white;
  border: none;
}

#iniciarSesionInicio {
  background: white;
  color: #355a96;
  border: 1.5px solid #355a96;
}

#crearCuentaInicio:hover {
  background: #294b81;
}

#iniciarSesionInicio:hover {
  background: #f1f5fb;
}
.nombre-app {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 2px;

  background: linear-gradient(
    90deg,
    #ff4d4d,
    #ff9f1c,
    #ffd93d,
    #38c172,
    #25b7d3,
    #4568dc,
    #8e44ad
  );

  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.encabezado .titulo h1 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

#usuarioEncabezado {
  font-size: 12px;
  margin: 2px 0 0;
  opacity: 0.85;
}
/* ===== PERFIL EN MODO LECTURA ===== */

.vista-perfil {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dato-perfil {
  background: #f7f9fc;
  border-radius: 14px;
  padding: 12px 14px;
}

.etiqueta-perfil {
  display: block;
  font-size: 11px;
  color: #7b8797;
  margin-bottom: 4px;
}

.dato-perfil strong {
  font-size: 15px;
  color: #18345d;
  font-weight: 600;
}

.color-perfil-vista {
  display: flex;
  align-items: center;
  gap: 9px;
}

.muestra-color-perfil {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

#editarPerfilBtn,
#configuracionBtn,
#cerrarSesionPerfil {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  cursor: pointer;
}

#editarPerfilBtn {
  background: #355fa3;
  color: white;
}

#configuracionBtn {
  background: #edf2f8;
  color: #18345d;
}

#cerrarSesionPerfil {
  background: #f4f4f4;
  color: #333;
}

.panel-configuracion {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 31, 48, 0.55);
}

.tarjeta-configuracion {
  width: 100%;
  max-width: 430px;
  background: white;
  border-radius: 24px;
  padding: 24px;
}

.temas-chat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.tema-chat {
  border: 0;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  font-weight: 700;
}

.foto-configuracion {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vista-foto-perfil {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #d9e1ee;
  display: none;
}

.tema-chat[data-tema="azul"] {
  background: linear-gradient(135deg, #244a82, #80b7f0);
  color: white;
}

.tema-chat[data-tema="verde"] {
  background: linear-gradient(135deg, #286452, #8adbb8);
  color: white;
}

.tema-chat[data-tema="dorado"] {
  background: linear-gradient(135deg, #243b63, #d9ad43);
  color: white;
}

.tema-chat[data-tema="oscuro"] {
  background: linear-gradient(135deg, #292d33, #34717a);
  color: white;
}

.tema-chat[data-tema="claro"] {
  background: linear-gradient(135deg, #ffffff, #bad5f2);
  color: #17365f;
}

#inputFotoPerfil {
  width: 100%;
}

#quitarFotoPerfil {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
#avatarEncabezado {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fotoEncabezado {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

#inicialesEncabezado {
  display: block;
}
.input-foto-oculto {
  display: none;
}

.boton-cargar-foto {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  border-radius: 12px;
  background: #eaf0f7;
  color: #17365f;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.boton-cargar-foto:hover {
  background: #dce7f4;
}

.tema-chat {
  position: relative;
}

.tema-chat.tema-seleccionado {
  outline: 4px solid #ffffff;
  box-shadow:
    0 0 0 3px #17365f,
    0 6px 16px rgba(0, 0, 0, 0.18);
}

.tema-chat.tema-seleccionado::after {
  content: "✓";
  position: absolute;
  top: 7px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  color: #17365f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

/* AZUL MARINO + AZUL CLARO */
body.tema-azul .mensaje.enviado {
  background: #4f8ed8;
  color: #ffffff;
}

body.tema-azul .mensaje.recibido {
  background: #dcecff;
  color: #17365f;
}


/* VERDE OSCURO + MENTA */
body.tema-verde .mensaje.enviado {
  background: #3f8f70;
  color: #ffffff;
}

body.tema-verde .mensaje.recibido {
  background: #dff5eb;
  color: #173b31;
}


/* AZUL OSCURO + DORADO */
body.tema-dorado .mensaje.enviado {
  background: #243b63;
  color: #ffffff;
}

body.tema-dorado .mensaje.recibido {
  background: #e2ba58;
  color: #17243b;
}


/* GRAFITO + AZUL PETRÓLEO */
body.tema-oscuro .mensaje.enviado {
  background: #286571;
  color: #ffffff;
}

body.tema-oscuro .mensaje.recibido {
  background: #454d56;
  color: #ffffff;
}


/* BLANCO + AZUL SUAVE */
body.tema-claro .mensaje.enviado {
  background: #8db9e5;
  color: #17365f;
}

body.tema-claro .mensaje.recibido {
  background: #edf5fc;
  color: #17365f;
}

.mensaje.enviado strong,
.mensaje.enviado p,
.mensaje.enviado small,
.mensaje.recibido strong,
.mensaje.recibido p,
.mensaje.recibido small {
  color: inherit;
}

.foto-avatar-chat {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}