* {
  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;
}

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

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 20px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: #444;
}

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

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

.form-group:first-child {
  grid-column: 1 / -1;
}

label {
  font-size: 0.8rem;
  color: #555;
  font-weight: 600;
}

input {
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #4a6fa5;
}

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

.btn-add:hover {
  background: #3a5a8f;
}

.summary {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.summary h2 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: #444;
}

.item-card {
  border: 1.5px solid #eee;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.item-card.safe {
  border-left: 4px solid #28a745;
}

.item-card.caution {
  border-left: 4px solid #ffc107;
}

.item-card.danger {
  border-left: 4px solid #dc3545;
}

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

.item-name {
  font-size: 1rem;
  font-weight: 700;
}

.risk-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.risk-badge.safe {
  background: #d4edda;
  color: #155724;
}

.risk-badge.caution {
  background: #fff3cd;
  color: #856404;
}

.risk-badge.danger {
  background: #f8d7da;
  color: #721c24;
}

.item-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.stat {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 8px 10px;
}

.stat-label {
  font-size: 0.72rem;
  color: #777;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
}

.stat-value.highlight-danger {
  color: #dc3545;
}

.stat-value.highlight-caution {
  color: #856404;
}

.stat-value.highlight-safe {
  color: #155724;
}

.item-advice {
  font-size: 0.82rem;
  color: #555;
  background: #f0f4ff;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.btn-delete {
  background: none;
  border: 1.5px solid #ccc;
  color: #888;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete:hover {
  border-color: #dc3545;
  color: #dc3545;
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group:first-child {
    grid-column: 1;
  }
  .item-stats {
    grid-template-columns: 1fr;
  }
}
