.isg-toc-container {
    background: #f9f9f9;
    border: 1px solid #aaa;
    padding: 1em 1em 0 1em;
    margin-bottom: 2em;
    width: 95%;
    display: table;
    /* font-size: 95%; */
}
.isg-toc-title {
    font-weight: 700;
}
.isg-toc-list, .isg-toc-list ol {
    margin-left: 0;
    padding-left: 0;
}
.isg-toc-list li {
    list-style: none;
    margin-left: 0;
}
.isg-toc-list li li {
    margin-left: 1em;
}

/* Hierarchical list styling */
.toc-child-list {
    margin-top: 0.5em;
    padding-left: 1.5em;
}

/* Counter styles - Fixed for proper hierarchical numbering */
.isg-toc-container.counter-decimal ol {
    counter-reset: section;
    list-style-type: none;
}

.isg-toc-container.counter-decimal li::before {
    counter-increment: section;
    content: counters(section, ".") ". ";
    float: left;
    margin-right: 0.5em;
}

.isg-toc-container.counter-decimal li {
    display: block;
}

/* Symbol counters */
.isg-toc-container.counter-disc .isg-toc-list li a:before,
.isg-toc-container.counter-circle .isg-toc-list li a:before,
.isg-toc-container.counter-square .isg-toc-list li a:before {
    display: inline-block;
    width: 1em;
}
.isg-toc-container.counter-disc .isg-toc-list li a:before { content: "• "; }
.isg-toc-container.counter-circle .isg-toc-list li a:before { content: "◦ "; }
.isg-toc-container.counter-square .isg-toc-list li a:before { content: "▪ "; }

/* Counter position styles */
.isg-toc-container.counter-position-outside li { margin-left: 1.5em; text-indent: -1.5em; }
.isg-toc-container.counter-position-inside li { text-indent: 0; }

/* Article heading numbering for decimal counter */
.isg-numbered-heading:before {
    margin-right: 0.5em;
    font-weight: bold;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll margin for headings */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
    scroll-margin-top: 30px; /* Default for desktop */
}

/* Mobile scroll margin */
@media (max-width: 768px) {
    h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
        scroll-margin-top: 30px; /* Can be different for mobile */
    }
}
