:root{
  --smart-toc-accent:#995A32;
  --smart-toc-maxw:420px;
}

.smart-toc{
  background:#ffffff;
  border:1px solid rgba(0,0,0,0.10);
  border-radius:16px;
  padding:14px 14px 16px 14px;
  margin:0 0 30px 0;
  max-width: var(--smart-toc-maxw);
  box-shadow: 0 12px 26px rgba(17,24,39,0.06);
}

.smart-toc--sticky{
  position: sticky;
  top: 110px; /* adjust to your header height */
}

.smart-toc-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 10px 0;
}

.smart-toc-title{
  font-weight:800;
  font-size:16px;
  margin:0;
  color:#111827;
}

.smart-toc-toggle{
  appearance:none;
  border:1px solid rgba(0,0,0,0.10);
  background:#fff;
  color:#111827;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: transform .16s ease, box-shadow .16s ease;
}

.smart-toc-toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(17,24,39,0.08);
}

.smart-toc-chevron{
  width:10px;height:10px;
  border-right:2px solid rgba(17,24,39,0.6);
  border-bottom:2px solid rgba(17,24,39,0.6);
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.smart-toc.is-collapsed .smart-toc-chevron{
  transform: rotate(-135deg);
}

.smart-toc-list{
  list-style:none;
  padding:0;
  margin:0;
}

.smart-toc.is-collapsed .smart-toc-list{
  display:none;
}

.smart-toc-list li{ margin:6px 0; }

.smart-toc-list li a{
  text-decoration:none;
  font-size:14px;
  color:#374151;
  transition:color .2s ease;
}

.smart-toc-list li a.active{
  color: var(--smart-toc-accent);
  font-weight:700;
}

.toc-h3{ padding-left:12px; }
.toc-h4{ padding-left:24px; }
.toc-h5{ padding-left:36px; }
.toc-h6{ padding-left:48px; }
