Gmail: Close Pop Up Window/Tab When Mail Is Archived?

Hi all - In chrome when I open an email from a notification I get it in a pop-up window or tab in chrome. For now what I do is look at said email, then usually archive (or sometimes reply), and that that point I'm done with the tab or window and I have to manually close it with CMD-W, or with the mouse. Is there some way I can use KM (or another program?) to close the window/tab automatically when I archive the email or send and archive a reply in that window/tab?

All ideas welcome. Thank you!

PS - Actually, I would prefer if the notifications would open the email in question in the main gmail tab on my browser, but I cant figure how to do that either...