/* SchmauseKiste – warmes Papier, Orange, Fraunces + Figtree */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('fonts/fraunces.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 500 600; font-display: swap; src: url('fonts/fraunces-italic.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/figtree.woff2') format('woff2'); }

:root {
  --paper: #fbf7f1; --paper-2: #f3ece2; --card: #ffffff; --ink: #17130f; --muted: #6b5f55; --line: #e6dccf;
  --orange: #ee7518; --orange-ink: #b85407; --on-orange: #17130f; --bar: #17130f; --on-bar: #f6efe6;
  --herz: #e0405e; --gruen: #3f7d3a; --shadow: 0 14px 34px -18px rgba(60, 35, 10, .35);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif; --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --radius: 18px;
  --t-pasta: #fde3cc; --t-reis: #fbefc4; --t-kartoffel: #f1e3cf; --t-suppe: #d9efe9; --t-fisch: #dbe9f6; --t-brot: #ece0f3; --t-auflauf: #f9dcd6; --t-suess: #fadbe6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14110e; --paper-2: #1c1813; --card: #211c17; --ink: #f4ede4; --muted: #b5a797; --line: #342b23;
    --orange: #f2873a; --orange-ink: #f6a465; --on-orange: #17130f; --bar: #0b0907; --on-bar: #f4ede4; --herz: #ff6b86; --gruen: #8fc786;
    --shadow: 0 14px 34px -18px rgba(0, 0, 0, .7);
    --t-pasta: #3a2412; --t-reis: #352c12; --t-kartoffel: #33261a; --t-suppe: #13292c; --t-fisch: #142636; --t-brot: #251a36; --t-auflauf: #3a1a14; --t-suess: #3a1424;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14110e; --paper-2: #1c1813; --card: #211c17; --ink: #f4ede4; --muted: #b5a797; --line: #342b23;
  --orange: #f2873a; --orange-ink: #f6a465; --on-orange: #17130f; --bar: #0b0907; --on-bar: #f4ede4; --herz: #ff6b86; --gruen: #8fc786;
  --shadow: 0 14px 34px -18px rgba(0, 0, 0, .7);
  --t-pasta: #3a2412; --t-reis: #352c12; --t-kartoffel: #33261a; --t-suppe: #13292c; --t-fisch: #142636; --t-brot: #251a36; --t-auflauf: #3a1a14; --t-suess: #3a1424;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--orange-ink); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--orange-ink); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

#app { padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left)); max-width: 720px; margin: 0 auto; }
.laden-start { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: dreh 0.8s linear infinite; display: inline-block; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Kopf */
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 0 16px; }
.kopf .eyebrow { margin-bottom: 6px; }
.eyebrow { font: 700 .72rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--orange-ink); }
.muted { color: var(--muted); }
.klein { font-size: .88rem; }
.zurueck { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; color: var(--orange-ink); font-weight: 700; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font: 700 .95rem/1 var(--body); padding: .9em 1.25em; border-radius: 999px; border: 2px solid transparent; background: var(--paper-2); color: var(--ink); text-decoration: none; transition: transform .15s, background .2s; min-height: 46px; }
.btn:active { transform: scale(.97); }
.btn-primaer { background: var(--orange); color: var(--on-orange); box-shadow: 0 10px 22px -12px rgba(238, 117, 24, .9); }
.btn-rand { border-color: var(--line); background: transparent; }
.btn-klein { padding: .55em .9em; min-height: 36px; font-size: .85rem; }
.btn-breit { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; }
.knopfreihe > .btn { flex: 1 1 auto; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* Karten */
.karte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.karte + .karte, .abschnitt + .abschnitt { margin-top: 14px; }
.abschnitt { margin-top: 22px; }
.abschnitt > h2, .abschnitt > .zeile-titel { margin-bottom: 10px; }
.zeile-titel { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hinweis { background: var(--paper-2); border-radius: 14px; padding: 12px 14px; font-size: .92rem; color: var(--muted); }
.hinweis strong { color: var(--ink); }

/* Rezept-Kachel */
.kachel { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: var(--t-pasta); }
.kachel.gross { width: 100%; height: 150px; border-radius: 22px; font-size: 76px; }
.art-pasta { background: var(--t-pasta); } .art-reis { background: var(--t-reis); } .art-kartoffel { background: var(--t-kartoffel); } .art-suppe { background: var(--t-suppe); }
.art-fisch { background: var(--t-fisch); } .art-brot { background: var(--t-brot); } .art-auflauf { background: var(--t-auflauf); } .art-suess { background: var(--t-suess); }

.rezept-zeile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.rezept-zeile + .rezept-zeile { margin-top: 10px; }
.rezept-zeile .text { flex: 1; min-width: 0; }
.rezept-zeile .name { font-weight: 700; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .82rem; color: var(--muted); margin-top: 4px; align-items: center; }
.marke { display: inline-flex; align-items: center; gap: 4px; font: 700 .72rem/1 var(--body); padding: 4px 8px; border-radius: 999px; background: var(--paper-2); color: var(--muted); white-space: nowrap; }
.marke.neu { background: #e9f4e6; color: #2f6b2a; }
.marke.herz { background: #fde4ea; color: #b4213f; }
.marke.angebot { background: #fff0dd; color: var(--orange-ink); }
.marke.goenn { background: #f3e6ff; color: #6b3aa0; }
.marke.ki { background: #e3eefc; color: #2a5ba8; }
.marke.warnung { background: #fde8e4; color: #a3321b; }
.marke.geraet { background: #e8f1f1; color: #2b6466; }
.schritt-punkte { display: flex; gap: 6px; }
.schritt-punkte span { width: 28px; height: 4px; border-radius: 2px; background: var(--line); }
.schritt-punkte span.an { background: var(--orange); }
.hinweis.warnung { background: #fde8e4; color: #a3321b; }
.hinweis.warnung strong { color: inherit; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .marke.neu { background: #1f3320; color: #9fd896; } :root:not([data-theme="light"]) .marke.herz { background: #3a1822; color: #ff9fb1; } :root:not([data-theme="light"]) .marke.angebot { background: #3a2412; color: #f6a465; } :root:not([data-theme="light"]) .marke.goenn { background: #2c1d3d; color: #d1b0f5; } :root:not([data-theme="light"]) .marke.ki { background: #172a42; color: #9cc2f5; } :root:not([data-theme="light"]) .marke.geraet { background: #173033; color: #8fd0d2; } :root:not([data-theme="light"]) .marke.warnung, :root:not([data-theme="light"]) .hinweis.warnung { background: #3d1c15; color: #ffab97; } }

/* Heute */
.heute-karte { padding: 0; overflow: hidden; }
.heute-karte .kachel.gross { border-radius: 0; height: 170px; }
.heute-karte .inhalt { padding: 16px; display: grid; gap: 12px; }
.heute-karte h2 { font-size: 1.6rem; }
.leer { text-align: center; padding: 28px 16px; display: grid; gap: 12px; justify-items: center; }
.leer .gross-emoji { font-size: 52px; }

/* Woche */
.wochenkopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pfeil { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.umschalter { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px; }
.umschalter button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.umschalter button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); }
.tag { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: stretch; }
.tag + .tag { margin-top: 10px; }
.tag-datum { display: grid; place-content: center; text-align: center; border-radius: 14px; background: var(--paper-2); line-height: 1.1; }
.tag-datum b { font-size: 1.25rem; font-family: var(--display); }
.tag-datum span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tag.ist-heute .tag-datum { background: var(--orange); color: var(--on-orange); }
.tag.ist-heute .tag-datum span { color: var(--on-orange); }
.tag-datum small { display: block; font-size: .64rem; font-weight: 700; margin-top: 3px; color: var(--orange-ink); }
.tag.ist-heute .tag-datum small { color: var(--on-orange); }
.tag .rezept-zeile { margin: 0; }
.tag-leer { width: 100%; border: 2px dashed var(--line); border-radius: var(--radius); background: transparent; padding: 18px; color: var(--muted); font-weight: 700; text-align: left; }
.tag-frei { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); padding: 18px; color: var(--muted); text-align: left; }
.statistik { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }

.monat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.monat .wt { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.monat button { aspect-ratio: 1 / 1.15; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 3px; display: grid; grid-template-rows: auto 1fr; justify-items: center; align-items: center; font-size: .72rem; min-width: 0; }
.monat button .e { font-size: 1.35rem; line-height: 1; }
.monat button.aus { opacity: .35; }
.monat button.heute { border: 2px solid var(--orange); }
.monat button.vergangen { background: var(--paper-2); }

/* Einkauf */
.fortschritt { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin: 8px 0 4px; }
.fortschritt span { display: block; height: 100%; background: var(--orange); border-radius: 99px; transition: width .3s; }
.hinzu { display: flex; gap: 8px; margin: 14px 0 4px; }
.hinzu input { flex: 1; min-width: 0; }
.gruppe { margin-top: 18px; }
.gruppe h3 { font-family: var(--body); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.posten { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); }
.liste { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.liste .posten:last-child { border-bottom: 0; }
.haken { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; background: var(--paper); }
.posten.erledigt .haken { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.posten.erledigt .p-name { text-decoration: line-through; color: var(--muted); }
.posten .p-text { flex: 1; min-width: 0; }
.p-name { font-weight: 600; }
.p-fuer { display: block; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-menge { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.posten .weg { border: 0; background: none; color: var(--muted); padding: 6px; }

/* Formulare */
input[type="text"], input[type="search"], input[type="date"], input[type="password"], select, textarea { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
label.feld { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; }
.felder { display: grid; gap: 12px; }
.felder-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; }

.regler { display: grid; gap: 8px; }
.regler-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.regler-wert { font: 600 1.5rem/1 var(--display); color: var(--orange-ink); }
input[type="range"] { width: 100%; accent-color: var(--orange); height: 32px; }
.regler-skala { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--paper-2); border-radius: 999px; padding: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--card); font-size: 1.2rem; font-weight: 700; }
.stepper output { min-width: 36px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.einstellung { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.einstellung:last-child { border-bottom: 0; }

/* Herzen */
.herzen { display: flex; flex-wrap: wrap; gap: 8px; }
.herz-knopf { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--card); padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .88rem; }
.herz-knopf svg { width: 18px; height: 18px; color: var(--muted); }
.herz-knopf[aria-pressed="true"] { border-color: var(--herz); background: color-mix(in srgb, var(--herz) 12%, var(--card)); }
.herz-knopf[aria-pressed="true"] svg { color: var(--herz); fill: var(--herz); animation: poch .35s ease; }
@keyframes poch { 50% { transform: scale(1.35); } }

/* Rezept-Ansicht */
.rezept-kopf { display: grid; gap: 12px; }
.trick { background: color-mix(in srgb, var(--gruen) 12%, var(--card)); border-radius: 14px; padding: 12px 14px; font-size: .94rem; }
.trick b { color: var(--gruen); }
.zutaten { list-style: none; padding: 0; margin: 0; }
.zutaten li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.zutaten li.vorrat { color: var(--muted); }
.zutaten li span:last-child { font-weight: 700; white-space: nowrap; }
.schritte { padding-left: 0; margin: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.schritte li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.schritte li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: var(--on-orange); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.tageswahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.tageswahl button { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 4px; font-size: .8rem; line-height: 1.25; }
.tageswahl button b { display: block; font-size: .95rem; }
.tageswahl button.belegt { color: var(--muted); }

/* Angebote */
.markt-karte { display: grid; gap: 10px; }
.markt-karte .zeile-titel h3 { font-size: 1.1rem; }
.datei { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); }
.datei .dn { flex: 1; min-width: 0; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.angebot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.angebot:last-child { border-bottom: 0; }
.angebot .preis { font-weight: 700; color: var(--orange-ink); white-space: nowrap; }

/* Familie / Login */
.login { min-height: 82dvh; display: grid; align-content: center; gap: 22px; padding: 20px 0; }
.login .titel { display: grid; gap: 10px; }
.login h1 { font-size: 2.6rem; }
.login-logo { width: 84px; height: auto; color: var(--ink); margin-bottom: 4px; }
.schluessel-anzeige { font: 700 1.5rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; background: var(--paper-2); border: 2px dashed var(--orange); border-radius: 14px; padding: 14px; text-align: center; word-break: break-all; }
.mitglied-liste { display: grid; gap: 8px; }
.trenner { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.haken-feld { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.haken-feld input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--orange); flex: none; }
.rechts-links { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 18px; }
.rechts-links a { color: var(--muted); }
input[type="email"] { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; }

/* Tableiste */
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left)); }
.tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding: 6px 0; font: 700 .7rem/1 var(--body); color: var(--muted); position: relative; }
.tabs button svg { width: 25px; height: 25px; }
.tabs button[aria-current="page"] { color: var(--orange-ink); }
.tabs .zahl { position: absolute; top: 0; left: calc(50% + 8px); background: var(--orange); color: var(--on-orange); border-radius: 99px; font-size: .65rem; padding: 2px 6px; }

/* Bottom-Sheet */
.sheet-huelle { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; justify-items: center; }
.sheet-hintergrund { position: absolute; inset: 0; background: rgba(20, 12, 5, .45); animation: einblenden .2s ease; }
.sheet { position: relative; width: 100%; max-width: 720px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-radius: 24px 24px 0 0; padding: 8px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left)); animation: hoch .28s cubic-bezier(.2, .8, .2, 1); }
.sheet-griff { display: block; width: 100%; height: 22px; border: 0; background: none; position: sticky; top: -8px; z-index: 2; }
.sheet-griff::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 6px auto; }
#sheet-inhalt { display: grid; gap: 16px; }
@keyframes hoch { from { transform: translateY(40%); opacity: 0; } }
@keyframes einblenden { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--bar); color: var(--on-bar); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.zeigen { opacity: 1; transform: translate(-50%, 0); }
.wartet { position: fixed; inset: 0; z-index: 70; background: rgba(20, 12, 5, .5); display: grid; place-items: center; }
.wartet .karte { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 300px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 760px) { #app { padding-top: 28px; } }
