.tree-output .input { 
  position: relative; }
  .tree-output .input .open {
    height: 40px;
    border: 0;
    width: calc(100% - 40px); }
    .tree-output .input .open .placeholder {
      display: none; }
      .tree-output .input .open .placeholder.active {
        display: block; }
    .tree-output .input .open .chosen {
      display: none;
      height: 40px;
      border: 0;
      padding: 0 10px;
      width: 100%;
	  direction: rtl;
	  text-align: left;
      background: white;
      pointer-events: none; }
      .tree-output .input .open .chosen.active {
        display: block; }
  .tree-output .input .close {
    height: 40px;
    width: 40px;
    border: 0;
    position: absolute;
    right: 0;
    top: 0; }
    .tree-output .input .close span {
      display: block;
      height: 2px;
      width: 20px;
      position: absolute;
      top: calc(50% - 1px);
      left: 10px;
      transform-origin: center center;
      background: black; }
      .tree-output .input .close span:first-of-type {
        transform: rotate(45deg); }
      .tree-output .input .close span:last-of-type {
        transform: rotate(-45deg); }

.tree {
  position: fixed;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 30px;
  background: white;
  box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none; }
  .tree.active {
    opacity: 1;
    pointer-events: all; }
  .tree .tree-container {
    width: calc(100vw - 70px);
    max-width: 360px;
    height: calc(100vh - 100px);
    max-height: 500px;
    overflow: scroll;
    border: 1px solid black; }
  .tree .input-container {
    width: 100%;
    position: relative;
    margin-top: 10px;
    border: 1px solid black;
    line-height: 40px; }
    .tree .input-container .tree-input {
      display: block;
      width: auto;
      height: 40px;
      padding: 0 10px;
      border: 0;
	  direction: rtl;
	  text-align: left;
      line-height: 40px;
	  font-size: 1em;
	  background: white; }
    .tree .input-container button {
      height: 40px;
      float: right;
      padding: 0 20px;
      border: 0;
      cursor: pointer; }
  .tree .root {
    float: left;
    clear: both;
    padding: 10px; }
    .tree .root .name {
      float: left;
      clear: both; }
  .tree ul {
    float: left;
    clear: both;
    list-style: none;
    display: none; }
  .tree .active > .name {
    background: #505050;
    color: white; }
  .tree .open > ul {
    display: block; }
  .tree li {
    float: left;
    clear: both;
    position: relative;
    padding-left: 20px; }
    .tree li:before {
      content: "";
      height: 100%;
      width: 1px;
      position: absolute;
      left: 0px;
      top: 0;
      background: #b4b4b4; }
    .tree li .name {
      position: relative;
      cursor: pointer; }
      .tree li .name:before {
        content: "";
        height: 1px;
        width: 18px;
        position: absolute;
        left: -19px;
        top: calc(50% - 1px);
        background: #b4b4b4; }