/* GE + primary polling Mediavine: desktop leaderboard wells always reserved. v=20260902c */

: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;
}

/* Primary pages: collapse the chart–table well when JS marks it skipped (<20 polls). */
.pm-tx-ad-band[data-pm-rf-place="under-chart"][data-pm-skip-mid="1"],
.pm-tx-ad-band[data-pm-rf-place="under-chart"][data-pm-skip-mid="1"] .pm-ad-slot {
    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;
}

/* PC-only in-content wells. Page-top is desktop-only; mobile uses class-only wells between panels. */
@media (max-width: 767px) {
    .pm-tx-ad-band[data-pm-rf-place="under-chart"],
    .pm-tx-ad-band[data-pm-rf-place="under-methodology"],
    .pm-tx-ad-band[data-pm-rf-place="under-table"],
    .pm-tx-ad-band[data-pm-rf-place="page-top"],
    .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;
    }
}

.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: 250px !important;
    height: 250px !important;
    max-height: 250px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pm-tx-ad-band.pm-tx-ad-band--desktop .mv-ad-box,
.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;
}
.pm-tx-ad-band.pm-tx-ad-band--desktop iframe,
.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;
    }
    .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: 16px 1.5rem !important;
        height: calc(250px + 32px) !important;
        min-height: calc(250px + 32px) !important;
        max-height: calc(250px + 32px) !important;
        overflow: hidden !important;
        border-top: none;
        border-bottom: 1px solid rgb(30 41 55 / 0.8) !important;
        background: #0b0e13 !important;
        text-align: center;
        pointer-events: auto;
        opacity: 1;
    }
    .pm-tx-ad-band[data-pm-rf-place="page-top"] {
        padding-top: 0 !important;
        height: calc(250px + 16px) !important;
        min-height: calc(250px + 16px) !important;
        max-height: calc(250px + 16px) !important;
    }
    .pm-tx-ad-band[data-pm-rf-place="under-chart"],
    .pm-tx-ad-band[data-pm-rf-place="under-methodology"],
    .pm-tx-ad-band[data-pm-rf-place="under-table"] {
        border-top: 1px solid rgb(30 41 55 / 0.8) !important;
        border-bottom: 1px solid rgb(30 41 55 / 0.8) !important;
    }
    /*
     * Object-gap around every desktop well so first paint matches forecast
     * pages: the band is already there, not inserted after Mediavine fills.
     */
    html.race-view-polling main > section:has(+ .pm-tx-ad-band) > div,
    html.race-view-polling .polling-about:has(+ .pm-tx-ad-band) .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 smaller top gap and more air
       above the poll table. */
    html.race-view-polling main > section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-chart"]) > 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"],
    html.race-view-polling .mi-senate-polling-summary + .pm-tx-ad-band[data-pm-rf-place="under-chart"] {
        margin-top: 1.5rem !important;
    }
    .pm-tx-ad-band + section > div,
    .pm-tx-ad-band + section:has(#pollsTableShell) > div {
        padding-top: var(--pm-poll-ad-object-gap) !important;
        margin-top: 0 !important;
    }
    .pm-tx-ad-band + 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"]) > div {
        padding-bottom: 0 !important;
    }
    .pm-tx-ad-band[data-pm-rf-place="under-chart"] {
        margin-top: 1.5rem !important;
        margin-bottom: 3.75rem !important;
    }
    .pm-tx-ad-band[data-pm-rf-place="under-chart"] + .et-primary-main-section > div,
    .pm-tx-ad-band[data-pm-rf-place="under-chart"] + section:has(#pollsTableShell) > div {
        padding-top: 0 !important;
    }
    /* Primary line-chart pages: even air on both sides of the mid well. */
    .pm-tx-ad-band[data-pm-rf-place="under-chart"][data-pm-primary-mid="1"] {
        margin-top: 3.5rem !important;
        margin-bottom: 3.5rem !important;
    }
    html.race-view-polling .et-primary-main-section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-chart"][data-pm-primary-mid="1"]) > div {
        padding-bottom: 0 !important;
    }
    .pm-tx-ad-band[data-pm-rf-place="under-chart"][data-pm-primary-mid="1"] + .et-primary-main-section > div {
        padding-top: 0 !important;
    }
    /* GE bottom well: more air above; keep flush to the footer below. */
    html.race-view-polling main > section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-methodology"]) > div,
    html.race-view-polling .polling-about:has(+ .pm-tx-ad-band[data-pm-rf-place="under-methodology"]) .polling-about__inner {
        padding-bottom: 0 !important;
    }
    .pm-tx-ad-band[data-pm-rf-place="under-methodology"] {
        margin-top: 3.75rem !important;
        margin-bottom: 0 !important;
    }
    @media (min-width: 1024px) {
        .pm-tx-ad-band.pm-tx-ad-band--desktop {
            padding-left: 2.5rem !important;
            padding-right: 2.5rem !important;
        }
    }
    @media (min-width: 1280px) {
        .pm-tx-ad-band.pm-tx-ad-band--desktop {
            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;
}
.pm-tx-ad-band[data-pm-rf-place="under-methodology"],
.pm-tx-ad-band[data-pm-rf-place="under-table"],
.pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] {
    margin-bottom: 0 !important;
}
.pm-tx-ad-band[data-pm-rf-place="under-methodology"] ~ [id^="mvp-"],
.pm-tx-ad-band[data-pm-rf-place="under-methodology"] ~ .mv-ad-box,
.pm-tx-ad-band[data-pm-rf-place="under-methodology"] ~ .google-auto-placed,
.pm-tx-ad-band[data-pm-rf-place="under-table"] ~ [id^="mvp-"],
.pm-tx-ad-band[data-pm-rf-place="under-table"] ~ .mv-ad-box,
.pm-tx-ad-band[data-pm-rf-place="under-table"] ~ .google-auto-placed,
.pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] ~ [id^="mvp-"],
.pm-tx-ad-band--mobile[data-pm-mob-place="under-table"] ~ .mv-ad-box,
.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[data-ad-state="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;
}
