/* Design aus mockup/index.html übernommen. Bewusst nur helles Theme. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500 800; font-display: swap; src: url(../fonts/archivo-latin.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-latin.woff2) format("woff2"); }
:root {
  color-scheme: light;
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --ink: #111827;
  --muted: #5E6A7D;
  --line: #E1E6EE;
  --accent: #2346DB;
  --accent-soft: #E7ECFF;
  --good: #11885A;
  --good-soft: #E2F5EC;
  --warn: #B86E00;
  --warn-soft: #FDF1DC;
  --bad: #C93A3A;
  --bad-soft: #FBE6E6;
  --run: #0E8F8A;
  --run-soft: #DDF3F2;
  --rest: #E6EAF1;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { max-width: 440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px calc(96px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.1; margin: 2px 0 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 2px rgba(17,24,39,.04); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section-title small { color: var(--muted); font-size: 13px; }

/* Heute */
.today { background: var(--accent); color: #fff; }
.today .eyebrow { color: rgba(255,255,255,.75); }
.today h2 { font-size: 24px; font-weight: 800; }
.today p { margin: 0; color: rgba(255,255,255,.85); font-size: 14px; }
.btn { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-white { background: #fff; color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--rest); color: var(--ink); }
.btn-block { width: 100%; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi.wide { grid-column: 1 / -1; }
.kpi .label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi .big { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .big small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; width: fit-content; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.dot { width: 100%; aspect-ratio: 1; max-width: 100%; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.dot.kraft { background: var(--accent); color: #fff; }
.dot.lauf { background: var(--run); color: #fff; }
.dot.miss { background: var(--bad-soft); color: var(--bad); }
.dot.rest { background: var(--rest); color: var(--muted); }
.dot.plan { background: var(--surface); border: 2px dashed var(--line); color: var(--muted); }
.dot.today { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); }

.lifts { display: flex; flex-direction: column; gap: 8px; }
.lift { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; }
.lift .v { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.trend { font-weight: 800; width: 26px; text-align: center; border-radius: 8px; padding: 2px 0; }
.trend.up { background: var(--good-soft); color: var(--good); }
.trend.flat { background: var(--rest); color: var(--muted); }
.trend.down { background: var(--bad-soft); color: var(--bad); }

.card.reminder { flex-direction: row; }
.reminder { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.reminder p { margin: 0; font-size: 14px; }
.reminder p b { display: block; }
.linkbtn { border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }

/* Training */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.steps { display: flex; gap: 4px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--accent); }
.steps span.cur { background: var(--ink); }
.ex-block { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ex-name { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; margin: 0; }
.ex-target { font-size: 14px; color: var(--muted); }
.last { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.last .num { font-weight: 700; }
.suggest { border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.suggest.up { background: var(--good-soft); color: #0B5E3E; }
.suggest.hold { background: var(--accent-soft); color: #1B3399; }
.suggest b { display: block; font-size: 15px; }
.suggest .ic { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; }

.sets { display: flex; flex-direction: column; gap: 8px; }
.sethead, .set { display: grid; grid-template-columns: 26px minmax(0,1fr) minmax(0,1.25fr) 46px 48px; gap: 8px; align-items: center; }
.sethead { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.set { background: var(--bg); border-radius: 12px; padding: 6px; }
.set.done { background: var(--good-soft); }
.set .n { text-align: center; font-weight: 700; color: var(--muted); }
.set input { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 6px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: transparent; height: 40px; font-size: 18px; font-weight: 700; color: var(--accent); }
.stepper span { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.rir { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; height: 42px; font-size: 14px; font-weight: 600; color: var(--muted); }
.check { border: 0; height: 42px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); font-size: 18px; font-weight: 800; color: var(--muted); }
.set.done .check { background: var(--good); border-color: var(--good); color: #fff; }
.set.simple { grid-template-columns: 26px 1fr 48px; }
.nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; }

.timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom, 0px)); width: min(408px, calc(100% - 32px)); background: var(--ink); color: #fff; border-radius: 18px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(17,24,39,.25); z-index: 20; }
.timer .t { font-family: var(--font-display); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.timer .lbl { font-size: 12px; color: rgba(255,255,255,.7); flex: 1; line-height: 1.3; }
.timer button { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 13px; }
.timer .bar { position: absolute; left: 16px; right: 16px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.15); overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; font-family: var(--font-display); font-weight: 700; font-size: 20px; width: 100%; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc { display: flex; justify-content: space-between; align-items: baseline; background: var(--bg); border-radius: 12px; padding: 12px; }
.calc .num { font-size: 24px; font-weight: 800; }

.bigstep { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; align-items: center; }
.bigstep button { height: 56px; border-radius: 14px; border: 0; background: var(--accent-soft); color: var(--accent); font-size: 24px; font-weight: 800; }
.bigstep .val { text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 40px; font-variant-numeric: tabular-nums; }
.bigstep .val small { font-size: 16px; color: var(--muted); font-weight: 600; }
.mini-list { display: flex; flex-direction: column; }
.mini-list div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-list div:last-child { border-bottom: 0; }
.mini-list .num { font-weight: 700; }

/* Fortschritt */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--rest); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(17,24,39,.1); }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.legend i.line { height: 3px; border-radius: 2px; vertical-align: 3px; }
.cal { display: grid; grid-template-columns: 22px repeat(7, 1fr); gap: 4px; font-size: 10px; color: var(--muted); }
.cal .c { aspect-ratio: 1; border-radius: 5px; }
.cal .wk { display: grid; place-items: center; }
.cal .h { text-align: center; }
.c.kraft { background: var(--accent); } .c.lauf { background: var(--run); } .c.miss { background: #F0A9A9; } .c.rest { background: var(--rest); } .c.plan { background: var(--surface); border: 1.5px dashed #C9D1DD; } .c.today { background: var(--accent-soft); border: 2px solid var(--accent); } .c.none { background: transparent; }
.body-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.body-wrap figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.body-wrap svg { width: 100%; max-width: 170px; height: auto; }
.prs { display: flex; flex-direction: column; gap: 8px; }
.pr { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; }
.pr .num { font-weight: 700; }

.howhead { display: flex; justify-content: space-between; align-items: center; }
.toggle { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 13px; padding: 4px 0; }
.howto { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--bg); border-radius: 14px; padding: 10px; }
.howto svg { width: 100%; height: auto; display: block; }
.howto ul { margin: 0; padding-left: 16px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.howto .mus { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pill.neutral { background: var(--rest); color: var(--muted); }
.restinfo { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding: 0 6px 2px; }
.restinfo b.ok { color: var(--good); }
.restinfo b.over { color: var(--warn); }
.timer.over { background: var(--warn); }
.mdetail { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.mdetail b { display: block; color: var(--ink); font-size: 15px; }
.body-wrap path { cursor: pointer; }
.rests { display: flex; flex-direction: column; }
.rests div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.rests div:last-child { border-bottom: 0; }
.rests .num { font-weight: 700; }
.rests small { color: var(--muted); font-size: 12px; }

/* Tabbar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); z-index: 30; }
.tabbar div { max-width: 440px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-selected="true"] { color: var(--accent); }

.sheet-bg { position: fixed; inset: 0; background: rgba(17,24,39,.35); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 440px; border-radius: 22px 22px 0 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sumgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sumgrid div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; }
.sumgrid .num { display: block; font-size: 22px; font-weight: 800; }
.sumgrid span { font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 50; }
@media (prefers-reduced-motion: no-preference) {
  .card, .kpi { animation: none; }
  .set.done { transition: background .2s; }
}

/* Ergänzungen gegenüber dem Mockup */
body { margin: 0; min-height: 100vh; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #fff; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo img + img { animation: swap 2.8s steps(1, end) infinite; }
@keyframes swap { 0% { opacity: 0; } 50% { opacity: 1; } }
.photo .tag { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; background: rgba(17,24,39,.7); color: #fff; border-radius: 6px; padding: 1px 6px; }
@media (prefers-reduced-motion: reduce) { .photo img + img { animation: none; opacity: 0; } }
.empty { color: var(--muted); font-size: 14px; }
.btn[disabled] { opacity: .4; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; }
.rowbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.offline { font-size: 12px; color: var(--muted); text-align: center; }
/* Solange der Timer sichtbar ist, darf er keine Bedienelemente am Seitenende verdecken. */
body.has-timer .app { padding-bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
