| Dec 31, 2017 | Dec 31, 2018 | Dec 31, 2019 | Dec 31, 2020 | Dec 31, 2021 | Dec 31, 2022 | Dec 31, 2023 | Dec 31, 2024 |
|---|
| Net loss | -15 | -42 | -81 | -19 | -110 | -321 | -130 | -165 |
|---|
| Depreciation and amortization | 7 | 8 | 9 | 15 | 47 | 65 | 63 | 43 |
|---|
| Stock-based compensation | 11 | 20 | 28 | 37 | 55 | 68 | 71 | 71 |
|---|
| Amortization of debt discount and issuance costs | - | 3 | 6 | 12 | 5 | 6 | 4 | 3 |
|---|
| Non-cash lease expense | - | - | 7 | 9 | 12 | 16 | 16 | 12 |
|---|
| Impairment costs | - | - | - | 2 | - | 1 | 2 | - |
|---|
| Net (gain) loss on IRLCs, forward sales commitments, and loans held for sale | - | - | - | -2 | 1 | 14 | -2 | -0 |
|---|
| Change in fair value of mortgage servicing rights, net | - | - | - | - | - | -1 | 3 | -1 |
|---|
| Gain on extinguishment of convertible senior notes | - | - | - | -5 | - | 57 | 94 | 12 |
|---|
| Other | - | - | -1 | -0 | -4 | 4 | -2 | 1 |
|---|
| Accounts receivable, net | 3 | 2 | 4 | 35 | 7 | -24 | -3 | -3 |
|---|
| Inventory | - | 19 | 52 | -25 | 309 | -244 | -114 | - |
|---|
| Prepaid expenses and other assets | - | - | 4 | -2 | 12 | 6 | -6 | 8 |
|---|
| Accounts payable | -0 | 1 | -0 | 2 | 3 | -2 | -1 | 6 |
|---|
| Increase (Decrease) in Accrued And Other Liabilities | - | - | - | - | 26 | -46 | -19 | -5 |
|---|
| Lease liabilities | - | - | -7 | -11 | -13 | -18 | -19 | -16 |
|---|
| Origination of mortgage servicing rights | - | - | - | - | - | -3 | -1 | -0 |
|---|
| Proceeds from sale of mortgage servicing rights | - | - | - | - | - | 2 | 1 | 31 |
|---|
| Origination of loans held for sale | 11 | 86 | 396 | 677 | 987 | 3,949 | 3,526 | 3,980 |
|---|
| Proceeds from Sale, Loan, Mortgage, Held-for-Sale | 9 | 83 | 379 | 658 | 993 | 4,001 | 3,567 | 3,985 |
|---|
| Net cash (used in) provided by operating activities | 5 | -37 | -108 | 61 | -302 | 40 | 57 | -32 |
|---|
| Purchases of property and equipment | 12 | 8 | 16 | 15 | 27 | 22 | 12 | 11 |
|---|
| Purchases of investments | - | - | 136 | 198 | 146 | 182 | 77 | - |
|---|
| Sales of investments | - | - | 11 | 8 | 99 | 18 | 125 | 39 |
|---|
| Maturities of investments | 3 | - | 24 | 148 | 107 | 99 | 62 | 6 |
|---|
| Cash paid for acquisition, net of cash, cash equivalents, and restricted cash acquired | - | - | - | - | 608 | 97 | - | - |
|---|
| Net cash provided by (used in) investing activities | -10 | -10 | -116 | -57 | -576 | -184 | 97 | 34 |
|---|
| Redemption of convertible preferred stock, net of issuance costs | - | - | - | - | - | - | - | 40 |
|---|
| Payment of dividends on convertible preferred stock | - | - | - | - | - | - | - | 0 |
|---|
| Proceeds from Stock Options Exercised | 3 | 23 | 16 | 21 | 23 | 12 | 10 | 7 |
|---|
| Tax payments related to net share settlements on restricted stock units | - | 1 | 5 | 17 | 27 | 7 | 16 | 2 |
|---|
| Proceeds from Unsecured Lines of Credit | - | - | 389 | 662 | 943 | 3,938 | 3,532 | 4,017 |
|---|
| Repayments to warehouse credit facilities | 9 | 81 | 372 | 645 | 949 | 3,989 | 3,571 | 4,022 |
|---|
| Proceeds from Secured Lines of Credit | - | - | 4 | 90 | 625 | 565 | - | - |
|---|
| Repayments to secured revolving credit facility | - | - | - | 70 | 449 | 765 | - | - |
|---|
| Principal payments under finance lease obligations | - | - | 0 | 0 | 1 | 1 | 0 | 0 |
|---|
| Repurchases of convertible senior notes | - | - | - | - | - | 84 | 242 | 107 |
|---|
| Repayments of convertible senior notes | - | - | - | - | - | - | 24 | - |
|---|
| Repayment of term loan principal | - | - | - | - | - | - | 0 | 2 |
|---|
| Extinguishment of convertible senior notes associated with closing of term loan | - | - | - | - | - | - | 57 | - |
|---|
| Payments of debt issuance costs | - | - | 1 | 0 | 1 | 1 | 2 | 2 |
|---|
| Proceeds from term loan | - | - | - | - | - | - | 125 | 125 |
|---|
| Net cash used in financing activities | 150 | 273 | 32 | 694 | 650 | -332 | -245 | -28 |
|---|
| Effect of exchange rate changes on cash, cash equivalents, and restricted cash | - | - | 0 | -0 | -0 | -0 | -0 | -0 |
|---|
| Net change in cash, cash equivalents, and restricted cash | - | - | -192 | 698 | -228 | -476 | -91 | -26 |
|---|
| Cash paid for interest | - | - | 2 | 5 | 8 | 20 | 16 | 36 |
|---|
| Share-Based Payment Arrangement, Amount Capitalized | 0 | 1 | 1 | -2 | 4 | 4 | 4 | 4 |
|---|
| Capital Expenditures Incurred but Not yet Paid | 0 | 0 | - | 2 | 1 | 0 | 0 | - |
|---|