/* ============================================================
   Kochkompass – Styles (mobile first, hell/dunkel)
   ============================================================ */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee7;
  --text: #2b2521;
  --muted: #7a6f66;
  --border: #e8e0d6;
  --primary: #c2562f;
  --primary-ink: #ffffff;
  --primary-weak: #f7e4db;
  --accent: #5f7a3a;
  --accent-weak: #e7eedc;
  --warn: #9a5b00;
  --warn-weak: #fdf0d5;
  --star: #e0a526;
  --shadow: 0 1px 2px rgba(43, 37, 33, .06), 0 4px 16px rgba(43, 37, 33, .06);
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1816; --surface: #25211e; --surface-2: #2e2925; --text: #f1ebe4; --muted: #a89c91;
    --border: #3a332e; --primary: #e0764c; --primary-ink: #1b1816; --primary-weak: #3d2a21;
    --accent: #9cbb6f; --accent-weak: #2c3323; --warn: #f0b85a; --warn-weak: #3a2d17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
h1 { font-size: 1.6rem; line-height: 1.2; margin: .4em 0 .5em; }
h2 { font-size: 1.2rem; margin: 1.2em 0 .5em; }
h3 { font-size: 1rem; margin: 1em 0 .4em; }
.card h2:first-child, .section-head h2 { margin-top: 0; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* --- Kopfzeile & Navigation --- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; padding: 10px 16px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand img { border-radius: 7px; }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; max-width: 150px; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: .75rem; color: var(--muted); text-decoration: none; position: relative;
}
.nav a.on { color: var(--primary); font-weight: 600; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav__badge { position: absolute; top: 8px; left: 50%; margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); font-size: .7rem; line-height: 18px; text-align: center; font-weight: 700; }
body.cooking .nav, body.cooking .topbar { display: none; }

/* --- Buttons, Chips, Eingaben --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); border-color: var(--border); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn--lg { min-height: 56px; padding: 0 24px; font-size: 1.1rem; flex: 1; }
.btn--block { width: 100%; margin-top: 12px; }
.btn--round { width: 40px; min-height: 40px; padding: 0; font-size: 1.3rem; }
.btn--icon.on { color: var(--primary); border-color: var(--primary); background: var(--primary-weak); }
.btn--timer { background: var(--accent-weak); border-color: transparent; color: var(--accent); }
.back-link { background: none; border: 0; padding: 8px 0; color: var(--muted); cursor: pointer; font-size: .95rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: .9rem;
}
.chip--on { background: var(--primary-weak); border-color: var(--primary); color: var(--text); font-weight: 600; }
.chip--ghost { border-style: dashed; color: var(--muted); }
.chip--timer { margin-top: 6px; background: var(--accent-weak); border-color: transparent; color: var(--accent); font-weight: 600; }

.input, select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); outline: none;
}
.input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
textarea.input { resize: vertical; }
.search { margin-bottom: 4px; }
.add-row { display: flex; gap: 8px; margin: 12px 0; }
.add-row .btn { flex: none; width: 48px; padding: 0; font-size: 1.3rem; }
.add-row .btn--auto { width: auto; padding: 0 16px; font-size: 1rem; }
.field { display: block; margin: 16px 0; border: 0; padding: 0; }
.field legend, .field { font-weight: 600; }
.field .input { margin-top: 6px; font-weight: 400; }
.field p, .field .chips { font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }

/* --- Karten & Listen --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.list { display: grid; gap: 12px; margin: 12px 0; }
@media (min-width: 640px) { .list { grid-template-columns: 1fr 1fr; } }
.recipe-card { display: block; margin: 0; color: var(--text); text-decoration: none; transition: transform .12s, border-color .12s; }
.recipe-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.recipe-card h3 { margin: 0; font-size: 1.05rem; }
.recipe-card p { margin: 4px 0 8px; }
.recipe-card__top { display: flex; justify-content: space-between; gap: 8px; }
.fav-dot { color: var(--primary); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .875rem; color: var(--muted); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--text); }
.badge--vegan, .badge--vegetarisch { background: var(--accent-weak); color: var(--accent); }
.badge--fisch { background: #dfeef6; color: #25607e; }
.badge--fleisch { background: var(--primary-weak); color: var(--primary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge--fisch { background: #1f323c; color: #8cc3de; } }
.notice { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; font-size: .925rem; }
.notice--warn { background: var(--warn-weak); color: var(--warn); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h1 { margin-bottom: .3em; }

.stars { display: inline-flex; gap: 1px; }
.star { color: var(--border); font-size: 1rem; line-height: 1; }
.star.on { color: var(--star); }
.stars--input .star { background: none; border: 0; font-size: 1.7rem; padding: 2px; cursor: pointer; }

.coverage { margin-top: 10px; }
.coverage__bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.coverage__bar span { display: block; height: 100%; background: var(--accent); }

.filters { margin: 8px 0; }
.filters summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 12px; padding: 8px 0; }
.filters__grid label { font-size: .875rem; color: var(--muted); }
.filters__grid select { margin-top: 4px; color: var(--text); }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 12px 0 0; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab--on { color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* --- Entscheidung --- */
.decide__bar { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.decide__title { text-align: center; font-size: 1.5rem; margin: .6em 0 .8em; }
.progress { display: flex; gap: 6px; }
.progress span { width: 8px; height: 8px; border-radius: 4px; background: var(--border); }
.progress span.on { background: var(--primary); }
.progress--wide { margin: 4px 0 12px; }
.progress--wide span { flex: 1; height: 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tiles--big { grid-template-columns: 1fr 1fr; }
.tiles--big .tile { min-height: 130px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 100px; padding: 14px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: center; color: var(--text); text-decoration: none;
  transition: transform .12s, border-color .12s;
}
.tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.tile__icon { font-size: 2rem; line-height: 1; }
.tile__label { font-weight: 600; }
.tile__count { position: absolute; top: 8px; right: 10px; font-size: .75rem; color: var(--muted); }
.tile--empty { opacity: .5; }
.tile--egal { background: var(--surface-2); box-shadow: none; }
.kcal-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.choice { border: 0; padding: 0; margin: 16px 0; }
.choice legend { font-weight: 600; margin-bottom: 8px; }
.choice .chip { margin: 0 6px 6px 0; }
.verdict { text-align: center; }
.verdict__text { font-size: 1.1rem; }
.verdict .row { justify-content: center; }

/* --- Rezept --- */
.recipe__head h1 { font-size: 1.8rem; margin: .1em 0 .3em; }
.eyebrow { margin: 8px 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); font-weight: 700; }
.lead { color: var(--muted); margin: 0 0 12px; }
.recipe__actions { align-items: center; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper__value { min-width: 110px; text-align: center; }
.form-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 600; }
.form-pick select { width: auto; font-weight: 400; }
.ing-group { margin: 16px 0 4px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ingredients li:last-child { border-bottom: 0; }
.ing-amount { flex: 0 0 96px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.steps { padding-left: 1.4em; margin: 0; }
.steps li { padding: 6px 0 10px; }
.steps li::marker { color: var(--primary); font-weight: 700; }
.steps p { margin: 0; }
.nutrition { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.nutrition th, .nutrition td { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: right; }
.nutrition th:first-child { text-align: left; font-weight: 400; }
.nutrition thead th { color: var(--muted); font-size: .8rem; font-weight: 600; }
.nutrition tr:first-child td { font-weight: 700; }
.nutrition tr.sub th { padding-left: 16px; color: var(--muted); }

/* --- Kochmodus --- */
.cook { min-height: 100vh; display: flex; flex-direction: column; padding-top: 8px; }
.cook__bar { display: flex; justify-content: space-between; align-items: center; }
.cook__title { font-size: 1rem; color: var(--muted); margin: 8px 0; }
.cook__body { flex: 1; }
.cook__step { font-size: 1.5rem; line-height: 1.45; margin: 12px 0 20px; }
.cook__ings { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; margin-bottom: 16px; }
.cook__nav { display: flex; gap: 12px; position: sticky; bottom: 0; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); background: var(--bg); }

/* --- Einkaufsliste --- */
.aisle h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 4px; }
.shop { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.shop li { border-bottom: 1px solid var(--border); }
.shop li:last-child { border-bottom: 0; }
.shop label { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 12px 14px; cursor: pointer; }
.shop input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.shop__amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.shop__from { flex-basis: 100%; padding-left: 34px; font-size: .78rem; color: var(--muted); }
.shop li.done .shop__name, .shop li.done .shop__amount { text-decoration: line-through; color: var(--muted); }

/* --- Verlauf --- */
.history { list-style: none; margin: 12px 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.history a { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 0; color: var(--text); text-decoration: none; }
.history__date { color: var(--muted); font-size: .85rem; min-width: 120px; }
.history__title { font-weight: 600; flex: 1; }

/* --- Dialog, Toast, Timer --- */
.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(92vw, 460px); max-height: 85vh; background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(20, 16, 14, .5); }
.dialog form { padding: 20px; display: flex; flex-direction: column; max-height: 85vh; }
.dialog h2 { margin: 0 0 8px; }
.dialog__body { overflow-y: auto; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.checklist { display: flex; flex-direction: column; }
.checklist .check { border-bottom: 1px solid var(--border); padding: 10px 0; }
.rate-pick { text-align: center; margin: 8px 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#timerbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; background: var(--accent-weak); border-top: 1px solid var(--border);
}
body.cooking #timerbar { bottom: calc(96px + env(safe-area-inset-bottom)); }
.timer { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 4px 6px 4px 14px; white-space: nowrap; }
.timer__time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.timer__label { font-size: .8rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.timer__x { border: 0; background: none; cursor: pointer; color: var(--muted); width: 28px; height: 28px; }
.timer--done { background: var(--primary); animation: pulse 1s infinite; }
.timer--done .timer__time, .timer--done .timer__label, .timer--done .timer__x { color: var(--primary-ink); }
@keyframes pulse { 50% { opacity: .7; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --- Editor --- */
.own-dot { color: var(--star); margin-left: auto; }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 560px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
.editor .field { margin: 12px 0; }
.editor select { margin-top: 6px; font-weight: 400; }
.editor .chips label.chip { display: inline-flex; align-items: center; font-weight: 400; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ed-row .ed-name, .ed-row .ed-note, .ed-row .ed-hint { grid-column: 1 / -1; }
.ed-row .ed-tools { justify-self: end; }
.ed-row--group { grid-template-columns: 1fr auto; }
.ed-row--group .input { font-weight: 700; }
.ed-row--group .ed-tools { grid-column: auto; }
.ed-row--unknown .ed-name { border-color: var(--warn); background: var(--warn-weak); }
.ed-hint { grid-column: 1 / -1; margin: 0; font-size: .85rem; color: var(--warn); }
.ed-unit { min-height: 44px; }
@media (min-width: 640px) {
  .ed-row { grid-template-columns: 1.4fr 80px 120px 1fr auto; }
  .ed-row .ed-name, .ed-row .ed-note, .ed-row .ed-tools { grid-column: auto; }
}
.ed-tools { display: inline-flex; gap: 2px; }
.ed-tools .btn { min-height: 36px; width: 36px; padding: 0; }
.ed-steps { padding-left: 1.4em; }
.ed-steps li { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 8px; }
.ed-steps li::marker { color: var(--primary); font-weight: 700; }
.ed-steps textarea { flex: 1; }
.ed-errors { color: var(--primary); padding-left: 1.2em; margin: 6px 0; }
.ed-warn { color: var(--warn); padding-left: 1.2em; margin: 6px 0; }
.ok { color: var(--accent); font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }

/* --- Konto & Sync --- */
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 0 auto; padding-right: 16px; }
.topbar__inner .brand { margin: 0; }
.sync-pill { font-size: .8rem; padding: 4px 12px; border-radius: 999px; text-decoration: none; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.sync-pill--off { color: var(--primary); border-color: var(--primary); }
.sync-pill--ok { color: var(--accent); border-color: transparent; background: var(--accent-weak); }
.sync-pill--warn { color: var(--warn); border-color: transparent; background: var(--warn-weak); }
.sync-state { font-weight: 600; }
.sync-state--synchron { color: var(--accent); }
.sync-state--fehler, .sync-state--offline { color: var(--warn); }
.members { list-style: none; padding: 0; margin: 4px 0 12px; }
.members li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.invite-code { font-size: 1.3rem; letter-spacing: .12em; font-family: ui-monospace, monospace; }
.danger { margin: 24px 0; color: var(--muted); }
.danger summary { cursor: pointer; }
.danger .btn { border-color: var(--primary); color: var(--primary); }

/* --- Wochenplan --- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; text-align: center; }
.days { display: grid; gap: 10px; }
@media (min-width: 640px) { .days { grid-template-columns: 1fr 1fr; } }
.day { margin: 0; padding: 12px 14px; }
.day--today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.day--past { opacity: .6; }
.day__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.day__add { margin-top: 4px; padding-left: 0; }
.plan-entry { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); }
.plan-entry a { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 0; color: var(--text); text-decoration: none; }
.plan-entry__meal { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); font-weight: 700; min-width: 64px; }
.plan-entry__title { font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.today-card { margin-top: 0; }
.today-card .eyebrow { margin-top: 0; }
.today-card__item { display: block; padding: 6px 0; color: var(--text); text-decoration: none; }

/* --- Tagebuch --- */
.diary-kcal { font-size: 1.1rem; }
.diary-kcal strong { font-size: 2rem; }
.meter { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.meter--over span { background: var(--warn); }
.macros { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; color: var(--muted); margin-top: 8px; }
.macros strong { color: var(--text); }
.diary-list { list-style: none; margin: 0; padding: 0; }
.diary-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.diary-list li > a { flex: 1 1 140px; color: var(--text); font-weight: 600; text-decoration: none; }
.diary-portions { display: inline-flex; align-items: center; gap: 6px; }
.btn--xs { width: 30px; min-height: 30px; font-size: 1rem; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 126px; padding: 0 2px; margin: 8px 0; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; cursor: pointer; }
.bar__fill { display: block; background: var(--accent-weak); border: 1px solid var(--accent); border-bottom: 0; border-radius: 6px 6px 0 0; min-height: 2px; }
.bar--on .bar__fill { background: var(--accent); }
.bar--over { background: var(--warn-weak) !important; border-color: var(--warn) !important; }
.bar--on .bar--over { background: var(--warn) !important; }
.bar__label { height: 22px; line-height: 22px; text-align: center; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--border); }
.bar--on .bar__label { color: var(--text); font-weight: 700; }
.bars__target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--primary); pointer-events: none; }

/* --- Vorrat --- */
.pantry-add { display: grid; grid-template-columns: 1fr 150px 48px; gap: 8px; margin: 12px 0; }
.pantry-add .btn { padding: 0; font-size: 1.3rem; }
@media (max-width: 420px) { .pantry-add { grid-template-columns: 1fr 48px; } .pantry-add input[type=date] { grid-column: 1; grid-row: 2; } }
.pantry { list-style: none; margin: 12px 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pantry__item { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.pantry__item:last-child { border-bottom: 0; }
.pantry__name { flex: 1 1 120px; font-weight: 600; }
.pantry__badge { font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); }
.pantry__item--abgelaufen .pantry__badge { background: var(--primary-weak); color: var(--primary); }
.pantry__item--abgelaufen .pantry__name { text-decoration: line-through; color: var(--muted); }
.pantry__date { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 4px 6px; font-size: .85rem; color: var(--muted); }
.rest { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rest-hint { display: block; color: var(--accent); font-weight: 600; margin-top: 2px; }

/* --- Auswahl-Dialog --- */
.chips--tight { margin: 8px 0; gap: 6px; }
.chips--tight .chip { min-height: 30px; padding: 0 10px; font-size: .8rem; }
.pick-list { max-height: 38vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.pick { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick--on { background: var(--primary-weak); font-weight: 600; }
.nav a { font-size: .7rem; }
.diary-list li > a { flex: 1 1 100%; }
.diary-list li > button:last-child { margin-left: auto; }
.pantry__date { width: 150px; }
.pantry__date:invalid, .pantry__date[value=""] { opacity: .55; }

/* --- Fotos --- */
.recipe__photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); margin: 8px 0 4px; }
.recipe-card--photo { padding-top: 0; overflow: hidden; }
.recipe-card__img { display: block; width: calc(100% + 32px); margin: 0 -16px 12px; height: 140px; object-fit: cover; }
.ed-photo { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; }
