/* ---- Help & Support ---- */

.help-page {
    padding-bottom: 32px;
}

/* Search */

.help-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 4px 0 20px;
}

.help-search-icon {
    position: absolute;
    left: 14px;
    color: var(--app-text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.help-search-input {
    width: 100%;
    height: 44px;
    padding: 0 40px;
    border-radius: 22px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.95rem;
    font-family: inherit;
}

.help-search-input::placeholder {
    color: var(--app-text-muted);
}

.help-search-input:focus {
    outline: none;
    border-color: var(--ui-primary);
}

.help-search-clear {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--app-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
}

/* Action cards */

.help-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.help-action-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.help-action-card--primary {
    background: var(--ui-primary);
    border-color: var(--ui-primary);
    color: #fff;
}

.help-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ui-primary-muted);
    color: var(--ui-primary);
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.help-action-card--primary .help-action-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.help-action-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.help-action-sub {
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

.help-action-card--primary .help-action-sub {
    color: rgba(255, 255, 255, 0.85);
}

/* Sections */

.help-section {
    margin-bottom: 28px;
}

.help-section-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app-text);
    letter-spacing: -0.01em;
}

.help-card-list {
    display: flex;
    flex-direction: column;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    overflow: hidden;
}

.help-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.help-row:last-child {
    border-bottom: none;
}

.help-row:active {
    background: var(--app-surface-raised);
}

.help-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--ui-primary-muted);
    color: var(--ui-primary);
    font-size: 1rem;
}

.help-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-row-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--app-text);
}

.help-row-sub {
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

.help-row-chevron {
    color: var(--app-text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Still need help footer */

.help-still-stuck {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 22px 18px;
    border-radius: var(--app-radius-lg);
    background: var(--ui-primary-muted);
    border: 1px solid var(--ui-primary-muted);
}

.help-still-stuck-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
}

.help-still-stuck-text {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--app-text-muted);
}

.help-still-stuck-btn {
    width: 100%;
    max-width: 260px;
}

.help-still-stuck-link {
    margin-top: 4px;
    background: transparent;
    border: none;
    color: var(--ui-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* Topic + article */

.help-topic-subtitle {
    margin-bottom: 14px;
}

.help-article {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 18px;
}

.help-article-topic {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--ui-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 10px;
}

.help-article-question {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--app-text);
    line-height: 1.35;
}

.help-article-answer {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--app-text-secondary);
    white-space: pre-wrap;
}

.help-article-footer {
    margin-top: 20px;
    text-align: center;
}

.help-article-footer-text {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: var(--app-text-muted);
}

.help-article-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Contact form */

.help-contact-intro {
    margin-bottom: 18px;
}

.help-contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.help-contact-submit,
.help-contact-form .help-contact-submit {
    width: 100%;
}

.help-done-btn {
    margin-top: 18px;
    width: 100%;
    max-width: 260px;
}

/* AI chat */

.help-chat-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--app-topbar-height) - var(--app-nav-height) - 32px);
    max-width: var(--app-max-content);
}

.help-chat-scroll {
    flex: 1;
}

.help-end-chat {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    padding: 6px 14px;
    color: var(--app-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.help-chat-bubble {
    white-space: pre-wrap;
}

.help-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
}

.help-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--app-text-muted);
    animation: help-typing 1s infinite ease-in-out;
}

.help-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.help-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes help-typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.help-handoff {
    margin: 14px 0 4px;
    padding: 16px;
    border-radius: var(--app-radius-lg);
    background: var(--ui-primary-muted);
    border: 1px solid var(--ui-primary-muted);
    text-align: center;
}

.help-handoff-text {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: var(--app-text);
}

.help-chat-error {
    margin: 8px 0 0;
}

.help-chat-human-link {
    align-self: center;
    margin: 8px 0 4px;
    background: transparent;
    border: none;
    color: var(--ui-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

@media (max-width: 380px) {
    .help-actions {
        grid-template-columns: 1fr;
    }
}
