/* nffoodtrack – Gestaltung von nfcaltrack übernommen (Klassisch und
   Liquid Glass, Animationen), Farben warm: Orange als Akzent, Türkis für
   prepmymeal. Hell/Dunkel: System-Voreinstellung, data-theme überschreibt. */
:root {
  --bg: #f6f7f9;
  --flaeche: #ffffff;
  --flaeche-2: #eef0f3;
  --text: #16181d;
  --leise: #5d636e;
  --rand: #e1e4e9;
  --akzent: #c2410c;
  --akzent-text: #ffffff;
  --warn: #d97706;
  --gefahr: #dc2626;
  --pmm: #0f766e;
  --knapp: #b45309;
  --ring-grund: #e5e7eb;
  --schatten: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px rgb(0 0 0 / .05);
  /* Federnde Kurve mit leichtem Überschwingen für Dinge, die „einrasten“
     (Zeiger, Knöpfe, Hinweis) – wie nftravel. Ältere Browser ohne linear()
     bekommen eine ähnliche Bézierkurve. */
  --feder: cubic-bezier(.34, 1.3, .64, 1);
  /* Wie iOS-Blätter: schnell los, weich aus, ohne Überschwingen. */
  --blatt: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --feder: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.4%,
      1.067, 1.099 24.3%, 1.108 26%, 1.103 27.9%, 1.071 34%, 1.009 41.6%, .993 45%,
      .987 48.2%, .992 55.5%, 1.001 63.8%, 1.003 72%, 1);
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d; --flaeche: #1e2128; --flaeche-2: #262a32; --text: #e9eaee; --leise: #9aa1ad;
    --rand: #2d313a; --akzent: #fb923c; --akzent-text: #1c0d04; --warn: #fbbf24; --gefahr: #f87171;
    --pmm: #2dd4bf; --knapp: #fbbf24; --ring-grund: #2d313a;
    --schatten: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16181d; --flaeche: #1e2128; --flaeche-2: #262a32; --text: #e9eaee; --leise: #9aa1ad;
  --rand: #2d313a; --akzent: #fb923c; --akzent-text: #1c0d04; --warn: #fbbf24; --gefahr: #f87171;
  --pmm: #2dd4bf; --knapp: #fbbf24; --ring-grund: #2d313a;
  --schatten: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* iOS-Home-Screen-App mit black-translucent: ist die Seite kürzer als der
   Bildschirm, rechnet Safari die Höhe ohne Statusleiste und die feste
   Tab-Leiste rutscht um diesen Betrag nach oben. Mindesthöhe inkl. Statusleiste
   behebt das. */
html { -webkit-text-size-adjust: 100%; min-height: calc(100% + env(safe-area-inset-top)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--akzent); }
h2 { font-size: 1.25rem; margin: .2rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }

/* --- Kopf --- */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .5rem;
  padding: calc(.45rem + env(safe-area-inset-top)) .75rem .45rem;
  background: var(--flaeche); border-bottom: 1px solid var(--rand);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.gescrollt .kopf { box-shadow: 0 6px 20px rgb(0 0 0 / .08); }
.marke { display: flex; align-items: center; gap: .45rem; font-weight: 650; color: var(--text); text-decoration: none; }
.punkt { width: .7rem; height: .7rem; border-radius: 50%; background: var(--akzent); }
.offline-badge { margin-left: auto; font-size: .75rem; background: var(--warn); color: #fff; padding: .1rem .45rem; border-radius: 1rem; }

.inhalt { max-width: 40rem; margin: 0 auto; padding: .75rem 1rem 6rem; }

/* --- Tab-Leiste unten (wie eine App) --- */
:root { --tabs-h: 3.6rem; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--flaeche); border-top: 1px solid var(--rand);
}
.tabs a {
  flex: 1; max-width: 10rem; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  color: var(--leise); text-decoration: none; font-size: .72rem;
  -webkit-tap-highlight-color: transparent;
}
.tabs svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.aktiv { color: var(--akzent); font-weight: 600; }
.tabs a { transition: color .2s ease, transform .35s var(--feder); }
.tabs a:active { transform: scale(.92); transition-duration: .08s; }
/* Zeiger am aktiven Reiter (lib/darstellung.js, zeigerSetzen): oben ein
   Strich, er gleitet beim Wechsel hinüber. */
.mit-zeiger a { position: relative; z-index: 1; }
.tab-zeiger {
  position: absolute; left: 0; top: 0; height: 2px; width: 0;
  background: var(--akzent); border-radius: 2px; pointer-events: none;
}
.tab-zeiger.bereit { transition: transform .45s var(--feder), width .45s var(--feder); }
/* Mit Tab-Leiste: Inhalt, „+“ und Meldungen darüber. */
body:has(.tabs:not([hidden])) { padding-bottom: 0; }
body:has(.tabs:not([hidden])) .inhalt { padding-bottom: calc(var(--tabs-h) + 6rem + env(safe-area-inset-bottom)); }
body:has(.tabs:not([hidden])) .fab { bottom: calc(var(--tabs-h) + 1rem + env(safe-area-inset-bottom)); }
body:has(.tabs:not([hidden])) .toast { bottom: calc(var(--tabs-h) + 5.5rem + env(safe-area-inset-bottom)); }

/* --- Karten und Formulare --- */
.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 1rem;
  padding: 1rem; margin: 0 0 .9rem; box-shadow: var(--schatten);
}
.karte.schmal { max-width: 26rem; margin: 2rem auto; }
.karte.deaktiviert { opacity: .7; }
details.karte > summary { cursor: pointer; list-style: none; }
details.karte > summary::-webkit-details-marker { display: none; }
details.karte > summary h3 { display: inline; }
details.karte > summary::after { content: '+'; float: right; color: var(--leise); font-size: 1.2rem; line-height: 1; }
details.karte[open] > summary::after { content: '−'; }
details.karte[open] > summary { margin-bottom: .6rem; }

.formular { display: flex; flex-direction: column; gap: .7rem; }
.feld { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--leise); }
.feld > span:first-child { font-weight: 550; }
.raster2, .raster3 { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.raster3 { grid-template-columns: 1fr 1fr 1fr; }

input, select, textarea, button, .knopf {
  font: inherit; color: var(--text); border-radius: .65rem;
}
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--rand); background: var(--bg);
  font-size: 16px; /* iOS zoomt sonst beim Fokus */
}
textarea { resize: vertical; min-height: 5rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
button, .knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem .9rem; border: 1px solid var(--rand); background: var(--flaeche-2);
  cursor: pointer; text-decoration: none; font-size: .95rem; min-height: 2.5rem;
  transition: background-color .15s ease, border-color .15s ease, transform .35s var(--feder);
}
/* Beim Drücken sofort klein, beim Loslassen federnd zurück. */
button:active:not(:disabled), .knopf:active { transform: scale(.95); transition-duration: .08s; }
button:disabled { opacity: .5; cursor: default; }
button.primaer, .knopf.primaer { background: var(--akzent); color: var(--akzent-text); border-color: transparent; font-weight: 600; }
button.gefahr { color: var(--gefahr); }
button.leicht { background: transparent; }
button.breit { width: 100%; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; }
.knopfreihe.klein button { padding: .3rem .55rem; min-height: 2rem; font-size: .85rem; }
.chip { padding: .3rem .7rem; min-height: 2rem; border-radius: 1rem; font-size: .85rem; }
.schritte { display: flex; flex-wrap: wrap; gap: .4rem; }
.haken { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.haken input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; flex: none; }
.zeile-form { display: flex; gap: .5rem; }
.zeile-form input { flex: 1; }
.training { margin: -.4rem 0 .8rem; }
.training-fuss { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem .3rem 0; }
.token-feld { word-break: break-all; user-select: all; }
.link-feld { font-family: ui-monospace, monospace; font-size: .8rem !important; }

/* Segmentierte Auswahl (Slots, Darstellung) */
.segment { display: flex; background: var(--flaeche-2); border-radius: .7rem; padding: .2rem; gap: .2rem; }
.segment label { flex: 1; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
  display: block; text-align: center; padding: .4rem .2rem; border-radius: .5rem; cursor: pointer;
  font-size: .85rem; color: var(--leise);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .35s var(--feder);
}
.segment span:active { transform: scale(.95); transition-duration: .08s; }
.seg-titel { font-size: .85rem; color: var(--leise); margin: .8rem 0 .3rem; }
.seg-titel:first-of-type { margin-top: .2rem; }
.segment input:checked + span { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: var(--schatten); }
.segment input:focus-visible + span { outline: 2px solid var(--akzent); }

.leise { color: var(--leise); }
.klein { font-size: .82rem; }
.mitte { text-align: center; }
.fehlertext { color: var(--gefahr); margin: 0; }
.hinweis { background: var(--flaeche-2); border-left: 3px solid var(--warn); padding: .5rem .7rem; border-radius: .4rem; font-size: .9rem; }
.leer-hinweis { padding: 1rem 0; }
.unsichtbar { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.seitenkopf { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .6rem; }
.zurueck { font-size: .9rem; text-decoration: none; }
.seitenkopf.zeilig { flex-direction: row; justify-content: space-between; align-items: center; }
.seitenkopf h2 { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }

/* --- Listen und Zeilen (wie nfcaltrack) --- */
.liste { list-style: none; margin: 0; padding: 0; }
.zeile { position: relative; border-bottom: 1px solid var(--rand); overflow: hidden; transition: opacity .3s ease; }
.zeile:last-child { border-bottom: none; }
.zeile-inhalt {
  position: relative; display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem;
  background: var(--flaeche); width: 100%; color: inherit; text-decoration: none;
}
.karte .liste .zeile-inhalt { padding-left: 0; padding-right: 0; }
.zeile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zeile-titel { overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: .35rem; }
.zeile-link { color: inherit; text-decoration: none; }
.zeile.weg { opacity: .35; }
details.karte[open] > :not(summary) { animation: aufklappen .3s var(--feder) both; }
@keyframes aufklappen { from { opacity: 0; transform: translateY(-.3rem); } to { opacity: 1; transform: none; } }

.fab {
  position: fixed; right: max(1.2rem, calc(50vw - 19rem)); bottom: calc(1.2rem + env(safe-area-inset-bottom));
  width: 3.6rem; height: 3.6rem; border-radius: 50%; font-size: 2rem; line-height: 1;
  background: var(--akzent); color: var(--akzent-text); border: none; box-shadow: 0 6px 20px rgb(0 0 0 / .25);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; z-index: 5;
}
.fab:active { transform: scale(.9); }

/* --- Dialog --- */
.dlg {
  border: 1px solid var(--rand); border-radius: 1rem; padding: 0; background: var(--flaeche); color: var(--text);
  width: min(30rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem);
}
/* Auf- UND Zugehen wie nftravel: @starting-style liefert den Ausgangszustand
   beim Öffnen, `display`/`overlay` mit allow-discrete halten den Dialog beim
   Schließen so lange in der Oberfläche, bis er ausgeblendet ist (lib/dom.js
   entfernt ihn erst danach). Browser ohne das öffnen und schließen einfach
   ohne Übergang. */
.dlg {
  opacity: 0; transform: translateY(.6rem) scale(.96);
  transition: opacity .2s ease, transform .4s var(--feder),
    overlay .4s allow-discrete, display .4s allow-discrete;
}
.dlg[open] { opacity: 1; transform: none; }
@starting-style { .dlg[open] { opacity: 0; transform: translateY(.6rem) scale(.96); } }
.dlg::backdrop {
  background: rgb(0 0 0 / 0); backdrop-filter: blur(0);
  transition: background-color .25s ease, backdrop-filter .25s ease,
    overlay .4s allow-discrete, display .4s allow-discrete;
}
.dlg[open]::backdrop { background: rgb(0 0 0 / .45); backdrop-filter: blur(2px); }
@starting-style { .dlg[open]::backdrop { background: rgb(0 0 0 / 0); backdrop-filter: blur(0); } }

/* Handy: Blatt von unten wie in nftravel, Knöpfe als feste Fußzeile. */
@media (max-width: 560px) {
  .dlg {
    width: 100vw; max-width: 100vw; max-height: 92dvh;
    margin: auto 0 0; border-radius: 1rem 1rem 0 0; border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%); opacity: 1;
    transition: transform .45s var(--blatt), overlay .45s allow-discrete, display .45s allow-discrete;
  }
  .dlg[open] { transform: none; }
  @starting-style { .dlg[open] { transform: translateY(100%); opacity: 1; } }
  /* Tastatur offen (lib/dom.js): Blatt sitzt auf der Tastatur. */
  .dlg { margin-bottom: var(--tastatur, 0px); }
  .dlg { max-height: min(92dvh, calc(var(--sichtbar, 100dvh) - 1rem)); }
  .dlg menu { border-top: 1px solid var(--rand); }
  .dlg menu button { flex: 1; }
}
/* Höhe begrenzt nur der Dialog selbst (samt Rand und Safe-Area-Polster);
   das Formular füllt ihn, nur der Rumpf scrollt – die Knöpfe bleiben stehen. */
.dlg[open] { display: flex; flex-direction: column; overflow: hidden; }
.dlg form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.dlg h3 { padding: 1rem 1rem 0; margin: 0 0 .6rem; flex: none; }
.dlg-rumpf { padding: 0 1rem; overflow: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.dlg menu { flex: none; display: flex; gap: .5rem; justify-content: flex-end; padding: .8rem 1rem; margin: 0; flex-wrap: wrap; }
.dlg menu .gefahr { margin-right: auto; }
.vorschau { font-variant-numeric: tabular-nums; margin: 0; }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translate(-50%, 1rem);
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: .8rem; opacity: 0;
  transition: opacity .2s, transform .45s var(--feder); z-index: 50; display: flex; gap: .8rem; align-items: center;
  max-width: calc(100vw - 2rem); margin: 0;
}
.toast.zeigen { opacity: 1; transform: translate(-50%, 0); }
.toast:not(.zeigen) { transform: translate(-50%, 1rem) scale(.92); }
.toast.fehler { background: var(--gefahr); color: #fff; }
.toast-aktion { background: transparent; color: inherit; border: 1px solid currentColor; min-height: 0; padding: .2rem .6rem; }

.kreisel {
  width: 1rem; height: 1rem; flex: none; border-radius: 50%;
  border: 2px solid var(--ring-grund); border-top-color: var(--akzent); animation: drehen .8s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .kreisel { animation-duration: 2.4s; } }

/* --- Übergänge beim Umschalten (lib/darstellung.js, mitUebergang) ---
   Hell/Dunkel: die neue Darstellung wächst als Kreis aus der angetippten
   Auswahl. Andere Wechsel blenden einfach über. */
.vt-kreis::view-transition-old(root), .vt-kreis::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.vt-kreis::view-transition-new(root) { animation: kreis .55s cubic-bezier(.4, 0, .2, 1); }
@keyframes kreis {
  from { clip-path: circle(0 at var(--vt-x) var(--vt-y)); }
  to { clip-path: circle(var(--vt-r) at var(--vt-x) var(--vt-y)); }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* Ruhe: Gerät („Bewegung reduzieren“) oder Konto (Einstellungen →
   Animationen: Reduziert). Übergänge laufen dann praktisch sofort; nur der
   Ladekreisel dreht weiter, sonst sähe Warten wie Hängen aus. */
@media (prefers-reduced-motion: reduce) {
  *:not(.kreisel), *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
:root[data-bewegung="reduziert"] *:not(.kreisel), :root[data-bewegung="reduziert"] *::before,
:root[data-bewegung="reduziert"] *::after, :root[data-bewegung="reduziert"] ::backdrop {
  animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important;
}

/* „+“-Knopf: Symbol als SVG, genau mittig. */
.fab { padding: 0; }
.fab-plus svg { width: 1.7rem; height: 1.7rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* ==========================================================================
   Stil „Liquid Glass“ (Einstellungen → Darstellung, je Konto; data-stil="glas"
   am <html>) – dieselbe Gestaltung wie nftravel: farbige Flecken im
   Hintergrund, Flächen aus Milchglas mit hellem Glanzrand, Pillen-Knöpfe,
   schwebende Leisten. „Getönt“ (data-glas) macht das Glas deckender, wie die
   Wahl in iOS 26.1. Eingabefelder bleiben fast deckend: Gramm und kcal
   müssen sich gut lesen lassen.
   ========================================================================== */
:root[data-stil="glas"] {
  --bg: #fbf3ec;
  --flaeche: rgb(255 255 255 / .5);
  --flaeche-2: rgb(255 255 255 / .4);
  --rand: rgb(255 255 255 / .62);
  --ring-grund: rgb(255 255 255 / .55);
  --glas-kopf: rgb(255 255 255 / .55);
  --glas-feld: rgb(255 255 255 / .8);
  --glas-glanz: inset 0 1px 0 rgb(255 255 255 / .85), inset 0 -1px 0 rgb(255 255 255 / .25);
  --glas-blur: saturate(180%) blur(22px);
  --schatten: 0 8px 32px rgb(31 38 135 / .12), 0 1px 2px rgb(0 0 0 / .05);
  --hg-1: rgb(251 146 60 / .42); --hg-2: rgb(45 212 191 / .38); --hg-3: rgb(250 204 21 / .3); --hg-4: rgb(244 114 182 / .26);
}
:root[data-stil="glas"][data-glas="getoent"] {
  --flaeche: rgb(255 255 255 / .78); --flaeche-2: rgb(255 255 255 / .62); --glas-kopf: rgb(255 255 255 / .8);
}
@media (prefers-color-scheme: dark) {
  :root[data-stil="glas"]:not([data-theme="light"]) {
    --bg: #110d0b;
    --flaeche: rgb(30 34 44 / .46); --flaeche-2: rgb(255 255 255 / .07); --rand: rgb(255 255 255 / .14);
    --ring-grund: rgb(255 255 255 / .1);
    --glas-kopf: rgb(24 27 36 / .5); --glas-feld: rgb(14 16 22 / .7);
    --glas-glanz: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 -1px 0 rgb(255 255 255 / .04);
    --schatten: 0 8px 32px rgb(0 0 0 / .45);
    --hg-1: rgb(234 88 12 / .36); --hg-2: rgb(13 148 136 / .36); --hg-3: rgb(202 138 4 / .22); --hg-4: rgb(219 39 119 / .2);
  }
  :root[data-stil="glas"][data-glas="getoent"]:not([data-theme="light"]) {
    --flaeche: rgb(28 31 40 / .8); --flaeche-2: rgb(255 255 255 / .1); --glas-kopf: rgb(24 27 36 / .82);
  }
}
:root[data-stil="glas"][data-theme="dark"] {
  --bg: #110d0b;
  --flaeche: rgb(30 34 44 / .46); --flaeche-2: rgb(255 255 255 / .07); --rand: rgb(255 255 255 / .14);
  --ring-grund: rgb(255 255 255 / .1);
  --glas-kopf: rgb(24 27 36 / .5); --glas-feld: rgb(14 16 22 / .7);
  --glas-glanz: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 -1px 0 rgb(255 255 255 / .04);
  --schatten: 0 8px 32px rgb(0 0 0 / .45);
  --hg-1: rgb(234 88 12 / .36); --hg-2: rgb(13 148 136 / .36); --hg-3: rgb(202 138 4 / .22); --hg-4: rgb(219 39 119 / .2);
}
:root[data-stil="glas"][data-theme="dark"][data-glas="getoent"] {
  --flaeche: rgb(28 31 40 / .8); --flaeche-2: rgb(255 255 255 / .1); --glas-kopf: rgb(24 27 36 / .82);
}

/* Hintergrund: weiche Farbflecken, an denen sich das Glas bricht. Als
   festes Pseudo-Element statt background-attachment: fixed – das ignoriert
   Safari auf iOS. */
:root[data-stil="glas"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38rem 30rem at 0% 0%, var(--hg-1), transparent 70%),
    radial-gradient(34rem 28rem at 100% 18%, var(--hg-2), transparent 70%),
    radial-gradient(36rem 30rem at 10% 75%, var(--hg-3), transparent 70%),
    radial-gradient(30rem 26rem at 95% 100%, var(--hg-4), transparent 70%),
    var(--bg);
}

/* Glasflächen. Nur die großen bekommen Unschärfe – eine pro Zeile wäre auf
   dem Handy beim Scrollen spürbar. Zeilen darin sind nur durchscheinend. */
:root[data-stil="glas"] :is(.karte, .dlg, .gruppe-liste, .pmm-kachel) {
  background: var(--flaeche); border-color: var(--rand);
  box-shadow: var(--glas-glanz), var(--schatten);
  -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur);
}
:root[data-stil="glas"] :is(.karte, .dlg) { border-radius: 1.6rem; }
:root[data-stil="glas"] .gruppe-liste { border-radius: 1.3rem; }
:root[data-stil="glas"] .zeile { border-bottom-color: color-mix(in srgb, var(--leise) 18%, transparent); }
:root[data-stil="glas"] .zeile-inhalt { background: transparent; }
/* Beim Wischen deckend, sonst schiene das Rot zum Löschen durch die Zeile. */
:root[data-stil="glas"] .zeile.wischt .zeile-inhalt { background: var(--glas-feld); }
:root[data-stil="glas"] .dlg[open]::backdrop { background: rgb(0 0 0 / .25); backdrop-filter: blur(6px); }
:root[data-stil="glas"] .hinweis { background: var(--flaeche-2); }

/* Kopf: Glasleiste, unter der die Seite verschwimmt. */
:root[data-stil="glas"] .kopf {
  background: var(--glas-kopf); border-bottom-color: var(--rand);
  -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur);
}
:root[data-stil="glas"].gescrollt .kopf { box-shadow: var(--glas-glanz), 0 8px 24px rgb(0 0 0 / .1); }

/* Knöpfe als Glas-Pillen. Das Licht sitzt dort, wo Finger oder Maus sind
   (lib/darstellung.js) und leuchtet beim Drücken auf. :where hält die Regel
   schwach, damit die Sonderfälle darunter sie ohne Klimmzüge überschreiben. */
:root[data-stil="glas"] :where(button, .knopf, .chip):not(:where(.klein-knopf, .toast-aktion, .fab, .zeile-inhalt)) {
  border-radius: 999px; border-color: var(--rand);
  background-color: var(--flaeche-2);
  background-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%),
    rgb(255 255 255 / var(--licht, 0)), transparent 70%);
  box-shadow: var(--glas-glanz);
  transition: background-color .2s ease, border-color .2s ease, --licht .3s ease, transform .4s var(--feder), box-shadow .2s ease;
}
:root[data-stil="glas"] :is(button, .knopf, .chip, .tabs a):hover { --licht: .35; }
:root[data-stil="glas"] :is(button, .knopf, .chip):not(:disabled):active { --licht: .7; transform: scale(1.05); transition-duration: .15s; }
:root[data-stil="glas"] button.leicht { background-color: transparent; box-shadow: none; border-color: transparent; }
:root[data-stil="glas"] :is(button.primaer, .knopf.primaer) {
  background-color: var(--akzent); color: var(--akzent-text); border-color: transparent;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 6px 18px color-mix(in srgb, var(--akzent) 35%, transparent);
}
:root[data-stil="glas"] .fab {
  background-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgb(255 255 255 / var(--licht, .25)), transparent 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 10px 28px color-mix(in srgb, var(--akzent) 40%, rgb(0 0 0 / .25));
  transition: --licht .3s ease, transform .4s var(--feder);
}
:root[data-stil="glas"] .fab:active { --licht: .6; transform: scale(1.08); }

/* Eingaben fast deckend. */
:root[data-stil="glas"] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) {
  background: var(--glas-feld); border-color: var(--rand); border-radius: .9rem;
}
:root[data-stil="glas"] .segment { border-radius: 999px; background: var(--flaeche-2); box-shadow: var(--glas-glanz); }
:root[data-stil="glas"] .segment span { border-radius: 999px; }
:root[data-stil="glas"] .segment input:checked + span { background: var(--glas-feld); box-shadow: var(--glas-glanz), 0 2px 8px rgb(0 0 0 / .08); }

/* Hinweis unten als Glas-Pille. */
:root[data-stil="glas"] .toast:not(.fehler) {
  background: var(--glas-kopf); color: var(--text); border: 1px solid var(--rand); border-radius: 999px;
  box-shadow: var(--glas-glanz), var(--schatten);
  -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur);
}
:root[data-stil="glas"] .toast.fehler { border-radius: 999px; }

/* Reiterleiste schwebt als Pille über dem Inhalt, wie in iOS 26. Der Zeiger
   ist eine hellere Pille hinter dem aktiven Reiter. */
:root[data-stil="glas"] .tabs {
  left: .7rem; right: .7rem; bottom: calc(.5rem + env(safe-area-inset-bottom));
  max-width: 26rem; margin: 0 auto; padding: .25rem;
  border: 1px solid var(--rand); border-radius: 2rem;
  background: var(--glas-kopf); box-shadow: var(--glas-glanz), 0 10px 30px rgb(0 0 0 / .18);
  -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur);
}
:root[data-stil="glas"] .tabs a { height: calc(var(--tabs-h) - .5rem); border-radius: 1.8rem; }
:root[data-stil="glas"] .tab-zeiger {
  top: .25rem; bottom: .25rem; height: auto; border-radius: 1.8rem;
  background: color-mix(in srgb, var(--akzent) 20%, transparent);
  box-shadow: var(--glas-glanz), 0 2px 10px rgb(0 0 0 / .08);
}
:root[data-stil="glas"] body:has(.tabs:not([hidden])) .inhalt { padding-bottom: calc(var(--tabs-h) + 7rem + env(safe-area-inset-bottom)); }
:root[data-stil="glas"] body:has(.tabs:not([hidden])) .fab { bottom: calc(var(--tabs-h) + 1.6rem + env(safe-area-inset-bottom)); }
:root[data-stil="glas"] body:has(.tabs:not([hidden])) .toast { bottom: calc(var(--tabs-h) + 6.2rem + env(safe-area-inset-bottom)); }

/* Blatt von unten auf dem Handy: oben stark gerundet. */
@media (max-width: 560px) {
  :root[data-stil="glas"] .dlg { border-radius: 1.8rem 1.8rem 0 0; }
  :root[data-stil="glas"] .dlg menu { border-top-color: var(--rand); }
}

/* Barrierefreiheit: „Transparenz reduzieren“ → deckende Flächen. */
@media (prefers-reduced-transparency: reduce) {
  :root[data-stil="glas"] { --flaeche: #ffffff; --flaeche-2: #eef0f3; --glas-kopf: #ffffff; }
  :root[data-stil="glas"][data-theme="dark"] { --flaeche: #1e2128; --flaeche-2: #262a32; --glas-kopf: #1e2128; }
  :root[data-stil="glas"] * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

/* --licht als echte Zahl, damit der Glanz weich ein- und ausblendet statt
   zu springen. Ohne @property (ältere Browser) springt er eben. */
@property --licht { syntax: "<number>"; inherits: false; initial-value: 0; }

.liste-kopf { list-style: none; padding: .2rem .2rem .3rem; }

/* „+“-Menü (lib/ui.js, plusKnopf): Knöpfe schweben gestaffelt über dem „+“ auf. */
.fab-plus svg { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.fab-plus.offen svg { transform: rotate(45deg); }
.fab-plus.offen { z-index: 7; }
.speeddial-schleier {
  position: fixed; inset: 0; z-index: 6; background: rgb(0 0 0 / .35);
  opacity: 0; transition: opacity .2s ease-out;
}
.speeddial-schleier.offen { opacity: 1; }
.speeddial {
  position: fixed; z-index: 7; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem;
  pointer-events: none;
}
.speeddial.offen { pointer-events: auto; }
/* Keyframes statt transition: die allgemeine Knopf-Regel im Glas-Stil
   überschreibt `transition`. Nacheinander von unten nach oben; nur opacity +
   transform, damit es flüssig bleibt. */
.speeddial-knopf {
  padding: .65rem 1.1rem; border: 1px solid var(--rand); border-radius: 999px;
  background: var(--flaeche); color: var(--text); font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px rgb(0 0 0 / .25);
  opacity: 0;
}
@keyframes speeddial-rein {
  from { opacity: 0; transform: translate3d(0, .9rem, 0); }
  to { opacity: 1; transform: none; }
}
.speeddial.offen .speeddial-knopf { animation: speeddial-rein .16s cubic-bezier(.2, .8, .2, 1) both; }
.speeddial.offen .speeddial-knopf:nth-last-child(1) { animation-delay: 0s; }
.speeddial.offen .speeddial-knopf:nth-last-child(2) { animation-delay: .04s; }
.speeddial.offen .speeddial-knopf:nth-last-child(3) { animation-delay: .08s; }
/* Schließen: alle zusammen kurz ausblenden. */
.speeddial:not(.offen) .speeddial-knopf { opacity: 0; transition: opacity .12s ease-out !important; }
.speeddial-knopf:active { transform: scale(.96); }
:root[data-stil="glas"] .speeddial-knopf { background: var(--flaeche); background-image: none; }


/* ==========================================================================
   nffoodtrack: Vorrat, prepmymeal-Kacheln, Stepper, Hinweise
   ========================================================================== */
.such-leiste { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .9rem; }
.klein-pille { min-height: 2.1rem; padding: .3rem .9rem; font-size: .88rem; }

.gruppe { margin-bottom: 1.1rem; }
.gruppe-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: 0 .2rem .35rem; }
.gruppe-kopf h3 { margin: 0; font-size: .95rem; }
.gruppe-liste { background: var(--flaeche); border: 1px solid var(--rand); border-radius: .9rem; overflow: hidden; box-shadow: var(--schatten); }

/* PMM-Marke vor dem Namen */
.pmm-marke {
  display: inline-block; flex: none; font-size: .62rem; font-weight: 750; letter-spacing: .04em;
  padding: .05rem .35rem; border-radius: .35rem; color: #fff; background: var(--pmm); vertical-align: middle;
}
:root[data-theme="dark"] .pmm-marke { color: #04201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pmm-marke { color: #04201d; } }
.marke-warn {
  display: inline-block; flex: none; font-size: .68rem; font-weight: 650; padding: .05rem .4rem; margin-left: .35rem;
  border-radius: 1rem; background: color-mix(in srgb, var(--knapp) 22%, transparent); color: var(--text);
}

/* Kacheln: zwei Spalten auf dem Handy, mehr auf breiten Bildschirmen. */
.pmm-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .65rem; }
.pmm-kachel {
  position: relative; display: flex; flex-direction: column; gap: .35rem; padding: .75rem .75rem .6rem;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 1.1rem; box-shadow: var(--schatten);
  transition: opacity .3s ease, transform .35s var(--feder);
  overflow: hidden;
}
/* Türkiser Streifen links oben – PMM auf einen Blick. */
.pmm-kachel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pmm); opacity: .85;
}
.pmm-kachel.leer { opacity: .55; }
.pmm-kachel.leer::before { background: var(--leise); }
.pmm-kachel.knapp::before { background: var(--knapp); }
.pmm-kopf { color: inherit; text-decoration: none; min-height: 2.5em; display: flex; align-items: flex-start; gap: .25rem; }
.pmm-name {
  font-weight: 600; font-size: .92rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pmm-bestand { display: flex; align-items: baseline; gap: .3rem; }
.pmm-zahl { display: inline-block; font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pmm-einheit { font-size: .8rem; color: var(--leise); }

/* Stepper: − und + als runde Knöpfe. */
.stepper { display: flex; align-items: center; gap: .35rem; }
.pmm-kachel .stepper { justify-content: space-between; }
.stepper-knopf {
  width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; border-radius: 50%;
  font-size: 1.35rem; font-weight: 500; line-height: 1; flex: none;
}
.pmm-kachel .stepper-knopf { width: 2.6rem; }
.stepper-knopf:last-child:not(:first-child) { background: color-mix(in srgb, var(--akzent) 14%, var(--flaeche-2)); }
.stepper-knopf.klein { width: 2.1rem; height: 2.1rem; font-size: 1.15rem; }
.stepper-knopf.gross { width: 3.4rem; height: 3.4rem; font-size: 1.8rem; }

/* Zeilen im übrigen Vorrat */
.artikel-zeile .zeile-inhalt { padding: .5rem .6rem .5rem .8rem; }
.zeile-menge { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-block; }
.artikel-zeile.leer .zeile-titel, .artikel-zeile.leer .zeile-menge { color: var(--leise); }
.artikel-zeile.knapp .zeile-menge { color: var(--knapp); }

/* Hinweise oben auf der Startseite */
.hinweise { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .9rem; }
.hinweise .karte { margin: 0; }
.hinweis-karte {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; color: inherit; text-decoration: none;
  border-left: 4px solid var(--akzent);
}
.hinweis-karte.warn { border-left-color: var(--knapp); flex-direction: column; align-items: flex-start; gap: .15rem; }
.hinweis-karte.warn .hinweis-text { gap: .15rem; }
.hinweis-text { flex: 1; display: flex; flex-direction: column; }
.zaehler {
  flex: none; min-width: 2rem; height: 2rem; padding: 0 .5rem; border-radius: 1rem; display: grid; place-items: center;
  background: var(--akzent); color: var(--akzent-text); font-weight: 700; font-variant-numeric: tabular-nums;
  animation: puls-sanft 2.4s ease-in-out infinite;
}
@keyframes puls-sanft { 50% { box-shadow: 0 0 0 .35rem color-mix(in srgb, var(--akzent) 22%, transparent); } }
.pfeil { color: var(--leise); font-size: 1.4rem; line-height: 1; }

/* Leerer Vorrat */
.leer-start { text-align: center; padding: 1.6rem 1.2rem; }
.leer-start .knopfreihe { justify-content: center; }
.leer-symbol {
  width: 4.5rem; height: 4.5rem; margin: 0 auto .8rem; border-radius: 1.3rem;
  background:
    linear-gradient(var(--akzent), var(--akzent)) 50% 28% / 70% 22% no-repeat,
    linear-gradient(var(--pmm), var(--pmm)) 50% 72% / 70% 22% no-repeat,
    var(--flaeche-2);
}

/* Artikelseite */
.bestand-karte { display: flex; flex-direction: column; gap: .8rem; padding: 1.2rem 1rem; }
.bestand-mitte { display: flex; align-items: center; justify-content: center; gap: 1.4rem; }
.gross-bestand { display: flex; flex-direction: column; align-items: center; min-width: 6rem; }
.gross-zahl { display: inline-block; font-size: 3.4rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.gross-einheit { color: var(--leise); font-size: .9rem; }
.mitte-reihe { justify-content: center; }
.bestand-karte.ist-pmm { border-top: 4px solid var(--pmm); }
.notiz { white-space: pre-wrap; margin: -.3rem .2rem .9rem; }
.archiv-zeile { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--rand); }

.verlauf-menge {
  flex: none; min-width: 3.2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums;
}
.verlauf-menge.plus { color: var(--pmm); }
.verlauf-menge.minus { color: var(--akzent); }

/* Auswahl-Listen in Dialogen */
.artikel-suche { display: flex; flex-direction: column; gap: .5rem; }
.wahl-liste { max-height: 16rem; overflow: auto; border: 1px solid var(--rand); border-radius: .8rem; background: var(--bg); }
.wahl-liste:empty { display: none; }
.wahl-zeile {
  border: none; border-radius: 0; justify-content: flex-start; text-align: left; min-height: 2.8rem; font-size: .95rem;
  background: transparent; cursor: pointer;
}
.wahl-zeile:hover { background: var(--flaeche-2); }
.wahl-zeile.gewaehlt { background: color-mix(in srgb, var(--akzent) 16%, transparent); }
.neu-zeile .zeile-titel { color: var(--akzent); font-weight: 600; }
.karte .wahl-liste .zeile-inhalt, .dlg .wahl-liste .zeile-inhalt { padding: .5rem .7rem; }
.gewaehlt-zeile { display: flex; align-items: center; gap: .4rem; margin: 0; }
.eintrag-info { margin: 0 0 .2rem; }
.schritt-liste { margin: 0; padding-left: 1.2rem; color: var(--leise); }

/* Einräumen */
.einraeum-liste .zeile-inhalt { padding-top: .45rem; padding-bottom: .45rem; }
.einraeum-menge {
  min-width: 4.6rem; min-height: 2.1rem; padding: .2rem .5rem; font-weight: 650; font-variant-numeric: tabular-nums;
  background: transparent; border-color: transparent;
}
.fuss-aktion { margin-top: .8rem; }
.abstand-unten { margin-bottom: .6rem; }

/* Liquid Glass für die neuen Teile */
:root[data-stil="glas"] .pmm-kachel { border-radius: 1.4rem; }
:root[data-stil="glas"] .wahl-liste { background: var(--glas-feld); border-radius: 1rem; }
:root[data-stil="glas"] .wahl-zeile { border-radius: 0; box-shadow: none; background-image: none; }
:root[data-stil="glas"] .wahl-zeile.gewaehlt { background-color: color-mix(in srgb, var(--akzent) 18%, transparent); }
:root[data-stil="glas"] .einraeum-menge { background-color: transparent; box-shadow: none; border-color: transparent; }
:root[data-stil="glas"] .stepper-knopf:last-child:not(:first-child) {
  background-color: color-mix(in srgb, var(--akzent) 18%, var(--flaeche-2));
}
:root[data-stil="glas"] .hinweis-karte { border-left-width: 1px; }
:root[data-stil="glas"] .hinweis-karte::before {
  content: ""; align-self: stretch; width: 4px; border-radius: 4px; background: var(--akzent); flex: none; margin: -.1rem 0;
}
:root[data-stil="glas"] .hinweis-karte.warn::before { display: none; }
:root[data-stil="glas"] .hinweis-karte.warn { border-left: 4px solid var(--knapp); }
