You don’t actually pay the credit card account from an envelope. The credit card account has to be paid from a bank account. It’s a transfer transaction in GB. The CC envelope you have would be used to record a credit card transaction. So, let’s say you have $500 in your CC envelope and you make a $25 purchase using your credit card. You would create a GB expense transaction with the envelope field as “CC envelope” and the account field would be your credit card account. Now your CC envelope will have a balance of $475. This amount in the envelope shows you how much money you have left to spend using your credit card.
So, the principle is envelopes show how your money is allocated and spent, but actual payments to the credit card are paid from a bank account.
To address your first point, you ended up with unallocated funds because you recorded an income transaction. Income transactions are simply money you literally receive and fill envelopes with that money. Some people record income and don’t allocate to an envelope which automatically goes into the unallocated envelope. That simply means they have funds that is not assigned to any purpose. When they have a purpose for that money, then they do an envelope transfer from unallocated to whatever envelope they want. For example, you have $25 in unallocated, but you know that you will be making a $25 credit card purchase. So you will do an envelope transfer from unallocated to your CC envelope. Now you have $25 in the CC envelope to make that credit card purchase. When you actually make that purchase you’ll record an expense transaction using your CC envelope in the envelope field and your credit card in the account field. Now your envelope will decrease by $25 and your credit card account will increase $25 (that is your credit card balance will increase showing you owe $25). When it’s time to pay your credit card, you’ll do a transfer transaction from your bank account to your credit card account.
Envelopes and accounts are independent, but related. So, remember the balance of all your envelopes just show how the funds in all your accounts are allocated. Therefore, make sure the total amount in envelopes equals the total amount of your accounts. This is seen by viewing the total of envelopes on the envelopes tab and the total of accounts on the accounts tab.
Now to address your second point. You actually did the payment transaction correctly. The reason you still have money in the CC envelope is because that money needs to be recorded (used) when you make the credit card purchase.
I just explained a lot, so feel free to ask questions for clarification.