Preheat the oven to 180°C/160°C fan/gas 4. Heat 3 tbsp of the rapeseed oil in a large saucepan and cook the shallots gently with a pinch of salt until translucent (about 10 minutes), then add the nutmeg and a generous few grinds of black pepper and stir together.
Transfer to a large mixing bowl and set aside. In the same pan, add the remaining oil and chard stems and cook them for 2 minutes, then transfer to the mixing bowl.
Next, cooking in batches, gently wilt all the greens, including the mint and lovage, if using. Once cool enough to handle, squeeze out any excess water from the greens.
Transfer the greens to the mixing bowl and leave to cool completely before adding one egg and the cheese. Mix and set aside.
Grease a round 20–23cm tin with some of the melted butter, and cut the filo sheets into rounds to fit the tin (10–12 sheets in total). Lay 2 filo rounds in the base of the tin, brushing each with melted butter.
Sprinkle over half the caraway seeds, then add a layer of the greens and cheese and repeat these layers, each time brushing the filo with melted butter.
End with a top layer of 2 filo rounds, brushed with plenty of butter, a little beaten egg and the rest of the caraway seeds. Bake for around 35 minutes, until golden. Leave the pie to cool in the tin for 10 minutes before slicing into it.