I guess that you can use some Mermaid class definitions in the block (see Change Mermaid CSS), but that does seem clunky if you do it more than a few times.
I don’t have a concrete answer for you in general, but the mermaid.js theme definitions seem to be here. Not sure if you can just override those with the custom CSS though.