div.coto {
  border: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  padding: 0;
  background-color: #fff;
}

div.coto-inner {
  padding: 12px;
  padding-top: 0;
  margin: 0;
  border: transparent 2px solid;

  div.sub-cotos-button {
    padding-top: 5px;
    text-align: center;

    i {
      vertical-align: bottom;
    }
  }

  div.load-subgraph {
    padding-top: 10px;
    text-align: center;
  }

  div.main-sub-border {
    padding-top: 3px;
    border-bottom: 1px solid #eee;
  }

  div.close-reordering-div {
    z-index: 10;
    position: -webkit-sticky;
    position: sticky;
    top: -12px;
    left: 0;

    div.close-reordering-button {
      display: inline-block;
      padding-top: 10px;
      background-color: rgba(255, 255, 255, .9);
    }
  }

  a.posted-in {
    margin-left: 5px;
    font-size: 12px;
    color: #ccc;
  }
}

div.coto-header {
  position: relative;
  min-height: 12px;
  text-align: right;

  i.coto-status {
    margin-left: 10px;
    opacity: .5;
  }

  i.in-pinned-graph {
    display: none;
  }
}

.repost div.coto-header {
  min-height: auto;
}

div.blank-content {
  text-align: center;
  color: #ccc;

  i {
    vertical-align: middle;
    font-size: 1.8rem;
  }
}

div.parents {
  color: #999;
  font-size: 80%;
  margin-top: 3px;
  margin-bottom: 12px;

  div.parent {
    padding: 3px 6px;
    margin-bottom: 3px;
    background-color: #f8f8f8;
    cursor: pointer;

    &:hover {
      background-color: #eee;
    }

    div.blank-content i {
      font-size: 1.5rem;
    }
  }
}

div.coto-body {
  position: relative;

  div.topic-coto-body {
    position: relative;

    .topic-icon {
      position: absolute;
      top: 4px;
      left: 0;
      width: 15px;
      height: 15px;
      opacity: 0.8;
    }

    div.coto-summary {
      padding-left: 20px;
    }

    // text-indent for topic-coto content without summary
    & > div.content > p {
      text-indent: 20px;
    }
  }

  div.coto-summary {
    span.summary {
      font-weight: bold;
      opacity: .5;
    }

    a.toggle-coto-content {
      margin-right: 6px;
      vertical-align: middle;
    }
  }

  div.coto-collapsible-content {
    display: none;

    &.open {
      display: block;
      margin-top: 10px;
    }
  }
}

span.coto-tool-buttons {
  position: absolute;
  top: -40px;
  right: -10px;
  z-index: 10;
  display: none;
  height: 34px;
  padding: 0;
  padding-top: 3px;
  padding-right: 10px;
  border: 1px solid #eee;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  background-color: rgba(255, 255, 255, .6);
  white-space: nowrap;

  &::before {
    content: '';
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    right: 0;
    bottom: -10px;
    border-top: 10px solid #eee;
    border-right: 10px solid transparent;
    border-left: 10px solid transparent;
  }

  &::after {
    content: '';
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    right: 0;
    bottom: -8px;
    border-top: 10px solid rgba(255, 255, 255, .8);
    border-right: 10px solid transparent;
    border-left: 10px solid transparent;
  }

  a.tool-button {
    margin-left: 10px;

    i.material-icons {
      font-size: 30px;
    }

    i.fa {
      width: 30px;
      text-align: center;
      font-size: 26px;
      vertical-align: 5px;
    }
  }

  span.connecting-buttons {
    a.tool-button {
      color: #ffa500;
      opacity: 1;
    }

    i {
      font-size: 27px;
      vertical-align: 5px;
    }
  }

  span.border {
    display: inline-block;
    border-right: 1px solid #eee;
    margin-left: 10px;
    vertical-align: 2px;
    height: 26px;
  }

  @media (max-width: 400px) {
    a.pin-coto,
    a.repost {
      display: none;
    }
  }
}

div.sub-cotos {
  div.outbound-conn {
    margin-top: 8px;
    border-left: 3px solid #ddd;
    border-radius: 4px;

    div.coto {
      padding-bottom: 0;
      border-style: none;
      box-shadow: none;
    }

    div.coto-inner {
      padding: 3px 8px;
      padding-right: 0;
    }

    div.linking-phrase {
      position: relative;
      height: 30px;

      .linking-phrase {
        position: absolute;
        top: -6px;
        left: -13px;
        border: 1px solid #ddd;
        border-radius: 4px 4px 0 0;
        background-color: #fff;
        padding: 2px 10px;
        opacity: 1;
        white-space: nowrap;
        max-width: 80%;
        overflow-x: hidden;
        text-overflow: ellipsis;
      }

      span.linking-phrase {
        color: #aaa;
      }
    }

    div.coto-header {
      position: relative;
      min-height: auto;
    }

    div.sub-coto-body {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;

      div.coto-body {
        flex: 1;
        width: 100%;
      }

      div.sub-cotos-button {
        width: 24px;

        i {
          margin-top: -8px;
        }
      }
    }

    div.coto-body {
      span.coto-tool-buttons {
        right: -10px;
      }
    }

    div.coto-summary,
    span.cotonoma-label {
      font-size: 1.5rem;
    }
  }
} 

div.coto.selectable {
  &.element-focus > div.coto-inner > div.coto-header > span.coto-tool-buttons {
    display: inline-block !important;
  }

  &.coto-focus > div.coto-inner {
    border: 2px dotted #ccc !important;
    background-color: #fafafa;
  }

  &.selected > div.coto-inner {
    border: 2px solid #ffa500 !important;
  }

  &.focused-in-reordering > div.coto-inner {
    background-color: #ffffee;
  }
}

a.cotonoma-link {
  text-decoration: none;
}

span.cotonoma-label {
  img.avatar {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    margin-right: 6px;
    vertical-align: middle;
    border-radius: 4px;
  }

  span.cotonoma-name {
    margin-left: 3px;
    font-weight: bold;
    vertical-align: middle;
  }

  span.shared i {
    color: #ccc;
    margin-left: 6px;
    font-size: 20px;
    vertical-align: middle;
  }
}

span.not-accessible {
  span.cotonoma-name {
    color: #aaa;
  }

  i {
    color: #ccc;
    margin-left: 4px;
    font-size: 18px;
    vertical-align: -4px;
  }
}

div.simplified-coto {
  border: 1px solid #ddd;

  div.coto-inner {
    padding-top: 10px;
  }

  div.coto-summary {
    font-weight: bold;
    opacity: .5;
  }
}
