#ubpc-widget {
	--ubpc-surface: var(--ubpc-theme-surface, Canvas);
	--ubpc-ink: var(--ubpc-theme-ink, CanvasText);
	--ubpc-line: #8a8a8d66;
	--ubpc-line: color-mix(in srgb, var(--ubpc-ink) 22%, transparent);
	--ubpc-tint: var(--ubpc-surface);
	--ubpc-tint: color-mix(in srgb, var(--ubpc-surface) 93%, var(--ubpc-ink));
	--ubpc-gutter: 16px;
	--ubpc-offset: var(--ubpc-desktop-offset, 20px);
	--ubpc-safe-bottom: env(safe-area-inset-bottom, 0px);
	position: fixed;
	right: max(var(--ubpc-gutter), env(safe-area-inset-right, 0px));
	bottom: calc(max(var(--ubpc-offset), var(--ubpc-keyboard, 0px)) + var(--ubpc-safe-bottom));
	z-index: 10000;
	color: var(--ubpc-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
}

#ubpc-widget *,
#ubpc-widget *::before,
#ubpc-widget *::after {
	box-sizing: border-box;
}

#ubpc-widget[hidden],
#ubpc-widget [hidden] {
	display: none !important;
}

#ubpc-widget .ubpc-launcher {
	display: grid;
	width: 48px;
	height: 48px;
	min-width: 0;
	min-height: 0;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: var(--ubpc-theme-radius, 14px);
	background: transparent;
	box-shadow: none;
	color: var(--ubpc-ink);
	cursor: pointer;
	transition: opacity 160ms ease;
}

#ubpc-widget .ubpc-launcher-face {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	border: 1px solid var(--ubpc-line);
	border-radius: inherit;
	background: var(--ubpc-surface);
	box-shadow: 0 2px 10px #0002;
}

#ubpc-widget .ubpc-launcher:hover .ubpc-launcher-face {
	background: var(--ubpc-tint);
}

#ubpc-widget :is(button, input, a):focus-visible {
	outline: 2px solid var(--ubpc-ink);
	outline-offset: 3px;
}

#ubpc-widget a {
	color: var(--ubpc-ink);
	text-decoration: underline;
	text-underline-offset: .16em;
}

#ubpc-widget .ubpc-launcher-status {
	position: absolute;
	right: 0;
	bottom: calc(100% + 8px);
	width: max-content;
	max-width: min(260px, calc(100vw - 32px));
	padding: 8px 12px;
	border: 1px solid var(--ubpc-line);
	border-radius: 8px;
	background: var(--ubpc-surface);
	color: var(--ubpc-ink);
	box-shadow: 0 2px 10px #0002;
	font-size: 13px;
}

@media (max-width: 767px) {
	#ubpc-widget {
		--ubpc-gutter: 10px;
		--ubpc-offset: var(--ubpc-mobile-offset, 84px);
	}

	#ubpc-widget.ubpc-keyboard-open {
		--ubpc-offset: 10px;
		bottom: calc(var(--ubpc-keyboard, 0px) + 8px + var(--ubpc-safe-bottom));
	}

	#ubpc-widget .ubpc-launcher {
		width: 44px;
		height: 44px;
	}

	#ubpc-widget .ubpc-launcher-face {
		width: 38px;
		height: 38px;
	}

	#ubpc-widget .ubpc-launcher svg {
		width: 19px;
		height: 19px;
	}

	#ubpc-widget.ubpc-scrolling .ubpc-launcher:not(:focus-visible) {
		opacity: 0;
		pointer-events: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	#ubpc-widget .ubpc-launcher {
		transition: none;
	}
}

#ubpc-widget.ubpc-brand {
	--ubpc-surface: #21142e;
	--ubpc-ink: #f8edf9;
	--ubpc-line: #9670a655;
	--ubpc-tint: #31213e;
	--ubpc-gold: #e5ce8a;
	--ubpc-theme-radius: 13px;
}

#ubpc-widget.ubpc-brand .ubpc-launcher-face {
	border-color: #c6a75d80;
	background: linear-gradient(145deg, #39224c, #241432);
	color: var(--ubpc-gold);
	box-shadow: 0 5px 18px #160c2580;
}

#ubpc-widget.ubpc-brand .ubpc-launcher:hover .ubpc-launcher-face {
	background: #482c5d;
}
