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

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

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

h1 {
  font-size: 1.4rem;
  color: #2e7d32;
  text-align: center;
  padding: 16px 0 20px;
  border-bottom: 2px solid #a5d6a7;
  margin-bottom: 20px;
}

h2 {
  font-size: 1rem;
  color: #388e3c;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 4px solid #66bb6a;
}

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

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  font-size: 1rem;
  background: #fafffe;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #66bb6a;
}

#addBtn {
  width: 100%;
  padding: 12px;
  background: #43a047;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

#addBtn:hover {
  background: #388e3c;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.summary-card {
  background: #e8f5e9;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 0.72rem;
  color: #555;
}

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

.summary-unit {
  font-size: 0.75rem;
  color: #777;
}

/* 絞り込み */
.filter-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.filter-row {
  display: flex;
  gap: 8px;
}

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

.filter-row select {
  padding: 8px 10px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fafffe;
  outline: none;
}

/* 一覧 */
.list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.record-name {
  font-size: 1rem;
  font-weight: bold;
  color: #222;
  flex: 1;
}

.record-price {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2e7d32;
  white-space: nowrap;
}

.record-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.condition-badge {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: bold;
}

.condition-良品 { background: #c8e6c9; color: #2e7d32; }
.condition-普通 { background: #fff9c4; color: #f57f17; }
.condition-難あり { background: #ffcdd2; color: #c62828; }

.record-date {
  font-size: 0.78rem;
  color: #999;
}

.record-memo {
  font-size: 0.85rem;
  color: #666;
}

.delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

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

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

@media (max-width: 400px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-card:first-child {
    grid-column: span 2;
  }

  .filter-row {
    flex-direction: column;
  }
}
