:root {
  color-scheme: light dark;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #111827;
  color: #f9fafb;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(59,130,246,0.35), transparent 55%),
              radial-gradient(circle at bottom, rgba(236,72,153,0.35), transparent 50%),
              #0f172a;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font-size: 2.5rem;
}

.hero p {
  margin: 0;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  text-align: left;
}

.field label {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(94, 234, 212, 0.8);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.25);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
                    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 4px),
                       calc(100% - 12px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

#refresh-button {
  padding: 11px 22px;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #9333ea);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  height: 44px;
}

#refresh-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
}

#refresh-button:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.status {
  font-size: 0.95rem;
  opacity: 0.85;
}

.status.error {
  color: #f87171;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.chart-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-card h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.chart-inner {
  position: relative;
  height: 280px;
}

.details {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  line-height: 1.5;
}

.stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin: 0;
}

.stats div {
  display: grid;
  gap: 4px;
}

.stats dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.stats dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.note {
  margin: 0;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.75);
}

.footer a {
  color: rgba(94, 234, 212, 0.9);
  text-decoration: none;
}

.footer a:hover,
.footer a:focus {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }

  .details {
    padding: 16px;
  }
}

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

@media (min-width: 1200px) {
  .chart-inner {
    height: 360px;
  }
}
