/* HE_PILLAR_SIDEBAR_V70D
   Desktop: scrollable navigation rail beside the article.
   The document/article itself never becomes an inner scroll container. */

html{
  height:auto!important;
  min-height:100%!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:scroll!important;
}
body{
  position:static!important;
  height:auto!important;
  min-height:100vh!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:visible!important;
}
body>main,main{
  position:static!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}

/* Restore the desktop two-column layout after v70c. */
.toc-shell{
  display:grid!important;
  grid-template-columns:330px minmax(0,1fr)!important;
  gap:48px!important;
  align-items:start!important;
  width:min(var(--max),calc(100% - 40px))!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  padding:28px 0 76px!important;
}

/* Only this left rail has its own scroll area. */
.toc{
  position:sticky!important;
  top:22px!important;
  align-self:start!important;
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:calc(100vh - 44px)!important;
  overflow-x:hidden!important;
  overflow-y:scroll!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
  scrollbar-width:thin!important;
  scrollbar-color:#d4a77f #16383b!important;
  margin:0!important;
  padding:18px 12px 18px 16px!important;
  border:1px solid rgba(255,255,255,.12)!important;
  border-radius:20px!important;
  background:#102f32!important;
  box-shadow:0 14px 34px rgba(14,42,45,.16)!important;
}
.toc::-webkit-scrollbar{width:8px!important}
.toc::-webkit-scrollbar-track{background:#16383b!important;border-radius:999px!important}
.toc::-webkit-scrollbar-thumb{background:#d4a77f!important;border-radius:999px!important;border:2px solid #16383b!important}

.toc-title{
  position:sticky!important;
  top:-18px!important;
  z-index:2!important;
  display:block!important;
  margin:0 0 8px!important;
  padding:16px 8px 14px!important;
  border-bottom:1px solid rgba(255,255,255,.18)!important;
  background:#102f32!important;
  color:#f1caa7!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  font-size:11px!important;
  font-weight:900!important;
  line-height:1.2!important;
  letter-spacing:.16em!important;
  text-transform:uppercase!important;
}

.toc-links{
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}

.toc>a,.toc-links>a{
  display:grid!important;
  grid-template-columns:35px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:start!important;
  width:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:10px 7px!important;
  border:0!important;
  border-bottom:1px solid rgba(255,255,255,.095)!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#f7f4ec!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  font-size:13px!important;
  font-weight:720!important;
  line-height:1.38!important;
  letter-spacing:.004em!important;
  text-decoration:none!important;
  text-shadow:0 1px 0 rgba(0,0,0,.12)!important;
}
.toc>a:last-child,.toc-links>a:last-child{border-bottom-color:transparent!important}

/* Subtle grouping after 04, 08 and 12. */
.toc>a:nth-of-type(5),.toc>a:nth-of-type(9),.toc>a:nth-of-type(13),
.toc-links>a:nth-of-type(5),.toc-links>a:nth-of-type(9),.toc-links>a:nth-of-type(13){
  margin-top:9px!important;
  padding-top:14px!important;
  border-top:1px solid rgba(241,202,167,.36)!important;
}

.toc>a:hover,.toc-links>a:hover{
  background:rgba(255,255,255,.09)!important;
  color:#ffffff!important;
}
.toc>a.is-active,.toc-links>a.is-active{
  background:#f4eee4!important;
  color:#102f32!important;
  box-shadow:inset 3px 0 0 #cf754d!important;
  text-shadow:none!important;
}

.toc-num{
  display:inline-flex!important;
  width:31px!important;
  height:27px!important;
  flex:0 0 31px!important;
  align-items:center!important;
  justify-content:center!important;
  margin-top:1px!important;
  border:1px solid rgba(255,255,255,.16)!important;
  border-radius:8px!important;
  background:rgba(255,255,255,.10)!important;
  color:#f1caa7!important;
  font-family:Inter,ui-sans-serif,system-ui,sans-serif!important;
  font-size:10px!important;
  font-weight:900!important;
  line-height:1!important;
  letter-spacing:.08em!important;
}
.toc a.is-active .toc-num{
  border-color:#102f32!important;
  background:#102f32!important;
  color:#fff!important;
}
.toc-label{
  min-width:0!important;
  padding-top:4px!important;
}

/* Critical: article remains part of normal document flow. */
.article,
.toc-shell>.article,
.article-section{
  position:static!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
}
.article{min-width:0!important;margin:0!important;padding:0!important}
.article-section{scroll-margin-top:26px!important}

/* Tablet/mobile: navigation stays above article, but remains compact + scrollable. */
@media(max-width:940px){
  .toc-shell{
    grid-template-columns:1fr!important;
    gap:26px!important;
  }
  .toc{
    position:relative!important;
    top:auto!important;
    max-height:370px!important;
    overflow-y:scroll!important;
    margin:0 0 6px!important;
  }
  .toc-title{top:-18px!important}
}
@media(max-width:620px){
  .toc-shell{width:min(100% - 26px,var(--max))!important;padding-top:22px!important}
  .toc{max-height:330px!important;padding:14px 9px 14px 13px!important;border-radius:16px!important}
  .toc-title{top:-14px!important;padding:13px 7px 12px!important}
  .toc>a,.toc-links>a{font-size:12.5px!important;padding:9px 6px!important}
}
