/* Zyklus. Gestaltung: weich, warm und ruhig. Rosé auf hellem Pfirsich, im Dunkeln Pflaume.
   Phasenfarben sind immer zusätzlich beschriftet. Grosse Tippflächen (mindestens 48 px). */
:root {
  --grund: #fdf6f3;
  --karte: #ffffff;
  --tinte: #3a2630;
  --leise: #7d6670;
  --rose: #c2416b;
  --rose-dunkel: #9c2d53;
  --rose-flaeche: #fbe4ea;
  --linie: #eedde2;
  --periode: #d9466f;
  --follikel: #f2a65a;
  --eisprung: #3fa98c;
  --luteal: #8a7ad6;
  --vorperiode: #c27fb4;
  --erwartet: #f7c6d3;
  --fruchtbar: #c9eadf;
  --ok-flaeche: #e4f4ec;
  --warn-flaeche: #fff1d6;
  --fehler: #b3261e;
  --fehler-flaeche: #fdecea;
  --radius: 22px;
  --leiste: 4.25rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #1d1419;
    --karte: #2a1e25;
    --tinte: #f6e9ee;
    --leise: #c3aab5;
    --rose: #f27da0;
    --rose-dunkel: #ffa3be;
    --rose-flaeche: #43242f;
    --linie: #44323b;
    --erwartet: #5a2b3a;
    --fruchtbar: #1f4339;
    --ok-flaeche: #1f3a2d;
    --warn-flaeche: #3d3120;
    --fehler: #ff9a92;
    --fehler-flaeche: #3a1f24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font-family: 'Avenir Next', 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  padding-bottom: calc(var(--leiste) + env(safe-area-inset-bottom) + 1.5rem);
}

main, .kopf { max-width: 34rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--rose); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }

.sprung { position: absolute; left: -999px; }
.sprung:focus { left: 1rem; top: 1rem; background: var(--karte); padding: 0.5rem 1rem; z-index: 10; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf */
.kopf { display: flex; align-items: center; gap: 0.5rem; padding-top: calc(env(safe-area-inset-top) + 1rem); padding-bottom: 0.5rem; }
.kopf h1 { font-size: 1.6rem; margin: 0; }
.zurueck { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--karte); text-decoration: none; font-size: 1.8rem; line-height: 1; }

/* Gruss */
.gruss { padding-top: calc(env(safe-area-inset-top) + 1.25rem); margin-bottom: 1rem; }
.gruss h1 { font-size: 1.75rem; margin: 0.1rem 0 0.6rem; }
.datum { color: var(--leise); margin: 0; font-size: 0.95rem; }
.satz { font-size: 1.2rem; line-height: 1.45; margin: 0; padding: 1rem 1.1rem; background: var(--rose-flaeche); border-radius: var(--radius); font-weight: 500; }

/* Karten */
.karte { background: var(--karte); border-radius: var(--radius); padding: 1.15rem; margin: 0 0 1rem; box-shadow: 0 1px 2px rgb(60 20 40 / 6%), 0 6px 20px rgb(60 20 40 / 5%); }
.karte.leise { background: transparent; box-shadow: none; border: 1px solid var(--linie); }
.impuls p { margin: 0; }

/* Ring */
.ring { position: relative; width: min(16rem, 78vw); margin: 0.25rem auto 0.75rem; }
.ring svg { display: block; width: 100%; height: auto; }
.seg { fill: none; stroke-width: 18; stroke-linecap: butt; }
.seg.vorbei { opacity: 0.35; }
.seg-periode { stroke: var(--periode); }
.seg-follikel { stroke: var(--follikel); }
.seg-eisprung { stroke: var(--eisprung); }
.seg-luteal { stroke: var(--luteal); }
.seg-vorPeriode { stroke: var(--vorperiode); }
.ring-heute { fill: var(--karte); stroke: var(--tinte); stroke-width: 4; }
.ring-mitte { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3.2rem; }
.ring-zahl { font-size: 3.4rem; font-weight: 700; line-height: 1; }
.ring-klein { color: var(--leise); font-size: 0.95rem; }

.phase-name { text-align: center; font-weight: 700; font-size: 1.25rem; margin: 0; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.phase-text { text-align: center; color: var(--leise); margin: 0.25rem 0 1rem; }
.punkt { width: 0.8rem; height: 0.8rem; border-radius: 50%; display: inline-block; }
.punkt-periode { background: var(--periode); }
.punkt-follikel { background: var(--follikel); }
.punkt-eisprung { background: var(--eisprung); }
.punkt-luteal { background: var(--luteal); }
.punkt-vorPeriode { background: var(--vorperiode); }

.fakten { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.75rem; }
.fakten li { display: flex; gap: 0.75rem; align-items: flex-start; }
.fakt-zeichen { flex: none; width: 0.85rem; height: 0.85rem; border-radius: 50%; margin-top: 0.35rem; }
.fakt-zeichen.periode { background: var(--periode); }
.fakt-zeichen.eisprung { background: var(--eisprung); }

/* Knöpfe */
.aktionen { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.7rem 1.2rem;
  border-radius: 999px; border: 2px solid var(--rose); background: transparent; color: var(--rose);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center;
}
.knopf.haupt { background: var(--rose); color: #fff; }
.knopf.haupt:active { background: var(--rose-dunkel); }
.knopf.breit { width: 100%; }
form.inline:has(.breit) { display: block; }
.knopf.gefahr { border-color: var(--fehler); color: var(--fehler); }
.knopf.rund { width: 3rem; padding: 0; font-size: 1.6rem; }
.knopf:disabled { opacity: 0.6; }
form.inline { display: inline; margin: 0; }
.mitte { text-align: center; }

/* Formulare */
.formular { margin: 0; }
.feld { margin: 0 0 1rem; }
.feld label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.optional { font-weight: 400; color: var(--leise); font-size: 0.9rem; }
input[type='text'], input[type='email'], input[type='number'], input[type='date'], select, textarea {
  width: 100%; min-height: 3rem; padding: 0.65rem 0.9rem; border: 2px solid var(--linie); border-radius: 14px;
  background: var(--karte); color: var(--tinte); font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--rose); outline: none; }
.feldhinweis { color: var(--leise); font-size: 0.9rem; margin: 0.3rem 0 0; }
.feldfehler { color: var(--fehler); font-weight: 600; margin: 0.3rem 0 0; }
.hat-fehler input { border-color: var(--fehler); }

/* Auswahl als grosse Knöpfe */
.wahl { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.wahl legend { font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.wahl-reihe { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.4rem; }
.wahl-knopf { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.55rem 0.15rem; border: 2px solid var(--linie); border-radius: 16px; cursor: pointer; text-align: center; min-height: 4.2rem; }
.wahl-knopf input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wahl-zeichen { font-size: 1.6rem; line-height: 1.1; }
.wahl-text { font-size: 0.8rem; color: var(--leise); }
.wahl-knopf:has(input:checked) { border-color: var(--rose); background: var(--rose-flaeche); }
.wahl-knopf:has(input:checked) .wahl-text { color: var(--tinte); font-weight: 600; }
.wahl-knopf:has(input:focus-visible) { outline: 3px solid var(--rose); outline-offset: 2px; }
.notiz-feld summary { cursor: pointer; color: var(--rose); font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.notiz-feld textarea { margin-top: 0.4rem; }
.checkin-zusammen { font-size: 1.1rem; margin: 0 0 0.5rem; }
.notiz { color: var(--leise); white-space: pre-line; margin: 0 0 0.75rem; }

.schalter { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.7rem 0; border-bottom: 1px solid var(--linie); cursor: pointer; }
.schalter input { width: 1.5rem; height: 1.5rem; accent-color: var(--rose); flex: none; margin-top: 0.15rem; }

/* Hinweise */
.hinweis { border-radius: 16px; padding: 0.8rem 1rem; margin: 0 0 1rem; }
.hinweis.ok { background: var(--ok-flaeche); }
.hinweis.warnung { background: var(--warn-flaeche); }
.hinweis.fehler { background: var(--fehler-flaeche); }
#netz { max-width: 34rem; margin: 0.5rem auto; }
.klein { font-size: 0.92rem; color: var(--leise); }
.fuss { font-size: 0.85rem; color: var(--leise); text-align: center; margin: 1.5rem 1rem; }
.blei { color: var(--leise); }
.gross-text { font-size: 1.15rem; }

/* Listen */
.liste { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.liste li { border-bottom: 1px solid var(--linie); }
.liste li:last-child { border-bottom: 0; }
.liste a { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.75rem 0; color: inherit; text-decoration: none; min-height: 3rem; }
.wert { color: var(--leise); white-space: nowrap; font-size: 0.95rem; }
.erkenntnisse { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0 0 0.75rem; }
.zahlen div { background: var(--rose-flaeche); border-radius: 16px; padding: 0.7rem 0.9rem; }
.zahlen dt { font-size: 0.85rem; color: var(--leise); }
.zahlen dd { margin: 0; font-size: 1.3rem; font-weight: 700; }

/* Kalender */
.monat-kopf { display: flex; align-items: center; justify-content: space-between; margin: 0.25rem 0 0.75rem; }
.monat-kopf h2 { margin: 0; }
.wochentage, .monat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; text-align: center; }
.wochentage { color: var(--leise); font-size: 0.8rem; margin-bottom: 0.35rem; }
.tag { aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: inherit; text-decoration: none; position: relative; font-size: 0.95rem; }
.tag .stimmung { font-size: 0.7rem; line-height: 1; position: absolute; bottom: 0.1rem; }
.tag.periode { background: var(--periode); color: #fff; }
.tag.erwartet { background: var(--erwartet); border: 2px dashed var(--periode); }
.tag.fruchtbar { background: var(--fruchtbar); }
.tag.eisprung { background: var(--eisprung); color: #fff; }
.tag.heute { box-shadow: 0 0 0 3px var(--tinte); font-weight: 700; }
.legende { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; font-size: 0.9rem; }
.legende li { display: flex; align-items: center; gap: 0.5rem; }
.muster { width: 1rem; height: 1rem; border-radius: 50%; display: inline-block; }
.muster.periode { background: var(--periode); }
.muster.erwartet { background: var(--erwartet); border: 2px dashed var(--periode); }
.muster.fruchtbar { background: var(--fruchtbar); }
.muster.eisprung { background: var(--eisprung); }

/* Navigation unten */
.leiste {
  position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--karte); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.leiste a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--leiste); color: var(--leise); text-decoration: none; font-size: 0.8rem; gap: 0.1rem; }
.leiste .zeichen { font-size: 1.35rem; line-height: 1; }
.leiste a[aria-current='page'] { color: var(--rose); font-weight: 700; }

/* Einfache Seiten */
body.schlicht { padding-bottom: 2rem; }
body.schlicht main { padding-top: calc(env(safe-area-inset-top) + 2.5rem); }
.marke { display: flex; align-items: center; gap: 0.5rem; color: var(--rose); font-weight: 700; font-size: 1.1rem; margin: 0; }
.marke-punkt { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 4px solid var(--rose); display: inline-block; }
body.schlicht h1 { font-size: 1.8rem; }
