:root {
  /* Alltagleicht Markenfarben */
  --creme:        #FDF8F4;
  --weiss:        #FFFFFF;
  --rosa:         #A86C78;
  --rosa-dunkel:  #8E5562;
  --rosa-hell:    rgba(168, 108, 120, 0.10);
  --salbei:       #8FAF8F;
  --salbei-dunkel:#5F865F;
  --salbei-hell:  rgba(143, 175, 143, 0.16);
  --tinte:        #4A4446;
  --tinte-leise:  #77706F;
  --linie:        rgba(168, 108, 120, 0.22);
  --schatten:     0 10px 30px rgba(74, 68, 70, 0.08);
  --radius:       18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--creme);
  color: var(--tinte);
  font-family: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.wrap { max-width: 720px; margin: 0 auto; }

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--rosa);
  line-height: 1.15;
  margin: 0 0 12px;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 600; margin-top: 28px; }
h3 { font-size: 1.15rem; font-weight: 600; }

a { color: var(--rosa-dunkel); }

.laden { text-align: center; color: var(--tinte-leise); margin-top: 30vh; }

/* Kopfzeile */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.kopf .marke {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--salbei-dunkel); font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.zurueck {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--rosa-dunkel); text-decoration: none; font-weight: 700;
  padding: 8px 0; min-height: 44px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1rem;
  min-height: 50px; padding: 12px 22px;
  border-radius: 999px; border: 2px solid transparent;
  background: var(--rosa); color: var(--weiss);
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--rosa-dunkel); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.zweit { background: var(--weiss); color: var(--rosa-dunkel); border-color: var(--linie); }
.btn.zweit:hover { background: var(--rosa-hell); }
.btn.gruen { background: var(--salbei-dunkel); }
.btn.gruen:hover { background: #4F744F; }
.btn.leise { background: none; color: var(--tinte-leise); border: none; padding: 8px 10px; min-height: 44px; font-weight: 400; text-decoration: underline; }
.btn.breit { width: 100%; }
.btn:focus-visible, .karte:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--salbei); outline-offset: 2px;
}
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

/* Suche */
.suche {
  width: 100%; font: inherit; font-size: 1.05rem;
  padding: 14px 18px 14px 46px; min-height: 52px;
  border: 1px solid var(--linie); border-radius: 999px;
  background: var(--weiss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23A86C78' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/svg%3E") no-repeat 18px center;
  color: var(--tinte);
}

/* Bücher-Raster */
.buecher {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: 18px 0 8px;
}
@media (min-width: 560px) { .buecher { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.karte {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  min-height: 108px; padding: 16px;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten);
  color: var(--tinte); text-decoration: none;
  border-left: 6px solid var(--salbei);
}
.karte .name { font-family: "Playfair Display", Georgia, serif; font-weight: 600; font-size: 1.1rem; color: var(--rosa-dunkel); overflow-wrap: anywhere; }
.karte .anzahl { font-size: 0.88rem; color: var(--tinte-leise); }
.karte.alle { border-left-color: var(--rosa); }
.karte.neu {
  border: 2px dashed var(--linie); box-shadow: none; background: transparent;
  align-items: center; justify-content: center; color: var(--rosa-dunkel); font-weight: 700; cursor: pointer; font: inherit; font-weight: 700;
}

/* Rezeptliste */
.liste { list-style: none; margin: 8px 0 0; padding: 0; }
.liste li + li { margin-top: 6px; }
.liste a {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 14px;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px;
  text-decoration: none; color: var(--tinte);
}
.liste a:hover { border-color: var(--rosa); }
.liste .titel { font-weight: 700; color: var(--rosa-dunkel); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.98rem; }
.liste .info { font-size: 0.8rem; color: var(--tinte-leise); flex: 0 1 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leer { color: var(--tinte-leise); background: var(--weiss); border: 1px dashed var(--linie); border-radius: 14px; padding: 18px; }

/* Rezept-Ansicht */
.blatt {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 22px 20px 26px;
}
.blatt h1 { margin-bottom: 8px; }
.eckdaten { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--tinte-leise); font-size: 0.95rem; margin-bottom: 4px; }
.etiketten { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.etikett { background: var(--salbei-hell); color: var(--salbei-dunkel); border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.zutaten { padding-left: 0; list-style: none; margin: 0; }
.zutaten li { padding: 7px 0; border-bottom: 1px solid var(--linie); }
.zutaten li.zwischen { font-weight: 700; color: var(--salbei-dunkel); border-bottom: none; padding-top: 14px; }
.einkauf-knopf { margin-top: 12px; min-height: 40px; padding: 8px 16px; font-size: .95rem; }
.schritte { padding-left: 1.4em; margin: 0; }
.schritte li { margin-bottom: 12px; padding-left: 4px; }
.schritte li::marker { color: var(--rosa); font-weight: 700; }
.notiz { background: var(--rosa-hell); border-radius: 12px; padding: 12px 16px; white-space: pre-wrap; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fotos img { width: 100%; border-radius: 10px; border: 1px solid var(--linie); display: block; }

/* Formular */
.feld { margin-bottom: 18px; }
.feld label, .feld .label { display: block; font-weight: 700; margin-bottom: 6px; }
.feld .hilfe { font-size: 0.88rem; color: var(--tinte-leise); margin: -2px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%; font: inherit; color: var(--tinte);
  padding: 12px 14px; min-height: 50px;
  border: 1px solid var(--linie); border-radius: 12px; background: var(--weiss);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .zwei { grid-template-columns: 1fr; } }

.ki-box {
  background: var(--salbei-hell); border: 1px solid rgba(143,175,143,0.45);
  border-radius: var(--radius); padding: 18px; margin-bottom: 24px;
}
.ki-box h3 { color: var(--salbei-dunkel); }
.ki-box p { margin: 0 0 12px; }
.vorschau { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.vorschau figure { position: relative; margin: 0; }
.vorschau img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--linie); display: block; }
.vorschau button {
  position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--tinte); color: var(--weiss); font-size: 18px; line-height: 1; cursor: pointer;
}
.unsichtbar { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.auswahl { display: flex; flex-wrap: wrap; gap: 8px; }
.auswahl label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 14px; min-height: 44px; border: 1px solid var(--linie); border-radius: 999px; background: var(--weiss); font-weight: 400;
}
.auswahl input { width: 20px; height: 20px; accent-color: var(--salbei-dunkel); margin: 0; }
.auswahl label:has(input:checked) { background: var(--salbei-hell); border-color: var(--salbei); }

.fehler { color: #A23B3B; background: #FBECEC; border-radius: 12px; padding: 12px 16px; }
.erfolg { color: var(--salbei-dunkel); background: var(--salbei-hell); border-radius: 12px; padding: 12px 16px; }

/* Anmeldung */
.anmeldung { max-width: 440px; margin: 8vh auto 0; text-align: center; }
.anmeldung .blatt { text-align: left; margin-top: 22px; }
.anmeldung .untertitel { color: var(--tinte-leise); }
.code { letter-spacing: 0.3em; font-size: 1.4rem; text-align: center; }

/* Wartekreis */
.kreis {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5); border-top-color: var(--weiss);
  animation: drehen 0.9s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* Kurze Meldung unten */
.meldung {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--tinte); color: var(--weiss); padding: 12px 20px; border-radius: 999px;
  font-size: 0.95rem; box-shadow: var(--schatten); max-width: calc(100% - 32px); text-align: center;
}

/* Footer */
.site-footer { text-align: center; font-size: 0.8rem; color: var(--tinte-leise); margin-top: 40px; opacity: 0.85; }
.site-footer a { color: var(--tinte-leise); text-decoration: none; }
.site-footer a:hover { color: var(--tinte); text-decoration: underline; }
.site-footer .sep { margin: 0 8px; }

@media (prefers-reduced-motion: reduce) { .kreis { animation-duration: 3s; } }

/* Schnell-Foto auf der Startseite */
.schnell { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 20px; }
.btn.gross { min-height: 64px; font-size: 1.15rem; }
.warten { text-align: center; padding: 40px 20px; }
.warten p { color: var(--tinte-leise); }
.kreis.dunkel { width: 44px; height: 44px; border-width: 4px; border-color: var(--rosa-hell); border-top-color: var(--rosa); display: inline-block; margin-bottom: 18px; }
.ki-box.gast { margin-top: 28px; }
.gast-hinweis {
  display: block; margin: 0 0 18px; padding: 10px 14px;
  background: var(--salbei-hell); border-radius: 12px;
  color: var(--tinte); font-size: 0.92rem; line-height: 1.4; text-decoration: none;
}
.gast-hinweis strong { color: var(--salbei-dunkel); white-space: nowrap; }

/* Drucken / als PDF: jedes Rezept auf einer eigenen Seite */
.druck { margin-top: 18px; }
.druck-seite { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 22px 20px 26px; margin-bottom: 18px; }
.druck-titel { text-align: center; padding: 60px 20px; }
.druck-marke { font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--salbei-dunkel); margin: 0 0 10px; }
.druck-fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; break-inside: avoid; page-break-inside: avoid; }
.druck-fotos img { width: 100%; max-height: 5.5cm; object-fit: contain; border-radius: 8px; border: 1px solid var(--linie); }
/* Menüleiste unten (wie bei Handy-Apps) */
body.mit-leiste { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.mit-leiste .meldung { bottom: calc(84px + env(safe-area-inset-bottom)); }
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--weiss); border-top: 1px solid var(--linie);
  box-shadow: 0 -4px 18px rgba(74, 68, 70, 0.06);
  padding: 6px 4px max(6px, env(safe-area-inset-bottom));
}
.leiste[hidden] { display: none; }
.leiste .punkt {
  flex: 1 1 0; max-width: 120px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; font: inherit; cursor: pointer;
  color: var(--tinte-leise); text-decoration: none; font-size: 0.72rem; border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.leiste .punkt svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.leiste .punkt.aktiv { color: var(--rosa); font-weight: 700; }
.leiste .punkt:focus-visible { outline: 2px solid var(--rosa); outline-offset: -2px; }
.klein { font-size: 0.88rem; color: var(--tinte-leise); }
.karte.geteilt { border-left-color: #E2C044; }

@media print {
  @page { margin: 16mm; }
  body, body.mit-leiste { background: #fff; min-height: 0; padding: 0; }
  .nicht-drucken, .site-footer, .meldung, .leiste { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .druck { margin: 0; }
  .druck-seite { border: none; box-shadow: none; border-radius: 0; padding: 0; margin: 0; break-after: page; page-break-after: always; }
  .druck-seite:last-child { break-after: auto; page-break-after: auto; }
  .druck-titel { padding-top: 35vh; }
  .druck-fotos img { break-inside: avoid; }
}
