/* Feature 035 — Voice & SMS Agents demo experience.
   Supplements the shared catalog/admin tokens; never redefines brand values.
   Loaded after catalog.css so the shared chip, card and grid rules win where they overlap. */

.vsa-demo {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ---- Sub-navigation (Scenarios / Run / Prompts / Call log) ------------------
   Mirrors the .di-segments composition from the Document Intelligence demo so
   the two reusable experiences read as one system. */
.vsa-segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--an-surface-muted, #f2f1ec);
}

.vsa-segment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--an-ink-secondary, #5c5b56);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.vsa-segment[aria-current="true"] {
    background: #fff;
    color: var(--an-ink, #1b1b1a);
    box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

.vsa-segment-count {
    min-width: 1.5rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--an-surface-muted, #e8e6df);
    font-size: 0.8125rem;
    text-align: center;
}

/* ---- Toolbar --------------------------------------------------------------- */
.vsa-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* ---- Scenario cards -------------------------------------------------------- */
.vsa-scenarios {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.vsa-scenario-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--an-border, #e2e0d9);
    border-radius: 14px;
    background: #fff;
}

.vsa-scenario-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.vsa-scenario-card__channels {
    display: inline-flex;
    gap: 0.375rem;
}

.vsa-scenario-card__agent {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--an-border, #e2e0d9);
}

.vsa-scenario-card__actions {
    display: flex;
    gap: 0.5rem;
}

/* ---- Two-column layouts (Run, Live, Summary, Prompts) ---------------------- */
.vsa-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24rem;
    gap: 1rem;
    align-items: start;
}

.vsa-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--an-border, #e2e0d9);
    border-radius: 14px;
    background: #fff;
}

/* ---- Live status bar ------------------------------------------------------- */
.vsa-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.vsa-status__live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    background: var(--an-accent-soft, #f7e8e9);
    color: var(--an-accent, #a3232b);
    font-weight: 600;
}

/* ---- Transcript ------------------------------------------------------------ */
.vsa-transcript {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 32rem;
    overflow-y: auto;
    padding: 1.25rem;
}

.vsa-turn {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 78%;
}

.vsa-turn--agent {
    align-self: flex-start;
}

.vsa-turn--contact {
    align-self: flex-end;
    align-items: flex-end;
}

.vsa-bubble {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: var(--an-surface-muted, #f2f1ec);
    color: var(--an-ink, #1b1b1a);
}

.vsa-turn--contact .vsa-bubble {
    background: var(--an-ink, #1b1b1a);
    color: #fff;
}

.vsa-turn__meta {
    font-size: 0.8125rem;
    color: var(--an-ink-secondary, #5c5b56);
}

.vsa-transcript__notice {
    align-self: center;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    background: var(--an-surface-muted, #f2f1ec);
    color: var(--an-ink-secondary, #5c5b56);
    font-size: 0.875rem;
}

/* ---- Collected checklist --------------------------------------------------- */
.vsa-collected {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vsa-collected__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--an-border, #e2e0d9);
}

.vsa-collected__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

/* ---- Signals and quality bars ---------------------------------------------- */
.vsa-meter {
    height: 4px;
    border-radius: 999px;
    background: var(--an-surface-muted, #e8e6df);
    overflow: hidden;
}

.vsa-meter__fill {
    display: block;
    height: 100%;
    background: var(--an-ink, #1b1b1a);
}

.vsa-meter__fill--accent {
    background: var(--an-accent, #a3232b);
}

.vsa-meter__fill--review {
    background: var(--an-warning, #9a4a06);
}

/* ---- Prompt editors -------------------------------------------------------- */
.vsa-prompt {
    width: 100%;
    min-height: 18rem;
    padding: 1rem;
    border: 1px solid var(--an-border, #e2e0d9);
    border-radius: 10px;
    background: var(--an-surface-muted, #faf9f6);
    font-family: var(--an-font-mono, "DM Mono", ui-monospace, monospace);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

.vsa-token {
    padding: 0.0625rem 0.375rem;
    border-radius: 6px;
    background: var(--an-info-soft, #e8eff8);
    color: var(--an-info, #2f5f9e);
    font-family: var(--an-font-mono, "DM Mono", ui-monospace, monospace);
}

.vsa-token--control {
    background: var(--an-accent-soft, #f7e8e9);
    color: var(--an-accent, #a3232b);
}

/* ---- Responsive ------------------------------------------------------------
   FR-046: no page-level horizontal scrolling at 360/400/768/1024/1440. */
@media (max-width: 1200px) {
    .vsa-scenarios {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vsa-split {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .vsa-scenarios {
        grid-template-columns: minmax(0, 1fr);
    }

    .vsa-turn {
        max-width: 92%;
    }

    .vsa-toolbar > * {
        width: 100%;
    }

    .vsa-transcript {
        max-height: none;
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vsa-meter__fill,
    .vsa-status__live {
        transition: none;
        animation: none;
    }
}
