:root {
	--zmst-accent: #c9002b;
	--zmst-accent-dark: #a90024;
	--zmst-surface: rgba(255, 255, 255, .94);
	--zmst-border: rgba(201, 0, 43, .18);
	--zmst-shadow: 0 14px 34px rgba(15, 23, 42, .18);
}

.zmst-scroll-top {
	position: fixed;
	right: 22px;
	bottom: calc(22px + env(safe-area-inset-bottom));
	z-index: 9997;
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 1px solid var(--zmst-border);
	border-radius: 999px;
	background: var(--zmst-surface);
	box-shadow: var(--zmst-shadow);
	color: var(--zmst-accent);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translate3d(0, 14px, 0) scale(.96);
	transition:
		opacity .22s ease,
		visibility .22s ease,
		transform .22s ease,
		background-color .22s ease,
		color .22s ease,
		box-shadow .22s ease;
	pointer-events: none;
	-webkit-tap-highlight-color: transparent;
	backdrop-filter: blur(8px);
}

.zmst-scroll-top.is-visible {
	opacity: .96;
	visibility: visible;
	transform: translate3d(0, 0, 0) scale(1);
	pointer-events: auto;
}

.zmst-scroll-top:hover,
.zmst-scroll-top:focus-visible {
	background: linear-gradient(180deg, var(--zmst-accent), var(--zmst-accent-dark));
	color: #fff;
	box-shadow: 0 16px 36px rgba(201, 0, 43, .28);
	outline: 0;
	transform: translate3d(0, -2px, 0) scale(1);
}

.zmst-scroll-top:focus-visible {
	outline: 3px solid rgba(201, 0, 43, .25);
	outline-offset: 4px;
}

.zmst-scroll-top__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.zmst-scroll-top svg {
	display: block;
	fill: currentColor;
}

@media (max-width: 768px) {
	.zmst-scroll-top {
		right: 12px;
		bottom: calc(18px + env(safe-area-inset-bottom));
		width: 42px;
		height: 42px;
		box-shadow: 0 10px 24px rgba(15, 23, 42, .15);
	}

	.zmst-scroll-top.is-visible {
		opacity: .88;
	}

	.zmst-scroll-top:hover,
	.zmst-scroll-top:focus-visible {
		opacity: 1;
	}

	.zmst-scroll-top svg {
		width: 20px;
		height: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zmst-scroll-top {
		transition: none;
	}
}

@media print {
	.zmst-scroll-top {
		display: none !important;
	}
}
