/* APD 170.0.0 — native scrollbar/header stability */
html {
    /* Reserve the native Windows scrollbar lane so viewport-centred elements
       do not recalculate horizontally when overlays/modals change overflow. */
    scrollbar-gutter: stable;
}

@media (min-width:1180px) {
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context.apd-header-stabilizing,
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context.apd-header-stabilizing *,
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context.apd-header-stabilizing .apd5-header-search-row,
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context.apd-header-stabilizing .apd5-search {
        transition: none !important;
        animation: none !important;
    }

    /* Never let the temporary flow placeholder participate in horizontal
       sizing. It only preserves the original header height. */
    body.apd-marketplace-ui.apd170-scroll-stability .apd12-header-spacer {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        pointer-events: none !important;
    }

    /* Stable horizontal geometry in both expanded and compact states. */
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context,
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context .apd5-header-row,
    body.apd-marketplace-ui.apd170-scroll-stability .apd5-header.is-discovery-context .apd5-header-search-row {
        box-sizing: border-box !important;
    }
}
