Good Lord! This home allowed her to stay out all nite long with this boy? How old is he? Can he be charged with having sex with a minor?
The stealing part....here in my state, she would be tried as an adult at 17. You wouldnt have to go with her to court. If you do have to go with her there, I would tell them point blank that she ran away from home, was in this other place, they let her run loose and this is what transpired. You have no control over her. Maybe they can place her as an incorrigible teen.
As far as if she is pregnant, that is a bit harder. She holds all the cards Im afraid. With her attitude and frame of mind, I would doubt that she will come to you for help. Even if she did, I would be afraid it would be a disaster. Are there homes for unwed mothers? Would she want to keep it? So many questions. Lets hope she isnt pregnant. Much as I love my grandkids this isnt what either of you need.