Thank you for the replies!
I am well aware that I can do this with Javascript. I should have mentioned that from the start. However, the point of my post is that I would like to do it in a much simpler way, with a tiny bit of CSS (see the expandable part of my original post).
Besides being a simpler and more natural solution, it would let me manage things with the excellent built-in system for Themes and Theme Components.
And it is not like this would be some weird exotic thing. As I mentioned initially, Discourse already has class attributes on the very same element (post on topic page) for indicating properties of the posting user (topic-owner, trust level, group memberships etc). And in a sub-element of this element (the like button), there is already a class attribute indicating that the post is made by the user who is currently accessing the page.
For these reasons, I think adding that single attribute on the topic-post element is a much better solution than some Javascript hack.