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

.consenta {
    --consenta-bg: #fff;
    --consenta-fg: #171717;
    --consenta-muted: #5f6368;
    --consenta-border: #d8dadd;
    --consenta-accent: #20252b;
    --consenta-accent-text: #fff;
    --consenta-focus: #2563eb;
    --consenta-radius: 12px;
    --consenta-shadow: 0 -8px 28px rgba(0, 0, 0, .14);
    --consenta-container-width: 1180px;
    color: var(--consenta-fg);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

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

.consenta__banner {
    position: fixed;
    z-index: 2147483000;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 12px;
    pointer-events: none;
}

.consenta__banner-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
    gap: 24px;
    align-items: center;
    margin: 0 auto;
    padding: 18px 20px;
    border: 1px solid var(--consenta-border);
    border-radius: var(--consenta-radius);
    background: var(--consenta-bg);
    box-shadow: var(--consenta-shadow);
    pointer-events: auto;
}

.consenta__banner--container .consenta__banner-inner {
    max-width: var(--consenta-container-width);
}

.consenta__banner--full {
    padding: 0;
}

.consenta__banner--full .consenta__banner-inner {
    max-width: none;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
}

.consenta__banner-content,
.consenta__category-copy {
    min-width: 0;
}

.consenta__title,
.consenta__dialog-title,
.consenta__category-title {
    margin: 0;
    color: var(--consenta-fg);
    font-weight: 700;
    line-height: 1.25;
}

.consenta__title {
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.consenta__text,
.consenta__dialog-intro,
.consenta__category-description,
.consenta__status {
    margin: 0;
    color: var(--consenta-muted);
}

.consenta__links {
    margin: 7px 0 0;
    font-size: .875rem;
}

.consenta__links a,
.consenta__service-policy a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consenta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.consenta__actions--banner {
    justify-content: flex-end;
    min-width: 280px;
}

.consenta__button,
.consenta__close {
    appearance: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.consenta__button {
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--consenta-accent);
    border-radius: 8px;
    font-weight: 650;
    line-height: 1.2;
}

.consenta__button--primary {
    background: var(--consenta-accent);
    color: var(--consenta-accent-text);
}

.consenta__button--secondary {
    background: var(--consenta-bg);
    color: var(--consenta-fg);
}

.consenta__button:hover,
.consenta__close:hover {
    filter: brightness(.96);
}

.consenta__button:focus-visible,
.consenta__close:focus-visible,
.consenta__switch-input:focus-visible + .consenta__switch-visual,
.consenta__links a:focus-visible,
.consenta__service-summary:focus-visible,
.consenta__service-policy a:focus-visible {
    outline: 3px solid var(--consenta-focus);
    outline-offset: 3px;
}

.consenta__overlay {
    position: fixed;
    z-index: 2147483100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .46);
}

.consenta__dialog {
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-height: min(780px, calc(100vh - 40px));
    max-height: min(780px, calc(100dvh - 40px));
    overflow: hidden;
    border: 1px solid var(--consenta-border);
    border-radius: var(--consenta-radius);
    background: var(--consenta-bg);
    box-shadow: 0 20px 70px rgba(0, 0, 0, .25);
}

.consenta__dialog-header {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--consenta-border);
}

.consenta__dialog-title {
    font-size: 1.35rem;
}

.consenta__close {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: var(--consenta-fg);
    font-size: 28px;
    line-height: 1;
}

.consenta__dialog-scroll {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 20px;
}

.consenta__dialog-intro {
    margin-bottom: 16px;
}

.consenta__category {
    padding: 16px;
    border: 1px solid var(--consenta-border);
    border-radius: 10px;
}

.consenta__category + .consenta__category {
    margin-top: 12px;
}

.consenta__category-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.consenta__category-title {
    font-size: 1rem;
}

.consenta__category-description {
    margin-top: 5px;
    font-size: .9rem;
}

.consenta__always-on {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eceff3;
    color: #30343a;
    font-size: .75rem;
    font-weight: 700;
}

.consenta__switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 48px;
    width: 48px;
    height: 28px;
    margin-top: 2px;
}

.consenta__switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.consenta__switch-visual {
    position: absolute;
    inset: 0;
    border: 1px solid #8a8a8a;
    border-radius: 999px;
    background: #d7d7d7;
    transition: background .18s ease, border-color .18s ease;
}

.consenta__switch-visual::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    content: "";
    transition: transform .18s ease;
}

.consenta__switch-input:checked + .consenta__switch-visual {
    border-color: var(--consenta-accent);
    background: var(--consenta-accent);
}

.consenta__switch-input:checked + .consenta__switch-visual::after {
    transform: translateX(20px);
}

.consenta__service {
    margin-top: 12px;
    border-top: 1px solid var(--consenta-border);
    padding-top: 10px;
    color: var(--consenta-muted);
    font-size: .84rem;
}

.consenta__service-summary {
    cursor: pointer;
    font-weight: 650;
}

.consenta__service-list {
    margin: 10px 0 0;
}

.consenta__service-row {
    display: grid;
    grid-template-columns: minmax(110px, .35fr) minmax(0, 1fr);
    gap: 8px 14px;
    padding: 4px 0;
}

.consenta__service-row dt {
    font-weight: 650;
}

.consenta__service-row dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.consenta__service-policy {
    margin: 8px 0 0;
}

.consenta__links--dialog {
    margin-top: 16px;
}

.consenta__status {
    min-height: 1.4em;
    margin-top: 8px;
    font-size: .875rem;
}

.consenta__actions--dialog {
    flex: 0 0 auto;
    padding: 16px 20px;
    border-top: 1px solid var(--consenta-border);
    background: var(--consenta-bg);
}

.consenta--dialog-open {
    overflow: hidden;
}

.consenta__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .consenta__banner {
        max-height: 50vh;
        max-height: 50dvh;
        padding: 8px;
    }

    .consenta__banner-inner {
        display: flex;
        max-height: calc(50vh - 16px);
        max-height: calc(50dvh - 16px);
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 14px;
        overflow: hidden;
    }

    .consenta__banner-content {
        overflow: auto;
        overscroll-behavior: contain;
    }

    .consenta__actions--banner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        min-width: 0;
    }

    .consenta__actions--banner .consenta__button:last-child {
        grid-column: 1 / -1;
    }

    .consenta__button {
        min-height: 44px;
    }

    .consenta__overlay {
        padding: 0;
        background: var(--consenta-bg);
    }

    .consenta__dialog {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .consenta__dialog-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .consenta__actions--dialog {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .consenta__actions--dialog .consenta__button {
        flex: 1 1 100%;
    }
}

@media (max-width: 520px) {
    .consenta {
        font-size: 15px;
    }

    .consenta__actions--banner {
        grid-template-columns: 1fr;
    }

    .consenta__actions--banner .consenta__button:last-child {
        grid-column: auto;
    }

    .consenta__service-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consenta *,
    .consenta *::before,
    .consenta *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    .consenta {
        --consenta-bg: #171717;
        --consenta-fg: #f5f5f5;
        --consenta-muted: #c7c7c7;
        --consenta-border: #444;
        --consenta-accent: #f5f5f5;
        --consenta-accent-text: #171717;
        --consenta-shadow: 0 -8px 30px rgba(0, 0, 0, .38);
    }

    .consenta__always-on,
    .consenta__close:hover {
        background: #303030;
        color: #eee;
    }
}
