/* Zentrale Cookie-Einwilligung: kompakter Dialog, Overlay, fixer Buttonbereich. */
html.consent-open,
html:has(.consent-root--required .consent-dialog:not([hidden])) {
    overflow: hidden;
}
html.consent-open body,
html:has(.consent-root--required .consent-dialog:not([hidden])) body {
    overflow: hidden;
}

.consent-overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(6, 47, 70, .46);
    pointer-events: auto;
}

.consent-dialog {
    position: fixed;
    z-index: 10050;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    width: min(440px, calc(100vw - 24px));
    max-height: 90vh;
    max-height: 90dvh;
    margin: 0;
    padding: 0;
    background: #fff;
    color: var(--alt-public-text, #0c2640);
    border: 1px solid rgba(8, 61, 77, .14);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(6, 47, 70, .28);
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.consent-dialog[hidden],
.consent-overlay[hidden] {
    display: none !important;
}

.consent-dialog__head {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 8px;
}

.consent-dialog__title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 700;
}

.consent-dialog__close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    border-radius: 8px;
}

.consent-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 8px;
}

.consent-dialog__lead {
    margin: 0 0 10px;
    font-size: .92rem;
    line-height: 1.45;
}

.consent-dialog__privacy {
    margin: 0;
    font-size: .9rem;
}

.consent-dialog__error {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 16px;
    color: #8b1e1e;
    background: #fdeeee;
    font-size: .88rem;
}

.consent-dialog__error[hidden] {
    display: none !important;
}

.consent-dialog__foot {
    flex: 0 0 auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(8, 61, 77, .1);
    background: #fff;
}

.consent-dialog__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.consent-dialog__actions[hidden] {
    display: none !important;
}

.consent-dialog__choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid #004d67;
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    touch-action: manipulation;
    overflow-wrap: break-word;
}

.consent-dialog__choice:focus,
.consent-dialog__close:focus,
.consent-cat input:focus,
.consent-svc-details summary:focus,
.consent-dialog__choice:focus-visible,
.consent-dialog__close:focus-visible,
.consent-cat input:focus-visible,
.consent-svc-details summary:focus-visible {
    outline: 3px solid #004d67;
    outline-offset: 2px;
}

.consent-dialog__choice--all,
.consent-dialog__choice--necessary {
    color: #004d67;
    background: #fff;
}

.consent-dialog__choice--save {
    color: #fff;
    background: #004d67;
    border-color: #004d67;
}

.consent-dialog__choice--settings {
    color: #004d67;
    background: #fff;
    border-color: #c5d4dc;
    font-weight: 600;
}

.consent-cat {
    border: 0;
    margin: 0 0 12px;
    padding: 10px 0 0;
}

.consent-cat legend {
    font-weight: 700;
    font-size: .95rem;
}

.consent-cat legend label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.consent-svc {
    margin: 6px 0 0 1.1rem;
    padding: 0;
}

.consent-svc-details {
    margin-top: 6px;
}

.consent-svc-details summary {
    cursor: pointer;
    font-size: .88rem;
    color: #004d67;
}

.consent-app-link {
    position: static;
    z-index: 30;
    margin: 0;
    padding: 8px 16px 12px;
    text-align: center;
}

.consent-app-link a { font-size: .9rem; }

@media (min-width: 640px) {
    .consent-dialog {
        width: min(480px, calc(100vw - 48px));
    }
    .consent-dialog__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .consent-dialog__actions[data-consent-actions="compact"] .consent-dialog__choice--settings {
        grid-column: 1 / -1;
    }
}

.consent-js-only { display: none !important; }
html.consent-js .consent-js-only { display: inline-flex !important; }

@media (max-width: 430px) {
    .consent-dialog {
        width: calc(100vw - 20px);
        max-height: min(90vh, calc(100vh - 72px));
        max-height: min(90dvh, calc(100dvh - 72px));
    }
    .consent-dialog__title { font-size: 1rem; }
    .consent-dialog__choice { min-height: 48px; }
}
