.cookie-notice {
    position: fixed;
    inset-inline: 12px;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 24px;
    box-sizing: border-box;
    max-width: 1100px;
    max-height: 40vh;
    max-height: 40dvh;
    margin-inline: auto;
    padding: 16px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #bfd6e4;
    border-radius: 10px;
    background: #fff;
    color: #203d51;
    box-shadow: 0 4px 24px rgb(22 58 80 / 18%);
}

.cookie-notice[hidden],
.cookie-notice [hidden] {
    display: none !important;
}

body.cookie-notice-visible {
    padding-bottom: var(--cookie-notice-space, 0px);
}

#cookie-notice-text {
    min-width: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.cookie-notice a {
    color: #086b9d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-notice-actions,
.cookie-preference-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

.cookie-notice .cookie-choice {
    box-sizing: border-box;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #127caf;
    border-radius: 6px;
    background: #fff;
    color: #086b9d;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.cookie-notice .cookie-choice:hover {
    background: #eef7fc;
}

.cookie-notice .cookie-choice:disabled {
    opacity: .65;
    cursor: wait;
}

.cookie-notice a:focus-visible,
.cookie-notice button:focus-visible,
.cookie-notice input:focus-visible {
    outline: 3px solid #173d56;
    outline-offset: 3px;
}

.cookie-preferences,
.cookie-consent-status {
    grid-column: 1 / -1;
    min-width: 0;
}

.cookie-preferences {
    padding-top: 16px;
    border-top: 1px solid #d7e4ed;
}

.cookie-preferences fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cookie-preferences legend {
    margin-bottom: 10px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
}

.cookie-category + .cookie-category {
    margin-top: 10px;
}

.cookie-category label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.cookie-category input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #127caf;
}

.cookie-category small {
    display: inline-block;
    margin-left: 8px;
    color: #536c7d;
    font-size: 12px;
    font-weight: 400;
}

.cookie-category p {
    margin: 0 0 0 32px;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cookie-preference-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.cookie-consent-status {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cookie-consent-status.is-error {
    color: #9c2525;
}

.site-footer .cookie-settings-link {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 0;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.site-footer .cookie-settings-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

@media (max-width: 900px) {
    .cookie-notice {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .cookie-notice {
        gap: 12px;
        padding: 12px 14px;
    }

    .cookie-notice .cookie-choice {
        padding: 10px 6px;
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .cookie-notice {
        max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }

    .cookie-notice-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }

    .cookie-notice-actions .cookie-choice {
        width: 100%;
        min-height: 50px;
        padding: 12px 16px;
        font-size: 15px;
        overflow-wrap: normal;
        word-break: normal;
    }

    #cookie-accept-all {
        min-height: 56px;
        background: #127caf;
        color: #fff;
        font-size: 16px;
    }

    #cookie-accept-all:hover {
        background: #086b9d;
    }
}
