/* 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/");

%include shared.inc
%define toolbarButtonPressed :hover:active:not([disabled="true"]):not([cui-areatype="menu-panel"])

@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.css

:root {
  --toolbarbutton-vertical-text-padding: calc(var(--toolbarbutton-inner-padding) + 1px);

%ifdef MOZ_PHOTON_THEME
  --toolbarbutton-border-radius: 4px;
%else
  --space-above-tabbar: 9px;

  --toolbarbutton-border-radius: 3px;

  --toolbarbutton-hover-background: hsla(0,0%,100%,.1) linear-gradient(hsla(0,0%,100%,.3), hsla(0,0%,100%,.1)) padding-box;
  --toolbarbutton-active-background: hsla(0,0%,0%,.02) linear-gradient(hsla(0,0%,0%,.12), transparent) border-box;

  --backbutton-border-color: rgba(0,0,0,0.2);
  --backbutton-background: linear-gradient(rgba(255,255,255,0.9),
                                           rgba(255,255,255,0.7)) repeat-x;

  --toolbarbutton-hover-bordercolor: hsla(0,0%,0%,.2);
  --toolbarbutton-hover-boxshadow: 0 1px 0 hsla(0,0%,100%,.5),
                                   0 1px 0 hsla(0,0%,100%,.5) inset;

  --toolbarbutton-active-bordercolor: hsla(0,0%,0%,.3);
  --toolbarbutton-active-boxshadow: 0 1px 0 hsla(0,0%,100%,.5),
                                    0 1px 0 hsla(0,0%,0%,.05) inset,
                                    0 1px 1px hsla(0,0%,0%,.2) inset;

  --toolbarbutton-checkedhover-backgroundcolor: hsla(0,0%,0%,.09);
%endif

  --urlbar-dropmarker-url: url("chrome://browser/skin/urlbar-history-dropmarker.png");
  --urlbar-dropmarker-region: rect(0, 11px, 14px, 0);
  --urlbar-dropmarker-active-region: rect(0, 22px, 14px, 11px);
  --urlbar-dropmarker-2x-url: url("chrome://browser/skin/urlbar-history-dropmarker@2x.png");
  --urlbar-dropmarker-2x-region: rect(0, 22px, 28px, 0);
  --urlbar-dropmarker-active-2x-region: rect(0, 44px, 28px, 22px);

  --panel-separator-color: hsla(210,4%,10%,.14);
  --arrowpanel-dimmed: hsla(210,4%,10%,.07);
  --arrowpanel-dimmed-further: hsla(210,4%,10%,.12);
  --arrowpanel-dimmed-even-further: hsla(210,4%,10%,.17);

  --urlbar-separator-color: hsla(0,0%,16%,.2);
}

%ifndef MOZ_PHOTON_THEME
toolbar:-moz-lwtheme {
  --backbutton-background: linear-gradient(rgba(255,255,255,0.5),
                              rgba(255,255,255,0.2) 50%,
                              rgba(255,255,255,0.1) 50%,
                              rgba(255,255,255,0.2)) repeat-x;
}

#urlbar:-moz-lwtheme:not([focused="true"]),
.searchbar-textbox:-moz-lwtheme:not([focused="true"]) {
  opacity: .9;
}
%endif

#navigator-toolbox::after {
  -moz-box-ordinal-group: 101; /* tabs toolbar is 100 */
  content: "";
  display: -moz-box;
  border-top: 1px solid hsla(0,0%,100%,.15);
  border-bottom: 1px solid hsla(0,0%,0%,.15);
  margin-top: -2px;
  position: relative;
  z-index: 2; /* navbar is at 1 */
}

@media (-moz-mac-yosemite-theme) {
  #navigator-toolbox:-moz-window-inactive::after {
    border-top-style: none;
    border-bottom-color: hsla(0,0%,0%,.1);
    margin-top: -1px;
  }
}

#navigator-toolbox toolbarbutton:-moz-lwtheme {
  color: inherit;
  text-shadow: inherit;
}

#main-window {
  -moz-appearance: none;
  background-color: #eeeeee;
}

/** Begin titlebar **/

#titlebar-buttonbox > .titlebar-button {
  display: none;
}

/* NB: these would be margin-inline-start/end if it wasn't for the fact that OS X
 * doesn't reverse the order of the items in the titlebar in RTL mode. */
.titlebar-placeholder[type="caption-buttons"],
#titlebar-buttonbox {
  margin-left: 7px;
}

.titlebar-placeholder[type="fullscreen-button"],
#titlebar-secondary-buttonbox {
  margin-right: 7px;
  margin-left: 7px;
}

#main-window:not(:-moz-lwtheme) > #titlebar {
  -moz-appearance: -moz-window-titlebar;
}

#main-window:not([tabsintitlebar]) > #titlebar {
  -moz-appearance: -moz-window-titlebar;
  height: 22px; /* The native titlebar on OS X is 22px tall. */
}

/**
 * For tabs in titlebar on OS X, we stretch the titlebar down so that the
 * tabstrip can overlap it.
 */
#main-window[tabsintitlebar] > #titlebar {
%ifndef MOZ_PHOTON_THEME
  min-height: calc(var(--tab-min-height) + var(--space-above-tabbar) - var(--tab-toolbar-navbar-overlap));
%else
  min-height: calc(var(--tab-min-height) - var(--tab-toolbar-navbar-overlap));
%endif
}

/**
 * We also vertically center the window buttons.
 */
#titlebar-buttonbox-container {
  -moz-box-align: start;
}

#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-buttonbox-container,
#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button {
%ifdef MOZ_PHOTON_THEME
  margin-top: 6px;
%else
  margin-top: 11px;
%endif
}

#main-window:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-buttonbox-container,
#main-window:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button {
  margin-top: 3px;
}

%ifndef MOZ_PHOTON_THEME
#main-window[customize-entered] > #titlebar {
  -moz-appearance: none;
}
%endif

/** End titlebar **/

#main-window[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] {
  border-top: 1px solid rgba(0,0,0,0.65);
}

%ifdef MOZ_PHOTON_THEME
#navigator-toolbox > toolbar:not(#TabsToolbar):not(:-moz-lwtheme) {
  -moz-appearance: none;
  background: var(--toolbar-background-color);
}
%else
#navigator-toolbox > toolbar:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
  -moz-appearance: none;
  background: url(chrome://browser/skin/Toolbar-background-noise.png) hsl(0,0%,83%);
}

/* remove noise texture on Yosemite */
@media (-moz-mac-yosemite-theme) {
  #navigator-toolbox > toolbar:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
    background-image: none;
  }

  #navigator-toolbox > toolbar:-moz-window-inactive:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
    background-color: hsl(0,0%,95%);
  }
}
%endif

#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;
}

%ifndef MOZ_PHOTON_THEME
#nav-bar {
  -moz-appearance: none;
  background: url(chrome://browser/skin/Toolbar-background-noise.png),
              linear-gradient(hsl(0,0%,93%), hsl(0,0%,83%));
  background-clip: border-box;
  background-origin: border-box !important;

  /* Move the noise texture out of the top 1px strip because that overlaps
     with the tabbar and we don't want to repaint it when animating tabs.
     The noise image is at least 100px high, so repeating it only horizontally
     is enough. */
  background-repeat: repeat-x, no-repeat;
  background-position: 0 1px, 0 0;

  box-shadow: inset 0 1px 0 hsla(0,0%,100%,.4);
}

@media (min-resolution: 2dppx) {
  #nav-bar {
    background-size: 100px 100px, auto;
  }
}

/* remove noise texture on Yosemite */
@media (-moz-mac-yosemite-theme) {
  #nav-bar {
    background: linear-gradient(hsl(0,0%,93%), hsl(0,0%,83%));
  }

  #nav-bar:-moz-window-inactive {
    background: linear-gradient(hsl(0,0%,97%), hsl(0,0%,95%));
  }
}
%endif

/* Draw the bottom border of the tabs toolbar when it's not using
   -moz-appearance: toolbar. */
#main-window:-moz-any([sizemode="fullscreen"],[customize-entered]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
#main-window:not([tabsintitlebar]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
#TabsToolbar:not([collapsed="true"]) + #nav-bar:-moz-lwtheme {
  border-top: 1px solid hsla(0,0%,0%,.3);
  background-clip: padding-box;
  margin-top: calc(-1 * var(--navbar-tab-toolbar-highlight-overlap));
  /* Position the toolbar above the bottom of background tabs */
  position: relative;
  z-index: 1;
}

/* Always draw a border on Yosemite to ensure the border is well-defined there
 * (the default border is too light). */
@media (-moz-mac-yosemite-theme) {
  #main-window[tabsintitlebar] #TabsToolbar:not([collapsed="true"]) + #nav-bar:not(:-moz-lwtheme) {
    border-top: 1px solid hsla(0,0%,0%,.2);
    background-clip: padding-box;
    margin-top: calc(-1 * var(--navbar-tab-toolbar-highlight-overlap));
    /* Position the toolbar above the bottom of background tabs */
    position: relative;
    z-index: 1;
  }

  #main-window[tabsintitlebar] #TabsToolbar:not([collapsed="true"]) + #nav-bar:-moz-window-inactive:not(:-moz-lwtheme) {
    border-top-color: hsla(0,0%,0%,.05);
  }
}

#TabsToolbar:not([collapsed="true"]) + #nav-bar {
  /* The toolbar buttons that animate are only visible when the #TabsToolbar is not collapsed.
     The animations use position:absolute and require a positioned #nav-bar. */
  position: relative;
}

#PersonalToolbar {
  padding: 0 4px 4px;
}

#PersonalToolbar:not([collapsed=true]) {
  /* 4px padding ^  plus 19px personal-bookmarks (see below) */
  min-height: 23px;
}

%ifndef MOZ_PHOTON_THEME
#navigator-toolbox > toolbar:not(#TabsToolbar):-moz-lwtheme {
  background-color: @toolbarColorLWT@;
  background-image: url(chrome://browser/skin/Toolbar-background-noise.png);
}
%endif

#PersonalToolbar:not(:-moz-lwtheme):-moz-window-inactive,
#nav-bar:not(:-moz-lwtheme):-moz-window-inactive {
  background-color: -moz-mac-chrome-inactive;
}

/* ----- BOOKMARK TOOLBAR ----- */

#personal-bookmarks {
  min-height: 19px; /* 16px button height + 2px padding + 1px margin-bottom */
}

#nav-bar-customization-target > #wrapper-personal-bookmarks > #personal-bookmarks {
  min-height: 32px;
  -moz-box-align: center;
}

toolbarbutton.chevron {
  list-style-image: url("chrome://global/skin/icons/chevron.png");
  margin: 1px 0 0;
  padding: 0;
}

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

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

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

@media (min-resolution: 2dppx) {
  toolbarbutton.chevron {
    list-style-image: url("chrome://global/skin/icons/chevron@2x.png");
  }

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

  toolbarbutton.chevron > .toolbarbutton-icon {
    width: 13px;
  }
}

/* ----- BOOKMARK BUTTONS ----- */

.bookmark-item[container] {
  list-style-image: url("chrome://global/skin/tree/folder.png");
}

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

.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");
}

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

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

.bookmark-item[query][hostContainer] {
  list-style-image: url("chrome://global/skin/tree/folder.png");
}

.bookmark-item[query][hostContainer][open] {
  list-style-image: url("chrome://global/skin/tree/folder.png");
}

@media (min-resolution: 2dppx) {
  .bookmark-item[container] {
    list-style-image: url("chrome://global/skin/tree/folder@2x.png");
  }

  .bookmark-item[container][livemark] {
    list-style-image: url("chrome://browser/skin/page-livemarks@2x.png");
  }

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

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

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

  .bookmark-item[query][dayContainer] {
    list-style-image: url("chrome://browser/skin/places/history@2x.png");
  }

  .bookmark-item[query][hostContainer] {
    list-style-image: url("chrome://global/skin/tree/folder@2x.png");
  }

  .bookmark-item[query][hostContainer][open] {
    list-style-image: url("chrome://global/skin/tree/folder@2x.png");
  }
}

/* Workaround for native menubar inheritance */
.openintabs-menuitem,
.openlivemarksite-menuitem,
.livemarkstatus-menuitem {
  list-style-image: none;
}

.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;
}

#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;
}

@media (min-resolution: 2dppx) {
  #bookmarks-toolbar-placeholder {
    list-style-image: url("chrome://browser/skin/places/bookmarksToolbar@2x.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@2x.png") !important;
  }

  #bookmarks-toolbar-placeholder > .toolbarbutton-icon {
    width: 16px;
  }
}

/* ----- BOOKMARK MENUS ----- */

.bookmark-item > .menu-iconic-left > .menu-iconic-icon {
  width: 16px;
  height: 16px;
}

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

#menu_unsortedBookmarks,
#BMB_unsortedBookmarks,
#panelMenu_unsortedBookmarks {
  list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.png");
}

@media (min-resolution: 2dppx) {
  #bookmarksToolbarFolderMenu,
  #BMB_bookmarksToolbar {
    list-style-image: url("chrome://browser/skin/places/bookmarksToolbar@2x.png");
  }

  #BMB_unsortedBookmarks {
    list-style-image: url("chrome://browser/skin/places/unfiledBookmarks@2x.png");
  }
}

%include ../shared/bookmarked-notification.inc.css

%include ../shared/toolbarbuttons.inc.css
%include ../shared/toolbarbutton-icons.inc.css
%include ../shared/menupanel.inc.css

/* Override OSX-specific toolkit findbar button styles */
.findbar-button {
  background: none;
  box-shadow: none;
  border: none;
}

/* On Mac, native buttons keep their full opacity when they become disabled
 * and only the glyph or text on top of them becomes less opaque. */
#back-button[disabled="true"] > .toolbarbutton-icon {
  opacity: 1 !important;
  -moz-context-properties: fill, fill-opacity;
  fill-opacity: 0.4;
}

/* Inactive elements are faded out on OSX */
.toolbarbutton-1:not(:hover):-moz-window-inactive,
#main-window:not([customizing]) .toolbarbutton-1:-moz-window-inactive[disabled="true"] {
  opacity: 0.5;
}

.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;
}

%ifndef MOZ_PHOTON_THEME
@media (-moz-mac-yosemite-theme) {
  #forward-button > .toolbarbutton-icon {
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: 0 .5px 0 0 rgba(0,0,0,0.2) !important;
  }
  #forward-button:-moz-window-inactive > .toolbarbutton-icon {
    box-shadow: 0 1px 0 0 rgba(0,0,0,0.2) inset,
                0 -1px 0 0 rgba(0,0,0,0.2) inset !important;
  }
}
%endif

/* ----- FULLSCREEN WINDOW CONTROLS ----- */

#minimize-button,
#close-button,
#fullscreen-button ~ #window-controls > #restore-button {
  display: none;
}

/* ::::: nav-bar-inner ::::: */

%include ../shared/urlbar-searchbar.inc.css

%ifdef MOZ_PHOTON_THEME

#urlbar,
.searchbar-textbox {
  font-size: 1.25em;
}

/* Ensure diacritics and other edge-of-font-box glyphs do not get clipped,
 * even in non-Latin scripts. */
html|input.urlbar-input {
  line-height: 1.745em;
}

#urlbar[focused="true"],
.searchbar-textbox[focused="true"] {
  border-color: -moz-mac-focusring;
  box-shadow: var(--focus-ring-box-shadow);
}

%else

#urlbar,
.searchbar-textbox {
  font: icon;
  -moz-appearance: none;
  box-shadow: 0 1px 0 hsla(0,0%,100%,.2),
              inset 0 0 1px hsla(0,0%,0%,.05),
              inset 0 1px 2px hsla(0,0%,0%,.1);
  margin: 0 4px;
  padding: 1px 0;
  border: 1px solid;
  background-image: linear-gradient(hsl(0,0%,97%), hsl(0,0%,100%));
  border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.25) hsla(0,0%,0%,.15);
  background-clip: padding-box;
}

#urlbar[readonly] {
  background-color: -moz-field;
}

@media (-moz-mac-yosemite-theme) {
  .searchbar-textbox,
  #urlbar {
    border-color: #fff;
    border-radius: 3px;
    box-shadow: 0 .5px 0 0 rgba(0,0,0,0.2);
    background-image: none;
  }
  .searchbar-textbox:-moz-window-inactive,
  #urlbar:-moz-window-inactive {
    box-shadow: none;
    border-color: rgba(0,0,0,0.1);
  }
}

#urlbar[focused="true"],
.searchbar-textbox[focused="true"] {
  border-color: -moz-mac-focusring;
  box-shadow: var(--focus-ring-box-shadow);
}

#urlbar {
  border-radius: var(--toolbarbutton-border-radius);
}

@conditionalForwardWithUrlbar@ > #urlbar {
  border-inline-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");
  margin-inline-start: calc(-1 * var(--backbutton-urlbar-overlap));
}

@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;
}
%endif

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

%ifndef MOZ_PHOTON_THEME
#identity-box {
  padding-top: 2px;
  padding-bottom: 2px;
}

#urlbar:not([focused="true"]) > #identity-box {
  margin-top: -1px;
  margin-bottom: -1px;
  padding-top: 3px;
  padding-bottom: 3px;
}

@media (-moz-mac-yosemite-theme) {
  #urlbar:not([focused="true"]):not(:-moz-window-inactive) > #identity-box {
    margin-top: -2px;
    margin-bottom: -2px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}
%endif

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

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

#identity-box:not(:active):-moz-focusring {
  box-shadow: var(--focus-ring-box-shadow);
  border-inline-end-style: none;
  padding-inline-end: 5px;
}
.urlbar-input-box {
  margin: 0;
  padding: 3px 0 2px;
}
.urlbar-history-dropmarker {
  padding: 0 3px;
  list-style-image: var(--urlbar-dropmarker-url);
  -moz-image-region: var(--urlbar-dropmarker-region);
  transition: opacity 0.15s ease;
}
#urlbar-wrapper[switchingtabs] > #urlbar > .urlbar-textbox-container > .urlbar-history-dropmarker {
  transition: none;
}

#navigator-toolbox:not(:hover) #nav-bar:not([customizing="true"]) #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
  opacity: 0;
}

.urlbar-history-dropmarker[open="true"],
.urlbar-history-dropmarker:hover:active {
  -moz-image-region: var(--urlbar-dropmarker-active-region);
}

@media (min-resolution: 2dppx) {
  .urlbar-history-dropmarker {
    list-style-image: var(--urlbar-dropmarker-2x-url);
    -moz-image-region: var(--urlbar-dropmarker-2x-region);
  }

  .urlbar-history-dropmarker[open="true"],
  .urlbar-history-dropmarker:hover:active {
    -moz-image-region: var(--urlbar-dropmarker-active-2x-region);
  }

  .urlbar-history-dropmarker > .dropmarker-icon {
    width: 11px;
  }
}

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

.urlbar-icon {
  padding: 0 3px;
  /* 16x16 icon with border-box sizing */
  width: 22px;
  height: 16px;
}

/* ::::: URL Bar Zoom Reset Button ::::: */
@keyframes urlbar-zoom-reset-pulse {
  0% {
    transform: scale(0);
  }
  75% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1.0);
  }
}

#urlbar-search-footer {
  border-top: 1px solid var(--panel-separator-color);
  background-color: var(--arrowpanel-dimmed);
}

#urlbar-search-settings {
  -moz-appearance: none;
  -moz-user-focus: ignore;
  color: GrayText;
  margin: 0;
  padding: 8px 20px;
}

#urlbar-search-settings:hover {
  background-color: var(--arrowpanel-dimmed);
}

#urlbar-search-settings:hover:active {
  background-color: var(--arrowpanel-dimmed-further);
}

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

#wrapper-urlbar-container[place="palette"] {
  max-width: 20em;
}

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

%include ../shared/urlbarSearchSuggestionsNotification.inc.css

/* ----- AUTOCOMPLETE ----- */

%include ../shared/autocomplete.inc.css

#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
  border-top: 1px solid #C7C7C7;
}

#treecolAutoCompleteImage {
  max-width: 36px;
}

.autocomplete-richlistbox {
  padding: 4px;
}

.autocomplete-richlistitem {
  height: 30px;
  min-height: 30px;
  font: message-box;
  border-radius: 2px;
  border: 1px solid transparent;
}

.autocomplete-richlistitem:hover,
treechildren.searchbar-treebody::-moz-tree-row(hover) {
  background-color: hsla(0, 0%, 0%, 0.06);
  border-color: hsla(0, 0%, 0%, 0.1);
}

.autocomplete-richlistitem[selected],
treechildren.searchbar-treebody::-moz-tree-row(selected) {
  background-color: Highlight;
  color: HighlightText;
}

.ac-title {
  font-size: 14px;
}

.ac-separator,
.ac-url,
.ac-action,
.ac-tags {
  font-size: 12px;
}

html|span.ac-tag {
  background-color: hsl(216, 0%, 88%);
  color: hsl(0, 0%, 0%);
  border-radius: 2px;
  border: 1px solid transparent;
  padding: 0 1px;
}

.ac-separator:not([selected=true]) {
  color: hsl(0, 0%, 50%);
}

.ac-url:not([selected=true]) {
  color: hsl(210, 77%, 47%);
}

.ac-action:not([selected=true]) {
  color: hsl(178, 100%, 28%);
}

.ac-tags-text[selected] > html|span.ac-tag {
  background-color: hsl(0, 0%, 100%);
  color: hsl(210, 80%, 40%);
}

html|span.ac-emphasize-text-title,
html|span.ac-emphasize-text-tag,
html|span.ac-emphasize-text-url {
  font-weight: 600;
}

.ac-type-icon[type=bookmark] {
  list-style-image: url("chrome://browser/skin/bookmark.svg");
  -moz-context-properties: fill;
  fill: #b2b2b2;
}

.ac-type-icon[type=bookmark][selected][current] {
  fill: white;
}

.ac-type-icon[type=keyword],
.ac-site-icon[type=searchengine] {
  list-style-image: url(chrome://global/skin/icons/autocomplete-search.svg);
  -moz-context-properties: fill;
  fill: GrayText;
}

.ac-type-icon[type=keyword][selected],
.ac-site-icon[type=searchengine][selected] {
  fill: highlighttext;
}

.ac-type-icon[type=switchtab],
.ac-type-icon[type=remotetab] {
  list-style-image: url("chrome://browser/skin/urlbar-tab.svg");
  -moz-context-properties: fill;
  fill: #b2b2b2;
}

.ac-type-icon[type=switchtab][selected],
.ac-type-icon[type=remotetab][selected] {
  fill: white;
}

.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;
}


%ifndef MOZ_PHOTON_THEME
/* ----- COMBINED GO/RELOAD/STOP BUTTON IN LOCATION BAR ----- */

#urlbar-go-button,
#reload-button,
#stop-button {
  margin: 0;
  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
  padding: 0 9px;
  margin-inline-start: 5px;
  border-inline-start: 1px solid var(--urlbar-separator-color);
  border-image: linear-gradient(transparent 15%,
                                var(--urlbar-separator-color) 15%,
                                var(--urlbar-separator-color) 85%,
                                transparent 85%);
  border-image-slice: 1;
}

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

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

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

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

#reload-button:not([disabled]):hover:active {
  -moz-image-region: rect(14px, 14px, 28px, 0);
}

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

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

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

@media (min-resolution: 2dppx) {
  #urlbar-go-button,
  #reload-button,
  #stop-button {
    list-style-image: url("chrome://browser/skin/reload-stop-go@2x.png");
  }

  #urlbar-go-button > .toolbarbutton-icon,
  #reload-button > .toolbarbutton-icon,
  #stop-button > .toolbarbutton-icon {
    width: 14px;
  }

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

  #urlbar-go-button:hover:active {
    -moz-image-region: rect(28px, 84px, 56px, 56px);
  }

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

  #reload-button:not([disabled]):hover:active {
    -moz-image-region: rect(28px, 28px, 56px, 0);
  }

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

  #stop-button:hover:active {
    -moz-image-region: rect(28px, 56px, 56px, 28px);
  }
}
%endif

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

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

/* 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:active,
#page-report-button[open="true"] {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

@media (min-resolution: 2dppx) {
  #page-report-button {
    list-style-image: url("chrome://browser/skin/urlbar-popup-blocked@2x.png");
    -moz-image-region: rect(0, 32px, 32px, 0);
  }

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

/* 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:active {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

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

/* 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");
}

@media (min-resolution: 2dppx) {
  #editBookmarkPanelStarIcon {
    list-style-image: url("chrome://browser/skin/places/starred48@2x.png");
    -moz-image-region: rect(0px 96px 96px 0px);
  }
}

#editBookmarkPanelTitle {
  font-size: 130%;
  font-weight: bold;
}

#editBMPanel_rows > row {
  margin-bottom: 8px;
}

#editBMPanel_rows > row:last-of-type {
  margin-bottom: 0;
}

/**** Input elements ****/

#editBMPanel_rows > row > textbox,
#editBMPanel_rows > row > hbox > textbox {
  -moz-appearance: none;
  background: linear-gradient(#fafafa, #fff);
  background-clip: padding-box;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,.3) !important;
  box-shadow: inset 0 1px 1px 1px rgba(0,0,0,.05),
              0 1px rgba(255,255,255,.3);
  margin: 0;
  padding: 3px 6px;
}

#editBMPanel_rows > row > textbox[focused="true"],
#editBMPanel_rows > row > hbox > textbox[focused="true"] {
  border-color: -moz-mac-focusring !important;
  box-shadow: var(--focus-ring-box-shadow);
}

/**** HUD style buttons ****/

.editBookmarkPanelHeaderButton,
.editBookmarkPanelBottomButton {
  @hudButton@
  margin: 0;
  min-width: 82px;
  min-height: 22px;
}

.editBookmarkPanelHeaderButton:hover:active,
.editBookmarkPanelBottomButton:hover:active {
  @hudButtonPressed@
}

.editBookmarkPanelHeaderButton:-moz-focusring,
.editBookmarkPanelBottomButton:-moz-focusring {
  box-shadow: var(--focus-ring-box-shadow);
}

.editBookmarkPanelBottomButton[default="true"] {
  background-color: #666;
}

#editBookmarkPanelHeader {
  margin-bottom: 6px;
}

.editBookmarkPanelBottomButton:last-child {
  margin-inline-start: 8px;
}

/* The following elements come from editBookmarkOverlay.xul. Styling that's
   specific to the editBookmarkPanel should be in browser.css. Styling that
   should be shared by all editBookmarkOverlay.xul consumers should be in
   editBookmarkOverlay.css. */

#editBMPanel_newFolderBox {
  background: linear-gradient(#fff, #f2f2f2);
  background-origin: padding-box;
  background-clip: padding-box;
  border-radius: 0 0 3px 3px;
  border: 1px solid #a5a5a5;
  box-shadow: inset 0 1px rgba(255,255,255,.8),
              inset 0 0 1px rgba(255,255, 255,.25),
              0 1px rgba(255,255,255,.3);
  margin: 0;
  padding: 0;
  height:  20px;
}

#editBMPanel_newFolderButton {
  -moz-appearance: none;
  border: 0 solid #a5a5a5;
  border-inline-end-width: 1px;
  padding: 0 9px;
  margin: 0;
  min-width: 21px;
  min-height: 20px;
  height:  20px;
  color: #fff;
  list-style-image: url("chrome://browser/skin/panel-plus-sign.png");
  position: relative;
}

#editBMPanel_newFolderButton:hover:active {
  background: linear-gradient(rgba(40,40,40,.9), rgba(70,70,70,.9));
  box-shadow: inset 0 0 3px rgba(0,0,0,.2), inset 0 1px 7px rgba(0,0,0,.4);
}

#editBMPanel_newFolderButton:-moz-focusring {
  box-shadow: var(--focus-ring-box-shadow);
}

#editBMPanel_newFolderButton .button-text {
  display: none;
}

#editBMPanel_folderMenuList {
  @hudButton@
  background-clip: padding-box;
  margin: 0;
  min-height: 22px;
  padding-top: 2px;
  padding-bottom: 1px;
  padding-inline-start: 8px;
  padding-inline-end: 4px;
}

#editBMPanel_folderMenuList:-moz-focusring {
  box-shadow: var(--focus-ring-box-shadow);
}

#editBMPanel_folderMenuList[open="true"],
#editBMPanel_folderMenuList:hover:active {
  @hudButtonPressed@
}

#editBMPanel_folderMenuList > .menulist-dropmarker {
  -moz-appearance: none;
  display: -moz-box;
  background-color: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  padding-inline-end: 4px;
  width: 7px;
}

#editBMPanel_folderMenuList > .menulist-dropmarker > .dropmarker-icon {
  list-style-image: url("chrome://global/skin/icons/panel-dropmarker.png");
}

/**** folder tree and tag selector ****/

#editBMPanel_folderTree,
#editBMPanel_tagsSelector {
  -moz-appearance: none;
  background: linear-gradient(#fafafa, #fff);
  background-clip: padding-box;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,.3);
  box-shadow: inset 0 1px 1px 1px rgba(0,0,0,.05),
              0 1px rgba(255,255,255,.3);
  margin: 0;
}

#editBMPanel_folderTree:-moz-focusring,
#editBMPanel_tagsSelector:-moz-focusring {
  border-color: -moz-mac-focusring;
  box-shadow: var(--focus-ring-box-shadow);
}

#editBMPanel_folderTree {
  border-bottom: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  /* Implements editBookmarkPanel resizing on folderTree un-collapse. */
  margin: 0 !important;
  min-width: 27em;
  position: relative;
}

/**** expanders ****/

#editBookmarkPanel .expander-up,
#editBookmarkPanel .expander-down {
  @hudButton@
  margin: 0;
  margin-inline-start: 4px;
  min-width: 27px;
  min-height: 22px;
}

#editBookmarkPanel .expander-up:-moz-focusring,
#editBookmarkPanel .expander-down:-moz-focusring {
  box-shadow: var(--focus-ring-box-shadow);
}

#editBookmarkPanel .expander-up:hover:active,
#editBookmarkPanel .expander-down:hover:active {
  @hudButtonPressed@
}

#editBookmarkPanel .expander-up {
  list-style-image: url("chrome://browser/skin/panel-expander-open.png");
}

#editBookmarkPanel .expander-down {
  list-style-image: url("chrome://browser/skin/panel-expander-closed.png");
}

#editBookmarkPanel .expander-up > .button-box > .button-icon,
#editBookmarkPanel .expander-down > .button-box > .button-icon {
  margin: 1px 0 0;
}

#editBookmarkPanel .expander-up > .button-box > .button-text,
#editBookmarkPanel .expander-down > .button-box > .button-text {
  display: none;
}

@media (min-resolution: 2dppx) {
  #editBookmarkPanel .expander-up {
    list-style-image: url("chrome://browser/skin/panel-expander-open@2x.png");
  }

  #editBookmarkPanel .expander-down {
    list-style-image: url("chrome://browser/skin/panel-expander-closed@2x.png");
  }

  #editBookmarkPanel .expander-up > .button-box > .button-icon,
  #editBookmarkPanel .expander-down > .button-box > .button-icon {
    width: 9px;
  }
}

#editBMPanel_tagsField > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::placeholder {
  opacity: 1.0;
  color: #bbb;
}

.editBMPanel_rowLabel {
  text-align: end;
}

/* History Swipe Animation */

#historySwipeAnimationCurrentPage,
#historySwipeAnimationNextPage {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

#historySwipeAnimationContainer {
  background: url("chrome://browser/skin/subtle-pattern.png") #B3B9C1;
}


/* ----- SIDEBAR ELEMENTS ----- */

%include ../shared/sidebar.inc.css

#sidebar-box {
  -moz-appearance: -moz-mac-source-list;
  -moz-font-smoothing-background-color: -moz-mac-source-list;
  /* Default font size is 11px on mac, so this is 12px */
  font-size: 1.0909rem;
}

#sidebar-header {
  border-bottom: 1px solid hsla(240, 5%, 5%, .1);
  background-color: transparent;
}

.sidebar-splitter {
  border-color: hsla(240, 5%, 5%, .1);
}

/* ----- CONTENT ----- */

.browserContainer > findbar {
  background: @scopeBarBackground@;
  border-top: @scopeBarSeparatorBorder@;
  color: -moz-DialogText;
  text-shadow: none;
}

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

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

.openintabs-menuitem {
  list-style-image: none;
}

/* ::::: tabbrowser ::::: */

.tabbrowser-tabbox {
  margin: 0;
}

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

.tab-label {
  margin-top: 1px;
  margin-bottom: 0;
  -moz-box-flex: 1;
  text-align: center;
}

@media (-moz-mac-yosemite-theme) {
  /* image preloading hack from shared/tabs.inc.css */
  #tabbrowser-tabs::before {
    background-image:
      url(chrome://browser/skin/yosemite/tab-selected-end-inactive.svg),
      url(chrome://browser/skin/yosemite/tab-selected-start-inactive.svg),
      url(chrome://browser/skin/yosemite/tab-stroke-start-inactive.png),
      url(chrome://browser/skin/yosemite/tab-active-middle-inactive.png),
      url(chrome://browser/skin/yosemite/tab-stroke-end-inactive.png),
      url(chrome://browser/skin/tabbrowser/tab-selected-end.svg),
      url(chrome://browser/skin/tabbrowser/tab-selected-start.svg),
      url(chrome://browser/skin/tabbrowser/tab-stroke-end.png),
      url(chrome://browser/skin/tabbrowser/tab-active-middle.png),
      url(chrome://browser/skin/tabbrowser/tab-stroke-start.png),
      url(chrome://browser/skin/tabbrowser/tab-background-end.png),
      url(chrome://browser/skin/tabbrowser/tab-background-middle.png),
      url(chrome://browser/skin/tabbrowser/tab-background-start.png);
  }

  .tab-background-middle[selected=true]:-moz-window-inactive {
    background-image: url(chrome://browser/skin/yosemite/tab-active-middle-inactive.png),
                      @fgTabTextureYosemiteInactive@,
                      none;
  }

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

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

  .tab-background-start[selected=true]:-moz-window-inactive:-moz-locale-dir(ltr):not(:-moz-lwtheme)::before,
  .tab-background-end[selected=true]:-moz-window-inactive:-moz-locale-dir(rtl):not(:-moz-lwtheme)::before {
    background-image: url(chrome://browser/skin/yosemite/tab-selected-start-inactive.svg);
    background-size: 100% 100%;
  }

  .tab-background-end[selected=true]:-moz-window-inactive:-moz-locale-dir(ltr):not(:-moz-lwtheme)::before,
  .tab-background-start[selected=true]:-moz-window-inactive:-moz-locale-dir(rtl):not(:-moz-lwtheme)::before {
    background-image: url(chrome://browser/skin/yosemite/tab-selected-end-inactive.svg);
    background-size: 100% 100%;
  }

  @media (min-resolution: 2dppx) {
    /* image preloading hack from shared/tabs.inc.css */
    #tabbrowser-tabs::before {
      background-image:
        url(chrome://browser/skin/yosemite/tab-selected-end-inactive.svg),
        url(chrome://browser/skin/yosemite/tab-selected-start-inactive.svg),
        url(chrome://browser/skin/yosemite/tab-stroke-start-inactive@2x.png),
        url(chrome://browser/skin/yosemite/tab-active-middle-inactive@2x.png),
        url(chrome://browser/skin/yosemite/tab-stroke-end-inactive@2x.png),
        url(chrome://browser/skin/tabbrowser/tab-selected-end.svg),
        url(chrome://browser/skin/tabbrowser/tab-selected-start.svg),
        url(chrome://browser/skin/tabbrowser/tab-stroke-end@2x.png),
        url(chrome://browser/skin/tabbrowser/tab-active-middle@2x.png),
        url(chrome://browser/skin/tabbrowser/tab-stroke-start@2x.png),
        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);
    }

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

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

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

.tabbrowser-tab:not(:hover) > .tab-stack > .tab-content > .tab-icon-image:not([selected="true"]) {
  opacity: .9;
}

/*
 * Force the overlay to create a new stacking context so it always appears on
 * top of the icon.
 */
.tab-icon-overlay {
  opacity: 0.9999;
}

.tab-label-container:not([selected="true"]) {
  opacity: .7;
}

.tabbrowser-tab,
.tabs-newtab-button {
  font: message-box;
  border: none;
}

.tabbrowser-tab[visuallyselected=true]:not(:-moz-lwtheme) {
  /* overriding tabbox.css */
%ifdef MOZ_PHOTON_THEME
  color: hsl(240, 5%, 5%);
%else
  color: inherit;
%endif
}

.tabbrowser-tab[visuallyselected=true] {
  /* overriding tabbox.css */
  text-shadow: inherit;
}

.tabs-newtab-button > .toolbarbutton-icon {
  -moz-box-align: center;
  border: solid transparent;
  border-width: 0 11px;
}

.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label-container:not([pinned]),
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-icon-image[pinned],
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-throbber[pinned] {
  box-shadow: var(--focus-ring-box-shadow);
}

#TabsToolbar {
  -moz-appearance: none;
  /* overlap the nav-bar's top border */
  margin-bottom: calc(-1 * var(--tab-toolbar-navbar-overlap));
}

%ifndef MOZ_PHOTON_THEME
#main-window:not([customizing]) #navigator-toolbox[inFullscreen] > #TabsToolbar:not(:-moz-lwtheme),
#main-window:not(:-moz-any([customizing],[tabsintitlebar])) #navigator-toolbox > #TabsToolbar:not(:-moz-lwtheme) {
%else
:root:not([customizing]):not([tabsintitlebar]):not([inFullscreen]) #TabsToolbar:not(:-moz-lwtheme) {
%endif
  -moz-appearance: toolbar;
}

#TabsToolbar:not(:-moz-lwtheme) {
  color: #333;
  text-shadow: @loweredShadow@;
}

%ifdef MOZ_PHOTON_THEME
:root:-moz-any([inFullscreen], [tabsintitlebar]) #TabsToolbar:not(:-moz-lwtheme) {
  -moz-appearance: -moz-mac-vibrancy-dark;
  -moz-font-smoothing-background-color: -moz-mac-vibrancy-dark;
  color: hsl(240, 9%, 98%);
  text-shadow: none;
}
%endif

%ifndef MOZ_PHOTON_THEME
#navigator-toolbox[inFullscreen] > #TabsToolbar {
  padding-top: var(--space-above-tabbar);
}
%endif

.tabbrowser-tab[visuallyselected=true]:not(:-moz-lwtheme) {
  -moz-font-smoothing-background-color: var(--toolbar-bgcolor);
}

#tabbrowser-tabs {
  -moz-box-align: stretch;
}

.tabs-newtab-button > .toolbarbutton-icon {
  padding: 6px 0 4px;
}

/**
 * Tab Drag and Drop
 */

.tab-drop-indicator {
  list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator.png);
  margin-top: -2px;
  z-index: 3;
}

@media (min-resolution: 2dppx) {
  .tab-drop-indicator {
    list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator@2x.png);
    width: 12px;
  }
}

/**
 * In-tab close button
 */

.tab-close-button > .toolbarbutton-icon {
  margin-inline-end: 0px !important;
}

.tab-close-button {
  -moz-appearance: none;
  border: none !important;
  background: none;
  cursor: default;
}

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

@media (min-resolution: 2dppx) {
  #TabsToolbar[brighttext] .tab-close-button.close-icon:not([selected=true]):not(:hover) {
    -moz-image-region: rect(0, 128px, 32px, 96px);
  }
}

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

/* Bookmark drag and drop styles */

.bookmark-item[dragover-into="true"] {
  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;
  margin-inline-end: -4em;
  background-color: Highlight;
}

%include ../shared/notification-icons.inc.css

.notification-anchor-icon:-moz-focusring {
  box-shadow: var(--focus-ring-box-shadow);
}

/* Translation */

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

notification[value="translation"] {
  color: #484848;
  background-color: #EFEFEF;
  background-image: none;
  border-top: none;
  border-bottom: 1px solid #c4c4c4;
  padding-top: 1px;
  padding-bottom: 1px;
  min-height: 35px;
}

.translate-infobar-element {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

button.translate-infobar-element {
  background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1)) repeat scroll 0% 0% padding-box transparent;
  color: #333333;
  border: 1px solid;
  border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2);
  box-shadow: 0px 0px 2px rgba(255, 255, 255, 0.5) inset, 0px 1px 0px rgba(255, 255, 255, 0.2);
  transition-property: background-color, border-color, box-shadow;
  transition-duration: 150ms;
  min-height: 22px;
  min-width: 0;
  padding: 0 0.8em !important;
  margin-left: 0.25em;
  margin-right: 0.25em;
}

button.translate-infobar-element .button-text {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

label.translate-infobar-element {
  padding-top: 2px;
}

button.translate-infobar-element:hover {
  background: #f0f0f0;
  box-shadow: 0 1px 0 hsla(0,0%,100%,.1) inset,  0 0 0 1px hsla(0,0%,100%,.05) inset,  0 1px 0 hsla(210,54%,20%,.01),  0 0 4px hsla(206,100%,20%,.1);
}

button.translate-infobar-element:active {
  box-shadow: 0 1px 1px hsla(211,79%,6%,.1) inset,  0 0 1px hsla(211,79%,6%,.2) inset;
  transition-duration: 0ms;
}

button.translate-infobar-element[anonid="translate"] {
  color: #ffffff;
  background: linear-gradient(#4cb1ff, #1793e5);
  box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,  0 0 0 1px hsla(0,0%,100%,.1) inset,  0 1px 0 hsla(210,54%,20%,.03);
  border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2);
  padding: 0 1.1em  !important;;
}

button.translate-infobar-element[anonid="translate"]:hover {
  background-image: linear-gradient(#66bdff, #0d9eff);
  box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,  0 0 0 1px hsla(0,0%,100%,.1) inset,  0 1px 0 hsla(210,54%,20%,.03),  0 0 4px hsla(206,100%,20%,.2);
}

button.translate-infobar-element.options-menu-button {
  padding-inline-start: 0.5em !important;
  padding-inline-end: 0em !important;
}

button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker {
  display: -moz-box;
  list-style-image: url("chrome://global/skin/icons/glyph-dropdown.png");
  padding: 0 !important;
  margin: 0 !important;
}

@media (min-resolution: 2dppx) {
  button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker {
    list-style-image: url("chrome://global/skin/icons/glyph-dropdown@2x.png");
  }

  button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker > .dropmarker-icon {
    width: 8px;
  }
}

menulist.translate-infobar-element {
  text-shadow: 0 1px 1px #FEFFFE;
  border: 1px solid;
  border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2);
  box-shadow: 0 1px 1px 0 #FFFFFF, inset 0 2px 2px 0 #FFFFFF;
  background-color: #F1F1F1;
  background-image: linear-gradient(#FFFFFF, rgba(255,255,255,0.1));
  color: #333333;
  padding: 0;
  min-height: 22px !important;
}

menulist.translate-infobar-element > .menulist-label-box {
  padding-top: 1px;
  padding-inline-start: 0.3em;
  margin-top: 0;
  margin-bottom: 0;
}

menulist.translate-infobar-element:hover {
  background: #f0f0f0;
  box-shadow: 0 1px 0 hsla(0,0%,100%,.1) inset,  0 0 0 1px hsla(0,0%,100%,.05) inset,  0 1px 0 hsla(210,54%,20%,.01),  0 0 4px hsla(206,100%,20%,.1);
}

menulist.translate-infobar-element[open="true"] {
  background-image: linear-gradient(rgba(255,255,255,0.1),
                                    rgba(255,255,255,0.6));
}

menulist.translate-infobar-element > .menulist-dropmarker {
  display: -moz-box;
  list-style-image: url("chrome://global/skin/icons/glyph-dropdown.png");
}

@media (min-resolution: 2dppx) {
  menulist.translate-infobar-element > .menulist-dropmarker {
    list-style-image: url("chrome://global/skin/icons/glyph-dropdown@2x.png");
  }

  menulist.translate-infobar-element > .menulist-dropmarker > .dropmarker-icon {
    width: 8px;
  }
}

.popup-notification-body[popupid="addon-progress"],
.popup-notification-body[popupid="addon-install-confirmation"] {
  width: 28em;
  max-width: 28em;
}

.addon-install-confirmation-name {
  font-weight: bold;
}

html|*.addon-webext-perm-list {
  margin-block-end: 0;
  padding-inline-start: 10px;
}

.addon-webext-perm-text {
  margin-inline-start: 0;
}

.popup-notification-description[popupid="addon-webext-permissions"],
.popup-notification-description[popupid="addon-installed"] {
  display: none;
}

.addon-webext-perm-notification-content,
.addon-installed-notification-content {
  margin-top: 0;
}

#addon-webext-perm-header {
  /* Align the text more closely with the icon by clearing some top line height. */
  margin-top: -1px;
  margin-inline-start: 0;
}

#addon-installed-notification-header {
  /* Align the text more closely with the icon by clearing some top line height. */
  margin-top: -1px;
}

.addon-webext-name {
  display: inline;
  font-weight: bold;
  margin: 0;
}

.addon-addon-icon,
.addon-toolbar-icon {
  width: 14px;
  height: 14px;
  vertical-align: bottom;
  margin-bottom: 1px;
  -moz-context-properties: fill;
  fill: currentColor;
}

.addon-addon-icon {
  list-style-image: url("chrome://browser/skin/addons.svg");
}

.addon-toolbar-icon {
  list-style-image: url("chrome://browser/skin/menu.svg");
}

/* Status panel */

.statuspanel-label {
  margin: 0;
  padding: 2px 4px;
  background-color: #f9f9fa;
  border: 1px none #ddd;
  border-top-style: solid;
  color: #444;
  text-shadow: none;
}

.statuspanel-label:-moz-locale-dir(ltr):not([mirror]),
.statuspanel-label:-moz-locale-dir(rtl)[mirror] {
  border-right-style: solid;
  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;
  border-top-left-radius: .3em;
  margin-left: 1em;
}

%include ../shared/fullscreen/warning.inc.css
%include ../shared/ctrlTab.inc.css

%include downloads/indicator.css

/* On mac, the popup notification contents are indented by default and so
  the default closebutton margins from notification.css require adjustment */

.click-to-play-plugins-notification-description-box > .popup-notification-closebutton {
  margin-inline-end: -6px;
  margin-top: -7px;
}

.gclitoolbar-input-node > .textbox-input-box > html|*.textbox-input::-moz-selection {
  color: hsl(210,11%,16%);
}

/* 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;
}

/* Customization mode */

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

%ifndef MOZ_PHOTON_THEME
#main-window[customizing] {
  background-color: rgb(178,178,178);
}

#main-window[tabsintitlebar][customize-entered] > #titlebar,
#main-window[privatebrowsingmode=temporary]:not([tabsintitlebar])[customize-entered] > #titlebar,
#main-window[customize-entered] > #tab-view-deck {
  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
                    url("chrome://browser/skin/customizableui/background-noise-toolbar.png"),
                    linear-gradient(to bottom, rgb(233,233,233), rgb(178,178,178) 40px);
  background-attachment: fixed;
}

#main-window[tabsintitlebar][customization-lwtheme] > #titlebar:-moz-lwtheme {
  background-repeat: no-repeat;
  background-position: right top;
  background-attachment: fixed;
  background-image: var(--lwt-header-image);
  background-color: var(--lwt-accent-color);
}

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

#main-window[customize-entered] #browser-bottombox,
#main-window[customize-entered] #navigator-toolbox > toolbar:not(#TabsToolbar),
#main-window[customize-entered] #customization-container {
  border: 3px solid hsla(0,0%,0%,.1);
  border-top-width: 0;
  background-clip: padding-box;
  background-origin: padding-box;
  -moz-border-right-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
  -moz-border-bottom-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
  -moz-border-left-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
}

#main-window[customize-entered] #customization-container,
#main-window[customize-entered] #navigator-toolbox > toolbar:not(#TabsToolbar) {
  border-bottom-width: 0;
}

#main-window[customize-entered] #nav-bar {
  border-top-left-radius: 2.5px;
  border-top-right-radius: 2.5px;
}

/* Compensate for the border set above for this horizontal line. */
#main-window[customize-entered] #navigator-toolbox::after {
  margin-left: 3px;
  margin-right: 3px;
}

#main-window[customize-entered] #TabsToolbar {
  background-clip: padding-box;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
}
%endif

%ifndef MOZ_PHOTON_THEME
@media (min-resolution: 2dppx) {
  .customization-tipPanel-infoBox {
    background-image: url(chrome://browser/skin/customizableui/info-icon-customizeTip@2x.png);
    background-size: 25px 25px;
  }

  .customization-tipPanel-contentImage {
    list-style-image: url(chrome://browser/skin/customizableui/customize-illustration@2x.png);
  }

  .customization-tipPanel-contentImage:-moz-locale-dir(rtl) {
    list-style-image: url(chrome://browser/skin/customizableui/customize-illustration-rtl@2x.png);
  }

  #customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="left"],
  #customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="right"] {
    list-style-image: url("chrome://browser/skin/customizableui/panelarrow-customizeTip@2x.png");
  }
}
%endif

/* End customization mode */

.private-browsing-indicator {
  background-image: url("chrome://browser/skin/privatebrowsing-mask.png");
  background-repeat: no-repeat;
  background-size: 100% auto;
  width: 38px;
  height: 28px;
  /**
   * The private browsing mask graphic has a 3px flare at the top. The distance
   * we want between the mask and items on either side is 7px, so we use 4px,
   * since the other 3px is accounted for by the empty space on either side.
   */
  margin-left: 4px;
  margin-right: 4px;
}

#titlebar-secondary-buttonbox > .private-browsing-indicator {
  position: relative;
}

#main-window[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
  background-image: url("chrome://browser/skin/privatebrowsing-mask-short.png");
  height: 20px;
}

#main-window:not([privatebrowsingmode=temporary]) .private-browsing-indicator,
#main-window[privatebrowsingmode=temporary][inFullscreen] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator,
#main-window[privatebrowsingmode=temporary]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .private-browsing-indicator {
  display: none;
}

@media (min-resolution: 2dppx) {
  .private-browsing-indicator {
    background-image: url("chrome://browser/skin/privatebrowsing-mask@2x.png");
  }
  #main-window[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
    background-image: url("chrome://browser/skin/privatebrowsing-mask-short@2x.png");
  }
}

#TabsToolbar > .private-browsing-indicator {
%ifndef MOZ_PHOTON_THEME
  transform: translateY(calc(-1 * var(--space-above-tabbar)));
%endif
  /* We offset by 38px for mask graphic, plus 4px to account for the
   * margin-left, which sums to 42px.
   */
  margin-right: -42px;
}

#main-window[privatebrowsingmode=temporary] .titlebar-placeholder[type="fullscreen-button"],
#main-window[privatebrowsingmode=temporary] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button {
  margin-left: 0px;
}

#main-window[privatebrowsingmode=temporary][inFullscreen] .titlebar-placeholder[type="fullscreen-button"] {
  /* Override display:none for .titlebar-placeholder in fullscreen so we can have consistent
     position and padding for the private browsing indicator. */
  display: -moz-box;
}

#TabsToolbar > .private-browsing-indicator:-moz-locale-dir(rtl) {
  -moz-box-ordinal-group: 0;
}

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

#context-navigation > .menuitem-iconic {
  padding-left: 0;
  padding-right: 0;
}

.browser-extension-panel > .panel-arrowcontainer > .panel-arrowcontent {
  padding: 0;
  overflow: hidden;
}

.cui-widget-panelview[id^=PanelUI-webext-] {
  border-radius: 3.5px;
}

.webextension-popup-browser,
.webextension-popup-stack {
  border-radius: inherit;
}
