/* Мгновенный пререндер матрицы и живой статус анализа (ROADMAP 1.1 п.6). */

.instant {
    margin-bottom: 24px;
    animation: instant-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.instant-matrix {
    max-width: 460px;
}

.instant-matrix .matrix-cell {
    font-variant-numeric: tabular-nums;
}

.instant-matrix .matrix-cell.is-lit {
    border-color: var(--accent);
    background: rgb(199 215 255 / 8%);
    transition:
        border-color 320ms ease,
        background-color 320ms ease;
}

.instant-numbers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    max-width: 460px;
    margin: 4px 0 12px;
}

.instant-number {
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.instant-number span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.instant-number strong {
    color: var(--accent);
    font-size: 22px;
    font-weight: 600;
}

.analysis {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.analysis-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 8px 0 12px;
    padding: 0;
    list-style: none;
    counter-reset: stage;
}

.analysis-stages li {
    counter-increment: stage;
    color: var(--muted);
    font-size: 14px;
    opacity: 0.55;
    transition:
        color 320ms ease,
        opacity 320ms ease;
}

.analysis-stages li::before {
    content: counter(stage) ". ";
}

.analysis-stages li.is-active {
    color: var(--text);
    opacity: 1;
}

.analysis-stages li.is-done {
    color: var(--success);
    opacity: 1;
}

.analysis-bar {
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--border);
}

.analysis-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes instant-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 420px) {
    .instant-numbers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .instant {
        animation: none;
    }

    .analysis-bar span,
    .analysis-stages li,
    .instant-matrix .matrix-cell.is-lit {
        transition: none;
    }
}
