.wacc {
	--wacc-color: #66cf72;
	--wacc-bottom: 20px;
	position: fixed;
	bottom: var(--wacc-bottom);
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
}
.wacc-right { right: 20px; }
.wacc-left  { left: 20px; }
.wacc *, .wacc *::before, .wacc *::after { box-sizing: border-box; }

/* Botón */
.wacc-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--wacc-color);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}
.wacc-right .wacc-toggle { margin-left: auto; }
.wacc-toggle:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); color: #fff; }
.wacc-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--wacc-color); }

.wacc-ico {
	position: absolute;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .2s ease, transform .25s ease;
}
.wacc-ico svg, img.wacc-ico { width: 32px; height: 32px; display: block; object-fit: contain; }
.wacc-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.wacc-ico-close svg { width: 26px; height: 26px; }
.wacc-open .wacc-ico-open  { opacity: 0; transform: rotate(90deg) scale(.6); }
.wacc-open .wacc-ico-close { opacity: 1; transform: none; }

/* Ventana */
.wacc-box {
	position: absolute;
	bottom: 80px;
	width: 380px;
	max-width: calc(100vw - 40px);
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.wacc-right .wacc-box { right: 0; }
.wacc-left  .wacc-box { left: 0; transform-origin: bottom left; }
.wacc-open .wacc-box {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

.wacc-head {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 20px 18px 24px;
	background: var(--wacc-color);
	color: #fff;
}
.wacc-agent { flex: 1; min-width: 0; }
.wacc-agent strong { display: block; font-size: 18px; font-weight: 700; }
.wacc-agent span {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	font-style: italic;
	opacity: .9;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wacc-avatar { position: relative; flex: none; width: 64px; height: 64px; }
.wacc-avatar > img,
.wacc-initials {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 3px solid #fff;
	object-fit: cover;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .25);
	font-size: 22px;
	font-weight: 700;
	color: #fff;
}
.wacc-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--wacc-color);
	border: 2px solid #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wacc-badge-icon, .wacc-badge-icon svg { width: 14px; height: 14px; display: block; color: #fff; object-fit: contain; }

.wacc-body { padding: 30px 24px 34px; background: #fff; }
.wacc-bubble {
	position: relative;
	margin-left: auto;
	max-width: 88%;
	padding: 16px 20px;
	border-radius: 8px;
	background: var(--wacc-color);
	color: #fff;
	font-size: 16px;
	line-height: 1.55;
}
.wacc-bubble::before {
	content: "";
	position: absolute;
	top: -10px;
	right: 50px;
	border: 10px solid transparent;
	border-top: 0;
	border-bottom-color: var(--wacc-color);
}
.wacc-left .wacc-bubble { margin-left: 0; margin-right: auto; }
.wacc-left .wacc-bubble::before { right: auto; left: 30px; }

.wacc-foot {
	display: flex;
	align-items: center;
	margin: 0;
	border-top: 1px solid #e6e6e6;
	background: #fafafa;
}
.wacc-foot .wacc-input {
	flex: 1;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 20px 12px 20px 24px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-size: 16px;
	color: #222;
}
.wacc-foot .wacc-input::placeholder { color: #8a8a8a; }
.wacc-foot .wacc-input:focus { outline: none; box-shadow: none; }
.wacc-foot .wacc-send {
	flex: none;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #8a8a8a;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color .15s ease;
}
.wacc-foot .wacc-send:hover,
.wacc-foot .wacc-send:focus-visible { color: var(--wacc-color); background: transparent; outline: none; }
.wacc-foot .wacc-send svg { width: 24px; height: 24px; }

@media (max-width: 600px) {
	.wacc-right { right: 16px; }
	.wacc-left  { left: 16px; }
	.wacc-toggle { width: 58px; height: 58px; }
	.wacc-box { bottom: 72px; max-width: calc(100vw - 32px); }
	.wacc-head { padding: 16px 16px 16px 20px; }
	.wacc-agent strong { font-size: 17px; }
	.wacc-body { padding: 26px 18px 28px; }
	.wacc-bubble { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
	.wacc-toggle, .wacc-ico, .wacc-box { transition: none; }
}
