/* ===================================================================
   Rezepte & Einkauf
   Alles Gestaltbare steht als Variable oben; der dunkle Modus tauscht
   nur Farben. Größen in rem (Komponenten) bzw. em (Innenabstände) –
   die Gesamtgröße hängt allein an body.
   =================================================================== */
@font-face { font-family: 'Source Sans 3'; font-weight: 300; font-style: normal; font-display: swap; src: url(/fonts/source-sans-3-latin-300-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/source-sans-3-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/source-sans-3-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/source-sans-3-latin-600-normal.woff2) format('woff2'); }

:root {
  --grund: 17px;
  --schrift: 'Source Sans 3', -apple-system, system-ui, sans-serif;

  --bg: #f6f3ee;
  --flaeche: #ffffff;
  --flaeche-2: #eeebe7;          /* Zutatenkasten, wie im PDF */
  --text: #231f20;
  --leise: #6b6560;
  --linie: #e2dcd4;
  --akzent: #8a5a2b;
  --akzent-text: #ffffff;
  --akzent-weich: #f1e6d9;
  --hinweis-bg: #fbf3e4;
  --hinweis-rand: #d9b77a;
  --erledigt: #9a948e;
  --gefahr: #b3261e;
  --gefahr-text: #ffffff;
  --hervor: #5b3a1a;             /* Zeiten/Temperaturen im Text */

  --radius: 0.75rem;
  --radius-klein: 0.45rem;
  --radius-rund: 999px;
  --schatten: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 14px rgb(0 0 0 / 0.05);
  --abstand: 1rem;
  --rand-seite: max(1rem, env(safe-area-inset-left));
  --leiste-hoehe: 3.6rem;
  --breite: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1918; --flaeche: #242220; --flaeche-2: #2d2a28; --text: #eee9e3; --leise: #a49d96;
    --linie: #3a3633; --akzent: #e0a96a; --akzent-text: #1a1918; --akzent-weich: #3a2e22;
    --hinweis-bg: #2e281f; --hinweis-rand: #7a6036; --erledigt: #6f6a65; --gefahr: #f2867d; --gefahr-text: #1a1918; --hervor: #f0c48f;
    --schatten: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--grund)/1.45 var(--schrift);
  overflow-x: hidden;                      /* explizit – sonst macht CSS aus der anderen Achse auto */
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* Unter 16 px zoomt Safari beim Fokussieren hinein */
input, select, textarea { font-size: max(1rem, 16px); }
a { color: var(--akzent); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

#inhalt {
  max-width: var(--breite); margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 0.8rem) var(--rand-seite) calc(var(--leiste-hoehe) + env(safe-area-inset-bottom) + 1.5rem);
}

/* ── Leiste unten ─────────────────────────────────────────────────── */
#leiste {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--flaeche) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--linie);
}
/* Bei offener Tastatur stört die Leiste nur (iOS schiebt sie sonst mit) */
body.tippt #leiste { display: none; }
#leiste a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1em;
  color: var(--leise); text-decoration: none; font-size: 0.72rem; position: relative;
}
#leiste a svg { width: 1.45rem; height: 1.45rem; }
#leiste a.aktiv { color: var(--akzent); font-weight: 600; }
#leiste .zahl:not(:empty) {
  position: absolute; top: 0.35em; left: calc(50% + 0.5rem);
  min-width: 1.35em; padding: 0 0.35em; border-radius: var(--radius-rund);
  background: var(--akzent); color: var(--akzent-text); font-size: 0.68rem; line-height: 1.35em; text-align: center;
}

/* ── Typografie ───────────────────────────────────────────────────── */
h1 { font-weight: 300; font-size: 1.65rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0.2em 0 0.5em; }
h2 { font-weight: 300; font-size: 1.05rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 1.4em 0 0.5em; color: var(--leise); }
h3 { font-weight: 600; font-size: 0.95rem; margin: 0.9em 0 0.25em; }
.leise { color: var(--leise); }
.klein { font-size: 0.85rem; }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.5em; }
.kopf h1 { margin-bottom: 0.3em; }

/* ── Knöpfe & Felder ──────────────────────────────────────────────── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.55em 1.05em; border-radius: var(--radius-rund); border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
  touch-action: manipulation;
}
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); font-weight: 600; }
.knopf.gefahr { color: var(--gefahr); }
/* Gefährliche Hauptaktion: rote Fläche statt roter Schrift auf Braun */
.knopf.haupt.gefahr { background: var(--gefahr); border-color: var(--gefahr); color: var(--gefahr-text); }
.knopf.klein { padding: 0.3em 0.75em; font-size: 0.85rem; }
.knopf.symbol { padding: 0.45em; min-width: 2.4rem; }
.knopf:disabled { opacity: 0.5; }
@media (hover: hover) and (pointer: fine) {
  .knopf:hover { border-color: var(--akzent); }
  .knopf.haupt:hover { filter: brightness(1.06); }
}
.knopfreihe { display: flex; flex-wrap: wrap; gap: 0.5em; margin: 1em 0; }

.feld { display: block; margin: 0 0 0.9em; }
.feld > span { display: block; font-size: 0.85rem; color: var(--leise); margin-bottom: 0.25em; }
.eingabe, .feld input:not([type=checkbox]), .feld select, .feld textarea {
  width: 100%; padding: 0.55em 0.75em; border: 1px solid var(--linie); border-radius: var(--radius-klein);
  background: var(--flaeche); outline: none;
}
.feld textarea { min-height: 8em; resize: vertical; line-height: 1.5; }
.eingabe:focus, .feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); }
.feld-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0 0.75em; }
.haken { display: flex; align-items: center; gap: 0.55em; margin: 0.4em 0 0.9em; }
.haken input { width: 1.2rem; height: 1.2rem; accent-color: var(--akzent); }

.suche { position: relative; margin-bottom: 0.8em; }
.suche input { padding-right: 2.6em; }
.suche input::-webkit-search-cancel-button { -webkit-appearance: none; }   /* eigener ×-Knopf statt Browser-Variante */
.suche .leeren {
  position: absolute; right: 0.35em; top: 50%; transform: translateY(-50%);
  width: 1.9em; height: 1.9em; border: 0; border-radius: var(--radius-rund);
  background: var(--flaeche-2); color: var(--leise); font-size: 1rem; line-height: 1; cursor: pointer;
}

.chips { display: flex; gap: 0.4em; overflow-x: auto; padding-bottom: 0.3em; margin-bottom: 0.6em; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 0.3em 0.85em; border-radius: var(--radius-rund); border: 1px solid var(--linie);
  background: var(--flaeche); font-size: 0.88rem; cursor: pointer; white-space: nowrap;
}
.chip.an { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 0.9em 1em; box-shadow: var(--schatten); }
.leer { text-align: center; color: var(--leise); padding: 3em 1em; }

/* ── Einkaufsliste ────────────────────────────────────────────────── */
#neuForm .suche { margin-bottom: 0.4em; }
.mengen-schnell { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5em; }
.mengen-schnell .knopf { flex-direction: column; gap: 0.1em; padding: 0.8em 0.4em; border-radius: var(--radius); font-weight: 600; white-space: normal; }
.mengen-schnell small { font-weight: 400; color: var(--leise); font-size: 0.78rem; }
.vorschlaege { margin: 0 0 0.8em; }
.vorschlaege button {
  display: block; width: 100%; text-align: left; padding: 0.5em 0.8em; border: 0; border-bottom: 1px solid var(--linie);
  background: var(--flaeche); cursor: pointer;
}
.vorschlaege button:first-child { border-radius: var(--radius-klein) var(--radius-klein) 0 0; }
.vorschlaege button:last-child { border-radius: 0 0 var(--radius-klein) var(--radius-klein); border-bottom: 0; }
.vorschlaege .leise { font-size: 0.85rem; }

.laden-kopf { display: flex; align-items: baseline; justify-content: space-between; margin: 1.3em 0 0.3em; }
.laden-kopf h2 { margin: 0; color: var(--akzent); }
.abt-kopf { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--leise); margin: 0.9em 0 0.2em 0.2em; }
.posten {
  display: grid; grid-template-columns: 2rem 1fr auto auto; align-items: center; gap: 0.5em;
  background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 0.55em 0.4em 0.55em 0.6em;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.gruppe > .posten:first-child { border-top-left-radius: var(--radius-klein); border-top-right-radius: var(--radius-klein); }
.gruppe > .posten:last-child { border-bottom: 0; border-bottom-left-radius: var(--radius-klein); border-bottom-right-radius: var(--radius-klein); }
.gruppe { border: 1px solid var(--linie); border-radius: var(--radius-klein); overflow: hidden; }
.kreis { width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid var(--akzent); display: grid; place-items: center; }
.posten.erledigt .kreis { background: var(--akzent); }
.posten.erledigt .kreis::after { content: ''; width: 0.35rem; height: 0.65rem; border: solid var(--akzent-text); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.posten .name { font-weight: 600; }
.posten .info { display: block; font-size: 0.8rem; color: var(--leise); font-weight: 400; }
.posten .menge { font-variant-numeric: tabular-nums; color: var(--leise); text-align: right; white-space: nowrap; }
.posten .mehr { border: 0; background: none; color: var(--leise); padding: 0.3em 0.4em; font-size: 1.1rem; cursor: pointer; }
.posten.erledigt .name, .posten.erledigt .menge { color: var(--erledigt); text-decoration: line-through; font-weight: 400; }
.im-wagen { margin-top: 1.8em; }

/* ── Rezeptliste ──────────────────────────────────────────────────── */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.8em; }
.rezeptkarte { display: block; text-decoration: none; color: inherit; background: var(--flaeche); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--linie); box-shadow: var(--schatten); }
.rezeptkarte .bild { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: var(--flaeche-2); }
.rezeptkarte .titel { padding: 0.55em 0.7em 0.65em; font-weight: 600; font-size: 0.92rem; line-height: 1.25; }
.rezeptkarte .titel small { display: block; font-weight: 400; color: var(--leise); font-size: 0.75rem; margin-top: 0.15em; }
.punkt-offen { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--hinweis-rand); margin-left: 0.3em; vertical-align: middle; }

/* ── Rezept ───────────────────────────────────────────────────────── */
.zurueck { display: inline-block; margin: 0.2em 0 0.6em; text-decoration: none; color: var(--leise); }
.rezept-titel {
  border: 1px solid var(--text); padding: 0.55em 0.8em; margin: 0 0 1em; text-align: center;
  font-weight: 300; font-size: 1.45rem; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2;
}
.rezept-bild { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: var(--radius-klein); background: var(--flaeche-2); }
.rezept-oben { display: grid; gap: 1em; }
@media (min-width: 40rem) { .rezept-oben { grid-template-columns: 1.15fr 1fr; align-items: start; } }

.offen { background: var(--hinweis-bg); border-left: 0.25em solid var(--hinweis-rand); border-radius: var(--radius-klein);
  padding: 0.5em 0.8em; margin: 0 0 1em; font-size: 0.9rem; }
.offen ul { margin: 0.2em 0 0; padding-left: 1.1em; }
.offen li { margin: 0.25em 0; }
.offen button { border: 0; background: none; color: var(--akzent); font-size: 0.8rem; padding: 0 0.3em; cursor: pointer; }

.umrechnen { background: var(--akzent-weich); border-radius: var(--radius-klein); padding: 0.6em 0.8em; margin-bottom: 1em; font-size: 0.92rem; }
.umrechnen .reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45em; }
.umrechnen input { width: 4.2em; padding: 0.3em 0.4em; border: 1px solid var(--linie); border-radius: var(--radius-klein); background: var(--flaeche); text-align: center; }
.umrechnen select { padding: 0.3em; border: 1px solid var(--linie); border-radius: var(--radius-klein); background: var(--flaeche); }
.faktor { font-weight: 600; color: var(--akzent); }

.zutaten { background: var(--flaeche-2); border-radius: var(--radius-klein); padding: 0.4em 0.9em 0.7em; }
.zutaten-kopf { text-align: center; font-weight: 300; letter-spacing: 0.12em; font-size: 1.05rem; margin: 0.3em 0 0.2em; }
.zutaten h3 { margin-top: 0.7em; }
.zliste { display: grid; grid-template-columns: max-content 1fr; column-gap: 0.6em; row-gap: 0.25em; }
.zliste h3 { grid-column: 1 / -1; }
/* display: contents – die Mengenspalte ist so breit wie die längste Menge
   ("2 Tropfen", "1½ Würfel"), über alle Zeilen hinweg bündig */
.zut { display: contents; cursor: pointer; }
.zut .m { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 3em; }
.zut.umgerechnet .m { color: var(--akzent); font-weight: 600; }
.zut .teil { display: block; font-size: 0.8rem; font-style: italic; color: var(--leise); }
.zut .kette { display: block; font-size: 0.8rem; color: var(--akzent); }
.zut .zus { color: var(--leise); }
.uebrig { margin-top: 0.6em; padding-top: 0.45em; border-top: 1px dashed var(--linie); font-size: 0.85rem; color: var(--leise); }

.schritte { margin-top: 1.2em; }
.schritte h3 { margin-top: 1em; }
.schritt { display: grid; grid-template-columns: 1.9em 1fr; gap: 0.3em; margin: 0.45em 0; }
.schritt .nr { font-weight: 600; text-align: right; }
.schritt .nr::after { content: ' |'; font-weight: 400; color: var(--leise); }
.schritt b, .schritt strong { font-weight: 600; }
.schritt .zeit { font-weight: 600; color: var(--hervor); }
.hinweise { white-space: pre-line; margin-top: 1em; font-style: italic; color: var(--leise); }

/* ── Dialoge ──────────────────────────────────────────────────────── */
/* Dialoge hängen OBEN im sichtbaren Bereich, nicht unten:
   - vh/Unterkante meinen auf iOS den großen Viewport – unten verschwindet
     der Dialog hinter Safaris Leiste bzw. hinter der Tastatur.
   - --vv-top/--vvh kommen aus visualViewport (app.js, einzige Messstelle)
     und schrumpfen mit der Tastatur. Der Rumpf scrollt, Kopf und Fuß bleiben.
   - Ein Eingabefeld weit oben verleitet iOS nicht dazu, die Seite beim
     Fokussieren zu verschieben (Lehre aus bfs6huct). */
dialog {
  --dlg-rand: 0.6rem;
  position: fixed; inset: auto 0 auto 0;
  top: calc(var(--vv-top, 0px) + max(var(--dlg-rand), env(safe-area-inset-top)));
  margin: 0 auto; border: 0; padding: 0; width: min(36rem, calc(100vw - 2 * var(--dlg-rand)));
  max-height: calc(var(--vvh, 100dvh) - 2 * var(--dlg-rand) - env(safe-area-inset-top));
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.25); overflow: hidden;
}
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.dlg-kopf { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 0.5em;
  padding: 0.8em 1em; background: var(--bg); border-bottom: 1px solid var(--linie); }
.dlg-kopf h2 { margin: 0; color: var(--text); font-size: 0.95rem; }
.dlg-rumpf { padding: 1em; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* flex-wrap: Reichen zwei Knöpfe nicht nebeneinander, rutscht einer in die nächste Zeile statt über den Rand */
.dlg-fuss { position: sticky; bottom: 0; display: flex; flex-direction: row-reverse; flex-wrap: wrap; gap: 0.5em; justify-content: flex-start; padding: 0.75em 1em;
  background: var(--bg); border-top: 1px solid var(--linie); }

.einkauf-zeile { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6em; align-items: center; padding: 0.5em 0; border-bottom: 1px solid var(--linie); }
.einkauf-zeile input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: var(--akzent); }
.einkauf-zeile .wie { display: block; font-size: 0.8rem; color: var(--leise); }
.einkauf-zeile select { max-width: 7.5em; padding: 0.25em; border: 1px solid var(--linie); border-radius: var(--radius-klein); background: var(--flaeche); font-size: 0.85rem; }
.einkauf-zeile.aus { opacity: 0.55; }

/* ── Zutaten-Zeilen im Editor ─────────────────────────────────────── */
.ed-zutaten > [data-sort] .name { display: flex; gap: 0.6em; align-items: baseline; min-width: 0; }
.ed-zutaten .ed-menge { flex: none; min-width: 4.2em; text-align: right; color: var(--leise); font-variant-numeric: tabular-nums; }
.ed-zutaten .ed-gruppe { background: var(--flaeche-2); }
.ed-zutaten .ed-gruppe .name { font-weight: 600; }
.ed-zutaten .rechts { white-space: normal; text-align: right; max-width: 38%; }
.ed-zutaten .ed-ohne { color: var(--gefahr); }
.ed-suche { margin: 0.6em 0 0; }
#zutTreffer { margin-top: 0.3em; }
.ed-artikel { display: flex; align-items: center; justify-content: space-between; gap: 0.6em;
  padding: 0.55em 0.8em; border-radius: var(--radius-klein); background: var(--flaeche-2); }

/* ── Listen (Artikel, Läden, Verlauf, Mehr) ───────────────────────── */
.zeilen { border: 1px solid var(--linie); border-radius: var(--radius-klein); overflow: hidden; background: var(--flaeche); }
.zeilen > * { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; width: 100%;
  padding: 0.65em 0.85em; border: 0; border-bottom: 1px solid var(--linie); background: none; text-align: left; text-decoration: none; color: inherit; cursor: pointer; }
.zeilen > *:last-child { border-bottom: 0; }
.zeilen .rechts { color: var(--leise); font-size: 0.85rem; white-space: nowrap; }
.pfeile { display: flex; gap: 0.2em; }
.pfeile button { border: 1px solid var(--linie); background: var(--flaeche); border-radius: var(--radius-klein); width: 2.1rem; height: 2.1rem; cursor: pointer; }

.vorgang { margin-bottom: 0.9em; }
.vorgang .titel { font-weight: 600; }
.vorgang ul { margin: 0.4em 0 0; padding-left: 1.1em; font-size: 0.9rem; }
.vorgang li.erl { color: var(--leise); }
.vorgang li.weg { color: var(--erledigt); text-decoration: line-through; }

/* ── Anmeldung ────────────────────────────────────────────────────── */
.anmelden { max-width: 22rem; margin: 12vh auto 0; text-align: center; }
.anmelden img { width: 5rem; margin: 0 auto 1em; border-radius: 1.1rem; }
.anmelden .feld { text-align: left; }

/* Zentriert über left/right + margin auto statt left 50 % + translate:
   sonst ist die Breite auf die halbe Seite begrenzt, der Text bricht zu
   früh um und die Box sitzt sichtbar schief. */
#meldung {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; max-width: calc(100vw - 2 * var(--rand-seite));
  bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom) + 0.8rem); z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.2em 0.9em;
  background: var(--text); color: var(--bg); padding: 0.6em 1.2em; border-radius: var(--radius);
  font-size: 0.9rem; text-align: center; box-shadow: var(--schatten);
}
#meldung[hidden] { display: none; }
body.tippt #meldung { bottom: calc(env(safe-area-inset-bottom) + 0.8rem); }
#meldung button { border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0.2em 0; }

/* Fokusrahmen nur bei Tastaturbedienung. Überschriften bekommen den Fokus
   nur, damit Dialoge nicht gleich ein Feld samt Tastatur öffnen. */
:focus:not(:focus-visible) { outline: none; }
[tabindex="-1"]:focus { outline: none; }

/* ── Druck: A5 wie die InDesign-Vorlage ───────────────────────────── */
@media print {
  @page { size: A5; margin: 12mm 12mm 12mm 12mm; }
  :root { --grund: 9.5pt; --text: #231f20; --flaeche-2: #ecebe9; --linie: #ccc; --hervor: #231f20; --akzent: #231f20; }
  body { background: #fff; color: #231f20; }
  #leiste, #meldung, .zurueck, .nicht-drucken, .offen, .umrechnen, dialog { display: none !important; }
  #inhalt { padding: 0; max-width: none; }
  .rezept-titel { font-size: 18pt; margin-bottom: 5mm; }
  .rezept-oben { grid-template-columns: 1.2fr 1fr; gap: 5mm; }
  .rezept-bild { border-radius: 0; }
  .zutaten { padding: 1mm 3mm 2mm; }
  .schritte { margin-top: 5mm; }
  .schritte .kopf-druck { text-align: center; font-weight: 300; letter-spacing: 0.12em; font-size: 12pt; }
  .schritt { break-inside: avoid; }
  .zut.umgerechnet .m { color: inherit; font-weight: 400; }
}

/* Dialog: Kopf und Fuß stehen, nur der Rumpf scrollt */
dialog[open] > form { display: flex; flex-direction: column; max-height: inherit; }
dialog .dlg-rumpf { flex: 1; min-height: 0; }
details > summary { cursor: pointer; }

/* ── Sortieren per Ziehen ─────────────────────────────────────────── */
.griff { touch-action: none; cursor: grab; color: var(--leise); padding: 0.4em 0.5em; margin: -0.4em 0 -0.4em -0.5em;
  font-size: 1.15rem; line-height: 1; user-select: none; -webkit-user-select: none; }
.sortiert > [data-sort] { transition: transform 0.15s ease; }
.sortiert > [data-sort].zieht { transition: none; position: relative; z-index: 3; background: var(--flaeche);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); cursor: grabbing; }
.zeilen > [data-sort] { gap: 0.4em; }
.zeilen > [data-sort] .name { flex: 1; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; text-decoration: none; }
.abt-wahl { display: flex; flex-wrap: wrap; gap: 0.4em; margin-bottom: 1em; }
.abt-wahl .chip { display: inline-flex; align-items: center; gap: 0.4em; }
.abt-wahl .chip .weg { border: 0; background: none; color: var(--leise); padding: 0 0 0 0.2em; cursor: pointer; font-size: 1rem; line-height: 1; }

/* ── Bildausschnitt ───────────────────────────────────────────────── */
.zuschnitt { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-klein);
  background: var(--flaeche-2); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.zuschnitt .zs-bild { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.zuschnitt::after { content: ''; position: absolute; inset: 0; pointer-events: none;   /* Drittel-Linien als Hilfe */
  background: linear-gradient(to right, transparent 33.2%, rgb(255 255 255 / .45) 33.3%, transparent 33.5%, transparent 66.5%, rgb(255 255 255 / .45) 66.6%, transparent 66.8%),
              linear-gradient(to bottom, transparent 33.2%, rgb(255 255 255 / .45) 33.3%, transparent 33.5%, transparent 66.5%, rgb(255 255 255 / .45) 66.6%, transparent 66.8%); }
.bild-klein { max-width: 16rem; }
input[type=range] { accent-color: var(--akzent); width: 100%; }

/* ── Fehler im Dialog (Dialog bleibt offen, Eingaben bleiben) ───────── */
.dlg-fehler { color: var(--gefahr); font-size: 0.9rem; margin: 0.6em 0 0; }

/* ── Schreibweisen im Artikel ─────────────────────────────────────── */
.sw-block { border-top: 1px solid var(--linie); margin-top: 1em; padding-top: 0.8em; }
.sw-block h3 { font-size: 0.95rem; margin: 0 0 0.3em; }
.sw-liste { display: flex; flex-wrap: wrap; gap: 0.4em; margin: 0.5em 0 0.8em; }
.sw-liste .chip { cursor: pointer; text-align: left; border-radius: var(--radius-klein); color: inherit; }
.sw-liste .chip small { display: block; color: var(--leise); font-size: 0.75rem; }
.sw-neu { display: flex; flex-wrap: wrap; gap: 0.5em; align-items: flex-end; }
.sw-neu .feld { flex: 1; margin-bottom: 0; }
.sw-neu .feld:first-child { flex-basis: 100%; }      /* Eingabe volle Breite, Teil + Knopf darunter */

/* Fester Wert statt gesperrtem Eingabefeld (ein readonly-Feld sieht antippbar aus, die Tastatur kommt aber nicht) */
.fest-wert { padding: 0.55em 0.8em; border-radius: var(--radius-klein); background: var(--flaeche-2); font-size: 1rem; }
.fest-wert small { display: block; color: var(--leise); font-size: 0.8rem; margin-top: 0.15em; }

/* Umschalter mit einem Tipp (z. B. Menge / etwas / nach Belieben) */
.segment { display: flex; border: 1px solid var(--linie); border-radius: var(--radius-rund); overflow: hidden; background: var(--flaeche); }
.segment button { flex: 1; padding: 0.55em 0.6em; border: 0; border-left: 1px solid var(--linie); background: none; color: var(--text);
  font: inherit; font-size: 0.95rem; cursor: pointer; white-space: nowrap; }
.segment button:first-child { border-left: 0; }
.segment button.an { background: var(--akzent); color: var(--akzent-text); }
.ed-vorschlaege { display: flex; flex-wrap: wrap; gap: 0.35em; margin-top: 0.45em; }
.ed-vorschlaege .chip { font-size: 0.85rem; padding: 0.25em 0.75em; }
.ed-vorschau { margin: -0.4em 0 1em; font-size: 0.9rem; color: var(--leise); }
.ed-vorschau strong { color: var(--text); font-weight: 600; }

/* Verbindung weg: dezenter Balken oben, bleibt bis der Server wieder antwortet */
#verbindung { position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 60;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.2em 0.9em;
  padding: 0.45em 1em; background: var(--gefahr); color: var(--gefahr-text); font-size: 0.85rem; text-align: center; }
#verbindung[hidden] { display: none; }
#verbindung button { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0.2em 0; }
