
body {
    overflow: hidden;
}

/* Overall chat-screen */
.chat {
    position: fixed;

    top: 80px;
    left: 256px;
    width: calc(100% - 256px);
    height: calc(100% - 120px);

    padding: 20px 0;

    display: inline-block;
}

#chat-recent-panel {
    width: 256px;
    height: calc(100% - 100px);

    display: inline-block;
    float: left;

    overflow-y: auto;
}

/* Chat history. */
#chat-history {
    overflow-y: auto;
    overflow-x: hidden;

    width: calc(100% - 256px - 85px);
    height: calc(100% - 80px);
    margin-right: 10px;

    padding: 10px;

    display: inline-block;
    float: right;

    word-wrap: break-word;
}

/* Chat-message takes the whole width of the chat area */
.day-message {
    width: 100%;
    min-height: 40px;
    padding: 10px 0;
    clear: both;
    text-align: center;
}

.day-message-content {
    width: auto;
    padding: 10px;

    background-color: #F8F8F8;
    color: #666;
}

.chat-message {
    width: 100%;
    min-height: 40px;
    padding: 10px 0;
    clear: both;
}

.chat-message::after {
    content: '';
    display: table;
    clear: both;
}

.chat-message-self, .chat-message-other {
    border-radius: 20px;
    padding: 10px;
    max-width: 45%;
}

.chat-message-self {
    float: right;
    margin-right: 10px;
    background-color: #FBC02D;
    color: #333;
}

.chat-message-other {
    float: left;
    margin-left: 10px;
    background-color: #4CAF50;
    color: white;
}

/* Chat reply field */

.chat-field {
    width: calc(100% - 10px);
    display: table;
}

.chat-field form {
    width: 100%;
    overflow: hidden;
}

.chat-field span {
    display: block;
    overflow: hidden;
}

.chat-field input[type="text"] {
    width: 100%;
    border: none;
    border-radius: 10px 0 0 10px;
}

.chat-field input[type="submit"] {
    width: auto;
    float: right;
    background-color: #FBC02D;
    color: white;
    padding: 5px 10px;
    border-radius: 0 10px 10px 0;
}

.active-friend-chat {
    background: #4CAF50;
    color: white;
}

.chat-message img {
    max-width: 100%;
}

.chat-message a {
    text-decoration: underline;
}

.chat-time {
    color: #666666;
    font-size: 12px;
    margin-bottom: -3px;
}

.chat-message-other .chat-time {
    text-align: right;
}

@media only screen and (max-width: 1080px) {
    .chat-message-self, .chat-message-other {
        max-width: 75%;
    }
    .chat {
        left: 0;
        width: 100%;
    }
    #chat-recent-panel {
        left: 0;
        width: 320px;
    }
    #chat-history {
        left: 50%;
        width: calc(100% - 390px);
    }
}