/* Dinner Planner V6
   Farbregel: jede Farbe hat genau eine Bedeutung.
   Proteinquelle -> Fleisch rot, Fisch blau, Hülsenfrüchte bernstein,
   Milch & Ei violett, ohne tierisches Protein grau.
   Grün ist ausschliesslich das Kennzeichen "vegetarisch".
   Bewertungen bleiben bewusst farblos, damit keine Farbe doppelt belegt ist. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e4e4e7;
  --ink: #18181b;
  --muted: #71717a;
  --accent: #111827;

  --protein-fleisch: #b91c1c;
  --protein-fisch: #0369a1;
  --protein-huelsen: #a16207;
  --protein-milchei: #7c3aed;
  --protein-ohne: #52525b;
  --vegetarisch: #15803d;
}

* { box-sizing: border-box; }
body {
  margin: 0; padding: 0 0 80px;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.45;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 14px; }
h1 { font-size: 21px; margin: 0 0 2px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
h3 { font-size: 15px; margin: 0 0 4px; }
a { color: var(--accent); }
.muted, .sub { color: var(--muted); font-size: 13px; }

nav.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; gap: 2px; overflow-x: auto; padding: 8px 10px;
}
nav.top a {
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 6px 10px; border-radius: 9px; white-space: nowrap;
}
nav.top a.active { background: var(--accent); color: #fff; }

.panel, .card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px; margin-bottom: 10px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

label { font-size: 13px; color: var(--muted); }
select, input[type=text], input[type=number], input[type=password], textarea {
  font-size: 16px; padding: 8px; border: 1px solid #d4d4d8;
  border-radius: 9px; background: #fff; color: var(--ink); font-family: inherit;
}
textarea { width: 100%; resize: vertical; min-height: 58px; }
input[type=color] { width: 42px; height: 34px; padding: 2px; border: 1px solid #d4d4d8; border-radius: 8px; }

button {
  border: 0; border-radius: 11px; padding: 10px 13px; font-size: 14px;
  font-weight: 700; background: var(--accent); color: #fff; cursor: pointer;
}
button.secondary { background: #e5e7eb; color: var(--accent); }
button.ghost { background: transparent; color: var(--muted); font-weight: 600; padding: 6px 8px; }
button.small { padding: 6px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 999px; border: 1px solid currentColor;
}
.p-Fleisch { color: var(--protein-fleisch); }
.p-Fisch { color: var(--protein-fisch); }
.p-Hülsenfrüchte, .p-Huelsenfruechte { color: var(--protein-huelsen); }
.p-MilchEi { color: var(--protein-milchei); }
.p-Ohne { color: var(--protein-ohne); }
.badge.veg { color: var(--vegetarisch); }

.thumb { width: 62px; height: 62px; border-radius: 10px; object-fit: cover;
  background: #f1f1f4; flex: none; display: block; }
.hero { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px;
  display: block; margin-bottom: 10px; background: #f1f1f4; }
.meal { display: grid; grid-template-columns: 76px 72px 1fr; gap: 10px; align-items: start; }
.meal.no-image { grid-template-columns: 76px 1fr; }
.meal .day { font-weight: 800; font-size: 13px; padding-top: 3px; }
.meal .title { font-size: 16px; font-weight: 700; }
.meal .actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.kal-kopf, .kal-gitter { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.kal-kopf { font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.kal-kopf > div { text-align: center; }
.kal-zelle { min-height: 84px; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 8px; padding: 4px; font-size: 11px; overflow: hidden; cursor: pointer;
  background: #fff; }
.kal-zelle.fremd { opacity: .42; }
.kal-zelle.heute { outline: 2px solid var(--accent); outline-offset: -2px; }
.kal-tag { font-weight: 800; color: var(--muted); }
.kal-titel { margin-top: 2px; line-height: 1.2; font-weight: 600; }
.kal-schloss { margin-top: 2px; color: var(--muted); font-size: 10px; }
.kal-zelle .thumb { border-radius: 5px; margin-top: 2px; }

.bar { height: 7px; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.shop-group { font-size: 12px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 4px; }
.shop-item { display: flex; gap: 10px; align-items: center; padding: 9px 2px;
  border-bottom: 1px solid #f1f1f4; }
.shop-item:last-child { border-bottom: 0; }
.shop-item input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.shop-item .qty { font-weight: 700; min-width: 74px; }
.shop-item.done { color: #a1a1aa; text-decoration: line-through; }
.shop-item .why { font-size: 11px; color: var(--muted); }

.list-item { display: flex; gap: 10px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid #f1f1f4; }
.list-item:last-child { border-bottom: 0; }
.list-item a { text-decoration: none; font-weight: 600; }

.rate { display: inline-flex; gap: 4px; }
.rate button { background: #f4f4f5; color: var(--ink); border: 1px solid var(--line);
  padding: 5px 9px; font-size: 13px; }
.rate button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.waehler-huelle { position: fixed; inset: 0; background: rgba(24,24,27,.45);
  display: flex; align-items: flex-start; justify-content: center; z-index: 50;
  padding: 24px 12px; overflow-y: auto; }
.waehler { background: var(--card); border-radius: 14px; padding: 13px;
  width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(0,0,0,.22); }
.waehler-suche { width: 100%; }
.waehler-liste { margin-top: 9px; max-height: 62vh; overflow-y: auto; }
.waehler-zeile { display: flex; gap: 9px; align-items: center; width: 100%;
  text-align: left; background: transparent; color: var(--ink); font-weight: 500;
  border: 0; border-bottom: 1px solid #f1f1f4; border-radius: 0; padding: 8px 2px; }
.waehler-zeile:hover { background: #f8f8fa; }
.waehler-zeile .thumb { width: 42px; height: 42px; }
.waehler-titel { display: block; font-weight: 700; font-size: 15px; }
.waehler-zeile .sub { display: block; }

.note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line);
  padding-left: 9px; margin: 6px 0; }
.error { color: var(--protein-fleisch); font-size: 13px; font-weight: 600; }
.hidden { display: none; }
.code { font: 12px ui-monospace, SFMono-Regular, monospace; min-height: 150px; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid #f1f1f4; }
.ing-row { display: grid; grid-template-columns: 68px 74px 1fr 34px; gap: 6px; margin-bottom: 6px; }
.ing-row input, .ing-row select { width: 100%; font-size: 14px; padding: 6px; }
@media (max-width: 520px) {
  .kal-zelle { min-height: 62px; font-size: 10px; padding: 3px; }
  .kal-zelle .thumb { display: none; }
}
@media (max-width: 420px) {
  .meal { grid-template-columns: 56px 58px 1fr; }
  .meal.no-image { grid-template-columns: 56px 1fr; }
  .thumb { width: 54px; height: 54px; }
  .ing-row { grid-template-columns: 58px 64px 1fr 30px; }
}
