/* GE + primary polling Mediavine: class-only desktop leaderboard wells. v=20260901m */

:root {
    --pm-poll-ad-object-gap: 1.75rem; /* pt-7 — same air as poll-table / section objects */
}
@media (min-width: 640px) {
    :root {
        --pm-poll-ad-object-gap: 2.25rem; /* sm:pt-9 */
    }
}

.pm-tx-ad-band {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    text-align: center;
}

/* PC-only in-content wells. Page-top is desktop-only; mobile uses class-only wells between panels. */
@media (max-width: 767px) {
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"],
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"],
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"],
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="page-top"],
    html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        pointer-events: none !important;
        background: transparent !important;
    }
}

html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop .pm-ad-slot {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop:is(
    [data-pm-well-filled="1"],
    :has(.mv-ad-box),
    :has([id^="mvp-"]),
    :has(iframe),
    :has(ins.adsbygoogle)
) .pm-ad-slot {
    min-height: 250px !important;
    height: 250px !important;
    max-height: 250px !important;
}

html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop .mv-ad-box,
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop [id^="mvp-"] {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: max-content;
    max-width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100%;
    margin: auto !important;
    overflow: hidden;
    align-self: center;
}
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop iframe,
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop img {
    display: block !important;
    float: none !important;
    margin: auto !important;
    align-self: center;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    html.race-view-polling main.mv-content {
        overflow: visible;
    }
    html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop {
        position: relative;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        background: transparent !important;
        text-align: center;
        pointer-events: auto;
        opacity: 1;
    }
    html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) {
        padding: 16px 1.5rem !important;
        height: calc(250px + 32px) !important;
        min-height: calc(250px + 32px) !important;
        max-height: calc(250px + 32px) !important;
        overflow: hidden !important;
        background: #0b0e13 !important;
        border-top: none;
        border-bottom: 1px solid rgb(30 41 55 / 0.8) !important;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="page-top"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) {
        padding-top: 0 !important;
        height: calc(250px + 16px) !important;
        min-height: calc(250px + 16px) !important;
        max-height: calc(250px + 16px) !important;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ),
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ),
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) {
        border-top: 1px solid rgb(30 41 55 / 0.8) !important;
        border-bottom: 1px solid rgb(30 41 55 / 0.8) !important;
    }
    /*
     * Object-gap only around a filled well so empty slots don't open a hole
     * between summary/stats or between methodology and the footer ad.
     */
    html.race-view-polling main > section:has(+ .pm-tx-ad-band:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    )) > div,
    html.race-view-polling .polling-about:has(+ .pm-tx-ad-band:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    )) .polling-about__inner {
        padding-bottom: var(--pm-poll-ad-object-gap) !important;
    }
    /* GE chart cluster uses py-14; don't let object-gap collapse the air
       above the mid well. The well owns a 2.5rem gap on both sides. */
    html.race-view-polling main > section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    )) > div {
        padding-bottom: 0 !important;
    }
    /* If a well is still jammed under the description panel, keep the same air. */
    html.race-view-polling #pollingSummary + .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ),
    html.race-view-polling .mi-senate-polling-summary + .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) {
        margin-top: 2.5rem !important;
    }
    html.race-view-polling .pm-tx-ad-band:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) + section > div,
    html.race-view-polling .pm-tx-ad-band:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) + section:has(#pollsTableShell) > div {
        padding-top: var(--pm-poll-ad-object-gap) !important;
        margin-top: 0 !important;
    }
    html.race-view-polling .pm-tx-ad-band:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) + section .state-polls-shell {
        margin-top: 0 !important;
    }

    /*
     * Primary polling: chart is py-14 and the table is pt-7, so the mid well
     * was cramped and uneven. Own the gap on the well so both sides match.
     */
    html.race-view-polling .et-primary-main-section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    )) > div {
        padding-bottom: 0 !important;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) {
        margin-top: 2.5rem !important;
        margin-bottom: 2.5rem !important;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) + .et-primary-main-section > div,
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"]:is(
        [data-pm-well-filled="1"],
        :has(.mv-ad-box),
        :has([id^="mvp-"]),
        :has(iframe),
        :has(ins.adsbygoogle)
    ) + section:has(#pollsTableShell) > div {
        padding-top: 0 !important;
    }
    @media (min-width: 1024px) {
        html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop:is(
            [data-pm-well-filled="1"],
            :has(.mv-ad-box),
            :has([id^="mvp-"]),
            :has(iframe),
            :has(ins.adsbygoogle)
        ) {
            padding-left: 2.5rem !important;
            padding-right: 2.5rem !important;
        }
    }
    @media (min-width: 1280px) {
        html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop:is(
            [data-pm-well-filled="1"],
            :has(.mv-ad-box),
            :has([id^="mvp-"]),
            :has(iframe),
            :has(ins.adsbygoogle)
        ) {
            padding-left: 3.5rem !important;
            padding-right: 3.5rem !important;
        }
    }
}

/* Bottom well sits on the footer — no multiplex / auto units under it. */
html.race-view-polling main.mv-content.pb-20,
html.race-view-polling main.mv-content {
    padding-bottom: 0 !important;
}
html.race-view-polling footer[data-et-site-footer="1"].mt-32,
html.race-view-polling footer[data-et-site-footer="1"] {
    margin-top: 0 !important;
    border-top: none !important;
}
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"],
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"],
html.race-view-polling .pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] {
    margin-bottom: 0 !important;
}
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"] ~ [id^="mvp-"],
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"] ~ .mv-ad-box,
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"] ~ .google-auto-placed,
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"] ~ [id^="mvp-"],
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"] ~ .mv-ad-box,
html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"] ~ .google-auto-placed,
html.race-view-polling .pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] ~ [id^="mvp-"],
html.race-view-polling .pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] ~ .mv-ad-box,
html.race-view-polling .pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] ~ .google-auto-placed,
html.race-view-polling main.mv-content + [id^="mvp-"],
html.race-view-polling main.mv-content + .mv-ad-box,
html.race-view-polling main.mv-content + .google-auto-placed,
html.race-view-polling main.mv-content + aside.pollsmax-ad-shell,
html.race-view-polling main.mv-content + aside.pollsmax-site-multiplex {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
html.race-view-polling aside.pollsmax-site-multiplex,
html.race-view-polling aside.pollsmax-site-multiplex.pollsmax-ad-shell,
html.race-view-polling aside.pollsmax-site-multiplex[data-ad-state],
html.race-view-polling aside.pollsmax-site-multiplex:not([data-pollsmax-ad-empty="1"]),
html.race-view-polling aside.pollsmax-site-multiplex:has(ins.adsbygoogle[data-ad-status="filled"]),
html.race-view-polling aside.pollsmax-site-multiplex[data-pollsmax-mux-settled="1"],
html.race-view-polling aside.pollsmax-site-multiplex iframe,
html.race-view-polling aside.pollsmax-site-multiplex ins.adsbygoogle,
html.race-view-polling #pollsmaxSiteMultiplex,
html.race-view-polling #homeAdMultiplex {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
