/* Peak – Designsystem. Vorbild: native iOS-Apps (Fitness, Health, Einstellungen).
   Große Titel, gruppierte Listen statt Karten-Stapel, Haarlinien, Zahlen in der runden Systemschrift,
   eine Akzentfarbe sparsam eingesetzt. Personenfarben nur für Avatare ohne Foto und Kurven.
   Farben nur über die Tokens; Hell und Dunkel gleichwertig. */

:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --flaeche: #ffffff;
  --flaeche2: #f2f2f7;          /* Felder, Segmente, fremde Chat-Blasen */
  --flaeche3: #e5e5ea;          /* Spuren (Ringe, Balken) */
  --text: #0b0b0f;
  --text2: #3c3c43;
  --leise: #8a8a8e;
  --blass: #c7c7cc;
  --linie: rgba(60, 60, 67, .16);
  --akzent: #f05a1f;
  --akzent-text: #d24a12;
  --akzent-zart: rgba(240, 90, 31, .11);
  --auf-akzent: #ffffff;
  --gruen: #20a35a;
  --gruen-zart: rgba(32, 163, 90, .12);
  --rot: #e5383b;
  --gelb: #c7880d;
  --schalter-aus: #e9e9eb;
  --blase-fremd: #e9e9eb;
  --f1: #f05a1f; --f2: #3a6ff2; --f3: #20a35a; --f4: #8b5cf6; --f5: #e0457b; --f6: #0e9aa7; --f7: #d99a0b; --f8: #5f6b7a;
  --schatten: 0 1px 2px rgba(0, 0, 0, .04);
  --schatten-hoch: 0 10px 40px -10px rgba(0, 0, 0, .25);
  --r: 14px;
  --r-s: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --font-titel: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --font-zahl: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --tab-hoehe: 56px;
  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --flaeche: #1c1c1e;
  --flaeche2: #2c2c2e;
  --flaeche3: #2c2c2e;
  --text: #f5f5f7;
  --text2: #d1d1d6;
  --leise: #8d8d93;
  --blass: #48484a;
  --linie: rgba(84, 84, 88, .55);
  --akzent: #ff6a2b;
  --akzent-text: #ff7a40;
  --akzent-zart: rgba(255, 106, 43, .16);
  --auf-akzent: #ffffff;
  --gruen: #30d158;
  --gruen-zart: rgba(48, 209, 88, .15);
  --rot: #ff453a;
  --gelb: #ffd60a;
  --schalter-aus: #39393d;
  --blase-fremd: #26262a;
  --f1: #ff6a2b; --f2: #5e8bff; --f3: #30d158; --f4: #a78bfa; --f5: #ff6b9a; --f6: #3cc8d3; --f7: #ffc233; --f8: #8e9aab;
  --schatten: none;
  --schatten-hoch: 0 10px 40px -10px rgba(0, 0, 0, .8);
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.35 var(--font); letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--akzent-text); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-titel); color: var(--text); }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.022em; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.018em; line-height: 1.2; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
.leise { color: var(--leise); }
.klein { font-size: 15px; }
.mini { font-size: 13px; letter-spacing: -.004em; }
.zahl { font-family: var(--font-zahl); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.k { width: 17px; height: 17px; stroke-width: 1.9; }
svg.i.g { width: 28px; height: 28px; }

/* ---------- Gerüst ---------- */
main { max-width: 620px; margin: 0 auto; padding: calc(var(--oben) + 18px) 16px calc(var(--tab-hoehe) + var(--unten) + 32px); }
.kopf { display: flex; align-items: flex-end; gap: 12px; margin: 6px 4px 22px; min-height: 52px; }
.kopf .ueber { font-size: 13px; font-weight: 600; color: var(--leise); text-transform: none; margin-bottom: 2px; letter-spacing: -.004em; }
.kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.kopf .zurueck { margin-left: -4px; margin-bottom: 4px; }
.kopf .knopf.grau { background: var(--flaeche); box-shadow: var(--schatten); }
.link-knopf { border: 0; background: none; padding: 0; color: var(--akzent-text); font: inherit; cursor: pointer; }
.link-knopf:disabled { color: var(--leise); cursor: default; }
.kopf.mit-zurueck { align-items: center; min-height: 40px; margin-bottom: 14px; }
.kopf.mit-zurueck .ueber { margin: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding-bottom: var(--unten);
  background: color-mix(in srgb, var(--flaeche) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  border-top: .5px solid var(--linie);
}
.tabs-innen { max-width: 620px; margin: 0 auto; height: var(--tab-hoehe); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--leise);
          font-size: 10.5px; font-weight: 500; letter-spacing: 0; position: relative; }
.tabs a svg.i { width: 25px; height: 25px; stroke-width: 1.6; }
.tabs a.an { color: var(--akzent); }
.tabs a.an svg.i { stroke-width: 2; }
.punkt-zahl { position: absolute; top: 4px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
              background: var(--rot); color: #fff; font: 600 11px/18px var(--font); text-align: center; }

/* ---------- Abschnitte und gruppierte Listen ---------- */
.abschnitt { margin-top: 30px; }
.abschnitt-kopf { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 10px; }
.abschnitt-kopf .rechts { margin-left: auto; font-size: 15px; font-weight: 500; }
.fuss { font-size: 13px; color: var(--leise); margin: 8px 16px 0; line-height: 1.4; }

.gruppe { background: var(--flaeche); border-radius: var(--r); overflow: hidden; box-shadow: var(--schatten); }
.gruppe + .gruppe { margin-top: 14px; }
.reihe { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; position: relative; color: var(--text); }
.reihe:not(:first-child)::before {
  content: ""; position: absolute; top: 0; right: 0; left: var(--einzug, 16px); height: .5px; background: var(--linie); }
.reihe.mit-avatar { --einzug: 64px; }
.reihe .haupt { flex: 1; min-width: 0; }
.reihe .titel { font-size: 17px; line-height: 1.25; }
.reihe .titel.fett { font-weight: 600; }
.reihe .unter { font-size: 15px; color: var(--leise); line-height: 1.3; margin-top: 1px; }
.reihe .wert { color: var(--leise); text-align: right; white-space: nowrap; }
.reihe .chevron { color: var(--blass); margin-right: -6px; }
.reihe.oben { align-items: flex-start; }
a.reihe:active, button.reihe:active { background: var(--flaeche2); }
button.reihe { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.reihe.aktion { color: var(--akzent-text); justify-content: flex-start; }
.reihe.gefahr { color: var(--rot); }
.reihe-unter { padding: 0 16px 14px; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 50px; padding: 0 20px; border-radius: 13px;
  border: 0; cursor: pointer; font: 600 17px var(--font); letter-spacing: -.012em; background: var(--akzent); color: var(--auf-akzent);
  transition: transform .1s, opacity .15s; text-decoration: none; white-space: nowrap;
}
.knopf:active { transform: scale(.98); opacity: .85; }
.knopf:disabled { opacity: .4; cursor: default; }
.knopf.breit { width: 100%; }
.knopf.zart { background: var(--akzent-zart); color: var(--akzent-text); }
.knopf.grau { background: var(--flaeche2); color: var(--text); }
.knopf.klein { height: 34px; padding: 0 14px; border-radius: 17px; font-size: 15px; }
.knopf.mini { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 14px; }
.knopf.rund { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.knopf.text { background: none; color: var(--akzent-text); padding: 0 4px; height: auto; font-weight: 500; }
.knopf.gefahr { color: var(--rot); }

.check {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--blass); background: none; display: grid; place-items: center;
  cursor: pointer; flex: none; color: transparent; transition: background .15s, border-color .15s;
}
.check svg { width: 18px; height: 18px; stroke-width: 2.6; }
.check.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.check.akzent.an { background: var(--akzent); border-color: var(--akzent); }

/* ---------- Eingaben ---------- */
input, textarea, select {
  font: 17px var(--font); letter-spacing: -.012em; color: var(--text); background: var(--flaeche2); border: 0; border-radius: var(--r-s);
  padding: 12px 14px; outline: none; width: 100%; -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--leise); }
input:focus, textarea:focus { box-shadow: 0 0 0 2px var(--akzent-zart), 0 0 0 1px var(--akzent) inset; }
textarea { resize: none; line-height: 1.4; }
.reihe input.inline { background: none; padding: 0; text-align: right; border-radius: 0; box-shadow: none; color: var(--leise); flex: 1; min-width: 60px; }
.reihe input.inline:focus { color: var(--text); }
.reihe textarea.inline { background: none; padding: 0; border-radius: 0; box-shadow: none; min-height: 60px; }
input[type="time"] { width: auto; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.fehler { color: var(--rot); font-size: 15px; margin: 10px 4px 0; min-height: 1.2em; }

.segment { display: flex; background: rgba(118, 118, 128, .12); border-radius: 9px; padding: 2px; gap: 2px; }
:root[data-theme="dark"] .segment { background: rgba(118, 118, 128, .24); }
.segment button { flex: 1; border: 0; background: transparent; font: 500 14px var(--font); color: var(--text); padding: 6px 4px; border-radius: 7px;
                  cursor: pointer; white-space: nowrap; letter-spacing: -.008em; }
.segment button.an { background: var(--flaeche); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .segment button.an { background: #636366; }

.schalter { width: 51px; height: 31px; border-radius: 16px; background: var(--schalter-aus); position: relative; flex: none; border: 0; cursor: pointer;
            transition: background .2s; padding: 0; }
.schalter::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
                   box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .2s; }
.schalter.an { background: var(--gruen); }
.schalter.an::after { transform: translateX(20px); }

.stepper { display: inline-flex; background: var(--flaeche2); border-radius: 9px; flex: none; }
.stepper button { width: 46px; height: 32px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.stepper button:active { opacity: .5; }
.stepper button + button { border-left: .5px solid var(--linie); }
.stepper svg { width: 18px; height: 18px; stroke-width: 2; }
.wert-gross { font: 600 20px var(--font-zahl); font-variant-numeric: tabular-nums; letter-spacing: -.01em; min-width: 72px; text-align: right; }
.wert-gross.leer { color: var(--blass); font-weight: 500; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 16px 14px; margin-top: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 0; background: var(--flaeche2); color: var(--text2); font: 500 14px var(--font); padding: 6px 12px; border-radius: 15px; cursor: pointer; }
.chips button.an { background: var(--text); color: var(--flaeche); }
.chips.offen { padding: 0; margin: 0; flex-wrap: wrap; overflow: visible; }

.bewertung { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: rgba(118, 118, 128, .12); border-radius: 9px; padding: 2px; margin: 0 16px 14px; }
.bewertung button { border: 0; background: none; border-radius: 7px; padding: 7px 0 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.bewertung b { font: 600 17px var(--font-zahl); }
.bewertung span { font-size: 11px; color: var(--leise); margin-top: 1px; }
.bewertung button.an { background: var(--flaeche); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .bewertung button.an { background: #636366; }
:root[data-theme="dark"] .bewertung button.an span { color: var(--text2); }

/* ---------- Avatare ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 15px var(--font-titel); flex: none;
          color: #fff; background: var(--pf, var(--f1)); position: relative; letter-spacing: 0; }
.avatar.klein { width: 26px; height: 26px; font-size: 11px; }
.avatar.gross { width: 88px; height: 88px; font-size: 34px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.aus { opacity: .32; }
.avatar .ok { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--gruen); color: #fff;
              display: grid; place-items: center; box-shadow: 0 0 0 2px var(--flaeche); }
.avatar .ok svg { width: 9px; height: 9px; stroke-width: 3.4; }
.avatare { display: flex; }
.avatare { gap: 6px; }
.garmin { display: inline-flex; vertical-align: -2px; color: var(--gruen); }
.garmin svg { width: 15px; height: 15px; stroke-width: 2.2; }

/* ---------- Heute: Übersicht ---------- */
.uebersicht { display: flex; align-items: center; gap: 20px; padding: 20px; }
.ring { position: relative; flex: none; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .spur { stroke: var(--flaeche3); }
.ring .fuellung { stroke: var(--akzent); transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.ring .mitte { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .mitte b { font: 700 30px/1 var(--font-zahl); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ring .mitte span { font-size: 12px; color: var(--leise); margin-top: 3px; font-weight: 500; }
.uebersicht .info { flex: 1; min-width: 0; }
.uebersicht .platz { font: 700 22px/1.15 var(--font-titel); letter-spacing: -.018em; }
.uebersicht .abstand { font-size: 15px; color: var(--leise); margin-top: 3px; }
.uebersicht .knopf { margin-top: 14px; }
.serie { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; color: var(--akzent-text); margin-top: 8px; }
.serie svg { width: 16px; height: 16px; }

.challenge-reihe { padding: 16px; display: flex; gap: 14px; align-items: center; }
.challenge-reihe .ueber { font-size: 13px; font-weight: 600; color: var(--akzent-text); }
.challenge-reihe .titel { font: 600 20px/1.2 var(--font-titel); letter-spacing: -.016em; margin-top: 2px; }
.challenge-reihe .unter { font-size: 15px; color: var(--leise); margin-top: 3px; }
.challenge-reihe .avatare { margin-top: 10px; }

.rang { width: 18px; text-align: center; font: 600 15px var(--font-zahl); color: var(--leise); flex: none; font-variant-numeric: tabular-nums; }
.rang.eins { color: var(--akzent); }
.punkte { text-align: right; flex: none; }
.punkte b { display: block; font: 600 22px/1.05 var(--font-zahl); font-variant-numeric: tabular-nums; letter-spacing: -.015em; color: var(--text); }
.punkte span { font-size: 12px; color: var(--leise); }
.balken { height: 4px; border-radius: 2px; background: var(--flaeche3); overflow: hidden; margin-top: 7px; max-width: 220px; }
.balken i { display: block; height: 100%; border-radius: 2px; background: var(--pf, var(--akzent)); }
.marke { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--leise); }
.marke svg { width: 14px; height: 14px; }

/* ---------- Tag einer Person ---------- */
.profilkopf { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 24px; }
.profilkopf h1 { margin-top: 12px; font-size: 28px; }
.profilkopf .unter { color: var(--leise); font-size: 15px; margin-top: 4px; }
.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 16px 8px; }
.kennzahlen > div + div { border-left: .5px solid var(--linie); }
.kennzahlen b { display: block; font: 700 26px/1.1 var(--font-zahl); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kennzahlen span { font-size: 13px; color: var(--leise); }
.teil .balken { max-width: none; margin-top: 8px; }
.teil .wert { font-family: var(--font-zahl); font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.teil .wert small { color: var(--leise); font-weight: 500; }
.notiz-text { padding: 14px 16px; font-size: 17px; line-height: 1.45; white-space: pre-wrap; color: var(--text2); }

.kommentar { display: flex; gap: 10px; padding: 10px 16px; align-items: flex-start; }
.kommentar .haupt { flex: 1; min-width: 0; }
.kommentar .kopfzeile { font-size: 13px; color: var(--leise); }
.kommentar .kopfzeile b { color: var(--text); font-weight: 600; font-size: 15px; margin-right: 4px; }
.kommentar .text { font-size: 16px; line-height: 1.38; margin-top: 1px; overflow-wrap: anywhere; }
.kommentar-feld { display: flex; gap: 8px; padding: 10px 12px 12px 16px; align-items: center; }
.kommentar-feld input { border-radius: 18px; padding: 8px 14px; font-size: 16px; }

/* ---------- Eintragen ---------- */
.formular { padding-bottom: 96px; }
.garmin-zeile { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gruen); padding: 0 16px 12px; margin-top: -4px; }
.garmin-zeile button { margin-left: auto; border: 0; background: none; color: var(--akzent-text); font-size: 13px; cursor: pointer; padding: 0; }
.leiste-unten { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-hoehe) + var(--unten)); z-index: 25; padding: 12px 16px;
                background: linear-gradient(to bottom, transparent, var(--bg) 28%); }
.leiste-unten .innen { max-width: 588px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.vorschau { height: 50px; padding: 0 16px; border-radius: 13px; background: var(--flaeche); box-shadow: var(--schatten-hoch);
            display: flex; align-items: baseline; gap: 5px; white-space: nowrap; align-self: stretch; align-items: center; }
.vorschau b { font: 700 22px var(--font-zahl); font-variant-numeric: tabular-nums; }
.vorschau span { font-size: 13px; color: var(--leise); }
.leiste-unten .knopf { flex: 1; box-shadow: var(--schatten-hoch); }
.gesperrt { opacity: .5; pointer-events: none; }

/* ---------- Rangliste ---------- */
.kurve { width: 64px; height: 24px; flex: none; overflow: visible; }
.vergleich { width: 100%; border-collapse: collapse; font-size: 15px; }
.vergleich th, .vergleich td { padding: 11px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.vergleich td { font-family: var(--font-zahl); color: var(--leise); }
.vergleich td.bester { color: var(--text); font-weight: 650; }
.vergleich th:first-child, .vergleich td:first-child { text-align: left; padding-left: 16px; font-family: var(--font); color: var(--text); }
.vergleich th:last-child, .vergleich td:last-child { padding-right: 16px; }
.vergleich tr + tr td { border-top: .5px solid var(--linie); }
.vergleich thead th { padding-top: 14px; padding-bottom: 8px; }
.vergleich thead .avatar { margin-left: auto; }
.serien { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.serien span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; padding: 4px 9px; border-radius: 12px;
               background: var(--flaeche2); color: var(--text2); }
.serien span b { font-family: var(--font-zahl); color: var(--akzent-text); }
details.aufklapp > summary { list-style: none; cursor: pointer; }
details.aufklapp > summary::-webkit-details-marker { display: none; }
details.aufklapp[open] .chevron { transform: rotate(90deg); }
.erklaerung { padding: 0 16px 16px; color: var(--text2); font-size: 15px; line-height: 1.5; }
.erklaerung ul { margin: 8px 0 0; padding-left: 18px; }

/* ---------- Herausforderungen ---------- */
.hf-reihe { padding: 14px 16px; display: block; color: var(--text); position: relative; }
.hf-reihe + .hf-reihe::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--linie); }
.hf-reihe .oben { display: flex; gap: 12px; align-items: flex-start; }
.hf-reihe .titel { font: 600 17px/1.25 var(--font); }
.hf-reihe .meta { font-size: 13px; color: var(--leise); margin-top: 3px; }
.hf-reihe .unten { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hf-reihe .unten .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hf-reihe.vorbei { opacity: .55; }
.fortschritt { font-size: 13px; color: var(--leise); }
.status-liste .reihe .wert { font-size: 15px; }
.status-liste .ok { color: var(--gruen); }
.beweise { display: flex; gap: 8px; padding: 0 16px 16px; overflow-x: auto; }
.beweise button { border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.beweise img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; display: block; }
.punkte-hinweis { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }

/* ---------- Chat (wie Nachrichten) ---------- */
.chat { display: flex; flex-direction: column; padding-bottom: 76px; }
.chat .tag-trenner { text-align: center; font-size: 12px; color: var(--leise); margin: 18px 0 8px; font-weight: 500; }
.nachricht { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; max-width: 100%; }
.nachricht.ich { flex-direction: row-reverse; }
.nachricht.neu-gruppe { margin-top: 10px; }
.nachricht .platzhalter { width: 28px; flex: none; }
.nachricht .avatar { width: 28px; height: 28px; font-size: 12px; }
.nachricht .spalte { display: flex; flex-direction: column; min-width: 0; max-width: 76%; }
.nachricht.ich .spalte { align-items: flex-end; }
.nachricht .name { font-size: 12px; color: var(--leise); margin: 0 12px 3px; }
.blase { padding: 8px 13px; border-radius: 19px; background: var(--blase-fremd); font-size: 17px; line-height: 1.3; overflow-wrap: anywhere;
         white-space: pre-wrap; }
.nachricht.ich .blase { background: var(--akzent); color: var(--auf-akzent); }
.blase.bild { padding: 3px; background: none; }
.nachricht.ich .blase.bild { background: none; }
.blase.bild img { display: block; max-width: 100%; max-height: 340px; border-radius: 16px; min-width: 120px; min-height: 80px; object-fit: cover; background: var(--flaeche3); }
.blase.bild .unterschrift { background: var(--blase-fremd); border-radius: 17px; padding: 7px 12px; margin-top: 3px; white-space: pre-wrap; display: inline-block; }
.nachricht.ich .blase.bild .unterschrift { background: var(--akzent); color: var(--auf-akzent); }
.blase.bild button { border: 0; padding: 0; background: none; cursor: zoom-in; display: block; }
.sticker-msg { width: 132px; height: 132px; }
.sticker-msg img, .sticker-msg svg { width: 132px; height: 132px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .16)); }
.chat .zeit { font-size: 11px; color: var(--leise); margin: 3px 12px 0; }
.gesehen { align-self: flex-end; font-size: 11px; color: var(--leise); margin: 3px 4px 0; }
.ereignis { align-self: center; text-align: center; font-size: 13px; color: var(--leise); margin: 14px 24px 4px; line-height: 1.4; max-width: 420px; }
.ereignis b { color: var(--text2); font-weight: 600; }
.ereignis a { font-weight: 500; }
.eingabe { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-hoehe) + var(--unten)); z-index: 25; padding: 8px 12px;
           background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
           border-top: .5px solid var(--linie); }
.eingabe .innen { max-width: 596px; margin: 0 auto; display: flex; gap: 6px; align-items: flex-end; }
.eingabe .feld { flex: 1; display: flex; align-items: flex-end; background: var(--flaeche); border: .5px solid var(--linie); border-radius: 20px; padding: 0 4px 0 14px; }
.eingabe textarea { background: none; padding: 8px 0; border-radius: 0; box-shadow: none !important; max-height: 120px; font-size: 17px; }
.eingabe .ikon { width: 36px; height: 36px; border: 0; background: none; color: var(--leise); display: grid; place-items: center; cursor: pointer; flex: none; border-radius: 50%; }
.eingabe .senden { width: 30px; height: 30px; border-radius: 50%; background: var(--akzent); color: #fff; border: 0; display: grid; place-items: center;
                   cursor: pointer; flex: none; margin: 4px 0; }
.eingabe .senden svg { width: 17px; height: 17px; stroke-width: 2.4; }
.sticker-feld { max-width: 596px; margin: 0 auto 8px; max-height: 40vh; overflow-y: auto; background: var(--flaeche); border-radius: var(--r);
                padding: 12px; box-shadow: var(--schatten-hoch); }
.sticker-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; }
.sticker-raster button { border: 0; background: none; padding: 3px; border-radius: 12px; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; }
.sticker-raster button:active { background: var(--flaeche2); }
.sticker-raster img, .sticker-raster svg { width: 64px; height: 64px; object-fit: contain; }
.sticker-raster .sticker-neu { background: var(--flaeche2); color: var(--leise); font-size: 11px; font-weight: 500; line-height: 1.2; gap: 2px; }

/* ---------- Profil ---------- */
.foto-knopf { position: relative; border: 0; background: none; padding: 0; cursor: pointer; }
.foto-knopf .stift { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--flaeche);
                     color: var(--text); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.foto-knopf .stift svg { width: 15px; height: 15px; }
.farben { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.farben button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--pf); cursor: pointer; padding: 0; }
.farben button.an { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pf); }
.link-feld { display: flex; gap: 8px; padding: 0 16px 14px; }
.link-feld input { font-size: 14px; padding: 9px 12px; color: var(--leise); }

/* ---------- Willkommen, Anmelden ---------- */
.mitte-seite { min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); display: flex; flex-direction: column; justify-content: center; }
.logo-gross { width: 64px; height: 64px; margin-bottom: 22px; }
.logo-gross svg { width: 64px; height: 64px; display: block; }
.willkommen h1 { margin-bottom: 10px; }
.willkommen .text { color: var(--text2); font-size: 17px; line-height: 1.45; }
.punkte-liste { margin: 26px 0 32px; padding: 0; list-style: none; display: grid; gap: 18px; }
.punkte-liste li { display: flex; gap: 14px; align-items: flex-start; }
.punkte-liste li svg.i { color: var(--akzent); width: 26px; height: 26px; margin-top: 1px; }
.punkte-liste b { display: block; font-weight: 600; }
.punkte-liste span { color: var(--leise); font-size: 15px; }
.schrittpunkte { display: flex; gap: 6px; margin-bottom: 26px; }
.schrittpunkte i { height: 4px; flex: 1; border-radius: 2px; background: var(--flaeche3); }
.schrittpunkte i.an { background: var(--akzent); }
.wahl { display: grid; gap: 10px; margin-top: 28px; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center;
           padding: 8px 8px calc(var(--unten) + 8px); animation: einblenden .18s ease-out; }
.overlay > .blatt { width: 100%; max-width: 420px; background: var(--flaeche); border-radius: 22px; padding: 22px 18px 18px; box-shadow: var(--schatten-hoch);
                    animation: hoch .24s cubic-bezier(.2, .8, .2, 1); }
.overlay > .blatt h2 { margin-bottom: 4px; }
.overlay.mittig { align-items: center; }
@keyframes einblenden { from { opacity: 0; } }
@keyframes hoch { from { transform: translateY(30px); opacity: 0; } }
.zuschnitt-feld { margin: 16px auto 0; border-radius: 14px; overflow: hidden; position: relative; background: var(--flaeche3); touch-action: none; }
.zuschnitt-feld canvas { display: block; cursor: grab; touch-action: none; }
.zuschnitt-feld.kreis::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .5); }
.zoom { width: 100%; margin-top: 16px; padding: 0; height: 28px; background: transparent !important; box-shadow: none !important; -webkit-appearance: auto; appearance: auto; accent-color: var(--akzent); }
.overlay.vollbild { padding: 0; background: #000; align-items: center; }
.overlay.vollbild img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; }
.overlay.vollbild .schliessen { position: fixed; top: calc(var(--oben) + 12px); right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0;
                                background: rgba(255, 255, 255, .18); color: #fff; display: grid; place-items: center; cursor: pointer; }

.toast { position: fixed; left: 50%; top: calc(var(--oben) + 12px); transform: translate(-50%, -16px); z-index: 70; pointer-events: none;
         background: var(--flaeche); color: var(--text); padding: 11px 18px; border-radius: 22px; font-size: 15px; font-weight: 500;
         box-shadow: var(--schatten-hoch), 0 0 0 .5px var(--linie); opacity: 0; transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1);
         max-width: calc(100% - 32px); text-align: center; }
.toast.an { opacity: 1; transform: translate(-50%, 0); }
.leer { text-align: center; color: var(--leise); padding: 40px 16px; font-size: 15px; }
.laden { height: 60vh; }

@media (min-width: 700px) {
  main { padding-top: calc(var(--oben) + 36px); }
}
