#container {
    display: flex;
    height: 100vh;
}

#legend {
    width: 200px;
    min-width: 200px; /* ✅ 幅を固定 */
    height: 100%;
    padding: 10px;
    pointer-events: none;
    background: white;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    flex-shrink: 0; /* ✅ これで圧縮を防ぐ */
}

#chart {
    flex-grow: 1;
    min-width: 300px; /* ✅ これで `#legend` の幅が確保される */
    background: #f4f4f4;
    height: 100%;
}

.legend-background {
    fill: rgba(255, 255, 255, 0.4); /* 半透明の白色 */
    /* stroke: #ccc; /* 枠線を薄いグレーに */ */
    stroke-width: 1;
    rx: 10; /* 角を丸くする */
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f9f9f9, #e3f2fd); /* 優しいグレーとブルーのグラデーション */
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    font-size: 24px;
    color: #333;
    padding: 20px;
    margin-bottom: 30px;
}

/* ▼ グラフを覆わないようにするための安全設定 ▼ */
#chart {
  position: relative;
  z-index: 1;
}

svg {
  position: relative !important;
  z-index: 1;
}

/* ▼ 説明セクションが下にちゃんと出るように制御 ▼ */
#graph-description {
  position: relative;
  z-index: 0;
  background: #ffffff;
  margin: 2em auto;
  max-width: 900px;
  padding: 1em 2em;
  font-size: 0.95em;
  line-height: 1.6;
  border-top: 1px solid #ddd;
}

/* ▼ 凡例とグラフの下端を揃えるための追加CSS ▼ */
#container {
  display: flex;
  align-items: stretch;
}

#legend {
  padding-bottom: 0;
  margin-bottom: 0;
}

#chart {
  padding-bottom: 1em;
}