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

searchbar {
  -moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
}

tabbrowser {
  -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser");
}

.tabbrowser-tabs {
  -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-tabs");
}

#tabbrowser-tabs:not([overflow="true"]) + #new-tab-button,
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
#TabsToolbar[currentset]:not([currentset*="tabbrowser-tabs,new-tab-button"]) > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
#TabsToolbar[customizing="true"] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button {
  visibility: collapse;
}

.tabbrowser-tab {
  -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-tab");
}

.tabbrowser-tab:not([pinned]) {
  -moz-box-flex: 100;
  max-width: 250px;
  min-width: 100px;
  width: 0;
  -moz-transition: min-width 200ms ease-out,
                   max-width 250ms ease-out,
                   opacity 50ms ease-out 20ms /* hide the tab for the first 20ms of the max-width transition */;
}

.tabbrowser-tab:not([pinned]):not([fadein]) {
  max-width: 0.1px;
  min-width: 0.1px;
  opacity: 0 !important;
  -moz-transition: min-width 200ms ease-out,
                   max-width 250ms ease-out,
                   opacity 50ms ease-out 100ms /* hide the tab for the last 100ms of the max-width transition */;
}

.tab-throbber:not([fadein]):not([pinned]),
.tab-label:not([fadein]):not([pinned]),
.tab-icon-image:not([fadein]):not([pinned]),
.tab-close-button:not([fadein]):not([pinned]) {
  opacity: 0 !important;
}

.tab-throbber,
.tab-label,
.tab-icon-image,
.tab-close-button {
  -moz-transition: opacity 250ms;
}

.tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned] {
  position: fixed !important;
  display: block; /* position:fixed already does this (bug 579776), but let's be explicit */
}

#alltabs-popup {
  -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-alltabs-popup");
}

toolbar[printpreview="true"] {
  -moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}

#toolbar-menubar {
  -moz-box-ordinal-group: 5;
}

#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
  -moz-box-ordinal-group: 50;
}

#TabsToolbar {
  -moz-box-ordinal-group: 100;
}

#TabsToolbar[tabsontop="true"] {
  -moz-box-ordinal-group: 10;
}


toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
  display: none;
}

#main-window[disablechrome] #navigator-toolbox[tabsontop="true"] > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
  visibility: collapse;
}

#wrapper-urlbar-container #urlbar-container > #urlbar > toolbarbutton,
#urlbar-container:not([combined]) > #urlbar > toolbarbutton,
#urlbar-container[combined] + #reload-button + #stop-button,
#urlbar-container[combined] + #reload-button,
toolbar:not([mode="icons"]) > #urlbar-container > #urlbar > toolbarbutton,
toolbar[mode="icons"] > #urlbar-container > #urlbar > #urlbar-reload-button:not([displaystop]) + #urlbar-stop-button,
toolbar[mode="icons"] > #urlbar-container > #urlbar > #urlbar-reload-button[displaystop],
toolbar[mode="icons"] > #reload-button:not([displaystop]) + #stop-button,
toolbar[mode="icons"] > #reload-button[displaystop] {
  visibility: collapse;
}

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

#feed-menu > .feed-menuitem:-moz-locale-dir(rtl) {
  direction: rtl;
}

#main-window:-moz-lwtheme {
  background-repeat: no-repeat;
  background-position: top right;
}

#main-window[inFullscreen="true"] {
  padding-top: 0; /* override drawintitlebar="true" */
}

#browser-bottombox[lwthemefooter="true"] {
  background-repeat: no-repeat;
  background-position: bottom left;
}

splitmenu {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#splitmenu");
}

.splitmenu-menuitem {
  -moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem");
  list-style-image: inherit;
  -moz-image-region: inherit;
}

.splitmenu-menuitem[iconic="true"] {
  -moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
}

.splitmenu-menu > .menu-text,
:-moz-any(.splitmenu-menu, .splitmenu-menuitem) > .menu-accel-container,
#appmenu-editmenu > .menu-text,
#appmenu-editmenu > .menu-accel-container {
  display: none;
}

.menuitem-tooltip {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-tooltip");
}

.menuitem-iconic-tooltip,
.menuitem-tooltip[type="checkbox"],
.menuitem-tooltip[type="radio"] {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-iconic-tooltip");
}


/* Hide menu elements intended for keyboard access support */
#main-menubar[openedwithkey=false] .show-only-for-keyboard {
  display: none;
}

/* ::::: location bar ::::: */
#urlbar {
  -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
}

.uri-element-right-align:-moz-locale-dir(rtl),
html|input.uri-element-right-align:-moz-locale-dir(rtl),
.ac-url-text:-moz-locale-dir(rtl),
.ac-title:-moz-locale-dir(rtl) > description {
  direction: ltr !important;
}

/* For results that are actions, their description text is shown instead of
   the URL - this needs to follow the locale's direction, unlike URLs. */
panel:not([noactions]) > richlistbox > richlistitem[type~="action"]:-moz-locale-dir(rtl) > .ac-url-box {
  direction: rtl;
}

panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .ac-url > .ac-action-text,
panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .ac-action-icon {
  visibility: collapse;
}

panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .ac-url > .ac-url-text {
  visibility: visible;
}

#urlbar:not([actiontype]) > #urlbar-display-box {
  display: none;
}

#wrapper-urlbar-container > #urlbar-container > #urlbar {
  -moz-user-input: disabled;
  cursor: -moz-grab;
}

#PopupAutoComplete {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#browser-autocomplete-result-popup");
}

#PopupAutoCompleteRichResult {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup");
}

#urlbar-throbber:not([busy="true"]),
#urlbar-throbber[busy="true"] + #page-proxy-favicon {
  display: none;
}

#urlbar-container[combined] > #urlbar > #urlbar-icons > #go-button,
#urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon:not(#go-button),
#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button,
#urlbar[pageproxystate="invalid"][focused="true"] > #urlbar-go-button ~ toolbarbutton,
#urlbar[pageproxystate="valid"] > #urlbar-go-button,
#urlbar:not([focused="true"]) > #urlbar-go-button {
  visibility: collapse;
}

#identity-icon-labels {
  max-width: 18em;
}

#identity-icon-country-label {
  direction: ltr;
}

#identity-box.verifiedIdentity > #identity-box-inner > #identity-icon-labels > #identity-icon-label {
  -moz-margin-end: 0.25em !important;
}

#wrapper-search-container > #search-container > #searchbar > .searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input {
  visibility: hidden;
}

/* ::::: Unified Back-/Forward Button ::::: */
#back-button > .toolbarbutton-menu-dropmarker,
#forward-button > .toolbarbutton-menu-dropmarker {
  display: none;
}
.unified-nav-current {
  font-weight: bold;
}

toolbarbutton.bookmark-item {
  max-width: 13em;
}


#editBMPanel_tagsSelector {
  /* override default listbox width from xul.css */
  width: auto;
}

menupopup[emptyplacesresult="true"] > .hide-if-empty-places-result {
  display: none;
}

menuitem.spell-suggestion {
  font-weight: bold;
}

#sidebar-header > .tabs-closebutton {
  -moz-user-focus: normal;
}

/* apply Fitts' law to the notification bar's close button */
window[sizemode="maximized"] #content .notification-inner {
  border-right: 0px !important;
}

/* Hide extension toolbars that neglected to set the proper class */
window[chromehidden~="location"][chromehidden~="toolbar"] toolbar:not(.chromeclass-menubar),
window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-menubar) {
  display: none;
}

#navigator-toolbox ,
#status-bar ,
#mainPopupSet {
  min-width: 1px;
}

/* Sync notification UI */
#sync-notifications {
  -moz-binding: url("chrome://browser/content/syncNotification.xml#notificationbox");
  overflow-y: visible !important;
}

#sync-notifications notification {
  -moz-binding: url("chrome://browser/content/syncNotification.xml#notification");
}

/* Identity UI */
#identity-popup-content-box.unknownIdentity > #identity-popup-connectedToLabel ,
#identity-popup-content-box.unknownIdentity > #identity-popup-runByLabel ,
#identity-popup-content-box.unknownIdentity > #identity-popup-content-host ,
#identity-popup-content-box.unknownIdentity > #identity-popup-content-owner ,
#identity-popup-content-box.verifiedIdentity > #identity-popup-connectedToLabel2 ,
#identity-popup-content-box.verifiedDomain > #identity-popup-connectedToLabel2 {
  display: none;
}

/*  Full Screen UI */

#fullscr-toggler {
  height: 1px;
  background: black;
}

#full-screen-warning-container {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

#full-screen-warning-container[fade-warning-out] {
  -moz-transition-property: opacity !important;
  -moz-transition-duration: 500ms !important;
  opacity: 0.0;
}

#full-screen-warning-message {
  pointer-events: auto;
}

#nav-bar[mode="text"] > #window-controls > toolbarbutton > .toolbarbutton-icon {
  display: -moz-box;
}

#nav-bar[mode="text"] > #window-controls > toolbarbutton > .toolbarbutton-text {
  display: none;
}

/* ::::: Keyboard UI Panel ::::: */
.KUI-panel-closebutton {
  -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image");
}

.ctrlTab-preview > html|canvas,
.allTabs-preview > html|canvas {
  min-width: inherit;
  max-width: inherit;
  min-height: inherit;
  max-height: inherit;
}

.ctrlTab-favicon-container,
.allTabs-favicon-container {
  -moz-box-align: start;
  -moz-box-pack: end;
}

.ctrlTab-favicon,
.allTabs-favicon {
  width: 16px;
  height: 16px;
}

/* ::::: Ctrl-Tab Panel ::::: */
.ctrlTab-preview {
  -moz-binding: url("chrome://browser/content/browser-tabPreviews.xml#ctrlTab-preview");
}

/* ::::: All Tabs Panel ::::: */
.allTabs-preview {
  -moz-binding: url("chrome://browser/content/browser-tabPreviews.xml#allTabs-preview");
}

#allTabs-tab-close-button {
  -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image");
  margin: 0;
}


/* notification anchors should only be visible when their associated
   notifications are */
.notification-anchor-icon {
  display: none;
  -moz-user-focus: normal;
}

/* We use the iconBox as the notification anchor when a popup notification is
   created with a null anchorID, so in that case use a default anchor icon. */
#notification-popup-box[anchorid="notification-popup-box"] > #default-notification-icon,
#notification-popup-box[anchorid="geo-notification-icon"] > #geo-notification-icon,
#notification-popup-box[anchorid="canvas-notification-icon"] > #canvas-notification-icon,
#notification-popup-box[anchorid="indexedDB-notification-icon"] > #indexedDB-notification-icon,
#notification-popup-box[anchorid="addons-notification-icon"] > #addons-notification-icon,
#notification-popup-box[anchorid="password-notification-icon"] > #password-notification-icon {
  display: -moz-box;
}

#invalid-form-popup > description {
  max-width: 280px;
}

#geolocation-notification {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#geolocation-notification");
}

#addon-progress-notification {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#addon-progress-notification");
}

/* override hidden="true" for the status bar compatibility shim
   in case it was persisted for the real status bar */
#status-bar {
  display: -moz-box;
}

/* Remove the resizer from the statusbar compatibility shim */
#status-bar[hideresizer] > .statusbar-resizerpanel {
  display: none;
}

browser[tabmodalPromptShowing] {
  -moz-user-focus: none !important;
}

/* Status panel */

statuspanel {
  -moz-binding: url("chrome://browser/content/tabbrowser.xml#statuspanel");
  position: fixed;
  margin-top: -3em;
  left: 0;
  max-width: 50%;
}

statuspanel:-moz-locale-dir(ltr)[mirror],
statuspanel:-moz-locale-dir(rtl):not([mirror]) {
  left: auto;
  right: 0;
}

statuspanel[type=status] {
  min-width: 23em;
}

@media all and (max-width: 800px) {
  statuspanel[type=status] {
    min-width: 33%;
  }
}

statuspanel[type=overLink] {
  -moz-transition: opacity 120ms ease-out;
  direction: ltr;
}

statuspanel[inactive] {
  -moz-transition: none;
  opacity: 0;
  pointer-events: none;
}

statuspanel[inactive][previoustype=overLink] {
  -moz-transition: opacity 200ms ease-out;
}

.statuspanel-inner {
  height: 3em;
  width: 100%;
  -moz-box-align: end;
}

.styleInspector {
  min-width: 350px;
}

.panel-inner-arrowcontentfooter[footertype="promobox"] {
  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
}

/* highlighter */
#highlighter-container {
  pointer-events: none;
}

#highlighter-controls {
  position: absolute;
  top: 0;
  left: 0;
}

#highlighter-veil-container {
  overflow: hidden;
}

#highlighter-veil-container:not([locked]) > .highlighter-veil,
#highlighter-veil-container:not([locked]) > #highlighter-veil-middlebox,
#highlighter-veil-container:not([locked]) > #highlighter-veil-middlebox > .highlighter-veil,
#highlighter-veil-container:not([locked]) > #highlighter-veil-middlebox > #highlighter-veil-transparentbox {
  -moz-transition-property: width, height;
  -moz-transition-duration: 0.1s;
  -moz-transition-timing-function: linear;
}

#highlighter-veil-bottombox,
#highlighter-veil-rightbox {
  -moz-box-flex: 1;
}

#highlighter-veil-middlebox:-moz-locale-dir(rtl) {
  -moz-box-direction: reverse;
}

.inspector-breadcrumbs-button {
  direction: ltr;
}

.inspector-resizer {
  display: none;
}

#inspector-toolbar[treepanel-open] > vbox > #inspector-top-resizer,
#inspector-toolbar[treepanel-open] > vbox > hbox > #inspector-end-resizer {
  display: -moz-box;
}

/*
 * Node Infobar
 */

#highlighter-nodeinfobar-container {
  position: absolute;
}

#highlighter-nodeinfobar-container:not([locked]) {
  -moz-transition-property: top, left;
  -moz-transition-duration: 0.1s;
  -moz-transition-timing-function: linear;
}

#highlighter-nodeinfobar {
  display: block;
  white-space: nowrap;
  direction: ltr;
}

.highlighter-nodeinfobar-arrow {
  display: none;
}

#highlighter-nodeinfobar-container[position="top"]:not([hide-arrow]) > #highlighter-nodeinfobar-arrow-bottom {
  display: block;
}

#highlighter-nodeinfobar-container[position="bottom"]:not([hide-arrow]) > #highlighter-nodeinfobar-arrow-top {
  display: block;
}

#highlighter-nodeinfobar-container[disabled] {
  visibility: hidden;
}

#highlighter-nodeinfobar-id:empty {
  display: none;
}

#highlighter-nodeinfobar-id::before {
  content: "#";
}

.highlighter-nodeinfobar-class::before {
  content: ".";
}

#highlighter-nodeinfobar-tagname {
  text-transform: lowercase;
}
