/* ---------- toasts & modals ---------- */
function toast(html,kind='',actions=[],open=null){
if(S)logNote(html,kind,actions,open);
const el=document.createElement('div');el.className='toast '+kind;el.dataset.born=performance.now();
el.innerHTML=`
${html}
${actions.map(a=>btn(a.l,a.act,a.args,'sm')).join('')}`;
const box=$('toasts');box.prepend(el);const max=innerWidth<760?2:3;while(box.children.length>max)box.lastChild.remove();
setTimeout(()=>{el.style.transition='opacity .4s';el.style.opacity=0;setTimeout(()=>el.remove(),400);},actions.length?8000:4500);
}