/* Farben und Maße aus dem App-Prototyp (fitness-plattform/app/design/app-prototyp.md, Abschnitt 1) */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --text: #14171C;
  --text2: #3D4450;
  --muted: #5A6170;
  --line: #E1E4EA;
  --line2: #D3D8DF;
  --accent: #2457D6;
  --accent-soft: #F2F5FD;
  --pause: #C2410C;
  --done: #1E7B4A;
  --danger: #B42318;
  --r-btn: 14px;
  --r-card: 18px;
  --tabh: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
main { max-width: 560px; margin: 0 auto; padding: env(safe-area-inset-top) 0 24px; }
main.with-tabs { padding-bottom: calc(var(--tabh) + 24px + env(safe-area-inset-bottom)); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack h3 { margin-top: 8px; }

/* Kopfzeile */
.top { display: flex; align-items: center; gap: 8px; padding: 16px 16px 12px; min-height: 64px; }
.top h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .right { display: flex; gap: 8px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; margin: 0 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.pad .card, .stack .card { margin: 0; }
.card.accent { border-color: var(--accent); background: var(--accent-soft); }
.card.center { align-items: stretch; text-align: center; }
.card.empty p { color: var(--text2); }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.eyebrow.pause { color: var(--pause); }
.mini-list { margin: 0; padding-left: 20px; color: var(--text2); font-size: 14px; }

/* Buttons */
.btn { min-height: 48px; padding: 0 16px; border-radius: var(--r-btn); border: 1px solid var(--line2); background: var(--surface); font-weight: 600; cursor: pointer; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.success { background: var(--done); border-color: var(--done); color: #fff; }
.btn.danger { color: var(--danger); border-color: #F1C9C5; background: #fff; }
.btn.ghost { background: var(--surface); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 8px 4px; cursor: pointer; min-height: 44px; }
.iconbtn { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; font-size: 20px; }
.iconbtn.sm { width: 36px; height: 36px; }
.iconbtn:disabled { opacity: .35; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }

/* Listen */
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; }
.row { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer; min-height: 56px; }
.sheet .row, .pad .row { width: 100%; margin: 0 0 8px; }
.row.sel { border-color: var(--accent); background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main strong { font-weight: 600; }
.chev { color: var(--muted); font-size: 22px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 6px; vertical-align: 0; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.12); }
.group-title { padding: 12px 16px 6px; font-size: 13px; font-weight: 700; color: var(--text2); display: flex; align-items: center; }
.sheet .group-title { padding: 12px 0 6px; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.thumb.ph { background: var(--bg); border: 1px dashed var(--line2); }
.sum-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sum-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-list li:last-child { border-bottom: 0; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; white-space: pre-wrap; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text2); font-weight: 500; }
.field input, .field select, .field textarea, .search { font-size: 16px; color: var(--text); padding: 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--surface); min-height: 48px; width: 100%; }
.field.small input, .field.small select { padding: 8px 10px; min-height: 40px; }
input.plain { border: 0; background: transparent; font-weight: 600; font-size: 16px; padding: 2px 0; width: 100%; border-bottom: 1px dashed transparent; }
input.plain:focus { outline: none; border-bottom-color: var(--accent); }
.toggle, .check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 56px; }
.check { justify-content: flex-start; margin-bottom: 8px; }
.toggle span, .check span { display: flex; flex-direction: column; }
.toggle input, .check input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }

/* Plan-Editor */
.plan-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 0 16px 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.plan-item-head { display: flex; align-items: flex-start; gap: 10px; }
.nr { width: 26px; height: 26px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-top: 2px; }
.item-tools { display: flex; gap: 4px; }
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fields .field:nth-child(4) { grid-column: 1 / -1; }

/* Tab-Leiste */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabh) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 10; }
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.tab.on { color: var(--accent); }

/* Workout */
.workout { display: flex; flex-direction: column; gap: 0; }
.wtop { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.wclock { display: flex; flex-direction: column; align-items: center; }
.wclock small { font-size: 12px; color: var(--muted); font-weight: 500; }
.wclock span { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progressline { display: flex; justify-content: space-between; padding: 4px 16px; font-size: 13px; color: var(--text2); font-weight: 600; }
.segs { display: flex; gap: 4px; padding: 4px 16px 12px; }
.seg { flex: 1; height: 6px; border-radius: 3px; background: var(--line2); }
.seg.cur { background: var(--accent); }
.seg.done { background: var(--done); }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; text-align: left; }
.pressable { cursor: pointer; text-decoration: underline dotted var(--line2); text-underline-offset: 4px; }
.tag { background: #FFF1E8; color: var(--pause); border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 700; }
.last { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 14px; color: var(--text2); text-align: left; }
.setline { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.setdots { display: flex; gap: 6px; }
.setdot { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.setdot.cur { background: var(--accent); }
.setdot.done { background: var(--done); }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.stepper .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.ctl { display: flex; align-items: center; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.stepbtn { width: 44px; height: 56px; border: 0; background: var(--bg); font-size: 24px; font-weight: 600; cursor: pointer; flex: 0 0 auto; }
.stepbtn:active { background: var(--line); }
.bigval { width: 100%; min-width: 0; border: 0; text-align: center; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0; height: 56px; background: transparent; }
.bigval:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #E8F4EE; color: var(--done); border-radius: 8px; padding: 4px 8px; font-size: 13px; font-weight: 600; }
.ring { position: relative; width: 200px; height: 200px; margin: 4px auto; }
.ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #FBE5D9; stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--pause); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-txt span { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pause); }
.ring-txt small { color: var(--muted); }
.bigclock { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav { padding: 0 16px 8px; }
.nav .btn { min-height: 48px; padding: 0 6px; font-size: 14px; }

/* Zusammenfassung / Statistik */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats3.card { padding: 12px; }
.stats3 b { display: block; font-size: 20px; }
.stats3 small { color: var(--muted); font-size: 12px; }
.effort { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.effort button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface); font-weight: 700; cursor: pointer; }
.effort button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays span { text-align: center; font-size: 12px; font-weight: 600; padding: 6px 0; border-radius: 8px; background: var(--bg); color: var(--muted); }
.weekdays span.on { background: var(--done); color: #fff; }
.seg-ctl { display: grid; grid-template-columns: 1fr 1fr; background: var(--line); border-radius: 12px; padding: 3px; }
.seg-ctl button { border: 0; background: transparent; min-height: 40px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg-ctl button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chart { width: 100%; height: auto; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 3; }
.chart .axis { font-size: 11px; fill: var(--muted); }

/* Studio-Karte */
.mapwrap { margin: 0 16px; overflow: auto; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); max-height: 62vh; }
.map { position: relative; min-width: 100%; }
.map img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.map.placing { cursor: crosshair; outline: 3px solid var(--accent); outline-offset: -3px; }
.pin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 11px; border: 2.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); padding: 0; cursor: pointer; }
.pin.big { width: 26px; height: 26px; margin: -13px 0 0 -13px; left: 50%; top: 50%; border-width: 3px; }
.zoom { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 16px 0; }
.banner { margin: 0 16px 8px; padding: 10px 12px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; font-size: 14px; }
.minimap { position: relative; height: 130px; overflow: hidden; border-radius: 12px; background: var(--bg); }
.minimap img { position: absolute; max-width: none; }
.minimap-card { text-align: left; }
.photo { min-height: 160px; border-radius: var(--r-card); background: var(--surface); border: 1px dashed var(--line2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.gallery { display: flex; gap: 8px; overflow-x: auto; }
.gallery img { height: 180px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }

/* Sheets */
.backdrop { position: fixed; inset: 0; background: rgba(20,23,28,.45); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); z-index: 21; display: flex; flex-direction: column; gap: 10px; }
.sheet h2 { margin-bottom: 4px; }
.sheet .scroll { max-height: 46vh; overflow-y: auto; }
.custom { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.custom summary { font-weight: 600; cursor: pointer; min-height: 28px; }
.custom[open] { display: flex; flex-direction: column; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); }
.warnbox { background: #FFF6E5; color: #7A4B00; border-radius: 10px; padding: 8px 10px; }
.tag.ok { background: #E8F4EE; color: var(--done); }
.datein { border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; min-height: 40px; background: var(--surface); font-size: 14px; }
