GNOME CSD styles for headerbar on Firefox  @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

#main-window {
	-moz-appearance: -moz-window-titlebar !important;
}


/* Window buttons: at least 1 button */
@media (-moz-gtk-csd-minimize-button),
(-moz-gtk-csd-maximize-button),
(-moz-gtk-csd-close-button) {
	:root:not([inFullscreen]) #nav-bar {
		padding-right: 60px !important;
	}
}

/* Window buttons: at least 2 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button),
(-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-close-button),
(-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
	:root:not([inFullscreen]) #nav-bar {
		padding-right: 70px !important;
	}
}

/* Window buttons: 3 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
	:root:not([inFullscreen]) #nav-bar {
		padding-right: 90px !important;
	}
}

/* Fullscreen headerbar padding for 1 button */
:root[inFullscreen] #nav-bar {
	padding-right: 40px !important;
}

/* Window buttons box */
:root:not([inFullscreen]) #TabsToolbar .titlebar-buttonbox-container,
:root:not([inFullscreen]) #TabsToolbar-buttonbox-container {
	-moz-appearance: none !important;
	padding: 0 3px 0 4px;
	position: absolute !important;
	left: 2px;
	top: 18px;
	display: block !important;
}
:root[inFullscreen] #window-controls {
	-moz-appearance: none !important;
	padding: 0 3px 0 4px;
	position: absolute !important;
	left: 8px;
	display: block !important;
	top:10px !important;
}


/* Left window buttons */
@media (-moz-gtk-csd-reversed-placement) {
	:root:not([inFullscreen]) #nav-bar {
		padding-right: 3px !important;
	}

	/* Window buttons box */
	:root #TabsToolbar .titlebar-buttonbox-container {
		padding: 0 3px 0 4px;
		left: 8px;
		right: auto;
	}


	/* Remove tabsbar titlebar blank spaces */
	:root #TabsToolbar .titlebar-placeholder {
		display: none !important;
	}

	/* Prevent menubar from breaking */
	:root #toolbar-menubar:not([inactive=true]) {
		height: 30px !important;
		margin-bottom: 8px;
	}

	/* Remove default style of titlebar */
	:root #TabsToolbar {
		-moz-appearance: none !important;
	}

	/* Fix the issue when dragging tabs */
	:root #navigator-toolbox[movingtab] #TabsToolbar {
		padding-bottom: 0 !important;
	}
	
