/* ===== 食物アレルギー一覧ページ用 最小限補足 ===== */

/* ツールバー */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}

/* ===== 食物アレルギー一覧ページ用（色とフォーム補強） ===== */

/* --- ボタンの色・形状 --- */
button {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  display: inline-block;
  margin: 0;
}

button:hover {
  background-color: #2980b9;
}

/* --- テキストエリア --- */
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  font-size: 1rem;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
}

/* --- select --- */
select {
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

select:focus {
  border-color: #3498db;
  box-shadow: 0 0 4px rgba(52, 152, 219, 0.4);
  outline: none;
}

/* テーブル */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e0e0e0;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  text-align: left;
}

th {
  background: #fafafa;
}

/* テーブルの横スクロール用ラッパー */
.tableWrap {
  width: 100%;
  overflow-x: auto;
}

/* 補足テキスト */
.small {
  font-size: 12px;
  color: #555;
}

select,
input[type="text"] {
  font-size: 13px;
}

/* カテゴリ行（折りたたみ行） */
.catRow td {
  background: #e8e8e8;
  font-weight: 600;
  cursor: pointer;
}

/* 全体メモ見出し */
h3 {
  margin-top: 16px;
}

/* ===== スマートフォン用追加スタイル ===== */
@media (max-width: 600px) {

  /* ツールバーの縦積み */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar button,
  .toolbar select,
  .toolbar input[type="text"] {
    width: 100%;
    font-size: 1rem;
  }

  /* ボタンを大きめに */
  button {
    padding: 12px 0;
    font-size: 1.05rem;
  }

  /* テキストエリア調整 */
  textarea {
    font-size: 1.05rem;
  }

  /* テーブル文字調整 */
  th,
  td {
    padding: 10px 6px;
    font-size: 13px;
  }

  /* カテゴリ行タップしやすく */
  .catRow td {
    padding: 12px 6px;
    font-size: 14px;
  }

  /* 見出し調整 */
  h3 {
    margin-top: 20px;
    font-size: 1.1rem;
  }

  /* 横スクロールラッパー強化 */
  .tableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* スムーズスクロール */
  }

  /* 横スクロール前提で幅を確保 */
  #allergyTable {
    min-width: 900px;
    width: 900px; /* 横スクロールを強制して確実に表示 */
  }

  /* セル余白調整 */
  #allergyTable th,
  #allergyTable td {
    padding: 10px 6px;
    font-size: 13px;
  }

  /* メモ欄が極端に潰れないように */
  #allergyTable textarea {
    min-width: 220px;
  }
}