/* ===== Public Help Center ===== */

.help-main {
    min-height: calc(100vh - 200px);
    background: var(--bg, #f7f8fa);
}

/* Hero */
.help-hero {
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(ellipse 60% 50% at 85% 100%, rgba(5,150,105,0.55) 0%, rgba(5,150,105,0) 70%),
        linear-gradient(135deg, #16a34a 0%, #15803d 55%, #166534 100%);
    color: #fff;
    padding: 96px 0 88px;
    text-align: center;
    /* overflow MUST stay visible so the autosuggest panel can escape the hero */
    overflow: visible;
    isolation: isolate;
    /* Promote hero stacking context above the .help-container (sidebar + articles)
       so the autosuggest dropdown paints over the sticky sidebar instead of under it. */
    z-index: 20;
}
/* Keep the articles container below the hero's stacking context. */
.help-container { position: relative; z-index: 1; }
.help-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.10) 1px, transparent 0);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 70% 80% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 40%, #000 30%, transparent 75%);
    pointer-events: none;
    z-index: -1;
}
/* Make sure the form + container do not clip the absolute-positioned dropdown */
.help-hero .container,
.help-search-form,
.help-search-wrap { overflow: visible; }
.help-hero .container {
    position: relative;
    z-index: 1;
}

.help-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ecfdf5;
    margin-bottom: 22px;
}
.help-hero-eyebrow svg { width: 14px; height: 14px; }

.help-hero-title {
    font-size: 52px;
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #fff;
}
.help-hero-subtitle {
    font-size: 18px;
    margin: 0 auto 36px;
    opacity: 0.92;
    max-width: 600px;
    line-height: 1.6;
    font-weight: 400;
}

.help-search-form {
    max-width: 720px;
    margin: 0 auto;
}
.help-search-wrap {
    position: relative;
    display: flex;
    background: #fff;
    border-radius: 16px;
    padding: 8px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 20px 50px -12px rgba(0, 0, 0, 0.35),
        0 8px 20px -8px rgba(0, 0, 0, 0.2);
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.help-search-wrap:focus-within {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 25px 60px -12px rgba(0, 0, 0, 0.4),
        0 0 0 4px rgba(255, 255, 255, 0.18);
}
.help-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.help-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 16px 14px 16px 52px;
    font-size: 16px;
    background: transparent;
    color: #1f2937;
    font-family: inherit;
    border-radius: 12px;
}
.help-search-input::placeholder { color: #9ca3af; }
.help-search-btn {
    background: linear-gradient(180deg, #16a34a, #15803d);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(22, 101, 52, 0.35);
    flex-shrink: 0;
}
.help-search-btn:hover {
    background: linear-gradient(180deg, #15803d, #14532d);
    box-shadow: 0 6px 16px rgba(22, 101, 52, 0.45);
}
.help-search-btn:active { transform: translateY(1px); }

/* Autosuggest dropdown - only renders when NOT hidden (HTML hidden attr respected) */
.help-suggest[hidden] { display: none !important; }
.help-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 12px);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    box-shadow:
        0 24px 60px -16px rgba(15, 23, 42, 0.40),
        0 10px 24px -10px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    z-index: 40;
    text-align: left;
    max-height: min(440px, 65vh);
    display: flex;
    flex-direction: column;
    animation: helpSuggestIn 0.16s ease-out;
}
@keyframes helpSuggestIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.help-suggest-header {
    padding: 10px 16px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}
.help-suggest-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.help-suggest-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s, transform 0.05s;
}
.help-suggest-item.active,
.help-suggest-item:hover {
    background: #f0fdf4;
}
.help-suggest-item.active {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.25);
}
.help-suggest-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.help-suggest-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.help-suggest-q {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.help-suggest-q mark {
    background: #fef08a;
    color: #1f2937;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}
.help-suggest-cat {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.help-suggest-arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    align-self: center;
    opacity: 0;
    transition: opacity 0.1s, transform 0.1s;
}
.help-suggest-item.active .help-suggest-arrow,
.help-suggest-item:hover .help-suggest-arrow {
    opacity: 1;
    color: #16a34a;
    transform: translateX(2px);
}
.help-suggest-empty {
    padding: 28px 16px;
    font-size: 13.5px;
    color: #64748b;
    text-align: center;
}
.help-suggest-empty strong {
    display: block;
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 4px;
}
.help-suggest-footer {
    padding: 9px 14px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.help-suggest-kbd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.help-suggest-kbd kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 4px;
    color: #475569;
    line-height: 1;
}

.help-search-meta {
    margin: 18px 0 0;
    font-size: 14px;
    opacity: 0.95;
}
.help-search-meta a {
    color: #fff;
    text-decoration: underline;
}

/* Quick suggestions under search - hidden while autosuggest is open so the
   dropdown never sits on top of the pills. */
.help-quick-tags {
    margin: 22px 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    transition: opacity 0.15s;
}
.help-search-form.is-searching .help-quick-tags {
    opacity: 0;
    pointer-events: none;
}
.help-quick-tags-label {
    opacity: 0.8;
    margin-right: 4px;
    align-self: center;
}
.help-quick-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.help-quick-tag:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* Container */
.help-container {
    padding: 56px 20px 90px;
    max-width: 1180px;
}
.help-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Sidebar */
.help-sidebar {
    position: sticky;
    top: 24px;
}
.help-sidebar-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 12px;
    padding-left: 12px;
}
.help-cat-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.help-cat-list li {
    border-bottom: 1px solid #f1f5f9;
}
.help-cat-list li:last-child {
    border-bottom: 0;
}
.help-cat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.help-cat-link:hover {
    background: #f8fafc;
    color: #16a34a;
}
.help-cat-link.active {
    background: #ecfdf5;
    color: #16a34a;
    font-weight: 600;
}
.help-cat-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* CTA card in sidebar */
.help-cta-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.help-cta-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1f2937;
}
.help-cta-card p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 14px;
}
.help-cta-card .btn-block {
    display: block;
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.help-cta-card .btn-primary {
    background: #16a34a;
    color: #fff;
    border: 0;
}
.help-cta-card .btn-primary:hover {
    background: #15803d;
}
.help-cta-card .btn-secondary {
    background: #fff;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.help-cta-card .btn-secondary:hover {
    background: #f8fafc;
}

/* Content */
.help-content {
    min-width: 0;
}
.help-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 4px 2px;
    flex-wrap: wrap;
}
.help-toolbar-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
.help-toolbar-count strong { color: #1f2937; font-weight: 700; }
.help-toolbar-actions {
    display: inline-flex;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.help-toolbar-btn {
    background: transparent;
    border: 0;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 7px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s, color 0.12s;
}
.help-toolbar-btn:hover {
    background: #f0fdf4;
    color: #16a34a;
}
.help-toolbar-btn svg {
    width: 14px;
    height: 14px;
}
.help-category {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 28px 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.help-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.help-cat-icon-large {
    color: #16a34a;
    display: inline-flex;
}
.help-category-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
}

.help-articles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.help-article {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.help-article:hover {
    border-color: #cbd5e1;
}
.help-article[open] {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}
.help-article-question {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}
.help-article-question::-webkit-details-marker {
    display: none;
}
.help-chevron {
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.help-article[open] .help-chevron {
    transform: rotate(180deg);
    color: #16a34a;
}
.help-article-answer {
    padding: 0 18px 18px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    margin-top: 0;
}

/* Empty state */
.help-empty {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 60px 28px;
    text-align: center;
    color: #64748b;
}
.help-empty svg {
    color: #cbd5e1;
    margin-bottom: 12px;
}
.help-empty h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
}
.help-empty p {
    font-size: 14px;
    margin: 0;
}
.help-empty a {
    color: #16a34a;
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 880px) {
    .help-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .help-sidebar {
        position: static;
    }
    .help-hero {
        padding: 64px 0 56px;
    }
    .help-hero-eyebrow {
        font-size: 11px;
        padding: 6px 12px;
        margin-bottom: 16px;
    }
    .help-hero-title {
        font-size: 34px;
        letter-spacing: -0.015em;
    }
    .help-hero-subtitle {
        font-size: 15px;
        padding: 0 16px;
        margin-bottom: 28px;
    }
    .help-search-wrap {
        padding: 6px;
        border-radius: 14px;
    }
    .help-search-input {
        padding: 13px 8px 13px 46px;
        font-size: 15px;
    }
    .help-search-icon { left: 18px; }
    .help-search-btn {
        padding: 11px 16px;
        font-size: 14px;
        border-radius: 10px;
    }
    .help-quick-tags { margin-top: 18px; padding: 0 16px; }
    .help-quick-tag { font-size: 12px; padding: 5px 11px; }
    .help-container { padding: 40px 20px 70px; }
    .help-category {
        padding: 20px 18px 8px;
    }
    .help-category-title {
        font-size: 16px;
    }
    .help-article-question {
        font-size: 14px;
        padding: 12px 14px;
    }
}

/* Dark mode (inherits from main.css var system) */
@media (prefers-color-scheme: dark) {
    .help-main {
        background: #0f172a;
    }
    .help-suggest {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
    }
    .help-suggest-header,
    .help-suggest-footer {
        background: #0f172a;
        border-color: #334155;
        color: #94a3b8;
    }
    .help-suggest-footer .help-suggest-kbd kbd {
        background: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }
    .help-suggest-item.active,
    .help-suggest-item:hover {
        background: rgba(22, 163, 74, 0.18);
    }
    .help-suggest-icon {
        background: rgba(22, 163, 74, 0.18);
    }
    .help-suggest-q { color: #f1f5f9; }
    .help-suggest-q mark { background: #facc15; color: #1f2937; }
    .help-suggest-cat { color: #94a3b8; }
    .help-suggest-empty { color: #94a3b8; }
    .help-suggest-empty strong { color: #f1f5f9; }
    .help-toolbar-actions {
        background: #1e293b;
        border-color: #334155;
    }
    .help-toolbar-btn { color: #cbd5e1; }
    .help-toolbar-btn:hover { background: rgba(22, 163, 74, 0.18); }
    .help-toolbar-count { color: #94a3b8; }
    .help-toolbar-count strong { color: #f1f5f9; }
    .help-cat-list,
    .help-cta-card,
    .help-category,
    .help-empty {
        background: #1e293b;
        border-color: #334155;
    }
    .help-cat-link {
        color: #cbd5e1;
    }
    .help-cat-link:hover {
        background: #0f172a;
    }
    .help-cat-link.active {
        background: rgba(22, 163, 74, 0.15);
    }
    .help-cta-card h3,
    .help-category-title,
    .help-article-question,
    .help-empty h2 {
        color: #f1f5f9;
    }
    .help-cta-card p,
    .help-article-answer,
    .help-empty,
    .help-empty p {
        color: #94a3b8;
    }
    .help-article {
        border-color: #334155;
    }
    .help-category-count {
        background: #0f172a;
        color: #94a3b8;
    }
}
