:root {
  --grund: #0E0F13;
  --flaeche: #16181E;
  --flaeche-2: #1A1C23;
  --flaeche-3: #23262F;
  --rand: #2A2D36;
  --text: #EDEEF2;
  --leise: #9AA0AE;
  --akzent: #7EE2B8;
  --orange: #FFB86B;
  --rot: #FF8A8A;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--grund); color: var(--text); height: 100%; }
body { font: 16px/1.45 Manrope, system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .voll { fill: currentColor; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#app { max-width: 480px; margin: 0 auto; height: 100%; }
.ansicht {
  min-height: 100%; display: flex; flex-direction: column; gap: 20px;
  padding: max(24px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}
.ansicht.mit-leiste { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.ansicht.schwarz { background: #000; }
.mitte { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.mitte.links { align-items: stretch; text-align: left; gap: 16px; }
.spalte { display: flex; flex-direction: column; gap: 12px; }
.spalte.zentriert { align-items: center; text-align: center; gap: 8px; }
.breit { width: 100%; margin-top: 12px; }
.zeile { display: flex; gap: 12px; align-items: center; }
.zeile.zwischen { justify-content: space-between; }
.wachsen { flex: 1; min-width: 0; }
.links { text-align: left; align-items: flex-start; }

.datum { font-size: 15px; font-weight: 600; color: var(--leise); }
.etikett { font-size: 13px; font-weight: 700; letter-spacing: .14em; }
.akzent { color: var(--akzent); }
.orange { color: var(--orange); }
.leise { color: var(--leise); }
.fett { font-weight: 700; }
.fehler { color: var(--rot); min-height: 1.4em; font-size: 15px; }
.riesig { font-size: 46px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.gross { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.mittel { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.hinweis { text-align: center; font-size: 15px; max-width: 280px; margin: 0 auto; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--flaeche-2); font-size: 15px; font-weight: 600; }
.chip svg { width: 16px; height: 16px; }
a.chip { text-decoration: none; }
a.chip[href] { color: var(--text); }
.chip.klein { height: 30px; font-size: 13px; color: #C9CCD6; margin-top: 6px; }
.chip.klein svg { width: 14px; height: 14px; }

.knopf { height: 60px; border-radius: 30px; padding: 0 22px; font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s, opacity .2s; }
.knopf:active { transform: scale(.97); }
.knopf:disabled { opacity: .5; }
.knopf.gross-knopf { height: 68px; border-radius: 34px; font-size: 19px; font-weight: 800; }
.knopf.akzent { background: var(--akzent); color: var(--grund); }
.knopf.hell { background: var(--text); color: var(--grund); font-weight: 800; }
.knopf.dunkel { background: var(--flaeche-2); }
.knopf.rand { border: 1px solid var(--rand); color: var(--leise); font-weight: 600; }
.gruende { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gruende .knopf { height: 50px; padding: 0 10px; font-size: 15px; }
.gruende .etikett { grid-column: 1 / -1; margin: 4px 0 2px; }
.gruende [data-grund="weg"], .gruende .klein { grid-column: 1 / -1; }
.klein { font-size: 13px; text-align: center; }
.chip.frist { color: var(--orange); }
.knopf.leise-knopf { height: 48px; color: var(--leise); font-size: 15px; font-weight: 600; }
.rund { width: 44px; height: 44px; border-radius: 22px; background: var(--flaeche-2); display: flex; align-items: center; justify-content: center; flex: none; }
.rund.hell { width: 52px; height: 52px; border-radius: 26px; background: var(--text); color: var(--grund); }
.feld { height: 52px; padding: 0 18px; border-radius: 26px; border: 1px solid #262932; background: var(--flaeche); color: var(--text); font: inherit; font-size: 16px; outline: none; }
.feld:focus { border-color: var(--akzent); }
.feld::placeholder { color: #8A90A0; }

.vorschlag { background: var(--flaeche); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.vorschlag p { font-size: 16px; white-space: pre-wrap; }

/* Foto */
.kopfzeile { display: flex; align-items: center; justify-content: space-between; }
.platz { width: 44px; }
.sucher { flex: 1; position: relative; border-radius: 28px; background: #121318; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: pointer; min-height: 360px; }
.sucher img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sucher-text { display: flex; flex-direction: column; gap: 10px; padding: 0 40px; text-align: center; position: relative; }
.sucher-text strong { font-size: 22px; line-height: 1.3; }
.ecke { position: absolute; width: 40px; height: 40px; border: 0 solid var(--akzent); z-index: 1; }
.ecke.lo { left: 24px; top: 24px; border-left-width: 3px; border-top-width: 3px; border-radius: 10px 0 0 0; }
.ecke.ro { right: 24px; top: 24px; border-right-width: 3px; border-top-width: 3px; border-radius: 0 10px 0 0; }
.ecke.lu { left: 24px; bottom: 24px; border-left-width: 3px; border-bottom-width: 3px; border-radius: 0 0 0 10px; }
.ecke.ru { right: 24px; bottom: 24px; border-right-width: 3px; border-bottom-width: 3px; border-radius: 0 0 10px 0; }
.ausloeser-zeile { display: flex; justify-content: center; }
.ausloeser { width: 84px; height: 84px; border-radius: 42px; border: 4px solid var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ausloeser span { width: 66px; height: 66px; border-radius: 33px; background: var(--akzent); }
.ausloeser.laedt span { animation: puls 1s ease-in-out infinite; }
@keyframes puls { 50% { transform: scale(.85); opacity: .6; } }

/* Training */
.kamera { flex: 1; position: relative; border-radius: 28px; overflow: hidden; background: #121318; min-height: 420px; }
.kamera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.kamera-text { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 60px 20px 24px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.kamera-zahl { font-size: 120px; font-weight: 800; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--akzent); }
.kamera-zahl.zaehlt { animation: zaehlen .3s ease-out; }
@keyframes zaehlen { from { transform: scale(1.25); } }
.kamera-status { font-size: 17px; font-weight: 700; }

/* Timer */
.ring { position: relative; width: 280px; height: 280px; }
.ring svg { position: absolute; inset: 0; width: 280px; height: 280px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 14; }
.ring-grund { stroke: #1E2128; }
.ring-lauf { stroke: var(--akzent); stroke-linecap: round; stroke-dasharray: 754; transition: stroke-dashoffset 1s linear; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ring-text span:first-child { font-size: 72px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Erledigt */
.haken { width: 120px; height: 120px; border-radius: 60px; background: var(--akzent); color: var(--grund); display: flex; align-items: center; justify-content: center; animation: rein .5s cubic-bezier(.2,1.4,.4,1); }
.haken svg { width: 56px; height: 56px; stroke-width: 2.8; }
@keyframes rein { from { transform: scale(.4); opacity: 0; } }
.raster2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kachel { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border-radius: 20px; background: var(--flaeche); }
.kachel.links { align-items: flex-start; }
.kachel .knopf { width: 100%; height: 52px; margin-top: 6px; }
.zahl { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }

/* Geschafft */
.woche { align-items: stretch; gap: 14px; }
.balken { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 120px; }
.balken div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.balken i { width: 100%; border-radius: 6px; background: var(--flaeche-3); min-height: 6px; }
.balken i.voll { background: #3A3E4A; }
.balken i.heute { background: var(--akzent); }
.balken b { font-size: 12px; font-weight: 600; color: var(--leise); }
.balken b.heute { color: var(--text); }
.liste { display: flex; flex-direction: column; gap: 4px; }
.liste ul { list-style: none; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #1E2128; font-weight: 600; font-size: 15px; }
.liste li svg { color: var(--akzent); width: 18px; height: 18px; stroke-width: 2.6; }
.liste li span:nth-child(2) { flex: 1; }
.liste li span:last-child { color: var(--leise); font-weight: 500; }
.liste .leer { color: var(--leise); font-weight: 500; border: 0; }

/* Chat */
.verlauf { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; overflow-y: auto; min-height: 0; }
.blase { max-width: 82%; padding: 12px 15px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.blase.ich { align-self: flex-end; background: var(--akzent); color: var(--grund); font-weight: 600; border-radius: 20px 20px 6px 20px; }
.blase.claude { align-self: flex-start; background: var(--flaeche-2); border-radius: 20px 20px 20px 6px; }
.blase.tippt { color: var(--leise); }
#v-chat { height: 100%; }
#v-chat form { margin-bottom: 4px; }

/* Leiste */
.leiste {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom));
  width: min(432px, calc(100% - 48px)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  padding: 6px; border-radius: 22px; background: var(--flaeche);
}
.leiste button { height: 54px; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--leise); }
.leiste button.aktiv { background: var(--flaeche-3); color: var(--text); font-weight: 700; }

#s-wa-qr { width: 100%; max-width: 280px; border-radius: 12px; background: #fff; margin-top: 8px; }
