/* Familien-Planer – einfarbige Landschaft
   Alle Farben hängen an drei Reglern:
   --hue  Farbton (0–360), --c Sättigungsfaktor, --n Nacht (0 = Tag, 1 = Nacht). */

/* Schriften liegen im Projekt (fonts/), keine Verbindung zu Google nötig. Zeichensatz: latin (inkl. ä ö ü ß). */
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/figtree-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/newsreader-latin.woff2) format('woff2');
}

@property --hue { syntax: '<number>'; inherits: true; initial-value: 195; }
@property --c   { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --n   { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --shift { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  --hue: 195; --c: 1; --n: 0; --shift: 0;
  --cc: calc(var(--c) * (1 - var(--n) * 0.45));

  --himmel: oklch(calc(0.95 - var(--n) * 0.785) calc(0.035 * var(--cc)) var(--hue));
  --s1: oklch(calc(0.86 - var(--n) * 0.55) calc(0.06 * var(--cc)) var(--hue));
  --s2: oklch(calc(0.74 - var(--n) * 0.48) calc(0.085 * var(--cc)) var(--hue));
  --s3: oklch(calc(0.57 - var(--n) * 0.355) calc(0.09 * var(--cc)) var(--hue));
  --s4: oklch(calc(0.40 - var(--n) * 0.24) calc(0.075 * var(--cc)) var(--hue));
  --nebel: oklch(calc(0.98 - var(--n) * 0.6) calc(0.02 * var(--cc)) var(--hue));

  --tinte: oklch(calc(0.27 + var(--n) * 0.58) calc(0.05 * var(--cc)) var(--hue));
  --tinte-2: oklch(calc(0.45 + var(--n) * 0.27) calc(0.045 * var(--cc)) var(--hue));
  --flaeche: oklch(calc(0.99 - var(--n) * 0.73) calc(0.012 * var(--cc) + var(--n) * 0.02) var(--hue) / calc(0.9 - var(--n) * 0.1));
  --flaeche-fest: oklch(calc(0.985 - var(--n) * 0.72) calc(0.015 * var(--cc) + var(--n) * 0.02) var(--hue));
  --linie: color-mix(in oklch, var(--tinte) 14%, transparent);
  --zart: color-mix(in oklch, var(--tinte) 6%, transparent);
  --akzent: oklch(calc(0.48 + var(--n) * 0.3) calc(0.11 * var(--cc)) var(--hue));
  --auf-akzent: oklch(calc(0.99 - var(--n) * 0.8) 0.01 var(--hue));
  --warn: oklch(calc(0.55 + var(--n) * 0.15) 0.17 30);

  /* Personen: feste Farben, damit sie auf jedem Farbton erkennbar bleiben */
  --p-koralle: oklch(0.68 0.16 28);
  --p-blau: oklch(0.62 0.14 250);
  --p-gruen: oklch(0.66 0.14 150);
  --p-violett: oklch(0.6 0.15 305);
  --p-gold: oklch(0.76 0.14 80);

  --schrift: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --schrift-deko: 'Newsreader', Georgia, serif;
  --r-gross: 28px;
  --r: 18px;
  --tipp: 60px;
  --nav-breite: 112px;
  --rand: clamp(16px, 2.6vw, 36px);
  --dauer: .9s;

  color-scheme: light;
  transition: --hue var(--dauer) ease, --c var(--dauer) ease, --n 2.5s ease;
}
:root[data-nacht="1"] { color-scheme: dark; }
:root.sofort, :root.sofort * { transition: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--schrift);
  font-size: clamp(18px, 1.55vw + 6px, 22px);
  line-height: 1.4;
  color: var(--tinte);
  background: var(--himmel);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Landschaft ---------- */
.landschaft { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: --shift 1.1s cubic-bezier(.3, .7, .2, 1); }
.landschaft.wird-gewischt { transition: none; }
.landschaft svg { width: 100%; height: 100%; display: block; }
.himmel { fill: var(--himmel); }
.schicht { will-change: transform; }
.s1 { fill: var(--s1); transform: translateX(calc(var(--shift) * -18px)); }
.s2 { fill: var(--s2); transform: translateX(calc(var(--shift) * -42px)); }
.s3 { fill: var(--s3); transform: translateX(calc(var(--shift) * -76px)); }
.s4 { fill: var(--s4); transform: translateX(calc(var(--shift) * -118px)); }
.gestirn { transition: transform 2s ease; }
.gestirn .scheibe { fill: oklch(calc(0.985 - var(--n) * 0.06) calc(0.05 * (1 - var(--n))) calc(var(--hue) + 25)); }
.gestirn .halo { fill: oklch(0.99 0.03 var(--hue) / calc(0.35 - var(--n) * 0.25)); }
@keyframes nebel { from { transform: translateX(-160px); } to { transform: translateX(220px); } }

/* ---------- Grundgerüst ---------- */
.nav, .ansicht { position: relative; z-index: 1; }
.ansicht {
  min-height: 100dvh;
  padding: calc(var(--rand) + env(safe-area-inset-top)) var(--rand) var(--rand) calc(var(--nav-breite) + var(--rand));
  outline: none;
}
.nav {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-breite);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 16px 12px;
  z-index: 5;
}
.nav-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 84px; border-radius: var(--r);
  color: var(--tinte-2); text-decoration: none; font-size: 15px; font-weight: 600;
  transition: background .3s, color .3s;
}
.nav-link svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link[aria-current="page"] { background: var(--flaeche); color: var(--tinte); }
.nav-link[aria-current="page"] svg { stroke-width: 2.2; }

/* Hochformat und Handy: Leiste unten */
@media (orientation: portrait), (max-width: 760px) {
  :root { --nav-breite: 0px; }
  .ansicht { padding: calc(var(--rand) + env(safe-area-inset-top)) var(--rand) calc(110px + env(safe-area-inset-bottom)); }
  .nav {
    top: auto; right: 0; width: auto; flex-direction: row; justify-content: space-around;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--flaeche-fest);
    border-top: 1px solid var(--linie);
  }
  .nav-link { flex: 1; min-height: 64px; font-size: 13px; }
  .nav-link svg { width: 26px; height: 26px; }
}
@media (max-width: 420px) {
  .nav-link span { font-size: 11px; }
}

/* ---------- Bausteine ---------- */
.kopf { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.titel {
  font-family: var(--schrift-deko); font-weight: 500;
  font-size: clamp(34px, 3.4vw + 12px, 56px); line-height: 1.05; margin: 0;
  font-variation-settings: 'opsz' 96; letter-spacing: -0.01em;
}
.kopf .aktionen { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.blaettern { display: flex; gap: 10px; }
.neu-termin .nur-breit { margin-left: -2px; }

.flaeche {
  background: var(--flaeche);
  border-radius: var(--r-gross);
  padding: clamp(16px, 2vw, 28px);
}
.flaeche h2 { font-size: 1em; font-weight: 700; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.flaeche h2 .zahl { margin-left: auto; font-weight: 500; color: var(--tinte-2); font-size: .85em; }

.knopf {
  min-height: var(--tipp); padding: 0 24px; border-radius: 999px; border: 0;
  background: var(--akzent); color: var(--auf-akzent);
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s, background .3s;
}
.knopf:active { transform: scale(.96); }
.knopf svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.knopf.leise { background: var(--flaeche); color: var(--tinte); }
.knopf.rund { width: var(--tipp); padding: 0; }
.knopf.gefahr { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 2px currentColor; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  min-height: 52px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--flaeche); color: var(--tinte); font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip[aria-pressed="true"] { background: var(--akzent); color: var(--auf-akzent); }

.punkt { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; }
.punkte { display: inline-flex; }
.punkte .punkt + .punkt { margin-left: -5px; box-shadow: 0 0 0 2px var(--flaeche-fest); }

.leer { color: var(--tinte-2); margin: 6px 0; }
.leer-gross { text-align: center; padding: 40px 16px; color: var(--tinte-2); }
.leer-gross strong { display: block; color: var(--tinte); font-size: 1.15em; margin-bottom: 4px; }

/* Listen mit Abhaken */
.liste { list-style: none; margin: 0; padding: 0; }
.zeile {
  display: flex; align-items: center; gap: 14px;
  min-height: 68px; padding: 6px 4px;
  border-bottom: 1px solid var(--linie);
}
.zeile:last-child { border-bottom: 0; }
.zeile .haupt { flex: 1; min-width: 0; background: none; border: 0; padding: 8px 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.zeile .text { overflow-wrap: anywhere; }
.zeile .meta { font-size: .78em; color: var(--tinte-2); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.meta .ueberfaellig { color: var(--warn); font-weight: 600; }

.haken {
  width: 52px; height: 52px; flex: none; border-radius: 16px; border: 2.5px solid var(--tinte-2);
  background: transparent; display: grid; place-items: center; padding: 0;
  transition: background .25s, border-color .25s, transform .2s;
}
.haken svg { width: 28px; height: 28px; fill: none; stroke: var(--auf-akzent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s .05s; }
.zeile.erledigt .haken { background: var(--akzent); border-color: var(--akzent); }
.zeile.erledigt .haken svg { stroke-dashoffset: 0; }
.zeile.erledigt .text { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--tinte-2); }
.haken:active { transform: scale(.88); }
.mehr { width: 52px; height: 52px; border: 0; border-radius: 50%; background: transparent; color: var(--tinte-2); display: grid; place-items: center; flex: none; }
.mehr svg { width: 26px; height: 26px; fill: currentColor; }

@keyframes rein { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
@keyframes aufleuchten { from { background: color-mix(in oklch, var(--akzent) 24%, transparent); } }
.neu { border-radius: 14px; animation: rein .45s cubic-bezier(.2, .9, .3, 1.2), aufleuchten 1.6s ease-out; }
/* Abhaken: Haken ploppt kurz auf, danach gleitet die Zeile weg und klappt zusammen */
@keyframes plopp { 40% { transform: scale(1.18); } }
.zeile.abgehakt .haken { animation: plopp .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes wegklappen {
  45% { opacity: 0; transform: translateX(56px); }
  to { opacity: 0; transform: translateX(56px); height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; border-bottom-color: transparent; }
}
.zeile.geht { overflow: hidden; animation: wegklappen .42s ease-in forwards; }

/* Formularfelder */
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.feld > span, .feld-titel { font-size: .8em; font-weight: 600; color: var(--tinte-2); }
.eingabe, select.eingabe {
  min-height: var(--tipp); width: 100%; padding: 0 20px; border-radius: var(--r);
  border: 2px solid var(--linie); background: var(--flaeche-fest);
}
.eingabe:focus { outline: none; border-color: var(--akzent); }
.zeilen-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.umschalter { display: flex; gap: 8px; flex-wrap: wrap; }
.umschalter label { position: relative; }
.umschalter input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.umschalter input + span {
  min-height: 52px; min-width: 52px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--zart); font-weight: 500; transition: background .2s, color .2s;
}
.umschalter input:checked + span { background: var(--akzent); color: var(--auf-akzent); }
.umschalter input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Dialog: auf dem Tablet mittig, auf dem Handy von unten */
.dialog {
  border: 0; padding: 0; color: var(--tinte); background: var(--flaeche-fest);
  border-radius: var(--r-gross); width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
  box-shadow: 0 30px 80px -20px oklch(0.2 0.05 var(--hue) / .45);
}
.dialog::backdrop { background: oklch(0.25 0.04 var(--hue) / .35); }
.dialog[open] { animation: dialog-rein .35s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes dialog-rein { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.dialog form { padding: 24px 28px 0; }
.dialog h2 { font-family: var(--schrift-deko); font-weight: 500; font-size: 1.5em; margin: 0 0 14px; }
.dialog .fuss { display: flex; gap: 12px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--flaeche-fest); padding: 12px 0 20px; margin-top: 4px; }
.dialog .fuss .rechts { margin-left: auto; display: flex; gap: 12px; }
@media (max-width: 760px) {
  .dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: var(--r-gross) var(--r-gross) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialog form { padding: 22px 18px; }
  .zeilen-2 { grid-template-columns: 1fr; }
}

.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 20;
  transform: translate(-50%, 140%); opacity: 0;
  background: var(--tinte); color: var(--himmel); padding: 16px 26px; border-radius: 999px;
  font-weight: 600; transition: transform .4s cubic-bezier(.2, .9, .3, 1.2), opacity .3s;
  max-width: calc(100vw - 32px);
}
.toast.zeigen { transform: translate(-50%, 0); opacity: 1; }
.toast:has(.toast-knopf) { display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 24px; }
.toast-knopf {
  font: inherit; font-weight: 700; color: var(--tinte); background: var(--himmel);
  border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px; cursor: pointer; white-space: nowrap;
}
@media (orientation: portrait), (max-width: 760px) { .toast { bottom: calc(100px + env(safe-area-inset-bottom)); } }

/* ---------- Start ---------- */
.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(16px, 2vw, 28px); align-items: start; }
.uhr-block { padding-top: clamp(8px, 3vh, 40px); padding-bottom: clamp(4px, 2vh, 24px); }
.uhr {
  font-family: var(--schrift-deko); font-weight: 300; font-variation-settings: 'opsz' 144;
  font-size: clamp(96px, 11vw, 190px); line-height: .9; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; margin: 0;
}
.uhr { perspective: 800px; }
.uhr .ziffer { display: inline-block; }
@keyframes kippen { from { transform: rotateX(85deg) translateY(-18%); opacity: 0; } 60% { opacity: 1; } }
.uhr .ziffer.kippt { transform-origin: 50% 0; animation: kippen .8s cubic-bezier(.25, 1.5, .45, 1); }
.uhr .doppelpunkt { animation: blinken 2s steps(1) infinite; }
@keyframes blinken { 50% { opacity: .25; } }
.datum { font-size: clamp(22px, 2vw + 6px, 34px); font-weight: 500; margin: 10px 0 0; }
.gruss { color: var(--tinte-2); margin: 6px 0 0; }
.spalte { display: grid; gap: clamp(14px, 1.6vw, 22px); }
.kachel { display: block; text-decoration: none; color: inherit; transition: transform .2s; }
.kachel:active { transform: scale(.985); }
.termin-zeile { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.termin-zeile:last-child { border-bottom: 0; }
.termin-zeile .zeit { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 4.2em; }
.tag-titel { font-size: .78em; font-weight: 700; color: var(--tinte-2); margin: 10px 0 0; }
.tag-titel:first-of-type { margin-top: 0; }
.weitere { margin: 8px 0 0; color: var(--tinte-2); font-weight: 600; font-size: .85em; }
.einkauf-vorschau { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.einkauf-vorschau span { background: var(--zart); padding: 6px 14px; border-radius: 999px; font-size: .9em; }
/* Kalender vorerst ausgeblendet (siehe AUSGEBLENDET in js/app.js) */
.start [data-termine] { display: none; }
.grosse-zahl { font-family: var(--schrift-deko); font-size: 1.8em; font-weight: 500; line-height: 1; }

@media (orientation: portrait), (max-width: 760px) {
  .start { display: flex; flex-direction: column; align-items: stretch; }
  .start .spalte { display: contents; }
  .start [data-termine] { order: 1; }
  .start [data-aufgaben] { order: 2; }
  .start [data-einkauf] { order: 3; }
  .uhr-block { padding-top: 4vh; padding-bottom: 2vh; }
}

/* ---------- Einkauf ---------- */
.eingabe-reihe { display: flex; gap: 12px; }
.eingabe-reihe .eingabe { flex: 1; font-size: 1.05em; min-height: 68px; border-radius: 999px; padding: 0 26px; }
.eingabe-reihe .knopf { min-height: 68px; }
.vorschlaege { margin: 14px 0 22px; }
.vorschlaege .chip { min-height: 48px; }
.einkauf-raster { columns: 2 340px; column-gap: clamp(14px, 1.6vw, 22px); }
.einkauf-raster .flaeche { break-inside: avoid; margin-bottom: clamp(14px, 1.6vw, 22px); }

/* ---------- Aufgaben ---------- */
.aufgaben-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: clamp(14px, 1.6vw, 22px); align-items: start; margin-top: 20px; }

/* ---------- Kalender ---------- */
.woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.tag { background: var(--flaeche); border-radius: var(--r); padding: 12px 10px; min-height: 260px; display: flex; flex-direction: column; gap: 8px; }
.tag-kopf { background: none; border: 0; padding: 0; text-align: left; display: flex; align-items: baseline; gap: 8px; min-height: 44px; }
.tag-kopf .wt { font-weight: 700; font-size: .85em; color: var(--tinte-2); }
.tag-kopf .nr { font-family: var(--schrift-deko); font-size: 1.6em; line-height: 1; }
.tag.heute { background: var(--flaeche-fest); box-shadow: inset 0 0 0 3px var(--akzent); }
.tag.heute .wt { color: var(--akzent); }
.termin {
  border: 0; text-align: left; width: 100%; padding: 8px 10px; border-radius: 12px;
  background: color-mix(in oklch, var(--pfarbe, var(--akzent)) 18%, var(--flaeche-fest)); font-size: .8em; line-height: 1.25; display: flex; flex-direction: column; gap: 2px;
}
.termin .t-zeit { font-weight: 700; font-variant-numeric: tabular-nums; }
.tag .plus { margin-top: auto; border: 2px dashed var(--linie); background: none; border-radius: 12px; min-height: 48px; color: var(--tinte-2); font-size: 1.3em; }

.monat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.monat .wt-kopf { text-align: center; font-weight: 700; font-size: .8em; color: var(--tinte-2); padding: 4px 0; }
.mtag { background: var(--flaeche); border: 0; border-radius: 14px; min-height: 92px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.mtag.fremd { opacity: .45; }
.mtag.heute { box-shadow: inset 0 0 0 3px var(--akzent); }
.mtag .nr { font-weight: 700; }
.mtag .mini { font-size: .7em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border-radius: 6px; background: color-mix(in oklch, var(--pfarbe, var(--akzent)) 20%, transparent); }

@media (orientation: portrait), (max-width: 760px) {
  .woche { grid-template-columns: 1fr; }
  .tag { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tag-kopf { flex: 1; }
  .tag .termin { flex: 1 1 100%; order: 2; }
  .tag .plus { margin-top: 0; flex: 0 0 64px; order: 1; }
  .mtag { min-height: 64px; }
  .mtag .mini { display: none; }
  .mtag > .punkte { margin-top: auto; }
  .monat .mtag > .punkte.nur-handy { display: inline-flex; }
}
.mtag > .punkte.nur-handy { display: none; }

/* ---------- Einstellungen ---------- */
.einstellungen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: clamp(14px, 1.6vw, 22px); align-items: start; }
.person-reihe { display: grid; grid-template-columns: 80px 1fr; gap: 12px; margin-bottom: 12px; }
.farbwahl { display: flex; gap: 10px; margin: 0 0 18px; }
.farbwahl label { position: relative; }
.farbwahl input { position: absolute; opacity: 0; inset: 0; }
.farbwahl span { display: block; width: 48px; height: 48px; border-radius: 50%; box-shadow: inset 0 0 0 3px transparent; transition: transform .2s; }
.farbwahl input:checked + span { transform: scale(1.12); box-shadow: 0 0 0 3px var(--flaeche-fest), 0 0 0 6px var(--tinte); }
.hinweis { font-size: .8em; color: var(--tinte-2); margin: 8px 0 0; }

/* Bereichswechsel */
@keyframes ansicht-rein { from { opacity: 0; transform: translateY(14px); } }
.ansicht.wechsel > * { animation: ansicht-rein .5s cubic-bezier(.2, .8, .3, 1) both; }

/* Wischen: die Seite folgt dem Finger, der nächste Bereich kündigt sich am Rand an */
.ansicht { touch-action: pan-y; }
.ansicht.wird-gewischt { will-change: transform, opacity; }
.ansicht.wisch-raus { transition: transform .2s cubic-bezier(.4, 0, 1, 1), opacity .2s ease-in; pointer-events: none; }
.ansicht.wisch-zurueck { transition: transform .45s cubic-bezier(.2, 1.25, .4, 1), opacity .3s ease; }
@keyframes rein-von-rechts { from { opacity: 0; transform: translate3d(22vw, 0, 0); } }
@keyframes rein-von-links { from { opacity: 0; transform: translate3d(-22vw, 0, 0); } }
.ansicht.wechsel[data-richtung="vor"] > * { animation: rein-von-rechts .42s cubic-bezier(.15, .85, .25, 1) both; }
.ansicht.wechsel[data-richtung="zurueck"] > * { animation: rein-von-links .42s cubic-bezier(.15, .85, .25, 1) both; }
.wisch-hinweis {
  position: fixed; top: 46%; z-index: 4; pointer-events: none; opacity: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 14px; min-width: 92px; border-radius: 24px;
  background: var(--flaeche-fest); color: var(--tinte); font-weight: 700; font-size: 15px;
  box-shadow: 0 14px 34px -14px oklch(0.2 0.05 var(--hue) / .5);
}
.wisch-hinweis[data-seite="rechts"] { right: 14px; }
.wisch-hinweis[data-seite="links"] { left: 14px; }
.wisch-hinweis svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wisch-hinweis.weich { transition: opacity .25s ease, transform .25s ease; }

/* Kalender: Blättern */
@keyframes von-rechts { from { opacity: 0; transform: translateX(48px); } }
@keyframes von-links { from { opacity: 0; transform: translateX(-48px); } }
.blaettern-vor { animation: von-rechts .45s cubic-bezier(.2, .8, .3, 1); }
.blaettern-zurueck { animation: von-links .45s cubic-bezier(.2, .8, .3, 1); }

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}

/* Kalender-Kopfzeile auf dem Handy: oben Ansicht und „+“, darunter Blättern */
@media (max-width: 760px) {
  .kopf .kal-aktionen { width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .kopf .kal-aktionen .blaettern { grid-column: 1 / -1; grid-row: 2; }
  .kal-aktionen .blaettern [data-heute] { flex: 1; }
  .neu-termin { width: var(--tipp); padding: 0; }
  .neu-termin .nur-breit { display: none; }
}

/* ---------- Essen ---------- */
.suche-reihe { margin-bottom: 18px; display: flex; gap: 12px; align-items: center; }
.suche-reihe .eingabe.suche { flex: 1; min-width: 0; }
.fav-filter { flex: none; min-height: 64px; padding: 0 22px; gap: 8px; display: inline-flex; align-items: center; }
.fav-filter svg, .knopf svg.stern, [data-favorit] svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; flex: none; }
.fav-filter[aria-pressed="true"] svg, [data-favorit][aria-pressed="true"] svg { fill: currentColor; }
[data-favorit] { display: inline-flex; align-items: center; gap: 8px; }
.fav-stern {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,.9); color: #8a6a00; cursor: pointer;
}
.essen-bild .fav-stern svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.fav-stern[aria-pressed="true"] svg { fill: #e9b100; stroke: #8a6a00; }
@media (max-width: 640px) {
  .suche-reihe { flex-wrap: wrap; }
  .suche-reihe .eingabe.suche { flex: 1 1 100%; }
  .fav-filter { min-height: 52px; }
}
.eingabe.suche { border-radius: 999px; min-height: 64px; padding: 0 26px; }
.eingabe.mehrzeilig { min-height: 0; padding: 14px 18px; line-height: 1.45; resize: vertical; }

.essen-bild {
  display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--zart); border-radius: inherit;
}
.essen-bild { position: relative; }
.essen-bild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.essen-bild svg { width: 42px; height: 42px; fill: none; stroke: var(--tinte-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.essens-woche { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.essen-tag, .rezept-karte {
  border: 0; padding: 0; text-align: left; overflow: hidden; color: inherit;
  background: var(--flaeche);
  border-radius: var(--r-gross); display: flex; flex-direction: column;
  transition: transform .2s;
}
.essen-tag:active, .rezept-karte:active { transform: scale(.98); }
.essen-tag .essen-bild, .rezept-karte .essen-bild { border-radius: 0; }
.essen-tag.frei .essen-bild { background: transparent; border-bottom: 2px dashed var(--linie); }
.essen-tag.heute { box-shadow: inset 0 0 0 3px var(--akzent); }
.essen-text { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.essen-text .wt { font-size: .78em; font-weight: 700; color: var(--tinte-2); }
.essen-tag.heute .wt { color: var(--akzent); }
.essen-text .gericht, .karten-titel { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.essen-tag.frei .gericht { color: var(--tinte-2); font-weight: 500; }
.essen-text .personen { font-size: .78em; color: var(--tinte-2); }

.rezept-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.karten-titel { padding: 12px 16px 16px; }

.heute-abend { display: flex; align-items: center; gap: 16px; }
.heute-abend .essen-bild { width: 104px; flex: none; border-radius: 16px; }
.abend-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.abend-text .tag-titel { margin: 0; }
.abend-text .gericht { font-weight: 600; font-size: 1.05em; line-height: 1.25; }
.abend-text .leer { margin: 0; }
.abend-text .erinnerung {
  margin-top: 6px; padding: 6px 12px; border-radius: 10px; align-self: flex-start;
  background: color-mix(in oklch, var(--akzent) 16%, transparent); font-size: .88em; font-weight: 600; line-height: 1.3;
}
.vortag-wahl { margin: -6px 0 16px; }

.zeile .menge { font-weight: 700; }
.zeile .haupt .fuer { display: block; font-size: .78em; font-weight: 500; color: var(--tinte-2); }

/* Rezeptansicht im Dialog */
.dialog { overflow: auto; }
.dialog.breit { width: min(1080px, calc(100vw - 32px)); }
.rezept-ansicht h2 { font-family: var(--schrift-deko); font-weight: 500; font-size: 1.7em; line-height: 1.1; margin: 0 0 14px; }
.rezept-ansicht h3 { font-size: 1em; margin: 22px 0 6px; }
.rezept-bild { overflow: hidden; }
.rezept-bild .essen-bild { aspect-ratio: 16 / 10; border-radius: 0; display: block; }
.rezept-inhalt { padding: 24px 28px 0; }
.portionen { display: flex; align-items: center; gap: 12px; }
.portionen span { min-width: 7.5em; text-align: center; font-weight: 600; }
.portionen .knopf { font-size: 1.4em; }
.zutaten-liste { list-style: none; margin: 0; padding: 0; }
.zutaten-liste li { padding: 9px 0; border-bottom: 1px solid var(--linie); }
.schritte { margin: 0; padding-left: 1.3em; }
.schritte li { margin: 0 0 12px; line-height: 1.5; padding-left: 4px; }
.schritte li::marker { font-weight: 700; color: var(--akzent); }
.dialog-frei .fuss { display: flex; flex-wrap: wrap; gap: 12px; position: sticky; bottom: 0; background: var(--flaeche-fest); padding: 16px 0 22px; margin-top: 12px; }
@media (min-width: 900px) and (orientation: landscape) {
  .dialog.breit { overflow: hidden; }
  .rezept-ansicht { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: minmax(0, 1fr); height: min(calc(100dvh - 40px), 820px); }
  .rezept-bild .essen-bild { aspect-ratio: auto; height: 100%; }
  .rezept-ansicht > * { min-height: 0; }
  .rezept-inhalt { overflow: auto; }
}

/* Rezept auswählen */
.auswahl { padding: 24px 28px 0; }
.auswahl h2 { font-family: var(--schrift-deko); font-weight: 500; font-size: 1.5em; margin: 0 0 14px; }
.auswahl-liste { list-style: none; margin: 14px 0 0; padding: 0; }
.auswahl-zeile { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--linie); background: none; text-align: left; font-weight: 500; }
.auswahl-zeile .essen-bild { width: 92px; flex: none; border-radius: 12px; }
.link-import { padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--linie); }
.link-import .eingabe-reihe .eingabe, .link-import .eingabe-reihe .knopf { min-height: 56px; font-size: 1em; }
.foto-wahl { display: flex; align-items: center; gap: 16px; }
.foto-wahl .essen-bild { width: 132px; border-radius: 16px; }

/* Einkaufs-Vorschau */
.vorschau-liste { list-style: none; margin: 0; padding: 0; }
.vorschau-zeile { position: relative; display: flex; align-items: center; gap: 14px; min-height: 62px; border-bottom: 1px solid var(--linie); cursor: pointer; }
.vorschau-zeile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vorschau-zeile .kasten { width: 46px; height: 46px; flex: none; border-radius: 14px; border: 2.5px solid var(--tinte-2); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.vorschau-zeile .kasten svg { width: 26px; height: 26px; fill: none; stroke: var(--auf-akzent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .25s; }
.vorschau-zeile input:checked + .kasten { background: var(--akzent); border-color: var(--akzent); }
.vorschau-zeile input:checked + .kasten svg { stroke-dashoffset: 0; }
.vorschau-zeile input:focus-visible + .kasten { outline: 3px solid var(--akzent); outline-offset: 2px; }
.vorschau-zeile .text { flex: 1; }
.vorschau-zeile input:not(:checked) ~ .text { color: var(--tinte-2); }
.vorschau-zeile .herkunft { font-size: .78em; color: var(--tinte-2); }

@media (max-width: 760px) {
  .essen-tag { flex-direction: row; align-items: center; }
  .essen-tag .essen-bild { width: 120px; flex: none; align-self: stretch; aspect-ratio: auto; min-height: 90px; }
  .essen-tag.frei .essen-bild { border-bottom: 0; border-right: 2px dashed var(--linie); }
  .rezept-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .karten-titel { padding: 10px 12px 14px; font-size: .9em; }
  .auswahl, .rezept-inhalt { padding: 20px 18px 0; }
  .heute-abend .essen-bild { width: 88px; }
  .nav-link span { font-size: 11px; }
}
.rezept-ansicht { position: relative; }
.schliessen-x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--flaeche-fest); color: var(--tinte); font-size: 30px; line-height: 1;
  box-shadow: 0 4px 16px -6px oklch(0.2 0.05 var(--hue) / .4);
}
@media (max-width: 760px) {
  .dialog-frei .fuss { position: static; padding-bottom: 28px; }
  .dialog-frei .fuss .knopf { flex: 1 1 auto; }
}

/* ---------- Foto-Landschaft ----------
   Ebenen: Himmel → Sterne → Landschaft, darüber Farbton, Nacht und Licht.
   Stärke der Einfärbung über data-fototon am <html>. */
:root { --foto-grau: .85; --foto-ton: .72; }
:root[data-fototon="kraeftig"] { --foto-grau: 1; --foto-ton: .92; }
:root[data-fototon="natuerlich"] { --foto-grau: .25; --foto-ton: .28; }

.foto-landschaft { position: absolute; inset: 0; overflow: hidden; isolation: isolate; background: var(--himmel); }
.foto-ebenen {
  position: absolute; inset: 0;
  filter: grayscale(var(--foto-grau)) contrast(1.06);
}
@keyframes langsam-naeher { from { transform: scale(1); } to { transform: scale(1.06); } }
.foto-gruppe { position: absolute; inset: 0; transition: opacity 1.2s ease; }
.foto-gruppe.kommt { opacity: 0; }
.foto-gruppe canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
/* Tiefe: die Landschaft wandert beim Bereichswechsel weiter als der Himmel */
.foto-himmel, .foto-sterne { transform: translateX(calc((var(--shift) - 2.5) * -3px)) scale(1.1); }
.foto-land { transform: translateX(calc((var(--shift) - 2.5) * -11px)) scale(1.1); }
.foto-sternenebene { position: absolute; inset: 0; pointer-events: none; opacity: calc(var(--n) * .9); }

/* Farbton des Bereichs bzw. der Tageszeit über die Helligkeit des Fotos legen */
.foto-ton { position: absolute; inset: 0; background: var(--s2); mix-blend-mode: color; opacity: var(--foto-ton); }
.foto-nacht { position: absolute; inset: 0; background: oklch(0.24 0.06 262); mix-blend-mode: multiply; opacity: calc(var(--n) * .85); }
/* Oben läuft das Foto in die Himmelsfarbe aus (Uhr und Überschriften bleiben lesbar), unten leicht abgedunkelt */
.foto-licht {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--himmel) 0%, color-mix(in oklch, var(--himmel) 70%, transparent) 16%, transparent 42%),
    linear-gradient(to top, color-mix(in oklch, var(--s4) 45%, transparent) 0%, transparent 28%);
}
/* Bei Fotos: Flächen etwas deckender, damit Text vor unruhigen Stellen ruhig bleibt */
:root[data-stil="foto"] { --flaeche: oklch(calc(0.99 - var(--n) * 0.73) calc(0.012 * var(--cc) + var(--n) * 0.02) var(--hue) / calc(0.92 - var(--n) * 0.08)); }
:root[data-stil="foto"] .nav-link { color: var(--tinte); }
/* Navigation als Glasleiste, damit sie über dunklen Wald- und Seestellen lesbar bleibt */
:root[data-stil="foto"] .nav {
  top: 14px; bottom: 14px; left: 10px; width: calc(var(--nav-breite) - 18px); padding: 12px 8px;
  border-radius: var(--r-gross); background: var(--flaeche);
}
@media (orientation: portrait), (max-width: 760px) {
  :root[data-stil="foto"] .nav { top: auto; left: 0; width: auto; border-radius: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--flaeche-fest); }
  .foto-gruppe canvas { object-position: 45% 45%; }
}

/* Einstellungen: Fotos */
.foto-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.foto-karte { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--zart); }
.foto-karte img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.foto-karte figcaption { font-size: .62em; line-height: 1.3; padding: 6px 8px 8px; color: var(--tinte-2); }
.foto-karte figcaption a { color: inherit; }
.foto-karte.aus img { opacity: .35; filter: grayscale(1); }
/* Umzugs-Hinweis (nur unter der alten Netlify-Adresse) */
.umzug-leiste {
  position: fixed; z-index: 30; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 12px);
  max-width: 680px; margin: 0 auto; padding: 16px 18px; border-radius: var(--r-gross);
  background: var(--flaeche-fest); color: var(--tinte); outline: 3px solid var(--warn); outline-offset: -3px;
  box-shadow: 0 20px 50px -20px oklch(0.2 0.05 var(--hue) / .5); line-height: 1.4;
}
.umzug-leiste ol { margin: 8px 0 12px; padding-left: 1.3em; }
.umzug-leiste li { margin-bottom: 4px; }
.umzug-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.umzug-knoepfe .knopf { text-decoration: none; }

/* Rezepte: Filter, Kurzinfo, Notiz */
.suche-reihe { flex-wrap: wrap; }
.suche-reihe .eingabe.suche { flex: 1 1 320px; }
.filter-chips { gap: 8px; }
.filter-chips .chip, .filter-chips .fav-filter { min-height: 52px; padding: 0 18px; }
.karten-info { padding: 0 16px 14px; margin-top: -10px; font-size: .78em; color: var(--tinte-2); }
.rezept-info { margin: -6px 0 12px; color: var(--tinte-2); font-weight: 500; }
.rezept-notiz, .koch-notiz { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--zart); line-height: 1.4; }
.koch-notiz { margin: 8px 0 0; }
@media (max-width: 760px) {
  /* Filter in einer Reihe zum seitlichen Schieben statt drei Zeilen */
  .filter-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chips .chip { flex: none; min-height: 46px; }
  .karten-info { padding: 0 12px 12px; margin-top: -8px; }
}
.auswahl-name { display: flex; flex-direction: column; gap: 2px; }
.auswahl-name small { font-size: .78em; font-weight: 500; color: var(--tinte-2); }

/* Woche füllen */
.fuellen-zeile { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--linie); }
.fuellen-zeile .vorschau-zeile { flex: 1; min-width: 0; border-bottom: 0; padding: 8px 0; }
.fuellen-inhalt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; transition: opacity .2s; }
.fuellen-inhalt .essen-bild { width: 76px; flex: none; border-radius: 12px; }
.fuellen-inhalt .text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fuellen-inhalt .wt { font-size: .78em; font-weight: 700; color: var(--tinte-2); }
.fuellen-inhalt small { font-size: .78em; color: var(--tinte-2); }
.vorschau-zeile input:not(:checked) ~ .fuellen-inhalt { opacity: .45; }
@media (max-width: 760px) { .fuellen-inhalt .essen-bild { width: 56px; } }

/* Kochmodus: ganzer Bildschirm, ein Schritt groß */
.dialog.kochen {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.dialog.kochen .dialog-frei { height: 100%; }
.kochmodus { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; padding: 20px clamp(18px, 4vw, 48px) 16px; }
.koch-kopf { position: relative; padding-right: 64px; }
.koch-kopf .feld-titel { margin: 0 0 2px; }
.koch-kopf h2 { margin: 0; font-size: clamp(1.4em, 3vw, 2em); line-height: 1.1; }
.koch-kopf .schliessen-x { top: -4px; right: 0; }
.koch-inhalt { overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.koch-zutaten summary { cursor: pointer; font-weight: 700; padding: 12px 0; min-height: 44px; }
.koch-zutaten summary span { font-weight: 500; color: var(--tinte-2); }
.koch-zutaten .vorschau-zeile { min-height: 54px; }
.koch-zutaten .vorschau-zeile .kasten { width: 38px; height: 38px; border-radius: 12px; }
.koch-zutaten .vorschau-zeile input:not(:checked) ~ .text { color: var(--tinte); }
.koch-zutaten .vorschau-zeile input:checked ~ .text { color: var(--tinte-2); text-decoration: line-through; }
.koch-schritt { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 12px 0; touch-action: pan-y; user-select: none; }
.koch-zaehler { margin: 0 0 10px; font-weight: 700; color: var(--akzent); }
.koch-text { margin: 0; font-size: clamp(1.45em, 3.4vw, 2.3em); line-height: 1.35; font-weight: 500; text-wrap: pretty; }
.koch-fuss { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.koch-fuss .knopf { min-height: 64px; padding-inline: 22px; font-size: 1.05em; }
.koch-fuss [data-weiter] { margin-left: auto; min-width: 9em; }
.koch-fuss .knopf svg { width: 22px; height: 22px; }
.koch-punkte { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.koch-punkte span { width: 8px; height: 8px; border-radius: 50%; background: var(--linie); transition: background .2s; }
.koch-punkte span.an { background: var(--akzent); }
@media (min-width: 900px) and (orientation: landscape) {
  .koch-inhalt { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(0, 2fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
  .koch-zutaten { position: sticky; top: 0; }
  .koch-schritt { min-height: 100%; }
}
@media (max-width: 760px) {
  .koch-fuss .knopf { flex: 1; }
  .koch-fuss [data-weiter] { min-width: 0; }
  .koch-punkte { display: none; }
}

.schliessen-x.klein { width: 40px; height: 40px; font-size: 24px; top: 6px; right: 6px; }
.schalter-zeile { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-top: 8px; font-weight: 500; cursor: pointer; }
.schalter-zeile input { width: 26px; height: 26px; accent-color: var(--akzent); }

/* ---------- Wochenplan Essen: Mo–So, Tauschen, Auswärts ---------- */
.woche-leiste { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin: -6px 0 18px; }
.wochen-titel { font-weight: 600; min-width: 10.5em; text-align: center; align-self: center; }
.essen-tag { position: relative; cursor: pointer; }
.essen-tag.vorbei { opacity: .55; }
.essen-tag.auswaerts .essen-bild { background: color-mix(in oklch, var(--akzent) 13%, transparent); }
.essen-tag.auswaerts .essen-bild svg, .auswaerts-bild svg { width: 46px; height: 46px; stroke: var(--akzent); stroke-width: 1.7; }
.essen-tag.auswaerts .gericht { font-style: italic; }
.auswaerts-bild { background: color-mix(in oklch, var(--akzent) 13%, transparent); }
.auswaerts-bild svg { width: 36px; height: 36px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.griff {
  position: absolute; top: 8px; right: 8px; width: 46px; height: 46px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--flaeche-fest); color: var(--tinte-2);
  box-shadow: 0 3px 10px -4px oklch(0.2 0.05 var(--hue) / .35);
  touch-action: none; cursor: grab;
}
.griff svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
/* Ziehen */
.zieh-geist { position: fixed; z-index: 60; margin: 0; pointer-events: none; opacity: .96; transition: none !important; animation: none !important;
  box-shadow: 0 24px 48px -16px oklch(0.15 0.05 var(--hue) / .55); }
.essen-tag.wird-gezogen { opacity: .3; }
.essen-tag.drueber { outline: 3px solid var(--akzent); outline-offset: 3px; transform: scale(1.03); transition: transform .15s; }
body.zieht, body.zieht * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
@keyframes getauscht { 0% { transform: scale(.92); box-shadow: 0 0 0 4px var(--akzent); } 60% { transform: scale(1.03); } 100% { transform: none; box-shadow: none; } }
.essen-tag.getauscht { animation: getauscht .55s cubic-bezier(.3, 1.4, .5, 1); }
/* Tauschen per Antippen */
.tausch-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 18px; }
.tausch-banner > span { flex: 1; display: flex; align-items: center; gap: 10px; }
.tausch-banner svg, .knopf-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@keyframes ziel-puls { 50% { outline-color: color-mix(in oklch, var(--akzent) 35%, transparent); } }
.tausch-modus .essen-tag:not(.quelle) { outline: 3px dashed var(--akzent); outline-offset: 2px; animation: ziel-puls 1.6s ease-in-out infinite; }
.tausch-modus .essen-tag.quelle { box-shadow: 0 0 0 4px var(--akzent); transform: scale(.97); }
.tausch-modus .griff { display: none; }
/* Auswahl-Dialog */
.auswaerts-wahl .chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.frei-reihe { margin-top: 12px; }
.frei-reihe .eingabe { min-height: 60px; font-size: 1em; }
.frei-reihe .knopf { min-height: 60px; }
.eingetragen { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r); background: color-mix(in oklch, var(--akzent) 12%, transparent); }
.eingetragen svg { width: 26px; height: 26px; fill: none; stroke: var(--akzent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Querformat (Tablet): die Woche als eine Reihe von 7 Tagen */
@media (orientation: landscape) and (min-width: 1000px) {
  .essens-woche { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
  .essens-woche .essen-text { padding: 10px 12px 14px; }
  .essens-woche .gericht { font-size: .92em; }
  .essens-woche .essen-tag .essen-bild { aspect-ratio: 1 / 1; }
}
/* Hochformat und Handy: ein Tag pro Zeile */
@media (orientation: portrait), (max-width: 999px) {
  .essens-woche { grid-template-columns: 1fr; gap: 10px; }
  .essens-woche .essen-tag { flex-direction: row; align-items: center; min-height: 96px; }
  .essens-woche .essen-tag .essen-bild { width: 132px; flex: none; align-self: stretch; aspect-ratio: auto; min-height: 96px; }
  .essens-woche .essen-tag.frei .essen-bild { border-bottom: 0; border-right: 2px dashed var(--linie); }
  .essens-woche .essen-text { padding-right: 70px; }
  .essens-woche .griff { top: 50%; right: 12px; transform: translateY(-50%); }
}
@media (max-width: 760px) {
  .essens-woche .essen-tag .essen-bild { width: 104px; }
  .woche-leiste .blaettern { width: 100%; justify-content: space-between; }
}

/* Abgleich-Status */
.abgleich-punkt { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: middle; background: var(--p-gruen); }
.abgleich-punkt.warn { background: var(--warn); }
.abgleich-punkt.laeuft { background: var(--akzent); animation: blinken 1s steps(1) infinite; }

/* Hinweis, wenn der Gerätespeicher (noch) nicht bereit ist */
.speicher-hinweis {
  position: fixed; z-index: 100; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); padding: 18px 22px; border-radius: var(--r);
  background: var(--flaeche-fest); color: var(--tinte); box-shadow: 0 16px 40px -12px oklch(0.2 0.05 var(--hue) / .5);
  outline: 2px solid var(--warn); outline-offset: -2px; line-height: 1.45;
}
.speicher-hinweis strong { display: block; margin-bottom: 4px; }

/* Handy: weniger Verschiebung, sonst sieht man bei schmalem Bild den Rand der Foto-Ebene */
@media (max-width: 760px) {
  .foto-himmel, .foto-sterne { transform: translateX(calc((var(--shift) - 2.5) * -1px)) scale(1.1); }
  .foto-land { transform: translateX(calc((var(--shift) - 2.5) * -5px)) scale(1.1); }
}

/* Zutaten-Auswahl: „Alle“ / „Keine“ */
.wahl-knoepfe { margin: 0 0 10px; }
.wahl-knoepfe .chip { min-height: 46px; padding: 0 18px; }

/* ---------- Ausgaben ---------- */
:root[data-display="1"] .nav-link[data-view="ausgaben"] { display: none; }
.monat-titel { align-self: center; min-width: 9.5em; text-align: center; font-weight: 700; }
.ausgaben-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(14px, 1.6vw, 22px); align-items: start; }
.ausgaben-raster > .spalte { align-content: start; }
@media (max-width: 900px) { .ausgaben-raster { grid-template-columns: minmax(0, 1fr); } }
.ausgaben-raster > .leer-gross { grid-column: 1 / -1; }
.ausgaben-raster > .spalte > .leer-gross { grid-column: auto; }

/* Verlauf: gestapelte Säulen der letzten Monate */
.verlauf { --f-laufend: var(--akzent); --f-fest: color-mix(in oklch, var(--akzent) 55%, var(--flaeche-fest)); }
.verlauf-legende { display: flex; gap: 18px; margin: -4px 0 10px; font-size: .8em; color: var(--tinte-2); }
.verlauf-legende span { display: inline-flex; align-items: center; gap: 7px; }
.verlauf-legende i { width: 12px; height: 12px; border-radius: 3px; }
.verlauf .teil-laufend { background: var(--f-laufend); }
.verlauf .teil-fest { background: var(--f-fest); }
.saeulen { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; height: 190px; border-bottom: 1px solid var(--linie); }
.saeule { display: grid; grid-template-rows: auto minmax(0, 1fr); background: none; border: 0; padding: 0; color: inherit;
  border-radius: 12px; position: relative; min-width: 0; transition: background .2s; }
.saeule-wert { font-size: .62em; font-weight: 600; color: var(--tinte-2); text-align: center; white-space: nowrap; padding: 2px 0 4px;
  font-variant-numeric: tabular-nums; min-height: 1.6em; display: flex; align-items: flex-end; justify-content: center; }
.saeule-stapel { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; min-height: 0; }
.saeule-stapel i { display: block; width: min(24px, 70%); flex: none; min-height: 3px; }
.saeule-stapel i:first-child { border-radius: 4px 4px 0 0; }
.saeule-monat { position: absolute; left: 0; right: 0; bottom: -1.7em; text-align: center; font-size: .7em; color: var(--tinte-2); }
.saeulen { margin-bottom: 1.9em; }
.saeule.gewaehlt { background: var(--zart); }
.saeule.gewaehlt .saeule-wert, .saeule.gewaehlt .saeule-monat { color: var(--tinte); font-weight: 800; }
@media (hover: hover) { .saeule:hover { background: var(--zart); } }
.summe-gross { font-family: var(--schrift-deko); font-size: 2.6em; font-weight: 500; line-height: 1.1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.summe-teile { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0; color: var(--tinte-2); font-size: .9em; }
.summe-teile span { display: inline-flex; align-items: center; gap: 6px; }
.summe-vergleich { margin: 8px 0 0; font-size: .9em; color: var(--tinte-2); }
.summe-vergleich .diff-plus { color: var(--warn); font-weight: 700; }
.summe-vergleich .diff-minus { color: var(--akzent); font-weight: 700; }

.kat-symbol { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in oklch, var(--kfarbe) 22%, transparent); color: var(--tinte); }
.kat-symbol svg, .kat-wahl svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.kat-balken { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.kat-balken button { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px;
  align-items: center; padding: 8px; border: 0; border-radius: 14px; background: none; color: inherit; text-align: left; font: inherit; }
.kat-balken button[aria-pressed="true"] { background: color-mix(in oklch, var(--kfarbe) 18%, transparent); }
.kat-balken .kat-symbol { grid-row: 1 / 3; }
.kat-balken .kat-name { font-weight: 600; }
.kat-balken .kat-betrag { font-variant-numeric: tabular-nums; font-weight: 600; }
.kat-balken .balken { grid-column: 2 / 4; height: 8px; border-radius: 99px; background: var(--linie); overflow: hidden; }
.kat-balken .balken i { display: block; height: 100%; border-radius: inherit; background: var(--kfarbe); }

.ausgabe-zeile { gap: 12px; }
.ausgabe-betrag { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.flaeche h2 .knopf.klein, .knopf.klein { min-height: 36px; padding: 0 14px; font-size: .9em; }
.fix-summe { margin: 4px 0 10px; }

.betrag-feld { display: flex; align-items: center; gap: 10px; }
.betrag-eingabe { font-size: 2em !important; font-weight: 600; min-height: 72px !important; text-align: right; font-variant-numeric: tabular-nums; }
.betrag-feld > span { font-size: 1.6em; font-weight: 600; color: var(--tinte-2); }
.kat-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.kat-wahl label { position: relative; }
.kat-wahl input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.kat-wahl input + span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px 6px;
  border-radius: 16px; text-align: center; font-size: .82em; font-weight: 600; line-height: 1.15;
  background: color-mix(in oklch, var(--kfarbe) 16%, var(--flaeche-fest)); border: 2px solid transparent; }
.kat-wahl input:checked + span { border-color: var(--kfarbe); background: color-mix(in oklch, var(--kfarbe) 40%, var(--flaeche-fest)); }
.kat-wahl input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 2px; }
@media (max-width: 420px) { .kat-wahl { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.ausgaben-kachel { display: flex; align-items: center; gap: 16px; }
.ausgaben-kachel .abend-text { flex: 1; }
.ausgaben-kachel .gericht { font-family: var(--schrift-deko); font-size: 1.6em; font-weight: 500; }
@media (orientation: portrait), (max-width: 760px) { .start [data-ausgaben] { order: 4; } }
.ausgaben-kachel[hidden] { display: none; }

/* ---------- Belege ---------- */
.beleg-knopf svg, .beleg-waehlen svg, .beleg-marke svg, .beleg-anderswo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.beleg-knopf, .beleg-waehlen { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.beleg-bereich { margin-bottom: 14px; }
.beleg-waehlen { width: 100%; justify-content: center; border: 2px dashed var(--linie); background: transparent; }
.beleg-bereich:has(.beleg-vorschau) { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 18px; background: var(--zart); }
.beleg-vorschau { flex: none; width: 76px; height: 96px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px -3px oklch(0.2 0.05 var(--hue) / .4); }
.beleg-vorschau img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.beleg-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.beleg-info .hinweis { margin: 0; }
.beleg-aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.beleg-anderswo { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.beleg-status { margin: -4px 0 14px; padding: 10px 14px; border-radius: 14px; font-size: .9em; font-weight: 600; background: var(--zart); }
.beleg-status[data-art="laeuft"]::before { content: ''; display: inline-block; width: .9em; height: .9em; margin-right: 10px; vertical-align: -2px;
  border: 2.5px solid var(--linie); border-top-color: var(--akzent); border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.beleg-status[data-art="ok"] { background: color-mix(in oklch, var(--akzent) 14%, transparent); }
.beleg-status[data-art="warn"] { background: color-mix(in oklch, var(--warn) 14%, transparent); }
/* Aus dem Beleg übernommen: markiert, bis man das Feld selbst anfasst */
.feld.aus-beleg > span:first-child::after, .feld.aus-beleg > .feld-titel::after { content: ' · aus dem Beleg'; color: var(--akzent); font-weight: 700; }
.feld.aus-beleg .eingabe { box-shadow: 0 0 0 3px color-mix(in oklch, var(--akzent) 45%, transparent); }
form.liest .fuss button[type="submit"] { opacity: .5; }
.beleg-marke { display: inline-flex; align-items: center; gap: 4px; }
.beleg-marke svg { width: 15px; height: 15px; }
.beleg-gross { position: fixed; inset: 0; z-index: 10; background: oklch(0.15 0.02 var(--hue) / .92); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; overflow: auto; }
.beleg-gross img { max-width: 100%; height: auto; border-radius: 8px; background: #fff; }
.beleg-gross .knopf { position: sticky; bottom: 0; flex: none; }
/* Ausgaben-Kopf auf dem Handy: Monat oben, darunter Feste Kosten | Beleg | + Ausgabe in einer Reihe */
@media (max-width: 560px) {
  .kopf:has([data-beleg-neu]) .aktionen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-left: 0; }
  .kopf:has([data-beleg-neu]) .blaettern { grid-column: 1 / -1; justify-content: space-between; }
  .kopf:has([data-beleg-neu]) .aktionen > .knopf { padding: 0 6px; gap: 6px; justify-content: center; white-space: nowrap; font-size: .82em; min-width: 0; }
  .kopf:has([data-beleg-neu]) .aktionen > .knopf svg { width: 20px; height: 20px; }
}
