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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #eef1f5;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  gap: 24px;
}

header {
  text-align: center;
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a237e;
}

header p {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
}

.page-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1565c0;
  text-decoration: none;
}

.page-link:hover { text-decoration: underline; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.controls {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.range-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #555;
}

.range-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-controls input {
  /* Fixed size so swapping between type="date" and type="month" doesn't reflow the toolbar */
  width: 10.5rem;
  height: 2.25rem;
  background: #fff;
  border: 1px solid #dde2ea;
  border-radius: 8px;
  color: #1a1a2e;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  color-scheme: light;
}

.range-controls input:focus {
  outline: none;
  border-color: #1565c0;
}

.range-sep {
  color: #aaa;
}

.controls button {
  background: none;
  border: none;
  color: #555;
  padding: 8px 28px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.controls button.active {
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: #fff;
}

.controls button:not(.active):hover {
  background: #eef1f5;
  color: #1565c0;
}

.charts {
  width: 100%;
  max-width: 1060px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.chart-card h2 {
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 16px;
}

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

footer {
  font-size: 0.78rem;
  color: #999;
}

footer a {
  color: #1565c0;
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

#status {
  font-size: 0.85rem;
  color: #666;
}

#status.error {
  color: #e53935;
}
