/* Support Bubble — front-end styles */
.sb-widget {
	--sb-primary: #25D366;
	--sb-bottom: 24px;
	--sb-size: 50px;
	--sb-mlift: 0px;
	position: fixed;
	bottom: var(--sb-bottom);
	z-index: 99990;
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: inherit;
	line-height: 1.4;
}

.sb-widget [hidden] {
	display: none !important;
}

.sb-pos-right {
	right: 20px;
	align-items: flex-end;
}

.sb-pos-left {
	left: 20px;
	align-items: flex-start;
}

/* ---------- Main button ---------- */
.sb-button {
	position: relative;
	width: var(--sb-size);
	height: var(--sb-size);
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--sb-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	animation: sb-pop 0.35s ease both;
}

.sb-button:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.sb-button:focus-visible {
	outline: 3px solid var(--sb-primary);
	outline-offset: 2px;
}

/* ---------- Wave rings ---------- */
.sb-wave {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--sb-primary);
	opacity: 0;
	pointer-events: none;
	z-index: 0;
	animation: sb-wave 2.4s ease-out infinite;
}

.sb-wave-2 {
	animation-delay: 1.2s;
}

@keyframes sb-wave {
	0% {
		transform: scale(1);
		opacity: 0.55;
	}
	100% {
		transform: scale(1.9);
		opacity: 0;
	}
}

/* ---------- Rotating avatars ---------- */
.sb-avatars {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	overflow: hidden;
	z-index: 1;
}

.sb-avatar {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 0;
	transition: opacity 0.6s ease;
}

.sb-avatar.is-active {
	opacity: 1;
}

.sb-button .sb-glyph {
	display: block;
	position: relative;
	z-index: 1;
	width: 50%;
	height: 50%;
}

.sb-button-dot {
	position: absolute;
	right: calc(var(--sb-size) * 0.017);
	bottom: calc(var(--sb-size) * 0.017);
	width: calc(var(--sb-size) * 0.233);
	height: calc(var(--sb-size) * 0.233);
	border-radius: 50%;
	border: 2px solid #fff;
	box-sizing: border-box;
	z-index: 2;
}

/* ---------- Status dots ---------- */
.sb-dot-on {
	background: #31c453;
}

.sb-dot-off {
	background: #9aa0a6;
}

/* ---------- Greeting bubble ---------- */
.sb-greeting {
	position: relative;
	background: #fff;
	color: #222;
	border-radius: 14px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
	padding: 12px 36px 12px 16px;
	max-width: 260px;
	font-size: 14px;
	cursor: pointer;
	animation: sb-pop 0.3s ease both;
}

.sb-greeting-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.sb-greeting-text {
	display: block;
	transition: opacity 0.25s ease;
}

.sb-greeting-text.sb-fade-out {
	opacity: 0;
}

.sb-greeting::after {
	content: "";
	position: absolute;
	bottom: -7px;
	border: 8px solid transparent;
	border-top-color: #fff;
	border-bottom: 0;
}

/* The tail stays centred over the button whatever its size is
   (the tail itself is 16px wide, hence the -8px). */
.sb-pos-right .sb-greeting::after {
	right: calc(var(--sb-size) / 2 - 8px);
}

.sb-pos-left .sb-greeting::after {
	left: calc(var(--sb-size) / 2 - 8px);
}

.sb-greeting-close {
	position: absolute;
	top: 4px;
	right: 8px;
	background: none;
	border: none;
	padding: 2px 4px;
	font-size: 18px;
	line-height: 1;
	color: #888;
	cursor: pointer;
	z-index: 1;
}

.sb-greeting-close:hover {
	color: #333;
}

/* ---------- Animation ---------- */
@keyframes sb-pop {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ---------- Mobile adjustments (v1.1.3) ----------
   On small screens the whole widget (button + greeting bubble)
   can be lifted above a theme's sticky bottom bar via the
   Mobile lift setting, and the button can take the smaller
   Mobile button size. Desktop is never affected. */
@media (max-width: 768px) {
	.sb-widget {
		bottom: calc(var(--sb-bottom) + var(--sb-mlift, 0px));
	}

	.sb-widget.sb-has-msize {
		--sb-size: var(--sb-msize);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sb-widget *,
	.sb-widget *::before,
	.sb-widget *::after {
		animation: none !important;
		transition: none !important;
	}
}
