.toc-sidebar {
  position: sticky;
  top: var(--topbar-h, 3.25rem);
  align-self: flex-start;
  flex: 0 0 var(--toc-w, 210px);
  max-height: calc(100dvh - var(--topbar-h, 3.25rem));
  overflow-y: auto;
  padding: 2rem 1rem 2rem 1.25rem;
}

.toc-sidebar ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.toc-sidebar a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-left: 0.6rem;
  margin-left: -0.6rem;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-sidebar a:hover {
  color: var(--ink);
}

.toc-sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.toc-title {
  font-family: var(--serif-body);
  font-size: 0.85rem;
}

@media (max-width: 1280px) {
  .toc-sidebar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toc-sidebar a {
    transition: none;
  }
}
