:root {
  --primary: #007bff;
  --secondary: #6c757d;
  --bg: #f6f8fa;
  --text: #333;
  --radius: 8px;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

header h1 {
  text-align: center;
  font-weight: 600;
  margin-bottom: 2rem;
}

.form-section {
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
}

th,
td {
  border: 1px solid #e0e0e0;
  padding: 0.75rem;
  text-align: left;
}

th {
  background: #fafafa;
}

button {
  cursor: pointer;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 500;
}

button.primary {
  background: var(--primary);
  color: #fff;
}

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

button + button {
  margin-left: 0.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

input.invalid {
  border-color: red;
}

@media (max-width: 600px) {
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    border: 1px solid #ccc;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    overflow: hidden;
  }

  td {
    border: none;
    position: relative;
    padding-left: 50%;
    border-bottom: 1px solid #eee;
  }

  td:before {
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    padding-left: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
  }

  td:nth-of-type(1):before {
    content: "Ingredient";
  }
  td:nth-of-type(2):before {
    content: "Weight (g)";
  }
  td:nth-of-type(3):before {
    content: "Calories per 100 g (kcal)";
  }
  td:nth-of-type(4):before {
    content: "Protein per 100 g (g)";
  }
  td:nth-of-type(5):before {
    content: "Fibre per 100 g (g)";
  }
  td:nth-of-type(6):before {
    content: "Remove";
  }
}
