html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	font-family: Arial, Helvetica, sans-serif;
	background: #edf4ef;
	color: #35483b;
}

body {
	min-height: 100vh;
}

/* =========================================================
   CHAT GENERAL
========================================================= */

.chat {
	width: min(94%, 1180px);
	height: 100vh;
	margin: 0 auto;
	padding: 14px 0 8px;
	box-sizing: border-box;

	display: flex;
	flex-direction: column;

	overflow: hidden;
}

/* =========================================================
   ENCABEZADO FLORAL
========================================================= */

.chat-welcome-bar {
	position: relative;

	flex: 0 0 auto;

	height: 155px;
	min-height: 155px;

	margin: 0 0 12px;
	padding: 0;

	border-radius: 22px;
	overflow: hidden;

	background:
		linear-gradient(
			90deg,
			rgba(255, 255, 255, 0.93) 0%,
			rgba(255, 255, 255, 0.72) 27%,
			rgba(255, 255, 255, 0.30) 53%,
			rgba(255, 255, 255, 0.05) 100%
		),
		url("/fondo-chat.jpg") center center / cover no-repeat;

	border: 1px solid rgba(255, 255, 255, 0.95);

	box-shadow:
		0 7px 22px rgba(48, 79, 56, 0.14);
}

/* =========================================================
   ZONA DEL LOGO
========================================================= */

.chat-welcome-text {
	position: absolute;

	left: 22px;
	top: 50%;

	transform: translateY(-50%);

	width: 330px;
	height: 135px;

	display: block;

	background: transparent;

	border: none;
	border-radius: 0;

	box-shadow: none;

	overflow: visible;

	z-index: 2;
}

/* =========================================================
   LOGO INTEGRADO
========================================================= */

.chat-welcome-text::before {
	content: "";

	position: absolute;

	left: 0;
	top: 0;

	width: 330px;
	height: 135px;

	background-image: url("/logo-agapantos.jpg");
	background-repeat: no-repeat;
	background-position: center center;
	background-size: 100% auto;

	/*
	   El blanco del JPG se mezcla con el fondo claro
	   del encabezado para eliminar visualmente
	   el efecto de "caja".
	*/
	mix-blend-mode: multiply;

	opacity: 0.97;

	filter:
		contrast(1.03)
		saturate(1.04);

	pointer-events: none;
}

/* Ocultamos los textos originales */
.chat-welcome-text strong,
.chat-welcome-text span {
	display: none;
}

/* =========================================================
   SEPARADOR
========================================================= */

.chat-welcome-text::after {
	content: "";

	position: absolute;

	right: -18px;
	top: 18px;

	width: 1px;
	height: 98px;

	background: rgba(52, 94, 63, 0.32);
}

/* =========================================================
   TÍTULO
========================================================= */

.chat-welcome-bar::before {
	content: "Chat de Vecinos";

	position: absolute;

	left: 370px;
	top: 55px;

	z-index: 3;

	font-size: 30px;
	font-weight: 700;

	color: #315c3d;

	text-shadow:
		0 1px 3px rgba(255, 255, 255, 0.95),
		0 0 7px rgba(82, 154, 91, 0.15);
}

/* =========================================================
   SUBTÍTULO
========================================================= */

.chat-welcome-bar::after {
	content: "Conversemos entre vecinos • Comunidad • Seguridad • Convivencia";

	position: absolute;

	left: 370px;
	top: 98px;

	z-index: 3;

	font-size: 12px;
	font-weight: 500;

	color: #607267;

	text-shadow:
		0 1px 3px rgba(255, 255, 255, 0.96);
}

/* =========================================================
   EN LÍNEA
========================================================= */

.chat-live {
	position: absolute;

	right: 20px;
	top: 18px;

	z-index: 5;

	display: flex;
	align-items: center;
	gap: 7px;

	padding: 8px 14px;

	background: rgba(255, 255, 255, 0.94);

	border: 1px solid rgba(255, 255, 255, 0.98);

	border-radius: 999px;

	color: #477153;

	font-size: 12px;
	font-weight: 700;

	box-shadow:
		0 4px 12px rgba(43, 76, 50, 0.12);
}

.online-dot {
	display: inline-block;

	width: 8px;
	height: 8px;

	border-radius: 50%;

	background: #50ae61;

	box-shadow:
		0 0 0 3px rgba(80, 174, 97, 0.16);
}

/* =========================================================
   MENSAJES
========================================================= */

.messages-area {
	flex: 1 1 auto;

	min-height: 0;

	overflow-y: auto;
	overflow-x: hidden;

	padding: 7px 12px 8px;

	box-sizing: border-box;

	display: flex;
	flex-direction: column;

	scroll-behavior: smooth;
}

.messages-area::-webkit-scrollbar {
	width: 6px;
}

.messages-area::-webkit-scrollbar-track {
	background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
	background: #c8d8cc;
	border-radius: 10px;
}

/* =========================================================
   MENSAJES
========================================================= */

.message {
	width: 100%;

	display: flex;
	flex-direction: column;

	margin-bottom: 9px;

	box-sizing: border-box;
}

.my-message {
	align-items: flex-end;
}

.other-message {
	align-items: flex-start;
}

/* =========================================================
   NOMBRE Y HORA
========================================================= */

.message-meta {
	display: flex;
	align-items: baseline;
	gap: 6px;

	margin-bottom: 3px;
	padding: 0 5px;
}

.message-user {
	font-size: 12px;
	font-weight: 700;
}

.my-message .message-user {
	color: #43804f;
}

.other-message .message-user {
	color: #5a6d61;
}

.message-time {
	font-size: 10px;
	color: #929e96;
}

/* =========================================================
   BURBUJAS
========================================================= */

.message-bubble {
	max-width: min(68%, 560px);

	padding: 9px 13px;

	border-radius: 14px;

	font-size: 14px;
	line-height: 1.35;

	font-weight: 700;

	word-break: break-word;

	box-sizing: border-box;
}

/* =========================================================
   MIS MENSAJES
========================================================= */

.my-message .message-bubble {
	background: #dcefe0;

	border: 1px solid #acd5b4;

	color: #285e34;

	border-bottom-right-radius: 5px;

	text-shadow:
		0 0 2px rgba(102, 255, 119, 0.65),
		0 0 6px rgba(102, 255, 119, 0.28);

	box-shadow:
		0 3px 8px rgba(54, 103, 62, 0.10),
		0 0 10px rgba(91, 192, 101, 0.18);
}

/* =========================================================
   MENSAJES DE OTROS
========================================================= */

.other-message .message-bubble {
	background: #ffffff;

	border: 1px solid #d5e1d8;

	color: #3b5142;

	border-bottom-left-radius: 5px;

	text-shadow:
		0 0 2px rgba(95, 190, 105, 0.32),
		0 0 5px rgba(95, 190, 105, 0.12);

	box-shadow:
		0 3px 8px rgba(48, 71, 54, 0.07),
		0 0 7px rgba(91, 173, 99, 0.08);
}

/* =========================================================
   DOBLE CHECK
========================================================= */

.message-status {
	margin-top: 2px;
	padding-right: 5px;

	font-size: 10px;
	font-weight: 700;

	letter-spacing: -2px;

	color: #4c9c59;
}

/* =========================================================
   ESTÁ ESCRIBIENDO
========================================================= */

.typing-indicator {
	align-self: flex-start;

	display: flex;
	align-items: center;
	gap: 5px;

	margin: 2px 0 8px 4px;

	padding: 7px 10px;

	background: #f6faf7;

	border: 1px solid #dce7de;

	border-radius: 13px;

	color: #7c887f;

	font-size: 11px;
}

.typing-icon {
	font-size: 13px;
}

.typing-name {
	color: #4f8058;
	font-weight: 700;
}

.typing-dots {
	display: inline-flex;
	gap: 2px;
}

.typing-dots span {
	color: #559d60;
	font-size: 13px;

	animation: typingDots 1.2s infinite;
}

.typing-dots span:nth-child(2) {
	animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typingDots {
	0%,
	60%,
	100% {
		opacity: 0.25;
		transform: translateY(0);
	}

	30% {
		opacity: 1;
		transform: translateY(-2px);
	}
}

/* =========================================================
   CAJA DE ESCRITURA
========================================================= */

.chat-form {
	flex: 0 0 auto;

	display: flex;
	align-items: center;

	gap: 7px;

	margin: 2px 0 0;
	padding: 6px;

	background: #ffffff;

	border: 1px solid #d9e4dc;

	border-radius: 13px;

	box-shadow:
		0 3px 10px rgba(43, 76, 51, 0.07);

	box-sizing: border-box;
}

.my-input-text {
	flex: 1;

	width: auto !important;

	height: 40px !important;

	margin: 0 !important;

	padding: 0 13px !important;

	box-sizing: border-box;

	border: 1px solid #d2ddd5 !important;

	border-radius: 9px !important;

	background: #fbfdfb;

	color: #354039;

	font-size: 13px;
}

.my-input-text::placeholder {
	color: #9aa59d;
}

.my-input-text:focus {
	outline: none;

	border-color: #78a47f !important;

	background: #ffffff;

	box-shadow:
		0 0 0 3px rgba(120, 164, 127, 0.11);
}

/* =========================================================
   BOTÓN
========================================================= */

.send-message {
	flex: 0 0 76px;

	width: 76px !important;
	height: 40px !important;

	margin: 0 !important;
	padding: 0 !important;

	border: none !important;

	border-radius: 9px !important;

	background: #4f8758 !important;

	color: #ffffff !important;

	font-size: 12px;
	font-weight: 700;

	cursor: pointer;
}

.send-message:hover {
	background: #3f7148 !important;
}

/* =========================================================
   PIE
========================================================= */

.chat-security {
	flex: 0 0 auto;

	text-align: center;

	padding: 5px 4px 1px;

	font-size: 9px;

	color: #8c968f;
}

/* =========================================================
   PANTALLA DE INGRESO
========================================================= */

.name-screen {
	width: 100%;
	height: 100vh;

	display: flex;
	align-items: center;
	justify-content: center;

	padding: 18px;

	box-sizing: border-box;

	background: #edf4ef;
}

.name-box {
	width: 100%;
	max-width: 460px;

	padding: 30px;

	box-sizing: border-box;

	background: #ffffff;

	border: 1px solid #dce7de;

	border-radius: 18px;

	box-shadow:
		0 7px 24px rgba(43, 76, 51, 0.10);

	text-align: center;
}

.name-icon {
	font-size: 38px;
	margin-bottom: 4px;
}

.name-welcome {
	margin-bottom: 5px;

	font-size: 11px;
	font-weight: 700;

	color: #568160;

	letter-spacing: 0.4px;
}

.name-box h2 {
	margin: 0 0 9px;

	font-size: 24px;

	color: #315b3d;
}

.name-box p {
	margin: 0 0 18px;

	font-size: 13px;
	line-height: 1.5;

	color: #69766d;
}

.name-box form {
	display: flex;
	gap: 7px;

	margin: 0;
}

.name-box input {
	flex: 1;

	height: 42px;

	margin: 0;

	padding: 0 13px;

	box-sizing: border-box;

	border: 1px solid #d2ddd4;

	border-radius: 9px;

	background: #fafcfa;

	font-size: 13px;
}

.name-box input:focus {
	border-color: #78a47f;

	outline: none;

	box-shadow:
		0 0 0 3px rgba(120, 164, 127, 0.11);
}

.name-box button {
	height: 42px;

	margin: 0;

	padding: 0 17px;

	border: none;

	border-radius: 9px;

	background: #4f8758;

	color: #ffffff;

	font-size: 12px;

	font-weight: 700;

	cursor: pointer;
}

.name-box button:hover {
	background: #3f7148;
}

/* =========================================================
   MÓVIL
========================================================= */

@media screen and (max-width: 700px) {

	.chat {
		width: 100%;
		height: 100vh;
		padding: 7px;
	}

	.chat-welcome-bar {
		height: 125px;
		min-height: 125px;

		margin-bottom: 8px;

		border-radius: 14px;
	}

	.chat-welcome-text {
		left: 8px;

		width: 160px;
		height: 100px;
	}

	.chat-welcome-text::before {
		width: 160px;
		height: 100px;

		background-size: 100% auto;
	}

	.chat-welcome-text::after {
		display: none;
	}

	.chat-welcome-bar::before {
		left: 185px;
		top: 46px;

		font-size: 21px;
	}

	.chat-welcome-bar::after {
		left: 185px;
		top: 77px;

		max-width: 190px;

		font-size: 8px;

		line-height: 1.2;
	}

	.chat-live {
		right: 10px;
		top: 10px;

		padding: 6px 9px;

		font-size: 9px;
	}

	.online-dot {
		width: 7px;
		height: 7px;
	}

	.messages-area {
		padding: 5px 2px 7px;
	}

	.message {
		margin-bottom: 11px;
	}

	.message-user {
		font-size: 11px;
	}

	.message-time {
		font-size: 9px;
	}

	.message-bubble {
		max-width: 78%;

		padding: 8px 11px;

		font-size: 14px;

		border-radius: 13px;
	}

	.chat-form {
		padding: 5px;
		gap: 5px;
		border-radius: 11px;
	}

	.my-input-text {
		height: 40px !important;
		font-size: 13px;
	}

	.send-message {
		flex-basis: 68px;
		width: 68px !important;
		height: 40px !important;
		font-size: 11px;
	}

	.chat-security {
		font-size: 8px;
	}

	.name-screen {
		padding: 12px;
	}

	.name-box {
		padding: 25px 17px;
	}

	.name-box h2 {
		font-size: 22px;
	}

	.name-box form {
		flex-direction: column;
	}

	.name-box input,
	.name-box button {
		width: 100%;
	}
}
/* Logo transparente: pegar al final de styles.css */
.chat-welcome-text {
  position: absolute;
  z-index: 2;
  left: 24px;
  top: 50%;
  width: 320px;
  height: 132px;
  padding: 0;
  transform: translateY(-50%);
  background: url("/logo-agapantos-transparente.png") center / contain no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Quita el JPG blanco anterior */
.chat-welcome-text > img,
.chat-welcome-text::before {
  display: none !important;
  content: none !important;
  background: none !important;
}

.chat-welcome-text strong,
.chat-welcome-text span {
  display: none !important;
}

.chat-welcome-text::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 17px;
  width: 1px;
  height: 98px;
  background: rgba(46, 88, 57, .30);
}
/*
  PEGAR AL FINAL DE styles.css
  Solo modifica la zona de mensajes; no toca el encabezado ni el logo.
*/

.messages-area {
  margin: 0 2px;
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(208, 226, 214, .78);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .80);
}

/* Se muestra antes de los mensajes, sin cambiar el HTML ni el JavaScript. */
.messages-area::before {
  content: "Bienvenido/a al chat de Villa Los Agapantos\A Conversa con respeto y entre vecinos.\A\A Hoy";
  align-self: center;
  margin: 1px 0 14px;
  padding: 8px 14px;
  white-space: pre-line;
  border: 1px solid #d6e7d9;
  border-radius: 12px;
  background: rgba(248, 252, 249, .92);
  color: #698071;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 2px 7px rgba(54, 95, 64, .06);
}

.message {
  margin-bottom: 12px;
}

.message-meta {
  margin-bottom: 4px;
}

.message-bubble {
  box-shadow: 0 3px 9px rgba(46, 79, 54, .09);
}

@media (max-width: 700px) {
  .messages-area {
    margin: 0;
    padding: 11px 9px 9px;
    border-radius: 12px;
  }

  .messages-area::before {
    margin-bottom: 11px;
    padding: 7px 10px;
    font-size: 10px;
  }
}
/* =======================================================
   VECINOS EN LÍNEA
======================================================= */

.online-users {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	position: relative;
}

.online-users > strong {
	cursor: default;
	white-space: nowrap;
}

.online-users-list {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;

	min-width: 190px;
	max-width: 240px;

	padding: 10px 12px;

	background: rgba(255, 255, 255, 0.97);
	border: 1px solid rgba(76, 126, 83, 0.18);
	border-radius: 12px;

	box-shadow: 0 8px 22px rgba(40, 70, 46, 0.16);

	z-index: 20;
}

.online-user {
	display: flex;
	align-items: center;
	gap: 8px;

	padding: 6px 4px;

	font-size: 12px;
	color: #385b40;

	border-bottom: 1px solid rgba(76, 126, 83, 0.08);
}

.online-user:last-child {
	border-bottom: none;
}

.online-user-dot {
	width: 8px;
	height: 8px;

	flex-shrink: 0;

	background: #4caf50;
	border-radius: 50%;

	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

.online-notice {
	position: relative;

	margin: 6px auto 8px;

	width: fit-content;
	max-width: 90%;

	padding: 7px 14px;

	background: rgba(238, 248, 239, 0.96);
	border: 1px solid rgba(76, 126, 83, 0.16);
	border-radius: 999px;

	color: #416348;

	font-size: 12px;
	font-weight: 600;

	text-align: center;

	box-shadow: 0 4px 12px rgba(50, 90, 56, 0.08);

	animation: onlineNoticeAppear 0.25s ease;
}

@keyframes onlineNoticeAppear {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* MÓVIL */

@media screen and (max-width: 700px) {
	.online-users-list {
		right: -4px;
		min-width: 170px;
		max-width: 210px;
	}

	.online-user {
		font-size: 11px;
		padding: 5px 3px;
	}

	.online-notice {
		font-size: 11px;
		padding: 6px 12px;
	}
}
/* =========================================================
   VILLA LOS AGAPANTOS - USUARIOS EN LINEA
========================================================= */

.chat-live {
	position: relative;
	display: flex;
	align-items: center;
}

.online-users-button {
	display: flex;
	align-items: center;
	gap: 7px;
	border: 0;
	background: transparent;
	padding: 6px 8px;
	margin: 0;
	color: #385b40;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.online-users-button:hover {
	opacity: 0.85;
}

.online-arrow {
	font-size: 9px;
	margin-left: 2px;
}

.online-dot,
.online-user-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	flex-shrink: 0;
	border-radius: 50%;
	background: #42a85f;
	box-shadow: 0 0 0 3px rgba(66, 168, 95, 0.13);
}

.online-users-list {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 210px;
	max-width: 80vw;
	padding: 10px;
	background: rgba(255, 255, 255, 0.98);
	border: 1px solid rgba(76, 126, 83, 0.18);
	border-radius: 14px;
	box-shadow: 0 8px 25px rgba(40, 70, 46, 0.18);
	z-index: 100;
}

.online-users-title {
	padding: 4px 6px 9px;
	margin-bottom: 3px;
	border-bottom: 1px solid rgba(76, 126, 83, 0.12);
	font-size: 12px;
	font-weight: 700;
	color: #385b40;
}

.online-user {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 5px;
	font-size: 12px;
	color: #385b40;
}

.online-user-dot {
	width: 8px;
	height: 8px;
}

.online-user-empty {
	padding: 9px 5px;
	font-size: 12px;
	color: #777;
}

/* =========================================================
   AVISO DE CONEXION
========================================================= */

.online-notice {
	width: fit-content;
	max-width: 90%;
	margin: 6px auto 8px;
	padding: 7px 14px;
	background: rgba(238, 248, 239, 0.97);
	border: 1px solid rgba(76, 126, 83, 0.16);
	border-radius: 999px;
	color: #416348;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	box-shadow: 0 4px 12px rgba(50, 90, 56, 0.08);
	animation: onlineNoticeAppear 0.25s ease;
}

@keyframes onlineNoticeAppear {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =========================================================
   CAJA DE MENSAJE + EMOJIS
========================================================= */

.chat-input-wrapper {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
}

.emoji-button {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	padding: 0;
	margin: 0 2px 0 4px;
	border: 0;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.emoji-button:hover {
	transform: scale(1.08);
}

.emoji-picker {
	position: absolute;
	left: 0;
	bottom: calc(100% + 8px);
	width: 290px;
	max-width: 90vw;
	padding: 10px;
	background: rgba(255, 255, 255, 0.99);
	border: 1px solid rgba(76, 126, 83, 0.18);
	border-radius: 15px;
	box-shadow: 0 10px 28px rgba(40, 70, 46, 0.2);
	z-index: 200;
}

.emoji-picker-title {
	padding: 3px 5px 9px;
	margin-bottom: 5px;
	border-bottom: 1px solid rgba(76, 126, 83, 0.12);
	font-size: 12px;
	font-weight: 700;
	color: #385b40;
}

.emoji-grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 2px;
	max-height: 220px;
	overflow-y: auto;
}

.emoji-item {
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	border-radius: 8px;
	font-size: 21px;
	line-height: 1;
	cursor: pointer;
}

.emoji-item:hover {
	background: rgba(76, 126, 83, 0.1);
	transform: scale(1.12);
}

/* =========================================================
   MOVIL
========================================================= */

@media screen and (max-width: 700px) {

	.online-users-button {
		padding: 5px 4px;
		font-size: 11px;
		gap: 5px;
	}

	.online-dot {
		width: 8px;
		height: 8px;
	}

	.online-users-list {
		right: -4px;
		width: 190px;
	}

	.online-user {
		font-size: 11px;
	}

	.emoji-picker {
		left: 0;
		width: 270px;
	}

	.emoji-grid {
		grid-template-columns: repeat(7, 1fr);
	}

	.emoji-item {
		width: 31px;
		height: 31px;
		font-size: 20px;
	}
}
/* =========================================================
   PANTALLA DE INGRESO - MOVIL
========================================================= */

@media screen and (max-width: 700px) {
	.name-box {
		width: 88%;
		max-width: 390px;
		padding: 28px 22px;
	}

	.name-box input {
		height: 48px;
		min-height: 48px;
		font-size: 16px;
		padding: 0 14px;
	}

	.name-box button {
		height: 48px;
		min-height: 48px;
		font-size: 15px;
	}
}
/* =========================================================
   REACCIONES TIPO WHATSAPP
========================================================= */

.message-bubble-wrapper {
	position: relative;
	display: inline-block;
	max-width: 100%;
}

.message-reaction-button {
	position: absolute;
	right: -30px;
	bottom: 0;

	width: 28px;
	height: 28px;

	padding: 0;
	margin: 0;

	border: 0;
	border-radius: 50%;

	background: rgba(255, 255, 255, 0.95);

	font-size: 15px;
	line-height: 28px;

	cursor: pointer;

	opacity: 0;
	transition:
		opacity 0.15s ease,
		transform 0.15s ease;
}

.message:hover .message-reaction-button {
	opacity: 1;
}

.message-reaction-button:hover {
	transform: scale(1.12);
}

.reaction-picker {
	position: absolute;
	left: 0;
	bottom: calc(100% + 7px);

	display: flex;
	align-items: center;
	gap: 3px;

	padding: 6px 8px;

	background: rgba(255, 255, 255, 0.99);

	border: 1px solid rgba(76, 126, 83, 0.18);
	border-radius: 999px;

	box-shadow: 0 7px 20px rgba(40, 70, 46, 0.18);

	z-index: 150;
}

.reaction-option {
	width: 34px;
	height: 34px;

	padding: 0;
	margin: 0;

	border: 0;
	border-radius: 50%;

	background: transparent;

	font-size: 21px;
	line-height: 34px;

	cursor: pointer;

	transition:
		background 0.12s ease,
		transform 0.12s ease;
}

.reaction-option:hover {
	background: rgba(76, 126, 83, 0.09);
	transform: scale(1.18);
}

.message-reactions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;

	margin-top: 4px;
}

.message-reaction {
	display: inline-flex;
	align-items: center;
	gap: 3px;

	height: 25px;

	padding: 2px 7px;

	margin: 0;

	border: 1px solid rgba(76, 126, 83, 0.15);
	border-radius: 999px;

	background: rgba(255, 255, 255, 0.95);

	font-size: 13px;
	line-height: 20px;

	cursor: pointer;

	box-shadow: 0 2px 5px rgba(40, 70, 46, 0.08);
}

.message-reaction:hover {
	transform: translateY(-1px);
}

.message-reaction.my-reaction {
	background: rgba(226, 244, 229, 0.98);
	border-color: rgba(66, 168, 95, 0.3);
}

/* MÓVIL */

@media screen and (max-width: 700px) {
	.message-reaction-button {
		opacity: 1;

		right: -5px;
		bottom: -10px;

		width: 25px;
		height: 25px;

		font-size: 14px;
		line-height: 25px;
	}

	.reaction-picker {
		left: auto;
		right: 0;

		max-width: calc(100vw - 30px);

		padding: 5px 6px;
	}

	.reaction-option {
		width: 31px;
		height: 31px;

		font-size: 19px;
		line-height: 31px;
	}

	.message-reactions {
		margin-top: 6px;
	}

	.message-reaction {
		height: 23px;
		padding: 2px 6px;
		font-size: 12px;
	}
}
/* =========================================================
   CORRECCION DE BURBUJAS DE MENSAJES
   Evita que palabras cortas se partan innecesariamente
========================================================= */

.message-bubble-wrapper {
	display: inline-block;
	width: fit-content;
	max-width: min(78vw, 460px);
}

.message-bubble {
	width: fit-content;
	min-width: 70px;
	max-width: 100%;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
}

.message {
	margin-bottom: 8px;
}

.message-meta {
	margin-bottom: 3px;
}

.message-reactions {
	margin-top: 2px;
	margin-bottom: 2px;
}

/* Mensajes propios y de otros más compactos */

.my-message,
.other-message {
	max-width: 82%;
}

/* En celular */

@media screen and (max-width: 700px) {

	.message {
		margin-bottom: 6px;
	}

	.message-bubble-wrapper {
		max-width: 72vw;
	}

	.message-bubble {
		min-width: 72px;
		max-width: 72vw;
		white-space: normal;
		word-break: normal;
		overflow-wrap: break-word;
	}

	.my-message,
	.other-message {
		max-width: 86%;
	}

	.message-meta {
		margin-bottom: 2px;
	}
}


/* AJUSTE DEFINITIVO: encabezado y reacción cercana */
.chat-live {
	width: max-content !important;
	min-width: 0 !important;
	flex-direction: row !important;
	align-items: center !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	white-space: nowrap;
}

.message-bubble-wrapper {
	position: relative !important;
}

.message-reaction-button {
	position: absolute !important;
	right: -8px !important;
	bottom: -8px !important;
	width: 28px !important;
	height: 28px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 1px solid rgba(76,126,83,.20) !important;
	border-radius: 50% !important;
	background: rgba(255,255,255,.96) !important;
	font-size: 15px !important;
	line-height: 1 !important;
	opacity: 1 !important;
	z-index: 20 !important;
}

.message-reaction-button:hover {
	transform: scale(1.08);
}

@media screen and (min-width: 701px) {
	.message-bubble-wrapper {
		max-width: 760px !important;
	}

	.message-bubble {
		max-width: 760px !important;
	}

	.message-reaction-button {
		right: -8px !important;
		bottom: -8px !important;
	}
}

@media screen and (max-width: 700px) {
	.chat-live {
		width: max-content !important;
		max-width: calc(100% - 20px) !important;
		flex-direction: row !important;
	}

	.message-reaction-button {
		right: -8px !important;
		bottom: -8px !important;
	}
}

/* CORRECCION FINAL - ENCABEZADO Y REACCION CERCANA */
.chat-live {
	position: absolute !important;
	right: 20px !important;
	top: 18px !important;
	width: max-content !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 8px 14px !important;
	z-index: 20 !important;
	box-sizing: border-box !important;
}

.message-bubble-wrapper {
	position: relative !important;
	display: inline-block !important;
	width: fit-content !important;
	max-width: 760px !important;
}

.message-bubble {
	width: fit-content !important;
	max-width: 760px !important;
	white-space: normal !important;
	word-break: normal !important;
	overflow-wrap: break-word !important;
	text-align: left !important;
}

.message-reaction-button {
	right: -34px !important;
	bottom: -3px !important;
	opacity: 1 !important;
	z-index: 30 !important;
}

@media screen and (max-width: 700px) {
	.chat-live {
		right: 10px !important;
		top: 10px !important;
		padding: 6px 9px !important;
	}

	.message-bubble-wrapper {
		max-width: 72vw !important;
	}

	.message-bubble {
		max-width: 72vw !important;
	}

	.message-reaction-button {
		right: -34px !important;
		bottom: -3px !important;
	}
}

/* AVISO DE NUEVO MENSAJE */
.new-message-notice {
	position: sticky;
	top: 10px;
	z-index: 40;
	display: block;
	width: fit-content;
	max-width: calc(100% - 30px);
	margin: 8px auto 10px;
	padding: 8px 16px;
	border: 1px solid rgba(76, 126, 83, 0.22);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.97);
	color: #3f6948;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 5px 14px rgba(50, 90, 56, 0.12);
	cursor: pointer;
}

.new-message-notice:hover {
	transform: translateY(-1px);
}

@media screen and (max-width: 700px) {
	.new-message-notice {
		top: 8px;
		max-width: calc(100% - 24px);
		padding: 8px 13px;
		font-size: 12px;
	}
}
