body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #343541;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 1em;
}

.chatgpt-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100vw;
    max-width: 100vw;
    padding: 0;
}

.avatar-side {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 0 0 0;
    height: auto;
    order: -1;
}

#avatarVideo {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px auto;
    display: block;
    border-radius: 50%;
    background: #222;
    border: 2px solid #555;
    object-fit: cover;
}

.chat-side {
    width: 100vw;
    max-width: 100vw;
    min-height: 0;
    border-radius: 18px 18px 0 0;
    padding: 0;
    box-shadow: none;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    background: #444654;
    padding-bottom: 10px;
    flex: 1;
}

#chat {
    flex: 1;
    overflow-y: auto;
    padding: 18px 8px 8px 8px;
    gap: 18px;
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    padding-bottom: 70px;
    /* espacio para input fijo */
}

.msg {
    font-size: 1.1em;
    padding: 14px 16px;
    border-radius: 14px;
    max-width: 90%;
    word-break: break-word;
    box-shadow: 0 1px 2px #0001;
}

.user {
    align-self: flex-end;
    background: #2b313a;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bot {
    align-self: flex-start;
    background: #ececf1;
    color: #222;
    border-bottom-left-radius: 4px;
}

.bot p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.bot p:last-child {
    margin-bottom: 0;
}

.bot strong {
    color: #1a1a1a;
    font-weight: 600;
}

#inputArea {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 98vw;
    z-index: 10;
    background: #fff;
    display: flex;
    padding: 8px 4px 8px 4px;
    margin: 0;
    border-top: 1px solid #ccc;
    box-shadow: 0 -2px 8px #0001;
    height: 56px;
}

#messageInput {
    flex: 1;
    font-size: 1em;
    padding: 12px 8px;
    border-radius: 10px;
    border: 1px solid #ccc;
    outline: none;
    background: #fff;
}

#sendBtn {
    font-size: 1em;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    background: #19c37d;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 8px;
}

#sendBtn:hover {
    background: #15a86b;
}

#stopBtn {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2b313a;
    color: #fff;
    border: none;
    box-shadow: 0 2px 12px #0003;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    z-index: 100;
    cursor: pointer;
    transition: background 0.2s;
}

#stopBtn:hover {
    background: #2b313a;
}

.d-flex {
    display: flex;
}

.w-50 {
    width: 50%;
}

.w-100 {
    width: 100%;
}

.row {
    display: flex;
    margin: 0 -15px;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.text-white {
    color: white;
}

#systemMessage {
    minHeight: 24px;
    color: #888;
    fontSize: 1em;
    textAlign: left;
    margin: 0 0 70px 0;
    paddingLeft: 4px;
    transition: color 0.2s;
}


/* Desktop styles (min-width: 64em = 1024px) */

@media (min-width: 64em) {
    body {
        font-size: 1.15em;
    }
    .chatgpt-container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: 100vh;
        max-width: 900px;
        margin: 0 auto;
    }
    .avatar-side {
        width: auto;
        align-items: flex-end;
        padding: 0 20px 0 0;
        height: 80vh;
        order: 0;
    }
    #avatarVideo {
        width: 200px;
        height: 200px;
    }
    .chat-side {
        flex: 1;
        height: 80vh;
        max-width: 600px;
        border-radius: 12px;
        box-shadow: 0 2px 16px #0002;
        padding: 0 0 10px 0;
    }
    #chat {
        padding: 24px 20px 10px 20px;
        min-height: 0;
        padding-bottom: 0;
    }
    #inputArea {
        position: static;
        width: 95%;
        box-shadow: none;
        border-top: none;
        height: auto;
        margin: 0;
        background: none;
        padding: 10px 20px 0 20px;
    }
    #systemMessage {
        margin: 0 0 4px 0;
    }
}