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

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

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

/* Ventana */
.smscc-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;
}
.smscc-right .smscc-box { right: 0; }
.smscc-left  .smscc-box { left: 0; transform-origin: bottom left; }
.smscc-open .smscc-box {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

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

.smscc-avatar { position: relative; flex: none; width: 64px; height: 64px; }
.smscc-avatar > img,
.smscc-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;
}
.smscc-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--smscc-color);
	border: 2px solid #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.smscc-badge-icon, .smscc-badge-icon svg { width: 14px; height: 14px; display: block; color: #fff; object-fit: contain; }

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

.smscc-foot {
	display: flex;
	align-items: center;
	margin: 0;
	border-top: 1px solid #e6e6e6;
	background: #fafafa;
}
.smscc-foot .smscc-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;
}
.smscc-foot .smscc-input::placeholder { color: #8a8a8a; }
.smscc-foot .smscc-input:focus { outline: none; box-shadow: none; }
.smscc-foot .smscc-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;
}
.smscc-foot .smscc-send:hover,
.smscc-foot .smscc-send:focus-visible { color: var(--smscc-color); background: transparent; outline: none; }
.smscc-foot .smscc-send svg { width: 24px; height: 24px; }

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

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

/* Opción "solo móviles": se oculta en dispositivos con ratón */
@media (hover: hover) and (pointer: fine) {
	.smscc-mobile-only { display: none; }
}
