Gravar-mail: Segmented targeted least squares estimator for material decomposition in multibin photon-counting detectors