/* ── Smart TOC – Stylish Design ── */

.smart-toc {
    display: inline-block;
    min-width: 240px;
    max-width: 500px;
    width: auto;
    margin: 1.6em 0 1.8em 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    font-size: 0.94em;
    font-family: inherit;
    border: 1px solid #d0d7de;
}

/* ── Header (clickable) ── */
.stoc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.stoc-header:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0a3880 100%);
}

.stoc-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stoc-icon {
    font-size: 1em;
    opacity: 0.95;
}

.stoc-title {
    font-weight: 700;
    font-size: 0.95em;
    color: #fff;
    letter-spacing: 0.02em;
}

/* ── Arrow indicator ── */
.stoc-arrow {
    color: rgba(255,255,255,0.9);
    font-size: 0.8em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.smart-toc.stoc-open .stoc-arrow {
    transform: rotate(180deg);
}

/* ── Collapsible body — CLOSED by default ── */
.stoc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1),
                opacity 0.25s ease;
    opacity: 0;
    background: #ffffff;
}

.smart-toc.stoc-open .stoc-body {
    opacity: 1;
    max-height: 1000px;
}

.stoc-body-inner {
    padding: 12px 16px 14px 16px;
}

/* ── Ordered list ── */
.stoc-list {
    margin: 0;
    padding-left: 22px;
    list-style: decimal;
}

.stoc-list li {
    margin: 5px 0;
    color: #333;
    line-height: 1.55;
}

.stoc-list li a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.15s;
}

.stoc-list li a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* Sub-levels */
.stoc-level-3 {
    margin-left: 18px;
    list-style-type: lower-alpha;
    font-size: 0.95em;
}
.stoc-level-4 {
    margin-left: 36px;
    list-style-type: lower-roman;
    font-size: 0.9em;
}

/* Active highlight while scrolling */
.stoc-list li a.stoc-active {
    font-weight: 700;
    color: #0d47a1;
}
