Use `:has()` together with `:user-invalid`, `:user-valid`, `:placeholder-shown` and `:focus-within` to express form and component state in CSS, removing the JavaScript class-toggling pattern and the race conditions it brings.
W3C Selectors Level 4 — Relational selector `:has()`
HTML Living Standard — Constraint validation