South Kensington Campus, London SW7 2AZ, United Kingdom ‡ 7 Interdisciplinary Scientific Center J-V Poncelet, UMI CNRS 2615, 11 Bol. Vlassievsky per., Moscow, Russia §We develop a theory of charge storage in ultra-narrow slit-like pores of nanostructured electrodes. Our analysis is based on the Blume-Capel model in external field, which we solve analytically on a Bethe lattice. The obtained solutions allow us to explore the complete phase diagram of confined ionic liquids in terms of the key parameters characterising the system, such as pore ionophilicity, interionic interaction energy and voltage. The phase diagram includes the lines of first and second-order, direct and re-entrant, phase transitions, which are manifested by singularities in the corresponding capacitance-voltage plots. To test our predictions experimentally requires mono-disperse, conducting, ultra-narrow slit pores, permitting only one layer of ions, and thick pore walls, preventing interionic interactions across the pore walls. However, some qualitative features, which distinguish the behavior of ionophilic and arXiv:1909.13089v1 [cond-mat.soft] 28 Sep 2019 ionophobic pores, and its underlying physics, may emerge in future experimental studies of more complex electrode structures.