/* MRD Cookie Consent */
#mrd-cc[hidden],
.mrd-cc-reopen[hidden],
#mrd-cc [hidden] {
	display: none !important;
}

#mrd-cc {
	--mrd-cc-primary: #2563eb;
	--mrd-cc-primary-text: #ffffff;
	--mrd-cc-text: #1f2937;
	--mrd-cc-link: #2563eb;
	--mrd-cc-radius: 16px;
	--mrd-cc-btn-radius: 999px;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	font-family: inherit;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

#mrd-cc *,
#mrd-cc *::before,
#mrd-cc *::after {
	box-sizing: border-box;
}

#mrd-cc .mrd-cc__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.45);
	pointer-events: auto;
}

#mrd-cc[data-backdrop="0"] .mrd-cc__backdrop {
	display: none;
}

#mrd-cc .mrd-cc__box {
	pointer-events: auto;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 48px);
	max-width: 630px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: #ffffff;
	color: var(--mrd-cc-text);
	border-radius: var(--mrd-cc-radius);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
	padding: 34px 38px 32px;
	text-align: left;
	animation: mrd-cc-in 0.25s ease-out;
}

@keyframes mrd-cc-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

#mrd-cc .mrd-cc__title {
	margin: 0 0 14px;
	padding: 0;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--mrd-cc-text);
	letter-spacing: normal;
	text-transform: none;
}

#mrd-cc .mrd-cc__msg {
	margin: 0 0 26px;
	padding: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.7;
	color: var(--mrd-cc-text);
}

#mrd-cc .mrd-cc__msg a {
	color: var(--mrd-cc-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

#mrd-cc .mrd-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
}

#mrd-cc .mrd-cc__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-width: 130px;
	min-height: 48px;
	margin: 0;
	padding: 12px 22px;
	border-radius: var(--mrd-cc-btn-radius);
	border: 2px solid transparent;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

#mrd-cc .mrd-cc__btn--primary {
	background: var(--mrd-cc-primary);
	border-color: var(--mrd-cc-primary);
	color: var(--mrd-cc-primary-text);
}

#mrd-cc .mrd-cc__btn--primary:hover {
	filter: brightness(0.92);
}

#mrd-cc .mrd-cc__btn--ghost {
	background: transparent;
	border-color: #d1d5db;
	color: var(--mrd-cc-text);
}

#mrd-cc .mrd-cc__btn--ghost:hover {
	border-color: #9ca3af;
	background: #f9fafb;
}

#mrd-cc .mrd-cc__btn--link {
	flex: 0 0 auto;
	min-width: 0;
	padding: 12px 10px;
	background: transparent;
	border-color: transparent;
	color: var(--mrd-cc-text);
	font-weight: 400;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
}

#mrd-cc .mrd-cc__btn--link:hover {
	color: var(--mrd-cc-text);
	text-decoration-color: currentColor;
	background: transparent;
}

#mrd-cc .mrd-cc__actions--banner {
	align-items: center;
	gap: 8px 18px;
}

#mrd-cc .mrd-cc__actions--banner .mrd-cc__btn--primary {
	flex: 0 0 auto;
	min-width: 130px;
	padding-left: 24px;
	padding-right: 24px;
}

#mrd-cc .mrd-cc__btn:focus-visible {
	outline: 3px solid var(--mrd-cc-primary);
	outline-offset: 2px;
}

/* Preferences */
#mrd-cc .mrd-cc__cats {
	margin: 0 0 24px;
	border-top: 1px solid #e5e7eb;
}

#mrd-cc .mrd-cc__cat {
	padding: 14px 0;
	border-bottom: 1px solid #e5e7eb;
}

#mrd-cc .mrd-cc__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

#mrd-cc .mrd-cc__cat-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--mrd-cc-text);
	cursor: pointer;
}

#mrd-cc .mrd-cc__cat-desc {
	margin: 6px 0 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
	color: #4b5563;
}

#mrd-cc .mrd-cc__switch {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
}

#mrd-cc .mrd-cc__switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

#mrd-cc .mrd-cc__switch input:disabled {
	cursor: not-allowed;
}

#mrd-cc .mrd-cc__slider {
	position: absolute;
	inset: 0;
	background: #d1d5db;
	border-radius: 26px;
	transition: background-color 0.2s ease;
}

#mrd-cc .mrd-cc__slider::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 3px;
	width: 20px;
	height: 20px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease;
}

#mrd-cc .mrd-cc__switch input:checked + .mrd-cc__slider {
	background: var(--mrd-cc-primary);
}

#mrd-cc .mrd-cc__switch input:checked + .mrd-cc__slider::before {
	transform: translateX(20px);
}

#mrd-cc .mrd-cc__switch input:disabled + .mrd-cc__slider {
	opacity: 0.6;
}

#mrd-cc .mrd-cc__switch input:focus-visible + .mrd-cc__slider {
	outline: 3px solid var(--mrd-cc-primary);
	outline-offset: 2px;
}

/* Everything centred, text balanced over equal lines */
#mrd-cc .mrd-cc__title,
#mrd-cc .mrd-cc__msg {
	text-align: center;
	text-wrap: balance;
}

#mrd-cc .mrd-cc__actions {
	justify-content: center;
}

#mrd-cc .mrd-cc__cats {
	text-align: left;
}

/* Re-open button */
.mrd-cc-reopen {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482999;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	background: #ffffff;
	color: var(--mrd-cc-primary, #2563eb);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	cursor: pointer;
}

/* Mobile: bottom sheet, no overlay, never full screen */
@media (max-width: 767px) {
	#mrd-cc {
		inset: auto 0 0 0;
	}

	#mrd-cc .mrd-cc__backdrop {
		display: none;
	}

	#mrd-cc .mrd-cc__box {
		position: relative;
		left: auto;
		top: auto;
		transform: none;
		width: 100%;
		max-width: none;
		max-height: 45vh;
		border-radius: var(--mrd-cc-radius) var(--mrd-cc-radius) 0 0;
		padding: 28px 28px calc(28px + env(safe-area-inset-bottom));
		box-shadow: none;
		border-top: 1px solid #e5e7eb;
		animation: mrd-cc-up 0.25s ease-out;
	}

	#mrd-cc[data-view="prefs"] .mrd-cc__box {
		max-height: 70vh;
	}

	@keyframes mrd-cc-up {
		from { transform: translateY(30px); opacity: 0; }
		to { transform: none; opacity: 1; }
	}

	#mrd-cc .mrd-cc__title {
		font-size: 20px;
		margin-bottom: 6px;
	}

	#mrd-cc .mrd-cc__msg {
		font-size: 15px;
		line-height: 1.5;
		margin-bottom: 14px;
	}

	#mrd-cc .mrd-cc__actions {
		gap: 10px;
		flex-wrap: nowrap;
	}

	#mrd-cc .mrd-cc__btn {
		min-width: 0;
		min-height: 48px;
		padding: 10px 12px;
		font-size: 15px;
	}

	#mrd-cc .mrd-cc__btn--link {
		padding: 10px 4px;
	}

	#mrd-cc[data-view="prefs"] .mrd-cc__actions {
		position: sticky;
		bottom: 0;
		background: #ffffff;
		padding-top: 10px;
	}

	#mrd-cc .mrd-cc__cats {
		margin-bottom: 4px;
	}
}
