Question about digital nomad visa

Hi all, didn’t find the info after searching on google, so trying my luck here

  1. What happens if you lose your job in the middle of the 1 year period? Do you immediately lose the visa or can you still stay until end of the year
  2. What determines the length of the visa? Do you specify whether you want 3 or 12 months?

Thanks