/* App "Meine Routinen" – baut auf den Farben und Schriften aus ../stil.css auf. Handy zuerst. */

body.app { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); min-height: 100vh; }
body.blatt-offen { overflow: hidden; }

.app-kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(0.7rem + env(safe-area-inset-top)) 1.1rem 0.7rem;
  background: color-mix(in srgb, var(--grund) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}
.app-kopf .logo { font-size: 1.15rem; }
.app-kopf .logo svg { width: 1.6rem; height: 1.6rem; }

.app-inhalt { width: min(640px, 100%); margin: 0 auto; padding: 1.2rem 1.1rem 2rem; }
.app-inhalt h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); margin-bottom: 0.4em; }
.app-inhalt h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; }
.app-inhalt h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.app-inhalt .oberzeile { margin-bottom: 0.3rem; }

.app-navi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
  background: var(--karte); border-top: 1px solid var(--linie);
  box-shadow: 0 -6px 20px rgb(0 0 0 / 6%);
}
.app-navi a { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.35rem 0; border-radius: 12px;
  color: var(--leise); text-decoration: none; font-size: 0.78rem; font-weight: 600; }
.app-navi a span { font-size: 1.35rem; line-height: 1.2; filter: grayscale(0.6); }
.app-navi a[aria-current] { color: var(--akzent); background: var(--flaeche); }
.app-navi a[aria-current] span { filter: none; }

.karte-app { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--rund); padding: 1.1rem 1.2rem; margin-bottom: 0.8rem; box-shadow: var(--schatten); }
.karte-app p:last-child { margin-bottom: 0; }
.hinweis-karte { border-style: dashed; border-color: var(--akzent-hell); background: var(--flaeche); box-shadow: none; }
.hinweis-app { background: var(--flaeche); border: 1px dashed var(--akzent-hell); border-radius: 12px; padding: 0.8rem 1rem; }
.klein-knopf { padding: 0.55rem 0.95rem; font-size: 0.92rem; }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.link-knopf { background: none; border: 0; padding: 0.3rem 0; color: var(--akzent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.link-knopf.gefahr { color: #b3261e; margin-top: 1rem; }
.marke-app { display: inline-block; font-size: 0.85rem; font-weight: 700; color: var(--akzent); white-space: nowrap; }

/* Umschalter und Chips */
.umschalter { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: var(--flaeche); border-radius: 999px; margin: 0.3rem 0 1rem; }
.umschalter button, .chips-app button { font: inherit; font-size: 0.92rem; font-weight: 600; border: 0; border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; background: transparent; color: var(--text); }
.umschalter button[aria-pressed="true"] { background: var(--karte); color: var(--akzent); box-shadow: var(--schatten); }
.chips-app { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.5rem 0; }
.chips-app button { border: 1px solid var(--linie); background: var(--karte); font-weight: 500; }
.chips-app button[aria-pressed="true"], .chips-app button:hover { border-color: var(--akzent); color: var(--akzent); }
.chips-app button[aria-pressed="true"] { background: var(--akzent); color: var(--auf-akzent); }

/* Einfacher Modus: nur "Probier's heute", ohne Menüleiste */
body.einfach { padding-bottom: 2rem; }
body.einfach .app-navi { display: none; }

/* Probier's heute */
.probieren { margin-bottom: 1.5rem; }
.idee { text-align: center; padding: 1.8rem 1.4rem 1.2rem; }
.idee-emoji { font-size: 3.4rem; line-height: 1; margin-bottom: 0.6rem; }
.idee h1 { margin-bottom: 0.3em; }
.idee .erklaerung-gross { font-size: 1.2rem; max-width: 30rem; margin-inline: auto; }
.idee .knopf-reihe { justify-content: center; margin-top: 1.2rem; }
.idee .aufklapp { text-align: left; }
.geschafft-marke { padding: 0.8rem 1.2rem; border-radius: 999px; background: color-mix(in srgb, var(--akzent-hell) 18%, var(--karte)); }
.idee .wahl-zeile { margin-top: 0.6rem; text-align: left; }
.optionen h2 { margin-top: 1.8rem; }
.option { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--rund); padding: 1rem 1.1rem; margin-bottom: 0.7rem; }
.option > summary, .option-kopf { display: flex; gap: 0.9rem; align-items: center; cursor: pointer; list-style: none; }
.option > summary::-webkit-details-marker { display: none; }
.option > summary::after { content: "＋"; margin-left: auto; color: var(--akzent); font-weight: 700; }
.option[open] > summary::after { content: "－"; }
.option[open] > summary { margin-bottom: 0.8rem; }
.option-kopf { cursor: default; }
.option-emoji { font-size: 1.8rem; line-height: 1; flex: none; }
.option strong { display: block; }
.option .klein { display: block; margin: 0.15rem 0 0; }
.option .knopf-reihe { margin-top: 0.8rem; align-items: center; }
.fuss-app { text-align: center; margin-top: 2rem; line-height: 1.8; }
/* Kalender: Schritte und der eigentliche Export als klar erkennbare Aktion */
.schritt { font-weight: 700; font-size: 0.92rem; margin: 1rem 0 0.2rem; color: var(--akzent); }
.option .schritt:first-of-type { margin-top: 0; }
.kalender-aktion { margin-top: 0.4rem; padding: 0.9rem 1rem; border-radius: 14px; background: var(--flaeche); border: 1px dashed var(--akzent-hell); }
.kalender-aktion .knopf-reihe { margin-top: 0; }
.kalender-aktion .klein { margin: 0.7rem 0 0; }
.kalender-knopf { font-weight: 700; }
.option .kalender-aktion strong { display: inline; }
/* Kalender als Hauptweg in der Idee-Ansicht */
.kalender-karte { background: var(--karte); border: 2px solid var(--akzent-hell); border-radius: var(--rund); padding: 1.2rem 1.2rem 1.3rem; margin: 1.6rem 0 1rem; box-shadow: var(--schatten); scroll-margin-top: 5rem; }
.kalender-karte h2 { margin: 0 0 0.3rem; }
.kalender-karte > .klein { margin: 0.2rem 0 0.4rem; }
.kalender-karte .schritt:first-of-type { margin-top: 0.9rem; }
.eigene-zeit { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; color: var(--leise); margin: 0.2rem 0 0.4rem; }
.app .eigene-zeit input { width: auto; padding: 0.35rem 0.6rem; }
.kalender-karte .kalender-aktion strong { display: inline; }
.kalender-folge { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--linie); }
.kalender-folge h3 { margin: 0.9rem 0 0.2rem; }
.kalender-liste { list-style: none; padding: 0; margin: 0.4rem 0 0.6rem; display: grid; gap: 0.4rem; }
.kalender-liste li { display: flex; align-items: flex-start; gap: 0.6rem; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 0.55rem 0.8rem; }
.kalender-liste li > span { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.kalender-liste li .link-knopf { padding: 0; text-align: left; }
.kalender-liste li .link-knopf.klein { text-decoration: none; color: var(--leise); padding: 0.1rem 0.2rem; }
.install-liste { padding-left: 1.2rem; font-size: 0.95rem; }
.install-liste li { margin-bottom: 0.5rem; }

/* Willkommen und Auswahl-Listen */
.wahl-liste { display: grid; gap: 0.55rem; margin-bottom: 0.8rem; }
.wahl-zeile { display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left; padding: 0.85rem 1rem; border: 2px solid var(--linie);
  border-radius: var(--rund); background: var(--karte); color: var(--text); font: inherit; cursor: pointer; }
.wahl-zeile .wahl-emoji { font-size: 1.7rem; line-height: 1; flex: none; }
.wahl-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.wahl-text span { font-size: 0.92rem; color: var(--leise); }
.wahl-haken { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--linie); display: grid; place-items: center; color: transparent; font-weight: 700; }
.wahl-pfeil { flex: none; color: var(--akzent); font-size: 1.2rem; }
.wahl-zeile[aria-pressed="true"] { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent-hell) 12%, var(--karte)); }
.wahl-zeile[aria-pressed="true"] .wahl-haken { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.anker-wahl { display: grid; gap: 0.6rem; }
.anker-wahl > span { display: flex; flex-direction: column; gap: 0.1rem; }
.punkt-erklaerung { font-size: 0.9rem; color: var(--leise); line-height: 1.35; }
.gruppe-app { font-size: 1.1rem; margin: 1.6rem 0 0.2rem; }
.erklaerung-gross { font-size: 1.1rem; margin-bottom: 1rem; }
.aufklapp { margin: 1rem 0; border-top: 1px solid var(--linie); padding-top: 0.6rem; }
.aufklapp > summary { cursor: pointer; font-weight: 600; color: var(--akzent); padding: 0.4rem 0; list-style: none; }
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary::before { content: "＋ "; }
.aufklapp[open] > summary::before { content: "－ "; }
.aufklapp[open] > summary { margin-bottom: 0.6rem; }
.wort-wahl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; margin-bottom: 0.4rem; }
.wort-wahl > span { font-weight: 600; }
.wort-wahl .chips-app { margin: 0.2rem 0; }
.wort-wahl .link-knopf { font-size: 0.88rem; font-weight: 500; color: var(--leise); }

/* Willkommen */
.willkommen { margin-bottom: 1.2rem; }
.wahl-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
.wahl { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.9rem 0.6rem; border: 2px solid var(--linie); border-radius: var(--rund);
  background: var(--karte); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.wahl-emoji { font-size: 1.8rem; line-height: 1; }
.wahl[aria-pressed="true"] { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent-hell) 14%, var(--karte)); }
.leiste-unten { position: sticky; bottom: calc(4.8rem + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 0 0.3rem;
  background: linear-gradient(transparent, var(--grund) 35%); }

/* Heute */
.tag-kopf h1 { margin-bottom: 0.2em; }
.wort { background: var(--flaeche); border-radius: 12px; padding: 0.7rem 1rem; }
.app input, .app select { font: inherit; color: var(--text); background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 0.6rem 0.8rem; width: 100%; }
.app input:focus, .app select:focus { outline: 2px solid var(--akzent-hell); outline-offset: 1px; }
.blatt label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.8rem; }

.liste { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.5rem; }
.punkt { display: flex; align-items: center; gap: 0.8rem; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--rund); padding: 0.55rem 0.8rem 0.55rem 0.6rem; transition: background 0.2s ease; }
.punkt.fertig { background: color-mix(in srgb, var(--akzent-hell) 14%, var(--karte)); border-color: color-mix(in srgb, var(--akzent-hell) 45%, var(--linie)); }
.haken { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 2px solid var(--akzent-hell); background: transparent; color: transparent;
  font-size: 1.2rem; font-weight: 700; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease; }
.haken:active { transform: scale(0.9); }
.haken[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); animation: haken 0.35s ease; }
@keyframes haken { 50% { transform: scale(1.18); } }
.punkt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; background: none; border: 0; padding: 0.2rem 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.punkt-titel { font-weight: 600; }
.punkt-meta { font-size: 0.85rem; color: var(--leise); font-weight: 400; }
.sanft { font-size: 0.82rem; color: var(--akzent); }
.quest { border-color: var(--akzent-hell); }

/* Entdecken */
.entdecken { list-style: none; padding: 0; margin: 0; }
.eintrag { display: flex; align-items: center; gap: 0.8rem; justify-content: space-between; }
.eintrag-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; background: none; border: 0; padding: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.eintrag-titel { font-weight: 600; }

/* Fortschritt */
.ueberblick p:last-child { font-size: 1.05rem; }
.erkenntnisse { padding-left: 1.2rem; }
.erkenntnisse li { margin-bottom: 0.5rem; }
.ketten { list-style: none; padding: 0; margin: 0; }
.ketten .eintrag-titel { margin-bottom: 0.5rem; }
.ketten .punkt-meta { display: block; }
.tagpunkte { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.tagpunkt { aspect-ratio: 1; border-radius: 4px; background: var(--flaeche); border: 1px solid var(--linie); }
.tagpunkt.ja { background: var(--akzent-hell); border-color: var(--akzent-hell); }
.tagpunkt.vor { opacity: 0.3; }
.rueckschau { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.rueckschau th { text-align: right; font-weight: 600; color: var(--leise); font-size: 0.85rem; padding-bottom: 0.4rem; }
.rueckschau td { padding: 0.35rem 0; border-top: 1px solid var(--linie); }
.rueckschau td + td { text-align: right; font-variant-numeric: tabular-nums; width: 6.5rem; }
.gutes { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.gutes li { display: flex; flex-direction: column; gap: 0.15rem; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 0.7rem 0.9rem; }

/* Mehr */
.zeiten { display: flex; gap: 1rem; margin-bottom: 0.8rem; }
.zeiten label { display: grid; gap: 0.3rem; font-weight: 600; flex: 1; }
.datei { cursor: pointer; }
.mehr-links { list-style: none; padding: 0; display: grid; gap: 0.6rem; }

/* Detailblatt */
.blatt-huelle { position: fixed; inset: 0; z-index: 10; background: rgb(20 14 10 / 45%); display: flex; align-items: flex-end; justify-content: center; }
.blatt-huelle[hidden] { display: none; }
.blatt { position: relative; width: min(640px, 100%); max-height: 88vh; overflow-y: auto; background: var(--grund); border-radius: 22px 22px 0 0;
  padding: 1.6rem 1.3rem calc(1.6rem + env(safe-area-inset-bottom)); animation: hoch 0.25s ease; outline: none; }
@keyframes hoch { from { transform: translateY(40px); opacity: 0; } }
.blatt-zu { position: absolute; top: 0.8rem; right: 0.8rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--linie); background: var(--karte); color: var(--text); font-size: 1rem; cursor: pointer; }
.blatt h2 { margin: 0 2.5rem 0.8rem 0; }
.blatt .uebung-text { padding: 0; margin-bottom: 1.2rem; overflow-wrap: anywhere; }
.blatt .uebung-text .in-app { display: none; }
.blatt [data-gut] { margin-bottom: 0.5rem; }
.plan { background: var(--flaeche); border-radius: 10px; padding: 0.6rem 0.9rem; font-size: 0.95rem; }
.stimmung { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; margin-bottom: 1rem; }
.stimmung button { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.6rem 0.2rem; border: 2px solid var(--linie); border-radius: 14px; background: var(--karte); cursor: pointer; font: inherit; color: var(--text); }
.stimmung button span:first-child { font-size: 1.7rem; line-height: 1; }
.stimmung button[aria-pressed="true"] { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent-hell) 16%, var(--karte)); }

/* Rückmeldung */
.toast { position: fixed; left: 50%; bottom: calc(5.6rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--grund); padding: 0.7rem 1.1rem; border-radius: 999px; font-weight: 600; box-shadow: var(--schatten);
  max-width: calc(100% - 2rem); text-align: center; animation: hoch 0.25s ease; }
.feder-flug { position: fixed; bottom: 6rem; z-index: 19; font-size: 1.6rem; pointer-events: none; animation: flug 1.6s ease-out forwards; }
@keyframes flug { to { transform: translateY(-55vh) rotate(40deg); opacity: 0; } }

@media (min-width: 700px) {
  .app-navi { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 1rem; border: 1px solid var(--linie); border-radius: 20px; }
  body.app { padding-bottom: 7rem; }
}

/* „Was möchtest du verändern?“: Freitext, fertige Routinen als Chips, Routine mit Zeiten je Schritt */
.suche-app { display: flex; gap: 0.5rem; margin: 0.9rem 0 0.6rem; }
.app .suche-app input { flex: 1; min-width: 0; font-size: 1.05rem; padding: 0.7rem 0.95rem; border: 2px solid var(--akzent-hell); border-radius: 999px; }
.app .suche-app input:focus { outline: none; border-color: var(--akzent); }
.suche-app .knopf { flex: none; }
.routinen-chips { margin-top: 0.2rem; }
.zwischen { font-size: 1.2rem; margin: 1.6rem 0 0.3rem; }
.zwischen + .klein { margin-top: 0; }
.routine-schritte { list-style: none; padding: 0; margin: 0.3rem 0 0.4rem; display: grid; gap: 0.55rem; }
.routine-schritte li { padding: 0.65rem 0.8rem; background: var(--flaeche); border-radius: 12px; }
.routine-kopf { display: flex; align-items: center; gap: 0.7rem; }
.app .routine-schritte input { width: auto; flex: none; padding: 0.3rem 0.5rem; }
.routine-schritte strong { display: inline; line-height: 1.3; }
.routine-schritte .marke-app { margin-top: 0.4rem; }
.routine-schritte .klein { display: block; margin-top: 0.35rem; }
.kalender-aktion .knopf-reihe + .knopf-reihe { margin-top: 0.6rem; }
@media (max-width: 420px) {
  .suche-app { flex-direction: column; }
  .suche-app .knopf { align-self: flex-start; }
}
