#chat .chat-panel {
    background: var(--dark-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    padding: 1.5rem;
}

#chat .chat-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

#chat .chat-title {
    margin-bottom: 0;
}

#chat .chat-identity {
    color: var(--text-gray);
    font-size: 0.9rem;
    white-space: nowrap;
}

#chat .chat-identity span {
    color: var(--accent-blue);
    font-weight: 700;
}

#chat .chat-messages {
    height: 360px;
    overflow-y: auto;
    background: var(--dark-bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, 0.65) rgba(20, 20, 28, 0.9);
}

#chat .chat-messages::-webkit-scrollbar {
    width: 10px;
}

#chat .chat-messages::-webkit-scrollbar-track {
    background: rgba(20, 20, 28, 0.9);
    border-radius: 999px;
}

#chat .chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.8), rgba(125, 211, 252, 0.65));
    border-radius: 999px;
    border: 2px solid rgba(20, 20, 28, 0.9);
}

#chat .chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.95), rgba(125, 211, 252, 0.8));
}

#chat .chat-message {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 0.65rem 0.8rem;
}

#chat .chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

#chat .chat-user {
    color: var(--accent-purple);
    font-size: 0.85rem;
    font-weight: 700;
}

#chat .chat-time {
    color: var(--text-gray);
    font-size: 0.75rem;
}

#chat .chat-text {
    color: var(--accent-white);
    word-break: break-word;
    line-height: 1.5;
    font-size: 0.95rem;
}

#chat .chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    margin-top: 1rem;
}

#chat .chat-input {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--dark-bg-tertiary);
    color: var(--accent-white);
    border-radius: 999px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
}

#chat .chat-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12);
}

#chat .chat-send {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.85rem 1.35rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark-bg);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    transition: transform 0.2s ease;
}

#chat .chat-send:hover {
    transform: scale(1.03);
}

#chat .chat-send:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

#chat .chat-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-gray);
}

#chat .chat-empty {
    color: var(--text-gray);
    text-align: center;
    padding: 1.5rem 0.5rem;
    font-size: 0.9rem;
}

@media (max-width: 767px) {
    #chat .chat-panel {
        border-radius: 1.5rem;
        padding: 1rem;
    }

    #chat .chat-header {
        align-items: flex-start;
        flex-direction: column;
    }

    #chat .chat-identity {
        white-space: normal;
    }

    #chat .chat-messages {
        height: 320px;
    }

    #chat .chat-form {
        grid-template-columns: 1fr;
    }
}
