#delays-bar-chart canvas {
    height: 230px !important;
    max-height: 230px;
}

#delays-bar-chart {
    position: relative;
}

.chart-caplets {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: -20px;
    gap: 2px;
}

.chart-caplet {
    flex: 0 1 auto;
    display: inline-block;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    background: #e1251b;
    color: #fff;
    font-weight: bold;
    border-radius: 13.6px / 8.2px;
    padding: 6px 4px;
    font-size: 15px;
    letter-spacing: 1px;
    border: 2px solid #fff;
    font-family: 'Onest', sans-serif;
}

body.dark-mode .chart-caplet {
    border: 2px solid #2e2e2e;
}

.chart-caplet.nsl {
    background: #e1251b;
}

.chart-caplet.ewl {
    background: #00953b;
}

.chart-caplet.ccl {
    background: #ff9e18;
    color: #000;
}

.chart-caplet.dtl {
    background: #0055b8;
}

.chart-caplet.nel {
    background: #9e28b5;
}

.chart-caplet.tel {
    background: #9d5918;
}

.chart-caplet.lrt {
    background: #718472;
}

.chart-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

body.dark-mode .mkbf-line-chart-lrt,
body.dark-mode .mkbf-line-chart-mrt {
    border: 1px solid #2b2b2b33 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.233), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* iOS PWA specific - ensure statistics page header margin is consistent */


@media (max-width: 994px) {
    .chart-caplets {
        gap: 2px;
        margin-top: -10px;
        margin-left: 26px;
        margin-right: 26px;
    }

    .chart-caplet {
        font-size: 10px !important;
        flex: 0 1 auto;
    }

    #delays-bar-chart canvas,
    #mkbf-line-chart-mrt canvas,
    #mkbf-line-chart-lrt canvas {
        height: auto !important;
        min-height: 120px !important;
        width: 100% !important;
    }

}