/* 全画面共通のスタイル。iPhoneでの片手操作を想定し、ボタンは大きめにしている。 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background-color: #f5f5f5;
  color: #222;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}

h1 {
  font-size: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: #555;
}

input,
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  font-size: 16px; /* iOSでズームが起きないよう16px以上にする */
  border: 1px solid #ccc;
  border-radius: 8px;
}

button {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #2b7a4b;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled {
  background-color: #9bb8a6;
}

button.secondary {
  background-color: #888;
}

.error {
  color: #c0392b;
  margin-top: 12px;
  font-size: 14px;
}

h2 {
  font-size: 17px;
  margin: 20px 0 12px;
}

section {
  margin-bottom: 16px;
}

.notice {
  background-color: #fff8e1;
  border: 1px solid #f0d98c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #6b5900;
  margin-bottom: 16px;
}

.notice ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

/* confidenceがlowの品目を目立たせる */
.item-row.needs-check {
  border-color: #f0d98c;
  background-color: #fffdf5;
}

.item-confidence-note {
  color: #8a6d00;
  font-weight: normal;
  font-size: 13px;
}

.warning-text {
  background-color: #fdecea;
  border: 1px solid #f0b4ac;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #8a2c22;
  margin-bottom: 16px;
}

.field-label {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

.link-line {
  text-align: center;
  font-size: 14px;
}

/* 少なめ/普通/多め/倍、朝食/昼食/夕食/間食 などのワンタップ選択ボタン群 */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-block;
  width: auto;
  padding: 8px 14px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: normal;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
}

.chip.selected {
  background-color: #2b7a4b;
  color: #fff;
  border-color: #2b7a4b;
}

.photo-button-label {
  margin-bottom: 8px;
}

.photo-button {
  display: block;
  width: 100%;
  padding: 16px;
  text-align: center;
  font-size: 17px;
  font-weight: bold;
  color: #fff;
  background-color: #2b7a4b;
  border-radius: 8px;
}

.photo-button.secondary {
  background-color: #888;
}

/* 数量調整画面の1品目分 */
.item-row {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.item-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.item-quantity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.item-quantity-row input {
  width: 80px;
  margin-top: 0;
}

.unit-label {
  font-size: 14px;
  color: #555;
}

.delete-item-button {
  background-color: transparent;
  color: #c0392b;
  border: 1px solid #f0b4ac;
  margin-bottom: 0;
  margin-top: 4px;
}

.total-kcal {
  font-size: 18px;
  font-weight: bold;
  text-align: right;
  margin: 8px 0 16px;
}

.photo-preview {
  display: block;
  width: 100%;
  border-radius: 8px;
  margin-top: 12px;
}

/* 下部の共通ナビゲーション。iPhoneで親指が届く画面下部に固定表示する。 */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background-color: #fff;
  border-top: 1px solid #ddd;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 2px;
  margin: 0;
  font-size: 12px;
  font-weight: normal;
  color: #555;
  text-decoration: none;
  text-align: center;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.bottom-nav-item.active {
  color: #2b7a4b;
  font-weight: bold;
}

.bottom-nav-logout {
  color: #c0392b;
}

/* ホーム画面の統計カード */
.stat-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.stat-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: bold;
  color: #222;
}

.stat-sub {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* ホーム画面の一番目立たせたいボタン */
.primary-action {
  padding: 20px;
  font-size: 18px;
}

/* 記録一覧の日付切り替え */
.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.date-nav-arrow {
  width: 48px;
  flex: none;
  padding: 12px 0;
  margin-bottom: 0;
}

.date-nav input[type="date"] {
  margin-top: 0;
}

/* オンボーディング画面の良い例・悪い例 */
.onboarding-example {
  background-color: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.onboarding-example.good {
  border-color: #2b7a4b;
}

.onboarding-example.bad {
  border-color: #c0392b;
}

.onboarding-label {
  display: inline-block;
  font-size: 13px;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.onboarding-label.good {
  background-color: #e3f1e8;
  color: #2b7a4b;
}

.onboarding-label.bad {
  background-color: #fbe6e3;
  color: #c0392b;
}

.onboarding-illustration {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.onboarding-example p {
  font-size: 14px;
  margin: 8px 0 0;
}

.onboarding-tips {
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}
