* {
    box-sizing: border-box;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem;
    background: #26272d;
    border: 1px solid #33343a;
    border-radius: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

input, select, button {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #44454d;
    background: #1e1f24;
    color: #e6e6e6;
}

button {
    cursor: pointer;
    background: #1f6f43;
    border-color: #1f6f43;
    color: #d6ffe9;
    font-weight: 600;
}

button:hover {
    background: #248150;
}

button.secondary {
    background: #3a3b42;
    border-color: #44454d;
    color: #ccc;
}

/* Chart.js measures a canvas against its immediate parent, so that parent
   exists purely to be measured: no padding of its own, a definite height,
   and the canvas as its only child. */
.chart-canvas {
    position: relative;
    height: 18rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.mode-ON {
    color: #7ee0a3;
    font-weight: 600;
}

.mode-OFF {
    color: #ffcfae;
    font-weight: 600;
}

.mode-MIXED {
    color: #9a9aa5;
    font-weight: 600;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.events {
    max-height: 12rem;
    overflow-y: auto;
}

@media (max-width: 1000px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
