Vyxal, 95 91 bytes
@i|¥‛--oṘ:\irß›,;:£L‹(¥2wi:\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@i
The messiest mess I've ever made. Even I don't really understand it...
This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.
Borrowed a trick from @ovs by checking if the result is a substring of -
.