/* --- Ingresso live demo --- */
.demo-intro {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.demo-intro[hidden] {
    display: none;
}

.demo-intro__veil {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 24, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.demo-intro__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 22rem);
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--pillar-radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    --eco-accent: #06a77d;
}

.demo-intro__avatar {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto 1rem;
    border: 2px solid color-mix(in srgb, var(--eco-accent) 45%, transparent);
}

.demo-intro__title {
    font-size: 1.5rem;
    color: var(--eco-accent);
    text-transform: none;
    margin-bottom: 0.35rem;
}

.demo-intro__subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.demo-intro__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #fff;
    background: var(--eco-accent);
    border: 1px solid color-mix(in srgb, var(--eco-accent) 70%, transparent);
    border-radius: 0.55rem;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.demo-intro__cta:hover,
.demo-intro__cta:focus-visible {
    filter: brightness(1.1);
    outline: none;
}

body.demo-intro-open {
    overflow: hidden;
}

/* --- Live demo overlay (detail → demo) --- */
.demo-live-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #080c18;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.demo-live-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.demo-live-overlay__inner {
    min-height: 100%;
}

body.demo-live-open {
    overflow: hidden;
}

/* --- Live demo page --- */
.demo-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        calc(var(--header-height) + 1rem)
        var(--grid-padding-left)
        calc(var(--footer-height) + 1rem);
    --eco-accent: #06a77d;
}

.demo-section__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.demo-section__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.demo-section__back:hover,
.demo-section__back:focus-visible {
    color: var(--color-text);
    outline: none;
}

.demo-section__back .material-symbols-outlined {
    font-size: 1.1rem;
}

.demo-section__badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--eco-accent);
    border: 1px solid color-mix(in srgb, var(--eco-accent) 55%, transparent);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    background: color-mix(in srgb, var(--eco-accent) 12%, transparent);
}

.demo-section__layout {
    display: grid;
    grid-template-columns: minmax(16rem, 34%) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.demo-panel {
    display: flex;
    flex-direction: column;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--box-radius);
    overflow: hidden;
}

.demo-panel--video {
    align-self: start;
    width: 100%;
}

.demo-panel__title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 1rem 1.15rem 0.75rem;
}

.demo-panel__video-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: min(68dvh, 34rem);
    padding: 1.15rem;
}

.demo-panel__media {
    width: 100%;
    max-height: 100%;
    border-radius: 0.45rem;
    object-fit: contain;
}

.demo-panel__video {
    background: #000;
}

.demo-panel__hello {
    background: transparent;
}

.demo-panel__hello[hidden],
.demo-panel__video[hidden] {
    display: none;
}

.demo-panel__empty {
    padding: 1rem 1.15rem 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

.demo-panel--chat {
    height: calc(100dvh - var(--header-height) - var(--footer-height) - 5rem);
    max-height: 40rem;
    min-height: 24rem;
}

.demo-chat__header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.demo-chat__header-text {
    flex: 1;
    min-width: 0;
}

.demo-chat__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: auto;
    padding: 0;
    font: inherit;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.demo-chat__reset .material-symbols-outlined {
    font-size: 1.25rem;
}

.demo-chat__reset:hover,
.demo-chat__reset:focus-visible {
    color: var(--color-text);
    border-color: color-mix(in srgb, var(--eco-accent) 45%, transparent);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.demo-chat__avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid color-mix(in srgb, var(--eco-accent) 45%, transparent);
    background: rgba(255, 255, 255, 0.04);
}

.demo-chat__name {
    font-size: 1.125rem;
    color: var(--eco-accent);
    text-transform: none;
}

.demo-chat__status {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.demo-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.demo-chat__message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    word-break: break-word;
}

.demo-chat__message--assistant {
    align-self: flex-start;
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 0.2rem;
}

.demo-chat__message--user {
    align-self: flex-end;
    color: #fff;
    background: color-mix(in srgb, var(--eco-accent) 78%, #0a0f18);
    border: 1px solid color-mix(in srgb, var(--eco-accent) 55%, transparent);
    border-bottom-right-radius: 0.2rem;
}

.demo-chat__message--typing {
    align-self: flex-start;
    color: var(--color-text-muted);
    font-style: italic;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.14);
}

.demo-chat__message--voice {
    padding: 0.55rem 0.75rem;
    min-width: 12rem;
}

.demo-chat__message--voice audio {
    display: block;
    width: 100%;
    max-width: 16rem;
    height: 2.25rem;
}

.demo-chat__message--solutions {
    max-width: 100%;
    width: 100%;
    white-space: normal;
    padding: 0.85rem;
}

.demo-chat__solutions-lead {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

.demo-chat__cards {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.demo-chat-card {
    --eco-accent: #06a77d;
    display: flex;
    align-items: stretch;
    min-height: 4.5rem;
    border-radius: 0.55rem;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    overflow: hidden;
    color: inherit;
    cursor: default;
}

.demo-chat-card__avatar {
    flex: 0 0 34%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-width: 0;
    padding-left: 0.2rem;
    overflow: hidden;
}

.demo-chat-card__avatar img {
    display: block;
    width: auto;
    height: 4rem;
    max-width: none;
    object-fit: contain;
    object-position: bottom left;
    pointer-events: none;
}

.demo-chat-card__avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 3rem;
    margin: auto 0 0.35rem 0.35rem;
    border-radius: 0.3rem;
    background: linear-gradient(145deg, color-mix(in srgb, var(--eco-accent) 35%, transparent), rgba(255, 255, 255, 0.04));
    border: 1px dashed color-mix(in srgb, var(--eco-accent) 55%, transparent);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--eco-accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.demo-chat-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    padding: 0.45rem 0.55rem 0.45rem 0.2rem;
    min-width: 0;
}

.demo-chat-card__app {
    font-size: 0.5625rem;
    font-weight: 500;
    color: var(--color-text-muted);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.15rem;
}

.demo-chat-card__title {
    font-size: 0.8125rem;
    color: var(--eco-accent);
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

.demo-chat-card__rule {
    width: 4.5rem;
    height: 1px;
    margin: 0.25rem 0;
    background: var(--eco-accent);
}

.demo-chat-card__subtitle {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--color-text-muted);
    line-height: 1.35;
    margin: 0;
}

.demo-chat__composer {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
}

.demo-chat__composer-row {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
}

.demo-chat__actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.demo-chat__input {
    flex: 1;
    min-height: 2.75rem;
    max-height: 8rem;
    resize: none;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.55rem;
    padding: 0.7rem 0.9rem;
    line-height: 1.45;
}

.demo-chat__input::placeholder {
    color: rgba(240, 244, 248, 0.45);
}

.demo-chat__input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--eco-accent) 65%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--eco-accent) 18%, transparent);
}

.demo-chat__record,
.demo-chat__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border: none;
    border-radius: 0.55rem;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.demo-chat__record {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.demo-chat__record:hover,
.demo-chat__record:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    outline: none;
}

.demo-chat__record--active {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

.demo-chat__record--active:hover,
.demo-chat__record--active:focus-visible {
    background: #ef4444;
    border-color: #ef4444;
}

.demo-chat__record .material-symbols-outlined {
    font-size: 1.35rem;
}

.demo-chat__send {
    color: #fff;
    background: var(--eco-accent);
}

.demo-chat__send:hover,
.demo-chat__send:focus-visible {
    filter: brightness(1.1);
    outline: none;
}

.demo-chat__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .demo-section__layout {
        grid-template-columns: 1fr;
    }

    .demo-panel__video-wrap {
        max-height: min(52dvh, 22rem);
    }

    .demo-panel--chat {
        height: min(62dvh, 28rem);
        max-height: none;
    }
}
