
#toc {
  /* IMPORTANT height must be calculated by javascript. */
    width: 240px;
    margin: 0;
    font-size: 14.72px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Aligns toc to the top and side of the allotted space, respectively */
#toc ul {
    margin: 0px;
    padding: 0px;
}

/* Places section titles */
#toc .title {
    margin-left: 1.4em;
    display: inline-block;
}


/* Places codenumbers */
#toc .codenumber {
    position: absolute;
    margin-right: 0;
    margin-left: 0em;
/*
    margin-top: 0.4px;
*/
    left: 0.3em;
    display: inline-block;
}

#toc .part > a .codenumber {
    position: relative;
    display: block;
    float: left;
    margin-right: 0.7em;
}
#toc .part > a .title {
    display: block;
    margin-left: 1em;
}

#toc ul li a {
    position: relative;
    display: block;
    padding: 2.86957px;
    padding-left: 1.6em;
    border-top: 1px solid #d1d1d1;
    border-bottom: 1px solid #d1d1d1;
}

/* Sets spacing between section headings*/
#toc > ul > li:not(:first-child) {
    margin-top: 0.3em;
}
/* But not at the start of a part */
/* I cannot see that this actually does anything --DF */
#toc > ul > li.part + li,
#toc > ul > li.frontmatter + li,
#toc > ul > li.backmatter + li {
    margin-top: 0;
}
/* Removes underlines from links in toc */
#toc ul li a, #toc ul li a:link, #toc ul li a:visited, #toc ul li a:hover, #toc ul li a:active {
    text-decoration: none;
}

#toc > ul > li > a, #toc > ul > li > a:link, #toc > ul > li > a:visited {
    font-weight: bold;
    font-family: "PT Serif", "Times New Roman", Times, serif;
    padding-left: 0.2em;
}

/* Ensures that there is no double border between subsections */
#toc ul li ul a {
    border-top: none;
}

/* Allows both "top" and bottom border of a subsection to be highlighted on hover */
#toc ul li ul a:hover {
    border-top: 1px solid #3c110a;
    margin-top: -1px;
}

/* Removes the excess space between the last subsection and the next section (caused by
the margin on top of sections being used to space out adjacent sections) */
#toc ul li ul li:last-child {
    margin-bottom: -0.3em;
}

/* Removes double border between last subsection and next section */
#toc ul li ul li:last-child a {
    border-bottom: none;
}

#toc ul li a:active {
  box-shadow: rgba(0, 0, 0, 0.5) 0 2px 5px inset;
}

