/* Rezeptewelt im Look der App (avolya-app, nutrition/recipes_screen.dart und
   recipe_world.dart, Screens G1–G5 vom 14.10.2026). Gilt fuer alle Programme –
   in der App sehen Balance und Legacy dieselbe Rezeptewelt. Die Bausteine stehen
   in welten-app.css.

   Die alte Seite (Kopf, Tracker-Widget, Phasen-Banner, Filterleiste, Raster) bleibt
   im Dokument, weil ihr Skript die Elemente anspricht; sie ist hier nur
   ausgeblendet. Der Tagesplan-Generator oeffnet als eigene Ebene und behaelt –
   wie in der App – seinen hellen Look. Die Einkaufsliste ebenso (body.rw-sl). */

body.rw-app .rz-header,
body.rw-app #rzContent { display: none; }

/* Das Seitenskript blendet das Widget per Inline-Stil ein */

body.rw-app #trWidget { display: none !important; }

/* Einkaufsliste offen: alter heller Kopf und Liste, die neue Welt ruht */

body.rw-app.rw-sl { background: #f2f4ee; color: #0e1e18; }

body.rw-app.rw-sl .rz-header { display: block; }

body.rw-app.rw-sl .rw-bar,
body.rw-app.rw-sl .rw-start,
body.rw-app.rw-sl .rw-alle { display: none; }

/* .rz-main ist eine Flex-Spalte; die waagrechten Reihen zoegen sie sonst auf ihre
   volle Breite auf. Die Einkaufsliste (rw-sl) braucht das alte Layout. */

body.rw-app:not(.rw-sl) .rz-main { display: block; max-width: none; padding: 0; }

.rw-start, .rw-alle { min-width: 0; }

@media (max-width: 767px) {
  body.rw-app:not(.rw-sl) .rz-main { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Wochenplan ────────────────────────────────────────────── */

.rw-week-top { display: flex; align-items: center; gap: 6px; }

.rw-week-title {
  flex: 1;
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: -0.4px;
  margin: 0;
}

.rw-week-range { font-size: 0.85rem; color: var(--rw-ink-muted); margin: 0 0 12px; }

.rw-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }

.rw-day {
  border: 0;
  background: transparent;
  color: var(--rw-ink);
  border-radius: 16px;
  padding: 8px 0;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rw-day:hover { background: var(--rw-hover, rgba(255, 255, 255, 0.06)); }

.rw-day-wd { font-size: 0.86rem; }

.rw-day-num { font-size: 1.12rem; font-weight: 600; }

.rw-day--today .rw-day-num { font-weight: 900; text-decoration: underline; text-decoration-color: var(--rw-accent); text-underline-offset: 3px; }

.rw-day-mark {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.6px solid var(--rw-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rw-day--planned .rw-day-mark { border: 0; background: var(--rw-lime); color: var(--rw-on-lime); }

.rw-day--sel { background: var(--rw-lime); color: var(--rw-on-lime); }

.rw-day--sel:hover { background: var(--rw-lime); }

.rw-day--sel .rw-day-num { font-weight: 900; text-decoration: none; }

.rw-day--sel .rw-day-mark { border-color: var(--rw-on-lime); }

.rw-day--sel.rw-day--planned .rw-day-mark { background: var(--rw-on-lime); color: var(--rw-lime); }

.rw-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 12px;
  font-size: 0.85rem;
  color: var(--rw-ink-muted);
}

.rw-week-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.94rem;
}

.rw-week-foot strong { font-weight: 800; }

/* Highlights der Saison */

.rw-season {
  position: relative;
  width: 90%;
  max-width: 520px;
  height: 200px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--rw-tile-dark);
  color: var(--rw-ink);
  text-decoration: none;
  display: block;
}

.rw-season img {
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 35%);
          mask-image: linear-gradient(to right, transparent, #000 35%);
}

.rw-season-body {
  position: relative;
  height: 100%;
  width: 66%;
  padding: 14px 12px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.rw-season-title {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-season-sub {
  font-size: 0.9rem;
  color: var(--rw-ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rw-season-meta { margin-top: auto; font-size: 0.84rem; }

.rw-season .rw-pill { margin-top: 8px; padding: 8px 14px; font-size: 0.875rem; }

/* Kategorien */

.rw-cat {
  width: 84px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--rw-ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rw-cat-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--rw-card);
  border: 1px solid var(--rw-inner-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rw-cat-label {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.rw-cat:hover .rw-cat-icon { border-color: var(--rw-accent); }

.rw-cat.on .rw-cat-icon { background: var(--rw-lime); border-color: var(--rw-lime); color: var(--rw-on-lime); }

.rw-cat.on .rw-cat-label { background: var(--rw-lime); color: var(--rw-on-lime); font-weight: 800; }

.rw-cat:focus-visible { outline: none; }

.rw-cat:focus-visible .rw-cat-icon { outline: 2px solid var(--rw-accent); outline-offset: 3px; }

/* Kategorien als Raster: Handy 4, ab 720 px 8 in einer Reihe */
.rw-cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
@media (min-width: 720px) { .rw-cat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.rw-cat-grid .rw-cat { width: auto; min-width: 0; }
.rw-cat-grid .rw-cat-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: clamp(0.76rem, 3.2vw, 0.9rem); padding: 2px 6px; }
@media (max-width: 400px) { .rw-cat-grid .rw-cat-icon { width: 64px; height: 64px; } }

/* Rezeptkarte (RecipeWorldCard) */

.rw-rcard {
  width: 220px;
  display: flex;
  flex-direction: column;
  background: var(--rw-card);
  border: 1px solid var(--rw-card-border);
  border-radius: 20px;
  overflow: hidden;
}

.rw-rcard-img { position: relative; display: block; aspect-ratio: 1.45; background: var(--rw-icon-bg); }

.rw-rcard-img a { display: block; width: 100%; height: 100%; }

.rw-rcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rw-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 26, 16, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rw-heart.on { color: #e83f6f; }

.rw-heart.on svg { fill: currentColor; }

.rw-rcard-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }

.rw-rcard-title {
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--rw-ink);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rw-rcard-title:hover { text-decoration: underline; }

.rw-rcard-foot { margin-top: auto; padding: 0 12px 12px; }

.rw-plan {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--rw-lime);
  color: var(--rw-on-lime);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
}

.rw-plan:hover { background: #e0fb7a; }

@media (max-width: 380px) {
  .rw-grid .rw-rcard-title { font-size: 0.95rem; }
  .rw-grid .rw-plan { font-size: 0.86rem; }
}

.rw-cat-pill { margin-top: 10px; }

/* Eigene Rezepte (Liste) */

.rw-own { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.rw-own-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--rw-card);
  border: 1px solid var(--rw-card-border);
  border-radius: 16px;
}

.rw-own-item img,
.rw-own-ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--rw-icon-bg); display: flex; align-items: center; justify-content: center; }

.rw-own-text { flex: 1; min-width: 0; }

.rw-own-title { font-weight: 800; }

.rw-own-meta { font-size: 0.82rem; color: var(--rw-ink-muted); }

.rw-own-actions { display: flex; gap: 6px; }

.rw-catgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }

.rw-catgrid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: 18px;
  border: 1px solid var(--rw-inner-border);
  background: var(--rw-card);
  color: var(--rw-ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.rw-catgrid button.on { background: var(--rw-lime); border-color: var(--rw-lime); color: var(--rw-on-lime); font-weight: 800; }

.rw-catgrid small { font-size: 0.75rem; color: var(--rw-ink-soft); }

.rw-catgrid button.on small { color: var(--rw-on-lime); }

.rw-day:focus-visible { outline: 2px solid var(--rw-accent); outline-offset: 2px; }
