.wama {
	--wama-color: #25D366;
	--wama-ink: #1c2b33;
	--wama-muted: #667781;
	--wama-surface: #ffffff;
	--wama-soft: #f0f2f5;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.35;
}
.wama--right { right: 20px; align-items: flex-end; }
.wama--left  { left: 20px;  align-items: flex-start; }
.wama *, .wama *::before, .wama *::after { box-sizing: border-box; }

/* Botón flotante */
.wama-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	color: inherit;
}
/* Ubicación del texto respecto al icono */
.wama--label-left   .wama-toggle { flex-direction: row; }
.wama--label-right  .wama-toggle { flex-direction: row-reverse; }
.wama--label-top    .wama-toggle { flex-direction: column; gap: 8px; }
.wama--label-bottom .wama-toggle { flex-direction: column-reverse; gap: 8px; }
/* Arriba o abajo: icono y texto centrados entre sí */
.wama--label-top .wama-toggle,
.wama--label-bottom .wama-toggle { align-items: center; text-align: center; }
.wama-toggle__icon {
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--wama-color);
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
	transition: transform .2s ease;
}
.wama-toggle:hover .wama-toggle__icon { transform: scale(1.06); }
.wama-toggle__label {
	background: var(--wama-surface);
	color: var(--wama-ink);
	padding: 8px 14px;
	border-radius: 20px;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .15);
	font-weight: 600;
	white-space: nowrap;
}
.wama.is-open .wama-toggle__label { display: none; }
.wama-toggle:focus-visible .wama-toggle__icon,
.wama-agent:focus-visible,
.wama-close:focus-visible {
	outline: 3px solid var(--wama-ink);
	outline-offset: 3px;
}

/* Burbuja */
.wama-panel {
	width: min(340px, calc(100vw - 40px));
	background: var(--wama-surface);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
	overflow: hidden;
	transform-origin: bottom right;
	animation: wama-in .18s ease-out;
}
.wama--left .wama-panel { transform-origin: bottom left; }
.wama-panel[hidden] { display: none; }
@keyframes wama-in {
	from { opacity: 0; transform: translateY(8px) scale(.97); }
	to   { opacity: 1; transform: none; }
}

.wama-panel__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 18px 16px;
	background: var(--wama-color);
	color: #fff;
}
.wama-panel__title { margin: 0; font-size: 17px; font-weight: 700; }
.wama-panel__subtitle { margin: 4px 0 0; font-size: 13.5px; opacity: .92; }
.wama-close {
	flex: none;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .15);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	padding-left: 7px;
	cursor: pointer;
}

.wama-list {
	list-style: none;
	margin: 0;
	padding: 8px;
	max-height: 60vh;
	overflow-y: auto;
}
.wama-list li { margin: 0; }
.wama-agent {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 12px;
	color: var(--wama-ink);
	text-decoration: none !important;
}
.wama-agent:hover { background: var(--wama-soft); }

.wama-avatar {
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wama-soft);
	display: grid;
	place-items: center;
}
.wama-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wama-avatar__initials { font-weight: 700; color: var(--wama-muted); }

.wama-agent__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wama-agent__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wama-agent__role { font-size: 13px; color: var(--wama-muted); }
.wama-agent__go { color: var(--wama-color); display: grid; }
.wama-agent__go svg { width: 22px; height: 22px; }

@media (max-width: 480px) {
	.wama { bottom: 14px; }
	.wama--right { right: 14px; }
	.wama--left { left: 14px; }
	.wama--label-left .wama-toggle__label,
	.wama--label-right .wama-toggle__label { display: none; }
	.wama--label-top .wama-toggle__label,
	.wama--label-bottom .wama-toggle__label { padding: 6px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.wama-panel { animation: none; }
	.wama-toggle__icon { transition: none; }
}

/* Icono personalizado */
.wama-icon-img { display: block; object-fit: contain; }
.wama-toggle__icon--custom .wama-icon-img { width: 34px; height: 34px; }
.wama-agent__go .wama-icon-img { width: 22px; height: 22px; }
