:root {
    --sos-bg: #f5f7fb;
    --sos-surface: #ffffff;
    --sos-surface-soft: #f6f7fc;
    --sos-surface-muted: #eef1f7;
    --sos-ink: #1c2440;
    --sos-muted: #64748b;
    --sos-border: #e4e8f0;
    --sos-brand: #6f76ff;
    --sos-brand-dark: #535ad6;
    --sos-accent: #5e67ef;
    --sos-radius-lg: 22px;
    --sos-radius-md: 14px;
    --sos-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    --sos-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
}

body.sos-docs-body {
    margin: 0;
    min-height: 100vh;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--sos-ink);
    background: linear-gradient(180deg, #f8f9fd 0%, #f3f5fb 100%);
    overflow-x: hidden;
}

.sos-bg-layer {
    display: none;
}

#app {
    position: relative;
    z-index: 1;
}

.sos-topbar-wrap {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sos-border);
}

.sos-topbar-accent {
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(111, 118, 255, 0.15) 0%,
        var(--sos-brand) 50%,
        rgba(94, 103, 239, 0.16) 100%
    );
}

.sos-topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 14px;
}

.sos-topbar-left,
.sos-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sos-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--sos-ink);
    text-decoration: none;
}

.sos-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sos-brand-copy strong {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sos-brand-copy small {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--sos-muted);
}

.sos-brand-mark svg {
    display: block;
}

.sos-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 4px;
    border: 1px solid var(--sos-border);
    border-radius: 12px;
    background: var(--sos-surface);
    color: var(--sos-ink);
    box-shadow: var(--sos-shadow-soft);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.sos-sidebar-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(94, 103, 239, 0.28);
    color: var(--sos-accent);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.sos-sidebar-toggle:focus-visible {
    outline: 3px solid rgba(94, 103, 239, 0.18);
    outline-offset: 2px;
}

.sos-sidebar-toggle i {
    font-size: 1rem;
}

.sos-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sos-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sos-version-btn,
.sos-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sos-version-list {
    min-width: 120px;
    padding: 8px 0;
}

.sos-version-list li a {
    display: block;
    padding: 10px 14px;
    color: var(--sos-ink);
    text-decoration: none;
    font-weight: 500;
}

.sos-version-list li a:hover {
    background: var(--sos-surface-soft);
}

.sos-logout-form {
    margin: 0;
}

.sos-logout-btn {
    border: 0;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #fff;
    background: #dc2626;
    cursor: pointer;
}

.sos-layout-shell {
    display: block;
    padding: 68px 0 28px;
    max-width: 100%;
    margin: 0 auto;
}

.sos-layout-shell.sos-layout-collapsed {
    display: block;
}

.sidebar.sos-sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    height: calc(100vh - 68px);
    align-self: start;
    background: var(--sos-surface);
    border-right: 1px solid var(--sos-border);
    box-shadow: none;
    max-height: calc(100vh - 68px);
    overflow: hidden;
    width: 280px;
    transition:
        transform 0.28s ease,
        opacity 0.28s ease;
}

.sidebar.sos-sidebar.is-hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.sos-sidebar-content {
    overflow-y: auto;
    height: 100%;
    max-height: calc(100vh - 68px);
    padding: 12px 12px 20px;
    line-height: 1.65;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar ul li {
    margin: 4px 0;
}

.sidebar ul li a {
    display: block;
    text-decoration: none;
    color: #22304b;
    font-size: 0.97rem;
    font-weight: 500;
    line-height: 1.6;
    padding: 9px 10px;
    border-radius: 10px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.sos-sidebar-content h1,
.sos-sidebar-content h2,
.sos-sidebar-content h3,
.sos-sidebar-content h4,
.sos-sidebar-content p,
.sos-sidebar-content pre,
.sos-sidebar-content blockquote,
.sos-sidebar-content table,
.sos-sidebar-content hr {
    display: none;
}

.sidebar ul li a:hover {
    color: #18243f;
    background: var(--sos-surface-soft);
    transform: translateX(2px);
}

.sidebar ul li.is-active > a {
    color: var(--sos-brand-dark);
    background: rgba(111, 118, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(111, 118, 255, 0.14);
}

.sidebar li ul {
    margin-top: 4px;
    margin-left: 10px;
    padding-left: 12px;
    border-left: 1px solid #e7eaf2;
}

.sidebar li.sos-module-parent > a {
    position: relative;
    padding-right: 26px;
}

.sidebar li.sos-module-parent > a::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid #8a94a8;
    border-bottom: 2px solid #8a94a8;
    transform: translateY(-66%) rotate(45deg);
    transition:
        transform 0.22s ease,
        border-color 0.2s ease;
}

.sidebar li.sos-module-parent.sos-open > a::after {
    transform: translateY(-36%) rotate(225deg);
    border-color: var(--sos-brand-dark);
}

.sidebar li.sos-module-parent > ul {
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        transform 0.25s ease,
        margin-top 0.25s ease;
}

.sidebar li.sos-module-parent.sos-open > ul {
    margin-top: 8px;
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
}

.sidebar li.sos-module-parent > ul > li > a {
    font-size: 0.92rem;
    padding-left: 12px;
    color: #3d4a63;
}

.sos-content-shell {
    min-width: 0;
    margin-left: 280px;
    padding: 0 24px;
    transition: margin-left 0.28s ease;
}

.sos-layout-shell.sos-layout-collapsed .sos-content-shell {
    margin-left: 0;
}

.sos-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    align-items: start;
    max-width: 1380px;
    margin: 0 auto;
}

.documentation {
    width: 100%;
    max-width: 940px;
    margin: 20px 10px !important;
    background: var(--sos-surface);
    border: 1px solid var(--sos-border);
    border-radius: 24px;
    box-shadow: var(--sos-shadow);
    padding: 46px 52px;
    animation: sos-fade-slide 360ms ease-out;
}

.sos-layout-collapsed .documentation {
    margin-left: 0;
}

.documentation.expanded {
    margin-left: 0;
}

.sos-doc-content {
    max-width: 980px;
}

.documentation h1,
.documentation h2,
.documentation h3,
.documentation h4 {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
    color: #0c1830;
}

.documentation h1 {
    font-size: clamp(2.15rem, 3.3vw, 3rem);
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.08;
    padding-left: 16px;
    border-left: 3px solid var(--sos-brand);
}

.documentation h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    margin-top: 2rem;
    line-height: 1.22;
}

.documentation h3 {
    font-size: 1.15rem;
    margin-top: 1.6rem;
    line-height: 1.25;
}

.documentation p,
.documentation li {
    color: #223248;
    font-size: 1.08rem;
    line-height: 1.84;
}

.documentation img {
    display: block;
    width: min(100%, 500px);
    max-height: 600px;
    height: auto;
    object-fit: contain;
    margin: 20px auto;
    border-radius: 14px;
}

.documentation a {
    color: var(--sos-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(94, 103, 239, 0.18);
}

.documentation a:hover {
    border-bottom-color: var(--sos-accent);
}

.documentation code {
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 0.88em;
    border-radius: 8px;
    padding: 2px 7px;
    background: #f2f4ff;
    color: #3f46cc;
}

.documentation pre {
    border-radius: 16px;
    border: 1px solid #dde5f2;
    background: #09111f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.documentation blockquote {
    margin: 1.4rem 0;
    border-left: 4px solid rgba(111, 118, 255, 0.7);
    background: #fafbff;
    border-radius: 0 12px 12px 0;
    padding: 4px 2px 4px 16px;
}

.documentation table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(128, 146, 177, 0.14);
}

.documentation th,
.documentation td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(128, 146, 177, 0.16);
    text-align: left;
}

.documentation th {
    background: #f7f8fc;
    color: #102347;
}

.documentation tr:last-child td {
    border-bottom: 0;
}

.sos-page-outline {
    position: sticky;
    top: 96px;
    align-self: start;
}

.sos-page-outline-card {
    padding: 10px 0;
}

.sos-page-outline-card p {
    margin: 0 0 10px;
    color: var(--sos-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sos-page-outline-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sos-page-outline-nav li {
    margin: 0 0 8px;
}

.sos-page-outline-nav li.sos-outline-level-h3 {
    margin-left: 14px;
}

.sos-page-outline-nav a {
    display: inline-flex;
    color: #8a94a8;
    font-size: 0.82rem;
    text-decoration: none;
    line-height: 1.4;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.sos-page-outline-nav a:hover {
    color: var(--sos-brand-dark);
    transform: translateX(2px);
}

.sos-sidebar-backdrop {
    background: rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(2px);
    animation: sos-backdrop-in 180ms ease-out;
}

@media (max-width: 1200px) {
    .sos-content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sos-page-outline {
        display: none;
    }
}

@media (max-width: 1023px) {
    .sos-layout-shell {
        padding: 68px 0 16px;
    }

    .sidebar.sos-sidebar {
        position: fixed;
        top: 68px;
        left: 0;
        z-index: 30;
        width: min(88vw, 300px);
        max-height: calc(100vh - 68px);
    }

    .sos-content-shell {
        margin-left: 0;
        padding: 0 16px;
    }

    .documentation {
        padding: 30px 22px;
    }
}

.sos-not-found {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
    padding: 32px;
}

.sos-not-found-card {
    max-width: 560px;
    text-align: center;
    border: 1px solid var(--sos-border);
    border-radius: 22px;
    background: var(--sos-surface);
    box-shadow: var(--sos-shadow);
    padding: 36px 30px;
}

.sos-not-found-code {
    margin: 0;
    font-size: 3.4rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--sos-brand);
}

.sos-not-found-card h1 {
    margin: 14px 0 8px;
    font-size: 1.8rem;
}

.sos-not-found-card p {
    margin: 0;
    color: var(--sos-muted);
}

.sos-install-hint {
    margin-top: 18px;
    padding: 14px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.sos-install-hint code {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 10px;
    font-family: "IBM Plex Mono", Consolas, monospace;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 8px;
}

.sos-alert-warning {
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid #facc15;
    border-left: 6px solid #f59e0b;
    border-radius: 12px;
    background: #fef9c3;
    color: #713f12;
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.14);
}

.sos-alert-warning strong {
    color: #92400e;
}

@keyframes sos-fade-slide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sos-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 720px) {
    .sos-topbar {
        height: auto;
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .sos-topbar-left,
    .sos-topbar-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .sos-brand-copy small {
        display: none;
    }

    .sos-action-btn span {
        display: none;
    }

    .documentation {
        border-radius: 18px;
        padding: 26px 18px;
    }

    .documentation h1 {
        font-size: 1.8rem;
    }
}
