/* Gym your Life – Styleguide
   Nachtblau #0B1426 · Karten #121E33 / #1A2842 · Linien #2A3A57
   Türkis #2DD4BF · zart #0F3A47 · tief #0F766E · Bernstein #F5B83D · Koralle #FF7A6B
   Text #F1F5F5 · gedämpft #9DAAC4 */
:root {
  --bg: #0B1426; --card: #121E33; --card2: #1A2842; --line: #2A3A57;
  --teal: #2DD4BF; --teal-soft: #0F3A47; --teal-deep: #0F766E; --amber: #F5B83D; --amber-soft: #2A2312; --coral: #FF7A6B;
  --text: #F1F5F5; --muted: #9DAAC4; --muted2: #C9D3E3;
  --head: 'Barlow Condensed', 'Arial Narrow', sans-serif; --body: Inter, system-ui, -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); }
body { overscroll-behavior-y: none; }
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
input, textarea { outline: none; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; position: relative; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: calc(20px + var(--safe-top)) 16px 24px; }
.screen.with-nav { padding-bottom: calc(100px + var(--safe-bottom)); }
.screen.with-bar { padding-bottom: calc(96px + var(--safe-bottom)); }

/* Kopfbereich */
.hdr { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.hdr-logo { width: 120px; height: auto; display: block; }
.hdr-right { display: flex; align-items: center; gap: 10px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.clock-t { display: flex; align-items: baseline; gap: 1px; font-family: var(--head); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-hm { font-size: 34px; color: var(--teal); }
.clock-s { font-size: 20px; color: var(--muted); }
.clock-d { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; background: var(--card2); border: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text); text-decoration: none; }
.icon-btn.on { background: var(--teal); color: var(--bg); }
.icon-btn.plain { background: transparent; }

/* Typo */
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.h1 { margin: 0; font-family: var(--head); font-weight: 700; font-size: 40px; line-height: 1.05; text-transform: uppercase; }
.h2 { margin: 0; font-family: var(--head); font-weight: 700; font-size: 24px; text-transform: uppercase; letter-spacing: .5px; }
.h3 { font-family: var(--head); font-weight: 600; font-size: 21px; line-height: 1.1; }
.label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.small { font-size: 13px; color: var(--muted); line-height: 1.5; }
.tiny { font-size: 12px; color: var(--muted); line-height: 1.5; }
.num { font-family: var(--head); font-weight: 700; }
.title-block { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teal { color: var(--teal); } .amber { color: var(--amber); } .coral { color: var(--coral); } .muted { color: var(--muted); }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.sm { border-radius: 16px; padding: 12px 14px; }
.card.accent { border-color: var(--teal); }
.card.active { border: 2px solid var(--teal); }
.card.amber { background: var(--amber-soft); border-color: var(--amber); }
.card.soft { background: var(--teal-soft); border-color: var(--teal); }
.inset { background: var(--bg); border-radius: 14px; }
.list { display: flex; flex-direction: column; gap: 10px; }

/* Buttons */
.btn { height: 56px; border: none; border-radius: 999px; background: var(--teal); color: var(--bg); font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; padding: 0 20px; width: 100%; }
.btn.outline { background: transparent; border: 2px solid var(--teal); color: var(--teal); }
.btn.sec { background: var(--card2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.danger { background: var(--coral); color: var(--bg); }
.btn.danger-ghost { background: transparent; color: var(--coral); }
.btn.md { height: 48px; font-size: 15px; }
.btn.sm { height: 44px; font-size: 14px; width: auto; padding: 0 14px; }
.btn.dashed { background: transparent; border: 1px dashed var(--teal); color: var(--teal); border-radius: 16px; height: 60px; font-size: 16px; }
.btn[disabled] { background: var(--line); color: var(--muted); }
.pill { height: 44px; padding: 0 14px; border: none; border-radius: 999px; background: var(--card2); color: var(--teal); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; flex-shrink: 0; }
.pill.white { color: var(--text); }
.pill.outline { border: 1px solid var(--teal); }
.play { width: 48px; height: 48px; border-radius: 999px; border: 2px solid var(--teal); background: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--teal); text-decoration: none; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.chip .cnt { color: var(--muted); margin-left: 4px; }
.chip.on .cnt { color: var(--teal); opacity: .7; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.seg button { height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; flex-direction: column; line-height: 1.1; }
.seg button.on { background: var(--teal); color: var(--bg); }
.seg.tall button { height: 52px; font-size: 13px; }
.seg button small { font-size: 10px; font-weight: 500; opacity: .85; }

/* Eingaben */
.field { display: flex; flex-direction: column; gap: 6px; }
.input { height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 16px; width: 100%; }
.input.big { font-family: var(--head); font-weight: 600; font-size: 22px; }
textarea.input { height: auto; padding: 10px 14px; line-height: 1.4; resize: none; }
.stepper { display: flex; align-items: center; justify-content: space-between; height: 48px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.stepper button { width: 40px; height: 46px; border: none; background: transparent; font-size: 22px; color: var(--text); }
.stepper button.plus { color: var(--teal); }
.stepper .v { font-family: var(--head); font-weight: 700; font-size: 22px; text-align: center; }
.stepper.lg { height: 56px; } .stepper.lg .v { font-size: 30px; } .stepper.lg button { width: 48px; height: 54px; font-size: 24px; }

/* Schalter */
.switch-row { min-height: 60px; border: none; background: transparent; text-align: left; padding: 8px 4px; display: flex; align-items: center; gap: 12px; width: 100%; color: var(--text); }
.switch-row .t { font-size: 14px; font-weight: 600; display: block; }
.switch-row .h { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.sw { width: 48px; height: 28px; border-radius: 999px; background: var(--line); padding: 3px; display: flex; justify-content: flex-start; flex-shrink: 0; transition: background .15s; }
.sw::after { content: ''; width: 22px; height: 22px; border-radius: 999px; background: var(--muted); }
.sw.on { background: var(--teal); justify-content: flex-end; }
.sw.on::after { background: var(--bg); }
.divide > * + * { border-top: 1px solid var(--line); }

/* Leiste unten */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); padding: 8px 8px calc(12px + var(--safe-bottom)); }
.nav-in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.nav a { height: 60px; border-radius: 14px; color: var(--muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; }
.nav a.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 16px calc(16px + var(--safe-bottom)); }
.bottom-bar > * { max-width: 448px; margin: 0 auto; }

/* Startseite */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { height: 76px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.day.today { border: 2px solid var(--teal); }
.day.train { background: var(--teal); color: var(--bg); border-color: var(--teal); }
.day .wd { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.day .dn { font-family: var(--head); font-weight: 700; font-size: 26px; line-height: 1; color: var(--text); }
.day.train .dn { color: var(--bg); }
.day .tag { width: 100%; padding: 0 1px; text-align: center; white-space: nowrap; font-family: var(--head); font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: -.2px; text-transform: uppercase; min-height: 10px; overflow: visible; }
.week { gap: 3px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 30px; line-height: 1; }
.stat span:last-child { font-size: 12px; color: var(--muted); }
.plan-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 12px; display: flex; align-items: center; gap: 10px; }
.ico-box { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.link-area { flex: 1; min-width: 0; min-height: 44px; color: var(--text); text-decoration: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; background: none; border: none; text-align: left; padding: 0; }

/* Bottom-Sheet */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 20, .72); display: flex; flex-direction: column; justify-content: flex-end; }
.sheet { max-width: 480px; width: 100%; margin: 0 auto; max-height: 92vh; background: var(--card); border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 12px 16px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; animation: pop .25s ease-out both; }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); align-self: center; flex-shrink: 0; }
.sheet .scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.fullscreen { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; }
.fullscreen > .in { max-width: 480px; width: 100%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 16px; padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); }

/* Ringe & Timer */
.ring { border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring > div { border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.segbar { display: flex; gap: 4px; }
.segbar div { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.segbar .cur { background: var(--teal); } .segbar .done { background: var(--teal-deep); }

/* Training */
.set-head, .set-row { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 48px; gap: 8px; align-items: center; padding: 0 8px; }
.set-head { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.set-row { height: 60px; border-radius: 14px; border: 1px dashed var(--line); }
.set-row .n { font-family: var(--head); font-weight: 700; font-size: 22px; color: var(--muted); }
.set-row .v { font-family: var(--head); font-weight: 600; font-size: 26px; color: var(--muted); }
.set-row .l { font-size: 13px; color: var(--muted); }
.set-row.active { background: var(--card2); border: 2px solid var(--teal); }
.set-row.active .n, .set-row.active .v { color: var(--text); font-weight: 700; }
.set-row.done { background: var(--teal-soft); border: 1px solid var(--teal-soft); animation: pop .3s ease-out both; }
.set-row.done .n { color: var(--teal); } .set-row.done .v { color: var(--text); font-weight: 700; }
.set-row.rec { border: 2px solid var(--amber); } .set-row.rec .kg { color: var(--amber); }
.check { width: 44px; height: 44px; border-radius: 999px; border: 2px solid var(--teal); background: transparent; display: flex; align-items: center; justify-content: center; color: transparent; }
.check.on { background: var(--teal); border-color: var(--teal); color: var(--bg); }
.check.off { border-color: var(--line); }

/* Muskel-Figuren */
.fig g * { stroke: var(--card); stroke-width: 1.2; }

/* Diverses */
.badge { height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }
.tagp { height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--teal); color: var(--teal); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.empty { padding: 20px 12px; text-align: center; font-size: 14px; color: var(--muted); line-height: 1.5; }
.bar { height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; } .bar > div { height: 6px; border-radius: 3px; background: var(--teal); }
.toast { position: fixed; left: 50%; bottom: calc(120px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); z-index: 60; background: var(--teal); color: var(--bg); font-weight: 600; font-size: 14px; padding: 12px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pop { animation: pop .3s ease-out both; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* Start / Splash */
.splash { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; }
.splash-in { width: 100%; max-width: 480px; flex: 1; display: flex; flex-direction: column; align-items: center; padding: calc(24px + var(--safe-top)) 24px calc(40px + var(--safe-bottom)); }
.quote { position: fixed; inset: 0; z-index: 55; width: 100%; border: none; background: var(--bg); color: var(--text); padding: 0 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.quote p { margin: 0; max-width: 420px; font-family: var(--head); font-weight: 700; font-size: 38px; line-height: 1.1; text-align: center; text-transform: uppercase; animation: fadeUp .6s ease-out .25s both; }
.quote .barwrap { position: absolute; left: 36px; right: 36px; bottom: calc(64px + var(--safe-bottom)); height: 3px; border-radius: 2px; background: var(--card2); overflow: hidden; }
.quote .barwrap div { height: 3px; background: var(--teal); animation: grow linear both; }
@keyframes grow { from { width: 0; } to { width: 100%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.gym { font-family: var(--head); font-weight: 700; font-size: 112px; line-height: .9; letter-spacing: 2px; margin-top: 16px; animation: gymIn 1.1s ease-out .35s both; }
@keyframes gymIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.yl { display: flex; align-items: center; gap: 14px; }
.yl .line { width: 28px; height: 3px; border-radius: 2px; background: var(--teal); animation: lineIn .4s ease-out 2.4s both; }
.yl .word { display: flex; white-space: pre; font-family: var(--head); font-weight: 600; font-size: 30px; letter-spacing: 6px; color: var(--teal); }
.yl .word span { display: inline-block; animation: fly .7s cubic-bezier(.2,.9,.3,1.15) both; }
@keyframes fly { 0% { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(1.6); } 70% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes lineIn { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
.draw { stroke-dasharray: 1200; animation: draw 1.1s ease-out both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
