${list}`;
});
rst.addEventListener("click", ()=>{
byId("r_task").selectedIndex = 0;
byId("r_medium").selectedIndex = 0;
byId("r_Q").value = 300;
out.style.display = "none";
out.innerHTML = "";
});
}
function tocActive(){
const toc = byId("toc");
if(!toc) return;
const links = Array.from(toc.querySelectorAll('a.pill[href^="#"]'));
const map = new Map();
links.forEach(a=>{
const id = (a.getAttribute("href")||"").slice(1);
const sec = document.getElementById(id);
if(sec) map.set(sec, a);
});
const obs = new IntersectionObserver((entries)=>{
entries.forEach(e=>{
const a = map.get(e.target);
if(!a) return;
if(e.isIntersecting){
links.forEach(x=>x.classList.remove("active"));
a.classList.add("active");
}
});
}, {rootMargin:"-30% 0px -60% 0px", threshold:0.01});
map.forEach((_,sec)=>obs.observe(sec));
}
renderPills("model_pills");
renderPills("catalog_pills");
fillCompareSelects();
attachUsecases();
routerSuggest();
tocActive();
})();