/* Site script, served at /assets/app.js (deferred). Vanilla JS, no build step. 1. Preferences: theme, length order and base map (saved in localStorage; applied early by prefs.js), and the theme menu in the header 1b. Saved trails: the Save buttons, the count in the header (lh-saved in localStorage) 1c. The Saved page (/saved/): the visitor's saved trails, or a list from a link 2. Maps: .mapfig[data-map] figures. Nothing for a map is loaded with the page: when the figure scrolls near the screen (or is touched, or takes focus) the script loads MapLibre (and the contour add-on) from the addresses on its own