/* nfballett – Gestaltung von nffoodtrack/nfcaltrack übernommen (Klassisch
   und Liquid Glass, Animationen). Farben: Rosa als Akzent, Grün für
   „bezahlt“. Hell/Dunkel: System-Voreinstellung, data-theme überschreibt. */
:root {
  --bg: #f6f7f9;
  --flaeche: #ffffff;
  --flaeche-2: #eef0f3;
  --text: #16181d;
  --leise: #5d636e;
  --rand: #e1e4e9;
  --akzent: #be185d;
  --akzent-text: #ffffff;
  --warn: #d97706;
  --gefahr: #dc2626;
  --bezahlt: #047857;
  --offen: #b45309;
  --balken: #be185d;   /* Monatsbalken, geprüft mit dem dataviz-Validator */
  --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: #f472b6; --akzent-text: #2a0717; --warn: #fbbf24; --gefahr: #f87171;
    --bezahlt: #34d399; --offen: #fbbf24; --balken: #ec4899; --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: #f472b6; --akzent-text: #2a0717; --warn: #fbbf24; --gefahr: #f87171;
  --bezahlt: #34d399; --offen: #fbbf24; --balken: #ec4899; --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: Beträge müssen
   sich gut lesen lassen.
   ========================================================================== */
:root[data-stil="glas"] {
  --bg: #fbf1f5;
  --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(244 114 182 / .42); --hg-2: rgb(167 139 250 / .36); --hg-3: rgb(253 186 116 / .3); --hg-4: rgb(251 113 133 / .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: #120b10;
    --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(219 39 119 / .34); --hg-2: rgb(124 58 237 / .32); --hg-3: rgb(234 88 12 / .18); --hg-4: rgb(225 29 72 / .22);
  }
  :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: #120b10;
  --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(219 39 119 / .34); --hg-2: rgb(124 58 237 / .32); --hg-3: rgb(234 88 12 / .18); --hg-4: rgb(225 29 72 / .22);
}
: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, .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; }


/* ==========================================================================
   nfballett: Offen-Karte, Termine, Kacheln, Monatsbalken, Listen
   ========================================================================== */
.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-unter { margin: -.25rem .2rem .4rem; }
.gruppe-liste { background: var(--flaeche); border: 1px solid var(--rand); border-radius: .9rem; overflow: hidden; box-shadow: var(--schatten); }
.mitte-reihe { justify-content: center; }
.abstand-unten { margin-bottom: .6rem; }
.klein-knopf { min-height: 2rem; padding: .25rem .6rem; font-size: .85rem; }
.knopf.leicht-knopf { background: transparent; }
:root[data-stil="glas"] .knopf.leicht-knopf { background-color: transparent; box-shadow: none; border-color: transparent; }

/* Hinweis oben (kein Satz festgelegt) */
.hinweis-karte { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; border-left: 4px solid var(--akzent); }
.hinweis-text { flex: 1 1 12rem; display: flex; flex-direction: column; gap: .15rem; }

/* Offen: die eine Zahl, auf die es ankommt. */
.offen-karte { text-align: center; padding: 1.2rem 1rem 1rem; }
.offen-titel { margin: 0; font-size: .85rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--leise); }
.offen-betrag { margin: .2rem 0 .15rem; }
.gross-zahl { display: inline-block; font-size: 2.9rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.offen-betrag.erledigt .gross-zahl { color: var(--bezahlt); }
.offen-karte .knopfreihe { margin-top: .8rem; }
.offen-karte .hinweis { text-align: left; }

/* Fehlende Termine: Datum, Stepper, Haken */
.termin-zeile .zeile-inhalt { padding-top: .5rem; padding-bottom: .5rem; gap: .5rem; }
.termin-tag, .termin-aus {
  background: none; border: none; padding: 0; min-height: 0; justify-content: flex-start; text-align: left;
  border-radius: 0; box-shadow: none;
}
.termin-tag { font-weight: 600; color: var(--text); }
.termin-unter { display: flex; align-items: baseline; flex-wrap: wrap; }
.termin-aus { font-size: .8rem; color: var(--leise); text-decoration: underline; text-underline-offset: .15em; }
:root[data-stil="glas"] :is(.termin-tag, .termin-aus) { background: none; box-shadow: none; border: none; border-radius: 0; }
.haken-knopf { width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; border-radius: 50%; font-size: 1.15rem; flex: none; }

/* Stepper: − Zahl + */
.stepper { display: flex; align-items: center; gap: .3rem; flex: none; }
.stepper-knopf {
  width: 2.3rem; height: 2.3rem; min-height: 0; padding: 0; border-radius: 50%;
  font-size: 1.3rem; font-weight: 500; line-height: 1; flex: none;
}
.stepper-knopf.plus { background: color-mix(in srgb, var(--akzent) 14%, var(--flaeche-2)); }
:root[data-stil="glas"] .stepper-knopf.plus { background-color: color-mix(in srgb, var(--akzent) 18%, var(--flaeche-2)); }
.stepper-zahl {
  width: 2.6rem !important; padding: .3rem .1rem !important; text-align: center; font-weight: 700;
  font-variant-numeric: tabular-nums; background: transparent !important; border-color: transparent !important;
}
.stepper.gross { justify-content: center; gap: 1rem; margin: .2rem 0; }
.stepper.gross .stepper-knopf { width: 3.2rem; height: 3.2rem; font-size: 1.7rem; }
.stepper.gross .stepper-zahl { width: 5rem !important; font-size: 2.6rem !important; line-height: 1.1; }
.mitte-feld { align-items: center; text-align: center; }
.mitte-feld > span:first-child { align-self: flex-start; }
.vorschau { font-variant-numeric: tabular-nums; margin: 0; color: var(--leise); min-height: 1.45em; }
.vorschau strong { color: var(--text); font-size: 1.1rem; }
.betrag-feld { font-size: 1.4rem !important; font-weight: 650; font-variant-numeric: tabular-nums; }
.chip.gewaehlt { background: var(--akzent); color: var(--akzent-text); border-color: transparent; font-weight: 600; }
:root[data-stil="glas"] .chip.gewaehlt { background-color: var(--akzent); color: var(--akzent-text); }
details.mehr > summary { cursor: pointer; color: var(--akzent); font-size: .9rem; padding: .2rem 0; }
details.mehr[open] > summary { margin-bottom: .5rem; }

/* Kacheln: Monat, Jahr, gesamt, ausgezahlt */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin: 0 0 .9rem; }
.kachel {
  display: flex; flex-direction: column; gap: .1rem; padding: .8rem .9rem; color: inherit; text-decoration: none;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 1.1rem; box-shadow: var(--schatten);
  transition: transform .35s var(--feder);
}
.kachel:active { transform: scale(.97); transition-duration: .08s; }
.kachel-titel { font-size: .82rem; color: var(--leise); font-weight: 600; }
.kachel-zahl { display: inline-block; font-size: 1.45rem; font-weight: 720; font-variant-numeric: tabular-nums; line-height: 1.2; }
:root[data-stil="glas"] .kachel { border-radius: 1.4rem; }

/* Monate als Balken: eine Reihe, eine Farbe, Werte als Text daneben. */
.jahr-kopf { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.jahr-kopf h3 { margin: 0; }
.pfeil-knopf { width: 2.2rem; min-height: 2.2rem; padding: 0; font-size: 1.4rem; line-height: 1; }
.jahr-summe { text-align: center; margin: .1rem 0 .7rem; }
.monats-balken { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.monat-zeile {
  display: grid; grid-template-columns: 2.4rem 1fr 6.2rem; align-items: center; gap: .6rem;
  padding: .3rem .2rem; color: inherit; text-decoration: none; border-radius: .5rem; min-height: 2.2rem;
}
.monat-zeile:hover, .monat-zeile:focus-visible { background: var(--flaeche-2); }
.monat-name { font-size: .85rem; color: var(--leise); }
.balken-spur { height: .55rem; background: var(--ring-grund); border-radius: 4px; overflow: hidden; }
.balken { display: block; height: 100%; width: 0; background: var(--balken); border-radius: 4px; }
.monat-wert { text-align: right; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.2; }
.monat-offen { font-size: .72rem; font-weight: 500; color: var(--leise); }

/* Stunden- und Auszahlungszeilen */
.zeile-knopf {
  border: none; border-radius: 0; text-align: left; justify-content: flex-start; min-height: 3.2rem; cursor: pointer; font-size: 1rem;
}
.zeile-knopf:hover { background: var(--flaeche-2); }
:root[data-stil="glas"] .zeile-knopf { border-radius: 0; box-shadow: none; background-image: none; border: none; }
.datum-spalte { flex: none; width: 3rem; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.datum-wt { font-size: .75rem; color: var(--leise); text-transform: uppercase; font-weight: 650; letter-spacing: .03em; }
.datum-tag { font-weight: 650; font-variant-numeric: tabular-nums; font-size: .9rem; }
.betrag-spalte { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.zeile-betrag { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zeile-betrag.plus { color: var(--bezahlt); }
.status-ausgefallen .zeile-titel, .status-ausgefallen .datum-tag { color: var(--leise); }
.status-marke {
  font-size: .68rem; font-weight: 650; padding: .05rem .45rem; border-radius: 1rem; white-space: nowrap;
  background: var(--flaeche-2); color: var(--leise);
}
.status-marke.bezahlt { background: color-mix(in srgb, var(--bezahlt) 18%, transparent); color: var(--text); }
.status-marke.bezahlt::before { content: "✓ "; }
.status-marke.teilweise, .status-marke.offen { background: color-mix(in srgb, var(--offen) 20%, transparent); color: var(--text); }
.status-marke.ohne_satz { border: 1px dashed var(--leise); background: transparent; }

/* Bilanz auf der Auszahlungsseite */
.bilanz-liste { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0; font-variant-numeric: tabular-nums; }
.bilanz-liste dt { color: var(--leise); }
.bilanz-liste dd { margin: 0; text-align: right; font-weight: 600; }
.bilanz-summe { border-top: 1px solid var(--rand); padding-top: .45rem; font-size: 1.15rem; }
dt.bilanz-summe { color: var(--text); font-weight: 650; }
.bilanz p { margin: .7rem 0 0; }

.satz-jetzt { font-size: 1.3rem; margin: 0 0 .4rem; font-variant-numeric: tabular-nums; }
.segment.tage label { min-width: 0; }
.segment.tage span { padding-left: 0; padding-right: 0; }

/* Leere Liste */
.leer-start { text-align: center; padding: 1.6rem 1.2rem; }
.leer-symbol {
  width: 4.5rem; height: 4.5rem; margin: 0 auto .8rem; border-radius: 1.3rem;
  background:
    radial-gradient(circle at 50% 30%, var(--akzent) 0 14%, transparent 15%),
    linear-gradient(var(--akzent), var(--akzent)) 50% 68% / 60% 16% no-repeat,
    var(--flaeche-2);
}
@media (max-width: 380px) {
  .monat-zeile { grid-template-columns: 2.2rem 1fr 5.4rem; gap: .45rem; }
  .gross-zahl { font-size: 2.5rem; }
  .stepper-knopf { width: 2.1rem; height: 2.1rem; }
}
