:root {
    --bc-primary: #7c5cfc;
    --bc-primary-dark: #6a4bf0;
    --bc-primary-light: #ede9fe;
    --bc-primary-soft: #f5f3ff;
    --bc-text: #1f2937;
    --bc-muted: #6b7280;
    --bc-border: #e5e7eb;
    --bc-card-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --bc-radius: 16px;
    --bc-radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body.help-page {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: #f3f4f6;
    color: var(--bc-text);
}

.help-page-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

.help-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.help-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--bc-border);
    background: #fff;
    color: var(--bc-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}

.help-back-link:hover {
    background: var(--bc-primary-soft);
    border-color: #ddd6fe;
    color: var(--bc-text);
    text-decoration: none;
}

.help-topbar-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bc-muted);
    text-transform: lowercase;
}

.help-hero {
    background: linear-gradient(135deg, var(--bc-primary-soft) 0%, #fff 100%);
    border: 1px solid #ddd6fe;
    border-radius: var(--bc-radius);
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.help-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    font-weight: 700;
}

.help-hero p {
    margin: 0 0 20px;
    color: var(--bc-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.help-search-wrap {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
}

.help-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--bc-muted);
    pointer-events: none;
}

.help-search {
    width: 100%;
    padding: 14px 16px 14px 42px;
    border: 1px solid var(--bc-border);
    border-radius: 999px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.help-search:focus {
    border-color: var(--bc-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}

.help-section-title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
}

.help-topics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.help-topic-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-sm);
    background: #fff;
    box-shadow: var(--bc-card-shadow);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s;
    cursor: pointer;
}

.help-topic-card:hover {
    border-color: #ddd6fe;
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.help-topic-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bc-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--bc-primary);
}

.help-topic-icon svg {
    width: 20px;
    height: 20px;
}

.help-topic-card h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
}

.help-topic-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--bc-muted);
    line-height: 1.4;
}

.help-faq-card {
    background: #fff;
    border-radius: var(--bc-radius);
    box-shadow: var(--bc-card-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.help-faq-item {
    border-bottom: 1px solid var(--bc-border);
}

.help-faq-item:last-child {
    border-bottom: none;
}

.help-faq-item.is-hidden,
.help-topic-card.is-hidden,
.help-flow-card.is-hidden,
.help-section-title.is-hidden {
    display: none;
}

.help-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    color: var(--bc-text);
    cursor: pointer;
}

.help-faq-question:hover {
    background: var(--bc-primary-soft);
}

.help-faq-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--bc-muted);
    transition: transform 0.2s;
}

.help-faq-item.is-open .help-faq-chevron {
    transform: rotate(180deg);
}

.help-faq-answer {
    display: none;
    padding: 0 18px 16px;
    color: var(--bc-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.help-faq-item.is-open .help-faq-answer {
    display: block;
}

.help-faq-answer ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.help-faq-answer li {
    margin-bottom: 6px;
}

.help-contact-card {
    background: var(--bc-primary);
    color: #fff;
    border-radius: var(--bc-radius);
    padding: 22px 20px;
    text-align: center;
}

.help-contact-card h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.help-contact-card p {
    margin: 0 0 16px;
    font-size: 0.9rem;
    opacity: 0.92;
    line-height: 1.5;
}

.help-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    background: #fff;
    color: var(--bc-primary-dark);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}

.help-contact-btn:hover {
    background: var(--bc-primary-light);
    color: var(--bc-primary-dark);
    text-decoration: none;
}

.help-empty-search {
    display: none;
    text-align: center;
    padding: 24px 16px;
    color: var(--bc-muted);
    font-size: 0.9rem;
}

.help-empty-search.is-visible {
    display: block;
}

.help-table-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(124, 92, 252, 0.12);
    color: var(--bc-primary-dark);
    font-size: 0.82rem;
    font-weight: 600;
}

.help-flow-card {
    background: #fff;
    border-radius: var(--bc-radius);
    box-shadow: var(--bc-card-shadow);
    padding: 20px;
    margin-bottom: 28px;
}

.help-flow-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--bc-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.help-flow-steps li {
    margin-bottom: 8px;
}

.help-faq-answer code {
    font-size: 0.82rem;
    background: var(--bc-primary-soft);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--bc-primary-dark);
}

.help-faq-answer pre.help-sql-block {
    margin: 12px 0;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--bc-border);
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.45;
    overflow-x: auto;
    white-space: pre;
    color: #334155;
}

.help-dev-login-card {
    text-align: left;
}

.help-dev-login-form {
    max-width: 420px;
    margin: 0 auto;
}

.help-dev-login-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bc-text);
}

.help-dev-login-input {
    margin-bottom: 12px;
}

.help-dev-login-error {
    margin: 0 0 12px;
    color: #b91c1c;
    font-size: 0.88rem;
}

.help-dev-login-btn {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 999px;
    background: var(--bc-primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.help-dev-login-btn:hover {
    background: var(--bc-primary-dark);
}

.help-dev-logout-form {
    margin: 0;
}

.help-dev-logout-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--bc-border);
    background: #fff;
    color: var(--bc-muted);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.help-dev-logout-btn:hover {
    background: var(--bc-primary-soft);
    color: var(--bc-text);
}

.help-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.help-contact-btn--outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}

.help-contact-btn--outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

@media (max-width: 480px) {
    .help-topics {
        grid-template-columns: 1fr;
    }

    .help-topbar-title {
        display: none;
    }
}
