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

body {
  font-family: sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

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

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 16px;
  color: #4a90d9;
}

/* 曜日タブ */
.day-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.day-tab {
  flex: 1;
  min-width: 40px;
  padding: 8px 4px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.day-tab:hover {
  border-color: #4a90d9;
}

.day-tab.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
  font-weight: bold;
}

.day-tab .badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  margin-left: 2px;
  vertical-align: middle;
}

.day-tab.active .badge {
  background: rgba(255,255,255,0.7);
  color: #4a90d9;
}

/* 入力セクション */
.input-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.input-row {
  margin-bottom: 10px;
}

.input-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

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

#addBtn {
  width: 100%;
  padding: 10px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#addBtn:hover {
  background: #357abd;
}

/* セクション共通 */
.section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.section h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #555;
  border-bottom: 2px solid #4a90d9;
  padding-bottom: 6px;
}

/* 献立リスト */
.menu-list {
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item-info {
  flex: 1;
}

.menu-item-name {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 4px;
}

.menu-item-ingredients {
  font-size: 0.85rem;
  color: #888;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}

.delete-btn:hover {
  color: #e74c3c;
}

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

/* 食材リスト */
.shopping-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.shopping-header span {
  color: #888;
  font-size: 0.85rem;
  margin-right: auto;
}

.copy-btn, .clear-btn {
  padding: 5px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

.clear-btn:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}

.ingredient-list {
  list-style: none;
}

.ingredient-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.ingredient-item:last-child {
  border-bottom: none;
}

.ingredient-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4a90d9;
  flex-shrink: 0;
}

.ingredient-item label {
  flex: 1;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s;
}

.ingredient-item.checked label {
  text-decoration: line-through;
  color: #bbb;
}

.ingredient-day {
  font-size: 0.75rem;
  color: #aaa;
  white-space: nowrap;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.2rem;
  }

  .day-tab {
    font-size: 0.75rem;
    padding: 6px 2px;
  }

  .input-row input {
    font-size: 0.95rem;
  }
}
