/*
 * Kinlytix — Genealogy Research & DNA Collaboration Platform
 *
 * Floating KINNY Assist Chat widget.
 *
 * Copyright (c) 2026 Z-Factor PM, LLC. All rights reserved.
 * Unauthorized copying of this file is strictly prohibited.
 *
 * @author     Suzanne St. John <suzanne@kinlytix.com>
 * @copyright  2026 Z-Factor PM, LLC
 * @license    Proprietary
 */

#kinlytix-help-assist {
    position: fixed;
    bottom: calc(12px + var(--kin-workspace-float-height, 0px) + var(--kin-phone-tabbar-height, 0px));
    left: 24px;
    z-index: 2147482990;
    font-family: inherit;
}
#kin-help-assist-toggle {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    border: 0;
    background: #fff !important;
    border-radius: 16px;
    cursor: pointer;
    line-height: 0;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
}
#kin-help-assist-toggle:hover {
    transform: scale(1.06);
}
#kin-help-assist-toggle:focus-visible {
    outline: 2px solid #3a5a2c;
    outline-offset: 4px;
    border-radius: 4px;
}
#kin-help-assist-toggle img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    background: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
}
body:has(#kin-help-assist-header-toggle) #kin-help-assist-toggle {
    display: none;
}
#kin-help-assist-panel {
    width: 360px;
    height: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0ddd5;
    margin-bottom: 8px;
}
#kin-help-assist-panel.is-open {
    display: flex;
}
.kin-help-assist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: #3a5a2c;
    color: #fff;
    flex-shrink: 0;
}
.kin-help-assist-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.kin-help-assist-kb {
    margin-left: auto;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.kin-help-assist-close {
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.kin-help-assist-log {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    background: #faf9f6;
}
.kin-help-assist-msg {
    max-width: 92%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.kin-help-assist-msg--bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e8e4dc;
    border-bottom-left-radius: 4px;
}
.kin-help-assist-msg--user {
    align-self: flex-end;
    background: #5a7a3c;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.kin-help-assist-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.kin-help-assist-links a {
    color: #3a5a2c;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.kin-help-assist-links a:hover {
    text-decoration: underline;
}
.kin-help-assist-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e0ddd5;
    flex-shrink: 0;
    background: #fff;
}
.kin-help-assist-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
#kin-help-assist-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #d8d2c7;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}
#kin-help-assist-send {
    border: 0;
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    background: #3a5a2c;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}
#kin-help-assist-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.kin-help-assist-status {
    padding: 0 12px 8px;
    font-size: 12px;
    color: #6b7280;
}
@media (max-width: 768px) {
    #kinlytix-help-assist {
        left: 12px;
        bottom: calc(8px + var(--kin-workspace-float-height, 0px) + var(--kin-phone-tabbar-height, 0px));
    }
    #kin-help-assist-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }
}
