/* NutriGiro
   Handy: Menü unten, eine Spalte.
   Tablet und PC (ab 900 px): Menü links, Inhalte in zwei Spalten,
   Fenster für Artikel als Leiste am rechten Rand. */

:root {
  --blau: #1f6f8b;
  --blau-dunkel: #134b5f;
  --blau-hell: #e3f1f6;
  --gruen: #2e7d32;
  --gelb: #f4b63f;
  --gelb-hell: #fff4d9;
  --rot: #c62828;
  --rot-hell: #fdecea;
  --text: #1d2a30;
  --text-leise: #52656e;
  --rand: #cfdde3;
  --flaeche: #ffffff;
  --grund: #f3f7f9;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(20, 50, 70, 0.08), 0 4px 14px rgba(20, 50, 70, 0.08);
  --schrift: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --navi-hoehe: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--grund);
  -webkit-tap-highlight-color: transparent;
}
h1 { font-size: 1.6rem; margin: 0.2em 0 0.5em; line-height: 1.2; }
h1:focus { outline: none; }
h2 { font-size: 1.15rem; margin: 1.4em 0 0.5em; }
h3 { font-size: 1rem; margin: 1em 0 0.4em; }
a { color: var(--blau); }
img { max-width: 100%; }
.leise { color: var(--text-leise); }
.klein { font-size: 0.85rem; }
.versteckt { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
[hidden] { display: none !important; }

/* ---------- Grundgerüst ---------- */
.haupt {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--navi-hoehe) + 32px + env(safe-area-inset-bottom));
}
.haupt:focus { outline: none; }

/* Kopfzeile mit dem Konto-Knopf (Modul „Konto“) */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px 0;
}
.kopf__marke { min-width: 0; font-weight: 800; color: var(--blau-dunkel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf__haushalt { font-weight: 500; color: var(--text-leise); }
.kopf__haushalt:not(:empty)::before { content: "· "; }
.kopf__rechts { display: flex; align-items: center; gap: 8px; flex: none; }
/* Fragezeichen öffnet die Bedienungsanleitung (PDF in hilfe/) */
.kopf__hilfe {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 800; font-size: 1.15rem; text-decoration: none;
  color: var(--blau-dunkel); background: var(--flaeche); border: 2px solid var(--rand);
}
.kopf__hilfe:hover { background: var(--blau-hell); }
.kopf__hilfe:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
/* Farben des Konto-Fensters passend zur App (stärker als :root in konto.css) */
html:root {
  --konto-text: var(--text);
  --konto-leise: var(--text-leise);
  --konto-grund: var(--flaeche);
  --konto-flaeche: var(--grund);
  --konto-rand: var(--rand);
  --konto-akzent: var(--blau);
  --konto-akzent-dunkel: var(--blau-dunkel);
  --konto-akzent-hell: var(--blau-hell);
  --konto-link: var(--blau);
  --konto-gefahr: var(--rot);
  --konto-gefahr-hell: var(--rot-hell);
  --konto-hinweis: var(--gelb-hell);
  --konto-schrift: var(--schrift);
}

.navi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--navi-hoehe) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--flaeche);
  border-top: 1px solid var(--rand);
}
.navi__marke { display: none; }
.marke { display: inline-flex; align-items: center; }
.marke__logo { width: 1.5em; height: 1.5em; margin-right: .4em; vertical-align: -.4em; flex: none; }
.navi__link {
  font: inherit; background: none; border: 0; cursor: pointer;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; font-size: 0.75rem; color: var(--text-leise); text-decoration: none;
}
.navi__symbol { font-size: 1.35rem; line-height: 1; }
.navi__link[aria-current="page"] { color: var(--blau); font-weight: 700; }
.navi__link:focus-visible { outline: 3px solid var(--blau); outline-offset: -3px; }

.demo { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--gelb-hell); color: #5c3a00; font-weight: 600; font-size: 0.9rem; }

/* ---------- Knöpfe und Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px;
  font: inherit; font-weight: 650; color: #fff; text-decoration: none;
  background: var(--blau); border: 2px solid var(--blau); border-radius: 12px;
  cursor: pointer; touch-action: manipulation;
}
.btn:hover { background: var(--blau-dunkel); border-color: var(--blau-dunkel); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn:focus-visible, .rund:focus-visible, .chip:focus-visible, .vorlage:focus-visible, .artikel:focus-visible, .karte:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.btn--hell { color: var(--blau-dunkel); background: var(--flaeche); border-color: var(--rand); }
.btn--hell:hover { background: var(--blau-hell); border-color: var(--blau); }
.btn--schwarz { color: #fff; background: #000; border-color: #000; }
.btn--gefahr { color: var(--rot); background: var(--flaeche); border-color: #efb4ae; }
.btn--gefahr:hover { background: var(--rot-hell); border-color: var(--rot); }
.btn--klein { min-height: 38px; padding: 6px 12px; font-size: 0.9rem; }
.link { padding: 6px 0; font: inherit; color: var(--blau); background: none; border: 0; text-decoration: underline; cursor: pointer; justify-self: start; }

.rund {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  font: inherit; font-size: 1.1rem; color: var(--blau-dunkel);
  background: var(--flaeche); border: 1.5px solid var(--rand); border-radius: 50%; cursor: pointer;
}
.rund:disabled { opacity: 0.35; cursor: default; }
.rund--klein { width: 32px; height: 32px; font-size: 1rem; }
.rund--gefahr { color: var(--rot); }

.chip {
  min-height: 36px; padding: 4px 12px;
  font: inherit; font-size: 0.9rem; color: var(--blau-dunkel);
  background: var(--blau-hell); border: 1px solid #b9dbe6; border-radius: 999px; cursor: pointer;
}

.form { display: grid; gap: 12px; margin: 8px 0; }
.feld { display: grid; gap: 4px; font-weight: 600; font-size: 0.92rem; min-width: 0; }
.feld input, .feld select, .feld textarea {
  width: 100%; min-height: 46px; padding: 9px 11px;
  font: inherit; font-weight: 400; font-size: 1rem; color: inherit;
  background: var(--flaeche); border: 1.5px solid var(--rand); border-radius: 10px;
}
.feld input:focus, .feld select:focus { outline: 3px solid #9fd0e2; border-color: var(--blau); }
.code { text-transform: uppercase; letter-spacing: 0.14em; font-family: ui-monospace, Menlo, Consolas, monospace; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.adresse { display: grid; gap: 10px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zwei--plz { grid-template-columns: 7rem 1fr; }
.reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.haken { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 500; }
.haken input { width: 22px; height: 22px; }

.meldung { min-height: 1.2em; margin: 6px 0; font-weight: 600; }
.meldung.is-fehler { color: var(--rot); }
.meldung.is-ok { color: var(--gruen); }
.trenner { display: flex; align-items: center; gap: 10px; color: var(--text-leise); font-size: 0.9rem; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--rand); }
.stapel { display: grid; gap: 10px; }

.kasten { padding: 14px 16px; margin: 0 0 16px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.kasten > h2:first-child, .kasten > summary { margin-top: 0; }
details.kasten > summary { cursor: pointer; font-weight: 700; }
details.kasten[open] > summary { margin-bottom: 10px; }

.zurueck { display: inline-block; margin-bottom: 4px; text-decoration: none; font-weight: 600; }
.kopfzeile { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kopfzeile h1 { margin-bottom: 0.1em; }
.ort { margin: 0 0 8px; font-weight: 600; color: var(--text-leise); }

.abzeichen { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: #6b4300; background: var(--gelb-hell); border: 1px solid #f0d08a; }
.abzeichen--leise { color: var(--blau-dunkel); background: var(--blau-hell); border-color: #b9dbe6; margin-left: 8px; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste > li + li { border-top: 1px solid #e6eef1; }
.liste.kompakt > li { padding: 6px 0; }

.spalten { display: grid; gap: 16px; }
.spalten > * { min-width: 0; }

/* ---------- Geräte-Übersicht ---------- */
.karten { display: grid; gap: 12px; margin-bottom: 16px; }
.karte {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; color: inherit; text-decoration: none;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten);
}
.karte:hover { border-color: var(--blau); }
.karte-zeile { display: flex; gap: 8px; align-items: stretch; }
.karte-zeile .karte { flex: 1; min-width: 0; }
.karte__anpassen {
  flex: none; display: grid; place-content: center; justify-items: center; gap: 2px;
  min-width: 76px; padding: 8px; font-size: 0.8rem; font-weight: 600; color: var(--blau-dunkel); text-decoration: none;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten);
}
.karte__anpassen span:first-child { font-size: 1.3rem; }
.karte__anpassen:hover { border-color: var(--blau); }
.karte__bild {
  flex: none; display: grid; place-items: center;
  width: 64px; height: 64px; font-size: 2rem;
  background: var(--blau-hell) center / cover no-repeat; border-radius: 10px;
}
.karte__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.karte__text strong { font-size: 1.05rem; }
.karte__ort { font-size: 0.9rem; }

.warnbox { padding: 12px 16px; margin: 0 0 16px; background: var(--gelb-hell); border: 1px solid #f0d08a; border-radius: var(--radius); }
.warnbox h2 { margin-top: 0; }
.warnzeile { display: flex; flex-wrap: wrap; gap: 0 6px; padding: 7px 0; color: inherit; text-decoration: none; }
.warnzeile .klein { flex-basis: 100%; }
.warnzeile.is-abgelaufen span:nth-child(2) { color: var(--rot); font-weight: 700; }

/* ---------- Vorlagen und Aufbau ---------- */
.vorlagen { display: grid; gap: 10px; }
.vorlage {
  display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; text-align: left;
  padding: 12px; font: inherit; color: inherit;
  background: var(--flaeche); border: 2px solid var(--rand); border-radius: var(--radius); cursor: pointer;
}
.vorlage__symbol { grid-row: span 2; font-size: 1.8rem; }
.vorlage[aria-pressed="true"] { border-color: var(--blau); background: var(--blau-hell); }

.fachliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fachzeile {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: end;
  padding: 10px 12px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px;
}
.fachzeile__felder { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fachzeile__felder .feld:first-child { grid-column: 1 / -1; }
.fachzeile__knoepfe { display: flex; flex-direction: column; gap: 6px; }
.temperatur-feld { display: flex; gap: 4px; align-items: center; min-width: 0; }
.temperatur-feld input { flex: 1 1 auto; min-width: 60px; text-align: center; }
.fachzeile__info { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; }
.reihe--fest { position: sticky; bottom: calc(var(--navi-hoehe) + env(safe-area-inset-bottom)); padding: 10px 0; background: var(--grund); }

.foto-feld { display: grid; gap: 8px; align-content: start; }
.foto-vorschau {
  display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden;
  color: var(--text-leise); background: var(--blau-hell); border: 1.5px dashed var(--rand); border-radius: 12px;
}
.foto-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.geraet-foto { margin: 0 0 16px; }
.geraet-foto img { display: block; width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); cursor: zoom-in; }
.foto-gross { display: block; width: 100%; margin: 0 0 12px; border-radius: 10px; }

/* ---------- Gerät als Schema ---------- */
.schema {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  padding: 10px; margin: 8px 0 16px;
  background: #dfe9ee; border: 3px solid #9fb6c1; border-radius: 22px;
}
/* Handy: Tür unter dem Innenraum; ab 600 px daneben wie beim offenen Kühlschrank */
.schema__innen, .schema__tuer { display: grid; gap: 8px; align-content: start; min-width: 0; }
.schema__tuer { padding-top: 10px; border-top: 3px dashed #9fb6c1; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.schema__tuer::before { content: "Tür"; grid-column: 1 / -1; font-size: 0.8rem; font-weight: 700; color: #3b5360; }
.schema__zeile { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.schema--weinkuehlschrank { background: #ede3e6; border-color: #b9a0a8; }
/* Schränke und Regale: Holz statt Kühlschrank-Blau */
.schema--vorrat, .schema--kuechenschrank, .schema--keller { background: #f1e6d6; border-color: #c4a27a; border-radius: 10px; }

.fach {
  display: grid; gap: 6px; align-content: start; min-width: 0;
  min-height: 72px; padding: 8px;
  background: rgba(255, 255, 255, 0.92); border: 1.5px solid #c3d4dc; border-radius: 10px;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.fach--gemuesefach { background: #eef7ea; border-color: #b8d7ad; }
.fach--frischefach { background: #fbeeee; border-color: #e6b9b9; }
.fach--gefrierschublade { background: #eaf4fb; border-color: #a9cde6; }
.fach--weinrost { background: #f8eef1; border-color: #d9b3bf; }
.fach--tablar { border-bottom: 5px solid #c4a27a; }
.fach--kiste { background: #f6efe4; border-color: #d2b48c; border-style: dashed; }
.fach--tuerfach, .fach--flaschenfach { min-height: 60px; }
.fach.is-ziel { border-color: var(--blau); box-shadow: 0 0 0 3px #9fd0e2; }
.fach__kopf { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fach__name { min-width: 0; font-size: 0.85rem; font-weight: 700; color: #3b5360; overflow-wrap: anywhere; }
.fach__info { font-weight: 500; color: var(--text-leise); }
.fach__inhalt { display: flex; flex-wrap: wrap; gap: 6px; }
.fach__leer { font-size: 0.8rem; color: #8aa0aa; }

.artikel {
  display: inline-grid; gap: 0; text-align: left;
  max-width: 100%; padding: 5px 10px;
  font: inherit; font-size: 0.88rem; line-height: 1.25; color: inherit;
  background: var(--flaeche); border: 1.5px solid #b7cbd4; border-radius: 10px;
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.artikel__name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artikel__menge, .artikel__mhd { font-size: 0.78rem; color: var(--text-leise); }
.artikel.is-bald { border-color: var(--gelb); background: var(--gelb-hell); }
.artikel.is-abgelaufen { border-color: var(--rot); background: var(--rot-hell); }
.artikel.is-abgelaufen .artikel__mhd { color: var(--rot); font-weight: 700; }
.artikel.is-gezogen { opacity: 0.35; }
.artikel--geist {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  box-shadow: 0 10px 24px rgba(20, 50, 70, 0.3); transform-origin: center; cursor: grabbing;
}

/* ---------- Einkauf fotografieren: erkannte Artikel zum Einräumen ---------- */
.foto-einkauf { display: grid; gap: 10px; margin-bottom: 14px; }
.neu-ablage {
  padding: 12px 14px; background: var(--blau-hell);
  border: 2px dashed var(--blau); border-radius: var(--radius);
}
.neu-ablage h2 { margin: 0 0 4px; font-size: 1.05rem; }
.neu-ablage__inhalt { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.artikel--neu { background: var(--flaeche); border-color: var(--blau); box-shadow: var(--schatten); }
.neu-hinweis { border-color: var(--blau); background: var(--blau-hell); }

.listen-artikel {
  display: flex; flex-wrap: wrap; gap: 0 6px; width: 100%; padding: 4px 0; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.listen-artikel .klein { flex-basis: 100%; }
.listen-artikel.is-bald strong { color: #8a5a00; }
.listen-artikel.is-abgelaufen strong { color: var(--rot); }

/* ---------- Haushalt ---------- */
.personen { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.person { display: grid; gap: 4px; padding: 12px 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; }
.person__name { display: flex; align-items: center; flex-wrap: wrap; }
.person .reihe { margin-top: 4px; }
.einladen .code { font-size: 1.2rem; }

/* ---------- Einkauf ---------- */
.einkauf-neu { grid-template-columns: 1fr 7rem auto; align-items: end; }
.einkauf__zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.einkauf__zeile label { display: flex; align-items: center; gap: 10px; flex: 1; min-height: 40px; cursor: pointer; }
.einkauf__zeile input { width: 22px; height: 22px; flex: none; }
.einkauf__zeile.is-erledigt span { text-decoration: line-through; color: var(--text-leise); }
.einkauf-neu.mit-wo { grid-template-columns: 1fr 7rem; }
.einkauf-neu.mit-wo > .btn { align-self: end; }
.einkauf__wo { flex: none; max-width: 9.5rem; min-height: 36px; padding: 4px 6px; font: inherit; font-size: 0.85rem; color: var(--text-leise);
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; }
.einkauf-gruppen { display: grid; gap: 14px; }
.einkauf-gruppe__kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 2px; font-size: 1.05rem; }
.geschaeft-link { font-weight: 700; color: var(--blau); text-decoration: none; }
.geschaeft-link:hover, .geschaeft-link:focus-visible { text-decoration: underline; }
.geschaefte .geschaeft { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.geschaeft__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
a.rund { text-decoration: none; }
.gekauft-bei { max-width: 20rem; }
.zettel__zeile { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.zettel__text { flex: 1; min-width: 0; }
.zettel__text summary { cursor: pointer; }
.zettel__text p { margin: 4px 0 0; }
.zettel-neu { margin-top: 12px; grid-template-columns: 1fr auto; align-items: end; }
.erledigt { margin-top: 16px; }
.erledigt summary { cursor: pointer; color: var(--text-leise); margin-bottom: 6px; }

/* ---------- Verlauf ---------- */
.verlauf__zeile { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 8px 0; }
.verlauf__zeile > .leise { grid-column: 2; font-size: 0.85rem; }
.verlauf__art { grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; color: #fff; background: var(--gruen); }
.is-entnahme .verlauf__art { background: #8a6d3b; }

/* ---------- Fenster und Meldung ---------- */
.dialog {
  width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 20px);
  padding: 0; border: 0; border-radius: 18px;
  color: inherit; background: var(--grund);
  box-shadow: 0 20px 60px rgba(10, 30, 45, 0.35); overflow: auto; overscroll-behavior: contain;
}
.dialog::backdrop { background: rgba(10, 30, 45, 0.45); }
.dialog__inhalt { padding: 18px 18px 22px; }
.dialog__titel { margin-top: 0; font-size: 1.3rem; }
.entnahme { padding: 12px 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; }
.entnahme h3 { margin-top: 0; }
.teilmenge { display: inline-flex; align-items: center; gap: 6px; }
.teilmenge input { width: 5.5rem; min-height: 46px; padding: 8px; font: inherit; border: 1.5px solid var(--rand); border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--navi-hoehe) + 16px + env(safe-area-inset-bottom)); z-index: 100;
  max-width: calc(100vw - 32px); padding: 10px 16px;
  color: #fff; background: #1d2a30; border-radius: 12px; box-shadow: var(--schatten);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.is-sichtbar { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mittlere Breite (grosse Handys quer, kleine Tablets) ---------- */
@media (min-width: 600px) {
  .karten { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
  .vorlagen { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .vorlagen legend { grid-column: 1 / -1; }
  .spalten { grid-template-columns: 1fr 1fr; }
  .einkauf-neu.mit-wo { grid-template-columns: 1fr 7rem 10rem auto; }
  .fachzeile__felder { grid-template-columns: 2fr 1.4fr 1fr minmax(150px, 1fr) 0.8fr; }
  .fachzeile__felder .feld:first-child { grid-column: auto; }
  .fachzeile__knoepfe { flex-direction: row; }
  .schema.hat-tuer { grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr); }
  .schema__tuer { padding-top: 0; padding-left: 8px; border-top: 0; border-left: 3px dashed #9fb6c1; grid-template-columns: 1fr; }
  .schema__tuer::before { display: none; }
}

/* ---------- Tablet und PC: Menü links, Platz nutzen ---------- */
@media (min-width: 900px) {
  :root { --navi-breite: 230px; }
  body.mit-navi { padding-left: var(--navi-breite); }
  .haupt { max-width: 1280px; padding: 24px 32px 48px; }
  body:not(.mit-navi) .haupt { max-width: 860px; }
  .kopf { max-width: 1280px; padding: 16px 32px 0; }
  body:not(.mit-navi) .kopf { max-width: 860px; }
  body.mit-navi .kopf__marke { visibility: hidden; } /* steht schon im Menü links */
  h1 { font-size: 1.9rem; }

  .navi {
    top: 0; right: auto; bottom: 0; width: var(--navi-breite); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 12px;
    border-top: 0; border-right: 1px solid var(--rand);
  }
  .navi__marke { display: grid; padding: 4px 12px 18px; font-weight: 800; font-size: 1.15rem; color: var(--blau-dunkel); }
  .navi__haushalt { font-weight: 500; font-size: 0.9rem; color: var(--text-leise); }
  .navi__link {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 11px 12px; font-size: 1rem; border-radius: 10px;
  }
  .navi__link:hover { background: var(--blau-hell); }
  .navi__link[aria-current="page"] { background: var(--blau-hell); }
  .toast { bottom: 24px; left: calc(50% + var(--navi-breite) / 2); }
  .reihe--fest { bottom: 0; }

  .spalten--start { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
  .spalten--start .karten { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  .spalten--geraet { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
  .spalten--breit { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }
  .seite { position: sticky; top: 24px; }
  .karte__bild { width: 84px; height: 84px; }

  /* Das Schema darf auf dem Tablet hoch werden, Fächer bekommen mehr Platz */
  .schema { padding: 14px; gap: 10px; }
  .fach { min-height: 96px; padding: 10px; }
  .artikel { font-size: 0.95rem; padding: 7px 12px; }

  /* Artikel-Fenster als Leiste rechts, das Gerät bleibt sichtbar */
  .dialog {
    margin: 0 0 0 auto; width: min(480px, 45vw); height: 100dvh; max-height: 100dvh;
    border-radius: 18px 0 0 18px;
  }
  .personen { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (min-width: 1400px) {
  .spalten--geraet { grid-template-columns: minmax(0, 2.4fr) minmax(340px, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .fach { transition: none; }
}
@media (min-width: 900px) { .geraet-foto img { max-height: 320px; } }

/* ---------- Neuer Lagerort aus einem Foto ---------- */
.aus-foto { display: grid; gap: 8px; margin-bottom: 16px; border: 2px dashed var(--blau); background: var(--blau-hell); }
.aus-foto h2 { margin: 0; font-size: 1.05rem; }
.aus-foto p { margin: 0; }
/* ---------- Eigenes Hintergrundbild (js/hintergrund.js) ----------
   Das Bild liegt fest hinter allem, eine helle Schicht darüber hält
   Schrift und Knöpfe lesbar. Karten und Kästen bleiben weiss. */
.hintergrund {
  position: fixed; inset: 0; z-index: -1;
  background: center / cover no-repeat;
  display: none;
}
.hintergrund::after { content: ""; position: absolute; inset: 0; background: rgba(243, 247, 249, 0.8); }
body.mit-hintergrund .hintergrund { display: block; }
body.mit-hintergrund .haupt > h1,
body.mit-hintergrund .haupt h2,
body.mit-hintergrund .haupt > p,
body.mit-hintergrund .kopf { text-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 2px rgba(255, 255, 255, 0.9); }
.fuss { margin: 28px 0 0; font-size: 0.9rem; }
.hintergrund-vorschau { aspect-ratio: 16 / 10; margin-bottom: 12px; }
.hintergrund-vorschau img { width: 100%; height: 100%; object-fit: cover; }
/* Auswahl Kamera oder Galerie */
.foto-quelle { display: flex; flex-direction: column; gap: .6rem; min-width: min(20rem, 80vw); }
