/* GD Theme Tweaks – Nach oben */

.gd-totop {
	--gd-totop-bg: var(--afn-dark, #141414);
	--gd-totop-fg: #fff;
	--gd-totop-ring: var(--afn-glow, var(--afn-accent, #C2410C));
	position: fixed;
	z-index: 9990;
	bottom: calc(var(--gd-totop-y, 24px) + var(--gd-totop-lift, 0px) + env(safe-area-inset-bottom, 0px));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--gd-totop-size, 44px);
	height: var(--gd-totop-size, 44px);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--gd-totop-radius, 10px);
	background: var(--gd-totop-bg);
	color: var(--gd-totop-fg);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--gd-totop-fg) 14%, transparent), 0 4px 14px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.25s, transform 0.25s, visibility 0s linear 0.25s, background-color 0.2s, bottom 0.25s ease;
}

.gd-totop[hidden] {
	display: none;
}

.gd-totop--right {
	right: var(--gd-totop-x, 24px);
}

.gd-totop--left {
	left: var(--gd-totop-x, 24px);
}

.gd-totop.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.25s, transform 0.25s, visibility 0s, background-color 0.2s, bottom 0.25s ease;
}

.gd-totop:hover {
	background: color-mix(in srgb, var(--gd-totop-bg) 82%, #fff);
}

.gd-totop:focus-visible {
	outline: 2px solid var(--gd-totop-ring);
	outline-offset: 3px;
}

.gd-totop__icon {
	display: inline-flex;
	font-size: calc(var(--gd-totop-size, 44px) * 0.36);
	line-height: 1;
}

.gd-totop__icon svg {
	display: block;
	width: 1em;
	height: 1em;
}

/* Ring: Fortschritt der Seite */
.gd-totop__ring {
	position: absolute;
	inset: 3px;
	width: calc(100% - 6px);
	height: calc(100% - 6px);
	transform: rotate(-90deg);
	pointer-events: none;
}

.gd-totop__ring circle {
	fill: none;
	stroke-width: 2.2;
}

.gd-totop__track {
	stroke: color-mix(in srgb, var(--gd-totop-fg) 18%, transparent);
}

.gd-totop__bar {
	stroke: var(--gd-totop-ring);
	stroke-dasharray: 100;
	stroke-dashoffset: var(--gd-totop-progress, 100);
	stroke-linecap: round;
}

@media (prefers-reduced-motion: reduce) {
	.gd-totop,
	.gd-totop.is-visible {
		transition: none;
		transform: none;
	}
}

@media print {
	.gd-totop {
		display: none !important;
	}
}
