improved @-rule handling