I found that create-next-app installed Tailwind 3.x here in the fall of 2025, and as such, the steps above were helpful to upgrade to Tailwind 4.x. However, that alone was not sufficient.
My ultimate fix was to remove --turboback from this line in package.json:
"dev": "next dev",
Apparently, it skips Tailwind's preprocessing stages and doesn't handle @theme, @layer, or custom directives. And it injects only raw CSS imports.