If she does it from some feeling of anxiety, then no amount of talking or disciplining her will make it better. In fact, it may make it worse or make her hide it or even choose something else more harmful.
I'd let it go for now, and put in a call to the pediatrician to ask how long you should allow it to continue before addressing it medically/psychologically.
See if dropping the subject helps her work through this. Maybe constantly discussing it and trying to get her to stop makes it much more top of mind. It really doesn't sound dangerous, even if it's a little unappetizing, so you don't need to panic. If you can easily (inconspicuously) take a photo or video while you appear to just be looking at your phone, it will give you something to show the doctor. I'd email it or discuss it privately without your daughter being there, at least to start.
If she does have anxiety, there are a wide variety of techniques to deal with it. Get expert help in this regard.