/* Layout: eine schmale Spalte für das iPhone (375 pt breit). Unten die schwebende Leiste (Liste | Essen | Einstellungen).
   Farben: graue Flächen, der Hintergrund mit einem Hauch der Akzentfarbe (Standard Blau, siehe unten „Akzentfarbe“). Hell/Dunkel folgt dem iPhone oder dem Schalter in Einstellungen → Darstellung
   (setzt data-theme="light"/"dark" auf <html>). Bei Farbänderungen auch themeBg() in bedienung.js und theme-color in index.html, ueber.html, about.html, gast.html anpassen. */
:root {
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --ink: #1D1D1D;
  --muted: #686868;
  --line: #E0E0E0;
  --soft: #EBEBEB;
  --accent: #1F6BCF;
  --on-accent: #FFFFFF;
  --warn: #B3361E;
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(255, 255, 255, .6);
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  color-scheme: light; /* auch bei dunklem System: Auswahllisten, Scrollbalken usw. passend zur gewählten Darstellung */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1013; --surface: #1B1B1B; --ink: #EDEDED; --muted: #9E9E9E;
    --line: #2F2F2F; --soft: #242424; --accent: #6AA8FF; --on-accent: #04172E; --warn: #FF8A72;
    --glass: rgba(34, 34, 34, .66); --glass-line: rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1013; --surface: #1B1B1B; --ink: #EDEDED; --muted: #9E9E9E;
  --line: #2F2F2F; --soft: #242424; --accent: #6AA8FF; --on-accent: #04172E; --warn: #FF8A72;
  --glass: rgba(34, 34, 34, .66); --glass-line: rgba(255, 255, 255, .08);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.35 var(--font-ui);
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(env(safe-area-inset-top, 0px) + 26px) calc(28px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
/* Oberer Rand (Uhrzeit, Akku): früher eine Fläche in Hintergrundfarbe gegen das Durchscheinen beim Scrollen.
   Heute unsichtbar, weil iOS 26 dort selbst einen weichen Glas-Effekt zeichnet (die Fläche wirkte wie ein Balken).
   Der Inhalt beginnt beim Start 26px unter der Statusleiste: iOS färbt die Statusleiste nach dem, was direkt
   darunter liegt (das blaue + schimmerte sonst oben rechts durch). */
#topcover {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; pointer-events: none;
  height: calc(env(safe-area-inset-top, 0px) + 14px); /* 14px: siehe gesten.js (Höhe der Statusleiste) */
  background: none; /* unsichtbar: iOS 26 zeichnet unter der Statusleiste selbst einen weichen Glas-Effekt. Das Element bleibt, weil gesten.js daraus die Höhe der Statusleiste abliest. */
}
.wrap { max-width: 560px; margin: 0 auto; }
h2 { font: 700 1.25rem var(--font-display); margin: 0; }
button, input, select { font: inherit; color: inherit; }
/* Aufgeklappte Auswahlliste am PC: Die Felder haben oft einen durchsichtigen Hintergrund, den die Liste übernimmt.
   Feste Farben, sonst steht im Dunkelmodus helle Schrift auf weißem Grund. (Das iPhone zeigt ein eigenes Auswahlrad.) */
select option, select optgroup { background-color: var(--surface); color: var(--ink); }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Kopfzeile der Liste */
.bar { display: flex; align-items: center; gap: 8px; padding: 2px 0 8px; }
.pill {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-weight: 600;
}
.pill span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); flex: none; }
.iconbtn {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.iconbtn svg, .plus svg { display: block; }

/* Eingabe */
.add { display: flex; gap: 8px; margin: 0 0 4px; }
.add input {
  flex: 1; min-width: 0; font-size: 16px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 10px 16px;
}
.plus { width: 44px; height: 44px; flex: none; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }

/* Liste: Gruppenkopf als dünne Zeile, Zeilen ohne eigene Karten */
.grp { display: flex; align-items: center; gap: 8px; margin: 12px 2px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.grp .gname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grpbtn { width: 100%; background: none; border: 0; padding: 0; text-align: left; font-family: inherit; }
.grpbtn .nozone { color: var(--accent); text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 600; }
.grp .cnt { font-variant-numeric: tabular-nums; font-weight: 600; }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.badge.none { background: var(--line); color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.row {
  display: flex; align-items: center; min-height: 46px; padding-right: 12px; border-top: 1px solid var(--line);
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; cursor: pointer;
}
.row:first-child { border-top: 0; }
.row:active { background: var(--soft); }
.chk { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.chk::before { content: ""; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--muted); display: block; }
.done .chk::before {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
  border-color: var(--accent);
}
.txt { flex: 1; min-width: 0; padding: 6px 0; display: grid; gap: 0; }
.nm { overflow-wrap: anywhere; }
.nt { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; line-height: 1.25; }
.qty { font-size: .82rem; background: var(--soft); border-radius: 999px; padding: 1px 9px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 8px; }
.done .nm { text-decoration: line-through; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.donetoggle { margin-top: 12px; }
.tip { text-align: center; color: var(--muted); font-size: .8rem; margin: 14px 0 0; }

.btn { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 600; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--line); }
.btn.danger { background: transparent; color: var(--warn); border: 1.5px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .4; }
.link { background: none; border: 0; color: var(--accent); padding: 8px 0; font-weight: 600; }

/* Läden */
.edhead { display: flex; align-items: center; gap: 8px; padding: 2px 0 8px; }
.edhead input { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.edhead h2 { flex: 1; }
.cards { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.card { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card small { color: var(--muted); display: block; }
.card .go { color: var(--accent); font-weight: 700; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; flex: 1; min-width: 0; }
.hint.live { color: var(--accent); font-weight: 600; }
.plan { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); touch-action: none; }
.plan svg { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; touch-action: none; -webkit-user-select: none; user-select: none; }
.plan svg.drawing { cursor: crosshair; }
.plan .floor { fill: var(--surface); }
.plan .gridline { stroke: var(--line); fill: none; }
.plan .zl { font-weight: 600; font-family: var(--font-ui); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-linejoin: round; }
.plan .num { font-weight: 700; font-family: var(--font-ui); fill: #fff; text-anchor: middle; dominant-baseline: central; }
.plan .zone { cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.plan .handle { fill: var(--surface); stroke: var(--accent); pointer-events: none; }
.zoombar { position: absolute; top: 6px; right: 6px; display: grid; gap: 4px; }
.zoombar button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.15rem; line-height: 1; opacity: .88; }
.planbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.zpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 0 0 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.zpanel input { width: 100%; min-width: 0; font-size: 16px; font-weight: 600; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .85rem; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip.taken { color: var(--muted); }
.chip small { margin-left: 3px; opacity: .8; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.zlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.zitem { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.zitem[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.zitem .zn { flex: 1; min-width: 0; display: grid; }
.zitem small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sheets (Dialog am unteren Rand) */
dialog {
  width: min(560px, 100%); max-width: 100%; margin: auto auto 0; border: 0; border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--surface); color: var(--ink);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(8, 20, 14, .45); }
dialog::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.sheettitle { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 2px 4px 6px; }
.sheetbtn {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 4px; background: none; border: 0;
  border-top: 1px solid var(--line); text-align: left; font-size: 1rem; color: var(--ink);
}
.sheetbtn.on::after { content: "✓"; color: var(--accent); font-weight: 700; }
.sheetbtn.on > small { margin: 0 10px 0 auto; } /* mit Häkchen: Hinweis trotzdem rechts, nicht in der Mitte */
.sheetbtn.accent { color: var(--accent); font-weight: 600; }
.sheetbtn.danger { color: var(--warn); }
.sheetbtn small { color: var(--muted); }
dialog form { display: grid; gap: 8px; }
.field { display: grid; gap: 3px; }
.field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; font-size: 16px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.two { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.sheetnote { color: var(--muted); font-size: .8rem; margin: 0; }
dialog .actions { justify-content: space-between; margin-top: 4px; flex-wrap: nowrap; }
dialog .actions .grp2 { display: flex; gap: 8px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .zitem, .card, .row { transition: background-color .12s, border-color .12s; }
}
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

.row.pending { opacity: .6; }
.prow { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; text-align: left; }
.prow .pl { flex: none; width: 84px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.prow .pv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow::after { content: "›"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.prodrow { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 2px 4px; }
.chips.big { gap: 6px; }
.chips.big .chip { padding: 7px 12px; font-size: .9rem; }
.zpanel .actions { flex-wrap: nowrap; }

/* Eintrag bearbeiten: kompakt */
.namerow { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.namerow input, .notein { width: 100%; min-width: 0; font-size: 16px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.namerow .nameinput { font-weight: 600; }
.srow { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px 0 12px; }
.srow .pl { flex: none; width: 76px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.srow select { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; padding: 12px 0; color: var(--ink); }
dialog .actions { gap: 8px; }

/* Bereiche sortieren */
.zli { display: flex; align-items: stretch; gap: 6px; }
.zli .zitem { flex: 1; min-width: 0; }
.grab { flex: none; width: 44px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.zli.dragging { position: relative; z-index: 5; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.zli.dragging .zitem { border-color: var(--accent); }
dialog form { grid-template-columns: minmax(0, 1fr); }
.srow { min-width: 0; }
.srow select { text-overflow: ellipsis; }
/* Fokus in einer Zeile mit Beschriftung (Kategorie, Bereich, Art …): Rahmen um die ganze Zeile statt nur um das Feld darin.
   Am PC bekommt eine Auswahl den Fokus-Rahmen auch beim Anklicken, er stand dann wie zwei Striche mitten in der Zeile. */
.srow select:focus-visible, .srow input:focus-visible, .gline select:focus-visible { outline: none; }
.srow:has(:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gline select:focus-visible { color: var(--accent); }

/* Details: Foto, aufklappbarer Bereich, Gesten */
dialog { touch-action: none; max-height: calc(100% - 24px); overflow: auto; overscroll-behavior: contain; }
/* Sheets nie unter die Statusleiste. Ist die Tastatur offen, setzt app.js --kb (Höhe der Tastatur)
   und --vvh (sichtbare Höhe): das Sheet sitzt dann direkt über der Tastatur. */
dialog:not(.viewer) {
  margin-bottom: var(--kb, 0px);
  max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 12px);
  transition: margin-bottom .25s ease;
}
html.kb dialog:not(.viewer) { padding-bottom: 12px; }
html.kb #tabbar { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { dialog:not(.viewer) { transition: none; } }
.thumb { width: 34px; height: 34px; flex: none; border-radius: 8px; object-fit: cover; margin-left: 8px; }
.photo { display: grid; gap: 4px; justify-items: start; }
.photo img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 10px; display: block; }
.expanded .photo img { max-height: var(--phfull, 40vh); }
.photoact { display: flex; gap: 16px; }
.photobtn { cursor: pointer; color: var(--ink); padding-block: 11px; }
.photobtn .pv { flex: 1; min-width: 0; color: var(--muted); }
.more { overflow: hidden; height: 0; margin-top: -8px; }
.expanded .more { height: auto; margin-top: 0; }
.moreinner { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.more[inert] .moreinner { opacity: 0; }
.expanded .more .moreinner { opacity: 1; }

.noterow { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; }
.noterow:has(#camBtn[hidden]) { grid-template-columns: minmax(0, 1fr); }
.camlabel { display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--accent); cursor: pointer; }

/* Listen in Sheets */
.scrollbox { max-height: 46vh; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.kwbox { max-height: 28vh; padding: 8px 0; }

/* Autovervollständigung unter dem Eingabefeld: liegt über der Liste, nimmt keinen Platz weg */
.addwrap { position: relative; }
.sugg {
  position: absolute; left: 0; right: 52px; top: 100%; z-index: 20; margin-top: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.sugg[hidden] { display: none; }
.sg {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line);
}
.sg:first-child { border-top: 0; }
.sg:active { background: var(--soft); }
.sgn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgn b { font-weight: 700; }
.sgtag { flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: var(--muted); }
.sgtag.on { color: var(--accent); font-weight: 600; }
.sg.dupnote { padding: 10px 14px; color: var(--accent); font-weight: 600; font-size: .9rem; line-height: 1.3; }
.sg.dupnote .sgn { white-space: normal; }
.row.flash { animation: rowflash 1.1s ease-out; }
@keyframes rowflash { 0%, 55% { background: var(--soft); } 100% { background: transparent; } }

.srowgo { flex: none; width: 40px; height: 40px; border: 0; background: none; color: var(--accent); font-size: 1.7rem; line-height: 1; border-radius: 10px; }

/* Foto im Vollbild */
.photo img { cursor: zoom-in; }
dialog.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0; background: #000; box-shadow: none; touch-action: none; overflow: hidden; }
dialog.viewer::before { display: none; }
dialog.viewer::backdrop { background: #000; }
.viewer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vx { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.6rem; line-height: 1; }

.plantoggle { margin-bottom: 8px; }
.plantoggle.open::after { transform: rotate(90deg); }
.plantoggle .pv { color: var(--muted); }

.bgrow { display: flex; gap: 8px; margin: 6px 0 0; }
.chipbtn { display: grid; place-items: center; width: 36px; height: 36px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--accent); font-size: 1.05rem; font-weight: 700; font-style: italic; font-family: Georgia, serif; cursor: pointer; padding: 0; }
.chipbtn svg { font-style: normal; }
.bgrow + .sheetnote { margin: 6px 2px 0; }

.bgadd { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--accent); font-weight: 600; font-size: .9rem; cursor: pointer; }

.sugg.inl { position: static; margin: -2px 0 10px; box-shadow: none; }

.prowwrap { display: flex; gap: 8px; align-items: stretch; }
.prowwrap .prow { flex: 1; min-width: 0; width: auto; }
.star { flex: none; width: 46px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0; }
.star.on { color: var(--accent); border-color: var(--accent); }
.prowwrap { min-width: 0; }

#toast{position:fixed;inset:auto;left:50%;bottom:calc(var(--kb, 0px) + env(safe-area-inset-bottom) + 18px);transform:translateX(-50%);margin:0;border:0;padding:10px 16px;border-radius:14px;background:#26262b;color:#fff;font-size:14px;line-height:1.3;text-align:center;max-width:calc(100vw - 32px);box-shadow:0 6px 20px rgba(0,0,0,.3)}
#toast:not(:popover-open):not(.fallback){display:none}

.catsearch{margin:0 0 8px}
#catRes .sheetbtn small.on{color:var(--accent);font-weight:600}
#catRes .sheetbtn small.muted{color:#8a8a90;font-weight:400}
#catRes .sheetbtn i{font-style:normal;font-weight:600}

.zpanelli{margin:2px 0 6px}
.zpanelli .zpanel{margin:0}
.zlist:has(.dragging) .zpanelli{display:none}

.listpill{flex:0 1 42%}

/* Essen */
.mact{margin:8px 0 10px}
.mtags{margin:0 0 4px}
.chip.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.mcard{gap:10px}.mcard .mt{flex:1;min-width:0;display:grid;text-align:left}
.mcard small{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mstep{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 8px}
.mstep.inl{display:inline-flex;gap:8px;margin:0 0 0 6px;vertical-align:middle;text-transform:none;letter-spacing:0}
.mpers{font-weight:600;min-width:6.5em;text-align:center}
.stepbtn{width:40px;height:40px;border-radius:999px;border:1.5px solid var(--line);background:var(--surface);font-size:22px;line-height:1;color:var(--text,inherit)}
.stepbtn.sm{width:32px;height:32px;font-size:18px}
.stepbtn:disabled{opacity:.35}
.mings{list-style:none;margin:0;padding:0;max-height:34vh}
.mrow{display:flex;align-items:center;gap:12px;padding:10px 4px;border-bottom:1px solid var(--line)}
.mrow input{width:22px;height:22px;flex:none;accent-color:var(--accent)}
.mrow .mn{flex:1;min-width:0}.mq{color:var(--muted);font-variant-numeric:tabular-nums}
.basic{color:var(--muted);font-size:12px;border:1px solid var(--line);border-radius:6px;padding:0 5px;margin-left:4px}
.ming{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--line)}.ming .mn{flex:1;min-width:0}
.basicbtn{font-size:13px;padding:2px 9px;border-radius:999px;width:auto;height:auto;font-style:normal;font-family:inherit;font-weight:600;display:inline-block}
.basicbtn.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.mphoto{display:block;width:100%;max-height:30vh;object-fit:cover;border-radius:12px;margin:0 0 8px}
.mmore{margin-top:10px}.mmore summary{color:var(--muted);padding:6px 0}
.msteps{white-space:pre-wrap;padding:6px 0}
#dlg textarea.notein{width:100%;resize:vertical;font:inherit}
.ming .chipbtn:not(.basicbtn){width:32px;height:32px}

/* Untere Leiste */
.wrap{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
#tabbar{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;justify-content:center;background:var(--surface);border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom))}
#tabbar button{flex:1;max-width:190px;display:grid;justify-items:center;gap:2px;padding:4px 0;background:none;border:0;color:var(--muted);font-size:11px;font-weight:600}
#tabbar button[aria-current="page"]{color:var(--accent)}

.ming .mqty{width:5.2em;flex:none;font-size:16px;padding:6px 8px;border:1.5px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);text-align:right}
.ming .mqty:placeholder-shown{border-style:dashed}

.tagplus{min-width:36px;font-weight:700;color:var(--accent);padding:4px 12px}
.tagadd{display:inline-flex;align-items:center;gap:6px}
.tagadd input{width:9em;font-size:16px;padding:4px 10px;border:1.5px solid var(--accent);border-radius:999px;background:var(--bg);color:var(--ink)}
.tagadd .chipbtn{width:32px;height:32px;font-style:normal;font-family:inherit}

.nt.ml{display:flex;align-items:center;gap:4px}.nt.ml svg{flex:none}

.donehead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.donehead .donetoggle{margin-top:0}
.clearbtn{color:var(--warn);font-size:.9rem}

#tabbar button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tabbar button{min-width:0}

/* Wischen auf Einträgen */
.row,.swp{position:relative;touch-action:pan-y;transition:transform .18s ease}
.row.swiping,.swp.swiping{transform:translateX(var(--sx,0px));transition:none;z-index:1}
.row::after,.swp::after{content:attr(data-sw);position:absolute;top:0;bottom:0;width:240px;display:none;align-items:center;font-weight:700;color:#fff;font-size:.95rem;opacity:.8}
.row.swiping::after,.swp.swiping::after{display:flex}
.row[data-dir="left"]::after,.swp[data-dir="left"]::after{left:100%;padding-left:16px}
.row[data-dir="right"]::after,.swp[data-dir="right"]::after{right:100%;padding-right:16px;justify-content:flex-end}
.row[data-kind="delete"]::after,.swp[data-kind="delete"]::after{background:#D64533}
.row[data-kind="details"]::after,.row[data-kind="check"]::after,.swp[data-kind="open"]::after,.swp[data-kind="edit"]::after,.swp[data-kind="tolist"]::after{background:var(--accent);color:var(--on-accent)}
.row[data-kind="none"]::after,.swp[data-kind="none"]::after{background:var(--line)}
.row[data-armed="1"]::after,.swp[data-armed="1"]::after{opacity:1}
#toast .toastbtn{margin-left:12px;background:none;border:0;color:color-mix(in srgb,var(--accent) 45%,#fff);font:inherit;font-weight:700;padding:2px 4px}

.cards{overflow-x:clip}

.chip.unused{border-style:dashed;color:var(--muted)}

/* ---------- Seiten (Unterseiten von rechts, siehe openPage in app.js) ---------- */
.wrap, .page { touch-action: pan-y; } /* waagerechtes Wischen gehört der App (Wisch-zurück, Einträge) */
.page {
  position: fixed; left: 0; right: 0; top: var(--vvt, 0px); bottom: var(--kb, 0px); z-index: 15;
  overflow-y: auto; overscroll-behavior: contain; background: var(--bg);
  box-shadow: -10px 0 30px rgba(0, 0, 0, .16);
  padding: 0 max(16px, env(safe-area-inset-left, 0px)) calc(92px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
html.kb .page { padding-bottom: 16px; }
.page > * { max-width: 560px; margin-inline: auto; }
.pagehead {
  display: grid; justify-items: start; gap: 2px;
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 0 10px; /* Abstand zur Statusleiste, wie die Hauptansicht (siehe #topcover) */
}
.wrap .pagehead { position: static; padding-top: 0; }
.pageback {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 44px;
  margin-left: -8px; padding: 0 10px 0 2px; background: none; border: 0; border-radius: 10px;
  color: var(--accent); font-weight: 600;
}
.pageback span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pageback:active { background: var(--soft); }
.pagetitle { font: 700 1.6rem/1.15 var(--font-display); margin: 0; overflow-wrap: anywhere; }
.edhead .pageback { flex: none; margin-left: -8px; }
.pagebody { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.pagebody > .btn { justify-self: start; }
.pagebody .field input, .pagebody .notein, .pagebody .srow, .pagebody .add input { background: var(--surface); }
.pagebody .catsearch { margin: 0; }
.pagebody .sheettitle { padding: 0 4px; }

/* Gruppe von Zeilen auf einer Seite (wie in den iOS-Einstellungen) */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.group[hidden] { display: none; }
.group .sheetbtn { padding: 13px 14px; }
.group .sheetbtn:first-child { border-top: 0; }
.group .sheetbtn:active { background: var(--soft); }
.group > .sheetnote { padding: 12px 14px; }
.pagebody .kwbox { max-height: none; padding: 2px 0; }
.pagebody .mings { max-height: none; overflow: visible; }
.mcard { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } /* langes Drücken ohne iOS-Menü */
.mmore #mSteps { display: block; margin-top: 12px; }
.ming .mname { flex: 1; min-width: 0; font-size: 16px; padding: 6px 8px; border: 1.5px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); text-overflow: ellipsis; }
.ming .mname:focus { border-color: var(--line); background: var(--surface); outline: none; }
.sg.kb { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); } /* mit Pfeiltasten markierter Vorschlag */

/* Einheitliche Kopfzeile in Sheets: Titel links, rechts runder ✕-Knopf (wie iOS 26) */
.sheethead { display: flex; align-items: center; gap: 8px; margin: -8px 0 12px; min-height: 32px; } /* ✕ sitzt 16 px von oben und rechts, wie der Rand links */
.sheethead .sheettitle { flex: 1; min-width: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheetdone { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); }
.sheetdone:active { background: var(--line); }
#editForm .actions { justify-content: flex-start; }

/* Wisch-zurück auch am Seitenrand der Hauptansicht (dort liegt nur body), z. B. bei Geschäfte */
html, body { touch-action: pan-y; }
/* Nach langem Drücken liegt der Finger noch auf dem neuen Sheet: keine versehentliche Textauswahl.
   In Eingabefeldern bleibt Markieren möglich. */
dialog, .page { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
dialog input, dialog textarea, .page input, .page textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Ziehen zum Aktualisieren: kleiner Kreis oben in der Mitte */
#pull {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 4px); z-index: 40; pointer-events: none;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  opacity: 0; transform: translateX(-50%); transition: opacity .2s, transform .2s, background-color .15s;
}
#pull.pulling { transition: none; }
#pull.ready { transition: transform .15s; background: var(--accent); color: var(--on-accent); }
#pull.spin { background: var(--accent); color: var(--on-accent); }
#pull.spin svg { animation: pullspin .9s linear infinite; }
@keyframes pullspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #pull.spin svg { animation: none; } }

/* ---------- Liquid Glass (dezent): schwebende untere Leiste und Sheets ---------- */
#tabbar {
  left: 0; right: 0; margin: 0 auto; width: calc(100% - 24px); max-width: 520px;
  bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) - 10px));
  padding: 5px; border-radius: 999px; border: 1px solid var(--glass-line);
  background: color-mix(in srgb, var(--surface) var(--bar-p, 72%), transparent);
  -webkit-backdrop-filter: blur(var(--bar-blur, 22px)) saturate(1.8); backdrop-filter: blur(var(--bar-blur, 22px)) saturate(1.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16), 0 0 0 .5px var(--line);
}
#tabbar button { border-radius: 999px; padding: 5px 0; }
#tabbar button[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wrap { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
.page { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
#toast { bottom: calc(var(--kb, 0px) + env(safe-area-inset-bottom, 0px) + 78px); }
html.kb #toast { bottom: calc(var(--kb, 0px) + 12px); }

dialog:not(.viewer) {
  width: min(560px, calc(100% - 16px)); border-radius: 28px;
  margin-bottom: calc(var(--kb, 0px) + 8px);
  max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 20px);
  padding-bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) - 6px));
  background: color-mix(in srgb, var(--surface) var(--sheet-p, 86%), transparent);
  -webkit-backdrop-filter: blur(var(--sheet-blur, 28px)) saturate(1.6); backdrop-filter: blur(var(--sheet-blur, 28px)) saturate(1.6);
  border: 1px solid var(--glass-line); box-shadow: 0 12px 50px rgba(0, 0, 0, .3);
}
html.kb dialog:not(.viewer) { padding-bottom: 14px; }
dialog::backdrop { background: rgba(0, 0, 0, .32); }

/* Akzentfarbe (Einstellungen → Darstellung): data-accent auf <html>, ohne = Blau (oben in :root). Je Farbe hell und dunkel.
   Neue Farbe: auch in ACCENTS in bedienung.js eintragen (Name, Farbe hell und dunkel). */
:root[data-accent="gruen"] { --accent: #0E7A55; --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="gruen"] { --accent: #4CD49B; --on-accent: #04261A; } }
:root[data-theme="dark"][data-accent="gruen"] { --accent: #4CD49B; --on-accent: #04261A; }
:root[data-accent="blau"] { --accent: #1F6BCF; --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="blau"] { --accent: #6AA8FF; --on-accent: #04172E; } }
:root[data-theme="dark"][data-accent="blau"] { --accent: #6AA8FF; --on-accent: #04172E; }
:root[data-accent="lila"] { --accent: #7A4FD0; --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="lila"] { --accent: #B79BFF; --on-accent: #1E0E40; } }
:root[data-theme="dark"][data-accent="lila"] { --accent: #B79BFF; --on-accent: #1E0E40; }
:root[data-accent="orange"] { --accent: #C25A00; --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="orange"] { --accent: #FFA552; --on-accent: #2E1500; } }
:root[data-theme="dark"][data-accent="orange"] { --accent: #FFA552; --on-accent: #2E1500; }
:root[data-accent="pink"] { --accent: #C2306B; --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="pink"] { --accent: #FF7FAE; --on-accent: #3A0A1D; } }
:root[data-theme="dark"][data-accent="pink"] { --accent: #FF7FAE; --on-accent: #3A0A1D; }
/* Nur der Hintergrund (--bg) bekommt einen Hauch der Akzentfarbe: feste Helligkeit, Farbton (h) von --accent,
   Sättigung (c) als kleiner Anteil davon (Grau als eigene Farbe gibt also Grau). Karten, Linien und Schrift bleiben rein grau.
   Ältere Browser ohne „oklch(from …)“ behalten den festen Wert oben (passt zu Blau). Gleiche Rechnung in themeBg() in bedienung.js (Statusleiste). */
@supports (color: oklch(from red l calc(c * .5) h)) {
  :root { --bg: oklch(from var(--accent) .9654 calc(c * .023) h); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: oklch(from var(--accent) .1724 calc(c * .053) h); } }
  :root[data-theme="dark"] { --bg: oklch(from var(--accent) .1724 calc(c * .053) h); }
}
.swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; background: var(--c); display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
/* Eigene Akzentfarbe: Werte für hell/dunkel berechnet app.js (lesbar gemacht) und setzt sie als --cust-* auf <html> */
:root[data-accent="custom"] { --accent: var(--cust-l); --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="custom"] { --accent: var(--cust-d); --on-accent: var(--cust-od); } }
:root[data-theme="dark"][data-accent="custom"] { --accent: var(--cust-d); --on-accent: var(--cust-od); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#f33, #fc3, #3c6, #3cf, #36f, #c3f, #f33); cursor: pointer; }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.swatch.custom .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; pointer-events: none; }
.swatch.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c, var(--accent)); }
/* Glas-Stärke (Einstellungen → Darstellung → Glas): app.js setzt --bar-p/--bar-blur/--sheet-p/--sheet-blur. Heller Rand oben wie bei echtem Glas. */
#tabbar { box-shadow: 0 8px 30px rgba(0, 0, 0, .16), 0 0 0 .5px var(--line), inset 0 1px 0 var(--glass-line); }
.glassrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.glassrow input { flex: 1; accent-color: var(--accent); }
.glassrow output { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
dialog::backdrop { background: rgba(0, 0, 0, var(--dim, .32)); }
dialog:not(.viewer) .notein, dialog:not(.viewer) .field input, dialog:not(.viewer) .namerow input, dialog:not(.viewer) .srow,
dialog:not(.viewer) .camlabel, dialog:not(.viewer) .btn.danger, dialog:not(.viewer) .btn.ghost, dialog:not(.viewer) .prow {
  background: color-mix(in srgb, var(--bg) var(--field-p, 100%), transparent);
}
/* Mehr Teile im Sheet folgen der Glas-Stärke (Essen: ± Knöpfe, Zutatenliste, Haken) */
dialog:not(.viewer) .stepbtn, dialog:not(.viewer) .chipbtn, dialog:not(.viewer) .chip, dialog:not(.viewer) .bgadd {
  background: color-mix(in srgb, var(--surface) var(--field-p, 100%), transparent);
}
dialog:not(.viewer) .mrow input { opacity: .95; }

/* Glas-Eindruck (Nachahmung von Liquid Glass; echte Lichtbrechung kann Safari nicht):
   schräger Lichtreflex über der Fläche, helle Lichtkante oben, feine Kante unten, weicher Schatten. */
:root { --glass-hi-0: rgba(255, 255, 255, .55); --glass-sheen-0: rgba(255, 255, 255, .28); }
:root { --glass-hi: color-mix(in srgb, var(--glass-hi-0) var(--sheen-p, 100%), transparent); --glass-sheen: color-mix(in srgb, var(--glass-sheen-0) var(--sheen-p, 100%), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass-hi-0: rgba(255, 255, 255, .16); --glass-sheen-0: rgba(255, 255, 255, .07); } }
:root[data-theme="dark"] { --glass-hi-0: rgba(255, 255, 255, .16); --glass-sheen-0: rgba(255, 255, 255, .07); }
#tabbar, dialog:not(.viewer) {
  background-image: linear-gradient(135deg, var(--glass-sheen) 0%, transparent 38%, transparent 68%, var(--glass-sheen) 100%);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 color-mix(in srgb, var(--glass-hi) 40%, transparent),
    inset 0 0 0 .5px color-mix(in srgb, var(--glass-hi) 50%, transparent), 0 10px 34px rgba(0, 0, 0, .2);
}
#tabbar { background-color: color-mix(in srgb, var(--surface) var(--bar-p, 72%), transparent); }
dialog:not(.viewer) { background-color: color-mix(in srgb, var(--surface) var(--sheet-p, 86%), transparent); }
.stepbtn { display: inline-grid; place-items: center; padding: 0; vertical-align: middle; } .stepbtn svg { display: block; } .stepbtn.sm svg { width: 15px; height: 15px; }
/* Ausblenden am Rand scrollbarer Listen (app.js setzt more-t / more-b) */
.scrollbox { --ft: 0px; --fb: 0px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%); }
.scrollbox.more-b { --fb: 44px; }
.scrollbox.more-t { --ft: 24px; }
/* Essen-Sheet: Knöpfe in einer Reihe, Zutaten bekommen mehr Platz */
.mealacts { flex-wrap: nowrap; }
.mealacts #mAddBtn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.diceBtn { flex: none; display: grid; place-items: center; padding: 0 12px; }
.mealacts { margin-top: 10px; }
/* Würfel wackelt beim Neu-Würfeln */
.diceBtn svg { display: block; }
.diceBtn.roll svg { animation: diceroll .6s cubic-bezier(.3, .7, .3, 1); }
@keyframes diceroll { 0% { transform: rotate(0) scale(1); } 20% { transform: rotate(-28deg) scale(1.15); } 45% { transform: rotate(22deg) scale(1.1); } 65% { transform: rotate(-12deg); } 85% { transform: rotate(5deg); } 100% { transform: rotate(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .diceBtn.roll svg { animation: none; } }
/* Essen-Sheet: nicht das Sheet scrollt, sondern nur die Zutatenliste; sie füllt den Platz bis unten */
dialog[open]:has(> .mings) { display: flex; flex-direction: column; overflow: hidden; }
dialog:has(> .mings) > * { flex: none; }
dialog > .mings { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
/* Essen-Sheet (Stand nach Test): höchstens 60 % der Bildschirmhöhe, Knöpfe unter der Liste,
   unten blenden etwa 1,5 Zeilen weich aus */
dialog[open]:has(> .mings) { max-height: min(60dvh, calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 20px)); }
dialog > .mings { padding-bottom: 0; }
dialog > .mings.more-b { --fb: 96px; }
dialog:not(.viewer) .mealacts .btn.ghost { background: color-mix(in srgb, var(--surface) 92%, transparent); }
/* Essen-Sheet hochgezogen: groß (90 %), oben bleibt ein Streifen frei */
dialog.tall[open]:has(> .mings) { max-height: min(90dvh, calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 20px)); }
/* Solange der Finger nach langem Drücken noch liegt: keine Textauswahl, Eingabefelder reagieren nicht (app.js: holdAfterLongPress) */
html.lphold, html.lphold * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
html.lphold input, html.lphold textarea, html.lphold select { pointer-events: none; }
/* Abbild einer Ansicht für Übergänge bei Geschäfte/Editor (app.js: wrapGhost). Liegt unter (Standard) oder über (top) der echten Ansicht. */
.wrapghost {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 26px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}
.wrapghost.top { z-index: 14; box-shadow: -10px 0 30px rgba(0, 0, 0, .16); }
.wrapghost .wrap { padding-bottom: 0; }
/* Echte Ansicht, solange sie über einem Abbild gleitet: deckend und über die ganze Breite */
.wrap.slide { position: relative; z-index: 1; background: var(--bg); min-height: 100vh; margin: 0 -16px; padding-left: 16px; padding-right: 16px; max-width: none; box-shadow: -10px 0 30px rgba(0, 0, 0, .16); }
/* Kategorien sortieren: Zeile mit Griff rechts (Einstellungen → Kategorien) */
.catrow { display: flex; align-items: stretch; border-top: 1px solid var(--line); background: var(--surface); }
.catrow:first-child { border-top: 0; }
.catrow .sheetbtn { flex: 1; min-width: 0; border-top: 0; }
.catrow .grab { width: 46px; border-radius: 0; }
.catrow .nograb { cursor: default; }
.catrow.dragging { position: relative; z-index: 5; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); border-radius: 12px; }
.group:has(.dragging) { overflow: visible; }

/* Wackelmodus (Sortieren nach langem Drücken): Zeilen wackeln leicht, Ziehen verschiebt sie */
@keyframes wiggle { from { transform: rotate(-.45deg) translateX(-.5px); } to { transform: rotate(.45deg) translateX(.5px); } }
.wiggle > .catrow:not(.dragging):not([data-key="sonst"]), .wiggle > .zli:not(.dragging) { animation: wiggle .2s ease-in-out infinite alternate; }
.wiggle > :nth-child(2n):not(.dragging) { animation-delay: -.1s; }
.wiggle > .catrow:not([data-key="sonst"]), .wiggle > .zli { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.wiggle > .catrow[data-key="sonst"] { opacity: .55; }
.wiggle .sheetbtn small { visibility: hidden; } /* „›“ und Zahl ausblenden: Antippen öffnet gerade nichts */
@media (prefers-reduced-motion: reduce) {
  .wiggle > .catrow:not([data-key="sonst"]), .wiggle > .zli { animation: none; outline: 1.5px dashed var(--accent); outline-offset: -3px; }
}
.wigglebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 4px; color: var(--accent); font-weight: 600; font-size: .9rem; }
/* Kategorien: immer einzelne Karten (wie die Bereiche), damit der Wackelmodus gleich aussieht */
#catRows { display: grid; gap: 6px; background: none; border: 0; overflow: visible; }
#catRows > .catrow { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
/* Einheitlicher Abstand zwischen Karten in allen Listen (Einstellungen, Geschäfte, Essen, Kategorien, Bereiche) */
:root { --list-gap: 4px; }
.cards, .zlist, #catRows { gap: var(--list-gap); }

/* ---------- Querformat auf dem Handy: wenig Höhe, also alles flacher ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  /* Leiste: flach, Symbol neben dem Text, schmaler */
  #tabbar { max-width: 420px; padding: 3px; bottom: max(6px, calc(env(safe-area-inset-bottom, 0px) - 14px)); }
  #tabbar button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 0; font-size: 12px; }
  #tabbar button svg { width: 20px; height: 20px; }
  .wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .page { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  #toast { bottom: calc(var(--kb, 0px) + env(safe-area-inset-bottom, 0px) + 58px); }
  /* Seiten: kleinere Kopfzeile */
  .pagehead { padding-bottom: 4px; }
  .pagetitle { font-size: 1.3rem; }
  .pageback { min-height: 36px; }
  /* Sheets dürfen fast die ganze Höhe nutzen (auch das Essen-Sheet) */
  dialog:not(.viewer), dialog[open]:has(> .mings), dialog.tall[open]:has(> .mings) { max-height: calc(var(--vvh, 100dvh) - 12px); }
  dialog:not(.viewer) { margin-bottom: calc(var(--kb, 0px) + 6px); }
  /* Grundriss nicht höher als der Bildschirm */
  .plan svg { width: auto; max-width: 100%; max-height: calc(100dvh - 130px); margin: 0 auto; }
}
/* Kleiner Gruppen-Hinweis (z. B. „👥 Einkauf · …“) bei Listen und Geschäften: schlichter Text, bündig */
.gtag { white-space: nowrap; }
.gtag svg { width: 1.15em; height: 1.15em; margin-right: 3px; vertical-align: -.2em; }
/* Unauffällige Gruppen-Auswahl (Essen): Symbol + Auswahl ohne Kasten */
.gline { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; color: var(--muted); }
.gline svg { flex: none; }
.gline select { flex: 0 1 auto; min-width: 0; border: 0; background: transparent; font-size: 16px; padding: 6px 4px 6px 0; color: var(--muted); text-overflow: ellipsis; }
form .gline { margin: 0 2px 10px; }
.srow:has(#catGroupSel) .pl { width: auto; white-space: nowrap; } /* „Stichwörter von“ nicht umbrechen */
.acct > .sheetnote { padding: 0; } /* Kontokarte: Status nicht extra einrücken */
/* Personen-Symbol überall dort, wo es um Gruppen geht (Auswahlfelder, Gruppenliste im Konto) */
.gpl { display: inline-flex; align-items: center; gap: 5px; }
.gpl svg { flex: none; width: 15px; height: 15px; }
.gname { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.gname svg { flex: none; color: var(--muted); }
/* Einfache Liste: eine einzige Reihe (Einträge + Abschnitts-Köpfe), sieht aber aus wie eine Karte je Abschnitt */
.bar[hidden] { display: none; }
.srows { list-style: none; margin: 0; padding: 0; }
.srows > .row { background: var(--surface); border: 1px solid var(--line); border-bottom: 0; transition: transform .15s ease, box-shadow .15s ease; }
.srows > .row:first-child, .srows > .secli + .row { border-radius: 12px 12px 0 0; }
.srows > .row:last-child, .srows > .row:has(+ .secli) { border-bottom: 1px solid var(--line); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.srows > .secli { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.secbtn.on, .secbtn.on .gname { color: var(--accent); }
.secempty { margin: 0 2px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .85rem; list-style: none; }
.addsec { display: block; margin-top: 10px; }
/* Gedrückt halten: Eintrag hebt sich leicht an */
.srows > .row.lifted { transform: scale(1.02); box-shadow: 0 8px 22px rgba(0, 0, 0, .28); position: relative; z-index: 2; border-radius: 12px; border-bottom: 1px solid var(--line); }
/* Wackelmodus */
.wiggle > .row:not(.dragging) { animation: wiggle .2s ease-in-out infinite alternate; }
.wiggle > .row { touch-action: pan-y; cursor: grab; }
.wiggle > .row.dragging { position: relative; z-index: 2; transition: none; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); border-radius: 12px; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .wiggle > .row { animation: none; } }
/* Favoriten bei Essen (Tag „★“) */
.favmark { color: var(--accent); margin-right: 5px; }
.favchip { font-size: 1rem; line-height: 1; min-width: 40px; }
.favbtn { margin-left: 8px; padding: 2px 6px; border: 0; background: none; color: var(--muted); font-size: 1.35rem; line-height: 1; vertical-align: -2px; text-transform: none; letter-spacing: 0; cursor: pointer; }
.favbtn.on { color: var(--accent); }
/* Sortieren in Listen: „Ziehen zum Sortieren / Fertig“ schwebt immer über der Tab-Leiste (auch in langen Listen sichtbar) */
.wigglebar.floatbar {
  position: fixed; z-index: 19; left: 0; right: 0; margin: 0 auto; width: calc(100% - 24px); max-width: 520px; box-sizing: border-box;
  bottom: calc(max(10px, calc(env(safe-area-inset-bottom, 0px) - 10px)) + 72px);
  padding: 6px 6px 6px 18px; border-radius: 999px; border: 1px solid var(--glass-line, var(--line));
  background: color-mix(in srgb, var(--surface) var(--bar-p, 72%), transparent);
  -webkit-backdrop-filter: blur(var(--bar-blur, 22px)) saturate(1.8); backdrop-filter: blur(var(--bar-blur, 22px)) saturate(1.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16), 0 0 0 .5px var(--line);
}
.wigglebar.floatbar .btn { border-radius: 999px; }
.srows.wiggle { margin-bottom: 64px; }
/* Auswahl im Wackelmodus: runder Kreis statt Kästchen, ausgewählt = gefüllt mit Haken und leicht eingefärbt */
.srows.wiggle .row .chk::before { border-radius: 50%; background: none; border-color: var(--muted); }
.srows.wiggle .row.picked { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.srows.wiggle .row.picked .chk::before {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
  border-color: var(--accent);
}
.wigglebar.floatbar .wbtxt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wigglebar.floatbar .btn:disabled { opacity: .45; } /* Platz, damit der letzte Eintrag nicht unter der Leiste liegt */
@media (orientation: landscape) and (max-height: 520px) {
  .wigglebar.floatbar { max-width: 420px; bottom: calc(max(6px, calc(env(safe-area-inset-bottom, 0px) - 14px)) + 50px); }
}
/* Hinweis (z. B. „Rückgängig“ nach dem Verschieben) über die schwebende Sortier-Leiste setzen */
body:has(.floatbar) #toast { bottom: calc(var(--kb, 0px) + env(safe-area-inset-bottom, 0px) + 140px); }
@media (orientation: landscape) and (max-height: 520px) { body:has(.floatbar) #toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 108px); } }
.wigglebar.floatbar { background: color-mix(in srgb, var(--surface) min(100%, calc(var(--bar-p, 72%) + 18%)), transparent); } /* etwas deckender als die Tab-Leiste: Text bleibt lesbar */
/* Hilfe: Themen zum Aufklappen, Schalter „Hinweise anzeigen“ */
.helplist { display: grid; gap: 6px; margin-top: 12px; }
.helpsec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.helpsec > summary { display: flex; align-items: center; gap: 10px; padding: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.helpsec > summary::-webkit-details-marker { display: none; }
.helpsec > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 1.2rem; transition: transform .2s ease; }
.helpsec[open] > summary::after { transform: rotate(90deg); }
.helpsec > summary svg { flex: none; color: var(--muted); }
.helpbody { padding: 0 14px 12px; color: var(--ink); font-size: .95rem; line-height: 1.45; }
.helpbody p { margin: 0 0 8px; }
.helpbody ul, .helpbody ol { margin: 0 0 8px; padding-left: 20px; }
.helpbody li { margin: 0 0 6px; }
.helpbody svg { width: 1.1em; height: 1.1em; vertical-align: -.2em; color: var(--muted); }
.helpbody code, .siricopy code { font-size: .88em; background: var(--line); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }
.helpbody code.sel, .siricopy code.sel { display: inline-block; margin: 4px 0; padding: 4px 8px; -webkit-user-select: all; user-select: all; }
.siricopy { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.siricopy code.sel { flex: 1; min-width: 0; margin: 0; }
.pwforgot { margin: 14px 4px 0; }
.pwforgot summary { color: var(--accent); cursor: pointer; font-size: .95rem; }
.pwforgot p { margin: 6px 0 0; }
.swrow { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.swrow > span { flex: 1; min-width: 0; display: grid; }
.swrow small { color: var(--muted); font-size: .8rem; }
.swrow input { flex: none; width: 44px; height: 26px; accent-color: var(--accent); }
/* Hinweise aus: Bedienhinweise verschwinden (im Grundriss nur unsichtbar, damit „+ Bereich“ an seinem Platz bleibt) */
.notips .tip.bedien { display: none; }
.notips .hint.bedien { visibility: hidden; }
/* Stern im Essen-Sheet: beim Öffnen landet der Fokus dort, Safari zeigte das als Textauswahl (zwei Striche) an */
.sheethead .sheettitle, .favbtn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.favbtn:focus { outline: none; }
.favbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
/* Kleine Späße: Konfetti über allem, ohne Klicks abzufangen; Statistik-Kacheln */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; display: grid; gap: 2px; }
.stat b { font-size: 1.5rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }
p.tip[data-act="vertap"] { cursor: default; -webkit-user-select: none; user-select: none; }
.swrow .funicon { font-size: 1.4rem; line-height: 1; }
.srows > .row:first-child { margin-top: 12px; } /* einfache Liste ohne Abschnitt oben: gleicher Abstand zur Eingabe wie mit Überschrift */
/* „Vielleicht fällig“ (Kaufhistorie) über der Einkaufsliste */
.duebar { margin: 12px 0 0; }
.duelabel { display: block; margin: 0 2px 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.duechips { display: flex; flex-wrap: wrap; gap: 6px; }
.duechip { display: inline-flex; align-items: stretch; border: 1.5px dashed var(--accent); border-radius: 12px; overflow: hidden; background: var(--surface); }
.dueadd { display: grid; gap: 0; text-align: left; border: 0; background: none; padding: 6px 12px; color: var(--ink); font-weight: 600; font-size: .95rem; line-height: 1.2; }
.dueadd small { color: var(--muted); font-weight: 500; font-size: .75rem; }
.duex { display: grid; place-items: center; flex: none; width: 40px; padding: 0; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); }
.duex svg { display: block; }
.srow .duenum { flex: 0 0 64px; width: 64px; border: 0; background: transparent; font-size: 16px; padding: 12px 0; color: var(--ink); text-align: center; }

/* Gast-Ansicht (gast.html): geteilte Liste ohne Konto */
body.guest .wrap { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.ghead { margin: 0 4px 14px; }
.ghead h1 { margin: 0; font-size: 1.9rem; line-height: 1.15; overflow-wrap: anywhere; }
.ghead p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.ghead p b { color: var(--warn); font-weight: 600; }
body.guest #gName { font-size: 16px; }
.gfoot { margin: 24px 4px 0; color: var(--muted); font-size: .85rem; text-align: center; line-height: 1.5; }
.ghint { margin: 6px 6px 14px; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.gfoot a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Einführung: Willkommens-Hinweise (js/hilfe.js, introCard) */
.intro { background: var(--card, var(--soft)); border: 1px solid var(--accent); border-radius: 16px; padding: 14px 16px 10px; margin: 16px 0; }
.intro strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.intro p { margin: 0 0 6px; line-height: 1.45; color: var(--ink); }
.intro .link { color: var(--accent); font-weight: 600; padding: 6px 0; }

/* Seite „Über diese App“ (ueber.html) */
.about .abox { padding-top: 12px; margin-bottom: 12px; }
.about .abox h2 { font-size: 1.05rem; margin: 0 0 6px; }
.about a { color: var(--accent); }
.aback { margin: 0 4px 10px; }
.aback a { text-decoration: none; font-weight: 600; }
.delinfo { margin: 0 4px 10px; padding-left: 20px; }
.link.danger { color: var(--warn); }
.swrow > .swicon { flex: none; display: block; width: 44px; text-align: center; font-size: 1.4rem; color: var(--accent); }

/* Essen: Foto vom Essen links in der Karte (halb Bild, halb Text), Bild-Plätze im Bearbeiten, Rezept-Links, Bildnummer im Vollbild */
.mcard.pic { padding-left: 0; overflow: hidden; min-height: 88px; }
.mcard .mcover { flex: none; align-self: stretch; width: 36%; max-width: 160px; margin: -12px 0; object-fit: cover; }
.mpic { position: relative; flex: none; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--line); cursor: pointer; }
.mpic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mphoto[data-act] { cursor: zoom-in; }
.vcount { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%); padding: 4px 12px; border-radius: 14px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .9rem; pointer-events: none; }
.mslot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.mslot .pl { flex-basis: 100%; color: var(--muted); font-size: .9rem; }
.mrecipe { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.mrecipe svg { width: 18px; height: 18px; }
.mlinks { display: grid; justify-items: start; gap: 2px; margin: 0 0 8px; }
.mlinks .mrecipe { margin: 0; text-decoration: none; overflow-wrap: anywhere; }
