:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px 24px 24px;
  background: #ffffff;
  color: #222222;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.5;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 12px;
}

.title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 14px;
  color: #555555;
}

.city-select {
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #cccccc;
  border-radius: 6px;
  background: #ffffff;
  color: #222222;
}

.status {
  min-height: 1.4em;
  margin: 0 0 8px;
  font-size: 14px;
  color: #555555;
}

.status:empty {
  display: none;
  margin: 0;
}

#chart.chart {
  width: 100%;
  min-height: 520px;
  height: 70vh;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: #444444;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.chip-up {
  background: #e0393e;
}

.chip-down {
  background: #2b6cb0;
}

.chip-forecast {
  background: rgba(224, 57, 62, 0.35);
}

.attribution {
  margin-top: 12px;
  font-size: 12px;
  color: #777777;
}

.attribution a {
  color: #2b6cb0;
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls {
    width: 100%;
  }

  .city-select {
    flex: 1;
  }
}
