.profit-chart {
    position: relative;
    height: 200px;
    margin-left: 40px;
    background: linear-gradient(to top,
            rgba(255, 0, 0, 0.1) 0%,
            rgba(255, 0, 0, 0.1) var(--cost-position),
            rgba(0, 128, 0, 0.1) var(--cost-position),
            rgba(0, 128, 0, 0.1) 100%);
}

.profit-chart .bars {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    height: 100%;
    z-index: 1;
}


.profit-chart .y-axis-labels {
    position: absolute;
    left: -40px;
    bottom: 0;
    height: 100%;
    width: 40px;
    font-size: 0.75rem;
}

.profit-chart .y-axis-labels .tick {
    position: absolute;
    right: 0;
    transform: translateY(50%);
}

.profit-chart .bar {
    background-color: var(--bar-color, #6c757d);
    border: 1px solid var(--bar-color, #6c757d);
    box-sizing: border-box;
    flex: 0 0 auto;
    position: relative;
}

.profit-chart .bar:hover {
    opacity: 0.8;
}

.profit-chart .cost-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px solid black;
    bottom: var(--cost-position);
    pointer-events: none;
    z-index: 2;
}

.profit-chart .cost-line::before,
.profit-chart .cost-line::after {
    position: absolute;
    left: 0;
    font-size: 0.75rem;
    font-style: italic;
    color: #000;
    pointer-events: none;
}

.profit-chart .cost-line::before {
    content: 'gain';
    top: -2px;
    transform: translateY(-100%);
}

.profit-chart .cost-line::after {
    content: 'loss';
    bottom: -2px;
    transform: translateY(100%);
}
