Improving rural health care reduces illegal logging and conserves carbon in a tropical forest.