/* Active Help Chatbot — local_helpbot */

.local-helpbot-root {
    position: fixed;
    right: 1.25rem;
    bottom: 6.5rem;
    z-index: 10050;
    font-size: 0.9375rem;
    pointer-events: none;
}

.local-helpbot-root * {
    pointer-events: auto;
}

.local-helpbot-launcher.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 2rem;
    padding: 0.65rem 1.1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    background: #4338ca;
    border: 1px solid #4338ca;
    color: #fff;
}

.local-helpbot-launcher.btn:hover,
.local-helpbot-launcher.btn:focus {
    background: #3730a3;
    border-color: #3730a3;
    color: #fff;
}

.local-helpbot-launcher-icon {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-weight: 700;
}

.local-helpbot-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: min(24rem, calc(100vw - 2rem));
    max-height: min(28rem, calc(100vh - 13rem));
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1e293b;
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.local-helpbot-panel.hidden,
.local-helpbot-policy.hidden,
.local-helpbot-suggestions.hidden {
    display: none;
}

.local-helpbot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
    background: #4338ca;
    color: #fff;
}

.local-helpbot-heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.local-helpbot-support {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
}

.local-helpbot-support:hover,
.local-helpbot-support:focus {
    color: #fff;
}

.local-helpbot-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M2.146 2.146a.5.5 0 0 1 .708 0L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1rem 1rem;
    filter: none;
    opacity: 1;
    cursor: pointer;
}

.local-helpbot-close:hover,
.local-helpbot-close:focus-visible {
    background-color: rgba(255, 255, 255, 0.18);
}

.local-helpbot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
    background: #f8fafc;
    overscroll-behavior: contain;
}

.local-helpbot-bubble {
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    line-height: 1.45;
    max-width: 95%;
    word-wrap: break-word;
}

.local-helpbot-bubble p {
    margin: 0 0 0.4rem;
}

.local-helpbot-bubble p:last-child {
    margin-bottom: 0;
}

.local-helpbot-bubble-user {
    margin-left: auto;
    background: #4338ca;
    color: #fff;
}

.local-helpbot-bubble-bot {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.local-helpbot-bubble-bot a {
    color: #3730a3;
    text-decoration: underline;
}

.local-helpbot-bubble-handoff {
    border-color: #fdba74;
    background: #fff7ed;
}

.local-helpbot-bubble-system {
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    padding-left: 0;
    padding-right: 0;
}

.local-helpbot-sources {
    margin: 0.45rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.local-helpbot-source {
    display: block;
}

.local-helpbot-feedback,
.local-helpbot-followups,
.local-helpbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.local-helpbot-feedback,
.local-helpbot-followups {
    margin-top: 0.45rem;
}

.local-helpbot-suggestions {
    flex: 0 1 auto;
    max-height: 4.75rem;
    overflow-y: auto;
    padding: 0 1rem 0.75rem;
    background: #f8fafc;
}

.local-helpbot-feedback-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-right: 0.15rem;
}

.local-helpbot-suggestion,
.local-helpbot-feedback button {
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #3730a3;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    max-width: 100%;
}

.local-helpbot-suggestion:hover,
.local-helpbot-feedback button:hover,
.local-helpbot-suggestion:focus-visible,
.local-helpbot-feedback button:focus-visible,
.local-helpbot-launcher:focus-visible,
.local-helpbot-send:focus-visible,
.local-helpbot-close:focus-visible,
.local-helpbot-accept-policy:focus-visible {
    outline: 2px solid #312e81;
    outline-offset: 2px;
}

.local-helpbot-policy {
    padding: 0.5rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.local-helpbot-policy-text {
    margin: 0 0 0.4rem;
    font-size: 0.8125rem;
    color: #475569;
}

.local-helpbot-accept-policy {
    background: #fff;
    color: #3730a3;
    border: 1px solid #4338ca;
}

.local-helpbot-compose {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.local-helpbot-input {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
}

.local-helpbot-send.btn {
    align-self: flex-end;
    background: #4338ca;
    border-color: #4338ca;
    color: #fff;
}

.local-helpbot-send.btn:disabled {
    opacity: 0.65;
}

.local-helpbot-consent {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 1rem 0.75rem;
    font-size: 0.7rem;
    line-height: 1.35;
    color: #64748b;
    background: #fff;
}

.local-helpbot-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.local-helpbot-report-filters {
    margin-bottom: 0.75rem;
}

.local-helpbot-report-question {
    max-width: 28rem;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 480px) {
    .local-helpbot-root {
        right: 0.75rem;
        bottom: 5.75rem;
    }

    .local-helpbot-launcher-label {
        display: none;
    }

    .local-helpbot-panel {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 9.5rem;
        width: auto;
        max-height: calc(100vh - 12rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .local-helpbot-root,
    .local-helpbot-root * {
        scroll-behavior: auto;
    }
}
