#thread-view {
  position: relative;

  .level {
    width: $post-width;
    display: flex;
    flex-direction: column;
    margin-left: auto;
    margin-right: 125px;

    .box {
      border-style: solid;
      border-width: 0 0 0 4px;
    }
  }

  .level-2 {
    width: 885px;
  }

  .level-3 {
    width: 845px;
  }

  .level-4 {
    width: 805px;
  }

  @for $i from 5 through 12 {
    .level-#{$i} {
      width: 765px;
    }
  }
}

.idea {
  position: relative;

  .padding-left-right {
    padding-left: 40px;
    padding-right: 40px;
  }

  .subject-prefix {
    font-family: $font-family4;
  }

  .no-rows {
    margin-top: 20px;
  }

  .child-level {
    .box {
      border-style: solid;
      border-width: 4px;
    }
  }

  .level-1,
  .level-2,
  .level-3,
  .level-4 {
    padding-bottom: $post-space;
    padding-left: $tree-indentation * 2;
    border-top-style: solid;
    border-top-width: 1px;
    border-left-style: solid;
    border-left-width: 1px;

    .box {
      border-top: none;
    }

    &:last-child {
      border-left: none;
      padding-bottom: 0;
    }
  }

  .level-5 {
    padding-bottom: $post-space;

    &:last-child {
      padding-bottom: 0;
    }
  }

  .postfolded-container {
    cursor: pointer;
    position: relative;
    top: -8px;
  }

  .expand-indented {
    font-size: $font-size-xs;
    cursor: pointer;
    display: inline-block;
    position: relative;
    height: $post-space;
    border-left-style: solid;
    border-left-width: 1px;
    width: $tree-indentation;

    span {
      position: absolute;
      bottom: -12px;
      left: -15px;
    }
  }

  .expand {
    border-left-style: solid;
    border-left-width: 1px;
    cursor: pointer;
    position: relative;
    height: $post-space;

    span {
      position: absolute;
      bottom: 28px;
      left: -14px;
    }
  }

  .post-folded {
    cursor: pointer;
    display: inline-block;
    font-size: $font-size-xs;
    position: relative;

    span {
      display: block;
      margin: 3px 0 0 20px;
      width: 400px;
    }
  }

  .no-shift {
    .post-folded {
      span {
        bottom: 0;
        left: 0;
      }
    }
  }

  .infinite-separator {
    margin: $margin-section auto;
    width: 200px;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    position: relative;

    span {
      position: absolute;
      background-color: $page-bkg-grey;
      width: 50px;
      padding: 0 15px 0 0;
      top: -8px;
      margin: 0 0 0 75px;
      text-align: center;
    }
  }

  .padding-right {
    padding-right: $tree-indentation;
  }

  .tree-list {
    will-change: auto !important;

    &:focus {
      outline: none;
    }
  }
}

@media screen and (min-width: $screen-xl-min) {
  #thread-view {
    .padding-left-right {
      padding-left: 110px;
      padding-right: 110px;
    }
  }
}

@media screen and (max-width: 992px) {
  #thread-view {
    .border-left {
      border-left: none;
    }

    .padding-left-right {
      padding-left: 20px;
      padding-right: 20px;
    }

    .level {
      border-top-style: solid;
      border-top-width: 1px;
      margin-top: 20px;
    }

    .level-1 {
      margin-left: 0;
      padding-left: 0;
      padding-right: 20px;
    }

    .level-2,
    .level-3,
    .level-4 {
      margin-left: 0;
      padding-left: 0;
      padding-bottom: 0;
    }

    .expand-indented {
      display: none;
    }

    .expand {
      display: none;
    }

    .padding-right {
      padding-right: 0;
    }

    .postfolded-container {
      top: 0;
    }
  }
}

@media screen and (max-width: $post-width) {
  #thread-view {
    .padding-left-right {
      padding-left: 10px;
      padding-right: 10px;
    }

    .level {
      width: 100%;
      padding-bottom: 0;
    }

    .margin-txt-xxs {
      margin-left: 20px;
      margin-right: 20px;
    }
  }
}

@media screen and (max-width: $screen-xxs-max) {
  #thread-view .level-1 {
    padding-right: 0;
  }

  .posts-filter-button {
    display: none;
  }
}

@media (max-width: $screen-sm-max) and (orientation: landscape) {
  .posts-filter-button {
    display: none;
  }
}
