Modules in styles are being applied in reverse order

As Pascal says above, the history stack is just a list of the modules applied, it is not the ordered list of the applied modules.

The order of the applied modules can be seen on the right side of the interface.
Look here for more details.