/*
 * Red Braid Tracking — Banner, Platzhalter, Nachfrage am Formular.
 *
 * Farben aus den Design-Tokens des Portals, wo Basics sie liefert, sonst die Rückfallwerte.
 * Jede Regel trägt .rbt-… als Vorsatz: Theme- und Elementor-Regeln wie
 * `.elementor-kit-N p{margin-block-end:0}` sollen hier nichts verschieben.
 */
.rbt-cmp, .rbt-ph, .rbt-ask {
    --rbt-a: var(--rbt-accent, var(--rbb-accent, #2F6FB5));
    --rbt-ink: #1b2430;
    --rbt-muted: #5a6676;
    --rbt-line: #d5dce5;
    font: 15px/1.5 var(--rbb-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    color: var(--rbt-ink);
    box-sizing: border-box;
}
.rbt-cmp *, .rbt-ph *, .rbt-ask * { box-sizing: border-box; }

.rbt-cmp {
    position: fixed; z-index: 2147483000; left: 16px; bottom: 16px;
    width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
    background: #fff; border-radius: 12px; padding: 20px 22px;
    box-shadow: 0 12px 36px rgba(20, 32, 48, .22); display: flex; flex-direction: column; gap: 12px;
}
.rbt-cmp[hidden] { display: none !important; }
.rbt-cmp .rbt-cmp__title { margin: 0; font-size: 1.1rem; line-height: 1.3; font-weight: 700; color: var(--rbt-ink); }
.rbt-cmp .rbt-cmp__text { margin: 0; font-size: .9rem; color: var(--rbt-muted); }
.rbt-cmp .rbt-cmp__text a, .rbt-cmp a { color: var(--rbt-a); }
.rbt-cmp .rbt-cmp__cats { display: flex; flex-direction: column; gap: 8px; }

/*
 * Schalter: <label class="rbt-tg"> mit unsichtbarer Checkbox und gezeichnetem <span>.
 * Die Checkbox wird mit hoher Spezifität versteckt — Elementors globale Formularfeld-Stile
 * (.elementor-kit-N input:not([type=button]):not([type=submit]), Spezifität 0,3,1) geben
 * jedem <input> Hintergrund, Rahmen und Innenabstand. Gezeichnet wird deshalb der <span>.
 */
.rbt-cmp .rbt-tg { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; cursor: pointer; margin: 0; position: relative; }
.rbt-cmp label.rbt-tg input.rbt-tg__in[type="checkbox"] {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0;
    opacity: 0; pointer-events: none; appearance: none; -webkit-appearance: none; background: none; box-shadow: none;
}
.rbt-cmp .rbt-tg__sw {
    display: inline-block; position: relative; width: 34px; height: 20px; margin-top: 1px; border-radius: 10px;
    background: #c9d1db; transition: background .15s; flex: none;
}
.rbt-cmp .rbt-tg__sw::after {
    content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(20, 32, 48, .25); transition: left .15s;
}
.rbt-cmp .rbt-tg__in:checked + .rbt-tg__sw { background: var(--rbt-a); }
.rbt-cmp .rbt-tg__in:checked + .rbt-tg__sw::after { left: 17px; }
.rbt-cmp .rbt-tg__in:indeterminate + .rbt-tg__sw { background: #8fb3dc; background: color-mix(in srgb, var(--rbt-a) 45%, #c9d1db); }
.rbt-cmp .rbt-tg__in:indeterminate + .rbt-tg__sw::after { left: 10px; }
.rbt-cmp .rbt-tg__in:disabled + .rbt-tg__sw { opacity: .55; }
.rbt-cmp .rbt-tg__in:disabled ~ .rbt-tg__txt { cursor: default; }
.rbt-cmp .rbt-tg:has(.rbt-tg__in:disabled) { cursor: default; }
.rbt-cmp .rbt-tg__in:focus-visible + .rbt-tg__sw { outline: 2px solid var(--rbt-a); outline-offset: 2px; }
.rbt-cmp .rbt-tg__txt strong { display: inline; font-size: .92rem; }
.rbt-cmp .rbt-tg--cat .rbt-tg__txt strong { display: block; }
.rbt-cmp .rbt-tg__txt small { display: block; font-size: .8rem; color: var(--rbt-muted); line-height: 1.4; }
.rbt-cmp .rbt-cmp__details { font-size: .85rem; }
.rbt-cmp .rbt-cmp__details summary { cursor: pointer; color: var(--rbt-a); }
.rbt-cmp .rbt-cmp__details h3 { font-size: .85rem; margin: 10px 0 4px; }
.rbt-cmp .rbt-cmp__svc { padding: 8px 0; border-top: 1px solid var(--rbt-line); }
.rbt-cmp .rbt-cmp__more { padding-left: 44px; }
.rbt-cmp .rbt-cmp__more p { margin: 2px 0; color: var(--rbt-muted); }
.rbt-cmp .rbt-cmp__meta { font-size: .78rem; }
.rbt-cmp .rbt-cmp__btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.rbt-cmp .rbt-cmp__foot { margin: 0; font-size: .75rem; color: var(--rbt-muted); overflow-wrap: anywhere; }
.rbt-cmp .rbt-cmp__short, .rbt-cmp .rbt-cmp__morebtn { display: none; }

.rbt-cmp .rbt-b, .rbt-ph .rbt-b, .rbt-ask .rbt-b {
    font: inherit; font-size: .85rem; font-weight: 600; line-height: 1.2; cursor: pointer;
    border: 1px solid var(--rbt-a); color: var(--rbt-a); background: #fff;
    border-radius: 8px; padding: 9px 10px; margin: 0; text-transform: none; letter-spacing: 0;
}
.rbt-cmp .rbt-b--p, .rbt-ph .rbt-b--p, .rbt-ask .rbt-b--p { background: var(--rbt-a); color: #fff; }
.rbt-cmp .rbt-b--link { border: 0; background: none; color: var(--rbt-a); text-decoration: underline; padding: 4px; justify-self: center; }
.rbt-cmp .rbt-b:focus-visible, .rbt-ph .rbt-b:focus-visible, .rbt-ask .rbt-b:focus-visible { outline: 2px solid var(--rbt-a); outline-offset: 2px; }

.rbt-ph {
    display: flex; align-items: center; justify-content: center; width: 100%;
    background: #243241 center / cover no-repeat; border-radius: 8px; padding: 18px; text-align: center; color: #fff;
}
.rbt-ph--thumb { box-shadow: inset 0 0 0 2000px rgba(20, 30, 42, .62); }
.rbt-ph .rbt-ph__in { max-width: 38ch; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rbt-ph .rbt-ph__in strong { font-size: 1rem; color: #fff; }
.rbt-ph .rbt-ph__in p { margin: 0; font-size: .85rem; color: #dfe6ee; }
.rbt-ph .rbt-ph__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rbt-ph .rbt-b { background: transparent; color: #fff; border-color: #fff; }
.rbt-ph .rbt-b--p { background: #fff; color: var(--rbt-ink); }

.rbt-ask { background: #f2f5f9; border-radius: 8px; padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.rbt-ask p { margin: 0; font-size: .82rem; color: var(--rbt-muted); }

/*
 * Smartphone: zwei Ebenen. Die erste ist eine schmale Leiste am unteren Rand — Überschrift,
 * Kurztext, „Nur notwendige“ und „Alle zulassen“ gleich groß nebeneinander, darunter
 * „Einstellungen“ und die Links zu Datenschutz und Impressum. Sie verdeckt rund ein Drittel
 * des Bildschirms, nicht die ganze Seite. Kategorien und Dienste stehen auf der zweiten Ebene.
 */
@media (max-width: 600px) {
    .rbt-cmp {
        left: 0; right: 0; bottom: 0; width: auto; max-height: 60vh; gap: 10px;
        border-radius: 14px 14px 0 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom));
        font-size: 14px; box-shadow: 0 -8px 28px rgba(20, 32, 48, .22);
    }
    .rbt-cmp .rbt-cmp__title { font-size: 1rem; }
    .rbt-cmp:not(.rbt-cmp--settings) .rbt-cmp__text,
    .rbt-cmp:not(.rbt-cmp--settings) .rbt-cmp__cats,
    .rbt-cmp:not(.rbt-cmp--settings) .rbt-cmp__details,
    .rbt-cmp:not(.rbt-cmp--settings) .rbt-b--save { display: none; }
    .rbt-cmp:not(.rbt-cmp--settings) .rbt-cmp__short { display: block; margin: 0; font-size: .85rem; color: var(--rbt-muted); }
    .rbt-cmp:not(.rbt-cmp--settings) .rbt-cmp__morebtn { display: block; margin: -4px auto 0; }
    .rbt-cmp .rbt-cmp__btns { grid-template-columns: 1fr 1fr; }
    .rbt-cmp.rbt-cmp--settings { max-height: 88vh; }
    .rbt-cmp.rbt-cmp--settings .rbt-cmp__btns {
        position: sticky; bottom: calc(-12px - env(safe-area-inset-bottom)); background: #fff;
        padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); margin-bottom: calc(-12px - env(safe-area-inset-bottom));
    }
    .rbt-cmp .rbt-b--save { grid-column: 1 / -1; order: 3; }
}
@media (prefers-reduced-motion: reduce) {
    .rbt-cmp .rbt-tg__sw, .rbt-cmp .rbt-tg__sw::after { transition: none; }
}
