/*
 * Pegel – monochrom, im Stil von iOS 27.
 *
 * Drei Regeln:
 *   1. Keine Farbe. Schwarz, Weiß und Grau, je nach Einstellung des iPhones.
 *      Die einzige Ausnahme ist Rot für Löschen.
 *   2. Glas nur für die schwebende Ebene: Leiste, Hinweis, Blätter. Inhalt
 *      steht auf ruhigen, deckenden Flächen. So macht es iOS auch.
 *   3. Bedienbares ist eine Pille oder ein Kreis, Flächen haben große Radien.
 *
 * Eingabefelder haben mindestens 16 px, sonst zoomt Safari beim Antippen.
 */

:root {
  color-scheme: light dark;

  --grund: #f2f2f2;
  --flaeche: #ffffff;
  --flaeche-2: #ebebeb;
  --text: #000000;
  --text-2: rgba(0, 0, 0, 0.62);
  --text-3: rgba(0, 0, 0, 0.42);
  --linie: rgba(0, 0, 0, 0.1);
  --fuellung: rgba(0, 0, 0, 0.055);
  --fuellung-2: rgba(0, 0, 0, 0.1);
  --primaer: #000000;
  --auf-primaer: #ffffff;
  --gefahr: #d70015;
  --schleier: rgba(0, 0, 0, 0.25);
  --tab-aktiv: rgba(0, 0, 0, 0.11);

  --glas: rgba(250, 250, 250, 0.66);
  --glas-blatt: rgba(246, 246, 246, 0.86);
  --glas-rand: rgba(255, 255, 255, 0.8);
  --glas-glanz: rgba(255, 255, 255, 0.95);
  --glas-schatten: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --blatt-gruppe: #ffffff;

  /*
   * Schrift und Radien (seit 1.54.0, UX-Prüfung): sieben Größen und drei Radien statt 23 und 18 fester Werte.
   * Eigene Größen behalten nur große Zahlen samt Einheit, Initialen im Profilbild (folgen dem Kreis), Emoji und
   * die nachgebaute Safari im Onboarding; eigene Radien nur Blätter (Glasform), Säulen und feine Striche.
   *
   * Seit 1.58.0 (To-do 8) folgen die sieben Größen der Textgröße des iPhones (Einstellungen › Anzeige ›
   * Textgröße): --basis ist die Größe des Fließtexts, 17 px bei der Standardstufe. Konrads Wahl: bis zur
   * größten normalen Stufe (23 px, etwa 135 %); die Stufen der Bedienungshilfen darüber deckelt die App, damit
   * Leiste, Pillen und Kacheln heil bleiben. Nach unten höchstens bis 16 px, sonst zoomt iOS in jedes Eingabefeld.
   */
  --basis: clamp(16px, 1rem, 23px);
  --gr-mini: calc(var(--basis) * 11 / 17);
  --gr-klein: calc(var(--basis) * 13 / 17);
  --gr-neben: calc(var(--basis) * 15 / 17);
  --gr-text: var(--basis);
  --gr-abschnitt: calc(var(--basis) * 20 / 17);
  --gr-titel: calc(var(--basis) * 28 / 17);
  --gr-gross: calc(var(--basis) * 34 / 17);
  --r-karte: 26px;
  --r-kachel: 22px;
  --r-klein: 12px;
  --leiste-h: 62px;
  --unten: max(14px, calc(env(safe-area-inset-bottom, 0px) - 12px));

  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --schrift-zahl: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #000000;
    --flaeche: #1a1a1a;
    --flaeche-2: #262626;
    --text: #ffffff;
    --text-2: rgba(255, 255, 255, 0.64);
    --text-3: rgba(255, 255, 255, 0.42);
    --linie: rgba(255, 255, 255, 0.12);
    --fuellung: rgba(255, 255, 255, 0.08);
    --fuellung-2: rgba(255, 255, 255, 0.16);
    --primaer: #ffffff;
    --auf-primaer: #000000;
    --gefahr: #ff6961;
    --schleier: rgba(0, 0, 0, 0.55);
    --tab-aktiv: rgba(255, 255, 255, 0.18);

    --glas: rgba(36, 36, 36, 0.62);
    --glas-blatt: rgba(30, 30, 30, 0.88);
    --glas-rand: rgba(255, 255, 255, 0.13);
    --glas-glanz: rgba(255, 255, 255, 0.2);
    --glas-schatten: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
    --blatt-gruppe: #2c2c2c;
  }
}

/* ---------- Grundlagen ---------- */

* { box-sizing: border-box; }

html {
  /* 1rem: die Textgröße, nach der sich --basis richtet. Überall 17 px, auf dem iPhone die des Systems (unten). */
  font-size: 17px;
  background: var(--grund);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /*
   * Kein Zoomen per Doppeltipp, nirgends (1.23.0): Ein ausgegrauter Knopf nimmt
   * keine Tipps an, der Doppeltipp ging an die Fläche dahinter, und Safari
   * zoomte die ganze Seite heran (Pfeil „Später“ in der Statistik). Mit zwei
   * Fingern zoomen geht weiter.
   */
  touch-action: manipulation;
}

/*
 * Nur auf iPhone und iPad (dort gibt es -webkit-touch-callout): die Textgröße des Systems. Safari auf dem Mac nähme
 * sonst seine 13 px. Die Schriftart setzt body, hier zählt nur die Größe.
 */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}

html.gesperrt { overflow: hidden; }

/* Kein Scroll-Balken rechts, wie in einer App (Konrads Wunsch, 1.22.0). Scrollen geht weiter. */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--text);
  font: var(--gr-text)/1.35 var(--schrift);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  /*
   * Keine Hurenkinder (seit 1.57.0, To-do 7): Kein Absatz endet mit einem einzelnen
   * Wort in der letzten Zeile. Safari und Chrome brechen dann früher um. Wo schon
   * balance steht, bleibt es dabei. Zwei Wörter in einer schmalen Kachel bleiben
   * zwei Zeilen, das geht nicht anders.
   */
  text-wrap: pretty;
}

button, select, input { font: inherit; color: inherit; letter-spacing: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

/* Ausgegraut: Der Finger geht durch auf die Fläche dahinter, dort zoomt ein Doppeltipp nicht (siehe html). */
button:disabled { cursor: default; pointer-events: none; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

h1, h2, p { margin: 0; }

.icon { flex: none; display: block; }

.ansicht {
  max-width: 560px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 12px)
    max(16px, env(safe-area-inset-right, 0px))
    calc(var(--unten) + var(--leiste-h) + 40px)
    max(16px, env(safe-area-inset-left, 0px));
}

.titel {
  font-size: var(--gr-gross);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 10px 4px 16px;
}

.abschnitt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 4px 10px;
}

.abschnitt h2 { font-size: var(--gr-abschnitt); font-weight: 700; letter-spacing: 0; }
.abschnitt > span { font-size: var(--gr-neben); color: var(--text-2); font-variant-numeric: tabular-nums; }
.abschnitt-zahl { display: inline-flex; align-items: center; gap: 2px; font-size: var(--gr-neben); color: var(--text-2); font-variant-numeric: tabular-nums; }
.abschnitt-zahl:active { opacity: 0.6; }

.karte {
  background: var(--flaeche);
  border-radius: var(--r-karte);
  padding: 16px;
  margin: 0 0 12px;
}

.karte-kopf, .kurve-kopf {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--gr-neben);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.kurve-kopf strong { color: var(--text); font-weight: 600; }

.karte-etikett { font-size: var(--gr-neben); font-weight: 600; margin-bottom: 10px; }
.karte-text { font-size: var(--gr-neben); color: var(--text-2); margin-bottom: 14px; }
.karte-klein { font-size: var(--gr-klein); color: var(--text-2); margin-top: 10px; }
.karte-fehler { font-size: var(--gr-klein); color: var(--gefahr); margin-top: 12px; }
.karte-fehler .code { color: var(--text-3); }

.leer-text { color: var(--text-2); font-size: var(--gr-neben); text-align: center; padding: 20px 16px; }

.banner {
  background: var(--flaeche);
  border-radius: var(--r-kachel);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: var(--gr-neben);
  color: var(--gefahr);
}

.fussnote { font-size: var(--gr-klein); color: var(--text-2); text-align: center; margin: 28px 12px 0; }
.fussnote + .fussnote { margin-top: 8px; color: var(--text-3); }

/* ---------- Glas ---------- */

.glas {
  background: var(--glas);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow:
    inset 0 0 0 0.5px var(--glas-rand),
    inset 0 1px 0 var(--glas-glanz),
    var(--glas-schatten);
}

/* ---------- Leiste ---------- */

.leiste {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: var(--unten);
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 420px);
  height: var(--leiste-h);
  padding: 4px;
  border-radius: 999px;
  display: flex;
  gap: 2px;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: var(--gr-mini);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color 0.25s, color 0.25s, transform 0.15s;
}

.tab[aria-selected="true"] { color: var(--text); }
.tab { position: relative; z-index: 1; }

/*
 * Eine Glasblase für den gewählten Reiter statt eines Hintergrunds je Knopf:
 * Sie gleitet beim Wechsel hinüber und folgt beim Ziehen dem Finger (leiste.js).
 */
.leiste { touch-action: none; }
.tab-blase {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  border-radius: 999px; background: var(--tab-aktiv);
  pointer-events: none; opacity: 0; will-change: translate, scale;
  /* Lage und Form bewegt leiste.js (Federn, Dehnen); hier nur Glas und Schatten. */
  transition: opacity 0.2s, background-color 0.25s, box-shadow 0.25s;
}
.tab-blase.da { opacity: 1; }
/* Unter dem Finger angehoben: heller, mit Schatten, wie eine Linse über der Leiste. */
.leiste.zieht .tab-blase {
  background: color-mix(in srgb, var(--tab-aktiv) 70%, var(--glas-glanz));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14), inset 0 0 0 0.5px var(--glas-rand);
}
.leiste.zieht .tab[aria-selected="true"]:not(.unter-finger) { color: var(--text-2); }
.leiste.zieht .tab.unter-finger { color: var(--text); }

.tab-zahl {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primaer);
  color: var(--auf-primaer);
  font-size: var(--gr-mini);
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--glas-blatt);
}
.tab-zahl.ploppt { animation: ploppen 0.55s cubic-bezier(0.25, 1.35, 0.5, 1); }
@keyframes ploppen { 0% { transform: scale(0.2); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.tab:active { transform: scale(0.95); }

/* ---------- Pegel ---------- */

.pegel { padding: 10px 4px 20px; }

.pegel .datum { font-size: var(--gr-neben); font-weight: 500; color: var(--text-2); margin-bottom: 2px; }

.pegel .zahl {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--schrift-zahl);
  font-variant-numeric: tabular-nums;
}

.pegel .wert {
  font-size: clamp(78px, 26vw, 112px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.pegel .einheit { font-size: 34px; font-weight: 500; color: var(--text-2); }
.pegel .einheit.steigt { margin-left: 2px; }
.pegel .wert.platzhalter { color: var(--text-3); font-weight: 300; letter-spacing: 0.02em; }

.skala {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--fuellung-2);
  margin: 14px 0 26px;
}
/* Ohne Marken (seit 1.52.2 ohne Getränk heute: weder Grenze noch Limit) braucht es unten keinen Platz für deren Beschriftung (Konrads Meldung: Balken zu weit oben). */
.skala:not(:has(.skala-marke)) { margin-bottom: 6px; }

.skala i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--text);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skala b {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--grund);
}

.skala-marke {
  position: absolute;
  top: 13px;
  transform: translateX(-50%);
  font-size: var(--gr-mini);
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.skala-marke.vor { transform: translateX(calc(-100% + 3px)); }
.skala-marke.nach { transform: translateX(-3px); }
/* Limit und Landesgrenze sehen seit 1.52.1 gleich aus (Konrads Wunsch); nur über dem Limit wird dessen Marke rot. */
/* Die Grenze des Landes kommt erst, wenn der Standort feststeht (seit 1.52.1), das Limit mit ihr (seit 1.52.2); beide blenden weich ein (0,7 s wie LAND_EINBLENDEN_MS in home.js). */
.skala b.kommt { animation: grenze-strich 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.skala .skala-marke.kommt { animation: grenze-marke 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
/* Über dem eigenen Limit: Balken und Limit-Marke rot. */
.skala.ueber i { background: var(--gefahr); }
.skala.ueber .skala-marke.limit { color: var(--gefahr); }

.info { font-size: var(--gr-neben); color: var(--text-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.info strong { color: var(--text); font-weight: 600; }

.pille.schmal { width: auto; padding: 0 22px; height: 46px; margin-top: 16px; }

/* ---------- Kurve ---------- */

.kurve-karte { padding: 14px 14px 8px; }

.kurve {
  position: relative;
  height: 160px;
  margin: 0 -2px;
}

.kurve svg { display: block; touch-action: pan-y; overflow: visible; }

.kurve .raster { stroke: var(--linie); stroke-width: 1; }
.kurve .raster.markiert { stroke-dasharray: 3 4; stroke: var(--text-3); }
.kurve .raster.limit { stroke: var(--text-2); stroke-width: 1.25; }
.kurve .achse-limit { fill: var(--text); font-weight: 700; }
.kurve .grund { stroke: var(--linie); stroke-width: 1; }
.kurve .achse { fill: var(--text-2); font-size: var(--gr-mini); font-weight: 500; font-variant-numeric: tabular-nums; }
.kurve .flaeche { fill: var(--text); opacity: 0.07; }
.kurve .linie { fill: none; stroke: var(--text); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.kurve .linie.vorhersage { stroke-dasharray: 2 5; opacity: 0.6; }
.kurve .getraenk { fill: var(--text-2); }
.kurve .jetzt { stroke: var(--text-3); stroke-width: 1; }
.kurve .jetzt-punkt { fill: var(--text); stroke: var(--flaeche); stroke-width: 2.5; }
.kurve .jetzt-text { fill: var(--text); font-weight: 600; }
.kurve .fuehrung { stroke: var(--text); stroke-width: 1; }
.kurve .abtast-text { fill: var(--text); font-size: var(--gr-klein); font-weight: 600; font-variant-numeric: tabular-nums; }
.kurve.tastet .jetzt, .kurve.tastet .jetzt-text { opacity: 0; }
.kurve .zeitmarke { fill: var(--text); font-weight: 600; }
.kurve .zeitmarke-punkt { fill: var(--text); stroke: var(--flaeche); stroke-width: 2; }
.kurve.tastet .zeitmarke, .kurve.tastet .zeitmarke-punkt { opacity: 0; }

/* ---------- Kacheln ---------- */

.kacheln {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kachel {
  position: relative;
  min-height: 88px;
  padding: 13px 12px 11px;
  border-radius: var(--r-kachel);
  background: var(--flaeche);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.18s;
}

.kachel:active { transform: scale(0.95); background: var(--flaeche-2); }
.kachel.puls { animation: puls 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }

@keyframes puls {
  0% { transform: scale(0.93); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.kachel-name {
  font-size: var(--gr-neben);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kachel-meta { font-size: var(--gr-klein); color: var(--text-2); font-variant-numeric: tabular-nums; }

.kachel-anzahl {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primaer);
  color: var(--auf-primaer);
  box-shadow: 0 0 0 2.5px var(--grund);
  font-size: var(--gr-klein);
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tipp { font-size: var(--gr-klein); color: var(--text-3); text-align: center; margin: 12px 8px 0; }

/* ---------- Listen ---------- */

.liste {
  display: block;
  width: 100%;
  background: var(--flaeche);
  border-radius: var(--r-karte);
  overflow: hidden;
  text-align: left;
}

.zeile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px 8px 16px;
  text-align: left;
}

.zeile + .zeile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--linie);
  transform: scaleY(0.5);
  transform-origin: top;
}

.zeile-knopf { transition: background-color 0.15s; }
.zeile-knopf:active, .zeile-haupt:active { background: var(--fuellung); }
.zeile-knopf .icon:last-child { color: var(--text-3); }
.zeile-knopf.gefahr { color: var(--gefahr); }
.zeile-knopf.gefahr .icon { color: var(--gefahr); }
.zeile-neu { color: var(--text); }

.zeile-haupt {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  margin: -8px 0 -8px -16px;
  padding: 8px 0 8px 16px;
  text-align: left;
  border-radius: 0;
}

.zeile-haupt:disabled { opacity: 1; }
.zeile-haupt .icon { margin-left: auto; color: var(--text-3); }

.uhr { font-size: var(--gr-neben); color: var(--text-2); font-variant-numeric: tabular-nums; width: 44px; flex: none; }

.zeile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zeile-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile-meta { font-size: var(--gr-klein); color: var(--text-2); font-variant-numeric: tabular-nums; }
.zeile-meta:empty { display: none; }
.zeile-wert { font-size: var(--gr-neben); color: var(--text-2); font-variant-numeric: tabular-nums; }

.minus {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fuellung);
  color: var(--text);
  transition: transform 0.15s, background-color 0.15s;
}

/* 44 Punkte Trefferfläche, auch wenn der Kreis kleiner aussieht: seit 1.58.0 für alle kleinen runden Knöpfe gemeinsam (bei .rund). */
.minus:active { transform: scale(0.9); background: var(--fuellung-2); }

.wertzeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
  position: relative;
}

.wertzeile + .wertzeile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--linie);
  transform: scaleY(0.5);
}

.wertzeile-wert { color: var(--text-2); font-variant-numeric: tabular-nums; }
.wertzeile .icon { color: var(--text-3); }
.liste-knopf { padding: 4px 0; }
.liste-knopf:active { background: var(--flaeche-2); }

.karte .wertzeile-trenner { padding: 0; margin-top: 16px; border-top: 0.5px solid var(--linie); padding-top: 12px; }

.auswahl {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--fuellung);
  padding: 8px 16px;
  font-size: var(--gr-neben);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.text-knopf { font-size: var(--gr-text); font-weight: 500; color: var(--text); padding: 4px 0; }

/* Favoriten am Griff ziehen (seit 1.32.0, seit 1.40.0 in getraenk-blatt.js): die gezogene Zeile hebt sich, die anderen weichen aus. */
.vorlage-zeile { transition: translate 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); background: var(--flaeche); }
.vorlage-zeile.gehoben {
  z-index: 2;
  transition: none;
  scale: 1.02;
  border-radius: var(--r-klein);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
}
.vorlage-zeile.gehoben::before, .vorlage-zeile.gehoben + .vorlage-zeile::before { opacity: 0; }
.griff {
  flex: none;
  align-self: stretch;
  display: grid;
  place-items: center;
  width: 48px;
  margin: -8px -12px -8px 0;
  color: var(--text-3);
  touch-action: none;
  cursor: grab;
}
.gehoben .griff { cursor: grabbing; color: var(--text-2); }

.konto { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primaer);
  color: var(--auf-primaer);
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 600;
}

/* ---------- Bedienelemente ---------- */

.pille {
  width: 100%;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--gr-text);
  font-weight: 600;
  transition: transform 0.15s, opacity 0.15s;
}

.pille:active { transform: scale(0.98); opacity: 0.85; }
.pille:disabled { opacity: 0.45; }
.pille.primaer { background: var(--primaer); color: var(--auf-primaer); }
.pille.zweit { background: var(--fuellung); color: var(--text); }

/* Anmelden (einwilligung.js): auf iPhone und iPad Apple oben, Google darunter. Das Logo ist Apples Zeichen U+F8FF, das nur Apple-Geräte zeichnen. */
.anmelde-knoepfe { display: grid; gap: 10px; width: 100%; }
.apple-logo { font-size: var(--gr-abschnitt); line-height: 1; margin-top: -3px; }
.pille.gefahr { background: transparent; color: var(--gefahr); height: 44px; }

.rund {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fuellung);
  color: var(--text);
  transition: transform 0.15s, opacity 0.15s;
}

.rund:active { transform: scale(0.92); }
.rund:disabled { opacity: 0.3; }
.rund.klein { width: 36px; height: 36px; }

/*
 * Tippfläche mindestens 44 × 44 pt, wie Apple es verlangt (seit 1.58.0, To-do 8): Kleine runde Knöpfe behalten ihr
 * Aussehen, die Fläche reicht unsichtbar darüber hinaus. :where, damit eine eigene Lage (etwa absolute beim Minus
 * der Getränkekarte) gewinnt.
 */
:where(.rund, .suche-leeren, button.minus) { position: relative; }
:is(.rund, .suche-leeren, button.minus)::after {
  content: "";
  position: absolute;
  inset: min(0px, calc((100% - 44px) / 2));
  border-radius: 50%;
}

.segment {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--fuellung);
}

/* Die Pille liegt als eigene Ebene unter den Knöpfen und gleitet (js/bewegung.js). Breite und Lage setzt segment(). */
.segment-daumen {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 999px;
  /* Ein Look überall (seit 1.54.0, UX-Prüfung): Gewählt ist schwarz wie bei den Chips, auf Seiten wie in Blättern. */
  background: var(--primaer);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.segment button {
  position: relative;
  flex: 1;
  height: 36px;
  border-radius: 999px;
  font-size: var(--gr-neben);
  font-weight: 500;
  color: var(--text-2);
}

.segment button[aria-checked="true"] { color: var(--auf-primaer); font-weight: 600; }

/* Ziehen (js/bewegung.js): seitlich gehört der Finger dem Segment, senkrecht scrollt die Seite. */
.segment { touch-action: pan-y; }
.segment-daumen { will-change: translate, scale; transition: box-shadow 0.2s; }
.segment.zieht .segment-daumen { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.05); }
.segment.zieht button[aria-checked="true"]:not(.unter-finger) { color: var(--text-2); font-weight: 500; }
.segment.zieht button.unter-finger { color: var(--auf-primaer); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
/* Die üblichen Mengen beim Buchen und Bearbeiten mittig (seit 1.32.0). */
.mengen-chips { justify-content: center; }
/* Katalog und Neue Vorlage unter den Vorlagen: eigene Gruppe mit Abstand (seit 1.32.0). */
.liste-hinzu { margin-top: 24px; }

.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fuellung);
  font-size: var(--gr-neben);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s, color 0.15s;
}

.chip[aria-pressed="true"] { background: var(--primaer); color: var(--auf-primaer); }

/* ---------- Statistik ---------- */

.statistik .segment { margin-bottom: 4px; }

.zeitnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 12px;
}

.zeitnav-mitte {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  border-radius: var(--r-klein);
}

.zeitnav-mitte strong { font-size: var(--gr-text); font-weight: 600; }
.zeitnav-mitte span { font-size: var(--gr-klein); color: var(--text-2); }

.saeulen {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 190px;
}

.saeulen-monat { gap: 2px; }
.saeulen-jahr { gap: 5px; }

.saeule {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
}

.saeule-feld {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-top: 18px;
}

.saeule i {
  position: relative;
  display: block;
  width: 100%;
  max-width: 30px;
  border-radius: 999px;
  background: var(--text);
}

.saeulen-monat .saeule i { border-radius: 3px 3px 2px 2px; }

.saeule.leer i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fuellung-2);
}

.saeule.zukunft i { background: transparent; box-shadow: inset 0 0 0 1px var(--linie); }

/*
 * Vorzeitraum (seit 1.30.0, Konrads Wahl C): seine Säulen grau hinter den eigenen, im selben Maßstab.
 * Das Feld darüber beginnt unter dem Rand für die Werte, damit Prozent dasselbe heißen wie bei den Säulen.
 */
.geist-feld { position: absolute; left: 0; right: 0; top: 18px; bottom: 0; display: flex; justify-content: center; align-items: flex-end; pointer-events: none; }
.saeule .geist-feld i.geist { width: 100%; max-width: 30px; border-radius: 999px; background: var(--fuellung-2); box-shadow: none; }
.saeulen-monat .saeule .geist-feld i.geist { border-radius: 3px 3px 2px 2px; }
.legende { display: inline-flex; align-items: center; gap: 6px; }
.legende b { width: 10px; height: 10px; border-radius: 3px; background: var(--fuellung-2); }
.saeule.heute .saeule-label { color: var(--text); font-weight: 700; }
.saeule:active .saeule-feld { opacity: 0.6; }

/*
 * Fahren über die Säulen (js/bewegung.js): seitlich gehört der Finger der
 * Grafik, senkrecht scrollt die Seite. Gesperrte Säulen (Zukunft, bei Freunden)
 * lassen den Finger zum Rahmen durch, damit er auch über sie fährt.
 */
.saeulen { touch-action: pan-y; }
.saeule:disabled { pointer-events: none; }
.saeule i { transition: opacity 0.15s; }
.saeulen.faehrt .saeule:not(.gewaehlt) i { opacity: 0.25; }
.saeulen.faehrt .saeule:active .saeule-feld { opacity: 1; }
.saeulen.faehrt .saeule.gewaehlt .saeule-label { color: var(--text); font-weight: 700; }
.karte-kopf.faehrt { color: var(--text); }
.karte-kopf.faehrt strong { flex: none; font-weight: 600; }
.karte-kopf.faehrt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hängt über der Säule, ohne Platz zu belegen. Das padding-top des Feldes hält ihn frei. */
.saeule-wert {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  font-size: var(--gr-mini);
  font-weight: 600;
  font-style: normal;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.saeule-label {
  height: 14px;
  font-size: var(--gr-mini);
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.kennzahlen {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kennzahl { background: var(--flaeche); border-radius: var(--r-kachel); padding: 14px 16px; }
.kennzahl-etikett { font-size: var(--gr-klein); font-weight: 500; color: var(--text-2); }

.kennzahl-wert {
  font-family: var(--schrift-zahl);
  font-size: var(--gr-titel);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 1px;
  white-space: nowrap;
}

.kennzahl-klein { font-size: var(--gr-klein); color: var(--text-2); }

/* ---------- Hinweis ---------- */

.hinweis {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(var(--unten) + var(--leiste-h) + 12px);
  transform: translate(-50%, 16px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: var(--gr-neben);
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.hinweis.mit-knopf { padding: 6px 6px 6px 20px; }
.hinweis.an { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.hinweis-text { overflow: hidden; text-overflow: ellipsis; }

/* Rückgängig: Der Ring läuft in der Zeit ab, die der Hinweis steht (ui.js, RUECKGAENGIG_MS). */
.hinweis-ring { flex: none; margin-right: 6px; transform: rotate(-90deg); }
.hinweis-ring circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 50.3; animation: ring-ab var(--dauer) linear forwards; }
/* 50,3 ist der Umfang bei r = 8. */
@keyframes ring-ab { to { stroke-dashoffset: 50.3; } }

/* Ein frisch gebuchtes Getränk ploppt auf der Grundlinie der Kurve auf (kurve.js). */
.kurve .getraenk.neu { transform-box: fill-box; transform-origin: center; animation: punkt-neu 0.5s cubic-bezier(0.25, 1.35, 0.5, 1) 0.2s both; }
@keyframes punkt-neu { from { transform: scale(0); } }

.hinweis-knopf {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primaer);
  color: var(--auf-primaer);
  font-size: var(--gr-neben);
  font-weight: 600;
}

/* Liegt ein Blatt offen, sitzt der Hinweis darüber statt dahinter. */
html.gesperrt .hinweis { z-index: 60; }

/* ---------- Blatt ---------- */

.schleier {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--schleier);
  opacity: 0;
  transition: opacity 0.3s;
}

.schleier.an { opacity: 1; }

.blatt {
  position: fixed;
  z-index: 41;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--tastatur, 0px));
  max-width: 560px;
  max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 24px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 34px;
  background: var(--glas-blatt);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--glas-rand), inset 0 1px 0 var(--glas-glanz), 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(calc(100% + 24px));
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.25, 1), bottom 0.25s;
  outline: none;
}

.blatt.an { transform: none; }

.blatt-kopf {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 6px;
}

.blatt-kopf h2 {
  text-align: center;
  font-size: var(--gr-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blatt-inhalt {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 4px;
}

.blatt-fuss {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 16px max(14px, calc(env(safe-area-inset-bottom, 0px) - 10px));
}

.blatt-fuss.leer { padding-top: 0; }

.blatt .karte, .blatt .liste { background: var(--blatt-gruppe); }
.blatt .karte { margin-bottom: 12px; }
.blatt .liste { margin-bottom: 8px; }
.blatt .rund { background: var(--fuellung); }
.blatt .chip { background: var(--blatt-gruppe); }
.blatt .chip[aria-pressed="true"] { background: var(--primaer); }
.blatt .segment { background: var(--blatt-gruppe); }

.tag-summe { font-size: var(--gr-neben); color: var(--text-2); text-align: center; margin: 0 8px 14px; font-variant-numeric: tabular-nums; }

/* ---------- Formulare ---------- */

.gruppe {
  background: var(--blatt-gruppe);
  border-radius: var(--r-kachel);
  margin: 0 0 14px;
  overflow: hidden;
}

.gruppe-segment { background: transparent; border-radius: 0; overflow: visible; }
/* Was Freunde sehen (seit 1.54.0): „Wie für alle“ als Satz, die Stufen als Liste mit Haken. */
.stufe-satz { font-size: var(--gr-neben); color: var(--text-2); margin: 2px 6px 12px; line-height: 1.4; }
.stufe-zeile .zeile-meta { white-space: normal; }

.feld { position: relative; }

.feld + .feld::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--linie);
  transform: scaleY(0.5);
}

.feld-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
}

.feld-name { flex: 1; white-space: nowrap; }

.feld-zeile input[type="text"],
.feld-zeile input[type="datetime-local"] {
  flex: 1 1 50%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
  font-size: var(--gr-text);
  padding: 14px 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.feld-zeile input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 52px;
  display: flex;
  justify-content: flex-end;
}

.feld-zeile input::-webkit-date-and-time-value { text-align: right; }

/* Ein Feld, das mitwächst (seit 1.52.2, Heimadresse Straße und Ort): einzeilig wie die anderen, nur Überlanges bricht um; die Beschriftung bleibt auf der ersten Zeile. */
.feld-zeile:has(.feld-mehrzeilig) { align-items: flex-start; }
.feld-zeile:has(.feld-mehrzeilig) .feld-name { flex: none; padding-top: 14px; line-height: 24px; }
.feld-zeile .feld-mehrzeilig {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
  font: inherit;
  font-size: var(--gr-text);
  line-height: 24px;
  padding: 14px 0;
  color: var(--text);
  resize: none;
  overflow: hidden;
  field-sizing: content;
}
.feld-zeile .feld-mehrzeilig::placeholder { color: var(--text-3); }

/* Die IBAN nimmt die ganze Zeile neben der Beschriftung (seit 1.52.2); auf schmalen iPhones etwas kleiner, damit sie ganz passt. */
.feld-zeile:has(.iban-feld) .feld-name { flex: none; }
.feld-zeile input.iban-feld { flex: 1 1 auto; font-size: clamp(15px, 4.25vw, 17px); }

/* Das i neben einer Beschriftung (seit 1.52.2): klein und grau, mit großer Tippfläche. */
.feld-name .info-knopf {
  position: relative;
  display: inline-grid;
  place-items: center;
  vertical-align: -3px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-3);
}
.feld-name .info-knopf::after { content: ""; position: absolute; inset: -12px; }
.paypal-info { padding: 4px 0 8px; }
.paypal-info .paypal-beispiel {
  background: var(--blatt-gruppe);
  border-radius: var(--r-kachel);
  padding: 22px 16px;
  margin: 0 0 6px;
  text-align: center;
  font-size: var(--gr-abschnitt);
  color: var(--text-3);
}
.paypal-info .paypal-beispiel strong { color: var(--text); font-weight: 600; }
.paypal-info p { font-size: var(--gr-neben); line-height: 1.45; color: var(--text-2); margin: 12px 4px 0; }
.paypal-info a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.feld-zeile input::placeholder { color: var(--text-3); }

.feld-zeile input[type="checkbox"] {
  flex: none;
  width: 51px;
  height: 31px;
  accent-color: var(--primaer);
  margin: 0;
}

/* Schalter ohne Safari (ui.js setzt .ohne-schalter): wie der native, an in der Primärfarbe, der Daumen gleitet. */
.ohne-schalter input[type="checkbox"][switch] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: var(--fuellung-2);
  cursor: pointer;
  transition: background-color 0.25s;
}
.ohne-schalter input[type="checkbox"][switch]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: translate 0.3s cubic-bezier(0.3, 1.4, 0.5, 1), background-color 0.25s;
}
.ohne-schalter input[type="checkbox"][switch]:checked { background: var(--primaer); }
.ohne-schalter input[type="checkbox"][switch]:checked::before { translate: 20px 0; background: var(--auf-primaer); }
.ohne-schalter input[type="checkbox"][switch]:disabled { opacity: 0.45; cursor: default; }
.ohne-schalter input[type="checkbox"][switch]:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }

.feld-einheit { color: var(--text-2); font-size: var(--gr-text); flex: none; }

.feld.hat-fehler .feld-name { color: var(--gefahr); }
.feld-fehler { font-size: var(--gr-klein); color: var(--gefahr); padding: 0 16px 10px; text-align: right; }
/* „Wird gesucht …“ unter einem Feld, das sich selbst speichert (Heimadresse, seit 1.30.0). */
.feld-status { font-size: var(--gr-klein); color: var(--text-2); margin: 8px 16px 0; text-align: right; }
.gruppe-segment .feld-fehler { text-align: center; padding-top: 6px; }

.gruppe-fuss { font-size: var(--gr-klein); color: var(--text-2); margin: -6px 16px 14px; }
.liste-knopf + .gruppe-fuss { margin-top: 8px; }

.gramm-zeile { font-size: var(--gr-klein); color: var(--text-2); text-align: center; margin: -6px 0 14px; min-height: 18px; font-variant-numeric: tabular-nums; }

/* ---------- Platzhalter beim Laden (ui.js) ---------- */

.platzhalter { display: grid; gap: 16px; padding: 8px 4px 14px; }
.platzhalter i, .platzhalter-strich { display: block; height: 12px; border-radius: 6px; background: var(--fuellung-2); animation: schimmern 1.4s ease-in-out infinite; }
.platzhalter-zeile { display: flex; align-items: center; gap: 12px; }
.platzhalter-zeile > span { flex: 1; display: grid; gap: 8px; }
.platzhalter .platzhalter-rund { flex: none; width: 36px; height: 36px; border-radius: 50%; }
.platzhalter .platzhalter-flaeche { border-radius: var(--r-karte); }
.platzhalter-strich { display: inline-block; width: 96px; height: 10px; vertical-align: middle; }
@keyframes schimmern { 50% { opacity: 0.4; } }

/* ---------- Ohne Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* Ohne Glas: deckend statt durchsichtig, damit nichts unlesbar wird. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glas { background: var(--flaeche); }
  .blatt, .blatt-zentral > .blatt-glas { background: var(--grund); }
}

/* ---------- Freunde ---------- */

.avatar.klein { width: 36px; height: 36px; font-size: 16px; }
.avatar.gross { width: 72px; height: 72px; font-size: 30px; }

.freund-zeile { min-height: 64px; }

.freund-wert {
  font-family: var(--schrift-zahl);
  font-size: var(--gr-abschnitt);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pille.klein { width: auto; height: 34px; padding: 0 14px; font-size: var(--gr-neben); flex: none; }

.knopf-reihe { display: flex; flex-direction: column; gap: 10px; }
.knopf-reihe.abstand { margin-top: 24px; }
.text-knopf.mitte { align-self: center; padding: 8px 12px; }

.mitte { text-align: center; }
.abstand-oben { margin-top: 8px; }

.link-feld {
  font: 14px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--blatt-gruppe);
  border-radius: var(--r-klein);
  padding: 14px 16px;
  margin: 0 0 14px;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
  -webkit-touch-callout: default;
}

.einladung-kopf { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 14px; }
.einladung-name { font-size: var(--gr-abschnitt); font-weight: 700; }

.schalter-zeile { padding-top: 10px; padding-bottom: 10px; }
.schalter-zeile .feld-name { white-space: normal; display: flex; flex-direction: column; gap: 2px; }
.schalter-name { font-size: var(--gr-text); }
.schalter-text { font-size: var(--gr-klein); color: var(--text-2); }

.gruppe-titel { font-size: var(--gr-klein); font-weight: 600; color: var(--text-2); margin: 16px 16px 6px; }
.gruppe-titel:first-child { margin-top: 4px; }

.pegel-freund { padding: 4px 4px 16px; }
.pegel-freund .wert { font-size: clamp(60px, 18vw, 76px); }
.pegel-freund .einheit { font-size: 26px; }
.stand { font-size: var(--gr-klein); color: var(--text-3); margin-top: 8px; }

.freund-seite .karte-kopf, .freund-seite .kurve-kopf { color: var(--text-2); }
.blatt .kennzahl { background: var(--blatt-gruppe); }

/* ---------- Profil ---------- */

img.avatar { object-fit: cover; background: var(--fuellung-2); padding: 0; }
.karte-knopf-huelle { padding: 0; overflow: hidden; }
.konto-knopf { width: 100%; padding: 16px; margin: 0; text-align: left; border-radius: var(--r-karte); transition: background-color 0.15s; }
.konto-knopf:active { background: var(--flaeche-2); }
.konto-knopf .icon { color: var(--text-3); }
.profil-kopf { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 4px 0 16px; }
.profil-kopf .avatar.gross { width: 96px; height: 96px; font-size: 40px; }
/* Der Kopf der Einstellungen ist ein Knopf (seit 1.29.0): öffnet Name und Foto. */
.profil-kopf-knopf { width: 100%; margin: 4px 0 20px; transition: opacity 0.15s; }
.profil-kopf-knopf:active { opacity: 0.6; }
.knopf-zeile { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.freund-kopf { display: flex; justify-content: center; margin: 0 0 8px; }
.text-knopf.block { display: block; margin-left: auto; margin-right: auto; }

/* ---------- Gruppen ---------- */

.gruppe-seite .segment { margin: 4px 0 2px; }

.mitglieder-leiste {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: var(--blatt-gruppe);
  text-align: left;
}
.mitglieder-leiste .zeile-meta { flex: 1; }
.mitglieder-leiste .icon { color: var(--text-3); }

/* Gruppenbild (gruppen-blaetter.js): groß im Kopf des Gruppen-Blatts; ohne Foto ein Gruppen-Symbol. */
.gruppe-kopf { display: flex; justify-content: center; margin: 2px 0 12px; }
.gruppe-kopf .avatar.gross, .profil-kopf .gruppen-avatar.gross { width: 96px; height: 96px; }
.gruppenbild-knopf { border-radius: 50%; transition: transform 0.15s; }
.gruppenbild-knopf:active { transform: scale(0.95); }
.gruppen-avatar { background: var(--fuellung-2); color: var(--text-2); }

/* Kopf einer Gruppe (seit 1.25.0): Mitglieder als kleine Pegel-Ringe (js/ringe.js), wenige mittig, viele zum Wischen. */
.kopf-ringe { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -2px; }
.kopf-ringe::-webkit-scrollbar { display: none; }
.kopf-ringe > :first-child { margin-left: auto; }
.kopf-ringe > :last-child { margin-right: auto; }
.kopf-ring { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; }
.kopf-ring .ring-name { max-width: 56px; font-size: var(--gr-mini); }
.kopf-ring.ruhig .avatar { opacity: 0.5; }
.ring.klein { width: 48px; height: 48px; }
.ring.klein .avatar { width: 37px; height: 37px; font-size: 16px; }
.kopf-dabei { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; margin: 2px 0 12px; padding: 6px 0; font-size: var(--gr-klein); color: var(--text-2); }
.kopf-dabei .icon { color: var(--text-3); }

/* Pegel jetzt als Balken (seit 1.25.0). */
.balken-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.balken-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.balken-wert { flex: none; font-family: var(--schrift-zahl); font-weight: 600; font-variant-numeric: tabular-nums; }
.balken-bahn { display: block; height: 8px; border-radius: 4px; background: var(--fuellung-2); overflow: hidden; }
.balken-bahn i { display: block; height: 100%; border-radius: 4px; background: var(--text); }
.balken-bahn i.gefahr { background: var(--gefahr); }

/* Treffen einer Gruppe (seit 1.25.0). */
.treffen-karte { display: grid; gap: 10px; margin-bottom: 10px; }
.treffen-kopf { display: flex; align-items: center; gap: 12px; }
.treffen-symbol { flex: none; width: 40px; height: 40px; border-radius: var(--r-klein); display: grid; place-items: center; background: var(--fuellung); }
.treffen-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.treffen-text strong { font-size: var(--gr-text); font-weight: 600; }
.treffen-text span { font-size: var(--gr-klein); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treffen-notiz { font-size: var(--gr-neben); color: var(--text-2); }
.treffen-zusagen { display: flex; align-items: center; gap: 8px; }
.treffen-antwort { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.treffen-antwort .pille { width: 100%; }
.treffen-planen { margin: 0 0 14px; }
/* Das Blatt einer Gruppe seit 1.42.0 (Entwurf B): die Lage oben, darunter Chat und vier Kacheln. */
.lage-karte { display: grid; gap: 12px; margin-bottom: 14px; }
.lage-karte .pegel-balken, .lage-karte .karte-mit-karte { margin: 0; }
.lage-karte .reihe.medaillen { margin: 0 -16px; padding: 0 16px; }
.lage-karte .foto-raster { margin: 0; }
.lage-karte > .pille { width: 100%; }
/* Zwei Stile für Abschnittstitel (seit 1.54.0, UX-Prüfung): .abschnitt h2 und das Gruppenlabel; „Gerade unterwegs“ nicht mehr in Großbuchstaben. */
.lage-titel { display: flex; align-items: center; gap: 8px; font-size: var(--gr-klein); font-weight: 600; color: var(--text-2); }
/* Die gemeinsamen Kurven unter den Balken (seit 1.42.1), etwas flacher als im Abend-Blatt. */
.lage-kurven .kurve-mehrere .kurve { height: 160px; }
.lage-kurven .legende-zeit { margin-top: 2px; }
.gruppe-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.gruppe-kachel { display: grid; gap: 4px; align-content: start; min-height: 98px; padding: 14px; border-radius: var(--r-kachel); background: var(--blatt-gruppe); text-align: left; transition: transform 0.15s; }
.gruppe-kachel:active { transform: scale(0.97); }
.gruppe-kachel .icon { color: var(--text-2); margin-bottom: 2px; }
.gruppe-kachel strong { font-size: var(--gr-neben); font-weight: 600; }
/* Kleine Bilder nebeneinander, überlappend (Zusagen beim Treffen). */
.preis-bilder { display: inline-flex; flex: none; }
.preis-bilder .avatar { width: 28px; height: 28px; font-size: 13px; box-shadow: 0 0 0 2px var(--blatt-gruppe); }
.preis-bilder .avatar + .avatar { margin-left: -8px; }

/* Auszeichnungen als Medaillen in einer Reihe (seit 1.25.0). Die Reihe reicht bis an den Rand des Blatts. */
.blatt .medaillen { margin: 0 -16px 8px; padding: 2px 16px 6px; gap: 8px; align-items: stretch; }
.medaille { width: 108px; background: var(--blatt-gruppe); border-radius: var(--r-kachel); padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.medaille-kopf { align-self: stretch; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.medaille-kopf span { font-size: var(--gr-mini); color: var(--text-3); font-variant-numeric: tabular-nums; }
.medaille-bilder { display: inline-flex; margin: 6px 0 6px; }
.medaille-bilder .avatar { width: 44px; height: 44px; font-size: 18px; box-shadow: 0 0 0 2px var(--blatt-gruppe); }
.medaille-bilder .avatar + .avatar { margin-left: -14px; }
/* Bei Gleichstand teilen sich bis zu drei die Medaille; die Bilder werden kleiner, damit sie in die Fassung passen. */
.medaille-bilder.je-2 .avatar { width: 38px; height: 38px; font-size: 16px; }
.medaille-bilder.je-2 .avatar + .avatar { margin-left: -10px; }
.medaille-bilder.je-3 .avatar { width: 32px; height: 32px; font-size: 14px; }
.medaille-bilder.je-3 .avatar + .avatar { margin-left: -9px; }
.medaille-titel { font-size: var(--gr-mini); font-weight: 600; line-height: 1.25; }
.medaille-wert { margin-top: auto; padding-top: 4px; font-family: var(--schrift-zahl); font-size: var(--gr-neben); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.medaille-name { max-width: 100%; font-size: var(--gr-mini); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medaille.ploppt { animation: medaille-rein 0.55s cubic-bezier(0.25, 1.35, 0.5, 1) var(--verzug, 0ms) backwards; }
@keyframes medaille-rein { from { opacity: 0; transform: scale(0.6); } }

/* Gruppenkalender (seit 1.25.0, js/album.js): Abende gefüllt, mit Foto als Bild, heute umgedreht, Treffen gestrichelt. */
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; background: var(--blatt-gruppe); border-radius: var(--r-kachel); padding: 12px 10px; margin-bottom: 12px; }
.kalender-wt { font-size: var(--gr-mini); color: var(--text-3); text-align: center; padding-bottom: 2px; }
.kalender-tag { position: relative; aspect-ratio: 1; border-radius: var(--r-klein); display: grid; place-items: center; overflow: hidden; font-size: var(--gr-neben); color: var(--text-2); font-variant-numeric: tabular-nums; transition: transform 0.15s; }
button.kalender-tag:active { transform: scale(0.92); }
.kalender-tag.abend { background: var(--fuellung-2); color: var(--text); font-weight: 600; }
.kalender-tag img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kalender-tag.mit-bild .kalender-zahl { position: absolute; left: 6px; top: 3px; font-size: var(--gr-mini); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.kalender-tag.heute:not(.mit-bild) { background: var(--text); color: var(--grund); font-weight: 600; }
.kalender-tag.heute.mit-bild { box-shadow: 0 0 0 2px var(--blatt-gruppe), 0 0 0 4px var(--text); overflow: visible; }
.kalender-tag.heute.mit-bild img { border-radius: var(--r-klein); }
.kalender-tag.geplant { border: 1.5px dashed var(--text-3); color: var(--text); }
.kalender-punkte { position: absolute; bottom: 5px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.kalender-punkte i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.kalender-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 10px 4px 2px; font-size: var(--gr-klein); color: var(--text-2); }
.kalender-legende span { display: inline-flex; align-items: center; gap: 6px; }
.kalender-legende .muster { width: 12px; height: 12px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.kalender-legende .muster.abend { background: var(--fuellung-2); }
.kalender-legende .muster.geplant { border: 1.5px dashed var(--text-3); }
.kalender-legende .muster.punkte b { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.55; }

/* Fotos eines Abends: Raster mit Feld zum Hinzufügen; groß im eigenen Blatt zum Wischen. */
.foto-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.foto-kachel { aspect-ratio: 1; border-radius: var(--r-klein); overflow: hidden; background: var(--blatt-gruppe); display: grid; place-items: center; color: var(--text-2); transition: transform 0.15s; }
.foto-kachel:active { transform: scale(0.95); }
.foto-kachel img { width: 100%; height: 100%; object-fit: cover; }
.foto-kachel.laedt { background: var(--fuellung-2); animation: schimmern 1.2s ease-in-out infinite; }
.foto-galerie { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; }
.foto-galerie::-webkit-scrollbar { display: none; }
.foto-seite { flex: none; width: 100%; height: min(62vh, 560px); margin: 0; padding: 0 16px; box-sizing: border-box; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.foto-seite img { max-width: 100%; max-height: 100%; border-radius: var(--r-klein); object-fit: contain; }
.foto-seite img.vorschau { width: min(100%, 62vh); filter: blur(8px); }
.foto-unter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 4px; }
.foto-unter > span { display: grid; gap: 1px; }
.foto-unter strong { font-size: var(--gr-neben); font-weight: 600; }
.foto-unter span span { font-size: var(--gr-klein); color: var(--text-2); }

.vergleich { margin-bottom: 10px; }
.vergleich-zeile { display: grid; grid-template-columns: 28px minmax(0, 5.5em) 1fr auto; align-items: center; gap: 10px; min-height: 36px; }
.vergleich-zeile .avatar { width: 28px; height: 28px; font-size: 13px; }
.vergleich-name { font-size: var(--gr-neben); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vergleich-zeile.ich .vergleich-name { font-weight: 700; }
.vergleich-balken { height: 8px; border-radius: 999px; background: var(--fuellung); overflow: hidden; }
.vergleich-balken i { display: block; height: 100%; border-radius: 999px; background: var(--text); opacity: 0.55; }
.vergleich-zeile.ich .vergleich-balken i { opacity: 1; }
.vergleich-wert { font-size: var(--gr-neben); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.kurve-mehrere .kurve { height: 190px; }
.kurve .linie.blass { opacity: 0.5; }
.kurve .linie.vorhersage-mehrere { opacity: 0.4; }
.kurve .kurven-name {
  fill: var(--text);
  font-size: var(--gr-mini);
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--blatt-gruppe);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.kurve .kurven-name.ich { font-weight: 800; }
.legende-zeit { font-size: var(--gr-mini); font-weight: 600; color: var(--text-2); margin: 6px 2px 4px; font-variant-numeric: tabular-nums; }
.kurve-legende { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 0 2px 4px; }
.legende-eintrag { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--gr-klein); }
.legende-eintrag svg { flex: none; }
.legende-eintrag .linie { stroke: var(--text); fill: none; stroke-linecap: round; }
.legende-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.legende-eintrag.ich .legende-name { color: var(--text); font-weight: 600; }
.legende-wert { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Karte ---------- */

.karte-mit-karte { padding: 0; overflow: hidden; }
/* Unter den Getränken eines Freundes: frühere Tage auf- und zuklappen (seit 1.41.1). */
.weitere-tage { margin-top: 10px; }
.weitere-tage .zeile { justify-content: space-between; min-height: 50px; }
.weitere-tage .zeile-name { color: var(--text-2); font-weight: 500; }
/* Unter der Karte eines Freundes: Route dorthin (seit 1.41.1). */
.route-knopf { width: 100%; margin: -4px 0 14px; gap: 8px; }
.karten-flaeche { width: 100%; background: var(--fuellung); border-radius: var(--r-karte); overflow: hidden; z-index: 0; }
/*
 * Der Hinweis auf OpenStreetMap als kleine Glaspille unten rechts (seit 1.30.0), wie „Wer ist wo“ links.
 * Er bleibt immer sichtbar (Regeln der OSMF); die Glaskarte eines gewählten Pins steht darüber.
 */
.karten-flaeche .leaflet-control-attribution.leaflet-control {
  margin: 0 10px 10px 0;
  padding: 2px 9px;
  border-radius: 999px;
  font: 500 11px/18px var(--schrift);
  letter-spacing: 0;
  color: var(--text-2);
  background: var(--glas);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 0 0 0.5px var(--linie), 0 2px 8px rgba(0, 0, 0, 0.12);
}
/*
 * OpenStreetMap ist bunt; grau passt zur App. Im Dunkelmodus umgekehrt und gedämpft.
 * Der Filter sitzt auf jeder Kachel, nicht auf der ganzen Ebene (seit 1.28.1, Konrads Fund): Mit dem Filter auf
 * der Ebene malte Safari alles hell, was keine Kachel ist, im Dunkelmodus also helle Linien in den Fugen zwischen
 * den Kachelreihen und helle Flächen beim Nachladen. Dahinter liegt der Ton der gefilterten Karte, damit Fugen
 * (auch Leaflets plus-lighter gegen Fugen in Chrome, hier abgeschaltet) nicht auffallen.
 */
.karten-flaeche .leaflet-tile-pane img.leaflet-tile { filter: grayscale(1) contrast(0.92) brightness(1.04); mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) {
  .karten-flaeche .leaflet-tile-pane img.leaflet-tile { filter: grayscale(1) invert(1) contrast(0.85) brightness(0.8); }
  .karten-flaeche.leaflet-container { background: #1a1a1a; }
}
.karten-flaeche .leaflet-control-attribution a { color: inherit; text-decoration: none; }
.karten-pin-huelle { background: none; border: 0; }
.karten-pin { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.karten-pin .avatar { width: 40px; height: 40px; font-size: 17px; box-shadow: 0 0 0 3px var(--flaeche), 0 4px 12px rgba(0, 0, 0, 0.3); }
.karten-pin.ich .avatar { box-shadow: 0 0 0 3px var(--primaer), 0 4px 12px rgba(0, 0, 0, 0.3); }
.karten-pin-name {
  font: 600 11px/1.2 var(--schrift);
  color: var(--text);
  background: var(--glas-blatt);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.karten-genauigkeit { fill: var(--text); fill-opacity: 0.08; stroke: var(--text); stroke-opacity: 0.25; stroke-width: 1; }
/*
 * Ein Tipp auf einen Pin: eine Glaskarte unten in der Karte wie in „Wo ist?“ (seit 1.30.0, statt Leaflets
 * Sprechblase). Sie gleitet herauf; der Hinweis auf OpenStreetMap rückt so lange unter sie.
 */
.karten-auswahl {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 38px;
  z-index: 1000;
  border-radius: var(--r-kachel);
  opacity: 0;
  translate: 0 12px;
  pointer-events: none;
  transition: opacity 0.2s ease, translate 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.karten-auswahl.an { opacity: 1; translate: 0 0; pointer-events: auto; }
.karten-auswahl-inhalt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  text-align: left;
  font: 15px/1.3 var(--schrift);
  color: var(--text);
}
.karten-auswahl-knopf { transition: transform 0.15s; }
.karten-auswahl-knopf:active { transform: scale(0.98); }
.karten-auswahl-knopf > .icon { flex: none; color: var(--text-3); }
.karten-auswahl .avatar { flex: none; width: 44px; height: 44px; font-size: 18px; }
.karten-auswahl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.karten-auswahl-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karten-auswahl-spitzname { font-size: var(--gr-klein); color: var(--text-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karten-auswahl-zeit { font-size: var(--gr-klein); color: var(--text-2); }
.karten-auswahl-wert { flex: none; font: 700 22px/1 var(--schrift-zahl); font-variant-numeric: tabular-nums; }
.karten-auswahl-wert .ring-pfeil { font-size: var(--gr-neben); margin-left: 2px; }
/* Meine Orte: der Inhalt der Glaskarte ist das Ort-Popup (statistik.js). */
.karten-auswahl .karten-popup { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-left: 6px; }
.karten-popup strong { font-weight: 600; }
.karten-popup span { font-size: var(--gr-klein); color: var(--text-2); }
.karten-popup-zeit { font-size: var(--gr-mini); color: var(--text-3); }
/* Der gewählte Pin hebt sich etwas. */
.karten-pin, .karten-ort { transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.karten-pin.gewaehlt { transform: scale(1.12) translateY(-3px); }
.karten-pin.gewaehlt .avatar { box-shadow: 0 0 0 3px var(--primaer), 0 6px 16px rgba(0, 0, 0, 0.35); }
.karten-ort.gewaehlt { transform: scale(1.12); }
.leaflet-container { font: inherit; background: var(--fuellung); }

/* ---------- Name und Spitzname ---------- */

.zeile-spitzname { font-size: var(--gr-klein); color: var(--text-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil-name { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
.profil-name strong { font-size: var(--gr-abschnitt); font-weight: 700; }
.profil-name span { font-size: var(--gr-neben); color: var(--text-2); font-style: italic; }
.freund-kopf { flex-direction: column; align-items: center; gap: 4px; }
.freund-kopf .zeile-spitzname { font-size: var(--gr-neben); }
.abstand-unten { margin-bottom: 4px; }
.blatt .liste-knopf.gruppe { display: block; width: 100%; text-align: left; padding: 4px 0; }

/* Einzelne Zeilen als eigene Pillen in den Einstellungen */
.liste.pille-karte { margin-bottom: 12px; }

/* ---------- Home auf einen Bildschirm ---------- */

/*
 * Zielgröße: ein iPhone ab 390 × 844 Punkten als App vom Home-Bildschirm,
 * also etwa 690 Punkte zwischen Statusleiste und Leiste unten. Kleinere
 * Geräte scrollen weiterhin.
 */
/* Oben 14px: Die Oberkante der Datumsschrift steht damit auf derselben Höhe wie die Titel der anderen Seiten. */
.home .pegel { padding: 14px 4px 10px; }
.home .pegel .wert { font-size: 72px; }
.home .pegel .einheit { font-size: 26px; }
.home .skala { margin: 10px 0 22px; }
/* Ohne Marken (kein Getränk heute) kein Platz für deren Beschriftung: Buchen und Heute rücken hoch (seit 1.52.2). */
.home .skala:not(:has(.skala-marke)) { margin-bottom: 4px; }
.home .kurve-karte { padding: 10px 12px 4px; margin-bottom: 0; }
.home .kurve-kopf { margin-bottom: 2px; font-size: var(--gr-klein); }
.home .kurve { height: 110px; }
.home .abschnitt { margin: 18px 4px 8px; }
.home .tipp { margin-top: 6px; }
.leer-text.klein { padding: 12px 16px; }

/* Waagerechte Reihen: bis an den Bildschirmrand, einrasten, ohne Rollbalken. */
.reihe {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 8px max(16px, env(safe-area-inset-left, 0px)) 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.reihe::-webkit-scrollbar { display: none; }
.reihe > * { flex: none; scroll-snap-align: start; }
/* Bezug für die Lage der Karten beim Nachrücken (js/bewegung.js), unabhängig vom Wischen. */
.reihe { position: relative; }
/* Breite und Höhe hält wegfallen() fest; hier nichts, was die Größe ändert (bis 1.42.0 sprang die Karte mit min-width: 0). */
.getraenk-karte.geht { pointer-events: none; }
/* Nicht einrasten, solange eine Karte kommt, nachrückt oder geht (js/bewegung.js): Die Einrastkante wanderte mit. */
.reihe:has(> .bewegt, > .geht) { scroll-snap-type: none; }
/*
 * Menge und Alkohol stehen immer in einer Zeile („0,25 l · 4,8 %“): Die Kachel
 * ist 96 px breit und wächst nur, wenn die Angabe länger ist. Der Name zählt
 * dabei nicht mit (width 0, min-width 100 %), sonst machte ein langer Name die
 * Kachel breit, statt umzubrechen.
 */
.kacheln-reihe .kachel { width: auto; min-width: 96px; max-width: 150px; min-height: 84px; }
.kacheln-reihe .kachel-meta { white-space: nowrap; }
.kacheln-reihe .kachel-name { width: 0; min-width: 100%; }

/* Breiter, bis der Name passt (seit 1.26.0: „Kleines Bier“ statt „Kleines B…“), höchstens 170 px. */
.getraenk-karte {
  position: relative;
  width: auto;
  min-width: 132px;
  max-width: 170px;
  background: var(--flaeche);
  border-radius: var(--r-kachel);
}
.getraenk-karte-haupt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 10px 12px 10px;
  text-align: left;
  border-radius: var(--r-kachel);
}
.getraenk-karte-haupt:active { background: var(--flaeche-2); }
.getraenk-karte-haupt .uhr { width: auto; font-size: var(--gr-klein); }
.getraenk-karte-name { font-weight: 600; font-size: var(--gr-neben); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 30px; }
.getraenk-karte .minus { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; }

/* Statistik auf einen Bildschirm: die Listen liegen in einem Blatt hinter einer Zeile. */
.statistik-listen { margin-top: 12px; }
.statistik-listen .zeile-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statistik .zeitnav { margin: 10px 0 10px; }
.statistik .saeulen { height: 160px; }
.statistik .kennzahl { padding: 11px 14px; }
.statistik .kennzahl-wert { font-size: var(--gr-titel); }
/*
 * Unten nur so viel Luft, wie die Leiste braucht: Mit den Rändern für Dynamic
 * Island und Home-Balken war die Statistik auf dem iPhone 17 sonst 1 px zu hoch,
 * ließ sich scrollen und zeigte rechts den Scroll-Balken.
 */
.ansicht:has(> .statistik) { padding-bottom: calc(var(--unten) + var(--leiste-h) + 16px); }
/* iPhone mini und ähnlich: etwas weniger Höhe, die Säulen geben sie her. */
@media (max-height: 820px) { .statistik .saeulen { height: 140px; } }

/* ---------- Mitteilungen ---------- */

.mitteilungen-hinweis {
  background: var(--blatt-gruppe);
  border-radius: var(--r-kachel);
  padding: 14px 16px;
  font-size: var(--gr-neben);
  line-height: 1.4;
  color: var(--text-2);
}

/* ---------- Onboarding ---------- */

html.in-einrichtung .leiste { display: none; }
html.in-einrichtung .ansicht { padding-bottom: 0; }

.einrichtung {
  position: relative;
  min-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
  display: flex;
  flex-direction: column;
}
/* Die vorige Seite beim Weiterblättern, nur als Bild über der neuen (bewegung.js, seiteGleiten). */
.einrichtung-alt { position: absolute; margin: 0; pointer-events: none; }
/*
 * Seit 1.36.0: Auf der Seite Körperdaten hat jedes aufgeklappte Rad bis zu 220
 * Zeilen, jede mit eigener Ebene (will-change). Gleitet die Seite samt offenem Rad
 * hinaus, musste Safari all diese Ebenen mitbewegen und blieb dabei gut 400 ms
 * stehen; die Getränke kamen dann ruckartig herein. Beim Hinausgleiten keine Ebenen.
 */
.einrichtung-alt .rad-zeile { will-change: auto; }

.einrichtung-kopf { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.rund-platz { width: 44px; height: 44px; flex: none; }
.einrichtung-punkte { display: flex; gap: 6px; }
.einrichtung-punkte i { display: block; width: 6px; height: 6px; border-radius: 3px; background: var(--fuellung-2); transition: width 0.3s, background-color 0.3s; }
.einrichtung-punkte i.fertig { background: var(--text-3); }
.einrichtung-punkte i.an { width: 18px; background: var(--text); }

.einrichtung-inhalt { flex: 1; display: flex; flex-direction: column; }
.einrichtung-inhalt.mitte { justify-content: center; align-items: center; text-align: center; padding-bottom: 8vh; }
.einrichtung-titel { font-size: var(--gr-gross); font-weight: 700; letter-spacing: 0.01em; line-height: 1.15; margin: 4px 4px 8px; }
.einrichtung-text { font-size: var(--gr-text); line-height: 1.4; color: var(--text-2); margin: 0 4px 20px; }
.einrichtung-symbol { width: 96px; height: 96px; border-radius: var(--r-kachel); margin-bottom: 20px; box-shadow: var(--glas-schatten); }
.einrichtung-einladung { display: inline-flex; align-items: center; gap: 8px; font-size: var(--gr-neben); color: var(--text-2); background: var(--fuellung); border-radius: 999px; padding: 8px 14px; margin: 4px 4px 0; }
.einrichtung-inhalt:not(.mitte) .einrichtung-einladung { align-self: flex-start; margin-top: 16px; border-radius: var(--r-klein); }
.einrichtung-knoepfe { display: flex; flex-direction: column; gap: 10px; }

.einrichtung-fuss {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0 calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: linear-gradient(to bottom, transparent, var(--grund) 24px);
}

.einrichtung-schritte { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border-radius: var(--r-karte); overflow: hidden; }
.einrichtung-schritte li { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.einrichtung-schritte li + li::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: 1px; background: var(--linie); }
.schritt-nr { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fuellung); font-weight: 600; font-size: var(--gr-neben); font-variant-numeric: tabular-nums; }
.schritt-text { display: flex; flex-direction: column; gap: 2px; }
.schritt-text strong { font-weight: 600; }
.schritt-text span { font-size: var(--gr-klein); color: var(--text-2); }

/* Vorschauen: Stücke der echten App, nur zum Ansehen */
.vorschau { pointer-events: none; -webkit-user-select: none; user-select: none; margin-bottom: 24px; }
.vorschau .pegel { padding: 0 4px 8px; }
.vorschau .pegel .wert { font-size: 64px; }
.vorschau .pegel .einheit { font-size: 24px; }
.vorschau .skala { margin: 10px 0 20px; }
.vorschau .kurve-karte { padding: 10px 12px 4px; margin: 4px 0 0; }
.vorschau .kurve { height: 110px; }
.vorschau .heute-reihe { margin-top: 4px; }
.vorschau .saeulen { height: 150px; }
.vorschau .kennzahlen { margin-top: 12px; }
.vorschau .liste { margin-top: 12px; }

.mitteilung-muster {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-kachel);
  background: var(--glas);
  border: 0.5px solid var(--glas-rand);
  box-shadow: var(--glas-schatten);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  text-align: left;
}
.mitteilung-muster img { width: 38px; height: 38px; border-radius: var(--r-klein); flex: none; }
/* Mehrere Mitteilungen im Onboarding (seit 1.32.0, vorschau.js), laufen nacheinander ein (bewegung.js). */
.mitteilungen-stapel { display: grid; gap: 8px; align-content: start; margin-top: 8px; }
.mitteilungen-stapel > [hidden] { display: none; }
.mitteilung-inhalt { flex: 1; min-width: 0; }
.mitteilung-kopf { display: flex; justify-content: space-between; font-size: var(--gr-klein); color: var(--text-2); }
.mitteilung-kopf strong { color: var(--text); font-weight: 600; }
.mitteilung-titel { font-size: var(--gr-neben); font-weight: 600; }
.mitteilung-text { font-size: var(--gr-neben); white-space: pre-line; }
.einrichtung-inhalt.zentriert { justify-content: center; padding-bottom: 4vh; }

/* ---------- Räder (statt Tastatur) ---------- */

.raeder {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2px;
  padding: 0 12px;
  -webkit-user-select: none;
  user-select: none;
}
.rad-band {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--r-klein);
  background: var(--fuellung);
  pointer-events: none;
}
.rad-spalte {
  position: relative;
  height: 100%;
  /* Der Greifbereich neben den Zahlen (rad.js, raeder): Polster und gleich großer negativer Rand. */
  min-width: calc(64px + var(--rad-l, 0px) + var(--rad-r, 0px));
  margin: 0 calc(-1 * var(--rad-r, 0px)) 0 calc(-1 * var(--rad-l, 0px));
  padding: 0 var(--rad-r, 0px) 0 var(--rad-l, 0px);
  overflow-y: scroll;
  /* Nur hoch und runter: Die gekippten Zeilen sind ein paar Pixel breiter als die Spalte und machten sie sonst seitlich scrollbar. */
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
.rad-spalte::-webkit-scrollbar { display: none; }
.rad-spalte:focus-visible { box-shadow: inset 0 0 0 2px var(--text-3); border-radius: var(--r-klein); }
.rad-zeile {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  scroll-snap-align: center;
  font-size: var(--gr-abschnitt);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  will-change: transform, opacity;
}
.rad-rechts .rad-zeile { justify-content: flex-end; }
.rad-links .rad-zeile { justify-content: flex-start; }
.rad-text { display: flex; align-items: center; font-size: var(--gr-abschnitt); font-weight: 500; color: var(--text); padding: 0 2px; }


.aufklapper-kopf { width: 100%; text-align: left; }
.aufklapper.offen .aufklapper-kopf .wertzeile-wert { color: var(--text); font-weight: 600; }
/*
 * Auf und zu wie bei iOS: Die Höhe zieht mit der Federkurve von Apple auf
 * (grid-template-rows 0fr → 1fr), die Räder blenden dabei ein und wachsen leicht.
 */
.aufklapper-inhalt {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}
.aufklapper.offen .aufklapper-inhalt { grid-template-rows: 1fr; }
.aufklapper-innen {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}
.aufklapper.offen .aufklapper-innen { opacity: 1; transform: none; transition: opacity 0.35s ease 0.05s, transform 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
.aufklapper-innen > .raeder { margin: 2px 0 12px; }
.aufklapper-kopf .wertzeile-wert { transition: color 0.2s, font-weight 0.2s; }
.aufklapper.ohne-uebergang .aufklapper-inhalt,
.aufklapper.ohne-uebergang .aufklapper-innen { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .aufklapper-inhalt, .aufklapper-innen { transition: none; }
}
.aufklapper { position: relative; }
.aufklapper + .aufklapper::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--linie); transform: scaleY(0.5); }

/* ---------- Wie eine App: kein Markieren ---------- */

/*
 * Safari markiert beim Halten sonst Text auf der ganzen Seite und zeigt Lupe
 * und Kopieren-Menü. Erlaubt bleibt es nur, wo man wirklich Text braucht.
 */
html { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Räder und Blätter scrollen nie seitlich. */
.raeder { overflow: hidden; }
.blatt-inhalt { overflow-x: hidden; overscroll-behavior-x: none; }

/* ---------- Promillegrenze (Blatt hinter der Skala, seit 1.41.0) ---------- */

/* Derselbe Balken wie auf Home, größer; er läuft beim Öffnen voll, dann kommen die Marken nacheinander. */
.grenze-blatt .skala { height: 12px; margin: 14px 6px 36px; }
.grenze-blatt .skala b { top: -4px; bottom: -4px; }
.grenze-blatt .skala-marke { top: 18px; font-size: var(--gr-mini); }
.grenze-blatt .skala i { animation: grenze-voll 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both; }
.grenze-blatt .skala b { animation: grenze-strich 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.grenze-blatt .skala-marke { animation: grenze-marke 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.grenze-blatt .skala :is(b, .skala-marke):nth-of-type(1) { animation-delay: 0.7s; }
.grenze-blatt .skala :is(b, .skala-marke):nth-of-type(2) { animation-delay: 0.9s; }
.grenze-blatt .skala :is(b, .skala-marke):nth-of-type(3) { animation-delay: 1.1s; }
@keyframes grenze-voll { from { width: 0; } }
@keyframes grenze-strich { from { opacity: 0; scale: 1 0; } }
@keyframes grenze-marke { from { opacity: 0; translate: 0 -6px; } }

.grenze-legende .zeile { animation: grenze-zeile 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.grenze-legende .zeile:nth-child(1) { animation-delay: 0.35s; }
.grenze-legende .zeile:nth-child(2) { animation-delay: 0.75s; }
.grenze-legende .zeile:nth-child(3) { animation-delay: 0.95s; }
.grenze-legende .zeile:nth-child(4) { animation-delay: 1.15s; }
@keyframes grenze-zeile { from { opacity: 0; translate: 0 8px; } }
.grenze-legende .zeile.gilt .zeile-name, .grenze-legende .zeile.gilt .zeile-wert { font-weight: 700; color: var(--text); }

/* Die Zeichen der Legende wie im Balken: Füllung für jetzt, Striche für Grenze und Limit. */
.grenze-zeichen { flex: none; width: 18px; height: 18px; position: relative; }
.grenze-zeichen.jetzt::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 6px; border-radius: 999px; background: var(--text); }
.grenze-zeichen.grenze::before, .grenze-zeichen.limit::before { content: ""; position: absolute; left: 8px; top: 1px; bottom: 1px; width: 2px; border-radius: 1px; background: var(--text-3); }

.grenze-strafen .zeile { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
.strafe-wann { font-size: var(--gr-klein); color: var(--text-2); font-variant-numeric: tabular-nums; }
.strafe-was { font-size: var(--gr-neben); font-weight: 500; line-height: 1.3; margin-top: 2px; }

/* ---------- Wirkung ---------- */

/*
 * Der Knopf schwebt oben rechts im Pegel, ohne die Datumszeile zu verschieben (deren Oberkante steht auf Titelhöhe).
 * Auf derselben Höhe wie die runden Knöpfe neben den Seitentiteln in Statistik und Freunde (.titel-knoepfe, seit
 * 1.28.1: gemessen 25,4 px von oben, mittig zu den Großbuchstaben des Titels).
 */
.pegel { position: relative; }
.pegel-knoepfe { position: absolute; top: 13.4px; right: 0; display: flex; gap: 10px; }
.pegel-knoepfe .rund { color: var(--text-2); }
.warnzeile { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--gefahr); font-size: var(--gr-neben); font-weight: 600; text-align: left; }

.wirkung-stufe { background: var(--blatt-gruppe); border-radius: var(--r-karte); padding: 16px 18px 18px; }
.wirkung-bereich { font-size: var(--gr-klein); color: var(--text-2); font-variant-numeric: tabular-nums; }
.wirkung-name { font-size: var(--gr-titel); font-weight: 700; letter-spacing: -0.01em; margin: 2px 0 10px; }
.wirkung-stufe .wirkung-name:first-child { margin-bottom: 2px; }
.wirkung-zeichen { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: var(--gr-neben); line-height: 1.35; }
.wirkung-zeichen li::marker { color: var(--text-3); }
.wirkung-steigt { margin-top: 12px; font-size: var(--gr-klein); color: var(--text-2); }

.wirkung-sprosse { gap: 14px; }
.wirkung-punkt { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--fuellung-2); }
.wirkung-sprosse.aktuell .wirkung-punkt { background: var(--text); box-shadow: 0 0 0 4px var(--fuellung); }
.wirkung-sprosse.aktuell .zeile-name { font-weight: 700; }
.wirkung-sprosse .zeile-wert { font-size: var(--gr-klein); white-space: nowrap; }

.wirkung-fuss { font-size: var(--gr-klein); color: var(--text-2); margin: 14px 4px 6px; }
.wirkung-quellen { font-size: var(--gr-mini); color: var(--text-3); margin: 0 4px 8px; line-height: 1.55; }
.wirkung-quellen a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.wirkung-quellen .quelle { display: block; margin-top: 2px; }

.wirkung-notfall {
  border-radius: var(--r-karte);
  padding: 16px 18px 18px;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--gefahr) 10%, var(--blatt-gruppe));
  border: 1px solid color-mix(in srgb, var(--gefahr) 35%, transparent);
}
.wirkung-notfall-titel { display: flex; align-items: center; gap: 8px; color: var(--gefahr); font-weight: 700; font-size: var(--gr-text); margin-bottom: 6px; }
.wirkung-notfall-text { font-size: var(--gr-neben); color: var(--text-2); }
.wirkung-notfall ul { margin: 6px 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: var(--gr-neben); line-height: 1.35; }
.wirkung-handeln { font-weight: 600; }
.pille.notruf { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--gefahr); color: #fff; text-decoration: none; margin-top: 4px; }

/* ---------- Was wäre, wenn ---------- */

.wenn:empty { display: none; }
.wenn { text-align: center; margin: 0 4px 10px; font-size: var(--gr-klein); color: var(--text-2); font-variant-numeric: tabular-nums; text-wrap: balance; }
.wenn strong { color: var(--text); font-weight: 600; }
.wenn-limit { color: var(--gefahr); font-weight: 600; margin-bottom: 2px; }
.wenn.ueber .wenn-zeile strong:first-of-type { color: var(--gefahr); }

/* ---------- Zurufe ---------- */

.zurufe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.zuruf {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 4px 10px; border-radius: var(--r-klein); background: var(--blatt-gruppe);
  font-size: var(--gr-mini); font-weight: 600; color: var(--text); line-height: 1.15;
  transition: transform 0.15s, opacity 0.2s;
}
.zuruf-zeichen { display: grid; place-items: center; height: 22px; line-height: 1; }
.zuruf:active { transform: scale(0.95); }
.zuruf.gesendet { opacity: 0.45; }
/* Gerade gesendet: Häkchen ploppt auf, danach kommt das Zeichen weich zurück (freunde-blaetter.js). */
.zuruf-haken { display: grid; place-items: center; height: 22px; animation: ploppen 0.5s cubic-bezier(0.25, 1.35, 0.5, 1); }
.zuruf.gesendet { transition: opacity 0.4s; }
.zuruf.gesendet.frisch { opacity: 1; }
.zuruf-zeichen.zurueck { animation: zurueck 0.35s ease both; }
@keyframes zurueck { from { opacity: 0; transform: scale(0.6); } }
/* Antwort-Blatt (seit 1.28.0): die Mitteilung, auf die man antwortet, darüber die Knöpfe. */
.antwort-mitteilung {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px;
  border-radius: var(--r-klein); background: var(--blatt-gruppe); font-size: var(--gr-neben); font-weight: 600; line-height: 1.25;
}
.antwort-mitteilung .avatar { flex: none; }
.antwort-text { min-width: 0; text-wrap: balance; display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.antwort-text strong { font-weight: 600; }

/* ---------- Heimweg ---------- */

.heimweg > .abschnitt:first-child { margin-top: 6px; }
.heim-adresse { flex: 1; min-width: 0; white-space: normal; line-height: 1.3; padding: 4px 0; }
.heim-adresse.leer { color: var(--text-3); }
.ankunft-zeile { gap: 12px; }
.ankunft-zeile input { margin-left: auto; }

/* ---------- Jahresrückblick ---------- */

.titel-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.titel-zeile .pille { width: auto; height: 34px; padding: 0 14px; font-size: var(--gr-neben); margin-top: 4px; }

/* Eine Bühne in Schwarz, Weiß und Grau, unabhängig vom hellen oder dunklen Modus. */
.rb {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 24px calc(env(safe-area-inset-bottom, 0px) + 26px);
  background: #000; color: #fff;
  opacity: 0; transform: scale(0.98);
  transition: opacity 0.3s, transform 0.3s, background-color 0.45s, color 0.45s;
  touch-action: manipulation; outline: none;
}
.rb.an { opacity: 1; transform: none; }
.rb[data-farbe="weiss"] { background: #fff; color: #000; }
.rb[data-farbe="grau"] { background: #2c2c2e; color: #fff; }
/* Farben für die Kurve auf der Bühne, je nach Seite. */
.rb { --text: #fff; --text-2: rgba(255, 255, 255, 0.7); --text-3: rgba(255, 255, 255, 0.45); --linie: rgba(255, 255, 255, 0.16); --flaeche: #000; }
.rb[data-farbe="grau"] { --flaeche: #2c2c2e; }
.rb[data-farbe="weiss"] { --text: #000; --text-2: rgba(0, 0, 0, 0.6); --text-3: rgba(0, 0, 0, 0.4); --linie: rgba(0, 0, 0, 0.1); --flaeche: #fff; }

.rb-balken { display: flex; gap: 4px; padding-right: 0; }
.rb-balken span { flex: 1; height: 3px; border-radius: 2px; background: color-mix(in srgb, currentColor 25%, transparent); overflow: hidden; }
.rb-balken i { display: block; height: 100%; width: 0; background: currentColor; }
.rb-zu { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 20px); right: 12px; width: 40px; height: 40px; display: grid; place-items: center; color: inherit; }

.rb-buehne { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.rb-seite { animation: rb-rein 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rb-rein { from { opacity: 0; transform: translateY(26px) scale(0.98); } to { opacity: 1; transform: none; } }

.rb-klein { font-size: var(--gr-text); font-weight: 600; opacity: 0.6; margin-bottom: 8px; }
.rb-gross {
  font-family: var(--schrift-zahl); font-size: clamp(72px, 24vw, 120px); font-weight: 800;
  letter-spacing: -0.045em; line-height: 0.95; overflow-wrap: break-word; font-variant-numeric: tabular-nums;
}
.rb-gross.mittel { font-size: clamp(56px, 17vw, 88px); white-space: nowrap; }
.rb-gross.lang { font-size: clamp(42px, 12.5vw, 64px); }
.rb-gross.rb-wort, .rb-gross.rb-titel { font-family: var(--schrift); font-size: clamp(54px, 16vw, 80px); letter-spacing: -0.035em; }
.rb-gross.rb-wort.lang { font-size: clamp(38px, 11vw, 58px); }
.rb-gross.rb-jahr { font-size: clamp(96px, 29vw, 150px); margin-top: 4px; white-space: nowrap; }
.rb-unter { font-size: var(--gr-abschnitt); font-weight: 600; margin-top: 16px; opacity: 0.85; line-height: 1.3; }

/* Zum Antippen: Rangliste der Getränke, Säulen der Monate, Kurve des höchsten Pegels. */
.rb-rangliste { display: grid; gap: 2px; margin-top: 24px; }
.rb-zeile {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; margin: 0 -12px; width: calc(100% + 24px); border-radius: var(--r-klein);
  font-size: var(--gr-text); font-weight: 600; opacity: 0.55; font-variant-numeric: tabular-nums;
  transition: opacity 0.2s, background-color 0.2s; -webkit-tap-highlight-color: transparent;
}
.rb-zeile.hervor { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.rb-platz { width: 18px; opacity: 0.6; }
.rb-zeile-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-kurve { margin-top: 26px; }
.rb .kurve { height: 200px; }

.rb-saeulen { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; height: 150px; margin-top: 34px; }
.rb-saeule { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.rb-saeule i { width: 100%; border-radius: 5px; background: currentColor; opacity: 0.25; transition: opacity 0.2s; }
button.rb-saeule { -webkit-tap-highlight-color: transparent; }
.rb-saeule.hervor i { opacity: 1; }
.rb-saeule span { font-size: var(--gr-mini); font-weight: 700; opacity: 0.55; }

.rb-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 16px; margin: 20px 0 40px; }
.rb-raster strong { display: block; font-family: var(--schrift-zahl); font-size: 42px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.rb-raster span { font-size: var(--gr-neben); font-weight: 600; opacity: 0.6; }
.rb-knoepfe { display: flex; flex-direction: column; gap: 10px; }

/* Gruppenfotos (seit 1.45.0): Das Foto füllt die Bühne, die Schrift steht unten. */
.rb[data-farbe="foto"] { background: #000; color: #fff; --text: #fff; --text-2: rgba(255, 255, 255, 0.75); }
.rb.mit-foto .rb-buehne { justify-content: flex-end; }
.rb-fotos { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #000; }
.rb-fotos::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 20%, transparent 42%, rgba(0, 0, 0, 0.88));
}
.rb-foto {
  position: absolute; inset: -4%; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.9s, filter 0.5s; animation: rb-zoom 9s linear both;
}
.rb-foto.an { opacity: 1; }
.rb-foto.unscharf { filter: blur(14px); }
@keyframes rb-zoom { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
@media (prefers-reduced-motion: reduce) { .rb-foto { animation: none; } }
.rb-abend .rb-klein { opacity: 0.75; }
.rb-abend-zahlen { display: flex; gap: 24px; margin-top: 20px; }
.rb-abend-zahlen strong { display: block; font-family: var(--schrift-zahl); font-size: var(--gr-titel); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.rb-abend-zahlen span { font-size: var(--gr-neben); font-weight: 600; opacity: 0.75; }
.rb-leute { display: flex; margin-top: 18px; }
.rb-leute .avatar { width: 34px; height: 34px; font-size: 14px; margin-right: -8px; box-shadow: 0 0 0 2px #000; }
.rb-leute span.avatar { background: #fff; color: #000; }
.rb .pille { display: flex; align-items: center; justify-content: center; gap: 8px; }
.rb[data-farbe="weiss"] .pille.primaer { background: #000; color: #fff; }
.rb[data-farbe="weiss"] .pille.zweit { background: rgba(0, 0, 0, 0.07); color: #000; }

/* ---------- Konto löschen ---------- */

.loeschen { display: grid; gap: 10px; padding: 4px 4px 8px; }
.loeschen-text { font-size: var(--gr-neben); line-height: 1.4; color: var(--text-2); }
.loeschen-text.stark { color: var(--text); font-weight: 600; }
.pille.loeschen { background: var(--gefahr); color: #fff; }

/* ---------- Einwilligung ---------- */

.einwilligung-text { font-size: var(--gr-neben); line-height: 1.45; color: var(--text-2); }
.einwilligung-text a { color: var(--text); text-underline-offset: 2px; }
.blatt .einwilligung-text { font-size: var(--gr-neben); padding: 4px 4px 8px; }
.einwilligung-schalter { display: flex; align-items: flex-start; gap: 12px; text-align: left; margin: 18px 0 4px; }
.einwilligung-schalter input { flex: none; margin-top: 2px; }

.fussnote a { color: inherit; text-underline-offset: 2px; }

/* Ganz unten im Profil, erst nach dem Scrollen: Abmelden und Konto löschen. */

/* ---------- Katalog ---------- */

/* Immer so hoch wie möglich: Sonst spränge das Blatt bei jedem Buchstaben in der Höhe. */
.blatt.blatt-voll { height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 24px); }
.blatt-voll .blatt-inhalt { flex: 1; }
.blatt-unterkopf { padding: 4px 16px 6px; }

.suche {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 6px 0 14px;
  border-radius: 999px;
  background: var(--blatt-gruppe);
  color: var(--text-3);
}
.suche input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--gr-text);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.suche input::placeholder { color: var(--text-3); }
.suche input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.suche-leeren { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--text-2); }
.suche-leeren[hidden] { display: none; }

/* Die Arten als eine Reihe zum Wischen, bis an den Rand des Blatts. */
.chips.chips-reihe {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 10px -16px 0;
  padding: 0 16px 2px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.chips-reihe::-webkit-scrollbar { display: none; }
.chips-reihe .chip { flex: none; }

.katalog-gruppe { font-size: var(--gr-klein); font-weight: 600; color: var(--text-2); margin: 16px 16px 6px; }
.katalog-liste > .katalog-gruppe:first-child { margin-top: 6px; }
.katalog-liste .liste { margin-bottom: 4px; }

.katalog-marke {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-2);
  box-shadow: inset 0 0 0 1.5px var(--linie);
  transition: background-color 0.2s, color 0.2s;
}
.katalog-marke.drin { background: var(--primaer); color: var(--auf-primaer); box-shadow: none; }
.zeile-knopf .katalog-marke .icon:last-child { color: inherit; }

/* ---------- Freunde: Live oben (1.17.0) ---------- */

.freunde .titel-zeile .titel { margin-right: 0; }
/*
 * Rund wie die Knöpfe oben rechts auf Home (.pegel-knoepfe): 36 px, grau, Abstand 10. Die Mitte steht auf der
 * Mitte der Großbuchstaben im Titel (seit 1.28.1 auf Konrads Wunsch, vorher 4 px tiefer).
 */
.titel-knoepfe { display: flex; gap: 10px; margin-top: -4px; }
.titel-knoepfe .rund { color: var(--text-2); }
.freunde .liste.pille-karte:first-of-type { margin-top: 2px; }
.freunde > .abschnitt:first-of-type { margin-top: 18px; }

/* Wer gerade einen Pegel hat: Profilbild im Ring, der Ring füllt sich bis 1,5 ‰. */
.ringe-reihe { gap: 14px; padding-top: 4px; padding-bottom: 2px; }
.ring-freund { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 70px; transition: transform 0.15s; }
.ring-freund:active { transform: scale(0.94); }
.ring { position: relative; display: grid; place-items: center; width: 64px; height: 64px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring circle { fill: none; stroke-width: 4; }
.ring .ring-bahn { stroke: var(--fuellung-2); }
.ring .ring-bogen { stroke: var(--text); stroke-linecap: round; transition: stroke-dasharray 0.6s cubic-bezier(0.2, 0.9, 0.25, 1); }
.ring.gefahr .ring-bogen { stroke: var(--gefahr); }
/* Der Ring atmet leise, solange der Abend läuft; --atem setzt die Phase nach der Uhr (views/freunde.js). */
.ring.atmet svg { animation: atmen 3.2s ease-in-out var(--atem, 0s) infinite; }
@keyframes atmen { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.ring .avatar { width: 50px; height: 50px; font-size: 21px; }
.ring-wert { margin-top: 3px; font-family: var(--schrift-zahl); font-size: var(--gr-neben); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ring-pfeil { margin-left: 2px; font-size: var(--gr-klein); }
.ring-name { max-width: 70px; font-size: var(--gr-klein); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kleine Karte ohne Finger; der Knopf darüber öffnet sie groß. */
.karten-vorschau { position: relative; margin-top: 16px; }
.karten-vorschau .karten-flaeche { pointer-events: none; }
.karten-vorschau-knopf { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; padding: 10px; border-radius: var(--r-karte); }
.karten-vorschau-knopf .glas { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 8px 0 14px; border-radius: 999px; font-size: var(--gr-neben); font-weight: 600; color: var(--text); }
.karten-vorschau-knopf .glas .icon { color: var(--text-2); }


/* ---------- Freigaben (1.19.0) ---------- */

.gruppe-titel { font-size: var(--gr-klein); font-weight: 600; color: var(--text-2); margin: 14px 16px 6px; }
/* „Wie für alle“: die Schalter des Standards nur zum Ansehen. */
.gruppe.gesperrt .feld-zeile { opacity: 0.5; }

/* ---------- Lokale (1.20.0) ---------- */

.getraenk-karte-lokal { font-size: var(--gr-mini); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rang { flex: none; width: 22px; font-family: var(--schrift-zahl); font-weight: 700; color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Blätter übereinander, wegziehen, Rückfrage (seit 1.26.0) ---------- */

/* Das untere Blatt tritt zurück, sein Schleier liegt darüber (Ebene je Blatt in ui.js). */
.blatt.an.darunter { transform: scale(0.94); transform-origin: 50% 0; }
/* Beim Ziehen folgt das Blatt dem Finger ohne Verzögerung; losgelassen gleitet es wieder. */
.blatt.zieht, .schleier.folgt { transition: none; }
.blatt-kopf { position: relative; }
.blatt-griff {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: var(--text-3);
  opacity: 0.6;
}
/* Ein Knopf, dessen Aktion noch läuft: ein kleiner Kreis dreht sich daneben. */
.pille.laeuft { opacity: 0.75; }
.pille.laeuft::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: drehen 0.7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }
.blatt-frage .frage-text { font-size: var(--gr-neben); line-height: 1.4; color: var(--text-2); padding: 4px 4px 10px; text-align: center; white-space: pre-line; }

/* Druck-Rückmeldung auch für die kleinen Knöpfe. */
.chip:active, .text-knopf:active, .zeitnav-mitte:active, .kopf-dabei:active, .warnzeile:active { opacity: 0.55; }
.karten-vorschau-knopf:active .glas { transform: scale(0.96); }
.karten-vorschau-knopf .glas { transition: transform 0.15s; }
.text-knopf, .zeitnav-mitte, .kopf-dabei, .warnzeile { transition: opacity 0.15s; }

/* ---------- Meine Orte (seit 1.27.0) ---------- */

/* Ein Punkt je Ort, die Zahl der Abende darin; ohne Lokal grau. */
.karten-ort {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primaer);
  color: var(--auf-primaer);
  font-size: var(--gr-klein);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px var(--flaeche), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.karten-ort.ohne-lokal { background: var(--text-3); color: var(--flaeche); }
/* Mehrere Orte zusammen (herausgezoomt): ein zweiter Ring zeigt, dass ein Tipp hineinzoomt. */
.karten-ort.gruppiert { box-shadow: 0 0 0 3px var(--flaeche), 0 0 0 6px var(--primaer), 0 4px 12px rgba(0, 0, 0, 0.3); }
.orte-summe { margin: 10px 4px 4px; font-size: var(--gr-klein); color: var(--text-2); text-align: center; }
.titel-knoepfe .pille { margin-top: 0; }
.titel-knoepfe { align-items: center; }

/* ---------- Chat in Gruppen (seit 1.34.0, js/chat-blaetter.js) ---------- */

/* Der ganze Chat: volle Höhe, wenige Nachrichten stehen unten wie in iMessage. */
.chat-blatt { height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 24px); }
.chat-blatt .blatt-inhalt { flex: 1; display: flex; flex-direction: column; padding-bottom: 0; }
.chat-blatt .verlauf { margin-top: auto; padding: 4px 0 10px; }
.chat-blatt .blatt-fuss { padding-top: 6px; }

.verlauf { display: flex; flex-direction: column; }
.trenner { align-self: center; margin: 16px 0 6px; font-size: var(--gr-mini); font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.verlauf > .trenner:first-child { margin-top: 4px; }
.neu-trenner { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: var(--gr-mini); font-weight: 600; color: var(--text-2); }
.neu-trenner::before, .neu-trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }
.chat-leer { padding: 6px 0 2px; font-size: var(--gr-neben); color: var(--text-2); text-align: center; }

.nachricht { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.nachricht.erste { margin-top: 10px; }
.verlauf > .nachricht:first-child { margin-top: 0; }
.nachricht.mein { justify-content: flex-end; }
.avatar.mini, .avatar-platz { flex: none; width: 28px; height: 28px; font-size: 13px; }
.blase-spalte { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; min-width: 0; }
.mein .blase-spalte { align-items: flex-end; }
.absender { margin: 0 0 3px 12px; font-size: var(--gr-mini); font-weight: 600; color: var(--text-2); }
.blase {
  position: relative;
  padding: 8px 13px;
  border-radius: var(--r-kachel);
  background: var(--blatt-gruppe);
  color: var(--text);
  font-size: var(--gr-text);
  line-height: 1.32;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.18s cubic-bezier(0.25, 1.35, 0.5, 1);
}
.mein .blase { background: var(--primaer); color: var(--auf-primaer); }
.nachricht:not(.mein):not(.erste) .blase { border-top-left-radius: 6px; }
.nachricht:not(.mein):not(.letzte) .blase { border-bottom-left-radius: 6px; }
.nachricht.mein:not(.erste) .blase { border-top-right-radius: 6px; }
.nachricht.mein:not(.letzte) .blase { border-bottom-right-radius: 6px; }
.blase.nur-emoji { background: none; font-size: 40px; line-height: 1.1; padding: 0 2px; }
.mein .blase.nur-emoji { background: none; }
.blase.bild { padding: 0; overflow: hidden; background: var(--fuellung); }
.mein .blase.bild { background: var(--fuellung); }
.blase.bild img { display: block; width: 220px; max-width: 100%; height: auto; }
.blase.gewaehlt { transform: scale(1.05); }
.reaktionen {
  position: relative;
  z-index: 1;
  margin: -7px 10px 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--text);
  font-size: var(--gr-klein);
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--glas-blatt), 0 1px 3px rgba(0, 0, 0, 0.12);
}
.reaktionen.mit-mir { background: var(--flaeche-2); }
.nachricht.neu { animation: nachricht-rein 0.4s cubic-bezier(0.2, 0.9, 0.25, 1) backwards; transform-origin: left bottom; }
.nachricht.mein.neu { transform-origin: right bottom; }
@keyframes nachricht-rein { from { opacity: 0; transform: translateY(14px) scale(0.9); } }

/* Halten auf einer Blase: Reaktionen als Glaspille darüber, über allen Blättern. */
.reaktion-schleier { position: fixed; inset: 0; z-index: 200; }
.reaktion-wahl {
  position: fixed;
  z-index: 201;
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glas-blatt);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--glas-rand), var(--glas-schatten);
  animation: wahl-rein 0.3s cubic-bezier(0.25, 1.35, 0.5, 1);
}
.reaktion-wahl button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; transition: transform 0.12s; }
.reaktion-wahl button:active { transform: scale(1.25); }
.reaktion-wahl button[aria-pressed="true"] { background: var(--fuellung-2); }
.reaktion-wahl .reaktion-loeschen { color: var(--gefahr); }
@keyframes wahl-rein { from { opacity: 0; transform: translateY(8px) scale(0.6); } }

/* Eingabe: Schnellantworten, darunter Foto, Feld und Senden. */
.chat-eingabe { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.schnell { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.schnell::-webkit-scrollbar { display: none; }
.schnell .chip { flex: none; height: 32px; padding: 0 12px; font-size: var(--gr-neben); }
.blatt .schnell .chip { background: var(--blatt-gruppe); }
.eingabe-zeile { display: flex; align-items: center; gap: 8px; }
.eingabe-zeile input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--blatt-gruppe);
  color: var(--text);
  font: inherit;
  font-size: var(--gr-text);
  outline: none;
  box-shadow: inset 0 0 0 0.5px var(--linie);
  -webkit-appearance: none;
  appearance: none;
}
.eingabe-zeile input::placeholder { color: var(--text-3); }
.eingabe-zeile .rund { width: 40px; height: 40px; color: var(--text-2); }
.blatt .eingabe-zeile .rund.senden { background: var(--primaer); color: var(--auf-primaer); }
.eingabe-zeile .rund.senden:disabled { opacity: 0.22; }
/* Ein Lokal frei eintippen (seit 1.38.0, lokale-blatt.js): unter der Liste der Lokale. */
.lokal-frei { margin: 4px 0 10px; }

/* Zahl ungelesener Nachrichten, schwarz bzw. weiß wie die Zahl am Reiter; Rot bleibt für Gefahr. */
.chat-zahl {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--primaer);
  color: var(--auf-primaer);
  font-size: var(--gr-klein);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chat-zahl.ploppt { animation: ploppen 0.55s cubic-bezier(0.25, 1.35, 0.5, 1); }

/*
 * Die Karte im Gruppen-Blatt (Konrads Wahl: Entwurf E, „etwas präsenter“):
 * großer Kopf mit gefülltem Symbol, die letzten Nachrichten als Blasen,
 * darunter Schnellantworten und Feld.
 */
.blatt .chat-karte { display: grid; gap: 12px; padding: 14px 14px 12px; margin: 0 0 14px; }
.chat-karte-oben { display: grid; gap: 12px; width: 100%; text-align: left; transition: opacity 0.15s; }
.chat-karte-oben:active { opacity: 0.6; }
.chat-karte-kopf { display: flex; align-items: center; gap: 10px; }
.chat-karte-symbol { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primaer); color: var(--auf-primaer); }
.chat-karte-kopf strong { flex: 1; font-size: var(--gr-abschnitt); font-weight: 700; }
.chat-karte-kopf > .icon { color: var(--text-3); }
.chat-karte .verlauf .nachricht.erste { margin-top: 8px; }
.chat-karte .verlauf > .nachricht:first-child { margin-top: 0; }
.chat-karte .blase {
  padding: 7px 12px;
  font-size: var(--gr-neben);
  background: var(--fuellung);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.chat-karte .mein .blase { background: var(--primaer); }
.chat-karte .blase.nur-emoji { font-size: 30px; }
/* Nur Emoji: ohne Blase, auch bei eigenen Nachrichten (die Regel darüber färbte sie sonst schwarz). */
.chat-karte .mein .blase.nur-emoji { background: none; }
.chat-karte .blase.bild { display: block; padding: 0; }
.chat-karte .blase.bild img { width: auto; height: 96px; max-width: 170px; object-fit: cover; }
.chat-karte .reaktionen { box-shadow: 0 0 0 2px var(--blatt-gruppe); background: var(--flaeche-2); }
.chat-karte .schnell { margin: 0 -14px; padding: 0 14px; }
.blatt .chat-karte .schnell .chip, .chat-karte .eingabe-zeile input { background: var(--fuellung); box-shadow: none; }
.blatt .chat-karte .eingabe-zeile .rund:not(.senden) { background: var(--fuellung); }
.chat-karte .platzhalter { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .nachricht.neu, .reaktion-wahl, .chat-zahl.ploppt { animation: none; }
}

/* ---------- Ankommen (seit 1.35.0, UX-REISE-2026-10-27.md) ---------- */

/* Die Promillezahl auf Home ist ein Knopf: Sie öffnet „Wirkung“. */
.pegel .zahl-knopf { font: inherit; color: inherit; text-align: left; padding: 0; transition: opacity 0.15s; }
.pegel .zahl-knopf:active { opacity: 0.55; }

/*
 * „Anderes“ als Plus rechts neben „Buchen“. Rechts ohne den Einzug der Überschriften: Kamera und Plus stehen
 * genau unter den Knöpfen oben rechts (seit 1.37.3, Konrads Wunsch; vorher 4 px weiter links).
 */
.abschnitt.mit-knopf { align-items: center; margin-top: 22px; margin-bottom: 6px; margin-right: 0; }
.abschnitt.mit-knopf .rund { color: var(--text-2); }

/* Anmelden: gedimmt bleibt nur für Stellen außerhalb der Einrichtung (einwilligung.anmeldeKnoepfe). */
.pille.gedimmt { opacity: 0.45; }

/* Einrichtung: ein großes Zeichen statt einer Vorschau (Einladung, Standort). */
.einrichtung-zeichen { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 20px; background: var(--primaer); color: var(--auf-primaer); }

/* Am Computer: der Link als QR-Code, immer schwarz auf weiß. */
.qr-bild { display: flex; justify-content: center; margin: 8px 0 4px; }
.qr-bild svg { border-radius: var(--r-kachel); box-shadow: var(--glas-schatten); }
.qr-text { text-align: center; color: var(--text-2); margin: 10px 0 18px; }
.qr-gilt { display: block; font-size: var(--gr-klein); color: var(--text-3); margin-top: 4px; }

/* ---------- Einstellungen (seit 1.40.0, Konrads Entwurf A, js/views/einstellungen.js) ---------- */

/* Profilzeile wie die Apple-ID, rechts der eigene QR-Code. */
.einstellungen .profil-zeile { display: flex; align-items: center; margin-bottom: 22px; }
.profil-zeile-haupt { flex: 1; min-width: 0; min-height: 84px; gap: 14px; }
.profil-zeile .avatar { width: 60px; height: 60px; font-size: 26px; }
.zeile .avatar .icon:last-child { color: var(--auf-primaer); }
.profil-zeile .zeile-name { font-size: var(--gr-abschnitt); font-weight: 600; }
.profil-qr { flex: none; margin-right: 14px; }
/* Gruppen ohne Überschrift; Symbol in einer grauen Kachel, Wert rechts. */
.einstellungen-gruppen .liste { margin-bottom: 22px; }
.einstellungen-gruppen .zeile { min-height: 50px; }
.einstellungen-gruppen .zeile + .zeile::before { left: 58px; }
.einstellungen-gruppen .zeile-name { flex: 1; min-width: 0; }
.einstellung-kachel { flex: none; width: 30px; height: 30px; border-radius: var(--r-klein); display: grid; place-items: center; background: var(--fuellung); }
.zeile .einstellung-kachel .icon:last-child { color: var(--text); }
.einstellung-wert { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* Jeder Schalter schwarz-weiß wie in den Blättern (.feld-zeile), nie iOS-Grün (seit 1.40.0, Konrads Wunsch). */
input[type="checkbox"][switch] { accent-color: var(--primaer); }
.einstellungen > .fussnote { margin-top: 6px; }

/* Die Datenschutzerklärung als Blatt (seit 1.40.0, einwilligung.js): Abschnitte als Karten wie auf der Seite. */
.datenschutz-blatt .stand { color: var(--text-2); font-size: var(--gr-klein); margin: 0 4px 12px; }
.datenschutz-blatt section { background: var(--blatt-gruppe); border-radius: var(--r-karte); padding: 16px 18px; margin: 0 0 12px; font-size: var(--gr-neben); line-height: 1.5; }
.datenschutz-blatt h2 { font-size: var(--gr-text); font-weight: 700; margin: 0 0 8px; }
.datenschutz-blatt h3 { font-size: var(--gr-neben); font-weight: 600; margin: 14px 0 4px; }
.datenschutz-blatt p, .datenschutz-blatt ul { margin: 0 0 10px; }
.datenschutz-blatt p:last-child, .datenschutz-blatt ul:last-child { margin-bottom: 0; }
.datenschutz-blatt ul { padding-left: 20px; list-style: disc; }
.datenschutz-blatt li { margin-bottom: 4px; }
.datenschutz-blatt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.einrichtung-adresse { text-align: center; font-size: var(--gr-klein); color: var(--text-3); margin: 6px 0 0; }

/* ---------- Der Rest der UX-Reise (seit 1.36.0) ---------- */

/*
 * Der Film zum Installieren auf dem iPhone (einrichtung.js, safariFilm): fünf
 * Bilder der Safari-Oberfläche von iOS 26, je 2,5 s, in Schleife. --start
 * versetzt Bild, Tipp-Kreis und den passenden Schritt darunter in denselben Takt.
 */
.film {
  position: relative;
  height: 168px;
  margin: 0 0 12px;
  border-radius: var(--r-karte);
  background: var(--flaeche);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.film-bild {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 14px 14px;
  opacity: 0;
  animation: film-bild 12.5s infinite both;
  animation-delay: var(--start);
}
@keyframes film-bild {
  0% { opacity: 0; transform: translateY(10px); }
  3%, 18% { opacity: 1; transform: none; }
  20%, 100% { opacity: 0; transform: none; }
}
.film-leiste { display: flex; align-items: center; gap: 8px; width: 100%; }
.film-kreis {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glas-blatt);
  box-shadow: var(--glas-schatten), inset 0 0 0 0.5px var(--glas-rand);
  color: var(--text);
}
.film-kreis.klein { width: 40px; height: 40px; }
.film-punkte { font-size: 17px; letter-spacing: 1px; font-weight: 700; line-height: 1; }
.film-adresse {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: #6b6b6b;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 14px;
}
.film-menue, .film-blatt {
  display: grid;
  background: var(--glas-blatt);
  box-shadow: var(--glas-schatten), inset 0 0 0 0.5px var(--glas-rand);
  border-radius: 22px;
}
.film-menue { margin-left: auto; width: max-content; max-width: 100%; padding: 6px; }
.film-zeile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 15px;
  white-space: nowrap;
}
.film-blatt { width: 100%; padding: 12px 10px; }
.film-blatt:not(.film-liste):not(.film-dialog) { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.film-liste { padding: 6px; }
.film-aktion { display: grid; justify-items: center; gap: 6px; font-size: 11px; color: var(--text-2); text-align: center; }
.film-aktion .film-kreis { background: var(--fuellung-2); box-shadow: none; }
.film-dialog { gap: 12px; }
.film-dialog-kopf { display: flex; align-items: center; gap: 10px; }
.film-dialog-kopf strong { flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-hinzufuegen { position: relative; padding: 9px 14px; border-radius: 999px; background: #0a84ff; color: #fff; font-weight: 600; font-size: 14px; }
.film-dialog-app { display: flex; align-items: center; gap: 12px; font-size: 16px; padding: 0 4px; }
.film-dialog-app img { width: 40px; height: 40px; border-radius: 10px; }

/* Der Tipp: ein grauer Kreis auf dem Ziel, kurz nach dem Erscheinen des Bilds. */
.film-ziel::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: rgba(128, 128, 128, 0.35);
  opacity: 0;
  animation: film-tipp 12.5s infinite;
  animation-delay: var(--start);
}
@keyframes film-tipp {
  0%, 7% { opacity: 0; transform: scale(1.25); }
  9% { opacity: 1; transform: scale(1); }
  13% { opacity: 1; transform: scale(0.92); }
  16%, 100% { opacity: 0; transform: scale(1); }
}
.film-zeile.film-ziel::after { border-radius: 14px; }
.film-kreis.film-ziel::after { border-radius: 50%; }

/* Die Schritte darunter, knapp; der gerade gezeigte leuchtet. */
.einrichtung-schritte.kurz li { padding: 9px 16px; }
.film-schritt { animation: film-schritt 12.5s infinite; animation-delay: var(--start); }
@keyframes film-schritt {
  0%, 1% { background: transparent; }
  3%, 18% { background: var(--fuellung); }
  20%, 100% { background: transparent; }
}
.film-schritt .schritt-nr { animation: film-nummer 12.5s infinite; animation-delay: var(--start); }
@keyframes film-nummer {
  0%, 1% { background: var(--fuellung); color: var(--text); }
  3%, 18% { background: var(--primaer); color: var(--auf-primaer); }
  20%, 100% { background: var(--fuellung); color: var(--text); }
}

/* Ein Pfeil auf die echte Leiste von Safari, unten rechts auf •••. */
.film-pfeil {
  position: fixed;
  right: 46px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
  z-index: 5;
  color: var(--text);
  animation: film-pfeil 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes film-pfeil {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(2px); }
}

/* Gruppen in der Tour (vorschau.js): Kopf mit Ringen und die Karte mit dem Chat wie im Gruppen-Blatt. */
.vorschau-gruppen .kopf-dabei { margin: 0 0 10px; }
.vorschau .chat-karte { display: grid; gap: 10px; padding: 14px 14px 12px; margin: 0; }
.vorschau .chat-karte .verlauf .nachricht.erste { margin-top: 8px; }
.vorschau .chat-karte .verlauf > .nachricht:first-child { margin-top: 0; }

/* Ein Tipp bucht, zum Mitmachen: Kacheln und Minus nehmen Finger an. */
.vorschau.mitmachen { pointer-events: auto; }
/*
 * Ohne Einrasten (seit 1.36.1, Konrads Meldung „da zuckt es“): Safari misst die
 * Einrastkante an der verkleinerten Kachel, solange sie aus 60 % hereinploppt.
 * Die Reihe stand deshalb 19 px verschoben da und sprang nach gut 300 ms zurück;
 * beim Mitmachen ebenso nach jedem Tipp (Puls, neue Karte).
 */
.vorschau .reihe { scroll-snap-type: none; }
.vorschau.mitmachen .kachel { cursor: pointer; }
.vorschau.mitmachen .kachel:active { transform: scale(0.96); }

/* Die Freigaben auf der Seite Freunde der Einrichtung. */
.einrichtung-gruppe { margin-top: 24px; }

/* Was Freunde sehen (seit 1.47.0, Entwurf A): drei Stufen zum Antippen, die gewählte mit Rahmen und Haken. */
.einrichtung-stufen { display: flex; flex-direction: column; gap: 10px; }
.einrichtung-stufe {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; border-radius: var(--r-karte); background: var(--flaeche);
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.2s, transform 0.15s;
}
.einrichtung-stufe:active { transform: scale(0.98); }
.einrichtung-stufe[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--text); }
.einrichtung-stufe-zeichen { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--fuellung); transition: background-color 0.2s, color 0.2s; }
.einrichtung-stufe[aria-checked="true"] .einrichtung-stufe-zeichen { background: var(--primaer); color: var(--auf-primaer); }
.einrichtung-stufe strong { display: block; font-size: var(--gr-text); font-weight: 600; }
.einrichtung-stufe-was { display: block; font-size: var(--gr-klein); color: var(--text-2); margin-top: 2px; }
.einrichtung-einzeln { margin-top: 10px; }
.einrichtung-wo { margin: 18px 4px 0; font-size: var(--gr-klein); line-height: 1.7; color: var(--text-2); }
.einrichtung-weg { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; font-weight: 600; color: var(--text); white-space: nowrap; vertical-align: middle; }
.einrichtung-weg .icon { width: 16px; height: 16px; }

/* Mit E-Mail anmelden (mail-anmeldung.js). */
.text-knopf.gedimmt { opacity: 0.45; }
.mail-anmeldung { display: grid; gap: 12px; }
.mail-anmeldung .karte-text { margin: 0; }
.mail-anmeldung .gruppe { margin: 0; }

/* Die Skala erklärt ihre Marken auf Tipp; Hinweise brechen dafür um, statt abgeschnitten zu werden. */
.skala-knopf { cursor: pointer; }
/* Seit 1.58.0 ein echter Knopf (To-do 8): so breit wie der Balken, Tippfläche 46 pt hoch. */
button.skala { display: block; width: 100%; padding: 0; text-align: left; }
.skala-knopf::before { content: ""; position: absolute; inset: -14px 0 -24px; }
.hinweis-text { white-space: pre-line; padding: 8px 0; line-height: 1.3; }

/* Glasblase beim ersten Mal (hinweise.js), mit Spitze zum Ziel. */
.tipp-blase {
  position: fixed;
  z-index: 45;
  max-width: min(300px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: var(--r-kachel);
  color: var(--text);
  font-size: var(--gr-neben);
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  opacity: 0;
  transform: translateY(4px) scale(0.94);
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.25, 1.35, 0.5, 1);
}
.tipp-blase.an { opacity: 1; transform: none; }
.tipp-blase::after {
  content: "";
  position: absolute;
  left: calc(var(--spitze) - 7px);
  width: 14px;
  height: 14px;
  background: inherit;
  -webkit-backdrop-filter: inherit;
  backdrop-filter: inherit;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 0.5px var(--glas-rand);
}
.tipp-blase.oben::after { bottom: -6px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.tipp-blase.unten::after { top: -6px; clip-path: polygon(0 0, 100% 0, 0 100%); }

/* Runde Knöpfe mit Wort beim ersten Mal (hinweise.js, benennen): Pille, die zum Kreis schrumpft. */
.rund.mit-wort { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 36px; padding: 0 9px; border-radius: var(--r-kachel); }
.rund-wort {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: var(--gr-klein);
  font-weight: 600;
  transition: max-width 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s, margin 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}
.rund.benannt .rund-wort { max-width: 120px; opacity: 1; margin-left: 6px; }
.rund.wort-neu .rund-wort { animation: wort-auf 0.5s cubic-bezier(0.32, 0.72, 0, 1) both; }
@keyframes wort-auf { from { max-width: 0; opacity: 0; margin-left: 0; } }

/* Gruppe gründen, einmal angeboten (views/freunde.js). */
.angebot-karte { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 6px; margin-top: 18px; }
.angebot-inhalt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; text-align: left; border-radius: var(--r-kachel); transition: opacity 0.15s; }
.angebot-inhalt:active { opacity: 0.6; }
.angebot-symbol { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primaer); color: var(--auf-primaer); }

/* Freund in Gefahr (freunde-blaetter.js): derselbe Kasten wie bei „Wirkung“. */
.freund-gefahr { margin-bottom: 14px; }
.freund-gefahr .knopf-reihe { margin-top: 10px; }
.freund-gefahr .pille.notruf { margin-top: 0; }

/* Unten in den Einstellungen: Hilfe und Datenschutz nebeneinander. */
.fussnote-zeile { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.fussnote-knopf { font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  /* Ohne Bewegung: das Bild mit „Zum Home-Bildschirm“, alle Schritte ruhig. */
  .film-bild, .film-ziel::after, .film-schritt, .film-schritt .schritt-nr, .film-pfeil, .rund.wort-neu .rund-wort { animation: none; }
  .film-bild.film-4 { opacity: 1; }
  .tipp-blase, .rund-wort { transition: none; }
}

/* ---------- Foto erkennen (1.37.0) ---------- */

/*
 * Die Bühne oben im Foto-Blatt: erst das eigene Foto, dann das Foto aus dem
 * Katalog (js/produktbilder.js). Gezeichnet wird seit 1.37.2 nichts mehr.
 * Darunter, bis ein Bild steht, ein Lichtkegel von oben; der Boden dunkelt nach
 * unten ab.
 */
:root { --shot-grund: #d6d6dc; --shot-licht: #ffffff; --shot-boden: rgba(0, 0, 0, 0.1); }
@media (prefers-color-scheme: dark) {
  :root { --shot-grund: #060606; --shot-licht: #34343a; --shot-boden: rgba(0, 0, 0, 0.6); }
}

.shot-buehne {
  position: relative;
  overflow: hidden;
  aspect-ratio: 40 / 26;
  border-radius: var(--r-karte);
  background:
    linear-gradient(to bottom, transparent 82%, var(--shot-boden)),
    radial-gradient(85% 80% at 50% 14%, var(--shot-licht), var(--shot-grund) 74%);
  isolation: isolate;
}

/* Während der Erkennung: das eigene Foto, abgedunkelt, mit einem Lichtband, das das Etikett abtastet. */
.shot-foto {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.62) saturate(0.85); transform: scale(1.04);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.shot-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 34%;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.22) 70%, rgba(255, 255, 255, 0.75) 98%, transparent);
  mix-blend-mode: screen;
  animation: shot-scan 1.7s ease-in-out infinite alternate;
}
@keyframes shot-scan { from { transform: translateY(-40%); } to { transform: translateY(230%); } }
.shot-status {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #fff; font-size: var(--gr-neben); font-weight: 600; text-align: center; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.shot-status .pille { text-shadow: none; }
.shot-buehne.fertig .shot-foto { opacity: 0; filter: blur(16px) brightness(0.5); transform: scale(1.18); }
/* Erkannt, aber ohne Foto im Katalog: das eigene bleibt, hell und ruhig (seit 1.37.2). */
.shot-buehne.eigen .shot-foto { filter: none; transform: none; }
.shot-buehne.fertig .shot-scan, .shot-buehne.eigen .shot-scan, .shot-buehne.sorte .shot-scan, .shot-buehne.fehler .shot-scan { opacity: 0; animation: none; transition: opacity 0.3s; }
/* Nur als Sorte im Katalog (seit 1.37.2): was erkannt wurde, darunter kleiner der Hinweis; rechts unten bleibt die Kamera frei. */
.shot-buehne.sorte .shot-status { left: 56px; right: 56px; gap: 2px; }
.shot-unter { font-size: var(--gr-klein); font-weight: 500; opacity: 0.85; }

.shot-beta {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  padding: 3px 9px; border-radius: 999px;
  font-size: var(--gr-mini); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2);
}
.shot-buehne:not(.fertig) .shot-beta { color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.28); }
.shot-neu { position: absolute; right: 12px; bottom: 12px; z-index: 1; color: var(--text-2); }
.shot-buehne:not(.fertig):not(.eigen):not(.sorte) .shot-neu { display: none; }
/* Auf dem eigenen Foto hell wie die Beta-Marke, sonst verschwindet die Kamera im Dunkeln (seit 1.37.2). */
.shot-buehne:not(.fertig) .shot-neu { color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.28); }
.blatt-unterkopf .shot-buehne { margin: 2px 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .shot-scan { animation: none; }
  .shot-foto { transition: opacity 0.3s; }
}

/* Kamera und Plus nebeneinander neben „Buchen“ (seit 1.37.0), Abstand wie oben rechts. */
.abschnitt-knoepfe { display: flex; gap: 10px; }

/* ---------- Fotos der Katalog-Getränke (1.37.0, js/produktbilder.js) ---------- */

/*
 * Bewusste Ausnahme von Regel 1: Farbe trägt nur das Getränk.
 * Je Stelle abschaltbar (PRODUKTBILDER_ZEIGEN in js/config.js).
 */
.produktbild { display: block; overflow: hidden; }
.produktbild img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }

/* Auf der Bühne im Foto-Blatt: füllt sie ganz und blendet weich ein. */
.shot-buehne .shot-bild { position: absolute; inset: 0; animation: bild-auf 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.shot-buehne:not(.fertig) .shot-bild { display: none; }
@keyframes bild-auf { from { opacity: 0; transform: scale(1.05); } }

/* Im Buchungsblatt oben, im Format der Aufnahme. */
.buchen-bild { aspect-ratio: 3 / 2; margin: 2px 0 12px; border-radius: var(--r-karte); background: var(--fuellung); }

/* Im Katalog links ein kleines Quadrat. */
.katalog-bild { flex: none; width: 44px; height: 44px; margin: -6px 12px -6px -4px; border-radius: var(--r-klein); background: var(--fuellung); }

/*
 * Kachel und Heute-Karte: das Foto als Streifen rechts über die ganze Höhe,
 * nach links weich ausgeblendet. Die Höhe bleibt gleich (Home ohne Scrollen),
 * der Text rückt nur so weit ein, dass er nicht über der Flasche steht.
 */
.kachel-bild, .karte-bild {
  position: absolute; top: 0; right: 0; bottom: 0; width: 66px;
  border-radius: 0 var(--r-kachel) var(--r-kachel) 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%);
  mask-image: linear-gradient(to right, transparent, #000 45%);
  pointer-events: none;
}
.kachel.mit-bild { padding-right: 60px; }
.kacheln-reihe .kachel.mit-bild { max-width: 200px; }
/* Die Zahl der heute gebuchten bleibt oben rechts über dem Rand (position: absolute). */
.kachel.mit-bild > span:not(.kachel-anzahl) { position: relative; }
.kachel.mit-bild .kachel-anzahl { z-index: 1; }
.getraenk-karte.mit-bild { max-width: 220px; }
.getraenk-karte.mit-bild .getraenk-karte-haupt { position: relative; padding-right: 60px; }
.getraenk-karte.mit-bild .getraenk-karte-name { padding-right: 0; }
/* Das Minus liegt über dem Foto, oft über weißem Schaum: deshalb auf Glas. */
.getraenk-karte.mit-bild .minus { background: var(--glas); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ---------- Neuigkeiten (1.38.0, js/neuigkeiten-blatt.js) ---------- */

/* Je Punkt ein Symbol im Kreis, Titel und ein Satz; der Satz darf umbrechen (Karte und Blatt in den Einstellungen). */
.neu-punkt { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.neu-punkt .zeile-name { white-space: normal; }
.neu-punkt .zeile-meta { font-size: var(--gr-klein); line-height: 1.35; margin-top: 2px; }
.neu-symbol {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fuellung);
  color: var(--text);
}

/*
 * Nach dem Update als Karte mittig über der App (Konrads Wahl). Zentriert über
 * inset und margin, nicht über transform; das gehört dem Herunterziehen.
 */
.blatt.blatt-mitte {
  top: 0;
  bottom: 0;
  left: 20px;
  right: 20px;
  max-width: 400px;
  height: max-content;
  margin: auto;
  border-radius: 30px;
  opacity: 0;
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.25, 1.15), opacity 0.25s;
}
.blatt.blatt-mitte.an { opacity: 1; transform: none; }
.blatt-mitte .blatt-griff { display: none; }
/*
 * Seit 1.53.0 (Konrads Wahl, vierte Fassung „Tropfen“; ui.js blattForm, formSteuerung): Jedes Blatt steht
 * mittig. Das Glas trägt hier nicht das Blatt selbst, sondern seine Hülle (.blatt-glas) dahinter: Sie quillt rund aus
 * dem Knopf (über ihr ein Abbild des Knopfs, [data-zwilling]), der Inhalt kommt erst nach der Ankunft. Der große
 * Schatten ist eine eigene Ebene (.blatt-schatten), die nur ein- und ausblendet. Weggeschoben folgt das ganze Blatt
 * dem Finger und gleitet von hier aus zurück.
 */
.blatt.blatt-zentral {
  --oben: max(12px, env(safe-area-inset-top, 0px));
  --unten: max(12px, env(safe-area-inset-bottom, 0px));
  top: var(--oben);
  bottom: calc(var(--unten) + var(--tastatur, 0px));
  max-height: calc(var(--vvh, 100dvh) - var(--oben) - var(--unten));
  left: 10px;
  right: 10px;
  height: max-content;
  margin: auto;
  border-radius: 32px;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  transform: none;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), bottom 0.25s;
}
.blatt-zentral > .blatt-glas {
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: var(--glas-blatt);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--glas-rand), inset 0 1px 0 var(--glas-glanz);
  transform-origin: 50% 50%;
  pointer-events: none;
}
.blatt-zentral > .blatt-schatten {
  position: absolute;
  inset: 0;
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
/* Der Inhalt liegt über Schatten und Hülle. */
.blatt-zentral > :not(.blatt-glas, .blatt-schatten) { position: relative; }
[data-zwilling] { box-sizing: border-box; }
.blatt.blatt-zentral.an { transform: none; }
.blatt.blatt-zentral.an.darunter { transform: scale(0.94); transform-origin: 50% 50%; }
.blatt.blatt-zentral.blatt-voll { height: auto; }
.blatt-zentral .blatt-griff { display: none; }
.blatt-zentral .blatt-fuss { padding-bottom: 14px; }

/* Ohne Kopf (seit 1.38.1): kein Schließen-Knopf, „Weiter“ schließt; der Titel steht groß im Inhalt. */
.neu-karte .blatt-kopf { display: none; }
.neu-karte .blatt-inhalt { padding-top: 30px; }
.neu-kopf { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0 0 8px; text-align: center; }
.neu-kopf h3 { font-size: var(--gr-titel); font-weight: 700; letter-spacing: -0.01em; }
.neu-stern {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primaer);
  color: var(--auf-primaer);
}
.neu-liste .neu-punkt { min-height: 0; padding-left: 0; padding-right: 0; background: none; }
.neu-liste .neu-punkt::before { display: none; }
/* Die Trennlinie beginnt beim Text, nicht beim Symbol. */
.neu-punkte .neu-punkt + .neu-punkt::before { left: 66px; }

/* ---------- Getränkesuche hinter dem Plus (1.39.0, js/getraenk-blatt.js) ---------- */

.getraenk-abschnitt { font-size: var(--gr-klein); font-weight: 600; color: var(--text-2); margin: 14px 4px 6px; }
.getraenk-blatt .blatt-inhalt > .getraenk-abschnitt:first-child { margin-top: 4px; }
.getraenk-zeile + .getraenk-zeile { border-top: 0.5px solid var(--linie); }
.getraenk-zeile-kopf { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.getraenk-zeile-haupt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0 8px 12px; text-align: left; }
.getraenk-zeile-haupt:active { opacity: 0.6; }
/* Lange Namen in zwei Zeilen statt abgeschnitten (seit 1.54.0, UX-Prüfung): Stern und Plus brauchen den Platz. */
.getraenk-zeile .zeile-name, .katalog-zeile .zeile-name {
  white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; line-height: 1.25;
}
.getraenk-zeile-bild { flex: none; width: 44px; height: 44px; border-radius: var(--r-klein); overflow: hidden; background: var(--fuellung); display: grid; place-items: center; color: var(--text-3); }
.getraenk-zeile-bild .produktbild, .getraenk-zeile-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.getraenk-zeile-plus { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primaer); color: var(--auf-primaer); }
.getraenk-zeile-plus:active { transform: scale(0.92); }
/* Stern: in die Favoriten (seit 1.39.0); gefüllt, wenn es schon einer ist. */
.getraenk-zeile-stern { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--fuellung); color: var(--text-2); }
.getraenk-zeile-stern[aria-pressed="true"] { color: var(--text); }
.getraenk-zeile-stern[aria-pressed="true"] svg { fill: currentColor; }
.getraenk-zeile-stern:active { transform: scale(0.92); }
/* Favoriten (seit 1.40.0): Griff statt Plus; eben herausgenommene stehen blass, bis man die Ansicht wechselt. */
.getraenk-blatt .vorlage-zeile { background: var(--blatt-gruppe); }
.getraenk-zeile .griff, .griff-platz { flex: none; align-self: stretch; width: 44px; margin: 0 -12px 0 -4px; }
.vorlage-zeile.entfernt .getraenk-zeile-haupt { opacity: 0.4; }
.getraenk-zeile.gehoben, .getraenk-zeile.gehoben + .getraenk-zeile { border-top-color: transparent; }
.getraenk-zeile + .zeile { border-top: 0.5px solid var(--linie); }

/* ---------- Deckel in Gruppen (seit 1.48.0, js/deckel-blatt.js; Entwurf A in Schwarz-weiß) ---------- */

.deckel {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.1)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.deckel .d-flaeche { fill: var(--flaeche); stroke: var(--linie); stroke-width: 1; }
.deckel .d-praegung { fill: none; stroke: var(--linie); stroke-width: 1; }
.deckel .d-ring { fill: none; stroke: var(--text-3); }
.deckel .d-druck { fill: var(--text-3); font-family: var(--schrift); font-weight: 700; letter-spacing: 0.18em; }
.deckel .d-marke { fill: var(--text); opacity: 0.045; letter-spacing: -0.03em; }
.deckel .d-hand { fill: var(--text); font-family: var(--schrift-zahl); font-weight: 700; }
.deckel .d-betrag { fill: var(--text-2); font-variant-numeric: tabular-nums; }
.deckel .d-strich, .deckel .d-schlinge { fill: none; stroke: var(--text); stroke-linecap: round; stroke-linejoin: round; }
.deckel .d-strich { stroke-width: 2.4; }
.deckel .d-schlinge { stroke-width: 1.5; opacity: 0.72; }
.deckel .d-strich.neu, .deckel .d-schlinge.neu { stroke-dasharray: 1; stroke-dashoffset: 1; animation: d-zeichnen 0.34s ease-out forwards; }
.deckel .neu.spaet { animation-delay: 0.2s; }
@keyframes d-zeichnen { to { stroke-dashoffset: 0; } }
.deckel .d-zeile { cursor: pointer; outline: none; }
.deckel .d-treffer { fill: var(--text); fill-opacity: 0; transition: fill-opacity 0.15s; }
.deckel .d-zeile:active .d-treffer, .deckel .d-zeile:focus-visible .d-treffer { fill-opacity: 0.06; }
.deckel .d-stempel { opacity: 0.88; }
.deckel .d-stempel rect { fill: none; stroke: var(--text); }
.deckel .d-stempel text { fill: var(--text); font-family: var(--schrift); font-weight: 900; }
.deckel .d-stempel.neu { transform-box: fill-box; transform-origin: center; animation: d-stempeln 0.42s cubic-bezier(0.2, 0.8, 0.25, 1.15) both; }
@keyframes d-stempeln { from { opacity: 0; transform: scale(1.8); } to { opacity: 0.88; transform: scale(1); } }
@media (prefers-color-scheme: dark) {
  .deckel { filter: drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.25)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)); }
  .deckel .d-flaeche { fill: #1f1f1f; }
}
@media (prefers-reduced-motion: reduce) {
  .deckel .d-strich.neu, .deckel .d-schlinge.neu, .deckel .d-stempel.neu { animation: none; stroke-dashoffset: 0; }
}

/* Die Zeile unter „Gerade unterwegs“ */
.deckel-zeile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 12px 8px 8px; border-radius: var(--r-kachel); background: var(--fuellung); transition: transform 0.15s; }
.deckel-zeile:active { transform: scale(0.98); }
.deckel-zeile .deckel-mini { width: 46px; height: 46px; flex: none; filter: none; }
.deckel-zeile-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.deckel-zeile-text strong { font-size: var(--gr-neben); font-weight: 600; }
.deckel-zeile > .icon { color: var(--text-3); flex: none; }

/* Das Blatt */
.deckel-tisch { padding: 4px 2px 0; }
.deckel-drauf { margin: 4px 0 16px; }
.deckel-aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.deckel-aktionen > .pille.primaer { grid-column: 1 / -1; }
.deckel-aktionen .pille { height: 48px; gap: 8px; }
.deckel-gast { margin-top: 10px; }
.text-knopf.gefahr { color: var(--gefahr); }
.deckel-kopf { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 4px 12px; }
.deckel-kopf strong { font-family: var(--schrift-zahl); font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.deckel-kopf span { font-size: var(--gr-neben); color: var(--text-2); }
.deckel-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 6px; padding: 0 16px; }
.deckel-chips::-webkit-scrollbar { display: none; }
.deckel-chips .chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px 0 4px; height: 38px; }
.deckel-chips .chip .avatar { width: 30px; height: 30px; font-size: 13px; }
.deckel-chips .chip[aria-pressed="true"] .avatar { background: var(--auf-primaer); color: var(--primaer); }
.deckel-haken { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--linie); transition: background-color 0.15s; }
[aria-checked="true"] > .deckel-haken { background: var(--primaer); box-shadow: none; }
.deckel-wahl .deckel-haken .icon, .deckel-abhaken .deckel-haken .icon { color: var(--auf-primaer); }
.deckel-wahl { cursor: pointer; }
.deckel-wahl[aria-checked="false"] .zeile-text, .deckel-wahl[aria-checked="false"] .avatar { opacity: 0.45; }
.deckel-sorte { flex: none; height: 32px; max-width: 46%; padding: 0 12px; border-radius: 999px; background: var(--fuellung); font-size: var(--gr-neben); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deckel-abhaken { flex: none; padding: 6px; margin-right: -6px; }
.deckel-erledigt .zeile-name, .deckel-erledigt .zeile-wert { text-decoration: line-through; opacity: 0.5; }
.deckel-summe { margin-top: 10px; }
.deckel-laut { font-size: var(--gr-klein); color: var(--text-2); margin: 6px 4px 0; }
/* Mehrere Zahler (seit 1.50.0, Konrads Wahl: Entwurf A): die Beträge untereinander unter den Chips. */
.deckel-betraege .aufklapper + .aufklapper .aufklapper-kopf::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--linie); transform: scaleY(0.5); transform-origin: top;
}
.deckel-betraege { margin-top: 2px; }
/* Bezahlen per Link (seit 1.51.0): Betrag groß, PayPal als Pille, Überweisung zum Kopieren, GiroCode mittig. */
.deckel-betrag { display: grid; justify-items: center; gap: 2px; margin: 4px 0 18px; text-align: center; }
.deckel-betrag strong { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.deckel-betrag span { font-size: var(--gr-neben); color: var(--text-2); }
a.deckel-paypal { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-bottom: 6px; }
.deckel-kopieren { width: 100%; }
.deckel-kopieren .zeile-text { min-width: 0; }
.deckel-kopieren .zeile-name { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.deckel-kopieren .icon { color: var(--text-3); flex: none; }
.deckel-giro { display: flex; justify-content: center; margin: 6px 0 10px; }
.deckel-giro .qr-bild svg { width: 240px; height: 240px; }
