As climate change increasingly impacts the environment and society worldwide, advanced biofuels produced from cyanobacteria constitute a nature-based solution to the capture and storage of the atmospheric greenhouse gas carbon dioxide by continual or enhanced biological processes. We propose a mixedinteger nonlinear programming problem to address the optimal design of a biorefinery and its heat exchanger network based on Synechocystis sp. PCC 6803, aiming to maximize the sustainability net present value in a superstructure approach. The optimal scheme includes production of pigments and fourth-generation bioethanol, self-supply of energy, and recycling of enriched nutrient streams. Numerical results provide a sustainability net present value of 117.55 M USD, rendering a competitive fourth-generation bioethanol production cost of 0.40 USD/kg of bioethanol. Simultaneous heat integration improves the objective function, showing that reducing environmental burden has a greater impact than minimizing the capital investment in heat exchangers, compared to the case of no heat integration. Sensitivity analysis shows that further enhancement of Synechocystis' ethanol productivity is crucial to improve sustainability.