Media query and variable substitution fixes