As of Tailwind v4, the media queries and the answer should be:
.your-class {
@apply your-rules
}
@variant sm {
.your-class {
@apply your-rules-for-the-sm-breakpoint-and-above
}
}
@variant md {
.your-class {
@apply your-rules-for-the-md-breakpoint-and-above
}
}