* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f4f4f5;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.chat-wrapper {
    width: 100%;
    max-width: 600px;
    height: 700px;

    background: white;

    display: flex;
    flex-direction: column;

    border-radius: 18px;
    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12);
}

.chat-header {
    padding: 18px 20px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-bottom: 1px solid #eee;
}

.business-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #111;
    color: white;

    font-weight: 700;
}

.business-name {
    font-size: 16px;
    font-weight: 700;
}

.status {
    margin-top: 3px;

    display: flex;
    align-items: center;
    gap: 5px;

    color: #777;
    font-size: 12px;
}

.status span {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: #22c55e;
}

.messages {
    flex: 1;

    padding: 20px;

    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 82%;

    padding: 11px 14px;

    border-radius: 14px;

    line-height: 1.45;
    font-size: 14px;
}

.message.assistant {
    align-self: flex-start;

    background: #f1f1f1;
    color: #111;
}

.message.user {
    align-self: flex-end;

    background: #111;
    color: white;

    white-space: pre-wrap;
}

.message p {
    margin: 0 0 8px;
}

.message p:last-child {
    margin-bottom: 0;
}

.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
    margin: 0 0 8px;
    line-height: 1.3;
}

.message ul,
.message ol {
    margin: 6px 0 8px;
    padding-left: 20px;
}

.message li + li {
    margin-top: 4px;
}

.message code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
}

.message pre {
    margin: 8px 0;
    padding: 10px;
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.08);
}

.message pre code {
    padding: 0;
    background: transparent;
}

.message blockquote {
    margin: 8px 0;
    padding-left: 10px;
    border-left: 3px solid #ccc;
}

.message a {
    color: inherit;
    text-decoration: underline;
}

.input-area {
    padding: 14px;

    display: flex;
    gap: 10px;

    border-top: 1px solid #eee;
}

textarea {
    flex: 1;

    resize: none;

    border: 1px solid #ddd;
    border-radius: 12px;

    padding: 12px;

    font: inherit;

    outline: none;
}

textarea:focus {
    border-color: #999;
}

button {
    border: none;

    padding: 0 18px;

    border-radius: 12px;

    background: #111;
    color: white;

    cursor: pointer;

    font-weight: 600;
}

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

@media (max-width: 650px) {

    body {
        background: white;
    }

    .chat-wrapper {
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

}