The example is a real diagram from one of my notes, I did not change anything. Unfortunately your solution does not work.
Having said that, if I am not mistaken your solution is a global one for all the Mermaid diagrams in Obsidian, and it avoids having to apply font size on a case-by-case basis. It would be nice, more convenient, to have that.
With your code I also tried reducing the size to 0.3em, but there was no change.