.crm-help {
    --ch-card: #ffffff;
    --ch-text: #0f172a;
    --ch-muted: #64748b;
    --ch-border: #e8ecf1;
    --ch-soft: #f8fafc;
    --ch-elev: #f1f5f9;
    --ch-accent: #2563eb;
    --ch-on-accent: #ffffff;
    color: var(--ch-text);
    max-width: 1180px;
    margin: 0 auto;
}
html[data-site-profile="bsp"] .crm-help { --ch-accent: #253e94; }
html:not([data-site-profile="bsp"]) .crm-help { --ch-accent: #af000f; }
html[data-ui-theme="dark"] .crm-help {
    --ch-card: #1e2128;
    --ch-text: #e8eaed;
    --ch-muted: #9aa0a6;
    --ch-border: #3c4043;
    --ch-soft: #121418;
    --ch-elev: #252830;
    --ch-accent: #8ab4f8;
    --ch-on-accent: #121418;
}
.crm-help-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.crm-help a:focus,
.crm-help button:focus,
.crm-help input:focus {
    outline: 2px solid var(--ch-accent);
    outline-offset: 2px;
}
.crm-help-crumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--ch-muted);
    font-size: 13px;
    margin-bottom: 14px;
}
.crm-help-crumb a { color: var(--ch-muted); text-decoration: none; }
.crm-help-crumb a:hover { color: var(--ch-text); }
.crm-help-intro h1 {
    margin: 0 0 6px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ch-text);
}
.crm-help-intro p { margin: 0 0 18px; color: var(--ch-muted); font-size: 15px; }
.crm-help-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}
.crm-help-search i {
    position: absolute;
    left: 14px;
    color: var(--ch-muted);
}
.crm-help-search input {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--ch-border);
    background: var(--ch-soft);
    color: var(--ch-text);
    padding: 0 88px 0 40px;
    font-size: 15px;
}
.crm-help-search-clear {
    position: absolute;
    right: 12px;
    color: var(--ch-accent);
    font-size: 13px;
    text-decoration: none;
}
.crm-help-live {
    position: absolute;
    z-index: 5;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    max-height: 320px;
    overflow: auto;
}
.crm-help-live a,
.crm-help-live p {
    display: block;
    padding: 10px 14px;
    color: var(--ch-text);
    text-decoration: none;
    border-bottom: 1px solid var(--ch-border);
}
.crm-help-live a strong { display: block; }
.crm-help-live a span { color: var(--ch-muted); font-size: 12px; }
.crm-help-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
.crm-help-section-title,
.crm-help-card h2,
.crm-help-results h2,
.crm-help-article h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ch-text);
}
.crm-help-topics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.crm-help-topic,
.crm-help-card,
.crm-help-article,
.crm-help-results,
.crm-help-support,
.crm-help-assist {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: 16px;
    color: var(--ch-text);
}
.crm-help-topic {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    text-decoration: none;
    min-height: 112px;
}
.crm-help-topic:hover { background: var(--ch-elev); }
.crm-help-topic-copy { flex: 1; min-width: 0; }
.crm-help-topic-copy strong,
.crm-help-questions a span,
.crm-help-result-list strong {
    display: block;
    color: var(--ch-text);
    font-size: 14px;
}
.crm-help-topic-copy em,
.crm-help-summary,
.crm-help-result-list em,
.crm-help-support p {
    display: block;
    margin-top: 4px;
    color: var(--ch-muted);
    font-style: normal;
    font-size: 13px;
    line-height: 1.45;
}
.crm-help-topic > .fa-angle-right { color: var(--ch-muted); margin-top: 4px; }
.crm-help-topic-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    color: #fff;
}
.tone-blue { background: #3b82f6; }
.tone-green { background: #16a34a; }
.tone-purple { background: #7c3aed; }
.tone-orange { background: #ea580c; }
.tone-teal { background: #0f766e; }
.tone-amber { background: #d97706; }
.tone-red { background: #e11d48; }
.tone-slate { background: #475569; }
.crm-help-card,
.crm-help-results,
.crm-help-article { padding: 16px 18px 8px; margin-bottom: 16px; }
.crm-help-questions { list-style: none; margin: 0; padding: 0; }
.crm-help-questions a,
.crm-help-result-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 2px;
    border-top: 1px solid var(--ch-border);
    color: var(--ch-text);
    text-decoration: none;
}
.crm-help-result-list { list-style: none; margin: 0; padding: 0; }
.crm-help-result-list a { align-items: flex-start; flex-direction: column; }
.crm-help-result-list span { color: var(--ch-accent); font-size: 12px; }
.crm-help-questions a:hover,
.crm-help-result-list a:hover { color: var(--ch-accent); }
.crm-help-empty {
    text-align: center;
    padding: 28px 12px 22px;
    color: var(--ch-muted);
}
.crm-help-empty h3 { margin: 8px 0 4px; color: var(--ch-text); }
.crm-help-article ol { margin: 0 0 16px 18px; padding: 0; }
.crm-help-article li { margin: 0 0 10px; line-height: 1.5; }
.crm-help-kicker {
    margin: 0 0 6px;
    color: var(--ch-accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.crm-help-article-links h3 { font-size: 14px; margin: 0 0 8px; }
.crm-help-article-links ul { margin: 0 0 12px 18px; padding: 0; }
.crm-help-article-links a { color: var(--ch-accent); }
.crm-help-article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 8px 0 12px;
}
.crm-help-back,
.crm-help-ask-article,
.crm-help-retry {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--ch-border);
    background: var(--ch-elev);
    color: var(--ch-text);
    cursor: pointer;
}
.crm-help-ask-article,
.crm-help-retry {
    background: var(--ch-accent);
    border-color: var(--ch-accent);
    color: var(--ch-on-accent);
}
.crm-help-support {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px;
    margin-bottom: 20px;
}
.crm-help-support > div { display: flex; gap: 12px; align-items: flex-start; }
.crm-help-support strong { display: block; }
.crm-help-support p { margin: 2px 0 0; }
.crm-help-support a { color: var(--ch-accent); text-decoration: none; }
.crm-help-assist {
    position: sticky;
    top: 16px;
    padding: 16px;
    border-color: var(--ch-accent);
    box-shadow: inset 0 0 0 1px rgba(138, 180, 248, 0.15);
}
.crm-help-assist h2 { margin: 0; font-size: 18px; }
.crm-help-assist header p { margin: 4px 0 12px; color: var(--ch-muted); font-size: 13px; }
.crm-help-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.crm-help-assist-banner,
.crm-help-error {
    background: var(--ch-elev);
    border: 1px solid var(--ch-border);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ch-text);
    font-size: 13px;
    margin-bottom: 12px;
}
.crm-help-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    margin-bottom: 12px;
    padding-right: 2px;
}
.crm-help-bubble { display: flex; gap: 8px; align-items: flex-start; }
.crm-help-bubble.is-user { justify-content: flex-end; }
.crm-help-bubble p {
    margin: 0;
    white-space: pre-wrap;
    background: var(--ch-elev);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
}
.crm-help-bubble.is-user p {
    background: var(--ch-accent);
    color: var(--ch-on-accent);
}
.crm-help-bubble ul { margin: 8px 0 0; padding-left: 16px; }
.crm-help-bubble a { color: var(--ch-accent); }
.crm-help-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.crm-help-suggestions button {
    border-radius: 999px;
    border: 1px solid var(--ch-border);
    background: transparent;
    color: var(--ch-text);
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.crm-help-suggestions button:hover { background: var(--ch-elev); }
.crm-help-composer { display: flex; gap: 8px; }
.crm-help-composer input {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--ch-border);
    background: var(--ch-soft);
    color: var(--ch-text);
    padding: 0 12px;
}
.crm-help-composer button,
.crm-help-retry {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: var(--ch-accent);
    color: var(--ch-on-accent);
}
.crm-help-retry { width: auto; height: auto; margin-top: 8px; }
.crm-help-composer button:disabled,
.crm-help-composer input:disabled { opacity: 0.55; cursor: not-allowed; }
.crm-help-disclaimer { margin: 8px 0 0; color: var(--ch-muted); font-size: 12px; }
html[data-ui-theme="dark"] body.admin .crm-help a.crm-help-topic,
html[data-ui-theme="dark"] body.admin .crm-help a.crm-help-topic strong,
html[data-ui-theme="dark"] body.admin .crm-help a.crm-help-topic em,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-questions a,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-questions a span,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-result-list a,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-result-list a strong,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-crumb,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-crumb a,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-back {
    color: #e8eaed !important;
}
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-article-links a,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-support a,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-bubble a,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-search-clear,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-kicker,
html[data-ui-theme="dark"] body.admin .crm-help .crm-help-result-list span {
    color: #8ab4f8 !important;
}
@media (max-width: 991px) {
    .crm-help-layout,
    .crm-help-topics { grid-template-columns: 1fr; }
    .crm-help-assist { position: static; order: -1; }
    .crm-help-support { flex-direction: column; align-items: flex-start; }
    .crm-help-intro h1 { font-size: 26px; }
}
