#007: Rail Pool (Cursed)

I constructed this when I noticed that my wording of the Rail Pool rules did not specify that the loop had to move orthogonally. It actually turned out as a nice puzzle, but I’m not sure I’d want to deal with this on a bigger grid size.

Note that Penpa’s answer check is very finnicky with free lines. If you have a line that travels straight through the centre of a cell, make sure to only draw a single long line instead of several short ones.

Rules: Draw a non-intersecting loop through the centres of all cells. Some boldly outlined regions contain number clues. If a straight loop segment visits any cells of a clued region, its length must match one of these numbers. Each number must correspond to at least one such loop segment. Question marks represent any positive integer, but numbers cannot repeat within a region.

Variant: Cursed — The loop does not have to move orthogonally. It can travel in a straight line between any two cell centres. It also does not have to visit every cell centre, but it must still pass through every cell.