@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #F6F5F1; --card: #FFFFFF; --line: #E5E3DC; --text: #1A1D1B; --muted: #5B605C;
  --accent: #0F766E; --accent-light: #B7D3CF; --empty: #ECEAE2; --warn: #9A3412;
  --tile: #FAF9F5; --pill: #E9E7DF; --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.wrap { max-width: 1000px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.head h1 { font-size: 24px; font-weight: 700; margin: 4px 0 0; letter-spacing: -0.01em; }
.date { margin: 2px 0 14px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: var(--warn); }

/* Tabs */
.tabs { display: flex; gap: 2px; background: var(--pill); border-radius: 999px; padding: 4px; margin-bottom: 16px; position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 5; }
.tabs button { flex: 1 1 0; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 14px Inter, system-ui, sans-serif; padding: 0 4px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(26,29,27,.08); }
.tabs button:focus-visible, .btn:focus-visible, .seg button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Karten */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: 1 / -1; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 .muted { font-weight: 400; font-size: 13px; }
.empty { color: var(--muted); margin: 4px 0; }

/* große Zahl */
.big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.big small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.rest { margin: 6px 0 0; color: var(--muted); }

/* Balken */
.bar { height: 6px; background: var(--empty); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.thick { height: 14px; margin-top: 12px; }
.bar.over > i { background: var(--warn); }
.macro { margin-top: 12px; }
.macro .row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.macro .row b { font-weight: 600; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 44px; }
.list li:first-child { border-top: 0; padding-top: 2px; }
.list .l { min-width: 0; }
.list .l .t { font-weight: 500; overflow-wrap: anywhere; }
.list .l .s, .list .r .s { font-size: 13px; color: var(--muted); }
.list .r { text-align: right; white-space: nowrap; }
.list .r .t { font-weight: 600; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.tile .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Umschalter */
.seg { display: inline-flex; background: var(--pill); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg button { min-height: 44px; min-width: 64px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 14px Inter, system-ui, sans-serif; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); font-weight: 700; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Diagramme */
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { font: 500 11px Inter, system-ui, sans-serif; fill: var(--muted); }
svg.chart .hit { fill: transparent; cursor: pointer; }
.cap { min-height: 20px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.legend .dash { display: inline-block; width: 16px; border-top: 2px dashed var(--muted); vertical-align: middle; margin-right: 4px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

/* Erholung */
.rec { margin-top: 12px; }
.rec:first-of-type { margin-top: 0; }
.rec .row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.rec .row .st { color: var(--muted); font-size: 13px; }
.bar.mid > i { background: var(--accent-light); }

/* Aktivitäts-Raster */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heat .h { text-align: center; font-size: 11px; color: var(--muted); }
.heat button { aspect-ratio: 1; min-height: 32px; border: 0; border-radius: 8px; background: var(--empty); padding: 0; cursor: pointer; font: 500 11px Inter, sans-serif; color: transparent; }
.heat button.l1 { background: var(--accent-light); }
.heat button.l2 { background: #5FA39B; }
.heat button.l3 { background: var(--accent); }
.heat button.today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.heat button.future { background: transparent; border: 1px dashed var(--line); cursor: default; }

.fam .bar { margin-top: 6px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--tile); border: 1px solid var(--line); color: var(--muted); }
.chip.ok { color: var(--accent); border-color: var(--accent-light); }
.chip.bad { color: var(--warn); border-color: #E8C9B9; }

.coach p { margin: 0 0 8px; }
.coach p:last-child { margin-bottom: 0; }

details { margin-top: 12px; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent); font-weight: 500; }
details p { font-size: 13px; color: var(--muted); margin: 6px 0; }

dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }

/* Anmelden */
.login { max-width: 480px; }
.login input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font: 400 16px Inter, system-ui, sans-serif; background: var(--tile); color: var(--text); margin: 8px 0 10px; }
.btn { min-height: 48px; width: 100%; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: 600 16px Inter, system-ui, sans-serif; cursor: pointer; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); margin-top: 12px; }
.btn[disabled] { opacity: .6; }

.skel { height: 120px; background: linear-gradient(90deg, #fff, var(--tile), #fff); border: 1px solid var(--line); border-radius: var(--r); }
