#scb-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.18);
	-webkit-tap-highlight-color: transparent;
	transform: translateY(calc(100% + var(--scb-y, 0px)));
	transition: transform 0.3s ease;
}

/* Once JS confirms the page has settled, hand control over to two separate values:
   --scb-hide (0% visible / 130% off-screen, always relative to the bar's OWN current
   size, so it stays correct whether the bar is expanded or collapsed to icons-only)
   and --scb-y (a px nudge upward to clear a cookie banner). Starts at 0/0, so this
   also slides the bar in from off-screen on first load. */
#scb-sticky-bar.scb-in {
	transform: translateY(calc(var(--scb-hide, 0%) + var(--scb-y, 0px)));
}

#scb-sticky-bar .scb-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 56px;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	color: var(--scb-text-color, #ffffff);
	text-decoration: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	transition: opacity 0.15s ease, filter 0.15s ease;
	white-space: nowrap;
}

#scb-sticky-bar.scb-single .scb-btn {
	flex: 1 1 100%;
}

#scb-sticky-bar .scb-btn:active {
	opacity: 0.85;
	filter: brightness(0.95);
}

#scb-sticky-bar .scb-btn .scb-ico {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

#scb-sticky-bar .scb-btn svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: currentColor;
	flex-shrink: 0;
}

#scb-sticky-bar .scb-btn .scb-label {
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
	opacity: 1;
	margin-left: 0;
	transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

/* Idle-collapsed state: icon only, label fades and shrinks away.
   The link itself is unchanged, so a single tap still calls/messages straight away. */
#scb-sticky-bar.scb-compact .scb-btn .scb-label {
	max-width: 0;
	opacity: 0;
	margin-left: 0;
}

#scb-sticky-bar.scb-compact .scb-btn {
	flex: 0 0 auto;
	min-width: 56px;
	padding-left: 16px;
	padding-right: 16px;
}

#scb-sticky-bar.scb-compact {
	justify-content: center;
	gap: 10px;
	background: transparent;
	box-shadow: none;
}

#scb-sticky-bar.scb-compact .scb-btn {
	border-radius: 999px;
	margin-bottom: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* Room at the very bottom of the page so the bar never sits on top of footer content.
   This is a real element (not body padding) so it can be hidden above the breakpoint,
   can have its own fill colour, and never leaves a gap on desktop. The height is
   measured from the live bar by frontend.js; 56px is only the pre-measure fallback. */
#scb-spacer {
	display: block;
	width: 100%;
	height: var(--scb-bar-h, 56px);
	margin: 0;
	padding: 0;
	background: var(--scb-space-color, transparent);
	pointer-events: none;
}

/* Optional attention animations, set per button in the plugin settings.
   They only move the icon, so the tap target and label never shift. */
#scb-sticky-bar .scb-anim-pulse .scb-ico::after {
	content: "";
	position: absolute;
	top: -5px;
	right: -5px;
	bottom: -5px;
	left: -5px;
	border: 2px solid currentColor;
	border-radius: 50%;
	opacity: 0;
	animation: scb-ring 1.8s ease-out infinite;
}

#scb-sticky-bar .scb-anim-pulse .scb-ico svg {
	animation: scb-beat 1.8s ease-in-out infinite;
}

#scb-sticky-bar .scb-anim-bounce .scb-ico {
	animation: scb-bounce 2s ease infinite;
}

@keyframes scb-ring {
	0%   { transform: scale(0.6); opacity: 0.8; }
	70%  { transform: scale(1.7); opacity: 0; }
	100% { transform: scale(1.7); opacity: 0; }
}

@keyframes scb-beat {
	0%, 100% { transform: scale(1); }
	15%      { transform: scale(1.2); }
	30%      { transform: scale(1); }
}

@keyframes scb-bounce {
	0%, 55%, 100% { transform: translateY(0); }
	65%           { transform: translateY(-7px); }
	75%           { transform: translateY(0); }
	85%           { transform: translateY(-3px); }
	92%           { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	#scb-sticky-bar .scb-anim-pulse .scb-ico::after,
	#scb-sticky-bar .scb-anim-pulse .scb-ico svg,
	#scb-sticky-bar .scb-anim-bounce .scb-ico {
		animation: none;
	}
}
