Why does my first batch of cookies come out nice while later batches get thin?
The fat in your dough started to soften/melt - especially if you have a hot oven running in the kitchen.  Keep your dough cold in the fridge between batches.

See this question for more details on the issue in general, but for your situation, keep it cold between batches.  You seem to have started correctly, which is good - you just have to keep it going right.