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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  line-height: 1.6;
  padding-bottom: 3rem;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  border-bottom: 1px solid #2a2d35;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.4rem;
}

header .subtitle {
  font-size: 0.95rem;
  color: #888;
  max-width: 600px;
  margin: 0 auto;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Summary panel */
.summary-panel {
  background: #1a1d27;
  border: 1px solid #2a2d35;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.summary-panel h2 {
  font-size: 1.1rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.summary-item {
  background: #22252f;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.summary-value.positive {
  color: #4caf50;
}

.summary-value.negative {
  color: #f44336;
}

.summary-value.neutral {
  color: #ff9800;
}

/* Chart sections */
.chart-section {
  margin-bottom: 2.5rem;
}

.chart-explanation {
  margin-bottom: 0.75rem;
}

.chart-explanation h2 {
  font-size: 1.15rem;
  color: #ddd;
  margin-bottom: 0.3rem;
}

.chart-explanation p {
  font-size: 0.85rem;
  color: #888;
  max-width: 700px;
}

.chart {
  width: 100%;
  height: 420px;
  background: #1a1d27;
  border-radius: 10px;
  border: 1px solid #2a2d35;
}

/* dat.gui overrides for dark theme consistency */
.dg.ac {
  z-index: 100;
}

.dg .cr.number input[type=text] {
  color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
  header h1 {
    font-size: 1.3rem;
  }

  .chart {
    height: 320px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Move dat.gui to a less obstructive position on mobile */
  .dg.ac {
    top: auto !important;
    bottom: 0;
  }
}
