& {
  transform: scale(1); // so that sidebar gets attached here
}

.debug-sidebar {

  $sidebar-w: 119px;
  $toggle-w: 7px;
  $trans-time: 0.33s;

  position: absolute;
  box-sizing: border-box;
  width: $sidebar-w + $toggle-w;
  background: var(--color-bg-2);
  // color: var(--color-fg);
  height: 100%;
  transform: translateX(-$sidebar-w);
  transition: transform $trans-time;

  button {
    width: 100%;
  }
  input[type=checkbox] {
    display: none;
  }
  label {
    font-weight: normal;
  }

  + .tab-body {
    margin-left: 6px;
    padding-left: 10px;
    transition: margin-left $trans-time;
  }

  &.no-transition + .tab-body {
    transition: none;
  }

  .collapse { display: none; }
  .sidebar-content {
    padding: 0 11px 0 4px;
    opacity: 0;
    overflow: hidden;
  }

  &.show {
    transform: translateX(0);
    .expand { display: none; }
    .collapse { display: block; }
    + .tab-body {
      margin-left: $sidebar-w + $toggle-w;
    }
    .sidebar-content {
      opacity: 1;
      transition: opacity 0.33s;
    }
  }

  .sidebar-toggle {
    position: absolute;
    box-sizing: border-box;
    right: 0;
    top: 0;
    height: 100%;
    width: $toggle-w;
    background: var(--color-bg-2);
    border-left: 1px solid var(--color-ui-border);
    border-right: 1px solid var(--color-ui-border);
    cursor: pointer;
    display: flex;
    color: var(--color-ui-border);
    text-align: center;
    z-index: 1;
    &:hover {
      color: var(--color-fg-2);
      background: var(--color-bg-2-hover);
    }
    > div {
      margin: auto;
      padding-left: 1px;
    }
  }

  // see https://stackoverflow.com/a/40678740/1371433
  .debug-filters {
    position: relative;
    margin: 0 -4px 10px -4px;
    ul {
      margin-left: 0;
    }
    li {
      text-indent: 0;
      padding-left: 10px;
    }
    > li {
      padding-left: 4px;
      > *:first-child {
        padding-top: 3px;
        padding-bottom: 3px;
      }
      > ul {
        margin-left: -10px;
        > li {
          padding-left: 32px;
        }
      }
    }
    label {
      padding: 2px 0 2px 100%;
      white-space: nowrap;
      &.disabled span {
        /*
        color: #818a91
        */
        opacity: 0.5;
      }
    }
    label,
    ul ul {
      margin-left: -100%;
      padding-left: 100%;
    }
  }

  .fa-times-circle { color: var(--color-error-fg); }
  .fa-warning { color: var(--color-warn-fg); }
  .fa-info-circle { color: var(--color-info-fg); }

  .toggle {
    cursor: pointer;
    &.active {
      background: var(--color-bg-2-hover);
      &:hover {
        background: color-mix(in srgb, var(--color-button-bg-hover), #000 30%);
      }
    }
    &:hover,
    &:hover + ul {
      background: var(--color-button-bg-hover);
      .toggle.active {
        background: color-mix(in srgb, var(--color-button-bg-hover), #000 30%);
      }
    }
  }

  /*
  .expand-all {
    font-size: 1.25em;
  }
  */
}
