:root {
  --bg: #0b0b0c;
  --karte: #17171a;
  --karte2: #202024;
  --linie: #2c2c31;
  --text: #f2f2f3;
  --leise: #8e8e96;
  --orange: #ff7a1a;
  --orange2: #ffa25a;
  --orangeHg: rgba(255, 122, 26, 0.14);
  --gruen: #4ade80;
  --rot: #f87171;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: var(--text); }
button:active { transform: scale(0.97); }

.seite { position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 340px at 50% -80px, rgba(255, 122, 26, 0.16), transparent 70%) no-repeat, var(--bg); }
.seite.ueber { z-index: 5; animation: rein 0.22s ease-out; }
@keyframes rein { from { transform: translateY(24px); opacity: 0; } }
.innen, .login { max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 120px); }

.logo { font-weight: 900; font-size: 26px; letter-spacing: -0.03em; }
.logo b { color: var(--orange); font-weight: inherit; }
.logo.gross { font-size: 54px; text-align: center; margin: 18vh 0 6px; }
.slogan { text-align: center; color: var(--leise); margin: 0 0 32px; }

.kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; min-height: 44px; }
.kopfMitte { text-align: center; display: grid; }
.kopfMitte b { font-size: 18px; }
.kopfMitte small { color: var(--orange); font-variant-numeric: tabular-nums; font-weight: 600; }
.rund { width: 40px; height: 40px; border-radius: 50%; background: var(--karte); font-size: 20px; display: grid; place-items: center; }
.rund.leer { background: none; }

/* Login */
.login form { display: grid; gap: 12px; }
.login input { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 14px; font-size: 20px; text-align: center; letter-spacing: 0.3em; }
.fehler { color: var(--rot); text-align: center; min-height: 1.4em; margin: 0; }

/* Knöpfe */
.knopf { background: var(--orange); color: #160a00; font-weight: 800; border-radius: 14px; padding: 13px 18px; font-size: 16px; }
.knopf.gross { width: 100%; padding: 16px; font-size: 18px; border-radius: 16px; box-shadow: 0 8px 30px rgba(255, 122, 26, 0.35); }
.knopf.leise { background: var(--karte); color: var(--text); width: 100%; margin-top: 12px; font-weight: 600; }
.knopf.rot { background: rgba(248, 113, 113, 0.14); color: var(--rot); }
.knopf:disabled { opacity: 0.5; }
.unten { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(transparent, var(--bg) 35%); }
.unten > * { max-width: 528px; margin: 0 auto; display: block; }

/* Pläne */
.plaene { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.plaene::-webkit-scrollbar { display: none; }
.plaene button { background: var(--karte); border-radius: 999px; padding: 9px 18px; font-weight: 700; white-space: nowrap; color: var(--leise); }
.plaene button.aktiv { background: var(--orange); color: #160a00; }
.plaene button.neu { color: var(--orange); }
.planInfo { color: var(--leise); font-size: 14px; margin: 10px 2px 12px; display: flex; justify-content: space-between; gap: 8px; }
.planInfo button { color: var(--orange); font-size: 14px; }

/* Übungs-Karten */
.liste { display: grid; gap: 10px; }
.karte { background: var(--karte); border-radius: var(--radius); padding: 16px; text-align: left; width: 100%; display: block; }
.karteKopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.karteKopf b { font-size: 17px; }
.letztes { color: var(--leise); font-size: 13px; white-space: nowrap; }
.ziel { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.zielWert { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; color: var(--orange); font-variant-numeric: tabular-nums; }
.zielWert small { font-size: 15px; font-weight: 700; color: var(--orange2); }
.saetzeChips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--orangeHg); color: var(--orange2); border-radius: 999px; padding: 3px 9px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pfeil { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 6px; }
.pfeil.hoch { background: var(--orange); color: #160a00; }
.pfeil.mehr { background: var(--karte2); color: var(--orange2); }
.pfeil.runter { background: rgba(248, 113, 113, 0.14); color: var(--rot); }
.pfeil.start, .pfeil.halten { background: var(--karte2); color: var(--leise); }
.hinweis { color: var(--leise); font-size: 13px; margin-top: 8px; display: flex; gap: 6px; }
.ki { color: var(--orange); font-weight: 800; font-size: 11px; border: 1px solid var(--orange); border-radius: 5px; padding: 0 4px; height: fit-content; flex: none; margin-top: 1px; }
.laedt .ki { animation: puls 1s infinite alternate; }
@keyframes puls { to { opacity: 0.3; } }

/* Training */
.tUebung { background: var(--karte); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.tUebung.fertig { outline: 1px solid rgba(255, 122, 26, 0.5); }
.tKopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.tKopf b { font-size: 17px; }
.tKopf small { color: var(--leise); font-size: 12px; }
.tZiel { color: var(--orange2); font-size: 13px; margin-bottom: 8px; }
.satz { display: grid; grid-template-columns: 22px 1fr 1fr 44px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--linie); }
.satz:first-of-type { border-top: 0; }
.satz .nr { color: var(--leise); font-weight: 700; text-align: center; }
.stepper { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; background: var(--karte2); border-radius: 12px; height: 44px; }
.stepper button { height: 100%; font-size: 20px; color: var(--leise); }
.stepper input { width: 100%; min-width: 0; text-align: center; background: none; border: 0; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; padding: 0; }
.stepper input:focus { outline: none; color: var(--orange); }
.stepper .einheit { display: none; }
.haken { width: 44px; height: 44px; border-radius: 12px; background: var(--karte2); font-size: 20px; color: var(--leise); }
.satz.ok .haken { background: var(--orange); color: #160a00; }
.satz.ok .stepper input { color: var(--orange2); }
.satz.besser .nr { color: var(--orange); }
.tFuss { display: flex; justify-content: space-between; margin-top: 6px; }
.tFuss button { color: var(--leise); font-size: 14px; padding: 6px 2px; }
.kopfzeile { display: grid; grid-template-columns: 22px 1fr 1fr 44px; gap: 8px; color: var(--leise); font-size: 12px; text-align: center; }

/* Detail */
.detailZiel { background: var(--karte); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.detailZiel .titel, .abschnitt { color: var(--leise); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.abschnitt { margin: 22px 2px 8px; }
.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kennzahl { background: var(--karte); border-radius: 14px; padding: 12px; }
.kennzahl b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.kennzahl small { color: var(--leise); font-size: 12px; }
.diagramm { background: var(--karte); border-radius: var(--radius); padding: 14px 10px 8px; }
.diagramm svg { width: 100%; height: auto; display: block; }
.legende { display: flex; gap: 14px; color: var(--leise); font-size: 12px; padding: 6px 6px 0; }
.legende i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.verlauf { background: var(--karte); border-radius: var(--radius); }
.vZeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--linie); }
.vZeile:first-child { border-top: 0; }
.vZeile .datum { color: var(--leise); font-size: 14px; white-space: nowrap; }
.vZeile .werte { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; flex: 1; }
.vZeile button { color: var(--leise); padding: 4px; }

/* Formulare im Fenster */
.fenster { position: fixed; inset: 0; z-index: 20; }
.fensterHg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); animation: hg 0.2s; }
@keyframes hg { from { opacity: 0; } }
.fensterBox { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--karte);
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); animation: hoch 0.25s ease-out;
  max-height: 88vh; overflow-y: auto; }
@keyframes hoch { from { transform: translateY(100%); } }
.fensterBox h2 { margin: 0 0 14px; font-size: 20px; }
.feld { display: grid; gap: 6px; margin-bottom: 12px; }
.feld span { color: var(--leise); font-size: 13px; }
.feld input { background: var(--karte2); border: 1px solid var(--linie); border-radius: 12px; padding: 12px; font-size: 17px; width: 100%; }
.feld input:focus { outline: none; border-color: var(--orange); }
.zweier { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.knoepfe { display: grid; gap: 8px; margin-top: 6px; }
.menue button { display: block; width: 100%; text-align: left; padding: 14px 4px; border-top: 1px solid var(--linie); font-size: 17px; }
.menue button:first-child { border-top: 0; }
.erklaer { color: var(--leise); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 16px; border-radius: 999px; max-width: 90vw; text-align: center;
  animation: hg 0.2s; }
.leerText { color: var(--leise); text-align: center; padding: 30px 10px; }
.lOrange { background: var(--orange); }
.lGrau { background: var(--leise); }
.rotText { color: var(--rot); }
.abstand { margin-top: 14px; }

/* Prozent-Abzeichen: besser / schlechter als letztes Training */
.pct { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pct.plus { background: rgba(74, 222, 128, 0.14); color: var(--gruen); }
.pct.minus { background: rgba(248, 113, 113, 0.14); color: var(--rot); }
.pct.gleich { background: var(--karte2); color: var(--leise); }
.gruen { color: var(--gruen); }
.schnitt { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.schnitt .pct { font-size: 15px; padding: 2px 8px; }
.schnitt small { color: var(--leise); font-weight: 500; font-size: 13px; display: block; margin-top: 4px; }
.ergName { display: grid; font-weight: 700; }
.ergName small { color: var(--leise); font-weight: 500; font-variant-numeric: tabular-nums; }
.fensterBox .verlauf { background: var(--karte2); }
/* Logo-Zeichen (Hantel mit Pfeil) vor dem Schriftzug */
.logo { display: flex; align-items: center; gap: 8px; }
.logo img { height: 1.05em; width: auto; }
.logo.gross { justify-content: center; gap: 12px; }

/* Live-Prozent im Training: unter jedem Satz „vorher …“ und die Veränderung */
.satzInfo { grid-column: 2 / -1; display: flex; justify-content: space-between; align-items: center; color: var(--leise); font-size: 12px; margin-top: -2px; min-height: 18px; font-variant-numeric: tabular-nums; }
.satzInfo .pct { margin-left: 0; }
.tKopf b .pct { vertical-align: 2px; }

/* ---------- Übung eintragen (einfach: −/＋, Wdh groß in der Mitte, Prozent) ---------- */
.gesamt { text-align: center; margin: 4px 0 18px; }
.gesamt b { display: block; font-size: 52px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.gesamt b.plus { color: var(--gruen); }
.gesamt b.minus { color: var(--rot); }
.gesamt b.gleich { color: var(--leise); }
.gesamt small { color: var(--leise); font-size: 14px; }
.logSatz { background: var(--karte); border-radius: var(--radius); padding: 12px 14px 14px; margin-bottom: 12px; }
.logKopf { display: flex; justify-content: space-between; align-items: center; color: var(--leise); font-size: 14px; font-weight: 700; margin-bottom: 8px; min-height: 22px; }
.logKopf small { font-weight: 500; }
.logKopf .pct { font-size: 14px; padding: 2px 8px; }
.zeile { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; }
.zeile + .zeile { margin-top: 6px; }
.zeile button { height: 56px; border-radius: 16px; background: var(--karte2); font-size: 28px; font-weight: 500; color: var(--text); }
.zeile.wdh button { height: 72px; background: var(--orangeHg); color: var(--orange); font-size: 34px; }
.zeile label { display: flex; flex-direction: column; align-items: center; min-width: 0; line-height: 1.1; }
.zeile input { width: 100%; min-width: 0; background: none; border: 0; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0; color: var(--text); }
.zeile input:focus { outline: none; color: var(--orange); }
.zeile small { color: var(--leise); font-size: 12px; font-weight: 600; }
.zeile.kg input { font-size: 26px; }
.zeile.wdh input { font-size: 48px; color: var(--orange); }
.satzKnoepfe { display: flex; justify-content: center; gap: 24px; margin: 4px 0 8px; }
.satzKnoepfe button { color: var(--leise); padding: 8px; font-weight: 600; }
.kiTipp { display: flex; gap: 8px; color: var(--leise); font-size: 14px; margin: 8px 2px; }

/* Karten in der Übersicht */
.karteKopf > span { display: flex; align-items: center; gap: 6px; }
.karteKopf .pct { margin-left: 0; }
.haekchen { color: var(--gruen); font-size: 13px; font-weight: 800; }
.zielLabel { color: var(--leise); font-size: 13px; font-weight: 600; margin-right: 2px; }
.karte.erledigt .zielWert { color: var(--orange2); }
.fensterBox .knopf.leise { background: var(--karte2); }

/* Runterziehen zum Aktualisieren: Ladekreis wie bei Macro³, in Orange */
html, body { overscroll-behavior-y: contain; }
.ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) - 30px); z-index: 50; width: 38px; height: 38px; border-radius: 50%;
  background: var(--karte2); border: 1px solid var(--linie); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center;
  transform: translate3d(-50%, 0, 0); opacity: 0; will-change: transform, opacity; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s; pointer-events: none; }
.ptr.ziehend { transition: none; }
.ptr span { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--linie); border-top-color: var(--leise); will-change: transform; }
.ptr.bereit span { border-top-color: var(--orange); }
.ptr.dreht span { border-top-color: var(--orange); animation: ptrDreh 0.7s linear infinite; }
@keyframes ptrDreh { to { transform: rotate(360deg); } }

/* Ergebnis nach dem Speichern */
.naechstes { background: var(--karte2); border-radius: var(--radius); padding: 14px 16px; }
.naechstes .titel { color: var(--leise); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.naechstes .ziel { margin-top: 6px; }
.naechstesText { margin: 8px 0 0; color: var(--text); font-size: 15px; min-height: 1.4em; }
.naechstesText.laedt { color: var(--leise); animation: puls 1s infinite alternate; }
.vorherKlein { color: var(--leise); font-weight: 500; font-size: 12px; margin-left: 4px; }

/* Gesamt-Workout */
.workoutKarte { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.wLinks { display: grid; gap: 2px; }
.wLinks b { font-size: 16px; }
.wLinks small { color: var(--leise); font-size: 13px; }
.wProzent { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wProzent.plus { color: var(--gruen); }
.wProzent.minus { color: var(--rot); }
.wProzent.gleich { color: var(--leise); }
.workoutZeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--karte2); border-radius: var(--radius); padding: 12px 16px; margin-top: 12px; }
.workoutZeile > span:first-child { display: grid; font-weight: 700; }
.workoutZeile small { color: var(--leise); font-weight: 500; font-size: 13px; }
.workoutZeile .wProzent { font-size: 22px; }
.heuteWerte { font-size: 20px; font-weight: 800; color: var(--orange2); font-variant-numeric: tabular-nums; }
