/* Left-hand contents rail for the lecture notes, styled like the table of
   contents on the publication reading pages. Shown on wide screens only;
   narrower screens keep the in-page Contents box instead. */
:root{--toc-active:#1b5fbf;--toc-active-soft:rgba(27,95,191,.09);--toc-hover:rgba(20,32,46,.05)}
@media (prefers-color-scheme:dark){:root{--toc-active:#8fc0ff;--toc-active-soft:rgba(112,180,255,.10);--toc-hover:rgba(255,255,255,.06)}}

h1[id],h2[id],h3[id],.box[id],li[id]{scroll-margin-top:var(--toc-offset,16px)}
.notes-toc{display:none}

.notes-toc-inner{border-left:2px solid var(--line);padding-left:1rem}
.notes-toc-head{margin:0 0 .55rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;font-size:.72rem;color:var(--muted)}
.notes-toc nav{display:flex;flex-direction:column;gap:.1rem}
.notes-toc a{display:block;color:var(--muted);text-decoration:none;font-size:.88rem;line-height:1.3;padding:.28rem .5rem .28rem calc(1rem - 2px);margin-left:-1rem;border-radius:8px;border-left:2px solid transparent;transition:color .15s,background .15s,border-color .15s}
.notes-toc a:hover{color:var(--text);background:var(--toc-hover)}
.notes-toc a.l2{padding-left:calc(1rem - 2px + .95rem);font-size:.82rem}
.notes-toc a.top{font-style:italic}
.notes-toc a.active{color:var(--toc-active);border-left-color:var(--toc-active);background:var(--toc-active-soft)}

@media (min-width:1200px){
  .notes-shell{display:grid;grid-template-columns:15.5rem minmax(0,880px);justify-content:center;column-gap:2.2rem;padding:0 16px}
  .notes-shell>.wrap{margin:0;max-width:none;min-width:0}
  .notes-toc{display:block;position:sticky;top:0;align-self:start;max-height:100vh;overflow-y:auto;padding:30px 4px 24px 0;scrollbar-width:thin}
  .notes-shell nav.toc{display:none}
}
/* very wide screens: an empty right column of the same width keeps the text centred */
@media (min-width:1560px){
  .notes-shell{grid-template-columns:15.5rem minmax(0,880px) 15.5rem}
}
@media print{
  .notes-toc{display:none!important}
  .notes-shell{display:block!important}
  .notes-shell nav.toc{display:block!important}
}
