* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
}

.topbar {
  padding: 24px 16px 16px;
  text-align: center;
  background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
  border-bottom: 1px solid #30363d;
}

.topbar h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.topbar .sub { margin: 4px 0 0; font-size: 0.85rem; color: #8b949e; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  color: #ffd33d;
}

.stat .label { font-size: 0.8rem; color: #8b949e; }

.map-section {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.map-wrap {
  flex: 1 1 540px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
}

#map { width: 100%; height: auto; display: block; }

#map .tile {
  cursor: pointer;
  stroke: #0d1117;
  stroke-width: 2;
  transition: opacity 0.1s;
}

#map .tile:hover { opacity: 0.75; stroke: #fff; }

#map .tile-label {
  font-size: 13px;
  fill: #0d1117;
  pointer-events: none;
  text-anchor: middle;
  font-weight: 600;
}

#map .tile-wage {
  font-size: 11px;
  fill: rgba(13, 17, 23, 0.75);
  pointer-events: none;
  text-anchor: middle;
  font-family: ui-monospace, monospace;
}

.side {
  flex: 0 1 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
}

.legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.legend .swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend .range { font-family: ui-monospace, monospace; }

.detail {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px;
  min-height: 120px;
  font-size: 0.9rem;
}

.detail h3 { margin: 0 0 4px; font-size: 1.1rem; }
.detail .wage-big {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  color: #ffd33d;
}

.dim { color: #8b949e; font-size: 0.85rem; }

.chart-section, .table-section, .about {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.chart-section h2, .table-section h2, .about h2 { margin-top: 0; font-size: 1.05rem; }

#chart { width: 100%; height: auto; }

#chart .axis { stroke: #30363d; stroke-width: 1; }
#chart .axis-label { fill: #8b949e; font-size: 11px; font-family: ui-monospace, monospace; }
#chart .grid-line { stroke: #1c2331; stroke-width: 1; }

#chart .line-avg { stroke: #ffd33d; stroke-width: 2.5; fill: none; }
#chart .line-tokyo { stroke: #58a6ff; stroke-width: 2; fill: none; }
#chart .line-lowest { stroke: #ff7b72; stroke-width: 2; fill: none; }

#chart .dot { fill: #ffd33d; }

.chart-legend {
  display: flex;
  gap: 18px;
  font-size: 0.85rem;
  margin-top: 8px;
  flex-wrap: wrap;
}

.chart-legend span { display: flex; align-items: center; gap: 6px; }

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

.line-swatch.tokyo { background: #58a6ff; }
.line-swatch.avg { background: #ffd33d; }
.line-swatch.lowest { background: #ff7b72; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

thead th {
  text-align: left;
  padding: 6px 8px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
}

tbody td { padding: 5px 8px; border-bottom: 1px solid #1c2331; }
tbody tr:hover td { background: #1c2331; }

.wage-cell { font-family: ui-monospace, monospace; color: #ffd33d; text-align: right; }

.bar-cell { width: 40%; }

.bar {
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1f6feb, #58a6ff);
}

.about p { font-size: 0.9rem; }
.about a { color: #58a6ff; }

footer {
  border-top: 1px solid #30363d;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #8b949e;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 980px;
  margin: 24px auto 0;
}

footer a { color: #58a6ff; }
