.ht-toc{
  margin-bottom:20px;
}

.ht-toc__details{
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--surface);
  overflow:hidden;
}

html[data-theme="dark"] .ht-toc__details{
  background:var(--surface-2);
  border-color:var(--border);
}

.ht-toc__summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  cursor:pointer;
}

.ht-toc__summary::-webkit-details-marker{
  display:none;
}

.ht-toc__summary-label{
  color:var(--fg);
}

.ht-toc__summary-icon{
  width:16px;
  height:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--fg);
  transition:transform .2s ease;
}

.ht-toc__summary-icon svg{
  width:100%;
  height:100%;
  display:block;
}

.ht-toc__details[open] .ht-toc__summary-icon{
  transform:rotate(180deg);
}

.ht-toc__body{
  padding:8px 0 10px 8px;
  border-top:1px solid var(--border);
  max-height:360px;
  overflow-y:auto;
  overflow-x:hidden;
  counter-reset:ht-toc-step;
}

.ht-toc__body::-webkit-scrollbar{
  width:4px;
}

.ht-toc__body::-webkit-scrollbar-track{
  background:transparent;
}

.ht-toc__body::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.5);
  border-radius:999px;
}

html[data-theme="dark"] .ht-toc__body::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.8);
}

.ht-toc__body ul,
.ht-toc__body ol{
  margin:0;
  padding:0;
  list-style:none;
}

.ht-toc__body li{
  position:relative;
  margin:0 0 4px 0;
}

.ht-toc__body li::marker{
  content:none;
}

.ht-toc__item--h2{
  padding-right:30px;
}

.ht-toc__item--h2::before{
  content:counter(ht-toc-step);
  counter-increment:ht-toc-step;
  position:absolute;
  top:50%;
  right:2px;
  width:22px;
  height:22px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:500;
  color:var(--brand-600);
  background:var(--surface);
  box-shadow:0 0 0 1px var(--brand-500);
  transform:translateY(-50%);
}

html[data-theme="dark"] .ht-toc__item--h2::before{
  background:var(--surface-2);
}

.ht-toc__item--h3{
  padding-right:40px;
}

.ht-toc__item--h3::before{
  content:"";
  position:absolute;
  top:50%;
  right:20px;
  width:12px;
  height:2px;
  border-radius:999px;
  background:var(--border);
  transform:translateY(-50%);
}

.ht-single__main .ht-toc__body a{
  all:unset;
  display:block;
  width:100%;
  box-sizing:border-box;
  padding:6px 0;
  color:var(--fg);
  font-size:13px;
  line-height:1.7;
  cursor:pointer;
  border-radius:8px;
  text-decoration:none;
}

.ht-single__main .ht-toc__item--h2 a{
  font-weight:500;
}

.ht-single__main .ht-toc__item--h3 a{
  font-size:12px;
  font-weight:400;
  color:var(--muted);
}

.ht-single__main .ht-toc__body a,
.ht-single__main .ht-toc__body a:hover,
.ht-single__main .ht-toc__body a:focus,
.ht-single__main .ht-toc__body a:active,
.ht-single__main .ht-toc__body a:visited{
  text-decoration:none;
}

.ht-single__main .ht-toc__body a:focus-visible{
  outline:2px solid var(--border);
  outline-offset:2px;
}
