Replaced single-field sortBy('name') with toArray() + JS comparator to
implement the full desired sort chain. Dexie's sortBy() only supports a
single indexed field, so multi-field ordering requires a JS sort pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>