* { box-sizing: border-box; }

body {
    margin: 0;
    font: 400 15px/1.8 Vazirmatn, Tahoma, sans-serif;
    color: #261938;
}

[hidden] { display: none !important; }
p { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible, .messages:focus-visible {
    outline: 2px solid #9b61e8;
    outline-offset: 3px;
}
button:disabled { opacity: .58; }
button:not(:disabled) { cursor: pointer; }

.demo {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
    padding: clamp(24px, 5vw, 64px);
    border: 1px solid #e8ddf4;
    border-radius: 28px;
    background: radial-gradient(ellipse at 100% 0%, #fcecf7, transparent 60%), linear-gradient(145deg, #faf6ff, #efe6fb);
}

.eyebrow {
    color: #7241a4;
    font-size: 14px;
    font-weight: 750;
}

.intro h2 {
    margin: 7px 0 12px;
    font-size: clamp(27px, 3.9vw, 48px);
    line-height: 1.4;
    letter-spacing: -.035em;
}

.intro > p:last-of-type { color: #574865; }

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.suggestions button {
    min-height: 40px;
    padding: 5px 13px;
    border: 1px solid #d8c5ee;
    border-radius: 99px;
    background: #fff9ff;
    color: #55288b;
    font-size: 13px;
    font-weight: 650;
}

.suggestions button:not(:disabled):hover { background: #eaddfa; }

.chat {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2d7ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 36px -24px #42246c7a;
}

.chat-head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eee6f6;
    background: #fbf8ff;
}

.avatar {
    display: grid;
    flex: 0 0 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(125deg, #a646b5, #7035cf);
    color: white;
    font-size: 20px;
    font-weight: 800;
}

#status {
    color: #635271;
    font-size: 12px;
}

.messages {
    height: 232px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 16px 18px;
    background: #fdfaff;
}

.message {
    width: fit-content;
    max-width: 94%;
    margin-block-end: 10px;
    padding: 8px 12px;
    border-radius: 13px 4px 13px 13px;
    background: #f2ebfb;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.user {
    margin-inline-start: auto;
    border-radius: 4px 13px 13px 13px;
    background: #6b30bf;
    color: #fff;
}

.typing { color: #635271; }

.send-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee6f6;
}

.send-form input {
    flex: 1;
    width: 0;
    min-width: 0;
    min-height: 44px;
    padding: 7px 11px;
    border: 1px solid #dcd1e9;
    border-radius: 10px;
    background: white;
    color: #261938;
}

.send-form button {
    min-height: 44px;
    padding-inline: 16px;
    border: 0;
    border-radius: 10px;
    background: #7135c6;
    color: white;
    font-weight: 700;
}

.send-form button:not(:disabled):hover { background: #5c29a5; }

.fallback {
    display: block;
    margin: 0 12px 12px;
    color: #622eaa;
    font-size: 13px;
}

@media (max-width: 740px) {
    .demo {
        grid-template-columns: minmax(0, 1fr);
        padding: clamp(14px, 4vw, 30px);
        border-radius: 22px;
    }

    .intro h2 br { display: none; }
    .suggestions { margin-top: 14px; }
    .messages { height: 205px; }
}
