/*
 * Drucksachen-Studio — Stilbogen der Maske (Stufe C1b).
 *
 * Eigene Datei und eigene Klassen (`dst-…`) statt Tailwind, aus zwei Gründen:
 * der Tailwind-Bau liest nur `static/index.html` und `static/*.js` — Klassen
 * aus `static/drucksachen/studio.js` sähe er nicht, und sie fehlten ohne
 * Fehlermeldung. Und die Hausfarben sind CSS-Variablen: Deckkraft-Varianten
 * (`bg-brand/10`) greifen darauf nicht, `color-mix` schon.
 *
 * Alles hängt an `.dst` (der Wurzel, die studio.js füllt). Die Haus-Tokens
 * (`--haus-…`) erbt sie von `#lsf-view-karten`; die Vorgaben hier gelten nur,
 * wenn das Studio einmal außerhalb davon steht (Rauchtest).
 *
 * Hausfarbe tragen: Hauptknopf, gewählter Baustein, Kachel-Miniatur. Zustände
 * (gesichert, Überlauf, Entwurf/Freigegeben) behalten die Flow-Farben.
 *
 * Das BLATT selbst wird hier nicht gestaltet — es steht in einem eigenen
 * Rahmen (iframe) mit dem Stilbogen des Renderers.
 */
.dst {
  --dst-tinte: #0f172a;
  --dst-text: #334155;
  --dst-leise: #64748b;
  --dst-blass: #94a3b8;
  --dst-linie: #e2e8f0;
  --dst-linie2: #cbd5e1;
  --dst-grund: #f8fafc;
  --dst-akzent: var(--haus-akzent, #334155);
  --dst-dunkel: var(--haus-dunkel, #0f172a);
  --dst-auf-dunkel: var(--haus-text-auf-dunkel, #fff);
  --dst-creme: var(--haus-creme, #f1f5f9);
  --dst-hell: color-mix(in srgb, var(--dst-akzent) 10%, #fff);
  --dst-rand: color-mix(in srgb, var(--dst-akzent) 35%, #fff);
  color: var(--dst-text);
  font-size: 14px;
  line-height: 1.45;
}
.dst *, .dst *::before, .dst *::after { box-sizing: border-box; }
.dst [hidden] { display: none !important; }
.dst h3, .dst h4, .dst p { margin: 0; }
.dst button { font: inherit; cursor: pointer; }
.dst button:disabled { cursor: not-allowed; opacity: .5; }
.dst :focus-visible { outline: 2px solid var(--dst-akzent); outline-offset: 2px; }

/* ------------------------------------------------------------ Bausteine */
.dst-l { display: block; font-size: 10px; font-weight: 700; color: var(--dst-blass); text-transform: uppercase; letter-spacing: .08em; }
.dst-klein { font-size: 12px; color: var(--dst-leise); }
.dst-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--dst-linie2); background: #fff;
  color: var(--dst-text); font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.dst-knopf:hover:not(:disabled) { background: var(--dst-grund); }
.dst-knopf.dst-haupt { background: var(--dst-dunkel); border-color: var(--dst-dunkel); color: var(--dst-auf-dunkel); }
.dst-knopf.dst-haupt:hover:not(:disabled) { background: var(--dst-dunkel); filter: brightness(1.12); }
.dst-knopf.dst-kleiner { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.dst-knopf.dst-gross { min-height: 46px; padding: 10px 20px; font-size: 15px; border-radius: 10px; }
/* Der zweitstärkste Knopf einer Zeile: Hausfarbe als Rand und Schrift, nicht als Fläche — die gehört dem Hauptknopf. */
.dst-knopf.dst-zweit { border-color: var(--dst-dunkel); color: var(--dst-dunkel); background: #fff; }
.dst-knopf.dst-zweit:hover:not(:disabled) { background: var(--dst-hell); }
.dst-nurleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dst-knopf.dst-weich { border-color: transparent; background: transparent; color: var(--dst-leise); }
.dst-knopf.dst-weich:hover:not(:disabled) { background: #f1f5f9; color: var(--dst-tinte); }
.dst-knopf.dst-strich { border-style: dashed; border-color: var(--dst-rand); color: var(--dst-dunkel); background: transparent; }
.dst-knopf.dst-strich:hover:not(:disabled) { background: var(--dst-hell); }
.dst-knopf.dst-gefahr { border-color: #fecaca; color: #b91c1c; background: #fff; }
.dst-knopf.dst-gefahr:hover:not(:disabled) { background: #fef2f2; }
.dst-link { border: 0; background: none; padding: 0; color: var(--dst-dunkel); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.dst-symbol { color: var(--dst-akzent); }

.dst-marke { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.dst-m-entwurf { background: #f1f5f9; color: #334155; }
.dst-m-frei { background: #d1fae5; color: #065f46; }
.dst-m-wartet { background: #fef3c7; color: #92400e; }
.dst-m-archiv { background: #e0f2fe; color: #075985; }
.dst-m-offen { background: #f1f5f9; color: #64748b; }
.dst-m-kommt { background: #f1f5f9; color: #64748b; }

.dst-hinweis { display: flex; gap: 8px; align-items: flex-start; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; }
.dst-hinweis.dst-rot { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.dst-hinweis.dst-ruhig { border-color: var(--dst-linie); background: var(--dst-grund); color: var(--dst-leise); }
.dst-hinweis.dst-gut { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.dst-hinweis > i { flex: none; margin-top: 2px; }
.dst-kasten { background: #fff; border: 1px solid var(--dst-linie); border-radius: 12px; }

/* ------------------------------------------------------------ Übersicht */
.dst-abschnitt { margin-top: 22px; }
.dst-abschnitt:first-child { margin-top: 0; }
.dst-uebersicht > [data-dst-teil="alt"] > .dst-abschnitt:first-child { margin-top: 22px; }
.dst-abschnitt-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.dst-aufgaben { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.dst-aufgabe {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left;
  background: #fff; border: 2px solid var(--dst-linie); border-radius: 12px; padding: 12px 14px; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
button.dst-aufgabe:hover { border-color: var(--dst-akzent); box-shadow: 0 2px 8px rgb(15 23 42 / .06); }
/* Gewählt = die Liste darunter zeigt nur das. Hausfarbe in Rand, Grund und Zähler; `aria-pressed` sagt es dem Vorleser. */
.dst-aufgabe { position: relative; }
.dst-aufgabe.dst-gewaehlt { border-color: var(--dst-dunkel); background: var(--dst-hell); box-shadow: 0 0 0 1px var(--dst-dunkel); }
.dst-aufgabe .dst-zahl {
  position: absolute; top: 8px; right: 10px; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; line-height: 1;
  background: var(--dst-creme); color: var(--dst-tinte); border: 1px solid var(--dst-rand);
}
.dst-aufgabe.dst-gewaehlt .dst-zahl { background: var(--dst-dunkel); border-color: var(--dst-dunkel); color: var(--dst-auf-dunkel); }
.dst-aufgabe h4 { padding-right: 36px; }
.dst-aufgabe.dst-kommt { background: var(--dst-grund); border-style: dashed; }
.dst-aufgabe.dst-kommt .dst-mini i, .dst-aufgabe.dst-kommt h4 { opacity: .55; }
.dst-aufgabe h4 { font-size: 14px; font-weight: 700; color: var(--dst-tinte); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dst-aufgabe .dst-mass { display: block; font-size: 11.5px; color: var(--dst-leise); margin-top: 1px; }
.dst-aufgabe .dst-bsp { display: block; font-size: 12px; color: var(--dst-text); font-style: italic; margin-top: 3px; }
.dst-mini { width: 64px; height: 64px; display: grid; place-items: center; }
.dst-mini i { display: block; position: relative; background: var(--dst-creme); border: 1px solid var(--dst-rand); box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.dst-mini i.dst-falz-s::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed var(--dst-akzent); }
.dst-mini i.dst-falz-w::after { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px dashed var(--dst-akzent); }
.dst-mini .fa-solid { font-size: 26px; color: var(--dst-blass); }

.dst-suche { min-height: 36px; width: min(100%, 280px); border: 1px solid var(--dst-linie2); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13.5px; background: #fff; color: var(--dst-tinte); }
.dst-zeilen > .dst-zeile { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--dst-linie); }
.dst-zeilen > .dst-zeile:first-child { border-top: 0; }
.dst-zeile > .fa-solid { font-size: 20px; text-align: center; }
.dst-zeile h4 { font-size: 14px; font-weight: 700; color: var(--dst-tinte); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.dst-zeile h4 .dst-titelknopf { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; overflow-wrap: anywhere; }
.dst-zeile h4 .dst-titelknopf:hover { text-decoration: underline; }
.dst-zeile p { font-size: 12px; color: var(--dst-leise); overflow-wrap: anywhere; }
.dst-zeile p a { color: var(--dst-dunkel); font-weight: 600; }
.dst-zeile-kn { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.dst-mehrknopf { display: none; }
.dst-zeile-mehr { display: contents; }
.dst-filterleiste { background: #fff; border: 1px solid var(--dst-rand); border-left: 6px solid var(--dst-dunkel); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; scroll-margin-top: 104px; }
.dst-filter-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.dst-filter-kopf h3 { font-size: 18px; font-weight: 700; color: var(--dst-tinte); overflow-wrap: anywhere; }
.dst-filter-zahl { font-weight: 600; color: var(--dst-leise); }
.dst-filter-tat { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.dst-filter-tat .dst-klein { flex: 1 1 220px; }
.dst .dst-wegweiser { margin-bottom: 8px; }
.dst-leerfeld { padding: 26px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.dst-leerfeld p { font-size: 14.5px; color: var(--dst-text); }
.dst-leer { padding: 18px 16px; color: var(--dst-leise); font-size: 13.5px; }
.dst-klappe > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13.5px; font-weight: 600; color: var(--dst-text); }
.dst-klappe > summary::-webkit-details-marker { display: none; }
.dst-klappe > summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 10px; color: var(--dst-blass); }
.dst-klappe[open] > summary::after { content: "\f077"; }
@media (max-width: 699px) {
  .dst-zeilen > .dst-zeile { grid-template-columns: 26px minmax(0, 1fr); }
  .dst-zeile-kn { grid-column: 1 / -1; justify-content: flex-start; }
  .dst-mehrknopf { display: inline-flex; }
  .dst-zeile-mehr { display: none; }
  .dst-zeile.dst-mehr-auf .dst-zeile-mehr { display: contents; }
  .dst-filter-tat .dst-knopf.dst-gross { width: 100%; }
  .dst-aufgaben { grid-template-columns: 1fr; }
  .dst-suche { width: 100%; }
}

/* --------------------------------------------------------------- Studio */
.dst-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.dst-kopf-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; flex: 1 1 320px; }
.dst-kopf-titel h3 { font-size: 18px; font-weight: 700; color: var(--dst-tinte); min-width: 0; overflow-wrap: anywhere; }
.dst-kopf-titel h3 button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; overflow-wrap: anywhere; }
.dst-kopf-titel h3 button:hover { text-decoration: underline; text-decoration-color: var(--dst-blass); }
.dst-kopf-kn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.dst-stand { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dst-leise); }
.dst-stand.dst-ok { color: #047857; }
.dst-stand.dst-arbeit { color: var(--dst-leise); }
.dst-stand.dst-schlecht { color: #b91c1c; font-weight: 600; }
.dst-menue { position: relative; }
.dst-menue > summary { list-style: none; }
.dst-menue > summary::-webkit-details-marker { display: none; }
.dst-menue-liste { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 260px; max-width: 86vw; background: #fff; border: 1px solid var(--dst-linie); border-radius: 12px; box-shadow: 0 10px 30px rgb(15 23 42 / .15); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.dst-menue-liste button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; color: var(--dst-text); }
.dst-menue-liste button:hover { background: var(--dst-grund); }
.dst-menue-liste button i { width: 16px; text-align: center; color: var(--dst-blass); }

/* Telefon: Umschalter Bausteine · Blatt · Felder. Nur dort sichtbar. */
.dst-tabs { display: none; background: #f1f5f9; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 10px; }
.dst-tabs button { flex: 1 1 0; border: 0; background: transparent; border-radius: 8px; padding: 8px 6px; font-size: 13.5px; font-weight: 700; color: var(--dst-leise); min-height: 40px; }
.dst-tabs button[aria-selected="true"] { background: #fff; color: var(--dst-dunkel); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }

.dst-spalten { display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.dst-sp { background: #fff; border: 1px solid var(--dst-linie); border-radius: 12px; min-width: 0; }
.dst-sp-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 10px 14px; border-bottom: 1px solid var(--dst-linie); }
.dst-sp-kopf h4 { font-size: 13px; font-weight: 700; color: var(--dst-tinte); }
.dst-sp-innen { padding: 10px; }
.dst-sp-liste, .dst-sp-felder { position: sticky; top: var(--dst-oben, 8px); max-height: calc(100vh - var(--dst-oben, 8px) - 8px); display: flex; flex-direction: column; }
.dst-sp-liste > .dst-sp-innen, .dst-sp-felder > .dst-sp-innen { overflow-y: auto; min-height: 0; }
.dst-sp-blatt { position: sticky; top: var(--dst-oben, 8px); }
.dst-listenklappe { display: none; }

/* Tablet: Blatt oben, darunter Bausteinliste (einklappbar) und Felder. */
@media (max-width: 1099px) {
  .dst-spalten { grid-template-columns: 300px minmax(0, 1fr); }
  .dst-sp-blatt { grid-column: 1 / -1; grid-row: 1; position: static; }
  .dst-sp-liste, .dst-sp-felder { position: static; max-height: none; }
  .dst-listenklappe { display: inline-flex; }
  .dst-spalten.dst-liste-zu { grid-template-columns: minmax(0, 1fr); }
  .dst-spalten.dst-liste-zu .dst-sp-liste > .dst-sp-innen { display: none; }
  .dst-spalten.dst-liste-zu .dst-sp-liste { grid-row: 2; }
  .dst-paar { grid-template-columns: 1fr 1fr; }
}
/* Telefon: eine Spalte, der Umschalter wählt sie. */
@media (max-width: 699px) {
  .dst-tabs { display: flex; }
  .dst-spalten, .dst-spalten.dst-liste-zu { grid-template-columns: minmax(0, 1fr); }
  .dst-spalten > .dst-sp { display: none; grid-column: auto; grid-row: auto; }
  .dst-spalten[data-tab="bausteine"] > .dst-sp-liste,
  .dst-spalten[data-tab="blatt"] > .dst-sp-blatt,
  .dst-spalten[data-tab="felder"] > .dst-sp-felder { display: flex; flex-direction: column; }
  .dst-spalten.dst-liste-zu .dst-sp-liste > .dst-sp-innen { display: block; }
  .dst-listenklappe { display: none; }
  .dst-paar { grid-template-columns: 1fr; }
  .dst-kopf-kn { margin-left: 0; width: 100%; }
  .dst-menue-liste { left: 0; right: auto; }
  .dst-kopf-kn .dst-knopf.dst-haupt { margin-left: auto; }
}

/* ------------------------------------------------------- Bausteinliste */
.dst-liste { display: flex; flex-direction: column; gap: 6px; }
.dst-flaeche-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 8px 2px 0; }
.dst-flaeche-kopf:first-child { margin-top: 0; }
.dst-flaeche-kopf .dst-voll { font-size: 11px; color: var(--dst-blass); font-weight: 600; }
.dst-flaeche-kopf .dst-voll.dst-zuviel { color: #b91c1c; }
.dst-bst { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--dst-linie); border-radius: 10px; padding: 6px 6px 6px 6px; background: #fff; text-align: left; cursor: pointer; }
.dst-bst:hover { border-color: var(--dst-linie2); }
.dst-bst.dst-an { border-color: var(--dst-akzent); box-shadow: 0 0 0 1px var(--dst-akzent); }
.dst-bst.dst-ueber { border-color: #fcd34d; background: #fffbeb; }
.dst-bst.dst-zieht { opacity: .45; }
.dst-bst.dst-ziel-oben { box-shadow: 0 -3px 0 0 var(--dst-akzent); }
.dst-bst.dst-ziel-unten { box-shadow: 0 3px 0 0 var(--dst-akzent); }
.dst-griff { color: var(--dst-blass); cursor: grab; text-align: center; font-size: 12px; }
.dst-bst-text { min-width: 0; }
.dst-bst-n { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--dst-tinte); }
.dst-art { display: inline-flex; gap: 3px; align-items: center; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--dst-blass); }
.dst-bst-v { display: block; font-size: 11.5px; color: var(--dst-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dst-bst-v.dst-leerwert { font-style: italic; color: var(--dst-blass); }
.dst-bst-kn { display: flex; gap: 0; }
.dst-bst-kn button { border: 0; background: transparent; color: var(--dst-blass); width: 26px; height: 28px; border-radius: 6px; font-size: 12px; display: inline-grid; place-items: center; }
.dst-bst-kn button:hover:not(:disabled) { background: #f1f5f9; color: var(--dst-tinte); }
.dst-bst-kn button:disabled { opacity: .3; }
.dst-bst .dst-nur-an { display: none; }
.dst-bst.dst-an .dst-nur-an { display: inline-grid; }
.dst-bst.dst-umbruch { background: var(--dst-hell); border-style: dashed; border-color: var(--dst-rand); }
.dst-bst.dst-umbruch .dst-bst-n { color: var(--dst-dunkel); }
.dst-band { border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; border-radius: 8px; padding: 7px 10px; font-size: 12px; display: flex; gap: 8px; align-items: flex-start; }
.dst-band.dst-rot { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.dst-band > i { flex: none; margin-top: 2px; }
.dst-band b { display: block; }

/* ----------------------------------------------------------------- Blatt */
.dst-blatt-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.dst-umsch { display: inline-flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.dst-umsch button { border: 0; background: transparent; border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 600; color: var(--dst-leise); min-height: 28px; }
.dst-umsch button[aria-pressed="true"] { background: #fff; color: var(--dst-dunkel); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.dst-haken { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dst-leise); cursor: pointer; }
.dst-befund { padding: 8px 14px; border-bottom: 1px solid var(--dst-linie); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; min-height: 38px; }
.dst-befund .dst-b-ok { color: #047857; font-weight: 600; }
.dst-befund .dst-b-warn { color: #92400e; font-weight: 600; }
.dst-befund .dst-b-rot { color: #b91c1c; font-weight: 700; }
.dst-befund .dst-b-lauf { color: var(--dst-leise); }
.dst-buehne { background: #e2e8f0; padding: 14px; overflow: auto; border-radius: 0 0 12px 12px; position: relative; }
.dst-rahmen { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 8px 26px rgb(15 23 42 / .22); overflow: hidden; }
.dst-rahmen iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #fff; display: block; }
.dst-seiten { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dst-seiten figure { margin: 0; position: relative; background: #fff; box-shadow: 0 8px 26px rgb(15 23 42 / .22); }
.dst-seiten img { display: block; width: 100%; height: auto; }
.dst-seiten figcaption { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #475569; background: rgb(255 255 255 / .85); padding: 1px 6px; border-radius: 4px; }
.dst-seiten.dst-alt figure { opacity: .55; }
.dst-wird { position: sticky; top: 0; z-index: 3; margin: 0 auto 10px; width: fit-content; background: #0f172a; color: #fff; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- Felder */
.dst-feld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.dst-feld > label, .dst-feld > .dst-l { font-size: 10px; font-weight: 700; color: var(--dst-blass); text-transform: uppercase; letter-spacing: .08em; display: flex; justify-content: space-between; gap: 8px; }
.dst-feld .dst-zaehler { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--dst-blass); }
.dst-feld .dst-zaehler.dst-knapp { color: #b45309; }
.dst-feld input[type="text"], .dst-feld textarea, .dst-feld select {
  width: 100%; border: 1px solid var(--dst-linie2); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px;
  background: #fff; color: var(--dst-tinte); min-height: 36px;
}
.dst-feld textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
.dst-feld input:focus, .dst-feld textarea:focus, .dst-feld select:focus, .dst-fenster input:focus, .dst-fenster textarea:focus, .dst-suche:focus {
  outline: 0; border-color: var(--dst-dunkel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dst-akzent) 25%, transparent);
}
.dst-feld .dst-falsch { border-color: #dc2626 !important; background: #fef2f2 !important; }
.dst-zu { font-size: 11.5px; color: var(--dst-leise); }
.dst-zu.dst-fehler { color: #b91c1c; font-weight: 600; }
.dst-paar { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
.dst-ohne-en .dst-en { display: none; }
.dst-wahl { display: flex; flex-wrap: wrap; gap: 6px; }
.dst-wahl button { border: 2px solid var(--dst-linie); border-radius: 8px; background: #fff; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--dst-text); min-height: 36px; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.dst-wahl button[aria-pressed="true"] { border-color: var(--dst-akzent); color: var(--dst-dunkel); background: var(--dst-hell); }
.dst-wahl.dst-bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.dst-wahl.dst-bilder button { font-size: 11px; padding: 6px 4px; }
.dst-wahl button .dst-bild { width: 100%; height: 40px; display: grid; place-items: center; }
.dst-wahl button .dst-bild img { max-width: 100%; max-height: 40px; display: block; }
.dst-wahl button .dst-muster { width: 44px; height: 30px; border-radius: 3px; border: 1px solid var(--dst-linie2); background: #fff; display: block; background-size: cover; background-position: center; }
.dst-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.dst-chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--dst-linie); border-radius: 8px; padding: 5px 8px; font-size: 12px; color: var(--dst-text); cursor: pointer; min-height: 32px; background: #fff; }
.dst-chip:has(input:checked) { border-color: var(--dst-akzent); background: var(--dst-hell); color: var(--dst-dunkel); }
.dst-chip b { min-width: 16px; color: var(--dst-tinte); }
.dst-chip input { accent-color: var(--dst-dunkel); margin: 0; }
.dst-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dst-preiszeile { display: grid; grid-template-columns: minmax(0, 96px) minmax(0, 1fr) 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.dst-preiszeile .dst-euro { position: relative; }
.dst-preiszeile .dst-euro::after { content: "€"; position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--dst-blass); font-size: 13px; pointer-events: none; }
.dst-preiszeile .dst-euro input { padding-right: 22px; text-align: right; }
.dst-preiszeile button { border: 0; background: none; color: var(--dst-blass); width: 30px; height: 32px; border-radius: 6px; }
.dst-preiszeile button:hover { background: #f1f5f9; color: var(--dst-tinte); }
.dst-schalter { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--dst-text); cursor: pointer; }
.dst-schalter input { width: 18px; height: 18px; accent-color: var(--dst-dunkel); margin: 0; }
.dst-trenn { border: 0; border-top: 1px solid var(--dst-linie); margin: 14px 0 12px; }
.dst-felder-fuss { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- Fenster */
.dst-fenster { position: fixed; inset: 0; z-index: 115; background: rgb(15 23 42 / .6); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.dst-fenster-kasten { background: #fff; border-radius: 16px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .35); width: 100%; max-width: 34rem; margin: 32px 0; color: var(--dst-text); }
.dst-fenster-kasten.dst-breit { max-width: 44rem; }
.dst-fenster-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid #f1f5f9; }
.dst-fenster-kopf h3 { font-size: 18px; font-weight: 700; color: var(--dst-tinte); overflow-wrap: anywhere; }
.dst-fenster-kopf p { font-size: 12px; color: var(--dst-leise); margin-top: 2px; }
.dst-fenster-kopf > button { border: 0; background: none; color: var(--dst-blass); width: 32px; height: 32px; border-radius: 8px; font-size: 18px; flex: none; }
.dst-fenster-kopf > button:hover { background: #f1f5f9; color: var(--dst-tinte); }
.dst-fenster-inhalt { padding: 16px 24px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.dst-fenster-inhalt input[type="text"], .dst-fenster-inhalt textarea { width: 100%; border: 1px solid var(--dst-linie2); border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 14px; color: var(--dst-tinte); min-height: 38px; }
.dst-fenster-fuss { padding: 14px 24px 18px; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dst-ruhe { background: #ecfdf5; color: #065f46; border-radius: 8px; padding: 8px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.dst-typen { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.dst-typen button { text-align: left; border: 2px solid var(--dst-linie); border-radius: 10px; padding: 10px; background: #fff; display: flex; flex-direction: column; gap: 3px; color: inherit; }
.dst-typen button:hover:not(:disabled) { border-color: var(--dst-akzent); }
.dst-typen h4 { font-size: 13.5px; font-weight: 700; color: var(--dst-tinte); display: flex; gap: 7px; align-items: center; }
.dst-typen h4 i { color: var(--dst-akzent); width: 16px; text-align: center; }
.dst-typen p { font-size: 11.5px; color: var(--dst-leise); }
.dst-typen .dst-rest { font-size: 11px; font-weight: 600; color: var(--dst-blass); }
.dst-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dst-profile button { text-align: left; border: 2px solid var(--dst-linie); border-radius: 12px; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 5px; color: inherit; }
.dst-profile button[aria-pressed="true"] { border-color: var(--dst-dunkel); background: var(--dst-hell); }
.dst-profile h4 { font-size: 15px; font-weight: 700; color: var(--dst-tinte); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dst-profile h4 > i { color: var(--dst-akzent); }
.dst-profile p { font-size: 12.5px; color: var(--dst-leise); }
.dst-schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.dst-schritte li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.dst-schritte li > i { flex: none; margin-top: 3px; width: 16px; text-align: center; }
.dst-gut { color: #047857; } .dst-warn { color: #b45309; } .dst-schlecht { color: #b91c1c; } .dst-lauf { color: var(--dst-blass); }
.dst-probe { background: #e2e8f0; border-radius: 10px; padding: 10px; display: flex; gap: 10px; justify-content: center; overflow-x: auto; }
.dst-probe img { display: block; max-height: 230px; width: auto; max-width: 100%; box-shadow: 0 4px 14px rgb(15 23 42 / .2); background: #fff; }
.dst-revisionen { display: flex; flex-direction: column; }
.dst-revisionen .dst-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--dst-linie); }
.dst-revisionen .dst-zeile:first-child { border-top: 0; }
.dst-rev-blatt { background: #e2e8f0; border-radius: 10px; padding: 10px; overflow: auto; max-height: 60vh; }
@media (max-width: 560px) {
  .dst-profile { grid-template-columns: 1fr; }
  .dst-fenster { padding: 8px; }
  .dst-fenster-kopf, .dst-fenster-inhalt, .dst-fenster-fuss { padding-left: 16px; padding-right: 16px; }
}

/* ---------------------------------------------------------------- Meldung */
.dst-meldung { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; max-width: min(92vw, 560px); background: #0f172a; color: #fff; font-size: 13.5px; padding: 9px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgb(15 23 42 / .3); display: flex; align-items: center; gap: 12px; }
.dst-meldung.dst-fehler { background: #b91c1c; }
.dst-meldung button { border: 1px solid rgb(255 255 255 / .45); background: rgb(255 255 255 / .1); color: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.dst-meldung button:hover { background: rgb(255 255 255 / .22); }
.dst-nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Stufe C2: Druckbogen wählen und ansehen */
.dst-wahl.dst-bogen { display: grid; grid-template-columns: 1fr; }
.dst-wahl.dst-bogen button { flex-direction: row; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; }
.dst-wahl.dst-bogen button b { display: block; font-size: 12.5px; }
.dst-wahl.dst-bogen button small { display: block; font-weight: 400; font-size: 11.5px; color: var(--dst-leise, #64748b); line-height: 1.35; margin-top: 2px; }
.dst-bogenbild { flex: 0 0 auto; display: grid; box-sizing: border-box; background: #fff; border: 1px solid var(--dst-linie2); }
.dst-bogenbild i { display: block; background: var(--dst-hell, #e2e8f0); outline: 1px solid var(--dst-linie2); }
.dst-probe.dst-probe-bogen img { max-height: 340px; }

/* ------------------------------------------- Gericht aus der Hauptkarte */
/* Marke am Baustein: woher das Gericht kommt. Ruhig — sie ist eine Auskunft,
 * kein Alarm. Amber wird es erst, wenn die Hauptkarte abweicht. */
.dst-art.dst-hk { color: #075985; text-transform: none; letter-spacing: 0; font-size: 10.5px; font-weight: 600; }
.dst-art.dst-hk-weg { color: var(--dst-leise); text-transform: none; letter-spacing: 0; font-size: 10.5px; font-weight: 600; font-style: italic; }
.dst-band.dst-band-hk { align-items: center; }
.dst-band.dst-band-hk > span { flex: 1 1 auto; min-width: 0; }
.dst-band.dst-band-hk .dst-knopf, .dst-hk-sammel .dst-knopf, .dst-hk-box .dst-knopf { flex: none; border-color: #f59e0b; color: #92400e; background: #fff; }
/* Die Bausteinspalte ist schmal: der Knopf rutscht unter den Satz, statt ihn auf drei Wörter je Zeile zu quetschen. */
.dst-hk-sammel { flex-wrap: wrap; margin-bottom: 4px; }
.dst-hk-sammel > span { flex: 1 1 170px; min-width: 0; }
.dst-hk-sammel .dst-knopf { margin-left: auto; }
.dst-hk-fusszeile { margin-top: 8px; }
.dst-hk-kopfort:empty { display: none; }
.dst-hk-kopfort { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.dst-hk-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--dst-text); }
.dst-hk-zeile .dst-hk-t { min-width: 0; overflow-wrap: anywhere; }
.dst-hk-zeile .dst-hk-kn { display: flex; flex-wrap: wrap; gap: 4px 12px; flex: 1 0 100%; font-size: 12px; }
.dst-hk-box { align-items: flex-start; }
.dst-hk-box > span { flex: 1 1 auto; min-width: 0; }
.dst-hk-box b { display: inline; }
.dst-hk-diff { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.dst-hk-diff li { overflow-wrap: anywhere; }
.dst-hk-diff .dst-hk-f { font-weight: 700; margin-right: 2px; }
.dst-hk-diff s { opacity: .75; }
.dst-hk-diff i { font-size: 10px; margin: 0 2px; }
.dst-hk-note:empty { display: none; }
.dst-hk-note b { color: var(--dst-tinte); font-weight: 600; }
.dst-hk-wegsatz { font-style: italic; }
.dst-typen button.dst-typ-vorgabe { border-color: var(--dst-rand); background: var(--dst-hell); }

/* Das Fenster „Aus der Hauptkarte": Suche oben, Liste in eigenem Rollfeld —
 * der Knopf „n Gerichte einfügen" bleibt so immer zu sehen, auch am Telefon. */
.dst-hk-kopf { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.dst-hk-kopf .dst-suche { flex: 1 1 220px; width: auto; min-height: 40px; }
.dst-hk-liste { border: 1px solid var(--dst-linie); border-radius: 10px; max-height: min(50vh, 520px); overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.dst-hk-abschnitt + .dst-hk-abschnitt { border-top: 1px solid var(--dst-linie); }
.dst-hk-abk { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 7px 12px; background: var(--dst-grund); border-bottom: 1px solid var(--dst-linie); }
.dst-hk-abk h4 { font-size: 12.5px; font-weight: 700; color: var(--dst-tinte); overflow-wrap: anywhere; }
.dst-hk-abk h4 small { font-weight: 400; font-style: italic; color: var(--dst-leise); margin-left: 4px; }
.dst-hk-teil { padding: 7px 12px 2px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--dst-leise); }
.dst-hk-teil small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.dst-hk-g { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center; width: 100%; min-height: 44px; padding: 6px 12px; border: 0; border-top: 1px solid #f1f5f9; background: #fff; text-align: left; color: inherit; cursor: pointer; font: inherit; }
button.dst-hk-g { grid-template-columns: minmax(0, 1fr) auto auto; }
.dst-hk-abk + .dst-hk-g, .dst-hk-teil + .dst-hk-g { border-top: 0; }
.dst-hk-g:hover { background: var(--dst-grund); }
.dst-hk-g.dst-an { background: var(--dst-hell); }
.dst-hk-g:has(input:disabled) { cursor: not-allowed; opacity: .5; }
.dst-hk-g input { width: 18px; height: 18px; margin: 0; accent-color: var(--dst-dunkel); }
.dst-hk-text { min-width: 0; display: flex; flex-direction: column; }
.dst-hk-text b { font-size: 13.5px; font-weight: 600; color: var(--dst-tinte); overflow-wrap: anywhere; }
.dst-hk-text small { font-size: 11.5px; color: var(--dst-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dst-hk-text small.dst-hk-hin { white-space: normal; font-style: italic; }
.dst-hk-text small.dst-hk-warn { color: #92400e; font-style: normal; }
.dst-hk-preis { font-size: 12.5px; color: var(--dst-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dst-hk-nr { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--dst-dunkel); color: var(--dst-auf-dunkel); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dst-hk-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 0; }
.dst-hk-fuss:empty { display: none; }
.dst-hk-vgl { border: 1px solid var(--dst-linie); border-radius: 10px; overflow: hidden; font-size: 13px; }
.dst-hk-vgl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 7px 12px; border-top: 1px solid var(--dst-linie); overflow-wrap: anywhere; }
.dst-hk-vgl > div:first-child { border-top: 0; }
.dst-hk-vgl .dst-hk-vk { background: var(--dst-grund); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--dst-blass); }
@media (max-width: 560px) {
  .dst-hk-preis { grid-column: 2 / -1; }
  button.dst-hk-g .dst-hk-preis { grid-column: 1 / -1; }
  .dst-hk-g { padding: 8px 10px; }
  .dst-hk-vgl > div { grid-template-columns: 1fr; gap: 2px; }
  .dst-hk-vgl .dst-hk-vk { display: none; }
  .dst-hk-liste { max-height: 46vh; }
}

/* ------------------------------------------------- Anzeigen und Größe */
.dst-anz { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dst-zu.dst-aus { color: #92400e; }
.dst-ganz { margin: 0 0 12px; border: 1px solid var(--dst-linie); border-radius: 10px; padding: 2px 10px; }
.dst-ganz > summary { font-size: 12.5px; padding: 6px 0; }
.dst-ganz-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 6px 10px; align-items: center; padding: 2px 0 10px; font-size: 12.5px; }
.dst-ganz-raster select { width: 100%; min-height: 34px; border: 1px solid var(--dst-linie2); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; background: #fff; color: var(--dst-tinte); }
.dst-befund .dst-b-ruhig { color: var(--dst-leise); }
