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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #555;
    max-width: 700px;
    margin: 0 auto;
    font-size: 0.95rem;
}

.subtitle a {
    color: #2563eb;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.age-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.age-filter label {
    color: #555;
    font-weight: 500;
}

.age-filter select {
    padding: 0.35rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
    transition: color 0.2s;
}

.toggle-label.active {
    color: #1a1a1a;
    font-weight: 700;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #2563eb;
    border-radius: 26px;
    transition: background 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .slider {
    background: #dc2626;
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(22px);
}

/* Panels */
.panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.section-note {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.5rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

th:first-child, td:first-child {
    text-align: left;
    font-weight: 500;
}

td.negative {
    color: #dc2626;
}

td.positive {
    color: #16a34a;
}

tr:hover td {
    background: #f0f7ff;
}

/* Charts */
.chart-wrapper {
    position: relative;
    height: 400px;
    margin-top: 1rem;
}

/* Footer */
footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
}

footer p + p {
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    h1 {
        font-size: 1.4rem;
    }
    .chart-wrapper {
        height: 300px;
    }
}
