* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: #10101d;
    --sidebar: #171728;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f7f7ff;
    --muted: #a5a5c2;
    --accent: #8b83ff;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

button,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 255px;
    flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 19px;
    font-weight: 700;
    margin: 5px 4px 32px;
    white-space: nowrap;
}

.brand-icon {
    color: #aaa3ff;
    font-size: 25px;
}

.beta {
    font-size: 9px;
    color: #c2bdff;
    border: 1px solid #615b9b;
    padding: 3px 5px;
    border-radius: 5px;
}

.new-chat {
    width: 100%;
    padding: 13px;
    color: var(--text);
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
    border-radius: 11px;
    text-align: left;
    transition: 0.2s;
}

.new-chat:hover {
    background: rgba(139,131,255,0.13);
    border-color: var(--accent);
}

.new-chat span {
    font-size: 20px;
    margin-right: 7px;
}

.history-title {
    font-size: 10px;
    letter-spacing: 1.4px;
    color: #777793;
    margin: 30px 7px 14px;
}

.chat-history {
    overflow-y: auto;
}

.history-empty {
    font-size: 12px;
    color: #777793;
    padding: 7px;
}

.history-item {
    padding: 11px;
    margin-bottom: 5px;
    border-radius: 8px;
    font-size: 13px;
    color: #d2d2e6;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item:hover,
.history-item.active {
    background: rgba(255,255,255,0.07);
}

.account {
    margin-top: auto;
    padding: 17px 5px 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 11px;
}

.account-avatar {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #aaa3ff, #6257c8);
    color: white;
    font-weight: bold;
}

.account strong,
.account span {
    display: block;
    font-size: 12px;
}

.account span {
    color: var(--muted);
    margin-top: 4px;
}

/* Main area */

.main-chat {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 50% 40%, #292451 0%, transparent 50%),
        linear-gradient(145deg, #17172b, #111120 75%);
}

.topbar {
    height: 66px;
    display: flex;
    align-items: center;
    padding: 0 28px;
}

.menu-toggle {
    display: none;
    color: white;
    background: transparent;
    border: none;
    font-size: 22px;
}

.mobile-brand {
    font-weight: 650;
    font-size: 15px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px 24px 160px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Welcome screen */

.welcome {
    width: 100%;
    max-width: 850px;
    margin: auto;
    text-align: center;
    padding: 30px 0;
}

.welcome-icon {
    font-size: 35px;
    color: #d5d1ff;
    margin-bottom: 22px;
    text-shadow: 0 0 35px #8b83ff;
}

.welcome h1 {
    font-size: clamp(25px, 3.5vw, 38px);
    font-weight: 650;
    letter-spacing: -1.2px;
}

.welcome > p {
    margin-top: 15px;
    color: #b6b4d3;
    font-size: 14px;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 34px;
}

.suggestions button {
    color: #eeeeff;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    transition: 0.2s;
}

.suggestions button:hover {
    background: rgba(139,131,255,0.15);
    border-color: #7770cf;
    transform: translateY(-2px);
}

.suggestions button span {
    margin-right: 5px;
    color: #d2ceff;
}

/* Chat messages */

.message-row {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.user-message {
    max-width: 80%;
    margin-left: auto;
    background: #343253;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    white-space: pre-wrap;
}

.avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #38315f;
    color: #d7d2ff;
}

.message-content {
    flex: 1;
    padding-top: 3px;
    white-space: pre-wrap;
}

.bot-label {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 7px;
    color: #d3ceff;
}

/* Message input */

.composer-area {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 15px 24px 20px;
    background: linear-gradient(transparent, #111120 18%);
}

.chat-form {
    width: 100%;
    max-width: 780px;
    min-height: 65px;
    margin: 0 auto;
    padding: 9px 10px 9px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(125,120,190,0.23);
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    transition: border-color 0.2s;
}

.chat-form:focus-within {
    border-color: #8b83ff;
}

.chat-form textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    max-height: 150px;
    overflow-y: auto;
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-size: 14px;
    line-height: 1.5;
    padding: 10px 0;
}

.chat-form textarea::placeholder {
    color: #d1cee8;
}

.send-button {
    flex-shrink: 0;
    width: 39px;
    height: 39px;
    border: none;
    border-radius: 50%;
    background: #f4f2ff;
    color: #37315f;
    font-size: 25px;
    font-weight: 600;
    display: grid;
    place-items: center;
    transition: 0.2s;
}

.send-button:hover {
    background: #c9c3ff;
    transform: scale(1.05);
}

.disclaimer {
    max-width: 780px;
    margin: 10px auto 0;
    text-align: center;
    color: #8887a8;
    font-size: 11px;
}

/* Mobile responsive */

@media (max-width: 700px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 10;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
        margin-right: 13px;
    }

    .topbar {
        padding: 0 17px;
        height: 58px;
    }

    .chat-messages {
        padding: 15px 15px 140px;
    }

    .welcome {
        padding: 15px 0;
    }

    .welcome h1 {
        font-size: 27px;
    }

    .welcome > p {
        font-size: 13px;
        line-height: 1.6;
    }

    .suggestions {
        gap: 8px;
        margin-top: 25px;
    }

    .suggestions button {
        padding: 10px 12px;
        font-size: 12px;
    }

    .composer-area {
        padding: 12px 12px 15px;
    }

    .chat-form {
        min-height: 58px;
        border-radius: 15px;
    }

    .disclaimer {
        font-size: 10px;
    }
}