/* Staff Hound — Help Chat Assistant */
#shChatAssistant {
    --sh-chat-z: 1060;
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: var(--sh-chat-z);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.sh-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--sh-blue, #003399), var(--sh-blue-light, #1a4db3));
    color: #fff;
    font-size: 1.45rem;
    box-shadow: 0 6px 24px rgba(0, 51, 153, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sh-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0, 51, 153, 0.45);
}

.sh-chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(380px, calc(100vw - 2rem));
    height: min(520px, calc(100vh - 6rem));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(15, 23, 42, 0.18);
    border: 1px solid var(--sh-border, #e2e8f0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

#shChatAssistant.open .sh-chat-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#shChatAssistant.open .sh-chat-toggle {
    background: var(--sh-navy, #0c1a3a);
}

.sh-chat-header {
    background: linear-gradient(135deg, var(--sh-blue, #003399), var(--sh-blue-light, #1a4db3));
    color: #fff;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sh-chat-header-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}

.sh-chat-header-sub {
    font-size: 0.72rem;
    opacity: 0.85;
    margin: 0.15rem 0 0;
}

.sh-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sh-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sh-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
}

.sh-chat-msg {
    max-width: 92%;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
    word-break: break-word;
}

.sh-chat-msg.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--sh-border, #e2e8f0);
    color: var(--sh-text, #1e293b);
    border-bottom-left-radius: 4px;
}

.sh-chat-msg.user {
    align-self: flex-end;
    background: var(--sh-blue, #003399);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sh-chat-msg.out-of-scope {
    border-left: 3px solid #f59e0b;
}

.sh-chat-links {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sh-chat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sh-blue, #003399);
    text-decoration: none;
    padding: 0.35rem 0.55rem;
    background: rgba(0, 51, 153, 0.06);
    border-radius: 8px;
    transition: background 0.15s;
}

.sh-chat-link:hover {
    background: rgba(0, 51, 153, 0.12);
    color: var(--sh-blue-dark, #002266);
}

.sh-chat-suggestions {
    padding: 0 1rem 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    background: #f8fafc;
}

.sh-chat-chip {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--sh-border, #e2e8f0);
    background: #fff;
    color: var(--sh-text-muted, #64748b);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.sh-chat-chip:hover {
    border-color: var(--sh-blue, #003399);
    color: var(--sh-blue, #003399);
}

.sh-chat-input-wrap {
    padding: 0.75rem;
    border-top: 1px solid var(--sh-border, #e2e8f0);
    display: flex;
    gap: 0.5rem;
    background: #fff;
}

.sh-chat-input {
    flex: 1;
    border: 1px solid var(--sh-border, #e2e8f0);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.86rem;
    outline: none;
    font-family: inherit;
}

.sh-chat-input:focus {
    border-color: var(--sh-blue, #003399);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.sh-chat-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--sh-red, #E30613);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.sh-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sh-chat-typing {
    align-self: flex-start;
    font-size: 0.78rem;
    color: var(--sh-text-muted, #64748b);
    padding: 0.25rem 0.5rem;
}

@media (max-width: 480px) {
    #shChatAssistant {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .sh-chat-panel {
        width: calc(100vw - 1.5rem);
        height: min(480px, calc(100vh - 5rem));
    }
}
