.mkt-main, .mkt-main * {
    box-sizing: border-box;
}

#mkt-chat-box {
    background: #f0f2f5;
    padding: 24px 12px 12px 12px;
    border-radius: 12px;
    width: 100%;
    margin: 0 auto 20px auto;
    height: 50vh;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    overflow-y: auto;
}

.mkt-chat-message {
    display: flex;
    align-items: flex-end;
    margin-bottom: 14px;
}

.mkt-chat-user {
    flex-direction: row-reverse;
}

.mkt-chat-admin {
    flex-direction: row;
}

.mkt-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    color: #fff;
    font-weight: 600;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    background: #8b9dc3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.mkt-chat-admin .mkt-chat-avatar img,
.mkt-chat-admin .mkt-chat-avatar,
.mkt-chat-admin .avatar {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    object-fit: cover;
    background: #fff;
}

.mkt-chat-bubble {
    max-width: 70%;
    padding: 10px 16px;
    border-radius: 18px;
    background: #e4e6eb;
    position: relative;
    font-size: 1em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    word-break: break-word;
}

.mkt-chat-user .mkt-chat-bubble {
    background: var(--mkt-chat-primary);
    color: var(--mkt-chat-primary-contrast);
    margin-right: 8px;
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 18px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.mkt-chat-admin .mkt-chat-bubble {
    background: #e4e6eb;
    color: #050505;
    margin-left: 8px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 18px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.mkt-chat-name {
    font-size: 0.82em;
    color: #65676b;
    margin-bottom: 2px;
    font-weight: 500;
}

.mkt-chat-user .mkt-chat-name {
    color: #fff;
}

.mkt-chat-time {
    font-size: 0.72em;
    color: #b0b3b8;
    text-align: right;
    margin-top: 4px;
}

.mkt-chat-user .mkt-chat-time {
    color: #fff;
}

#mkt-chat-form {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 0 auto;
    margin-top: 10px;
}

#mkt-chat-message {
    flex: 1;
    border-radius: 20px;
    border: 1px solid #ccd0d5;
    padding: 10px 14px;
    font-size: 1em;
    background: #fff;
    outline: none;
    transition: border 0.2s;
}

#mkt-chat-message:focus {
    border-color: var(--mkt-chat-primary);
}

#mkt-chat-form button {
    background: var(--mkt-chat-primary);
    color: var(--mkt-chat-primary-contrast);
    border: none;
    border-radius: 20px;
    padding: 0 18px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

#mkt-chat-form button:hover {
    background: var(--mkt-chat-primary-hover);
}

/* Auth Forms Styling */
.mkt-chat-auth-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 24px;
    background: #f0f2f5;
    border-radius: 12px;
}

.mkt-chat-auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mkt-chat-auth-form h2 {
    text-align: center;
    color: #050505;
    font-size: 24px;
    margin: 0 0 16px 0;
}

.mkt-chat-form-group {
    position: relative;
}

.mkt-chat-auth-form input[type="text"],
.mkt-chat-auth-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 20px;
    border: 1px solid #ccd0d5;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mkt-chat-auth-form input[type="text"]:focus,
.mkt-chat-auth-form input[type="password"]:focus {
    border-color: #0084ff;
    box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.2);
    outline: none;
}

.mkt-chat-auth-form button {
    background: #0084ff;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mkt-chat-auth-form button:hover {
    background: #005fc1;
}

.mkt-chat-auth-form button:active {
    transform: scale(0.98);
}

/* Info Box Styling */
.mkt-chat-info {
    background: #f4f8fb;
    border: 1px solid #b6d4ef;
    color: #25608a;
    padding: 1.5rem;
    margin: 1rem auto;
    border-radius: 6px;
    font-size: 1.1em;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    word-break: break-word;
}

.mkt-chat-flexbox {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
}

#mkt-chat-box-col {
    flex: 3 1 0%;
    min-width: 0;
}

#mkt-chat-info-col {
    flex: 1 1 0%;
    max-width: 25%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

#mkt-chat-info-col .mkt-chat-info {
    margin-top: 0;
}

@media screen and (max-width: 900px) {
    .mkt-chat-flexbox {
        flex-direction: column;
        gap: 0;
    }
    #mkt-chat-info-col {
        max-width: 100%;
        min-width: 0;
        margin-top: 18px;
        justify-content: flex-start;
        order: -1;
    }
}

/* Responsive Styles */
@media screen and (max-width: 782px) {
    #mkt-chat-box {
        height: 70vh;
        padding: 15px 8px 8px 8px;
        margin-bottom: 10px;
        border-radius: 8px;
    }

    .mkt-chat-bubble {
        max-width: 85%;
        padding: 8px 12px;
    }

    .mkt-chat-avatar {
        width: 32px;
        height: 32px;
        margin: 0 4px;
    }

    #mkt-chat-form {
        gap: 4px;
    }

    #mkt-chat-message {
        font-size: 16px;
        padding: 8px 12px;
    }

    #mkt-chat-form button {
        padding: 0 15px;
        font-size: 15px;
    }

    /* Auth Forms Responsive */
    .mkt-chat-auth-container {
        margin: 20px 15px;
        padding: 20px 15px;
    }

    .mkt-chat-auth-form h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .mkt-chat-auth-form input[type="text"],
    .mkt-chat-auth-form input[type="password"] {
        padding: 10px 14px;
        font-size: 16px;
    }

    .mkt-chat-auth-form button {
        padding: 10px 20px;
        font-size: 15px;
    }
}