.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border-soft);
    background: var(--color-header);
}

.brand {
    display: flex;
    grid-row: 1;
    grid-column: 1;
    align-items: center;
    gap: 11px;
    min-width: 0;
    height: var(--header-height);
    padding: 0 20px 0 37px;
}

.brand__mark {
    display: block;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 50%;
    object-fit: cover;
}

.brand__name {
    overflow: hidden;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 600;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-main {
    display: flex;
    grid-row: 1;
    grid-column: 2;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    height: var(--header-height);
    padding: 0 16px 0 16px;
}

.page-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(100vh - var(--header-height));
}

.page-shell > .site-sidebar {
    grid-column: 1;
    grid-row: 1;
}

.page-shell > .sidebar-backdrop {
    grid-column: 1 / -1;
    grid-row: 1;
}

.page-shell > .site-main {
    grid-column: 2;
    grid-row: 1;
}

.sidebar-backdrop {
    display: none;
}

.site-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 40;
    width: var(--sidebar-width);
    padding: 10px 14px 28px 30px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar-thumb) transparent;
    border-right: 1px solid var(--color-border-soft);
    background: var(--color-sidebar);
}

.site-sidebar::-webkit-scrollbar {
    width: 5px;
}

.site-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.site-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--color-scrollbar-thumb);
}

.site-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-scrollbar-thumb-hover);
}

.site-sidebar::-webkit-scrollbar-button {
    width: 0;
    height: 0;
}

.site-main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: calc(100vh - var(--header-height));
    margin: 0;
    padding: 32px 24px 34px 20px;
    background: var(--color-background);
}

.home-page {
    width: 100%;
    max-width: 1120px;
    min-width: 0;
    margin: 0 auto;
}

@media (max-width: 1120px) {
    :root {
        --sidebar-width: 220px;
    }

    .brand {
        padding-left: 28px;
    }

    .site-sidebar {
        padding-left: 20px;
    }

    .header-main {
        padding-right: 14px;
        padding-left: 14px;
    }
}

@media (max-width: 900px) {
    .site-header {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .brand {
        padding-left: 20px;
        border-right: 0;
    }

    .page-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-shell > .site-sidebar {
        grid-column: 1;
    }

    .page-shell > .site-main {
        grid-column: 1;
    }

    .site-sidebar {
        display: none;
    }

    .site-main {
        padding: 24px 20px 28px;
    }
}

@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    .site-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .brand {
        gap: 5px;
        padding: 0 8px 0 44px;
    }

    .brand__mark {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
    }

    .brand__name {
        font-size: 14px;
        line-height: 20px;
    }

    .header-main {
        min-width: 0;
        padding-right: 10px;
        padding-left: 4px;
    }

    .page-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-sidebar {
        z-index: 90;
        display: block;
        width: min(280px, calc(100% - 56px));
        max-width: 280px;
        padding: 12px 18px 28px;
        visibility: hidden;
        box-shadow: 12px 0 30px rgba(16, 24, 40, 0.16);
        transform: translateX(-100%);
        transition: transform 200ms ease, visibility 0s linear 200ms;
    }

    .sidebar-backdrop {
        position: fixed;
        top: var(--header-height);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 80;
        display: block;
        width: auto;
        height: auto;
        padding: 0;
        border: 0;
        visibility: hidden;
        background: rgba(9, 14, 23, 0.42);
        opacity: 0;
        cursor: default;
        transition: opacity 200ms ease, visibility 0s linear 200ms;
    }

    .is-sidebar-open,
    .is-sidebar-open body {
        overflow: hidden;
    }

    .is-sidebar-open .site-sidebar {
        visibility: visible;
        transform: translateX(0);
        transition-delay: 0s;
    }

    .is-sidebar-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
        transition-delay: 0s;
    }

    .site-main {
        padding: 12px 12px 24px;
    }
}

@media (max-width: 380px) {
    .brand {
        padding-right: 4px;
    }

    .header-main {
        padding-right: 8px;
    }
}