:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --primary: #22c55e;
  --primary-dark: #15803d;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}


/* Header */
header {
  display: flex;
  align-items: center; /* vertikal zentrieren */
  gap: 14px;           /* Abstand zwischen Logo und Text */
  margin-bottom: 24px;
}

header .logo {
  width: 46px;
  height: 46px;
  background: var(--primary);
  border-radius: 12px;
  display: grid;
  place-items: center;
}

header .logo svg {
  width: 26px;
  height: 26px;
  fill: white;
}

header .brand {
  margin: 0;
  padding: 0;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1; /* Zeilenhöhe auf H2 minimieren */
}

header .brand + span {
  display: block;
  margin: 2px 0 0; /* kleiner negativer Abstand */
  font-size: 0.9rem;
  line-height: 1; /* Zeilenhöhe für span minimieren */
  color: var(--muted);
}

/* MAIN */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* H1 – Hauptüberschrift */
main h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.2;
}

/* H2 */
main h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 12px;
  line-height: 1.25;
}

/* H3 – kleinere Abschnitte / Sektionen */
main h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 8px;
  line-height: 1.25;
}

/* Absätze */
main p {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 16px;
}

/* Optional: kleine Hinweis-Texte */
main p.hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 12px;
}


/* Suche */
#search {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 1rem;
  margin: 16px 0 24px;
}

/* Tabellen = Cards */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
  margin-bottom: 28px;
}

thead {
  background: #ecfdf5;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: .95rem;
}

th {
  font-weight: 600;
  color: var(--primary-dark);
}

tbody tr:hover {
  background: #f1f5f9;
}

/* Inputs */
input.food-amount {
  width: 80px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

/* Gesamtnährwerte */
#nutrients-table td.nutrient-value {
  font-weight: 600;
}

/* Mobile */
@media (max-width: 700px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }

  td {
    border: none;
    padding: 6px 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: .75rem;
    color: var(--muted);
  }

  input.food-amount {
    width: 100%;
  }
}