
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 28px 24px;
    background: #f2f5f3;
    color: #24352f;
    font-family: "Segoe UI", sans-serif;
}

main {
    width: 100%;
}


.data-entry {
    display: grid;
    gap: 10px;
}

.data-entry label {
    font-size: 14px;
    font-weight: 600;
}

textarea {
    width: 100%;
    min-height: 220px;
    padding: 12px;
    resize: vertical;
    border: 1px solid #cbd6cf;
    border-radius: 5px;
    background: #fff;
    color: #24352f;
    font: 13px/1.5 Consolas, monospace;
}

textarea:focus-visible,
button:focus-visible {
    outline: 3px solid #70b9a4;
    outline-offset: 2px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 40px;
}

button {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 4px;
    background: #176e59;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #105843;
}

#dataStatus {
    color: #52645b;
    font-size: 13px;
}

#dataStatus.error {
    color: #a32d36;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
    margin: 18px 0 10px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #52645b;
    font-size: 13px;
}

.legend-color {
    width: 28px;
    height: 24px;
    padding: 2px;
    border: 1px solid #cbd6cf;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.chart-scroll {
    position: relative;
    width: 100%;
    overflow-x: auto;
}

.chart-crosshair {
    position: absolute;
    z-index: 1;
    width: 0;
    border-left: 1px dashed #53685d;
    pointer-events: none;
}

.chart-tooltip {
    position: fixed;
    z-index: 10;
    max-width: min(280px, calc(100vw - 16px));
    padding: 10px 12px;
    border: 1px solid #cbd6cf;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 6px 20px rgb(36 53 47 / 16%);
    color: #24352f;
    font-size: 13px;
    pointer-events: none;
}

.chart-tooltip[hidden] {
    display: none;
}

.chart-tooltip-title {
    margin-bottom: 6px;
    font-weight: 700;
}

.chart-tooltip-row,
.chart-tooltip-label {
    display: flex;
    align-items: center;
}

.chart-tooltip-row {
    justify-content: space-between;
    gap: 18px;
    line-height: 1.6;
}

.chart-tooltip-label {
    gap: 6px;
}

.chart-tooltip-swatch {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
}


canvas {
    display: block;
    height: min(60vh, 680px);
    min-height: 360px;
    border: 1px solid #d7dfda;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 8px 24px rgb(36 53 47 / 8%);
}

.chart-scroll canvas {
    width: 100%;
    min-width: 0;
}

@media (max-width: 600px) {
    body {
        padding: 20px 14px;
    }

    .form-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}