/* === Shared styles === */
#toc {
    padding: 8px;
  }
  
  #toc ul {
    list-style: none;
    margin: 0;
    padding-left: 12px;
  }
  
  #toc ul ul {
    display: none;
  }
  
  #toc li.expanded > ul {
    display: block;
  }

  #toc a.active {
    font-weight: bold;
    color: #111;
  }
  
  #toc li {
    margin-bottom: 4px;
    line-height: 1.4;
  }
  
  #toc a {
    text-decoration: none;
    color: #444;
    transition: color 0.2s ease;
  }
  
  #toc a:hover {
    text-decoration: underline;
    color: #000;
  }
  
  #toc-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    background: #fff;
    border: 1px solid #ccc;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    box-shadow: none;
  }
  
  #toc-toggle svg {
    display: block;
  }
  
  /* === Desktop mode (default) === */
  #toc-container {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 250px;
    max-height: 75vh;
    overflow-y: auto;
    background: transparent;
    border: none;
    padding: 0;
    font-family: sans-serif;
    font-size: 16px;
    z-index: 999;
    display: block;
    opacity: 1;
  }
  
  /* === Mobile overlay styles === */
  @media (max-width: 1250px) {
    #toc-container {
      display: none;
      opacity: 0;
      transition: opacity 0.3s ease;
      position: fixed;
      bottom: 60px;
      right: 20px;
      padding: 12px 16px;
      border-radius: 12px;
      max-height: 70vh;
      overflow-y: auto;
      width: max-content;
      max-width: 80vw;
      z-index: 1000;
  
      /* 🧊 Glass effect */
      background: rgba(255, 255, 255, 0.4);
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px); /* Safari support */
      border: 1px solid rgba(255, 255, 255, 0.3);
      box-shadow: inset 0 0 0.5px rgba(255,255,255,0.5), 0 4px 20px rgba(0, 0, 0, 0.1);
    }
  
    #toc-container.visible {
      display: block;
      opacity: 1;
    }
  
    #toc-toggle {
      display: block;
    }
  }
  
  