/* =====================================================================
   Gym Buddy 2 — Styles
   Ein Maßstab für alles: Abstände im 4px-Raster, 7 Schriftgrößen,
   semantische Farbrollen. Dunkles Theme (bewusst: Gym, Akku, Fokus).
   ===================================================================== */
:root {
  color-scheme: dark;

  /* Flächen */
  --bg: #0b0d10;
  --bg-2: #111418;
  --surface: #161a1f;
  --surface-2: #1d2229;
  --surface-3: #252b33;
  --border: #262c34;          /* dekorativ */
  --border-strong: #5f6772;   /* 3.05:1 auf --surface — Eingabefelder */

  /* Text (Kontrast auf --surface geprüft) */
  --text: #eef1f4;            /* 15:1 */
  --text-muted: #a3acb8;      /* 7.6:1 */
  --text-faint: #8a94a0;      /* 5.7:1 */

  /* Akzent & Status */
  --accent: #c8ff3c;          /* 14.8:1 auf --surface */
  --accent-strong: #b3eb1f;
  --on-accent: #0b0d10;       /* 16.5:1 auf --accent */
  --accent-soft: rgba(200, 255, 60, .12);
  --accent-line: rgba(200, 255, 60, .38);
  --gold: #ffd24a;            /* Rekorde */
  --gold-soft: rgba(255, 210, 74, .14);
  --danger: #ff6b81;
  --danger-soft: rgba(255, 107, 129, .14);
  --ok: #37d67a;

  /* Abstände */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* Typo */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "SF Pro Display", -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-xs: 12px; --t-sm: 14px; --t-base: 16px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 30px; --t-display: 44px;

  /* Radien */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;

  /* Bewegung */
  --fast: 120ms; --base: 180ms; --slow: 280ms;
  --ease-out: cubic-bezier(.2, 0, 0, 1);

  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + var(--s6));
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s3);
  padding: calc(var(--s3) + var(--safe-t)) max(var(--s4), calc(50% - 284px)) var(--s3);
  background: rgba(11, 13, 16, .88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--base);
}
.app-header.scrolled { border-bottom-color: var(--border); }
.brand-mark {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
}
.brand-mark .ic { width: 22px; height: 22px; }
.brand-text { min-width: 0; flex: 1; }
.brand-text h1 { font-size: var(--t-lg); font-weight: 700; }
.brand-text p { font-size: var(--t-xs); color: var(--text-muted); }
.level-pill {
  display: flex; align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s3) 0 var(--s1);
  border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border);
}
.level-pill .ring { width: 32px; height: 32px; }
.level-pill b { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 700; line-height: 1; }
.level-pill span { font-size: var(--t-xs); color: var(--text-muted); line-height: 1; }
.level-pill .lp-text { display: flex; flex-direction: column; gap: 2px; }

main { padding: 0 var(--s4); max-width: 600px; margin: 0 auto; }
.view { animation: viewIn var(--base) var(--ease-out); }
@keyframes viewIn { from { transform: translateY(6px); } to { transform: none; } }

/* ---------- Generic ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); }
.card + .card { margin-top: var(--s3); }
.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: 0 var(--s1) var(--s3); }
.section-head h2 { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.section-head .aside { font-size: var(--t-xs); color: var(--text-faint); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.row { display: flex; align-items: center; gap: var(--s3); }
.grow { flex: 1; min-width: 0; }
.stack-2 > * + * { margin-top: var(--s2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-md);
  font-size: var(--t-base); font-weight: 600;
  transition: transform var(--fast) var(--ease-out), background var(--fast), opacity var(--fast);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: var(--t-lg); border-radius: var(--r-lg); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: transform var(--fast), background var(--fast);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.accent { color: var(--accent); }

.tag {
  display: inline-flex; align-items: center; gap: var(--s1);
  height: 24px; padding: 0 var(--s2); border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-muted);
  font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
}
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag .ic { width: 14px; height: 14px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
  min-width: 44px; height: 32px; padding: 0 var(--s3); border-radius: var(--r-full);
  font-size: var(--t-sm); font-weight: 700; color: var(--text-muted);
  transition: background var(--fast), color var(--fast);
}
.seg button.on { background: var(--accent); color: var(--on-accent); }

.bar { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: var(--r-full); background: var(--accent); transition: width var(--slow) var(--ease-out); }
.bar.thin { height: 6px; }

/* ---------- Week strip ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: var(--s3) 0 var(--s4); }
.wd {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--s2) 0 var(--s2); min-height: 60px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  transition: background var(--fast), border-color var(--fast);
}
.wd .d { font-size: var(--t-sm); font-weight: 700; }
.wd .t { font-size: 10px; font-weight: 600; color: var(--text-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.wd.today { border-color: var(--border-strong); }
.wd.sel { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wd.sel .t { color: var(--on-accent); opacity: .75; }
.wd .dot {
  position: absolute; top: -5px; right: -3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok); color: var(--on-accent); display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.wd .dot .ic { width: 11px; height: 11px; stroke-width: 3.5; }

/* ---------- Day hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: var(--s5);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(200, 255, 60, .16), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.hero .eyebrow { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero h2 { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: .005em; margin-top: var(--s2); text-transform: uppercase; }
.hero .meta { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.hero .progress { margin-top: var(--s5); }
.hero .progress-label { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--text-muted); margin-bottom: var(--s2); }
.hero .progress-label b { color: var(--text); font-weight: 700; }
.hero .cta { margin-top: var(--s4); }
.hero .note { margin-top: var(--s3); font-size: var(--t-sm); color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.link-btn { color: var(--accent); font-weight: 600; font-size: var(--t-sm); min-height: 32px; }

.done-banner {
  display: flex; align-items: center; gap: var(--s3);
  margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text);
  font-size: var(--t-sm);
}
.done-banner .ic { color: var(--accent); }

/* ---------- Exercise cards ---------- */
.ex-list { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.ex { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); transition: border-color var(--base); }
.ex.complete { border-color: var(--accent-line); }
.ex-head { display: flex; gap: var(--s3); align-items: flex-start; }
.thumb {
  display: block; position: relative; width: 64px; height: 64px; flex: none; border-radius: var(--r-md); overflow: hidden;
  background: #e9ecef; border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.photo { background: var(--surface-2); }
.thumb.failed img { display: none; }
.thumb.failed::after { content: ''; position: absolute; inset: 0; background: var(--surface-2); }
.thumb .num-badge {
  position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-full);
  background: rgba(11, 13, 16, .82); color: var(--text); font-size: 11px; font-weight: 700; display: grid; place-items: center; z-index: 1;
}
.thumb.done .num-badge { background: var(--accent); color: var(--on-accent); }
.ex-title { flex: 1; min-width: 0; }
.ex-title h3 { font-size: var(--t-base); font-weight: 700; line-height: 1.25; }
.ex-title .sub { margin-top: var(--s1); font-size: var(--t-sm); color: var(--text-muted); }
.ex-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.ex-last { margin-top: var(--s3); font-size: var(--t-sm); color: var(--text-muted); }
.ex-last b { color: var(--text); font-weight: 600; }

.suggest {
  display: flex; align-items: center; gap: var(--s3);
  margin-top: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.suggest .ic { color: var(--accent); }
.suggest .txt { flex: 1; min-width: 0; font-size: var(--t-sm); line-height: 1.35; }
.suggest .txt b { color: var(--accent); }
.suggest button { flex: none; min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-size: var(--t-sm); font-weight: 700; }
.suggest.info { background: var(--surface-2); border-color: var(--border); }
.suggest.info .ic { color: var(--text-muted); }

/* Set rows */
.sets { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.set-head { display: grid; grid-template-columns: 28px 1fr 1fr 48px; gap: var(--s2); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-top: var(--s4); padding: 0 2px; }
.set-head span:nth-child(2), .set-head span:nth-child(3) { text-align: center; }
.set-row { display: grid; grid-template-columns: 28px 1fr 1fr 48px; gap: var(--s2); align-items: center; }
.set-row.one { grid-template-columns: 28px 1fr 48px; }
.set-head.one { grid-template-columns: 28px 1fr 48px; }
.sn { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-muted); font-size: var(--t-xs); font-weight: 700; display: grid; place-items: center; }
.set-row.is-done .sn { background: var(--accent-soft); color: var(--accent); }
.field {
  width: 100%; min-width: 0; height: 48px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--border-strong);
  text-align: center; font-size: var(--t-lg); font-weight: 700; color: var(--text);
  outline: none; transition: border-color var(--fast), background var(--fast), color var(--fast);
  -moz-appearance: textfield;
}
.field::-webkit-outer-spin-button, .field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field:focus { border-color: var(--accent); background: #0e1216; }
.field::placeholder { color: var(--text-faint); font-weight: 600; font-size: var(--t-sm); }
.field.ghost { color: var(--text-faint); border-style: dashed; }
.set-row.is-done .field { border-color: var(--border); background: transparent; }
.check {
  width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-faint);
  transition: background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.check:active { transform: scale(.92); }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check .ic { width: 22px; height: 22px; stroke-width: 3; }
.set-row .pr-flag { grid-column: 2 / -2; font-size: 11px; font-weight: 700; color: var(--gold); margin-top: -4px; }

/* ---------- Rest day ---------- */
.rest-card { text-align: center; padding: var(--s10) var(--s6); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.rest-card .big-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.rest-card h2 { font-family: var(--font-display); font-size: var(--t-2xl); text-transform: uppercase; margin-top: var(--s4); }
.rest-card p { color: var(--text-muted); font-size: var(--t-sm); margin: var(--s2) auto 0; max-width: 34ch; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: var(--s1) var(--s2) calc(var(--s1) + var(--safe-b));
  background: rgba(17, 20, 24, .92);
  backdrop-filter: saturate(140%) blur(16px); -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-top: 1px solid var(--border);
}
.nav button { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-faint); font-size: 11px; font-weight: 600; border-radius: var(--r-md); }
.nav button .ic { width: 24px; height: 24px; }
.nav button.on { color: var(--accent); }
@media (min-width: 640px) { .nav { max-width: 600px; margin: 0 auto; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; } }

/* ---------- Focus / workout player ---------- */
.player { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.pl-top { display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s2) + var(--safe-t)) var(--s4) var(--s2); }
.pl-top .grow { text-align: center; }
.pl-top .grow b { display: block; font-size: var(--t-sm); font-weight: 700; }
.pl-top .grow span { font-size: var(--t-xs); color: var(--text-muted); }
.pl-clock { min-width: 64px; text-align: right; font-family: var(--font-display); font-size: var(--t-xl); font-weight: 700; color: var(--text-muted); }
.pl-segs { display: flex; gap: 4px; padding: 0 var(--s4) var(--s2); border-bottom: 1px solid var(--border); }
.pl-segs button { flex: 1; height: 6px; border-radius: var(--r-full); background: var(--surface-3); position: relative; overflow: hidden; padding: 0; }
.pl-segs button::before { content: ''; position: absolute; inset: -10px 0; }
.pl-segs button i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: inherit; }
.pl-segs button.cur { outline: 1px solid var(--text); outline-offset: 1px; }
.pl-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--s4) var(--s4) var(--s6); }
.pl-inner { max-width: 600px; margin: 0 auto; }
.media {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 34vh; border-radius: var(--r-lg); overflow: hidden;
  background: #e9ecef; border: 1px solid var(--border);
}
.media.photo { background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: contain; }
.media.photo img { object-fit: cover; }
.media.failed img { display: none; }
.media.failed { background: var(--surface-2); }
.media .media-toggle {
  position: absolute; right: var(--s2); bottom: var(--s2);
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-full);
  background: rgba(11, 13, 16, .82); color: var(--text); font-size: var(--t-xs); font-weight: 700;
}
.media .media-toggle .ic { width: 14px; height: 14px; color: var(--accent); }
.media .media-badge { position: absolute; left: var(--s2); bottom: var(--s2); padding: 4px 10px; border-radius: var(--r-full); background: rgba(11, 13, 16, .82); color: var(--accent); font-size: 11px; font-weight: 700; }
.pl-title { display: flex; align-items: flex-start; gap: var(--s3); margin-top: var(--s4); }
.pl-title h2 { font-size: var(--t-xl); font-weight: 700; line-height: 1.2; }
.pl-title .sub { margin-top: var(--s1); font-size: var(--t-sm); color: var(--text-muted); }
.cue {
  margin-top: var(--s3); padding: var(--s3); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); font-size: var(--t-sm); line-height: 1.5; color: var(--text-muted);
}
.cue b { color: var(--text); }
.warmup { margin-top: var(--s3); font-size: var(--t-sm); color: var(--text-muted); display: flex; gap: var(--s2); align-items: flex-start; }
.warmup .ic { margin-top: 2px; color: var(--text-faint); }

/* Active set card with steppers */
.active-set {
  margin-top: var(--s4); padding: var(--s4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.active-set .as-head { display: flex; justify-content: space-between; align-items: baseline; }
.active-set .as-head b { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.active-set .as-head span { font-size: var(--t-xs); color: var(--text-muted); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.stepper button {
  height: 56px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text);
}
.stepper button:active { background: var(--surface-3); transform: scale(.96); }
.stepper .val { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.stepper input {
  width: 100%; height: 42px; padding: 0; border: 0; background: transparent; text-align: center; outline: none;
  font-family: var(--font-display); font-weight: 700; font-size: var(--t-display); line-height: 1; color: var(--text);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { color: var(--accent); }
.stepper .unit { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); pointer-events: none; line-height: 1; }
.plates { margin-top: var(--s3); font-size: var(--t-xs); color: var(--text-faint); text-align: center; }

.pl-sets { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.pl-set {
  display: grid; grid-template-columns: 28px 1fr auto; gap: var(--s3); align-items: center;
  min-height: 48px; padding: 0 var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
  text-align: left; width: 100%;
}
.pl-set .v { font-size: var(--t-base); font-weight: 600; }
.pl-set .v.ghost { color: var(--text-faint); font-weight: 500; }
.pl-set .st { font-size: var(--t-xs); color: var(--text-faint); display: flex; align-items: center; gap: var(--s1); }
.pl-set.is-done { background: transparent; }
.pl-set.is-done .st { color: var(--accent); }
.pl-set.is-active { border-color: var(--accent-line); }
.pl-set .pr { color: var(--gold); }

.pl-foot {
  padding: var(--s3) var(--s4) calc(var(--s3) + var(--safe-b));
  border-top: 1px solid var(--border); background: rgba(11, 13, 16, .96);
}
.pl-foot-inner { max-width: 600px; margin: 0 auto; }
.rest-strip {
  display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3);
  padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
}
.rest-strip .rs-ring { width: 44px; height: 44px; flex: none; }
.rest-strip .rs-time { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 700; line-height: 1; min-width: 72px; }
.rest-strip .rs-lab { font-size: var(--t-xs); color: var(--text-muted); }
.rest-strip .rs-btns { margin-left: auto; display: flex; gap: var(--s1); }
.rest-strip .rs-btns button { min-width: 44px; height: 40px; padding: 0 var(--s2); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--t-sm); font-weight: 700; color: var(--text); }
.rest-strip.go { border-color: var(--accent); background: var(--accent-soft); }
.pl-actions { display: flex; gap: var(--s2); }
.pl-actions .btn-secondary { flex: 0 0 auto; }
.pl-actions .btn-primary { flex: 1; }

/* Summary */
.summary { text-align: center; padding: var(--s6) 0 var(--s4); }
.summary .trophy { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.summary .trophy .ic { width: 36px; height: 36px; }
.summary h2 { font-family: var(--font-display); font-size: 36px; text-transform: uppercase; margin-top: var(--s4); }
.summary .lead { color: var(--text-muted); margin-top: var(--s2); font-size: var(--t-sm); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin-top: var(--s5); text-align: left; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); }
.kpi .k-lab { font-size: var(--t-xs); color: var(--text-muted); }
.kpi .k-val { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 700; line-height: 1.1; margin-top: 2px; }
.kpi .k-val small { font-family: var(--font); font-size: var(--t-sm); font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.kpi .k-delta { font-size: var(--t-xs); font-weight: 700; margin-top: 2px; }
.k-delta.up { color: var(--ok); } .k-delta.down { color: var(--danger); } .k-delta.flat { color: var(--text-faint); }
.xp-card { margin-top: var(--s3); text-align: left; }
.pr-list { margin-top: var(--s3); text-align: left; }
.pr-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); font-size: var(--t-sm); }
.pr-item:first-child { border-top: 0; }
.pr-item .ic { color: var(--gold); }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fadeIn var(--base) var(--ease-out); }
.sheet-card {
  position: relative; width: 100%; max-width: 600px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 0 var(--s4) calc(var(--s5) + var(--safe-b));
  animation: slideUp var(--slow) var(--ease-out);
}
.sheet-card::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: var(--s2) auto 0; }
.sheet-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0 var(--s3); background: var(--surface); }
.sheet-h h3 { font-size: var(--t-lg); font-weight: 700; }
.sheet-h p { font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.opt {
  display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left;
  padding: var(--s2); border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border);
}
.opt + .opt { margin-top: var(--s2); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt .thumb { width: 56px; height: 56px; }
.opt .o-name { font-weight: 600; font-size: var(--t-base); line-height: 1.3; }
.opt .o-sub { font-size: var(--t-xs); color: var(--text-muted); margin-top: 2px; }
.opt .o-check { color: var(--accent); }

.list-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-size: var(--t-base); font-weight: 600; }
.list-row .lr-sub { font-size: var(--t-xs); color: var(--text-muted); margin-top: 2px; }
.list-row .lr-sub.lr-err { color: var(--danger); }

.switch { position: relative; width: 52px; height: 32px; flex: none; border-radius: var(--r-full); background: var(--surface-3); border: 1px solid var(--border-strong); transition: background var(--fast); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text-muted); transition: transform var(--base) var(--ease-out), background var(--fast); }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-accent); }
.mini-stepper { display: flex; align-items: center; gap: var(--s2); }
.mini-stepper button { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; }
.mini-stepper b { min-width: 24px; text-align: center; font-size: var(--t-lg); }

/* ---------- Toasts & celebration ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--s3) + var(--safe-t)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: var(--s2); pointer-events: none; padding: 0 var(--s4); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s3); width: 100%; max-width: 440px;
  padding: var(--s3) var(--s4); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  animation: toastIn var(--slow) var(--ease-out);
}
.toast.gold { border-color: var(--gold); background: #231f10; }
.toast.accent { border-color: var(--accent); background: #1a2210; }
.toast .t-ic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); }
.toast.gold .t-ic { background: var(--gold); color: var(--on-accent); }
.toast.accent .t-ic { background: var(--accent); color: var(--on-accent); }
.toast b { display: block; font-size: var(--t-sm); }
.toast span { font-size: var(--t-xs); color: var(--text-muted); }
.toast.out { animation: toastOut var(--base) var(--ease-out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
#confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* ---------- Progress / Stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); }
.tile .t-lab { font-size: var(--t-xs); color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tile .t-lab .ic { width: 16px; height: 16px; color: var(--text-faint); }
.tile .t-val { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 700; line-height: 1.1; margin-top: var(--s2); }
.tile .t-val small { font-family: var(--font); font-size: var(--t-sm); font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.tile .t-sub { font-size: var(--t-xs); color: var(--text-faint); margin-top: 2px; }
.goal-card { display: flex; align-items: center; gap: var(--s4); }
.goal-card .ring { width: 88px; height: 88px; flex: none; }
.goal-card h3 { font-size: var(--t-lg); font-weight: 700; }
.goal-card p { font-size: var(--t-sm); color: var(--text-muted); margin-top: var(--s1); }
.quote { font-size: var(--t-sm); color: var(--text-muted); font-style: italic; margin-top: var(--s4); text-align: center; }

.mv-row { display: grid; grid-template-columns: 96px 1fr 56px; gap: var(--s3); align-items: center; padding: 6px 0; }
.mv-row .mv-name { font-size: var(--t-sm); font-weight: 600; }
.mv-row .mv-val { font-size: var(--t-xs); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.mv-row .bar > i.full { background: var(--ok); }

.heat { display: grid; grid-template-columns: 28px repeat(7, 1fr); gap: 4px; }
.heat .hl { font-size: 10px; color: var(--text-faint); font-weight: 600; display: grid; place-items: center; }
.heat .hl.wk { place-items: center end; padding-right: 2px; }
.heat .hc { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.heat .hc.l1 { background: rgba(200, 255, 60, .32); }
.heat .hc.l2 { background: rgba(200, 255, 60, .62); }
.heat .hc.l3 { background: var(--accent); }
.heat .hc.fut { opacity: .35; }
.heat .hc.today { outline: 2px solid var(--text); outline-offset: 1px; }
.legend { display: flex; align-items: center; gap: 6px; margin-top: var(--s3); font-size: 11px; color: var(--text-faint); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.chart-wrap { position: relative; margin-top: var(--s3); }
.chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis-t { fill: var(--text-faint); font-size: 10px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: var(--accent); opacity: .1; stroke: none; }
.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .pt.pr { fill: var(--gold); }
.chart .end-t { fill: var(--text); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .cross { stroke: var(--text-faint); stroke-width: 1; }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--border-strong);
  font-size: var(--t-xs); color: var(--text); box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.chart-tip b { display: block; font-size: var(--t-sm); }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--text-faint); font-size: var(--t-sm); }
.select {
  width: 100%; height: 48px; padding: 0 40px 0 var(--s3); border-radius: var(--r-md);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3acb8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--border-strong); color: var(--text); font-weight: 600; font-size: var(--t-base);
  -webkit-appearance: none; appearance: none;
}
.input { width: 100%; height: 48px; padding: 0 var(--s3); border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text); font-size: var(--t-base); font-weight: 600; outline: none; }
.input:focus { border-color: var(--accent); }
.hist-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); font-size: var(--t-sm); }
.hist-row:first-child { border-top: 0; }
.hist-row .hd { color: var(--text-muted); white-space: nowrap; }
.hist-row .hv { text-align: right; font-weight: 600; }
.hist-row .hv small { display: block; font-weight: 500; color: var(--text-faint); font-size: var(--t-xs); }
.delta { font-size: var(--t-xs); font-weight: 700; margin-left: 6px; }
.delta.good { color: var(--ok); } .delta.bad { color: var(--danger); }

/* ---------- Achievements ---------- */
.lvl-card { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: var(--s5); background: radial-gradient(100% 120% at 0% 0%, rgba(200,255,60,.18), transparent 60%), var(--surface); border: 1px solid var(--border); }
.lvl-card .lvl-top { display: flex; align-items: center; gap: var(--s4); }
.lvl-badge { width: 76px; height: 76px; flex: none; border-radius: 22px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(200,255,60,.22); }
.lvl-badge b { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; }
.lvl-badge small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; margin-bottom: -2px; }
.lvl-card h2 { font-family: var(--font-display); font-size: var(--t-2xl); text-transform: uppercase; }
.lvl-card .lvl-sub { font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; }
.lvl-card .xp-row { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--text-muted); margin: var(--s4) 0 var(--s2); }
.lvl-card .xp-row b { color: var(--text); }
.xp-rules { margin-top: var(--s3); font-size: var(--t-xs); color: var(--text-faint); line-height: 1.6; }

.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: var(--s3) var(--s2); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); min-height: 132px; }
.badge .b-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-faint); }
.badge.on .b-ic { background: var(--accent); color: var(--on-accent); }
.badge .b-n { font-size: var(--t-xs); font-weight: 700; line-height: 1.25; }
.badge .b-d { font-size: 11px; color: var(--text-faint); line-height: 1.3; }
.badge:not(.on) .b-n { color: var(--text-muted); }
.badge .bar { width: 100%; height: 4px; margin-top: auto; }

.rec-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--border); }
.rec-row:first-child { border-top: 0; }
.rec-row .rn { font-size: var(--t-sm); font-weight: 600; }
.rec-row .rd { font-size: var(--t-xs); color: var(--text-faint); margin-top: 2px; }
.rec-row .rv { text-align: right; font-family: var(--font-display); font-size: var(--t-xl); font-weight: 700; line-height: 1; }
.rec-row .rv small { display: block; font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--text-faint); margin-top: 2px; }

/* ---------- Plan ---------- */
.plan-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.plan-day + .plan-day { margin-top: var(--s3); }
.plan-day summary { list-style: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); cursor: pointer; }
.plan-day summary::-webkit-details-marker { display: none; }
.plan-day .pd-day { width: 44px; height: 44px; flex: none; border-radius: var(--r-md); background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: var(--t-sm); }
.plan-day.today .pd-day { background: var(--accent); color: var(--on-accent); }
.plan-day .pd-title { font-weight: 700; }
.plan-day .pd-sub { font-size: var(--t-xs); color: var(--text-muted); margin-top: 2px; }
.plan-day .chev { margin-left: auto; color: var(--text-faint); transition: transform var(--base); }
.plan-day[open] .chev { transform: rotate(180deg); }
.plan-day .pd-list { padding: 0 var(--s4) var(--s3); }
.pd-ex { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--border); }
.pd-ex .thumb { width: 44px; height: 44px; border-radius: var(--r-sm); }
.pd-ex .pe-n { font-size: var(--t-sm); font-weight: 600; line-height: 1.3; }
.pd-ex .pe-s { font-size: var(--t-xs); color: var(--text-muted); }
.pd-ex .pe-r { margin-left: auto; font-size: var(--t-sm); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-day.rest summary { cursor: default; }
.plan-day.rest .pd-title { color: var(--text-muted); }
.tips { margin: 0; padding-left: var(--s5); }
.tips li { font-size: var(--t-sm); line-height: 1.55; color: var(--text-muted); }
.tips li + li { margin-top: var(--s2); }
.tips li b { color: var(--text); }
.version { text-align: center; font-size: var(--t-xs); color: var(--text-faint); margin-top: var(--s6); }

/* What's new */
.news-hero { text-align: center; padding: var(--s4) 0 var(--s2); }
.news-hero .brand-mark { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; }
.news-hero .brand-mark .ic { width: 36px; height: 36px; }
.news-hero h3 { font-family: var(--font-display); font-size: var(--t-2xl); text-transform: uppercase; margin-top: var(--s3); }
.news-hero p { color: var(--text-muted); font-size: var(--t-sm); margin-top: var(--s1); }
.news-item { display: flex; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.news-item:first-of-type { border-top: 0; }
.news-item .ni-ic { width: 40px; height: 40px; flex: none; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.news-item b { font-size: var(--t-sm); display: block; }
.news-item span { font-size: var(--t-xs); color: var(--text-muted); line-height: 1.45; display: block; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (hover: hover) {
  .wd:hover:not(.sel) { background: var(--surface-2); }
  .opt:hover:not(.sel) { background: var(--surface-2); }
}

/* Nachträge: schwebender Pausen-Timer, Bild-Button */
.rest-float {
  position: fixed; left: var(--s4); right: var(--s4); z-index: 40;
  bottom: calc(var(--nav-h) + var(--safe-b) + var(--s3));
  max-width: 568px; margin: 0 auto;
  background: var(--surface-2); border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.rest-float.go { background: #1a2210; border-color: var(--accent); }
.open-btn { flex: none; border-radius: var(--r-md); }
.rs-ring { display: block; width: 44px; height: 44px; flex: none; }
.rs-ring .ring { width: 44px; height: 44px; }

/* ---------- Motivation & Details ---------- */
.greet { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) var(--s1) 0; }
.greet-hi { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 700; line-height: 1.05; text-transform: uppercase; letter-spacing: .01em; }
.greet-sub { font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; }
.streak { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-full); background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(255, 210, 74, .3); }
.streak .ic { width: 18px; height: 18px; }
.streak b { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1; }

.hero.has-img { background: var(--surface); }
.hero.has-img::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 250px;
  background-image: var(--hero-img); background-size: cover; background-position: center 40%; }
.hero.has-img::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 252px;
  background: linear-gradient(180deg, rgba(22, 26, 31, .7) 0%, rgba(22, 26, 31, .1) 30%, rgba(22, 26, 31, .25) 55%, var(--surface) 100%); }
.hero.has-img h2 { margin-top: 118px; text-shadow: 0 2px 16px rgba(0, 0, 0, .65); }
.hero > * { position: relative; z-index: 1; }

.next-up { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text) !important; }
.next-up .ic { color: var(--accent); }

.check.just { animation: pop 320ms var(--ease-out); }
@keyframes pop { 0% { transform: scale(.7); } 55% { transform: scale(1.15); } 100% { transform: scale(1); } }
.set-row.is-done .field { animation: none; }

.sp-row { display: block; width: 100%; text-align: left; padding: var(--s3) 0; border-top: 1px solid var(--border); }
.sp-row:first-of-type { border-top: 0; padding-top: 0; }
.sp-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.sp-n { font-size: var(--t-sm); font-weight: 700; }
.sp-sub { font-size: var(--t-xs); color: var(--text-muted); margin-top: var(--s2); }

button.pd-ex { width: 100%; text-align: left; }
button.rec-row { width: 100%; text-align: left; }
.sheet-card .media { margin-top: var(--s1); max-height: 40vh; }
