.sanit-vote-dialog {
    --sanit-vote-accent: #19b4d7;
    --sanit-vote-text: #f5f5f5;
    --sanit-vote-close-size: 44px;
    --sanit-vote-close-inset: 13px;
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(930px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 22px;
    background: #292929;
    color: var(--sanit-vote-text);
    font: 400 16px/1.55 system-ui, sans-serif;
    box-shadow: 0 18px 70px #06162956;
}

.sanit-vote-dialog[open] {
    animation: sanit-vote-reveal 360ms cubic-bezier(.2, .75, .28, 1) both;
}

.sanit-vote-dialog::backdrop {
    background: #111a20a8;
    animation: sanit-vote-dim 260ms ease-out both;
}

html:has(.sanit-vote-dialog[open]) {
    overflow: hidden;
}

.sanit-vote-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: 'heading photo' 'copy photo';
    gap: 21px clamp(24px, 4vw, 44px);
    padding: clamp(28px, 4.5vw, 48px);
    padding-block-start: calc(var(--sanit-vote-close-inset) + var(--sanit-vote-close-size) + 8px);
}

.sanit-vote-heading {
    position: relative;
    grid-area: heading;
    align-self: end;
}

.sanit-vote-heading::before {
    position: absolute;
    inset-block: 4px;
    inset-inline-start: calc(-1 * clamp(28px, 4.5vw, 48px));
    width: 5px;
    background: var(--sanit-vote-accent);
    content: '';
}

.sanit-vote-heading #sanit-vote-title {
    margin: 0;
    color: #fff;
    font: 430 clamp(17px, 2.55vw, 27px)/1.18 system-ui, sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

#sanit-vote-title > [data-copy="titleBridge"] {
    font: inherit;
    letter-spacing: normal;
}

#sanit-vote-title strong {
    font-size: clamp(27px, 4.8vw, 49px);
    font-weight: 780;
    line-height: 1.04;
    letter-spacing: -.036em;
    text-transform: uppercase;
}

.sanit-vote-title-end {
    display: block;
    margin-top: 4px;
}

.sanit-vote-art {
    position: relative;
    grid-area: photo;
    align-self: center;
    isolation: isolate;
}

.sanit-vote-art::after {
    position: absolute;
    z-index: -1;
    inset: 10px -10px -10px 10px;
    border: 2px solid var(--sanit-vote-accent);
    border-radius: 12px;
    content: '';
}

.sanit-vote-art .sanit-vote-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 840 / 1128;
    border-radius: 11px;
    background: #363636;
    object-fit: cover;
}

.sanit-vote-copy {
    grid-area: copy;
    align-self: start;
}

.sanit-vote-copy .sanit-vote-description {
    max-width: 45ch;
    margin: 0 0 18px;
    font: inherit;
    text-wrap: pretty;
}

.sanit-vote-copy .sanit-vote-date {
    margin: 0 0 13px;
    color: var(--sanit-vote-text);
    font-size: 14px;
    font-weight: 650;
}

.sanit-vote-card .sanit-vote-cta {
    display: inline-block;
    box-sizing: border-box;
    min-height: 46px;
    max-width: 100%;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--sanit-vote-accent);
    color: #09232c;
    font: 740 15px/30px system-ui, sans-serif;
    letter-spacing: .05em;
    text-align: center;
    text-decoration: none;
}

.sanit-vote-cta strong {
    font-size: 1.7em;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .025em;
}

.sanit-vote-card .sanit-vote-cta:hover {
    background: #64d5ed;
    color: #09232c;
}

.sanit-vote-preferences {
    display: flex;
    flex-wrap: wrap;
    column-gap: 18px;
    margin-top: 5px;
}

.sanit-vote-preferences button {
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--sanit-vote-text);
    cursor: pointer;
    font: 550 13px/1.4 system-ui, sans-serif;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sanit-vote-preferences button:hover {
    color: #89e5f7;
}

.sanit-vote-copy .sanit-vote-thanks {
    margin: 7px 0 0;
    color: var(--sanit-vote-text);
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-line;
}

.sanit-vote-dialog .sanit-vote-close {
    position: absolute;
    z-index: 2;
    inset-block-start: var(--sanit-vote-close-inset);
    inset-inline-end: var(--sanit-vote-close-inset);
    display: grid;
    box-sizing: border-box;
    width: var(--sanit-vote-close-size);
    height: var(--sanit-vote-close-size);
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #242424;
    cursor: pointer;
}

.sanit-vote-dialog .sanit-vote-close:hover {
    background: #e6f7fb;
}

.sanit-vote-close::before,
.sanit-vote-close::after {
    grid-area: 1 / 1;
    width: 17px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    content: '';
    transform: rotate(45deg);
}

.sanit-vote-close::after {
    transform: rotate(-45deg);
}

.sanit-vote-dialog :is(button, a):focus-visible {
    outline: 2px solid #91e9fa;
    outline-offset: 3px;
}

.sanit-vote-ballot {
    width: min(1120px, calc(100vw - 32px));
    height: min(880px, calc(100vh - 32px));
    height: min(880px, calc(100dvh - 32px));
    overflow: hidden;
}

.sanit-vote-ballot[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.sanit-vote-ballot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px clamp(14px, 4vw, 24px);
}

.sanit-vote-ballot-header #sanit-vote-ballot-title {
    margin: 0 0 3px;
    color: #fff;
    font: 680 clamp(17px, 3vw, 22px)/1.2 system-ui, sans-serif;
}

.sanit-vote-ballot-header .sanit-vote-ballot-external {
    color: #a0eafb;
    font: 550 14px/1.4 system-ui, sans-serif;
    text-decoration: underline;
}

.sanit-vote-ballot-header .sanit-vote-close {
    position: static;
    flex-shrink: 0;
}

.sanit-vote-ballot .sanit-vote-ballot-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

.sanit-vote-chat a:focus-visible {
    outline: 2px solid #082746;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #fff;
}

.sanit-vote-chat[hidden],
.mwai-block:has(.sanit-vote-chat[hidden]) {
    display: none !important;
}

.sanit-vote-chat {
    padding: 10px 13px;
    border-inline-start: 3px solid #0a559c;
    border-radius: 4px;
    background: #eaf4fb;
    color: #102b43;
    font-size: .92em;
    line-height: 1.4;
}

.sanit-vote-chat p {
    margin: 4px 0 6px;
}

.sanit-vote-chat a {
    color: #084581;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@keyframes sanit-vote-reveal {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sanit-vote-dim {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 690px) {
    .sanit-vote-dialog {
        border-radius: 15px;
    }

    .sanit-vote-card {
        grid-template-columns: minmax(0, 1fr) minmax(0, 40%);
        grid-template-areas: 'heading photo' 'copy copy';
        gap: 26px 16px;
        padding-inline: 22px;
        padding-block-end: 20px;
    }

    .sanit-vote-heading {
        align-self: center;
        container-type: inline-size;
    }

    .sanit-vote-heading::before {
        inset-inline-start: -22px;
        width: 4px;
    }

    #sanit-vote-title > [data-copy="titleBridge"] {
        display: block;
        margin-top: 4px;
        font-size: clamp(14px, 3.5vw, 20px);
        line-height: 1.2;
    }

    #sanit-vote-title strong {
        display: block;
        font-size: clamp(22px, 9.7vw, 49px);
        font-size: clamp(18px, 23.5cqi, 49px);
        overflow-wrap: break-word;
    }

    .sanit-vote-art::after {
        inset: 6px -6px -6px 6px;
        border-radius: 9px;
    }

    .sanit-vote-art .sanit-vote-photo {
        border-radius: 8px;
    }

    .sanit-vote-copy .sanit-vote-description {
        max-width: 48ch;
        margin-bottom: 12px;
    }

    .sanit-vote-card .sanit-vote-cta {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .sanit-vote-card {
        gap: 12px 13px;
        padding-inline: 18px;
        padding-block-end: 14px;
    }

    .sanit-vote-heading::before {
        inset-inline-start: -18px;
    }

    .sanit-vote-copy .sanit-vote-description {
        margin-bottom: 8px;
        font-size: 15px;
        line-height: 1.4;
    }

    .sanit-vote-copy .sanit-vote-date {
        margin-bottom: 10px;
    }

    .sanit-vote-card .sanit-vote-cta {
        padding-inline: 9px;
        font-size: 13px;
    }

    .sanit-vote-preferences {
        column-gap: 12px;
        margin-top: 2px;
    }

    .sanit-vote-preferences button {
        font-size: 12px;
    }

    .sanit-vote-copy .sanit-vote-thanks {
        margin-top: 3px;
        font-size: 13px;
        line-height: 1.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sanit-vote-dialog[open],
    .sanit-vote-dialog::backdrop {
        animation: none;
    }
}
