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

body {
    background: aliceblue;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    padding: 10px;
}

.container {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.toggle-btn {
    padding: 6px 14px;
    border: 2px solid #999;
    border-radius: 6px;
    background: #e0e0e0;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active[data-index="0"] {
    background: #388E3C;
    color: #fff;
    border-color: #2E7D32;
}

.toggle-btn.active[data-index="1"] {
    background: #E53935;
    color: #fff;
    border-color: #C62828;
}

.toggle-btn.active[data-index="2"] {
    background: #FF7043;
    color: #fff;
    border-color: #E64A19;
}

.gap-btn {
    background: #3F51B5;
    color: #fff;
    border-color: #303F9F;
}

.gap-btn.active {
    background: #303F9F !important;
    color: #fff !important;
    border-color: #1A237E !important;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 600px) {
    h2 {
        font-size: 1rem;
    }
    .toggle-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    .chart-wrapper {
        height: 400px;
    }
}
