.tch-toc{
  position: fixed;
  right: 18px;
  top: 140px;
  width: 240px;
  z-index: 50;
}

.tch-toc[hidden]{ display:none !important; }

.tch-toc__inner{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  border-radius: 12px;
  overflow: hidden;
}

/* ドラッグハンドル（タイトル部） */
.tch-toc__title{
  font-weight: 700;
  font-size: 13px;
  padding: 10px 12px;
  margin: 0;
  cursor: grab;
  user-select: none;
  background: rgba(0,0,0,.03);
  border-bottom: 1px solid rgba(0,0,0,.06);
  text-align: center;
}
.tch-toc.is-dragging .tch-toc__title{ cursor: grabbing; }

.tch-toc__nav{
  padding: 10px 12px;
  /* ここが重要：ノートPC等で下が切れない */
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.tch-toc__list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.tch-toc__link{
  display: block;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
}

.tch-toc__link:hover{
  background: rgba(0,0,0,.05);
}

.tch-toc__link.is-active{
  background: rgba(0,0,0,.08);
  font-weight: 700;
}

/* 見出しレベル差（軽くインデント） */
.tch-toc__item.level-3 .tch-toc__link{ padding-left: 16px; }
.tch-toc__item.level-4 .tch-toc__link{ padding-left: 24px; }

.tch-toc__top{
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(0,0,0,.06);
  background: #fff;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tch-toc__top:hover{
  background: rgba(0,0,0,.03);
}

/* ドラッグで動かした後は、right/top固定から left/top運用へ */
.tch-toc.is-dragged{ right: auto; }

.tch-toc__nav[hidden]{ display:none !important; }

