:root {
    --bg: #2d1b34;
    --card: #382c3e;
    --text: #e8eef4;
    --muted: #ffffff;
    --border: #2d1b34;
}

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

body {
    font-family: monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 24px 16px 48px;
    min-height: 100vh;
    transition: background 0.6s ease;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
}

header {
    margin-bottom: 24px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
}

.sub {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

.hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    margin-bottom: 20px;
    transition: background 0.6s ease, border-color 0.6s ease;
}

.aqi-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
}

.aqi-category {
    font-size: 20px;
    font-weight: 600;
    margin-top: 8px;
}

.aqi-verdict {
    color: var(--muted);
    font-size: 15px;
    margin-top: 10px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.aqi-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
}
.aqi-category {
    font-size: 20px;
    font-weight: 600;
    margin-top: 8px;
    color: var(--accent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.cell {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.cell-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cell-value {
    font-size: 22px;
    font-weight: 600;
    margin-top: 4px;
}

.cell-unit {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chart-hint {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 260px;
}

footer {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.7;
}

footer a {
    color: var(--muted);
}

.loading, .error {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

.error {
    color: #f0999a;
}