/* Shared table of contents behavior for Stacio Wiki articles. */
.toc { position:sticky; top:100px; max-height:calc(100svh - 122px); overflow-y:auto; overflow-x:visible; padding:18px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:0 14px 28px rgba(22,40,74,.08); }
.toc-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 10px; }
.toc h2 { margin:0; font-size:14px; }
.wiki-toc-return { display:inline-flex; align-items:center; min-height:28px; gap:4px; color:var(--accent); font-size:13px; font-weight:700; line-height:1; text-decoration:none; transition:color 160ms ease,transform 160ms ease; }
.wiki-toc-return:hover { color:var(--accent); text-decoration:none; transform:translateX(-2px); }
.wiki-toc-return:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.toc-list-wrap { position:relative; }
.toc-fluid { position:absolute; inset:0; pointer-events:none; filter:url(#toc-goo); }
.toc-indicator,.toc-droplet { position:absolute; left:0; right:0; height:36px; border-radius:18px 15px 17px 14px; background:color-mix(in oklab,var(--accent) 15%,transparent); box-shadow:inset 0 1px 0 color-mix(in oklab,var(--accent) 24%,white),0 5px 14px color-mix(in oklab,var(--accent) 14%,transparent); opacity:0; transform:translateY(0); transition:transform 560ms cubic-bezier(.22,1,.36,1),border-radius 380ms ease,opacity 180ms ease; }
.toc-indicator { z-index:1; }
.toc-droplet { z-index:0; width:20px; right:auto; left:0; height:20px; margin-top:8px; border-radius:50%; transition:transform 520ms cubic-bezier(.16,1,.3,1),opacity 440ms ease; }
.toc ol { position:relative; z-index:2; margin:0; padding:0; display:grid; gap:3px; list-style:none; font-size:13px; }
.toc li { min-width:0; }
.toc-row { position:relative; z-index:2; display:flex; align-items:center; min-height:36px; }
.toc a { position:relative; display:flex; flex:1; align-items:center; gap:10px; min-width:0; min-height:36px; padding:7px 10px; border-radius:16px 13px 15px 12px; color:var(--muted); line-height:1.25; transform-origin:left center; transition:color 180ms ease,font-weight 180ms ease,transform 360ms cubic-bezier(.22,1,.36,1); }
.toc-heading .wiki-toc-return { flex:0 0 auto; min-width:0; min-height:28px; padding:0; border-radius:0; color:var(--accent); line-height:1; transform-origin:left center; }
.toc-index { flex:0 0 24px; text-align:right; font-variant-numeric:tabular-nums; }
.toc-label { min-width:0; }
.toc a.is-active { color:var(--accent); font-weight:750; transform:scale(1.045); }
.toc a:hover { color:var(--accent); }
.toc-sublist { display:grid; gap:2px; margin:1px 0 4px; padding:0; overflow:hidden; opacity:1; max-height:720px; transition:max-height 340ms cubic-bezier(.22,1,.36,1),opacity 200ms ease,margin 240ms ease; }
.toc-item.is-collapsed > .toc-sublist { max-height:0; margin:0; opacity:0; pointer-events:none; }
.toc-item-level-3 .toc-row { padding-left:18px; }
.toc-item-level-3 .toc-index { flex-basis:32px; font-size:12px; }
.toc-toggle { position:relative; z-index:3; flex:0 0 28px; width:28px; height:28px; margin-right:3px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); cursor:pointer; transition:background 160ms ease,color 160ms ease,transform 240ms ease; }
.toc-toggle::before { content:""; position:absolute; top:9px; left:10px; width:7px; height:7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); transition:transform 240ms ease; }
.toc-toggle:hover { color:var(--accent); background:color-mix(in oklab,var(--accent) 10%,transparent); }
.toc-item.is-collapsed > .toc-row .toc-toggle::before { transform:rotate(-45deg); }
.toc-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }

@media (max-width:900px) {
  .toc { position:static; max-height:none; overflow:visible; }
  .toc-fluid { display:none; }
  .toc > .toc-list-wrap > ol { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:20px; }
  .toc-sublist { grid-column:1 / -1; }
}

@media (max-width:640px) {
  .toc { padding:14px; }
  .toc > .toc-list-wrap > ol { grid-template-columns:1fr; }
}
