:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --accent: #a7b8c9;
  --accent-soft: #e6ecf2;
  --text: #2f3542;
  --subtle: #6b7280;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: var(--bg);
}

header {
  padding: 16px;
  background: white;
  position: sticky;
  top: 0;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

input, button, select {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ddd;
}

button {
  background: var(--accent);
  color: white;
  border: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  padding: 16px;
}

.card {
  background: var(--card);
  padding: 14px;
  border-radius: 18px;
  cursor: pointer;
}

.card img {
  width: 100%;
  border-radius: 12px;
}

.tag {
  display: inline-block;
  background: var(--accent-soft);
  padding: 4px 10px;
  margin: 2px;
  border-radius: 999px;
  font-size: 12px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 20px;
  width: 500px;
  max-height: 85%;
  overflow-y: auto;
  border-radius: 20px;
}

/* FORM */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 13px;
  color: var(--subtle);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.secondary-btn {
  background: #e5e7eb;
  color: #333;
}

/* Ingredient Builder */
.section-card {
  background: #f9fafb;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}

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

.section-header input {
  font-weight: 500;
}

.ingredient-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.ingredient-row input {
  flex: 1;
}

.small-btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.tag-pill {
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-pill span {
  cursor: pointer;
  font-weight: bold;
}