A worse Austrian defeat, leading to a military collapse and a harsher Peace of Prague is most likely going to start an event chain that causes the political collapse and partition of the Habsburg empire. However it is in all likelihood going to happen in a few years since the war (say within a decade) rather than immediately during the conflict. In 1866, conditions are not yet fully conductive: Germany has not formed yet, the serious obstacle of France has not been removed yet, and Prussia-Italy could not or would not afford a two-front war.
Picture this broad event sequence:
1866: Prussian victory at Sadowa, Italian victory at Custoza. Emboldened Prussia and Italy make maximum demands (all Irredentist claims for Italy; Saxony and Bohemia-Moravia for Prussia). Napoleon III makes pro-Austrian diplomatic pressures (backed by threat of military intervention), Prussia and Italy, unwilling to face a two-front war, accept a compromise. The Peace of Prague awards Prussia OTL gains, Saxony, Austrian Silesia, and northern-eastern Sudetenland, and gives Italy Veneto, Trento, and Gorizia-Gradisca. Prussia and Italy are satisfied with the outcome of the war, pissed off with France, and reaffirm their alliance. The peace allows Austria to avoid immediate political collapse, but the humiliation destabilizes the Empire. Prussia creates the North German Federation.
1867-70: growing tensions between Prussia-Italy and France lead to war, out of various possible issues (Luxemburg, Rome, the Spanish Succession) where compromise proves impossible. The Italo-Prussian alliance wins a decisive victory. Destabilization of Austria deepens: Austrian Germans experience a massive upsurge of Pan-German feelings (heightened by the Franco-Prussian/Italian War), the Hungarians make bold demans that make the Ausgleich compromise insufficient or impossible, the Czechs, Croats, and the remaining Italians get restive, too.
1871-74: The German Empire is created. defeated France is forced to make peace: the treaty of Frankfurt cedes Alsace-Lorraine to Germany; Nice, Savoy, and Corsica to Italy. France recognizes Tunisia in the Italian sphere of influence and pays heavy reparations. Further cessions of French colonies to Germany-Italy are possible. Internal tensions in the Austrian Empire reach the tipping point: the Hungarians secede, there is a Pan-German uprising in German Austria. The neighbor great powers organize the partition of the Habsburg lands: Germany gets German Austria, South Tyrol, Czechia, and Slovenia; Italy gets istria and Dalmatia; Russia gets Galicia and Bukovina; independent Hungary keeps the Lands of St. Stephen and a confederal union with Croatia-Slavonia.