/* ============================================================
   Мануал решений — базовый слой
   ============================================================ */

:root {
    --man-bg:          #ffffff;
    --man-bg-soft:     #f7f8fa;
    --man-border:      #e6e8eb;
    --man-text:        #1f2328;
    --man-text-muted:  #6b7280;
    --man-accent:      #0a66c2;
    --man-accent-soft: #eaf1fb;
    --man-radius:      8px;
    --man-radius-sm:   6px;
    --man-gap:         32px;
    --man-sidebar:     260px;
    --man-content:     820px;
}

/* --- Общий контейнер мануала ------------------------------ */

.man-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 64px;
    color: var(--man-text);
    font-size: 15px;
    line-height: 1.65;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.man-page__layout {
    display: grid;
    grid-template-columns: var(--man-sidebar) minmax(0, 1fr);
    gap: var(--man-gap);
    align-items: start;
}

@media (max-width: 900px) {
    .man-page__layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* --- Хлебные крошки --------------------------------------- */

.man-breadcrumbs {
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--man-text-muted);
}
.man-breadcrumbs a {
    color: var(--man-text-muted);
    text-decoration: none;
}
.man-breadcrumbs a:hover { color: var(--man-accent); }
.man-breadcrumbs span { margin: 0 6px; opacity: .5; }

/* ============================================================
   Сайдбар / дерево меню
   ============================================================ */

.man-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 4px 4px 4px 0;
    border-right: 1px solid var(--man-border);
    padding-right: 12px;
}

.man-sidebar::-webkit-scrollbar { width: 6px; }
.man-sidebar::-webkit-scrollbar-thumb {
    background: #d8dade; border-radius: 3px;
}

.man-sidebar__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--man-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 8px 10px;
    margin: 0;
}

.man-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.man-tree__level { list-style: none; padding: 0; margin: 0; }
.man-tree__submenu {
    list-style: none;
    padding-left: 12px;
    margin: 2px 0 2px 6px;
    border-left: 1px solid var(--man-border);
}

.man-tree__item { margin: 0; }

.man-tree__link {
    display: block;
    padding: 7px 10px;
    border-radius: var(--man-radius-sm);
    color: var(--man-text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: background .15s, color .15s;
}
.man-tree__link:hover {
    background: var(--man-bg-soft);
    color: var(--man-accent);
}

.man-tree__item.is-active > .man-tree__link {
    background: var(--man-accent-soft);
    color: var(--man-accent);
    font-weight: 600;
}

.man-tree__item--lvl1 > .man-tree__link {
    font-weight: 600;
    font-size: 14px;
    color: var(--man-text);
    margin-bottom: 4px;
}
.man-tree__item--lvl2 > .man-tree__link { font-size: 14px; }
.man-tree__item--lvl3 > .man-tree__link { font-size: 13px; }

/* ============================================================
   Контент
   ============================================================ */

.man-content {
    min-width: 0;
    max-width: var(--man-content);
}

.man-content__header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--man-border);
}

.man-content__step {
    display: inline-block;
    background: var(--man-accent-soft);
    color: var(--man-accent);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    letter-spacing: .02em;
}

.man-content h1 {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--man-text);
}

.man-content__lead {
    font-size: 16px;
    color: var(--man-text-muted);
    margin: 0;
}

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

.man-article {
    font-size: 15px;
    line-height: 1.7;
    color: var(--man-text);
}
.man-article h2 {
    font-size: 22px;
    margin: 32px 0 12px;
    font-weight: 600;
}
.man-article h3 {
    font-size: 18px;
    margin: 24px 0 10px;
    font-weight: 600;
}
.man-article p { margin: 0 0 14px; }
.man-article ul,
.man-article ol {
    margin: 0 0 16px;
    padding-left: 22px;
}
.man-article li { margin: 4px 0; }
.man-article a {
    color: var(--man-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(10,102,194,.25);
}
.man-article a:hover { border-bottom-color: var(--man-accent); }
.man-article code {
    background: var(--man-bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.man-article pre {
    background: #1f2328;
    color: #e6e8eb;
    padding: 14px 16px;
    border-radius: var(--man-radius);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}
.man-article pre code { background: none; padding: 0; color: inherit; }
.man-article blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--man-accent);
    background: var(--man-bg-soft);
    color: var(--man-text);
    font-size: 14px;
}
.man-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 18px;
    font-size: 14px;
}
.man-article th,
.man-article td {
    border: 1px solid var(--man-border);
    padding: 8px 10px;
    text-align: left;
}
.man-article th {
    background: var(--man-bg-soft);
    font-weight: 600;
}

/* --- Скриншоты -------------------------------------------- */

.man-figure {
    margin: 22px 0;
}
.man-figure__img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--man-border);
    border-radius: var(--man-radius-sm);
    background: #fff;
    cursor: zoom-in;
    transition: box-shadow .2s;
}
.man-figure__img:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,.08);
}
.man-figure__caption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--man-text-muted);
    text-align: left;
}

/* --- Placeholder вместо «текст будет добавлен позже» ------ */

.man-placeholder {
    padding: 18px 20px;
    border: 1px dashed var(--man-border);
    border-radius: var(--man-radius);
    background: var(--man-bg-soft);
    color: var(--man-text-muted);
    font-size: 14px;
    text-align: center;
}

/* --- CTA ---------------------------------------------------- */

.man-cta {
    margin-top: 40px;
    padding: 18px 20px;
    background: var(--man-accent-soft);
    border-radius: var(--man-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.man-cta__text {
    font-size: 14px;
    color: var(--man-text);
    margin: 0;
}
.man-cta__btn {
    display: inline-block;
    padding: 9px 16px;
    background: var(--man-accent);
    color: #fff !important;
    border-radius: var(--man-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}
.man-cta__btn:hover { background: #0858a8; }

/* --- Навигация prev/next ---------------------------------- */

.man-pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--man-border);
}
.man-pager__link {
    font-size: 14px;
    color: var(--man-accent);
    text-decoration: none;
    max-width: 48%;
}
.man-pager__link:hover { text-decoration: underline; }
.man-pager__link--next { text-align: right; margin-left: auto; }

/* ============================================================
   Список решений (корень /solutions/)
   ============================================================ */

.man-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 64px;
}
.man-list__header { margin-bottom: 28px; }
.man-list__header h1 {
    font-size: 30px;
    margin: 0 0 8px;
    font-weight: 700;
}
.man-list__lead {
    color: var(--man-text-muted);
    font-size: 16px;
    margin: 0;
}

.man-list__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.man-card {
    display: block;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--man-border);
    border-radius: var(--man-radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.man-card:hover {
    border-color: var(--man-accent);
    box-shadow: 0 6px 22px rgba(0,0,0,.06);
    transform: translateY(-2px);
}
.man-card__title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--man-text);
}
.man-card__desc {
    font-size: 14px;
    color: var(--man-text-muted);
    margin: 0 0 12px;
}
.man-card__meta {
    font-size: 12px;
    color: var(--man-text-muted);
    margin-bottom: 12px;
}
.man-card__more {
    font-size: 14px;
    color: var(--man-accent);
    font-weight: 600;
}

/* ============================================================
   Раздел (список превью)
   ============================================================ */

.man-section__items {
    display: grid;
    gap: 14px;
}
.man-preview {
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--man-border);
    border-radius: var(--man-radius);
    transition: border-color .2s, box-shadow .2s;
}
.man-preview:hover {
    border-color: var(--man-accent);
    box-shadow: 0 4px 16px rgba(0,0,0,.05);
}
.man-preview__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}
.man-preview__title a {
    color: var(--man-text);
    text-decoration: none;
}
.man-preview__title a:hover { color: var(--man-accent); }
.man-preview__text {
    color: var(--man-text-muted);
    font-size: 14px;
    margin: 0 0 10px;
}
.man-preview__link {
    font-size: 14px;
    color: var(--man-accent);
    text-decoration: none;
    font-weight: 600;
}
.man-preview__link:hover { text-decoration: underline; }

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

@media (max-width: 900px) {
    .man-page { padding: 16px 12px 48px; }
    .man-sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--man-border);
        padding-bottom: 16px;
    }
    .man-content h1 { font-size: 24px; }
    .man-list__header h1 { font-size: 24px; }
}