*, *::before, *::after {
  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: 600px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  text-align: center;
}

/* フォーム */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 24px;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.form-row label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-row input,
.form-row select {
  padding: 10px 12px;
  border: 1.5px solid #dce3ec;
  border-radius: 8px;
  font-size: 1rem;
  background: #fafbfc;
  color: #333;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #4a90d9;
  background: #fff;
}

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

.btn-primary:hover {
  background: #357abd;
}

.btn-primary:active {
  background: #2a6099;
}

/* 一覧 */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.list-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
}

#count-label {
  font-size: 0.82rem;
  color: #888;
}

#record-list {
  list-style: none;
}

#record-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef1f5;
}

#record-list li:last-child {
  border-bottom: none;
}

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

.record-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.record-date {
  font-size: 0.82rem;
  color: #888;
}

.record-category {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  background: #e8f1fc;
  color: #4a90d9;
}

.record-severity {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.severity-軽い { background: #e8faf0; color: #27ae60; }
.severity-普通 { background: #fff8e1; color: #f39c12; }
.severity-強い { background: #fdecea; color: #e74c3c; }

.record-memo {
  font-size: 0.9rem;
  color: #555;
  word-break: break-word;
}

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

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

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

@media (max-width: 375px) {
  .container {
    padding: 16px 12px 32px;
  }
  h1 {
    font-size: 1.4rem;
  }
}
