/*
# 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(/resources/ui-base.css);
@import url(/resources/ui-color.css);

:root.rtl {
  direction: rtl;
}

:root > * {
  transition: opacity 0.25s ease-out;
}
:root:not(.initialized) > * {
  opacity: 0;
}

/*
body {
  background: var(--in-content-box-background);
  color: var(--text-color);
}
*/

@media (prefers-color-scheme: dark) {
  body {
    background: var(--in-content-box-background);
    color: var(--text-color);
  }
}

body.independent {
  background: var(--bg-color);
  box-sizing: border-box;
  color: var(--text-color);
  cursor: default;
  display: flex;
  flex-direction: column;
  font: caption;
  margin-block: 0;
  margin-inline: 0;
  padding-block: 1em 100%;
  padding-inline: 1em;
  -moz-user-select: none;
}

em {
  font-style: normal;
  font-weight: bold;
}

p, ul {
  margin-block: 0 0.5em;
  margin-inline: 0;
  padding-block: 0;
  padding-inline: 0;
}

ul,
ul li {
  list-style: none;
}

p.sub,
div.sub {
  padding-inline-start: 2em;
}

ul p.sub,
ul div.sub p {
  margin-block: 0;
}

pre {
  white-space: pre-wrap;
}

label[disabled="true"],
input[disabled="true"] {
  opacity: 0.5;
}
label[disabled="true"] input,
label[disabled="true"] button {
  opacity: 1;
}

label.has-checkbox:not(.inline),
label.has-radio:not(.inline) {
  margin-inline-start: 2em;
  text-indent: -2em;
  display: block;
  width: -moz-fit-content;
}

.hidden,
:root:not(.expose-unblock-autoplay-features) .unblock-autoplay-features {
  display: none;
}


#style-radiogroup {
  align-content: flex-start;
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding-block: 0;
  padding-inline: 0;
}

#style-radiogroup li {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  margin-block-end: 0.5em;
  padding-block: 0;
  padding-inline: 0;
  width: calc(1em + 100px + 8em); /* radio + image + label */
}

#style-radiogroup li img {
  max-width: 100px;
}

.style-name {
  white-space: pre;
}

#applyThemeColorToIcon ~ img {
  max-width: 85px;
}

#showTabDragBehaviorNotification ~ img {
  max-width: 120px;
}

label input[type="radio"] ~ img,
label input[type="checkbox"] ~ img {
  border: 1px solid var(--ThreeDShadow);
  vertical-align: middle;
  margin-block: 0.15em;
}

#syncTabsToDeviceOptions label input[type="radio"] ~ img {
  border: 0 none;
}

.preview-image {
  background: no-repeat;
  background-size: contain;
  box-shadow: 0.25em 0.25em 0.5em rgba(0, 0, 0, 0.45);
  display: inline-block;
  height: 125px /*83px*/;
  inset-inline-end: 0;
  margin-inline-start: 0.5em;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 1.5em;
  transition: opacity 0.25s ease-out;
  width: 120px /*80px*/;
}
.has-preview-image:not([data-value="-1"]):hover .preview-image {
  opacity: 1;
}
.has-preview-image[data-value="0"] .preview-image {
  background-image: url("as-independent.png");
}
.has-preview-image[data-value="1"] .preview-image,
.has-preview-image[data-value="5"] .preview-image,
.has-preview-image[data-value="6"] .preview-image,
.has-preview-image[data-value="7"] .preview-image {
  background-image: url("as-child.png");
}
.has-preview-image[data-value="2"] .preview-image {
  background-image: url("as-sibling.png");
}
.has-preview-image[data-value="3"] .preview-image,
.has-preview-image[data-value="4"] .preview-image {
  background-image: url("as-next-sibling.png");
}



#browserThemeCustomRules {
  -moz-user-select: text;
  cursor: text;
}

#tooLargeUserStyleRulesCaution {
  color: var(--red-50);
  margin-block-end: 0;
  visibility: hidden;
}
#tooLargeUserStyleRulesCaution.invalid {
  visibility: visible;
}

#userStyleRulesField {
  margin-block: 0;
  margin-inline: -5px;
  min-height: 10em;
  overflow: hidden;
  resize: vertical;
}

#userStyleRulesField > .CodeMirror {
  border: thin solid;
  height: calc(100% - 10px);
  margin-block: 5px;
  margin-inline: 5px;
}

#userStyleRulesField > .CodeMirror.CodeMirror-focused {
  border-color: var(--in-content-border-focus);
  box-shadow: 0 0 0 1px var(--in-content-border-active),
              0 0 0 4px var(--in-content-border-active-shadow);
}

#userStyleRulesField.invalid > .CodeMirror {
  border-color: var(--red-50);
  --in-content-border-active: var(--red-50);
  --in-content-border-active-shadow: var(--red-50-a30);
}

#userStyleRulesField.invalid .CodeMirror-scroll {
  background-color: var(--red-50-a10);
}

.CodeMirror-wrap pre.CodeMirror-line,
.CodeMirror-wrap pre.CodeMirror-line-like {
  word-break: break-all !important;
}

#userStyleRules-footer-bar {
  display: flex;
  flex-direction: row;
}

#userStyleRules-footer-bar button {
  margin-inline-end: 0.5em;
}

#userStyleRules-footer-bar .spacer {
  display: flex;
  flex-grow: 1;
}


table {
  border-collapse: collapse;
}
th + *,
td + * {
  border-inline-start: 1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
}
tbody tr {
  border-block-start: 1px solid light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2));
}


.contextConfigs tbody th,
.tabDragBehaviorConfigs tbody th {
  font-weight: normal;
}

.contextConfigs tbody th,
.tabDragBehaviorConfigs thead th,
.tabDragBehaviorConfigs tbody th {
  text-align: start;
}

.contextConfigs td,
.tabDragBehaviorConfigs td {
  text-align: center;
}

.contextConfigs table input[type="checkbox"],
.tabDragBehaviorConfigs table input[type="radio"] {
  margin-inline: 1.5em;
}


#externalAddonPermissionsGroup td:nth-child(2) {
  text-align: center;
}
#externalAddonPermissionsGroup td:nth-child(2) input[type="checkbox"] {
  margin-inline: 3em;
}


fieldset.collapsible.collapsed > *:not(legend):not(div) /* "div" is for the container of "import" and "export" buttons */ {
  display: none;
}

fieldset.collapsible > legend::before,
body > section > h1:first-child::before {
  content: "▼";
  display: inline-block;
  font-size: 65%;
  margin-inline-end: 0.5em;
  position: relative;
  transition: transform 0.2s ease;
}

fieldset.collapsible.collapsed > legend::before,
body > section.collapsed > h1:first-child::before {
  transform: rotate(-90deg);
}

:root.rtl fieldset.collapsible.collapsed > legend::before,
:root.rtl body > section.collapsed > h1:first-child::before {
  transform: rotate(90deg);
}


:root.successor-tab-support .without-successor-tab-support,
:root:not(.successor-tab-support) .with-successor-tab-support {
  display: none;
}


body > section {
  margin-block-start: 1em;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}
body > section:not(.collapsed) {
  max-height: none !important;
}

body > section > h1:first-child {
  margin-block-start: 0;
  cursor: pointer;
}

body > section > h1:first-child ~ * {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}
body > section.collapsed > h1:first-child ~ * {
  opacity: 0;
}


#defaultBookmarkParentChooser {
  max-width: 100%;
}

:target {
  box-shadow: 0 0 0.5em highlight;
  margin-block: 0.5em;
}


:root:not(.show-expert-options) .expert:not(option.expert[selected]) {
  display: none;
}

.expert:not(option) {
  background: var(--in-content-box-info-background);
  box-shadow: 0 0 0.5em var(--in-content-box-info-background),
              0 0 0.5em var(--in-content-box-info-background),
              0 0 0.5em var(--in-content-box-info-background);
}


#link-optionsPage-top {
  float: inline-end;
  padding-inline-end: 1em;
}

body.independent #link-optionsPage-top {
  display: none;
}


input[type="checkbox"].missing-permission {
  opacity: 0.5;
}
input[type="checkbox"].missing-permission,
input[type="checkbox"].missing-permission ~ * {
  cursor: help;
}
