/* Base */
html {
    background-color: #f5f7fa;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
}

/* Site nav */
.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);
}

/* Site title */
.site-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: #222;
    margin: 1.25rem 1rem 0.15rem;
}

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

/* Comfort score hero */
.comfort-hero {
    text-align: center;
    padding: 0.75rem 1rem 0.5rem;
}

.comfort-score-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 7px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    transition: border-color 0.3s;
}

.comfort-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: #222;
}

.comfort-label {
    font-size: 1.35rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.1rem;
}

.comfort-explanation {
    font-size: 1rem;
    color: #777;
    margin-bottom: 0.1rem;
    padding: 0 1rem;
}

.comfort-override {
    font-size: 1rem;
    color: #c0392b;
    font-weight: 500;
    padding: 0 1rem;
}

/* Ring colors */
.comfort-score-ring.excellent { border-color: #27ae60; }
.comfort-score-ring.good { border-color: #f1c40f; }
.comfort-score-ring.fair { border-color: #e67e22; }
.comfort-score-ring.poor { border-color: #e74c3c; }
.comfort-score-ring.unsafe { border-color: #8e44ad; }

.comfort-score-ring:hover {
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.15);
}

.comfort-score-ring.ring-active {
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.3);
}

/* Conditions strip — pills as toggle buttons */
.conditions-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    margin: 0 auto 0.75rem;
}

.condition-pill {
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    color: #444;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.condition-pill:hover {
    background: #f0f4ff;
}

.condition-pill:active {
    transform: scale(0.96);
}

.condition-pill.active {
    background: #e8f0fe;
    border-color: #4a90d9 !important;
    color: #1a5fa8;
    font-weight: 600;
}

.condition-pill .pill-label {
    color: #888;
    margin-right: 0.2rem;
}

.condition-pill.active .pill-label {
    color: #5a8fc4;
}

/* Detail panel (chart shown when a pill is tapped) */
.detail-panel {
    display: none;
    max-width: 800px;
    margin: 0 auto 1rem;
    padding: 0 0.75rem;
}

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

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

.detail-staleness {
    font-size: 0.85rem;
    color: #b07040;
    text-align: center;
    margin: -0.3rem 0 0.4rem;
}

.detail-chart-wrap {
    width: 100%;
    height: 50vh;
    min-height: 280px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 0.75rem;
    box-sizing: border-box;
}

.detail-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Section titles */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem;
}

/* 7-day forecast */
.forecast-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0.75rem 2rem;
}

.forecast-cards {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.35rem;
}

.forecast-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 0.5rem 0.25rem;
    text-align: center;
    transition: transform 0.15s;
}

.forecast-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}

.forecast-day {
    font-size: 0.78rem;
    color: #888;
    font-weight: 500;
    line-height: 1.3;
}

.forecast-score {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.15rem 0;
}

.forecast-score.excellent { color: #27ae60; }
.forecast-score.good { color: #d4ac0d; }
.forecast-score.fair { color: #e67e22; }
.forecast-score.poor { color: #e74c3c; }
.forecast-score.unsafe { color: #8e44ad; }

.forecast-label-text {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
}

.forecast-temps {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.1rem;
}

.forecast-rationale {
    font-size: 0.65rem;
    color: #b07040;
    margin-top: 0.1rem;
    line-height: 1.2;
}

/* Mobile */
@media (max-width: 600px) {
    .site-title {
        font-size: 1.35rem;
        margin: 1rem 0.75rem 0.1rem;
    }
    .comfort-hero {
        padding: 0.5rem 0.75rem 0.25rem;
    }
    .comfort-score-ring {
        width: 100px;
        height: 100px;
        border-width: 6px;
    }
    .comfort-number {
        font-size: 2.3rem;
    }
    .comfort-label {
        font-size: 1.15rem;
    }
    .comfort-explanation,
    .comfort-override {
        font-size: 0.9rem;
    }
    .conditions-strip {
        gap: 0.35rem;
        padding: 0.4rem 0.5rem;
    }
    .condition-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    .forecast-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
    }
    .forecast-card {
        padding: 0.5rem 0.2rem;
    }
    .forecast-score {
        font-size: 1.3rem;
    }
    .forecast-day {
        font-size: 0.72rem;
    }
    .forecast-label-text {
        font-size: 0.65rem;
    }
    .forecast-temps {
        font-size: 0.65rem;
    }
    .forecast-rationale {
        font-size: 0.6rem;
    }
    .detail-chart-wrap {
        height: 40vh;
        min-height: 240px;
    }
    .section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 380px) {
    .forecast-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}
