Investments and Fair Value of Financial Assets and Liabilities (Details) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2018
Dec. 31, 2017
Marketable securities    
Amortized Cost $ 97,016  
Gross Unrealized Losses (29)  
Fair Value 96,987  
Assets:    
Investments 96,987  
Transfers between Level 1, Level 2 or Level 3    
Transfer from Level 1 to Level 2, assets 0 $ 0
Transfer from Level 2 to Level 1, assets 0 0
Transfers into Level 3, assets 0 0
Transfer out of Level 3, assets 0 0
Transfer from Level 1 to Level 2, liabilities 0 0
Transfer from Level 2 to Level 1, liabilities 0 0
Transfers into Level 3, liabilities 0  
U.S. government agency bonds    
Marketable securities    
Amortized Cost 17,704  
Gross Unrealized Losses (3)  
Fair Value 17,701  
Assets:    
Investments 17,701  
U.S. treasury notes    
Marketable securities    
Amortized Cost 79,312  
Gross Unrealized Losses (26)  
Fair Value 79,286  
Assets:    
Investments 79,286  
Preferred stock warrant liability    
Roll forward of aggregate fair values of preferred stock warrants    
Fair value at beginning of period 866 67
Issuance of warrants to purchase shares of Series B convertible preferred stock   14
Change in fair value through the exercise date 2,187 785
Reclassification to additional paid-in capital in connection with IPO (3,053)  
Fair value at end of period   866
Recurring    
Assets:    
Assets 404,051  
Recurring | Money market funds    
Assets:    
Cash equivalents 282,160 104,288
Recurring | U.S. treasury bills    
Assets:    
Cash equivalents 24,904  
Recurring | U.S. government agency bonds    
Marketable securities    
Fair Value 17,701  
Assets:    
Investments 17,701  
Recurring | U.S. treasury notes    
Marketable securities    
Fair Value 79,286  
Assets:    
Investments 79,286  
Recurring | Preferred stock warrant liability    
Liabilities:    
Liabilities   866
Recurring | Level 1    
Assets:    
Assets 282,160  
Recurring | Level 1 | Money market funds    
Assets:    
Cash equivalents 282,160 104,288
Recurring | Level 2    
Assets:    
Assets 121,891  
Recurring | Level 2 | U.S. treasury bills    
Assets:    
Cash equivalents 24,904  
Recurring | Level 2 | U.S. government agency bonds    
Marketable securities    
Fair Value 17,701  
Assets:    
Investments 17,701  
Recurring | Level 2 | U.S. treasury notes    
Marketable securities    
Fair Value 79,286  
Assets:    
Investments $ 79,286  
Recurring | Level 3 | Preferred stock warrant liability    
Liabilities:    
Liabilities   $ 866