The root topic rules the firmware and broker impose.
The firmware's buffer: 31 UTF-8 bytes plus the terminator.
Segment-wise, case-insensitive prefix: "msh/US/WA" prefixes "msh/US/WA/seattle" but not "msh/US/WAX".
First rule broken, in enum order; null when the radio accepts the root as typed.
Whitespace trimmed at both ends, runs of "/" collapsed to one, one trailing "/" dropped.
Split on "/", each segment trimmed, empties dropped.