/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@import url("chrome://global/skin/");

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
@namespace svg url("http://www.w3.org/2000/svg");

%include ../shared/browser.inc
%include windowsShared.inc
%filter substitution
%define toolbarShadowColor hsla(209,67%,12%,0.35)
%define navbarTextboxCustomBorder border-color: rgba(0,0,0,.32);
%define forwardTransitionLength 150ms
%define conditionalForwardWithUrlbar window:not([chromehidden~="toolbar"]) #urlbar-wrapper
%define conditionalForwardWithUrlbarWidth 30

:root {
  --toolbarbutton-hover-background: hsla(210,4%,10%,.08);
  --toolbarbutton-hover-bordercolor: hsla(210,4%,10%,.1);
  --toolbarbutton-hover-boxshadow: none;

  --toolbarbutton-active-background: hsla(210,4%,10%,.12);
  --toolbarbutton-active-bordercolor: hsla(210,4%,10%,.2) transparent transparent;
  --toolbarbutton-active-boxshadow: 0 1px 0 0 hsla(210,4%,10%,.1) inset;

  --toolbarbutton-checkedhover-backgroundcolor: hsla(210,4%,10%,.12);

  --toolbarbutton-combined-boxshadow: none;
  --toolbarbutton-combined-backgroundimage: linear-gradient(hsla(210,54%,20%,.2) 0, hsla(210,54%,20%,.2) 16px);

  --verified-identity-box-backgroundcolor: #FFF;

  --urlbar-dropmarker-url: url("chrome://browser/skin/urlbar-history-dropmarker.png");
  --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px);
  --urlbar-dropmarker-hover-region: rect(0px, 22px, 14px, 11px);
  --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px);
}

#menubar-items {
  -moz-box-orient: vertical; /* for flex hack */
}

#main-menubar {
  -moz-box-flex: 1; /* make menu items expand to fill toolbar height */
}

/* Hides the titlebar-placeholder underneath the window caption buttons when we
   are not autohiding the menubar. */
#toolbar-menubar:not([autohide="true"]) + #TabsToolbar > .titlebar-placeholder[type="caption-buttons"] {
  display: none;
}

/* We want a 4px gap between the TabsToolbar and the toolbar-menubar when the
   toolbar-menu is displayed, and a 16px gap when it is not. 1px is taken care
   of by the (light) outer shadow of the tab, the remaining 3/15 are these margins. */
#toolbar-menubar:not([moz-collapsed=true]):not([autohide=true]) ~ #TabsToolbar,
#toolbar-menubar:not([moz-collapsed=true])[autohide=true]:not([inactive]) ~ #TabsToolbar {
  margin-top: 3px;
}

#main-window[tabsintitlebar][sizemode="normal"]:not([inFullscreen])[chromehidden~="menubar"] #toolbar-menubar ~ #TabsToolbar,
#main-window[tabsintitlebar][sizemode="normal"]:not([inFullscreen]) #toolbar-menubar[autohide="true"][inactive] ~ #TabsToolbar {
  margin-top: 15px;
}

#toolbar-menubar:not([autohide="true"]) {
  -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
}

#main-window[customize-entered][tabsintitlebar]:not([inFullscreen]) #toolbar-menubar[customizing-dragovertarget].customization-target::before,
#main-window[customize-entered][tabsintitlebar]:not([inFullscreen]) #TabsToolbar[customizing-dragovertarget].customization-target::before,
#main-window[customize-entered][tabsintitlebar]:not([inFullscreen]) #toolbar-menubar.customization-target:hover::before,
#main-window[customize-entered][tabsintitlebar]:not([inFullscreen]) #TabsToolbar.customization-target:hover::before {
  outline-color: CaptionText;
}

#navigator-toolbox {
  -moz-appearance: none;
  background-color: transparent;
  border-top: none;
}

#navigator-toolbox::after {
  content: "";
  display: -moz-box;
  -moz-box-ordinal-group: 101; /* tabs toolbar is 100 */
  height: 1px;
  background-color: ThreeDShadow;
}

#navigator-toolbox > toolbar {
  -moz-appearance: none;
  border-style: none;
}

#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(:-moz-lwtheme) {
  background-color: -moz-Dialog;
}

#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):not(#addon-bar) {
  overflow: -moz-hidden-unscrollable;
  max-height: 4em;
  transition: min-height 170ms ease-out, max-height 170ms ease-out;
}

#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):not(#addon-bar)[collapsed=true] {
  min-height: 0.1px;
  max-height: 0;
  transition: min-height 170ms ease-out, max-height 170ms ease-out, visibility 170ms linear;
}

%ifdef WINDOWS_AERO
@media not all and (-moz-windows-compositor),
       not all and (-moz-windows-default-theme) {
%endif
  #main-window[tabsintitlebar]:not([inFullscreen]) #toolbar-menubar:not(:-moz-lwtheme),
  #main-window[tabsintitlebar]:not([inFullscreen]) #TabsToolbar:not(:-moz-lwtheme) {
    color: CaptionText;
  }

  #main-window[tabsintitlebar]:not([inFullscreen]) #toolbar-menubar:not(:-moz-lwtheme):-moz-window-inactive,
  #main-window[tabsintitlebar]:not([inFullscreen]) #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive {
    color: InactiveCaptionText;
  }

  #main-window[tabsintitlebar] #main-menubar > menu:not(:-moz-lwtheme) {
    color: inherit;
  }
%ifdef WINDOWS_AERO
}
%endif

%ifdef WINDOWS_AERO
@media not all and (-moz-windows-compositor) {
%endif
  #main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
    visibility: hidden;
  }

  #main-window[tabsintitlebar] #titlebar-content:-moz-lwtheme {
    -moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
    visibility: visible;
  }
%ifdef WINDOWS_AERO
}
%endif

/**
 * In the classic themes, the titlebar has a horizontal gradient, which is
 * problematic for reading the text of background tabs when they're in the
 * titlebar. We side-step this issue by layering our own background underneath
 * the tabs. Unfortunately, this requires a bunch of positioning in order to get
 * text and icons to not appear fuzzy.
 */
@media (-moz-windows-classic) {
  /**
   * We need to bump up the z-index of the tabbrowser-tabs so that they appear
   * over top of the fog we're applying for classic themes, as well as the nav-bar.
   */
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #tabbrowser-tabs {
    position: relative;
    z-index: 2;
  }

  #main-window[tabsintitlebar] #TabsToolbar:not(:-moz-lwtheme) {
    position: relative;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme)::after {
    /* Because we use placeholders for window controls etc. in the tabstrip,
     * and position those with ordinal attributes, and because our layout code
     * expects :before/:after nodes to come first/last in the frame list,
     * we have to reorder this element to come last, hence the
     * ordinal group value (see bug 853415). */
    -moz-box-ordinal-group: 1001;
    box-shadow: 0 0 50px 8px ActiveCaption;
    content: "";
    display: -moz-box;
    height: 0;
    margin: 0 50px;
    position: absolute;
    pointer-events: none;
    top: 100%;
    width: -moz-available;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive::after {
    box-shadow: 0 0 50px 8px InactiveCaption;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) toolbar[customindex]:not(:-moz-lwtheme),
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #PersonalToolbar:not(:-moz-lwtheme) {
    position: relative;
  }

  /* Need to constrain the box shadow fade to avoid overlapping layers, see bug 886281. */
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #navigator-toolbox:not(:-moz-lwtheme) {
    overflow: -moz-hidden-unscrollable;
  }

  /**
   * When the tabstrip is overflowed, pinned tab separators get position: absolute,
   * which makes the pinned tab separators leak over the nav-bar highlight. Forcing
   * the element to snap to the bottom of the client rect works around the issue.
   */
  #main-window[tabsintitlebar] #tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::before {
    bottom: 0px;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar .toolbarbutton-1 {
    position: relative;
    z-index: 1;
  }

  /**
   * With the tabbrowser-tabs element z-index'd above the nav-bar, we now get the
   * scrollbox button borders leaking over the nav-bar highlight. This transparent bottom
   * border forces the scrollbox button borders to terminate a pixel early, working
   * around the issue.
   */
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) .tabbrowser-arrowscrollbox > .scrollbutton-up,
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) .tabbrowser-arrowscrollbox > .scrollbutton-down {
    border-bottom: 1px solid transparent;
  }

  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme {
    /* Render a window top border: */
    background-image: linear-gradient(to bottom,
          ThreeDLightShadow 0, ThreeDLightShadow 1px,
          ThreeDHighlight 1px, ThreeDHighlight 2px,
          ActiveBorder 2px, ActiveBorder 4px, transparent 4px);
  }

  /* End classic titlebar gradient */

  #main-window[tabsintitlebar]:not([inFullscreen]) :-moz-any(#TabsToolbar, #toolbar-menubar) toolbarbutton:not(:-moz-lwtheme) {
    color: inherit;
  }
}

/* Render a window top border for lwthemes on WinXP modern themes: */
@media (-moz-windows-theme: luna-blue) {
  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme {
    background-image: linear-gradient(to bottom,
        rgb(8, 49, 216) 0, rgb(8, 49, 216) 1px,
        rgb(15, 77, 227) 1px, rgb(15, 77, 227) 2px,
        rgb(22, 106, 238) 2px, rgb(22, 106, 238) 3px,
        rgb(8, 85, 221) 3px, rgb(8, 85, 221) 4px,
        transparent 4px);
  }

  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme:-moz-window-inactive {
    background-image: linear-gradient(to bottom,
        rgb(91, 104, 205) 0, rgb(91, 104, 205) 1px,
        rgb(116, 128, 220) 1px, rgb(116, 128, 220) 2px,
        rgb(117, 140, 221) 2px, rgb(117, 140, 221) 4px,
        transparent 4px);
  }
}

@media (-moz-windows-theme: luna-silver) {
  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme {
    background-image: linear-gradient(to bottom,
        rgb(102,102,126) 0, rgb(102,102,126) 1px,
        rgb(168,167,191) 1px, rgb(168,167,191) 2px,
        white 2px, white 3px,
        rgb(188,188,207) 3px, rgb(188,188,207) 4px,
        transparent 4px);
  }

  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme:-moz-window-inactive {
    background-image: linear-gradient(to bottom,
        rgb(186,186,197) 0, rgb(186,186,197) 1px,
        rgb(236,238,245) 1px, rgb(236,238,245) 2px,
        white 2px, white 3px,
        rgb(215,215,227) 3px, rgb(215,215,227) 4px,
        transparent 4px);
  }
}

@media (-moz-windows-theme: luna-olive) {
  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme {
    background-image: linear-gradient(to bottom,
        rgb(139,161,105) 0, rgb(139,161,105) 1px,
        rgb(171, 189, 133) 1px, rgb(171, 189, 133) 2px,
        rgb(164,178,127) 2px, rgb(164,178,127) 3px,
        transparent 3px);
  }

  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme:-moz-window-inactive {
    background-image: linear-gradient(to bottom,
        rgb(207, 214, 188) 0, rgb(207, 214, 188) 1px,
        rgb(224, 226, 200) 1px, rgb(224, 226, 200) 2px,
        rgb(214, 216, 190) 2px, rgb(214, 216, 190) 3px,
        transparent 3px);
  }
}

#TabsToolbar:not([collapsed="true"]) + #nav-bar {
  margin-top: -1px; /* Move up into the TabsToolbar for the inner highlight at the top of the nav-bar */
  /* Position the toolbar above the bottom of background tabs */
  position: relative;
  z-index: 1;
}

#nav-bar {
  border-top: 1px solid @toolbarShadowColor@ !important;
  background-clip: padding-box;
  background-image: linear-gradient(@toolbarHighlight@, transparent);
  box-shadow: 0 1px 0 @toolbarHighlight@ inset;
}

%ifdef WINDOWS_AERO
@media not all and (-moz-windows-compositor) {
%endif
  #TabsToolbar[collapsed="true"] + #nav-bar {
    border-top-style: none !important;
  }
%ifdef WINDOWS_AERO
}
%endif

#personal-bookmarks {
  min-height: 24px;
}

#print-preview-toolbar:not(:-moz-lwtheme) {
  -moz-appearance: toolbox;
}

#browser-bottombox:not(:-moz-lwtheme) {
  background-color: -moz-dialog;
}

%ifndef WINDOWS_AERO
@media (-moz-windows-default-theme) {
  #main-window[tabsintitlebar][sizemode="normal"] #toolbar-menubar {
    margin-top: 4px;
  }
}
%endif

/* ::::: titlebar ::::: */

#main-window[sizemode="normal"] > #titlebar {
  -moz-appearance: -moz-window-titlebar;
}

#main-window[sizemode="maximized"] > #titlebar {
  -moz-appearance: -moz-window-titlebar-maximized;
}

@media (-moz-windows-classic) {
  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
    margin-top: 4px;
  }
}

/* The button box must appear on top of the navigator-toolbox in order for
 * click and hover mouse events to work properly for the button in the restored
 * window state. Otherwise, elements in the navigator-toolbox, like the menubar,
 * can swallow those events. It will also place the buttons above the fog on
 * themes with Aero Glass.
 */
#titlebar-buttonbox {
  z-index: 1;
}

.titlebar-placeholder[type="caption-buttons"] {
%ifdef WINDOWS_AERO
  margin-left: 22px; /* additional space for Aero Snap */
%else
  margin-left: 10px;
%endif
}

/* titlebar command buttons */

#titlebar-min {
  -moz-appearance: -moz-window-button-minimize;
}

#titlebar-max {
  -moz-appearance: -moz-window-button-maximize;
}

#main-window[sizemode="maximized"] #titlebar-max {
  -moz-appearance: -moz-window-button-restore;
}

#titlebar-close {
  -moz-appearance: -moz-window-button-close;
}

@media not all and (-moz-windows-classic) {
  #titlebar-min {
    -moz-margin-end: 2px;
  }
}

/* ::::: bookmark buttons ::::: */

toolbarbutton.bookmark-item:not(.subviewbutton),
#personal-bookmarks[cui-areatype="toolbar"]:not([overflowedItem=true]) > #bookmarks-toolbar-placeholder {
  margin: 0;
  padding: 2px 3px;
}

toolbarbutton.bookmark-item:not([disabled="true"]):not(.subviewbutton):hover:active,
toolbarbutton.bookmark-item[open="true"] {
  padding-top: 3px;
  padding-bottom: 1px;
  -moz-padding-start: 4px;
  -moz-padding-end: 2px;
}

.bookmark-item > .toolbarbutton-icon,
#personal-bookmarks[cui-areatype="toolbar"] > #bookmarks-toolbar-placeholder > .toolbarbutton-icon {
  width: 16px;
  height: 16px;
}

/* Force the display of the label for bookmarks */
.bookmark-item > .toolbarbutton-text,
#personal-bookmarks[cui-areatype="toolbar"] > #bookmarks-toolbar-placeholder > .toolbarbutton-text {
  display: -moz-box !important;
}

.bookmark-item > .toolbarbutton-menu-dropmarker {
  display: none;
}

#bookmarks-toolbar-placeholder {
  list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png") !important;
}

toolbarpaletteitem[place="palette"] > #personal-bookmarks > #bookmarks-toolbar-placeholder,
#personal-bookmarks[cui-areatype="menu-panel"] > #bookmarks-toolbar-placeholder {
  list-style-image: url("chrome://browser/skin/places/bookmarksToolbar-menuPanel.png") !important;
}

/* ----- BOOKMARK STAR ANIMATION ----- */

@keyframes animation-bookmarkAdded {
  from { transform: rotate(0deg) translateX(-16px) rotate(0deg) scale(1); opacity: 0; }
  60%  { transform: rotate(180deg) translateX(-16px) rotate(-180deg) scale(2.2); opacity: 1; }
  80%  { opacity: 1; }
  to   { transform: rotate(180deg) translateX(-16px) rotate(-180deg) scale(1); opacity: 0; }
}

@keyframes animation-bookmarkPulse {
  from { transform: scale(1); }
  50%  { transform: scale(1.3); }
  to   { transform: scale(1); }
}

#bookmarked-notification-container {
  min-height: 1px;
  min-width: 1px;
  height: 1px;
  margin-bottom: -1px;
  z-index: 5;
  position: relative;
}

#bookmarked-notification {
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
  width: 16px;
  height: 16px;
  opacity: 0;
}

#bookmarked-notification-dropmarker-anchor {
  z-index: -1;
  position: relative;
}

#bookmarked-notification-dropmarker-icon {
  width: 18px;
  height: 18px;
  visibility: hidden;
}

#bookmarked-notification-anchor[notification="finish"] > #bookmarked-notification {
  background-image: url("chrome://browser/skin/places/bookmarks-notification-finish.png");
  animation: animation-bookmarkAdded 800ms;
  animation-timing-function: ease, ease, ease;
}

#bookmarks-menu-button[notification="finish"] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
  list-style-image: none !important;
}

#bookmarked-notification-dropmarker-anchor[notification="finish"] > #bookmarked-notification-dropmarker-icon {
  visibility: visible;
  animation: animation-bookmarkPulse 300ms;
  animation-delay: 600ms;
  animation-timing-function: ease-out;
}

/* ::::: bookmark menus ::::: */

menu.bookmark-item,
menuitem.bookmark-item {
  min-width: 0;
  max-width: 32em;
}

.bookmark-item:not(.subviewbutton) > .menu-iconic-left {
  margin-top: 0;
  margin-bottom: 0;
}

.bookmark-item > .menu-iconic-left > .menu-iconic-icon {
  -moz-padding-start: 0px;
}

/* ::::: bookmark items ::::: */

.bookmark-item  {
  list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
}

.bookmark-item[container] {
  list-style-image: url("chrome://global/skin/icons/folder-item.png");
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}

.bookmark-item[container][open] {
  -moz-image-region: rect(16px, 32px, 32px, 16px);
}

.bookmark-item[container][livemark] {
  list-style-image: url("chrome://browser/skin/livemark-folder.png");
  -moz-image-region: auto;
}

.bookmark-item[container][livemark] .bookmark-item {
  list-style-image: url("chrome://browser/skin/places/livemark-item.png");
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}

.bookmark-item[container][livemark] .bookmark-item[visited] {
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}

.bookmark-item[container][query] {
  list-style-image: url("chrome://browser/skin/places/query.png");
  -moz-image-region: auto;
}

.bookmark-item[query][tagContainer] {
  list-style-image: url("chrome://browser/skin/places/tag.png");
  -moz-image-region: auto;
}

.bookmark-item[query][dayContainer] {
  list-style-image: url("chrome://browser/skin/places/calendar.png");
  -moz-image-region: auto;
}

.bookmark-item[query][hostContainer] {
  list-style-image: url("chrome://global/skin/icons/folder-item.png");
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}

.bookmark-item[query][hostContainer][open] {
  list-style-image: url("chrome://global/skin/icons/folder-item.png");
  -moz-image-region: rect(16px, 32px, 32px, 16px);
}

.bookmark-item[cutting] > .toolbarbutton-icon,
.bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-icon {
  opacity: 0.5;
}

.bookmark-item[cutting] > .toolbarbutton-text,
.bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-text {
  opacity: 0.7;
}

/* ::::: primary toolbar buttons ::::: */

%include ../shared/toolbarbuttons.inc.css
%include ../shared/menupanel.inc.css

%ifndef WINDOWS_AERO
@media (-moz-windows-theme: luna-silver) {
  :-moz-any(@primaryToolbarButtons@),
  #bookmarks-menu-button.toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
    list-style-image: url("chrome://browser/skin/Toolbar-lunaSilver.png");
  }

  #loop-button > .toolbarbutton-badge-container {
    list-style-image: url(chrome://browser/skin/loop/toolbar-lunaSilver.png)
  }
}
%endif

#main-window:not([customizing]) .toolbarbutton-1[disabled=true] > .toolbarbutton-icon,
#main-window:not([customizing]) .toolbarbutton-1[disabled=true] > .toolbarbutton-menu-dropmarker,
#main-window:not([customizing]) .toolbarbutton-1[disabled=true] > .toolbarbutton-menubutton-dropmarker,
#main-window:not([customizing]) .toolbarbutton-1[disabled=true] > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
#main-window:not([customizing]) .toolbarbutton-1 > .toolbarbutton-menubutton-button[disabled=true] > .toolbarbutton-icon {
  opacity: .4;
}

.toolbarbutton-1 > .toolbarbutton-menu-dropmarker,
.toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
  list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow.png");
}

toolbar[brighttext] .toolbarbutton-1 > .toolbarbutton-menu-dropmarker,
toolbar[brighttext] .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
  list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png");
}

.toolbarbutton-1 > .toolbarbutton-icon,
.toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
  -moz-margin-end: 0;
}

.findbar-button,
#nav-bar .toolbarbutton-1,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button {
  -moz-appearance: none;
  border: none;
  padding: 0;
  background: none;
}

#nav-bar .toolbarbutton-1:not([type=menu-button]),
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
  padding: 8px 2px;
  -moz-box-pack: center;
}

#nav-bar #PanelUI-menu-button {
  -moz-padding-start: 7px;
  -moz-padding-end: 5px;
}

#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) {
  padding-left: 5px;
  padding-right: 5px;
}

#nav-bar .toolbarbutton-1 > menupopup {
  margin-top: -3px;
}

#nav-bar .toolbarbutton-1 > menupopup.cui-widget-panel {
  margin-top: -8px;
}

#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button {
  -moz-padding-end: 0;
}

#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
  -moz-padding-start: 0;
  -moz-box-align: center;
}

.findbar-button > .toolbarbutton-text,
#nav-bar .toolbarbutton-1 > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1 > .toolbarbutton-text,
#nav-bar .toolbarbutton-1 > .toolbarbutton-badge-container,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon,
@conditionalForwardWithUrlbar@ > .toolbarbutton-1:-moz-any([disabled],:not([open]):not([disabled]):not(:active)) > .toolbarbutton-icon {
  padding: 2px 6px;
  border: 1px solid;
  border-color: transparent;
  transition-property: background-color, border-color;
  transition-duration: 150ms;
}

%ifdef WINDOWS_AERO
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7) {
%endif
  /* < Win8 */
  :root {
    --toolbarbutton-hover-background: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
    --toolbarbutton-hover-bordercolor: hsla(210,54%,20%,.15) hsla(210,54%,20%,.2) hsla(210,54%,20%,.25);
    --toolbarbutton-hover-boxshadow: 0 1px hsla(0,0%,100%,.3) inset,
                                     0 1px hsla(210,54%,20%,.03),
                                     0 0 2px hsla(210,54%,20%,.1);

    --toolbarbutton-active-background: hsla(210,54%,20%,.15) linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
    --toolbarbutton-active-bordercolor: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4);
    --toolbarbutton-active-boxshadow: 0 1px 1px hsla(210,54%,20%,.1) inset,
                                      0 0 1px hsla(210,54%,20%,.2) inset,
/* allows keyhole-forward-clip-path to be used for non-hover as well as hover: */
                                      0 1px 0 hsla(210,54%,20%,0),
                                      0 0 2px hsla(210,54%,20%,0);

    --toolbarbutton-checkedhover-backgroundcolor: rgba(90%,90%,90%,.4);

    --toolbarbutton-combined-backgroundimage: linear-gradient(hsla(210,54%,20%,.2) 0, hsla(210,54%,20%,.2) 18px);
    --toolbarbutton-combined-boxshadow: 0 0 0 1px hsla(0,0%,100%,.2);
  }
  .findbar-button > .toolbarbutton-text,
  #nav-bar .toolbarbutton-1 > .toolbarbutton-icon,
  #nav-bar .toolbarbutton-1 > .toolbarbutton-text,
  #nav-bar .toolbarbutton-1 > .toolbarbutton-badge-container,
  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
    background-color: hsla(210,32%,93%,0);
    background-origin: padding-box;
    border-radius: 2px;
    border-color: hsla(210,54%,20%,0) hsla(210,54%,20%,0) hsla(210,54%,20%,0);
    box-shadow: 0 1px hsla(0,0%,100%,0) inset,
                0 1px hsla(210,54%,20%,0),
                0 0 2px hsla(210,54%,20%,0);
    transition-property: background-color, border-color, box-shadow;
    transition-duration: 150ms;
  }
%ifdef WINDOWS_AERO
}
%endif

#nav-bar .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-badge-container,
#nav-bar .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
  padding: 3px 7px;
}

/* Help SDK icons fit: */
toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
  width: 16px;
}

#nav-bar toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
  /* XXXgijs box models strike again: this is 16px + 2 * 7px padding + 2 * 1px border (from the rules above) */
  width: 32px;
}

#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1[type=menu] > .toolbarbutton-text /* hack for add-ons that forcefully display the label */ {
  -moz-padding-end: 17px;
}

#nav-bar .toolbarbutton-1 > .toolbarbutton-menu-dropmarker {
  -moz-margin-start: -15px;
}

#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
  -moz-border-end: none transparent;
}

#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
  padding: 8px 5px 7px;
}

#nav-bar .toolbaritem-combined-buttons {
  margin-left: 2px;
  margin-right: 2px;
}

#nav-bar .toolbaritem-combined-buttons > .toolbarbutton-1 {
  padding-left: 0;
  padding-right: 0;
}

#nav-bar .toolbarbutton-1:not(:hover):not(:active):not([open]) > .toolbarbutton-menubutton-dropmarker::before,
#nav-bar .toolbaritem-combined-buttons > .toolbarbutton-1:-moz-any(:not(:hover):not([open]),[disabled=true]) + .toolbarbutton-1:-moz-any(:not(:hover):not([open]),[disabled=true])::before {
  content: "";
  display: -moz-box;
  width: 1px;
  height: 16px;
  -moz-margin-end: -1px;
  background-image: var(--toolbarbutton-combined-backgroundimage);
  box-shadow: var(--toolbarbutton-combined-boxshadow);
  background-clip: padding-box;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 1px 16px;
}

@conditionalForwardWithUrlbar@ > .toolbarbutton-1:-moz-any([disabled],:not([open]):not([disabled]):not(:active)) > .toolbarbutton-icon {
  border-color: hsla(210,4%,10%,.1);
}

.findbar-button:not(:-moz-any([checked="true"],[disabled="true"])):hover > .toolbarbutton-text,
#nav-bar .toolbarbutton-1:not([disabled=true]) > .toolbarbutton-menubutton-button[open] + .toolbarbutton-menubutton-dropmarker > .dropmarker-icon,
#nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any(:hover,[open]) > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any(:hover,[open]) > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon,
#nav-bar .toolbarbutton-1:not([disabled=true]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1:not([disabled=true]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-text,
#nav-bar .toolbarbutton-1:not([disabled=true]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-badge-container,
@conditionalForwardWithUrlbar@ > #forward-button:not([open]):not(:active):not([disabled]):hover > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1:not([buttonover]):not([open]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled]) > .dropmarker-icon {
  background: var(--toolbarbutton-hover-background);
  border-color: var(--toolbarbutton-hover-bordercolor);
  box-shadow: var(--toolbarbutton-hover-boxshadow);
}

%ifdef WINDOWS_AERO
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7) {
%endif
  /* < Win8 */
  #nav-bar .toolbarbutton-1:not(:hover):not(:active):not([open]) > .toolbarbutton-menubutton-dropmarker::before,
  #nav-bar .toolbaritem-combined-buttons > .toolbarbutton-1:-moz-any(:not(:hover):not([open]),[disabled]) + .toolbarbutton-1:-moz-any(:not(:hover):not([open]),[disabled])::before {
    height: 18px;
    background-size: 1px 18px;
  }

  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon:-moz-locale-dir(ltr),
  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon:-moz-locale-dir(rtl) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon:-moz-locale-dir(rtl),
  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon:-moz-locale-dir(ltr) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):not([open]):not(:active):hover > .toolbarbutton-icon,
  #nav-bar .toolbarbutton-1:not([buttonover]):not([open]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled]) > .dropmarker-icon,
  @conditionalForwardWithUrlbar@ > #forward-button:not([open]):not(:active):not([disabled]):hover > .toolbarbutton-icon {
    border-color: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4);
    background-color: hsla(210,48%,96%,.75);
    box-shadow: 0 0 1px hsla(210,54%,20%,.03),
                0 0 2px hsla(210,54%,20%,.1);
  }
%ifdef WINDOWS_AERO
}
%endif

.findbar-button:not([disabled=true]):-moz-any([checked="true"],:hover:active) > .toolbarbutton-text,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled=true]):-moz-any(:hover:active, [open]) > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1[open] > .toolbarbutton-menubutton-dropmarker:not([disabled=true]) > .dropmarker-icon,
#nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-text,
#nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-container {
  background: var(--toolbarbutton-active-background);
  border-color: var(--toolbarbutton-active-bordercolor);
  box-shadow: var(--toolbarbutton-active-boxshadow);
  transition-duration: 10ms;
}

%ifdef WINDOWS_AERO
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7) {
%endif
  /* < Win8 */
  .findbar-button:not([disabled=true]):-moz-any([checked="true"],:hover:active) > .toolbarbutton-text,
  #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled=true]):-moz-any(:hover:active, [open]) > .toolbarbutton-icon,
  #nav-bar .toolbarbutton-1[open] > .toolbarbutton-menubutton-dropmarker:not([disabled]) > .dropmarker-icon,
  #nav-bar .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-icon,
  #nav-bar .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-text,
  #nav-bar .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-container {
    text-shadow: none;
    transition: none;
  }

  #nav-bar .toolbarbutton-1:-moz-any(:hover,[open]) > .toolbarbutton-menubutton-dropmarker:not([disabled]) > .dropmarker-icon {
    -moz-border-start-color: hsla(210,54%,20%,.35);
  }

  #nav-bar .toolbarbutton-1[checked]:not(:active):hover > .toolbarbutton-icon {
    background-color: var(--toolbarbutton-checkedhover-backgroundcolor);
    transition: background-color .4s;
  }
%ifdef WINDOWS_AERO
}
%endif

#TabsToolbar .toolbarbutton-1,
#TabsToolbar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
.tabbrowser-arrowscrollbox > .scrollbutton-up,
.tabbrowser-arrowscrollbox > .scrollbutton-down {
  -moz-appearance: none;
  border-style: none;
  padding: 0 3px;
}

#TabsToolbar .toolbarbutton-1 {
  margin-bottom: var(--tab-toolbar-navbar-overlap);
}

#TabsToolbar .toolbarbutton-1:not([disabled=true]):hover,
#TabsToolbar .toolbarbutton-1[open],
#TabsToolbar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled=true]):hover,
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled=true]):hover,
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled=true]):hover {
  background-image: linear-gradient(transparent, rgba(255,255,255,.5)),
                    linear-gradient(transparent, rgba(0,0,0,.25) 30%),
                    linear-gradient(transparent, rgba(0,0,0,.25) 30%);
  background-position: 1px -1px, 0 -1px, 100% -1px;
  background-size: calc(100% - 2px) 100%, 1px 100%, 1px 100%;
  background-repeat: no-repeat;
}

/* unified back/forward button */

#forward-button {
  -moz-box-align: stretch; /* let the button shape grow vertically with the location bar */
  padding: 0 !important;
}

#forward-button > menupopup {
  margin-top: 1px !important;
}

#forward-button > .toolbarbutton-icon {
  background-clip: padding-box !important;
  border-left-style: none !important;
  border-radius: 0 !important;
  padding-left: 9px !important;
  padding-right: 3px !important;
}

@conditionalForwardWithUrlbar@:not([switchingtabs]) > #forward-button {
  transition: margin-left @forwardTransitionLength@ ease-out;
}

@conditionalForwardWithUrlbar@ > #forward-button[disabled] {
  margin-left: -@conditionalForwardWithUrlbarWidth@px;
}

@conditionalForwardWithUrlbar@:hover:not([switchingtabs]) > #forward-button[disabled] {
  /* delay the hiding of the forward button when hovered to avoid accidental clicks on the url bar */
  transition-delay: 100s;
}

@conditionalForwardWithUrlbar@:not(:hover) > #forward-button[disabled] {
  /* when not hovered anymore, trigger a new transition to hide the forward button immediately */
  margin-left: -@conditionalForwardWithUrlbarWidth@.01px;
}

#back-button {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  -moz-padding-start: 5px !important;
  -moz-padding-end: 0 !important;
  position: relative !important;
  z-index: 1 !important;
  border-radius: 0 10000px 10000px 0 !important;
  --toolbarbutton-hover-boxshadow: 0 1px 0 0 hsla(210,4%,10%,.25),
                                   0 0 0 1px hsla(210,4%,10%,.25);
}

#back-button:-moz-locale-dir(rtl) {
  border-radius: 10000px 0 0 10000px !important;
}

#back-button > menupopup {
  margin-top: -1px !important;
}

#back-button > .toolbarbutton-icon {
  border-radius: 10000px !important;
  background-clip: padding-box !important;
  background-color: hsla(210,25%,98%,.08) !important;
  padding: 6px !important;
  border-style: none !important;
  box-shadow: 0 1px 0 0 hsla(210,4%,10%,.25),
              0 0 0 1px hsla(210,4%,10%,.25);
  transition-property: background-color, box-shadow !important;
  transition-duration: 250ms !important;
}

#back-button:not([disabled="true"]):not([open="true"]):not(:active):hover > .toolbarbutton-icon {
  background-color: hsla(210,4%,10%,.08) !important;
}

#back-button:not([disabled="true"]):hover:active > .toolbarbutton-icon,
#back-button[open="true"] > .toolbarbutton-icon {
  background-color: hsla(210,4%,10%,.12) !important;
  box-shadow: 0 1px 0 0 hsla(210,4%,10%,.25),
              0 0 0 1px hsla(210,4%,10%,.25),
              0 1px 0 0 hsla(210,80%,20%,.1) inset !important;
}

%ifdef WINDOWS_AERO
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7) {
%endif
  #back-button > .toolbarbutton-icon {
    background-image: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1)) !important;
    box-shadow: 0 1px 0 hsla(0,0%,100%,.3) inset,
                0 0 0 1px hsla(0,0%,100%,.3) inset,
                0 0 0 1px hsla(210,54%,20%,.25),
                0 1px 0 hsla(210,54%,20%,.35) !important;
  }

  #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover > .toolbarbutton-icon {
    background-color: hsla(210,48%,96%,.75) !important;
    box-shadow: 0 1px 0 hsla(0,0%,100%,.3) inset,
                0 0 0 1px hsla(0,0%,100%,.3) inset,
                0 0 0 1px hsla(210,54%,20%,.3),
                0 1px 0 hsla(210,54%,20%,.4),
                0 0 4px hsla(210,54%,20%,.2) !important;
  }

  #back-button:not([disabled="true"]):hover:active > .toolbarbutton-icon,
  #back-button[open="true"] > .toolbarbutton-icon {
    background-color: hsla(210,54%,20%,.15) !important;
    box-shadow: 0 1px 1px hsla(210,54%,20%,.1) inset,
                0 0 1px hsla(210,54%,20%,.2) inset,
                0 0 0 1px hsla(210,54%,20%,.4),
                0 1px 0 hsla(210,54%,20%,.2) !important;
    transition: none;
  }

  #main-window:not([customizing]) #back-button[disabled] > .toolbarbutton-icon {
    box-shadow: 0 0 0 1px hsla(210,54%,20%,.55),
                0 1px 0 hsla(210,54%,20%,.65) !important;
    transition: none;
  }
%ifdef WINDOWS_AERO
}
%endif

#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

.unified-nav-back[_moz-menuactive]:-moz-locale-dir(ltr),
.unified-nav-forward[_moz-menuactive]:-moz-locale-dir(rtl) {
  list-style-image: url("chrome://browser/skin/menu-back.png") !important;
}

.unified-nav-forward[_moz-menuactive]:-moz-locale-dir(ltr),
.unified-nav-back[_moz-menuactive]:-moz-locale-dir(rtl) {
  list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
}

/* tabview menu item */

#menu_tabview {
  list-style-image: url(chrome://browser/skin/tabview/tabview.png);
  -moz-image-region: rect(1px, 89px, 17px, 73px);
}

#menu_tabview[groups="0"] {
  -moz-image-region: rect(1px, 17px, 17px, 1px);
}

#menu_tabview[groups="1"] {
  -moz-image-region: rect(1px, 35px, 17px, 19px);
}

#menu_tabview[groups="2"] {
  -moz-image-region: rect(1px, 53px, 17px, 37px);
}

#menu_tabview[groups="3"] {
  -moz-image-region: rect(1px, 71px, 17px, 55px);
}

/* undo close tab menu item */
#alltabs_undoCloseTab {
  list-style-image: url(chrome://browser/skin/undoCloseTab.png);
}

@media (min-resolution: 1.25dppx) {
  #alltabs_undoCloseTab {
    list-style-image: url(chrome://browser/skin/undoCloseTab@2x.png);
  }
  #alltabs_undoCloseTab > .toolbarbutton-icon {
    width: 16px;
  }
}

/* zoom control text (reset) button special case: */

#nav-bar #zoom-reset-button > .toolbarbutton-text {
  /* To make this line up with the icons, it needs the same height (18px) +
   * padding (2 * 2px) + border (2 * 1px), but as a minimum because otherwise
   * increase in text sizes would break things...
   */
  min-height: 24px;
}

/* ::::: fullscreen window controls ::::: */

#window-controls {
  -moz-margin-start: 4px;
}

#minimize-button,
#restore-button,
#close-button {
  list-style-image: url("chrome://global/skin/icons/windowControls.png");
  padding: 0;
}

#minimize-button {
  -moz-image-region: rect(0, 16px, 16px, 0);
}
#minimize-button:hover {
  -moz-image-region: rect(16px, 16px, 32px, 0);
}
#minimize-button:hover:active {
  -moz-image-region: rect(32px, 16px, 48px, 0);
}
#restore-button {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}
#restore-button:hover {
  -moz-image-region: rect(16px, 32px, 32px, 16px);
}
#restore-button:hover:active {
  -moz-image-region: rect(32px, 32px, 48px, 16px);
}
#close-button {
  -moz-image-region: rect(0, 48px, 16px, 32px);
  -moz-appearance: none;
  border-style: none;
  margin: 2px;
}
#close-button:hover {
  -moz-image-region: rect(16px, 48px, 32px, 32px);
}
#close-button:hover:active {
  -moz-image-region: rect(32px, 48px, 48px, 32px);
}

/* ::::: Location Bar ::::: */

#urlbar,
.searchbar-textbox {
  -moz-appearance: none;
  margin: 0 3px;
  padding: 0;
  background-clip: padding-box;
  border: 1px solid ThreeDShadow;
}

%ifdef WINDOWS_AERO
@media (-moz-os-version: windows-vista),
       (-moz-os-version: windows-win7) {
%endif
  /* < Win8 */
  #urlbar,
  .searchbar-textbox {
    border-radius: 2px;
  }
%ifdef WINDOWS_AERO
}
%endif

#urlbar {
  -moz-padding-end: 2px;
}

@media (-moz-windows-default-theme) {
  #urlbar,
  .searchbar-textbox {
    @navbarTextboxCustomBorder@
  }
}

#urlbar:-moz-lwtheme,
.searchbar-textbox:-moz-lwtheme {
  background-color: rgba(255,255,255,.8);
  @navbarTextboxCustomBorder@
  color: black;
}

#urlbar:-moz-lwtheme:hover:not([focused]):not([readonly]),
.searchbar-textbox:-moz-lwtheme:hover:not([focused]) {
  background-color: rgba(255,255,255,.9);
}

#urlbar:-moz-lwtheme[focused]:not([readonly]),
.searchbar-textbox:-moz-lwtheme[focused] {
  background-color: white;
}

@conditionalForwardWithUrlbar@ > #urlbar {
  -moz-border-start: none;
  margin-left: 0;
}

@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(ltr) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

@conditionalForwardWithUrlbar@ {
  clip-path: url("chrome://browser/content/browser.xul#urlbar-back-button-clip-path");
  -moz-margin-start: -5px;
}

@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl),
@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
  /* let urlbar-back-button-clip-path clip the urlbar's right side for RTL */
  transform: scaleX(-1);
}

@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl) {
  -moz-box-direction: reverse;
}

html|*.urlbar-input:-moz-lwtheme::-moz-placeholder,
.searchbar-textbox:-moz-lwtheme > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::-moz-placeholder {
  opacity: 1.0;
  color: #777;
}

#urlbar-container {
  -moz-box-align: center;
}

.urlbar-textbox-container {
  -moz-box-align: stretch;
}

.urlbar-input-box {
  -moz-margin-start: 0;
}

#urlbar-icons {
  -moz-box-align: center;
}

.urlbar-icon {
  padding: 0 3px;
}

.searchbar-engine-button,
.search-go-container {
  padding: 2px 2px;
}

.urlbar-icon:hover {
  background-image: radial-gradient(circle closest-side, hsla(200,100%,70%,.3), transparent);
}

.urlbar-icon[open="true"],
.urlbar-icon:hover:active {
  background-image: radial-gradient(circle closest-side, hsla(200,100%,70%,.1), transparent);
}

#urlbar-search-splitter {
  min-width: 6px;
  -moz-margin-start: -3px;
  border: none;
  background: transparent;
}

#urlbar-search-splitter + #search-container > #searchbar > .searchbar-textbox {
  -moz-margin-start: 0;
}

#urlbar-display-box {
  -moz-border-end: 1px solid #AAA;
  -moz-margin-end: 3px;
}

.urlbar-display {
  margin-top: 0;
  margin-bottom: 0;
  -moz-margin-start: 0;
  color: GrayText;
}

#search-container {
  min-width: calc(54px + 11ch);
}

/* identity box */

#identity-box {
  padding: 2px;
  font-size: .9em;
}

#identity-box:-moz-locale-dir(ltr) {
  border-top-left-radius: 1.5px;
  border-bottom-left-radius: 1.5px;
}

#identity-box:-moz-locale-dir(rtl) {
  border-top-right-radius: 1.5px;
  border-bottom-right-radius: 1.5px;
}

#notification-popup-box:not([hidden]) + #identity-box {
  -moz-padding-start: 10px;
  border-radius: 0;
}

@conditionalForwardWithUrlbar@ > #urlbar > #identity-box {
  border-radius: 0;
}

@conditionalForwardWithUrlbar@:not([switchingtabs]) > #urlbar > #identity-box {
  transition: padding-left, padding-right;
}

@conditionalForwardWithUrlbar@ > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(ltr) {
  padding-left: 5px;
}

@conditionalForwardWithUrlbar@ > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(rtl) {
  padding-right: 5px;
}

@conditionalForwardWithUrlbar@:hover:not([switchingtabs]) > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box {
  /* forward button hiding is delayed when hovered */
  transition-delay: 100s;
}

@conditionalForwardWithUrlbar@:not(:hover) > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(ltr) {
  /* when not hovered anymore, trigger a new non-delayed transition to react to the forward button hiding */
  padding-left: 5.01px;
}

@conditionalForwardWithUrlbar@:not(:hover) > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(rtl) {
  /* when not hovered anymore, trigger a new non-delayed transition to react to the forward button hiding */
  padding-right: 5.01px;
}

#urlbar[pageproxystate="valid"] > #identity-box.chromeUI,
#urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity {
  -moz-margin-end: 4px;
}

#identity-box.verifiedIdentity:not(:-moz-lwtheme) {
  background-color: var(--verified-identity-box-backgroundcolor);
}

#identity-box:-moz-focusring {
  outline: 1px dotted #000;
  outline-offset: -3px;
}

#identity-icon-labels {
  -moz-padding-start: 2px;
  -moz-padding-end: 5px;
}

/* Location bar dropmarker */

.urlbar-history-dropmarker {
  -moz-appearance: none;
  padding: 0 3px;
  background-color: transparent;
  border: none;
  width: auto;
  list-style-image: var(--urlbar-dropmarker-url);
  -moz-image-region: var(--urlbar-dropmarker-region);
}

.urlbar-history-dropmarker:hover {
  background-image: radial-gradient(circle closest-side, hsla(205,100%,70%,.3), transparent);
  -moz-image-region: var(--urlbar-dropmarker-hover-region);
}

.urlbar-history-dropmarker:hover:active,
.urlbar-history-dropmarker[open="true"] {
  background-image: radial-gradient(circle closest-side, hsla(205,100%,70%,.1), transparent);
  -moz-image-region: var(--urlbar-dropmarker-active-region);
}

/* page proxy icon */

%include ../shared/identity-block.inc.css

#page-proxy-favicon {
  margin-top: 1px;
  margin-bottom: 1px;
  -moz-margin-start: 3px;
  -moz-margin-end: 1px;
  -moz-image-region: rect(0, 16px, 16px, 0);
}

#identity-box:hover > #page-proxy-favicon {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

#identity-box:hover:active > #page-proxy-favicon,
#identity-box[open=true] > #page-proxy-favicon {
  -moz-image-region: rect(0, 48px, 16px, 32px);
}

/* autocomplete */

#treecolAutoCompleteImage {
  max-width: 36px;
}

.ac-result-type-bookmark,
.autocomplete-treebody::-moz-tree-image(bookmark, treecolAutoCompleteImage) {
  list-style-image: url("chrome://browser/skin/places/bookmark.png");
  -moz-image-region: rect(0px 32px 16px 16px);
  width: 16px;
  height: 16px;
}

richlistitem[selected="true"][current="true"] > .ac-title-box > .ac-result-type-bookmark,
.autocomplete-treebody::-moz-tree-image(selected, current, bookmark, treecolAutoCompleteImage) {
  -moz-image-region: rect(0px 48px 16px 32px);
}

.ac-result-type-keyword,
.autocomplete-treebody::-moz-tree-image(keyword, treecolAutoCompleteImage),
richlistitem[type~="action"][actiontype="searchengine"] > .ac-title-box > .ac-site-icon {
  list-style-image: url(chrome://global/skin/icons/autocomplete-search.svg#search-icon);
  width: 16px;
  height: 16px;
}

%ifdef WINDOWS_AERO
@media not all and (-moz-windows-default-theme) {
%endif
  .ac-result-type-keyword[selected="true"],
  .autocomplete-treebody::-moz-tree-image(keyword, treecolAutoCompleteImage, selected),
  richlistitem[type~="action"][actiontype="searchengine"][selected="true"] > .ac-title-box > .ac-site-icon {
    list-style-image: url(chrome://global/skin/icons/autocomplete-search.svg#search-icon-inverted);
  }
%ifdef WINDOWS_AERO
}
%endif

.ac-result-type-tag,
.autocomplete-treebody::-moz-tree-image(tag, treecolAutoCompleteImage) {
  list-style-image: url("chrome://browser/skin/places/tag.png");
  width: 16px;
  height: 16px;
}

.ac-comment {
  font-size: 1.06em;
}

.ac-extra > .ac-comment {
  font-size: 1em;
}

.ac-url-text,
.ac-action-text {
  font-size: 1em;
  color: -moz-nativehyperlinktext;
}

%ifndef WINDOWS_AERO
@media (-moz-windows-default-theme) {
  .ac-url-text:not([selected="true"]),
  .ac-action-text:not([selected="true"]) {
    color: #008800;
  }
}
%endif

richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-icon {
  list-style-image: url("chrome://browser/skin/actionicon-tab.png");
  -moz-image-region: rect(0, 16px, 11px, 0);
  padding: 0 3px;
}

%ifdef WINDOWS_AERO
@media not all and (-moz-windows-default-theme) {
%endif
  richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url-box > .ac-action-icon {
    -moz-image-region: rect(11px, 16px, 22px, 0);
  }

  .ac-comment[selected="true"],
  .ac-url-text[selected="true"],
  .ac-action-text[selected="true"] {
    color: inherit !important;
  }
%ifdef WINDOWS_AERO
}
%endif

.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
  color: GrayText;
}

.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
.autocomplete-treebody::-moz-tree-cell-text(suggestfirst, treecolAutoCompleteComment)
{
  color: GrayText;
  font-size: smaller;
}

.autocomplete-treebody::-moz-tree-cell(suggesthint) {
  border-top: 1px solid GrayText;
}

/* combined go/reload/stop button in location bar */

#urlbar > toolbarbutton {
  -moz-appearance: none;
  padding: 0 2px;
  background-origin: border-box;
  border: none;
  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
}

#urlbar-reload-button {
  -moz-image-region: rect(0, 14px, 14px, 0);
}

#urlbar-reload-button:not([disabled]):hover {
  background-image: radial-gradient(circle closest-side, hsla(200,100%,70%,.2), transparent);
  -moz-image-region: rect(14px, 14px, 28px, 0);
}

#urlbar-reload-button:not([disabled]):hover:active {
  background-image: radial-gradient(circle closest-side, hsla(200,100%,60%,.1), transparent);
  -moz-image-region: rect(28px, 14px, 42px, 0);
}

#urlbar-reload-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

#urlbar-go-button {
  -moz-image-region: rect(0, 42px, 14px, 28px);
}

#urlbar-go-button:hover {
  background-image: radial-gradient(circle closest-side, hsla(110,70%,50%,.2), transparent);
  -moz-image-region: rect(14px, 42px, 28px, 28px);
}

#urlbar-go-button:hover:active {
  background-image: radial-gradient(circle closest-side, hsla(110,70%,50%,.1), transparent);
  -moz-image-region: rect(28px, 42px, 42px, 28px);
}

#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

#urlbar-stop-button {
  -moz-image-region: rect(0, 28px, 14px, 14px);
}

#urlbar-stop-button:not([disabled]):hover {
  background-image: radial-gradient(circle closest-side, hsla(5,100%,75%,.3), transparent);
  -moz-image-region: rect(14px, 28px, 28px, 14px);
}

#urlbar-stop-button:hover:active {
  background-image: radial-gradient(circle closest-side, hsla(5,100%,75%,.1), transparent);
  -moz-image-region: rect(28px, 28px, 42px, 14px);
}

/* popup blocker button */

#page-report-button {
  list-style-image: url("chrome://browser/skin/urlbar-popup-blocked.png");
  -moz-image-region: rect(0, 16px, 16px, 0);
}

#page-report-button:hover {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

#page-report-button:hover:active,
#page-report-button[open="true"] {
  -moz-image-region: rect(0, 48px, 16px, 32px);
}

%include ../shared/readinglist/readinglist.inc.css

/* Reader mode button */

#reader-mode-button {
  list-style-image: url("chrome://browser/skin/readerMode.svg");
  -moz-image-region: rect(0, 16px, 16px, 0);
}

#reader-mode-button:hover,
#reader-mode-button[readeractive]:hover {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

#reader-mode-button:hover:active,
#reader-mode-button[readeractive] {
  -moz-image-region: rect(0, 48px, 16px, 32px);
}

/* social share panel */

.social-share-frame {
  min-width: 756px;
  height: 150px;
}
#share-container {
  min-width: 756px;
  background-color: white;
  background-repeat: no-repeat;
  background-position: center center;
}
#share-container[loading] {
  background-image: url(chrome://browser/skin/tabbrowser/pendingpaint.png);
}
#share-container > browser {
  transition: opacity 150ms ease-in-out;
  opacity: 1;
}
#share-container[loading] > browser {
  opacity: 0;
}

.social-share-toolbar {
  border-bottom: 1px solid #e2e5e8;
  padding: 2px;
}

#social-share-provider-buttons {
  padding: 0;
  margin: 0;
}

.share-provider-button {
  padding: 5px;
  margin: 2px;
}

.share-provider-button > .toolbarbutton-text {
  display: none;
}
.share-provider-button > .toolbarbutton-icon {
  width: 16px;
  min-height: 16px;
  max-height: 16px;
}


toolbarbutton[type="socialmark"] > .toolbarbutton-icon {
  width: auto;
  height: auto;
  max-width: 32px;
  max-height: 24px;
}

/* fixup corners for share panel */
.social-panel > .social-panel-frame {
  border-radius: inherit;
}

#social-share-panel {
  min-height: 100px;
  min-width: 766px;
}

#share-container,
.social-share-frame {
  border-top-left-radius: 0;
  border-bottom-left-radius: inherit;
  border-top-right-radius: 0;
  border-bottom-right-radius: inherit;
}

#social-share-panel > .social-share-toolbar {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

#social-share-provider-buttons {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

/* social recommending panel */

#social-mark-button {
  -moz-image-region: rect(0, 16px, 16px, 0);
}

/* bookmarks menu-button */

#bookmarks-menu-button.bookmark-item {
  list-style-image: url("chrome://browser/skin/places/bookmark.png");
  -moz-image-region: rect(0px 16px 16px 0px);
}

#bookmarks-menu-button.bookmark-item[starred] {
  -moz-image-region: rect(0px 32px 16px 16px);
}

#bookmarks-menu-button.bookmark-item > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
  -moz-margin-start: 5px;
}

#bookmarks-menu-button[cui-areatype="toolbar"]:not(.bookmark-item):not([overflowedItem=true]) > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
  padding-top: 2px;
  padding-bottom: 2px;
}

#BMB_bookmarksPopup[side="top"],
#BMB_bookmarksPopup[side="bottom"] {
  margin-left: -20px;
  margin-right: -20px;
}

#BMB_bookmarksPopup[side="left"],
#BMB_bookmarksPopup[side="right"] {
  margin-top: -20px;
  margin-bottom: -20px;
}

/* bookmarking panel */

#editBookmarkPanelStarIcon {
  list-style-image: url("chrome://browser/skin/places/starred48.png");
  width: 48px;
  height: 48px;
}

#editBookmarkPanelStarIcon[unstarred] {
  list-style-image: url("chrome://browser/skin/places/unstarred48.png");
}

#editBookmarkPanelTitle {
  font-size: 130%;
}

#editBookmarkPanelHeader,
#editBookmarkPanelContent {
  margin-bottom: .5em;
}

/* Implements editBookmarkPanel resizing on folderTree un-collapse. */
#editBMPanel_folderTree {
  min-width: 27em;
}

.panel-promo-box {
  margin: 10px -10px -10px;
  padding: 8px 10px;
  border-top: 1px solid ThreeDShadow;
  background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}

@media (-moz-windows-default-theme) {
  .panel-promo-box {
    border-top-style: none;
    background: #f1f5fb;
    color: GrayText;
    box-shadow: 0px 1px 2px rgb(204,214,234) inset;
  }
}

.panel-promo-icon {
  list-style-image: url("chrome://browser/skin/sync-notification-24.png");
  -moz-margin-end: 10px;
  vertical-align: middle;
}

.panel-promo-closebutton {
  -moz-appearance: none;
  border: none;
  -moz-margin-end: -10px;
  margin-top: -5px;
}

.panel-promo-closebutton > .toolbarbutton-text {
  padding: 0;
}

/* ::::: content area ::::: */

#sidebar {
  background-color: Window;
}

#sidebar-title {
  -moz-padding-start: 0px;
}

#sidebar-header > .close-icon {
  -moz-appearance: none;
  padding: 4px 2px;
  margin: 0;
  border: none;
}

.browserContainer > findbar {
  background-color: -moz-dialog;
  color: -moz-DialogText;
  text-shadow: none;
}

/* Tabstrip */

#TabsToolbar {
  min-height: 0;
  padding: 0;
  margin-bottom: calc(-1 * var(--tab-toolbar-navbar-overlap)); /* overlap the nav-bar's top border */
}

%ifndef WINDOWS_AERO
@media (-moz-windows-default-theme) {
  #main-window[sizemode=normal] #TabsToolbar {
    padding-left: 2px;
    padding-right: 2px;
  }
}
%endif

%include ../shared/tabs.inc.css

@media (min-resolution: 1.25dppx) {
  /* image preloading hack from shared/tabs.inc.css */
  #tabbrowser-tabs::before {
    background-image:
      url(chrome://browser/skin/tabbrowser/tab-background-end@2x.png),
      url(chrome://browser/skin/tabbrowser/tab-background-middle@2x.png),
      url(chrome://browser/skin/tabbrowser/tab-background-start@2x.png);
  }

  .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]),
  .tabs-newtab-button:hover {
    background-image: url(chrome://browser/skin/tabbrowser/tab-background-start@2x.png),
                      url(chrome://browser/skin/tabbrowser/tab-background-middle@2x.png),
                      url(chrome://browser/skin/tabbrowser/tab-background-end@2x.png);
  }

  .tab-background-middle[selected=true] {
    background-image: url(chrome://browser/skin/tabbrowser/tab-active-middle@2x.png),
                      @fgTabTexture@,
                      none;
  }

  .tab-background-start[selected=true]:-moz-locale-dir(ltr)::after,
  .tab-background-end[selected=true]:-moz-locale-dir(rtl)::after {
    background-image: url(chrome://browser/skin/tabbrowser/tab-stroke-start@2x.png);
  }

  .tab-background-end[selected=true]:-moz-locale-dir(ltr)::after,
  .tab-background-start[selected=true]:-moz-locale-dir(rtl)::after {
    background-image: url(chrome://browser/skin/tabbrowser/tab-stroke-end@2x.png);
  }
}

%ifndef WINDOWS_AERO
/* Use lighter colors of buttons and text in the titlebar on luna-blue */
@media (-moz-windows-theme: luna-blue) {
  #tabbrowser-tabs[movingtab] > .tabbrowser-tab[beforeselected]:not([last-visible-tab])::after,
  .tabbrowser-tab:not([selected]):not([afterselected-visible]):not([afterhovered]):not([first-visible-tab]):not(:hover)::before,
  #tabbrowser-tabs:not([overflow]) > .tabbrowser-tab[last-visible-tab]:not([selected]):not([beforehovered]):not(:hover)::after {
    background-image: url("chrome://browser/skin/tabbrowser/tab-separator-luna-blue.png");
  }
}
%endif

#TabsToolbar[brighttext] .tab-close-button:not(:hover):not([selected="true"]) {
  -moz-image-region: rect(0, 64px, 16px, 48px) !important;
}

/* tabbrowser-tab focus ring */
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
  outline: 1px dotted;
}

/* Background tabs:
 *
 * Decrease the height of the hoverable region of background tabs whenever the tabs are at the top
 * of the window (e.g. no menubar, tabs in titlebar, etc.) to make it easier to drag the window by
 * the titlebar. We don't need this in fullscreen since window dragging is not an issue there.
 */
#main-window[tabsintitlebar][sizemode=normal] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar .tab-background-middle:not([selected=true]) {
  clip-path: url(chrome://browser/content/browser.xul#tab-hover-clip-path);
}

/* Tab DnD indicator */
.tab-drop-indicator {
  list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator.png);
  margin-bottom: -9px;
  z-index: 3;
}

/* Tab close button */
.tab-close-button {
  -moz-appearance: none;
  border: none;
}

/* Tab scrollbox arrow, tabstrip new tab and all-tabs buttons */

.tabbrowser-arrowscrollbox > .scrollbutton-up,
.tabbrowser-arrowscrollbox > .scrollbutton-down {
  list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png");
  margin: 0 0 var(--tab-toolbar-navbar-overlap);
}

#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .scrollbutton-up,
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .scrollbutton-down {
  list-style-image: url(chrome://browser/skin/tabbrowser/tab-arrow-left-inverted.png);
}

.tabbrowser-arrowscrollbox > .scrollbutton-up[disabled],
.tabbrowser-arrowscrollbox > .scrollbutton-down[disabled] {
  opacity: .4;
}

.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl),
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-locale-dir(ltr) {
  transform: scaleX(-1);
}

.tabbrowser-arrowscrollbox > .scrollbutton-down {
  transition: 1s background-color ease-out;
}

.tabbrowser-arrowscrollbox > .scrollbutton-down[notifybgtab] {
  background-color: Highlight;
  transition: none;
}

.tabs-newtab-button > .toolbarbutton-icon {
  margin-top: -1px;
  margin-bottom: -1px;
}

.tabs-newtab-button,
#TabsToolbar > #new-tab-button,
#TabsToolbar > toolbarpaletteitem > #new-tab-button {
  list-style-image: url(chrome://browser/skin/tabbrowser/newtab.png);
  -moz-image-region: auto;
}

#TabsToolbar[brighttext] .tabs-newtab-button,
#TabsToolbar[brighttext] > #new-tab-button,
#TabsToolbar[brighttext] > toolbarpaletteitem > #new-tab-button {
  list-style-image: url(chrome://browser/skin/tabbrowser/newtab-inverted.png);
}

#TabsToolbar > #new-tab-button {
  width: 26px;
}

#alltabs-button {
  list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow.png");
}

#TabsToolbar[brighttext] > #alltabs-button,
#TabsToolbar[brighttext] > toolbarpaletteitem > #alltabs-button {
  list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png");
}

#alltabs-button > .toolbarbutton-icon {
  margin: 0 2px;
}

#alltabs-button > .toolbarbutton-menu-dropmarker {
  display: none;
}

/* All tabs menupopup */
.alltabs-item > .menu-iconic-left > .menu-iconic-icon {
  list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
}

.alltabs-item[selected="true"] {
  font-weight: bold;
}

.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon {
  list-style-image: url("chrome://global/skin/icons/loading_16.png");
}

.alltabs-item[tabIsVisible] {
  /* box-shadow instead of background-color to work around native styling */
  box-shadow: inset -5px 0 ThreeDShadow;
}

toolbarbutton.chevron {
  list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
}

toolbar[brighttext] toolbarbutton.chevron {
  list-style-image: url("chrome://global/skin/toolbar/chevron-inverted.png") !important;
}

toolbarbutton.chevron:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

toolbarbutton.chevron > .toolbarbutton-text,
toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
  display: none;
}

toolbarbutton.chevron > .toolbarbutton-icon {
  margin: 0;
}

#sidebar-throbber[loading="true"] {
  list-style-image: url("chrome://global/skin/icons/loading_16.png");
  -moz-margin-end: 4px;
}

/* Bookmarks toolbar */
#PlacesToolbarDropIndicator {
  list-style-image: url(chrome://browser/skin/places/toolbarDropMarker.png);
}

toolbarbutton.bookmark-item[dragover="true"][open="true"] {
  -moz-appearance: none;
  background: Highlight !important;
  color: HighlightText !important;
}

/* rules for menupopup drop indicators */
.menupopup-drop-indicator-bar {
  position: relative;
  /* these two margins must together compensate the indicator's height */
  margin-top: -1px;
  margin-bottom: -1px;
}

.menupopup-drop-indicator {
  list-style-image: none;
  height: 2px;
  -moz-margin-end: -4em;
  background-color: Highlight;
}

/* ::::: Identity Indicator Styling ::::: */

/* Popup Icons */
#identity-popup-icon {
  height: 64px;
  width: 64px;
  padding: 0;
  list-style-image: url("chrome://browser/skin/identity.png");
  -moz-image-region: rect(0px, 64px, 64px, 0px);
}

#identity-popup.verifiedDomain > #identity-popup-container > #identity-popup-icon {
  -moz-image-region: rect(64px, 64px, 128px, 0px);
}

#identity-popup.verifiedIdentity > #identity-popup-container > #identity-popup-icon {
  -moz-image-region: rect(128px, 64px, 192px, 0px);
}

/* Popup Body Text */
.identity-popup-description {
  white-space: pre-wrap;
  -moz-padding-start: 15px;
  margin: 2px 0 4px;
}

.identity-popup-label {
  white-space: pre-wrap;
  -moz-padding-start: 15px;
  margin: 0;
}

#identity-popup-content-host,
#identity-popup-content-box.verifiedIdentity > #identity-popup-content-owner {
  font-size: 1.2em;
}

#identity-popup-content-host {
  margin-top: 3px;
  margin-bottom: 5px;
  font-weight: bold;
  max-width: 300px;
}

#identity-popup-content-owner {
  margin-top: 4px;
  margin-bottom: 0 !important;
  font-weight: bold;
  max-width: 300px;
}

.verifiedDomain > #identity-popup-content-owner {
  font-weight: normal;
}

#identity-popup-content-verifier {
  margin: 4px 0 2px;
}

#identity-popup-content-box.verifiedIdentity > #identity-popup-encryption ,
#identity-popup-content-box.verifiedDomain > #identity-popup-encryption {
  margin-top: 10px;
  -moz-margin-start: -24px;
}

#identity-popup-content-box.verifiedIdentity > #identity-popup-encryption > vbox > #identity-popup-encryption-icon ,
#identity-popup-content-box.verifiedDomain > #identity-popup-encryption > vbox > #identity-popup-encryption-icon {
  list-style-image: url("chrome://browser/skin/Secure24.png");
}

#identity-popup-help-icon {
  -moz-appearance: none;
  border: none;
  margin: 7px 0 0 -3px;
  background: none;
  min-width: 0;
  list-style-image: url("chrome://global/skin/icons/question-16.png");
  cursor: pointer;
}

#identity-popup-help-icon > .button-box > .button-text {
  display: none;
}

#identity-popup-help-icon > .button-box > .button-icon {
  height: 16px;
  width: 16px;
}

#identity-popup-more-info-button {
  margin-top: 6px;
  margin-bottom: 0;
  -moz-margin-end: 0;
}

#identity-popup > .panel-arrowcontainer > .panel-arrowcontent {
  padding: 0;
}

#identity-popup-container {
  min-width: 280px;
  padding: 10px;
}

#identity-popup-button-container {
  background: linear-gradient(to bottom, rgba(0,0,0,0.04) 60%, transparent);
  padding: 10px;
  margin-top: 5px;
}

.popup-notification-icon {
  width: 64px;
  height: 64px;
  -moz-margin-end: 10px;
}

.popup-notification-icon[popupid="geolocation"] {
  list-style-image: url(chrome://browser/skin/Geolocation-64.png);
}

.popup-notification-icon[popupid="xpinstall-disabled"],
.popup-notification-icon[popupid="addon-progress"],
.popup-notification-icon[popupid="addon-install-cancelled"],
.popup-notification-icon[popupid="addon-install-blocked"],
.popup-notification-icon[popupid="addon-install-failed"],
.popup-notification-icon[popupid="addon-install-complete"] {
  list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
  width: 32px;
  height: 32px;
}

.popup-notification-icon[popupid="click-to-play-plugins"] {
  list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
}

.popup-notification-icon[popupid="web-notifications"] {
  list-style-image: url(chrome://browser/skin/notification-64.png);
}

.addon-progress-description {
  width: 350px;
  max-width: 350px;
}

.popup-progress-label,
.popup-progress-meter {
  -moz-margin-start: 0;
  -moz-margin-end: 0;
}

.popup-progress-cancel {
  -moz-appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  min-height: 0;
  min-width: 0;
  list-style-image: url(chrome://mozapps/skin/downloads/downloadButtons.png);
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}

.popup-progress-cancel:hover {
  -moz-image-region: rect(16px, 32px, 32px, 16px);
}

.popup-progress-cancel:active {
  -moz-image-region: rect(32px, 32px, 48px, 16px);
}

.popup-notification-icon[popupid="indexedDB-permissions-prompt"],
.popup-notification-icon[popupid*="offline-app-requested"],
.popup-notification-icon[popupid="offline-app-usage"] {
  list-style-image: url(chrome://global/skin/icons/question-64.png);
}

.popup-notification-icon[popupid="password-save"],
.popup-notification-icon[popupid="password-change"] {
  list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png);
}

.popup-notification-icon[popupid="webapps-install-progress"],
.popup-notification-icon[popupid="webapps-install"] {
  list-style-image: url(chrome://global/skin/icons/webapps-64.png);
}

.popup-notification-icon[popupid="bad-content"] {
  list-style-image: url(chrome://browser/skin/bad-content-blocked-64.png);
}

.popup-notification-icon[popupid="bad-content"][mixedblockdisabled],
.popup-notification-icon[popupid="bad-content"][trackingblockdisabled] {
  list-style-image: url(chrome://browser/skin/bad-content-unblocked-64.png);
}

.popup-notification-icon[popupid="webRTC-sharingDevices"],
.popup-notification-icon[popupid="webRTC-shareDevices"] {
  list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
}

.popup-notification-icon[popupid="webRTC-sharingMicrophone"],
.popup-notification-icon[popupid="webRTC-shareMicrophone"] {
  list-style-image: url(chrome://browser/skin/webRTC-shareMicrophone-64.png);
}

.popup-notification-icon[popupid="webRTC-sharingScreen"],
.popup-notification-icon[popupid="webRTC-shareScreen"] {
  list-style-image: url(chrome://browser/skin/webRTC-shareScreen-64.png);
}

.popup-notification-icon[popupid="pointerLock"] {
  list-style-image: url(chrome://browser/skin/pointerLock-64.png);
}

/* Notification icon box */
#notification-popup-box {
  position: relative;
  background-color: #fff;
  background-clip: padding-box;
  padding-left: 3px;
  border-radius: 2.5px 0 0 2.5px;
  border-width: 0 8px 0 0;
  border-style: solid;
  border-image: url("chrome://browser/skin/urlbar-arrow.png") 0 8 0 0 fill;
  -moz-margin-end: -8px;
}

@conditionalForwardWithUrlbar@ > #forward-button[disabled] + #urlbar > #notification-popup-box {
  padding-left: 7px;
}

#notification-popup-box:-moz-locale-dir(rtl),
.notification-anchor-icon:-moz-locale-dir(rtl) {
  transform: scaleX(-1);
}

.notification-anchor-icon {
  width: 16px;
  height: 16px;
  margin: 0 2px;
}

.notification-anchor-icon:-moz-focusring {
  outline: 1px dotted -moz-DialogText;
}

.default-notification-icon,
#default-notification-icon {
  list-style-image: url(chrome://global/skin/icons/information-16.png);
}

.identity-notification-icon,
#identity-notification-icon {
  list-style-image: url(chrome://mozapps/skin/profile/profileicon.png);
}

.geo-notification-icon,
#geo-notification-icon {
  list-style-image: url(chrome://browser/skin/Geolocation-16.png);
}

#addons-notification-icon {
  list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png);
}

.indexedDB-notification-icon,
#indexedDB-notification-icon {
  list-style-image: url(chrome://global/skin/icons/question-16.png);
}

#password-notification-icon {
  list-style-image: url(chrome://mozapps/skin/passwordmgr/key-16.png);
}

#webapps-notification-icon {
  list-style-image: url(chrome://global/skin/icons/webapps-16.png);
}

#plugins-notification-icon {
  list-style-image: url(chrome://browser/skin/notification-pluginNormal.png);
}
#plugins-notification-icon.plugin-hidden {
  list-style-image: url(chrome://browser/skin/notification-pluginAlert.png);
}

#plugins-notification-icon.plugin-blocked {
  list-style-image: url(chrome://browser/skin/notification-pluginBlocked.png);
}

#plugins-notification-icon {
  -moz-image-region: rect(0, 16px, 16px, 0);
}

#plugins-notification-icon:hover {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

#plugins-notification-icon:active {
  -moz-image-region: rect(0, 48px, 16px, 32px);
}

#notification-popup-box[hidden] {
  /* Override display:none to make the pluginBlockedNotification animation work
     when showing the notification repeatedly. */
  display: -moz-box;
  visibility: collapse;
}

#plugins-notification-icon.plugin-blocked[showing] {
  animation: pluginBlockedNotification 500ms ease 0s 5 alternate both;
}

@keyframes pluginBlockedNotification {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.bad-content-blocked-notification-icon,
#bad-content-blocked-notification-icon {
  list-style-image: url(chrome://browser/skin/bad-content-blocked-16.png);
}

.bad-content-unblocked-notification-icon,
#bad-content-unblocked-notification-icon {
  list-style-image: url(chrome://browser/skin/bad-content-unblocked-16.png);
}

.webRTC-shareDevices-notification-icon,
#webRTC-shareDevices-notification-icon {
  list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
}

.webRTC-sharingDevices-notification-icon,
#webRTC-sharingDevices-notification-icon {
  list-style-image: url(chrome://browser/skin/webRTC-sharingDevice-16.png);
}

.webRTC-shareMicrophone-notification-icon,
#webRTC-shareMicrophone-notification-icon {
  list-style-image: url(chrome://browser/skin/webRTC-shareMicrophone-16.png);
}

.webRTC-sharingMicrophone-notification-icon,
#webRTC-sharingMicrophone-notification-icon {
  list-style-image: url(chrome://browser/skin/webRTC-sharingMicrophone-16.png);
}

.webRTC-shareScreen-notification-icon,
#webRTC-shareScreen-notification-icon {
  list-style-image: url(chrome://browser/skin/webRTC-shareScreen-16.png);
}

.webRTC-sharingScreen-notification-icon,
#webRTC-sharingScreen-notification-icon {
  list-style-image: url(chrome://browser/skin/webRTC-sharingScreen-16.png);
}

.web-notifications-notification-icon,
#web-notifications-notification-icon {
  list-style-image: url(chrome://browser/skin/notification-16.png);
}

#pointerLock-notification-icon {
  list-style-image: url(chrome://browser/skin/pointerLock-16.png);
}
#pointerLock-cancel {
  margin: 0px;
}

/* Translation infobar */

%include ../shared/translation/infobar.inc.css

notification[value="translation"] {
  min-height: 40px;
}

@media (-moz-windows-default-theme) {
  notification[value="translation"],
  notification[value="translation"] button,
  notification[value="translation"] menulist {
    min-height: 30px;
    color: #545454;
  }

  notification[value="translation"] {
    background-color: #EEE;
  }

  notification[value="translation"] button,
  notification[value="translation"] menulist {
    -moz-padding-end: 1ch;
  }

  notification[value="translation"] menulist {
    border: 1px solid #C1C1C1;
    background-color: #FFF;
  }

  notification[value="translation"] button {
    border: 1px solid #C1C1C1;
    background-color: #FBFBFB;
  }

  notification[value="translation"] button,
  notification[value="translation"] menulist,
  notification[value="translation"] menulist > .menulist-label-box {
    -moz-margin-start: 1ch;
    -moz-margin-end: 1ch;
  }

  notification[value="translation"] button:hover,
  notification[value="translation"] button:active,
  notification[value="translation"] menulist:hover,
  notification[value="translation"] menulist:active {
    background-color: #EBEBEB;
  }

  notification[value="translation"] button[anonid="translate"] {
    color: #FFF;
    background-color: #0095DD;
    box-shadow: none;
    border: 1px solid #006B9D;
  }

  notification[value="translation"] button[anonid="translate"]:hover,
  notification[value="translation"] button[anonid="translate"]:active {
    background-color: #008ACB;
  }

  notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker,
  notification[value="translation"] menulist > .menulist-dropmarker {
    list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow.png");
  }

  notification[value="translation"] button > .button-box,
  notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker {
    padding: 0;
    -moz-margin-start: 3ch;
  }

  notification[value="translation"] button:not([type="menu"]) > .button-box {
    -moz-margin-end: 3ch;
  }
}

.translate-notification-icon,
#translate-notification-icon {
  list-style-image: url(chrome://browser/skin/translation-16.png);
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}

.translated-notification-icon,
#translated-notification-icon {
  list-style-image: url(chrome://browser/skin/translation-16.png);
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}

.translation-menupopup {
  -moz-appearance: none;
}

/* Loop/ Hello browser styles */

notification[value="loop-sharing-notification"] .button-menubutton-button {
  -moz-appearance: none;
  min-width: 0;
  border: 0;
  margin: 0;
}

notification[value="loop-sharing-notification"] .messageImage {
  list-style-image: url(chrome://browser/skin/webRTC-shareScreen-16.png);
}

/* Bookmarks roots menu-items */
#subscribeToPageMenuitem:not([disabled]),
#subscribeToPageMenupopup,
#BMB_subscribeToPageMenuitem:not([disabled]),
#BMB_subscribeToPageMenupopup {
  list-style-image: url("chrome://browser/skin/feeds/feedIcon16.png");
}

#bookmarksToolbarFolderMenu,
#BMB_bookmarksToolbar,
#panelMenu_bookmarksToolbar {
  list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png");
  -moz-image-region: auto;
}

#BMB_unsortedBookmarks,
#panelMenu_unsortedBookmarks {
  list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png");
  -moz-image-region: auto;
}

#menu_readingList,
#BMB_readingList {
  list-style-image: url("chrome://browser/skin/readinglist/readinglist-icon.svg");
  -moz-image-region: auto;
}

/* ::::: Keyboard UI Panel ::::: */

.KUI-panel {
  -moz-appearance: none;
  background: rgba(27%,27%,27%,.9) url(KUI-background.png) repeat-x;
  color: white;
  border-style: none;
  border-radius: 20px;
}

.KUI-panel[level="top"] {
  background-color: rgba(27%,27%,27%,.65);
}

/* Ctrl-Tab */

#ctrlTab-panel {
  padding: 20px 10px 10px;
  font-weight: bold;
  text-shadow: 0 0 1px rgb(27%,27%,27%), 0 0 2px rgb(27%,27%,27%);
}

.ctrlTab-favicon[src] {
  background-color: white;
  width: 20px;
  height: 20px;
  padding: 2px;
}

.ctrlTab-preview-inner > .tabPreview-canvas {
  box-shadow: 1px 1px 2px rgb(12%,12%,12%);
}

.ctrlTab-preview:not(#ctrlTab-showAll) > * > .ctrlTab-preview-inner > .tabPreview-canvas {
  margin-bottom: 2px;
}

.ctrlTab-preview-inner {
  padding-bottom: 10px;
}

#ctrlTab-showAll:not(:focus) > * > .ctrlTab-preview-inner {
  padding: 10px;
  background-color: rgba(255,255,255,.2);
  border-radius: .5em;
}

.ctrlTab-preview:focus > * > .ctrlTab-preview-inner {
  color: white;
  background-color: rgba(0,0,0,.6);
  text-shadow: none;
  padding: 8px;
  border: 2px solid white;
  border-radius: .5em;
}

.ctrlTab-preview:not(#ctrlTab-showAll):focus > * > .ctrlTab-preview-inner {
  margin: -10px -10px 0;
}

#ctrlTab-showAll {
  margin-top: .5em;
}

/* Sync Panel */

.sync-panel-icon {
  height:32px;
  width: 32px;
  background: url("chrome://browser/content/abouthome/sync.png") top left no-repeat;
}

.sync-panel-inner {
  width: 0;
  padding-left: 10px;
}

.sync-panel-button-box {
  margin-top: 1em;
}

#sync-error-panel-title,
#sync-start-panel-title {
  font-size: 120%;
  font-weight: bold;
  margin-bottom: 5px;
}

#sync-start-panel-subtitle,
#sync-error-panel-subtitle {
  margin: 0;
}

/* Status panel */

.statuspanel-label {
  margin: 0;
  padding: 2px 4px;
  background: linear-gradient(#fff, #ddd);
  border: 1px none #ccc;
  border-top-style: solid;
  color: #333;
  text-shadow: none;
}

.statuspanel-label:-moz-locale-dir(ltr):not([mirror]),
.statuspanel-label:-moz-locale-dir(rtl)[mirror] {
  border-right-style: solid;
  /* disabled for triggering grayscale AA (bug 659213)
  border-top-right-radius: .3em;
  */
  margin-right: 1em;
}

.statuspanel-label:-moz-locale-dir(rtl):not([mirror]),
.statuspanel-label:-moz-locale-dir(ltr)[mirror] {
  border-left-style: solid;
  /* disabled for triggering grayscale AA (bug 659213)
  border-top-left-radius: .3em;
  */
  margin-left: 1em;
}

#full-screen-warning-message {
  background-image: url("chrome://browser/skin/fullscreen-darknoise.png");
  color: white;
  border-radius: 4px;
  margin-top: 30px;
  padding: 30px 50px;
  box-shadow: 0 0 2px white;
}

#full-screen-warning-container[obscure-browser] {
  background-color: rgba(0,0,0,0.3);
}

.full-screen-description {
  font-size: 150%;
}

#full-screen-domain-text {
  font-size: 300%;
}

.full-screen-approval-button,
#full-screen-remember-decision {
  font-size: 120%;
}

%include ../shared/devtools/responsivedesign.inc.css
%include ../shared/devtools/commandline.inc.css
%include ../shared/plugin-doorhanger.inc.css
%include ../shared/badcontent-doorhanger.inc.css

%include downloads/indicator.css

/* Error counter */

#developer-toolbar-toolbox-button[error-count]:before {
  color: #FDF3DE;
  min-width: 16px;
  text-shadow: none;
  background-image: linear-gradient(#B4211B, #8A1915);
  border-radius: 1px;
  -moz-margin-end: 5px;
}

/* Social toolbar item */

#switch-to-metro-button[cui-areatype="toolbar"] {
  list-style-image: url(chrome://browser/skin/Metro_Glyph.png);
}

toolbar[brighttext] #switch-to-metro-button[cui-areatype="toolbar"] {
  list-style-image: url(chrome://browser/skin/Metro_Glyph-inverted.png);
}

#switch-to-metro-button[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] > #switch-to-metro-button {
  list-style-image: url(chrome://browser/skin/Metro_Glyph-menuPanel.png);
}

.popup-notification-icon[popupid="servicesInstall"] {
  list-style-image: url(chrome://browser/skin/social/services-64.png);
}
#servicesInstall-notification-icon {
  list-style-image: url(chrome://browser/skin/social/services-16.png);
}
#social-undoactivation-button {
  -moz-margin-start: 0; /* override default label margin to match description margin */
}

#socialActivatedNotification .popup-notification-button-container {
  margin-left: 6px;
}

.social-activation-icon {
  width: auto;
  height: auto;
  max-height: 64px;
  max-width: 64px;
}

#social-activation-message {
  max-width: 250px;
}

#social-activation-message > label {
  margin: 0;
}

/* social toolbar provider menu */
.social-statusarea-popup {
  margin-top: 0;
  margin-left: -12px;
  margin-right: -12px;
}

.social-statusarea-user {
  -moz-appearance: none;
  border-bottom: 1px solid rgb(221,221,221);
  background-color: -moz-Dialog;
  position: relative;
  cursor: pointer;
  list-style-image:url("chrome://global/skin/icons/information-32.png");
}

.social-statusarea-user-portrait {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  margin: 10px;
}

.social-statusarea-loggedInStatus {
  -moz-appearance: none;
  background: transparent;
  border: none;
  color: -moz-nativehyperlinktext;
  min-width: 0;
  margin: 0 6px;
  list-style-image: none;
}

.social-statusarea-user[_moz-menuactive] > vbox > .social-statusarea-loggedInStatus {
  text-decoration: underline;
}

.social-panel > .panel-arrowcontainer > .panel-arrowcontent {
  padding: 0;
}

.social-panel-frame {
  border-radius: inherit;
}

%include ../shared/social/chat.inc.css

.chat-titlebar {
  background-color: #c4cfde;
  background-image: linear-gradient(rgba(255,255,255,.5), transparent);
}

.chat-titlebar[selected] {
  background-color: #dae3f0;
}

.chatbar-button {
  -moz-appearance: none;
  background-color: #c4cfde;
  background-image: linear-gradient(rgba(255,255,255,.5), transparent);
}

.chatbar-button > .toolbarbutton-icon {
  -moz-margin-end: 0;
}

.chatbar-button:hover,
.chatbar-button[open="true"] {
  background-color: #dae3f0;
}

.chatbar-button[activity]:not([open="true"]) {
  background-image: radial-gradient(circle farthest-corner at center 3px, rgb(255,255,255) 3%, rgba(186,221,251,0.75) 40%, rgba(127,179,255,0.5) 80%, rgba(127,179,255,0.25));
}

chatbox {
  border-top-left-radius: 2.5px;
  border-top-right-radius: 2.5px;
}

/* EME notifications */

.popup-notification-icon[popupid="drmContentPlaying"],
#eme-notification-icon {
  list-style-image: url("chrome://browser/skin/drm-icon.svg#chains");
}

#eme-notification-icon:hover:active {
  list-style-image: url("chrome://browser/skin/drm-icon.svg#chains-pressed");
}

#eme-notification-icon[firstplay=true] {
  animation: emeTeachingMoment 0.2s linear 0s 5 normal;
}

@keyframes emeTeachingMoment {
  0% {transform: translateX(0); }
  25% {transform: translateX(3px) }
  75% {transform: translateX(-3px) }
  100% { transform: translateX(0); }
}

/* Customization mode */

%include ../shared/customizableui/customizeMode.inc.css

/**
 * This next rule is a hack to disable subpixel anti-aliasing on all
 * labels during the customize mode transition. Subpixel anti-aliasing
 * on Windows with Direct2D layers acceleration is particularly slow to
 * paint, so this hack is how we sidestep that performance bottleneck.
 */
#main-window:-moz-any([customize-entering],[customize-exiting]) label {
  transform: perspective(0.01px);
}

#main-window[customize-entered] > #tab-view-deck {
  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png");
  background-attachment: fixed;
}

#main-window[customization-lwtheme] > #tab-view-deck:-moz-lwtheme {
  background-repeat: no-repeat;
  background-position: right top;
  background-attachment: fixed;
  /* The image will get set from CustomizeMode.jsm */
  background-image: none;
  background-color: transparent;
}

#main-window[customization-lwtheme]:-moz-lwtheme {
  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png");
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: left top;
}

#main-window[customize-entered] #browser-bottombox,
#main-window[customize-entered] #customization-container {
  border-left: 1px solid @toolbarShadowColor@;
  border-right: 1px solid @toolbarShadowColor@;
  background-clip: padding-box;
}

#main-window[customize-entered] #browser-bottombox {
  border-bottom: 1px solid @toolbarShadowColor@;
}

#customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="left"] {
  margin-right: -2px;
}

#customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="right"] {
  margin-left: -2px;
}

/* End customization mode */

/* Private browsing indicators */

/**
 * Currently, we have two places where we put private browsing indicators on
 * Windows. When tabsintitlebar is enabled, we draw the indicator in the titlebar.
 * When tabsintitlebar is disabled, we draw the indicator at the end of the
 * tabstrip. The titlebar indicator is the fiddliest of the bunch, since we
 * want the bottom border of the image to line up with the bottom of the window
 * caption buttons. That's why there's so much special-casing going on in here.
 */
.private-browsing-indicator {
  display: none;
  pointer-events: none;
}

#private-browsing-indicator-titlebar {
  display: block;
  position: absolute;
}

#main-window[privatebrowsingmode=temporary][tabsintitlebar] #private-browsing-indicator-titlebar > .private-browsing-indicator {
  display: block;
}

#main-window[privatebrowsingmode=temporary]:-moz-any([inFullscreen],:not([tabsintitlebar])) #TabsToolbar > .private-browsing-indicator {
  display: -moz-box;
}

#TabsToolbar > .private-browsing-indicator {
  background: url("chrome://browser/skin/privatebrowsing-mask-tabstrip.png") no-repeat center -3px;
  -moz-margin-start: 4px;
  width: 48px;
}

/* Bug 1008183: We're intentionally using the titlebar asset here for fullscreen
 * mode, since the tabstrip "mimics" the titlebar in that case with its own
 * min/max/close window buttons.
 */
#private-browsing-indicator-titlebar > .private-browsing-indicator,
#main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
  background: url("chrome://browser/skin/privatebrowsing-mask-titlebar.png") no-repeat center 0px;
  -moz-margin-end: 4px;
  width: 40px;
  height: 20px;
  position: relative;
}

%ifndef WINDOWS_AERO
#TabsToolbar > .private-browsing-indicator {
  background-image: url("chrome://browser/skin/privatebrowsing-mask-tabstrip-XPVista7.png");
}

@media not all and (-moz-windows-classic) {
  #private-browsing-indicator-titlebar > .private-browsing-indicator {
    background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7-tall.png");
    height: 28px;
  }

  /* We're intentionally using the titlebar asset here for fullscreen mode.
   * See bug 1008183.
   */
  #main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
    background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7.png");
  }

  #main-window[sizemode="maximized"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
    top: -5px;
  }
  #main-window[sizemode="normal"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
    top: -1px;
  }
}
%endif

@media (-moz-windows-classic) {
  /* We're intentionally using the titlebar asset here for fullscreen mode.
   * See bug 1008183.
   */
  #private-browsing-indicator-titlebar > .private-browsing-indicator,
  #main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
    background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7.png");
  }
  /**
   * We have to use top instead of background-position in this case, otherwise
   * the bottom of the indicator would get cut off by the bounds of the
   * private-browsing-indicator element.
   */
  #main-window[sizemode="normal"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
    top: 4px;
  }
}

/* End private browsing indicators */

%include ../shared/UITour.inc.css

#UITourTooltipButtons {
  margin: 24px -4px -4px;
}

%include ../shared/contextmenu.inc.css

#context-navigation {
  background-color: menu;
  padding-bottom: 4px;
}

#context-sep-navigation {
  -moz-margin-start: -28px;
  margin-top: -4px;
}
