html, body {
    margin: 0;
    padding: 0;
}

.toc {
    background: beige;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    max-width: 300px;
    transition: all 0.3s ease;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px;
}

.toc-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.toc-toggle-arrow {
    margin-left: 10px;
    width: 0;
    height: 0;
    min-width: 12px;
    min-height: 12px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
    border-bottom: none;
    transition: transform 0.3s ease;
}

.toc.collapsed .toc-toggle-arrow {
    transform: rotate(180deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.toc-list li {
    margin: 8px 0;
    position: relative;
}

.toc-list a {
    color: #0073aa;
    text-decoration: none;
    display: inline-block;
    padding-left: 15px;
    font-size: 1rem;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.toc-list a:hover {
    color: #d32f2f;
}

.toc-active-indicator {
    display: none;
    width: 0;
    height: 0;
    border-left: 6px solid #d32f2f;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.toc-list a.active .toc-active-indicator {
    display: inline-block;
}

/* Tablet and Desktop (min-width: 768px) */
@media (min-width: 768px) {
    .toc {
        position: sticky;
        top: 20px;
        max-width: 280px;
        margin: 0;
    }

    .toc-list {
        max-height: none;
        opacity: 1;
        display: block;
    }

    .toc.collapsed .toc-list {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .elementor-location-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1003;
    }

    .toc-spacer {
        height: 0; /* Fallback; will be set dynamically by JS */
    }

    .toc {
		position: relative;
        /*z-index: 1002;*/
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
        max-width: 100%;
        background: #f2fced;
    }

    .toc-header {
        padding: 12px 15px;
    }

    .toc-title {
        font-size: 1rem;
    }

    .toc-list {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-top: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
		/*z-index: 1001;*/
    }

    .toc:not(.collapsed) .toc-list {
		background: beige;
        max-height: 500px; /* Adjust based on content */
        opacity: 1;
        padding: 10px 15px;
    }

    .toc-list li {
        margin: 6px 0;
    }
	/* Force TOC above Omnisend embed */
   .toc,
   .toc-list {
	   z-index: 999999 !important; /* higher than Omnisend */
	}
	/* Lower Omnisend embed form layers */
	[id^="omnisend-embedded-v2"],
	[id^="omnisend-form-"],
	[class*="omnisend-form"],
	[class*="omnisend-reset"] {
		z-index: 0 !important;
	}
}