/* ==========================================================================
   Rezepte – Stylesheet (kein Framework, kein Build-Schritt)

   1. Farben & Grundwerte     4. Komponenten: .btn, .badge, .tag, .karte, Formulare,
   2. Basis                      Hinweise, Tabellen, Listen
   3. Layout: Kopf, Haupt-     5. Seiten: Sammlung, Rezept, Einkauf, Wochenplan,
      navigation, Tab-Leiste      Import/Eingang, Login

   Mobile first: Handy-Regeln sind die Grundregeln, Desktop kommt per min-width.
   Tab-Leiste unten bis 720 px, darüber Kopfnavigation. Tap-Ziele ≥ 40 px.
   ========================================================================== */

/* ---- 1. Farben & Grundwerte ------------------------------------------- */
:root {
  --bg: #faf8f4;
  --fg: #2b2622;
  --muted: #736b63;
  --line: #e6e0d6;
  --card: #fff;
  --akzent: #b5542a;
  --akzent-hell: #f6e7de;
  --auf-akzent: #fff;
  --ok: #3d7a4a;
  --ok-hell: #e1efe3;
  --warn: #8f6210;
  --warn-hell: #f7edd3;
  --fehler: #b23a3a;
  --fehler-hell: #f5dcdc;
  --info: #3b5a91;
  --info-hell: #e3e9f4;
  --radius: 10px;
  --kopf-hoehe: 52px;
  --tab-hoehe: 58px;
  --breite: 960px;
  color-scheme: light dark;
}
/* Dunkel: nur die Variablen wechseln – alle Regeln unten nutzen ausschließlich diese */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1715;
    --fg: #ece6df;
    --muted: #a99f95;
    --line: #3b3530;
    --card: #231f1c;
    --akzent: #e07a4b;
    --akzent-hell: #3d2a20;
    --auf-akzent: #1a1715;
    --ok: #7cc28b;
    --ok-hell: #1f3325;
    --warn: #e0b45a;
    --warn-hell: #3a2f18;
    --fehler: #f08a8a;
    --fehler-hell: #3d2020;
    --info: #9bb5e6;
    --info-hell: #202b40;
  }
}

/* ---- 2. Basis ---------------------------------------------------------- */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word; -webkit-text-size-adjust: 100%;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 12px; line-height: 1.2; }
h2 { font-size: 18px; margin: 28px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
img { max-width: 100%; }
.muted { color: var(--muted); font-size: 14px; }
.leer { color: var(--muted); padding: 40px 0; text-align: center; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* ---- 3. Layout ---------------------------------------------------------- */
.kopf {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.kopf-innen {
  max-width: var(--breite); margin: 0 auto; height: var(--kopf-hoehe);
  padding: 0 max(12px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; min-height: 40px; margin-right: auto; font-weight: 700; font-size: 18px; color: var(--fg); }
.logo:hover { text-decoration: none; }
.logo img { border-radius: 6px; }
.nutzer { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.nutzer form { margin: 0; }
.nutzer .name, .nutzer .lang { display: none; }

main {
  max-width: var(--breite); margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) calc(var(--tab-hoehe) + 32px + env(safe-area-inset-bottom));
}
main.breit { --breite: 1440px; }

/* Hauptnavigation – Handy: feste Tab-Leiste unten mit Symbol über Text */
.hauptnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.hauptnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tab-hoehe); padding: 4px 2px;
  color: var(--muted); font-size: 12px; white-space: nowrap;
}
.hauptnav a:hover { text-decoration: none; color: var(--fg); }
.hauptnav a::before {
  content: ""; width: 24px; height: 24px; flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.hauptnav a.aktiv, .hauptnav a.aktiv-mobil { color: var(--akzent); font-weight: 600; box-shadow: inset 0 3px 0 var(--akzent); }
.hauptnav .nur-desktop { display: none; }
#einkauf-zaehler { font-weight: 700; color: var(--akzent); }
/* Handy: Zähler als Hochzahl neben dem Wagen-Symbol, damit „Einkauf“ einzeilig bleibt */
.hauptnav [data-icon=einkauf] { position: relative; }
.hauptnav #einkauf-zaehler { position: absolute; top: 5px; left: calc(50% + 12px); font-size: 12px; }
/* Tastatur offen: Tab-Leiste würde über dem Eingabefeld kleben */
@media (max-width: 720px) {
  body:has(:is(input:not([type=checkbox], [type=radio], [type=file]), textarea):focus) .hauptnav { display: none; }
}

.hauptnav [data-icon=sammlung] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5z'/%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5'/%3E%3C/svg%3E"); }
.hauptnav [data-icon=plan] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.hauptnav [data-icon=einkauf] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M2 3h3l2.6 12.4a2 2 0 0 0 2 1.6h8.2a2 2 0 0 0 2-1.5L22 7H6'/%3E%3C/svg%3E"); }
.hauptnav [data-icon=import] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E"); }
.hauptnav [data-icon=eingang] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.5 5.1 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.5-6.9A2 2 0 0 0 16.8 4H7.2a2 2 0 0 0-1.7 1.1z'/%3E%3C/svg%3E"); }

/* Desktop: Kopfnavigation, keine Tab-Leiste */
@media (min-width: 721px) {
  .kopf-innen { gap: 20px; padding: 0 16px; }
  body:has(main.breit) .kopf-innen { max-width: 1440px; }
  main { padding: 20px 16px 60px; }
  .hauptnav {
    position: static; display: flex; gap: 2px; padding: 0;
    background: none; border: 0;
  }
  .hauptnav a { flex-direction: row; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 15px; color: var(--fg); }
  .hauptnav a::before { width: 18px; height: 18px; }
  .hauptnav a.aktiv { background: var(--akzent-hell); box-shadow: none; }
  .hauptnav a.aktiv-mobil { color: var(--fg); font-weight: 400; box-shadow: none; }
  .hauptnav .nur-desktop { display: flex; }
  .hauptnav #einkauf-zaehler { position: static; font-size: inherit; }
  .nutzer .name, .nutzer .lang { display: inline; }
  .nutzer .kurz { display: none; }
  h1 { font-size: 28px; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .hauptnav a::before { display: none; }
  .nutzer .name { display: none; }
}

/* Ladeindikatoren: Balken oben bei jedem HTMX-Request (body hx-indicator="#ladebalken"),
   Spinner im Knopf bei klassischen Formularen mit data-laden (Import-Upload, app.js) */
.ladebalken {
  position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 20; height: 3px;
  background: linear-gradient(90deg, transparent, var(--akzent), transparent) 0 0 / 40% 100% no-repeat;
  animation: ladebalken 1s linear infinite; pointer-events: none;
  opacity: 0; transition: opacity .2s; /* unabhängig von htmx-eigenem Indikator-CSS */
}
.ladebalken.htmx-request { opacity: 1; }
@keyframes ladebalken { from { background-position: -40% 0; } to { background-position: 140% 0; } }
form.laedt button[type=submit]::before {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: drehen .8s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ladebalken, form.laedt button[type=submit]::before { animation-duration: 3s; } }

/* Unternavigation (Import/Eingang) als Segment-Schalter */
.unternav { display: inline-flex; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 3px; }
.unternav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--fg); font-size: 15px; }
.unternav a:hover { text-decoration: none; }
.unternav a.aktiv { background: var(--akzent); color: var(--auf-akzent); font-weight: 600; }

/* ---- 4. Komponenten ------------------------------------------------------ */

/* Buttons: <button> und .btn sehen gleich aus; Varianten .sekundaer, .gefahr, .klein */
button, .btn {
  display: inline-block; min-height: 42px; padding: 10px 14px;
  border: 1px solid var(--akzent); border-radius: 8px;
  background: var(--akzent); color: var(--auf-akzent);
  font: inherit; line-height: 1.25; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; }
button.sekundaer, .btn.sekundaer { background: var(--card); color: var(--akzent); }
button.gefahr, .btn.gefahr { background: var(--card); color: var(--fehler); border-color: var(--fehler); }
button.klein, .btn.klein { min-height: 40px; padding: 10px 10px; font-size: 14px; line-height: 1.1; }
button:disabled { opacity: .6; cursor: default; }
/* Symbol-Knöpfe: Inhalt mittig */
.portionen button, .plan-nav .btn, button.loeschen { display: inline-flex; align-items: center; justify-content: center; }
button.loeschen { min-width: 44px; min-height: 44px; padding: 0 10px; background: none; border: 0; border-radius: 0; color: var(--muted); font-size: 22px; }
button.loeschen:hover { color: var(--fehler); }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.aktionen form { display: inline; margin: 0; }

/* Badges (Status) */
.badge { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted); vertical-align: middle; }
.badge.fertig, .badge.entwurf-erstellt { background: var(--ok-hell); color: var(--ok); }
.badge.entwurf, .badge.bereit, .badge.verarbeitung { background: var(--warn-hell); color: var(--warn); }
.badge.fehler { background: var(--fehler-hell); color: var(--fehler); }
.badge.neu { background: var(--info-hell); color: var(--info); }

/* Tags (Filter-Chips) */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tag { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 2px 14px; border-radius: 999px; background: var(--akzent-hell); color: var(--akzent); font-size: 14px; }
.tag:hover { text-decoration: none; }
.tag.aktiv { background: var(--akzent); color: var(--auf-akzent); }
@media (min-width: 721px) { .tag { min-height: 30px; padding: 2px 10px; font-size: 13px; } }

/* Karten (Rezeptliste) */
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.karte { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; }
.karte:hover { text-decoration: none; border-color: var(--akzent); }
.karte .bild { aspect-ratio: 4/3; background: var(--akzent-hell) center/cover no-repeat; }
.karte .body { padding: 10px 12px 12px; }
.karte h3 { margin: 0 0 4px; font-size: 16px; }
@media (max-width: 520px) {
  /* Handy: kompakte Zeilen mit Vorschaubild statt großer Kacheln */
  .karten { grid-template-columns: 1fr; gap: 8px; }
  .karte { flex-direction: row; align-items: center; min-height: 72px; }
  .karte .bild { flex: none; width: 84px; align-self: stretch; aspect-ratio: auto; }
  .karte .body { min-width: 0; padding: 8px 12px; }
}

/* Formulare */
input, textarea, select, button { font: inherit; }
input:not([type=checkbox], [type=radio], [type=file], [type=hidden]), textarea, select {
  width: 100%; min-height: 42px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg);
}
input[type=file] { max-width: 100%; min-height: 42px; }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
select.auto { width: auto; }
input.schmal { max-width: 120px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
label .muted { font-weight: 400; }
.zeile { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 601px) { .zeile { grid-template-columns: 1fr 1fr; } }
/* Eingabe + Knopf in einer Zeile (Einkauf, Plan-Notiz) */
.einkauf-eingabe, .plan-notiz { display: flex; gap: 8px; }
.einkauf-eingabe input, .plan-notiz input { flex: 1; min-width: 0; min-height: 44px; }
.einkauf-eingabe button, .plan-notiz button { min-height: 44px; }

/* Hinweise */
.hinweis { background: var(--akzent-hell); border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.fehlerbox { background: var(--fehler-hell); color: var(--fehler); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
a.zurueck { display: inline-flex; align-items: center; min-height: 40px; }

/* Tabellen; .stapel = am Handy Zeilen als Blöcke */
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 720px) {
  table.stapel { border: 1px solid var(--line); border-radius: var(--radius); display: block; }
  .stapel tbody { display: block; }
  .stapel tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .stapel tr:first-child { display: none; } /* Kopfzeile */
  .stapel tr:last-child { border-bottom: 0; }
  .stapel td { padding: 0; border: 0; }
  .stapel td:nth-child(3) { order: 5; flex-basis: 100%; }
  .stapel td a { display: inline-flex; align-items: center; min-height: 40px; }
}
pre { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; max-height: 480px; overflow: auto; }

/* Listen mit Zeilen (Einkauf, Rezeptauswahl) */
.einkauf, .plan-wahl { list-style: none; padding: 0; margin: 0 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---- 5. Seiten ------------------------------------------------------------ */

/* Sammlung */
.suche { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.suche input[type=search] { flex: 1 1 200px; }
.plan-heute { background: var(--akzent-hell); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 15px; overflow-wrap: anywhere; }
.plan-heute .plan-heute-label { font-weight: 700; color: var(--fg); margin-right: 4px; }

/* Rezept */
.rezept-kopf { display: grid; grid-template-columns: 1fr; gap: 16px; }
.rezept-kopf img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); }
.meta { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
.portionen { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0; }
.portionen button { min-width: 44px; padding: 0; font-size: 20px; }
.zutaten { list-style: none; padding: 0; margin: 0; }
.zutaten li { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.zutaten li.gruppe { font-weight: 600; border: 0; padding-top: 14px; }
.zutaten .m { display: inline-block; min-width: 80px; font-weight: 600; }
.schritte { padding-left: 1.4em; }
.schritte li { margin-bottom: 10px; }
.einkauf-aus-rezept { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.schritt { display: flex; gap: 10px; align-items: flex-start; margin: 0; font: inherit; }
.schritt-haken { display: none; }

/* Kochmodus (app.js setzt body.kochmodus): große Schrift, Schritte als abhakbare Karten */
.kochmodus-leiste { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; }
#kochmodus-schalter[aria-pressed=true] { background: var(--akzent); color: var(--auf-akzent); }
.kochmodus .aktionen, .kochmodus .einkauf-aus-rezept, .kochmodus main > .hinweis { display: none; }
.kochmodus .rezept-kopf img { max-height: 180px; }
.kochmodus .zutaten, .kochmodus .schritte { font-size: 21px; line-height: 1.5; }
.kochmodus .zutaten li { padding: 10px 0; }
.kochmodus .zutaten .m { min-width: 110px; }
.kochmodus .schritte { list-style: none; padding: 0; counter-reset: schritt; }
.kochmodus .schritte li { margin-bottom: 10px; }
.kochmodus .schritt { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.kochmodus .schritt-haken { display: block; flex: none; width: 28px; height: 28px; margin: 2px 0 0; accent-color: var(--ok); }
.kochmodus .schritt span::before { counter-increment: schritt; content: counter(schritt) ". "; font-weight: 700; }
.kochmodus .schritt:has(:checked) { background: transparent; }
.kochmodus .schritt-haken:checked + span { text-decoration: line-through; color: var(--muted); }

/* Einkaufsliste */
.einkauf-eingabe { position: sticky; top: calc(var(--kopf-hoehe) + env(safe-area-inset-top)); z-index: 4; padding: 10px 0; background: var(--bg); }
.einkauf-zeile { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.einkauf-zeile:last-child { border-bottom: 0; }
.einkauf-zeile form { display: flex; margin: 0; }
.einkauf-zeile form.abhaken { flex: 1; min-width: 0; }
.einkauf-zeile .abhaken button { flex: 1; display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 52px; padding: 8px 12px; background: none; border: 0; border-radius: 0; color: var(--fg); text-align: left; }
.einkauf-zeile .haken { flex: none; width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--auf-akzent); font-size: 15px; }
.einkauf-zeile .text { min-width: 0; overflow-wrap: anywhere; }
.einkauf-zeile .herkunft { display: block; color: var(--muted); font-size: 12px; }
.einkauf-zeile.erledigt .text { text-decoration: line-through; color: var(--muted); }
.einkauf-zeile.erledigt .haken { background: var(--ok); border-color: var(--ok); }
.plan-vorschau .einkauf-zeile { padding: 10px 12px; }

/* Wochenplan – Handy: Tage untereinander, Slots als Zeilen; ab 640 px zwei Spalten,
   ab 1100 px sieben Spalten (main.breit gibt dafür bis 1440 px Platz) */
.plan-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.plan-nav .btn { min-width: 44px; }
.plan-woche-titel { font-weight: 600; }
.plan-heute-link { display: inline-flex; align-items: center; min-height: 40px; margin-left: auto; }
.plan-einkauf { margin: 0 0 14px; }
.plan-woche { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.plan-tag { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; scroll-margin-top: calc(var(--kopf-hoehe) + 8px); }
.plan-tag.heute { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
.plan-tag h2 { font-size: 16px; margin: 0 0 6px; }
.plan-slot { display: flex; gap: 6px; align-items: flex-start; padding: 4px 0; border-top: 1px dotted var(--line); }
.plan-slot-name { flex: none; width: 66px; padding-top: 10px; color: var(--muted); font-size: 13px; }
.plan-slot-inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-plus { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 22px; }
.plan-plus:hover { text-decoration: none; border-color: var(--akzent); color: var(--akzent); }
.plan-plus.klein { font-size: 16px; border-color: transparent; justify-content: flex-start; padding-left: 8px; }
.plan-eintrag { display: flex; align-items: center; gap: 6px; min-width: 0; background: var(--bg); border-radius: 8px; padding: 4px; }
.plan-eintrag.notiz .titel { font-style: italic; }
.plan-rezept { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: inherit; }
.plan-rezept .bild, .plan-wahl .bild { flex: none; width: 44px; height: 44px; border-radius: 6px; background: var(--akzent-hell) center/cover no-repeat; }
.plan-rezept .titel { min-width: 0; overflow-wrap: break-word; hyphens: auto; font-size: 14px; line-height: 1.3; }
.plan-eintrag-aktionen { display: flex; align-items: center; flex: none; }
.plan-eintrag-aktionen form { margin: 0; display: flex; }
.plan-portionen { display: flex; align-items: center; gap: 2px; margin: 0; font-weight: 400; font-size: 12px; color: var(--muted); }
.plan-portionen input[type=number] { width: 52px; padding: 6px 4px; text-align: center; }
.plan-eintrag button.loeschen { min-width: 40px; min-height: 40px; padding: 0 8px; }
@media (min-width: 640px) { .plan-woche { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .plan-woche { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
  .plan-tag { padding: 6px; }
  .plan-slot { flex-direction: column; gap: 2px; }
  .plan-slot-name { width: auto; padding-top: 2px; font-size: 12px; }
  .plan-slot-inhalt { width: 100%; }
  .plan-eintrag { flex-wrap: wrap; }
  .plan-rezept { flex-direction: column; align-items: stretch; gap: 4px; flex-basis: 100%; }
  .plan-rezept .bild { width: 100%; height: auto; aspect-ratio: 4/3; }
  .plan-eintrag-aktionen { width: 100%; justify-content: space-between; }
}
/* Rezeptauswahl und Tag/Slot-Wahl */
.plan-wahl li { border-bottom: 1px solid var(--line); }
.plan-wahl li:last-child { border-bottom: 0; }
.plan-wahl form { margin: 0; }
.plan-wahl button { width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 56px; padding: 6px 12px; background: none; border: 0; border-radius: 0; color: var(--fg); text-align: left; }
.plan-wahl .titel { min-width: 0; overflow-wrap: anywhere; }
.plan-tagwahl fieldset { border: 0; padding: 0; margin: 14px 0 0; }
.plan-tagwahl legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.plan-pillen { display: flex; flex-wrap: wrap; gap: 8px; }
.pille { margin: 0; font-weight: 400; font-size: 15px; }
.pille input { position: absolute; opacity: 0; }
.pille span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; }
.pille input:checked + span { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.pille input:focus-visible + span { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* Import / Eingang */
.vorschau-bild { max-height: 400px; border-radius: 8px; }

/* Login */
.login { max-width: 360px; margin: 40px auto; }
.login button { width: 100%; min-height: 44px; margin-top: 18px; }
