body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
        'Helvetica Neue', sans-serif;
    background: #f0f0f0;
    display: grid;
    place-content: center;
    height: 100dvh;
}

main {
    width: 400px;
    max-width: 100%;
    height: 70vh;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 8px;
    margin-bottom: 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
}

.message {
    display: flex;
    flex-direction: column;
    margin: 4px 0;
    padding: 4px 8px;

    span {
        width: 36px;
        height: 36px;
        background: #eee;
        font-size: 12px;
        font-weight: 500;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
    }

    p {
        border-radius: 4px;
        padding: 4px 8px;
        margin-top: 4px;
    }

    &.user {
        align-self: flex-end;
        align-items: flex-end;

        span,
        p {
            background: rgb(202, 248, 255);
        }
    }

    &.bot {
        align-self: flex-start;

        span,
        p {

            background: rgb(205, 255, 202);
        }
    }
}

form {
    display: flex;

    input {
        border-radius: 999999px;
        flex-grow: 1;
        border: 0;
        padding: 8px;
        margin-right: 8px;
        border: 1px solid #ccc;
    }

    button {
        background: #09f;
        border: 0;
        color: #fff;
        border-radius: 6px;
        cursor: pointer;
        padding: 8px;
        transition: background .3s ease;

        &[disabled] {
            background: #ccc;
            opacity: 0.6;
            pointer-events: none;
            /* Hace que el botón no se pueda pulsar */
        }

        &:hover {
            background: rgb(0, 104, 173);
        }
    }
}

small {
    font-size: 10px;
    color: #555;
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    margin: auto;
    width: 400px;
}

@media (max-width: 600px) {
    main {
        max-width: 85%;
        margin: 0 auto;
    }

    input {
        max-width: 72%;
        margin-top: 10px;
        margin-inline: 20px;
    }

    button {
        max-width: 25%;
        margin-top: 10px;
        margin-right: 20px;
    }
}