:root {
    --ec-green: #156734;
    --ec-text: #252525;
    --ec-muted: #555;
    --ec-border: #d9d9d9;
    --ec-bg: #fff;
}

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

body.ec-modal-open {
    overflow: hidden !important;
}

.ec-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    z-index: 2147483000;
}

.ec-cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: calc(100% - 36px);
    max-width: 980px;
    padding: 28px 32px 30px;
    background: var(--ec-bg);
    color: var(--ec-text);
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, .09);
    border-radius: 4px;
    box-shadow: 0 12px 42px rgba(0, 0, 0, .24);
    z-index: 2147483001;
    font-family: inherit;
}

.ec-banner-title,
.ec-preferences-title,
.ec-preferences-body h3 {
    color: var(--ec-text);
    font-family: inherit;
}

.ec-banner-title {
    margin: 0 0 7px;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 700;
}

.ec-banner-text {
    margin: 0;
    color: #3f3f3f;
    font-size: 16px;
    line-height: 1.48;
}

.ec-banner-text a {
    color: var(--ec-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ec-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: center;
    margin-top: 24px;
}

.ec-link-button,
.ec-button,
.ec-close {
    font-family: inherit;
}

.ec-link-button {
    border: 0;
    background: transparent;
    padding: 12px 10px;
    color: #333;
    font-size: 16px;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.ec-button {
    min-height: 48px;
    padding: 10px 22px;
    background: #fff;
    border: 1px solid #222;
    border-radius: 0;
    color: #222;
    font-size: 16px;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ec-button:hover,
.ec-button:focus-visible {
    background: var(--ec-green);
    border-color: var(--ec-green);
    color: #fff;
}

.ec-link-button:focus-visible,
.ec-close:focus-visible {
    outline: 2px solid var(--ec-green);
    outline-offset: 2px;
}

.ec-preferences {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 50px);
    max-width: 970px;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    background: #fff;
    color: var(--ec-text);
    border-radius: 4px;
    box-shadow: 0 12px 45px rgba(0, 0, 0, .28);
    z-index: 2147483002;
    font-family: inherit;
}

.ec-preferences-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 28px 70px 22px 32px;
    border-bottom: 1px solid var(--ec-border);
}

.ec-preferences-title {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 700;
}

.ec-header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.ec-header-actions .ec-button {
    min-width: 138px;
}

.ec-header-actions #ec-save {
    min-width: 175px;
}

.ec-close {
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0 0 2px;
    border: 2px solid #8fd0f0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.ec-close:hover {
    border-color: var(--ec-green);
    color: var(--ec-green);
}

.ec-preferences-body {
    padding: 22px 32px 30px;
}

.ec-preferences-body h3 {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
}

.ec-preferences-intro {
    margin: 0 0 22px;
    color: var(--ec-muted);
    font-size: 16px;
    line-height: 1.45;
}

.ec-rule {
    height: 1px;
    background: var(--ec-border);
    margin-bottom: 8px;
}

.ec-category {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 16px;
    padding: 18px 0 4px;
}

.ec-category-control {
    padding-top: 2px;
}

.ec-category input[type="checkbox"] {
    width: 23px;
    height: 23px;
    margin: 0;
    accent-color: var(--ec-green);
    cursor: pointer;
}

.ec-category input[type="checkbox"]:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.ec-category-title {
    display: block;
    margin-bottom: 4px;
    color: var(--ec-text);
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
}

.ec-category-description {
    margin: 0;
    color: var(--ec-muted);
    font-size: 15px;
    line-height: 1.45;
}


@media (max-width: 900px) {
    .ec-preferences-header {
        grid-template-columns: 1fr;
        padding-right: 64px;
    }

    .ec-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ec-header-actions #ec-save {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .ec-cookie-banner {
        width: calc(100% - 20px);
        bottom: 10px;
        padding: 21px 18px 18px;
    }

    .ec-banner-title {
        font-size: 19px;
    }

    .ec-banner-text {
        font-size: 14px;
    }

    .ec-banner-actions {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 18px;
    }

    .ec-link-button {
        order: 3;
    }

    .ec-preferences {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }

    .ec-preferences-header {
        padding: 20px 56px 18px 18px;
    }

    .ec-preferences-title {
        font-size: 19px;
    }

    .ec-header-actions {
        grid-template-columns: 1fr;
        grid-column: 1 / -1;
    }

    .ec-header-actions #ec-save {
        grid-column: auto;
    }

    .ec-header-actions .ec-button,
    .ec-header-actions #ec-save {
        min-width: 0;
        width: 100%;
    }

    .ec-close {
        right: 14px;
        top: 14px;
        transform: none;
    }

    .ec-preferences-body {
        padding: 20px 18px 24px;
    }

    .ec-preferences-intro {
        font-size: 14px;
    }

    .ec-category {
        gap: 12px;
    }

    .ec-category-description {
        font-size: 14px;
    }
}
