/* Momentum – Fitnesstracker. Mobil zuerst, dunkles Design mit einer Akzentfarbe. */

:root {
  --bg: #0E0F12;
  --bg-2: #121318;
  --card: #17191E;
  --line: #23262D;
  --line-2: #2A2D35;
  --line-3: #3A3F4A;
  --muted-bar: #5A606C;
  --text: #F2F3F5;
  --text-2: #C9CDD4;
  --text-3: #9BA0AA;
  --text-4: #8A909B;
  --accent: #FF9B54;
  --accent-hover: #FFB98A;
  --on-accent: #0E0F12;
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: Inter, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --display: "Space Grotesk", Inter, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, a, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input::placeholder { color: #6E7480; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }

/* ---------- Layout ---------- */
.screen { padding: calc(env(safe-area-inset-top, 0px) + 40px) 20px calc(32px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; min-height: 100vh; min-height: 100dvh; }
.screen.with-nav { padding-bottom: calc(110px + var(--safe-bottom)); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Typografie ---------- */
.h1 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.h1.small { font-size: 24px; letter-spacing: -0.02em; }
.h2 { margin: 0; font-size: 17px; font-weight: 600; }
.big { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.muted { color: var(--text-3); }
.muted-2 { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.accent { color: var(--accent); }
.strong { font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Karten ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.tight { padding: 16px; gap: 10px; border-radius: 18px; }
.card.hl { border-color: var(--accent); }
.inset { background: var(--bg); border-radius: 16px; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.note { display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.note svg { flex-shrink: 0; margin-top: 1px; }
.note.dark { background: var(--bg); border: 0; }

/* ---------- Buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 58px; border-radius: 18px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px; text-decoration: none; cursor: pointer; width: 100%; }
.btn:hover { color: var(--on-accent); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); font-size: 15px; }
.btn.grey { background: var(--line-2); color: var(--text); }
.btn.dashed { background: transparent; border: 1px dashed var(--line-3); color: var(--text-2); font-size: 15px; font-weight: 500; height: 52px; }
.btn.dashed.acc { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn.danger { background: transparent; border: 1px solid #5c2b2b; color: #ff8a8a; font-size: 15px; }
.btn.sm { height: 48px; font-size: 15px; border-radius: 16px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.icon-btn:hover { color: var(--text); }
.step-btn { width: 56px; height: 56px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.mini-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--bg); color: var(--text); font-size: 20px; cursor: pointer; flex-shrink: 0; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14px; padding: 10px 0; cursor: pointer; text-decoration: none; }

/* ---------- Segmente & Chips ---------- */
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; background: var(--bg); border-radius: 14px; padding: 4px; }
.seg.on-bg { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.seg button { height: 40px; border: 0; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-3); }
.seg.on-bg button { height: 44px; font-size: 15px; border-radius: 12px; }
.seg button[aria-selected="true"] { background: var(--line-2); color: var(--text); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-2); border: 1px solid var(--line-2); display: inline-flex; align-items: center; gap: 6px; }
.chip.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.chip[aria-checked="true"], .chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chip.cur { background: var(--text); color: var(--bg); border-color: transparent; }
.chip.done { background: var(--card); color: var(--accent); }
.tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 6px; background: var(--accent); color: var(--on-accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--line-2); color: var(--text-2); }
.pill.on { background: var(--accent); color: var(--on-accent); }
.pill.outline { background: transparent; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; height: 30px; padding: 0 10px; }
.sm-chip { font-size: 12px; color: var(--text-2); background: var(--bg); border-radius: 8px; padding: 6px 9px; }

/* ---------- Formulare ---------- */
label.lbl, .lbl { font-size: 13px; font-weight: 500; color: var(--text-3); }
.field { display: flex; align-items: center; gap: 8px; height: 54px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); padding: 0 16px; }
.field input { flex: 1; min-width: 0; height: 44px; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 18px; outline: none; }
.field:focus-within { border-color: var(--accent); }
.field .unit { font-size: 14px; color: var(--text-3); }
.field.search { height: 48px; border-radius: 14px; padding: 0 14px; }
.field.search input { font-size: 16px; }
.field.big { height: 60px; padding: 0 8px 0 18px; }
.field.big input { letter-spacing: 0.06em; }
.err { color: #ff8a8a; font-size: 14px; }

/* ---------- Listen ---------- */
.list-btn { display: flex; align-items: center; gap: 12px; min-height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 8px 14px; cursor: pointer; text-align: left; width: 100%; font: inherit; }
.list-btn.hl { border-color: var(--accent); }
.list-btn .t { font-size: 15px; font-weight: 500; }
.list-btn .s { font-size: 12px; color: var(--text-3); }

/* ---------- Dashboard ---------- */
.avatar { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-family: var(--display); font-weight: 600; font-size: 18px; cursor: pointer; flex-shrink: 0; }
.ring { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 22px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: var(--bg); color: var(--text-4); border: 1px solid var(--line-2); }
.day.done { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.day.today:not(.done) { border-color: var(--text); color: var(--text); }
.stat-num { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.chart { width: 100%; height: 140px; display: block; }
.rank-row { display: flex; flex-direction: column; gap: 8px; }
.bar { margin-left: 28px; height: 8px; border-radius: 999px; background: var(--line); }
.bar > div { height: 8px; border-radius: 999px; background: var(--muted-bar); }
.bar > div.me { background: var(--accent); }
.empty { color: var(--text-3); font-size: 14px; line-height: 1.5; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-top: 1px solid var(--line); background: rgba(18, 19, 24, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 8px 12px calc(10px + var(--safe-bottom)); }
.nav-in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.nav a, .nav button { height: 56px; border: 0; background: transparent; color: var(--text-3); font-size: 12px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; text-decoration: none; }
.nav [aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- Training ---------- */
.train { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.train-top { padding: calc(env(safe-area-inset-top, 0px) + 36px) 20px 12px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid #1E2026; }
.progress { height: 6px; border-radius: 999px; background: var(--line); }
.progress > div { height: 6px; border-radius: 999px; background: var(--accent); transition: width 0.3s; }
.train-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.train-body::-webkit-scrollbar { display: none; }
.train-foot { padding: 12px 20px calc(16px + var(--safe-bottom)); border-top: 1px solid #1E2026; background: var(--bg); }
.rest { display: flex; align-items: center; gap: 10px; background: var(--accent); color: var(--on-accent); border-radius: 18px; padding: 10px 10px 10px 16px; }
.rest button { height: 44px; border-radius: 12px; border: 0; background: rgba(14, 15, 18, 0.14); color: var(--on-accent); font-size: 14px; font-weight: 700; cursor: pointer; min-width: 48px; }
.rest button.dark { background: var(--bg); color: var(--text); font-size: 13px; font-weight: 600; padding: 0 12px; }
.rest-time { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.weight-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.weight-in { width: 140px; background: transparent; border: 0; border-bottom: 2px dashed var(--line-3); color: var(--text); font-family: var(--display); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; text-align: center; padding: 0; outline: none; border-radius: 0; }
.weight-in:focus { border-bottom-color: var(--accent); }
.set { display: flex; align-items: center; gap: 8px; border-radius: 18px; padding: 8px; background: var(--card); border: 1px solid var(--line); }
.set.next { border-color: var(--accent); }
.set.done { background: var(--bg-2); }
.set .w { font-size: 16px; font-weight: 600; }
.set.done .w, .set.done .reps { color: var(--text-4); }
.set .reps { width: 44px; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 600; }
.check { width: 56px; height: 56px; border-radius: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; background: var(--bg); color: #5A606C; border: 1px solid var(--line-2); flex-shrink: 0; }
.set.next .check { background: var(--line-2); color: var(--text); }
.check[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + var(--safe-bottom)); z-index: 50; width: calc(100% - 40px); max-width: 440px; display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
.offline { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(160px + var(--safe-bottom)); z-index: 40; background: var(--line-2); color: var(--text-2); border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.switch { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: var(--text); cursor: pointer; text-align: left; width: 100%; font: inherit; }
.switch .knob { width: 48px; height: 28px; border-radius: 999px; padding: 3px; display: flex; background: var(--line-3); flex-shrink: 0; transition: background 0.2s; }
.switch .knob::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform 0.2s; }
.switch[aria-checked="true"] .knob { background: var(--accent); }
.switch[aria-checked="true"] .knob::after { transform: translateX(20px); }

/* ---------- Sheet / Dialog ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--bg-2); border-top-left-radius: 24px; border-top-right-radius: 24px; border: 1px solid var(--line); border-bottom: 0; padding: 20px 20px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow-y: auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-3); align-self: center; }

/* ---------- Login ---------- */
.login { padding: calc(env(safe-area-inset-top, 0px) + 72px) 28px calc(40px + var(--safe-bottom)); display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; min-height: 100dvh; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.login h1 { margin: 0; font-family: var(--display); font-size: 44px; line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; }
.eye { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }

.loading { display: flex; align-items: center; justify-content: center; min-height: 60vh; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
