:root {
  --bg: #f6f4ef; --karte: #ffffff; --tinte: #1c1f1e; --leise: #66706c; --linie: #e3dfd6;
  --akzent: #1f6f5c; --akzent-hell: #dcefe9; --akzent-text: #ffffff;
  --warn: #9a5b00; --warn-hell: #fbeed3; --fehler: #a8322a;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111413; --karte: #1a1e1d; --tinte: #eef1ef; --leise: #9aa5a0; --linie: #2a302e;
    --akzent: #5cc2a7; --akzent-hell: #1d3832; --akzent-text: #0c1513;
    --warn: #e5b663; --warn-hell: #33290f; --fehler: #f08a80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--tinte);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
h1 { font-size: 26px; line-height: 1.15; margin: 2px 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--leise); margin: 26px 2px 10px; font-weight: 650; }
h3 { font-size: 17px; margin: 0; }
p { margin: 0 0 10px; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }
.laden { padding: 40px 0; text-align: center; }
.zahl { font-variant-numeric: tabular-nums; }

/* Kopf der Woche */
.kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ueber { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--akzent); font-weight: 700; }
.blaettern { display: flex; gap: 6px; }
.rund { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie); background: var(--karte); color: var(--tinte); font-size: 20px; line-height: 1; cursor: pointer; }
.rund:disabled { opacity: 0.35; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.chip.neutral { background: transparent; border: 1px solid var(--linie); color: var(--leise); font-weight: 500; }
.chip.warn { background: var(--warn-hell); color: var(--warn); }

/* Karten */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px; margin: 0 0 10px; }
.hinweis { background: var(--warn-hell); border-color: transparent; color: var(--tinte); }
.hinweis strong { color: var(--warn); }
.info { background: var(--akzent-hell); border-color: transparent; }

/* Fortschritt der Woche */
.stand { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 4px; }
.stand .karte { margin: 0; padding: 12px; }
.stand .wert { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.balken { display: flex; gap: 4px; margin-top: 8px; }
.balken i { flex: 1; height: 6px; border-radius: 3px; background: var(--linie); }
.balken i.an { background: var(--akzent); }
.linkknopf { background: none; border: 0; padding: 6px 0 0; color: var(--akzent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }

/* Einheit */
.einheit { padding: 0; overflow: hidden; }
.einheit.erledigt { border-color: var(--akzent); }
.einheit.pausiert { opacity: 0.55; }
.einheit-kopf { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; }
.haken { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--linie); background: transparent; color: transparent; font-size: 18px; font-weight: 800; cursor: pointer; line-height: 1; }
.erledigt .haken { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.einheit-titel { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.einheit-titel .t { font-weight: 650; display: block; }
.einheit-titel .m { font-size: 13px; color: var(--leise); display: block; }
.pfeil { flex: none; color: var(--leise); font-size: 18px; transition: transform 0.15s; }
.offen .pfeil { transform: rotate(90deg); }
.einheit-inhalt { display: none; border-top: 1px solid var(--linie); padding: 4px 14px 14px; }
.offen .einheit-inhalt { display: block; }
.uebung { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.uebung:last-of-type { border-bottom: 0; }
.uebung .n { font-weight: 600; }
.uebung .v { display: block; }
.uebung .h { display: block; font-size: 13px; color: var(--leise); margin-top: 2px; }
.einheit-hinweis { font-size: 14px; background: var(--warn-hell); border-radius: 10px; padding: 8px 10px; margin: 10px 0 0; }
textarea, input[type=text], input[type=number], input[type=password] {
  width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 44px; resize: vertical; margin-top: 10px; }
label { display: block; font-size: 13px; color: var(--leise); margin: 0 0 4px; }

/* Knoepfe */
.btn { display: inline-block; border: 1px solid var(--linie); background: var(--karte); color: var(--tinte); font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.btn.primaer { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.btn:disabled { opacity: 0.5; }
.reihe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Stufen */
.stufen { display: flex; gap: 6px; margin: 10px 0 12px; }
.stufen span { flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; border: 1px solid var(--linie); font-size: 14px; color: var(--leise); }
.stufen span.fertig { background: var(--akzent-hell); border-color: transparent; color: var(--akzent); }
.stufen span.jetzt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 700; }
ul.liste { margin: 6px 0 10px; padding-left: 18px; }
ul.liste li { margin: 3px 0; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: 12px; color: var(--leise); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.gut { color: var(--akzent); font-weight: 600; }
.achtung { color: var(--warn); font-weight: 600; }
.scroll { overflow-x: auto; }
.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phase { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.phase:last-child { border-bottom: 0; }
.phase .nr { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--linie); display: grid; place-items: center; font-size: 13px; color: var(--leise); }
.phase.jetzt .nr { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 700; }

/* Navigation unten */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--karte); border-top: 1px solid var(--linie); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.tabs button { flex: 1; background: none; border: 0; color: var(--leise); font: inherit; font-size: 12px; padding: 6px 0; cursor: pointer; border-radius: 10px; }
.tabs button .ico { display: block; font-size: 18px; line-height: 1.2; }
.tabs button.aktiv { color: var(--akzent); font-weight: 700; }

/* Login */
body.login { display: grid; place-items: center; min-height: 100vh; }
.login-box { width: 100%; max-width: 340px; padding: 24px; text-align: center; }
.login-box form { text-align: left; margin-top: 22px; }
.login-box .btn { width: 100%; margin-top: 12px; }
.fehler { color: var(--fehler); margin-top: 12px; font-size: 14px; }
