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

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

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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c0392b;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

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

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

/* 控除上限設定 */
.limit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

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

.limit-row input[type="number"] {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
}

.limit-row button {
  padding: 8px 18px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.limit-row button:hover {
  background: #a93226;
}

/* サマリー */
.summary {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  color: #fff;
}

.summary h2 { display: none; }

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.summary-item:last-of-type {
  border-bottom: none;
}

.summary-item.highlight {
  font-size: 1.05rem;
}

.summary-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.summary-item.highlight .summary-value {
  font-size: 1.3rem;
}

.progress-bar-wrap {
  margin-top: 14px;
  background: rgba(255,255,255,0.3);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
}

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

/* フォーム */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.82rem;
  color: #666;
  font-weight: 500;
}

.form-group input {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
}

.form-group input:focus {
  outline: none;
  border-color: #c0392b;
  box-shadow: 0 0 0 2px rgba(192,57,43,0.15);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #a93226;
}

/* 一覧 */
.count {
  font-size: 0.85rem;
  color: #999;
  font-weight: 400;
}

.donation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.donation-item {
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: #fafafa;
}

.donation-info {
  flex: 1;
  min-width: 0;
}

.donation-dest {
  font-weight: 600;
  font-size: 0.98rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donation-amount {
  color: #c0392b;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2px;
}

.donation-gift {
  font-size: 0.82rem;
  color: #777;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donation-date {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 3px;
}

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

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