/* Limbic — asistente guiado. Colores de marca: #2d3e50 (azul noche), #08b774 (verde), #07704a (verde oscuro). */
.lchat {
	--lc-ink: #2d3e50;
	--lc-ink-2: #425b76;
	--lc-green: #08b774;
	--lc-green-2: #07704a;
	--lc-bg: #f2f5f8;
	--lc-ease: cubic-bezier(.2, .8, .2, 1);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--lc-ink);
}
.lchat *, .lchat *::before, .lchat *::after { box-sizing: border-box; }
.lchat [hidden] { display: none !important; }
.lchat p { margin: 0; padding: 0; }
.lchat button { font: inherit; cursor: pointer; }
.lchat-sr, .lchat-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* Burbuja */
.lchat-bubble {
	position: fixed; right: 20px; bottom: 20px; z-index: 99990;
	width: 62px; height: 62px; border-radius: 50%; border: 0; padding: 15px;
	background: var(--lc-ink); color: #fff;
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55), 0 0 0 4px rgba(255, 255, 255, .7);
	transition: transform .3s var(--lc-ease);
}
.lchat-bubble:hover { transform: scale(1.06); }
.lchat-bubble svg { width: 100%; height: 100%; display: block; }
.lchat-online { position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--lc-green); border: 2px solid #fff; }
.lchat-badge { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--lc-green); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }

/* Aviso */
.lchat-teaser {
	position: fixed; right: 20px; bottom: 96px; z-index: 99989;
	display: flex; align-items: flex-start; gap: 6px; max-width: 260px;
	background: #fff; padding: 14px 10px 14px 16px; border-radius: 14px 14px 4px 14px;
	box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .45);
	animation: lchat-in .6s var(--lc-ease) both;
}
.lchat-teaser-open { background: none; border: 0; padding: 0; text-align: left; color: var(--lc-ink); font-size: 14px; }
.lchat-teaser-close { background: none; border: 0; padding: 2px; width: 22px; height: 22px; color: var(--lc-ink-2); flex-shrink: 0; margin-top: -4px; }
.lchat-teaser-close svg, .lchat-close svg { width: 100%; height: 100%; display: block; }

/* Panel */
.lchat-panel {
	position: fixed; right: 20px; bottom: 96px; z-index: 99991;
	width: 380px; height: min(620px, calc(100vh - 130px));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--lc-bg); border-radius: 18px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5);
	transform-origin: bottom right; animation: lchat-open .4s var(--lc-ease) both;
}
.lchat-head { display: flex; align-items: center; gap: 12px; background: var(--lc-ink); color: #fff; padding: 12px 14px; }
.lchat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--lc-green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.lchat-hd { flex: 1; min-width: 0; line-height: 1.25; }
.lchat-hd p:first-child { font-weight: 700; font-size: 16px; color: #fff; }
.lchat-status { font-size: 12px; color: rgba(255, 255, 255, .7); }
.lchat-close { width: 38px; height: 38px; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: #fff; }
.lchat-close:hover { background: rgba(255, 255, 255, .12); }

.lchat-progress { height: 3px; background: rgba(45, 62, 80, .12); }
.lchat-progress span { display: block; height: 100%; width: 0; background: var(--lc-green); transition: width .4s var(--lc-ease); }

.lchat-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.lchat-msg { display: flex; animation: lchat-in .35s var(--lc-ease) both; margin: 0; padding: 0; }
.lchat-msg::before { content: none !important; }
.lchat-me { justify-content: flex-end; }
.lchat-b { max-width: 85%; padding: 8px 13px 5px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.lchat-bot .lchat-b { background: #fff; color: var(--lc-ink); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.lchat-me .lchat-b { background: var(--lc-green-2); color: #fff; border-bottom-right-radius: 4px; }
.lchat-time { display: block; text-align: right; font-size: 10px; margin-top: 2px; opacity: .55; }

.lchat-dots { display: flex; gap: 4px; background: #fff; padding: 14px 16px; border-radius: 14px; border-bottom-left-radius: 4px; color: var(--lc-ink-2); }
.lchat-dots span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: lchat-dot 1.1s infinite ease-in-out; }
.lchat-dots span:nth-child(2) { animation-delay: .15s; }
.lchat-dots span:nth-child(3) { animation-delay: .3s; }

/* Tarjetas de casos */
.lchat-cards-wrap { margin: 0 -12px; }
.lchat-cards { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 12px 4px; scrollbar-width: none; }
.lchat-cards::-webkit-scrollbar { display: none; }
.lchat-card { flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; text-decoration: none !important; color: var(--lc-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: box-shadow .2s; }
.lchat-card:hover { box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .25); }
.lchat-card img { width: 100%; height: 130px; object-fit: cover; display: block; max-width: none; }
.lchat-card-t { font-weight: 700; font-size: 15px; padding: 10px 12px 2px; }
.lchat-card-d { font-size: 13px; color: var(--lc-ink-2); padding: 0 12px; flex: 1; }
.lchat-card-cta { font-size: 13px; font-weight: 700; color: var(--lc-green-2); padding: 8px 12px 12px; }

.lchat-b p { white-space: pre-line; }

/* Clientes: logos (o nombre si aún no hay logo) */
.lchat-logos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 12px; }
.lchat-logo { display: flex; align-items: center; justify-content: center; height: 52px; padding: 8px; background: #fff; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--lc-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); overflow: hidden; }
.lchat-logo img { display: block; max-height: 30px; max-width: 100%; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.lchat-logo:hover img { filter: none; opacity: 1; }
@media (max-width: 360px) { .lchat-logos { grid-template-columns: repeat(3, 1fr); } }

/* Opciones */
.lchat-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 0 12px; }
.lchat-chips:not(:empty) { padding-bottom: 12px; }
.lchat-chip { border: 1.5px solid rgba(7, 112, 74, .45); background: #fff; color: var(--lc-green-2); padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.25; text-decoration: none !important; animation: lchat-in .35s var(--lc-ease) both; transition: background .2s, color .2s; }
.lchat-chip:hover, .lchat-chip:focus-visible { background: var(--lc-green-2); color: #fff; }
.lchat-chip-link::after { content: ' ↗'; }

/* Entrada */
.lchat-form { display: flex; align-items: center; gap: 8px; margin: 0; background: #fff; border-top: 1px solid #dde3ea; padding: 8px; }
.lchat-form input[type="text"]:not(.lchat-hp), .lchat-form input[type="tel"] { flex: 1; min-width: 0; height: auto; margin: 0; border: 0 !important; box-shadow: none !important; background: transparent; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--lc-ink); outline: none; }
.lchat-form button { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--lc-green); color: #fff; padding: 12px; }
.lchat-form button:hover { background: var(--lc-green-2); }
.lchat-form button svg { width: 100%; height: 100%; display: block; }
.lchat-legal { background: #fff; font-size: 10.5px; text-align: center; color: var(--lc-ink-2); padding: 0 10px 8px; }
.lchat-legal a { color: inherit; text-decoration: underline; }

@keyframes lchat-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes lchat-open { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes lchat-dot { 0%, 80%, 100% { opacity: .35; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 600px) {
	.lchat-panel { inset: 0; width: auto; height: auto; border-radius: 0; }
	html.lchat-open { overflow: hidden; }
	html.lchat-open .lchat-bubble { display: none; }
	.lchat-bubble { right: 14px; bottom: 14px; }
	.lchat-teaser { right: 14px; bottom: 88px; }
}
@media (prefers-reduced-motion: reduce) {
	.lchat-msg, .lchat-panel, .lchat-teaser, .lchat-chip { animation: none; }
	.lchat-dots span { animation: none; opacity: .6; }
	.lchat-bubble { transition: none; }
}
