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

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

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

h1 {
  font-size: 1.4rem;
  font-weight: bold;
  color: #1a1a2e;
  padding: 16px 0 12px;
  border-bottom: 2px solid #3a7bd5;
  margin-bottom: 20px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 10px;
}

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

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

.form-row input {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.2s;
}

.form-row input:focus {
  border-color: #3a7bd5;
}

.form-row button {
  padding: 8px 18px;
  background: #3a7bd5;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.form-row button:hover {
  background: #2a60b0;
}

/* フィルター */
.filter-section {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-section label {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
}

.filter-section select {
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

/* 比較エリア */
.table-section {
  margin-bottom: 16px;
}

.item-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.item-card h3 {
  font-size: 1rem;
  font-weight: bold;
  color: #1a1a2e;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.price-table th {
  background: #f0f4f8;
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #dde3ea;
}

.price-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.price-table tr:last-child td {
  border-bottom: none;
}

/* 最安値ハイライト */
.price-table tr.cheapest td {
  background: #e8f5e9;
  font-weight: 600;
}

.price-table tr.cheapest td.price-cell {
  color: #2e7d32;
}

.badge-cheapest {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* 削除ボタン */
.delete-btn {
  background: none;
  border: 1px solid #e57373;
  color: #e57373;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-btn:hover {
  background: #e57373;
  color: #fff;
}

/* データ管理 */
.manage-section {
  margin-top: 8px;
  text-align: right;
}

.danger-btn {
  background: none;
  border: 1px solid #e57373;
  color: #e57373;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.danger-btn:hover {
  background: #e57373;
  color: #fff;
}

/* 空メッセージ */
.empty-msg {
  text-align: center;
  color: #999;
  font-size: 0.9rem;
  padding: 40px 0;
}

/* レスポンシブ */
@media (max-width: 600px) {
  .form-row input {
    min-width: 100%;
  }

  .form-row button {
    width: 100%;
  }

  .price-table th:nth-child(3),
  .price-table td:nth-child(3) {
    display: none;
  }
}
