Got you, that makes sense, my bad I know what you mean
You are talking about doing this inside a note
I think you should make a feature request for this, it might already be in the devs plans, but it doesn’t hurt to show your interest, since I agree it’s a lot better to be able to have collapsed results.
I’m not saying it’s impossible to achieve it yourself with css, but it would definitely be really hard. Css is mostly for styling things. Being able to add a feature like this would do a lot better as a community plugin, but that’s of course harder to achieve.
But because this is a core functionality in Obsidian I’d advice you to write a feature request on it
Best of luck!