.ft-chat {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 500;
    font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}

.ft-chat-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid rgba(232, 197, 71, 0.35);
    border-radius: 999px;
    background: linear-gradient(135deg, #2a2418, #1a2840);
    color: #f2f2f7;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.ft-chat-toggle:hover {
    border-color: #e8c547;
}

.ft-chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: min(380px, calc(100vw - 2rem));
    height: min(520px, calc(100vh - 6rem));
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #181920;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.ft-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(90deg, #1a2840, #241a10);
    border-bottom: 1px solid rgba(232, 197, 71, 0.18);
}

.ft-chat-head strong {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 0.95rem;
}

.ft-chat-close {
    border: none;
    background: transparent;
    color: #9a9aa8;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.ft-chat-discord-banner {
    margin: 0.75rem 1rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(77, 212, 255, 0.08);
    border: 1px solid rgba(77, 212, 255, 0.2);
    font-size: 0.82rem;
    color: #c8d6e5;
}

.ft-chat-discord-banner a {
    color: #4dd4ff;
    font-weight: 600;
}

.ft-chat-intro {
    padding: 0.75rem 1rem 0;
    font-size: 0.88rem;
    color: #9a9aa8;
}

.ft-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ft-chat-empty {
    margin: 0;
    color: #9a9aa8;
    font-size: 0.88rem;
}

.ft-chat-msg {
    max-width: 92%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.ft-chat-msg-visitor {
    align-self: flex-end;
    background: rgba(232, 197, 71, 0.12);
    border: 1px solid rgba(232, 197, 71, 0.22);
}

.ft-chat-msg-staff {
    align-self: flex-start;
    background: rgba(77, 212, 255, 0.08);
    border: 1px solid rgba(77, 212, 255, 0.18);
}

.ft-chat-msg-meta {
    font-size: 0.72rem;
    color: #9a9aa8;
    margin-bottom: 0.2rem;
}

.ft-chat-msg-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.ft-chat-form {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ft-chat-name,
.ft-chat-input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #22222c;
    color: #f2f2f7;
    font: inherit;
    resize: none;
}

.ft-chat-input {
    min-height: 72px;
}

.ft-chat-error {
    margin: 0;
    font-size: 0.82rem;
    color: #ff8a8a;
}

.ft-chat-form .btn {
    align-self: flex-end;
}

@media (max-width: 480px) {
    .ft-chat {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .ft-chat-panel {
        width: calc(100vw - 1.5rem);
    }
}
