html {
    background-color: #f5f7fa;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.site-nav {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem 0;
}

.nav-link {
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: #555;
    background: rgba(0,0,0,0.04);
}

.nav-link.active {
    color: #333;
    font-weight: 600;
    background: rgba(0,0,0,0.06);
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
}

.site-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: #222;
    margin: 1.5rem 1rem 0.1rem;
}

.subtitle {
    font-size: 1rem;
    text-align: center;
    color: #666;
    margin: 0 0 0.15rem;
}

.timestamp {
    font-size: 0.85rem;
    text-align: center;
    color: #aaa;
    margin: 0 0 1rem;
}

.metric-pills {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem 0.75rem;
    flex-wrap: wrap;
}

.metric-pill {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.metric-pill:hover {
    border-color: #bbb;
    color: #444;
}

.metric-pill.active {
    background: #2980b9;
    border-color: #2980b9;
    color: #fff;
}

.chart-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 55vh;
    min-height: 320px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.legend-strip {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #555;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.projected { background: #2980b9; }
.legend-dot.historical { background: #bbb; }

.info-strip {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: #555;
}

.tier-guide {
    max-width: 500px;
    margin: 0.5rem auto 1.5rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.tier-guide h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem;
}

.tier-row {
    font-size: 0.9rem;
    color: #555;
    margin: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-badge {
    display: inline-block;
    width: 50px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    color: #fff;
    flex-shrink: 0;
}

.tier-badge.excellent { background: #27ae60; }
.tier-badge.good { background: #d4ac0d; }
.tier-badge.fair { background: #e67e22; }
.tier-badge.poor { background: #e74c3c; }
.tier-badge.unsafe { background: #8e44ad; }

.footnote {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #aaa;
}

.footnote a {
    color: #888;
}

/* Detail panel */

.detail-panel {
    display: none;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.detail-panel.open {
    display: block;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.detail-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.detail-close {
    font-size: 1.4rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}

.detail-close:hover {
    color: #666;
}

.detail-score-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.detail-score-badge {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.detail-score-label {
    font-size: 0.95rem;
    color: #888;
}

.detail-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-bar-label {
    width: 75px;
    font-size: 0.8rem;
    color: #777;
    text-align: right;
    flex-shrink: 0;
}

.detail-bar-track {
    flex: 1;
    height: 14px;
    background: #f0f0f0;
    border-radius: 7px;
    overflow: hidden;
}

.detail-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.3s ease;
}

.detail-bar-value {
    width: 32px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.detail-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.detail-condition {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.detail-condition-label {
    color: #999;
}

.detail-condition-value {
    font-weight: 600;
    color: #555;
}

@media (max-width: 600px) {
    .site-title { font-size: 1.35rem; }
    .chart-container {
        height: 45vh;
        min-height: 280px;
    }
    .tier-guide { margin: 0.5rem 0.75rem 1.5rem; }
    .detail-panel { margin: 0 0.75rem 1.5rem; }
}
