Here's an important point from the activist distress code case: CBP had a plan to target him for this treatment in advance before he showed up at the border checkpoint that day. The airlines send them passenger manifests 72 hours in advance.
100% of the time, if they take you to the little room, start asking you questions, and want to look through your phone, they already believe you're guilty of something specific.
If that happens to you, you need to understand that you have already been the "target" of an investigation. There is nothing you can do or say in that room that will convince them otherwise. The best thing you can do is shut the hell up, do as little as possible, and don't make their case for them.
And don't believe anything they're telling you either. The cops can lie to you, but you can't lie to the cops. It's a crime.