Thank you so much for your feedback!
As I wrote above, this is most likely impossible to implement within the framework of the CSS.
In short, selecting and editing text (in edit mode) are different processes and they are implemented in obsidian in completely different ways. As I see the selection is not really a selection, it is as if the block is absolutely positioned in the document. And it turns out that there is nothing inside this block, it seems to weigh over the text. Therefore, I cannot normally grab the selection text and leave its behavior as when editing, when I try to select, the mode switches from editing to selection (even like this: view and selection). So it turns out that when we try to select the text, the formatting seems to jump from edit mode to view mode (in our case, edit mode, but when the line is not active).
This problem occurred to me when I was still trying to behave the same for selected text in view and edit mode. As you can see in view mode the selected text turns white for better visual effect, but in edit mode the text color does not change (only the highlight color is slightly different). Obsidian programmers could not help me and said that you can only change the background color, and not the text itself in edit mode.
This problem is essentially the same.
I hope they will open the api soon and there will be an opportunity to do something about it, or else we will have to wait for the developers to implement this functionality. They have something similar in their roadmap, but apparently it won’t be soon.