:root {
    --xat-cookie-primary: #1d4ed8;
    --xat-cookie-accent: #f4c44e;
    --xat-cookie-radius: 18px;
    --xat-cookie-bg: #ffffff;
    --xat-cookie-surface: #f6f8fc;
    --xat-cookie-border: #dce2ed;
    --xat-cookie-text: #172033;
    --xat-cookie-muted: #5c6679;
    --xat-cookie-shadow: 0 20px 60px rgba(20, 34, 64, .2);
}

.xat-cookies,
.xat-cookies * {
    box-sizing: border-box;
}

.xat-cookies button,
.xat-cookie-inline-settings {
    font: inherit;
}

.xat-cookie-banner {
    position: fixed;
    z-index: 2147483000;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    width: min(1180px, calc(100% - 28px));
    max-height: calc(100dvh - 30px);
    padding: 20px;
    overflow: auto;
    color: var(--xat-cookie-text);
    background: var(--xat-cookie-bg);
    border: 1px solid var(--xat-cookie-border);
    border-radius: var(--xat-cookie-radius);
    box-shadow: var(--xat-cookie-shadow);
    transform: translateX(-50%);
    animation: xat-cookie-enter .28s ease-out both;
    overscroll-behavior: contain;
}

.xat-cookies--top .xat-cookie-banner {
    top: max(18px, env(safe-area-inset-top));
    bottom: auto;
}

.xat-cookies--center .xat-cookie-banner {
    top: 50%;
    bottom: auto;
    max-width: 820px;
    grid-template-columns: auto minmax(0, 1fr);
    transform: translate(-50%, -50%);
    animation-name: xat-cookie-enter-center;
}

.xat-cookies--center .xat-cookie-banner__actions {
    grid-column: 1 / -1;
}

.xat-cookie-banner[hidden],
.xat-cookie-overlay[hidden],
.xat-cookie-status[hidden] {
    display: none !important;
}

.xat-cookie-banner__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: #172033;
    background: var(--xat-cookie-accent);
    border-radius: 16px;
    flex: 0 0 auto;
}

.xat-cookie-banner__icon svg {
    width: 31px;
    height: 31px;
    fill: currentColor;
}

.xat-cookie-banner__content h2,
.xat-cookie-dialog h2,
.xat-cookie-category h3 {
    margin: 0;
    color: var(--xat-cookie-text);
    font-family: inherit;
    line-height: 1.25;
}

.xat-cookie-banner__content h2 {
    font-size: clamp(19px, 2vw, 24px);
    font-weight: 800;
}

.xat-cookie-banner__content p {
    max-width: 720px;
    margin: 7px 0 5px;
    color: var(--xat-cookie-muted);
    font-size: 14px;
    line-height: 1.55;
}

.xat-cookie-link,
.xat-cookie-inline-settings {
    color: var(--xat-cookie-primary);
    font-size: 13px;
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.xat-cookie-banner__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(125px, 1fr));
    gap: 9px;
    min-width: 290px;
}

.xat-cookie-banner__actions .xat-cookie-button--text {
    grid-column: 1 / -1;
}

.xat-cookie-button {
    min-height: 44px;
    margin: 0;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: calc(var(--xat-cookie-radius) * .62);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.xat-cookie-button:hover {
    transform: translateY(-1px);
}

.xat-cookie-button--primary {
    color: #172033;
    background: var(--xat-cookie-accent);
    border-color: rgba(23, 32, 51, .22);
}

.xat-cookie-button--secondary {
    color: var(--xat-cookie-text);
    background: var(--xat-cookie-surface);
    border-color: var(--xat-cookie-border);
}

.xat-cookie-button--text {
    min-height: 38px;
    color: var(--xat-cookie-primary);
    background: transparent;
}

.xat-cookie-button:focus-visible,
.xat-cookie-close:focus-visible,
.xat-cookie-switch input:focus-visible + .xat-cookie-switch__track,
.xat-cookie-inline-settings:focus-visible {
    outline: 3px solid rgba(29, 78, 216, .38);
    outline-offset: 3px;
}

.xat-cookie-overlay {
    position: fixed;
    z-index: 2147483100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background: rgba(11, 18, 32, .65);
    backdrop-filter: blur(4px);
}

.xat-cookie-dialog {
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    max-height: min(760px, calc(100dvh - 32px));
    overflow: hidden;
    color: var(--xat-cookie-text);
    background: var(--xat-cookie-bg);
    border: 1px solid var(--xat-cookie-border);
    border-radius: var(--xat-cookie-radius);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .35);
    animation: xat-dialog-enter .22s ease-out both;
}

.xat-cookie-dialog__header,
.xat-cookie-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
}

.xat-cookie-dialog__header {
    border-bottom: 1px solid var(--xat-cookie-border);
}

.xat-cookie-dialog__header h2 {
    margin-top: 4px;
    font-size: clamp(21px, 4vw, 28px);
    font-weight: 850;
}

.xat-cookie-eyebrow {
    color: var(--xat-cookie-primary);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.xat-cookie-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--xat-cookie-text);
    background: var(--xat-cookie-surface);
    border: 1px solid var(--xat-cookie-border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.xat-cookie-dialog__body {
    padding: 20px 22px;
    overflow: auto;
    overscroll-behavior: contain;
}

.xat-cookie-dialog__intro {
    margin: 0 0 16px;
    color: var(--xat-cookie-muted);
    font-size: 14px;
    line-height: 1.55;
}

.xat-cookie-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--xat-cookie-border);
}

.xat-cookie-category h3 {
    font-size: 15px;
    font-weight: 850;
}

.xat-cookie-category p {
    margin: 5px 0 0;
    color: var(--xat-cookie-muted);
    font-size: 13px;
    line-height: 1.5;
}

.xat-cookie-always {
    padding: 6px 9px;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.xat-cookie-switch {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.xat-cookie-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.xat-cookie-switch__track {
    position: relative;
    display: block;
    width: 48px;
    height: 28px;
    background: #8a94a6;
    border-radius: 999px;
    transition: background .18s ease;
}

.xat-cookie-switch__track::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .24);
    content: '';
    transition: transform .18s ease;
}

.xat-cookie-switch input:checked + .xat-cookie-switch__track {
    background: var(--xat-cookie-primary);
}

.xat-cookie-switch input:checked + .xat-cookie-switch__track::after {
    transform: translateX(20px);
}

.xat-cookie-dialog__footer {
    justify-content: flex-end;
    border-top: 1px solid var(--xat-cookie-border);
}

.xat-cookie-dialog__footer .xat-cookie-button {
    min-width: 155px;
}

.xat-cookies-app-shell .xat-cookie-banner {
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px));
}

.xat-cookies-app-shell .xat-cookies--top .xat-cookie-banner,
.xat-cookies-app-shell .xat-cookies--center .xat-cookie-banner {
    bottom: auto;
}

.xat-cookie-status {
    position: fixed;
    z-index: 2147483200;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    max-width: calc(100% - 32px);
    padding: 11px 16px;
    color: #fff;
    background: #172033;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
    font-size: 13px;
    font-weight: 750;
    transform: translateX(-50%);
}

.xat-cookie-inline-settings {
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.xat-cookie-embed-blocked {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 24px;
    color: var(--xat-cookie-text);
    background: var(--xat-cookie-surface);
    border: 1px dashed var(--xat-cookie-border);
    border-radius: var(--xat-cookie-radius);
    text-align: center;
}

.xat-cookie-embed-blocked p {
    max-width: 520px;
    margin: 0 0 10px;
    color: var(--xat-cookie-muted);
}

.xat-cookie-declaration {
    max-width: 100%;
    overflow-x: auto;
}

.xat-cookie-declaration table {
    width: 100%;
    border-collapse: collapse;
}

.xat-cookie-declaration th,
.xat-cookie-declaration td {
    padding: 12px;
    border: 1px solid currentColor;
    text-align: left;
    vertical-align: top;
}

.xat-cookie-noscript {
    position: relative;
    z-index: 100;
    padding: 12px 18px;
    color: #172033;
    background: #fef3c7;
    border-bottom: 1px solid #f4c44e;
    font-size: 13px;
    text-align: center;
}

html.xat-cookie-modal-open {
    overflow: hidden !important;
}

html[data-theme="dark"],
html.dark,
body.dark-mode,
body.msn-dark-mode,
body.wp-dark-mode-active {
    --xat-cookie-bg: #141b2b;
    --xat-cookie-surface: #1d273a;
    --xat-cookie-border: #344159;
    --xat-cookie-text: #f4f7fb;
    --xat-cookie-muted: #b6c0d2;
    --xat-cookie-shadow: 0 20px 70px rgba(0, 0, 0, .58);
}

html[data-theme="dark"] .xat-cookie-always,
html.dark .xat-cookie-always,
body.dark-mode .xat-cookie-always,
body.msn-dark-mode .xat-cookie-always,
body.wp-dark-mode-active .xat-cookie-always {
    color: #bbf7d0;
    background: #14532d;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not(.light) {
        --xat-cookie-bg: #141b2b;
        --xat-cookie-surface: #1d273a;
        --xat-cookie-border: #344159;
        --xat-cookie-text: #f4f7fb;
        --xat-cookie-muted: #b6c0d2;
        --xat-cookie-shadow: 0 20px 70px rgba(0, 0, 0, .58);
    }
}

@media (max-width: 760px) {
    .xat-cookie-banner,
    .xat-cookies--center .xat-cookie-banner {
        grid-template-columns: 1fr;
        gap: 13px;
        padding: 17px;
    }

    .xat-cookie-banner__icon {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .xat-cookie-banner__actions,
    .xat-cookies--center .xat-cookie-banner__actions {
        grid-column: auto;
        min-width: 0;
    }

    .xat-cookie-dialog__header,
    .xat-cookie-dialog__body,
    .xat-cookie-dialog__footer {
        padding: 16px;
    }
}

@media (max-width: 440px) {
    .xat-cookie-banner {
        width: calc(100% - 18px);
        bottom: max(9px, env(safe-area-inset-bottom));
        max-height: calc(100dvh - 18px);
    }

    .xat-cookies-app-shell .xat-cookie-banner {
        bottom: max(77px, calc(env(safe-area-inset-bottom) + 66px));
        max-height: calc(100dvh - 88px);
    }

    .xat-cookie-banner__actions {
        grid-template-columns: 1fr;
    }

    .xat-cookie-banner__actions .xat-cookie-button--text {
        grid-column: auto;
    }

    .xat-cookie-category {
        gap: 10px;
    }

    .xat-cookie-dialog__footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .xat-cookie-dialog__footer .xat-cookie-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xat-cookie-banner,
    .xat-cookie-dialog,
    .xat-cookie-button,
    .xat-cookie-switch__track,
    .xat-cookie-switch__track::after {
        animation: none !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

@keyframes xat-cookie-enter {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes xat-cookie-enter-center {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes xat-dialog-enter {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
