Optimal heat transport at the edge of energy stability
High heat transfer in Rayleigh--Bénard convection is commonly associated with vigorous turbulent motion, but turbulence intensity alone does not explain how a limiting transport state is selected. We propose that such limiting states are organized by marginal energy stability. Starting from the exact perturbation-energy balance, we determine, for a prescribed mean temperature profile, the smallest neutral Rayleigh number over the balance parameter and all admissible disturbances. The corresponding marginal modes are then coupled to the exact mean-temperature equation, producing a self-consistent profile and heat flux. At large $Ra$, the selected branch gives $Nu\simeq0.0245Ra^{1/2}$ and develops conductive inner layers, logarithmic-like intermediate regions and a weakly stably stratified core. An equivalent background-field formulation yields the same governing equations and establishes uniqueness of the selected mean profile. Three-dimensional simulations at $10^6\le Ra\le10^8$ show that distributed thermal forcing based on this profile suppresses convective motion while retaining a large wall heat flux.