.dse-consent {
	position: fixed;
	right: var(--dse-space-4);
	bottom: var(--dse-space-4);
	z-index: 99990;
	display: flex;
	flex-direction: column;
	gap: var(--dse-space-3);
	width: min(440px, calc(100vw - 2 * var(--dse-space-4)));
	max-height: calc(100dvh - 2 * var(--dse-space-4));
	padding: var(--dse-space-5);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--dse-line);
	border-radius: var(--dse-radius-lg);
	background: var(--dse-surface);
	box-shadow: var(--dse-shadow-md);
	color: var(--dse-ink);
	font-family: var(--dse-font-sans);
	animation: dse-consent-in 0.2s ease-out;
}

.dse-consent[hidden] {
	display: none;
}

@keyframes dse-consent-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

.dse-consent:focus-visible {
	outline-offset: -3px;
}

:root .dse-consent__title {
	margin: 0;
	color: var(--dse-ink);
	font-size: 18px;
	line-height: 26px;
	font-weight: 800;
}

:root .dse-consent__text {
	margin: 0;
	color: var(--dse-ink-muted);
	font-size: 14px;
	line-height: 22px;
}

.dse-consent__prefs {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--dse-line);
}

.dse-consent__prefs[hidden] {
	display: none;
}

.dse-consent__cat {
	padding: var(--dse-space-3) 0;
	border-bottom: 1px solid var(--dse-line);
}

:root .dse-consent__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--dse-space-3);
	min-height: 28px;
	margin: 0;
	color: var(--dse-ink);
	font-size: 15px;
	line-height: 22px;
	font-weight: 700;
}

label.dse-consent__cat-head {
	cursor: pointer;
}

.dse-consent__always {
	color: var(--dse-success);
	font-size: 13px;
	font-weight: 700;
}

:root .dse-consent__cat-text {
	margin: var(--dse-space-1) 0 0;
	color: var(--dse-ink-muted);
	font-size: 13px;
	line-height: 20px;
}

.dse-consent__switch {
	position: relative;
	flex: none;
	width: 44px;
	height: 24px;
	margin: 0;
	border: 0;
	border-radius: var(--dse-radius-full);
	background: var(--dse-line-strong);
	appearance: none;
	cursor: pointer;
	transition: background-color 0.2s;
}

.dse-consent__switch::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: var(--dse-radius-full);
	background: var(--dse-surface);
	transition: transform 0.2s;
}

.dse-consent__switch:checked {
	background: var(--dse-primary);
}

.dse-consent__switch:checked::before {
	transform: translateX(20px);
}

.dse-consent__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--dse-space-2);
}

:root .dse-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 var(--dse-space-4);
	border: 2px solid var(--dse-primary);
	border-radius: var(--dse-radius-md);
	font: 700 16px/22px var(--dse-font-sans);
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

:root .dse-consent__btn[hidden] {
	display: none;
}

:root .dse-consent__btn--choice {
	background: var(--dse-primary);
	color: var(--dse-on-primary);
}

:root .dse-consent__btn--choice:hover {
	border-color: var(--dse-primary-hover);
	background: var(--dse-primary-hover);
	color: var(--dse-on-primary);
}

:root .dse-consent__btn--more {
	grid-column: 1 / -1;
	background: transparent;
	color: var(--dse-primary);
}

:root .dse-consent__btn--more:hover {
	background: var(--dse-surface-tint);
	color: var(--dse-primary-hover);
}

:root .dse-consent__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--dse-space-1) var(--dse-space-5);
	margin: 0;
	font-size: 13px;
	line-height: 20px;
}

:root .dse-consent__links a {
	color: var(--dse-ink-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

:root .dse-consent__links a:hover {
	color: var(--dse-primary);
}

:root .dse-consent-settings {
	display: inline-block;
	padding: var(--dse-space-1) 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--dse-ink-muted);
	font: 500 14px/22px var(--dse-font-sans);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 4px;
	cursor: pointer;
}

:root .dse-consent-settings:hover {
	background: none;
	color: var(--dse-ink);
	text-decoration-color: var(--dse-primary);
}

.dse-consent-strip {
	padding: var(--dse-space-2) var(--dse-gutter);
	text-align: center;
}

@media (max-width: 480px) {
	.dse-consent {
		right: var(--dse-space-3);
		bottom: var(--dse-space-3);
		width: calc(100vw - 2 * var(--dse-space-3));
		max-height: calc(100dvh - 2 * var(--dse-space-3));
		padding: 20px var(--dse-space-4);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dse-consent {
		animation: none;
	}

	.dse-consent__switch,
	.dse-consent__switch::before,
	:root .dse-consent__btn {
		transition: none;
	}
}
