/*
 * Konform – Basis-Styles für Banner, Platzhalter und Symbole.
 * Nutzt bewusst keine eigenen Schriften: alle Elemente erben Typografie
 * vom Theme (font: inherit). Farben kommen aus CSS-Variablen, die das
 * Plugin inline pro Hell-/Dunkelmodus setzt.
 */

.kf,
.kf * {
	box-sizing: border-box;
}

.kf {
	font: inherit;
	color: var(--kf-fg, #16181d);
	-webkit-text-size-adjust: 100%;
}

.kf[hidden] {
	display: none !important;
}

/* ---------- Container ---------- */

.kf-root {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	pointer-events: none;
}

.kf-root--bottom {
	align-items: flex-end;
	justify-content: center;
}

.kf-root--center {
	align-items: center;
	justify-content: center;
}

.kf-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 10, 14, 0.5);
	opacity: 0;
	transition: opacity 0.18s ease;
	pointer-events: none;
}

.kf-root--center .kf-backdrop,
.kf-root.is-expanded .kf-backdrop {
	opacity: 1;
	pointer-events: auto;
}

.kf-box {
	position: relative;
	width: min(40rem, calc(100% - 2rem));
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 1rem;
	padding: 1.25rem 1.375rem;
	background: var(--kf-bg, #fff);
	border: 1px solid var(--kf-border, #e2e5ea);
	border-radius: var(--kf-radius, 14px);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.14);
	pointer-events: auto;
	animation: kf-in 0.22s ease both;
}

@keyframes kf-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
}

/* ---------- Typografie ---------- */

.kf-title {
	font: inherit;
	font-weight: 700;
	font-size: 1.0625em;
	line-height: 1.3;
	margin: 0 0 0.5rem;
	color: inherit;
}

.kf-text {
	font: inherit;
	font-size: 0.875em;
	line-height: 1.55;
	margin: 0 0 1rem;
	color: var(--kf-muted, #5b6472);
}

.kf-legal {
	font: inherit;
	font-size: 0.75em;
	margin: 0.875rem 0 0;
	color: var(--kf-muted, #5b6472);
}

.kf-legal a {
	color: inherit;
	text-decoration: underline;
}

/* ---------- Buttons ---------- */

.kf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.kf-btn {
	font: inherit;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1.2;
	flex: 1 1 10rem;
	min-height: 2.75rem;
	padding: 0.6875rem 1.125rem;
	border: 1px solid transparent;
	border-radius: calc(var(--kf-radius, 14px) / 2);
	cursor: pointer;
	text-align: center;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

/* Zustimmen und Ablehnen sind absichtlich identisch gestaltet (keine
   Dark Patterns, gleichwertige Auswahlmöglichkeit). */
.kf-btn--accent {
	background: var(--kf-accent, #1f6feb);
	color: var(--kf-accent-fg, #fff);
}

.kf-btn--plain {
	flex: 1 1 100%;
	background: transparent;
	color: var(--kf-muted, #5b6472);
	border-color: var(--kf-border, #e2e5ea);
}

.kf-btn:hover {
	filter: brightness(1.07);
}

.kf-btn:focus-visible,
.kf-switch input:focus-visible + .kf-switch__track,
.kf-inline-link:focus-visible,
.kf-icon:focus-visible {
	outline: 2px solid var(--kf-accent, #1f6feb);
	outline-offset: 2px;
}

/* ---------- Kategorien ---------- */

.kf-cats {
	display: grid;
	gap: 0.625rem;
	margin: 0 0 1rem;
}

.kf-cat {
	padding: 0.75rem 0.875rem;
	background: var(--kf-surface, #f5f6f8);
	border: 1px solid var(--kf-border, #e2e5ea);
	border-radius: calc(var(--kf-radius, 14px) / 2);
}

.kf-cat__desc {
	font: inherit;
	font-size: 0.8125em;
	line-height: 1.5;
	margin: 0.4375rem 0 0;
	color: var(--kf-muted, #5b6472);
}

.kf-switch {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	cursor: pointer;
}

.kf-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.kf-switch__track {
	position: relative;
	flex: 0 0 auto;
	width: 2.5rem;
	height: 1.375rem;
	background: var(--kf-border, #e2e5ea);
	border-radius: 999px;
	transition: background-color 0.15s ease;
}

.kf-switch__knob {
	position: absolute;
	top: 0.1875rem;
	left: 0.1875rem;
	width: 1rem;
	height: 1rem;
	background: var(--kf-bg, #fff);
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.kf-switch input:checked + .kf-switch__track {
	background: var(--kf-accent, #1f6feb);
}

.kf-switch input:checked + .kf-switch__track .kf-switch__knob {
	transform: translateX(1.125rem);
	background: var(--kf-accent-fg, #fff);
}

.kf-switch input:disabled + .kf-switch__track {
	opacity: 0.55;
}

.kf-switch input:disabled ~ .kf-switch__label {
	cursor: default;
}

.kf-switch__label {
	font: inherit;
	font-size: 0.875em;
	font-weight: 600;
}

.kf-details {
	font: inherit;
	font-size: 0.8125em;
	margin-top: 0.5rem;
}

.kf-details summary {
	cursor: pointer;
	color: var(--kf-muted, #5b6472);
	text-decoration: underline;
}

.kf-services {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.5rem;
}

.kf-services li {
	display: grid;
	gap: 0.125rem;
	line-height: 1.45;
	color: var(--kf-muted, #5b6472);
}

.kf-services strong {
	color: var(--kf-fg, #16181d);
}

/* ---------- Symbol auf dem Gerät / in der Seite ---------- */

.kf-icon {
	position: fixed;
	z-index: 2147482999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--kf-icon-bg, #1f6feb);
	color: var(--kf-icon-fg, #fff);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.kf-icon:hover,
.kf-icon:focus-visible {
	opacity: 1;
	transform: scale(1.05);
}

.kf-icon--bottom-left {
	bottom: 1rem;
	left: 1rem;
}

.kf-icon--bottom-right {
	bottom: 1rem;
	right: 1rem;
}

.kf-icon--top-left {
	top: 1rem;
	left: 1rem;
}

.kf-icon--top-right {
	top: 1rem;
	right: 1rem;
}

.kf-inline-link {
	font: inherit;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Platzhalter für blockierte Einbettungen ---------- */

/* Hinweis über Medien, die erst beim Klick vom Anbieter laden (Video-Popups,
   Player). Liegt deckend über dem Baustein und nutzt die Texte der Einbettungen. */
.kf-gate-host {
	position: relative;
}

.kf-gate {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: grid;
	place-items: center;
	padding: 1rem;
	overflow: auto;
	background: var(--kf-surface, #f5f6f8);
	border-radius: inherit;
	touch-action: manipulation;
}

.kf-gate .kf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kf-embed {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	padding: 1.25rem;
	background: var(--kf-surface, #f5f6f8);
	border: 1px solid var(--kf-border, #e2e5ea);
	border-radius: calc(var(--kf-radius, 14px) / 2);
}

.kf-embed[style*="--kf-ratio"]::before {
	content: "";
	display: block;
	grid-area: 1 / 1;
	width: 0;
	padding-top: var(--kf-ratio, 56.25%);
}

.kf-embed__box {
	grid-area: 1 / 1;
	max-width: 32rem;
	text-align: center;
}

.kf-embed__title {
	font: inherit;
	font-size: 0.9375em;
	font-weight: 700;
	margin: 0 0 0.375rem;
}

.kf-embed__text {
	font: inherit;
	font-size: 0.8125em;
	line-height: 1.5;
	margin: 0 0 0.875rem;
	color: var(--kf-muted, #5b6472);
}

.kf-embed .kf-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kf-embed__remember {
	font: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4375rem;
	font-size: 0.75em;
	line-height: 1.4;
	margin-top: 0.75rem;
	color: var(--kf-muted, #5b6472);
	cursor: pointer;
}

/* ---------- Kleine Viewports ---------- */

@media (max-width: 30rem) {
	.kf-box {
		width: 100%;
		margin: 0.5rem;
		padding: 1.125rem 1rem;
	}

	.kf-btn {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kf *,
	.kf-box {
		animation: none !important;
		transition: none !important;
	}
}

@media print {
	.kf-root,
	.kf-icon {
		display: none !important;
	}
}

/* ---------- Kopfzeile mit Logo (Favicon der Website) ---------- */

.kf-head {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0 0 0.5rem;
}

.kf-head .kf-title {
	margin: 0;
}

.kf-logo {
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	object-fit: contain;
	border-radius: calc(var(--kf-radius, 14px) / 3);
}

/* ---------- Historie der Einwilligungen (Shortcode) ---------- */

.kf-history {
	font: inherit;
}

.kf-history__table {
	width: 100%;
	border-collapse: collapse;
	font: inherit;
	font-size: 0.875em;
	margin: 0 0 0.75rem;
}

.kf-history__table th,
.kf-history__table td {
	text-align: left;
	padding: 0.5rem 0.625rem;
	border-bottom: 1px solid var(--kf-border, #e2e5ea);
	vertical-align: top;
}

.kf-history__table th {
	font-weight: 700;
}

.kf-history__table tbody tr:nth-child(odd) {
	background: var(--kf-surface, #f5f6f8);
}

.kf-history__id,
.kf-history__note {
	font: inherit;
	font-size: 0.75em;
	line-height: 1.5;
	margin: 0 0 0.25rem;
	color: var(--kf-muted, #5b6472);
	word-break: break-word;
}

.kf-note {
	font: inherit;
	font-size: 0.875em;
	margin: 0.625rem 0 0;
	padding: 0.625rem 0.75rem;
	border-radius: calc(var(--kf-radius, 14px) / 2);
	background: var(--kf-surface, #f5f6f8);
	border: 1px solid var(--kf-border, #e2e5ea);
	color: var(--kf-fg, #16181d);
}

/* ---------- Historie im Banner ---------- */

.kf-h-pick {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	font: inherit;
	font-size: 0.875em;
	margin: 0 0 0.875rem;
}

.kf-h-pick select {
	font: inherit;
	font-size: 1em;
	max-width: 100%;
	padding: 0.4375rem 0.5rem;
	background: var(--kf-bg, #fff);
	color: inherit;
	border: 1px solid var(--kf-border, #e2e5ea);
	border-radius: calc(var(--kf-radius, 14px) / 2);
}

.kf-h-row {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

/* Die Farbe ist nur Beiwerk: der Zustand steht auch als Wort daneben. */
.kf-h-mark {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.375rem;
	height: 1.375rem;
	border-radius: 50%;
	font-size: 0.8125em;
	font-weight: 700;
	line-height: 1;
}

.kf-h-mark--yes {
	background: var(--kf-accent, #1f6feb);
	color: var(--kf-accent-fg, #fff);
}

.kf-h-mark--no {
	background: var(--kf-border, #e2e5ea);
	color: var(--kf-muted, #5b6472);
}

/* ---------- Touch-Geräte ---------- */

/*
 * Zwei schnelle Tipps auf dieselbe Stelle sind auf dem Handy ein Doppeltipp,
 * und der vergrößert die ganze Seite – samt Banner, Assistent und Symbolen.
 * Wer mehrmals auf „+“ tippt, landete so in einer herangezoomten Ansicht,
 * die auch nach dem Zurückstellen blieb. "manipulation" nimmt nur diese eine
 * Geste weg; Zoomen mit zwei Fingern und Wischen bleiben erhalten.
 */
.kf-root,
.kf-root *,
.kf-icon,
.kf-embed,
.kf-embed *,
.kf-inline-link,
.kf-link,
.kf-skip {
	touch-action: manipulation;
}
