/* ══════════════════════════════════════════════════════════════════════
   СПРАВКА — тёмная тема, аналог Базы Знаний
   ══════════════════════════════════════════════════════════════════════ */
.view-help {
    --help-primary:    #00d4aa;
    --help-bg:         #0d1117;
    --help-card:       #161b22;
    --help-elevated:   #1e2430;
    --help-text:       #d1d9e0;
    --help-text-muted: #7d8590;
    --help-text-head:  #f0f6fc;
    --help-border:     rgba(255,255,255,0.06);
    font-family: 'Geist', 'Inter', system-ui, sans-serif;
    background: var(--help-bg);
    color: var(--help-text);
    min-height: 100%;
    padding: 0;
}

/* ── Search bar ─────────────────────────────────────────────────────── */
.help-search-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--help-bg);
    padding: 14px 20px;
    border-bottom: 1px solid var(--help-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-search-icon {
    color: var(--help-text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

#help-search-input {
    flex: 1;
    background: var(--help-card);
    border: 1px solid var(--help-border);
    border-radius: 8px;
    padding: 9px 14px;
    color: var(--help-text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
#help-search-input:focus { border-color: var(--help-primary); }
#help-search-input::placeholder { color: var(--help-text-muted); }

.help-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--help-card);
    border: 1px solid var(--help-border);
    border-radius: 6px;
    color: var(--help-text-muted);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.help-clear-btn:hover { background: var(--help-elevated); color: var(--help-text); }

/* ── Layout ─────────────────────────────────────────────────────────── */
.help-layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100dvh - 120px);
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.help-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 65px;
    max-height: calc(100dvh - 65px - 64px);
    overflow-y: auto;
    padding: 14px 10px 14px 14px;
    background: var(--help-card);
    border-right: 1px solid var(--help-border);
}
.help-sidebar::-webkit-scrollbar { width: 4px; }
.help-sidebar::-webkit-scrollbar-track { background: transparent; }
.help-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.help-sidebar-link {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--help-text-muted);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.15s, background 0.15s;
    margin-bottom: 2px;
}
.help-sidebar-link:hover { color: var(--help-text); background: rgba(255,255,255,0.04); }
.help-sidebar-link.active { color: var(--help-primary); background: rgba(0,212,170,0.08); font-weight: 500; }

/* ── Main content ───────────────────────────────────────────────────── */
.help-main { flex: 1; min-width: 0; padding: 16px 24px 60px; }

/* ── Override faq-* ─────────────────────────────────────────────────── */
.view-help .faq-overlay,
.view-help .faq-close-btn,
.view-help .faq-header { display: none !important; }

.view-help .faq-panel {
    position: static;
    transform: none !important;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.view-help .faq-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
}

.view-help .faq-section {
    background: var(--help-card);
    border: 1px solid var(--help-border);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.view-help .faq-section:hover { border-color: rgba(255,255,255,0.1); }

.view-help .faq-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s;
}
.view-help .faq-section-header:hover { background: rgba(255,255,255,0.03); }

.view-help .faq-section-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,212,170,0.1);
    border-radius: 8px;
    color: var(--help-primary);
    font-size: 14px;
    flex-shrink: 0;
}

.view-help .faq-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--help-text-head);
    flex: 1;
}

.view-help .faq-section-badge {
    font-size: 11px;
    color: var(--help-text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
}

.view-help .faq-chevron {
    color: var(--help-text-muted);
    font-size: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.view-help .faq-chevron.rotated { transform: rotate(180deg); }

.view-help .faq-section-body {
    display: none;
    padding: 0 18px 18px;
    border-top: 1px solid var(--help-border);
}
.view-help .faq-section-body.open { display: block; }

.view-help .faq-intro {
    font-size: 13.5px;
    color: var(--help-text-muted);
    line-height: 1.65;
    padding: 12px 0 10px 12px;
    border-left: none !important;
    border-bottom: 1px solid var(--help-border);
    margin-bottom: 10px;
}

/* Column list */
.view-help .faq-col-list { display: flex; flex-direction: column; }
.view-help .faq-col {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 9px 0 9px 14px;
    border-bottom: 1px solid var(--help-border);
    border-left: none !important;
}
.view-help .faq-col:last-child { border-bottom: none; }
.view-help .faq-col-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--help-text-head);
    padding-top: 1px;
}
.view-help .faq-col-desc {
    font-size: 13px;
    color: var(--help-text);
    line-height: 1.6;
}

/* Tip */
.view-help .faq-tip {
    font-size: 12px;
    color: var(--help-text-muted);
    background: rgba(0,212,170,0.05);
    border-left: 2px solid var(--help-primary);
    padding: 7px 10px;
    border-radius: 0 6px 6px 0;
    margin-top: 7px;
    line-height: 1.55;
}

/* Strategy block */
.view-help .faq-strategy-block {
    background: var(--help-elevated);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
}
.view-help .faq-strategy-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--help-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.view-help .faq-strategy-list { display: flex; flex-direction: column; gap: 6px; }
.view-help .faq-strategy-item {
    font-size: 13px;
    color: var(--help-text);
    line-height: 1.6;
    padding: 7px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}

/* Trend legend */
.view-help .faq-trend-legend { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.view-help .faq-trend-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--help-text);
}

/* Badges */
.view-help .faq-badge-up    { background: rgba(0,212,100,0.12); color: #00d464; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.view-help .faq-badge-down  { background: rgba(255,70,70,0.12);  color: #ff6464; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.view-help .faq-badge-flat  { background: rgba(200,200,200,0.1); color: #9ca3af; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.view-help .faq-badge-vol-up   { background: rgba(0,212,100,0.12); color: #00d464; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.view-help .faq-badge-vol-down { background: rgba(255,70,70,0.12); color: #ff6464; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* Category grid */
.view-help .faq-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.view-help .faq-cat-card {
    background: var(--help-elevated);
    border-radius: 8px;
    padding: 11px 13px;
    border: 1px solid var(--help-border);
}
.view-help .faq-cat-conservative { border-color: rgba(59,130,246,0.2); }
.view-help .faq-cat-working      { border-color: rgba(0,212,170,0.2); }
.view-help .faq-cat-aggressive   { border-color: rgba(251,146,60,0.2); }
.view-help .faq-cat-madmax       { border-color: rgba(239,68,68,0.2); }
.view-help .faq-cat-name { font-size: 13px; font-weight: 700; color: var(--help-text-head); margin-bottom: 5px; }
.view-help .faq-cat-desc { font-size: 12px; color: var(--help-text-muted); line-height: 1.55; }

/* Status grid */
.view-help .faq-status-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    align-items: center;
    margin-top: 7px;
    font-size: 12px;
}
.view-help .faq-status-near       { color: #00d4aa; font-weight: 600; }
.view-help .faq-status-watch      { color: #f59e0b; font-weight: 600; }
.view-help .faq-status-far        { color: #7d8590; font-weight: 600; }
.view-help .faq-status-break-up   { color: #00d464; font-weight: 600; }
.view-help .faq-status-break-down { color: #ff6464; font-weight: 600; }

/* Colors */
.view-help .faq-green  { color: #00d464; }
.view-help .faq-red    { color: #ff6464; }
.view-help .liq-liquid { color: #00d464; font-weight: 600; }
.view-help .liq-normal { color: #f59e0b; font-weight: 600; }
.view-help .liq-thin   { color: #ff6464; font-weight: 600; }
.view-help .lr-long    { color: #ff6464; }
.view-help .lr-short   { color: #00d464; }
.view-help .lr-none    { color: #7d8590; }

/* Search highlight */
.view-help mark {
    background: rgba(0,212,170,0.2);
    color: var(--help-primary);
    border-radius: 2px;
    padding: 0 1px;
}

/* Hidden in search */
.view-help .faq-section.help-hidden { display: none; }

/* Error */
.help-error {
    padding: 40px;
    text-align: center;
    color: var(--help-text-muted);
    font-size: 14px;
}
.help-error button {
    background: var(--help-primary);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .help-layout { flex-direction: column; }
    .help-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--help-border);
        padding: 10px 14px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .help-sidebar-link { padding: 5px 9px; }
    .help-main { padding: 14px 14px 40px; }
    .view-help .faq-col { grid-template-columns: 1fr; gap: 4px; }
    .view-help .faq-col-name { color: var(--help-primary); }
    .view-help .faq-section-badge { display: none; }
    .view-help .faq-category-grid { grid-template-columns: 1fr 1fr; }
}
