How much space should be left above a toilet lid for repairs to be made in the tank?
I have made repairs with as little as 6" above the tank with the aide of a mirror.
I think it's whatever is reasonable but depending on the tank's size. I would make sure that whatever I install there could be easily removed for toilet bowl service.
Depends. How big of a crane are you using?
Really, whatever you find to be comfortable working space to remove and replace the float valve, flapper, or lever. All other repairs require disassembly or removal of the toilet.
If you've got a choice, a minimum of 6", preferably a removable shelf. Unfortunately, there are many times when almost zero clearance is left (such as the use of a banjo top vanity ), instances like this require removal of the tank or the whole toilet to work on the guts.
Be careful what you put over a toilet.
I had a tenant who put one of those bathroom space saving shel arrangemnt over the tank, and a heavy item fell on the bowl one day.
The tenant had to pay for a new toilet.
I would like a foot or two above the toilet tank cover. I once had a toilet with just 6 inches and could not see the problem. It turned out that the trip lever was catching on the chain from the flapper but you could not stick your head inside enough to see as this was happening at the front of the tank.
I put shelves over all the tanks in my previous home. Put a cleat on the wall and vanity side. Bought bull nose stair tread at HD, nice and straight, wide, cut to fit and painted. Did not attach to cleats.