/* Origin To-Top — appearance via --origin-totop-* custom properties
   (defaults below; the module sets them from the Tools settings). */
.origin-totop {
	--origin-totop-bottom: 20px;
	--origin-totop-side: 20px;
	--origin-totop-size: 44px;
	--origin-totop-radius: 12px;
	--origin-totop-bg: #0f172a;
	--origin-totop-icon: #ffffff;

	position: fixed;
	right: var(--origin-totop-side);
	bottom: var(--origin-totop-bottom);
	z-index: 999990;
	width: var(--origin-totop-size);
	height: var(--origin-totop-size);
	border: 0;
	border-radius: var(--origin-totop-radius);
	background: var(--origin-totop-bg);
	color: var(--origin-totop-icon);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Keep layout stable while toggling visibility via the hidden attribute. */
.origin-totop[hidden] {
	display: inline-flex;
}

.origin-totop:not([hidden]) {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.origin-totop--left {
	right: auto;
	left: var(--origin-totop-side);
}

/* Size any svg root inside the button (default or client-uploaded). */
.origin-totop svg {
	--origin-totop-icon-size: calc(var(--origin-totop-size) * 0.62);
	width: var(--origin-totop-icon-size);
	height: var(--origin-totop-icon-size);
	display: block;
	flex: 0 0 auto;
	fill: currentColor;
}

.origin-totop:hover,
.origin-totop:focus-visible {
	filter: brightness(1.12);
}

.origin-totop:focus-visible {
	outline: 2px solid var(--origin-totop-icon);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.origin-totop {
		transition: none;
	}
}