@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .toggle-container {
        flex-direction: column;
    }

    #chat-form {
        flex-direction: column;
    }

    #user-input, .neon-button {
        width: 100%;
    }

    .message {
        max-width: 90%;
    }

    #status-messages {
        max-width: 90%;
    }
}

/* Ensure chat messages don't overflow */
#chat-messages {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Adjust chat container to prevent unnecessary scrolling */
#chat-container {
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
}

/* Ensure the chat form doesn't push content out of view */
.controls {
    flex-shrink: 0;
}