On my first
boat I killed two birds with one stone by fabricating a cockpit table which perfectly filled the space between the cockpit seats in much the same way many
interior dinette table tops lower to change the dinette into a bed.
In actuality, mine had two leaves that folded down in the table position when not in use and it didn't actually lower for a bed, but was detached and spun 90 degrees so that the three pieces spanned the cockpit joined by the hinges.
I also thought of making one that lowered straight down, but also hinges, so it's not always a full table. Fiddles mounted to the bottom could be spun 90 degrees in the bed position to support joints where each side leaf folds.