Title: Ionization, chemistry, and dust formation in the outflows of classical novae and red giants