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

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

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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #2563eb;
}

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

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

/* フォーム */
.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="date"],
input[type="number"],
input[type="text"],
input[type="month"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #333;
  background: #fafafa;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
}

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

.btn-primary:hover {
  background: #1d4ed8;
}

/* 月別集計 */
.month-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.month-filter input {
  flex: 1;
}

.btn-secondary {
  padding: 8px 16px;
  background: #e2e8f0;
  color: #333;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.summary-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-label {
  font-size: 0.9rem;
  color: #3b82f6;
  font-weight: 500;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-left: auto;
}

.summary-unit {
  font-size: 1rem;
  color: #3b82f6;
  font-weight: 500;
}

.summary-count {
  font-size: 0.8rem;
  color: #6b7280;
  width: 100%;
  text-align: right;
}

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

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

.list-filter-label {
  font-size: 0.8rem;
  color: #6b7280;
}

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

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

.record-item {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.record-date {
  font-size: 0.85rem;
  color: #6b7280;
  white-space: nowrap;
  min-width: 80px;
}

.record-main {
  flex: 1;
}

.record-purpose {
  font-size: 0.95rem;
  color: #333;
  font-weight: 500;
}

.record-distance {
  font-size: 0.85rem;
  color: #2563eb;
  font-weight: 600;
  margin-top: 2px;
}

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

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

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

  .summary-value {
    font-size: 1.5rem;
  }
}
