html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* スクロールバーを隠す */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}
#app-container {
  display: flex;
  height: 100%;
  width: 100%;
}
#controls {
  width: 300px;
  padding: 15px;
  background-color: #f4f7f6;
  border-right: 1px solid #ccc;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0; /* パネルが縮まないように */
}
#cy {
  flex-grow: 1;
  height: 100%;
}
h2 {
  margin-top: 0;
  font-size: 1.2em;
}
button {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 1em;
  cursor: pointer;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  transition: background-color 0.2s;
}
button:hover {
  background-color: #0056b3;
}
button.secondary {
  background-color: #6c757d;
}
button.secondary:hover {
  background-color: #5a6268;
}
#info,
#results {
  background-color: #e9ecef;
  padding: 10px;
  border-radius: 5px;
  margin-top: 15px;
  font-size: 0.9em;
}
#results {
  flex-shrink: 0;
}
#results table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #fff;
}
#results th,
#results td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: center;
}
#modeStatus {
  color: #d9534f;
  font-weight: bold;
}

/* ▼▼▼ モバイル向けレイアウト (メディアクエリ) を追加 ▼▼▼ */
@media (max-width: 768px) {
  #app-container {
    /* 横並びから縦積みに変更 */
    flex-direction: column;
  }
  #controls {
    width: 100%; /* 横幅を画面いっぱいに */
    height: 45%; /* 操作パネルの高さを画面の45%に */
    border-right: none; /* 右の境界線を削除 */
    border-bottom: 2px solid #ccc; /* 下に境界線を追加 */
    box-sizing: border-box; /* paddingを含めてサイズ計算 */
  }
  #cy {
    height: 55%; /* グラフの高さを画面の55%に */
  }
  h2 {
    font-size: 1.1em;
    margin-bottom: 8px;
  }
  button {
    padding: 8px;
    font-size: 0.9em;
  }
  #info,
  #results {
    margin-top: 10px;
    padding: 8px;
  }
}
