/* Beleg-Editor: rechte Spalte neben dem Blatt mit den Reitern „Produkte | PDF-Entwurf“ (EditorRechts, EditorProduktwahl; Bauplan
   2026-11-17-web-app-beleg-produktspalte-design.md, §9). Steht nur, wenn der Editor breit genug ist (der Rumpf trägt dann „rechts“,
   gesetzt aus oo.js beobachteEditorBreite); darunter gilt oo.dokumente.editor.css unverändert (schmale Spalte unter dem Blatt).
   Vorsatz dk-ed-rechts, dk-ed-reiter, dk-ed-pdf (Spalte, Reiter, PDF-Entwurf) und pw- (Produktliste). Eckig 3 px, Haarlinien, Blau nur
   für den Fokus; der gewählte Reiter weiß auf grauem Grund wie am PC. */

/* Das Blatt geht vor: es wird 940 px breit, sobald Platz ist (sonst rollt die Positionstabelle), die Spalte bekommt den Rest, 360 bis
   480 px (100 % = Inhaltsbreite des Rumpfs, 960 px = Blatt und Abstand). Zwei Klassen schlagen die Regeln der schmalen Fenster. */
.dk-ed-rumpf.rechts { grid-template-columns: minmax(640px, 940px) clamp(360px, 100% - 960px, 480px); padding: 18px 20px 48px; }
.dk-ed-rumpf.rechts .dk-ed-blatt { padding: 26px 36px 30px; }

/* Die Spalte klebt neben dem Blatt und ist so hoch wie die sichtbare Fläche (--dk-ed-sicht setzt oo.js); innen rollt nur die Liste. */
.dk-ed-rechts { position: sticky; top: 18px; display: flex; flex-direction: column; min-width: 0; height: calc(var(--dk-ed-sicht, 100vh) - 36px);
  min-height: 360px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); overflow: hidden; }
.dk-ed-rechts [hidden] { display: none !important; }
.dk-ed-rechts-hinweise { flex: 0 0 auto; display: grid; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--linie); font-size: 12.5px; }

/* Reiter: grauer Grund, der gewählte weiß mit Rand (Arbeitsregel „nicht zu blau“: die Auswahl ist neutral). */
.dk-ed-reiter { flex: 0 0 auto; display: flex; gap: 2px; margin: 10px 12px 0; padding: 2px; border: 1px solid var(--linie); border-radius: 3px;
  background: var(--flaeche-2); }
.dk-ed-reiter button { flex: 1 1 0; min-width: 0; height: 26px; padding: 0 10px; border: 1px solid transparent; border-radius: 2px; background: transparent;
  color: var(--tinte-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-ed-reiter button:hover { color: var(--tinte-1); }
.dk-ed-reiter button.an { border-color: var(--linie-stark); background: var(--flaeche); color: var(--tinte-1); }
.dk-ed-reiter button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.dk-ed-rechts-flaeche { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* ── PDF-Entwurf ──────────────────────────────────────────────────────────── */
.dk-ed-pdf-kopf { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 10px 12px 8px; }
.dk-ed-pdf-stand { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--tinte-5); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-ed-pdf-kopf .kn { height: 26px; padding: 0 8px; font-size: 12.5px; }
.dk-ed-pdf-rahmen { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie);
  background: var(--grund); }
.dk-ed-pdf-leer { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 24px; border-top: 1px solid var(--linie);
  color: var(--tinte-5); text-align: center; overflow-wrap: anywhere; }
.dk-ed-pdf-nach { flex: 0 0 auto; padding: 8px 12px 10px; color: var(--tinte-5); font-size: 12px; overflow-wrap: anywhere; }

/* ── Produktliste ─────────────────────────────────────────────────────────── */
.pw { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pw-kopf { flex: 0 0 auto; display: grid; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--linie); }
.pw-suche { position: relative; display: flex; align-items: center; }
.pw-suche .sym { position: absolute; left: 8px; color: var(--tinte-5); pointer-events: none; }
.pw-suche .ein { padding-left: 28px; }
.pw-typen { display: flex; flex-wrap: wrap; gap: 4px; }
.pw-typ { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--tinte-3); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.pw-typ:hover { color: var(--tinte-1); }
.pw-typ.an { border-color: var(--tinte-3); background: var(--flaeche-2); color: var(--tinte-1); font-weight: 600; }
.pw-typ:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.pw-zahl { color: var(--tinte-5); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.pw-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 150px); gap: 6px; }

.pw-rumpf { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.pw-leer { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; color: var(--tinte-5); text-align: center; }
.pw-zeilen { margin: 0; padding: 0; list-style: none; }
.pw-z { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; min-height: 52px; padding: 7px 12px;
  border-bottom: 1px solid var(--linie); }
.pw-z:hover { background: var(--flaeche-2); }
.pw-z.pw-variante { padding-left: 28px; background: color-mix(in srgb, var(--flaeche-2) 55%, transparent); }
.pw-z.pw-drin { box-shadow: inset 3px 0 0 var(--tinte-4); }
.pw-text { min-width: 0; display: grid; gap: 2px; }
.pw-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-1); font-size: 13px; font-weight: 600; }
.pw-neben { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--tinte-5); font-size: 11.5px; }
.pw-nr { font-family: ui-monospace, Consolas, monospace; color: var(--tinte-4); }
.pw-her { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-bestand { display: inline-flex; align-items: center; gap: 5px; color: var(--tinte-3); font-variant-numeric: tabular-nums; }
.pw-punkt { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ampel-gruen); }
.pw-punkt.gelb { background: var(--ampel-gelb); }
.pw-punkt.orange { background: color-mix(in srgb, var(--ampel-rot) 50%, var(--ampel-gelb)); }
.pw-punkt.rot { background: var(--ampel-rot); }
.pw-im-beleg { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--tinte-3); font-size: 11.5px; font-weight: 600; }
.pw-im-beleg .dk-ed-verweis { font-size: 11.5px; font-weight: 400; }
.pw-aktion { display: flex; align-items: center; gap: 6px; }
.pw-preis { min-width: 0; color: var(--tinte-1); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pw-menge.ein { width: 48px; height: 26px; padding: 0 6px; text-align: right; font-variant-numeric: tabular-nums; }
.pw-plus.kn { width: 28px; height: 26px; padding: 0; }
.pw-var { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--tinte-3); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.pw-var:hover { color: var(--tinte-1); }
.pw-weitere.kn { display: flex; margin: 10px auto 14px; }
.pw-fuss { flex: 0 0 auto; display: flex; align-items: center; min-height: 34px; padding: 6px 12px; border-top: 1px solid var(--linie);
  background: var(--flaeche-2); color: var(--tinte-3); font-size: 12px; overflow: hidden; }
.pw-fuss > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-status { color: var(--tinte-1); }

/* Schmale Spalte (360 bis 400 px): der Preis rückt unter die Menge, damit der Name Platz behält. */
@container dk-ed-rechts (max-width: 400px) {
  .pw-aktion { flex-wrap: wrap; justify-content: flex-end; max-width: 104px; }
  .pw-preis { flex: 1 0 100%; text-align: right; }
}
.dk-ed-rechts { container: dk-ed-rechts / inline-size; }
