/* Help bot "Vraag het Clubgenoot" (App/help_bot_widget.php, assets/js/help-bot.js). */
.cg-helpbot {
    --cg-hb-primary: var(--brand-primary, var(--primary, #4F46E5));
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    font-family: var(--font-sans, system-ui, sans-serif);
}
.cg-helpbot-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 0;
    border-radius: 999px;
    padding: .7rem 1.1rem;
    background: var(--cg-hb-primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .25);
    cursor: pointer;
}
.cg-helpbot-toggle:hover { filter: brightness(1.08); }
.cg-helpbot-toggle:focus-visible,
.cg-helpbot-close:focus-visible,
.cg-helpbot-choice:focus-visible,
.cg-helpbot-log:focus-visible {
    outline: 3px solid #0F172A;
    outline-offset: 2px;
}
.cg-helpbot.is-open .cg-helpbot-toggle { display: none; }
.cg-helpbot-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: min(600px, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    color: var(--text, #0F172A);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, .28);
    overflow: hidden;
}
.cg-helpbot-panel[hidden] { display: none; }
.cg-helpbot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    padding: .8rem 1rem;
    background: var(--cg-hb-primary);
    color: #fff;
}
.cg-helpbot-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #fff; }
.cg-helpbot-sub { font-size: .8rem; margin: 0; opacity: .9; }
.cg-helpbot-close {
    border: 0;
    background: transparent;
    color: #fff;
    padding: .25rem;
    border-radius: 6px;
    line-height: 0;
    cursor: pointer;
}
.cg-helpbot-close:hover { background: rgba(255, 255, 255, .15); }
.cg-helpbot-log {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .8rem;
    background: var(--background, #F7F8FC);
    display: flex;
    flex-direction: column;
    gap: .6rem;
    font-size: .95rem;
}
.cg-helpbot-msg {
    max-width: 92%;
    padding: .6rem .8rem;
    border-radius: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.cg-helpbot-msg p { margin: 0 0 .4rem; }
.cg-helpbot-msg p:last-child { margin-bottom: 0; }
.cg-helpbot-msg ol, .cg-helpbot-msg ul { margin: .25rem 0 .4rem; padding-left: 1.2rem; }
.cg-helpbot-msg li { margin-bottom: .2rem; }
.cg-helpbot-msg .help-tip { margin: .4rem 0; padding: .4rem .6rem; }
.cg-helpbot-msg code { color: inherit; background: #eef2f7; padding: 0 .2rem; border-radius: 4px; }
.cg-helpbot-bot { align-self: flex-start; background: #fff; border: 1px solid var(--border, #E5E7EB); }
.cg-helpbot-user { align-self: flex-end; background: var(--cg-hb-primary); color: #fff; }
.cg-helpbot-source { font-size: .78rem; color: var(--muted, #64748B); margin-bottom: .3rem; }
.cg-helpbot-source strong { color: var(--text, #0F172A); }
.cg-helpbot-more { display: inline-block; margin-top: .3rem; font-weight: 600; }
.cg-helpbot-related { margin-top: .5rem; padding-top: .4rem; border-top: 1px solid var(--border, #E5E7EB); font-size: .85rem; }
.cg-helpbot-related ul { list-style: none; padding: 0; margin: .2rem 0 0; }
.cg-helpbot-related li { margin: .15rem 0; }
.cg-helpbot-choices { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.cg-helpbot-choice {
    text-align: left;
    border: 1px solid var(--cg-hb-primary);
    background: #fff;
    color: var(--cg-hb-primary);
    border-radius: 10px;
    padding: .4rem .6rem;
    font-size: .9rem;
    cursor: pointer;
}
.cg-helpbot-choice:hover { background: rgba(79, 70, 229, .06); }
.cg-helpbot-typing { color: var(--muted, #64748B); font-style: italic; }
.cg-helpbot-form {
    display: flex;
    gap: .4rem;
    padding: .6rem;
    border-top: 1px solid var(--border, #E5E7EB);
    background: #fff;
}
.cg-helpbot-form .form-control { flex: 1 1 auto; min-width: 0; font-size: 1rem; }
.cg-helpbot-note { margin: 0; padding: 0 .7rem .6rem; font-size: .72rem; color: var(--muted, #64748B); background: #fff; }

@media (max-width: 575.98px) {
    .cg-helpbot { right: .75rem; bottom: .75rem; }
    .cg-helpbot-toggle { padding: .75rem; }
    .cg-helpbot-toggle-label {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .cg-helpbot.is-open { left: 0; right: 0; bottom: 0; top: 0; }
    .cg-helpbot-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        border: 0;
    }
}
@media print { .cg-helpbot { display: none; } }
