.demo-split-container {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.demo-split-container.active {
    opacity: 1;
    pointer-events: all;
}

.demo-info-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-y: auto;
}

.demo-dashboard-side {
    flex: 0 0 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.demo-close-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 90;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.demo-close-btn:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

canvas#constellation-canvas {
    position: fixed;
    inset: 0;
    z-index: 75;
    pointer-events: none;
}

.demo-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 95;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 9999px;
    padding: 0.3rem;
    gap: 0.2rem;
}

.demo-mobile-toggle button {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    transition: all 0.3s;
    border: none;
    background: none;
    cursor: pointer;
}

.demo-mobile-toggle button.active {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.demo-phone-frame {
    width: 400px;
    max-height: 92vh;
    border-radius: 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(5,5,5,0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 25px 80px rgba(0,0,0,0.6),
        0 0 60px rgba(59,130,246,0.03);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.demo-phone-frame.visible {
    opacity: 1;
    transform: scale(1);
}

.demo-phone-notch {
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.demo-phone-header {
    padding: 0.75rem 1.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.demo-phone-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.demo-avatar-switcher {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
}

.demo-avatar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.35rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.04);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.demo-avatar-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s;
}

.demo-avatar-btn .avatar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.4s;
}

.demo-avatar-btn .avatar-name {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.3);
    transition: all 0.4s;
}

.demo-avatar-btn.active {
    border-color: rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.demo-avatar-btn.active .avatar-name {
    color: rgba(255,255,255,0.8);
}

.demo-avatar-btn[data-avatar="pedro"] .avatar-dot { background: #3b82f6; }
.demo-avatar-btn[data-avatar="laura"] .avatar-dot { background: #ec4899; }
.demo-avatar-btn[data-avatar="leticia"] .avatar-dot { background: #f59e0b; }

.demo-avatar-btn[data-avatar="pedro"].active .avatar-dot { box-shadow: 0 0 12px rgba(59,130,246,0.6); }
.demo-avatar-btn[data-avatar="laura"].active .avatar-dot { box-shadow: 0 0 12px rgba(236,72,153,0.6); }
.demo-avatar-btn[data-avatar="leticia"].active .avatar-dot { box-shadow: 0 0 12px rgba(245,158,11,0.6); }

.demo-avatar-btn[data-avatar="pedro"].active::before { background: rgba(59,130,246,0.05); opacity: 1; }
.demo-avatar-btn[data-avatar="laura"].active::before { background: rgba(236,72,153,0.05); opacity: 1; }
.demo-avatar-btn[data-avatar="leticia"].active::before { background: rgba(245,158,11,0.05); opacity: 1; }

.demo-particle-viz {
    padding: 0.5rem 1rem;
    flex-shrink: 0;
}

.demo-particle-canvas {
    width: 100%;
    height: 120px;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.4);
}

.demo-session-stats {
    display: flex;
    justify-content: space-around;
    padding: 0.4rem 1rem;
    flex-shrink: 0;
}

.demo-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.demo-stat-value {
    font-size: 14px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: rgba(255,255,255,0.85);
}

.demo-stat-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
}

.demo-absorption-bar {
    padding: 0.25rem 1rem;
    flex-shrink: 0;
}

.demo-absorption-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.demo-absorption-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    white-space: nowrap;
}

.demo-absorption-track {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.demo-absorption-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.demo-absorption-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 7px;
    border-radius: 50%;
    background: inherit;
    filter: blur(3px);
    opacity: 0.8;
}

.demo-absorption-value {
    font-size: 11px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: rgba(255,255,255,0.5);
    min-width: 32px;
    text-align: right;
}

.demo-avatar-model-card {
    margin: 0 1rem 0.4rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.015);
    display: none;
}

.demo-avatar-model-card.visible {
    display: block;
    animation: demoMsgIn 0.4s ease;
}

.demo-model-title {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    margin-bottom: 0.35rem;
}

.demo-model-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.demo-model-trait {
    font-size: 8px;
    padding: 0.2rem 0.4rem;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.05em;
}

.demo-features-grid {
    display: flex;
    gap: 0.35rem;
    padding: 0.25rem 1rem 0.4rem;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.demo-features-grid::-webkit-scrollbar { display: none; }

.demo-feature-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.015);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.demo-feature-item:hover {
    border-color: rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.demo-feature-item .feat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    flex-shrink: 0;
}

.demo-feature-item .feat-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.3);
}

.demo-feature-item.locked::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-size: contain;
}

.demo-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: none;
    min-height: 0;
}

.demo-chat-area::-webkit-scrollbar { display: none; }

.demo-msg {
    max-width: 88%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.875rem;
    font-size: 12px;
    line-height: 1.55;
    animation: demoMsgIn 0.4s ease;
    word-wrap: break-word;
}

.demo-msg.avatar {
    align-self: flex-start;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    border-bottom-left-radius: 4px;
}

.demo-msg.user {
    align-self: flex-end;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.12);
    color: rgba(255,255,255,0.8);
    border-bottom-right-radius: 4px;
}

@keyframes demoMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.demo-learning-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    align-self: center;
    animation: demoLearnIn 0.6s ease;
}

.demo-learning-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: learnPulse 1.5s ease-in-out infinite;
}

.demo-learning-indicator span {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

@keyframes demoLearnIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes learnPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

.demo-chat-input-bar {
    padding: 0.5rem 1rem 0.75rem;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.demo-chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 1.25rem;
    padding: 0.35rem 0.4rem 0.35rem 0.875rem;
    transition: border-color 0.3s, background 0.3s;
}

.demo-chat-input-wrap.focused {
    border-color: rgba(59,130,246,0.2);
    background: rgba(255,255,255,0.035);
}

.demo-chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-family: inherit;
    min-width: 0;
}

.demo-chat-input::placeholder {
    color: rgba(255,255,255,0.18);
    font-size: 11px;
}

.demo-msg-counter {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.4rem;
    flex-shrink: 0;
}

.demo-msg-counter span {
    font-size: 10px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: rgba(255,255,255,0.2);
    transition: color 0.3s;
}

.demo-msg-counter span.warning {
    color: rgba(245,158,11,0.6);
}

.demo-send-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.15);
    color: rgba(59,130,246,0.6);
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.demo-send-btn:hover {
    background: rgba(59,130,246,0.2);
    border-color: rgba(59,130,246,0.35);
    color: #3b82f6;
    transform: scale(1.05);
}

.demo-signup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.demo-signup-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.demo-signup-card {
    max-width: 360px;
    width: 90%;
    padding: 2rem 1.75rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,10,10,0.95);
    text-align: center;
}

.demo-signup-card h3 {
    font-size: 1.125rem;
    font-weight: 300;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.demo-signup-card p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.demo-signup-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: white;
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.2));
    border: 1px solid rgba(59,130,246,0.3);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.demo-signup-cta:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.3), rgba(139,92,246,0.3));
    border-color: rgba(59,130,246,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59,130,246,0.2);
}

.demo-signup-dismiss {
    display: block;
    margin-top: 0.75rem;
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    background: none;
    border: none;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.demo-signup-dismiss:hover {
    color: rgba(255,255,255,0.4);
}

.demo-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0.4rem 0.75rem;
}

.demo-typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    animation: typingDot 1.4s infinite;
}

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

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 1024px) {
    .demo-dashboard-side {
        flex: 0 0 400px;
    }
}

@media (max-width: 768px) {
    .demo-split-container {
        flex-direction: column;
    }

    .demo-info-side {
        display: none;
        padding: 1rem;
        padding-bottom: 5rem;
    }

    .demo-info-side.mobile-visible {
        display: flex;
    }

    .demo-dashboard-side {
        flex: 1;
        width: 100%;
        padding: 0;
    }

    .demo-dashboard-side.mobile-hidden {
        display: none;
    }

    .demo-mobile-toggle {
        display: flex;
    }

    .demo-phone-frame {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: rgba(5,5,5,0.98);
    }

    .demo-phone-notch {
        display: none;
    }

    .demo-phone-header {
        padding-top: env(safe-area-inset-top, 0.5rem);
    }

    .demo-close-btn {
        top: env(safe-area-inset-top, 0.75rem);
        right: 0.75rem;
        z-index: 100;
    }

    .demo-particle-canvas {
        height: 100px;
    }

    .demo-chat-input-bar {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .demo-features-grid {
        padding: 0.25rem 0.75rem 0.35rem;
    }

    .demo-avatar-switcher {
        padding: 0.4rem 0.75rem;
    }

    .demo-chat-area {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 380px) {
    .demo-avatar-btn .avatar-name {
        font-size: 10px;
    }

    .demo-msg {
        font-size: 11px;
        padding: 0.4rem 0.6rem;
    }

    .demo-model-trait {
        font-size: 7px;
        padding: 0.15rem 0.3rem;
    }

    .demo-particle-canvas {
        height: 80px;
    }
}

@media (min-width: 769px) and (max-height: 700px) {
    .demo-phone-frame {
        max-height: 90vh;
    }

    .demo-particle-canvas {
        height: 80px;
    }

    .demo-avatar-model-card {
        margin-bottom: 0.25rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .demo-phone-frame {
        max-height: -webkit-fill-available;
    }
}
