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

body.cookie-consent-visible {
    padding-bottom: 0;
}

.cookie-consent {
    position: fixed;
    right: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 1000;
    width: min(960px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(18, 54, 74, 0.14);
    border-radius: 20px;
    box-shadow: 0 18px 55px rgba(18, 54, 74, 0.22);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
}

.cookie-consent__content {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    grid-template-areas:
        "title actions"
        "body actions"
        "links actions";
    gap: 4px 24px;
    align-items: center;
    padding: 18px 20px;
}

.cookie-consent h2 {
    grid-area: title;
    margin: 0;
    color: var(--ink);
    font-family: Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.2;
}

.cookie-consent p {
    margin: 0;
}

.cookie-consent #cookie-consent-description {
    grid-area: body;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.cookie-consent__actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.cookie-consent__actions button {
    min-height: 40px;
    padding: 9px 14px;
    color: #fff;
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 999px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-consent__actions button:first-child {
    color: var(--ink);
    background: transparent;
    border-color: rgba(18, 54, 74, 0.35);
}

.cookie-consent__actions button:nth-child(2) {
    color: var(--ink);
    background: #e8f3f1;
    border-color: #b8d3cf;
}

.cookie-consent__actions button:hover {
    color: #fff;
    background: var(--teal);
    border-color: var(--teal);
}

.cookie-consent__links {
    grid-area: links;
    padding-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
}

.cookie-consent__links a {
    font-weight: 700;
}

.transform-cookie-settings {
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

@media (max-width: 760px) {
    .cookie-consent {
        bottom: max(12px, env(safe-area-inset-bottom));
        width: min(620px, calc(100% - 24px));
        border-radius: 18px;
    }

    .cookie-consent__content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "body"
            "actions"
            "links";
        gap: 8px;
        padding: 16px;
    }

    .cookie-consent__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: stretch;
        margin-top: 2px;
    }

    .cookie-consent__actions button {
        width: 100%;
        white-space: normal;
    }

    .cookie-consent__actions button:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 360px) {
    .cookie-consent__actions {
        grid-template-columns: 1fr;
    }

    .cookie-consent__actions button:last-child {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent {
        backdrop-filter: none;
    }
}
