:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

body {
  margin: 0;
}

header,
main,
footer {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
}

header {
  padding: 24px 0;
}

header a,
footer a {
  color: #0369a1;
}

main {
  padding: 28px 0 48px;
}

h1 {
  margin-bottom: 8px;
}

.intro,
#weather-status,
footer {
  color: #475569;
}

#weather-status[data-state="error"] {
  color: #b91c1c;
}

#weather-status[data-state="warning"] {
  color: #92400e;
}

#weather-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

#temperature-summary-heading {
  margin: 32px 0 0;
  color: #0f172a;
  font-size: 1.2rem;
}

#monthly-weather-medians {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

#monthly-weather-medians table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: right;
}

#monthly-weather-medians caption {
  padding: 16px;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: left;
}

#monthly-weather-medians th,
#monthly-weather-medians td {
  padding: 11px 14px;
  border-top: 1px solid #e2e8f0;
  white-space: nowrap;
}

#monthly-weather-medians thead th {
  color: #334155;
  background: #f1f5f9;
  font-size: 0.9rem;
}

#monthly-weather-medians th:first-child {
  text-align: left;
}

#monthly-weather-medians tbody th {
  color: #334155;
}

#monthly-weather-medians tbody tr:nth-child(even) {
  background: #f8fafc;
}

.weather-stat {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.weather-stat h2 {
  margin: 0 0 12px;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
}

.weather-stat p {
  margin: 0;
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 700;
}

#weather-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 16px;
}

.chart-frame {
  min-width: 0;
  height: 340px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.chart-frame canvas {
  width: 100%;
  height: 100%;
}

footer {
  padding: 0 0 28px;
}

@media (max-width: 520px) {
  .chart-frame {
    height: 280px;
    padding: 8px;
  }
}
