/* ==========================================================================
   База знаний LeadPlan — /help/.

   Свой файл целиком: сайт на Тильде, её стили сюда не подключаются.
   Повторяем только узнаваемое — шрифт Commissioner, фирменный синий
   #007fff, светло-серые подложки и шапку с подвалом. Всё остальное — как в
   базе знаний dashamail.ru: те же блоки hc-*, другой цвет.
   ========================================================================== */

:root {
    --brand: #007fff;
    --brand-dark: #0063c7;
    --brand-tint: #e6f1ff;
    --ink: #000;
    --ink-soft: #333;
    --ink-muted: #777;
    --line: #e2e2e2;
    --line-soft: #efefef;
    --bg: #fff;
    --bg-soft: #f7f7f7;
    --code-bg: #f4f5f7;
    --radius: 6px;
    --radius-lg: 10px;
    --font: 'Commissioner', Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --header-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── Шапка ───────────────────────────────────────────────────────────────── */

.lp-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}

.lp-header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: 1240px;
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 20px;
}

.lp-logo { display: flex; flex: 0 0 auto; }
.lp-logo img { display: block; height: 35px; width: auto; }

.lp-menu {
    display: flex;
    align-items: center;
    gap: 26px;
    flex: 1 1 auto;
}

.lp-menu-item {
    font-size: 17px;
    color: var(--ink);
    cursor: pointer;
}

.lp-menu-item:hover,
.lp-menu-item.is-active { color: var(--brand); text-decoration: none; }

/* Подменю «Виджеты» — по наведению, как на Тильде. */
.lp-menu-drop { position: relative; }

.lp-menu-drop > .lp-menu-item::after {
    content: '';
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    vertical-align: 1px;
}

.lp-menu-sub {
    position: absolute;
    top: 100%;
    left: -16px;
    display: none;
    min-width: 230px;
    padding: 10px 0;
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}

.lp-menu-drop:hover .lp-menu-sub,
.lp-menu-drop:focus-within .lp-menu-sub { display: block; }

.lp-menu-sub a {
    display: block;
    padding: 6px 18px;
    color: var(--ink);
    font-size: 15px;
}

.lp-menu-sub a:hover { color: var(--brand); text-decoration: none; }

.lp-auth {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.lp-login { color: var(--ink); font-size: 14px; font-weight: 600; }

.lp-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.lp-button:hover { background: var(--brand-dark); text-decoration: none; }

/* Бургер виден только на узком экране. */
.lp-menu-toggle { position: absolute; opacity: 0; pointer-events: none; }

.lp-burger {
    display: none;
    width: 28px;
    height: 20px;
    margin-left: auto;
    position: relative;
    cursor: pointer;
}

.lp-burger span,
.lp-burger::before,
.lp-burger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand);
}

.lp-burger::before { top: 0; }
.lp-burger span { top: 9px; }
.lp-burger::after { bottom: 0; }

/* ── Раскладка: боковая панель и колонка текста ──────────────────────────── */

.hc-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 48px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 40px 20px 72px;
}

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

.hc-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    font-size: 14.5px;
}

.hc-sidebar summary { display: none; }

.hc-sidebar h4 {
    margin: 0 0 10px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.hc-sidebar ul { margin: 0 0 24px; padding: 0; list-style: none; }
.hc-sidebar ul ul { margin: 4px 0 8px 12px; padding-left: 10px; border-left: 2px solid var(--line-soft); }

.hc-sidebar li { margin: 0; }

.hc-sidebar a {
    display: block;
    padding: 5px 10px;
    border-radius: var(--radius);
    color: var(--ink-soft);
    line-height: 1.4;
}

.hc-sidebar a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }

.hc-sidebar li.is-active > a { color: var(--brand); font-weight: 600; }
.hc-sidebar li.is-current > a { background: var(--brand-tint); color: var(--brand-dark); }

/* ── Типографика ─────────────────────────────────────────────────────────── */

.hc-main h1 {
    margin: 0 0 14px;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.2;
}

.hc-main h2 {
    margin: 40px 0 14px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
}

.hc-main h3 {
    margin: 30px 0 10px;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
}

.hc-main p,
.hc-main ul,
.hc-main ol { margin: 0 0 16px; }

.hc-main ul,
.hc-main ol { padding-left: 24px; }

.hc-main li { margin: 4px 0; }

.hc-main code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--code-bg);
    font-family: var(--mono);
    font-size: .9em;
}

.hc-lede {
    margin: 0 0 28px;
    max-width: 760px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-soft);
}

/* Значок-ссылка на заголовок, проставляется в lib/content.php. */
.hc-main .anchor {
    margin-left: 8px;
    color: var(--line);
    font-weight: 400;
    opacity: 0;
}

.hc-main h2:hover .anchor,
.hc-main h3:hover .anchor { opacity: 1; }
.hc-main .anchor:hover { color: var(--brand); text-decoration: none; }

/* ── Поиск ───────────────────────────────────────────────────────────────── */

.hc-search {
    display: flex;
    gap: 12px;
    max-width: 620px;
    margin: 0 0 36px;
}

.hc-search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 18px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: var(--bg-soft);
    font-family: var(--font);
    font-size: 16px;
    color: var(--ink);
}

.hc-search input::placeholder { color: var(--ink-muted); }

.hc-search input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--bg);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

.hc-search button {
    flex: 0 0 auto;
    padding: 14px 34px;
    border: 0;
    border-radius: 5px;
    background: var(--brand);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

.hc-search button:hover { background: var(--brand-dark); }

/* ── Карточки разделов ───────────────────────────────────────────────────── */

.hc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 0 0 44px;
}

/* Карточка — ссылка целиком: попасть в неё мышью проще, чем в заголовок. */
.hc-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    color: inherit;
    transition: background .15s, box-shadow .15s;
}

.hc-card:hover {
    background: var(--bg);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .1);
    text-decoration: none;
}

.hc-card-name { font-size: 19px; font-weight: 600; color: var(--ink); }
.hc-card:hover .hc-card-name { color: var(--brand); }

.hc-card-note { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }

/* Счётчик прижат к низу, чтобы у карточек разной высоты он стоял в ряд. */
.hc-card-count {
    margin-top: auto;
    padding-top: 8px;
    font-size: 13.5px;
    color: var(--ink-muted);
}

/* ── Списки статей ───────────────────────────────────────────────────────── */

.hc-main ul.hc-list {
    max-width: 860px;
    margin: 0 0 36px;
    padding-left: 0;
    list-style: none;
}

.hc-main ul.hc-list li {
    margin: 0;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
}

.hc-main ul.hc-list li:first-child { border-top: 1px solid var(--line-soft); }

.hc-list a { font-size: 17px; font-weight: 600; }

.hc-list-note {
    display: block;
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-muted);
}

/* ── Хлебные крошки и подпись о правке ───────────────────────────────────── */

.hc-crumbs {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--ink-muted);
}

.hc-crumbs a { color: var(--ink-muted); }
.hc-crumbs a:hover { color: var(--brand); }

/* Разделитель рисуем стилями: так он не попадёт в копируемый текст. */
.hc-crumbs a::after {
    content: '/';
    margin: 0 8px;
    color: var(--line);
}

.hc-main p.hc-meta {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--ink-muted);
}

/* ── Тело статьи ─────────────────────────────────────────────────────────── */

/* Внутри — разметка chatwoot без классов, поэтому правила адресуются тегам. */
.hc-article { max-width: 860px; font-size: 17px; }

.hc-article img {
    max-width: 100%;
    height: auto;
    margin: 6px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* Скриншот почти всегда стоит в абзаце один — даём ему воздух. */
.hc-article p > img:only-child { margin: 10px 0 18px; }

.hc-article blockquote {
    margin: 20px 0;
    padding: 14px 20px;
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--brand-tint);
    color: var(--ink-soft);
}

.hc-article blockquote > :last-child { margin-bottom: 0; }

.hc-article pre {
    margin: 0 0 18px;
    padding: 16px 18px;
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--code-bg);
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.6;
}

.hc-article pre code { padding: 0; background: none; font-size: inherit; }

/* Широкая таблица прокручивается сама, а не тянет вбок всю страницу. */
.table-wrap { margin: 0 0 18px; overflow-x: auto; }

.hc-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.hc-article th,
.hc-article td {
    padding: 9px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.hc-article th { background: var(--bg-soft); font-weight: 600; }

/* ── Соседние статьи и обращение в поддержку ─────────────────────────────── */

.hc-neighbours {
    display: flex;
    gap: 16px;
    max-width: 860px;
    margin: 52px 0 0;
}

.hc-neighbour {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 0;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    color: inherit;
}

.hc-neighbour:hover { background: var(--brand-tint); text-decoration: none; }

/* «Следующая» прижата вправо и текстом тоже — пара читается как стрелки. */
.hc-neighbour--next { margin-left: auto; text-align: right; }

.hc-neighbour-label {
    font-size: 12.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.hc-neighbour-title { font-size: 16px; font-weight: 600; color: var(--brand); }

.hc-help {
    max-width: 860px;
    margin: 52px 0 0;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}

.hc-main .hc-help p { margin: 0; }
.hc-main .hc-help p + p { margin-top: 6px; font-size: 15px; }

/* ── Подвал ──────────────────────────────────────────────────────────────── */

.lp-footer { background: var(--bg-soft); }

.lp-footer-inner {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 32px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 56px 20px 64px;
}

.lp-footer-brand img { display: block; height: 31px; width: auto; }

.lp-footer-brand p { margin: 16px 0 0; font-size: 14px; color: var(--ink-muted); }

.lp-footer-col h5 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
}

.lp-footer-col a {
    display: block;
    margin: 0 0 8px;
    color: var(--ink-soft);
    font-size: 15px;
}

.lp-footer-col a:hover { color: var(--brand); text-decoration: none; }

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

@media (max-width: 1100px) {
    .lp-menu { gap: 18px; }
    .lp-auth { gap: 16px; }
}

@media (max-width: 900px) {
    :root { --header-h: 60px; }

    .lp-logo img { height: 30px; }

    .lp-burger { display: block; }

    /* Меню — выпадающая панель под шапкой. */
    .lp-menu {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px;
        background: var(--bg);
        box-shadow: 0 8px 16px rgba(0, 0, 0, .08);
    }

    .lp-menu-toggle:checked ~ .lp-menu { display: flex; }

    .lp-menu-sub { position: static; display: block; padding: 6px 0 0 12px; box-shadow: none; }
    .lp-menu-sub a { padding: 4px 0; }
    .lp-menu-drop > .lp-menu-item::after { display: none; }

    .lp-auth { margin-left: 0; }

    .hc-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding: 24px 16px 56px;
    }

    /* Боковая панель — свёрнутый блок «Разделы» над текстом. */
    .hc-sidebar {
        position: static;
        max-height: none;
        padding: 12px 16px;
        border-radius: var(--radius-lg);
        background: var(--bg-soft);
    }

    .hc-sidebar summary {
        display: list-item;
        font-weight: 600;
        cursor: pointer;
    }

    .hc-sidebar[open] summary { margin-bottom: 14px; }

    .hc-main h1 { font-size: 30px; }
    .hc-main h2 { font-size: 24px; }
    .hc-main h3 { font-size: 19px; }
    .hc-lede { font-size: 16.5px; }
    .hc-article { font-size: 16px; }

    .hc-search { flex-direction: column; }
    .hc-search button { width: 100%; }

    .hc-cards { grid-template-columns: 1fr; }

    .hc-neighbours { flex-direction: column; }
    .hc-neighbour--next { margin-left: 0; text-align: left; }

    .lp-footer-inner { grid-template-columns: 1fr 1fr; padding: 40px 16px 48px; }
    .lp-footer-brand { grid-column: 1 / -1; }
}
