/* Kochbuch – Aussehen. Für das iPhone gebaut (auch als App auf dem Home-Bildschirm). */
:root {
  --papier: #faf6f0;
  --karte: #ffffff;
  --tinte: #2b2420;
  --grau: #7a7067;
  --hell: #efe7dc;
  --linie: #e6ddd3;
  --akzent: #b4532a;
  --akzent-hell: #f6e3d8;
  --salbei: #5f7a5a;
  --p-gemeinsam: #b4532a;
  --p-christa: #8e3b78;
  --p-dennis: #2563b0;
  --rot: #b3261e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --unten: env(safe-area-inset-bottom, 0px);
  --oben: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--papier); color: var(--tinte); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
body { padding-top: var(--oben); }
a { color: var(--akzent); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--tinte); }
img { display: block; max-width: 100%; }
.laden { padding: 40vh 20px 0; text-align: center; color: var(--grau); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }

/* ---------- Rahmen ---------- */
.seite { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(96px + var(--unten)); }
.kopf { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; min-height: 40px; }
.kopf h1 { font-size: 28px; flex: 1; }
.kopf .zurueck { border: 0; background: none; font-size: 17px; color: var(--akzent); padding: 8px 4px; display: flex; align-items: center; gap: 2px; }
.kopf .rechts { margin-left: auto; display: flex; gap: 6px; }
.unterzeile { color: var(--grau); font-size: 14px; }

.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(250, 246, 240, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--linie);
  display: flex; justify-content: center; padding-bottom: var(--unten); }
.leiste a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; text-decoration: none; color: var(--grau); font-size: 11px; font-weight: 500; position: relative; }
.leiste a.aktiv { color: var(--akzent); }
.leiste svg { width: 25px; height: 25px; }
.leiste .zahl { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--akzent); color: #fff; border-radius: 9px;
  font-size: 10px; min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 4px; }

.plus { position: fixed; right: max(18px, calc(50% - 362px)); bottom: calc(74px + var(--unten)); z-index: 19; width: 56px; height: 56px;
  border-radius: 50%; border: 0; background: var(--akzent); color: #fff; font-size: 30px; line-height: 1;
  box-shadow: 0 6px 18px rgba(180, 83, 42, .35); display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------- Knöpfe & Felder ---------- */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--linie); background: var(--karte);
  border-radius: 11px; padding: 10px 14px; font-weight: 550; font-size: 15px; text-decoration: none; color: var(--tinte); min-height: 44px; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.zart { background: var(--akzent-hell); border-color: transparent; color: var(--akzent); }
.knopf.gefahr { color: var(--rot); }
.knopf.klein { min-height: 34px; padding: 6px 10px; font-size: 14px; border-radius: 9px; }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .5; }
.rund { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie); background: var(--karte); display: inline-flex;
  align-items: center; justify-content: center; font-size: 20px; padding: 0; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; }

.feld { display: block; margin-bottom: 14px; }
.feld > span { display: block; font-size: 13px; font-weight: 600; color: var(--grau); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }
.feld small { display: block; color: var(--grau); font-size: 13px; margin-top: 4px; }
.eingabe { width: 100%; border: 1px solid var(--linie); background: var(--karte); border-radius: 11px; padding: 11px 12px; outline: none; }
.eingabe:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }
textarea.eingabe { resize: vertical; min-height: 120px; line-height: 1.5; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drei { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 10px; }

.suche { position: relative; margin-bottom: 10px; }
.suche input { padding-left: 38px; border-radius: 12px; background: var(--hell); border-color: transparent; }
.suche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--grau); }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--linie); background: var(--karte); border-radius: 20px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.chip.an { background: var(--tinte); color: #fff; border-color: var(--tinte); }

/* ---------- Rezeptliste ---------- */
.gruppe { margin: 18px 0 8px; font-family: var(--serif); font-size: 19px; display: flex; align-items: baseline; gap: 8px; }
.gruppe small { font-family: var(--sans); color: var(--grau); font-size: 13px; }
.karten { display: grid; gap: 10px; }
@media (min-width: 620px) { .karten { grid-template-columns: 1fr 1fr; } }
.rkarte { display: flex; gap: 12px; align-items: center; background: var(--karte); border-radius: var(--radius); padding: 10px; text-decoration: none;
  color: inherit; border: 1px solid var(--linie); min-height: 76px; }
.rkarte .bild { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--hell) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 28px; }
.rkarte .t { font-weight: 600; font-size: 16px; line-height: 1.25; }
.rkarte .m { color: var(--grau); font-size: 13px; margin-top: 3px; }
.stern { color: #d99a1e; }
.leer { text-align: center; color: var(--grau); padding: 40px 10px; }
.leer .gross { font-size: 46px; }

/* ---------- Rezept ansehen ---------- */
.titelbild { margin: 0 -16px 14px; height: 260px; background: var(--hell) center/cover no-repeat; position: relative; }
@media (min-width: 760px) { .titelbild { margin: 0 0 14px; border-radius: var(--radius); height: 340px; } }
.rtitel { font-size: 30px; margin-bottom: 6px; }
.rinfo { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--grau); font-size: 14px; margin-bottom: 14px; }
.aktionen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 18px; }
.aktionen button, .aktionen a { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--linie); background: var(--karte);
  border-radius: 12px; padding: 9px 2px 7px; font-size: 12px; font-weight: 550; text-decoration: none; color: var(--tinte); }
.aktionen svg { width: 22px; height: 22px; color: var(--akzent); }
.block { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.block h2 { font-size: 21px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.portionen { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; background: var(--akzent-hell); border-radius: 12px; padding: 6px 8px; }
.portionen .wert { flex: 1; text-align: center; font-weight: 650; color: var(--akzent); }
.portionen .wert small { display: block; font-weight: 400; font-size: 12px; color: var(--grau); }
.portionen .rund { border-color: transparent; color: var(--akzent); font-size: 22px; }
.zutaten { list-style: none; margin: 0; padding: 0; }
.zutaten li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hell); cursor: pointer; }
.zutaten li:last-child { border-bottom: 0; }
.zutaten .mng { flex: none; width: 92px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.zutaten li.hab { opacity: .38; text-decoration: line-through; }
.zutaten li.zw { font-family: var(--serif); font-weight: 600; font-size: 16px; padding-top: 12px; border-bottom: 0; cursor: default; color: var(--salbei); }
.schritte { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.schritte li { position: relative; padding: 4px 0 14px 42px; cursor: pointer; }
.schritte li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--akzent-hell); color: var(--akzent); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.schritte li.fertig { opacity: .4; }
.schritte li.fertig::before { content: "✓"; background: var(--salbei); color: #fff; }
.schritte li.zw { padding-left: 0; font-family: var(--serif); font-weight: 600; color: var(--salbei); cursor: default; }
.schritte li.zw::before { display: none; }
.notiz { white-space: pre-wrap; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.galerie button { border: 0; padding: 0; aspect-ratio: 1; border-radius: 10px; background: var(--hell) center/cover no-repeat; }
.dateien a { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hell); text-decoration: none; color: var(--tinte); word-break: break-word; }
.dateien a:last-child { border-bottom: 0; }
.dateien .sym { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--akzent-hell); color: var(--akzent);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.wach { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--grau); margin: 0 0 12px; }

/* ---------- Bearbeiten ---------- */
.linkzeile { display: grid; grid-template-columns: 1fr 1.4fr 40px; gap: 6px; margin-bottom: 6px; }
.linkzeile .rund { width: 40px; height: 44px; border-radius: 10px; }
.anhaenge { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 10px; }
.anh { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--hell) center/cover no-repeat; border: 1px solid var(--linie);
  display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; padding: 6px; word-break: break-all; overflow: hidden; }
.anh.titel { outline: 3px solid var(--akzent); outline-offset: -3px; }
.anh .x, .anh .s { position: absolute; top: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 15px; }
.anh .x { right: 4px; } .anh .s { left: 4px; }
.anh .neu { position: absolute; bottom: 4px; left: 4px; right: 4px; background: rgba(255, 255, 255, .85); border-radius: 6px; font-size: 11px; padding: 2px; }
.hinweis { background: #fff6dc; border: 1px solid #f0dfa8; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.unten-fest { position: sticky; bottom: calc(64px + var(--unten)); background: linear-gradient(transparent, var(--papier) 30%); padding: 14px 0 6px; display: flex; gap: 8px; }

/* ---------- Einkauf ---------- */
.reiter { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--hell); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.reiter button { border: 0; background: none; border-radius: 9px; padding: 8px 4px; font-weight: 600; font-size: 14px; color: var(--grau); }
.reiter button.an { background: var(--karte); color: var(--farbe, var(--tinte)); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.reiter .anz { font-weight: 500; font-size: 12px; opacity: .8; }
.neuzeile { display: flex; gap: 8px; margin-bottom: 12px; }
.neuzeile .eingabe { flex: 1; }
.eliste { list-style: none; margin: 0; padding: 0; background: var(--karte); border-radius: var(--radius); border: 1px solid var(--linie); overflow: hidden; }
.eliste li { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-bottom: 1px solid var(--hell); min-height: 54px; }
.eliste li:last-child { border-bottom: 0; }
.haken { flex: none; width: 42px; height: 42px; border: 0; background: none; display: flex; align-items: center; justify-content: center; padding: 0; }
.haken span { width: 25px; height: 25px; border-radius: 50%; border: 2px solid var(--farbe, var(--akzent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; }
.erledigt .haken span { background: var(--farbe, var(--akzent)); }
.eliste .txt { flex: 1; min-width: 0; padding: 4px 0; }
.eliste .txt b { font-weight: 650; font-variant-numeric: tabular-nums; }
.eliste .txt small { display: block; color: var(--grau); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eliste li.erledigt .txt { opacity: .45; text-decoration: line-through; }
.eliste .mehr { border: 0; background: none; color: var(--grau); font-size: 20px; width: 36px; height: 36px; }
.abschnitt { font-size: 13px; color: var(--grau); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin: 18px 4px 8px; }

/* ---------- Ebenen (Fenster von unten) ---------- */
#ebene:empty { display: none; }
.schleier { position: fixed; inset: 0; z-index: 50; background: rgba(30, 22, 16, .45); display: flex; align-items: flex-end; justify-content: center; animation: ein .15s; }
.blatt { background: var(--papier); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(18px + var(--unten)); animation: hoch .2s ease-out; }
@media (min-width: 620px) { .schleier { align-items: center; } .blatt { border-radius: 18px; } }
.blatt .griff { width: 40px; height: 5px; border-radius: 3px; background: var(--linie); margin: 0 auto 12px; }
.blatt h2 { font-size: 22px; margin-bottom: 12px; }
.wahl { list-style: none; margin: 0 0 12px; padding: 0; background: var(--karte); border-radius: 12px; border: 1px solid var(--linie); }
.wahl label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--hell); }
.wahl li:last-child label { border-bottom: 0; }
.wahl input { width: 20px; height: 20px; accent-color: var(--akzent); flex: none; }
.wahl b { font-variant-numeric: tabular-nums; min-width: 64px; display: inline-block; }
.menue button, .menue a { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--hell);
  background: var(--karte); text-align: left; font-size: 16px; text-decoration: none; color: var(--tinte); }
.menue { border-radius: 12px; overflow: hidden; border: 1px solid var(--linie); margin-bottom: 12px; }
.menue > :last-child { border-bottom: 0; }
.menue .ic { width: 26px; text-align: center; font-size: 19px; }
.linkfeld { display: flex; gap: 6px; margin-bottom: 10px; }
.linkfeld input { flex: 1; font-size: 14px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; }
.lightbox .zu { top: calc(12px + var(--oben)); right: 12px; }
.lightbox .vor { right: 10px; top: 50%; } .lightbox .rueck { left: 10px; top: 50%; }

#meldung { position: fixed; left: 50%; bottom: calc(86px + var(--unten)); transform: translateX(-50%) translateY(20px); z-index: 70;
  background: var(--tinte); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: .2s; text-align: center; }
#meldung.sichtbar { opacity: 1; transform: translateX(-50%); }
#meldung.fehler { background: var(--rot); }

/* ---------- Anmelden ---------- */
.anmelden { max-width: 380px; margin: 0 auto; padding: 12vh 22px 40px; text-align: center; }
.anmelden .logo { font-size: 64px; margin-bottom: 6px; }
.anmelden h1 { font-size: 34px; margin-bottom: 4px; }
.anmelden p { color: var(--grau); margin: 0 0 26px; }
.wer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.wer button { border: 2px solid var(--linie); background: var(--karte); border-radius: 14px; padding: 16px 8px; font-size: 17px; font-weight: 650; }
.wer button.an { border-color: var(--farbe); color: var(--farbe); background: color-mix(in srgb, var(--farbe) 8%, white); }

/* ---------- Kategorien ---------- */
.kzeile { display: grid; grid-template-columns: 54px 1fr auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.kzeile .eingabe { padding: 9px 10px; }
.kzeile .sym { text-align: center; font-size: 20px; padding: 6px; }
.kzeile .knopfreihe { gap: 4px; flex-wrap: nowrap; }
.kzeile .rund { width: 36px; height: 36px; font-size: 15px; }

/* ---------- Öffentliche Seite ---------- */
.oeff-kopf { text-align: center; color: var(--grau); font-size: 13px; padding: 8px 0 0; }

@keyframes hoch { from { transform: translateY(30px); opacity: .6; } }
@keyframes ein { from { opacity: 0; } }

@media print {
  .leiste, .plus, .aktionen, .portionen .rund, .wach, .kopf .zurueck, .kopf .rechts { display: none !important; }
  body { background: #fff; }
  .block { border: 0; padding: 0; }
}
.schleier.frage { z-index: 80; align-items: center; }
.schleier.frage .blatt { border-radius: 18px; max-width: 400px; margin: 0 16px; padding-top: 16px; }
.abschnitt.abt { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--tinte); margin: 16px 4px 6px; }
.abschnitt.abt:first-of-type { margin-top: 4px; }
