* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f7f8;
    color: #202123;
}

.app {
    display: flex;
    height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 260px;
    background: #202123;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.logo span {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #444654;
    font-weight: bold;
}

.logo strong,
.logo small {
    display: block;
}

.logo small {
    color: #a9a9b3;
    margin-top: 3px;
}

.new-chat {
    border: 1px solid #565869;
    background: transparent;
    color: white;
    padding: 12px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
}

.new-chat:hover {
    background: #2a2b32;
}

.sidebar-bottom {
    margin-top: auto;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #444654;
}

.model-info strong,
.model-info small {
    display: block;
}

.model-info small {
    color: #a9a9b3;
    margin-top: 3px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10a37f;
}

/* Main */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 70px;
    border-bottom: 1px solid #ddd;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
}

.topbar h1 {
    font-size: 17px;
    margin: 0 0 5px;
}

.topbar span {
    font-size: 12px;
    color: #777;
}

.connection {
    color: #16845f;
    font-size: 13px;
}

/* Messages */

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 35px 10%;
}

.welcome {
    max-width: 650px;
    margin: 120px auto;
    text-align: center;
}

.welcome-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    background: #202123;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    font-weight: bold;
}

.welcome h2 {
    margin-bottom: 8px;
}

.welcome p {
    color: #777;
}

/* Chat messages */

.message {
    max-width: 850px;
    margin: 0 auto 25px;
    display: flex;
    gap: 14px;
}

.avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.user .avatar {
    background: #444654;
    color: white;
}

.assistant .avatar {
    background: #202123;
    color: white;
}

.message-content {
    flex: 1;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Input */

.input-area {
    padding: 15px 10% 20px;
    background: #f7f7f8;
}

.input-box {
    max-width: 850px;
    margin: auto;
    background: white;
    border: 1px solid #d9d9e3;
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    max-height: 150px;
    padding: 7px;
}

.send-button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #202123;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    max-width: 850px;
    margin: 7px auto 0;
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 11px;
}

/* Mobile */

@media (max-width: 700px) {

    .sidebar {
        display: none;
    }

    .messages {
        padding: 25px 15px;
    }

    .input-area {
        padding: 10px;
    }

    .topbar {
        padding: 0 15px;
    }

    .input-footer {
        padding: 0 5px;
    }
}
