:root {
  --color-accent-green: rgb(98, 181, 71);
  --color-accent-green-reduced-opacity: rgba(98, 181, 71, .5);
  --color-accent-green-text: rgb(255, 255, 255);
  --color-body-background: rgb(235, 235, 235);
  --color-body-text: rgb(33, 37, 42);
  --color-body-text-reduced-opacity: rgba(33, 37, 42, .5);
  --color-border: rgb(210, 210, 210);
  --color-border-hover: rgb(150, 150, 150);
  --color-box-background: rgb(255, 255, 255);
  --color-box-shadow: rgba(0, 0, 0, .25);
  --color-close: rgb(255, 255, 255);
  --color-close-hover: rgb(230, 230, 230);
  --color-debug-background: rgb(237, 237, 237);
  --color-gradient-1: rgba(0, 0, 0, .1);
  --color-gradient-2: rgba(255, 255, 255, .25);
  --color-gradient-3: rgba(0, 0, 0, .25);
  --color-gradient-4: rgb(0, 139, 185);
  --color-gradient-5: rgb(72, 185, 89);
  --color-link: rgb(90, 90, 90);
  --color-link-hover: rgb(120, 120, 120);
  --color-modal-background: rgba(0, 0, 0, .75);
  --color-modal-confirmation: rgb(172, 0, 0);
  --color-modal-primary: rgb(98, 181, 71);
  --color-status-error: rgb(172, 0, 0);
  --color-status-neutral: rgb(150, 150, 150);
  --color-status-warning: rgb(255, 165, 0);
  --color-text-shadow: rgb(0, 0, 0);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-accent-green: rgb(70, 129, 50);
    --color-accent-green-reduced-opacity: rgba(70, 129, 50, .65);
    --color-accent-green-text: rgb(255, 255, 255);
    --color-body-background: rgb(54, 59, 71);
    --color-body-text: rgb(235, 235, 235);
    --color-body-text-reduced-opacity: rgba(235, 235, 235, .65);
    --color-border: rgb(111, 112, 136);
    --color-border-hover: rgb(165, 165, 165);
    --color-box-background: rgb(77, 78, 103);
    --color-box-shadow: rgba(0, 0, 0, .25);
    --color-close: rgb(255, 255, 255);
    --color-close-hover: rgb(230, 230, 230);
    --color-debug-background: rgb(55, 60, 75);
    --color-gradient-1: rgba(0, 0, 0, .1);
    --color-gradient-2: rgba(255, 255, 255, .25);
    --color-gradient-3: rgba(0, 0, 0, .25);
    --color-gradient-4: rgb(0, 139, 185);
    --color-gradient-5: rgb(72, 185, 89);
    --color-link: rgb(190, 190, 190);
    --color-link-hover: rgb(165, 165, 165);
    --color-modal-background: rgba(0, 0, 0, .75);
    --color-modal-confirmation: rgb(68, 81, 111);
    --color-modal-primary: rgb(70, 129, 50);
    --color-status-error: rgb(190, 46, 46);
    --color-status-neutral: rgb(165, 165, 165);
    --color-status-warning: rgb(255, 165, 0);
    --color-text-shadow: rgb(0, 0, 0);
  }
}

body {
  margin: 0;
  font-family: Verdana, sans-serif;
  font-size: 16px;
  background-color: var(--color-body-background);
  color: var(--color-body-text);
  overflow-x: hidden;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color ease 250ms;
}

a:not(.button):hover {
  color: var(--color-link-hover);
}

input[type='search'], input[type='text'] {
  box-sizing: border-box;
  padding: 10px;
  width: 100%;
  border: none;
  background-color: var(--color-box-background);
  color: var(--color-body-text);
  outline: none;
  border-bottom: solid 2px var(--color-border);
  transition: border ease 500ms;
}

input[type='search']:hover, input[type='text']:hover {
  border-color: var(--color-border-hover);
}

input[type='search']:focus, input[type='text']:focus {
  border-color: var(--color-accent-green);
}

button {
  position: relative;
  margin: 12px 0;
  padding-left: 30px;
  padding-right: 30px;
  height: 40px;
  transform: perspective(1px) translateZ(0);
  font-size: 18px;
  border: 2px solid var(--color-accent-green);
  background-color: var(--color-box-background);
  color: var(--color-body-text);
  cursor: pointer;
  box-shadow: 0 0 1px transparent;
  transition-property: color;
  transition-duration: 250ms;
}

button:disabled {
  color: var(--color-body-text-reduced-opacity);
  cursor: default;
}

button:not(:disabled)::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  transform: scale(0);
  background-color: var(--color-body-background);
  transition-property: transform;
  transition-duration: 250ms;
  transition-timing-function: ease-out;
}

button:not(:disabled):hover::before, button:not(:disabled):focus::before, button:not(:disabled):active::before {
  transform: scale(1);
}

button#btn-cancel {
  border-color: var(--color-status-error);
}

button#reset-whitelist {
  margin-left: 10px;
  border-color: var(--color-status-error);
}

.clearfix::after {
  content: '';
  display: table-cell;
  clear: both;
}

.hidden {
  display: none !important; /* stylelint-disable-line declaration-no-important */
}

.center {
  text-align: center;
}

.animated-visibility.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.animated-visibility {
  visibility: visible;
  opacity: 1;
  transition: visibility 0ms 1000ms, opacity 1000ms linear;
}

.animated-visibility.active-check {
  transition: visibility 0ms 0ms, opacity 1000ms linear;
}

.checkbox {
  position: relative;
  width: 90px;
}

.checkbox.inline {
  display: inline-block;
}

.checkbox:not(.inline) {
  margin-bottom: 10px;
}

.checkbox label {
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  border: 2px solid var(--color-border);
  background-color: var(--color-box-background);
  text-indent: 35px;
  white-space: nowrap;
  cursor: pointer;
  transition: border ease 500ms;
}

.checkbox label:hover {
  border-color: var(--color-border-hover);
}

.checkbox label::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 7px;
  width: 9px;
  height: 5px;
  transform: rotate(-45deg);
  border: 3px solid var(--color-border-hover);
  border-top: none;
  border-right: none;
  opacity: .2;
}

.checkbox label span {
  vertical-align: middle;
}

.checkbox input[type='checkbox']:checked + label::after {
  opacity: 1;
}

#header-wrapper {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
}

#header {
  position: relative;
  background-color: var(--color-box-background);
  transition: height 250ms ease-in-out;
}

#header-wrapper.default #header {
  height: 100px;
}

#header-wrapper.compact #header {
  height: 60px;
}

#logo-wrapper {
  position: relative;
  left: -10px;
  width: 435px;
  height: 120px;
  transform: skew(-5deg) translateZ(0);
  background-color: var(--color-box-background);
  box-shadow: 0 0 10px 0 var(--color-box-shadow);
  transition: top 500ms ease-in-out;
}

#header-wrapper.default #logo-wrapper {
  top: 0;
}

#header-wrapper.compact #logo-wrapper {
  top: -200px;
}

#logo-wrapper a {
  display: block;
  width: inherit;
  height: inherit;
  transform: skew(5deg) translateZ(0);
  background-image: url('../images/logo-large.png');
  background-position: right 25px center;
  background-size: 375px 85px;
  background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
  #logo-wrapper a {
    background-image: url('../images/logo-large-dm.png');
  }
}

#logo-small {
  position: absolute;
  top: 0;
  padding: 18px 15px;
  width: 29px;
  height: 25px;
  background-image: url('../images/icon.svg');
  background-position: center center;
  background-size: 29px 25px;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: left 500ms ease-in-out;
}

#header-wrapper.default #logo-small {
  left: -200px;
}

#header-wrapper.compact #logo-small {
  left: 0;
}

#status-board {
  position: absolute;
  font-size: 14px;
  transition: all 500ms ease-in-out;
}

#header-wrapper.default #status-board {
  top: 25px;
  left: 450px;
}

#header-wrapper.compact #status-board {
  top: 6px;
  left: 65px;
}

#status-board .item {
  display: inline-block;
  padding: 0 15px;
  text-align: center;
}

#status-board .label {
  font-weight: 700;
}

#status-board .label::after {
  content: ':';
}

#status-board .value {
  margin-top: 5px;
  padding: 2px 5px;
  border-radius: 3px;
  background-color: var(--color-accent-green);
  color: var(--color-accent-green-text);
}

#status-board .value.errors {
  background-color: var(--color-status-error);
}

#status-board .value.warnings {
  background-color: var(--color-status-warning);
}

#progress {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 20px;
  border: none;
  background-color: var(--color-body-background);
  transition: padding 250ms ease-in-out;
}

#header-wrapper.default #progress {
  padding-left: 355px;
}

#header-wrapper.compact #progress {
  padding-left: 0;
}

#progress::-moz-progress-bar {
  background-image:
    linear-gradient(135deg, transparent 33%, var(--color-gradient-1) 33%, var(--color-gradient-1) 66%, transparent 66%),
    linear-gradient(to bottom, var(--color-gradient-2), var(--color-gradient-3)),
    linear-gradient(to right, var(--color-gradient-4), var(--color-gradient-5));
  background-size: 35px 20px, 100% 100%, 100% 100%;
}

#main {
  display: flex;
  box-sizing: border-box;
  padding: 130px 0 140px;
  width: 100%;
}

#main-section {
  width: 100%;
}

#fox {
  position: absolute;
  top: 135px;
  right: 30px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--color-accent-green-reduced-opacity);
  animation: waggle 1000ms 3000ms forwards ease-out;
  transition: background ease 500ms;
}

#fox:hover {
  background-color: var(--color-accent-green);
}

#fox img {
  float: right;
  width: inherit;
  height: inherit;
  animation: waggle 1000ms 3000ms forwards ease-out;
}

#hint {
  position: absolute;
  z-index: 10;
  left: 20px;
  right: 130px;
  padding: 20px 15px;
  border-radius: 5px;
  background-color: var(--color-accent-green);
  color: var(--color-accent-green-text);
  box-shadow: 0 0 10px 0 var(--color-box-shadow);
}

#hint::before {
  content: '';
  position: absolute;
  inset: 35px -20px auto auto;
  width: 0;
  height: 0;
  border: 12px solid;
  border-color: var(--color-accent-green) transparent transparent var(--color-accent-green);
}

#hint .notice {
  margin-bottom: 10px;
  font-weight: 700;
}

#results {
  margin: 35px 0;
}

#results ul {
  margin: 0;
  list-style: none;
}

#results li .wrapper {
  padding: 0 10px 0 35px;
}

#results > ul > li .wrapper {
  padding: 10px 10px 10px 35px;
}

#results > ul {
  padding: 0;
}

#results > ul > li > .wrapper {
  margin-top: -1px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#results li li.has-children > .wrapper {
  margin-top: -1px;
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#results li li:not(.has-children) > .wrapper {
  margin-top: -1px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-left: 1px dotted var(--color-border);
}

#results li.has-children > .wrapper {
  background-image: url('../images/folder.png');
  background-position: 10px center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
  #results li.has-children > .wrapper {
    background-image: url('../images/folder-dm.png');
  }
}

#results li:not(.has-children) > .wrapper {
  background-image: url('../images/bookmark.png');
  background-position: 10px 12px;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
  #results li:not(.has-children) > .wrapper {
    background-image: url('../images/bookmark-dm.png');
  }
}

#results li:not(.has-children) .name {
  font-weight: 700;
}

#results li:not(.has-children) .name.no-name {
  font-weight: 400;
  font-style: italic;
  color: var(--color-body-text-reduced-opacity);
}

#results .name {
  position: relative;
}

#results .default-wrapper .name::before, #results .duplicates-item > li > a::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

#results .default-wrapper .name::before {
  top: 24px;
  left: -24px;
}

#results .duplicates-item > li > a::before {
  top: 14px;
  left: 14px;
}

#results .error .default-wrapper .name::before, #results .duplicates-item > li > a::before {
  background-color: var(--color-status-error);
}

#results .warning .default-wrapper .name::before {
  background-color: var(--color-status-warning);
}

#results .unknown .default-wrapper .name::before {
  background-color: var(--color-status-neutral);
}

#results .redirect .new-url {
  position: relative;
}

#results .redirect .new-url::before {
  content: '';
  position: absolute;
  top: 3px;
  left: -25px;
  width: 16px;
  height: 16px;
  background-image: url('../images/redirect.png');
  background-position: center center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
  #results .redirect .new-url::before {
    background-image: url('../images/redirect-dm.png');
  }
}

#results .action-buttons {
  margin-top: 5px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0ms, opacity 500ms linear;
}

#results li:hover > .wrapper > .action-buttons, #results .duplicates > li:hover .action-buttons {
  visibility: visible;
  opacity: 1;
}

#results .action-buttons a {
  font-size: 12px;
}

#results .action-buttons a:hover {
  font-size: 12px;
}

#results .action-buttons a:not(:last-child) {
  margin-right: 30px;
}

#results .duplicates-item {
  margin-top: 100px;
}

#results .duplicates-item > li > a {
  display: block;
  position: relative;
  margin-top: -1px;
  padding: 10px 10px 10px 35px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#results .duplicates li {
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
  border-left: 1px dotted var(--color-border);
}

#results .duplicates .url {
  padding-left: 24px;
  background-image: url('../images/folder.png');
  background-position: 0 2px;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
  #results .duplicates .url {
    background-image: url('../images/folder-dm.png');
  }
}

#search {
  margin-top: 10px;
  margin-left: 30px;
  width: calc(100% - 165px);
}

#filterbar {
  margin-top: 10px;
  margin-left: 30px;
}

#filterbar:not(.hidden) {
  display: inline-block;
}

#mass-actions {
  float: right;
  margin-top: 5px;
  margin-right: 135px;
  text-align: right;
}

#mass-actions a {
  display: block;
}

#start {
  position: fixed;
  bottom: 160px;
  left: 30px;
  padding-left: 120px;
  height: 120px;
  font-size: 30px;
  background-image: url('../images/start.png');
  background-position: left center;
  background-size: 100px 100px;
  background-repeat: no-repeat;
}

#control-bar {
  position: fixed;
  z-index: 10;
  bottom: 64px;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--color-box-background);
}

#control-bar select {
  appearance: none;
  margin: 12px 5px 12px 10px;
  padding-left: 10px;
  padding-right: 40px;
  width: 310px;
  height: 40px;
  font-size: 18px;
  border: 2px solid var(--color-body-text);
  background-image: url('../images/arrow-down.png');
  background-position: right 10px center;
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-color: transparent;
  color: var(--color-body-text);
  cursor: pointer;
  transition: background ease 500ms;
}

@media (prefers-color-scheme: dark) {
  #control-bar select {
    background-image: url('../images/arrow-down-dm.png');
  }
}

#control-bar select:hover {
  background-color: var(--color-body-background);
}

#control-bar select:focus-visible {
  color: transparent;
  text-shadow: 0 0 0 var(--color-text-shadow);
}

#control-bar option {
  padding: 0 12px;
  font-size: 14px;
}

#options-form {
  padding: 10px 30px;
}

#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 20px;
  height: 64px;
  line-height: 64px;
  font-size: 14px;
  background-color: var(--color-body-background);
}

#footer a {
  display: block;
  padding-left: 40px;
  background-image: url('../images/sh-at.png');
  background-repeat: no-repeat;
  background-size: 32px 32px;
  background-position: center left;
  color: var(--color-body-text);
}

#debug-output-wrapper {
  padding: 30px 10px;
  max-height: 500px;
  border-top: 1px dotted var(--color-border);
  background-color: var(--color-debug-background);
  overflow: scroll;
}

#mask {
  position: absolute;
  inset: 0;
}

#mask img {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -120px;
  margin-left: -32px;
  width: 64px;
  height: 64px;
}

#spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -11px;
  margin-left: -35px;
  width: 70px;
  height: 22px;
  text-align: center;
}

#spinner > div {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--color-accent-green);
  animation: spinner 1400ms infinite ease-in-out both;
}

#spinner .bounce1 {
  animation-delay: -320ms;
}

#spinner .bounce2 {
  animation-delay: -160ms;
}

.modal-dialog {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-modal-background);
  overflow: auto;
}

.modal-content {
  position: relative;
  top: 50%;
  margin: -150px auto auto;
  width: 80%;
  animation-name: animateFromTop;
  animation-duration: 250ms;
}

.close {
  float: right;
  margin-top: -10px;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-close);
  text-decoration: none;
  cursor: pointer;
  transition: color ease 250ms;
}

.close:hover, .close:focus {
  color: var(--color-close-hover);
}

.modal-header {
  padding: 15px;
  background-color: var(--color-modal-primary);
  color: var(--color-accent-green-text);
}

.modal-body {
  padding: 5px 15px;
  background-color: var(--color-body-background);
}

.modal-body label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 700;
}

.modal-footer {
  padding: 5px;
  background-color: var(--color-modal-primary);
  color: var(--color-accent-green-text);
}

.confirm-dialog .modal-content {
  max-width: 600px;
}

.confirm-dialog .modal-header, .confirm-dialog .modal-footer {
  background-color: var(--color-modal-confirmation);
}

#permission-container {
  position: absolute;
  top: calc(50% - 65px);
  left: 50%;
  padding: 25px;
  width: 980px;
  max-width: 80vw;
  line-height: 1.5;
  border-radius: 8px;
  transform: translateX(-50%) translateY(-50%);
  background-color: var(--color-box-background);
  color: var(--color-body-text);
  box-shadow: 2px 3px 5px var(--color-box-shadow);
}

#permission-needed {
  font-weight: 700;
}

#permission-description {
  margin-top: 15px;
}

#permission-grant-button {
  margin-top: 20px;
}

@keyframes animateFromTop {
  from {
    top: -300px;
    opacity: 0;
  }

  to {
    top: 50%;
    opacity: 1;
  }
}

@keyframes spinner {
  0%, 80%, 100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

@keyframes waggle {
  0% {
    transform: none;
  }

  50% {
    transform: rotateZ(-20deg) scale(1.2);
  }

  60% {
    transform: rotateZ(25deg) scale(1.2);
  }

  67.5% {
    transform: rotateZ(-15deg) scale(1.2);
  }

  75% {
    transform: rotateZ(15deg) scale(1.2);
  }

  82.5% {
    transform: rotateZ(-12deg) scale(1.2);
  }

  85% {
    transform: rotateZ(0) scale(1.2);
  }

  100% {
    transform: rotateZ(0) scale(1);
  }
}
