/* Modul Dokumente, Beleg-Editor (neuer Beleg auf dem Blatt): Stilregeln, die nur der Editor braucht. Gemeinsames steht in
   oo.css, die Liste in oo.dokumente.css, die Akte in oo.dokumente.akte.css – hier nie etwas davon überschreiben. Klassen
   mit der Vorsilbe dk-ed…. Eingebunden in Dokument.razor.
   Wie die Seitenansicht des Editors im PC-Programm: ein weißes Blatt auf grauem Grund (Absenderzeile, Anschrift, Kopfangaben
   rechts, Positionen, Summen), daneben eine schmale Spalte. Zellen sehen aus wie Text auf dem Blatt und werden beim Zeigen
   und im Fokus zum Feld. Blau nur Hauptknopf und Fokus; Haarlinien, Ecken 3 px, Zeilen 28 px. */

/* ── Belegart wählen ────────────────────────────────────────────────────────── */
.dk-ed-wahl-flaeche { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.dk-ed-wahl { margin: 0 auto; max-width: 520px; padding: 12vh 24px 32px; display: grid; gap: 12px; justify-items: start; }
@media (max-width: 600px) { .dk-ed-wahl { padding-top: 16px; } }
.dk-ed-wahl h1 { font-size: 20px; font-weight: 600; }
.dk-ed-wahl > p { color: var(--tinte-4); font-size: 14px; }
.dk-ed-wahl-arten { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.dk-ed-wahl > .dk-ed-wahl-hinweis { color: var(--tinte-5); font-size: 12px; }
.dk-ed-verweis { padding: 0; border: 0; background: none; color: var(--tinte-3); font: inherit; text-decoration: underline;
  text-decoration-color: var(--linie-stark); text-underline-offset: 2px; cursor: pointer; }
.dk-ed-verweis:hover { color: var(--tinte-1); text-decoration-color: var(--tinte-3); }

/* ── Editor: Kopfleiste und Arbeitsfläche ───────────────────────────────────── */
.dk-ed { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--grund); }
.dk-ed-kopf { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--linie);
  background: var(--flaeche); }
.dk-ed-kopf h1 { font-size: 15px; font-weight: 600; white-space: nowrap; }
.dk-ed-quelle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-5); }
.dk-ed-stand { color: var(--warn); font-size: 12px; white-space: nowrap; }
.dk-ed-band.dk-ed-band-info { background: var(--flaeche-2); color: var(--tinte-2); }
#dk-ed-vorschau .sym, #dk-ed-vorschau .kreisel { flex: 0 0 auto; }
/* Die Arbeitsfläche ist zugleich das fieldset, das beim Speichern alle Felder sperrt. */
.dk-ed-rumpf { flex: 1 1 auto; min-height: 0; min-width: 0; margin: 0; padding: 18px 20px 48px; border: 0; overflow: auto;
  display: grid; grid-template-columns: minmax(0, 940px) 268px; justify-content: center; align-items: start; gap: 20px; }

/* ── Das Blatt ──────────────────────────────────────────────────────────────── */
.dk-ed-blatt { min-width: 0; padding: 26px 36px 30px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.dk-ed-band { display: grid; gap: 2px; margin: -6px 0 16px; padding: 9px 12px; border-radius: 3px; background: var(--alarm-grund); color: var(--alarm);
  white-space: pre-line; overflow-wrap: anywhere; }
/* Hinweis, der nicht sperrt, aber vor dem Speichern zu prüfen ist (VIES, OSS): gelb. */
.dk-ed-band.dk-ed-band-warn { background: var(--warn-grund); color: var(--warn); }
.dk-ed-band a { color: inherit; text-decoration: underline; }
/* Lieferschein aus Auftrag: die offene Menge unter der Menge. */
.dk-ed-offen { padding: 0 4px; color: var(--tinte-4); font-size: 11px; text-align: right; white-space: nowrap; }
.dk-ed-absender { display: inline-block; max-width: 100%; margin-bottom: 10px; border-bottom: 1px solid var(--linie); color: var(--tinte-5); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ed-kopfraster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 330px); gap: 28px; align-items: start; margin-bottom: 22px; }
.dk-ed-anschrift { min-width: 0; min-height: 112px; display: grid; align-content: start; justify-items: start; gap: 4px; }
.dk-ed-adresse { display: grid; gap: 1px; }
.dk-ed-adresse span { overflow-wrap: anywhere; }
.dk-ed-zeichen { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* Eigene Felder des Kunden unter der Anschrift (EditorKundeFelder): Name und Wert je Zeile, klein und ruhig – zum Nachschlagen
   beim Schreiben, nicht zum Bearbeiten. Die Namen stehen in einer Spalte (so breit wie der längste, höchstens 148 px). */
.dk-ed-kundenfelder { display: grid; grid-template-columns: fit-content(148px) minmax(0, 1fr); gap: 1px 10px; min-width: 0; max-width: 100%; margin: 6px 0 0;
  font-size: 12px; }
.dk-ed-kundenfelder > div { display: contents; }
.dk-ed-kundenfelder dt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-5); }
.dk-ed-kundenfelder dd { min-width: 0; margin: 0; color: var(--tinte-2); overflow-wrap: anywhere; }
/* Der Komplett-Rabatt des Kunden: im Browser trägt ihn niemand von selbst ein. */
.dk-ed-kundenrabatt { display: flex; align-items: flex-start; gap: 6px; max-width: 100%; margin: 6px 0 0; padding: 5px 8px; border-left: 3px solid var(--ampel-gelb);
  border-radius: 0 3px 3px 0; background: var(--warn-grund); color: var(--tinte-2); font-size: 12px; }
.dk-ed-kundenrabatt .sym { flex: 0 0 auto; margin-top: 1px; color: var(--warn); }
.dk-ed-kunde-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.dk-ed-marke { color: var(--tinte-4); }
.dk-ed-leer { color: var(--tinte-5); }

/* Kopfangaben rechts */
.dk-ed-info { min-width: 0; }
.dk-ed-art { margin-bottom: 8px; font-size: 20px; font-weight: 600; letter-spacing: -.005em; }
.dk-ed-angaben { display: grid; gap: 2px; }
.dk-ed-angabe { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 28px; }
/* Leistung von – bis: zwei Datumsfelder; reicht die Breite nicht, rückt „bis“ in die nächste Zeile. */
.dk-ed-angabe .w.dk-ed-zwei { flex-wrap: wrap; row-gap: 4px; }
/* Die Beschriftung bricht um statt abzuschneiden: die Kopfzeilen der Belegarten sind lang („Bezugsrechnungs-Nr.“, „Rechnungskorrektur-Nr.“,
   „Abschlagsrechnung-Nr.“) und standen mit „…“ ohne Kurzhilfe da (Durchsicht BR-B13). */
.dk-ed-angabe .wl { color: var(--tinte-4); line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.dk-ed-angabe .w { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.dk-ed-angabe .pflicht { color: var(--ampel-rot); }
.dk-ed-angabe .ein.dk-ed-tag { width: 152px; }
.dk-ed-angabe .ein.dk-ed-tage { flex: 0 0 64px; width: 64px; }
.dk-ed .blass { color: var(--tinte-5); }
.dk-ed-feldfehler { margin: 4px 0 0; color: var(--alarm); font-size: 12px; }
/* Unter seiner Zeile: im Kopf bündig mit den Feldern, in der Tabelle unter der Bezeichnung. */
.dk-ed-angaben > .dk-ed-feldfehler { margin: 0 0 4px 132px; }
.dk-ed-z-fehler { margin: 2px 0 6px 40px; }

/* ── Positionen ─────────────────────────────────────────────────────────────── */
.dk-ed-tabelle { margin: 0 -6px; padding: 0 6px; overflow-x: auto; }
/* Erste Spalte 36 px: „Pos.“ (12 px, halbfett) braucht mit dem Innenabstand 34 px – bei 30 px stand dort „P…“ (Durchsicht B10). */
.dk-ed-pos { --dk-ed-spalten: 36px 92px minmax(170px, 1fr) 76px 50px 100px 64px 72px 100px 60px; min-width: 856px; }
.dk-ed-pos.ohne-preise { --dk-ed-spalten: 36px 110px minmax(220px, 1fr) 92px 60px 60px; min-width: 596px; }
.dk-ed-th, .dk-ed-z { display: grid; grid-template-columns: var(--dk-ed-spalten); column-gap: 4px; align-items: center; }
.dk-ed-th { height: 28px; border-bottom: 1px solid var(--linie-stark); color: var(--tinte-5); font-size: 12px; font-weight: 600; }
.dk-ed-th > span { padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ed-th .rechts { text-align: right; }
.dk-ed-z { min-height: 32px; padding: 2px 0; border-bottom: 1px solid var(--linie-fein); }
.dk-ed-z > span { min-width: 0; }
.dk-ed-z .nr { padding: 0 4px; color: var(--tinte-5); }
.dk-ed-z > .blass { padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ed-z .bez { display: flex; align-items: center; gap: 6px; }
.dk-ed-z .menge { display: grid; }
.dk-ed-z .betrag { padding: 0 4px; text-align: right; font-weight: 600; white-space: nowrap; }
/* Zellen wie Text auf dem Blatt; beim Zeigen und im Fokus ein Feld. */
.dk-ed-z .ein, .dk-ed-z .aus { padding: 0 4px; border-color: transparent; background: transparent; }
.dk-ed-z:hover .ein, .dk-ed-z:hover .aus { border-color: var(--linie-stark); }
.dk-ed-z .ein:focus, .dk-ed-z .aus:focus { border-color: var(--akzent); background: var(--flaeche); }
.dk-ed-z .ein.fehler { border-color: var(--ampel-rot); }
.dk-ed-z .aus.dk-ed-satz { text-align: right; text-align-last: right; }
.dk-ed-dienst { flex: 0 0 auto; color: var(--tinte-5); font-size: 11.5px; white-space: nowrap; }
.dk-ed-bestand { padding: 0 4px; color: var(--warn); font-size: 11px; text-align: right; white-space: nowrap; }
.dk-ed-fest { display: block; padding: 0 4px; text-align: right; color: var(--tinte-4); }
.dk-ed-weg, .dk-ed-mehr { opacity: .5; }
.dk-ed-z:hover :is(.dk-ed-weg, .dk-ed-mehr), :is(.dk-ed-weg, .dk-ed-mehr):focus-visible, .dk-ed-mehr[aria-expanded=true] { opacity: 1; }
.dk-ed-aktionen { position: relative; display: flex; justify-content: flex-end; }
.dk-ed-menue { position: absolute; z-index: 20; top: calc(100% + 2px); right: 0; min-width: 210px; display: grid; padding: 4px; border: 1px solid var(--linie-stark);
  border-radius: 4px; background: var(--flaeche); box-shadow: var(--schatten); }
.dk-ed-menue button { height: 28px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; color: var(--tinte-2); font: inherit; text-align: left;
  white-space: nowrap; cursor: pointer; }
.dk-ed-menue button:hover:not(:disabled) { background: var(--flaeche-2); }
.dk-ed-menue button:disabled { color: var(--tinte-6); cursor: default; }
/* Leerzeile: nur „Leerzeile“, verschiebbar und entfernbar; Versandzeile mit Abzeichen. */
.dk-ed-z.leer { min-height: 26px; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--linie-fein) 6px 7px); }
.dk-ed-leerzeile { grid-column: 2 / -2; padding: 0 4px; color: var(--tinte-5); font-size: 12px; font-style: italic; }
.dk-ed-versandzeile { padding: 0 5px; border: 1px solid var(--linie); border-radius: 3px; }
/* Beschreibung (Langtext) unter der Bezeichnung; aufgeklappt mit Seriennummer und Zustand über die ganze Breite. */
.dk-ed-z .bez { flex-wrap: wrap; row-gap: 0; }
.dk-ed-langtext { flex: 1 0 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; padding: 0 4px;
  border: 0; background: none; color: var(--tinte-4); font: inherit; font-size: 12px; text-align: left; white-space: pre-line; cursor: pointer; }
.dk-ed-langtext.nicht-gedruckt { color: var(--tinte-6); text-decoration: line-through; text-decoration-color: var(--linie-stark); }
.dk-ed-angaben-z { grid-column: 3 / -1; display: grid; gap: 6px; padding: 6px 4px 8px; }
.dk-ed-angaben-z label { color: var(--tinte-4); font-size: 12px; }
.dk-ed-angaben-z .mehrzeilig { min-height: 52px; resize: vertical; }
.dk-ed-zwei-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dk-ed-feld-klein { display: grid; gap: 2px; min-width: 0; }
.dk-ed-keine { padding: 14px 4px 4px; color: var(--tinte-5); }

/* Artikel hinzufügen, freie Position */
.dk-ed-hinzu { display: flex; align-items: center; gap: 8px; margin: 10px 0 20px; }

/* ── Suchfeld mit Vorschlägen (Kunde, Artikel) ──────────────────────────────── */
.dk-ed-suche { position: relative; flex: 0 1 380px; min-width: 200px; width: 100%; max-width: 380px; display: flex; align-items: center; }
.dk-ed-suche.offen { z-index: 31; }
.dk-ed-suche > .sym { position: absolute; z-index: 32; left: 8px; color: var(--tinte-6); pointer-events: none; }
.dk-ed-suche input { position: relative; z-index: 31; width: 100%; height: 28px; padding: 0 8px 0 28px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--tinte-1); outline: none; }
.dk-ed-suche input:focus { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent-schein); }
.dk-ed-suche input::placeholder { color: var(--tinte-6); }
.dk-ed-suche input::-webkit-search-cancel-button { display: none; }
.dk-ed-vorschlaege { position: absolute; z-index: 32; top: 31px; left: 0; width: max(100%, 440px); max-height: 360px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--linie-stark); border-radius: 4px; background: var(--flaeche); box-shadow: var(--schatten); }
.dk-ed-vs { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: 3px; background: transparent;
  color: var(--tinte-2); text-align: left; cursor: pointer; }
.dk-ed-vs:hover { background: var(--flaeche-2); }
.dk-ed-vs.gewaehlt { background: var(--auswahl); color: var(--tinte-1); }
.dk-ed-vs .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dk-ed-vs .vor { font-weight: 400; color: var(--tinte-4); }
.dk-ed-vs .nr { flex: 0 0 auto; color: var(--tinte-5); }
.dk-ed-vs .blass { flex: 0 0 auto; font-size: 12px; }
.dk-ed-vs .rest { flex: 0 1 auto; min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-5); }
.dk-ed-vs-stand { display: flex; align-items: center; gap: 4px; padding: 6px 8px; color: var(--tinte-5); font-size: 12px; }
.dk-ed-vs-stand.fehler { color: var(--alarm); }
.dk-ed-vs-tasten { margin-top: 2px; padding: 5px 8px 2px; border-top: 1px solid var(--linie); color: var(--tinte-6); font-size: 11.5px; }

/* ── Summen und Bemerkung ───────────────────────────────────────────────────── */
.dk-ed-summen { width: min(320px, 100%); margin: 0 0 22px auto; display: grid; gap: 2px; }
.dk-ed-summen .zeile { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 22px; }
.dk-ed-summen .zeile > span:last-child { white-space: nowrap; }
.dk-ed-summen .gesamt { margin-top: 4px; padding-top: 6px; border-top: 2px solid var(--tinte-1); font-size: 14px; font-weight: 600; }
.dk-ed-summen .fett { font-weight: 600; }
.dk-ed-summen .linie { margin-top: 2px; padding-top: 3px; border-top: 1px solid var(--linie); }
.dk-ed-steuerhinweis { margin-top: 6px; color: var(--tinte-4); font-size: 12px; }
.dk-ed-bemerkung { display: grid; gap: 4px; padding-top: 14px; border-top: 1px dashed var(--linie); }
.dk-ed-bemerkung label { color: var(--tinte-4); }

/* ── Texte auf dem Blatt (EditorTexte): Einleitung, Schlusstext, Infobox an Kunde ── */
/* Wie Text auf dem Blatt; beim Zeigen und im Fokus ein Feld. Die Infobox steht links neben den Summen (gelb wie gedruckt). */
.dk-ed-text { display: grid; gap: 4px; margin: 0 0 16px; min-width: 0; }
.dk-ed-text-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; min-height: 28px; color: var(--tinte-4); font-size: 12px; }
.dk-ed-text-kopf label { font-weight: 600; }
.dk-ed .ein.dk-ed-textfeld { min-height: 58px; resize: vertical; border-color: transparent; background: transparent; }
.dk-ed-text:hover .ein.dk-ed-textfeld { border-color: var(--linie-stark); }
.dk-ed .ein.dk-ed-textfeld:focus { border-color: var(--akzent); background: var(--flaeche); }
.dk-ed-text-kopf .aus.dk-ed-baustein { width: auto; max-width: 260px; }
/* Die Texte wachsen mit dem Inhalt (Durchsicht B10): die Zeilenzahl setzt die Seite (BelegEditorAnzeige.TextZeilen, höchstens
   16); wo der Browser es kann, folgt die Höhe genau dem Text (auch beim Tippen und am Handy), höchstens rund 16 Zeilen. */
@supports (field-sizing: content) {
  .dk-ed .ein.dk-ed-textfeld, .dk-ed-infobox .ein.mehrzeilig { field-sizing: content; max-height: calc(16lh + 14px); }
}
.dk-ed-ph-liste { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 3px;
  background: var(--flaeche-2); }
.dk-ed-ph-gruppe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dk-ed-ph-titel { flex: 0 0 100%; color: var(--tinte-5); font-size: 11.5px; font-weight: 600; }
.dk-ed-ph { min-height: 24px; padding: 0 6px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); color: var(--tinte-2); font: inherit;
  font-size: 12px; overflow-wrap: anywhere; text-align: left; cursor: pointer; }
.dk-ed-ph:hover { border-color: var(--linie-stark); }
.dk-ed-summenzone { display: grid; grid-template-columns: minmax(0, 1fr) min(320px, 100%); gap: 24px; align-items: start; }
.dk-ed-summenzone .dk-ed-summen { grid-column: 2; width: auto; margin: 0 0 22px; }
.dk-ed-infobox { grid-column: 1; grid-row: 1; min-width: 0; justify-self: start; }
.dk-ed-infobox.an { justify-self: stretch; display: grid; gap: 4px; padding: 6px 10px 10px; border-radius: 3px; background: var(--warn-grund); }
.dk-ed-infobox .mehrzeilig { min-height: 58px; resize: vertical; }

/* ── Optionen unter dem Blatt (EditorBlattOptionen): „Zahlung“ und „Angaben“ ── */
/* Breit zwei Spalten, jede Option eine Zeile (Beschriftung links, Feld rechts) wie die Optionen des PC-Programms. */
.dk-ed-optionen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; margin: 0 0 22px; padding-top: 14px;
  border-top: 1px dashed var(--linie); }
.dk-ed-opt-spalte { display: grid; align-content: start; gap: 4px; min-width: 0; }
.dk-ed-opt-titel { padding-bottom: 3px; border-bottom: 1px solid var(--linie); color: var(--tinte-4); font-size: 12px; font-weight: 600; }
.dk-ed-optionen .dk-ed-ab { display: grid; grid-template-columns: 148px minmax(0, 1fr); column-gap: 8px; align-items: start; min-height: 28px; }
.dk-ed-optionen .dk-ed-ab-h { padding-top: 5px; color: var(--tinte-4); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.dk-ed-optionen .dk-ed-ab-inhalt { grid-column: 2; gap: 3px; align-content: start; min-height: 28px; }
.dk-ed-opt-feld { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; min-height: 28px; }
.dk-ed-optionen .ein.dk-ed-tage, .dk-ed-optionen .ein.dk-ed-prozent { flex: 0 0 64px; width: 64px; }
.dk-ed-optionen .ein.dk-ed-betrag { flex: 0 0 96px; width: 96px; }
.dk-ed-optionen .ein.dk-ed-tag { flex: 0 0 152px; width: 152px; }
.dk-ed-optionen .ein.dk-ed-dienstname { flex: 1 1 140px; min-width: 0; }
.dk-ed-optionen .segment { justify-self: start; }
.dk-ed-optionen p { font-size: 12.5px; }
.dk-ed-opt-hw { color: var(--tinte-5); font-size: 12px; overflow-wrap: anywhere; }
.dk-ed-opt-hw.warn { color: var(--warn); }
.dk-ed-opt-hw.alarm { color: var(--alarm); }
.dk-ed-optionen .dk-ed-verweis { justify-self: start; text-align: left; }
.dk-ed-schalter { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; cursor: pointer; }
.dk-ed-satz-alle .kn { height: 24px; padding: 0 8px; }

/* ── Schmale Spalte (Abschnitte: EditorAbschnitt) ───────────────────────────── */
.dk-ed-seite { position: sticky; top: 0; display: grid; gap: 14px; min-width: 0; }
.dk-ed-seite section { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--linie); }
.dk-ed-seite section:last-child { border-bottom: 0; }
.dk-ed-seite h3 { color: var(--tinte-4); font-size: 12px; font-weight: 600; }
.dk-ed-seite p { font-size: 12.5px; overflow-wrap: anywhere; }
.dk-ed-ab-inhalt { display: grid; gap: 6px; min-width: 0; }
.dk-ed-hw { padding-left: 8px; border-left: 2px solid var(--ampel-gelb); color: var(--tinte-3); }
.dk-ed-hw.alarm { border-left-color: var(--ampel-rot); }

/* Schmale Teile (Karten, Fußleiste, aufklappbare Köpfe) stehen breit nicht da. */
.dk-ed-karten, .dk-ed-fuss, .dk-ed-ab-kopf, .dk-ed-einheit-klein, .dk-ed-artnr-klein { display: none; }

/* ── Eine Position im Blatt von unten (EditorPositionBlatt) ─────────────────── */
/* Geöffnet über eine Karte (schmal); es gilt in jeder Breite und liegt über der Fußleiste, unter Rückfragen und Meldungen. */
.dk-ed-bl-schleier { z-index: 44; }
.dk-ed-posblatt { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; width: min(100%, 560px); max-height: calc(100dvh - 40px); margin: 0 auto;
  display: flex; flex-direction: column; border: 1px solid var(--linie-stark); border-bottom: 0; border-radius: 4px 4px 0 0; background: var(--flaeche);
  box-shadow: 0 -18px 48px rgba(15, 23, 42, .24); padding-bottom: env(safe-area-inset-bottom, 0px); animation: dk-ed-bl-ein .16s ease-out; }
@keyframes dk-ed-bl-ein { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.dk-ed-bl-griff { flex: 0 0 auto; width: 36px; height: 4px; margin: 6px auto 0; border-radius: 2px; background: var(--linie-stark); }
.dk-ed-bl-kopf { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 12px 8px 16px; border-bottom: 1px solid var(--linie); }
.dk-ed-bl-kopf h2 { font-size: 16px; font-weight: 600; white-space: nowrap; }
.dk-ed-bl-kopf .blass { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ed-bl-rumpf { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start; gap: 12px; padding: 14px 16px; }
.dk-ed-bl-feld { display: grid; align-content: start; gap: 4px; min-width: 0; }
.dk-ed-bl-feld.breit, .dk-ed-bl-betrag, .dk-ed-bl-fehler { grid-column: 1 / -1; }
.dk-ed-bl-feld > label, .dk-ed-bl-feld > .wl { color: var(--tinte-4); font-size: 13px; }
.dk-ed-bl-feld .dk-ed-bestand, .dk-ed-bl-feld .dk-ed-dienst { padding: 0; text-align: left; }
.dk-ed-bl-feld .dk-ed-fest { display: flex; align-items: center; height: 44px; padding: 0; text-align: left; font-size: 16px; }
.dk-ed-bl-betrag { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid var(--linie); }
.dk-ed-bl-betrag strong { font-size: 18px; font-weight: 600; white-space: nowrap; }
.dk-ed-bl-fehler { color: var(--alarm); font-size: 13px; }
.dk-ed-bl-fuss { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--linie); }
.dk-ed-bl-feld .mehrzeilig { min-height: 72px; }
.dk-ed-posblatt :is(.ein, .aus) { height: 44px; font-size: 16px; }
.dk-ed-posblatt .kn { height: 44px; padding: 0 16px; font-size: 15px; }
.dk-ed-posblatt .dk-ed-bl-weg { padding: 0 10px; color: var(--alarm); }
.dk-ed-posblatt .dk-ed-bl-weg:hover { background: var(--alarm-grund); color: var(--alarm); }

/* ── Fußleiste (EditorFussleiste) ──────────────────────────────────────────── */
/* Unter dem rollenden Rumpf, nicht über ihm: sie verdeckt nie ein Feld. */
.dk-ed-fuss { flex: 0 0 auto; align-items: center; gap: 12px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 16px;
  border-top: 1px solid var(--linie); background: var(--flaeche); box-shadow: 0 -4px 14px rgba(15, 23, 42, .06); }
.dk-ed-fuss-betrag { flex: 1 1 auto; min-width: 0; display: grid; }
.dk-ed-fuss-betrag .wl { color: var(--tinte-5); font-size: 12px; }
.dk-ed-fuss-betrag strong { font-size: 19px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-ed-fuss-stand { color: var(--warn); font-size: 12px; }
.dk-ed-fuss .kn-haupt { flex: 0 0 auto; height: 48px; min-width: 128px; padding: 0 20px; font-size: 16px; }

/* ── Mittlere Breite: die Tabelle wird schmaler statt zu rollen ─────────────── */
/* Ist die Tabelle schmaler als ihre 820 px (Fenster 760–1180 px, Spalte daneben), rückt die Einheit in die Mengenzelle und
   die Spalten werden enger. Breit (ab 1180 px) bleibt alles wie am PC. */
.dk-ed-tabelle { container: dk-ed-tabelle / inline-size; }
@container dk-ed-tabelle (max-width: 819px) {
  .dk-ed-pos { --dk-ed-spalten: 36px minmax(150px, 1fr) 76px 88px 60px 72px 88px 60px; min-width: 658px; }
  .dk-ed-pos.ohne-preise { --dk-ed-spalten: 36px minmax(160px, 1fr) 96px 60px; min-width: 0; }
  .dk-ed-angaben-z { grid-column: 2 / -1; }
  .dk-ed-pos .einheit, .dk-ed-pos .artnr { display: none; }
  .dk-ed-z .bez { flex-wrap: wrap; row-gap: 0; }
  .dk-ed-z .dk-ed-einheit-klein, .dk-ed-z .dk-ed-artnr-klein { display: block; padding: 0 4px; color: var(--tinte-5); font-size: 11px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
  .dk-ed-z .dk-ed-einheit-klein { text-align: right; }
  .dk-ed-z .dk-ed-artnr-klein { flex: 1 0 100%; }
}

/* ── Grober Zeiger (Finger) oder schmal: Ziele 44 px, Felder immer als Felder, Schrift 16 px (kein Zoom am iPhone) ── */
@media (max-width: 760px), (pointer: coarse) {
  .dk-ed :is(.ein, .aus), .dk-ed-suche input { height: 44px; font-size: 16px; }
  .dk-ed .ein.mehrzeilig { height: auto; min-height: 96px; font-size: 16px; }
  .dk-ed .kn { height: 44px; padding: 0 14px; }
  .dk-ed .kn-symbol { width: 44px; padding: 0; }
  .dk-ed .segment button { height: 40px; font-size: 14px; }
  .dk-ed-verweis { min-height: 44px; display: inline-flex; align-items: center; }
  .dk-ed-suche > .sym { left: 12px; }
  .dk-ed-suche input { padding-left: 34px; }
  .dk-ed-vorschlaege { top: 47px; }
  .dk-ed-vs { height: auto; min-height: 44px; padding: 6px 10px; font-size: 15px; }
  .dk-ed-vs-tasten { display: none; }
  .dk-ed-angabe { min-height: 44px; }
  .dk-ed-z .ein, .dk-ed-z .aus { border-color: var(--linie-stark); }
  .dk-ed-weg { opacity: 1; }
  .dk-ed-z { padding: 4px 0; }
  /* Rückfragen über dem Editor: Knöpfe groß genug für den Finger und umbrechend statt zu rollen. */
  body:has(#dk-ed) .oo-dialog .knoepfe { flex-wrap: wrap; }
  body:has(#dk-ed) .oo-dialog .kn { height: 44px; padding: 0 16px; }
}
/* Das aktive Feld bleibt beim Rollen (auch über die Bildschirmtastatur) mit etwas Luft sichtbar. */
.dk-ed-rumpf :is(input, select, textarea) { scroll-margin-block: 64px 24px; }
.dk-ed-suche { scroll-margin-top: 8px; }

/* ── Schmale Fenster ────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  /* Die Spalte rückt unter das Blatt; das Blatt wird etwas enger, damit die Tabelle hineinpasst. */
  .dk-ed-rumpf { grid-template-columns: minmax(0, 1fr); padding: 14px 12px 40px; }
  .dk-ed-seite { position: static; }
  .dk-ed-blatt { padding: 22px 24px 26px; }
}

/* Mittlere Breite (Tablet hoch): die Optionen untereinander statt in zwei engen Spalten. */
@media (min-width: 761px) and (max-width: 1000px) {
  .dk-ed-optionen { grid-template-columns: minmax(0, 1fr); }
  .dk-ed-opt-angaben { margin-top: 10px; }
}

/* Unter 760 px: kein Blatt mehr, die Teile stehen als Abschnitte untereinander (Kunde, Lieferadresse, Kopfangaben,
   Positionen als Karten, Preise, Summen, Bemerkung); „Speichern“ steht in der Fußleiste. Blatt, Spalte und Kopfraster lösen
   sich dafür auf (display: contents), die Reihenfolge setzt order. */
@media (max-width: 760px) {
  .dk-ed-kopf { min-height: 52px; padding: 4px 8px 4px 16px; }
  .dk-ed-kopf h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
  .dk-ed-kopf .dk-ed-quelle, .dk-ed-kopf .dk-ed-stand, .dk-ed-kopf #dk-ed-speichern { display: none; }
  /* Schmal bleibt von „Vorschau (PDF)“ das Symbol (44 px); „Abbrechen“ bleibt als Wort. */
  #dk-ed-vorschau { width: 44px; padding: 0; justify-content: center; }
  #dk-ed-vorschau .t { display: none; }
  .dk-ed-fuss { display: flex; }

  .dk-ed-rumpf { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px; padding: 8px 0 20px;
    overscroll-behavior: contain; }
  .dk-ed-blatt, .dk-ed-seite, .dk-ed-kopfraster, .dk-ed-optionen, .dk-ed-opt-spalte, .dk-ed-summenzone { display: contents; }
  /* ☠️ Im rollenden Rumpf (feste Höhe) schrumpften die Abschnitte sonst unter ihren Inhalt (die Anschrift auf 30 px). */
  .dk-ed-blatt > *, .dk-ed-seite > *, .dk-ed-kopfraster > *, .dk-ed-opt-spalte > *, .dk-ed-summenzone > * { flex-shrink: 0; }
  .dk-ed-absender, .dk-ed-tabelle { display: none; }

  /* Jeder Teil ein Abschnitt über die volle Breite. */
  .dk-ed-anschrift, .dk-ed-info, .dk-ed-karten, .dk-ed-hinzu, .dk-ed-summen, .dk-ed-bemerkung, .dk-ed-seite .dk-ed-ab, .dk-ed-optionen .dk-ed-ab,
  .dk-ed-text, .dk-ed-infobox {
    min-width: 0; margin: 0; padding: 14px 16px; border-block: 1px solid var(--linie); background: var(--flaeche); }
  .dk-ed-band { order: 0; margin: 0 8px; }
  .dk-ed-ab-hinweise { order: 1; }
  .dk-ed-anschrift { order: 2; min-height: 0; justify-items: stretch; gap: 6px; }
  .dk-ed-info { order: 4; }
  .dk-ed-text-intro { order: 5; }
  .dk-ed-karten { order: 6; display: block; padding-bottom: 0; border-bottom: 0; }
  .dk-ed-hinzu { order: 7; margin-top: -8px; padding-top: 10px; border-top: 0; }
  .dk-ed-summen { order: 8; }
  .dk-ed-infobox { order: 9; }
  .dk-ed-text-schluss { order: 10; }
  .dk-ed-opt-zahlung > * { order: 11; }
  .dk-ed-opt-angaben > * { order: 12; }
  .dk-ed-bemerkung { order: 13; padding-top: 14px; border-top-style: solid; }
  .dk-ed-ab-nach { order: 14; }

  /* Kunde */
  .dk-ed-adresse { font-size: 15px; }
  .dk-ed-anschrift > .dk-ed-verweis { justify-self: start; }
  .dk-ed-marke { font-weight: 600; color: var(--tinte-2); }

  /* Kopfangaben einspaltig: Beschriftung über dem Feld. */
  .dk-ed-art { margin-bottom: 10px; font-size: 17px; }
  .dk-ed-angaben { gap: 10px; }
  .dk-ed-angabe { grid-template-columns: minmax(0, 1fr); gap: 4px; min-height: 0; }
  .dk-ed-angabe .wl { white-space: normal; font-size: 13px; }
  .dk-ed-angabe .ein.dk-ed-tag { width: 100%; }
  .dk-ed-angabe .w { flex-wrap: wrap; white-space: normal; }
  .dk-ed-angabe .ein.dk-ed-tage { flex: 0 0 96px; width: 96px; }
  .dk-ed-angaben > .dk-ed-feldfehler { margin: -6px 0 0; }

  /* Positionen als Karten */
  .dk-ed-karten h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 15px; font-weight: 600; }
  .dk-ed-karten h2 .zahl { color: var(--tinte-5); font-weight: 400; }
  .dk-ed-karten ol { margin: 0 -16px; padding: 0; list-style: none; }
  .dk-ed-karten-keine { padding: 6px 0 4px; color: var(--tinte-5); }
  .dk-ed-karte { display: grid; grid-template-columns: minmax(0, 1fr) 16px; column-gap: 10px; align-items: center; width: 100%; min-height: 60px;
    padding: 10px 12px 10px 16px; border: 0; border-top: 1px solid var(--linie-fein); background: transparent; color: var(--tinte-1); font: inherit;
    text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .dk-ed-karte > :not(.sym) { grid-column: 1; }
  .dk-ed-karte > .sym { grid-column: 2; grid-row: 1 / span 3; color: var(--tinte-6); }
  .dk-ed-karte:hover, .dk-ed-karte:active, .dk-ed-karte.offen { background: var(--auswahl); }
  .dk-ed-karte .kopf { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .dk-ed-karte .nr { flex: 0 0 16px; color: var(--tinte-5); font-size: 12px; }
  .dk-ed-karte .name { flex: 1 1 auto; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }
  .dk-ed-karte .name.leer { color: var(--tinte-5); font-weight: 400; }
  .dk-ed-karte .betrag { flex: 0 0 auto; font-size: 15px; font-weight: 600; white-space: nowrap; }
  .dk-ed-karte .unter { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 0 0 24px; color: var(--tinte-4); font-size: 13px; }
  .dk-ed-karte .unter .blass { color: var(--tinte-5); }
  .dk-ed-karte .langtext { margin: 2px 0 0 24px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    color: var(--tinte-5); font-size: 13px; white-space: pre-line; }
  .dk-ed-karte .langtext.nicht-gedruckt { text-decoration: line-through; text-decoration-color: var(--linie-stark); }
  .dk-ed-karte.leer { min-height: 40px; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--linie-fein) 6px 7px); }
  .dk-ed-karte.leer .name { font-style: italic; font-size: 13px; }
  .dk-ed-karte .dk-ed-bestand { margin: 2px 0 0 24px; padding: 0; text-align: left; white-space: normal; font-size: 12.5px; }

  /* Artikel hinzufügen, freie Position: über die volle Breite untereinander */
  .dk-ed-hinzu { display: grid; gap: 8px; }
  .dk-ed-suche { flex: none; width: 100%; max-width: none; min-width: 0; }
  .dk-ed-vorschlaege { width: 100%; max-height: min(360px, 52dvh); }
  #dk-ed-frei { width: 100%; }

  /* Summen über die volle Breite */
  .dk-ed-summen { width: auto; gap: 4px; }
  .dk-ed-summen .zeile { min-height: 24px; font-size: 14px; }
  .dk-ed-summen .gesamt { font-size: 16px; }

  .dk-ed-bemerkung label { font-size: 13px; }
  .dk-ed-text-kopf { font-size: 13px; }
  .dk-ed .ein.dk-ed-textfeld { border-color: var(--linie-stark); background: var(--flaeche); }
  .dk-ed-text-kopf .aus.dk-ed-baustein { flex: 1 1 100%; max-width: none; order: 3; }
  .dk-ed-ph { min-height: 40px; padding: 0 10px; font-size: 14px; }
  .dk-ed-infobox.an { padding: 14px 16px; border-radius: 0; }

  /* Abschnitte der Spalte: aufklappbar, zugeklappt mit Kurzfassung */
  .dk-ed-seite .dk-ed-ab, .dk-ed-optionen .dk-ed-ab { display: block; padding: 0; }
  .dk-ed-opt-titel { margin-top: 6px; padding: 8px 16px 2px; border: 0; font-size: 12.5px; }
  .dk-ed-optionen .ein.dk-ed-tag { flex: 1 1 160px; width: auto; }
  .dk-ed-optionen .ein.dk-ed-tage, .dk-ed-optionen .ein.dk-ed-prozent { flex: 0 0 88px; width: 88px; }
  .dk-ed-optionen .ein.dk-ed-betrag { flex: 0 0 120px; width: 120px; }
  .dk-ed-optionen p, .dk-ed-opt-hw { font-size: 13.5px; }
  .dk-ed-schalter { min-height: 44px; font-size: 15px; }
  .dk-ed-schalter input { width: 22px; height: 22px; }
  .dk-ed-satz-alle .kn { height: 44px; padding: 0 14px; }
  .dk-ed-ab-h { display: none; }
  .dk-ed-ab-kopf { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 14px 0 16px; border: 0; background: transparent;
    color: var(--tinte-1); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .dk-ed-ab-kopf .t { flex: 1 1 auto; min-width: 0; }
  .dk-ed-ab-kopf .kurz { flex: 0 1 auto; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-5); font-size: 14px; font-weight: 400; }
  .dk-ed-ab-kopf .sym { color: var(--tinte-5); transition: transform .12s ease-out; }
  .dk-ed-ab.offen .dk-ed-ab-kopf .sym { transform: rotate(180deg); }
  .dk-ed-ab-inhalt { display: none; padding: 0 16px 14px; gap: 8px; }
  .dk-ed-ab.offen .dk-ed-ab-inhalt { display: grid; }
  .dk-ed-seite p { font-size: 14px; }

  /* Meldungen über der Fußleiste, nicht auf „Speichern“. */
  body:has(.dk-ed-fuss) .oo-meldungen { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Lieferadresse nur für diesen Beleg (EditorLieferblatt, Bauplan B9) ─────── */
/* Seit 17.11.2026 eine Zeile auf dem Blatt unter der Anschrift wie am PC (EditorLieferadresse): Titel und Stand, darunter die Wahl
   weiterer Lieferadressen und die Verweise. Die Felder klappen breit direkt darunter auf, schmal (unten) als Blatt von unten wie das
   Blatt einer Position. */
.dk-ed-liefer { justify-self: stretch; display: grid; justify-items: start; gap: 4px; min-width: 0; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--linie-fein); font-size: 12.5px; }
.dk-ed-liefer-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; max-width: 100%; }
.dk-ed-liefer-titel { color: var(--tinte-4); font-weight: 600; white-space: nowrap; }
.dk-ed-liefer .dk-ed-lf-stand { min-width: 0; color: var(--tinte-2); }
.dk-ed-liefer .dk-ed-lf-stand.blass { color: var(--tinte-5); }
.dk-ed-liefer-wahl { width: min(100%, 360px); }
.dk-ed-liefer .dk-ed-lfblatt { justify-self: stretch; max-width: 460px; }
.dk-ed-lf-stand { overflow-wrap: anywhere; }
.dk-ed-lf-marke { margin-right: 4px; padding: 0 5px; border-radius: 3px; background: var(--warn-grund); color: var(--warn); font-size: 11.5px; white-space: nowrap; }
.dk-ed-lf-aktionen { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; }
.dk-ed-lf-aktionen .dk-ed-verweis:disabled { color: var(--tinte-6); cursor: default; text-decoration: none; }
.dk-ed-lf-schleier, .dk-ed-lf-griff { display: none; }
.dk-ed-lfblatt { display: grid; gap: 8px; min-width: 0; margin-top: 4px; padding: 10px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.dk-ed-lf-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dk-ed-lf-kopf h4 { font-size: 12.5px; font-weight: 600; color: var(--tinte-2); }
.dk-ed-lf-felder { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 6px; }
.dk-ed-lf-feld { display: grid; gap: 2px; min-width: 0; }
.dk-ed-lf-feld.breit { grid-column: 1 / -1; }
.dk-ed-lf-feld > label { color: var(--tinte-4); font-size: 12px; }
.dk-ed-lf-steuer { color: var(--tinte-5); font-size: 12px; }
.dk-ed-lf-steuer.alarm { color: var(--alarm); }
.dk-ed-lf-fuss { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-ed-lf-quellen { display: grid; gap: 4px; margin: 0; padding: 6px 0 0; border-top: 1px solid var(--linie-fein); list-style: none; }
.dk-ed-lf-quellen .dk-ed-verweis { text-align: left; overflow-wrap: anywhere; font-size: 12.5px; }

/* ── Entwurf: Menü der Fußleiste (schmal) ──────────────────────────────────── */
.dk-ed-fuss-mehr { position: relative; flex: 0 0 auto; }
.dk-ed-fuss-schleier { background: transparent; }
.dk-ed-fuss-menue { position: absolute; z-index: 46; right: 0; bottom: calc(100% + 6px); min-width: 220px; padding: 4px; border: 1px solid var(--linie);
  border-radius: 3px; background: var(--flaeche); box-shadow: 0 6px 20px rgba(15, 23, 42, .14); }
.dk-ed-fuss-menue button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent;
  color: var(--tinte-1); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.dk-ed-fuss-menue button:hover { background: var(--auswahl); }

@media (max-width: 760px) {
  /* Breit steht „Als Entwurf speichern“ im Kopf, schmal im Menü der Fußleiste. */
  .dk-ed-kopf #dk-ed-entwurf { display: none; }
  .dk-ed-fuss .kn-haupt { min-width: 112px; }
  .dk-ed-lf-aktionen { font-size: 14px; }
  .dk-ed-liefer { margin-top: 4px; padding-top: 10px; font-size: 14px; }
  .dk-ed-liefer .dk-ed-lfblatt { max-width: none; }
  .dk-ed-lf-schleier { display: block; z-index: 44; }
  .dk-ed-lfblatt { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; width: min(100%, 560px); max-height: calc(100dvh - 40px); margin: 0 auto;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 10px 10px 0 0; overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, .18); }
  .dk-ed-lf-griff { display: block; }
  .dk-ed-lf-kopf { position: sticky; top: 0; z-index: 1; padding: 4px 0 8px; border-bottom: 1px solid var(--linie); background: var(--flaeche); }
  .dk-ed-lf-kopf h4 { font-size: 16px; color: var(--tinte-1); }
  .dk-ed-lf-felder { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  .dk-ed-lf-feld > label { font-size: 13px; }
  .dk-ed-lfblatt :is(.ein, .aus) { height: 44px; font-size: 16px; }
  .dk-ed-lf-steuer { font-size: 13px; }
}

/* ── Rechnung Nachtrag: Bestandssperre, ohne Lagerabgang, Komplettrabatt des Kunden ── */
/* Das Banner hat eigene Klassen (BR-B11): bis 14.11.2026 trug es „dk-ed-bestand“, den Mengenhinweis der Position, und stand darum
   rechtsbündig in 11 px da, der Knopf links. */
.dk-ed-bestandsbanner { gap: 6px; justify-items: start; text-align: left; }
.dk-ed-bestandsbanner-liste { display: grid; gap: 1px; }
/* Der Mengenhinweis „nur 237 von 5000 verfügbar“ steht unter der Menge, rechtsbündig an ihrer Spalte, und läuft nach links unter die
   Bezeichnung: ohne feste Spur zog er die Zelle über die Spalte „Einheit“, die Menge stand versetzt darüber (BR-B11). Die Zeile richtet
   ihre Felder oben aus, damit die Menge auf einer Linie mit den anderen Feldern steht. Nur Zeilen mit diesem Hinweis. */
.dk-ed-z:has(> .menge > .dk-ed-bestand) { align-items: start; }
.dk-ed-z:has(> .menge > .dk-ed-bestand) > [role=cell]:not(.menge) { line-height: 28px; }
.dk-ed-z .menge:has(> .dk-ed-bestand) { grid-template-columns: minmax(0, 1fr); }
.dk-ed-z .menge > .dk-ed-bestand { justify-self: end; white-space: nowrap; line-height: 1.25; }
#dk-ed-ohne-lager-stand { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; }
.dk-ed-komplettrabatt { display: grid; justify-items: start; gap: 2px; margin-top: 4px; color: var(--tinte-4); font-size: 12px; }
.dk-ed-komplettrabatt .dk-ed-verweis { font-size: 12px; text-align: left; }
@media (max-width: 760px) {
  #dk-ed-ohne-lager-stand { grid-auto-flow: row; gap: 2px; }
  .dk-ed-komplettrabatt, .dk-ed-komplettrabatt .dk-ed-verweis { font-size: 14px; }
  .dk-ed-bestand .kn { justify-self: stretch; }
}
