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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 0 2rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f5f5f5;
    text-align: center;
    margin: 0 -2rem 2rem;
    padding: 1rem 2rem 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

header h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
}

.subtitle a {
    color: #1a1a2e;
    text-decoration: underline;
}

.subtitle a:hover {
    color: #1f77b4;
}

.paper-banner {
    background: #eef3fb;
    border-left: 3px solid #1a1a2e;
    padding: 0.6rem 2rem;
    font-size: 0.9rem;
    color: #333;
    margin: 0 -2rem 1.5rem;
}

.paper-banner a {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 600;
}

.paper-banner a:hover {
    text-decoration: underline;
}

.chart-explainer {
    font-size: 0.92rem;
    color: #444;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.chart-explainer a {
    color: #5b9bd5;
    text-decoration: none;
}

.chart-explainer a:hover {
    text-decoration: underline;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-chart {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.card-chart-wide {
    max-width: none;
}

.card h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
    text-align: center;
}

.note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #000;
    text-align: left;
}

.note a {
    color: #5b9bd5;
    text-decoration: none;
}

.note a:hover {
    text-decoration: underline;
}

.empty-note {
    font-style: italic;
    color: #999;
}

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

thead th {
    background: #1a1a2e;
    color: #fff;
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-weight: 600;
}

tbody td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

tbody tr:hover {
    background: #f0f4ff;
}

footer {
    background: #1a1a2e;
    color: #ccc;
    margin-top: 3rem;
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 2.5rem 2rem;
}

.footer-inner {
    max-width: none;
    margin: 0 auto;
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.footer-col {
    flex: 1;
}

.footer-col h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.6rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-col p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #aaa;
    margin: 0 0 0.4rem 0;
}

footer a {
    color: #7ab3e0;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.chart-with-selector {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.chart-with-selector #wealth-chart,
.chart-with-selector #count-chart {
    flex: 1 1 0;
    min-width: 0;
    height: 600px;
}

#count-chart {
    height: 500px;
}

.series-selector {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.5rem;
    width: 310px;
    min-width: 310px;
    flex-shrink: 0;
}

.selector-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.series-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.88rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #999;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    user-select: none;
}

.series-item input[type="checkbox"] {
    accent-color: #1a1a2e;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.series-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.25;
    transition: opacity 0.15s;
}

.series-item.active {
    color: #1a1a2e;
    border-color: #aaa;
}

.series-item.active .series-dot {
    opacity: 1;
}

.series-item:hover {
    border-color: #1a1a2e;
}

.latest-box {
    margin-top: 1.25rem;
    padding: 0.85rem 0.9rem;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.83rem;
    color: #333;
    line-height: 1.6;
}

.latest-date {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.latest-row {
    margin: 0 0 0.35rem 0;
}

.latest-row:last-child {
    margin-bottom: 0;
}

.download-btn {
    display: block;
    margin-top: 0.85rem;
    padding: 0.55rem 0.9rem;
    background: #1a1a2e;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    letter-spacing: 0.02em;
    transition: background 0.15s;
}

.download-btn:hover {
    background: #2e2e50;
}

.movers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

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