/* =========================================================
   StudyWiki
   Technical Wiki theme
   ========================================================= */


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #ffffff;
    color: #20252b;

    overflow: hidden;
}

button,
input {
    font: inherit;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    display: flex;

    width: 100%;
    height: 100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: 285px;
    min-width: 285px;

    height: 100%;

    display: flex;
    flex-direction: column;

    background: #f8f9fa;

    border-right: 1px solid #dfe3e7;
}


/* =========================================================
   SIDEBAR HEADER
   ========================================================= */

.sidebar-header {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 14px 16px 15px;

    min-height: 62px;

    box-sizing: border-box;
}

.logo {
    color: #20252b;

    font-size: 17px;
    font-weight: 650;

    letter-spacing: -0.25px;
}


/* =========================================================
   SEARCH
   ========================================================= */

.sidebar-search {
    padding: 14px 14px 10px;
}

.sidebar-search input {
    width: 100%;
    height: 34px;

    padding: 0 10px;

    border: 1px solid #d5d9de;
    border-radius: 4px;

    outline: none;

    background: #ffffff;
    color: #20252b;

    font-size: 13px;

    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

.sidebar-search input::placeholder {
    color: #858d96;
}

.sidebar-search input:focus {
    border-color: #8b949e;

    box-shadow:
        0 0 0 2px rgba(80, 88, 96, 0.08);
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.navigation {
    flex: 1;

    overflow-y: auto;

    padding: 4px 9px 20px;
}

.navigation::-webkit-scrollbar {
    width: 5px;
}

.navigation::-webkit-scrollbar-track {
    background: transparent;
}

.navigation::-webkit-scrollbar-thumb {
    background: #cfd4d9;
    border-radius: 3px;
}


/* =========================================================
   NAVIGATION ITEMS
   ========================================================= */

.nav-item {
    width: 100%;
}

.nav-button {
    width: 100%;
    min-height: 32px;

    display: flex;
    align-items: center;

    gap: 4px;

    padding-top: 4px;
    padding-bottom: 4px;
    padding-right: 8px;

    border: none;

    background: transparent;

    color: #3d454d;

    font-family: inherit;
    font-size: 13px;

    line-height: 1.4;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.1s ease,
        color 0.1s ease;
}

.nav-button:hover {
    background: #eceff1;

    color: #171b1f;
}

.nav-section > .nav-button {
    font-weight: 600;

    color: #24292f;
}


/* =========================================================
   NAVIGATION ARROW
   ========================================================= */

.nav-arrow {
    width: 14px;
    min-width: 14px;

    display: inline-flex;

    justify-content: center;
    align-items: center;

    color: #6b737c;

    font-size: 15px;

    transition:
        transform 0.12s ease;
}

.nav-arrow.open {
    transform: rotate(90deg);
}

.nav-title {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.nav-children {
    width: 100%;
}


/* =========================================================
   NAVIGATION ERROR
   ========================================================= */

.navigation-error {
    padding: 10px;

    color: #b42318;

    font-size: 13px;
}


/* =========================================================
   CONTENT
   ========================================================= */

.content {
    flex: 1;

    height: 100%;

    overflow-y: auto;

    background: #ffffff;
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: #d0d5da;
    border-radius: 3px;
}


/* =========================================================
   CONTENT INNER
   ========================================================= */

.content-inner {
    max-width: 1000px;

    margin: 0 auto;

    padding: 54px 72px 100px;
}


/* =========================================================
   WELCOME
   ========================================================= */

.welcome {
    max-width: 680px;
}

.welcome h1 {
    margin: 0 0 12px;

    color: #20252b;

    font-size: 34px;
    font-weight: 650;

    line-height: 1.2;

    letter-spacing: -0.7px;
}

.welcome p {
    margin: 8px 0;

    color: #59636e;

    font-size: 15px;

    line-height: 1.7;
}


/* =========================================================
   ARTICLE
   ========================================================= */

.article {
    max-width: 820px;
}

.article h1 {
    margin: 0;

    color: #20252b;

    font-size: 36px;
    font-weight: 650;

    line-height: 1.2;

    letter-spacing: -0.7px;
}

.article h2 {
    margin: 34px 0 10px;

    color: #2b3137;

    font-size: 20px;
    font-weight: 600;

    line-height: 1.35;
}

.article p {
    margin: 9px 0;

    color: #4f5861;

    font-size: 15px;

    line-height: 1.7;
}


/* =========================================================
   ARTICLE DESCRIPTION
   ========================================================= */

.article-description {
    margin-top: 7px !important;

    color: #68727c !important;

    font-size: 15px !important;

    line-height: 1.6 !important;
}


/* =========================================================
   ARTICLE CATEGORY
   ========================================================= */

.article-category {
    margin-top: 14px;

    color: #7a838c;

    font-size: 12px;
}


/* =========================================================
   GENERAL ARTICLE
   ========================================================= */

.article-general {
    margin-top: 30px;
}

.article-general > h2:first-child {
    margin-top: 0;
}


/* =========================================================
   PLATFORM
   ========================================================= */

.platform-selector {
    display: flex;

    width: 100%;

    margin-top: 38px;

    padding: 0;

    border-bottom: 1px solid #dfe3e7;

    background: transparent;
}

.platform-button {
    position: relative;

    padding: 8px 14px 9px;

    border: none;

    background: transparent;

    color: #68717a;

    font-family: inherit;
    font-size: 13px;

    cursor: pointer;

    transition:
        color 0.12s ease;
}

.platform-button:first-child {
    padding-left: 0;
}

.platform-button:hover {
    color: #20252b;
}

.platform-button.active {
    color: #20252b;

    font-weight: 600;
}

.platform-button.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -1px;

    height: 2px;

    background: #4b5560;
}


/* =========================================================
   PLATFORM CONTENT
   ========================================================= */

.platform-content {
    margin-top: 28px;
}

.platform-content > h2:first-child {
    margin-top: 0;
}


/* =========================================================
   CODE
   ========================================================= */

.code-block {
    margin: 16px 0;

    overflow: hidden;

    border: 1px solid #dfe3e7;
    border-radius: 3px;

    background: #f6f8fa;
}

.code-language {
    padding: 5px 10px;

    border-bottom: 1px solid #dfe3e7;

    color: #737c85;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 0.4px;

    text-transform: uppercase;
}

.code-block pre {
    margin: 0;

    padding: 13px;

    overflow-x: auto;
}

.code-block code {
    font-family:
        "Cascadia Code",
        "Cascadia Mono",
        "Consolas",
        "Liberation Mono",
        monospace;

    color: #24292f;

    font-size: 13px;

    line-height: 1.6;

    white-space: pre;
}

.code-block pre::-webkit-scrollbar {
    height: 5px;
}

.code-block pre::-webkit-scrollbar-thumb {
    background: #c9ced3;

    border-radius: 3px;
}


/* =========================================================
   NOTE
   ========================================================= */

.article-note {
    margin: 20px 0;

    padding: 12px 14px;

    border-left: 3px solid #737b84;

    background: #f6f7f8;
}

.article-note strong {
    display: block;

    margin-bottom: 4px;

    color: #343a40;

    font-size: 13px;
}

.article-note p {
    margin: 0;

    color: #59636d;

    font-size: 14px;
}


/* =========================================================
   LIST
   ========================================================= */

.article ul {
    margin: 13px 0;

    padding-left: 21px;
}

.article li {
    margin: 6px 0;

    color: #4f5861;

    font-size: 15px;

    line-height: 1.6;
}


/* =========================================================
   INLINE CODE
   ========================================================= */

.article p code,
.article li code {
    padding: 1px 4px;

    border: 1px solid #e1e4e8;
    border-radius: 3px;

    background: #f6f8fa;

    color: #30363d;

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 0.88em;
}


/* =========================================================
   RELATED ARTICLES
   ========================================================= */

.related {
    margin-top: 48px;

    padding-top: 18px;

    border-top: 1px solid #dfe3e7;
}

.related h2 {
    margin-top: 0;

    font-size: 17px;
}

.related-list {
    display: flex;

    flex-wrap: wrap;

    gap: 0;
}

.related-link {
    padding: 4px 12px 4px 0;

    border: none;

    background: transparent;

    color: #4f5963;

    font-family: inherit;

    font-size: 13px;

    cursor: pointer;
}

.related-link::after {
    content: " →";
}

.related-link:hover {
    color: #11161b;

    text-decoration: underline;
}


/* =========================================================
   SELECTION
   ========================================================= */

::selection {
    background: #dfe3e7;

    color: #20252b;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .sidebar {
        width: 250px;
        min-width: 250px;
    }

    .content-inner {
        padding: 45px 42px 80px;
    }

}


@media (max-width: 700px) {

    body {
        overflow: auto;
    }

    .app {
        height: auto;
        min-height: 100vh;

        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;

        height: auto;

        border-right: none;
        border-bottom: 1px solid #dfe3e7;
    }

    .navigation {
        max-height: 300px;
    }

    .content {
        height: auto;

        overflow: visible;
    }

    .content-inner {
        padding: 35px 22px 70px;
    }

    .article h1 {
        font-size: 31px;
    }

    .platform-selector {
        overflow-x: auto;

        white-space: nowrap;
    }

    .platform-button {
        flex-shrink: 0;
    }

}

/* =========================================================
   SEARCH RESULTS
   ========================================================= */

.search-results {
    padding: 4px 0 20px;
}

.search-count {
    padding: 8px 10px 10px;

    color: #7a838c;

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.search-result {
    width: 100%;

    display: block;

    padding: 9px 10px;

    border: none;
    border-bottom: 1px solid #eceff1;

    background: transparent;

    text-align: left;

    cursor: pointer;
}

.search-result:hover {
    background: #eceff1;
}

.search-result-title {
    color: #252a2f;

    font-size: 13px;
    font-weight: 600;

    line-height: 1.4;
}

.search-result-category {
    margin-top: 2px;

    color: #858d95;

    font-size: 10px;

    line-height: 1.4;
}

.search-result-description {
    margin-top: 4px;

    color: #646d76;

    font-size: 11px;

    line-height: 1.45;
}

.search-empty {
    padding: 20px 10px;

    color: #7a838c;

    font-size: 13px;
}

.related-article.not-created,
.related-article:disabled {
    color: #aaa;
    background: #f7f7f7;
    border-color: #ddd;
    cursor: default;
}


/* =========================================
   Загрузка статьи
   ========================================= */

.article-loading {
    padding: 40px 0;
    color: #777;
    font-size: 14px;
}

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-main {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;
}


/* =========================
   LOGO / KNOWLEDGE BASE
   ========================= */

.sidebar-header {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 17px 16px 15px;
}

.logo-mark {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    background: #ffffff;

    border: 1px solid #d9dfe4;
    border-radius: 7px;

    color: #315f7a;

    font-size: 14px;
    font-weight: 700;

    box-shadow: 0 2px 7px rgba(30, 45, 60, 0.04);
}

.logo-info {
    min-width: 0;
}

.logo {
    font-size: 14px;
    font-weight: 650;

    color: #20262d;
}

.logo-subtitle {
    margin-top: 2px;

    font-size: 10px;

    color: #7b858e;

    letter-spacing: 0.01em;
}


/* =========================
   SEARCH
   ========================= */

.sidebar-search {
    padding: 0 12px 12px;
}

.sidebar-search input {
    width: 100%;
    box-sizing: border-box;

    height: 34px;

    padding: 0 10px;

    background: #e7ebee;

    border: 1px solid transparent;
    border-radius: 6px;

    color: #20262d;

    font-family: inherit;
    font-size: 12px;

    outline: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.sidebar-search input::placeholder {
    color: #8b949c;
}

.sidebar-search input:focus {
    background: #ffffff;

    border-color: #ccd5db;

    box-shadow: 0 0 0 2px rgba(49, 95, 122, 0.07);
}


/* =========================
   NAVIGATION
   ========================= */

.navigation {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
}


/* =========================
   FOOTER
   ========================= */

.sidebar-footer {
    padding: 10px;

    border-top: 1px solid #dce1e6;

    background: rgba(255, 255, 255, 0.32);
}


/* =========================
   USER
   ========================= */

.sidebar-user {
    min-height: 48px;

    display: flex;
    align-items: center;

    padding: 6px 7px;

    border-radius: 7px;

    transition: background 0.15s ease;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.7);
}

.user-avatar {
    width: 31px;
    height: 31px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    background: #e1eaf0;

    border: 1px solid #d1dde4;
    border-radius: 7px;

    color: #315f7a;

    font-size: 12px;
    font-weight: 650;
}

.user-data {
    min-width: 0;

    margin-left: 9px;
}

.user-name {
    font-size: 11px;
    font-weight: 600;

    color: #252b31;
}

.user-status {
    margin-top: 2px;

    font-size: 9px;

    color: #858e96;
}

.user-menu {
    margin-left: auto;

    color: #7f8991;

    font-size: 17px;

    line-height: 1;
}


/* =========================
   SETTINGS / THEME
   ========================= */

.sidebar-tools {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 5px;

    margin-top: 5px;
}

.sidebar-tool {
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    padding: 0 6px;

    background: transparent;

    border: 1px solid transparent;
    border-radius: 6px;

    color: #77818a;

    font-family: inherit;
    font-size: 10px;

    cursor: default;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.sidebar-tool:hover {
    background: #ffffff;

    border-color: #dce1e6;

    color: #30383f;
}

.tool-icon {
    font-size: 12px;
}


/* =========================
   FLOATING CHAT
   ========================= */

.floating-chat {
    position: fixed;

    right: 22px;
    bottom: 22px;

    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: #ffffff;

    border: 1px solid #d5dce1;
    border-radius: 50%;

    box-shadow:
        0 5px 18px rgba(30, 45, 60, 0.09);

    cursor: default;

    z-index: 1000;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.floating-chat:hover {
    transform: translateY(-2px);

    border-color: #c4cfd7;

    box-shadow:
        0 8px 24px rgba(30, 45, 60, 0.13);
}


/* Сам значок сообщения */

.chat-icon {
    position: relative;

    width: 17px;
    height: 13px;

    display: block;

    border: 2px solid #315f7a;

    border-radius: 4px;
}

.chat-icon::after {
    content: "";

    position: absolute;

    left: 2px;
    bottom: -5px;

    width: 5px;
    height: 5px;

    background: #ffffff;

    border-left: 2px solid #315f7a;
    border-bottom: 2px solid #315f7a;

    transform: skewY(-28deg);
}


/* =========================
   SCROLLBAR
   ========================= */

.navigation::-webkit-scrollbar {
    width: 5px;
}

.navigation::-webkit-scrollbar-track {
    background: transparent;
}

.navigation::-webkit-scrollbar-thumb {
    background: #cbd1d6;

    border-radius: 5px;
}

.navigation::-webkit-scrollbar-thumb:hover {
    background: #b9c1c7;
}

.user-name-row {
    display: flex;
    align-items: center;

    gap: 6px;

    min-width: 0;
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 16px;

    padding: 0 5px;

    background: #E7EEF2;

    border: 1px solid #cbd9e0;
    border-radius: 4px;
    border-color: #CBD9E0;

    color: #315F7A;

    font-size: 8px;
    font-weight: 750;

    line-height: 1;

    letter-spacing: 0.04em;
}