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

:root {
  --bg: #f3f2ef;
  --flaeche: #ffffff;
  --ink: #16181d;
  --leise: #5d6470;
  --punkt: #a3a7ae;
  --linie: #d6d3cc;
  --akzent: #c2410c;
  --gut: #2f6fdb;
  --zahl: "Barlow Condensed", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --flaeche: #1b1e23;
    --ink: #eceef1;
    --leise: #9aa1ab;
    --punkt: #5c636d;
    --linie: #2d3138;
    --akzent: #ff8a47;
    --gut: #6aa5f5;
  }
}

/* Page changes cross-fade instead of flashing white (Chrome, Safari; others just navigate). */
@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0 auto; max-width: 560px; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 14px/1.4 Barlow, sans-serif; }
main { flex: 1; padding: 22px 20px 32px; display: flex; flex-direction: column; gap: 20px; }
a { color: inherit; text-decoration: none; }
h2 { font-size: 14px; margin: 0 0 8px; }
section { display: flex; flex-direction: column; gap: 8px; }

nav { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-bottom: 1px solid var(--linie); text-align: center; }
nav a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 0; color: var(--leise); }
.icon { width: 18px; height: 18px; flex: none; }
nav a[aria-current] { color: var(--ink); font-weight: 600; }

.warnung { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 20px; background: var(--flaeche); border-bottom: 1px solid var(--linie); color: var(--akzent); font-size: 13px; }
.leise { color: var(--leise); font-size: 13px; }
.hoch { color: var(--akzent); }
.gut { color: var(--gut); }
.zahl { font-family: var(--zahl); font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }

.gross { font-family: var(--zahl); font-weight: 700; font-size: 56px; line-height: 0.9; margin: 0; }
.gross span { font-size: 22px; color: var(--leise); font-weight: 500; }
.gross.mittel { font-size: 46px; }
.kopf .leise { margin-top: 6px; }

/* Tage */
.log { display: flex; flex-direction: column; }
.zeile { scroll-margin-top: 220px; display: grid; grid-template-columns: 56px 62px 66px 62px 1fr; column-gap: 8px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--linie); font-family: var(--zahl); font-size: 19px; }
.zeile > span:not(.tag) { text-align: right; }
.training { display: flex; justify-content: flex-end; gap: 4px; align-self: center; }
.training .icon { display: block; }
.wochen .training { justify-content: flex-start; }
.zeile .tag { font-family: Barlow, sans-serif; font-size: 14px; }
.zeile.titel { font-family: Barlow, sans-serif; font-size: 12px; color: var(--leise); border-bottom-color: var(--ink); padding: 0 0 6px; }
.blass { opacity: 0.5; }
.woche { padding: 18px 0 6px; border-bottom: 2px solid var(--ink); font-size: 13px; }
.woche b { color: var(--ink); }
.gewaehlt { background: var(--flaeche); margin: 8px -20px; padding: 0 20px 16px; border-bottom: 1px solid var(--linie); }
.gewaehlt .zeile { border-bottom: 0; }
.gewaehlt .tag { font-weight: 600; }
.balken { display: grid; grid-template-columns: 92px 1fr 74px; column-gap: 10px; row-gap: 8px; align-items: center; font-size: 13px; margin-top: 4px; }
.balken .zahl { font-size: 16px; }
.spur { display: flex; height: 6px; background: var(--linie); }
.spur span { display: block; height: 6px; background: var(--ink); }
.spur .ueber { background: var(--akzent); }
.einheiten { display: grid; grid-template-columns: 44px 1fr 60px; column-gap: 8px; row-gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linie); font-size: 13px; }
.einheiten .zahl { font-family: Barlow, sans-serif; font-size: 13px; }

/* Energie */
.urteil b { font-size: 16px; }
.rechnung { border-top: 1px solid var(--ink); }
.rechnung > div { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; }
.rechnung .summe, .rechnung .strich { font-weight: 600; border-top: 1px solid var(--linie); padding-top: 9px; }
.rechnung .strich { font-weight: 400; }
.rechnung .ziel { font-weight: 700; border-top: 1px solid var(--ink); padding: 9px 0; }
.wochen { display: grid; grid-template-columns: 44px 1fr 80px 70px; column-gap: 8px; row-gap: 8px; align-items: baseline; border-top: 1px solid var(--ink); padding-top: 10px; }
.wochen .titel { font-size: 12px; color: var(--leise); font-family: Barlow, sans-serif; }

/* Körper */
.zeitraum { display: flex; justify-content: flex-end; gap: 12px; margin: 0; font-size: 13px; color: var(--leise); }
.zeitraum a[aria-current] { color: var(--ink); font-weight: 600; text-decoration: underline; }
.verlauf .kopfzeile { display: flex; justify-content: space-between; align-items: flex-end; }
.verlauf svg { width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.verlauf text { font-size: 10px; fill: var(--leise); }
.verlauf .gitter { stroke: var(--linie); }
.verlauf .punkte { fill: var(--punkt); }
.verlauf .trend { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ziele { border-top: 1px solid var(--ink); padding-top: 12px; }
.raster { display: grid; grid-template-columns: 1fr auto auto; column-gap: 12px; row-gap: 6px; margin-top: 8px; align-items: baseline; }
.raster.sync { grid-template-columns: 56px 86px 1fr; font-size: 13px; }

/* Formulare */
.formular { display: grid; gap: 10px; }
.formular.zeilig { grid-template-columns: 1fr 90px auto; align-items: end; }
label { display: grid; gap: 2px; font-size: 13px; color: var(--leise); }
input, button { font: inherit; color: var(--ink); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 4px; padding: 8px 10px; min-height: 44px; }
button { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); border: 0; cursor: pointer; justify-self: start; }
button.leise { background: none; color: var(--leise); border: 1px solid var(--linie); }
.plaene { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.plaene a { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.plaene a span { text-decoration: underline; }
.plaene .icon { color: var(--leise); }
