* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #fff;
    padding: 10px;
}

.form-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
}

.form-label {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    color: #676;
    font-weight: normal;
}

select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #aaa;
    border-radius: 3px;
    font-size: 13px;
    background-color: white;
    color: #333;
    cursor: pointer;
    height: 32px;
}

select:focus {
    outline: none;
    border-color: #888;
}

select:disabled {
    background-color: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

.main-content {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.summary-container {
    flex: 0 0 26%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: none;
    align-self: flex-start;
}

.summary-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.summary-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.summary-label {
    font-size: 11px;
    color: #677;
    min-width: 80px;
}

.summary-value {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    flex-grow: 1;
}

.summary-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.summary-time {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

.summary-code {
    font-size: 11px;
    color: #888; /* 3498db;
    font-weight: bold;
    background-color: #e8f4fc;
    padding: 3px 8px;
    border-radius: 3px; */
    font-style: italic;
}

.charts-section {
    flex: 0 0 72%;
}

.charts-container {
    display: none;
}

.chart-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.chart-box {
    padding-left: 12px;
    padding-right: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-wrapper {
    width: 100%;
    height: 92px;
    position: relative;
    display: flex;
    align-items: center;
/*    background-color: rgba(255, 255, 255, 0.7);  Полупрозрачный белый */
}

.chart-label {
    font-size: 11px;
    color: #2c3e50;
    font-weight: bold;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 5px 0;
    margin-right: 10px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.chart-canvas-container {
    flex: 1;
    height: 100%;
    position: relative;
/*    background-color: whitesmoke; /* Очень светлый фон */
/*    border-radius: 3px; /* Легкое скругление углов */
}

.time-scale-container {
    padding-left: 54px;
    padding-right: 2px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 0 0 5px 5px;
    margin-top: -1px;
}

.time-scale {
    display: flex;
    justify-content: space-between;
    position: relative;
    height: 20px;
}

.time-tick {
    flex: 1;
    text-align: left;
    position: relative;
    font-size: 10px;
    color: #677;
    padding-left: 2px;
}

.time-tick:first-child {
    padding-left: 0;
}

.time-tick:last-child {
    text-align: right;
    padding-right: 2px;
}

.time-tick::before {
    content: '';
    position: absolute;
    left: 0;
    top: -22px;
    height: 20px;
    width: 1px;
    background-color: rgba(0,0,0,0.1);
}

#global-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    max-width: 280px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

#global-tooltip .time {
    font-weight: bold;
    margin-bottom: 8px;
    color: #4bc0c0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 4px;
}

#global-tooltip .data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

#global-tooltip .label {
    color: #ccc;
}

#global-tooltip .value {
    font-weight: bold;
    color: white;
}

.section-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
}

.chart-area {
    position: relative;
    cursor: pointer;
}

.x-axis-label {
    text-align: center;
    font-size: 11px;
    color: #676;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

.vertical-line {
    position: fixed;
    top: 0;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 100;
    display: none;
}

.warning-title {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .summary-container,
    .charts-section {
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-group {
        width: 100%;
    }
    
    .chart-label {
        font-size: 9px;
        width: 15px;
        margin-right: 5px;
    }
    
    .time-tick {
        font-size: 8px;
    }
    
    .summary-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .summary-item {
        width: 100%;
    }
    
    .summary-footer {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .chart-row {
        gap: 6px;
    }
    
    .chart-box {
        padding: 8px;
    }
    
    .time-scale-container {
        padding-left: 27px;
        padding-right: 8px;
    }
}