@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url(fonts/nunito-latin-800-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --grund: #fdf8f3;
  --karte: #ffffff;
  --text: #2b2f36;
  --still: #6b7079;
  --linie: #eee6dd;
  --akzent: #14a37a;
  --akzent-dunkel: #0e7c5c;
  --akzent-hell: #e3f6ee;
  --da: #c9efdc;
  --da-text: #0b6a4d;
  --krank: #ffd9d2;
  --krank-text: #b23b26;
  --frei: #ebe8e5;
  --frei-text: #5e5a57;
  --anders: #ffe9b0;
  --anders-text: #8a5a00;
  --extra: #d6e8ff;
  --extra-text: #1d58a8;
  --ferien: #e3dcf5;
  --gut: #e8f8f0;
  --gut-rand: #a6e0c6;
  --knapp: #fff0ea;
  --knapp-rand: #ffb59f;
  --schatten: 0 2px 6px rgb(120 90 60 / 6%), 0 10px 28px rgb(120 90 60 / 8%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 0% 0%, #dff5ea 0%, transparent 60%),
    radial-gradient(90% 50% at 100% 0%, #ffe8d9 0%, transparent 55%),
    var(--grund);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.kopf, main { max-width: 34rem; margin: 0 auto; padding: 0 0.9rem; }
.kopf { padding-top: 1.25rem; padding-bottom: 0.1rem; }
h1 { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.55rem; }
.logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 3px 8px rgb(20 163 122 / 25%); }
h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 0.5rem; }
p { margin: 0 0 0.6rem; }
b { font-weight: 800; }
.unterzeile, .still { color: var(--still); font-size: 0.875rem; }
.unterzeile { margin: 0.35rem 0 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { display: grid; gap: 0.9rem; padding-top: 0.9rem; padding-bottom: 2.5rem; }

.karte {
  background: var(--karte);
  border-radius: 22px;
  padding: 1.1rem;
  box-shadow: var(--schatten);
}
.karte > :last-child { margin-bottom: 0; }

.hinweis { background: linear-gradient(160deg, #ffffff 40%, var(--akzent-hell)); border: 2px solid var(--gut-rand); }
.ios-tipp { font-size: 0.875rem; color: var(--still); background: var(--grund); border-radius: 12px; padding: 0.6rem 0.75rem; }
.warnung { background: var(--knapp); border: 2px solid var(--knapp-rand); display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.warnung p { margin: 0; flex: 1 1 12rem; }

/* ---------- Überblick ---------- */
.fortschritt { display: flex; align-items: center; gap: 1rem; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 13; }
.ring-grund { stroke: var(--akzent-hell); }
.ring-wert { stroke: var(--akzent); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: var(--akzent-dunkel); }
.zahlen { display: grid; }
.gross { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.von { color: var(--still); font-size: 1rem; font-weight: 700; }

.ende {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--grund);
  border-radius: 16px;
  line-height: 1.3;
}
.ende b { font-size: 1.1rem; }
.ende-symbol { font-size: 1.6rem; }
.urteil { border-radius: 16px; padding: 0.75rem 0.9rem; border: 2px solid transparent; font-size: 0.95rem; }
.urteil.gut { background: var(--gut); border-color: var(--gut-rand); }
.urteil.gut::before { content: "👍 "; }
.urteil.knapp { background: var(--knapp); border-color: var(--knapp-rand); }
.urteil.knapp::before { content: "⚠️ "; }
.kennzahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.75rem 0 0; }
.kennzahlen div { min-width: 0; background: var(--grund); border-radius: 14px; padding: 0.55rem 0.7rem; }
.kennzahlen dt { color: var(--still); font-size: 0.8rem; font-weight: 700; }
.kennzahlen dd { margin: 0; font-weight: 800; font-size: 0.95rem; }

/* ---------- Kalender ---------- */
.monat-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.monat-kopf h2 { margin: 0; text-align: center; flex: 1; }
.wochentage, .tage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.wochentage span { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--still); padding-bottom: 2px; }

.tag {
  position: relative;
  aspect-ratio: 1 / 1.05;
  min-height: 42px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}
.tag:not(:disabled):active { transform: scale(0.93); }
.tag:disabled { cursor: default; }
.tag .nr { font-size: 0.98rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tag .marke { font-size: 0.62rem; line-height: 1.1; font-weight: 800; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag .symbol { position: absolute; top: -6px; right: -3px; font-size: 0.85rem; }
.tag.leer { cursor: default; }
.tag.vor-start { color: var(--still); opacity: 0.4; }
.tag.ferien, .l-ferien { background: repeating-linear-gradient(135deg, var(--ferien) 0 4px, #f7f4fc 4px 8px); color: #5b4c86; }
.tag.da { background: var(--da); color: var(--da-text); }
.tag.plan { border: 2px dashed #7fd1b3; background: #f5fcf8; }
.tag.krank { background: var(--krank); color: var(--krank-text); }
.tag.frei { background: var(--frei); color: var(--frei-text); }
.tag.anders { background: var(--anders); color: var(--anders-text); }
.tag.extra { background: var(--extra); color: var(--extra-text); }
.tag.zukunft { border: 2px dashed currentColor; }
.tag.heute { border: 2px solid var(--text); }
.tag.heute .nr { font-weight: 800; }
.tag.frist::after {
  content: "Frist";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 800;
  background: #e8573f;
  color: #fff;
  border-radius: 6px;
  padding: 0 4px;
}
.tag:focus-visible { outline: 3px solid var(--akzent); outline-offset: 1px; }

.kalender-fuss { display: flex; justify-content: center; margin: 0.7rem 0 0.2rem; }
.legende { list-style: none; padding: 0.7rem 0 0; margin: 0.7rem 0 0; border-top: 1px solid var(--linie); display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.78rem; font-weight: 700; color: var(--still); }
.legende li { display: flex; align-items: center; gap: 0.35rem; }
.l { width: 15px; height: 15px; border-radius: 5px; display: inline-block; }
.l-da { background: var(--da); }
.l-plan { border: 2px dashed #7fd1b3; background: #f5fcf8; }
.l-krank { background: var(--krank); }
.l-frei { background: var(--frei); }
.l-anders { background: var(--anders); }
.l-extra { background: var(--extra); }
.l-symbol { font-size: 0.85rem; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--linie);
  background: var(--karte);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; box-shadow: 0 4px 12px rgb(20 163 122 / 28%); }
.knopf.klein { min-height: 36px; padding: 0.3rem 1rem; font-size: 0.9rem; }
.knopf:focus-visible, .rund:focus-visible, .wahl-knopf:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.knopf-reihe { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.knopf-reihe .knopf { flex: 1 1 9rem; }
.rund {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: var(--akzent-hell);
  color: var(--akzent-dunkel);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Einstellungen ---------- */
details summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details summary::-webkit-details-marker { display: none; }
details summary h2 { margin: 0; }
details summary::after { content: "›"; font-size: 1.5rem; font-weight: 800; color: var(--still); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(90deg); }
.formular { display: grid; gap: 0.9rem; margin-top: 0.9rem; }
.formular label { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 700; }
.formular input[type=date], .formular input[type=number] {
  font: inherit;
  font-weight: 700;
  min-height: 46px;
  padding: 0.4rem 0.7rem;
  border-radius: 14px;
  border: 2px solid var(--linie);
  background: var(--grund);
  color: var(--text);
  width: 100%;
  min-width: 0;
}
.formular input:focus-visible { outline: 3px solid var(--akzent); outline-offset: 1px; }
.formular fieldset { border: 0; padding: 0; margin: 0; }
.formular legend { font-size: 0.9rem; font-weight: 700; padding: 0; margin-bottom: 0.35rem; }
.tag-wahl { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag-wahl label { display: flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.8rem; border: 2px solid var(--linie); border-radius: 999px; font-weight: 800; }
.tag-wahl label:has(input:checked) { background: var(--akzent-hell); border-color: var(--gut-rand); }
.tag-wahl input { width: 18px; height: 18px; accent-color: var(--akzent); }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.formular p { margin: 0; }

/* ---------- Tag-Blatt ---------- */
.blatt {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 34rem;
  background: var(--karte);
  color: var(--text);
  border-radius: 26px 26px 0 0;
}
.blatt::backdrop { background: rgb(43 47 54 / 35%); }
.blatt[open] { animation: hoch 0.2s ease-out; }
@keyframes hoch { from { transform: translateY(40px); opacity: 0.4; } }
.blatt-inhalt { padding: 0.6rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); display: grid; gap: 0.85rem; }
.blatt-inhalt::before { content: ""; justify-self: center; width: 40px; height: 5px; border-radius: 99px; background: var(--linie); }
.blatt-kopf { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.blatt-kopf h2 { margin: 0; }
.blatt-kopf p { margin: 0.15rem 0 0; }
.wahl { display: grid; gap: 0.5rem; }
.wahl-knopf {
  text-align: left;
  min-height: 50px;
  padding: 0.6rem 0.9rem;
  border-radius: 16px;
  border: 2px solid var(--linie);
  background: var(--karte);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: grid;
}
.wahl-knopf small { font-weight: 400; color: var(--still); font-size: 0.8rem; }
.wahl-knopf.aktiv { border-color: var(--akzent); background: var(--gut); }
.stunden-zeile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem 0.75rem;
  align-items: center;
  border: 2px solid var(--linie);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
}
.stunden-zeile.aktiv { border-color: var(--akzent); background: var(--gut); }
.stunden-zeile > span { font-weight: 800; }
.stunden-zeile .knopf { grid-column: 1 / -1; }
.stepper { display: flex; align-items: center; gap: 0.35rem; }
.stepper input {
  width: 4.2rem;
  min-height: 44px;
  text-align: center;
  font: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 14px;
  border: 2px solid var(--linie);
  background: var(--karte);
  color: var(--text);
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Meldung ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  width: min(30rem, calc(100% - 1.5rem));
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.25s ease, visibility 0.25s;
  visibility: hidden;
  z-index: 10;
}
.toast.sichtbar { transform: translate(-50%, 0); visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
