* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f7f0;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* ヘッダー */
header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.5rem;
  color: #2e7d32;
}

.date {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
}

/* 目標設定 */
.goal-section {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.goal-section label {
  font-size: 0.85rem;
  color: #555;
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.goal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

.goal-row input:focus {
  border-color: #4caf50;
}

.goal-row span {
  color: #555;
  font-size: 0.9rem;
}

/* サマリー */
.summary-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.summary-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-item {
  text-align: center;
}

.summary-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 2px;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2e7d32;
}

.summary-unit {
  font-size: 0.8rem;
  color: #888;
  margin-left: 2px;
}

.summary-divider {
  font-size: 1.5rem;
  color: #ccc;
  margin-top: 8px;
}

.progress-bar-wrapper {
  background: #e8f5e9;
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: #4caf50;
  border-radius: 8px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-bar.over {
  background: #e53935;
}

.remaining {
  text-align: center;
  font-size: 0.85rem;
  color: #555;
}

/* 入力フォーム */
.input-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.input-section h2 {
  font-size: 1rem;
  color: #2e7d32;
  margin-bottom: 12px;
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
}

.input-row input:focus {
  border-color: #4caf50;
}

/* ボタン共通 */
button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

#add-btn {
  background: #4caf50;
  color: #fff;
  white-space: nowrap;
}

#add-btn:hover {
  background: #388e3c;
}

#save-goal-btn {
  background: #e8f5e9;
  color: #2e7d32;
  white-space: nowrap;
  padding: 8px 14px;
}

#save-goal-btn:hover {
  background: #c8e6c9;
}

/* 記録一覧 */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.list-section h2 {
  font-size: 1rem;
  color: #2e7d32;
  margin-bottom: 12px;
}

#meal-list {
  list-style: none;
}

#meal-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}

#meal-list li:last-child {
  border-bottom: none;
}

.meal-name {
  flex: 1;
  font-size: 0.95rem;
}

.meal-cal-badge {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.delete-btn {
  background: none;
  color: #bbb;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: normal;
}

.delete-btn:hover {
  background: #ffebee;
  color: #e53935;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 12px 0;
}

/* レスポンシブ補正 */
@media (max-width: 375px) {
  .summary-value {
    font-size: 1.6rem;
  }
}
