/* Документация Convy — самостоятельная страница без сборки. Стиль повторяет лендинг. */

:root {
    --ink: #16162e;
    --muted: #5d5d7d;
    --faint: #8b8ba7;
    --bg: #fbfbff;
    --card: #ffffff;
    --line: rgba(22, 22, 46, .09);
    --brand: #6c5ce7;
    --brand-2: #a855f7;
    --brand-soft: rgba(108, 92, 231, .10);
    --accent: #ff6b4a;
    --green: #17954c;
    --green-soft: rgba(23, 149, 76, .12);
    --amber: #b45309;
    --amber-soft: rgba(245, 158, 11, .14);
    --red: #dc2626;
    --red-soft: rgba(220, 38, 38, .10);
    --blue: #2563eb;
    --blue-soft: rgba(37, 99, 235, .10);
    --grad: linear-gradient(96deg, #6c5ce7 0%, #a855f7 100%);
    --radius: 14px;
    --shadow: 0 10px 30px rgba(22, 22, 46, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.docs-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Сайдбар ---------- */

.docs-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 18px 18px;
    background: var(--card);
    border-right: 1px solid var(--line);
}

.docs-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
    padding: 2px 6px;
}

.docs-brand-logo svg { display: block; border-radius: 8px; }

.docs-brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.docs-brand-text strong {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-size: 18px;
    letter-spacing: .01em;
}

.docs-brand-text small { color: var(--faint); font-size: 12.5px; font-weight: 600; }

.docs-nav { display: flex; flex-direction: column; gap: 18px; }

.docs-nav-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--faint);
    padding: 0 10px 6px;
}

.docs-nav-section.is-current > .docs-nav-label { color: var(--brand); }

.docs-nav-section.is-admin { margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--line); }

.docs-nav-section.is-admin > .docs-nav-label { color: var(--amber); }

.docs-lock { flex: none; }

.docs-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-nav a {
    display: block;
    padding: 7px 10px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    transition: background .15s, color .15s;
}

.docs-nav a:hover { background: var(--brand-soft); color: var(--ink); }

.docs-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 800; }

.docs-sidebar-footer { margin-top: auto; padding: 8px 10px 0; font-size: 13.5px; }

.docs-sidebar-footer a { color: var(--faint); text-decoration: none; font-weight: 700; }

.docs-sidebar-footer a:hover { color: var(--brand); }

/* ---------- Основная колонка ---------- */

.docs-main {
    padding: 40px clamp(20px, 5vw, 64px) 30px;
    display: flex;
    flex-direction: column;
}

.docs-content { flex: 1; max-width: 880px; width: 100%; margin: 0 auto; }

.docs-footer {
    max-width: 880px;
    width: 100%;
    margin: 46px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: 13.5px;
}

.docs-footer a { color: var(--muted); font-weight: 700; text-decoration: none; }

.docs-footer a:hover { color: var(--brand); }

/* ---------- Шапки, крошки ---------- */

.docs-hero h1,
.doc-header h1 {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-weight: 600;
    font-size: clamp(26px, 3.6vw, 38px);
    line-height: 1.18;
    margin: 0 0 14px;
}

.docs-hero {
    padding: 14px 0 8px;
    margin-bottom: 34px;
}

.docs-hero h1 span {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.docs-hero p { color: var(--muted); font-size: 17.5px; max-width: 720px; }

.doc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--faint);
    margin-bottom: 20px;
}

.doc-breadcrumb a { color: var(--muted); text-decoration: none; }

.doc-breadcrumb a:hover { color: var(--brand); }

.doc-header { margin-bottom: 30px; }

.doc-lede { color: var(--muted); font-size: 18px; margin: 0; max-width: 760px; }

/* ---------- Типографика статьи ---------- */

.doc-body h2 {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 21px;
    line-height: 1.3;
    margin: 40px 0 12px;
}

.doc-body h3 { font-size: 17.5px; margin: 28px 0 8px; }

.doc-body p { margin: 12px 0; }

.doc-body ul, .doc-body ol { padding-left: 24px; margin: 12px 0; }

.doc-body li { margin: 5px 0; }

.doc-body li::marker { color: var(--brand); }

.doc-body a { color: var(--brand); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(108, 92, 231, .35); text-underline-offset: 3px; }

.doc-body a:hover { text-decoration-color: var(--brand); }

.doc-body strong { font-weight: 800; }

.doc-body code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: .88em;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: 6px;
    padding: .12em .4em;
    white-space: nowrap;
}

/* ---------- Картинки ---------- */

.doc-figure { margin: 24px 0; }

.doc-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
}

.doc-figure figcaption {
    margin-top: 10px;
    text-align: center;
    font-size: 13.5px;
    color: var(--faint);
    font-weight: 600;
}

/* ---------- Врезки ---------- */

.doc-note {
    display: flow-root;
    margin: 18px 0;
    padding: 13px 16px 13px 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    background: var(--card);
    font-size: 15.5px;
}

.doc-note.tip { border-left-color: var(--green); background: var(--green-soft); border-color: rgba(23, 149, 76, .18); }

.doc-note.warn { border-left-color: var(--accent); background: rgba(255, 107, 74, .08); border-color: rgba(255, 107, 74, .2); }

.doc-note.admin { border-left-color: var(--amber); background: var(--amber-soft); border-color: rgba(245, 158, 11, .25); }

/* ---------- Плашки статусов ---------- */

.chip {
    display: inline-block;
    padding: .1em .6em;
    border-radius: 999px;
    font-size: .84em;
    font-weight: 800;
    white-space: nowrap;
    background: var(--brand-soft);
    color: var(--brand);
}

.chip-ok { background: var(--green-soft); color: var(--green); }

.chip-info { background: var(--blue-soft); color: var(--blue); }

.chip-warn { background: var(--amber-soft); color: var(--amber); }

.chip-danger { background: var(--red-soft); color: var(--red); }

.chip-muted { background: rgba(22, 22, 46, .07); color: var(--muted); }

/* ---------- Таблицы ---------- */

.doc-table-wrap { overflow-x: auto; margin: 18px 0; }

table.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.doc-table th, .doc-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }

.doc-table thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); background: rgba(22, 22, 46, .025); }

.doc-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Карточки разделов на главной ---------- */

.doc-sections {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.doc-section-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 26px 28px 22px;
    box-shadow: var(--shadow);
}

.doc-section-card > header h2 { margin: 0 0 6px; font-size: 24px; }

.doc-section-card > header h2 a { color: var(--ink); text-decoration: none; }

.doc-section-card > header h2 a:hover { color: var(--brand); }

.doc-section-card > header p { margin: 0 0 18px; color: var(--muted); }

.doc-article-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.doc-article-list li a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.doc-article-list li a:hover { background: var(--brand-soft); }

.doc-article-list li a strong { font-size: 16px; font-weight: 800; color: var(--ink); }

.doc-article-list li a:hover strong { color: var(--brand); }

.doc-article-list li a span { font-size: 14.5px; color: var(--muted); }

.doc-section-card--admin { border-style: dashed; border-color: rgba(245, 158, 11, .5); background: linear-gradient(180deg, rgba(245, 158, 11, .05), var(--card) 55%); }

.doc-admin-hint {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    font-size: 14px;
    color: var(--amber);
    font-weight: 600;
}

/* ---------- Навигация назад/вперёд ---------- */

.doc-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 44px;
}

.doc-pager-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
}

.doc-pager-link span { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }

.doc-pager-link strong { color: var(--ink); font-size: 15.5px; }

.doc-pager-link:hover { border-color: var(--brand); }

.doc-pager-link:hover strong { color: var(--brand); }

.doc-pager-link.is-next { text-align: right; }

/* ---------- Адаптив ---------- */

@media (max-width: 900px) {
    .docs-shell { grid-template-columns: 1fr; }

    .docs-sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .docs-main { padding-top: 26px; }

    .doc-pager { grid-template-columns: 1fr; }

    .doc-pager-link.is-next { text-align: left; }
}
