/* G22 Cookie Consent — scoped styles, all selectors prefixed .g22cc- */

.g22cc-banner {
	position: fixed;
	left: 24px;
	bottom: 24px;
	left: max(24px, env(safe-area-inset-left));
	bottom: max(24px, env(safe-area-inset-bottom));
	z-index: 999990;
	width: 420px;
	max-width: calc(100vw - 48px);
	background: var(--g22-paper, #f5f5f5);
	color: var(--g22-ink, #1a1a1a);
	border: 1px solid var(--g22-line, #d8d8d8);
	border-radius: var(--g22-r-lg, 20px);
	box-shadow: var(--g22-shadow-lg, 0 20px 48px rgba(26, 26, 26, 0.16));
	padding: 20px;
	font-family: var(--g22-font-body, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
	box-sizing: border-box;
}

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

.g22cc-banner__title {
	margin: 0 0 8px;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--g22-ink, #1a1a1a);
}

.g22cc-banner__text {
	margin: 0 0 16px;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--g22-ink-soft, rgba(26, 26, 26, 0.72));
}

.g22cc-link {
	color: var(--g22-purple, #432980);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.g22cc-link:hover {
	color: var(--g22-purple-hot, #533599);
}

.g22cc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.g22cc-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
	border-radius: var(--g22-r-pill, 999px);
	min-height: 44px;
	padding: 0 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.g22cc-btn--primary {
	background: var(--g22-purple, #432980);
	color: var(--g22-on-purple, #fff);
	border: 2px solid var(--g22-purple, #432980);
}

.g22cc-btn--primary:hover {
	background: var(--g22-purple-hot, #533599);
	border-color: var(--g22-purple-hot, #533599);
}

/* Equal visual weight with the accept button: same outline strength, same size. */
.g22cc-btn--outline {
	background: transparent;
	color: var(--g22-purple, #432980);
	border: 2px solid var(--g22-purple, #432980);
}

.g22cc-btn--outline:hover {
	background: var(--g22-purple-08, rgba(67, 41, 128, 0.08));
}

.g22cc-btn--text {
	background: transparent;
	color: var(--g22-ink, #1a1a1a);
	border: 2px solid transparent;
	padding: 0 12px;
	text-decoration: underline;
	text-underline-offset: 3px;
	min-height: 44px;
}

.g22cc-btn--text:hover {
	color: var(--g22-purple, #432980);
}

.g22cc-btn:focus-visible,
.g22cc-link:focus-visible,
.g22cc-modal__close:focus-visible {
	outline: 3px solid var(--g22-purple, #432980);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.g22cc-banner {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		border-radius: var(--g22-r-lg, 20px) var(--g22-r-lg, 20px) 0 0;
		border-left: none;
		border-right: none;
		border-bottom: none;
		padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.g22cc-banner__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.g22cc-banner__actions .g22cc-btn {
		width: 100%;
	}
}

/* Settings modal */

.g22cc-modal {
	position: fixed;
	inset: 0;
	margin: auto;
	z-index: 999999;
	width: 480px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 64px);
	overflow: auto;
	background: var(--g22-card, #fff);
	color: var(--g22-ink, #1a1a1a);
	border: 1px solid var(--g22-line, #d8d8d8);
	border-radius: var(--g22-r-lg, 20px);
	box-shadow: var(--g22-shadow-lg, 0 20px 48px rgba(26, 26, 26, 0.2));
	padding: 0;
	font-family: var(--g22-font-body, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
}

.g22cc-modal::backdrop {
	background: rgba(26, 26, 26, 0.5);
}

.g22cc-modal:not([open]) {
	display: none;
}

.g22cc-modal__form {
	padding: 24px;
}

.g22cc-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.g22cc-modal__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.g22cc-modal__close {
	appearance: none;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--g22-ink-soft, rgba(26, 26, 26, 0.68));
	width: 44px;
	height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--g22-r-pill, 999px);
	flex: 0 0 auto;
}

.g22cc-modal__close:hover {
	background: var(--g22-purple-08, rgba(67, 41, 128, 0.08));
	color: var(--g22-purple, #432980);
}

.g22cc-rows {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--g22-line, #d8d8d8);
}

.g22cc-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--g22-line, #d8d8d8);
}

.g22cc-row__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.g22cc-row__label {
	font-weight: 700;
	font-size: 0.9375rem;
}

.g22cc-row__desc {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--g22-ink-soft, rgba(26, 26, 26, 0.68));
	max-width: 320px;
}

/* Real checkbox switch, 44px hit target */
.g22cc-switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.g22cc-switch input[type='checkbox'] {
	position: absolute;
	inset: 0;
	margin: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.g22cc-switch--disabled input[type='checkbox'] {
	cursor: not-allowed;
}

.g22cc-switch label {
	pointer-events: none;
	position: relative;
	display: block;
	width: 40px;
	height: 24px;
	border-radius: var(--g22-r-pill, 999px);
	background: var(--g22-line, #d8d8d8);
	transition: background-color 160ms ease;
}

.g22cc-switch label::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(26, 26, 26, 0.3);
	transition: transform 160ms ease;
}

.g22cc-switch input[type='checkbox']:checked + label {
	background: var(--g22-purple, #432980);
}

.g22cc-switch input[type='checkbox']:checked + label::after {
	transform: translateX(16px);
}

.g22cc-switch input[type='checkbox']:disabled + label {
	background: var(--g22-purple-64, rgba(67, 41, 128, 0.64));
	opacity: 0.8;
}

.g22cc-switch input[type='checkbox']:focus-visible + label {
	outline: 3px solid var(--g22-purple, #432980);
	outline-offset: 2px;
}

.g22cc-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 20px;
}

@media (max-width: 600px) {
	.g22cc-modal {
		width: calc(100vw - 32px);
	}

	.g22cc-modal__actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.g22cc-modal__actions .g22cc-btn {
		width: 100%;
	}
}

/* Footer re-open link (injected into .g22-footer__legal by JS) */
.g22cc-footer-link {
	background: transparent;
	border: none;
	padding: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.g22cc-footer-link:focus-visible {
	outline: 3px solid var(--g22-purple, #432980);
	outline-offset: 2px;
}

/* Fallback reopen button when the footer target isn't found on the page */
.g22cc-fab {
	position: fixed;
	left: 16px;
	bottom: 16px;
	left: max(16px, env(safe-area-inset-left));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 999980;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--g22-line, #d8d8d8);
	background: var(--g22-card, #fff);
	color: var(--g22-purple, #432980);
	box-shadow: var(--g22-shadow-md, 0 8px 24px rgba(26, 26, 26, 0.16));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.g22cc-fab:focus-visible {
	outline: 3px solid var(--g22-purple, #432980);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.g22cc-btn,
	.g22cc-switch label,
	.g22cc-switch label::after {
		transition: none;
	}
}
