OK, here's a better design.
I've added U2, a TL431 2.5V shunt reference IC. Actually its nominal output voltage is 2.495V as shown on the schematic. The input voltage thresholds are derived from that voltage, so they're not dependent on the supply voltage. The marked values for RB, RC and RD...