I do feel for you OP, mine aren't teenagers yet but ds1 has started testing the boundaries of what is ok to say at 7 (ASD doesnt help as he can be abrupt) and I struggle a bit with it on the quiet.
Of course it's usually me he says things to , which makes sense I'm mum and I'm safe and he will test things out in me.
It was my DP actually that instituted the best policy and response. After a couple of times where he was told not to be rude DP sat him down and explained, you live with a family in a family home which means everyone is treated with respect and kindness. Part of our role in a family is that we are all important and everyone should be treated with a certain level of respect that includes mum, it is not ok to hurt her feelings and you have to consider what you say.
We see it as training him for the outside world as well, it covers comments about bodies , behaviours etc. Its mildly successful in the moment (no bloody idea if it will have the remotest success in the teen years ...I doubt it but we will try as it's worked so far) but of course he only finds out after he has said something that he has crossed a line which means the statement has been said, I cant help but be stung ( I divorced their father which is usually a go to and never fails to sting).
I did accidentally show I was upset one day (I usually try to hide it) and I felt awful but DP said something that made me think, he pointed out it was ok for ds1 to see the consequences of his actions ( I was far from histrionic but ds1 had definitely seen he had upset me ) , he pointed out that seeing it genuinely affect me rather than be all understanding all accepting mum would help with empathy. Still not sure how I feel about that as i dont like DC to have to manage my emotions but the more i consider it the more i think he has a point . I suspect knowing she upset you is a bigger consequence than anything else and seeing you are still struggling with it may not be a bad thing.
However i fully accept that i do not have teens so it's very different , I can still put mine on the step !!