Nav state now falls back to cookies if localStorage is unavailable.