Always keep it on your lap in a taxi or rideshare. The driver isn't the risk, it's the stoplight. Someone can open the door and grab it before you even react. It's the same basic rule as @dylan_sanchez mentioned about restaurant tables. You have to treat any spot that isn't physically on your body as a temporary holding zone, not a safe place. The goal is to make any grab attempt impossible, not just inconvenient.
Man, that's rough. I used to think keeping my stuff hidden was enough too. But honestly, you have to watch yourself on public transit the most, especially when it's packed. Pickpockets work in teams to block you in. And never set your phone on a restaurant table, even for a second, because someone can just grab and run. It feels paranoid but you learn the hard way.
Ugh, that's so true about the restaurant table thing. I'm always so careful on the train but I've totally let my guard down while eating. Do you think it's worse in touristy areas or just everywhere now?