We are sorry to hear of your miscarriage.
As you note, for a miscarriage more than 40 days after conception, a woman follows laws similar to those after childbirth. If the fetus was female or the gender is unknown, she does not immerse in the mikveh until at least 14 days have elapsed. The question of whether these laws apply when fetal development stops significantly earlier than the pregnancy is a difficult one, and often depends on the specific details. In practice, the difference in mikveh timing between the two scenarios is usually no more than two days.
It is fairly common, though, for bleeding to continue for some time after pregnancy loss, so that there is no practical difference in mikveh timing. That is the case here at this point. You will be permitted to immerse at earliest opportunity once you can make a hefsek taharah and count seven clean days.
Pregnancy loss is unfortunately very common. You might find it helpful to see our article on it here.
Please feel free to get back to us with any further questions. We wish you a refuah sheleimah, refuat hanefesh and refuat haguf–a full recovery, body and soul.