/* Einkaufsliste im Look der App (shopping_list_screen.dart), dunkel wie die
   Rezeptewelt. Baut auf welten-app.css auf (Farben --rw-*, Karten, Knöpfe,
   Suche, Blätter). Inhalt: einkaufsliste-app.js. */

.ek-page [hidden] { display: none !important; }
.ek-page { max-width: 760px; padding-top: 6px; }
.ek-page button { font: inherit; color: inherit; }

/* Kopfleiste: statt Tagesplänen und Korb der Lime-Knopf „+" */
.rw-bar-add {
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--rw-lime);
  color: var(--rw-on-lime);
  cursor: pointer;
}
.rw-bar-add:hover { background: #e0fb7a; }
.rw-bar-add:focus-visible { outline: 2px solid var(--rw-accent); outline-offset: 3px; }

.ek-sub { margin: 0 4px 14px; font-size: 1rem; color: var(--rw-ink-muted); }

/* Reiter: umbrechen statt seitwärts scrollen */
.ek-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ek-tabs button {
  flex: 1 1 auto;
  padding: 9px clamp(6px, 2vw, 16px);
  border: 1.5px solid var(--rw-inner-border);
  border-radius: 999px;
  background: transparent;
  font-size: clamp(0.8rem, 3.4vw, 0.97rem) !important;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ek-tabs button:hover { border-color: var(--rw-accent); }
.ek-tabs button.on { background: var(--rw-lime); border-color: var(--rw-lime); color: var(--rw-on-lime); font-weight: 800; }

/* Suche und Ansicht */
.ek-toolbar { display: flex; align-items: center; gap: 10px; }
.ek-search { flex: 1; min-width: 0; margin-top: 0 !important; }
.ek-search input { padding-top: 14px; padding-bottom: 14px; }
.ek-view { flex: none; display: flex; gap: 8px; }
.ek-view button {
  height: 52px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--rw-inner-border);
  border-radius: 16px;
  background: var(--rw-card);
  cursor: pointer;
}
.ek-view button.on { background: var(--rw-lime); border-color: var(--rw-lime); color: var(--rw-on-lime); font-weight: 800; }
.ek-view--l button { height: 46px; }
.ek-view--l button span { font-size: 0.94rem; }

/* Zähler, Schalter */
.ek-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin: 14px 2px 4px; }
.ek-stats p { margin: 0; font-size: 1rem; color: var(--rw-ink-muted); }
.ek-stats strong { color: var(--rw-ink); font-weight: 800; }
.ek-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 0.85rem; cursor: pointer; }
.ek-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ek-switch i { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--rw-track, rgba(255, 255, 255, 0.18)); transition: background 0.15s; }
.ek-switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.ek-switch input:checked + i { background: var(--rw-lime); }
.ek-switch input:checked + i::after { transform: translateX(20px); background: var(--rw-on-lime); }
.ek-switch input:focus-visible + i { outline: 2px solid var(--rw-accent); outline-offset: 2px; }
.ek-merged { display: flex; align-items: center; gap: 6px; margin: 2px 2px 12px; font-size: 0.82rem; color: var(--rw-ink-soft); }
.ek-merged svg { color: var(--rw-ink-soft); }
.ek-week {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--rw-accent);
  border-radius: 999px;
  background: transparent;
  color: var(--rw-accent) !important;
  font-size: 0.9rem !important;
  font-weight: 700;
  cursor: pointer;
}

/* Einträge als Karten */
.ek-items { display: flex; flex-direction: column; gap: 10px; }
.ek-item {
  display: flex;
  align-items: center;
  border: 1px solid var(--rw-card-border);
  border-radius: 18px;
  background: var(--rw-card);
}
.ek-item.done { background: var(--rw-done, #0e2e20); }
.ek-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px 14px 16px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.ek-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ek-item-text strong { font-size: 1.03rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.ek-item-text small { font-size: 0.82rem; color: var(--rw-ink-soft); }
.ek-item-amount { flex: none; max-width: 32%; text-align: right; font-size: 0.94rem; color: var(--rw-ink-muted); }
.ek-item.done .ek-item-text strong { color: var(--rw-ink-soft); text-decoration: line-through; }
.ek-item.done .ek-item-amount { color: var(--rw-ink-soft); }
.ek-check { flex: none; display: inline-flex; color: var(--rw-ink); }
.ek-check.on { color: var(--rw-accent); }
.ek-icon {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--rw-ink-muted) !important;
  cursor: pointer;
}
.ek-icon:hover { background: var(--rw-hover, rgba(255, 255, 255, 0.08)); }
.ek-item-main:focus-visible, .ek-icon:focus-visible, .ek-tile-main:focus-visible, .ek-tabs button:focus-visible, .ek-view button:focus-visible,
.ek-link:focus-visible, .ek-day button:focus-visible, .ek-rcard-toggle:focus-visible, .ek-rcard-remove:focus-visible, .ek-week:focus-visible { outline: 2px solid var(--rw-accent); outline-offset: 2px; }

/* In Karten (Tagespläne, Rezepte): ohne eigenen Rahmen */
.ek-item--s { border: 0; border-top: 1px solid var(--rw-card-border); border-radius: 0; background: transparent; }
.ek-item--s.done { background: transparent; opacity: 0.75; }
.ek-item--s .ek-item-main { padding: 10px 4px 10px 12px; }
.ek-item--s .ek-item-text strong { font-size: 0.94rem; font-weight: 500; }
.ek-item--s .ek-item-amount { font-size: 0.875rem; }

/* Raster */
.ek-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .ek-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ek-tiles--in { padding: 10px; border-top: 1px solid var(--rw-card-border); }
@media (min-width: 640px) { .ek-tiles--in { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ek-tile { position: relative; border: 1px solid var(--rw-card-border); border-radius: 20px; background: var(--rw-card); }
.ek-tile.done { background: var(--rw-done, #0e2e20); }
.ek-tile-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 10px 14px;
  border: 0;
  border-radius: 20px;
  background: none;
  text-align: center;
  cursor: pointer;
}
.ek-tile-main .ek-check { align-self: flex-start; }
.ek-tile-emoji { font-size: 2.9rem; line-height: 1.15; margin-top: 2px; }
.ek-tile.done .ek-tile-emoji { opacity: 0.55; }
.ek-tile-main strong { margin-top: 8px; font-size: 1rem; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ek-tile.done strong { color: var(--rw-ink-soft); text-decoration: line-through; }
.ek-tile-main small { margin-top: 2px; font-size: 0.9rem; color: var(--rw-ink-muted); }
.ek-tile-more { position: absolute; top: 4px; right: 0; }

/* Hinweise, Links, Knöpfe */
.ek-note { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 18px; }
.ek-note > svg { color: var(--rw-accent); margin-bottom: 4px; }
.ek-note strong { font-size: 1.06rem; }
.ek-note p { margin: 0; font-size: 0.94rem; color: var(--rw-ink-muted); line-height: 1.45; }
.ek-note .rw-outline { margin-top: 10px; text-decoration: none; }
.ek-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 14px 0 0; }
.ek-link { border: 0; background: none; padding: 8px 4px; color: var(--rw-accent) !important; font-size: 0.9rem !important; font-weight: 700; cursor: pointer; }
.ek-add { margin-top: 16px; }
.ek-loading { display: flex; justify-content: center; padding: 50px 0; }
.ek-loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--rw-accent); border-right-color: transparent; animation: ek-spin 0.8s linear infinite; }
@keyframes ek-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ek-loading span { animation-duration: 2.4s; } }

/* Tagespläne */
.ek-day { display: flex; align-items: center; border: 1px solid var(--rw-card-border); border-radius: 999px; background: var(--rw-card); }
.ek-day button { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.ek-day button:hover { background: var(--rw-hover, rgba(255, 255, 255, 0.08)); }
.ek-day span { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-center { text-align: center; margin: 8px 0 0; font-size: 0.875rem; color: var(--rw-ink-muted); }
.ek-meal-label { margin: 14px 4px 8px; font-size: 0.8rem; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--rw-ink-muted); }
.ek-meal { padding: 0; overflow: hidden; border-radius: 18px; }
.ek-meal + .ek-meal { margin-top: 10px; }
.ek-meal-head { display: flex; align-items: center; gap: 14px; padding: 10px 8px 10px 10px; color: var(--rw-ink); text-decoration: none; }
a.ek-meal-head:hover { background: var(--rw-hover, rgba(255, 255, 255, 0.04)); }
.ek-meal-head strong { flex: 1; min-width: 0; font-size: 1.03rem; font-weight: 800; }
.ek-thumb { flex: none; width: 64px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--rw-icon-bg); display: flex; align-items: center; justify-content: center; color: var(--rw-ink-soft); }
.ek-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ek-meal-note { margin: 0; padding: 4px 16px 14px; font-size: 0.875rem; color: var(--rw-ink-soft); }

/* Meine Rezepte */
.ek-lead { margin: 0 2px 12px; font-size: 0.94rem; color: var(--rw-ink-muted); }
.ek-h2 { margin: 0 2px 2px; font-size: 1.37rem; font-weight: 800; }
.ek-rcard { padding: 0; overflow: hidden; border-color: var(--rw-inner-border); }
.ek-rcard + .ek-rcard { margin-top: 12px; }
.ek-rcard-head { display: flex; align-items: flex-start; }
.ek-rcard-toggle { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 4px; padding: 16px 0 16px 18px; border: 0; background: none; text-align: left; cursor: pointer; }
.ek-rcard-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ek-rcard-info strong { font-size: 1.19rem; font-weight: 900; line-height: 1.2; }
.ek-rcard-info > span:not(.ek-bar) { font-size: 1rem; }
.ek-rcard-info small { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.9rem; }
.ek-rcard-info em { margin-top: 10px; font-style: normal; font-size: 0.875rem; color: var(--rw-ink-muted); }
.ek-bar { display: block; height: 7px; margin-top: 8px; border-radius: 999px; background: var(--rw-track, rgba(255, 255, 255, 0.15)); overflow: hidden; }
.ek-bar i { display: block; height: 100%; border-radius: 999px; background: var(--rw-accent); }
.ek-rcard-img { flex: none; width: 104px; height: 96px; margin: 16px 0 0 12px; border-radius: 14px; overflow: hidden; background: var(--rw-icon-bg); }
.ek-rcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ek-rcard-chev { flex: none; order: 2; }
.ek-rcard-head .ek-rcard-toggle { order: 1; }
.ek-rcard-head .ek-rcard-img { order: 2; }
.ek-rcard-head::after { content: ''; order: 3; width: 8px; }
.ek-rcard-toggle .ek-rcard-chev { transition: transform 0.16s; }
.ek-rcard-toggle[aria-expanded="true"] .ek-rcard-chev { transform: rotate(180deg); }
.ek-rcard-more { padding: 0 10px 12px; }
.ek-rcard-remove {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 0;
  border-top: 1px solid var(--rw-card-border);
  background: none;
  color: var(--rw-ink-muted) !important;
  font-size: 0.9rem !important;
  cursor: pointer;
}
.ek-rcard-remove:hover { color: var(--rw-ink) !important; }
.ek-rtile { display: flex; align-items: center; gap: 14px; padding: 10px; color: var(--rw-ink); text-decoration: none; }
.ek-rtile + .ek-rtile { margin-top: 12px; }
.ek-rtile img { flex: none; width: 120px; height: 104px; border-radius: 14px; object-fit: cover; }
.ek-rtile span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ek-rtile strong { font-size: 1.06rem; font-weight: 800; line-height: 1.25; }
.ek-rtile small { margin-top: 6px; font-size: 0.875rem; color: var(--rw-ink-muted); }
.ek-info { display: flex; align-items: flex-start; gap: 8px; margin: 14px 4px; font-size: 0.85rem; color: var(--rw-ink-soft); }
.ek-info svg { flex: none; }
.ek-more-recipes { margin-top: 4px; }

/* Blätter */
.ek-sheet-sub { white-space: pre-line; }
.ek-menu { display: flex; flex-direction: column; padding: 6px 0 4px; }
.ek-menu button { display: flex; align-items: center; gap: 14px; padding: 14px 8px; border: 0; border-radius: 12px; background: none; color: var(--rw-ink); font: inherit; font-size: 1rem; text-align: left; cursor: pointer; }
.ek-menu button:hover { background: var(--rw-hover, rgba(255, 255, 255, 0.06)); }
.ek-form .rw-label { margin-top: 14px; }
.ek-form .rw-label:first-child { margin-top: 4px; }
.ek-form select.rw-field { appearance: auto; }
.ek-form-hint { margin: 10px 0 16px; font-size: 0.85rem; color: var(--rw-ink-soft); }
.ek-form .rw-primary:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 380px) {
  .ek-rcard-img { width: 84px; height: 80px; }
  .ek-view button { min-width: 46px; height: 48px; padding: 0 10px; }
}
