You should remove your sunroof. You seem to have the same type of sunroof as I have so the pictures below should match your SR.
Left picture. First, on both left and right sides remove this piece held by the two screws. NOTE the position of this piece, if you flip it, your SR may not be leveled with the roof when you put everything back. Right picture. In this picture note the grooved nut. There are two on either side of the SR. They are also used to level the SR. If your SR is leveled with your roof line then do not turn those bolts. They are used to adjust the height of the sunroof in the closed position.
Left picture. There are two screws holding this piece (I removed tem). Right picture. When you remove the two screws you should hav a plate that slides out. Observe where it is sliding out from so you will know how to put it back later. You need to do this on both left and right side of SR.
This is the plate.
You should now be able to remove the SR by pushing it upwards then pulling it frontwards. Be careful not to scratch the roof. I would put heavy cloth/towels on the roof for protection.
Left picture. Once you removed the SR you will see this (Passenger side). Right picture. Remove the small aluminum insert, about 5 inches long and 3/4 inches wide, held by two screws. You need to do this only on one side. Pass or driver, your choice.
Left pictures. Lift the SR guide. You will see a groove. This is the groove where you will slide in in the sunroof liner. But first slide in the SR lining on the other side (the fixed SR guide)see right picture. NOTE: my sunroof bracket holding the lining will not look like yours. The PO lost the SR lining & bracket so I had to manufacture my own.
Left picture. Another view on how the SR lining fits in the groove. Right picture. Manually push the roof lining to the back making sure it is in both the left and right side grooves
Left picture. This is the position your SR should now be in. Right picture. You then carefully reinsert the SR which should then look like this from the inside. You can now screw everything back in but you will need to push the sunroof up a little in the back so you can align the holes for the screws after you reinsert the plate I mentioned above.
Left picture. Note the square holes. These are used to secure the roof lining/bracket to the sunroof in the front so it slide with the SR when you open it and close it. Into those holes go the clips shown in the right picture which should already be attached to your SR. What I say here is a pure guess because as I said above I do not have the original suroof Lining/bracket as mentioned above. I cannot think of any other purpose for those holes
I'm note sure but I believe this part is used to secure the SR lining/bracket at the back of the sunroof. Note that it swivels and is springlike. Again, not having the original bracket this is a guess. You will need to figure that out.
I hpoe the above is clear to you and will be helpful. Good luck.