.wy-nav-content {
    max-width: none !important;
}
.sidebar li.current > a,
.sidebar li.active > a {
    background-color: #dcdcdc !important; /* light gray */
    color: #000 !important;               /* dark text */
}

/* Optional: Add some reasonable padding for very wide screens */
@media screen and (min-width: 1400px) {
    .wy-nav-content {
        padding: 1.618em 3em;
    }
}

/* Top bar */
.wy-nav-top {
    background: linear-gradient(90deg, #0f172a, #0b1220);
    color: #fff;
    box-shadow: 0 2px 8px rgba(2,6,23,0.35);
}
.wy-nav-top .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6rem 1rem;
}
.wy-nav-top .logo img {
    height: 36px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.wy-nav-top .project-title {
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #e6eef8;
    font-size: 1rem;
}

/* Sidebar */
.wy-nav-side {
    background: #071028;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.wy-menu-vertical {
    list-style: none;
}
.wy-menu-vertical li.toclevel-1 > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #cfe6ff;
    transition: background 160ms ease, transform 160ms ease;
}
.wy-menu-vertical li.toclevel-1 > a:hover,
.wy-menu-vertical li.toctree-l1.current > a {
    background: rgba(255,255,255,0.03);
    transform: translateX(3px);
}
.wy-menu-vertical .toctree-l2 a {
    padding-left: 28px;
    color: #9fb9dd;
}

/* Active marker */
.wy-menu-vertical li.toctree-l1.current > a::before {
    content: "";
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg,#4f46e5,#06b6d4);
    border-radius: 4px;
    margin-right: 8px;
}

/* Make the nav fixed and scrollable on long sidebars */
.wy-nav-side .wy-side-scroll {
    max-height: calc(100vh - 64px);
    overflow: auto;
}

/* Search box styling (Sphinx search) */
.wy-side-scroll .search, .searchbox {
    margin: 0.6rem 0.6rem;
}
.searchbox input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: #e6eef8;
    border: 1px solid rgba(255,255,255,0.03);
}
.searchbox input[type="submit"] {
    display: none;
}

/* Breadcrumb and content header polish */
.wy-breadcrumbs {
    background: transparent;
    padding: 0.2rem 0 0.6rem 0;
}
.wy-breadcrumbs a {
    color: #0369a1;
    font-weight: 600;
}

/* Responsive tweaks: collapse sidebar on small screens */
@media (max-width: 900px) {
    .wy-nav-side {
        position: fixed;
        left: -320px;
        top: 0;
        z-index: 9999;
        width: 320px;
        transition: left 220ms ease;
        height: 100vh;
    }
    .wy-nav-side.open {
        left: 0;
    }
    .wy-side-scroll {
        max-height: 100vh;
    }
    .wy-nav-content {
        padding-left: 1rem !important;
    }
}

/* Small visual polish for links inside content */
.wy-nav-content a {
    color: #0b5fff;
    text-decoration: none;
}
.wy-nav-content a:hover {
    text-decoration: underline;
}

/* Keep previous custom rules intact */
