Nitrogen substitution improves the mobility and stability of electron transport materials for inverted perovskite solar cells.