For more complicated stuff, it is in the html as elements. With htmx you can often do this by making a request to the server to update a subtree; the server doesn't need to know the state that the user is seeing, just what is happening in the specific request.
Sometimes just updating html subtrees isn't quite enough, and then I use javascript. Transient state that is only concerned with what is presented to the user is probably not best done on the server.
And it makes me think you haven't had as much experience as you think.
How do you deal with form state using CSS? Where does it get stored? In the html as elements? So not on the server?