If only one leg is affected then we tend to think of cellulitis (infection) however there is no evidence of that, therefore the other possible cause that needs to be ruled out is a deep vein thrombosis, the recent sedentary history could make that a possibility and you need a Doppler ultrasound to rule that out.
When both legs are affected there are a variety of reasons for swollen ankles and feet including high blood pressure, cardiovascular problems, circulation problem, kidney problem and something putting pressure on a major vein (the Inferior vena cava)
Transient swelling could be related to prolonged immobility causing calf muscles failing to pump fluid back into the circulation. Other causes include varicose veins, side-effects of some drugs and being overweight.
A mild diuretic would be the first action, together with compression hosiery.
Keep your legs elevated at a high angle when you can to encourage drainage and if you have a sedentary job ensure that you get up and move around every hour.
Avoid caffeine drinks, but do continue to drink water. Reduce your salt intake too.
So you need to see your doctor as soon as you can, any change in color or temperature in the leg/foot , or shortness of breath then go directly to ER.