/* light mode */
:root:not([style]),
:root[style*="--lwt-accent-color: rgb(240, 240, 244);"],
:root[style*="--lwt-accent-color: white;"]
{
	/* accentcolor */
	--lwt-accent-color: #dee1e6 !important;

	/* textcolor */
	--lwt-text-color: #606368 !important;

	/* toolbar */
	--toolbar-bgcolor: #fff !important;

	/* toolbar_text */
	--toolbar-color: #606368 !important;

	/* toolbar_bottom_separator */
	--toolbox-border-bottom-color: #b3b1b3 !important; /* legacy */
	--chrome-content-separator-color: #b3b1b3 !important;

	/* icons */
	--lwt-toolbarbutton-icon-fill: #606368 !important;

	/* icons_attention */
	--lwt-toolbarbutton-icon-fill-attention: #5086ec !important;

	/* button_background_hover */
	--lwt-toolbarbutton-hover-background: rgba(0, 0, 0, .07) !important;

	/* button_background_active */
	--lwt-toolbarbutton-active-background: rgba(0, 0, 0, .11) !important;

	--lwt-toolbar-field-color: #202124 !important;

	/* popup_highlight */
	--autocomplete-popup-highlight-background: #f2f2f2 !important;

	/* popup_highlight_text */
	--autocomplete-popup-highlight-color: #202124 !important;

	--search-icon-url: url("../icons/search.svg");
}

/* don't bother with sidebar in light mode */

/* dark mode */
:root[style*="--lwt-accent-color: rgb(28, 27, 34);"],
:root[privatebrowsingmode=temporary]
{
	/* accentcolor */
	--lwt-accent-color: #202124 !important;

	/* textcolor */
	--lwt-text-color: #9ba0a5 !important;

	/* toolbar */
	--toolbar-bgcolor: #333639 !important;

	/* toolbar_text */
	--toolbar-color: #fff !important;

	/* toolbar_bottom_separator */
	--toolbox-border-bottom-color: #282828 !important; /* legacy */
	--chrome-content-separator-color: #282828 !important;

	/* icons */
	--lwt-toolbarbutton-icon-fill: #fff !important;

	/* icons_attention */
	--lwt-toolbarbutton-icon-fill-attention: #5086ec !important;

	/* button_background_hover */
	--lwt-toolbarbutton-hover-background: #434649 !important;

	/* button_background_active */
	--lwt-toolbarbutton-active-background: #4e5153 !important;

	--lwt-toolbar-field-color: #fff !important;

	/* popup */
	--arrowpanel-background: #373737 !important;

	/* popup_text */
	--arrowpanel-color: #fff !important;
	--autocomplete-popup-color: #fff !important;
	--panel-disabled-color: hsla(0, 0%, 100%, .5) !important;

	/* popup_border */
	--arrowpanel-border-color: #555 !important;
	--autocomplete-popup-border-color: #555 !important;

	/* popup_highlight */
	--autocomplete-popup-highlight-background: #4c4f52 !important;

	/* popup_highlight_text */
	--autocomplete-popup-highlight-color: #fff !important;
	--search-icon-url: url("../icons/search_dark.svg");
}

:-moz-any(#sidebar-box, #sidebar)[style*="--sidebar-background-color:rgb(56, 56, 61);"]
{
	/* sidebar */
	--sidebar-background-color: #333639 !important;

	/* sidebar_text */
	--sidebar-text-color: #f1f3ee !important;
}

:-moz-any(.sidebar-panel, body)[style*="--lwt-sidebar-background-color:rgb(56, 56, 61);"]
{
	/* sidebar */
	--lwt-sidebar-background-color: #333639 !important;

	/* sidebar_text */
	--lwt-sidebar-text-color: #f1f3ee !important;
}

:root
{
    --ease-in: cubic-bezier(.4, 0, 1, 1);
	--ease-out: cubic-bezier(0, 0, .2, 1);
	--ease-basic: linear;

	--button-size: 32px; /* is this used? */
	--icon-size: 24px; /* is this used? */

	--downloads-item-height: 48px !important;

	--toolbar-non-lwt-bgcolor: var(--toolbar-bgcolor) !important;
	--toolbar-non-lwt-textcolor: var(--toolbar-color) !important;
	
	--toolbar-field-fontsize: 14px !important;
}

#titlebar,
#tabbrowser-tabs
{
 	--tab-min-height: 34px !important;
}

@supports -moz-bool-pref("materialFox.reduceTabOverflow")
{
	#tabbrowser-tabs
	{
		--tab-min-width: 32px !important;
	}
}

:root
{
	--tab-separator-opacity: .35 !important;

	--toolbar-field-background-color: hsl(200, 12%, 95%) !important;
	--toolbar-field-hover-background-color: hsl(216, 12%, 92%) !important;
	--toolbar-field-focus-background-color: hsl(0, 0%, 100%) !important;
}

:root:-moz-any([lwtheme-brighttext], [privatebrowsingmode=temporary])
{
	--toolbar-field-background-color: #202124 !important;
	--toolbar-field-hover-background-color: #292a2d !important;
	--toolbar-field-focus-background-color: #202124 !important;
}

:root:not(:-moz-lwtheme):not([privatebrowsingmode=temporary])
{
	--toolbar-bgcolor: hsl(0, 0%, 100%) !important;
	--toolbar-color: hsl(213, 5%, 39%) !important;
	--toolbox-border-bottom-color: hsl(0, 0%, 70%) !important;
}

@media (-moz-mac-yosemite-theme)
{
	:root[extradragspace]
	{
		--space-above-tabbar: 8px !important;
	}
}

/* Ubuntu */
@media (-moz-gtk-csd-available)
{
	:root:not(:-moz-lwtheme):not([privatebrowsingmode=temporary])
	{
		--toolbar-bgcolor: -moz-dialog !important;
		--toolbar-color: -moz-dialogtext !important;
	}
}

:root:not([lwtheme-brighttext]),
:root toolbar:not([brighttext]),
.tabbrowser-tab[visuallyselected]
{
	--toolbarbutton-hover-background: var(--lwt-toolbarbutton-hover-background, hsla(0, 0%, 0%, .07)) !important;
    --toolbarbutton-active-background: var(--lwt-toolbarbutton-active-background, hsla(0, 0%, 0%, .11)) !important;
}

:root[lwtheme-brighttext],
:root toolbar[brighttext],
:root[lwtheme-brighttext] .tabbrowser-tab[visuallyselected]
{
    --toolbarbutton-hover-background: var(--lwt-toolbarbutton-hover-background, hsla(0, 0%, 100%, .1)) !important;
    --toolbarbutton-active-background: var(--lwt-toolbarbutton-active-background, hsla(0, 0%, 100%, .17)) !important;
}

/* special case for urlbar buttons */
:-moz-any(#urlbar, #searchbar)
{
	--toolbarbutton-hover-background: hsl(210, 5%, 85%) !important;
	--toolbarbutton-active-background: hsl(210, 4%, 80%) !important;
}

:root:-moz-any([privatebrowsingmode=temporary], [lwtheme-brighttext]) :-moz-any(#urlbar, #searchbar)
{
	--toolbarbutton-hover-background: hsl(206, 5%, 26%) !important;
	--toolbarbutton-active-background: hsl(210, 4%, 31%) !important;
}
