/* Floating help — fixed bottom-right; clears mobile bottom nav + safe area */
.support-chat-fab {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 10050;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary, #6366f1);
    color: white;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.support-chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}
@media (max-width: 640px) {
    .support-chat-fab {
        bottom: calc(16px + var(--bottom-nav-bar-height, 60px) + env(safe-area-inset-bottom));
    }
}

.support-chat-panel {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 10051;
    width: min(360px, calc(100vw - 32px));
    max-height: min(420px, 70vh);
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
@media (max-width: 640px) {
    .support-chat-panel {
        bottom: calc(76px + var(--bottom-nav-bar-height, 60px) + env(safe-area-inset-bottom));
    }
}

.support-chat-panel-hd {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--primary-light, #eef2ff);
}
.support-chat-panel-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text, #0f172a);
    flex: 1;
    min-width: 0;
}
.support-chat-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.support-chat-clear {
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    color: var(--muted, #64748b);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.support-chat-clear:hover {
    color: var(--text, #0f172a);
    background: rgba(255, 255, 255, 0.6);
}
.support-chat-close {
    border: none;
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--muted, #64748b);
    flex-shrink: 0;
}
.support-chat-close:hover {
    background: #f1f5f9;
    color: var(--text, #0f172a);
}

.support-chat-messages {
    flex: 1;
    min-height: 140px;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text, #0f172a);
}
.support-chat-bubble {
    padding: 8px 10px;
    border-radius: 10px;
    max-width: 100%;
    word-break: break-word;
}
.support-chat-bubble.q {
    align-self: flex-end;
    background: var(--primary-light, #eef2ff);
    color: var(--primary-dark, #4f46e5);
    font-weight: 600;
}
.support-chat-bubble.a {
    align-self: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    white-space: pre-wrap;
}
.support-chat-loading {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted, #64748b);
    padding: 4px 0;
}
.support-chat-err {
    align-self: stretch;
    font-size: 12px;
    font-weight: 600;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 10px;
}

.support-chat-ft {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.support-chat-input {
    width: 100%;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 100px;
    outline: none;
    box-sizing: border-box;
}
.support-chat-input:focus {
    border-color: var(--primary, #6366f1);
}
.support-chat-send {
    align-self: flex-end;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: var(--primary, #6366f1);
    color: white;
    cursor: pointer;
    font-family: inherit;
}
.support-chat-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.support-chat-send:hover:not(:disabled) {
    background: var(--primary-dark, #4f46e5);
}
