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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
}

.controls {
  margin-bottom: 1rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-group button {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}

.btn-group button:hover {
  background: #e8e8e8;
}

.btn-group button.active {
  background: #1976D2;
  color: #fff;
  border-color: #1976D2;
}

.chart-wrapper {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  color: #666;
  z-index: 10;
  border-radius: 8px;
}

.loader.hidden {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
}

thead {
  background: #fafafa;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid #eee;
}

th:first-child, td:first-child {
  text-align: left;
}

th {
  font-weight: 600;
  color: #555;
}

tbody tr:last-child td {
  border-bottom: none;
}

.error-msg {
  color: #d32f2f;
  text-align: center;
  padding: 2rem;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.2rem;
  }

  table {
    font-size: 0.75rem;
  }

  th, td {
    padding: 0.4rem 0.5rem;
  }
}
