:root {
  --bg-main: #fff6f2;
  --primary: #ff7a59;
  --secondary: #5ad1a3;
  --text: #333;
  --card: #fff;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--text);
}

.app-header {
  background: linear-gradient(135deg, var(--primary), #ffb199);
  color: #fff;
  text-align: center;
  padding: 18px;
  font-size: 22px;
  font-weight: 700;
}

.container {
  max-width: 900px;
  margin: auto;
  padding: 14px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,.05);
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #f0d9cf;
  margin-bottom: 10px;
}

.row {
  display: flex;
  gap: 10px;
}

.row input, .row select {
  flex: 1;
}

.macros-card {
  background: linear-gradient(135deg, #fff1ea, #eafff6);
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  text-align: center;
  font-weight: 600;
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.section {
  border: 2px dashed var(--secondary);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.section-header, .option-header, .ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.meal-option {
  background: #fffaf7;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}

.label {
  font-size: 12px;
  opacity: .6;
  margin-bottom: 4px;
}

.remove-x {
  color: #ff5c5c;
  font-size: 18px;
  cursor: pointer;
}

.ingredient-row {
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.ingredient-row input {
  width: 70px;
  margin: 0;
}

.unit-label {
  font-size: 13px;
  opacity: .7;
}

.toggle-row {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.toggle {
  flex: 1;
  background: #ffe1d7;
  color: #333;
}

.toggle.active {
  background: var(--secondary);
  color: #fff;
}

.sheet {
  position: fixed;
  inset: 0;
  background: #0006;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.sheet.hidden {
  display: none;
}

.sheet-content {
  background: #fff;
  width: 100%;
  max-height: 85%;
  border-radius: 20px 20px 0 0;
  padding: 16px;
  animation: slideUp .25s ease-out;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

#foodList div {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

#foodList div.selected {
  background: #fff3ed;
  font-weight: 600;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
