* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: #e8e8ea;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #222;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #fff;
  border: 1px solid #d0d0d5;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 auto 8px;
  max-width: 900px;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbar-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.toolbar-group input,
.toolbar-group select {
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
}

.toolbar-group input {
  width: 260px;
}

button {
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #f2f2f2;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #e6e6e6;
}

button.primary {
  background: #2f7d3f;
  border-color: #256432;
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  max-width: 900px;
  margin: 0 auto 16px;
  font-size: 12px;
  color: #555;
  text-align: center;
}

.graph-card {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #999;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
}

.graph-title {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  padding: 10px 8px 4px;
}

.graph-body {
  position: relative;
  padding: 4px 12px 0;
  background: #ffffff;
}

.graph-body canvas {
  width: 100% !important;
  height: 340px !important;
}

.watermark {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: right center;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #999;
  white-space: nowrap;
}

.graph-range {
  text-align: center;
  font-size: 11px;
  color: #333;
  padding: 2px 0 10px;
}

.graph-legend {
  border-top: 1px solid #ddd;
  padding: 8px 16px 14px;
  font-size: 11px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0;
  white-space: nowrap;
}

.legend-row b {
  font-weight: bold;
}

.legend-label {
  width: 60px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.swatch.in {
  background: #a9d18e;
  border: 1px solid #548235;
}

.swatch.out {
  background: #8fcaca;
  border: 1px solid #31859b;
}
