:root {
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #fff7ed;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #fed7aa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: white;
  padding: 40px 24px;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.site-header p {
  margin: 0;
  opacity: 0.95;
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

.control-panel,
.summary-card,
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font: inherit;
  background: white;
}

.summary-card h2,
.chart-card h2 {
  margin-top: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.summary-grid div {
  background: #fff7ed;
  border-radius: 14px;
  padding: 16px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

strong {
  font-size: 22px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 280px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 40px 12px 12px;
  overflow-x: auto;
  overflow-y: visible;
}

.bar {
  min-width: 10px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  position: relative;
}

.bar:hover {
  background: var(--accent-dark);
}

.bar span {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
}

.bar:hover span {
  display: block;
}

@media (max-width: 800px) {
  .control-panel,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .site-header h1 {
    font-size: 24px;
  }
}

.chart-card {
  overflow: visible;
}

.bar-chart {
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 40px;
}

.bar {
  z-index: 1;
}

.bar:hover {
  z-index: 10;
}

.bar span {
  z-index: 999;
}