/* app.css — Feature-Komponenten (aus v1 portiert, auf Tokens umgestellt). */

/* ---------- Suche + Chips (Listenansicht) ---------- */
.search-wrap {
  display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 12px 0;
}
.search-wrap input { flex: 1; min-width: 0; border: none; background: transparent; font-size: 15px; color: var(--ink); outline: none; }
/* F4 (v2.17): Sortierung rechts im Suchfeld — schmal, damit die Suche auf dem Handy breit bleibt. */
.sort-sel {
  flex: 0 1 auto; max-width: 46%; min-height: 32px; padding: 4px 6px; border: none; border-left: 1.5px solid var(--line);
  background: transparent; color: var(--muted-strong); font-size: 13px; font-weight: 600; text-overflow: ellipsis;
}
.sort-sel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips::-webkit-scrollbar { height: 0; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 20px; border: 1.5px solid var(--line);
  background: transparent; font-weight: 600; font-size: 13px; color: var(--muted-strong); white-space: nowrap;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.more-toggle { border-style: dashed; }

/* ---------- F2: Mehrfach-Filter ---------- */
.more-panel { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.fg-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.mini { padding: 5px 11px; font-size: 12px; }
.filter-summary { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.seg-btn { padding: 5px 12px; font-size: 12px; font-weight: 700; background: transparent; color: var(--muted-strong); border: none; }
.seg-btn.on { background: var(--accent); color: #fff; }
.match-count { font-size: 13px; font-weight: 600; color: var(--muted-strong); }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 0; margin-left: auto; }

/* ---------- Rezept-Karten ---------- */
.rcard {
  position: relative; display: block; width: 100%; text-align: left; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 16px; padding: 16px 18px; cursor: pointer;
  box-shadow: var(--shadow); color: var(--ink); margin-bottom: 12px; transition: transform .1s;
}
.rcard:active { transform: scale(.98); }
.card-thumb { width: 100%; height: 150px; border-radius: 12px; background: var(--line-soft) center/cover no-repeat; margin-bottom: 12px; display: none; }
.card-thumb.has-img { display: block; }
.cat-label { display: inline-block; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); margin-bottom: 6px; }
.rname { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.2; margin-bottom: 8px; padding-right: 30px; }
.rmeta { display: flex; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; flex-wrap: wrap; align-items: center; }
.card-heart { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 22px; line-height: 1; padding: 4px; z-index: 2; color: var(--accent); }
.rate-mini { color: var(--accent-2); letter-spacing: 1px; }
.fab {
  position: fixed; bottom: calc(18px + var(--tabbar-h) + env(safe-area-inset-bottom)); right: max(24px, calc(50% - 296px));
  width: 58px; height: 58px; border-radius: 18px; background: var(--accent); color: #fff; border: none;
  font-size: 30px; box-shadow: 0 6px 20px rgba(200, 99, 46, .35); z-index: 20; transition: transform .12s;
}
.fab:active { transform: scale(.92); }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--badge-bg); color: var(--badge-fg); white-space: nowrap; }
.badge.alltag { background: var(--badge-alltag-bg); color: var(--badge-alltag-fg); }
.badge.besonders { background: var(--badge-besonders-bg); color: var(--badge-besonders-fg); }
.badge.prep { background: var(--badge-prep-bg); color: var(--badge-prep-fg); }
.badge.totry { background: var(--badge-totry-bg); color: var(--badge-totry-fg); }
.card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.card-badges .badge { font-size: 11px; padding: 2px 7px; }

/* ---------- Overlay + Sheet ---------- */
.overlay {
  position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px);
  z-index: 50; display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--paper); width: 100%; max-width: var(--maxw); max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 20px 20px calc(32px + env(safe-area-inset-bottom));
  animation: slideUp .28s cubic-bezier(.16, 1, .3, 1);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.sheet-head .hd-r { display: flex; gap: 8px; align-items: center; }
.icon-btn.close { color: #c0392b; border-color: rgba(192, 57, 43, .35); font-size: 17px; font-weight: 700; }

/* ---------- Detail ---------- */
.hero { width: 100%; height: 210px; border-radius: 18px; background: var(--line-soft) center/cover no-repeat; margin: 8px 0 6px; display: none; }
.hero.has-img { display: block; }
.detail-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin: 4px 0 8px; line-height: 1.15; }
.sheet h3, .cook h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--accent); margin: 22px 0 10px; }
.sheet ul, .sheet ol { padding-left: 22px; }
.sheet li { font-size: 15px; line-height: 1.7; margin-bottom: 4px; }
.tips-box { font-size: 15px; line-height: 1.6; background: var(--tips-bg); padding: 12px 14px; border-radius: 12px; }
.tipp-sec { margin-bottom: 8px; }
.tipp-sec .tl { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--badge-besonders-fg); }
.heart { background: none; border: none; font-size: 24px; line-height: 1; padding: 0; color: var(--accent); }
.stars { font-size: 26px; letter-spacing: 3px; cursor: pointer; user-select: none; margin: 2px 0 8px; }
.stars .star { color: var(--line); }
.stars .star.on { color: var(--accent-2); }
.photo-add {
  display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--card);
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; width: 100%;
  font-weight: 600; font-size: 14px; color: var(--ink); margin-top: 10px;
}
.photostrip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; }
.photostrip::-webkit-scrollbar { height: 0; }
.photostrip .ph { position: relative; flex-shrink: 0; }
.photostrip .ph .thumb { width: 96px; height: 96px; border-radius: 12px; background: var(--line-soft) center/cover no-repeat; }
.photostrip .rm { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .55); color: #fff; border: none; border-radius: 50%; width: 24px; height: 24px; font-size: 13px; line-height: 1; }
.fb { width: 100%; min-height: 70px; margin-top: 4px; }
.fb-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.actions .btn-primary, .actions .btn-sec { width: 100%; padding: 14px 8px; }
.btn-cook { background: var(--accent); }
.btn-del { color: var(--danger); }

/* ---------- Formular ---------- */
.sheet label { display: block; font-weight: 700; font-size: 13px; color: var(--muted-strong); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .4px; }
input.f, textarea.f, select.f {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 15px; color: var(--ink); outline: none;
}
input.f:focus, textarea.f:focus, select.f:focus { outline: 2px solid var(--accent); }
textarea.f { resize: vertical; }
.frow { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.frow .num { flex-shrink: 0; width: 24px; text-align: right; font-weight: 700; font-size: 14px; color: var(--muted); }
.frow input { flex: 1; }
.frow .rm { flex-shrink: 0; background: transparent; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--danger); font-size: 14px; }
.addrow { background: transparent; border: none; color: var(--accent); font-weight: 700; font-size: 14px; padding: 8px 0 2px; }
.save-btn { width: 100%; margin-top: 24px; background: var(--accent); color: #fff; border: none; border-radius: 14px; padding: 15px; font-weight: 700; font-size: 16px; }
label.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; color: var(--ink); }
label.check input { width: auto; }

/* ---------- Menü ---------- */
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 10px;
  font-weight: 700; font-size: 16px; color: var(--ink);
}
.menu-item.on { border-color: var(--accent); color: var(--accent); }
.menu-item .soon { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--badge-bg); border-radius: 999px; padding: 2px 8px; }

/* ---------- Kochmodus ---------- */
.cook {
  position: fixed; inset: 0; background: var(--paper); z-index: 60; overflow-y: auto;
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 22px calc(48px + env(safe-area-inset-bottom));
}
.cook-top { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--paper); padding: 8px 0 12px; margin-bottom: 6px; z-index: 2; }
.cook-top .ct { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.cook h2 { font-family: var(--font-display); font-size: 26px; line-height: 1.15; margin-bottom: 4px; }
.wakeinfo { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cook-sec { font-family: var(--font-display); font-size: 18px; color: var(--accent); margin: 18px 0 8px; }
.cook-ing { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; font-size: 17px; line-height: 1.45; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.cook-ing.done { opacity: .4; text-decoration: line-through; }
.cook-step { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; font-size: 19px; line-height: 1.5; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.cook-step.done { opacity: .42; text-decoration: line-through; }
.cook-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.tick { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); margin-top: 2px; }
.done .tick { background: var(--accent); border-color: var(--accent); }
.cook-done-btn { width: 100%; margin-top: 28px; background: var(--ink); color: var(--paper); border: none; border-radius: 14px; padding: 15px; font-weight: 700; font-size: 16px; }
.modeswitch { display: flex; background: var(--badge-bg); border-radius: 10px; padding: 3px; }
.modeswitch .ms { border: none; background: transparent; font-weight: 700; font-size: 12px; color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.modeswitch .ms.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.foldhead { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.foldhead .chev { font-size: 14px; color: var(--muted); }
.cook-step .cook-text { flex: 1; }
.step-timer { flex-shrink: 0; align-self: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 9px; font-weight: 700; font-size: 13px; color: var(--accent); white-space: nowrap; }
.step-timer.running, .pager-timer.running { background: var(--accent); color: #fff; border-color: var(--accent); }
.step-timer.fired, .pager-timer.fired { background: var(--ok); color: #fff; border-color: var(--ok); }
.reset-prog { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 12px; text-decoration: underline; padding: 0; margin-left: 6px; }
.pager { margin-top: 8px; }
.pager-count { font-weight: 700; font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.pager-step { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; min-height: 150px; }
.pager-step.done { opacity: .5; }
.cook-num.big { width: 44px; height: 44px; font-size: 18px; }
.pager-text { flex: 1; font-size: 22px; line-height: 1.45; }
.pager-timer { width: 100%; margin-top: 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; font-weight: 700; font-size: 16px; color: var(--accent); }
.pager-nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.pager-nav button { padding: 13px 6px; font-size: 14px; }
.cook-tipp { background: var(--tips-bg); border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 15px; line-height: 1.55; }

/* Portions-Scaler */
.scaler { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 10px 0 4px; }
.scaler .lbl { font-weight: 700; font-size: 13px; color: var(--muted-strong); text-transform: uppercase; letter-spacing: .4px; }
.scaler button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); font-size: 19px; font-weight: 700; line-height: 1; }
.scaler .val { min-width: 64px; text-align: center; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.scaler .note { font-size: 12px; color: var(--accent); font-weight: 600; margin-left: auto; }

/* ---------- Koch-Match (Swipe) ---------- */
.match-stack { position: relative; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; border: none; border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; box-shadow: 0 3px 10px rgba(200, 99, 46, .35); }
.match-stack .ms-count { background: #fff; color: var(--accent); border-radius: 10px; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; padding: 0 5px; }
.swipe-wrap { padding: 8px var(--pad) 30px; }
.swipe-deck { position: relative; height: 60vh; max-height: 540px; margin: 6px auto 0; }
.scard { position: absolute; inset: 0; border-radius: 24px; overflow: hidden; background: #2a1f17; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); will-change: transform; touch-action: pan-y; cursor: grab; }
.scard.behind { transform: scale(.94) translateY(14px); filter: brightness(.95); pointer-events: none; }
.scard-img { position: absolute; inset: 0; background: #e9dcc6 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 88px; }
.scard-img.has-img, .match-thumb.has-img { font-size: 0; }
.scard-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, 0) 72%); }
.scard-badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 84%; }
.sb { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #fff; background: rgba(0, 0, 0, .42); backdrop-filter: blur(4px); padding: 6px 10px; border-radius: 20px; }
.sb.kind { background: rgba(232, 161, 58, .95); }
.scard-info { position: absolute; left: 18px; right: 18px; bottom: 18px; color: #fff; }
.scard-name { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.scard-meta { font-weight: 600; font-size: 14px; opacity: .96; display: flex; gap: 12px; flex-wrap: wrap; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.scard-meta .st { color: var(--accent-2); }
.scard-stamp { position: absolute; top: 34px; font-weight: 800; font-size: 26px; letter-spacing: 2px; padding: 6px 16px; border: 4px solid; border-radius: 12px; opacity: 0; text-transform: uppercase; pointer-events: none; }
.scard-stamp.like { left: 22px; color: #4caf50; border-color: #4caf50; transform: rotate(-16deg); }
.scard-stamp.nope { right: 22px; color: #e05246; border-color: #e05246; transform: rotate(16deg); }
.swipe-actions { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px; }
.sw-btn { width: 62px; height: 62px; border-radius: 50%; border: none; font-size: 26px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center; background: var(--card); transition: transform .12s; }
.sw-btn:active { transform: scale(.9); }
.sw-btn.nope { color: #e05246; }
.sw-btn.like { color: #fff; background: linear-gradient(135deg, #ff7a45, var(--accent)); font-size: 28px; }
.sw-btn.undo { width: 48px; height: 48px; font-size: 19px; color: var(--muted); }
.swipe-hint { text-align: center; font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 14px; }
.swipe-empty { text-align: center; padding: 50px 20px; color: var(--muted-strong); display: flex; flex-direction: column; align-items: center; }
.swipe-empty h3 { color: var(--accent); margin: 0 0 6px; }
.match-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.match-thumb { width: 56px; height: 56px; border-radius: 12px; background: #e9dcc6 center/cover no-repeat; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.match-info { flex: 1; min-width: 0; }
.match-info .mn { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.15; }
.match-info .mm { font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 3px; }
.match-rm { background: none; border: none; color: var(--danger); font-size: 16px; padding: 6px; flex-shrink: 0; }

/* ---------- Einkaufsliste ---------- */
.shop-add { display: flex; gap: 8px; margin-top: 10px; }
.shop-add input { flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; background: var(--card); color: var(--ink); outline: none; }
.shop-add input:focus { outline: 2px solid var(--accent); }
.add-custom { flex-shrink: 0; background: var(--accent); color: #fff; border: none; border-radius: 12px; padding: 0 14px; font-weight: 700; font-size: 14px; }
.sl-top { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 2px; }
.sl-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.sl-clear { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: underline; }
.sl-actions { display: flex; gap: 12px; align-items: center; }
.sl-clear-all { background: none; border: none; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; }
.sl-share { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: underline; }
/* v2.11: Sync-/Partner-Karte. Alle Knöpfe explizit mit Theme-Farben — vorher erbten sie die
   helle Schrift des Dark-Themes auf weißem Browser-Standard-Hintergrund (unlesbar). */
.sl-sync { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.sl-sync.warn { border-color: var(--danger); }
.sl-sync-row { display: flex; align-items: center; gap: 12px; }
.sl-sync-ic { font-size: 22px; flex-shrink: 0; }
.sl-sync-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sl-sync-txt strong { font-size: 14px; color: var(--ink); }
.sl-sync-txt span { font-size: 12.5px; color: var(--muted-strong); }
.sl-sync.warn .sl-sync-txt span { color: var(--danger); }
.sl-btn { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sl-btn:disabled { opacity: .5; }
.sl-refresh { width: 44px; padding: 0; flex-shrink: 0; font-size: 18px; }
.sl-wide { width: 100%; text-decoration: none; }
.sl-help { font-size: 14px; color: var(--muted-strong); line-height: 1.55; margin: 0 0 10px; }
.sl-pick-msg { margin-top: 8px; min-height: 1em; }
.sl-linked { background: var(--line-soft); border: 1.5px solid var(--accent); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin-top: 8px; }
.sheet .btn-primary.sl-wide, .sheet .btn-sec.sl-wide { margin-top: 4px; }
/* I3: Freunde-Link */
.sl-sync-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sl-sync-btns .sl-btn { flex: 1 1 140px; }
.sl-btn.sl-friends.on { border-color: var(--accent); }
.sl-friend-st { font-size: 12.5px; color: var(--muted-strong); }
.sl-friend-st.warn { color: var(--danger); }
.sl-from { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.sl-item.done .sl-from { color: var(--muted-strong); }
.sheet .sl-field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.sheet .sl-field input { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: 15px; background: var(--paper); color: var(--ink); }
.sl-fine { font-size: 12.5px; margin-top: 12px; }
.sl-undo-btn { background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 7px 14px; font-weight: 700; }
.sl-sort { display: flex; gap: 6px; margin: 8px 0 4px; }
.sl-sortbtn { background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted-strong); }
.sl-sortbtn.on { border-color: var(--accent); color: var(--accent); background: var(--line-soft); }
.sl-cat { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 14px 0 4px; }
.sl-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.sl-item.done .sl-name { text-decoration: line-through; opacity: .45; }
.sl-ic { font-size: 20px; flex-shrink: 0; width: 24px; text-align: center; }
.sl-name { flex: 1; font-size: 16px; cursor: pointer; }
.sl-ctrl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* K3 a11y: 44px Tippziel (WCAG 2.5.5) statt 30px. */
.sl-dec, .sl-inc { width: 44px; height: 44px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 17px; color: var(--ink); line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.sl-qty { min-width: 18px; text-align: center; font-weight: 700; font-size: 15px; }
.sl-rm { width: 44px; height: 44px; border-radius: 8px; border: none; background: transparent; color: var(--danger); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.cat-sec { margin-bottom: 8px; }
.cat-head { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px; font-weight: 700; font-size: 15px; color: var(--ink); gap: 8px; }
.cat-head .chev { color: var(--muted); font-size: 13px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.cat-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 6px; font-weight: 600; font-size: 12px; color: var(--ink); text-align: center; transition: transform .12s, border-color .12s; }
.cat-item .ci-ic { font-size: 24px; }
.cat-item .ci-nm { line-height: 1.2; }
.cat-item.just-added { transform: scale(.93); border-color: var(--accent); }
.cat-item.in { border-color: var(--accent); background: var(--line-soft); }
.ci-badge { position: absolute; top: -7px; right: -7px; background: var(--accent); color: #fff; border-radius: 11px; min-width: 22px; height: 22px; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- Wochenplan ---------- */
.plan-controls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.plan-controls .btn-primary, .plan-controls .btn-sec { padding: 10px 14px; font-size: 14px; }
.plan-day { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.plan-day.locked { border-color: var(--accent); }
.pd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pd-day { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.pd-date { font-family: var(--font-body); font-size: 12px; color: var(--muted); font-weight: 600; }
.pd-recipe { display: block; width: 100%; text-align: left; background: none; border: none; padding: 4px 0; }
.pd-name { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.pd-meta { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.pd-empty { color: var(--muted); font-style: italic; padding: 4px 0; }
.pd-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- KI-Assistent ---------- */
.ai-tools { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.ai-tools .chip { background: var(--card); }
.ai-msg { max-width: 88%; margin-bottom: 12px; padding: 12px 14px; border-radius: 16px; font-size: 15px; line-height: 1.55; }
.ai-msg.user { margin-left: auto; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.ai { margin-right: auto; background: var(--card); border: 1.5px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.ai a { color: var(--accent); }
.ai-busy { color: var(--muted); font-weight: 600; padding: 8px 0; }
.ai-inputbar { position: fixed; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--maxw); display: flex; gap: 8px; padding: 10px var(--pad); background: var(--paper); border-top: 1px solid var(--line-soft); z-index: 15; }
.ai-inputbar input { flex: 1; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 15px; background: var(--card); color: var(--ink); outline: none; }
.ai-inputbar input:focus { outline: 2px solid var(--accent); }
.ai-inputbar .btn-primary { padding: 12px 18px; }
.ai-suggestions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ai-sug { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.ai-sug .btn-sec, .ai-recipe .btn-sec, .ai-recipe .btn-primary { padding: 9px 14px; font-size: 13px; margin-top: 8px; margin-right: 6px; }
.sug-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.sug-reason { font-size: 13px; color: var(--muted-strong); margin-top: 3px; }
.ai-recipe { background: var(--paper); border: 1.5px solid var(--accent); border-radius: 12px; padding: 12px; margin-top: 8px; }

/* ---------- Einstellungen ---------- */
.set-card { margin-bottom: 14px; }
.set-card h3 { margin: 0 0 8px !important; }
.set-note { font-size: 13px; color: var(--muted-strong); line-height: 1.55; margin-bottom: 8px; }
.set-card label.check { margin-top: 8px; }
.set-card code { background: var(--badge-bg); border-radius: 6px; padding: 1px 5px; }
/* v2.16 (Q3): KI-Verbrauch */
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; }
.usage-table th, .usage-table td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.usage-table th { font-weight: 600; color: var(--muted-strong); }
.usage-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-table tfoot td { font-weight: 600; border-bottom: none; }

/* ---------- Sprachauswahl ---------- */
.lang-overlay { align-items: center; }
.lang-modal { background: var(--paper); border-radius: var(--radius-xl); padding: 28px 24px; width: 100%; max-width: 380px; margin: 0 16px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.lang-modal h2 { font-size: 22px; margin-bottom: 2px; }
.lang-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.lang-grid { display: flex; flex-direction: column; gap: 10px; }
.lang-btn { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; font-weight: 700; font-size: 16px; color: var(--ink); }
.lang-btn.on { border-color: var(--accent); color: var(--accent); }
.lang-flag { font-size: 24px; }
.lang-toggle { display: flex; gap: 8px; }
.lang-toggle .lang-btn { flex: 1; justify-content: center; padding: 12px 8px; font-size: 14px; }

/* ---------- Lager ---------- */
.lager-sec { margin-bottom: 16px; }
.lager-cat { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 14px 0 6px; }
.stock-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.stock-chip { padding: 7px 13px; border-radius: 20px; border: 1.5px solid var(--line); background: transparent; font-weight: 600; font-size: 13px; color: var(--muted-strong); white-space: nowrap; }
.stock-chip.on { background: var(--badge-alltag-bg); color: var(--badge-alltag-fg); border-color: var(--badge-alltag-fg); }
.stock-chip .x { margin-left: 6px; opacity: .5; }
.stock-chip .sc-ic { margin-right: 5px; }
.fridge-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.fridge-item .fi-ic { font-size: 18px; flex: 0 0 auto; }
.fridge-item .fi-name { flex: 1; font-size: 15px; }
.fridge-item .fi-qty { font-size: 13px; color: var(--muted); }
.fridge-item .fi-used { background: transparent; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--ok); }
.fridge-item .fi-del { background: none; border: none; color: var(--danger); font-size: 15px; padding: 6px; }
.fridge-add { display: flex; gap: 8px; margin-top: 10px; }
.fridge-add input { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; background: var(--card); color: var(--ink); outline: none; }
.fridge-add .fa-name { flex: 2; }
.fridge-add .fa-qty { flex: 1; min-width: 0; }
.stage-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.stage-item input { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); color: var(--ink); }
.cap-thumb { width: 100%; max-height: 220px; object-fit: contain; border-radius: 14px; margin-top: 10px; background: var(--line-soft); }
.cap-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cap-thumbs img { width: 90px; height: 90px; object-fit: cover; border-radius: 12px; }

/* ---------- Capture: AI busy state (A2) ---------- */
.cap-busy {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px;
  border: 1.5px solid var(--accent); border-radius: 14px; background: var(--line-soft);
}
.cap-busy .spinner {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
.cap-busy .cap-busy-text { font-weight: 600; color: var(--ink); }
.cap-busy .cap-busy-sub { font-size: 13px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Capture: Bulk-Review (C1) ---------- */
.bulk-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.bulk-row .bulk-cb { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.bulk-row .bulk-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bulk-row .bulk-name { font-weight: 600; }
.bulk-row .bulk-sub { font-size: 12px; color: var(--muted); }
.bulk-row .bulk-edit { padding: 5px 10px; font-size: 12px; }

/* ---------- Guide ---------- */
.guide-feat { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.guide-feat .gf-t { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.guide-feat .gf-b { font-size: 14px; color: var(--muted-strong); line-height: 1.5; }
.guide-changelog { font-size: 14px; line-height: 1.7; color: var(--muted-strong); }
.guide-changelog li { margin-bottom: 2px; }

/* ---------- J2: Tab-Leiste unten (5 Hauptbereiche) ---------- */
/* z-index: über FAB (20) und KI-Eingabe (15), unter Sheets/Overlays (50) und Kochmodus (60). */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 40;
  width: 100%; max-width: var(--maxw); display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  background: var(--paper); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}
body.no-tabbar .tabbar { display: none; }
.tab {
  flex: 1 1 0; min-width: 0; min-height: 44px; background: none; border: 0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted-strong); font-size: 11px; font-weight: 600; line-height: 1.1; padding: 6px 2px;
}
.tab-ic { position: relative; font-size: 22px; line-height: 1; filter: grayscale(.6); opacity: .8; transition: transform .12s; }
.tab-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.on { color: var(--accent); }
.tab.on .tab-ic { filter: none; opacity: 1; transform: translateY(-1px) scale(1.08); }
.tab.on .tab-lbl { font-weight: 700; }
.tab:active .tab-ic { transform: scale(.9); }
.tab-badge {
  position: absolute; top: -6px; left: 60%; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; border: 2px solid var(--paper);
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; font-family: var(--font-body);
}
@media (pointer: coarse) {
  body.typing .tabbar { display: none; }
  body.typing .ai-inputbar { bottom: env(safe-area-inset-bottom); }
}

/* ---------- D2: Zutaten mit Katalog-Symbol (Detail + Kochmodus) ---------- */
.sheet .ing-list, .ing-list { list-style: none; padding-left: 0; }
.ing-list li { display: flex; gap: 10px; align-items: baseline; }
.ing-ic { flex: 0 0 1.4em; text-align: center; font-size: .95em; color: var(--muted); }

/* ---------- C2: Fortschritt/Meldungen in der jeweiligen Erfassungs-Karte ---------- */
.cap-slot:empty { display: none; }
.cap-slot { margin-top: 10px; }
.cap-msg { margin: 0; }

/* ---------- v2.16b (T9): Herkunft, Snackbar, Neu-Hinweis, Ergebnis-Blatt, sichere Tipps ---------- */
.sl-origin { display: block; font-size: 12px; font-weight: 600; color: var(--muted-strong); margin-top: 2px; text-decoration: none; }
.sl-origin.tap { color: var(--accent); }
.sl-item.done .sl-origin { opacity: .7; }
/* UX-13: ✕ weg vom + (vorher 6px Abstand) */
.sl-rm { margin-left: 14px; }
/* UX-13: Kopf-Aktionen mit 44px-Tippfläche */
.sl-clear, .sl-clear-all, .sl-share { min-height: 44px; padding: 0 4px; }
.sl-actions { gap: 8px; }
.snack {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(12px + var(--tabbar-h) + env(safe-area-inset-bottom));
  width: calc(100% - 2 * var(--pad)); max-width: calc(var(--maxw) - 2 * var(--pad));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 8px 8px 8px 14px;
  font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.snack[hidden] { display: none; }
.snack .snack-txt { flex: 1; min-width: 0; }
.snack .sl-undo-btn { min-height: 40px; }
.sl-news { background: var(--line-soft); border: 1.5px solid var(--accent); border-radius: 12px; padding: 8px 8px 10px 14px; margin: 0 0 12px; font-size: 14px; }
.sl-news-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sl-news ul { margin: 4px 0 0; padding-left: 18px; }
.sl-news li { margin: 2px 0; }
.sl-news-more { font-size: 12.5px; color: var(--muted-strong); margin-top: 4px; }
.as-sum { font-size: 14px; color: var(--muted-strong); margin: 8px 0; }
.as-list { list-style: none; padding: 0; margin: 0 0 14px; max-height: 45vh; overflow: auto; }
.as-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.as-tag { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; align-self: center; }
.as-tag.merged { color: var(--muted-strong); }
.sheet .as-undo { margin-top: 8px; }
