A healthy 30 year old man is viable for a couple of weeks confined to his home, unviable for a couple of weeks confined in a snowdrift. An astronaut in a space walk is viable in his spacesuit, unviable without it. An unborn baby is viable in the uterus of a healthy mom, but unviable if the uterus is cancerous; and so forth.
In fact, it would make much more sense if the viability argument were deployed in the opposite direction. It ought to be illegal to expel a baby from the womb if he or she is too young to live outside it; and at the point where the baby can live outside the uterus without risk to its health, the pregnancy can be gently terminated with a view to preserving both mother's and baby's well-being.
This acceptable termination of pregnancy ordinarily happens at around 40 weeks gestation, and is called childbirth.
Viability has never been a good concept to base policy. As you’ve pointed out, it’s neither timeless nor placeless. A good ruling is both timeless and placeless, e.g., Thou Shalt Not Kill.