body, html {
  font-family: 'Noto Sans JP', sans-serif; /* モダンなフォント (必要に応じて変更) */
  background-color: #f4f4f4; /* 淡い背景色 */
  color: #333; /* テキストの基本色 */
  line-height: 1.6;
  margin: 20px;
}

h1, h2 {
  color: #555;
}

#timeline {
  /* height: 300px; */
  border: 1px solid #ddd;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  margin-bottom: 20px; /* forms-container との間に余白を追加 */
  margin-top: 20px;
  position: relative; /* デフォルトの static 以外に設定されている場合は念のため */
  z-index: 1; /* 必要に応じて重ね順を調整 */
}

.vis-item {
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease; /* ホバーエフェクト用トランジション */
}

.vis-item:hover {
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
}

.vis-item.ex {
  background-color: #ffb6c1; /* ピンク */
  color: #fff;
}

.vis-item.ns {
  background-color: #98fb98; /* 薄緑 */
  color: #fff;
}

.vis-item.ss {
  background-color: #ffa500; /* 橙色 */
  color: #fff;
}

.vis-axis {
  color: #777;
  font-size: 0.9em;
}

.vis-grid.horizontal {
  border-bottom: 1px solid #eee;
}

.forms-container {
  display: flex;
  gap: 20px; /* フォーム間の間隔 */
  position: relative;
  z-index: 1;
  margin: 20px 0; /* 上下の余白 */
}

#add-item-form, #edit-members-form {
  flex: 1; /* 親要素の残りのスペースを均等に分け合う */
  padding: 20px 20px 0 20px;
  border: 1px solid #ddd;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  margin-top: 0; /* 親要素でまとめて余白を取るので個々の margin-top は削除 */
  position: relative;
}

#edit-members-form {
  /* flex: 1; /* 親要素の残りのスペースを均等に分け合う (forms-container) */
  /* padding: 20px; */
  border: 1px solid #ddd;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  margin-top: 0;
}

#add-item-form h2, #edit-members-form h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

#add-item-form label, #edit-members-form label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: bold;
  font-size: 15px;
}

#add-item-form .horizontal-fields {
  display: flex; /* 水平方向に並べる */
  gap: 20px;    /* 要素間の間隔 */
  margin-bottom: 15px; /* 下部の余白 */
  align-items: center; /* 縦方向中央揃え (ラベルと入力欄) */
}

#add-item-form .horizontal-fields > div {
  flex: 1; /* 親要素のスペースを均等に分ける */
}

#add-item-form .horizontal-fields label {
  display: block; /* Flexboxの子要素内でラベルをブロック要素として扱う */
  margin-bottom: 5px; /* ラベルと入力欄の間隔 */
  color: #555;
  font-weight: bold;
  width: auto; /* ラベルの幅を自動調整 */
}

#add-item-form .horizontal-fields:nth-child(2) { /* 生徒とスキル種別のhorizontal-fields */
  display: flex;
  gap: 20px; /* メンバーと内容の間の間隔 */
  margin-bottom: 15px; /* 下部の余白 */
}

#add-item-form .horizontal-fields:nth-child(2) > div {
  flex: 1; /* 必要に応じて幅を調整 */
}

#add-item-form .horizontal-fields:nth-child(2) label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-weight: bold;
}

#add-item-form .horizontal-fields:nth-child(2) select {
  width: calc(100% - 12px);
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

#add-item-form #start-time {
  display: flex; /* 分と秒を横に並べる */
  align-items: center;
}

#add-item-form #start-time input[type="number"] {
  width: 60px;
  margin-right: 5px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

#add-item-form #duration input[type="number"]#duration-second {
  width: 60px; /* 開始時間と同じ幅にする */
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  /* margin-bottom: 15px;  /* 親要素でmargin-bottomを設定 */
  margin-right: 0; /* 不要な右マージンを削除 */
}

#add-item-form button, #edit-members-form button {
  background-color: #007bff;
  color: #fff;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
  margin-top: 10px; /* ボタン上部の余白 */

  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 100px;
}

#add-item-form button:hover, #edit-members-form button:hover {
  background-color: #0056b3;
}

.members-grid {
  display: flex; /* 横並びにする */
  gap: 20px; /* グループ間の間隔 */
  margin-bottom: 15px;
}

.strikers {
  flex: 1; /* 利用可能なスペースを均等に分配 */
}

.specials {
  flex: 1; /* 利用可能なスペースを均等に分配 */
}

.member-edit {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.member-edit label {
  margin-right: 15px;
  width: 120px;
  text-align: right;
  font-weight: normal;
}

.member-edit input[type="text"] {
  width: calc(100% - 130px); /* ラベルの幅を考慮 */
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

#duration-second {
  width: 60px;
  margin-right: 10px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

.header-container {
  display: flex;
  justify-content: space-between; /* h1とtimeline-range-controlsを左右に配置 */
  align-items: center; /* 縦方向中央揃え */
  margin-bottom: 20px; /* timelineとの間隔 */
}

.timeline-range-controls {
  display: flex;
  align-items: center; /* h2とラジオボタンを縦方向中央揃え */
}

.timeline-range-controls h2 {
  margin-right: 10px; /* h2の下マージンをリセット */
}

/* ボタンの基本スタイル */
button {
  background-color: #4CAF50; /* 緑色 */
  color: white; /* 文字色 */
  padding: 10px 20px; /* 内側の余白 */
  border: none; /* ボーダーなし */
  border-radius: 5px; /* 角を丸くする */
  cursor: pointer; /* カーソルをポインターに */
  font-size: 16px; /* フォントサイズ */
  transition: background-color 0.3s; /* ホバー時のアニメーション */
}

/* ホバー時のスタイル */
button:hover {
  background-color: #45a049; /* ホバー時の色 */
}

.output-container {
  margin-bottom: 20px; /* ボタンとの間に余白を追加 */
}

#tl-output {
  width: 100%; /* 幅を100%に設定 */
  padding: 10px; /* 内側の余白 */
  border: 1px solid #ccc; /* ボーダー */
  border-radius: 4px; /* 角を丸くする */
  font-size: 1em; /* フォントサイズ */
  resize: both; /* 幅と高さの両方を変更可能にする */
  height: 400px; /* 最小の高さを設定 */
}

.output-fields {
  display: flex; /* テキストエリアとボタンを横並びにする */
}

.output-buttons {
  display: flex;
  flex-direction: column; /* ボタンを上下に配置 */
  margin-left: 10px; /* テキストエリアとの間に余白を追加 */
}

.output-buttons button {
  margin-bottom: 10px; /* ボタン間の余白 */
  width: 180px; /* ボタンの幅を指定 */
}

#add-item-end-form {
  flex: 1; /* 親要素の残りのスペースを均等に分け合う */
  padding: 20px 20px 0 20px;
  border: 1px solid #ddd;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  margin-top: 0; /* 親要素でまとめて余白を取るので個々の margin-top は削除 */
  position: relative;
  display: flex;
  flex-direction: column; /* 縦方向に並べる */
}

#add-item-end-form h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

#add-item-end-form label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: bold;
  font-size: 15px;
}

#add-item-end-form .horizontal-fields {
  display: flex; /* 水平方向に並べる */
  gap: 20px;    /* 要素間の間隔 */
  margin-bottom: 15px; /* 下部の余白 */
  align-items: center; /* 縦方向中央揃え (ラベルと入力欄) */
}

#add-item-end-form .horizontal-fields > div {
  flex: 1; /* 親要素のスペースを均等に分ける */
}

#add-item-end-form .horizontal-fields label {
  display: block; /* Flexboxの子要素内でラベルをブロック要素として扱う */
  margin-bottom: 5px; /* ラベルと入力欄の間隔 */
  color: #555;
  font-weight: bold;
  width: auto; /* ラベルの幅を自動調整 */
}

#add-item-end-form .horizontal-fields input[type="number"] {
  width: 60px; /* 幅を調整 */
  margin-right: 5px; /* 右マージン */
  padding: 8px; /* 内側の余白 */
  border: 1px solid #ccc; /* ボーダー */
  border-radius: 4px; /* 角を丸くする */
  font-size: 1em; /* フォントサイズ */
}

#add-item-end-form .horizontal-fields select {
  width: calc(100% - 12px); /* 幅を調整 */
  padding: 8px; /* 内側の余白 */
  border: 1px solid #ccc; /* ボーダー */
  border-radius: 4px; /* 角を丸くする */
  font-size: 1em; /* フォントサイズ */
}

#add-item-end-form .horizontal-fields select:focus {
  border-color: #007bff; /* フォーカス時のボーダー色 */
  outline: none; /* デフォルトのアウトラインを削除 */
}

#add-item-end-form button {
  background-color: #007bff;
  color: #fff;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
  margin-top: 10px;
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 100px;
}

#add-item-end-form button:hover {
  background-color: #0056b3;
}