/* ========== APEX — Desktop Gym App ========== */

/* ===== SPLASH SCREEN ===== */
#splash {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: #0b0d14;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  transition: opacity .55s ease, visibility .55s ease;
}
#splash.sp-out { opacity: 0; visibility: hidden; pointer-events: none; }
.sp-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 500px at 15% 10%, rgba(109,94,252,.18), transparent 65%),
    radial-gradient(600px 500px at 90% 90%, rgba(34,211,238,.14), transparent 65%);
}
.sp-body { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.sp-logo {
  width: 72px; height: 72px;
  filter: drop-shadow(0 0 24px rgba(109,94,252,.55));
  animation: sp-pop .65s cubic-bezier(.34,1.56,.64,1) forwards;
}
.sp-title {
  font-size: 44px; font-weight: 900; letter-spacing: 6px;
  background: linear-gradient(135deg, #6d5efc, #22d3ee);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-top: 14px; opacity: 0;
  animation: sp-fade .4s .35s forwards;
}
.sp-sub {
  font-size: 13px; color: #8087a0; letter-spacing: 3px; text-transform: uppercase;
  margin-top: 6px; opacity: 0;
  animation: sp-fade .4s .55s forwards;
}
.sp-bar {
  width: 130px; height: 3px; background: rgba(255,255,255,.08);
  border-radius: 3px; overflow: hidden; margin-top: 48px;
  opacity: 0; animation: sp-fade .3s .7s forwards;
}
.sp-fill {
  height: 100%;
  background: linear-gradient(90deg, #6d5efc, #22d3ee);
  border-radius: 3px; width: 0;
  animation: sp-bar 2.1s .7s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes sp-pop  { from { transform: scale(.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sp-fade { to { opacity: 1; } }
@keyframes sp-bar  { to { width: 100%; } }
/* ========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #0b0d14;
  --bg-2: #0f1119;
  --surface: #151823;
  --surface-2: #1c2030;
  --surface-3: #232838;
  --border: #262b3d;
  --border-2: #313850;
  --text: #eef1f8;
  --muted: #8087a0;
  --muted-2: #5c627a;
  --indigo: #6d5efc;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #6d5efc 0%, #22d3ee 100%);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --shadow: 0 16px 40px rgba(0,0,0,.45);
  --r: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }
html { height: 100%; background: var(--bg); }
body {
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  /* overflow hidden nur wenn die App aktiv ist; Auth-Screen braucht Scroll */
  overflow: hidden;
}
h1,h2,h3,h4 { letter-spacing: -0.4px; }
.muted { color: var(--muted); }
button { font-family: inherit; cursor: pointer; }

/* logos */
.logo { width: 38px; height: 38px; }
.logo.sm { width: 28px; height: 28px; }

/* ========== AUTH ========== */
.auth {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* Hintergrundfarbe direkt auf .auth damit kein weißer Fleck beim Überscrollen */
  background:
    radial-gradient(700px 500px at 20% 10%, rgba(109,94,252,.22), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(34,211,238,.18), transparent 60%),
    var(--bg);
  /* Safe Areas: oben (Notch / Dynamic Island), unten (Home-Indikator) */
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.auth-bg { display: none; } /* nicht mehr nötig, bg liegt jetzt direkt auf .auth */
.auth-card {
  position: relative; width: 400px; max-width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 34px 32px; box-shadow: var(--shadow);
  /* verhindert dass die Karte in den seitlichen Safe-Areas klebt */
  margin-left: max(0px, env(safe-area-inset-left));
  margin-right: max(0px, env(safe-area-inset-right));
}
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.auth-brand h1 { font-size: 26px; font-weight: 900; letter-spacing: 1px; }
.auth-brand span { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.auth-tabs { display: flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; background: none; border: none; color: var(--muted); padding: 10px; border-radius: 9px; font-weight: 600; font-size: 14px; transition: .15s; }
.auth-tab.active { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 11px; padding: 13px 14px; font-size: 15px; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--indigo); }
.auth-err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 10px; }
.auth-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 16px; }
.auth-fp-link { display: block; text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; text-decoration: none; }
.auth-fp-link:hover { color: var(--cyan); }

/* buttons */
.btn { border: none; border-radius: 12px; padding: 12px 18px; font-weight: 700; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 8px; justify-content: center; transition: .14s; }
.btn:hover { border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #08111c; border: none; box-shadow: 0 8px 22px rgba(109,94,252,.3); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; padding: 14px; }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn-danger { color: var(--red); }
.btn-ghost { background: transparent; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 18px; width: 34px; height: 34px; border-radius: 9px; transition: .14s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ========== APP LAYOUT ========== */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }

.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 22px 16px; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.side-brand span { font-size: 20px; font-weight: 900; letter-spacing: 1px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-nav button { display: flex; align-items: center; gap: 13px; background: none; border: none; color: var(--muted);
  padding: 11px 13px; border-radius: 11px; font-size: 14.5px; font-weight: 600; text-align: left; transition: .14s; }
.side-nav button i { font-style: normal; font-size: 17px; width: 20px; text-align: center; opacity: .8; }
.side-nav button:hover { background: var(--surface); color: var(--text); }
.side-nav button.active { background: var(--surface-2); color: var(--text); }
.side-nav button.active i { opacity: 1; }
.side-user { display: flex; align-items: center; gap: 11px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-top: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--grad); color: #08111c; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.su-info { flex: 1; min-width: 0; }
.su-info strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-info span { font-size: 12px; color: var(--muted); }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 26px 34px 18px; border-bottom: 1px solid var(--border); }
.topbar h2 { font-size: 24px; font-weight: 800; }
.topbar p { font-size: 13px; margin-top: 3px; }
.topbar-actions { display: flex; gap: 10px; }
.content { flex: 1; overflow-y: auto; padding: 28px 34px 60px; }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }

/* ========== Generic cards / grid ========== */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2,1fr);} .cols-3{grid-template-columns:repeat(2,1fr);} }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.card.pad-lg { padding: 24px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-h h3 { font-size: 16px; font-weight: 700; }
.section-t { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin: 26px 2px 14px; }
.section-t:first-child { margin-top: 4px; }

/* stat cards */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; position: relative; overflow: hidden; }
.stat .ic { font-size: 20px; opacity: .9; margin-bottom: 12px; }
.stat .v { font-size: 30px; font-weight: 800; line-height: 1; }
.stat .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 7px; }
.stat .spark { position: absolute; right: 0; bottom: 0; opacity: .5; }
.stat.accent { background: linear-gradient(135deg, rgba(109,94,252,.16), rgba(34,211,238,.08)); border-color: rgba(109,94,252,.3); }
.stat.accent .v { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* lists */
.row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row .ic-box { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow strong { display: block; font-size: 15px; }
.row .grow span { font-size: 13px; color: var(--muted); }
.row .right { text-align: right; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 30px; background: var(--surface-2); color: var(--muted); }
.pill.g { color: var(--green); background: rgba(52,211,153,.12); }
.pill.a { color: var(--amber); background: rgba(251,191,36,.12); }
.pill.i { color: var(--cyan); background: rgba(34,211,238,.12); }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

/* empty state */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 12px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* clickable card */
.clic { cursor: pointer; transition: .14s; }
.clic:hover { border-color: var(--border-2); transform: translateY(-2px); }

/* plan card */
.plan-c { position: relative; overflow: hidden; }
.plan-c .bar { height: 5px; border-radius: 30px; background: var(--grad); margin-bottom: 16px; width: 48px; }
.plan-c h3 { font-size: 17px; margin-bottom: 5px; }
.plan-c .ex-prev { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 10px; }
.plan-c .actions { display: flex; gap: 8px; margin-top: 18px; }

/* ========== Active workout ========== */
.wk-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.wk-clock { font-size: 18px; font-weight: 800; color: var(--cyan); font-variant-numeric: tabular-nums; }
.ex-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.ex-block .eh { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ex-block .eh h3 { font-size: 16px; }
.ex-block .eh .muscle { font-size: 12px; color: var(--muted); }
.set-grid { padding: 8px 20px 4px; }
.set-grid .sr { display: grid; grid-template-columns: 40px 1fr 1fr 92px 46px 32px; gap: 10px; align-items: center; padding: 6px 0; }
.setdel { background: none; border: none; color: var(--muted-2); font-size: 16px; cursor: pointer; padding: 6px; border-radius: 8px; line-height: 1; }
.set-grid .sr .n { cursor: pointer; }
.set-grid .sr.warmup .n { color: var(--amber); font-weight: 800; }
.set-grid .sr.warmup input { opacity: .65; }
.ex-block .drag { cursor: grab; color: var(--muted); font-size: 18px; user-select: none; padding: 2px 2px; flex-shrink: 0; }
.ex-block .drag:active { cursor: grabbing; }
.ex-block.dragover { outline: 2px dashed var(--indigo); outline-offset: -2px; }
.setdel:hover { color: var(--red); background: var(--surface-2); }
.set-grid .sr.head { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding-bottom: 6px; }
.set-grid .sr .n { text-align: center; font-weight: 700; color: var(--muted); }
.set-grid input { width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px; font-size: 15px; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.set-grid input:focus { outline: none; border-color: var(--indigo); }
.set-grid input::-webkit-outer-spin-button, .set-grid input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.prev-hint { font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.6; }
.po-sug { display: inline-block; background: rgba(109,94,252,.14); color: var(--indigo); border: 1px solid rgba(109,94,252,.3); border-radius: 6px; padding: 1px 6px; font-size: 11px; cursor: pointer; margin-left: 3px; white-space: nowrap; }
.po-sug:hover { background: rgba(109,94,252,.28); }
/* Skeleton-Loader */
.skel { background: var(--surface-3); animation: skel-pulse 1.6s ease-in-out infinite; display: block; }
@keyframes skel-pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.chk { width: 40px; height: 40px; border-radius: 11px; border: 2px solid var(--border); background: var(--bg-2); display: flex; align-items: center; justify-content: center; font-size: 18px; color: transparent; transition: .12s; }
.chk.on { background: var(--green); border-color: var(--green); color: #06281d; }
.addset { background: none; border: none; color: var(--cyan); font-weight: 700; padding: 10px 20px 16px; font-size: 13px; }
.pr-flag { color: var(--amber); font-size: 12px; font-weight: 700; }

/* ========== Achievements ========== */
.ach { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.ach.locked { opacity: .4; filter: grayscale(.8); }
.ach .emj { font-size: 26px; }
.ach strong { display: block; font-size: 14px; }
.ach span { font-size: 12px; color: var(--muted); }

/* ========== Friends / leaderboard ========== */
.lb-row { display: grid; grid-template-columns: 36px 1fr repeat(3, 110px); gap: 12px; align-items: center; padding: 13px 16px; border-radius: 12px; }
.lb-row.head { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; padding: 6px 16px; }
.lb-row.me { background: linear-gradient(135deg, rgba(109,94,252,.14), rgba(34,211,238,.06)); border: 1px solid rgba(109,94,252,.3); }
.lb-row .rank { font-weight: 800; font-size: 16px; text-align: center; color: var(--muted); }
.lb-row .who { display: flex; align-items: center; gap: 11px; }
.lb-row .av { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.lb-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-val small { color: var(--muted); font-weight: 500; }

/* charts */
.chart { width: 100%; }
.bar-g rect { transition: .3s; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ========== Modal ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,7,12,.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; width: 520px; max-width: 100%; max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-h h3 { font-size: 18px; }
.modal-b { padding: 22px 24px; }
.modal-f { padding: 16px 24px 22px; display: flex; gap: 10px; }
.modal-f .btn { flex: 1; }

/* exercise picker */
.picker { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.picker .pi { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.picker .pi:last-child { border-bottom: none; }
.picker .pi:hover { background: var(--surface-2); }
.picker .pi.sel { background: rgba(109,94,252,.12); }
.picker .pi .cb { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-2); display: flex; align-items: center; justify-content: center; font-size: 13px; color: transparent; }
.picker .pi.sel .cb { background: var(--indigo); border-color: var(--indigo); color: #fff; }

.builder-ex { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 8px; }
.builder-ex .grow { flex: 1; }
.builder-ex strong { font-size: 14px; }
.builder-ex .mini { width: 60px; }
.builder-ex input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px; text-align: center; font-size: 14px; width: 100%; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--grad); color: #08111c; border: none; }

/* rest timer */
.rest { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(100px); z-index: 90;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); opacity: 0; transition: .3s; pointer-events: none; }
.rest.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.rest-l { color: var(--muted); font-size: 13px; font-weight: 600; }
.rest-t { font-size: 22px; font-weight: 800; color: var(--cyan); font-variant-numeric: tabular-nums; min-width: 64px; }
.rest-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 8px 12px; font-weight: 700; font-size: 13px; }

/* toast */
.toast { position: fixed; bottom: 26px; right: 26px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
  padding: 14px 20px; border-radius: 13px; font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(16px); transition: .3s; z-index: 120; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateY(0); }

/* progress bar */
.pbar { height: 8px; background: var(--bg-2); border-radius: 30px; overflow: hidden; }
.pbar > div { height: 100%; background: var(--grad); border-radius: 30px; transition: width .4s; }

/* small util */
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 10px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.center { text-align: center; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ====================================================================
   MOBILE — App-Look (Bottom-Nav, Vollbild, gestapelt)
   Desktop bleibt die Website-Ansicht mit Sidebar.
==================================================================== */
.mobile-bar { display: none; }
.mobile-nav { display: none; }

/* Workout-Start nur am Handy (App), nicht am PC (Website) */
@media (min-width: 761px) { .start-only { display: none !important; } }

/* Nur am Desktop sichtbar (z.B. „am Handy annehmen"-Hinweis) */
.desk-only { display: none; }
@media (min-width: 761px) { .desk-only { display: block; } }

/* Badge für offene Trainingsanfragen am Freunde-Menü */
.nav-badge { background: var(--red); color:#fff; font-size:10px; font-weight:800; min-width:18px; height:18px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; margin-left:auto; }
.mobile-nav button { position: relative; }
.mobile-nav .nav-badge { position:absolute; top:3px; left:52%; margin:0; }

/* Banner „Training läuft" wenn man wegnavigiert hat */
.train-banner { position: fixed; left: 24px; bottom: 24px; z-index: 85; background: var(--grad); color: #08111c;
  border-radius: 14px; padding: 11px 16px; display: none; align-items: center; gap: 13px; box-shadow: var(--shadow); cursor: pointer; }
.train-banner.show { display: flex; }
.train-banner .tb-info strong { display: block; font-size: 14px; font-weight: 800; }
.train-banner .tb-info span { font-size: 12px; opacity: .8; }
.train-banner .tb-time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 16px; }
.train-banner .tb-go { font-weight: 800; }
.tb-dot { width: 10px; height: 10px; border-radius: 50%; background: #08111c; animation: tbpulse 1.2s infinite; }
@keyframes tbpulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (max-width: 760px) { .train-banner { left: 12px; right: 12px; bottom: calc(82px + var(--sb)); } }

/* Partner-Pause-Anzeige (Gruppentraining) */
.prest { position: fixed; left: 50%; transform: translateX(-50%); bottom: 86px; z-index: 86;
  background: var(--amber); color: #1a1206; padding: 9px 15px; border-radius: 30px; font-size: 13px; font-weight: 700;
  display: none; gap: 14px; box-shadow: var(--shadow); }
.prest.show { display: flex; }
@media (max-width: 760px) { .prest { bottom: calc(150px + var(--sb)); left: 12px; right: 12px; transform: none; justify-content: center; } }

/* Konfetti bei neuem Rekord */
.confetti { position: fixed; top: -14px; width: 9px; height: 15px; border-radius: 2px; z-index: 200; pointer-events: none; animation: conffall 2s ease-in forwards; }
@keyframes conffall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(108vh) rotate(540deg); opacity: .15; } }

/* Toggle-Switch (Einstellungen) */
.switch { width: 48px; height: 28px; border-radius: 30px; background: var(--surface-3); border: 1px solid var(--border); position: relative; cursor: pointer; transition: .15s; flex-shrink: 0; }
.switch.on { background: var(--grad); border-color: transparent; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .15s; }
.switch.on::after { left: 23px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .grow strong { display: block; font-size: 15px; }
.set-row .grow span { font-size: 13px; color: var(--muted); }
.set-row .num-in { width: 76px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px; text-align: center; font-size: 15px; font-weight: 600; }
.set-row .ctrl { display: flex; align-items: center; gap: 8px; }

/* Mobile-Feinschliff */
@media (max-width: 760px) {
  /* Inhalt volle Breite (Grid-Spalte der Sidebar darf nicht reservieren) */
  .app { display: block !important; grid-template-columns: 1fr !important; width: 100%; }
  .main { width: 100% !important; }
  .content { width: 100% !important; }

  /* Einstellungs-Zeilen sauber stapeln statt quetschen */
  .set-row { flex-direction: column; align-items: stretch; gap: 11px; padding: 16px 0; }
  .set-row .grow span { margin-top: 3px; }
  .set-row .ctrl { width: 100%; }
  .set-row .num-in { flex: 1; width: auto; }
  .set-row .btn { width: 100%; }
  .set-row .switch { align-self: flex-start; }

  /* Stat-Kacheln: Label nicht mehr abschneiden */
  .stat { padding: 16px 14px; }
  .stat .v { font-size: 22px; }
  .stat .ic { margin-bottom: 8px; }
  .stat .l { font-size: 11px; overflow-wrap: anywhere; line-height: 1.3; }
}

@media (max-width: 760px) {
  :root { --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px); }
  body { overflow: auto; }
  /* Auth-Screen auf Handy */
  .auth { justify-content: flex-start; padding-top: max(40px, env(safe-area-inset-top)); }
  .auth-card { padding: 26px 22px; border-radius: 18px; width: 100%; max-width: 440px; }

  /* App-Grid -> einspaltig, Sidebar weg */
  .app { display: block; height: auto; min-height: 100vh; }
  .sidebar { display: none; }
  .main { height: auto; min-height: 100vh; overflow: visible; }

  /* App-Kopfzeile mit Logo + Logout */
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 40;
    padding: calc(12px + var(--st)) 18px 12px;
    background: rgba(11,13,20,.9); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .mobile-bar .side-brand span { font-size: 18px; }

  /* Topbar wird zur App-Section-Überschrift */
  .topbar { position: static; padding: 18px 18px 12px; border-bottom: none; flex-wrap: wrap; gap: 12px; }
  .topbar h2 { font-size: 22px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .topbar-actions .btn { flex: 1; min-width: 130px; }

  .content { padding: 4px 16px calc(96px + var(--sb)); overflow: visible; }

  /* Grids stapeln */
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }   /* Stat-Kacheln 2-spaltig */

  .stat .v { font-size: 24px; }
  .card.pad-lg { padding: 18px; }

  /* Plan-/Workout-Buttons griffiger */
  .plan-c .actions { flex-wrap: wrap; }
  .plan-c .actions .btn { flex: 1 1 auto; }

  /* Workout-Sätze: „Letztes Mal"-Spalte ausblenden */
  .wk-top { flex-wrap: wrap; gap: 8px; }
  .set-grid .sr { grid-template-columns: 28px 1fr 1fr 44px 30px; }
  .set-grid .sr > .prev-hint { display: none; }
  .set-grid .sr.head > :nth-child(4) { display: none; }

  /* Leaderboard kompakter: nur Rang, Name, Wochenvolumen */
  .lb-row { grid-template-columns: 28px 1fr 78px; gap: 8px; padding: 12px 10px; }
  .lb-row > :nth-child(4), .lb-row > :nth-child(5) { display: none; }

  /* Profil-Kopf stapeln */
  .card.pad-lg[style*="flex"] { flex-direction: column; align-items: flex-start !important; }

  /* Modal -> Bottom-Sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-f { padding-bottom: calc(22px + var(--sb)); }

  /* Bottom-Navigation wie native App */
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(15,17,25,.94); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border); padding-bottom: var(--sb);
  }
  .mobile-nav button {
    flex: 1; background: none; border: none; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 0 11px; font-size: 10.5px; font-weight: 600;
  }
  .mobile-nav button i { font-style: normal; font-size: 19px; }
  .mobile-nav button.active { color: var(--cyan); }

  /* Floating-Elemente über die Nav heben */
  .rest { bottom: calc(78px + var(--sb)); left: 14px; right: 14px; transform: translateY(120px); }
  .rest.show { transform: translateY(0); }
  .toast { bottom: calc(84px + var(--sb)); left: 16px; right: 16px; transform: translateY(16px); }
  .toast.show { transform: translateY(0); }
}
