In the 22 months that Boeing’s 737 Max flew commercially before it was grounded, the jet became the company’s flagship as well as an integral part of the global aviation system, and the American economy.

Airlines around the world sped the plane into service, eager to capitalize on its efficient engines. Some low-cost carriers built new routes around the Max, which could travel farther on less fuel than its predecessor. Boeing’s stock soared thanks to strong demand for the jet.

But with the Max grounded following two deadly crashes in five months, Boeing and the airlines that rely on its planes are scrambling to adjust, and the costs are mounting.

Major airlines, including Southwest, American and United, have canceled thousands of flights. Boeing has slowed production of the Max and stopped deliveries, stockpiling the finished planes in Seattle. And with no timetable for the return of the Max, Boeing is facing escalating bills, numerous legal threats and a crisis of confidence.