.best-time-to-save {
    --bts-gap: 6px;
    --bts-height: 140px;
    --bts-bar-width: 28px;
    --bts-label-space: 110px;
    --bts-accent: #e85d04;
    --bts-muted: #888;
    --bts-bar: #cfcfcf;
    --bts-avg-bg: #222;
    --bts-text: inherit;
}

.best-time-to-save__chart {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 18px;
    margin-block: 16px;
    padding: 24px 16px 16px;
}

.best-time-to-save__chart-head {
    display: grid;
    row-gap: 8px;
}

.best-time-to-save__chart-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.best-time-to-save__legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    color: var(--bts-muted);
}

.best-time-to-save__legend-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bts-accent);
}

.best-time-to-save__plot {
    min-width: 0;
}

.best-time-to-save__values,
.best-time-to-save__bars,
.best-time-to-save__months,
.best-time-to-save__discounts {
    display: flex;
    gap: var(--bts-gap);
    padding-right: var(--bts-label-space);
    text-align: center;
}

.best-time-to-save__value,
.best-time-to-save__col,
.best-time-to-save__month,
.best-time-to-save__discount {
    flex: 1 1 0;
    min-width: 0;
}

.best-time-to-save__value {
    font-size: 12px;
    line-height: 1;
}

.best-time-to-save__bars-row {
    position: relative;
    height: var(--bts-height);
    margin-top: 6px;
}

.best-time-to-save__bars {
    height: 100%;
    align-items: flex-end;
}

.best-time-to-save__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.best-time-to-save__bar {
    width: 100%;
    max-width: var(--bts-bar-width);
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    background: var(--bts-bar);
    transition: background 0.3s ease, height 0.4s ease;
}

.best-time-to-save__col--current .best-time-to-save__bar {
    background: var(--bts-accent);
}

.best-time-to-save__avg {
    position: absolute;
    left: 0;
    right: var(--bts-label-space);
    z-index: 1;
    border-top: 1px dashed var(--bts-muted);
    pointer-events: none;
}

.best-time-to-save__avg-label {
    position: absolute;
    left: 100%;
    top: 0;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    background: var(--bts-avg-bg);
    white-space: nowrap;
}

.best-time-to-save__months {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--bts-muted);
}

.best-time-to-save__month--current {
    color: var(--bts-text);
    font-weight: 700;
}

.best-time-to-save__discounts {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--bts-accent);
}

.best-time-to-save__summary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    row-gap: 12px;
    font-size: 14px;
    line-height: 1.2;
}

.best-time-to-save__summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.best-time-to-save__summary-icon {
    flex-shrink: 0;
    width: 1.25em;
    text-align: center;
}

@media (max-width: 990.98px) {
    .best-time-to-save {
        --bts-gap: 4px;
        --bts-height: 120px;
        --bts-bar-width: 5vw;
        --bts-label-space: 0px;
    }

    .best-time-to-save__chart {
        padding: 16px 12px 12px;
    }

    .best-time-to-save__bars-row {
        margin-bottom: 24px;
    }

    .best-time-to-save__avg-label {
        left: 50%;
        top: 100%;
        margin-left: 0;
        transform: translate(-50%, 4px);
        font-size: 11px;
    }

    .best-time-to-save__value {
        font-size: 11px;
    }

    .best-time-to-save__months,
    .best-time-to-save__discounts {
        font-size: 10px;
    }
}

@media (max-width: 500px) {
    .best-time-to-save {
        --bts-bar-width: 4vw;
        --bts-gap: 0;
    }

    .best-time-to-save__plot {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-block-end: 24px;
    }

    .best-time-to-save__avg-label {
        top: 125px;
        right: 0;
        left: 0;
        transform: none;
        text-align: center;
        padding: 0 12px;
        line-height: 1.5;
    }

    .best-time-to-save__months,
    .best-time-to-save__discounts {
        font-size: 2.6vw;
    }
}
