.docs-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.docs-sidebar {
    width: 200px;
    position: sticky;
    top: 20px;
    flex-shrink: 0;
    background: var(--button-background-color);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--button-border-block-color);
    font-size: 14px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.docs-sidebar h4 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--button-border-block-color);
    padding-bottom: 8px;
    color: var(--text-color);
}
.docs-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 2;
}
.docs-sidebar ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}
.docs-sidebar ul li a:hover {
    color: var(--parameter-color);
}
.text-content {
    flex-grow: 1;
    min-width: 0;
    margin: 0 !important;
}
.text-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    overflow-x: auto;
    display: block;
}
.text-content th, .text-content td {
    border: 1px solid var(--button-border-block-color);
    padding: 12px;
    text-align: left;
    min-width: 120px;
}
.text-content th {
    background: var(--button-background-color);
    color: var(--text-color);
}
.text-content code {
    word-break: break-word;
    background: var(--button-background-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}
.text-content img {
    max-width: 100%;
    height: auto;
}
@media (max-width: 992px) {
    .docs-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 10px;
    }
    .docs-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
        max-height: none;
        padding: 15px;
    }
    .docs-sidebar ul {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 5px 20px;
    }
    .docs-sidebar ul ul {
        display: none; /* Hide nested examples on mobile TOC for brevity */
    }
}
@media (max-width: 600px) {
    .docs-wrapper {
        max-width: 90%;
    }
    .docs-wrapper {
        max-width: 100%;
    }
    .docs-sidebar ul {
        grid-template-columns: 1fr;
    }
    .text-content {
       max-width: 90%;
    }
    .text-content h1 {
        font-size: 24px;
    }
    .text-content h2 {
        font-size: 20px;
    }
}

.lang-switcher {
    text-align: right;
    font-size: 14px;
    margin-bottom: 20px;
}
.lang-switcher a {
    text-decoration: none;
    color: var(--text-color);
}
.lang-switcher a.active {
    font-weight: bold;
    color: var(--parameter-color);
}
