/* Ingress stretches across the full calculator width, not just the left column */
.section-sub {
    max-width: none;
}

/* Total-cost metric highlighted in red */
.metric-value--negative {
    color: #C0392B;
}

.costs-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--border);
}

.costs-metric {
    padding: 20px 22px;
    border-right: 1px solid var(--border);
}

.costs-metric:last-child {
    border-right: none;
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.chart-container {
    height: 240px;
    padding: 20px;
    max-width: 280px;
    margin: 0 auto;
}

.card-header-row {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}

.card-title-inline {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}

.btn-export {
    padding: 7px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border-radius: 999px;
    border: 1.5px solid var(--accent);
    background: var(--surface);
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 0.15s;
}

.btn-export:hover {
    background: var(--accent);
    color: #fff;
}

.period-btns {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.period-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--muted);
    transition: all 0.15s;
}

.period-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.period-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.period-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--muted);
    border-color: var(--border);
    background: var(--surface-alt);
}

.comparison-box {
    background: linear-gradient(135deg, #e4f2eb, #fff4e4);
    border: 1px solid #bde3d0;
    border-radius: var(--radius);
    padding: 16px;
}

#comparisonTitle:not(:empty) {
    display: block;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.comparison-box p {
    font-size: 0.875rem;
    color: #3a5248;
}

@media (max-width: 820px) {
    .costs-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .costs-metric:nth-child(2) {
        border-right: none;
    }

    .costs-metric:nth-child(3) {
        border-right: 1px solid var(--border);
    }

    .costs-metric:nth-child(4) {
        border-top: 1px solid var(--border);
    }
}
