Early morning on April 19, the massive Maersk Edmonton moored at the nation's biggest cargo terminal, in the Port of Los Angeles. At 8 a.m., around 200 workers, operating nine cranes, swarmed the 1,200-foot-long ship.
By week's end, continuous shifts of workers had emptied the ship, which carries more than 13,000 container units when fully stocked, onto trucks headed to nearby warehouses or to trains headed across the country.
That seamless choreography is a point of pride for port leaders, who say they've moved past the dysfunction that plagued their business a year ago and are prepared to hold the line against ever more aggressive competitors.
March capped off the busiest first quarter ever for the Port of Los Angeles, and the biggest since 2007 for the neighboring Port of Long Beach. Imports at the two ports increased by 10% over the same period last year, as measured by loaded container units.
But ports in other parts of the country, from Houston to New York, have poured money into infrastructure projects to make their coastlines deeper and their terminals more efficient. Now they are slowly eating into the L.A. area's dominance as a gateway to U.S. markets.
In the first three months of 2016, Los Angeles and Long Beach took in 37% of all imports to the country arriving in containers, down from 43% during the same period in 2007.
That shift could accelerate later this year, if an improved Panama Canal opens and siphons business from the West Coast.
"We have witnessed a precipitous drop in market share, based on some things we didn't do well, and ports across the U.S. and Canada did to step up their service capabilities," said Gene Seroka, executive director of the Port of Los Angeles.
New York, the third-largest port in the country, has gained steadily. So have smaller entry points in cities such as Savannah, Ga., Charleston, S.C., and Houston.
"These areas are hungrier. Places that are poor and want to get better are going to try to find a competitive advantage against a place that is richer," said Joel Kotkin, a fellow at Chapman University who has researched the growth of Gulf Coast trade.
The L.A. ports became so congested last year that shipping lines and the companies paying them had to divert their cargo elsewhere.
As talks between dockworkers and shipping companies deadlocked in the fall of 2014, and terminals struggled to handle ever-bigger vessels, ships berthed elsewhere.
Even before the labor dispute peaked, the ports were moving to better coordinate ships, terminals operators, workers and truckers.
They helped make it easier for truckers to access the trailers needed to transport containers. They encouraged shipping companies to load their cargo in Asia methodically, so that dockworkers wouldn't have to spend time separating goods destined for different retailers on the Los Angeles shores.
All the while, the ports invested in technology.
The TraPac terminal, staffed almost entirely by robots, opened in the L.A. port 17 months ago. Today its 28 red cargo-carrying machines hum along, in relative silence, moving containers onto a set of gleaming, self-driving vehicles.
A handful of people participate, often from behind computer screens — directing, say, an automated crane to lower containers onto trucks as they leave the port.
On April 7, the Port of Long Beach received the first ship at its own automated terminal, called Middle Harbor, which is expected to formally open for business later this year. When Middle Harbor is fully built out in 2020, it will be able to handle about half the traffic that moved through the entire port in 2015.
There is little the local ports can do, though, to stem the increased flow of goods to the Southeast.
That region is in the midst of a population boom — Florida, Texas and the coast of the Carolinas are the fastest-growing areas of the country, according to the U.S. Census.
It's also undergoing a manufacturing renaissance. Factory investments include a $1-billion expansion at a BMW plant in South Carolina in 2014 and the opening of an Airbus production facility in Alabama last year.
The influx of cargo to southeast ports "is a function of servicing an industrial market and an expanding population base in the eastern part of the United States," said Jock O'Connell, an international trade economist with Beacon Economics.
That doesn't mean Los Angeles will lose its shipping-traffic title any time soon.
The area has natural advantages that won't go away. It faces Asia, the source of nearly 70% of American imports that arrive by sea. Its port waters are deep enough, and bridges tall enough, to accommodate ever-growing ships.
The biggest ship that visits North America, the Benjamin Franklin, arrived in L.A. on Friday. Wider than a football field, it can carry twice the amount of cargo as the largest ships making those runs four years ago.
Tim Simpson, the head of marketing for Maersk in North America, said that his company will go wherever customers like General Motors, Wal-Mart and Target want to bring in goods. But even during periods of congestion, the company generally advises most companies not to change their supply chains.
The complexity of those arrangements became obvious during the 2014-15 L.A. slowdown. Maersk routed some of its massive ships through Vancouver, Canada — but so did its competitors. Soon enough, Vancouver became overwhelmed too.
Simpson says the "severe congestion that we saw last year has been a non-issue" at L.A. ports this year. He doesn't see any broader threat to the region's status as a powerhouse.
"I don't know how anyone could predict a day when L.A. and Long Beach aren't the main hub. So much of the supply chains of global shippers are built around using those ports," Simpson said.
Seroka says the first-quarter boom shows that the ports have won back the trust of customers.
"I cannot attest that we gained every container back, but we have made a strong effort to gain a majority of that cargo back," he said.
Romy Taormina is not convinced. Her Pacific Grove-based company, Psi Bands, used to send 100% of its Chinese-made wristbands, which are designed to ease nausea, on ships that went first to Southern California and then up to Oakland.
Now she pays five times the price of ocean shipping to fly the vast majority of the bands in from China.
"I have been gun-shy to send shipments through Southern California," she says.
Taormina says she can't afford to anger customers like Target or REI. "It's more difficult for early stage companies to survive these types of major hiccups."
Other considerations could shape the ports' competitive position.
The International Longshore and Warehouse Union is reviewing a letter sent by the Pacific Maritime Assn., which represents port operators, to begin discussions about extending their current five-year contract, which ends in July 2019. If the two sides come to an early agreement, it would buy labor peace and boost shipper confidence. If they don't work out an extension, it could portend more strife and disruption.
The PMA confirmed that it sent the letter but did not comment further. The union did not respond to a request for comment.
To the south, a newly expanded Panama Canal offers a different challenge.
In June, nearly two years later than promised, Panama officials plan to open wider, deeper and longer locks that can accommodate some of the largest ships coming to the U.S. That could entice those big ships to bypass Los Angeles and keep sailing to Southeast and East Coast ports.
Around 70% of the goods that land in L.A.-area ports do not stay in Southern California, said O'Connell, the trade economist. But estimates by cargo analysts suggest that only around 5% of those products would be diverted through the canal, because the trip from Shanghai directly to the East Coast is two weeks longer than the one from Asia to Los Angeles, O'Connell said.
In any case, L.A. and Long Beach will probably continue to be the destination for goods that need to get on store shelves quickly, like high-end sneakers, the latest electronics and perishable goods.
"The impact of the new set of locks at Panama will be marginal on L.A. and Long Beach," said O'Connell, "as long as the West Coast ports operate at relative efficiency."