.analytics-consent {
    color: inherit;
    font: inherit;
}

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

.consent-banner,
.consent-dialog {
    -webkit-text-size-adjust: 100%;
    background: #fff;
    border: 1px solid #d5e4f2;
    border-radius: 20px;
    box-shadow: 0 16px 64px rgba(7, 27, 63, .18);
    box-sizing: border-box;
    color: #122b46;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    padding: 24px;
    text-align: start;
}

.consent-banner {
    bottom: 16px;
    inset-block-end: max(16px, env(safe-area-inset-bottom));
    inset-inline: 16px;
    left: 16px;
    margin: 0 auto;
    max-height: calc(100vh - 32px);
    max-width: 620px;
    overflow-y: auto;
    position: fixed;
    right: 16px;
    width: calc(100% - 32px);
    /* Выше закреплённой шапки сайта, которая использует z-index: 1000. */
    z-index: 1100;
}

.consent-dialog {
    margin: auto;
    max-height: calc(100vh - 32px);
    max-width: 640px;
    overflow-y: auto;
    overscroll-behavior: contain;
    width: calc(100% - 32px);
}

.consent-dialog:not([open]) {
    display: none;
}

.consent-dialog--fallback[open] {
    display: block;
    height: auto;
    left: 16px;
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1102;
}

.consent-backdrop {
    background: rgba(7, 27, 63, .45);
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1101;
}

.consent-dialog::backdrop {
    background: rgba(7, 27, 63, .45);
}

.analytics-consent h2 {
    color: #122b46;
    font-size: 22px;
    letter-spacing: normal;
    line-height: 1.25;
    margin: 0 0 12px;
}

.analytics-consent p {
    margin: 10px 0;
    max-width: none;
}

.consent-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.consent-button,
.consent-link {
    cursor: pointer;
    font: inherit;
    min-height: 44px;
}

.consent-button {
    background: #edf5ff;
    border: 1px solid #145bff;
    border-radius: 12px;
    color: #104bbd;
    flex: 1 1 180px;
    font-weight: 600;
    padding: 10px 16px;
}

.consent-button:hover {
    background: #deedff;
}

.consent-button[data-consent-choice="grant"] {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.consent-button[data-consent-choice="grant"]:hover {
    background: #166534;
    border-color: #166534;
}

.consent-button[data-consent-save] {
    background: #f59e0b;
    border-color: #d97706;
    color: #422006;
}

.consent-button[data-consent-save]:hover {
    background: #fbbf24;
    border-color: #d97706;
}

.consent-button[data-consent-choice="deny"] {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.consent-button[data-consent-choice="deny"]:hover {
    background: #eef2f6;
    border-color: #94a3b8;
}

.consent-link {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: inline-flex;
    padding: 8px 4px;
    text-decoration: underline dotted;
    text-underline-offset: 4px;
}

.analytics-consent button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.analytics-consent :focus-visible {
    outline: 3px solid #145bff;
    outline-offset: 3px;
}

.consent-option {
    border-top: 1px solid #d5e4f2;
    margin: 16px 0;
    padding: 16px 0;
}

.consent-option label {
    align-items: center;
    cursor: pointer;
    display: flex;
    min-height: 44px;
}

.consent-option label > span,
.consent-option label > strong {
    font-size: 14px;
    min-width: 0;
}

.consent-option input {
    accent-color: #145bff;
    flex: 0 0 22px;
    height: 22px;
    margin: 0 12px 0 0;
    min-height: 22px;
    min-width: 22px;
    width: 22px;
}

@supports (inset: 0) {
    .consent-option label {
        gap: 12px;
    }

    .consent-option input {
        margin-right: 0;
    }
}

@supports (height: 100svh) {
    .consent-banner,
    .consent-dialog {
        max-height: calc(100svh - 32px);
    }
}

.consent-note,
.consent-status,
.consent-option p {
    color: #4d6580;
    font-size: 13px;
}

.consent-status:empty {
    display: none;
}

.consent-document summary {
    cursor: pointer;
    font-weight: 600;
    padding: 12px 0;
}

[data-consent-text] {
    font-size: 14px;
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
}

@media (max-width: 480px) {
    .consent-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .consent-actions .consent-button {
        flex-basis: auto;
    }

    .consent-actions .consent-link {
        justify-content: center;
    }
}
