/* Flow view — row-based sequence grid */

.flow-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Column headers — sticky */
.flow-headers {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.flow-col-header {
    padding: 14px 24px;
}

.col-role {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.col-actor {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.col-actor img,
.col-actor svg {
    flex-shrink: 0;
}

.col-actor-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Grid of rows */
.flow-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Each row spans all three columns */
.flow-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 52px;
    position: relative;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.flow-row.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Vertical lane lines */
.flow-row::before,
.flow-row::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-subtle);
}

.flow-row::before { left: calc(100% / 3); }
.flow-row::after { left: calc(200% / 3); }

/* Cell — one per column */
.flow-cell {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Empty cell — subtle dot on the lane line */
.flow-cell.empty::after {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border-medium);
}

/* Step card inside a cell */
.flow-card {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 2px solid transparent;
}

.flow-card.pass { border-left-color: var(--pass); background: var(--pass-bg); }
.flow-card.fail { border-left-color: var(--fail); background: var(--fail-bg); }
.flow-card.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.flow-card.info { border-left-color: var(--info); background: var(--info-bg); }

.flow-card-title {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flow-card-icon {
    font-size: 11px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.flow-card-detail {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
    padding-left: 20px;
    line-height: 1.4;
}

.flow-card-detail code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    color: var(--text-primary);
}

/* Arrow between cells */
.flow-arrow {
    position: absolute;
    top: 50%;
    height: 1px;
    background: var(--text-tertiary);
    opacity: 0.4;
    z-index: 1;
}

.flow-arrow::after {
    content: "";
    position: absolute;
    top: -3px;
    width: 0;
    height: 0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

.flow-arrow.right {
    right: 0;
    left: calc(100% + 4px);
    /* width set by JS */
}

.flow-arrow.right::after {
    right: -1px;
    border-left: 5px solid var(--text-tertiary);
}

.flow-arrow.left {
    left: 0;
    right: calc(100% + 4px);
}

.flow-arrow.left::after {
    left: -1px;
    border-right: 5px solid var(--text-tertiary);
}

/* Verdict row — special styling */
.flow-row.verdict-row .flow-card {
    text-align: center;
    border-left: none;
    border: 1px solid;
}

.flow-row.verdict-row .flow-card.pass {
    border-color: rgba(34, 197, 94, 0.2);
}

.flow-row.verdict-row .flow-card.fail {
    border-color: rgba(239, 68, 68, 0.2);
}

.flow-row.verdict-row .flow-card.warn {
    border-color: rgba(245, 158, 11, 0.2);
}

.flow-row.verdict-row .flow-card-title {
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.flow-row.verdict-row .flow-card-detail {
    padding-left: 0;
    text-align: center;
}

/* Scrollbar */
.flow-grid::-webkit-scrollbar { width: 4px; }
.flow-grid::-webkit-scrollbar-track { background: transparent; }
.flow-grid::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }
