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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#header {
    text-align: center;
    padding: 30px 0 20px;
}

#header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

#header p {
    font-size: 1rem;
    color: #888;
    margin-top: 8px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#controls {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    justify-content: center;
    padding: 16px 0;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#variable-toggle {
    display: flex;
    gap: 4px;
    background: #1e2130;
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #3a86ff;
    color: white;
    font-weight: 600;
}

#year-slider {
    width: 300px;
    accent-color: #3a86ff;
}

#year-display {
    color: #3a86ff;
    font-weight: 700;
}

#year-input {
    background: #1e2130;
    color: #3a86ff;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    width: 70px;
}

#year-input:hover, #year-input:focus {
    border-color: #3a86ff;
}

#month-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    max-width: 420px;
}

.month-btn {
    padding: 6px 10px;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 48px;
}

.month-btn:hover {
    border-color: #3a86ff;
    color: #e0e0e0;
}

.month-btn.active {
    background: #3a86ff;
    border-color: #3a86ff;
    color: white;
}

#ssp-select {
    background: #1e2130;
    color: #e0e0e0;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

#ssp-select:hover {
    border-color: #3a86ff;
}

#reset-bar {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

#reset-bar.hidden {
    display: none;
}

#reset-btn {
    padding: 8px 20px;
    background: transparent;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

#reset-btn:hover {
    background: #ff6b6b;
    color: white;
}

#map-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 10px 0;
    position: relative;
}

#map {
    width: 100%;
    max-width: 1100px;
    height: 600px;
}

#mode-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1e2130;
    border: 1px solid #3a86ff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #3a86ff;
    font-weight: 600;
    display: none;
    z-index: 10;
}

#legend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 10px 0;
}

#legend-label {
    font-size: 0.85rem;
    color: #888;
}

#legend-svg {
    width: 320px;
    height: 44px;
}

#legend-note {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    margin-top: 4px;
    text-align: center;
}

#writeup {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

#writeup h2 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 12px;
}

#writeup p {
    font-size: 0.95rem;
    color: #888;
    line-height: 1.7;
    margin-bottom: 16px;
}

#sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e2130;
    border: 1px solid #2a2d3e;
    border-radius: 12px;
    padding: 24px;
    width: 260px;
    z-index: 100;
}

#sidebar.hidden {
    display: none;
}

#sidebar h2 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 16px;
}

#state-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

#focus-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: transparent;
    color: #e0e0e0;
    border: 1px solid #3a86ff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

#focus-btn:hover {
    background: #3a86ff;
    color: white;
}

#compare-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: transparent;
    color: #e0e0e0;
    border: 1px solid #3a86ff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

#compare-btn:hover {
    background: #3a86ff;
    color: white;
}

#close-sidebar {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
}

#close-sidebar:hover {
    color: #fff;
}

.state-path {
    stroke: #000;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.state-path:hover {
    opacity: 0.8;
    stroke-width: 1.5px;
}

#compare-panel {
    max-width: 900px;
    margin: 20px auto;
    padding: 24px;
    background: #1e2130;
    border: 1px solid #2a2d3e;
    border-radius: 12px;
}

.compare-header {
    text-align: center;
    margin-bottom: 24px;
}

.compare-header h2 {
    font-size: 1.4rem;
    color: #fff;
}

.compare-scenario {
    color: #3a86ff;
    font-size: 0.9rem;
    margin-top: 4px;
}

.compare-grid {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
}

.compare-state {
    flex: 1;
    background: #0f1117;
    border-radius: 10px;
    padding: 20px;
}

.compare-state h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 16px;
    text-align: center;
}

.compare-divider {
    font-size: 1.2rem;
    font-weight: 700;
    color: #3a86ff;
    flex-shrink: 0;
}

.compare-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

#scrolly {
    position: relative;
    background: #0f1117;
}

#scrolly-overlay {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

#scrolly-steps {
    position: relative;
    z-index: 0;
}

.scrolly-trigger {
    height: 100vh;
    width: 100%;
}

.scrolly-step {
    position: absolute;
    text-align: center;
    max-width: 700px;
    padding: 0 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}

.scrolly-step.active {
    opacity: 1;
    transform: translateY(0);
}

.scrolly-step p {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 16px;
}

.scrolly-step .scrolly-sub {
    font-size: 1.1rem;
    font-weight: 400;
    color: #888;
    line-height: 1.6;
}

html {
    scroll-behavior: auto;
}

#takeaway {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 40px;
    background: #1e2130;
    border: 1px solid #2a2d3e;
    border-radius: 16px;
    border-left: 4px solid #3a86ff;
}

#takeaway h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 20px;
}

#takeaway p {
    font-size: 1rem;
    color: #888;
    line-height: 1.8;
    margin-bottom: 16px;
}

.takeaway-highlight {
    font-size: 1.1rem !important;
    color: #e0e0e0 !important;
    font-weight: 600;
    font-style: italic;
    border-top: 1px solid #2a2d3e;
    padding-top: 16px;
    margin-top: 8px;
}