* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, Arial, sans-serif;
    background: #f5f7fb;
    color: #18202a;
}

body {
    display: flex;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 950px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 0 40px rgba(0,0,0,.06);
}

.topbar {
    height: 72px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8ebef;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: #111827;
    color: #fff;
    font-size: 22px;
}

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

.brand span {
    color: #7b8490;
    font-size: 12px;
}

.new-chat {
    border: 1px solid #dfe3e8;
    background: #fff;
    padding: 9px 13px;
    cursor: pointer;
    font-size: 13px;
}

.new-chat:hover {
    background: #f5f6f8;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 30px 22px;
}

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

.welcome-icon {
    width: 58px;
    height: 58px;
    margin: auto;
    display: grid;
    place-items: center;
    background: #111827;
    color: #fff;
    font-size: 28px;
}

.welcome h2 {
    margin: 18px 0 5px;
}

.welcome p {
    margin: 0;
    color: #7b8490;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 28px;
}

.suggestions button {
    padding: 13px;
    border: 1px solid #e2e6eb;
    background: #fff;
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
}

.suggestions button:hover {
    border-color: #aeb6c0;
    background: #fafafa;
}

.message-row {
    display: flex;
    margin: 14px auto;
    max-width: 760px;
}

.message-row.user {
    justify-content: flex-end;
}

.message {
    max-width: 80%;
    padding: 12px 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message.user {
    background: #111827;
    color: #fff;
}

.message.ai {
    background: #f1f3f5;
    color: #18202a;
}

.typing {
    max-width: 760px;
    margin: 0 auto 8px;
    padding: 0 22px;
    color: #7b8490;
    font-size: 13px;
}

.typing span {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #7b8490;
    border-radius: 50%;
    margin-right: 3px;
    animation: blink 1s infinite;
}

.typing span:nth-child(2) {
    animation-delay: .15s;
}

.typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: .3; }
    40% { opacity: 1; }
}

.hidden {
    display: none;
}

.composer {
    display: flex;
    gap: 10px;
    padding: 14px 22px 8px;
    border-top: 1px solid #e8ebef;
    background: #fff;
}

.composer textarea {
    flex: 1;
    resize: none;
    max-height: 130px;
    padding: 12px 14px;
    border: 1px solid #dfe3e8;
    outline: none;
    font: inherit;
}

.composer textarea:focus {
    border-color: #7b8490;
}

.composer button {
    width: 46px;
    height: 46px;
    border: 0;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 19px;
}

.composer button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.footer-note {
    text-align: center;
    padding: 5px 10px 10px;
    color: #9aa1aa;
    font-size: 11px;
}

@media (max-width: 650px) {
    .topbar {
        padding: 0 14px;
    }

    .chat-box {
        padding: 20px 14px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 90%;
    }

    .composer {
        padding: 10px 12px 5px;
    }
}
