/**
 * Returns true when an error message came from the backend's plan-feature
 * guard, i.e. the current plan doesn't include the requested feature.
 * Use this to suppress toast.error() on initial page loads that are already
 * covered by the FeatureGuard upgrade overlay.
 */
export function isFeatureLockedError(err: unknown): boolean {
  const msg = (err instanceof Error ? err.message : String(err ?? '')).toLowerCase();
  return (
    msg.includes('does not include') ||
    msg.includes('upgrade to enable') ||
    msg.includes('plan does not') ||
    msg.includes('feature not available')
  );
}
