* {
    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;
}

.demo-page {
    width: 100%;
    max-width: 600px;
    padding: 24px 0;

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

.demo-notice {
    background: #111;
    color: white;
    border-radius: 16px;
    padding: 15px 16px;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 12px;
}

.demo-badge {
    padding: 5px 8px;
    border: 1px solid #444;
    border-radius: 7px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.demo-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.4;
    font-size: 12px;
}

.demo-copy strong {
    font-size: 13px;
}

.demo-copy span {
    color: #b8b8b8;
}

.demo-details {
    min-width: 105px;
}

.demo-details summary {
    cursor: pointer;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.demo-info {
    position: absolute;
    z-index: 10;

    width: min(560px, calc(100vw - 32px));
    margin-top: 10px;
    margin-left: -440px;
    padding: 18px;

    display: grid;
    gap: 16px;

    background: #181818;
    border: 1px solid #333;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.demo-info div {
    display: grid;
    gap: 4px;
}

.demo-info strong {
    font-size: 12px;
}

.demo-info p {
    margin: 0;
    color: #aaa;
    font-size: 12px;
    line-height: 1.55;
}

.chat-wrapper {
    width: 100%;
    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;
}

.demo-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;

    color: #888;
    font-size: 10px;
    line-height: 1.4;
}

@media (max-width: 650px) {
    body {
        background: white;
        align-items: stretch;
    }

    .demo-page {
        max-width: none;
        padding: 10px;
        gap: 8px;
    }

    .demo-notice {
        grid-template-columns: auto 1fr;
        padding: 12px;
    }

    .demo-details {
        grid-column: 2;
    }

    .demo-info {
        position: fixed;
        top: 10px;
        left: 10px;
        margin: 0;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .chat-wrapper {
        height: calc(100vh - 84px);
        min-height: 560px;
        border-radius: 14px;
        box-shadow: none;
    }

    .demo-footer {
        display: none;
    }
}
