.firstmk-cookie[hidden],
.firstmk-cookie-settings[hidden] {
    display: none;
}

.firstmk-cookie {
    position: fixed;
    z-index: 95;
    inset-inline-end: max(1rem, env(safe-area-inset-right));
    inset-block-end: max(1rem, env(safe-area-inset-bottom));
    box-sizing: border-box;
    inline-size: min(26rem, calc(100% - 2rem));
    max-block-size: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.25rem;
    border-radius: var(--pmk-hero-radius);
    background: #fff;
    color: #141414;
    box-shadow: 0 8px 32px rgb(20 43 63 / 13%);
    font: 400 var(--site-type-body)/1.5 var(--site-font);
}

.firstmk-cookie h2 {
    margin: 0 0 .3rem;
    font: 600 var(--site-type-lead)/1.35 var(--site-font);
}

.firstmk-cookie p {
    margin: 0;
}

.firstmk-cookie__links {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .875rem;
    padding-block-start: .6rem;
    font-size: var(--site-type-caption);
}

.firstmk-cookie__links a,
.firstmk-external-embed a {
    color: #0066bd;
    text-decoration: underline;
    text-underline-offset: .18em;
}

.firstmk-cookie__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: .5rem;
    margin-block-start: 1rem;
}

.firstmk-cookie__actions button,
.firstmk-external-embed button {
    min-block-size: 44px;
    padding: .5rem var(--pmk-action-padding-inline);
    border: 1px solid #a9c7df;
    border-radius: .5rem;
    background: #fff;
    color: #005aab;
    font: inherit;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.firstmk-cookie__actions button:hover,
.firstmk-external-embed button:hover {
    border-color: transparent;
    background: #edf6fe;
}

.firstmk-cookie__actions button {
    font-size: var(--site-type-caption);
}

.firstmk-cookie__actions button[aria-disabled="true"] {
    opacity: .6;
    cursor: progress;
}

.firstmk-cookie-settings {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: .15em;
    cursor: pointer;
}

.firstmk-cookie :is(a, button):focus-visible,
.firstmk-cookie-settings:focus-visible,
.firstmk-external-embed :is(a, button):focus-visible {
    outline: 2px solid #0066bd;
    outline-offset: 2px;
}

.firstmk-cookie .firstmk-cookie__status:not(:empty) {
    margin-block-start: .6rem;
    font-size: var(--site-type-caption);
}

.firstmk-external-embed {
    display: grid;
    min-block-size: 100%;
    place-content: center;
    justify-items: center;
    gap: .5rem;
    padding: 1.25rem;
    background: #f5f8fb;
    text-align: center;
}

.firstmk-external-embed button {
    border-color: transparent;
}

.firstmk-external-embed a {
    font-size: var(--site-type-caption);
}

@media (640px <= width <= 72rem) {
    .pmk-page .firstmk-cookie {
        inset-block-end: calc(max(1rem, env(safe-area-inset-bottom)) + 58px);
        max-block-size: calc(100dvh - 5.75rem);
    }
}

@media (width < 640px) {
    .pmk-home .firstmk-cookie:not(.firstmk-cookie--settings) {
        position: static;
        inline-size: min(100%, 26rem);
        max-block-size: none;
        margin-block-start: .5rem;
        padding: .875rem;
        box-shadow: none;
    }
}

@media (max-width: 24rem) {
    .firstmk-cookie { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .firstmk-cookie__actions button,
    .firstmk-external-embed button { transition: none; }
}
