My 4'x8' trailer was designed for a solo camper, either for my wife to use when "bigfoot-hunting" with her group, or as it turned out, for me with my new-found camping friends. The basic sizing was based around using a traditional 48" x 96" plywood sheet for a base, and around a 38” x 75” twin-size mattress as the inner-cabin size. My wife is 5'4", and I'm 5'10.5", so there would be enough space for either of us, or perhaps even both if that was to occur.
I placed the 3/4" thick walls on the top of the floor, which made the overall inside dimensions 46.5" x 95.25" (front wall on top of, rear hatch abutting/overhanging the floor), and the rear bulkhead was positioned at exactly 75.25" from the front wall, leaving 20" for the rear storage/galley compartment). When I was trying different mattress and bedding configurations later on, after each trip, I found that it took both my wife and myself to reach in from both sides to change bedding, so perhaps I should've left a longer space for the mattress, and reduced the galley space a bit. I eventually ditched the mattress and bedding altogether, going to a 75"L x 39"W x 4"Th quad-fold mattress (with durable cover, folds up enogh to fit thru the door) in conjunction with two king-sized pillows and my choice of summer or winter-weight sleeping bag (both are taken on every trip, since Texas weather is so unpredictable).
I put shelving on each end of the cabin space, 22" above either my head or feet https://www.tnttt.com/viewtopic.php?f=21&t=72529&hilit=+rear+shelf#p1260917, so there's no problem with contact. Actually, since I often have leg/foot cramps at night, especially in hot weather, having my feet so close to the wall (front wall, since my sleeping position is head towards the rear) gives me something to press against, to relieve the cramps. YMMV
My trailer is built to address my needs, function over form, so I'm happy with it (now), though I thought I had worked-out in advance before building, every problem that might arise while camping, I've been constantly modifying the trailer after every trip (not the last one, I'm finally satisfied with it) for 10 years (12 years total build + camping time). GL to you on your build!