/**
 * Cookie banner and preferences. Loaded on the public frontend.
 * MASTER tokens unchanged. Equal-weight actions; no dark-pattern accent.
 * Mobile: stack actions below 480px so all three stay in view without inner scroll.
 */

.bne-consent-status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.bne-consent-banner {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 160;
	overflow: visible;
	padding: var(--bne-space-md) var(--bne-gutter) calc(var(--bne-space-md) + env(safe-area-inset-bottom, 0px));
	background: var(--bne-color-surface);
	color: var(--bne-color-text);
	border-top: 2px solid var(--bne-color-primary);
	box-shadow: 0 -1px 0 var(--bne-color-border);
}

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

.bne-has-cookie-banner .bne-mobile-bar {
	display: none;
}

@media (max-width: 1023px) {
	.bne-has-cookie-banner.bne-has-mobile-bar .bne-main,
	.bne-has-cookie-banner.bne-has-mobile-bar .bne-footer {
		padding-bottom: var(--bne-section-sm);
	}
}

.bne-consent-banner__inner {
	max-width: 72rem;
	margin: 0 auto;
}

.bne-consent-banner__title {
	margin: 0 0 var(--bne-space-xs);
	font-family: var(--bne-font-display);
	font-size: var(--bne-size-heading-3);
	font-weight: 700;
	color: var(--bne-color-text);
}

.bne-consent-banner__text,
.bne-consent-banner__note {
	margin: 0 0 var(--bne-space-sm);
	font-size: var(--bne-size-body, 1rem);
	line-height: 1.5;
}

.bne-consent-banner__note {
	font-family: var(--bne-font-mono);
	font-size: var(--bne-size-utility, 0.8125rem);
	color: var(--bne-color-text-muted);
}

.bne-consent-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bne-space-xs);
}

.bne-consent-btn {
	flex: 1 1 9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--bne-touch);
	min-width: 0;
	margin: 0;
	padding: var(--bne-space-sm) var(--bne-space-xs);
	border: 1px solid var(--bne-color-text);
	border-radius: var(--bne-radius);
	background: var(--bne-color-surface);
	color: var(--bne-color-text);
	font-family: var(--bne-font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	appearance: none;
	touch-action: manipulation;
}

.bne-consent-btn:hover,
.bne-consent-btn:focus-visible {
	background: var(--bne-color-surface-alt, var(--bne-color-surface));
}

@media (max-width: 479px) {
	.bne-consent-banner {
		padding-top: var(--bne-space-sm);
		padding-bottom: calc(var(--bne-space-sm) + env(safe-area-inset-bottom, 0px));
	}

	.bne-consent-banner__title {
		font-size: var(--bne-size-heading-4, 1.125rem);
	}

	.bne-consent-actions {
		display: grid;
		grid-template-columns: 1fr;
	}

	.bne-consent-btn {
		flex: none;
		width: 100%;
	}
}

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

.bne-consent-dialog {
	position: fixed;
	inset: 0;
	z-index: 220;
}

.bne-consent-dialog__backdrop {
	position: absolute;
	inset: 0;
	background: var(--bne-color-overlay);
}

.bne-consent-dialog__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(40rem, calc(100% - 2 * var(--bne-gutter)));
	max-height: min(90svh, 44rem);
	margin: 8vh auto 0;
	overflow: auto;
	padding: var(--bne-space-lg);
	background: var(--bne-color-surface);
	color: var(--bne-color-text);
	border-top: 2px solid var(--bne-color-primary);
}

@media (max-width: 767px) {
	.bne-consent-dialog__panel {
		width: 100%;
		max-height: min(92svh, 100%);
		margin: auto 0 0;
		padding-bottom: calc(var(--bne-space-lg) + env(safe-area-inset-bottom, 0px));
	}
}

.bne-consent-dialog__panel h2 {
	margin: 0 0 var(--bne-space-sm);
	font-family: var(--bne-font-display);
	font-size: var(--bne-size-heading-3);
}

.bne-consent-cat {
	margin: 0 0 var(--bne-space-md);
	padding: var(--bne-space-md) 0 0;
	border: 0;
	border-top: 1px solid var(--bne-color-border);
}

.bne-consent-cat legend {
	padding: 0;
	font-weight: 700;
}

.bne-consent-cat p,
.bne-consent-cat__empty {
	margin: var(--bne-space-xs) 0;
	font-size: 1rem;
}

.bne-consent-check {
	display: flex;
	align-items: center;
	gap: var(--bne-space-sm);
	min-height: var(--bne-touch);
	font-size: 1rem;
}

.bne-consent-check input {
	width: 1.25rem;
	height: 1.25rem;
}

.bne-consent-check input:disabled + span {
	color: var(--bne-color-text-muted);
}

.bne-consent-noscript {
	margin: var(--bne-space-md) var(--bne-gutter);
	padding: var(--bne-space-md);
	border: 1px solid var(--bne-color-border);
}

.bne-consent-noscript .bne-consent-actions {
	margin-top: var(--bne-space-sm);
}

.bne-consent-lock {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.bne-consent-banner,
	.bne-consent-dialog__panel,
	.bne-consent-btn {
		transition: none;
	}
}
