Sometimes a rule is genuinely "small screens only" — max-* variants express that directly.

html
<nav class="hidden max-md:flex">Mobile-only nav element</nav>
<div class="p-2 max-sm:p-1">Tighter on the smallest phones</div>

How it compiles#

css
/* max-md:p-2 */
@media (max-width: 767.98px) { .max-md\:p-2 { padding: 0.5rem } }

When to use which#

GoalUse
Add style as screens growmin-width prefixes (md:)
Remove/simplify below a widthmax-* prefixes
Hide on phonesmax-md:hidden OR hidden md:block — pick one convention
Warning. Do not mix both conventions for the same element — teams pick ONE and document it.