Why does custom CSS work on desktop but not on mobile in WordPress?

WordPress custom CSS may fail on mobile because a media query does not match, a later rule has greater specificity, or cached generated CSS serves an older declaration. Inspect the live mobile element and identify the winning rule before adding another override. Desktop success only proves that one cascade path works.
Check the media-query direction and units. A min-width rule applies above its boundary, while a max-width rule applies below it. Confirm the viewport meta tag and actual CSS viewport width. Overlapping queries can both match at the boundary, leaving source order to decide which value wins.
WordPress can place CSS in several locations: theme stylesheets, Site Editor Additional CSS, per-block CSS, plugin output and page-builder generated files. Inspect the Styles pane to see the source URL and crossed-out declarations. Place the correction in the appropriate layer instead of increasing selector complexity everywhere.
@media (max-width: 48rem) {
.site-header .primary-navigation {
display: none;
}
}
Check syntax around the rule. An unclosed brace earlier in the stylesheet can make the browser ignore later mobile declarations. Unsupported nesting, copied smart quotes and a missing unit can also invalidate a value. Run the CSS through browser developer tools and review console or stylesheet warnings.
Clear the WordPress page cache, optimization plugin cache, generated page-builder CSS, CDN cache and browser cache as appropriate. Test in a private window and inspect the response content to confirm that the purge succeeded. Service workers can retain old assets too.
Compare the editor preview with the published page and test a real phone. A plugin may inject inline styles after load or JavaScript may add a class only on mobile. Once the winning rule is understood, use the smallest scoped change and retest nearby widths so the fix does not create a new breakpoint gap.