/* Guarino Responde 4.6 — chat del sitio. Colores, esquina, márgenes y formato del botón configurables desde el panel (variables --gr4-*). */
#gr4-chat {
	--gr4-acento: #ff7900;
	--gr4-texto-acento: #ffffff;
	--gr4-fondo: #fff8ef;
	--gr4-tinta: #22262a;
	--gr4-tinta-2: #5e666d;
	--gr4-borde: #e7e2da;
	--gr4-x: 20px; /* distancia al borde lateral (Ajustes) */
	--gr4-y: 20px; /* distancia al borde de arriba o de abajo (Ajustes) */
	position: fixed;
	z-index: 99990;
	font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--gr4-tinta);
}
#gr4-chat.gr4-bottom-right { right: var(--gr4-x); bottom: var(--gr4-y); }
#gr4-chat.gr4-bottom-left { left: var(--gr4-x); bottom: var(--gr4-y); }
#gr4-chat.gr4-top-right { right: var(--gr4-x); top: var(--gr4-y); }
#gr4-chat.gr4-top-left { left: var(--gr4-x); top: var(--gr4-y); }
#gr4-chat *, #gr4-chat *::before, #gr4-chat *::after { box-sizing: border-box; }

/* Botón que abre el chat. Mismas reglas en el sitio y en la vista previa de Ajustes (por eso no dependen de #gr4-chat). */
.gr4-lanzador {
	--gr4-t: var(--gr4-tam, 120px);
	border: 0; margin: 0; cursor: pointer; text-align: center;
	background: var(--gr4-acento, #ff7900); color: var(--gr4-texto-acento, #fff);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.gr4-lanzador, .gr4-lanzador * { box-sizing: border-box; }
.gr4-lanzador:focus-visible, .gr4-panel button:focus-visible, .gr4-form input:focus-visible { outline: 3px solid rgba(0, 0, 0, .35); outline-offset: 2px; }
.gr4-l-foto { display: block; flex: none; border-radius: 50%; }
.gr4-l-foto img { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; object-fit: cover; }
.gr4-abierto .gr4-lanzador { display: none; }

/* Compacto: ícono chico y el nombre al lado. */
.gr4-f-compacto { display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1; box-shadow: 0 6px 22px rgba(0, 0, 0, .18); }
.gr4-f-compacto:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(0, 0, 0, .22); }
.gr4-f-compacto .gr4-l-foto { width: 34px; height: 34px; }
.gr4-f-compacto .gr4-l-dos { display: none; }

/* Insignia: ícono grande arriba, dos líneas debajo, en forma de globo de diálogo con la punta hacia el borde. */
.gr4-f-insignia {
	position: relative; display: flex; flex-direction: column; align-items: center;
	width: var(--gr4-t); padding: calc(var(--gr4-t) * .08) calc(var(--gr4-t) * .07) calc(var(--gr4-t) * .09);
	margin-bottom: calc(var(--gr4-t) * .16); /* lugar para la punta */
	border-radius: calc(var(--gr4-t) * .14);
	filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .22));
}
.gr4-f-insignia::after {
	content: ""; position: absolute; top: calc(100% - 1px); left: 6%;
	width: 42%; height: calc(var(--gr4-t) * .17);
	background: inherit; clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.gr4-bottom-left .gr4-f-insignia::after, .gr4-top-left .gr4-f-insignia::after { left: auto; right: 6%; clip-path: polygon(0 0, 100% 0, 0 100%); }
.gr4-f-insignia:hover { transform: translateY(-2px); filter: drop-shadow(0 9px 16px rgba(0, 0, 0, .28)); }
.gr4-f-insignia .gr4-l-foto {
	width: 80%; aspect-ratio: 1 / 1; padding: 4%;
	background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), rgba(255, 255, 255, .08) 60%), rgba(0, 0, 0, .06);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.gr4-f-insignia .gr4-l-uno { display: none; } /* el nombre va en aria-label */
.gr4-l-dos { display: flex; flex-direction: column; width: 100%; margin-top: calc(var(--gr4-t) * .06); line-height: 1.02; text-transform: uppercase; overflow-wrap: anywhere; }
.gr4-l1 { font-size: calc(var(--gr4-t) * .165); font-weight: 400; letter-spacing: .01em; }
.gr4-l2 { font-size: calc(var(--gr4-t) * .145); font-weight: 800; letter-spacing: .01em; }
.gr4-l1:empty, .gr4-l2:empty { display: none; }

.gr4-panel {
	position: absolute; bottom: 0; width: 380px; max-width: calc(100vw - 24px);
	height: min(600px, calc(100vh - var(--gr4-y) - 20px)); display: flex; flex-direction: column;
	background: #fff; border-radius: 16px; overflow: hidden;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .22); border: 1px solid var(--gr4-borde);
}
.gr4-bottom-right .gr4-panel, .gr4-top-right .gr4-panel { right: 0; }
.gr4-bottom-left .gr4-panel, .gr4-top-left .gr4-panel { left: 0; }
.gr4-top-right .gr4-panel, .gr4-top-left .gr4-panel { bottom: auto; top: 0; } /* arriba: el panel se abre hacia abajo */
.gr4-panel[hidden] { display: none; }

.gr4-cab { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--gr4-acento); color: var(--gr4-texto-acento); }
.gr4-cab img { width: 36px; height: 36px; border-radius: 50%; background: #fff; object-fit: cover; }
.gr4-cab div { flex: 1; min-width: 0; }
.gr4-cab strong { display: block; font-size: 15px; font-weight: 600; }
.gr4-cab small { display: block; font-size: 11.5px; opacity: .9; }
.gr4-cab button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.gr4-cab button:hover { background: rgba(255, 255, 255, .3); }

.gr4-mensajes { flex: 1; overflow-y: auto; padding: 14px; background: var(--gr4-fondo); display: flex; flex-direction: column; gap: 10px; }
.gr4-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; }
.gr4-msg p { margin: 0 0 6px; }
.gr4-msg p:last-child { margin-bottom: 0; }
.gr4-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.gr4-msg li { margin: 2px 0; }
.gr4-msg strong { font-weight: 600; }
.gr4-bot { align-self: flex-start; background: #fff; border: 1px solid var(--gr4-borde); border-bottom-left-radius: 4px; }
.gr4-yo { align-self: flex-end; background: var(--gr4-acento); color: var(--gr4-texto-acento); border-bottom-right-radius: 4px; }
.gr4-nuevo { animation: gr4-entra .18s ease-out; }
@keyframes gr4-entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.gr4-fuentes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--gr4-borde); }
.gr4-fuentes a { font-size: 12px; color: var(--gr4-tinta); background: #f4f1ec; padding: 3px 9px; border-radius: 999px; text-decoration: none; }
.gr4-fuentes a:hover { background: #ebe5dc; text-decoration: underline; }

.gr4-escribiendo { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.gr4-puntos { display: inline-flex; gap: 4px; }
.gr4-puntos span { width: 7px; height: 7px; border-radius: 50%; background: var(--gr4-tinta-2); opacity: .4; animation: gr4-punto 1s infinite; }
.gr4-puntos span:nth-child(2) { animation-delay: .15s; }
.gr4-puntos span:nth-child(3) { animation-delay: .3s; }
.gr4-pensando { font-style: normal; font-size: 13px; color: var(--gr4-tinta-2); }
@keyframes gr4-punto { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: .8; transform: translateY(-3px); } }

.gr4-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
.gr4-chips[hidden] { display: none; }
.gr4-chip { border: 1px solid var(--gr4-borde); background: #fff; color: var(--gr4-tinta); border-radius: 999px; padding: 5px 11px; font: 400 12.5px/1.3 inherit; cursor: pointer; }
.gr4-chip:hover { border-color: var(--gr4-acento); color: var(--gr4-acento); }

.gr4-form { display: flex; gap: 8px; padding: 10px 12px; background: #fff; }
.gr4-form input { flex: 1; min-width: 0; border: 1px solid var(--gr4-borde); border-radius: 999px; padding: 9px 14px; font: inherit; color: var(--gr4-tinta); background: #fff; }
.gr4-form input:focus { border-color: var(--gr4-acento); outline: none; }
.gr4-form button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--gr4-acento); color: var(--gr4-texto-acento); font-size: 15px; cursor: pointer; }
.gr4-pie { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 10.5px; color: var(--gr4-tinta-2); text-align: center; }
.gr4-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
	/* En el celular, como mucho 16px de margen para no tapar contenido. */
	#gr4-chat.gr4-bottom-right { right: min(var(--gr4-x), 16px); bottom: min(var(--gr4-y), 16px); }
	#gr4-chat.gr4-bottom-left { left: min(var(--gr4-x), 16px); bottom: min(var(--gr4-y), 16px); }
	#gr4-chat.gr4-top-right { right: min(var(--gr4-x), 16px); top: min(var(--gr4-y), 16px); }
	#gr4-chat.gr4-top-left { left: min(var(--gr4-x), 16px); top: min(var(--gr4-y), 16px); }
	.gr4-f-compacto .gr4-l-uno { display: none; }
	.gr4-f-compacto { padding: 7px; }
	#gr4-chat .gr4-f-insignia { --gr4-t: min(var(--gr4-tam, 120px), 96px); } /* en el celular, como mucho 96 px */
	.gr4-abierto { left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; }
	.gr4-abierto .gr4-panel { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; height: 88vh; border-radius: 16px 16px 0 0; }
	.gr4-form input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.gr4-nuevo, .gr4-puntos span { animation: none; }
	.gr4-lanzador { transition: none; }
}

/* 4.7 — "¿Te sirvió?" */
.gr4-voto { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--gr4-tinta-2); }
.gr4-voto button { border: 1px solid var(--gr4-borde); background: #fff; border-radius: 999px; padding: 2px 9px; font-size: 13px; line-height: 1.4; cursor: pointer; }
.gr4-voto button:hover { border-color: var(--gr4-acento); }

/* 4.11 — tablas de precios dentro de la respuesta (se desplazan de costado en pantallas chicas) */
#gr4-chat .gr4-tabla { overflow-x: auto; margin: 6px 0 8px; -webkit-overflow-scrolling: touch; }
#gr4-chat .gr4-tabla table { border-collapse: collapse; width: 100%; font-size: 12.5px; line-height: 1.35; }
#gr4-chat .gr4-tabla th, #gr4-chat .gr4-tabla td { padding: 4px 6px; border-bottom: 1px solid rgba(0,0,0,.08); text-align: left; vertical-align: top; }
#gr4-chat .gr4-tabla th { font-weight: 700; background: rgba(0,0,0,.04); white-space: nowrap; }
#gr4-chat .gr4-tabla td:not(:first-child), #gr4-chat .gr4-tabla th:not(:first-child) { text-align: right; white-space: nowrap; }
#gr4-chat .gr4-legal { font-size: 11px; line-height: 1.35; opacity: .85; margin: 4px 12px 8px; }
#gr4-chat .gr4-legal summary { cursor: pointer; list-style: none; }
#gr4-chat .gr4-legal summary::-webkit-details-marker { display: none; }
#gr4-chat .gr4-legal summary span { text-decoration: underline; }
#gr4-chat .gr4-legal p { margin: 4px 0 0; max-height: 120px; overflow-y: auto; }
#gr4-chat .gr4-legal a { color: inherit; text-decoration: underline; }
