:root {
  --surface: #1a1a19;
  --panel: #232322;
  --border: #3a3a38;
  --ink: #e8e6e3;
  --ink-muted: #9b9894;
  --up: #ed5565;
  --down: #4a8fe0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 14px;
}

header {
  padding: 14px 20px 6px;
}

h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

h1 .sub {
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-muted);
  margin-left: 8px;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}

#controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 13px;
}

#controls select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  max-width: 260px;
}

#status {
  color: var(--ink-muted);
  font-size: 12px;
}

#chart-wrap {
  position: relative;
  margin: 4px 20px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

#chart {
  width: 100%;
  height: 480px;
}

#legend {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 10;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  pointer-events: none;
  text-shadow: 0 0 4px var(--surface);
}

#legend .name { font-weight: 650; }
#legend .dim { color: var(--ink-muted); }

#info {
  padding: 0 20px 24px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  #chart { height: 360px; }
  #controls select { max-width: 160px; }
}
