/* Work Sans loaded via <link> in index.html */

:root {
  --bg:      #ddd0b6;
  --surface: #ffffff;
  --rand-1:  #e5e5e5;
  --rand-2:  #c4c4c4;
  --text:    #2f3a4a;
  --text-leicht: #737373;
  --akzent:    #0f766e;
  --akzent-bg: #f0fdfa;
  --danger:  #dc2626;
  --success: #16a34a;
  --fruehstueck: #cf7f63;
  --mittag:      #3a7e70;
  --abend:       #5a527a;
  --r:   8px;
  --r-s: 6px;

  /* Topbar */
  --tb-bg:    #1c4a52;
  --tb-text:  rgba(255,255,255,0.52);
  --tb-hover: rgba(255,255,255,0.08);
  --tb-linie: rgba(255,255,255,0.12);
  --tb-indik: #5eead4;
  --tb-h:     48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Topbar ─────────────────────────────────────── */
nav#topbar {
  height: var(--tb-h);
  background: var(--tb-bg);
  display: flex;
  align-items: stretch;
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  font-family: 'Work Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  padding-right: 24px;
  margin-right: 8px;
  border-right: 1px solid var(--tb-linie);
  white-space: nowrap;
  flex-shrink: 0;
}

nav#topbar ul {
  list-style: none;
  display: flex;
  align-items: stretch;
  flex: 1;
}

nav#topbar li { display: flex; }

nav#topbar li a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--tb-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
nav#topbar li a:hover { color: rgba(255,255,255,0.9); background: var(--tb-hover); }
nav#topbar li a.aktiv { color: #fff; border-bottom-color: var(--tb-indik); }

.topbar-rechts {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding-left: 8px;
  margin-left: 8px;
  border-left: 1px solid var(--tb-linie);
}

.topbar-menu-toggle {
  display: none;
  width: 44px; height: 44px; flex-shrink: 0;
  align-items: center; justify-content: center;
  background: none; border: none; color: #fff;
  font-size: 20px; cursor: pointer; font-family: inherit;
}

.topbar-einst {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--tb-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  cursor: pointer;
}
.topbar-einst:hover { color: rgba(255,255,255,0.9); background: var(--tb-hover); }
.topbar-einst.aktiv { color: #fff; border-bottom-color: var(--tb-indik); }

.topbar-nutzer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 8px;
  font-size: 13px;
  color: var(--tb-text);
  border-left: 1px solid var(--tb-linie);
  margin-left: 8px;
}
#nutzer-name { color: rgba(255,255,255,0.75); }
#abmelden-link { color: var(--tb-text); text-decoration: none; cursor: pointer; }
#abmelden-link:hover { color: #fca5a5; }

main#inhalt {
  flex: 1;
  overflow-y: auto;
  padding: 30px 18px;
}

.seite { display: none; max-width: 1280px; margin: 0 auto; }
.seite.aktiv { display: block; }

/* ── Typografie ─────────────────────────────────── */
h1 { font-size: 28px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; color: var(--text); }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ── Karten ─────────────────────────────────────── */
.karte {
  background: var(--surface);
  border: 1px solid var(--rand-1);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 16px;
}

/* ── Gericht-Karte ──────────────────────────────── */
.gericht-karte {
  background: var(--surface);
  border: 1px solid var(--rand-1);
  border-radius: var(--r);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: grab;
  transition: border-color 0.12s;
  margin-bottom: 8px;
}
.gericht-karte:hover { border-color: var(--rand-2); }
.gericht-karte.ausgewaehlt { border-color: var(--akzent); background: var(--akzent-bg); }
.gericht-karte.dragging { opacity: 0.5; }

.gericht-karte .mahlzeit-badge { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.badge-fruehstueck { background: var(--fruehstueck); }
.badge-mittag      { background: var(--mittag); }
.badge-abend       { background: var(--abend); }

.gericht-karte .gericht-info { flex: 1; min-width: 0; }
.gericht-karte .gericht-name {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gericht-karte .gericht-meta { font-size: 12px; color: var(--text-leicht); margin-top: 2px; }

.bewertung { display: flex; gap: 3px; }
.bewertung-punkt { width: 6px; height: 6px; border-radius: 50%; background: var(--rand-1); }
.bewertung-punkt.aktiv { background: var(--akzent); }

/* ── Bibliothek-Karte ───────────────────────────── */
.bib-karte { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 8px; }
.bib-badge { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.bib-info { flex: 1; min-width: 0; }
.bib-name { font-weight: 600; font-size: 14px; }
.bib-meta { font-size: 12px; color: var(--text-leicht); margin-top: 2px; }
.bib-kennzahlen { display: flex; gap: 14px; }
.bib-kennzahl { text-align: center; min-width: 56px; }
.bib-kennzahl.bib-genutzt { min-width: 48px; }
.bib-kennzahl-label { font-size: 11px; color: var(--text-leicht); }
.bib-kennzahl .bewertung { justify-content: center; margin-top: 2px; }
.bib-genutzt-wert { font-weight: 600; font-size: 15px; }
.bib-aktionen { display: flex; gap: 6px; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-s); border: none;
  font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: opacity 0.12s, background 0.12s, border-color 0.12s;
}
.btn:hover  { opacity: 0.88; }
.btn:active { opacity: 0.76; }
.btn-primaer   { background: var(--akzent); color: #fff; }
.btn-sekundaer { background: transparent; color: var(--text); border: 1px solid var(--rand-1); }
.btn-sekundaer:hover { opacity: 1; border-color: var(--rand-2); background: var(--bg); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-klein   { padding: 6px 12px; font-size: 13px; }
.btn-icon    { padding: 6px 10px; }

/* ── Formulare ──────────────────────────────────── */
.form-gruppe { margin-bottom: 16px; }
.form-gruppe label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 6px; color: var(--text-leicht);
}
.form-gruppe input,
.form-gruppe select,
.form-gruppe textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--rand-1); border-radius: var(--r-s);
  font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color 0.12s;
}
.form-gruppe input:focus,
.form-gruppe select:focus,
.form-gruppe textarea:focus { outline: none; border-color: var(--akzent); }
.form-gruppe textarea { resize: vertical; min-height: 72px; }

.form-reihe { display: flex; gap: 16px; }
.form-reihe .form-gruppe { flex: 1; }

/* Toggle Switch */
.toggle-zeile { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }

.toggle-switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--rand-2); border-radius: 22px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--akzent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

.bewertung-input { display: flex; gap: 6px; margin-top: 4px; }
.bewertung-input button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--rand-1); background: var(--bg);
  cursor: pointer; font-size: 12px; font-weight: 700;
  transition: all 0.1s; font-family: inherit;
}
.bewertung-input button.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }

/* ── Wochenplaner ───────────────────────────────── */

/* Toolbar */
.woche-toolbar {
  display: flex; align-items: center; margin-bottom: 20px;
}
.woche-toolbar-links { display: flex; align-items: flex-end; gap: 10px; }
.woche-toolbar-rechts { margin-left: auto; display: flex; gap: 8px; }

.woche-nav-pfeil {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #ddd2ba; border-radius: 10px;
  cursor: pointer; font-size: 20px; color: var(--text);
  font-family: inherit; line-height: 1;
  transition: background 0.12s;
}
.woche-nav-pfeil:hover { background: #f5f0e8; }

.woche-label-stapel {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 3px;
}

.woche-kw-badge {
  display: inline-block;
  font-size: 9.5px; font-weight: 500; text-transform: uppercase;
  padding: 4px 8px 2px; border-radius: 20px; letter-spacing: 0.06em;
  color: #fff; background: var(--akzent);
}

.woche-range {
  font-size: 30px; font-weight: 700; letter-spacing: -0.3px;
}

.btn-woche-heute {
  height: 38px; padding: 0 18px;
  display: inline-flex; align-items: center;
  background: #fff; border: 1px solid #ddd2ba; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; color: var(--text);
  transition: background 0.12s;
}
.btn-woche-heute:hover { background: #f5f0e8; }

.btn-einkaufsliste {
  height: 38px; padding: 0 18px;
  display: inline-flex; align-items: center;
  background: #c25a3f; color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: opacity 0.12s;
}
.btn-einkaufsliste:hover { opacity: 0.88; }

/* Week grid */
.woche-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

/* Day card */
.tag-karte {
  border-radius: 16px; border: 1.5px solid;
  overflow: hidden; display: flex; flex-direction: column;
}
.tag-karte.wochentag { background: #e9f2f1; border-color: #a9cac6; }
.tag-karte.wochenende { background: #fbf1e7; border-color: #e7c7ac; }

/* Day header */
.tag-kopf { padding: 12px 9px; }
.tag-karte.wochentag .tag-kopf { background: #bfdbd7; }
.tag-karte.wochenende .tag-kopf { background: #f3d9c4; }

.tag-kopf-zeile1 {
  display: flex; align-items: baseline; gap: 3px; white-space: nowrap;
}
.tag-kuerzel { font-size: 15px; font-weight: 700; }
.tag-karte.wochentag .tag-kuerzel { color: #0f3d38; }
.tag-karte.wochenende .tag-kuerzel { color: #8a3420; }

.tag-datum-text { font-size: 12px; font-weight: 700; }
.tag-karte.wochentag .tag-datum-text { color: #4a827a; }
.tag-karte.wochenende .tag-datum-text { color: #a97a5c; }

.heute-badge {
  display: inline-block;
  font-size: 9.5px; font-weight: 500; text-transform: uppercase;
  padding: 4px 6px 2px; border-radius: 20px;
  margin-left: 3px; letter-spacing: 0.06em;
}
.tag-karte.wochentag .heute-badge { color: #0f3d38; background: #86b0ab; }
.tag-karte.wochenende .heute-badge { color: #8a3420; background: #d0a88e; }

.tag-zusammenfassung {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: -0.2px; white-space: nowrap; margin-top: 5px;
}
.tag-karte.wochentag .tag-zusammenfassung { color: #1c5c54; }
.tag-karte.wochenende .tag-zusammenfassung { color: #8a3420; }

/* Slot area */
.tag-slots { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

/* Slot card */
.slot-karte {
  height: 92px; border-radius: 10px; padding: 7px 6px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; transition: opacity 0.1s;
}
.slot-karte:hover { opacity: 0.88; }

/* Filled slot */
.tag-karte.wochentag .slot-karte.gefuellt { background: #96bdb7; border: 1px solid #74a29b; }
.tag-karte.wochenende .slot-karte.gefuellt { background: #f0d4bb; border: 1px solid #dfb187; }

/* Empty slot */
.slot-karte.leer {
  background: #fff; border: 1.5px dashed;
  align-items: center; justify-content: center;
}
.tag-karte.wochentag .slot-karte.leer { border-color: #a9cac6; }
.tag-karte.wochenende .slot-karte.leer { border-color: #eccdb9; }

.slot-leer-plus { font-size: 20px; font-weight: 700; line-height: 1; }
.tag-karte.wochentag .slot-leer-plus { color: #0f3d38; }
.tag-karte.wochenende .slot-leer-plus { color: #8a3420; }

/* Meal chip */
.slot-chip {
  align-self: flex-start; display: inline-block;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  font-size: 9.5px; font-weight: 500; text-transform: uppercase;
  padding: 4px 8px 2px; border-radius: 20px; color: #fff;
  letter-spacing: 0.06em; white-space: nowrap;
}

/* Ort-Dropdown */
.ort-option {
  padding: 8px 12px; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: background 0.1s;
}
.ort-option:hover { background: var(--bg); }
.chip-fruehstueck { background: var(--fruehstueck); }
.chip-mittag      { background: var(--mittag); }
.chip-abend       { background: var(--abend); }
.chip-ort-home    { background: #c87941; }
.chip-ort-away    { background: #2d7d6f; }
.chip-ausnahme    { background: #9e9696; }
.ausnahme-badge   { font-size: 11px; font-weight: 500; color: #9e9696; letter-spacing: 0.02em; }

/* ── Zutaten-Liste im Gericht-Modal ─────────────── */
.zutat-zeile { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.zutat-zeile .zutat-name { flex: 1; }
.zutat-zeile .zutat-menge { width: 72px; }
.zutat-zeile .zutat-einheit { width: 68px; }
.zutat-zeile .zutat-loeschen {
  background: none; border: none; color: var(--text-leicht);
  cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1;
}
.zutat-zeile .zutat-loeschen:hover { color: var(--danger); }
.btn-zutat-hinzufuegen {
  margin-top: 2px; font-size: 13px; padding: 4px 10px;
  border: 1.5px dashed var(--rand-1); background: none;
  border-radius: var(--r-s); color: var(--text-leicht); cursor: pointer;
}
.btn-zutat-hinzufuegen:hover { border-color: var(--akzent); color: var(--akzent); }

/* ── Foto-Slots im Gericht-Modal ─────────────── */
.foto-slots { display: flex; gap: 12px; }
.foto-slot {
  position: relative; width: 120px; height: 120px;
  border: 1.5px dashed var(--rand-1); border-radius: var(--r-s);
  cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.foto-slot:hover { border-color: var(--akzent); }
.foto-vorschau { width: 100%; height: 100%; object-fit: cover; }
.foto-platzhalter { font-size: 13px; color: var(--text-leicht); }
.foto-entfernen {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.foto-entfernen:hover { background: var(--danger); }

/* Dish name */
.slot-gerichtname {
  font-size: 12px; font-weight: 700; line-height: 16px;
  max-height: 32px; overflow: hidden; hyphens: auto;
}
.tag-karte.wochentag .slot-gerichtname { color: #0f3d38; }
.tag-karte.wochenende .slot-gerichtname { color: #2b1a0d; }

/* Macro line */
.slot-makros { font-size: 10.5px; font-weight: 700; text-align: right; white-space: nowrap; }
.tag-karte.wochentag .slot-makros  { color: #1e4a44; }
.tag-karte.wochenende .slot-makros { color: #6b3d1c; }

/* ── Filter ─────────────────────────────────────── */
.filter-leiste { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-leiste input,
.filter-leiste select {
  padding: 6px 10px; border: 1px solid var(--rand-1); border-radius: var(--r-s);
  font-size: 13px; background: var(--surface); color: var(--text); font-family: inherit;
}
.filter-leiste input { flex: 1; min-width: 120px; }
.filter-checkbox { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* ── Körperwerte ────────────────────────────────── */
.kw-formular { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.kw-kennzahlen { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.kw-kachel {
  background: var(--surface); border: 1px solid var(--rand-1);
  border-top: 3px solid var(--akzent);
  border-radius: var(--r); padding: 16px 24px; min-width: 120px;
}
.kw-kachel .label   { font-size: 12px; color: var(--text-leicht); font-weight: 500; }
.kw-kachel .wert    { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -0.5px; color: var(--akzent); }
.kw-kachel .einheit { font-size: 13px; color: var(--text-leicht); }
.trend-positiv { color: var(--danger); }
.trend-negativ { color: var(--success); }
.trend-neutral { color: var(--text-leicht); }

.chart-wrap { position: relative; height: 280px; }

/* ── Meldungen ──────────────────────────────────── */
.meldung { padding: 12px 16px; border-radius: var(--r-s); font-size: 14px; margin-bottom: 16px; display: none; }
.meldung.sichtbar { display: block; }
.meldung-erfolg { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.meldung-fehler { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Modal ──────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.sichtbar { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--rand-1);
  border-radius: var(--r); padding: 32px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.modal-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-kopf h2 { margin: 0; color: var(--text); }
.modal-schliessen { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-leicht); font-family: inherit; }

/* ── Einkaufsliste ──────────────────────────────── */
.einkaufsliste { list-style: none; }
.einkaufsliste li {
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--rand-1);
}
.einkaufsliste li:last-child { border-bottom: none; }
.einkaufsliste .el-text {
  flex: 1; background: none; border: none;
  font-size: 14px; font-family: inherit; color: var(--text);
  padding: 10px 4px; line-height: 1.4;
}
.einkaufsliste .el-text:focus { outline: none; color: var(--akzent); }
.einkaufsliste .el-loeschen {
  background: none; border: none; color: var(--text-leicht);
  cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1; opacity: 0;
  transition: opacity 0.15s;
}
.einkaufsliste li:hover .el-loeschen { opacity: 0.4; }
.einkaufsliste .el-loeschen:hover { color: var(--danger); opacity: 1 !important; }
.einkauf-aktionen { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rand-1); }

/* ── KI-Inbox ───────────────────────────────────── */
.vorschlag-karte {
  background: var(--surface); border: 1px solid var(--rand-1);
  border-radius: var(--r); padding: 16px 24px; margin-bottom: 8px;
}
.vorschlag-karte .vorschlag-kopf {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; margin-bottom: 8px;
}
.vorschlag-karte h3 { font-size: 14px; font-weight: 600; }
.vorschlag-aktionen { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Tags ───────────────────────────────────────── */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.tag-fruehstueck { background: #fef3c7; color: #92400e; }
.tag-mittag      { background: #d1fae5; color: #065f46; }
.tag-abend       { background: #ede9fe; color: #4c1d95; }
.tag-offen       { background: #fef3c7; color: #92400e; }
.tag-angenommen  { background: #d1fae5; color: #065f46; }
.tag-abgelehnt   { background: #fee2e2; color: #991b1b; }

/* ── Login ──────────────────────────────────────── */
#login-seite {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--tb-bg);
}
.login-box {
  background: var(--surface); border-radius: var(--r);
  padding: 48px 40px; width: 100%; max-width: 380px;
}
.login-box h1 { font-size: 24px; margin-bottom: 6px; letter-spacing: -0.3px; }
.login-box .subtitle { color: var(--text-leicht); font-size: 13px; margin-bottom: 32px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1100px) {
  .woche-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .tag-kopf { padding: 8px 6px; }
  .slot-karte { height: 80px; }
  .slot-chip { font-size: 8px; padding: 1px 5px; }
  .slot-gerichtname { font-size: 11px; }
  .slot-makros { font-size: 9px; }
}

@media (max-width: 900px) {
  nav#topbar { padding: 0 12px; }
  .topbar-logo { padding-right: 12px; margin-right: 4px; font-size: 16px; }
  nav#topbar li a { padding: 0 10px; font-size: 12px; }
  .topbar-einst { padding: 0 10px; }
  main#inhalt { padding: 16px 12px; }
}

/* ── Mobile (iPhone) ────────────────────────────── */
@media (max-width: 600px) {
  /* Topbar: Hamburger-Menü */
  .topbar-menu-toggle { display: flex; }
  nav#topbar { flex-wrap: wrap; height: auto; min-height: var(--tb-h); padding: 0 12px; }
  nav#topbar ul,
  nav#topbar .topbar-rechts {
    display: none; flex-direction: column; align-items: stretch;
    flex-basis: 100%; width: 100%;
    border-top: 1px solid var(--tb-linie);
    margin-left: 0; padding-left: 0; border-left: none;
  }
  nav#topbar.menu-offen ul,
  nav#topbar.menu-offen .topbar-rechts { display: flex; }
  nav#topbar li a { padding: 12px 4px; font-size: 14px; }
  .topbar-einst { padding: 12px 4px; }
  .topbar-nutzer { border-left: none; margin-left: 0; padding: 12px 4px; }

  /* Wochenplaner: horizontales Swipe-Grid */
  .woche-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; gap: 10px; padding-bottom: 4px;
  }
  .tag-karte { flex: 0 0 85vw; max-width: 340px; scroll-snap-align: start; }
  .slot-karte { height: auto; min-height: 76px; }
  .slot-chip { font-size: 11px; padding: 3px 9px 2px; }
  .slot-gerichtname { font-size: 14px; line-height: 18px; max-height: 36px; }
  .slot-makros { font-size: 12px; }
  .tag-zusammenfassung { font-size: 11px; }
  .woche-toolbar { flex-wrap: wrap; }

  /* Touch-Ziele ≥44×44px */
  .woche-nav-pfeil { width: 44px; height: 44px; }
  .bewertung-input button { width: 44px; height: 44px; }
  .zutat-zeile .zutat-loeschen { padding: 13px 10px; margin: -13px -10px -13px 0; }
  .foto-entfernen { position: relative; }
  .foto-entfernen::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 44px; height: 44px;
  }
  .toggle-switch { width: 48px; height: 28px; }
  .toggle-slider::before { width: 22px; height: 22px; left: 3px; top: 3px; }
  .toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
  .modal-schliessen { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 22px; }

  /* Gericht-Karte (Slot-Modal Tippen-Weg) */
  .gericht-karte { padding: 14px 16px; }
  .gericht-karte .gericht-name { font-size: 15px; }

  /* Bibliothek-Karte */
  .bib-karte { flex-wrap: wrap; row-gap: 8px; }
  .bib-info { flex-basis: calc(100% - 26px); }
  .bib-kennzahlen { flex-basis: 100%; }
  .bib-aktionen { flex-basis: 100%; justify-content: flex-end; }

  /* Formulare im Gericht-Modal */
  .form-reihe { flex-direction: column; gap: 0; }
  .zutat-zeile .zutat-menge { width: 64px; }
  .zutat-zeile .zutat-einheit { width: 60px; }
  .foto-slots { flex-wrap: wrap; }
  .foto-slot { width: calc(50% - 6px); height: auto; aspect-ratio: 1 / 1; }

  /* Modals allgemein */
  .modal-overlay { padding: 16px; }
  .modal { padding: 18px; max-width: calc(100vw - 24px); }

  /* Login */
  .login-box { padding: 32px 24px; }
}
