.cookie-banner,
.cookie-manage {
    --cookie-gold: #c8a878;
    position: fixed;
    z-index: 30;
    left: max(10px, env(safe-area-inset-left));
    color: var(--navy);
    background: var(--cookie-gold);
    box-shadow: 0 8px 28px rgb(11 16 32 / .28);
}

.cookie-banner {
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(520px, calc(100% - 20px));
    max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
    padding: 18px 19px 14px;
    overflow: auto;
    border-radius: var(--radius);
    font-size: .875rem;
    line-height: 1.5;
}

.cookie-banner [hidden],
.cookie-banner[hidden],
.cookie-manage[hidden] {
    display: none;
}

.cookie-banner-header {
    position: relative;
    padding: 0 36px;
    text-align: center;
}

.cookie-banner-header h2 {
    margin: 0;
    font-size: 1rem;
}

.cookie-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: 700 1.55rem/1 Arial, sans-serif;
}

.cookie-close:hover {
    background: rgb(255 255 255 / .28);
}

.cookie-message {
    margin: 24px 0;
}

.cookie-categories {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.cookie-category,
.cookie-required,
.cookie-unavailable {
    position: relative;
    border-radius: 5px;
    background: rgb(255 255 255 / .34);
}

.cookie-categories summary {
    min-height: 42px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

.cookie-category summary {
    padding-right: 70px;
}

.cookie-categories details p {
    margin: 0;
    padding: 0 12px 12px;
}

.cookie-always,
.cookie-unavailable summary span {
    float: right;
    color: #254720;
    font-size: .8rem;
}

.cookie-unavailable summary span {
    color: var(--navy);
}

.cookie-toggle {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 50px;
    min-height: 38px;
    margin: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.cookie-toggle input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.cookie-switch {
    width: 36px;
    height: 21px;
    border: 1px solid #58524a;
    border-radius: 999px;
    background: #645c51;
}

.cookie-switch::before {
    display: block;
    width: 15px;
    height: 15px;
    margin: 2px;
    border-radius: 50%;
    background: white;
    content: "";
}

.cookie-toggle input:checked + .cookie-switch {
    border-color: var(--navy);
    background: var(--navy);
}

.cookie-toggle input:checked + .cookie-switch::before {
    transform: translateX(15px);
}

.cookie-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cookie-actions button,
.cookie-actions a,
.cookie-inline-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--navy);
    border-radius: 6px;
    color: white;
    background: var(--navy);
    text-align: center;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.cookie-actions button:hover,
.cookie-actions a:hover,
.cookie-inline-action:hover {
    background: #293653;
}

.cookie-actions button:disabled,
.cookie-close:disabled {
    opacity: .7;
    cursor: wait;
}

.cookie-error {
    margin: 0 0 10px;
    color: #5d0c09;
    font-weight: 700;
}

.cookie-policy-link {
    display: block;
    width: fit-content;
    margin: 8px auto 0;
    padding: 3px 6px;
    text-decoration: underline;
}

.cookie-manage {
    bottom: env(safe-area-inset-bottom);
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 8px 8px 0 0;
    font-size: .875rem;
    font-weight: 700;
}

.cookie-banner :focus-visible,
.cookie-toggle input:focus-visible + .cookie-switch,
.cookie-manage:focus-visible,
.cookie-inline-action:focus-visible {
    outline: 2px solid white;
    outline-offset: 1px;
    box-shadow: 0 0 0 4px var(--navy);
}

@media (forced-colors: active) {
    .cookie-toggle input {
        position: static;
        width: 20px;
        height: 20px;
        opacity: 1;
    }

    .cookie-switch {
        display: none;
    }
}

.privacy-footer {
    padding: 16px 0 50px;
    border-top: 1px solid var(--line);
    color: var(--navy);
    background: var(--soft);
    text-align: right;
    font-size: .875rem;
}

.privacy-footer a,
.cookie-policy a:not(.cookie-inline-action) {
    text-decoration: underline;
    text-underline-offset: .18em;
}

.cookie-policy h2 {
    margin-top: 1.6em;
}

.cookie-policy address {
    font-style: normal;
}

.cookie-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.cookie-table-wrap table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.cookie-table-wrap th,
.cookie-table-wrap td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.cookie-table-wrap thead {
    color: white;
    background: var(--navy);
}

.cookie-table-wrap tbody tr:last-child > * {
    border-bottom: 0;
}

@media (max-width: 420px) {
    .cookie-banner {
        padding-inline: 14px;
    }

    .cookie-message {
        margin-block: 15px;
    }

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

    .cookie-actions :last-child:not([hidden]),
    .cookie-actions [data-cookie-expand] {
        grid-column: 1 / -1;
    }
}
