.monitor-card {
    margin-top: 18px;
    padding: 22px;

    background: #ffffff;
    border: 1px solid #dce2e5;
    border-radius: 15px;
    box-shadow: 0 3px 14px rgba(24, 38, 47, 0.06);
}

.monitor-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.monitor-section-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.monitor-section-note {
    margin: 5px 0 0;
    color: #68727c;
    font-size: 14px;
    line-height: 1.4;
}

.period-switch {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px;

    background: #edf1f3;
    border-radius: 10px;
}

.period-button {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;

    color: #53606a;
    background: transparent;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.period-button:hover {
    background: rgba(255, 255, 255, 0.65);
}

.period-button.active {
    color: #20252b;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(24, 38, 47, 0.12);
}

.timeline-frame,
.speed-chart-frame {
    padding: 13px;

    background: #f6f8f9;
    border: 1px solid #e2e7e9;
    border-radius: 11px;
}

.timeline-bars {
    display: grid;
    align-items: stretch;

    width: 100%;
    height: 58px;
    overflow: hidden;

    background: #e2e6e8;
    border-radius: 8px;
}

.timeline-bar {
    min-width: 0;
    height: 100%;
}

.timeline-bar.state-ok {
    background: #397cb3;
}

.timeline-bar.state-slow {
    background: #d4a629;
}

.timeline-bar.state-down {
    background: #b64747;
}

.timeline-bar.state-no_data {
    background: transparent;
}

.monitor-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 13px;

    color: #68727c;
    font-size: 13px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-mark {
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.legend-mark.state-ok {
    background: #397cb3;
}

.legend-mark.state-slow {
    background: #d4a629;
}

.legend-mark.state-down {
    background: #b64747;
}

.legend-mark.state-no_data {
    background: #aab3b9;
}

.legend-line {
    width: 22px;
    height: 3px;
    border-radius: 3px;
}

.legend-line.homepage {
    background: #d64f8b;
}

.legend-line.search {
    background: #e28a2e;
}

.speed-chart-wrap {
    position: relative;
    width: 100%;
    height: 270px;
}

#speed-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-message {
    padding: 24px;
    color: #68727c;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 700px) {
    .monitor-card {
        padding: 17px;
    }

    .monitor-section-head {
        flex-direction: column;
        gap: 13px;
    }

    .period-switch {
        width: 100%;
    }

    .period-button {
        flex: 1 1 0;
        padding-right: 7px;
        padding-left: 7px;
    }

    .timeline-bars {
        height: 50px;
    }

    .speed-chart-wrap {
        height: 235px;
    }
}

.timeline-axis {
    position: relative;
    height: 25px;
    margin-top: 9px;
    color: #74808a;
    font-size: 12px;
    line-height: 1.2;
}

.timeline-axis-label {
    position: absolute;
    top: 0;
    white-space: nowrap;
    transform: translateX(-50%);
}

.timeline-axis-label.first {
    transform: none;
}

.timeline-axis-label.last {
    transform: translateX(-100%);
}

@media (max-width: 620px) {
    .timeline-axis {
        font-size: 11px;
    }
}
