
#main-content {
    width: 100%;
    box-sizing: border-box;
    scroll-behavior: smooth;  /* Keep smooth scrolling */
  }
  
  /* ToC button styling */
  .toc-button {
    position: fixed;
    right: 0;
    top: 0;
    /* Removed transform to prevent conflicts */
    background-color: var(--bg-surface-l-1);
  /*  color: #fff; */
   /* padding: var(--space-xs) var(--space-4xs); */
   /* border-top-left-radius: var(--radius-full);
    border-bottom-left-radius: var(--radius-full);*/
   /* border: 1px solid var(--border-primary); */
    cursor: pointer;
    z-index: 1000;
    touch-action: none; /* Prevent default touch actions */
    /* Ensure smooth movement */
    transition: top 0.1s ease-out;
  }
  
  /* Adjust ToC button during dragging */
  .toc-button.dragging {
    /* Remove transitions during dragging for immediate response */
    transition: none;
    /* Optional: Add visual feedback during dragging */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  /* ToC panel styling */
  .toc-panel {
    position: fixed;
    right: -75%;
    border-radius: var(--radius-s) 0 0 var(--radius-s);
    top: 0;
    width: 75%;
    height: 100%;
    backdrop-filter: blur(8px);
    background-color: #00000072;
    border: 1px solid var(--border-primary);
    overflow: hidden; /* Hide scrollbar */
    z-index: 999;
    padding-top: 20px;
    transition: right 0.3s ease;
    touch-action: none; /* Prevent default touch behaviors */
  }
  
  /* Open state */
  .toc-panel.open {
    right: 0;
  }
  
  /* ToC list styling */
  .toc-panel .toc-list {
    overflow-y: auto; /* Enable vertical scrolling if needed */
    height: 100%;
    position: relative;
  }
  
  .toc-panel ul {
    list-style: none;
    padding: 0 20px;
    margin: 0;
  }
  
  .toc-panel li {
    padding: var(--space-s);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: var(--radius-s);
   /* transition: font-size 0.3s ease,  background-color 0.3s ease, color 0s; */
  }
  
  .toc-panel li.active {
    background-color: var(--primary);
    color: var(--dark);
   font-weight: bold; 
    font-size: var(--text-3xl);
    transition: none;
  }
  
  .toc-panel a {
    color: inherit;
    text-decoration: none;
  }
  
  /* Hide scrollbar for html and body */
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none; /* WebKit (Chrome, Safari, Edge Chromium) */
    width: 0;  /* Sometimes needed for Chrome */
    height: 0; /* Sometimes needed for Chrome */
    background: transparent; /* Optional: Make scrollbar background transparent */
  }
  
  html,
  body {
    -ms-overflow-style: none;  /* IE and Edge Legacy */
    scrollbar-width: none;  /* Firefox */
    /* Ensure scrolling is still possible */
    /* Do NOT add overflow: hidden; here, as it will disable scrolling */
  }
  