.demo-page {
    padding: 85px 0 100px;
}

.demo-heading {
    max-width: 740px;
    margin: 0 auto 42px;
    text-align: center;
}

.demo-heading h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    margin: 14px 0;
}

.demo-heading p {
    color: #64748b;
    font-size: 1.08rem;
}

.demo-panel {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 15px 45px rgba(15, 23, 42, .06);
}

.demo-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.demo-panel-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.demo-panel-header p {
    margin-bottom: 0;
    color: #64748b;
}

.demo-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    font-size: .85rem;
    white-space: nowrap;
}

.demo-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.demo-status.connected {
    background: #dcfce7;
    color: #166534;
}

.demo-status.connected .demo-status-dot {
    background: #22c55e;
}

.demo-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.demo-status.error .demo-status-dot {
    background: #ef4444;
}

.demo-composer {
    padding: 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.demo-composer textarea {
    resize: vertical;
}

.demo-composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

#demoMessageLength {
    font-size: .8rem;
    color: #64748b;
}

.demo-events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 30px 0 15px;
}

.demo-events-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.demo-events-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: .85rem;
}

.demo-event-log {
    min-height: 190px;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.demo-empty {
    padding: 70px 20px;
    text-align: center;
    color: #94a3b8;
}

.demo-event {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    overflow-wrap: anywhere;
}

.demo-event:last-child {
    border-bottom: 0;
}

.demo-event-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #64748b;
    font-size: .75rem;
    margin-bottom: 6px;
}

.demo-event-message {
    white-space: pre-wrap;
    color: #0f172a;
}

.demo-feedback {
    min-height: 24px;
    margin-top: 14px;
    color: #b91c1c;
    font-size: .85rem;
}

.demo-bottom {
    margin-top: 45px;
    text-align: center;
}

.demo-bottom p {
    color: #64748b;
}

@media (max-width: 576px) {
    .demo-page {
        padding: 45px 0 65px;
    }

    .demo-panel {
        padding: 18px;
    }

    .demo-panel-header {
        flex-direction: column;
    }

    .demo-events-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .demo-composer {
        padding: 15px;
    }
}

.demo-event-latency {
    margin-top: 8px;
    font-size: .75rem;
    color: #64748b;
}

.demo-feedback:empty {
    display: none;
}

.demo-status.connected {
    background: #dcfce7;
    color: #166534;
}