It follows (I'd have thought) that the V1 calculation must take into account available runway length (is there enough length left to stop in?).
It is. Or at least, it should be
Sometimes it's more length to stop, V1 is not always limited to runway length, e.g. it can't be greater than VR. No margin = balanced field.
Some performance charts or performance calc computers tell you the margin which is left stopping at V1.