/* Cookie-Hinweis – Darstellung. Farben kommen als Variablen aus den Einstellungen. */
.ckh, .ckh-dialog, .ckh-schwebe, .ckh-platzhalter, .ckh-formular-hinweis {
	--ckh-hg: #ffffff; --ckh-text: #26332b; --ckh-knopf: #3f5e49; --ckh-knopftext: #ffffff;
	--ckh-rund: 10px;
}
.ckh[hidden], .ckh-schwebe[hidden] { display: none !important; }
.ckh-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Hinweis ---------- */
.ckh { position: fixed; z-index: 2147483000; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--ckh-text); }
.ckh *, .ckh-dialog * { box-sizing: border-box; }
.ckh .ckh-banner { background: var(--ckh-hg); color: var(--ckh-text); box-shadow: 0 -2px 18px rgba(0, 0, 0, .18); padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-height: 80vh; overflow: auto; animation: ckh-rein .35s ease-out; }
.ckh .ckh-titel { margin: 0 0 .35em; font-size: 1.15em; line-height: 1.3; font-weight: 700; color: inherit; font-family: inherit; text-transform: none; letter-spacing: normal; }
.ckh .ckh-text p { margin: 0 0 .5em; color: inherit; font-size: 1em; }
.ckh .ckh-links, .ckh-dialog .ckh-links { margin: .2em 0 .8em; font-size: .95em; }
.ckh a, .ckh-dialog a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ckh a:hover, .ckh-dialog a:hover { text-decoration-thickness: 2px; }

/* Leiste unten */
.ckh--leiste { left: 0; right: 0; bottom: 0; }
.ckh--leiste .ckh-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; align-items: center; }
.ckh--leiste .ckh-banner > * { grid-column: 1; }
.ckh--leiste .ckh-knoepfe { grid-column: 2; grid-row: 1 / span 3; }
@media (min-width: 1200px) { .ckh--leiste .ckh-banner { padding-left: calc((100vw - 1140px) / 2); padding-right: calc((100vw - 1140px) / 2); } }
/* Kasten unten links */
.ckh--box { left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 32px)); }
.ckh--box .ckh-banner { border-radius: var(--ckh-rund); box-shadow: 0 6px 30px rgba(0, 0, 0, .25); }
/* Kasten in der Mitte */
.ckh--mitte { inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .4); }
.ckh--mitte .ckh-banner { width: min(560px, 100%); border-radius: var(--ckh-rund); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }

/* ---------- Knöpfe (gegen Theme-Stile abgesichert) ---------- */
.ckh-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
body .ckh button.ckh-knopf, body .ckh span.ckh-knopf, body .ckh-dialog button.ckh-knopf, body .ckh-platzhalter button.ckh-knopf, body .ckh-formular-hinweis button.ckh-knopf {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: .55em 1.15em;
	border: 2px solid var(--ckh-knopf); border-radius: 8px; background: var(--ckh-knopf); color: var(--ckh-knopftext);
	font-family: inherit; font-size: 1em; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: normal; text-decoration: none; text-align: center;
	cursor: pointer; box-shadow: none; white-space: normal; width: auto; height: auto;
}
body .ckh button.ckh-knopf:hover, body .ckh-dialog button.ckh-knopf:hover, body .ckh-platzhalter button.ckh-knopf:hover, body .ckh-formular-hinweis button.ckh-knopf:hover { background: var(--ckh-knopf); color: var(--ckh-knopftext); filter: brightness(1.12); text-decoration: underline; }
body .ckh button.ckh-knopf--zweit, body .ckh span.ckh-knopf--zweit, body .ckh button.ckh-knopf--zweit:hover { background: transparent; color: var(--ckh-text); filter: none; }
body .ckh button.ckh-knopf:focus-visible, body .ckh-dialog button:focus-visible, body .ckh-platzhalter button:focus-visible, body .ckh-formular-hinweis button:focus-visible, body .ckh-schwebe:focus-visible, .ckh a:focus-visible, .ckh-dialog a:focus-visible, .ckh-dialog summary:focus-visible { outline: 3px solid var(--ckh-knopf); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ckh-hg); }

/* ---------- Dialog ---------- */
.ckh-dialog { width: min(640px, calc(100vw - 24px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: var(--ckh-rund); background: var(--ckh-hg); color: var(--ckh-text); font-family: inherit; font-size: 16px; line-height: 1.5; box-shadow: 0 12px 48px rgba(0, 0, 0, .35); }
.ckh-dialog[open] { display: flex; flex-direction: column; }
.ckh-dialog::backdrop { background: rgba(0, 0, 0, .5); }
.ckh-d-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.ckh-dialog .ckh-titel { margin: 0; font-size: 1.25em; font-weight: 700; color: inherit; font-family: inherit; }
body .ckh-dialog button.ckh-schliessen { min-width: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ckh-text); font-size: 1.6em; line-height: 1; cursor: pointer; box-shadow: none; }
body .ckh-dialog button.ckh-schliessen:hover { background: rgba(0, 0, 0, .07); color: var(--ckh-text); }
.ckh-d-inhalt { padding: 0 20px 12px; overflow: auto; }
.ckh-d-fuss { padding: 12px 20px 18px; border-top: 1px solid rgba(0, 0, 0, .12); }
.ckh-kat { margin: 14px 0; padding: 12px 14px; border: 1px solid rgba(0, 0, 0, .14); border-radius: 8px; }
.ckh-kat h3 { margin: 0 0 .3em; font-size: 1.05em; color: inherit; font-family: inherit; }
.ckh-kat .ckh-kat-text { margin: 0 0 .6em; font-size: .95em; }
.ckh-immer-aktiv { font-weight: 400; font-size: .9em; }
.ckh-dienste { list-style: none; margin: 0; padding: 0; }
.ckh-dienst { padding: 8px 0; border-top: 1px solid rgba(0, 0, 0, .08); }
.ckh-dienst-name { font-weight: 600; }
.ckh-details { margin: .3em 0 0; font-size: .92em; }
.ckh-details summary { cursor: pointer; display: inline-block; text-decoration: underline; }
.ckh-details dl { margin: .4em 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; }
.ckh-details dt { font-weight: 600; }
.ckh-details dd { margin: 0; overflow-wrap: anywhere; }

/* Schalter */
.ckh-schalter { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.ckh-schalter input { position: absolute; z-index: 1; left: 0; top: 50%; width: 46px; height: 26px; margin: -13px 0 0; opacity: 0; cursor: pointer; }
.ckh-schalter-bahn { pointer-events: none; position: relative; flex: 0 0 46px; width: 46px; height: 26px; border-radius: 13px; background: #8a958f; transition: background .2s; }
.ckh-schalter-bahn::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.ckh-schalter input:checked + .ckh-schalter-bahn { background: var(--ckh-knopf); }
.ckh-schalter input:checked + .ckh-schalter-bahn::after { transform: translateX(20px); }
.ckh-schalter input:indeterminate + .ckh-schalter-bahn::after { transform: translateX(10px); }
.ckh-schalter input:focus-visible + .ckh-schalter-bahn { outline: 3px solid var(--ckh-knopf); outline-offset: 2px; }

/* ---------- Schwebender Knopf ---------- */
body button.ckh-schwebe { position: fixed; z-index: 2147482000; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; min-height: 0; margin: 0; padding: 0; border: 2px solid var(--ckh-hg); border-radius: 50%; background: var(--ckh-knopf); color: var(--ckh-knopftext); box-shadow: 0 3px 12px rgba(0, 0, 0, .3); cursor: pointer; }
body button.ckh-schwebe:hover { background: var(--ckh-knopf); color: var(--ckh-knopftext); filter: brightness(1.12); }
/* Ab 1.1: rechts, nur am Seitenende, dezente Lasche */
body button.ckh-schwebe.ckh-schwebe--rechts { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
body button.ckh-schwebe.ckh-schwebe--ende { transition: transform .25s ease, opacity .25s ease; }
body button.ckh-schwebe.ckh-schwebe--weg { transform: translateY(calc(100% + 28px)); opacity: 0; pointer-events: none; }
body button.ckh-schwebe.ckh-schwebe--weg:focus-visible { transform: none; opacity: 1; pointer-events: auto; }
body button.ckh-schwebe.ckh-schwebe--lasche { left: 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: 30px; height: 40px; border-left: 0; border-radius: 0 10px 10px 0; opacity: .82; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: width .2s ease, opacity .2s ease; }
body button.ckh-schwebe.ckh-schwebe--lasche.ckh-schwebe--rechts { left: auto; right: 0; border-left: 2px solid var(--ckh-hg); border-right: 0; border-radius: 10px 0 0 10px; }
body button.ckh-schwebe.ckh-schwebe--lasche:hover, body button.ckh-schwebe.ckh-schwebe--lasche:focus-visible { width: 42px; opacity: 1; }
body button.ckh-schwebe.ckh-schwebe--lasche svg { width: 18px; height: 18px; }

/* ---------- Platzhalter für blockierte Inhalte ---------- */
.ckh-platzhalter { position: relative; display: grid; place-items: center; width: 100%; min-height: 220px; margin: 0 0 1.5em; padding: 20px; border-radius: 8px; background: color-mix(in srgb, var(--ckh-knopf) 10%, #fff); background-color: #eef3ef; color: #1f2a23; text-align: center; }
@supports (background: color-mix(in srgb, red 10%, white)) { .ckh-platzhalter { background-color: color-mix(in srgb, var(--ckh-knopf) 10%, #fff); } }
.ckh-platzhalter-innen { max-width: 520px; }
.ckh-platzhalter p { margin: 0 0 .7em; color: inherit; }
.ckh-platzhalter-titel { font-weight: 700; font-size: 1.1em; }
.ckh-platzhalter-text { font-size: .95em; }
.ckh-platzhalter a { color: inherit; text-decoration: underline; }
.ckh-platzhalter-immer { font-size: .92em; }
.ckh-platzhalter-immer label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.ckh-platzhalter-immer input { width: 20px; height: 20px; margin: 0; accent-color: var(--ckh-knopf); }

/* Hinweis in Formularen mit reCAPTCHA */
.ckh-formular-hinweis { width: 100%; margin: 0 0 12px; padding: 12px 14px; border-left: 4px solid var(--ckh-knopf); border-radius: 4px; background: #f1f5f2; color: #1f2a23; }
.ckh-formular-hinweis p { margin: 0 0 .6em; }

/* Knopf aus dem Shortcode [cookie_einstellungen]: sieht aus wie ein Link */
body button.ckh-oeffnen { display: inline; min-height: 0; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: normal; }
body button.ckh-oeffnen:hover, body button.ckh-oeffnen:focus { background: none; color: inherit; text-decoration-thickness: 2px; }

/* ---------- Handy ---------- */
@media (max-width: 700px) {
	.ckh { font-size: 15px; }
	.ckh--leiste .ckh-banner { display: block; padding-top: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
	.ckh .ckh-titel { font-size: 1.05em; }
	.ckh .ckh-links { margin-bottom: .6em; }
	.ckh .ckh-knoepfe, .ckh-d-fuss { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.ckh .ckh-knoepfe > :only-child, .ckh .ckh-knoepfe > :nth-child(3), .ckh-d-fuss > :first-child:not(:only-child) { grid-column: 1 / -1; }
	body .ckh button.ckh-knopf, body .ckh span.ckh-knopf, body .ckh-dialog button.ckh-knopf { width: 100%; padding-left: .6em; padding-right: .6em; }
	.ckh-d-kopf, .ckh-d-inhalt, .ckh-d-fuss { padding-left: 14px; padding-right: 14px; }
}
@keyframes ckh-rein { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.ckh .ckh-banner { animation: none; }
	.ckh-schalter-bahn, .ckh-schalter-bahn::after { transition: none; }
	body button.ckh-schwebe.ckh-schwebe--ende, body button.ckh-schwebe.ckh-schwebe--lasche { transition: none; }
}
@media (forced-colors: active) {
	.ckh .ckh-banner, .ckh-dialog { border: 2px solid CanvasText; }
	.ckh-schalter-bahn { border: 1px solid CanvasText; }
}
@media print { .ckh, .ckh-dialog, .ckh-schwebe { display: none !important; } }

/* Vorschau in der Verwaltung */
.ckh.ckh--vorschau { position: static; z-index: auto; }
.ckh.ckh--vorschau .ckh-banner { display: block; border-radius: var(--ckh-rund); box-shadow: 0 4px 20px rgba(0, 0, 0, .2); animation: none; max-height: none; }
