I normally get pretty myself tied in knots at the design phase, and decided this time to just wing it.
On the spare of the moment, I did this design work:
then headed of the hardware store and got them to cut the pieces of MDF:
Got back and realised my first mistake. For some reason I'd designed 450mm long for the bed, but the rails are only 340mm long.