.cookie-consent {
    --cookie-consent-bg: #1da1f2;
    --cookie-consent-fg: #fff;
    --cookie-consent-muted: rgba(255, 255, 255, 0.9);
    --cookie-consent-link: #fff;
    --cookie-consent-button-bg: #fff;
    --cookie-consent-button-fg: #075985;
    --cookie-consent-button-hover-bg: #e0f2fe;
    --cookie-consent-secondary-bg: rgba(255, 255, 255, 0.16);
    --cookie-consent-secondary-border: rgba(255, 255, 255, 0.55);
    --cookie-consent-panel-bg: rgba(4, 44, 79, 0.3);
    --cookie-consent-panel-border: rgba(255, 255, 255, 0.26);
    --cookie-consent-row-bg: rgba(255, 255, 255, 0.12);
    --cookie-consent-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    --cookie-consent-focus: rgba(255, 255, 255, 0.9);
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    overflow-anchor: none;
    contain: layout paint style;
    overscroll-behavior: contain;
    background: var(--cookie-consent-bg);
    padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
    z-index: 1000;
    color: var(--cookie-consent-fg);
    font-family: "Helvetica Neue", Arial, sans-serif;
    box-shadow: var(--cookie-consent-shadow);
    box-sizing: border-box;
}

.cookie-consent *,
.cookie-consent *::before,
.cookie-consent *::after {
    box-sizing: border-box;
}

.cookie-content {
    max-width: 1200px;
    min-height: 60px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.consent-text {
    flex: 1 1 auto;
    min-width: min(100%, 280px);
    font-size: 14px;
    line-height: 1.5;
    color: var(--cookie-consent-fg);
    overflow-wrap: anywhere;
}

.cookie-consent a {
    color: var(--cookie-consent-link);
    text-decoration: underline;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.cookie-reset-notice {
    display: block;
    margin-top: 6px;
    color: var(--cookie-consent-muted);
    font-size: 13px;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cookie-consent button {
    background: var(--cookie-consent-button-bg);
    color: var(--cookie-consent-button-fg);
    border: 0;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 100px;
    min-height: 44px;
}

.cookie-consent .cookie-preferences-button {
    background: var(--cookie-consent-secondary-bg);
    color: var(--cookie-consent-fg);
    border: 1px solid var(--cookie-consent-secondary-border);
}

.cookie-consent button:hover {
    background: var(--cookie-consent-button-hover-bg);
}

.cookie-consent .cookie-preferences-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.cookie-consent button:focus-visible,
.cookie-consent a:focus-visible {
    outline: 3px solid var(--cookie-consent-focus);
    outline-offset: 3px;
}

.cookie-preferences-panel {
    max-width: 1200px;
    margin: 8px auto 0;
    max-height: min(58vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    border-radius: 12px;
    background: var(--cookie-consent-panel-bg);
    border: 1px solid var(--cookie-consent-panel-border);
}

.cookie-preferences-panel[hidden] {
    display: none;
}

.cookie-preferences-header {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.cookie-preferences-header strong {
    font-size: 15px;
    line-height: 1.4;
}

.cookie-preferences-header p,
.cookie-runtime-gate-note {
    margin: 0;
    color: var(--cookie-consent-muted);
    font-size: 13px;
    line-height: 1.55;
}

.cookie-preferences-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.cookie-preference-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
    background: var(--cookie-consent-row-bg);
}

.cookie-preference-row input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: #fff;
}

.cookie-preference-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.cookie-preference-label {
    color: var(--cookie-consent-fg);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.cookie-preference-description {
    color: var(--cookie-consent-muted);
    font-size: 12px;
    line-height: 1.45;
}

.cookie-runtime-gate-note {
    margin-top: 10px;
}

.cookie-save-preferences-button {
    margin-top: 12px;
}

.cookie-consent--style-light-card,
.cookie-consent--style-dark-glass,
.cookie-consent--style-compact,
.cookie-consent--style-editorial {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    left: auto;
    width: min(720px, calc(100vw - 36px));
    max-height: calc(100vh - 36px - env(safe-area-inset-top));
    max-height: calc(100dvh - 36px - env(safe-area-inset-top));
    border-radius: 24px;
    padding: 18px;
}

.cookie-consent--style-light-card {
    --cookie-consent-bg: rgba(255, 255, 255, 0.98);
    --cookie-consent-fg: #111827;
    --cookie-consent-muted: #4b5563;
    --cookie-consent-link: #0f766e;
    --cookie-consent-button-bg: #0f766e;
    --cookie-consent-button-fg: #fff;
    --cookie-consent-button-hover-bg: #115e59;
    --cookie-consent-secondary-bg: #f8fafc;
    --cookie-consent-secondary-border: #cbd5e1;
    --cookie-consent-panel-bg: #f8fafc;
    --cookie-consent-panel-border: #e2e8f0;
    --cookie-consent-row-bg: #fff;
    --cookie-consent-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    --cookie-consent-focus: rgba(15, 118, 110, 0.42);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.cookie-consent--style-dark-glass {
    --cookie-consent-bg: rgba(15, 23, 42, 0.86);
    --cookie-consent-fg: #f8fafc;
    --cookie-consent-muted: rgba(226, 232, 240, 0.88);
    --cookie-consent-link: #93c5fd;
    --cookie-consent-button-bg: #f8fafc;
    --cookie-consent-button-fg: #0f172a;
    --cookie-consent-button-hover-bg: #dbeafe;
    --cookie-consent-secondary-bg: rgba(255, 255, 255, 0.1);
    --cookie-consent-secondary-border: rgba(255, 255, 255, 0.28);
    --cookie-consent-panel-bg: rgba(15, 23, 42, 0.72);
    --cookie-consent-panel-border: rgba(255, 255, 255, 0.2);
    --cookie-consent-row-bg: rgba(255, 255, 255, 0.08);
    --cookie-consent-shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
    --cookie-consent-focus: rgba(147, 197, 253, 0.7);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cookie-consent--style-compact {
    width: min(460px, calc(100vw - 28px));
    padding: 14px;
    border-radius: 18px;
    --cookie-consent-bg: #111827;
    --cookie-consent-fg: #fff;
    --cookie-consent-muted: rgba(255, 255, 255, 0.84);
    --cookie-consent-link: #fbbf24;
    --cookie-consent-button-bg: #fbbf24;
    --cookie-consent-button-fg: #111827;
    --cookie-consent-button-hover-bg: #f59e0b;
    --cookie-consent-secondary-bg: rgba(255, 255, 255, 0.08);
    --cookie-consent-secondary-border: rgba(255, 255, 255, 0.22);
    --cookie-consent-panel-bg: rgba(0, 0, 0, 0.18);
    --cookie-consent-panel-border: rgba(255, 255, 255, 0.18);
    --cookie-consent-row-bg: rgba(255, 255, 255, 0.08);
    --cookie-consent-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
    --cookie-consent-focus: rgba(251, 191, 36, 0.72);
}

.cookie-consent--style-compact .cookie-content {
    min-height: 0;
    align-items: flex-start;
}

.cookie-consent--style-compact .consent-text {
    flex-basis: 100%;
}

.cookie-consent--style-compact .cookie-actions {
    width: 100%;
}

.cookie-consent--style-editorial {
    --cookie-consent-bg: #fff7ed;
    --cookie-consent-fg: #1f2937;
    --cookie-consent-muted: #57534e;
    --cookie-consent-link: #9a3412;
    --cookie-consent-button-bg: #1f2937;
    --cookie-consent-button-fg: #fff7ed;
    --cookie-consent-button-hover-bg: #111827;
    --cookie-consent-secondary-bg: rgba(154, 52, 18, 0.08);
    --cookie-consent-secondary-border: rgba(154, 52, 18, 0.28);
    --cookie-consent-panel-bg: rgba(255, 237, 213, 0.72);
    --cookie-consent-panel-border: rgba(154, 52, 18, 0.18);
    --cookie-consent-row-bg: rgba(255, 255, 255, 0.7);
    --cookie-consent-shadow: 0 24px 64px rgba(67, 20, 7, 0.18);
    --cookie-consent-focus: rgba(154, 52, 18, 0.38);
    border: 1px solid rgba(154, 52, 18, 0.2);
    font-family: Georgia, "Times New Roman", serif;
}

@media (max-width: 1024px) {
    .cookie-consent {
        padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    }

    .consent-text {
        font-size: 15px;
    }

    .cookie-consent button {
        padding: 8px 15px;
    }

    .cookie-preferences-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .cookie-consent--style-light-card,
    .cookie-consent--style-dark-glass,
    .cookie-consent--style-compact,
    .cookie-consent--style-editorial {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        width: calc(100vw - 20px);
        border-radius: 18px;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
        align-items: stretch;
    }

    .consent-text {
        margin-bottom: 10px;
        font-size: 14px;
    }

    .cookie-consent button {
        width: 100%;
        max-width: 200px;
    }

    .cookie-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        justify-content: center;
    }

    .cookie-preferences-panel {
        max-height: min(52vh, 420px);
        text-align: left;
    }

    .cookie-preferences-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cookie-consent {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    }

    .consent-text {
        font-size: 12px;
    }

    .cookie-consent button {
        padding: 6px 12px;
        max-width: none;
    }

    .cookie-actions {
        gap: 6px;
    }

    .cookie-preferences-panel {
        padding: 10px;
    }

    .cookie-preference-row {
        padding: 8px;
    }
}
