:root {
  --grund: #f4f6f5; --karte: #ffffff; --text: #1c2421; --leise: #5f6b66; --linie: #e2e7e4;
  --akzent: #0f766e; --akzent-hell: #ccfbf1; --gut: #15803d; --gut-hell: #dcfce7;
  --achtung: #b45309; --achtung-hell: #fef3c7; --schlecht: #b91c1c; --schlecht-hell: #fee2e2;
  --rund: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1513; --karte: #18201d; --text: #e7ecea; --leise: #9aa6a1; --linie: #2a3430;
    --akzent: #2dd4bf; --akzent-hell: #12403b; --gut: #4ade80; --gut-hell: #14351f;
    --achtung: #fbbf24; --achtung-hell: #3d2e0a; --schlecht: #f87171; --schlecht-hell: #3f1515;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
p { margin: .3rem 0; }
.leise { color: var(--leise); font-size: .9rem; }
.versteckt { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

button {
  font: inherit; border: 0; border-radius: 12px; padding: .8rem 1rem; cursor: pointer;
  background: var(--akzent); color: #fff; font-weight: 600;
}
@media (prefers-color-scheme: dark) { button { color: #04201c; } }
button.leicht { background: transparent; color: var(--akzent); padding: .5rem .7rem; font-weight: 500; }
input {
  display: block; width: 100%; margin-top: .3rem; font: inherit; padding: .75rem .8rem;
  border: 1px solid var(--linie); border-radius: 12px; background: var(--karte); color: var(--text);
}
label { display: block; margin-bottom: 1rem; font-size: .92rem; color: var(--leise); }

.mitte { min-height: 100vh; display: grid; place-items: center; }
.kreisel { width: 36px; height: 36px; border: 4px solid var(--linie); border-top-color: var(--akzent); border-radius: 50%; animation: dreh 1s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

.eingang { max-width: 420px; margin: 0 auto; padding: 12vh 1.4rem 2rem; text-align: center; }
.eingang form { text-align: left; margin-top: 1.6rem; }
.eingang button { width: 100%; }
.logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: .8rem; }
.fehler { color: var(--schlecht); font-size: .92rem; margin: -.4rem 0 .8rem; }

main { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 1rem) 1rem calc(env(safe-area-inset-bottom) + 6rem); }
.kopf { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .9rem; }
.kopf button { font-size: 1.4rem; }

.karte { background: var(--karte); border-radius: var(--rund); padding: 1rem 1.1rem; margin-bottom: .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hinweis { border-radius: 12px; padding: .7rem .9rem; margin: 0 0 .9rem; font-size: .93rem; }
.warnung { background: var(--achtung-hell); color: var(--achtung); }
.gefahr { background: var(--schlecht-hell); color: var(--schlecht); }
.ok { background: var(--gut-hell); color: var(--gut); }

/* Wochenbudget */
.budget { text-align: center; padding: 1.4rem 1.1rem 1.2rem; }
.budget .klein { color: var(--leise); font-size: .95rem; }
.budget .gross { font-size: 3rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.budget.gut .gross { color: var(--gut); }
.budget.knapp .gross { color: var(--achtung); }
.budget.drueber .gross { color: var(--schlecht); }
.balken { height: 12px; background: var(--linie); border-radius: 99px; overflow: hidden; margin: 1rem 0 .5rem; }
.balken div { height: 100%; border-radius: 99px; background: var(--gut); transition: width .4s; }
.budget.knapp .balken div { background: var(--achtung); }
.budget.drueber .balken div { background: var(--schlecht); }
.zeile2 { display: flex; justify-content: space-between; font-size: .88rem; color: var(--leise); }
.pro-tag { margin-top: .9rem; font-size: 1.02rem; }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; justify-content: space-between; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--linie); }
.liste li:first-child { border-top: 0; }
.liste .was { min-width: 0; overflow-wrap: anywhere; }
.liste .was small { display: block; color: var(--leise); font-size: .82rem; }
.betrag { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.minus { color: var(--text); }
.plus { color: var(--gut); }
.rot { color: var(--schlecht); }
.grau { color: var(--leise); font-weight: 400; }
details summary { cursor: pointer; color: var(--akzent); font-size: .92rem; padding: .3rem 0; }
details[open] summary { margin-bottom: .4rem; }

/* Fahrplan */
.summe { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.woche-kopf { display: flex; justify-content: space-between; align-items: baseline; margin: 1.2rem .2rem .5rem; }
.woche-kopf h2 { margin: 0; }
.tag-kopf { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .2rem; }
.tag-kopf .stand { font-variant-numeric: tabular-nums; }
.tag { padding: .7rem 0; border-top: 1px solid var(--linie); }
.tag:first-child { border-top: 0; padding-top: 0; }
.tag.heute .tag-kopf span:first-child::after { content: "heute"; margin-left: .5rem; font-size: .75rem; background: var(--akzent-hell); color: var(--akzent); padding: .1rem .45rem; border-radius: 99px; vertical-align: middle; }
.eng { display: flex; justify-content: space-between; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--linie); }
.eng:first-of-type { border-top: 0; }

/* Erledigen */
.todo { padding: .75rem 0; border-top: 1px solid var(--linie); }
.todo:first-of-type { border-top: 0; }
.todo b { display: block; }
.todo p { font-size: .9rem; color: var(--leise); }
.marke { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; margin-right: .3rem; font-weight: 600; }
.marke.hoch { background: var(--schlecht-hell); color: var(--schlecht); }
.marke.mittel { background: var(--achtung-hell); color: var(--achtung); }
.marke.niedrig, .marke.zugesagt { background: var(--gut-hell); color: var(--gut); }
.marke.wartet { background: var(--achtung-hell); color: var(--achtung); }
.marke.tun { background: var(--akzent-hell); color: var(--akzent); }

.fuss { text-align: center; margin-top: 1.5rem; }
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: .3rem;
  background: var(--karte); border-top: 1px solid var(--linie);
  padding: .35rem .5rem calc(env(safe-area-inset-bottom) + .35rem);
}
.leiste button {
  flex: 1; max-width: 180px; background: transparent; color: var(--leise); font-weight: 500;
  font-size: .8rem; padding: .35rem; display: flex; flex-direction: column; align-items: center; gap: .1rem;
}
.leiste button span { font-size: 1.3rem; filter: grayscale(1); opacity: .7; }
.leiste button.aktiv { color: var(--akzent); }
.leiste button.aktiv span { filter: none; opacity: 1; }
