/* 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/. */

:root {
  color-scheme: light dark;
  direction: ltr;
  -moz-control-character-visibility: visible;
  height: 100%;
}

#viewsource {
  font-family: -moz-fixed;
  font-weight: normal;
  white-space: pre;
  counter-reset: line;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  /* stylelint-disable-next-line media-query-no-invalid */
  @media -moz-pref("view_source.wrap_long_lines") {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

pre {
  font: inherit;
  color: inherit;
  white-space: inherit;
}

span[id] {
  display: block;
  margin-left: 5ch;
}

span[id]::before {
  content: counter(line) " ";
  counter-increment: line;
  user-select: none;
  display: inline-block;
  width: 5ch;
  margin-left: -5ch;
  text-align: right;
  color: #ccc;
  font-weight: normal;
  font-style: normal;
}

/* stylelint-disable-next-line media-query-no-invalid */
@media -moz-pref("view_source.syntax_highlight") {
  .start-tag,
  .end-tag {
    color: light-dark(purple, #f55e5e);
    font-weight: bold;
  }
  .comment {
    color: light-dark(green, lightgreen);
    font-style: italic;
  }
  .cdata {
    color: light-dark(#cc0066, #f068ac);
  }
  .doctype,
  .markupdeclaration {
    color: light-dark(steelblue, lightgray);
    font-style: italic;
  }
  .pi {
    color: orchid;
    font-style: italic;
  }
  .entity {
    color: light-dark(#ff4500, #f18a65);
  }
  .text {
    font-weight: normal;
  }
  .attribute-name {
    font-weight: bold;
  }
  .attribute-value {
    color: light-dark(blue, #97bbff);
    font-weight: normal;
  }
  .error {
    color: revert;
    font-weight: bold;
    background-color: rgba(231, 116, 113, 0.3);
    text-decoration: underline wavy red 0.5px;
  }
}

span:not(.error),
a:not(.error) {
  unicode-bidi: embed;
}
