/* Live demo page (demo.html). Reuses the site tokens, .card, .btn, .product-*
   and the contact form fields (contact.css); only the demo-specific surfaces
   are defined here. Linked before depth.css, which must stay last. */

/* Product card pieces that live inline in index.html, repeated here so the
   demo page can use the same product-card vocabulary. */
.product-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(26, 92, 58, 0.08);
    color: #1A5C3A;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}
.product-icon svg {
    width: 24px;
    height: 24px;
}
.product-list {
    list-style: none;
    margin: 0 0 var(--spacing-md);
    padding: 0;
}
.product-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    color: var(--color-obsidian);
    font-weight: 500;
}
.product-list svg {
    width: 18px;
    height: 18px;
    color: #1A5C3A;
    flex-shrink: 0;
    margin-top: 3px;
}

.demo-page {
    scroll-behavior: smooth;
}
html {
    scroll-behavior: smooth;
}
.demo-fineprint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: var(--spacing-md) 0 0;
    font-size: 13.5px;
    color: #5A605B;
}
.demo-fineprint svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
    color: #1A5C3A;
}
.demo-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.demo-stage-next {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-lg);
}
.demo-stage {
    scroll-margin-top: 64px;
}

/* Hero --------------------------------------------------------------------- */
.demo-hero .hero {
    padding-bottom: var(--spacing-lg);
}

/* Secondary context bar ---------------------------------------------------- */
/* Deliberately quiet: one line, linen border, sticks under the (non-sticky)
   main header so the step tracker follows the visitor through the demo. */
.demo-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-linen);
    border-bottom: 1px solid var(--color-linen);
}
.demo-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    min-height: 48px;
}
.demo-bar-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-deep-forest-green);
    white-space: nowrap;
}
.demo-bar-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: demo-stage;
}
.demo-bar-steps li {
    counter-increment: demo-stage;
    display: flex;
    align-items: center;
}
.demo-bar-steps li + li::before {
    content: "";
    width: 20px;
    height: 1px;
    margin: 0 6px;
    background: #D1CDC4;
}
.demo-bar-steps a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #6B716C;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.demo-bar-steps a::before {
    content: counter(demo-stage);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #C9C4B9;
    font-size: 11px;
    font-weight: 700;
    color: #6B716C;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.demo-bar-steps a:hover {
    color: var(--color-deep-forest-green);
    background: rgba(26, 92, 58, 0.06);
}
.demo-bar-steps li.is-current a {
    color: var(--color-deep-forest-green);
}
.demo-bar-steps li.is-current a::before {
    background: var(--color-deep-forest-green);
    border-color: var(--color-deep-forest-green);
    color: #fff;
}
.demo-bar-steps li.is-done a::before {
    background: #DFF1E6;
    border-color: #1A5C3A;
    color: #1A5C3A;
}
.demo-bar-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-obsidian);
    white-space: nowrap;
}
.demo-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #DFFFEA 0%, #6EE7A0 24%, #25A862 58%, #1A5C3A 100%);
    box-shadow: 0 0 4px rgba(46, 204, 113, 0.85), 0 0 11px rgba(46, 204, 113, 0.45);
}

/* 1. Product selection ------------------------------------------------------ */
.demo-products {
    gap: var(--spacing-lg);
    align-items: stretch;
    max-width: 1060px;
    margin: 0 auto;
}
.demo-product {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    cursor: pointer;
    border: 1px solid var(--color-linen);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.demo-product h3 {
    font-size: 26px;
}
.demo-product h3 label {
    cursor: pointer;
    color: inherit;
    font-weight: inherit;
}
.demo-product .product-list {
    flex: 1;
}
.demo-product-radio {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.demo-product-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.demo-product-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #C9C4B9;
    color: transparent;
    background: #fff;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.demo-product-check svg {
    width: 16px;
    height: 16px;
}
.demo-product.is-selected {
    border-color: rgba(26, 92, 58, 0.45);
    box-shadow: 0 12px 40px rgba(26, 92, 58, 0.12), 0 0 0 1px rgba(26, 92, 58, 0.25);
}
.demo-product.is-selected .demo-product-check {
    background: var(--color-deep-forest-green);
    border-color: var(--color-deep-forest-green);
    color: #fff;
}
.demo-product:focus-within {
    outline: 2px solid #1A5C3A;
    outline-offset: 3px;
}
.demo-product-meta {
    font-size: 13px;
    font-weight: 600;
    color: #6B716C;
}

/* 2. Input ------------------------------------------------------------------ */
.demo-input-layout {
    align-items: start;
    gap: var(--spacing-lg);
}
.demo-samples-label {
    display: block;
    margin: var(--spacing-md) 0 var(--spacing-sm);
    color: #6B716C;
}
.demo-samples {
    display: grid;
    gap: 10px;
}
.demo-sample {
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 14px;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: var(--color-white);
    border: 1px solid var(--color-linen);
    border-radius: 12px;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-base);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.demo-sample:hover {
    border-color: rgba(26, 92, 58, 0.4);
    box-shadow: 0 10px 24px -14px rgba(11, 38, 24, 0.35);
}
.demo-sample.is-active {
    border-color: #1A5C3A;
    box-shadow: 0 0 0 3px rgba(26, 92, 58, 0.14);
}
.demo-sample-band {
    grid-row: 1 / span 2;
    width: 6px;
    height: 100%;
    min-height: 34px;
    border-radius: 3px;
}
.demo-sample-band.is-low { background: #1A8F57; }
.demo-sample-band.is-medium { background: #D9A400; }
.demo-sample-band.is-high { background: #B3261E; }
.demo-sample-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-obsidian);
}
.demo-sample-hint {
    font-size: 13px;
    color: #6B716C;
}
.demo-form {
    padding: 30px;
}
.demo-form .contact-fields {
    gap: 18px 16px;
}
.demo-form .contact-field input[type="number"] {
    font-variant-numeric: tabular-nums;
}
.demo-form.is-external .demo-field-full-only {
    display: none;
}
.demo-form:not(.is-external) .demo-hint-external {
    display: none;
}
.demo-form .contact-hint {
    margin-top: -4px;
}

/* Preview mode: the intake is shown, not edited. Samples fill it. */
.demo-form.is-preview .contact-fields {
    pointer-events: none;
}
.demo-form.is-preview .contact-field input,
.demo-form.is-preview .contact-field select,
.demo-form.is-preview .contact-field .select-trigger {
    background-color: #F5F4F0;
    border-style: dashed;
    color: #424843;
    cursor: default;
}
.demo-form.is-preview .contact-field .select-chevron {
    opacity: 0.45;
}
.demo-form .demo-actions {
    grid-template-columns: minmax(0, 1fr);
}
.demo-form .contact-fineprint {
    margin-top: 12px;
}
.demo-chat-form input[readonly] {
    background-color: #F5F4F0;
    border-style: dashed;
    cursor: default;
}
.demo-chat-form input[readonly]:focus {
    border-color: #DEDAD2;
    box-shadow: none;
    background-color: #F5F4F0;
}
.demo-chat-form .btn[disabled] {
    opacity: 0.4;
    cursor: default;
}

/* Disclaimer ---------------------------------------------------------------- */
.demo-disclaimer {
    padding-top: var(--spacing-lg);
}
.demo-disclaimer-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: var(--spacing-md);
    align-items: start;
    max-width: 960px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    border-color: rgba(26, 92, 58, 0.35);
    background: #FBFAF7;
}
.demo-disclaimer-card .product-icon {
    margin-bottom: 0;
}
.demo-disclaimer-card .label-caps {
    display: block;
    color: var(--color-deep-forest-green);
    margin-bottom: 8px;
}
.demo-disclaimer-card h3 {
    font-size: 22px;
}
.demo-disclaimer-card p {
    margin-bottom: var(--spacing-md);
}
@media (max-width: 768px) {
    .demo-disclaimer-card {
        grid-template-columns: minmax(0, 1fr);
        padding: var(--spacing-md);
    }
    .demo-disclaimer-card .btn {
        width: 100%;
    }
}

/* 3. Processing ------------------------------------------------------------- */
.demo-proc-layout {
    gap: var(--spacing-lg);
    align-items: start;
}
.demo-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.demo-steps::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: rgba(25, 25, 25, 0.1);
}
.demo-step {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 14px;
}
.demo-step:last-child {
    padding-bottom: 0;
}
.demo-step-num {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid rgba(25, 25, 25, 0.12);
    color: #8B908C;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.demo-step-num .demo-spinner,
.demo-step-num .demo-step-check,
.demo-step-num .demo-step-lock {
    display: none;
    width: 18px;
    height: 18px;
}
.demo-step-body {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.demo-step-body h4 {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: 700;
    color: #8B908C;
    transition: color 0.3s ease;
}
.demo-step-body p {
    margin: 0;
    font-size: 14px;
    color: #9A9E9B;
    transition: color 0.3s ease;
}
.demo-step-note {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #8B6A00;
}
.demo-step.is-running .demo-step-num {
    border-color: #1A5C3A;
    background: #1A5C3A;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(26, 92, 58, 0.14), 0 0 22px rgba(26, 92, 58, 0.35);
}
.demo-step.is-running .demo-step-idx,
.demo-step.is-done .demo-step-idx,
.demo-step.is-locked .demo-step-idx {
    display: none;
}
.demo-step.is-running .demo-spinner {
    display: inline-block;
}
.demo-step.is-running .demo-step-body {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(26, 92, 58, 0.22);
}
.demo-step.is-running .demo-step-body h4 { color: #1A5C3A; }
.demo-step.is-running .demo-step-body p { color: #424843; }
.demo-step.is-done .demo-step-num {
    border-color: #1A5C3A;
    background: #1A5C3A;
    color: #fff;
}
.demo-step.is-done .demo-step-check { display: block; }
.demo-step.is-done .demo-step-body h4 { color: var(--color-obsidian); }
.demo-step.is-done .demo-step-body p { color: #424843; }
.demo-step.is-locked .demo-step-num {
    border-style: dashed;
    border-color: #C9C4B9;
    background: #F5F4F0;
    color: #8B908C;
}
.demo-step.is-locked .demo-step-lock { display: block; }
.demo-step.is-locked .demo-step-note { display: block; }

.demo-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: demo-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes demo-spin {
    to { transform: rotate(360deg); }
}

/* Console */
.demo-console {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    padding: 0;
    overflow: hidden;
    background: #0F2A1B;
    border-color: rgba(255, 255, 255, 0.08);
    color: #DDE7E0;
}
.demo-console-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.demo-console-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #B9D3C2;
}
.demo-console-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6B716C;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.demo-console.is-running .demo-console-led {
    background: #6EE7A0;
    box-shadow: 0 0 6px rgba(110, 231, 160, 0.9);
    animation: demo-led 1.2s ease-in-out infinite;
}
.demo-console.is-done .demo-console-led {
    background: #6EE7A0;
}
@keyframes demo-led {
    50% { opacity: 0.4; }
}
.demo-console-status {
    font-size: 12.5px;
    font-weight: 600;
    color: #9DB8A6;
    font-variant-numeric: tabular-nums;
}
.demo-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
}
.demo-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #1A8F57, #6EE7A0);
    transition: width 0.5s ease;
}
.demo-log {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 16px 18px;
    max-height: 420px;
    overflow-y: auto;
    font-family: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
    font-size: 12.5px;
    line-height: 1.55;
}
.demo-log li.demo-log-empty {
    display: block;
    color: #7F9788;
    font-family: var(--font-family);
    font-size: 14px;
    animation: none;
    opacity: 1;
    transform: none;
}
.demo-log li {
    display: grid;
    grid-template-columns: 44px max-content minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 3px 0;
    opacity: 0;
    transform: translateY(4px);
    animation: demo-log-in 0.35s ease forwards;
}
@keyframes demo-log-in {
    to { opacity: 1; transform: none; }
}
.demo-log-time {
    color: #7F9788;
    font-variant-numeric: tabular-nums;
}
.demo-log-tag {
    font-weight: 700;
    color: #6EE7A0;
}
.demo-log li.is-skip .demo-log-tag { color: #E0B84C; }
.demo-log li.is-skip .demo-log-text { color: #B9B7A4; }
.demo-log li.is-alert .demo-log-tag { color: #F08C82; }
.demo-log-text {
    color: #DDE7E0;
    overflow-wrap: anywhere;
}

/* 4. Results ---------------------------------------------------------------- */
.demo-results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.demo-results-head h2 {
    margin-bottom: 0;
    max-width: 620px;
}
.demo-results-meta {
    text-align: right;
}
.demo-results-company {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-obsidian);
}
.demo-results-sub {
    display: block;
    font-size: 13.5px;
    color: #6B716C;
}
.demo-results-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    max-width: 640px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    text-align: center;
    border-style: dashed;
}
.demo-results-empty[hidden] {
    display: none;
}
.demo-results-empty svg {
    width: 36px;
    height: 36px;
    color: #1A5C3A;
}
.demo-results-empty p {
    margin: 0 0 var(--spacing-sm);
}
.demo-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-md);
}
.demo-report-grid > .card {
    padding: var(--spacing-md) 28px;
}
.demo-report.is-revealed .card {
    animation: demo-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.demo-report.is-revealed .card:nth-child(2) { animation-delay: 0.08s; }
.demo-report.is-revealed .card:nth-child(3) { animation-delay: 0.16s; }
.demo-report.is-revealed .card:nth-child(4) { animation-delay: 0.24s; }
@keyframes demo-card-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* Score */
.demo-score-top {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-linen);
    margin-bottom: var(--spacing-md);
}
.demo-ring {
    position: relative;
    width: 136px;
    height: 136px;
    flex-shrink: 0;
}
.demo-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    display: block;
}
.demo-ring-track {
    fill: none;
    stroke: rgba(25, 25, 25, 0.08);
    stroke-width: 9;
}
.demo-ring-fill {
    fill: none;
    stroke: #1A8F57;
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 314.16;
    stroke-dashoffset: 314.16;
    transition: stroke-dashoffset 1.3s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s ease;
}
.demo-report[data-band="medium"] .demo-ring-fill { stroke: #D9A400; }
.demo-report[data-band="high"] .demo-ring-fill { stroke: #B3261E; }
.demo-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    padding-top: 46px;
}
.demo-score-num {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--color-obsidian);
    font-variant-numeric: tabular-nums;
}
.demo-ring-label small {
    font-size: 14px;
    font-weight: 600;
    color: #6B716C;
}
.demo-score-text {
    min-width: 0;
}
.demo-score-text .label-caps {
    display: block;
    color: #6B716C;
    margin-bottom: 8px;
}
.demo-score-text p {
    margin: 12px 0 0;
    font-size: 14.5px;
}
.demo-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #DFF1E6;
    color: #1A5C3A;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.demo-report[data-band="medium"] .demo-badge { background: #FBF0C7; color: #7A5D00; }
.demo-report[data-band="high"] .demo-badge { background: #F9DEDB; color: #8E1E17; }
.demo-pathway .label-caps {
    display: block;
    color: #6B716C;
    margin-bottom: 10px;
}
.demo-pathway-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.demo-pathway-step {
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid var(--color-linen);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #9A9E9B;
    background: #FAFAF8;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.demo-pathway-step.is-active {
    color: #fff;
    border-color: transparent;
}
.demo-pathway-step[data-pathway="approve"].is-active { background: #1A8F57; }
.demo-pathway-step[data-pathway="refer"].is-active { background: #D9A400; color: #1F1A00; }
.demo-pathway-step[data-pathway="reject"].is-active { background: #B3261E; }
.demo-report.is-external .demo-pathway-steps {
    opacity: 0.55;
}
.demo-pathway-note {
    margin: 12px 0 0;
    font-size: 13.5px;
}

/* Factors + metrics */
.demo-factors-card h3,
.demo-flags-card h3,
.demo-metrics-title {
    font-size: 18px;
    margin-bottom: var(--spacing-sm);
}
.demo-metrics-title {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-linen);
}
.demo-factor {
    margin-bottom: 12px;
}
.demo-factor-head {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}
.demo-factor-val {
    color: #6B716C;
    font-variant-numeric: tabular-nums;
}
.demo-meter {
    height: 8px;
    border-radius: 999px;
    background: rgba(25, 25, 25, 0.08);
    overflow: hidden;
}
.demo-meter-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #1A8F57;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
}
.demo-factor.is-medium .demo-meter-fill { background: #D9A400; }
.demo-factor.is-high .demo-meter-fill { background: #B3261E; }
.demo-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
}
.demo-metrics div {
    padding: 10px 12px;
    border-radius: 10px;
    background: #FAFAF8;
    border: 1px solid var(--color-linen);
}
.demo-metrics dt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B716C;
    margin-bottom: 3px;
}
.demo-metrics dd {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-obsidian);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.demo-metrics dd.is-warn { color: #7A5D00; }
.demo-metrics dd.is-alert { color: #8E1E17; }
.demo-metrics dd.is-locked {
    color: #9A9E9B;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.demo-metrics dd.is-locked svg {
    width: 14px;
    height: 14px;
}

/* Flags */
.demo-flags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.demo-flags li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--color-linen);
    background: #FAFAF8;
    font-size: 14px;
    color: var(--color-obsidian);
}
.demo-flag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
}
.demo-flag-icon svg {
    width: 14px;
    height: 14px;
}
.demo-flags li.is-ok .demo-flag-icon { background: #1A8F57; }
.demo-flags li.is-warn .demo-flag-icon { background: #D9A400; }
.demo-flags li.is-alert .demo-flag-icon { background: #B3261E; }
.demo-flags li.is-alert { border-color: rgba(179, 38, 30, 0.35); }
.demo-flag-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6B716C;
    margin-bottom: 2px;
}

/* Evidence tabs */
.demo-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: var(--spacing-sm);
    border-radius: 10px;
    background: #F2F1EC;
}
.demo-tab {
    flex: 1;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #6B716C;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.demo-tab.is-active {
    background: #fff;
    color: var(--color-deep-forest-green);
    box-shadow: var(--shadow-base);
}
.demo-tab-panel[hidden] {
    display: none;
}
.demo-evidence {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.demo-evidence th,
.demo-evidence td {
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-linen);
}
.demo-evidence th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B716C;
}
.demo-evidence td:first-child {
    font-weight: 600;
    color: var(--color-obsidian);
}
.demo-evidence td:last-child {
    white-space: nowrap;
}
.demo-ev-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1A8F57;
}
.demo-ev-state.is-warn { color: #7A5D00; }
.demo-ev-state.is-alert { color: #8E1E17; }
.demo-ev-state.is-locked { color: #9A9E9B; }
.demo-ev-state svg {
    width: 14px;
    height: 14px;
}
.demo-code {
    margin: 0;
    padding: 16px 18px;
    border-radius: 12px;
    background: #0F2A1B;
    color: #DDE7E0;
    font-family: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
    font-size: 12.5px;
    line-height: 1.55;
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
    white-space: pre;
}
.demo-code-inline {
    margin: 0 0 var(--spacing-md);
    max-height: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.demo-results-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

/* 5. Locked / partner intelligence ---------------------------------------- */
.demo-locked-grid {
    gap: var(--spacing-md);
}
.demo-locked-card {
    position: relative;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    overflow: hidden;
    background: repeating-linear-gradient(135deg, #FFFFFF 0 10px, #FBFAF7 10px 20px);
}
.demo-locked-card .product-icon,
.demo-locked-card h3,
.demo-locked-card p {
    opacity: 0.72;
}
.demo-locked-card h3 {
    font-size: 20px;
}
.demo-locked-card p {
    margin: 0;
    font-size: 14.5px;
}
.demo-locked-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--color-deep-forest-green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.demo-locked-badge svg {
    width: 12px;
    height: 12px;
}
.demo-locked-card.is-unlocked {
    background: var(--color-white);
}
.demo-locked-card.is-unlocked .product-icon,
.demo-locked-card.is-unlocked h3,
.demo-locked-card.is-unlocked p {
    opacity: 1;
}
.demo-locked-card.is-unlocked .demo-locked-badge {
    background: #DFF1E6;
    color: #1A5C3A;
}

/* 6. Agent ------------------------------------------------------------------ */
.demo-agent-layout {
    align-items: start;
    gap: var(--spacing-lg);
}
.demo-chat {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 520px;
}
.demo-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-linen);
    background: linear-gradient(180deg, #FFFFFF 0%, #F8F7F4 100%);
}
.demo-chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #F4F4F4;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--color-linen);
}
.demo-chat-avatar svg {
    width: 20px;
    height: 20px;
}
.demo-chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}
.demo-chat-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-obsidian);
}
.demo-chat-sub {
    display: block;
    font-size: 12.5px;
    color: #6B716C;
}
.demo-chat-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    max-height: 460px;
    overflow-y: auto;
}
.demo-msg {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.55;
    animation: demo-card-in 0.35s ease both;
}
.demo-msg p {
    margin: 0;
    color: inherit;
}
.demo-msg.is-agent {
    align-self: flex-start;
    background: #F2F1EC;
    color: var(--color-obsidian);
    border-bottom-left-radius: 4px;
}
.demo-msg.is-user {
    align-self: flex-end;
    background: var(--color-deep-forest-green);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.demo-msg.is-typing {
    display: inline-flex;
    gap: 5px;
    padding: 14px 16px;
}
.demo-msg.is-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8B908C;
    animation: demo-typing 1s ease-in-out infinite;
}
.demo-msg.is-typing i:nth-child(2) { animation-delay: 0.15s; }
.demo-msg.is-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes demo-typing {
    0%, 100% { opacity: 0.35; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}
.demo-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 14px;
}
.demo-chip {
    padding: 7px 12px;
    border: 1px solid #DEDAD2;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-deep-forest-green);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.demo-chip:hover {
    border-color: #1A5C3A;
    background: rgba(26, 92, 58, 0.06);
}
.demo-chat-form {
    display: flex;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--color-linen);
}
.demo-chat-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--color-obsidian);
    background: #FAFAF8;
    border: 1px solid #DEDAD2;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.demo-chat-form input:focus {
    background: #fff;
    border-color: #1A5C3A;
    box-shadow: 0 0 0 3px rgba(26, 92, 58, 0.14);
}
.demo-chat-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 10px;
}
.demo-chat-form .btn svg {
    width: 18px;
    height: 18px;
}

/* 7. CTA -------------------------------------------------------------------- */
.demo-cta-grid {
    gap: var(--spacing-md);
    align-items: stretch;
}
.demo-cta-card {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
}
.demo-cta-card p {
    flex: 0 0 auto;
}
.demo-cta-card .btn {
    align-self: flex-start;
    margin-top: auto;
}
.demo-cta-card-primary {
    border-color: rgba(26, 92, 58, 0.35);
    box-shadow: 0 12px 40px rgba(26, 92, 58, 0.10);
}

/* Responsive ----------------------------------------------------------------- */
@media (max-width: 1024px) {
    .demo-report-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .demo-bar-product {
        display: none;
    }
}
@media (max-width: 768px) {
    .demo-bar-inner {
        justify-content: center;
    }
    .demo-bar-title {
        display: none;
    }
    .demo-bar-steps a span,
    .demo-bar-steps a {
        font-size: 12px;
        padding: 6px 6px;
    }
    .demo-bar-steps li + li::before {
        width: 10px;
        margin: 0 2px;
    }
    .demo-product {
        padding: var(--spacing-md);
    }
    .demo-product h3 {
        font-size: 22px;
    }
    .demo-form {
        padding: 22px 18px;
    }
    .demo-form .contact-fields,
    .demo-form .demo-actions {
        grid-template-columns: minmax(0, 1fr);
    }
    .demo-form .contact-field input,
    .demo-form .contact-field select,
    .demo-form .contact-field .select-trigger {
        font-size: 16px;
    }
    .demo-console {
        min-height: 320px;
    }
    .demo-log {
        max-height: 300px;
    }
    .demo-log li {
        grid-template-columns: max-content minmax(0, 1fr);
    }
    .demo-log-time {
        display: none;
    }
    .demo-results-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .demo-results-meta {
        text-align: left;
    }
    .demo-report-grid > .card {
        padding: var(--spacing-md) 18px;
    }
    .demo-score-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .demo-metrics {
        grid-template-columns: minmax(0, 1fr);
    }
    .demo-evidence td:last-child {
        white-space: normal;
    }
    .demo-results-actions .btn {
        width: 100%;
    }
    .demo-cta-card {
        padding: var(--spacing-md);
    }
    .demo-cta-card .btn {
        align-self: stretch;
    }
    .demo-chat {
        min-height: 0;
    }
}
@media (max-width: 480px) {
    .demo-bar-steps a::before {
        display: none;
    }
    .demo-bar-steps a {
        font-size: 11px;
        letter-spacing: 0.02em;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .demo-spinner,
    .demo-console.is-running .demo-console-led,
    .demo-msg.is-typing i {
        animation: none;
    }
    .demo-log li,
    .demo-msg,
    .demo-report.is-revealed .card {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .demo-ring-fill,
    .demo-meter-fill,
    .demo-progress-fill {
        transition: none;
    }
}



/* Step 7 stage: the agent streams its verdict into the interface ------------ */
/* Revealed under the steps/log grid when the pipeline reaches step 7. Four
   columns on desktop joined by SVG wires drawn from the live element
   positions; below 1100px the columns stack and the wires give way. */
.demo-flow-wrap {
    margin-top: var(--spacing-lg);
}
.demo-flow-wrap[hidden] {
    display: none;
}
.demo-flow-wrap.is-revealed {
    animation: demo-card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.demo-flow {
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(150px, 0.9fr) minmax(280px, 1.6fr) minmax(200px, 1.1fr);
    gap: 40px;
    align-items: center;
    padding: 24px 32px 36px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFAF7 100%);
    overflow: hidden;
    transition: box-shadow 0.6s ease, border-color 0.6s ease;
}
.demo-flow.is-complete {
    border-color: rgba(26, 143, 87, 0.55);
    box-shadow: 0 0 0 4px rgba(26, 143, 87, 0.12), 0 24px 60px -24px rgba(26, 143, 87, 0.45);
}
.demo-flow-wires {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.demo-flow-wires path {
    fill: none;
    stroke: #D9D5CC;
    stroke-width: 1.5;
    transition: stroke 0.35s ease;
}
.demo-flow-wires path.is-lit {
    stroke: #1A8F57;
    stroke-width: 2;
    stroke-dasharray: 6 6;
    animation: demo-wire 0.9s linear infinite;
}
.demo-flow-wires path.is-done {
    stroke: rgba(26, 143, 87, 0.45);
}
@keyframes demo-wire {
    to { stroke-dashoffset: -12; }
}
.demo-flow-head {
    grid-column: 1 / -1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-linen);
}
.demo-flow-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-deep-forest-green);
    white-space: nowrap;
}
.demo-flow-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D1CDC4;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.demo-flow.is-live .demo-flow-led {
    background: radial-gradient(circle at 35% 32%, #DFFFEA 0%, #6EE7A0 24%, #25A862 58%, #1A5C3A 100%);
    box-shadow: 0 0 4px rgba(46, 204, 113, 0.85), 0 0 11px rgba(46, 204, 113, 0.45);
    animation: demo-led 1.2s ease-in-out infinite;
}
.demo-flow.is-complete .demo-flow-led {
    animation: none;
}
.demo-flow-head-sub {
    font-size: 13.5px;
    color: #5A605B;
    text-align: right;
    max-width: 60ch;
}
.demo-flow-col {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.demo-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 14px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--color-linen);
    border-radius: 14px;
    box-shadow: var(--shadow-base);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.demo-node.is-active {
    border-color: rgba(26, 92, 58, 0.45);
    box-shadow: 0 0 0 4px rgba(26, 92, 58, 0.10), 0 12px 28px -16px rgba(11, 38, 24, 0.35);
}
.demo-node-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(26, 92, 58, 0.08);
    color: #1A5C3A;
}
.demo-node-icon svg {
    width: 22px;
    height: 22px;
}
.demo-node-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-obsidian);
}
.demo-node-sub {
    font-size: 12px;
    color: #6B716C;
    line-height: 1.4;
}
.demo-flow-col-client {
    position: relative;
}
.demo-wire-label {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11.5px;
    color: #8B908C;
    transition: color 0.3s ease;
}
.demo-wire-label svg {
    width: 14px;
    height: 14px;
}
.demo-wire-label code {
    font-family: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
    font-size: 11px;
}
.demo-wire-label.is-active {
    color: #1A5C3A;
}
.demo-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.demo-event {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--color-linen);
    border-radius: 12px;
    opacity: 0.55;
    transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.demo-event-dot {
    grid-row: 1 / span 2;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #D1CDC4;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.demo-event-name {
    font-family: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-obsidian);
}
.demo-event-body {
    font-family: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
    font-size: 11.5px;
    color: #6B716C;
    overflow-wrap: anywhere;
}
.demo-event.is-active {
    opacity: 1;
    border-color: rgba(26, 92, 58, 0.45);
    box-shadow: 0 0 0 4px rgba(26, 92, 58, 0.10);
    transform: translateX(2px);
}
.demo-event.is-active .demo-event-dot {
    background: #1A8F57;
    box-shadow: 0 0 8px rgba(26, 143, 87, 0.6);
}
.demo-event.is-done {
    opacity: 1;
}
.demo-event.is-done .demo-event-dot {
    background: #1A5C3A;
}
.demo-event[data-event="1"].is-active .demo-event-dot {
    background: #D9A400;
    box-shadow: 0 0 8px rgba(217, 164, 0, 0.6);
}
.demo-flow.is-complete .demo-event[data-event="5"] {
    border-color: rgba(26, 143, 87, 0.6);
    box-shadow: 0 0 0 4px rgba(26, 143, 87, 0.14), 0 0 32px rgba(26, 143, 87, 0.25);
    animation: demo-glow 1.6s ease-in-out infinite;
}
@keyframes demo-glow {
    50% { box-shadow: 0 0 0 6px rgba(26, 143, 87, 0.10), 0 0 48px rgba(26, 143, 87, 0.40); }
}

.demo-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--color-linen);
    border-radius: 14px;
    box-shadow: var(--shadow-base);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.demo-flow.is-complete .demo-panel {
    border-color: rgba(26, 143, 87, 0.5);
    box-shadow: 0 0 0 4px rgba(26, 143, 87, 0.12), 0 16px 40px -20px rgba(26, 143, 87, 0.5);
}
.demo-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-linen);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B716C;
}
.demo-panel-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D1CDC4;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.demo-panel.is-live .demo-panel-led {
    background: #25A862;
    box-shadow: 0 0 6px rgba(37, 168, 98, 0.8);
}
.demo-panel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #FAFAF8;
    border: 1px solid var(--color-linen);
    font-size: 13px;
    color: var(--color-obsidian);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-panel-row.is-in {
    opacity: 1;
    transform: none;
}
.demo-spinner-dark {
    border-color: rgba(26, 92, 58, 0.2);
    border-top-color: #1A5C3A;
}
.demo-panel-text {
    align-items: flex-start;
    min-height: 60px;
    line-height: 1.45;
}
.demo-panel-caret {
    display: none;
    width: 1px;
    height: 14px;
    margin-top: 2px;
    background: var(--color-obsidian);
    animation: demo-blink 1s steps(2, start) infinite;
}
.demo-panel-text.is-typing .demo-panel-caret {
    display: inline-block;
}
@keyframes demo-blink {
    to { visibility: hidden; }
}
.demo-panel-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(26, 92, 58, 0.08);
    color: #1A5C3A;
    font-family: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
    font-size: 11.5px;
    font-weight: 700;
}
.demo-panel-chip svg {
    width: 13px;
    height: 13px;
}
.demo-panel-row[data-panel="4"] {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.demo-panel-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(25, 25, 25, 0.08);
    overflow: hidden;
}
.demo-panel-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    background: #1A8F57;
    border-radius: inherit;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
}
.demo-flow[data-band="medium"] .demo-panel-progress-fill { background: #D9A400; }
.demo-flow[data-band="high"] .demo-panel-progress-fill { background: #B3261E; }
.demo-panel-progress-label {
    font-size: 12px;
    color: #6B716C;
    font-variant-numeric: tabular-nums;
}
.demo-panel-done {
    color: #1A5C3A;
    font-weight: 700;
}
.demo-panel-done svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 1100px) {
    .demo-flow {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 28px;
    }
    .demo-flow-wires {
        display: none;
    }
    .demo-flow-col-client {
        padding-bottom: 34px;
    }
    .demo-events,
    .demo-flow-col-panel {
        grid-column: 1 / -1;
    }
    .demo-panel {
        min-height: 0;
    }
}
@media (max-width: 640px) {
    .demo-flow {
        grid-template-columns: minmax(0, 1fr);
        padding: 18px 16px 22px;
    }
    .demo-flow-head {
        flex-direction: column;
        gap: 6px;
    }
    .demo-flow-head-sub {
        text-align: left;
    }
}
@media (prefers-reduced-motion: reduce) {
    .demo-flow-wrap.is-revealed,
    .demo-flow-wires path.is-lit,
    .demo-flow.is-live .demo-flow-led,
    .demo-flow.is-complete .demo-event[data-event="5"],
    .demo-panel-caret {
        animation: none;
    }
    .demo-panel-row,
    .demo-event {
        transition: none;
    }
}

/* Score card charts: revenue month to month + wallet distribution ----------- */
.demo-charts {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-linen);
}
.demo-chart {
    min-width: 0;
}
.demo-chart-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B716C;
}
.demo-chart-total {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-obsidian);
    font-variant-numeric: tabular-nums;
}
.demo-revenue {
    display: block;
    width: 100%;
    height: 110px;
}
.demo-revenue .bar {
    fill: #1A8F57;
    transform-box: fill-box;
    transform-origin: bottom;
    transform: scaleY(0.02);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-revenue .bar.is-last {
    fill: var(--color-deep-forest-green);
}
.demo-revenue.is-in .bar {
    transform: scaleY(1);
}
.demo-revenue .grid-line {
    stroke: rgba(25, 25, 25, 0.08);
    stroke-width: 1;
}
.demo-revenue .trend {
    fill: none;
    stroke: rgba(11, 38, 24, 0.55);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
}
.demo-chart-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-top: 6px;
    font-size: 10px;
    color: #8B908C;
    text-align: center;
    letter-spacing: 0.02em;
}
.demo-wallet {
    display: flex;
    align-items: center;
    gap: 14px;
}
.demo-wallet svg {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    transform: rotate(-90deg);
}
.demo-wallet circle {
    fill: none;
    stroke-width: 14;
    transition: stroke-dasharray 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-wallet-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 5px;
    min-width: 0;
    flex: 1;
}
.demo-wallet-legend li {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    line-height: 1.25;
    color: #424843;
}
.demo-wallet-legend li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.demo-wallet-legend i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}
.demo-wallet-legend strong {
    font-variant-numeric: tabular-nums;
    color: var(--color-obsidian);
}
.demo-charts.is-locked .demo-chart {
    filter: blur(3px);
    opacity: 0.45;
    pointer-events: none;
}
.demo-charts-lock {
    position: absolute;
    inset: var(--spacing-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #5A605B;
}
.demo-charts-lock[hidden] {
    display: none;
}
.demo-charts-lock svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #1A5C3A;
}
@media (max-width: 480px) {
    .demo-charts {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Step 7 stage: agent cards ------------------------------------------------- */
.demo-agent {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
}
.demo-agent-icon {
    grid-row: 1 / span 2;
    grid-column: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(26, 92, 58, 0.08);
    color: #1A5C3A;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.demo-agent-icon svg {
    width: 15px;
    height: 15px;
}
.demo-agent .demo-event-name {
    font-family: var(--font-family);
    font-size: 13.5px;
    letter-spacing: -0.01em;
}
.demo-agent .demo-event-body {
    font-family: var(--font-family);
    font-size: 12px;
}
.demo-agent .demo-event-name,
.demo-agent .demo-event-body {
    grid-column: 2;
}
.demo-agent-status {
    grid-row: 1 / span 2;
    grid-column: 3;
    align-self: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #F2F1EC;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8B908C;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.demo-agent.is-active .demo-agent-icon {
    background: #1A8F57;
    color: #fff;
}
.demo-agent.is-active .demo-agent-status {
    background: #DFF1E6;
    color: #1A5C3A;
}
.demo-agent.is-done .demo-agent-icon {
    background: var(--color-deep-forest-green);
    color: #fff;
}
.demo-agent.is-done .demo-agent-status {
    background: rgba(11, 38, 24, 0.08);
    color: var(--color-deep-forest-green);
}
.demo-panel-out {
    font-size: 12.5px;
}
.demo-panel-out svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #1A5C3A;
}
.demo-panel {
    min-height: 0;
}
@media (max-width: 480px) {
    .demo-agent {
        grid-template-columns: 30px minmax(0, 1fr);
    }
    .demo-agent-status {
        grid-row: auto;
        grid-column: 2;
        justify-self: start;
        margin-top: 4px;
    }
}

/* Score card: AI web and behaviour summary (External Intelligence) ----------- */
.demo-charts[hidden],
.demo-aisum[hidden] {
    display: none;
}
.demo-aisum {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-linen);
}
.demo-aisum-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(26, 92, 58, 0.08);
    color: #1A5C3A;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.demo-aisum-badge svg {
    width: 12px;
    height: 12px;
}
.demo-aisum-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.demo-aisum-list li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 10px;
    background: #FAFAF8;
    border: 1px solid var(--color-linen);
}
.demo-aisum-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #DFF1E6;
    color: #1A5C3A;
}
.demo-aisum-icon svg {
    width: 15px;
    height: 15px;
}
.demo-aisum-list li.is-ok { background: #F1F8F3; border-color: #CFE7D8; }
.demo-aisum-list li.is-warn { background: #FFF6E0; border-color: #F1D98A; }
.demo-aisum-list li.is-warn .demo-aisum-icon { background: #F7E4A8; color: #7A5D00; }
.demo-aisum-list li.is-alert { background: #FDEDEB; border-color: #F0B8B2; }
.demo-aisum-list li.is-alert .demo-aisum-icon { background: #F5C9C4; color: #8E1E17; }
.demo-aisum-badge img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}
.demo-aisum-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B716C;
    margin-bottom: 2px;
}
.demo-aisum-value {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-obsidian);
}
@media (max-width: 480px) {
    .demo-aisum-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* API tab: where the payload shape comes from */
.demo-api-note {
    margin: var(--spacing-sm) 0 0;
    font-size: 13px;
    color: #424843;
}
.demo-api-note a {
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 3px;
}
