/* Layout: eine schmale Handy-Spalte mit viel Weissraum; oben die Frage in grosser Serif, unten (Daumenbereich) genau eine dunkle Hauptaktion. */
/*
  Farben aus dem Design-System „Rudis Backwelt“ (design/system/project/tokens.json, 12.10.2026):
  Creme und Weinrot stammen aus dem Siegel (design/logo-siegel.webp).
  Bewusst NUR ein heller Look, auch bei prefers-color-scheme: dark.
  Grund: Rudi (70) braucht einen konstanten, sehr hohen Kontrast und ein Bild, das sich
  nie aendert. Darum gibt es keine Dark-Bloecke; alle Farben sind hier explizit gesetzt.
  Zustaende (Aufnahme, geaendert, fehlt) haengen weiter an Form und Bewegung; Farbe kommt
  nur dazu. --akzent ist so dunkel wie --fg und traegt nie allein eine Bedeutung.
  Kontraste auf --bg: --fg 14,5:1 · --fg-soft 8,0:1 · --line 4,0:1 (Feldrahmen) · --akzent 12,6:1.
*/
:root {
  color-scheme: light;
  --bg: #FAF3E6;          /* mehl: Seitengrund, aufgehelltes Siegel-Creme */
  --surface: #F5E9D2;     /* teig: Creme des Siegels, abgesetzte Flaechen */
  --fg: #2B1F17;          /* kruste: Hauptaktion, Rahmen, Flächen */
  --ink: #1C1612;         /* Text: fast schwarz mit einem Hauch Wärme */
  --ki-blase: #EBE8E3;    /* Sprechblase der KI: helles warmes Grau */
  --fg-soft: #5B4637;     /* kruste-weich: Nebentext, 8,0:1 auf --bg, 7,4:1 auf --surface */
  --line: #8A735F;        /* rand: Feldrahmen, 4,0:1 auf --bg */
  --hair: #E3D7C3;        /* haarlinie: rein dekorativ */
  --inv-soft: #D9C9B2;    /* auf-dunkel: Nebentext auf --fg und --erledigt */
  --akzent: #5F0404;      /* Weinrot des Siegels: ausgewaehlte Antwort, gewaehlte Einheit */
  --erledigt: #2E4D3B;    /* Tannengruen: geaenderte Felder, Fertig-Haken */
  --ring: rgba(43, 31, 23, 0.45);
  --ring-0: rgba(43, 31, 23, 0);
  /* Bild-Platzhalter */
  --sponge: #5B4637;  --cream: #FAF3E6;  --cherry: #5F0404;  --plate: #E3D7C3;  --bowl: #D9C9B2;

  --font: "Atkinson Hyperlegible", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --fs-base: 1.3125rem;   /* 21px */
  --fs-small: 1.25rem;    /* 20px, Untergrenze */
  --fs-q: 2rem;           /* 32px, Fragen */
  --fs-h1: 2.5rem;        /* 40px */
  --fs-btn: 1.5rem;       /* 24px */
  --radius: 8px;
  --gap: 1.5rem;
  --track: 0.08em;
}

html { height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; }
button { font: inherit; color: inherit; }
svg { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fokus: 3px Schwarz mit weissem Abstand */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; box-shadow: 0 0 0 3px var(--bg); }

/* ---------- App-Spalte ---------- */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  padding-inline: 24px;
}
.screen { display: flex; flex-direction: column; gap: var(--gap); padding-block: 32px 28px; }
.screen:not([hidden]) { flex: 1; }
.push { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 24px; }

/* Logo-Platz: rundes Siegel, zentriert, 200 px; faellt ohne Datei auf die Wortmarke zurueck */
.logo-slot { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 200px; margin: 8px 0 24px; }
.logo { display: block; width: 200px; height: 200px; object-fit: contain; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; line-height: 1.1; color: var(--akzent); text-align: center; }

.h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.lead { font-size: var(--fs-base); color: var(--fg-soft); max-width: 34ch; }
.question { font-family: var(--font-display); font-size: var(--fs-q); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }

/* ---------- Knoepfe ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 12px 20px;
  border-radius: var(--radius); border: 2px solid transparent;
  font-size: var(--fs-btn); font-weight: 700; line-height: 1.2; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, color .2s ease, transform .1s ease;
}
.btn svg { width: 32px; height: 32px; }
.btn-main { min-height: 96px; background: var(--fg); color: var(--bg); border-color: var(--fg); font-size: 1.625rem; }
.btn-main:active { transform: translateY(1px); }
.btn-second { min-height: 72px; background: var(--bg); color: var(--ink); border-color: var(--fg); }
.btn-quiet {
  min-height: 64px; background: var(--bg); color: var(--fg-soft);
  border: 2px solid var(--line); font-size: var(--fs-small); font-weight: 700;
}
.btn-text {
  min-height: 64px; width: auto; align-self: center; background: transparent; border: 0;
  color: var(--ink); font-size: var(--fs-small); font-weight: 700;
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px;
}
.quiet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiet-row > :only-child { grid-column: 1 / -1; }

/* Zurueck */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 64px; padding: 8px 12px 8px 0;
  background: none; border: 0; color: var(--ink); font-size: var(--fs-small); font-weight: 700; cursor: pointer; }
.back svg { width: 28px; height: 28px; }

/* ---------- Fortsetzen ---------- */
.resume-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.resume-item {
  width: 100%; min-height: 96px; padding: 18px 20px; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg); border: 2px solid var(--fg); border-radius: var(--radius);
}
.resume-item b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; }
.resume-item span.date { display: block; color: var(--fg-soft); font-size: var(--fs-small); margin-top: 6px; }
.resume-item svg { width: 32px; height: 32px; color: var(--ink); }
.resume-row { display: flex; align-items: stretch; gap: 10px; }
.resume-row .resume-item { flex: 1; min-width: 0; }
.resume-del { flex: none; display: grid; place-items: center; width: 64px; padding: 0; cursor: pointer;
  border-radius: var(--radius); border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.resume-del svg { width: 28px; height: 28px; }
.btn-danger { min-height: 80px; background: var(--akzent); color: var(--bg); border-color: var(--akzent); }
#btnSaveLater { margin-top: 10px; }
.field-hint { font-size: var(--fs-small); font-weight: 700; color: var(--fg-soft); }
#textInput {
  width: 100%; min-height: 9rem; padding: 14px 16px; resize: vertical;
  border: 2px solid var(--fg); border-radius: var(--radius); background: #FFFFFF; color: var(--ink);
  font: 400 1.375rem/1.45 var(--font);
}
.btn-del { color: var(--akzent); }
.btn-del.is-sure { background: var(--akzent); color: var(--bg); text-decoration: none; width: 100%; border-radius: var(--radius); }
.btn-add { min-height: 64px; background: var(--bg); color: var(--ink); border: 2px dashed var(--line); font-size: var(--fs-small); }
.num-input {
  width: 100%; text-align: center; padding: 12px 14px;
  border: 2px solid var(--fg); border-radius: var(--radius); background: #FFFFFF; color: var(--ink);
  font-family: var(--font-display); font-size: 3.5rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.photo.is-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; background: transparent; }
.photo.is-grid img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; }
.foto-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foto-liste li { display: flex; align-items: center; gap: 12px; }
.foto-liste img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius); flex: none; }
.foto-liste span { flex: 1; min-width: 0; font-weight: 700; }
.ib.is-sure { background: var(--akzent); border-color: var(--akzent); color: var(--bg); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  min-height: 72px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: 700 1.375rem var(--font);
}
.choice[aria-checked="true"] { background: var(--akzent); border-color: var(--akzent); color: var(--bg); }

/* ---------- Gespraech ---------- */
.q-row { display: flex; gap: 16px; align-items: flex-start; }
.q-row .question { flex: 1; min-width: 0; }

.status { display: flex; align-items: center; gap: 14px; font-size: 1.75rem; font-weight: 700; min-height: 2.5rem; }
.status[hidden] { display: none; }
.status.listening { color: var(--ink); }
.listen-dot { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); flex: none; }
.listen-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--fg); animation: dotring 1.4s ease-out infinite; }
@keyframes dotring { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

.answer { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; }
.answer-label { font-size: var(--fs-small); color: var(--fg-soft); font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; margin-bottom: 8px; }
.answer-text { font-size: 1.375rem; }

.btn-mic { min-height: 96px; background: var(--fg); color: var(--bg); border-color: var(--fg); font-size: 1.75rem; }
.btn-mic svg { width: 40px; height: 40px; }
/* Aufnahme laeuft: Knopf invertiert (weiss mit dickem schwarzem Rand) und pulsierender Ring */
.btn-mic.is-listening { background: var(--bg); color: var(--ink); border: 4px solid var(--fg); animation: pulse 1.6s ease-out infinite; }
.btn-mic[aria-disabled="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); cursor: progress; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--ring); }
  70%  { box-shadow: 0 0 0 18px var(--ring-0); }
  100% { box-shadow: 0 0 0 0 var(--ring-0); }
}
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--hair); border-top-color: var(--fg); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Foto ---------- */
.photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hair); background: var(--surface); }
.photo svg, .hero svg { display: block; width: 100%; height: auto; max-width: 100%; }

/* ---------- Durchsicht ---------- */
.recipe { display: flex; flex-direction: column; gap: 40px; }
.recipe section { display: flex; flex-direction: column; gap: 12px; }
.recipe h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; padding-bottom: 10px; border-bottom: 1px solid var(--fg); }
.recipe h3 { font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; margin-top: 10px; color: var(--fg-soft); }
.hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hair); }
/* Bildstrecke oben in der Durchsicht: Titelbild zuerst, wischen; Punkte sind 44 px große Tippflächen. */
.strecke { display: flex; flex-direction: column; gap: 8px; }
.spur { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; border-radius: var(--radius); border: 1px solid var(--hair); }
.spur::-webkit-scrollbar { display: none; }
.dia { flex: 0 0 100%; margin: 0; position: relative; scroll-snap-align: center; }
.dia img { display: block; width: 100%; height: 60vh; max-height: 420px; object-fit: cover; }
.dia figcaption { position: absolute; left: 10px; top: 10px; background: var(--bg); color: var(--ink); font-weight: 700; font-size: 1rem; padding: 4px 10px; border-radius: 999px; }
.strecke-leiste { display: flex; align-items: center; justify-content: center; }
.punkt { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.punkt::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--fg-soft); }
.punkt[aria-current="true"]::after { background: var(--fg); border-color: var(--fg); }
.zahl { color: var(--fg-soft); font-variant-numeric: tabular-nums; margin-left: 4px; }
.flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.step-num {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-bottom: 6px;
  border-radius: 50%; border: 2px solid var(--fg); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; font-variant-numeric: tabular-nums;
}
.steps > li > .fw { min-width: 0; }

.fw { border-radius: var(--radius); }
.field {
  width: 100%; min-height: 64px; padding: 14px 16px; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius);
}
.field:hover { border-color: var(--fg); }
.field-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.field .lbl { font-size: var(--fs-small); color: var(--fg-soft); font-weight: 700; }
.field .val { font-size: var(--fs-base); }
.field .qty { font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.field .hint { font-size: var(--fs-small); color: var(--fg-soft); margin-top: 6px; }
.field .hint b { color: var(--ink); }
.hint.zeichen { display: flex; align-items: flex-start; gap: 8px; }
.hint.zeichen svg { width: 1.2em; height: 1.2em; flex: none; margin-top: 0.15em; }
.field.title-field .val { font-family: var(--font-display); font-size: 1.875rem; font-weight: 600; line-height: 1.15; }
.pen { width: 28px; height: 28px; color: var(--ink); flex: none; }
.pen svg { width: 28px; height: 28px; }

/* Geaendert: Feld gefuellt in Tannengruen plus Label */
.fw.is-changed .field { background: var(--erledigt); color: var(--bg); border-color: var(--erledigt); }
.fw.is-changed .field .lbl,
.fw.is-changed .field .hint { color: var(--inv-soft); }
.fw.is-changed .field .hint b,
.fw.is-changed .pen { color: var(--bg); }
.undo-row { display: flex; align-items: center; gap: 12px; padding: 8px 0 0 2px; }
.changed-note {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--track); text-transform: uppercase;
}
.changed-note::before { content: ""; width: 14px; height: 14px; background: var(--erledigt); flex: none; }
.btn-undo { width: auto; min-height: 64px; padding: 8px 18px; background: var(--bg); color: var(--ink); border: 2px solid var(--fg); font-size: var(--fs-small); }

/* Fehlt noch: gestrichelter Rahmen, Etikett als schwarze Plakette */
.fw.is-gap .field { background: var(--bg); border: 3px dashed var(--akzent); }
.gap-note { color: var(--akzent); font-weight: 700; font-size: var(--fs-small); }
.gap-box, .step-box { display: flex; gap: 10px; padding: 14px 10px 14px 16px; border-radius: var(--radius); background: var(--bg); }
.gap-box { align-items: center; border: 3px dashed var(--akzent); }
.step-box { align-items: flex-start; border: 2px solid var(--line); }
.gap-box .field-body, .step-box .field-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gap-box .lbl { font-size: var(--fs-small); font-weight: 700; color: var(--ink); }
.ib {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; cursor: pointer;
  border-radius: var(--radius); border: 2px solid var(--fg); background: var(--bg); color: var(--ink);
}
.ib svg { width: 28px; height: 28px; }
.ib-col { display: flex; flex-direction: column; gap: 8px; }
.fw.is-changed .step-box { background: var(--erledigt); border-color: var(--erledigt); color: var(--bg); }
.fw.is-changed .step-box .hint, .fw.is-changed .step-box .hint b { color: var(--inv-soft); }
.fw.is-changed .step-box .step-num { color: var(--bg); border-color: var(--bg); }
.step-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.step-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.open-note { margin: 0 0 10px; text-align: center; color: var(--akzent); font-weight: 700; font-size: var(--fs-small); }
.mittig { text-align: center; margin-inline: auto; text-wrap: balance; }
.recipe h2 svg, .recipe h3 svg { width: 32px; height: 32px; vertical-align: -6px; margin-right: 10px; }
.gap-badge {
  align-self: flex-start; margin-top: 6px; padding: 4px 12px; border-radius: 4px;
  background: var(--fg); color: var(--bg); font-weight: 700; font-size: var(--fs-small);
  letter-spacing: var(--track); text-transform: uppercase;
}

.bottom-bar {
  position: sticky; bottom: 0; z-index: 5;
  margin-inline: -24px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--fg);
}

/* ---------- Fertig ---------- */
.done-name { font-family: var(--font-display); font-size: 1.625rem; font-weight: 500; color: var(--fg-soft); }
.check { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--erledigt); color: var(--bg); }
.check svg { width: 34px; height: 34px; }

/* ---------- Dialoge ---------- */
dialog {
  width: min(100% - 24px, 30rem); max-height: calc(100dvh - 24px); overflow: auto;
  margin: auto auto 12px; padding: 28px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 2px solid var(--fg); border-radius: 14px; background: var(--bg); color: var(--ink);
}
dialog::backdrop { background: rgba(43, 31, 23, 0.6); }
.dlg { display: flex; flex-direction: column; gap: 20px; }
.qty-show { text-align: center; font-family: var(--font-display); font-size: 3.5rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1;
  background: var(--surface); border-radius: var(--radius); padding: 18px 14px; }
.qty-show small { font-size: 2rem; font-weight: 500; }
.stepper { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper .btn { min-height: 80px; background: var(--bg); color: var(--ink); border-color: var(--fg); font-size: 1.5rem; }
.stepper .sign { font-size: 2.5rem; line-height: 1; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: var(--fs-small); font-weight: 700; color: var(--fg-soft); letter-spacing: var(--track); text-transform: uppercase; margin-bottom: 12px; padding: 0; }
.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.unit input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.unit span {
  display: grid; place-items: center; min-height: 64px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 700; font-size: var(--fs-small);
}
.unit input:checked + span { background: var(--akzent); color: var(--bg); border-color: var(--akzent); }
.unit input:focus-visible + span { outline: 3px solid var(--fg); outline-offset: 3px; box-shadow: 0 0 0 3px var(--bg); }

/* ---------- Hinweis-Zeile ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%);
  width: min(100% - 32px, 28rem); z-index: 50;
  background: var(--fg); color: var(--bg); border-radius: var(--radius); padding: 16px 20px;
  font-size: var(--fs-small); font-weight: 700; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  /* statt Puls ein fester Doppelring */
  .btn-mic.is-listening { animation: none; box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--fg); }
  .listen-dot::after { animation: none; opacity: 1; transform: none; }
  .spinner { animation: none; }
  .btn-main:active { transform: none; }
}

/* ---------- App: echte Bilder und Inline-Logo ---------- */
.photo img, .hero img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: cover; }
.logo img { display: block; width: 200px; height: 200px; }
/* Start: das Siegel prominent, etwa 2/3 der Bildschirmbreite und damit rund 1/3 der Höhe */
#s-start .logo, #s-start .logo img { width: min(66vw, 34vh, 420px); height: auto; aspect-ratio: 1; }
#s-start .logo-slot { min-height: 0; margin: 0 0 16px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Fehlertext im Debug-Modus (?debug=1) ---------- */
.debug {
  position: fixed; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); z-index: 60;
  background: #fff; color: #000; border: 2px solid #000; border-radius: 8px; padding: 8px 10px;
  font: 13px/1.35 ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow: auto;
}

/* ---------- Gespräch als Chat (12.10.2026) ----------
   Wie WhatsApp: KI links auf Hellgrau, Rudi rechts invertiert (Schwarz), neueste unten.
   Die Leiste mit dem Mikrofon klebt am unteren Rand; der Verlauf scrollt darüber. */
.screen-chat { padding-bottom: 0; gap: 12px; }
.chat-head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-block: 8px; }
.chat-head:has(.progress[hidden]) { display: none; }
/* „Noch X Punkte offen“: tippen klappt die offenen Punkte wie eine Jalousie von oben auf */
.progress {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink);
  font: 700 var(--fs-small) var(--font);
}
.progress svg { width: 24px; height: 24px; transition: transform .2s ease; }
.progress[aria-expanded="true"] svg { transform: rotate(180deg); }
.offen-panel { margin-top: 8px; padding: 14px 16px; border: 2px solid var(--fg); border-radius: var(--radius); background: var(--bg);
  max-height: 55vh; overflow: auto; animation: jalousie .22s ease-out; }
@keyframes jalousie { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.offen-hinweis { margin: 0 0 8px; font-size: var(--fs-small); color: var(--fg-soft); }
.offen-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.offen-liste li { position: relative; padding-left: 1.6em; font-size: 1.25rem; line-height: 1.4; }
.offen-liste li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1em; height: 1em; box-sizing: border-box; border: 2px solid var(--fg); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .offen-panel { animation: none; } .progress svg { transition: none; } }
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 88%; }
.msg-ki { align-self: flex-start; }
.msg-rudi { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 14px 18px; border-radius: 18px; font-size: 1.375rem; line-height: 1.4; overflow-wrap: anywhere; }
.msg-ki .bubble { background: var(--ki-blase); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-rudi .bubble { background: var(--surface); color: var(--ink); border-bottom-right-radius: 4px; }
.bubble-row { display: flex; align-items: flex-end; gap: 10px; }
.btn-redo {
  min-height: 48px; padding: 0 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--bg); color: var(--ink); border: 2px solid var(--line); font-size: var(--fs-small); font-weight: 700;
}
.bubble-typing { padding: 18px 22px; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .3; animation: tippt 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes tippt { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* Zwischenstand-Karte */
.card { border: 2px solid var(--fg); border-radius: 12px; padding: 16px 18px; background: var(--bg); }
.card-title { font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; color: var(--fg-soft); margin-top: 4px; }
.card-title + .card-list { margin-top: 6px; }
.card-list + .card-title { margin-top: 16px; }
.card-list { margin: 0; padding-left: 1.2em; font-size: 1.25rem; line-height: 1.45; }
.card-open { list-style: none; padding-left: 0; }
.card-open li { padding-left: 1.6em; position: relative; }
.card-open li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1em; height: 1em; border: 2px solid var(--fg); border-radius: 4px; }

.chat-bar {
  position: sticky; bottom: 0; z-index: 5; margin-top: auto;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg); border-top: 1px solid var(--hair);
  margin-inline: -24px; padding: 14px 24px calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.chat-bar .status { font-size: 1.375rem; min-height: 0; }

@media (prefers-reduced-motion: reduce) {
  .dots i { animation: none; opacity: .7; }
}

/* Antworten zum Antippen unter der aktuellen Frage */
.options { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-option {
  min-height: 56px; padding: 0 20px; border-radius: 28px; cursor: pointer;
  background: var(--bg); color: var(--ink); border: 2px solid var(--fg);
  font-size: var(--fs-small); font-weight: 700;
}
.btn-option:active { background: var(--akzent); color: var(--bg); border-color: var(--akzent); }

/* Fertig: Link zur Rezeptseite */
a.btn { text-decoration: none; }
.done-link { font-size: 1.05rem; color: var(--fg-soft); overflow-wrap: anywhere; }

/* „Ich will noch was ergänzen“: Mikrofon als zweite Aktion, solange „Weiter zum Foto“ die Hauptaktion ist */
.btn-mic.is-second { min-height: 72px; background: var(--bg); color: var(--ink); border-color: var(--fg); font-size: var(--fs-btn); }
.btn-mic.is-second svg { width: 32px; height: 32px; }

/* Überschrift eines Teils mit Stift zum Ändern */
.recipe h2.teil-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recipe h2.teil-kopf > span { min-width: 0; overflow-wrap: anywhere; }

/* Gespräch: drei Symbol-Knöpfe nebeneinander, 64 px hoch; Erzählen doppelt so breit (2 : 1 : 1).
   Ist ein Knopf ausgeblendet, nimmt das Mikrofon den Platz ein. */
.chat-knoepfe { display: flex; gap: 12px; }
.chat-knoepfe .btn-symbol { flex: 1 1 0; width: auto; min-height: 64px; padding: 0; gap: 0; }
.chat-knoepfe .btn-mic { flex-grow: 2; }
.chat-knoepfe .btn-symbol svg { width: 36px; height: 36px; }
.chat-knoepfe .btn-quiet { color: var(--ink); border-color: var(--fg); }
.chat-knoepfe .btn-symbol > span { display: flex; }

/* Durchsicht: offene Punkte oben in Weinrot; unten Mikrofon, Speichern, Veröffentlichen (1 : 1 : 2). */
.progress.is-warn { background: var(--akzent); border-color: var(--akzent); color: var(--bg); }
.durch-kopf { margin-inline: -24px; padding-inline: 24px; }
.durch-knoepfe { flex-direction: row; gap: 12px; }
.durch-knoepfe .btn-main { flex-grow: 2; }
.durch-knoepfe .btn-second { flex-grow: 1; }
.durch-knoepfe #btnSaveLater { margin-top: 0; }

/* Dialoge und Foto: Symbol-Knöpfe wie im Gespräch; Abbrechen als ✕ oben rechts; „breit“ = doppelte Breite.
   Mülltonne (btn-weg): erster Tipp färbt sie weinrot, der zweite löscht. */
.chat-knoepfe .breit { flex-grow: 2; }
.dlg { position: relative; }
.dlg-zu { position: absolute; top: -14px; right: -8px; width: 56px; height: 56px; display: grid; place-items: center; padding: 0;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: var(--radius); }
.dlg-zu svg { width: 32px; height: 32px; }
.dlg-zu:focus-visible { outline: 3px solid var(--fg); }
.dlg > .question { padding-right: 48px; }
.chat-knoepfe .btn-weg.is-sure { background: var(--akzent); border-color: var(--akzent); color: var(--bg); }
#photoAsk { flex-direction: row; }

/* Zutat: Name und Hinweis im Mengen-Dialog */
.text-input { width: 100%; min-height: 56px; padding: 10px 14px; border: 2px solid var(--fg); border-radius: var(--radius);
  background: #FFFFFF; color: var(--ink); font: 400 1.375rem/1.4 var(--font); }
/* Schritt: Bilder im Dialog, je Bild darunter die Mülltonne; daneben Kamera mit Plus */
.schritt-bilder { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.schritt-bilder li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.schritt-bilder img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; display: block; }
.bild-neu { width: 96px; height: 96px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.bild-neu svg { width: 36px; height: 36px; }
