/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */

/* CSS Variables specific to the devtools toolbar that aren't defined by the themes */
.theme-light {
  --toolbar-tab-hover: rgba(170, 170, 170, .2);
  --toolbar-tab-hover-active: rgba(170, 170, 170, .4);
  --searchbox-background-color: #ffee99;
  --searchbox-border-color: #ffbf00;
  --searcbox-no-match-background-color: #ffe5e5;
  --searcbox-no-match-border-color: #e52e2e;
  --magnifying-glass-image: url(images/magnifying-glass-light.png);
  --magnifying-glass-image-2x: url(images/magnifying-glass-light@2x.png);
  --tool-options-image: url(images/tool-options.svg);
  --close-button-image: url(chrome://devtools/skin/images/close.svg);
  --icon-filter: invert(1);
  --dock-bottom-image: url(chrome://devtools/skin/images/dock-bottom.svg);
  --dock-side-image: url(chrome://devtools/skin/images/dock-side.svg);
  --dock-undock-image: url(chrome://devtools/skin/images/dock-undock.svg);
  --toolbar-button-border-color: rgba(170, 170, 170, .5);

  /* Toolbox buttons */
  --command-paintflashing-image: url(images/command-paintflashing.svg);
  --command-screenshot-image: url(images/command-screenshot.svg);
  --command-responsive-image: url(images/command-responsivemode.svg);
  --command-scratchpad-image: url(images/command-scratchpad.svg);
  --command-pick-image: url(images/command-pick.svg);
  --command-frames-image: url(images/command-frames.svg);
  --command-splitconsole-image: url(images/command-console.svg);
  --command-noautohide-image: url(images/command-noautohide.svg);
  --command-eyedropper-image: url(images/command-eyedropper.svg);
  --command-rulers-image: url(images/command-rulers.svg);
  --command-measure-image: url(images/command-measure.svg);
}

.theme-dark {
  --toolbar-tab-hover: hsla(206, 37%, 4%, .2);
  --toolbar-tab-hover-active: hsla(206, 37%, 4%, .4);
  --searchbox-background-color: #4d4222;
  --searchbox-border-color: #d99f2b;
  --searcbox-no-match-background-color: #402325;
  --searcbox-no-match-border-color: #cc3d3d;
  --magnifying-glass-image: url(images/magnifying-glass.png);
  --magnifying-glass-image-2x: url(images/magnifying-glass@2x.png);
  --tool-options-image: url(images/tool-options.svg);
  --close-button-image: url(chrome://devtools/skin/images/close.svg);
  --icon-filter: none;
  --dock-bottom-image: url(chrome://devtools/skin/images/dock-bottom.svg);
  --dock-side-image: url(chrome://devtools/skin/images/dock-side.svg);
  --dock-undock-image: url(chrome://devtools/skin/images/dock-undock.svg);
  --toolbar-button-border-color: rgba(0, 0, 0, .4);

  /* Toolbox buttons */
  --command-paintflashing-image: url(images/command-paintflashing.svg);
  --command-screenshot-image: url(images/command-screenshot.svg);
  --command-responsive-image: url(images/command-responsivemode.svg);
  --command-scratchpad-image: url(images/command-scratchpad.svg);
  --command-pick-image: url(images/command-pick.svg);
  --command-frames-image: url(images/command-frames.svg);
  --command-splitconsole-image: url(images/command-console.svg);
  --command-noautohide-image: url(images/command-noautohide.svg);
  --command-eyedropper-image: url(images/command-eyedropper.svg);
  --command-rulers-image: url(images/command-rulers.svg);
  --command-measure-image: url(images/command-measure.svg);
}

.theme-firebug {
  --magnifying-glass-image: url(images/firebug/filter.svg);
  --magnifying-glass-image-2x: url(images/firebug/filter.svg);
  --tool-options-image: url(images/firebug/tool-options.svg);
  --close-button-image: url(chrome://devtools/skin/images/firebug/close.svg);
  --icon-filter: invert(1);
  --dock-bottom-image: url(chrome://devtools/skin/images/firebug/dock-bottom.svg);
  --dock-side-image: url(chrome://devtools/skin/images/firebug/dock-side.svg);
  --dock-undock-image: url(chrome://devtools/skin/images/firebug/dock-undock.svg);
  --toolbar-button-border-color: rgba(170, 170, 170, .5);

  /* Toolbox buttons */
  --command-paintflashing-image: url(images/firebug/command-paintflashing.svg);
  --command-screenshot-image: url(images/firebug/command-screenshot.svg);
  --command-responsive-image: url(images/firebug/command-responsivemode.svg);
  --command-scratchpad-image: url(images/firebug/command-scratchpad.svg);
  --command-pick-image: url(images/firebug/command-pick.svg);
  --command-frames-image: url(images/firebug/command-frames.svg);
  --command-splitconsole-image: url(images/firebug/command-console.svg);
  --command-noautohide-image: url(images/firebug/command-noautohide.svg);
  --command-eyedropper-image: url(images/firebug/command-eyedropper.svg);
  --command-rulers-image: url(images/firebug/command-rulers.svg);
  --command-measure-image: url(images/firebug/command-measure.svg);
}


/* Toolbars */
.devtools-toolbar,
.devtools-sidebar-tabs tabs {
  -moz-appearance: none;
  padding: 0;
  border-width: 0;
  border-bottom-width: 1px;
  border-style: solid;
  height: 24px;
  line-height: 24px;
  box-sizing: border-box;
}

.devtools-toolbar {
  padding: 0 3px;
}

.devtools-toolbar checkbox {
  margin: 0 2px;
  padding: 0;
  line-height: -moz-block-height;
}
.devtools-toolbar checkbox .checkbox-check {
  margin: 0;
  padding: 0;
  vertical-align: bottom;
}
.devtools-toolbar checkbox .checkbox-label-box {
  border: none !important; /* overrides .checkbox-label-box from checkbox.css */
}
.devtools-toolbar checkbox .checkbox-label-box .checkbox-label {
  margin: 0 6px !important; /* overrides .checkbox-label from checkbox.css */
  padding: 0;
}

/* Toolbar buttons */

.devtools-menulist,
.devtools-toolbarbutton,
.devtools-button {
  -moz-appearance: none;
  background: transparent;
  min-height: 18px;
  text-shadow: none;
  border: none;
  border-radius: 0;
  color: var(--theme-body-color);
  transition: background 0.05s ease-in-out;
}

.devtools-menulist,
.devtools-toolbarbutton {
  -moz-box-align: center;
  min-width: 78px;
  padding: 1px;
  margin: 2px 1px;
}

.devtools-toolbarbutton:not([label]) > .toolbarbutton-icon,
.devtools-button::before {
  width: 16px;
  height: 16px;
  transition: opacity 0.05s ease-in-out;
}

/* HTML buttons */
.devtools-button {
  margin: 2px 1px;
  padding: 1px;
  min-width: 32px;
  /* The icon is absolutely positioned in the button using ::before */
  position: relative;
}

.devtools-button::before {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -8px 0 0 -8px;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity 0.05s ease-in-out;
}

.devtools-button:-moz-focusring {
  outline: none;
}

/* Standalone buttons */
.devtools-button[standalone],
.devtools-button[data-standalone],
.devtools-toolbarbutton[standalone],
.devtools-toolbarbutton[data-standalone] {
  border-width: 1px;
  border-style: solid;
  min-height: 32px;
  background-color: var(--theme-toolbar-background);
}

.devtools-toolbarbutton[standalone], .devtools-toolbarbutton[data-standalone] {
  margin-inline-end: 5px;
}

.devtools-toolbarbutton[label][standalone] {
  min-height: 2em;
}

.devtools-menulist,
.devtools-toolbarbutton,
.devtools-button {
  border-color: var(--toolbar-button-border-color);
}

/* Icon button styles */
.devtools-toolbarbutton:not([label]),
.devtools-toolbarbutton[text-as-image] {
  min-width: 32px;
}

/* Set flex attribute to Toolbox buttons and Picker container so,
   they don't overlapp with the tab bar */
#toolbox-buttons {
  display: flex;
}

#toolbox-picker-container {
  display: flex;
}

/* Invert toolbox button icons in Firebug theme. */
.theme-firebug #toolbox-buttons toolbarbutton image {
  filter: invert(1);
}

.devtools-toolbarbutton:not([label]) > .toolbarbutton-text {
  display: none;
}

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

/* Menu button styles (eg. web console filters) */
.devtools-toolbarbutton[type=menu-button] > .toolbarbutton-menubutton-button {
  -moz-appearance: none;
  color: inherit;
  border-width: 0;
  -moz-box-orient: horizontal;
  padding: 0;
}

.devtools-toolbarbutton[type=menu-button] {
  padding: 0 1px;
  -moz-box-align: stretch;
}

.devtools-toolbarbutton > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
  margin-inline-end: 4px;
}

.devtools-menulist > .menulist-dropmarker {
  -moz-appearance: none;
  display: -moz-box;
  list-style-image: url("chrome://devtools/skin/images/dropmarker.svg");
  -moz-box-align: center;
  min-width: 16px;
}

.devtools-toolbarbutton[type=menu] > .toolbarbutton-menu-dropmarker,
.devtools-toolbarbutton[type=menu-button] > .toolbarbutton-menubutton-dropmarker {
  -moz-appearance: none !important;
  list-style-image: url("chrome://devtools/skin/images/dropmarker.svg");
  -moz-box-align: center;
  padding: 0 3px;
}

/* Icon-only buttons */
.devtools-button:empty::before,
.devtools-toolbarbutton:not([label]):not([disabled]) > image {
  opacity: 0.8;
}

.devtools-button:hover:empty::before,
.devtools-button[checked]:empty::before,
.devtools-button[open]:empty::before,
.devtools-toolbarbutton:not([label]):hover > image,
.devtools-toolbarbutton:not([label])[checked=true] > image,
.devtools-toolbarbutton:not([label])[open=true] > image {
  opacity: 1;
}

.devtools-button:disabled,
.devtools-button[disabled],
.devtools-toolbarbutton[disabled] {
  opacity: 0.5 !important;
}

.devtools-button[checked]:empty::before,
.devtools-button[open]:empty::before,
.devtools-toolbarbutton:not([label])[checked=true] > image,
.devtools-toolbarbutton:not([label])[open=true] > image {
  filter: url(images/filters.svg#checked-icon-state);
}

/* Icon-and-text buttons */
.devtools-toolbarbutton.icon-and-text .toolbarbutton-text {
  margin-inline-start: .5em !important;
  font-weight: 600;
}

/* Text-only buttons */
.theme-light .devtools-toolbarbutton[label]:not([text-as-image]):not([type=menu-button]),
.theme-light .devtools-toolbarbutton[data-text-only] {
  background-color: var(--toolbar-tab-hover);
}
.theme-dark .devtools-toolbarbutton[label]:not([text-as-image]):not([type=menu-button]),
.theme-dark .devtools-toolbarbutton[data-text-only] {
  background-color: rgba(0, 0, 0, .2); /* Splitter */
}

/* Text-only button states */
.theme-dark .devtools-button:not(:empty):not([disabled]):hover,
.theme-dark .devtools-toolbarbutton:not(:-moz-any([checked=true],[disabled],[text-as-image]))[label]:hover {
  background: rgba(0, 0, 0, .3); /* Splitters */
}
.theme-light .devtools-button:not(:empty):not([disabled]):hover,
.theme-light .devtools-toolbarbutton:not(:-moz-any([checked=true],[disabled],[text-as-image]))[label]:hover {
  background: rgba(170, 170, 170, .3); /* Splitters */
}

.theme-dark .devtools-button:not(:empty):not([disabled]):hover:active,
.theme-dark .devtools-toolbarbutton:not(:-moz-any([checked=true],[disabled],[text-as-image]))[label]:hover:active {
  background: rgba(0, 0, 0, .4); /* Splitters */
}
.theme-light .devtools-button:not(:empty):not([disabled]):hover:active,
.theme-light .devtools-toolbarbutton:not(:-moz-any([checked=true],[disabled],[text-as-image]))[label]:hover:active {
  background: var(--toolbar-tab-hover-active);
}

.theme-dark .devtools-toolbarbutton:not([disabled])[label][checked=true],
.theme-dark .devtools-toolbarbutton:not([disabled])[label][open],
.theme-dark .devtools-button:not(:empty)[checked=true] {
  background: var(--theme-selection-background-semitransparent);
  color: var(--theme-selection-color);
}
.theme-light .devtools-toolbarbutton:not([disabled])[label][checked=true],
.theme-light .devtools-toolbarbutton:not([disabled])[label][open],
.theme-light .devtools-button:not(:empty)[checked=true] {
  background: rgba(76, 158, 217, .3); /* Select highlight blue */
}

:root {
  --clear-icon-url: url("chrome://devtools/skin/images/clear.svg");
}

.devtools-button.devtools-clear-icon::before {
  background-image: var(--clear-icon-url);
}

.devtools-toolbarbutton.devtools-clear-icon {
  list-style-image: var(--clear-icon-url);
}

.devtools-option-toolbarbutton {
  list-style-image: var(--tool-options-image);
}

.devtools-toolbarbutton-group > .devtools-toolbarbutton:last-child {
  margin-inline-end: 0;
}

.devtools-toolbarbutton-group + .devtools-toolbarbutton {
  margin-inline-start: 3px;
}

.devtools-separator + .devtools-toolbarbutton {
  margin-inline-start: 1px;
}

/* Text input */

.devtools-textinput,
.devtools-searchinput {
  -moz-appearance: none;
  margin: 1px 3px;
  border: 1px solid;
  border-radius: 2px;
  padding: 4px 6px;
  border-color: var(--theme-splitter-color);
}

:root[platform="mac"] .devtools-textinput,
:root[platform="mac"] .devtools-searchinput {
  border-radius: 20px;
}

.devtools-searchinput {
  padding: 0;
  padding-inline-start: 22px;
  padding-inline-end: 4px;
  background-image: var(--magnifying-glass-image);
  background-position: 8px center;
  background-size: 11px 11px;
  background-repeat: no-repeat;
  font-size: inherit;
}

.devtools-searchinput:-moz-locale-dir(rtl),
.devtools-searchinput:dir(rtl) {
  background-position: calc(100% - 8px) center;
}

.devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-icon {
  visibility: hidden;
}

/* Searchbox is a div container element for a search input element */
.devtools-searchbox {
  display: flex;
  flex: 1;
  position: relative;
  padding: 0 3px;
}

/* The spacing is accomplished with a padding on the searchbox */
.devtools-searchbox > .devtools-textinput,
.devtools-searchbox > .devtools-searchinput {
  margin-left: 0;
  margin-right: 0;
}

.devtools-searchbox > .devtools-textinput:-moz-focusring,
.devtools-searchbox > .devtools-searchinput:-moz-focusring {
  border-color: var(--theme-focus-border-color-textbox);
  box-shadow: var(--theme-focus-box-shadow-textbox);
  transition: all 0.2s ease-in-out;
  outline: none;
}

/* Don't add 'double spacing' for inputs that are at beginning / end
   of a toolbar (since the toolbar has it's own spacing). */
.devtools-toolbar > .devtools-textinput:first-child,
.devtools-toolbar > .devtools-searchinput:first-child {
  margin-inline-start: 0;
}
.devtools-toolbar > .devtools-textinput:last-child,
.devtools-toolbar > .devtools-searchinput:last-child {
  margin-inline-end: 0;
}
.devtools-toolbar > .devtools-searchbox:first-child {
  padding-inline-start: 0;
}
.devtools-toolbar > .devtools-searchbox:last-child {
  padding-inline-end: 0;
}

.devtools-rule-searchbox {
  -moz-box-flex: 1;
  width: 100%;
  font: inherit;
}

.devtools-rule-searchbox[filled] {
  background-color: var(--searchbox-background-color);
  border-color: var(--searchbox-border-color);
  padding-inline-end: 23px;
}

.devtools-style-searchbox-no-match {
  background-color: var(--searcbox-no-match-background-color) !important;
  border-color: var(--searcbox-no-match-border-color) !important;
}

.devtools-no-search-result {
  border-color: var(--theme-highlight-red) !important;
}

.devtools-searchinput-clear {
  position: absolute;
  top: 3.5px;
  right: 7px;
  padding: 0;
  border: 0;
  width: 16px;
  height: 16px;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-color: transparent;
}

.devtools-searchinput-clear:dir(rtl) {
  right: unset;
  left: 7px;
}

.theme-dark .devtools-searchinput-clear {
  background-image: url("chrome://devtools/skin/images/search-clear-dark.svg");
}

.theme-light .devtools-searchinput-clear {
  background-image: url("chrome://devtools/skin/images/search-clear-light.svg");
}

.devtools-style-searchbox-no-match + .devtools-searchinput-clear {
  background-image: url("chrome://devtools/skin/images/search-clear-failed.svg") !important;
}

.devtools-searchinput-clear:hover {
  background-position: -16px 0;
}

.theme-dark .devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear {
  list-style-image: url("chrome://devtools/skin/images/search-clear-dark.svg");
  -moz-image-region: rect(0, 16px, 16px, 0);
}

.theme-light .devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear {
  list-style-image: url("chrome://devtools/skin/images/search-clear-light.svg");
  -moz-image-region: rect(0, 16px, 16px, 0);
}

.devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear {
  margin-bottom: 0;
}

.devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear:hover {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

@media (min-resolution: 1.1dppx) {
  .devtools-searchinput {
    background-image: var(--magnifying-glass-image-2x);
  }
}

/* Close button */

#toolbox-close::before {
  background-image: var(--close-button-image);
}

/* In-tools sidebar */
.devtools-sidebar-tabs {
  -moz-appearance: none;
  margin: 0;
}

.devtools-sidebar-tabs > tabpanels {
  -moz-appearance: none;
  background: transparent;
  padding: 0;
  border: 0;
}

.theme-light .devtools-sidebar-tabs > tabpanels {
  background: var(--theme-sidebar-background);
  color: var(--theme-body-color);
}

.devtools-sidebar-tabs tabs {
  position: static;
  font: inherit;
  margin-bottom: 0;
  overflow: hidden;
}

.devtools-sidebar-alltabs {
  -moz-appearance: none;
  height: 24px;
  line-height: 24px;
  padding: 0 4px;
  margin: 0;
  border-width: 0 0 1px 0;
  border-inline-start-width: 1px;
  border-style: solid;
}

.devtools-sidebar-alltabs .toolbarbutton-icon {
  display: none;
}

.devtools-sidebar-tabs tabs > .tabs-right,
.devtools-sidebar-tabs tabs > .tabs-left {
  display: none;
}

.devtools-sidebar-tabs tabs > tab {
  -moz-appearance: none;
  /* We want to match the height of a toolbar with a toolbarbutton
   * First, we need to replicated the padding of toolbar (4px),
   * then we need to take the border of the buttons into account (1px).
   */
  padding: 0 3px;
  margin: 0;
  min-width: 78px;
  text-align: center;
  background-color: transparent;
  color: inherit;
  -moz-box-flex: 1;
  border-width: 0;
  border-inline-start-width: 1px;
  border-style: solid;
  border-radius: 0;
  position: static;
  text-shadow: none;
}

.devtools-sidebar-tabs tabs > tab {
  border-image: linear-gradient(transparent 15%, var(--theme-splitter-color) 15%, var(--theme-splitter-color) 85%, transparent 85%) 1 1;
}

.devtools-sidebar-tabs tabs > tab[selected],
.devtools-sidebar-tabs tabs > tab[selected] + tab {
  border-image: linear-gradient(var(--theme-splitter-color), var(--theme-splitter-color)) 1 1;
}

.devtools-sidebar-tabs tabs > tab:first-child {
  border-inline-start-width: 0;
}

.devtools-sidebar-tabs tabs > tab:hover {
  background: rgba(0, 0, 0, 0.12);
}

.devtools-sidebar-tabs tabs > tab:hover:active {
  background: rgba(0, 0, 0, 0.2);
}

.devtools-sidebar-tabs tabs > tab[selected],
.devtools-sidebar-tabs tabs > tab[selected]:hover:active {
  color: var(--theme-selection-color);
  background: var(--theme-selection-background);
}

/* Toolbox - moved from toolbox.css.
 * Rules that apply to the global toolbox like command buttons,
 * devtools tabs, docking buttons, etc. */

#toolbox-controls > button,
#toolbox-dock-buttons > button {
  -moz-appearance: none;
  -moz-user-focus: normal;
  border: none;
  margin: 0 4px;
  min-width: 16px;
  width: 16px;
}

/* Save space in Firebug theme */
.theme-firebug #toolbox-controls button {
  margin-inline-start: 0 !important;
  min-width: 12px;
  margin: 0 1px;
}

#toolbox-dock-bottom::before {
  background-image: var(--dock-bottom-image);
}

#toolbox-dock-side::before {
  background-image: var(--dock-side-image);
}

#toolbox-dock-window::before {
  background-image: var(--dock-undock-image);
}

#toolbox-dock-bottom-minimize {
  /* Bug 1177463 - The minimize button is currently hidden until we agree on
     the UI for it, and until bug 1173849 is fixed too. */
  display: none;
}

#toolbox-dock-bottom-minimize::before {
  background-image: url("chrome://devtools/skin/images/dock-bottom-minimize@2x.png");
}

#toolbox-dock-bottom-minimize.minimized::before {
  background-image: url("chrome://devtools/skin/images/dock-bottom-maximize@2x.png");
}

#toolbox-dock-window,
#toolbox-dock-bottom,
#toolbox-dock-side {
  opacity: 0.8;
}

#toolbox-dock-window:hover,
#toolbox-dock-bottom:hover,
#toolbox-dock-side:hover {
  opacity: 1;
}

.devtools-separator {
  margin: 0 2px;
  width: 2px;
  background-image: linear-gradient(transparent 15%, var(--theme-splitter-color) 15%, var(--theme-splitter-color) 85%, transparent 85%);
  background-size: 1px 100%;
  background-repeat: no-repeat;
  background-position: 0, 1px, 2px;
}

#toolbox-buttons:empty + .devtools-separator,
.devtools-separator[invisible] {
  visibility: hidden;
}

#toolbox-controls-separator {
  margin: 0;
}

/* Command buttons */

.command-button {
  padding: 0;
  margin: 0;
  position: relative;
  -moz-user-focus: normal;
}

.command-button::before {
  opacity: 0.7;
}

.command-button:hover {
  background-color: var(--toolbar-tab-hover);
}

.command-button:hover:active,
.command-button[checked=true]:not(:hover) {
  background-color: var(--toolbar-tab-hover-active)
}

.command-button:hover::before {
  opacity: 0.85;
}

.command-button:hover:active::before,
.command-button[checked=true]::before,
.command-button[open=true]::before {
  opacity: 1;
}

/* Toolbox command buttons */

#command-button-paintflashing::before {
  background-image: var(--command-paintflashing-image);
}

#command-button-screenshot::before {
  background-image: var(--command-screenshot-image);
}

#command-button-responsive::before {
  background-image: var(--command-responsive-image);
}

#command-button-scratchpad::before {
  background-image: var(--command-scratchpad-image);
}

#command-button-pick::before {
  background-image: var(--command-pick-image);
}

#command-button-splitconsole::before {
  background-image: var(--command-splitconsole-image);
}

#command-button-noautohide::before {
  background-image: var(--command-noautohide-image);
}

#command-button-eyedropper::before {
  background-image: var(--command-eyedropper-image);
}

#command-button-rulers::before {
  background-image: var(--command-rulers-image);
}

#command-button-measure::before {
  background-image: var(--command-measure-image);
}

#command-button-frames::before {
  background-image: var(--command-frames-image);
}

#command-button-frames {
  background: url("chrome://devtools/skin/images/dropmarker.svg") no-repeat right;

  /* Override background-size from the command-button.
    The drop down arrow is smaller */
  background-size: 8px 4px !important;
}

#command-button-frames:-moz-dir(rtl) {
  background-position: left;
}

/* Tabs */

.devtools-tabbar {
  -moz-appearance: none;
  min-height: 24px;
  border: 0px solid;
  border-bottom-width: 1px;
  padding: 0;
  background: var(--theme-tab-toolbar-background);
  border-bottom-color: var(--theme-splitter-color);
}

#toolbox-tabs {
  margin: 0;
}

.toolbox-panel {
  display: -moz-box;
  -moz-box-flex: 1;
  visibility: collapse;
}

.toolbox-panel[selected] {
  visibility: visible;
}

.devtools-tab {
  -moz-appearance: none;
  -moz-binding: url("chrome://global/content/bindings/general.xml#control-item");
  -moz-box-align: center;
  min-width: 32px;
  min-height: 24px;
  max-width: 100px;
  margin: 0;
  padding: 0;
  border-style: solid;
  border-width: 0;
  border-inline-start-width: 1px;
  -moz-box-align: center;
  -moz-user-focus: normal;
  -moz-box-flex: 1;
}

/* Save space on the tab-strip in Firebug theme */
.theme-firebug .devtools-tab {
  -moz-box-flex: initial;
}

.theme-dark .devtools-tab {
  color: var(--theme-body-color-alt);
  border-color: #42484f;
}

.theme-light .devtools-tab {
  color: var(--theme-body-color);
  border-color: var(--theme-splitter-color);
}

.theme-dark .devtools-tab:hover {
  color: #ced3d9;
}

.devtools-tab:hover {
  background-color: var(--toolbar-tab-hover);
}

.theme-dark .devtools-tab:hover:active {
  color: var(--theme-selection-color);
}

.devtools-tab:hover:active {
  background-color: var(--toolbar-tab-hover-active);
}

.theme-dark .devtools-tab:not([selected])[highlighted] {
  background-color: hsla(99, 100%, 14%, .3);
}

.theme-light .devtools-tab:not([selected])[highlighted] {
  background-color: rgba(44, 187, 15, .2);
}

/* Display execution pointer in the Debugger tab to indicate
   that the debugger is paused. */
.theme-firebug #toolbox-tab-jsdebugger.devtools-tab:not([selected])[highlighted] {
  background-color: rgba(89, 178, 234, .2);
  background-image: url(chrome://devtools/skin/images/firebug/tool-debugger-paused.svg);
  background-repeat: no-repeat;
  padding-left: 13px !important;
  background-position: 3px 6px;
}

.devtools-tab > image {
  border: none;
  margin: 0;
  margin-inline-start: 4px;
  opacity: 0.6;
  max-height: 16px;
  width: 16px; /* Prevents collapse during theme switching */
}

.devtools-tab > label {
  white-space: nowrap;
  margin: 0 4px;
}

.devtools-tab:hover > image {
  opacity: 0.8;
}

.devtools-tab:active > image,
.devtools-tab[selected] > image {
  opacity: 1;
}

.devtools-tabbar .devtools-tab[selected],
.devtools-tabbar .devtools-tab[selected]:hover:active {
  color: var(--theme-selection-color);
  background-color: var(--theme-selection-background);
}

#toolbox-tabs .devtools-tab[selected],
#toolbox-tabs .devtools-tab[highlighted] {
  border-width: 0;
  padding-inline-start: 1px;
}

#toolbox-tabs .devtools-tab[selected]:last-child,
#toolbox-tabs .devtools-tab[highlighted]:last-child {
  padding-inline-end: 1px;
}

#toolbox-tabs .devtools-tab[selected] + .devtools-tab,
#toolbox-tabs .devtools-tab[highlighted] + .devtools-tab {
  border-inline-start-width: 0;
  padding-inline-start: 1px;
}

#toolbox-tabs .devtools-tab:first-child[selected] {
  border-inline-start-width: 0;
}

#toolbox-tabs .devtools-tab:last-child {
  border-inline-end-width: 1px;
}

.devtools-tab:not([highlighted]) > .highlighted-icon,
.devtools-tab[selected] > .highlighted-icon,
.devtools-tab:not([selected])[highlighted] > .default-icon {
  visibility: collapse;
}

/* The options tab is special - it doesn't have the same parent
   as the other tabs (toolbox-option-container vs toolbox-tabs) */
#toolbox-option-container .devtools-tab:not([selected]) {
  background-color: transparent;
}
#toolbox-option-container .devtools-tab {
  border-color: transparent;
  border-width: 0;
  padding-inline-start: 1px;
}
#toolbox-tab-options > image {
  margin: 0 8px;
}

/* Invert the colors of certain dark theme images for displaying
 * inside of the light theme.
 */
.theme-light .devtools-tab[icon-invertable] > image,
.theme-light .devtools-toolbarbutton > image,
.theme-light .devtools-button::before,
.theme-light #breadcrumb-separator-normal,
.theme-light .scrollbutton-up > .toolbarbutton-icon,
.theme-light .scrollbutton-down > .toolbarbutton-icon,
.theme-light #black-boxed-message-button .button-icon,
.theme-light #requests-menu-perf-notice-button .button-icon,
.theme-light #requests-menu-network-summary-button .button-icon,
.theme-light #toggle-breakpoints[checked] > image,
.theme-light .event-tooltip-debugger-icon {
  filter: var(--icon-filter);
}

/* Reset the filter defined above */
.theme-light .command-button:not(.command-button-invertable) {
  filter: none !important;
}

/* Since selected backgrounds are blue, we want to use the normal
 * (light) icons. */
.theme-light .devtools-tab[icon-invertable][selected] > image,
.theme-light .devtools-tab[icon-invertable][highlighted] > image {
  filter: none !important;
}

.theme-light .command-button:hover {
  background-color: inherit;
}

.theme-light .command-button:hover:active,
.theme-light .command-button[checked=true]:not(:hover) {
  background-color: inherit;
}

.hidden-labels-box:not(.visible) > label,
.hidden-labels-box.visible ~ .hidden-labels-box > label:last-child {
  display: none;
}

.devtools-invisible-splitter {
  border-color: transparent;
  background-color: transparent;
}

.devtools-horizontal-splitter,
.devtools-side-splitter {
  background-color: var(--theme-splitter-color);
}


/* Throbbers */
.devtools-throbber::before {
  content: "";
  display: inline-block;
  vertical-align: bottom;
  margin-inline-end: 0.5em;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: 1.1s linear throbber-spin infinite;
}

@keyframes throbber-spin {
  from {
    transform: none;
  }
  to {
    transform: rotate(360deg);
  }
}
