/** * Detect whether the current device is mobile. * Uses navigator.userAgentData (modern API) with UA regex fallback. */ export function isMobileDevice(): boolean { const nav = navigator as unknown as Record if (nav.userAgentData && typeof (nav.userAgentData as Record).mobile === 'boolean') { return (nav.userAgentData as Record).mobile as boolean } return /Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent) }