Modular and programmable molecular sensors for cell types and states