/* =========================================================================
   Rezepti – Bausteine (Richtung A · Emaille)
   Gepflegt von Chat #1 Design. Nutzt ausschließlich Variablen aus tokens.css.
   Übersicht aller Bausteine: design/bausteine.html
   Inhalt:
     1 Grundlagen      2 App-Gerüst (Topbar, Inhalt, Navigation)
     3 Knöpfe          4 Karten & Listen     5 Formulare
     6 Chips, Segment, Portionen   7 Bewertung    8 Rezept-Bausteine
     9 Editor (Stufen, Scrollrad, Zutaten-Zeilen)  10 Hinweise, Sheet, Login
     11 Hilfsklassen   12 Tablet   13 Maskottchen   14 Desktop
   ========================================================================= */

/* 1 ─ Grundlagen ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-ink);
  font-family: var(--font-body); font-size: var(--fs-md); line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0; }
a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-accent-hover); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: var(--r-sm); }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* 2 ─ App-Gerüst ──────────────────────────────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidenav { display: none; }   /* nur Desktop, siehe Abschnitt 14 */
.skip-link { position: absolute; left: var(--sp-2); top: -60px; z-index: 100; padding: var(--sp-2) var(--sp-3); background: var(--c-accent); color: var(--c-accent-ink); border-radius: var(--r-sm); font-weight: var(--fw-bold); }
.skip-link:focus { top: var(--sp-2); color: var(--c-accent-ink); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: calc(var(--topbar-h) + var(--safe-top)); padding: var(--safe-top) var(--sp-1) 0;
  display: flex; align-items: center; gap: var(--sp-1);
  background: var(--c-surface); border-bottom: 1px solid var(--c-line);
}
.topbar__title { flex: 1; min-width: 0; text-align: center; font-family: var(--font-head); font-size: var(--fs-lg); font-weight: var(--fw-bold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title--left { text-align: left; padding-left: var(--sp-3); }
.topbar__side { display: flex; align-items: center; min-width: var(--tap); }
.topbar__side--end { justify-content: flex-end; }
.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-4) var(--sp-4) calc(var(--nav-h) + var(--safe-bottom) + var(--sp-6)); display: flex; flex-direction: column; gap: var(--sp-4); }
.content--flush { padding-left: 0; padding-right: 0; padding-top: 0; }
.content--no-nav { padding-bottom: calc(var(--sp-8) + var(--safe-bottom)); }
.content--with-actionbar { padding-bottom: calc(84px + var(--safe-bottom)); }
.section { display: flex; flex-direction: column; gap: var(--sp-3); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.section__title { font-family: var(--font-body); font-size: var(--fs-md); font-weight: var(--fw-bold); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-bottom)); padding: 0 var(--sp-2) var(--safe-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: var(--c-surface); border-top: 1px solid var(--c-line);
}
.bottomnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 56px; min-height: var(--tap); color: var(--c-muted); text-decoration: none;
  font-size: 11px; font-weight: var(--fw-medium);
}
.bottomnav__item[aria-current="page"] { color: var(--c-accent); font-weight: var(--fw-bold); }
.bottomnav__item .icon { width: 22px; height: 22px; }
.bottomnav__add {
  width: 52px; height: 52px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center;
  background: var(--c-accent); color: var(--c-accent-ink); box-shadow: var(--shadow-2);
}
.bottomnav__add:hover { color: var(--c-accent-ink); background: var(--c-accent-hover); }
.bottomnav__add .icon { width: 26px; height: 26px; stroke-width: 2.4; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  background: var(--c-surface); border-top: 1px solid var(--c-line);
}
.actionbar__inner { display: flex; gap: var(--sp-3); width: 100%; max-width: var(--content-max); margin: 0 auto; }
.actionbar__inner > * { flex: 1; }
.actionbar__inner > .btn--primary { flex: 1.4; }

/* 3 ─ Knöpfe ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-5); border-radius: var(--r-lg); border: 1.5px solid transparent;
  font-size: var(--fs-md); font-weight: var(--fw-bold); text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn--primary { background: var(--c-accent); color: var(--c-accent-ink); }
.btn--primary:hover { background: var(--c-accent-hover); color: var(--c-accent-ink); }
.btn--secondary { background: transparent; color: var(--c-accent); border-color: var(--c-accent); }
.btn--secondary:hover { background: var(--c-soft); }
.btn--soft { background: var(--c-soft); color: var(--c-soft-ink); }
.btn--ghost { background: transparent; color: var(--c-accent); padding: 0 var(--sp-3); }
.btn--danger { background: var(--c-danger-soft); color: var(--c-danger); }
.btn--sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-pill); }
.btn--block { width: 100%; }
.btn-icon {
  width: var(--tap); height: var(--tap); flex-shrink: 0; border-radius: var(--r-pill); border: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--c-ink); cursor: pointer; text-decoration: none;
}
.btn-icon:hover { background: var(--c-surface-2); color: var(--c-ink); }
.btn-icon--filled { background: var(--c-surface); box-shadow: var(--shadow-1); }
.btn-icon--outline { border: 1px solid var(--c-line); background: var(--c-surface); }

/* 4 ─ Karten & Listen ─────────────────────────────────────────────────── */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.card--tight { padding: var(--sp-3); gap: var(--sp-2); }
.card--flush { padding: 0; gap: 0; overflow: hidden; }

.list { list-style: none; margin: 0; padding: 0; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.list__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--c-line); color: var(--c-ink); text-decoration: none; }
.list__item:first-child { border-top: 0; }
a.list__item:hover { background: var(--c-bg); color: var(--c-ink); }
.list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list__title { font-weight: var(--fw-semi); }
.list__sub { font-size: var(--fs-sm); color: var(--c-muted); }

/* Rezept-Kachel für Listen (Entdecken, Meine Rezepte) */
.rcard { display: flex; gap: var(--sp-3); padding: var(--sp-3); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); color: var(--c-ink); text-decoration: none; }
.rcard:hover { color: var(--c-ink); border-color: var(--c-muted); }
.rcard__photo { width: 88px; height: 88px; border-radius: var(--r-md); flex-shrink: 0; object-fit: cover; background: var(--c-surface-2); }
.rcard__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.rcard__title { font-family: var(--font-head); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.rcard__meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--c-muted); margin-top: auto; align-items: center; }

/* Foto / Platzhalter */
.photo { width: 100%; background-color: var(--c-surface-2); object-fit: cover; }
.photo--hero { height: 210px; }
.photo-placeholder {
  display: flex; align-items: center; justify-content: center; color: var(--c-muted); font-size: var(--fs-xs);
  background-color: var(--c-surface-2);
  background-image: repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 10px, transparent 10px 20px);
}

/* 5 ─ Formulare ───────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.field__hint { font-size: var(--fs-xs); color: var(--c-muted); }
.field__error { font-size: var(--fs-xs); color: var(--c-danger); font-weight: var(--fw-semi); }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap); padding: 0 var(--sp-3);
  background: var(--c-bg); color: var(--c-ink); border: 1px solid var(--c-line); border-radius: var(--r-sm);
  font-size: 16px; /* 16px verhindert Auto-Zoom auf iOS */
  transition: border-color var(--dur) var(--ease);
}
.textarea { padding: var(--sp-3); min-height: 96px; line-height: 1.45; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.input--amount { width: 72px; text-align: right; font-weight: var(--fw-bold); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 40px; }
.input-group > .icon { position: absolute; left: 12px; color: var(--c-muted); pointer-events: none; }
.input-group > .btn-icon { position: absolute; right: 0; }

/* Schalter (Admin-Einstellungen, Wasserzeichen …) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 56px; padding: var(--sp-3) 0; cursor: pointer; }
.switch__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 48px; height: 28px; border-radius: var(--r-pill); background: var(--c-line); flex-shrink: 0; transition: background var(--dur) var(--ease); }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease); }
.switch__input:checked + .switch__track { background: var(--c-accent); }
.switch__input:checked + .switch__track::after { transform: translateX(20px); }
.switch__input:focus-visible + .switch__track { outline: 2px solid var(--c-focus); outline-offset: 2px; }

/* Auf-/Zuklappen: <details class="card"> bzw. ui_disclosure() */
details.card { gap: 0; padding: 0; }
details.card > summary {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: var(--sp-3) var(--sp-4);
  list-style: none; cursor: pointer; font-weight: var(--fw-bold); border-radius: var(--r-lg);
  -webkit-user-select: none; user-select: none;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::marker { content: ""; }
details.card > summary::after { /* Pfeil rechts */
  content: ""; flex-shrink: 0; margin-left: auto; width: 9px; height: 9px;
  border-right: 2px solid var(--c-muted); border-bottom: 2px solid var(--c-muted);
  transform: translateY(-2px) rotate(45deg); transition: transform var(--dur) var(--ease);
}
details.card[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.card > summary:hover { background: var(--c-bg); }
details.card[open] > summary { border-bottom: 1px solid var(--c-line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
details.card > :not(summary) { margin: var(--sp-4); }
details.card > summary + * { margin-top: var(--sp-4); }
details.card > .disclosure__body { display: flex; flex-direction: column; gap: var(--sp-3); }
.disclosure__summary .icon { color: var(--c-accent); }

/* Kopierfeld: ui_copy_field() */
.copyfield { display: flex; gap: var(--sp-2); }
.copyfield__input { flex: 1; min-width: 0; font-size: var(--fs-sm); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--c-muted); }
.copyfield__btn { flex-shrink: 0; min-height: var(--tap); padding: 0 var(--sp-4); }
.copyfield__btn.is-copied { background: var(--c-accent); color: var(--c-accent-ink); }

/* 6 ─ Chips, Segment, Portionen ───────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--sp-4) * -1); padding: 0 var(--sp-4); }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--sp-3); flex-shrink: 0;
  border-radius: var(--r-pill); border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
  font-size: var(--fs-sm); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"], .chip--active { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-ink); font-weight: var(--fw-semi); }
.chip--soft { background: var(--c-soft); border-color: transparent; color: var(--c-soft-ink); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--c-surface-2); }
.seg__btn {
  flex: 1; min-height: 40px; border: none; border-radius: var(--r-md); background: transparent; color: var(--c-muted);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.seg__btn[aria-selected="true"], .seg__btn[aria-pressed="true"] { background: var(--c-surface); color: var(--c-ink); font-weight: var(--fw-bold); box-shadow: var(--shadow-1); }
.seg__count { font-weight: var(--fw-regular); color: var(--c-muted); }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.stepper__label { font-weight: var(--fw-semi); }
.stepper__ctrl { display: flex; align-items: center; gap: var(--sp-3); }
.stepper__value { min-width: 24px; text-align: center; font-size: var(--fs-lg); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* 7 ─ Bewertung 1–10 ──────────────────────────────────────────────────── */
/* Farbe über Klasse .rate-N (N = gerundeter Wert 1–10) */
.rate-1  { --rate: var(--rate-1);  --rate-ink: var(--rate-1-ink); }
.rate-2  { --rate: var(--rate-2);  --rate-ink: var(--rate-2-ink); }
.rate-3  { --rate: var(--rate-3);  --rate-ink: var(--rate-3-ink); }
.rate-4  { --rate: var(--rate-4);  --rate-ink: var(--rate-4-ink); }
.rate-5  { --rate: var(--rate-5);  --rate-ink: var(--rate-5-ink); }
.rate-6  { --rate: var(--rate-6);  --rate-ink: var(--rate-6-ink); }
.rate-7  { --rate: var(--rate-7);  --rate-ink: var(--rate-7-ink); }
.rate-8  { --rate: var(--rate-8);  --rate-ink: var(--rate-8-ink); }
.rate-9  { --rate: var(--rate-9);  --rate-ink: var(--rate-9-ink); }
.rate-10 { --rate: var(--rate-10); --rate-ink: var(--rate-10-ink); }

.rating { display: inline-flex; align-items: center; gap: var(--sp-2); }
.rating__badge {
  min-width: 44px; height: 44px; padding: 0 var(--sp-2); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rate, var(--c-surface-2)); color: var(--rate-ink, var(--c-muted));
  font-weight: var(--fw-black); font-size: 18px; font-variant-numeric: tabular-nums;
}
.rating__badge--sm { min-width: 32px; height: 26px; border-radius: 8px; font-size: var(--fs-sm); padding: 0 6px; }
.rating__text { display: flex; flex-direction: column; line-height: 1.2; }
.rating__of { font-size: var(--fs-sm); font-weight: var(--fw-semi); }
.rating__count { font-size: var(--fs-xs); color: var(--c-muted); }
.rating--none .rating__badge { font-size: var(--fs-sm); font-weight: var(--fw-semi); }

/* Auswahl-Leiste 1–10 (eigene Bewertung abgeben) */
.ratescale { display: flex; gap: 4px; margin: 0; padding: 0; border: 0; }
.ratescale__opt { flex: 1; position: relative; }
.ratescale__input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ratescale__label {
  display: flex; align-items: center; justify-content: center; height: var(--tap); border-radius: var(--r-sm);
  background: var(--rate); color: var(--rate-ink); font-weight: var(--fw-black); font-size: var(--fs-md); cursor: pointer;
  opacity: 0.55; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ratescale:not(:has(:checked)) .ratescale__label { opacity: 1; }
.ratescale__input:checked + .ratescale__label { opacity: 1; box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-ink); transform: translateY(-1px); }
.ratescale__input:focus-visible + .ratescale__label { outline: 2px solid var(--c-focus); outline-offset: 3px; }

/* 8 ─ Rezept-Bausteine ────────────────────────────────────────────────── */
.recipe-hero { position: relative; }
.recipe-hero__bar { position: absolute; top: calc(var(--sp-3) + var(--safe-top)); left: var(--sp-3); right: var(--sp-3); display: flex; justify-content: space-between; }
.recipe-hero__bar > div { display: flex; gap: var(--sp-2); }
.recipe-head { display: flex; flex-direction: column; gap: 6px; }
.recipe-head__by { font-size: var(--fs-sm); color: var(--c-muted); }
.meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.meta__item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-muted); }
.meta__item strong { color: var(--c-ink); font-weight: var(--fw-semi); }

/* Zutatenliste */
.ings { list-style: none; margin: 0; padding: 0; }
.ings__item { display: flex; gap: var(--sp-2); align-items: baseline; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-line); font-size: 14px; }
.ings__item:last-child { border-bottom: 0; }
.ings__amt { min-width: 60px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.ings__split { display: block; font-size: var(--fs-xs); color: var(--c-muted); margin-top: 2px; }
.ings__group { padding: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); }

/* Schritt */
.step { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: 10px; }
.step__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.step__no { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-accent); }
.step__text { font-size: var(--fs-md); line-height: var(--lh-text); }
.step__extra { font-size: var(--fs-sm); color: var(--c-muted); }
/* Zutat im Text + Teilmenge in Klammer: <span class="ing">Salz</span> <span class="amt">(6 g)</span> */
.ing { font-weight: var(--fw-semi); }
.amt { color: var(--c-accent); font-weight: var(--fw-bold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timer {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1.5px solid var(--c-accent); background: transparent; color: var(--c-accent); font-size: var(--fs-sm); font-weight: var(--fw-bold); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.timer[aria-pressed="true"] { background: var(--c-accent); color: var(--c-accent-ink); }

/* 9 ─ Editor ──────────────────────────────────────────────────────────── */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.stages__item { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--c-muted); }
.stages__item::before { content: ""; height: 4px; border-radius: 2px; background: var(--c-line); }
.stages__item--done::before, .stages__item[aria-current="step"]::before { background: var(--c-accent); }
.stages__item[aria-current="step"] { color: var(--c-ink); font-weight: var(--fw-bold); }

.steptabs { display: flex; align-items: center; gap: var(--sp-2); }
.steptabs__btn {
  width: var(--tap); height: var(--tap); border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-surface);
  font-weight: var(--fw-black); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--c-ink);
}
.steptabs__btn[aria-current="true"] { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); }
.steptabs__btn--add { border: 1.5px dashed var(--c-muted); background: transparent; color: var(--c-muted); }
.steptabs__hint { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--c-muted); }

/* Zugeordnete Zutat mit Teilmenge */
.assign { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--c-line); }
.assign__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.assign__name { font-size: 14px; font-weight: var(--fw-bold); }
.assign__hint { font-size: var(--fs-xs); color: var(--c-muted); }
.assign__hint--open { color: var(--c-accent); font-weight: var(--fw-semi); }
.assign__unit { width: 26px; font-size: var(--fs-sm); color: var(--c-muted); }

.preview { font-size: 14px; line-height: var(--lh-text); }
.preview__label { font-size: var(--fs-xs); color: var(--c-muted); margin-bottom: 2px; }

/* Scrollrad – kompakt: 3 sichtbare Zeilen à 28 px (≈ 84 px). Logik: assets/js/ui/wheel.js */
.wheels { position: relative; display: flex; justify-content: center; gap: var(--sp-6); }
.wheels::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 28px; margin-top: -14px; border-radius: var(--r-md); background: var(--c-soft); pointer-events: none; }
.wheel { position: relative; display: flex; align-items: center; gap: var(--sp-1); }
.wheel__list {
  width: 48px; height: 84px; margin: 0; padding: 28px 0; list-style: none; overflow-y: auto;
  scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), #000 35%, #000 65%, rgba(0,0,0,.35));
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), #000 35%, #000 65%, rgba(0,0,0,.35));
}
.wheel__list::-webkit-scrollbar { display: none; }
.wheel__list:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.wheel__opt { height: 28px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center;
  font-size: 15px; color: var(--c-muted); font-variant-numeric: tabular-nums; cursor: pointer; transition: font-size var(--dur) var(--ease); }
.wheel__opt[aria-selected="true"] { font-size: 20px; font-weight: var(--fw-black); color: var(--c-ink); }
.wheel__unit { width: 30px; font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--c-muted); }

/* Foto-Leiste im Editor (sortierbar) */
.photos { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; }
.photos__item { position: relative; width: 80px; height: 80px; border-radius: var(--r-md); overflow: hidden; flex-shrink: 0; background: var(--c-surface-2); }
.photos__item img { width: 100%; height: 100%; object-fit: cover; }
.photos__item--cover::after { content: "Titelbild"; position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--c-accent); color: var(--c-accent-ink); font-size: 10px; font-weight: var(--fw-bold); }
.photos__add { width: 80px; height: 80px; flex-shrink: 0; border-radius: var(--r-md); border: 1.5px dashed var(--c-muted); background: transparent; color: var(--c-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-xs); font-weight: var(--fw-semi); cursor: pointer; }

/* 10 ─ Hinweise, Sheet, Login/Passwortschutz ──────────────────────────── */
.notice { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--c-soft); color: var(--c-soft-ink); font-size: var(--fs-sm); }
.notice--error { background: var(--c-danger-soft); color: var(--c-danger); }
.notice--success { background: var(--c-soft); color: var(--c-success); }
.notice > .icon { margin-top: 1px; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: var(--c-overlay); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88dvh; overflow-y: auto;
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom)); background: var(--c-surface);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: var(--sp-3);
}
.sheet::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--c-line); margin-bottom: var(--sp-2); }
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }

.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + var(--safe-bottom)); }
.auth__box { width: 100%; max-width: 400px; margin: auto; display: flex; flex-direction: column; gap: var(--sp-5); }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; }
.auth__logo { width: 64px; height: 64px; border-radius: 18px; }
.auth__name { font-family: var(--font-head); font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.auth__lead { color: var(--c-muted); font-size: var(--fs-sm); }
.auth__foot { text-align: center; font-size: var(--fs-sm); color: var(--c-muted); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-4); color: var(--c-muted); }
.empty > .icon { width: 36px; height: 36px; color: var(--c-accent); }
.empty__title { font-family: var(--font-head); font-size: var(--fs-lg); color: var(--c-ink); }

/* Admin: kompakte Einstellungs-Gruppen */
.settings { display: flex; flex-direction: column; gap: var(--sp-4); }
.settings__group { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 0 var(--sp-4); }
.settings__group > * + * { border-top: 1px solid var(--c-line); }
.settings__title { font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); padding: 0 var(--sp-1); margin-bottom: calc(var(--sp-2) * -1); }
.settings__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 52px; padding: var(--sp-2) 0; }

/* 11 ─ Hilfsklassen ───────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack--sm { gap: var(--sp-2); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.bold { font-weight: var(--fw-bold); }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--c-surface-2); color: var(--c-ink); font-size: var(--fs-xs); font-weight: var(--fw-semi); }
.badge--accent { background: var(--c-soft); color: var(--c-soft-ink); }

/* 13 ─ Maskottchen „Rezepti“ am Seitenende (links) ─────────────────────── */
/* Steht auf einer dünnen Linie („Küchentheke“) am Ende jeder Seite. Bei kurzen Seiten unten fixiert über margin-top:auto. */
.page-foot {
  margin-top: auto; padding-top: var(--sp-8);
  display: flex; align-items: flex-end; gap: var(--sp-2);
  border-bottom: 2px solid var(--c-line);
}
.page-foot__say {
  position: relative; margin-bottom: 64px; max-width: 220px; padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  font-family: var(--font-head); font-size: var(--fs-md); font-weight: var(--fw-semi); line-height: 1.3; color: var(--c-ink);
}
.page-foot__say::before { /* Sprechblasen-Spitze zum Koch */
  content: ""; position: absolute; left: -7px; bottom: 12px; width: 12px; height: 12px;
  background: var(--c-surface); border-left: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); transform: rotate(45deg);
}

/* Die Figur: zwei Bild-Ebenen (Körper + Arm mit Kochlöffel) und zwei Augenlider.
   Animation: sanftes Wiegen, Winken mit dem Löffel, Blinzeln. Abgeschaltet bei „Bewegung reduzieren“. */
.koch {
  position: relative; flex-shrink: 0; font-size: 112px; height: 1em; aspect-ratio: 297 / 336; margin: 0 0 -1px var(--sp-2);
  transform-origin: 50% 100%; animation: koch-wiegen 4.2s ease-in-out infinite;
  user-select: none; -webkit-user-select: none; pointer-events: none;
}
.koch__img { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-user-drag: none; }
.koch__arm { transform-origin: 76.9% 56.6%; animation: koch-winken 3.6s ease-in-out infinite; }
.koch__lid { /* Lid in Gesichtsfarbe deckt das offene Auge ab, ::after zeichnet das geschlossene Auge „︶“ */
  position: absolute; border-radius: 50%; background: #FDECD6;
  transform: scaleY(0); transform-origin: 50% 30%; animation: koch-blinzeln 5.3s infinite;
}
.koch__lid::after {
  content: ""; position: absolute; left: 12%; right: 12%; top: 22%; height: 40%;
  border-bottom: 0.022em solid #000; border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.koch__lid--l { left: 27.9%; top: 39.9%; width: 13.4%; height: 10.9%; }
.koch__lid--r { left: 53.9%; top: 37.4%; width: 12.2%; height: 11.4%; }
.koch--still, .koch--still * { animation: none !important; }

@keyframes koch-wiegen {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(1.6deg) scaleY(1.012); }
}
@keyframes koch-winken {
  0%, 52%, 100% { transform: rotate(0deg); }
  60% { transform: rotate(-11deg); }
  70% { transform: rotate(5deg); }
  80% { transform: rotate(-9deg); }
  90% { transform: rotate(2deg); }
}
@keyframes koch-blinzeln {
  0%, 90%, 94%, 100% { transform: scaleY(0); }
  92% { transform: scaleY(1); }
}

/* Dunkelmodus: schwarze Konturen bekommen einen hellen Rand, damit die Figur sichtbar bleibt */
@media (prefers-color-scheme: dark) {
  .koch { filter: drop-shadow(0 0 1px rgba(243,237,227,.9)) drop-shadow(0 0 3px rgba(243,237,227,.35)); }
}
:root[data-theme="dark"] .koch { filter: drop-shadow(0 0 1px rgba(243,237,227,.9)) drop-shadow(0 0 3px rgba(243,237,227,.35)); }
:root[data-theme="light"] .koch { filter: none; }
@media (min-width: 768px) { .koch { font-size: 136px; } .page-foot__say { margin-bottom: 80px; } }
.auth .page-foot { width: 100%; max-width: 400px; margin: var(--sp-6) auto 0; }
.auth__wordmark { width: 200px; height: auto; }

/* Raster für Kacheln und Zweispalter (Handy: untereinander) */
.grid-cards { display: flex; flex-direction: column; gap: var(--sp-2); }
.grid-2 { display: flex; flex-direction: column; gap: var(--sp-4); }

/* 12 ─ Tablet ─────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .content { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .photo--hero { height: 320px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .bottomnav { justify-content: center; gap: var(--sp-8); }
}
@media (min-width: 1024px) {
  :root { --content-max: 960px; }
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Rezept auf Tablet quer: Zutaten links, Schritte rechts */
  .recipe-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--sp-4); align-items: start; }
}

/* 14 ─ Große Bildschirme ─────────────────────────────────────────────────
   Tablet hochkant / Handy: untere Navigation (oben definiert).
   Tablet quer 1024–1199 px: schmale Symbolleiste links (Rail).
   Desktop ab 1200 px: volle Seitenleiste links.
   Gleiche Layout-Variablen wie bisher – Seiten müssen nichts ändern. */
@media (min-width: 1024px) {
  :root { --side-w: 92px; --content-max: 1040px; --nav-h: 0px; }
  .app { flex-direction: row; }
  .app--focus { flex-direction: column; }
  .bottomnav { display: none; }

  .sidenav {
    display: block; position: sticky; top: 0; flex: 0 0 var(--side-w); width: var(--side-w); height: 100dvh;
    background: var(--c-surface); border-right: 1px solid var(--c-line); overflow-y: auto; z-index: 25;
  }
  .sidenav__inner { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: var(--sp-4) var(--sp-2); }
  .sidenav__brand { display: flex; justify-content: center; padding: 0 0 var(--sp-3); }
  .sidenav__logo { display: none; }
  .sidenav__mark { display: block; width: 44px; height: auto; }
  .sidenav__new { width: 52px; min-height: 52px; height: 52px; padding: 0; margin: 0 auto var(--sp-3); border-radius: var(--r-pill); }
  .sidenav__new .icon { width: 24px; height: 24px; }
  .sidenav__newlabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sidenav__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: var(--sp-1);
    border-radius: var(--r-md); color: var(--c-muted); text-decoration: none; font-size: 11px; font-weight: var(--fw-medium); text-align: center;
    transition: background var(--dur) var(--ease);
  }
  .sidenav__item .icon { width: 22px; height: 22px; }
  .sidenav__item:hover { background: var(--c-bg); color: var(--c-ink); }
  .sidenav__item[aria-current="page"] { background: var(--c-soft); color: var(--c-soft-ink); font-weight: var(--fw-bold); }
  .sidenav__item .sidenav__long { display: none; }
  .sidenav__sep { border: 0; border-top: 1px solid var(--c-line); margin: var(--sp-2) var(--sp-2); }

  .topbar { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .topbar__title { text-align: left; padding-left: var(--sp-2); font-size: var(--fs-xl); }
  .content { padding: var(--sp-6) var(--sp-6) var(--sp-8); gap: var(--sp-5); }
  .content--wide { max-width: none; }
  .content--no-nav { padding-bottom: var(--sp-8); }
  .content--with-actionbar { padding-bottom: calc(96px + var(--sp-6)); }
  .actionbar { left: var(--side-w); padding: var(--sp-3) var(--sp-6) var(--sp-4); }
  .actionbar__inner { justify-content: flex-end; }
  .actionbar__inner > * { flex: 0 0 auto; min-width: 180px; }
  .app--focus .actionbar { left: 0; }

  /* Inhalte nutzen die Breite */
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
  .grid-cards .rcard { flex-direction: column; padding: 0; overflow: hidden; }
  .grid-cards .rcard__photo { width: 100%; height: 150px; border-radius: 0; }
  .grid-cards .rcard__body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }

  /* Rezept: Zutaten links (bleiben beim Scrollen stehen), Schritte rechts */
  .recipe-split { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: var(--sp-5); align-items: start; }
  .recipe-split > :first-child {
    position: sticky; top: calc(var(--topbar-h) + var(--sp-4));
    max-height: calc(100dvh - var(--topbar-h) - var(--sp-8)); overflow-y: auto;
  }

  /* Login / Seitenpasswort: Box mittig, Koch daneben */
  .auth { flex-direction: row; align-items: center; justify-content: center; gap: var(--sp-10); }
  .auth__box { margin: 0; max-width: 420px; }
  .auth .page-foot { order: -1; width: auto; max-width: none; margin: 0; padding: 0; border: 0; align-self: center; }
  .auth .koch { font-size: 240px; margin: 0; }

  .page-foot { margin-top: var(--sp-10); }
}

@media (min-width: 1200px) {
  :root { --side-w: 248px; }
  .sidenav__inner { padding: var(--sp-5) var(--sp-3); gap: 2px; }
  .sidenav__brand { justify-content: flex-start; padding: var(--sp-1) var(--sp-3) var(--sp-4); }
  .sidenav__logo { display: block; width: 150px; height: auto; }
  .sidenav__mark { display: none; }
  .sidenav__new { width: 100%; height: auto; min-height: 48px; padding: 0 var(--sp-5); margin: 0 0 var(--sp-4); border-radius: var(--r-lg); }
  .sidenav__new .icon { width: 20px; height: 20px; }
  .sidenav__newlabel { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .sidenav__item { flex-direction: row; justify-content: flex-start; gap: var(--sp-3); min-height: var(--tap); padding: 0 var(--sp-3);
    color: var(--c-ink); font-size: var(--fs-md); text-align: left; }
  .sidenav__item .icon { width: 20px; height: 20px; color: var(--c-muted); }
  .sidenav__item[aria-current="page"] .icon { color: var(--c-soft-ink); }
  .sidenav__item .sidenav__short { display: none; }
  .sidenav__item .sidenav__long { display: inline; }
  .sidenav__sep { margin: var(--sp-3); }

  .content { padding: var(--sp-6) var(--sp-8) var(--sp-8); }
  .actionbar { padding: var(--sp-3) var(--sp-8) var(--sp-4); }
  .grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* Formulare zweispaltig: Label links, Feld rechts (Admin-Einstellungen, Profil, .form-cols) */
  .settings { max-width: 880px; }
  .settings .field, .form-cols .field {
    display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); column-gap: var(--sp-5); row-gap: 6px; align-items: start;
  }
  .settings .field > .field__label, .form-cols .field > .field__label { grid-column: 1; grid-row: 1 / span 3; padding-top: 12px; }
  .settings .field > :not(.field__label), .form-cols .field > :not(.field__label) { grid-column: 2; }
  .settings .switch { padding-left: 0; }
}
@media (min-width: 1600px) {
  :root { --side-w: 272px; --content-max: 1200px; }
}

/* Hover & Tastatur-Fokus (alle Größen; Hover nur auf Geräten mit Maus) */
@media (hover: hover) {
  .chip:hover { border-color: var(--c-muted); }
  .chip[aria-pressed="true"]:hover { background: var(--c-accent-hover); }
  .seg__btn:hover:not([aria-selected="true"]):not([aria-pressed="true"]) { color: var(--c-ink); background: rgba(127,127,127,.08); }
  .rcard { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
  .rcard:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
  .timer:hover { background: var(--c-soft); }
  .steptabs__btn:hover:not([aria-current="true"]) { border-color: var(--c-muted); }
  .btn--soft:hover { filter: brightness(0.97); }
  .bottomnav__item:hover { color: var(--c-ink); }
  .ratescale__label:hover { opacity: 1; }
}
.btn:focus-visible, .btn-icon:focus-visible, .chip:focus-visible, .seg__btn:focus-visible, .sidenav__item:focus-visible,
.bottomnav__item:focus-visible, .rcard:focus-visible, .list__item:focus-visible, details.card > summary:focus-visible, .timer:focus-visible {
  outline: 2px solid var(--c-focus); outline-offset: 2px;
}
