Decided to finally solve the issue of intermittently leaking sunroof. Firstly checked that draining channels work, and they seem to be completely clean. Yet when I pour enough water over the closed sunroof, the water ends up in the headliner. It was not obvious where the water was coming from, so I had to disassemble the interior a little bit. Finally I can see the problem!
(caution: video may cause an urgent need to take a piss)
The sunroof channels are not overflowing, there is another issue.
The black plastic corner piece is concave. The water gets guided on top of it by, presumably, capillary action along the sunroof seals, drips into the "bucket" formed by the plastic piece, and then continues along the green arrows. It's mainly coming over that piece of foam, which should be sealing when the little spoiler lowers on top if it, as the sunroof is closing, but it's worn and doesn't seal. But even if it was ok, the water would still find a way inside, because the outer edge is rather high.
There is a factory service bulletin regarding the issue, even:
The right hand side is pictured, I believe.
So the new piece does not have this concave shape, and guides the water into the channel right away. Unfortunately it's not available through the dealer, so I'm over(fort)nighting it from Japan. If that doesn't help, I'll just silicone the shit out of every possible water path.
In other news, ordered a big timing belt kit, including waterpump and bunch of other stuff, planning to do that job in a month or so.