body {
    width: 95%;
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0;
    padding: 16px;
    font: 16px/1.5 "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #f7f9fc 0%, #eef3f8 100%);
    color: #23374d;
    overflow-x: hidden;
    overflow-y: auto;
}

ul, li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bodysplit {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 32px);
    align-items: stretch;
}

.container {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 24px rgba(35, 55, 77, 0.08);
}

.container2 {
    flex: 0 0 240px;
    min-width: 220px;
    min-height: 0;
}

#users,
#rooms {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    align-items: stretch;
}

#users {
    margin-bottom: 4px;
}

#rooms {
    min-height: 44px;
    margin: 0;
}

#users h3,
#roomMembersPanel h3 {
    margin: 0;
    font-size: 1rem;
}

#userList {
    max-height: 90px;
    overflow-y: auto;
    padding-top: 2px;
}

#rooms label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
    font-size: 0.95rem;
    margin: 0;
    width: 100%;
}

#disappearingOptions {
    display: none;
}

#roomSelect,
#interval,
input,
select,
button {
    border-radius: 8px;
    border: 1px solid #d9e4f0;
    color: #23374d;
    background-color: #f8fbff;
    box-shadow: inset 0 1px 2px rgba(35, 55, 77, 0.05);
}

select,
input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 10px;
    font-size: 0.95rem;
    line-height: 1.2;
    height: 36px;
}

#messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 1px 3px rgba(35, 55, 77, 0.08);
}

#messageList {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#messageList li.my-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #dceeff 0%, #cfe3ff 100%);
    color: #23374d;
    padding: 8px 12px;
    border-radius: 12px 12px 4px 12px;
    max-width: 72%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(35, 55, 77, 0.08);
}

#messageList li.other-message {
    align-self: flex-start;
    background: #f4f6f9;
    color: #44576b;
    padding: 8px 12px;
    border-radius: 12px 12px 12px 4px;
    max-width: 72%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(35, 55, 77, 0.06);
}

.message-sender {
    font-size: 0.75em;
    opacity: 0.72;
    margin-bottom: 4px;
}

.message-text {
    font-size: 1em;
    line-height: 1.45;
}

#form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    width: 100%;
    margin-top: auto;
    align-items: center;
}

#chatInput {
    min-width: 0;
}

button {
    margin: 0;
    padding: 0.45em 0.8em;
    background: linear-gradient(135deg, #5b7cff 0%, #4d68d8 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(77, 104, 216, 0.2);
}

#roomMembersPanel {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(35, 55, 77, 0.08);
}

#roomMembersPanel.hidden {
    display: none;
}

#roomMembersList {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

#roomMembersList li {
    background: #f4f7fb;
    border-radius: 8px;
    padding: 6px 8px;
    color: #23374d;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .bodysplit {
        flex-direction: column;
        min-height: auto;
        gap: 10px;
    }

    .container,
    .container2 {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }

    .container {
        padding: 12px;
    }

    #users,
    #rooms {
        gap: 6px;
    }

    #rooms {
        min-height: 48px;
    }

    #messages {
        min-height: 240px;
    }

    #form {
        grid-template-columns: 1fr auto;
    }
}

