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

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

header {
  background: #e74c3c;
  color: white;
  padding: 16px 20px;
  text-align: center;
}

header h1 {
  font-size: 1.4rem;
}

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

section {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

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

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

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

.form-group input:focus {
  outline: none;
  border-color: #e74c3c;
}

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

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

/* エリア別集計 */
.summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff5f5;
  border-radius: 8px;
  border-left: 4px solid #e74c3c;
}

.summary-area {
  font-weight: 700;
  font-size: 0.95rem;
}

.summary-stat {
  text-align: center;
  font-size: 0.8rem;
  color: #666;
}

.summary-stat span {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.summary-rate {
  font-size: 1.1rem;
  font-weight: 800;
  color: #e74c3c;
  text-align: right;
  min-width: 60px;
}

.summary-rate.high {
  color: #e74c3c;
}

.summary-rate.mid {
  color: #e67e22;
}

.summary-rate.low {
  color: #999;
}

/* 記録一覧 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h2 {
  margin-bottom: 0;
}

.total-count {
  font-size: 0.85rem;
  color: #999;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
  gap: 8px;
}

.record-info {
  flex: 1;
}

.record-area {
  font-weight: 700;
  font-size: 0.95rem;
}

.record-date {
  font-size: 0.78rem;
  color: #999;
  margin-top: 2px;
}

.record-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.record-num {
  text-align: center;
  font-size: 0.78rem;
  color: #666;
}

.record-num span {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
}

.record-rate-badge {
  background: #e74c3c;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 52px;
  text-align: center;
}

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

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

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

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

  .summary-item {
    grid-template-columns: 1fr auto auto;
  }

  .summary-stat:nth-child(3) {
    display: none;
  }

  .record-stats {
    gap: 8px;
  }

  .record-num:first-child {
    display: none;
  }
}
