
:root {
  --dark-grey: #ccc;
  --main-color: #565656;
  --font-size: 14px;
  --line-height: 1.2;
}

.table-of-contents {
  margin: 0rem 0 1rem 0;
  position: relative;
padding: 20px;
border: #ccc 1px solid;
border-radius: 8px;
max-width:275px;
}

.table-of-contents .toc-headline {
  font-size: 20px;
  color: var(--main-color);
  font-weight: 600;
  display: block;
  cursor: pointer;
}

.table-of-contents .toggle-toc {
  position: absolute;
  top: 8px;
  right: 1rem;
  font-size: 30px;
  cursor: pointer;
  font-weight: 800;
  color: var(--main-color);
}

.table-of-contents ul {
  padding: 0;
  padding-left: 1rem;
}

.table-of-contents li {
  position: relative;
  padding-left: 1rem;
  list-style: none;
  line-height: var(--line-height);
  font-weight: 400;
  margin: .3rem 0;
  transition: .2s ease all;
}

.table-of-contents li:hover {
  padding-left: 1.1rem;
}

.table-of-contents li a {
  font-size: var(--font-size);
  line-height: var(--line-height);
  text-decoration: none;
  color: var(--main-color);
}

.table-of-contents li:before {
  content: '';
  -webkit-transform: translateX(-0.75em) rotate(45deg);
  transform: translateX(-0.75em) rotate(45deg);
  height: 0.5em;
  width: 0.5em;
  border-top: solid 2px var(--dark-grey);
  border-right: solid 2px var(--dark-grey);
  border-radius: 0;
  background: 0 0;
  position: absolute;
  display: block;
  top: 7px;
  left: 0;
}

.table-of-contents li>ul {
  padding-left: 0.7rem;
  padding-bottom: 1rem;
}