/* Cookie Consent Tool */
#cct-root[hidden], .cct-float[hidden], #cct-root [hidden] { display: none !important; }

#cct-root {
	--cct-radius: 10px;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cct-text, #1b1f24);
}
#cct-root *, #cct-root *::before, #cct-root *::after { box-sizing: border-box; }

#cct-root .cct-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .25s ease;
	display: none;
}
#cct-root.cct--modal .cct-overlay { display: block; pointer-events: auto; }
#cct-root.cct--visible .cct-overlay { opacity: 1; }

#cct-root .cct-banner {
	position: absolute;
	pointer-events: auto;
	background: var(--cct-bg, #fff);
	color: var(--cct-text, #1b1f24);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
	padding: 22px 24px 18px;
	max-height: calc(100vh - 24px);
	overflow-y: auto;
	outline: none;
	transition: transform .3s ease, opacity .3s ease;
	opacity: 0;
}

/* Leiste unten */
#cct-root:not(.cct--modal) .cct-banner {
	left: 12px;
	right: 12px;
	bottom: 12px;
	margin: 0 auto;
	max-width: 980px;
	border-radius: var(--cct-radius);
	transform: translateY(20px);
}
/* Dialog in der Mitte */
#cct-root.cct--modal .cct-banner {
	left: 50%;
	top: 50%;
	width: min(560px, calc(100vw - 24px));
	border-radius: var(--cct-radius);
	transform: translate(-50%, -46%);
}
#cct-root.cct--visible .cct-banner { opacity: 1; transform: translateY(0); }
#cct-root.cct--modal.cct--visible .cct-banner { transform: translate(-50%, -50%); }

#cct-root .cct-title {
	margin: 0 0 6px;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}
#cct-root .cct-desc { margin: 0 0 14px; }
#cct-root .cct-desc p { margin: 0 0 .5em; color: inherit; font-size: 1em; }
#cct-root a { color: var(--cct-primary, #1f5fbf); text-decoration: underline; }

/* Buttons */
#cct-root .cct-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	align-items: center;
}
.cct-btn,
#cct-root .cct-btn {
	appearance: none;
	display: inline-block;
	margin: 0;
	padding: 10px 18px;
	min-height: 44px;
	border: 2px solid var(--cct-primary, #1f5fbf);
	border-radius: 6px;
	background: var(--cct-primary, #1f5fbf);
	color: var(--cct-btn-text, #fff);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
	transition: filter .15s ease;
}
.cct-btn:hover, #cct-root .cct-btn:hover { filter: brightness(1.1); }
.cct-btn:focus-visible, #cct-root .cct-btn:focus-visible, .cct-float:focus-visible {
	outline: 3px solid var(--cct-primary, #1f5fbf);
	outline-offset: 2px;
}
.cct-btn--ghost,
#cct-root .cct-btn--ghost {
	background: transparent;
	color: var(--cct-primary, #1f5fbf);
}
#cct-root .cct-actions [data-cct-action="settings"],
#cct-root .cct-actions [data-cct-action="save"] { margin-right: auto; }

#cct-root .cct-links {
	margin: 12px 0 0;
	font-size: 13px;
	opacity: .85;
}

/* Kategorien */
#cct-root .cct-prefs {
	margin: 0 0 16px;
	border-top: 1px solid rgba(127, 127, 127, .25);
}
#cct-root .cct-cat {
	padding: 12px 0;
	border-bottom: 1px solid rgba(127, 127, 127, .25);
}
#cct-root .cct-cat-desc { margin: 4px 0 0 58px; font-size: 13.5px; opacity: .85; }
#cct-root .cct-cat-name { font-weight: 600; }
#cct-root .cct-cat-name small { font-weight: 400; opacity: .7; }
#cct-root .cct-id { margin: 10px 0 0; font-size: 12px; opacity: .7; }
#cct-root .cct-id code { font-size: 12px; background: none; padding: 0; color: inherit; }

#cct-root .cct-switch {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	margin: 0;
}
#cct-root .cct-switch input {
	position: absolute;
	opacity: 0;
	width: 46px;
	height: 26px;
	margin: 0;
	cursor: pointer;
}
#cct-root .cct-slider {
	position: relative;
	flex: 0 0 46px;
	width: 46px;
	height: 26px;
	border-radius: 26px;
	background: #9aa1a9;
	transition: background .2s ease;
}
#cct-root .cct-slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform .2s ease;
}
#cct-root .cct-switch input:checked + .cct-slider { background: var(--cct-primary, #1f5fbf); }
#cct-root .cct-switch input:checked + .cct-slider::after { transform: translateX(20px); }
#cct-root .cct-switch input:disabled + .cct-slider { opacity: .55; cursor: not-allowed; }
#cct-root .cct-switch input:focus-visible + .cct-slider { outline: 3px solid var(--cct-primary, #1f5fbf); outline-offset: 2px; }

/* Schwebender Button */
.cct-float {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482999;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--cct-primary, #1f5fbf);
	color: var(--cct-btn-text, #fff);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	cursor: pointer;
	opacity: .85;
}
.cct-float:hover { opacity: 1; }

/* Blockierte Einbettungen */
.cct-embed { position: relative; width: 100%; }
.cct-embed-ph {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 6px;
	min-height: 220px;
	height: 100%;
	padding: 20px;
	background: #eef0f3;
	color: #1b1f24;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
}
.cct-embed-ph p { margin: 0; max-width: 520px; }
.cct-embed-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px !important; }
.cct-embed-ph .cct-btn { font-size: 14px; padding: 8px 14px; min-height: 40px; }

/* Responsive Embeds des Block-Editors (Seitenverhältnis-Wrapper) */
.wp-has-aspect-ratio .wp-block-embed__wrapper > .cct-embed { position: absolute; inset: 0; }
.wp-has-aspect-ratio .wp-block-embed__wrapper > .cct-embed > .cct-embed-ph { min-height: 0; }

@media (max-width: 600px) {
	#cct-root .cct-banner { padding: 18px 16px 14px; }
	#cct-root .cct-actions { flex-direction: column-reverse; align-items: stretch; }
	#cct-root .cct-actions .cct-btn { width: 100%; margin: 0; }
	#cct-root:not(.cct--modal) .cct-banner { left: 8px; right: 8px; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	#cct-root .cct-banner, #cct-root .cct-overlay, #cct-root .cct-slider, #cct-root .cct-slider::after { transition: none; }
}
