/* ==========================================================================
   Calculation explanations (FCFF forecast, DCF valuation)
   Base flow styles (.assumption-flow-*) live in dcf-assumptions.css;
   this file only adds what the calculation tables need on top of them.
   ========================================================================== */

.calc-flow > * + * {
    margin-top: var(--space-5);
}

/* Wide per-year tables scroll sideways on narrow screens */

.calc-flow-scroll {
    overflow-x: auto;
}

.calc-flow-scroll > .assumption-flow-step {
    min-width: calc(190px + var(--cols) * 84px);
}

/* Keep row labels visible while scrolling sideways */

.calc-flow-scroll .assumption-flow-row > :first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface-raised);
}

@media (max-width: 600px) {
    .calc-flow-scroll > .assumption-flow-step {
        min-width: calc(120px + var(--cols) * 72px);
    }
}

/* Row variants */

.assumption-flow-row small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.72rem;
    font-weight: 400;
}

.assumption-flow-row.is-input > :not(:first-child) {
    color: var(--text-muted);
}

.assumption-flow-row.is-subtotal {
    font-weight: 600;
}

.assumption-flow-row.is-subtotal > :first-child {
    color: var(--text);
}

/* Multi-column totals: same size across the row */

.calc-flow-scroll .assumption-flow-row.is-total > :last-child {
    font-size: inherit;
}


#dcf-fcff-calculation-section,
#dcf-valuation-calculation-section {
    margin-top: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}


.fcff-section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.fcff-section-toggle > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fcff-section-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.fcff-section-toggle:hover {
    background: var(--surface-hover);
}

.fcff-section-chevron {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    right: 10px;
    top: -2px
}

.fcff-section-toggle.is-active {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.fcff-section-toggle.is-active .fcff-section-chevron {
    transform: rotate(180deg);
}

#dcf-fcff-calculation-content,
#dcf-valuation-calculation-content {
    padding: 20px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}