/* Gerätetafeln — Oberfläche (UI-Standard 1.4, Bausteine /shared/ v1)
 *
 * Schiefergrau #475569 als Akzent. Kontrast berechnet nach WCAG 2.2 (relative Luminanz):
 *   weiß auf Kopf #475569 ........ 7,58 : 1   Zweittext #E6F2FA darauf 6,66 : 1
 *   weiß auf Kopf dunkel #1E293B .. 14,63 : 1
 *   Text #1F2937 auf #F8FAFC ...... 14,0 : 1   Zweittext #4B5563 auf #F8FAFC 7,22 : 1
 *   Marken (Text auf Fläche), hell:   Entwurf #1E293B/#E2E8F0 11,87 · zur Quittung #78350F/#FEF3C7 8,15
 *                                     freigegeben #14532D/#DCFCE7 8,30 · archiviert #475569/#F1F5F9 6,92
 *   Marken dunkel:                    Entwurf #F1F5F9/#334155 9,45 · zur Quittung #FDE68A/#422006 11,70
 *                                     freigegeben #86EFAC/#052E16 10,62 · archiviert #CBD5E1/#1E293B 9,85
 * Kopf, Seitenleiste, Glocke, Tabelle und Ansicht kommen aus /shared/ und werden hier nur eingefärbt.
 */

:root {
  --gt-akzent: #475569;
  --gt-bg: #F8FAFC;
  --gt-karte: #FFFFFF;
  --gt-text: #1F2937;
  --gt-text2: #4B5563;
  --gt-rand: #CBD5E1;
  --gt-link: #0070B0;
  --gt-fokus: #0070B0;
  --gt-feld: #FFFFFF;
  --gt-feldrand: #64748B;
  --gt-haupt-bg: #475569;
  --gt-haupt-text: #FFFFFF;
  --gt-warn-bg: #FFF4E5;
  --gt-warn-text: #7A3E00;
  --gt-fehler-bg: #FEE4E2;
  --gt-fehler-text: #912018;
  --gt-ok-bg: #DCFCE7;
  --gt-ok-text: #14532D;
  --gt-m-entwurf-bg: #E2E8F0;   --gt-m-entwurf-text: #1E293B;
  --gt-m-quittung-bg: #FEF3C7;  --gt-m-quittung-text: #78350F;
  --gt-m-frei-bg: #DCFCE7;      --gt-m-frei-text: #14532D;
  --gt-m-archiv-bg: #F1F5F9;    --gt-m-archiv-text: #475569;

  /* Baustein-Variablen: Kopf und Seitenleiste in Schiefergrau */
  --ok-kopf-bg: #475569;
  --ok-kopf-text2: #E6F2FA;
  --ok-kopf-linie: #64748B;
  --ok-kopf-hover: #334155;
  --ok-sl-aktiv-bg: #475569;
}
:root[data-theme="dark"], html.dark {
  --gt-bg: #0F172A;
  --gt-karte: #1E293B;
  --gt-text: #E5E7EB;
  --gt-text2: #CBD5E1;
  --gt-rand: #334155;
  --gt-link: #7CC4F2;
  --gt-fokus: #7CC4F2;
  --gt-feld: #0B1220;
  --gt-feldrand: #8A9BB3;
  --gt-haupt-bg: #94A3B8;      /* Text #0F172A darauf 6,96 : 1 */
  --gt-haupt-text: #0F172A;
  --gt-warn-bg: #422006;
  --gt-warn-text: #FDE68A;
  --gt-fehler-bg: #3A0D0A;
  --gt-fehler-text: #FDA29B;
  --gt-ok-bg: #052E16;
  --gt-ok-text: #86EFAC;
  --gt-m-entwurf-bg: #334155;   --gt-m-entwurf-text: #F1F5F9;
  --gt-m-quittung-bg: #422006;  --gt-m-quittung-text: #FDE68A;
  --gt-m-frei-bg: #052E16;      --gt-m-frei-text: #86EFAC;
  --gt-m-archiv-bg: #1E293B;    --gt-m-archiv-text: #CBD5E1;

  --ok-kopf-bg: #1E293B;
  --ok-kopf-text2: #CBD5E1;
  --ok-kopf-linie: #475569;
  --ok-kopf-hover: #334155;
  --ok-sl-aktiv-bg: #475569;
}
:root { --ok-sl-breite: 208px; }   /* UI-Standard §3: Leiste 176 bis 216 px */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--gt-bg);
  color: var(--gt-text);
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--osp-schrift, 14px);
  line-height: var(--osp-zeilenabstand, 1.4);
}
h1, h2, h3 { font-family: 'Montserrat', 'Open Sans', system-ui, sans-serif; font-weight: 700; color: var(--gt-text); }
h1 { font-size: 1.35em; margin: 0; line-height: 1.2; }
h2 { font-size: 1.1em; margin: 0 0 6px; }
p { margin: 0 0 6px; }
code, kbd { font-family: 'Fira Code', ui-monospace, Consolas, monospace; font-size: .92em; }
a { color: var(--gt-link); }

:focus-visible { outline: 3px solid var(--gt-fokus); outline-offset: 2px; }
/* Seitentitel wird nach dem Routenwechsel nur programmatisch fokussiert (nicht bedienbar): kein Rahmen */
.gt-kopfzeile h1:focus, .gt-kopfzeile h1:focus-visible { outline: none; }

.gt-sprungmarke { position: absolute; left: -9999px; top: 0; background: var(--gt-haupt-bg); color: var(--gt-haupt-text); padding: 10px 16px; z-index: 300; }
.gt-sprungmarke:focus { left: 8px; top: 8px; }
.gt-noscript { padding: 16px; }

/* Kopf: Schiefergrau; Versions-Pille liest sich auf dem Kopf (news-badge.css) */
header[data-osp-kopf="v1"] .hdr-version-pill { height: 24px; padding: 0 8px; font-size: 12px; color: var(--ok-kopf-text); }
header[data-osp-kopf="v1"] .hdr-version-pill:focus-visible { outline: 3px solid var(--ok-kopf-fokus); }

/* ── Hauptfläche: Kopf 56 px, daneben die Seitenleiste (fixed) ───────── */
.gt-haupt {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--ok-kopf-h, 56px));
  height: calc(100dvh - var(--ok-kopf-h, 56px));
  padding: 10px 16px 12px;
  outline: none;
}
/* Gescrollt wird nur der Inhaltsbereich (UI-Standard §2); Tabellen-Ansichten füllen ihn und scrollen in sich */
.gt-ansicht { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; gap: 8px; overflow-y: auto; }
.gt-kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; min-height: 36px; }
.gt-kopfzeile h1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gt-kopfzeile h1 svg { flex: 0 0 auto; color: var(--gt-text2); }
.gt-kopfzeile .gt-zusatz { color: var(--gt-text2); font-weight: 400; font-family: 'Open Sans', system-ui, sans-serif; font-size: .9em; }

/* Knöpfe */
.gt-knopf, .gt-haupt-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; min-width: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--gt-feldrand);
  background: var(--gt-feld); color: var(--gt-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.gt-knopf:hover { background: var(--gt-bg); border-color: var(--gt-akzent); }
/* nicht verfügbar: gestrichelter Rand, Zweittext auf ruhigem Grund (Kontrast ≥ 4,5 : 1, P-18) statt blasser Deckkraft */
.gt-knopf[disabled], .gt-haupt-knopf[disabled], .gt-knopf[aria-disabled="true"] { background: var(--gt-bg); color: var(--gt-text2); border: 1px dashed var(--gt-feldrand); cursor: not-allowed; }
/* Hinweisfarbe für „Indexvergleich: n Abweichungen“ (Paar der Warnfläche, ≥ 7 : 1) */
.gt-knopf--warn { background: var(--gt-warn-bg); color: var(--gt-warn-text); border-color: var(--gt-warn-text); }
.gt-knopf--warn:hover { background: var(--gt-warn-bg); filter: brightness(.96); }
.gt-knopf--leise { border-color: transparent; background: transparent; color: var(--gt-link); text-decoration: underline; text-underline-offset: 3px; }
.gt-haupt-knopf { background: var(--gt-haupt-bg); border-color: var(--gt-haupt-bg); color: var(--gt-haupt-text); }
.gt-haupt-knopf:hover { filter: brightness(1.1); }
.gt-haupt-knopf svg, .gt-knopf svg { flex: 0 0 auto; }

/* Tabelle der Anweisungen: füllt den Rest der Fläche, scrollt in sich */
.gt-tabelle { position: relative; flex: 1 1 auto; min-height: 240px; border: 1px solid var(--gt-rand); border-radius: 10px; overflow: hidden; background: var(--gt-karte); }
.gt-tabelle .ot { position: absolute; inset: 0; }
.gt-tabelle > .gt-leer { position: absolute; inset: 0; justify-content: center; }
.gt-tabelle a.gt-zeilenlink { display: inline-flex; align-items: center; min-height: 24px; color: var(--gt-link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.gt-tabelle .ot-z .gt-nummer-leer { color: var(--gt-text2); }

/* Status-Marken (Symbol + Wort, Farbe nie allein) */
.gt-marke {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: .86em; font-weight: 600; line-height: 1.2; white-space: nowrap;
  background: var(--gt-m-entwurf-bg); color: var(--gt-m-entwurf-text);
}
.gt-marke svg { width: 13px; height: 13px; flex: 0 0 auto; }
.gt-marke--entwurf  { background: var(--gt-m-entwurf-bg);  color: var(--gt-m-entwurf-text); }
.gt-marke--quittung { background: var(--gt-m-quittung-bg); color: var(--gt-m-quittung-text); }
.gt-marke--freigegeben { background: var(--gt-m-frei-bg);  color: var(--gt-m-frei-text); }
.gt-marke--archiviert { background: var(--gt-m-archiv-bg); color: var(--gt-m-archiv-text); border: 1px solid var(--gt-rand); }
.gt-marke--zurueckgenommen { background: var(--gt-fehler-bg); color: var(--gt-fehler-text); }
.gt-marke--an  { background: var(--gt-m-frei-bg);   color: var(--gt-m-frei-text); }
.gt-marke--aus { background: var(--gt-m-archiv-bg); color: var(--gt-m-archiv-text); border: 1px solid var(--gt-rand); }

/* Karten und Hinweise */
.gt-karte { background: var(--gt-karte); border: 1px solid var(--gt-rand); border-radius: 10px; padding: 12px 14px; }
.gt-karte + .gt-karte { margin-top: 8px; }
.gt-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; align-items: start; }
.gt-hinweis { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--gt-warn-bg); color: var(--gt-warn-text); border: 1px solid transparent; }
.gt-hinweis svg { flex: 0 0 auto; margin-top: 2px; }
.gt-hinweis--fehler { background: var(--gt-fehler-bg); color: var(--gt-fehler-text); }
.gt-hinweis--ok { background: var(--gt-ok-bg); color: var(--gt-ok-text); }
.gt-hinweis .gt-knopf { margin-left: auto; flex: 0 0 auto; }
.gt-leer { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--gt-text2); }
.gt-leer svg { color: var(--gt-text2); }
.gt-leer p { margin: 0; max-width: 46ch; }

/* Anmelde-/Meldungsleiste über der Ansicht */
.gt-leiste { margin: 0 0 8px; }

/* Schutzklasse: im Titelbereich jeder Anweisung und in der Hilfe */
.gt-schutz { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: 12px; font-size: .86em; font-weight: 600; background: var(--gt-warn-bg); color: var(--gt-warn-text); }
.gt-schutz svg { width: 13px; height: 13px; }

/* Label-Wert-Zeilen */
.gt-daten { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.gt-daten dt { color: var(--gt-text2); font-weight: 600; }
.gt-daten dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Platzhalter für Editor (AP-7) und Abweichungsbericht (AP-9) */
.gt-platzhalter { border: 1px dashed var(--gt-feldrand); border-radius: 10px; padding: 12px 14px; background: var(--gt-karte); }
.gt-platzhalter h2 { display: flex; align-items: center; gap: 8px; }
.gt-platzhalter p { color: var(--gt-text2); margin: 0; }

/* Upload */
.gt-upload { display: flex; flex-direction: column; gap: 10px; max-width: 880px; }
.gt-feldgruppe { display: grid; grid-template-columns: 1fr; gap: 6px; }
.gt-zone {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border: 2px dashed var(--gt-feldrand); border-radius: 10px; background: var(--gt-karte);
}
.gt-zone.gt-zone--drop { border-color: var(--gt-link); background: var(--gt-bg); }
.gt-zone-titel { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 190px; }
.gt-zone-titel .gt-pflicht { color: var(--gt-text2); font-weight: 400; font-size: .9em; }
.gt-zone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gt-zone input[type="file"]:focus-visible + label.gt-knopf { outline: 3px solid var(--gt-fokus); outline-offset: 2px; }
.gt-dateien { flex: 1 1 200px; min-width: 0; color: var(--gt-text2); margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.gt-dateien li { display: flex; align-items: center; gap: 8px; min-height: 24px; overflow-wrap: anywhere; }
.gt-dateien button { min-width: 24px; min-height: 24px; padding: 0; border: 0; background: transparent; color: var(--gt-link); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.gt-fortschritt { display: flex; align-items: center; gap: 10px; }
.gt-balken { flex: 1 1 auto; height: 10px; border-radius: 5px; background: var(--gt-rand); overflow: hidden; }
.gt-balken > i { display: block; height: 100%; width: 0; background: var(--gt-haupt-bg); transition: width .2s ease; }
.gt-fortschritt output { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.gt-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Textfeld (Artikelnummer) */
.gt-zone--feld { border-style: solid; }
.gt-feld { min-height: 36px; width: 14em; padding: 0 10px; border: 1px solid var(--gt-feldrand); border-radius: 8px; background: var(--gt-feld); color: var(--gt-text); font: inherit; font-family: 'Fira Code', ui-monospace, Consolas, monospace; }
.gt-feld::placeholder { color: var(--gt-text2); opacity: 1; }
.gt-feld:focus-visible { outline: 3px solid var(--gt-fokus); outline-offset: 2px; }

/* Hilfe */
.gt-schritte { margin: 0; padding: 0; list-style: none; counter-reset: schritt; display: grid; gap: 8px; }
.gt-schritte li { counter-increment: schritt; display: flex; align-items: center; gap: 12px; }
.gt-schritte li::before {
  content: counter(schritt); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--gt-haupt-bg); color: var(--gt-haupt-text); font-weight: 700;
}
.gt-schritte svg { flex: 0 0 auto; color: var(--gt-text2); }
.gt-liste { margin: 0; padding-left: 20px; }
.gt-liste li + li { margin-top: 4px; }

/* Ansicht-Panel unter dem Kopf */
.gt-ansicht-panel {
  position: fixed; top: calc(var(--ok-kopf-h, 56px) + 6px); right: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px; min-width: 260px; padding: 12px 14px;
  background: var(--gt-karte); color: var(--gt-text); border: 1px solid var(--gt-rand); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.gt-ansicht-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gt-ansicht-label { font-weight: 600; }
.gt-wahl { display: inline-flex; border: 1px solid var(--gt-feldrand); border-radius: 8px; overflow: hidden; }
.gt-wahl button { min-height: 32px; min-width: 28px; padding: 0 12px; border: 0; background: var(--gt-feld); color: var(--gt-text); font: inherit; cursor: pointer; }
.gt-wahl button + button { border-left: 1px solid var(--gt-feldrand); }
.gt-wahl button[aria-pressed="true"] { background: var(--gt-haupt-bg); color: var(--gt-haupt-text); font-weight: 600; }

/* Neuigkeiten */
.gt-dialog { max-width: 460px; width: calc(100% - 32px); padding: 16px 18px; border: 1px solid var(--gt-rand); border-radius: 10px; background: var(--gt-karte); color: var(--gt-text); }
.gt-dialog::backdrop { background: rgba(0, 0, 0, .45); }
/* Modale Dialoge unter dem Kopf (Controller P4/N5): das Feedback-Widget hängt seinen Kamera-Knopf in den obersten
   Dialog und setzt ihn auf die Kopfmitte. Reicht der Dialog bei 150 % in den Kopf, läge der Knopf auf der Dialogkante. */
.gt-dialog:modal { top: calc(var(--ok-kopf-h, 56px) + 8px); bottom: 8px;
  max-height: calc(100vh - var(--ok-kopf-h, 56px) - 16px); max-height: calc(100dvh - var(--ok-kopf-h, 56px) - 16px); }
.gt-dialog h3 { margin: 10px 0 4px; font-size: 1em; }
.gt-dialog ul { margin: 0 0 6px; padding-left: 20px; }
.gt-dialog .gt-knopf { margin-top: 10px; }

@media (max-width: 1023px) {
  .gt-haupt { padding: 8px 12px 12px; }
}
/* Die Feedback-Kamera steht fest in der Kopfmitte: die linke Gruppe (Zurück, Name, Pfad) endet davor, der Pfad kürzt mit Ellipse (B-11).
 * 21 px = halbe Kamera (17) + 4 px Abstand, 12 px = Innenabstand des Kopfes links. */
header[data-osp-kopf="v1"] .okopf-links { max-width: calc(50vw - 33px); }
/* Nummern und Einwort-Glieder (Kopf: .okopf-nummer) und das erste Glied werden nie gekürzt — es kürzt das letzte, längere Glied */
header[data-osp-kopf="v1"] .okopf-krumen li.okopf-nummer, header[data-osp-kopf="v1"] .okopf-krumen li:first-child { flex-shrink: 0; }
/* Schmale Fenster: Rollen-Chip und Uhr weichen der Feedback-Kamera in der Kopfmitte (sie wandert nie) */
@media (max-width: 1000px) {
  #gt-rolle, header[data-osp-kopf="v1"] .okopf-uhr { display: none; }
  /* Die Kamera steht fest in der Fenstermitte: App-Name und Versions-Pille rücken zusammen, damit der Pfad davor endet (B-11) */
  header[data-osp-kopf="v1"] .okopf-app { font-size: 16px; }
  header[data-osp-kopf="v1"] .okopf-links { gap: 6px; }
  header[data-osp-kopf="v1"] .hdr-version-pill { padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .gt-balken > i { transition: none; }
}
@media print {
  .gt-ansicht-panel, .gt-sprungmarke { display: none !important; }
}

/* ══ Editor, Freigabe, Archiv (AP-7) ══════════════════════════════════════════
 * Schrittliste, Schrittbild und Vorgaben stehen gleichzeitig im Blick (P-14, 1640×650 und 1366×768 ohne Scrollen der Seite):
 * die Editor-Fläche füllt die Höhe unter dem Kopf, jede der drei Spalten scrollt bei Bedarf in sich.
 * Kontraste: Chips nutzen die Paare der Marken (Text auf Fläche ≥ 7 : 1, siehe Kopf der Datei); Rahmenfarben tragen nie allein eine Aussage,
 * jede Marke hat ein Wort. Fokus: 3 px --gt-fokus (≥ 3 : 1 gegen die Fläche).
 */
.gt-ed-aktiv > .gt-karte { display: none; }              /* Artikel und Bezeichnung stehen im Kopf des Editors */
.gt-ed { background: var(--gt-karte); border: 1px solid var(--gt-rand); border-radius: 10px; padding: 6px 12px 6px;
  display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto;
  height: calc(100vh - var(--ok-kopf-h, 56px) - 70px); height: calc(100dvh - var(--ok-kopf-h, 56px) - 70px); min-height: 400px; }
.gt-ed-titel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gt-ed-nur-lesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
.gt-ed-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; flex: 0 0 auto; }
.gt-ed-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.gt-ed-name { font-weight: 600; overflow-wrap: anywhere; }
.gt-ed-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 11px; font-size: .82em; font-weight: 600; background: var(--gt-m-entwurf-bg); color: var(--gt-m-entwurf-text); white-space: nowrap; }
.gt-ed-chip--warn { background: var(--gt-warn-bg); color: var(--gt-warn-text); }
.gt-ed-chip--ok { background: var(--gt-ok-bg); color: var(--gt-ok-text); }
.gt-ed-chip--fehler { background: var(--gt-fehler-bg); color: var(--gt-fehler-text); }
/* P3: Wert aus der Siemens-PMI (gelb nach S-2); fester Gelbton wie die Drehmoment-Plakette, Text dunkel (≥ 7 : 1 in Hell und Dunkel) */
.gt-ed-chip--pmi { background: #FACC15; color: #1F1A00; }
/* Chip als Knopf (STEP zum JT): gleiche Form, mit Rahmen und Zeiger; Fokus über den globalen :focus-visible */
.gt-ed-chip--knopf { min-height: 24px; border: 1px solid var(--gt-text2); cursor: pointer; font: inherit; font-size: .82em; font-weight: 600; }
.gt-ed-gelb .gt-ed-sprung-nr { min-width: 24px; min-height: 24px; padding: 0 2px; margin-right: -4px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; } .gt-ed-gelb .gt-ed-sprung-nr:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.gt-ed-gelb .gt-ed-handlung { font-weight: 400; } .gt-ed-gelb details { margin: 2px 0 4px; } .gt-ed-gelb summary { cursor: pointer; font-weight: 600; }
.gt-ed-chip--knopf:hover { filter: brightness(.95); }
.gt-ed-step-unten { display: none; }
.gt-ed-raster { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) minmax(280px, 320px); gap: 10px; }
.gt-ed-raster > * { min-height: 0; }
.gt-ed-links { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
/* position: relative hält versteckte Lesetexte (.gt-ed-nur-lesen, absolut) im Zuschnitt der Spalte — sonst scrollt die ganze Seite (B1) */
.gt-ed-liste { position: relative; flex: 1 1 0; min-height: 0; overflow-y: auto; border: 1px solid var(--gt-rand); border-radius: 8px; }
.gt-ed-schritte { list-style: none; margin: 0; padding: 0; }
.gt-ed-schritte li + li { border-top: 1px solid var(--gt-rand); }
.gt-ed-schritt { scroll-margin-top: 40px; display: grid; grid-template-columns: 26px 1fr; gap: 2px 6px; width: 100%; text-align: left; padding: 6px 8px; min-height: 40px; border: 0; background: transparent; color: var(--gt-text); font: inherit; cursor: pointer; }
.gt-ed-schritt:hover { background: var(--gt-bg); }
.gt-ed-schritt.ist-aktiv { background: var(--gt-haupt-bg); color: var(--gt-haupt-text); }
.gt-ed-schritt.ist-aktiv .gt-ed-chip { outline: 1px solid var(--gt-haupt-text); }
.gt-ed-schritt .nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.gt-ed-schritt .ti { overflow-wrap: anywhere; line-height: 1.25; }
.gt-ed-schritt .marken { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; }
/* Gruppen als Abschnitte der Schrittliste (Plan DR-Folge AP-1) */
.gt-ed-abschnitt + .gt-ed-abschnitt { border-top: 2px solid var(--gt-rand); }
.gt-ed-gh { margin: 0; font-size: 1em; position: sticky; top: 0; z-index: 1; background: var(--gt-karte); }
.gt-ed-gkopf { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; padding: 4px 8px; border: 0; border-bottom: 1px solid var(--gt-rand);
  background: var(--gt-bg); color: var(--gt-text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.gt-ed-gkopf:hover { background: var(--gt-m-entwurf-bg); }
.gt-ed-gkopf:focus-visible, .gt-ed-esd-wahl input:focus-visible { outline: 3px solid var(--gt-fokus); outline-offset: -3px; }
.gt-ed-gkopf svg { flex: 0 0 auto; color: var(--gt-text2); }
.gt-ed-gtitel { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.2; }
.gt-ed-gzahl { flex: 0 0 auto; font-weight: 600; font-size: .82em; color: var(--gt-text2); white-space: nowrap; }
.gt-esd { display: inline-flex; align-items: center; flex: 0 0 auto; line-height: 0; }
.gt-esd-sym { display: block; }
.gt-ed-chip--esd { padding: 0 4px; background: transparent; }
.gt-ed-esd-wahl { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; cursor: pointer; }
.gt-ed-esd-wahl input { width: 20px; height: 20px; margin: 0; accent-color: var(--gt-haupt-bg); }
.gt-ed-struktur { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; flex: 0 0 auto; }
.gt-ed-struktur .gt-knopf { padding: 3px 6px; min-height: 34px; font-size: .84em; line-height: 1.15; text-align: center; white-space: normal; }
.gt-ed-mitte { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; overflow-y: auto; container-type: inline-size; }
.gt-ed-werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex: 0 0 auto; }
.gt-ed-werkzeug .gt-feld, .gt-ed-werkzeug .gt-ed-esd-wahl { min-height: 32px; }
.gt-ed-werkzeug .gt-ed-esd-feld { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.gt-ed-gruppe-feld { display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; }
.gt-ed-gruppe-feld select { max-width: 220px; }
.gt-ed-klein-knopf { min-height: 32px; padding: 0 8px; font-size: .9em; white-space: nowrap; }
.gt-info { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--gt-text2); cursor: help; font: inherit; line-height: 1; flex: 0 0 auto; }
.gt-info:hover { background: var(--gt-bg); color: var(--gt-text); }
.gt-info:focus-visible { outline: 3px solid var(--gt-fokus); outline-offset: 0; }
.gt-ed-labelzeile { display: flex; align-items: center; gap: 4px; min-width: 0; }
.gt-ed-labelzeile label { flex: 0 1 auto; }
.gt-ed-woerter { margin-left: auto; color: var(--gt-text2); white-space: nowrap; }
.gt-ed-woerter.ist-warnung { color: var(--gt-warn-text); background: var(--gt-warn-bg); border-radius: 6px; padding: 0 6px; font-weight: 600; }
.gt-ed-gelb { background: var(--gt-warn-bg); color: var(--gt-warn-text); border-radius: 8px; padding: 8px 10px; }
.gt-ed-gelb .gt-liste { margin: 4px 0 0; }
.gt-ed-knopf--pruefen { background: var(--gt-warn-bg); color: var(--gt-warn-text); border-color: var(--gt-warn-text); }
.gt-ed-nichtueb { margin-bottom: 10px; }
.gt-ed-nichtueb h4 { margin: 0 0 4px; font-size: 1em; }
.gt-ed-nichtueb .gt-ed-t td, .gt-ed-nichtueb .gt-ed-t th { color: var(--gt-warn-text); vertical-align: middle; }
.gt-ed-klein { width: auto; min-width: 0; max-width: 100%; font-family: inherit; }
.gt-wahl { display: inline-flex; border: 1px solid var(--gt-feldrand); border-radius: 8px; overflow: hidden; }
.gt-ed-bild { margin: 0; flex: 1 1 140px; min-height: 160px; position: relative; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gt-rand); border-radius: 8px; background: var(--gt-bg); overflow: hidden; }
.gt-ed-bildflaeche { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.gt-ed-bildstatus { position: absolute; left: 8px; right: 8px; bottom: 6px; color: var(--gt-text); font-size: .9em; text-align: center; }
.gt-ed-bildstatus:not(:empty) { background: var(--gt-warn-bg); color: var(--gt-warn-text); border-radius: 8px; padding: 4px 8px; }
.gt-ed-fotozeile { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.gt-ed-fotozeile input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.gt-ed-fotozeile input[type="file"]:focus-visible + label.gt-knopf { outline: 3px solid var(--gt-fokus); outline-offset: 2px; }
.gt-ed-texte { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 4px 10px; align-items: end; flex: 0 0 auto; }
@container (max-width: 620px) {
  .gt-ed-texte { grid-template-columns: minmax(0, 1fr) auto; }
  .gt-ed-texte > .gt-ed-feld:first-child { grid-column: 1 / -1; }
}
.gt-ed-texte .gt-ed-feld .gt-feld { width: 100%; font-family: inherit; }
.gt-ed-texte .gt-ed-hinweis { grid-column: 1 / -1; color: var(--gt-text2); }
.gt-ed-text { min-height: 36px; height: 36px; resize: vertical; padding-top: 6px; }
/* Titel und Hinweis wachsen mit dem Inhalt (Controller N2): Höhe setzt editor.js (wachsen), Titel bis 2, Hinweis bis 4 Zeilen */
.gt-ed-texte .gt-ed-text, .gt-ed-texte .gt-ed-titelfeld { min-height: 0; height: auto; resize: none; line-height: 1.3; padding: 7px 10px; overflow-y: hidden; display: block; }
.gt-ed-titelfeld { overflow-wrap: anywhere; }
/* Kennzeile im Seitentitel, Kurzwort ESD, Kamera-Knopf und Symbole: nur in niedrigen Fenstern (siehe max-height: 480px) */
.gt-ed-titelzusatz, .gt-ed-kamera-knopf, .gt-ed-kurz, .gt-ed-sym { display: none; }
.gt-ed-kamera { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.gt-ed-sym svg { display: block; }
.gt-ed-texte .gt-ed-feld label { font-size: .86em; }
.gt-ed-feld { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gt-ed-feld label { font-weight: 600; font-size: .92em; }
.gt-ed-feld small { color: var(--gt-text2); }
.gt-ed-feld .gt-feld { width: 100%; font-family: inherit; }
.gt-ed-formular { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.gt-ed-formular > .gt-knopf { align-self: flex-start; }
.gt-ed-rechts { position: relative; overflow-y: auto; padding-right: 2px; }
.gt-ed-rechts h3 { margin: 0 0 4px; font-size: 1em; }
.gt-ed-t { width: 100%; border-collapse: collapse; font-size: .92em; }
.gt-ed-t th, .gt-ed-t td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--gt-rand); vertical-align: top; }
.gt-ed-t th { color: var(--gt-text2); font-weight: 600; font-size: .88em; }
.gt-ed-t td.m, .gt-ed-t td.k { white-space: nowrap; font-variant-numeric: tabular-nums; }
.gt-ed-t td.m { text-align: right; font-weight: 700; }
.gt-ed-frei { overflow-wrap: anywhere; min-width: 14ch; }
.gt-ed-aktionszelle { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; font-family: inherit; }
.gt-tabelle td[data-spalte="aktionen"] .ot-z { overflow: visible; text-align: left; font-family: inherit; }
.gt-tabelle td[data-spalte="aktionen"] .ot-z::before { content: none; }
.gt-ed-aktionszelle .gt-knopf { min-height: 30px; padding: 0 8px; }
.gt-ed-tabelle { overflow-x: auto; max-height: 40vh; overflow-y: auto; }
.gt-ed-vkopf { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.gt-ed-vkopf h3 { margin: 0; }
.gt-ed-vorgaben { display: flex; flex-direction: column; gap: 6px; }
.gt-ed-vorgabe { border: 1px solid var(--gt-rand); border-left-width: 6px; border-radius: 8px; padding: 6px 8px; background: var(--gt-karte); }
/* entfernte Vorgabe: abgedunkelt über Hintergrund und Zweittext, nie über opacity (Kontrast bleibt ≥ 4,5 : 1, Bedienelemente ≥ 3 : 1) */
.gt-ed-vorgabe.entfernt { background: var(--gt-bg); border-style: dashed; border-left-style: solid; }
.gt-ed-vorgabe.entfernt .gt-ed-art, .gt-ed-vorgabe.entfernt .gt-ed-wert, .gt-ed-vorgabe.entfernt .gt-ed-vtext { text-decoration: line-through; }
.gt-ed-vorgabe.entfernt .gt-ed-vtext, .gt-ed-vorgabe.entfernt .gt-ed-fund, .gt-ed-vorgabe.entfernt .gt-ed-wert { color: var(--gt-text2); }
.gt-ed-v--drehmoment { border-left-color: #FFFFFF; } .gt-ed-v--drehmoment.gelb { border-left-color: #FACC15; } .gt-ed-v--drehmoment.weiss { border-left-color: #94A3B8; }
.gt-ed-v--fett, .gt-ed-v--vorgefettet, .gt-ed-v--fett_entfallen { border-left-color: #F59E0B; }
.gt-ed-v--strich { border-left-color: #15803D; } .gt-ed-v--loctite { border-left-color: #1D4ED8; }
.gt-ed-v--sicherungslack { border-left-color: #B91C1C; } .gt-ed-v--handfest { border-left-color: #64748B; } .gt-ed-v--hinweis { border-left-color: #1E40AF; }
.gt-ed-vk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gt-ed-art { font-weight: 700; }
.gt-ed-wert { font-variant-numeric: tabular-nums; }
.gt-ed-vtext { margin: 2px 0 0; overflow-wrap: anywhere; }
.gt-ed-orig { margin: 2px 0 0; color: var(--gt-fehler-text); font-size: .9em; }
.gt-ed-fund { margin: 2px 0 0; color: var(--gt-text2); font-size: .85em; overflow-wrap: anywhere; }
.gt-ed-vakt { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 2px; }
.gt-ed-vakt .gt-knopf { min-height: 30px; padding: 0 6px; font-size: .92em; }
.gt-ed-leer { color: var(--gt-text2); }
.gt-ed-meldung { flex: 0 0 auto; margin: 0; min-height: 1.3em; color: var(--gt-text); }
.gt-ed-meldung[role="alert"]:not(:empty) { color: var(--gt-fehler-text); background: var(--gt-fehler-bg); border-radius: 8px; padding: 4px 8px; }
.gt-ed-dialog { max-width: min(640px, 94vw); }
.gt-ed-dialog--breit { max-width: min(1100px, 96vw); }
.gt-ed-dlg-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.gt-ed-dialog .gt-ed-meldung:empty { min-height: 0; }
/* Knopfzeile bleibt sichtbar, wenn ein Dialog bei 150 % scrollen muss (Controller 0.5.3/A1, z. B. „Entwurf verwerfen“) */
.gt-dialog:modal { scroll-padding-bottom: 72px; }                 /* Tab-Fokus landet nie unter der Knopfzeile */
.gt-dialog:modal .gt-ed-dlg-knoepfe { position: sticky; bottom: -16px; z-index: 2; margin-top: 4px; margin-bottom: -16px; padding: 8px 0 16px; background: var(--gt-karte); }          /* leere Meldezeile kostet im Dialog keine Höhe (150 %, N5) */
.gt-ed-haken { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.gt-ed-haken input[type="checkbox"] { width: 20px; height: 20px; }
.gt-ed-zahl { width: 5em; font-family: inherit; }
.gt-ed-gruppe { border: 1px solid var(--gt-rand); border-radius: 8px; padding: 6px 10px; }
/* breite Mitte: Titel und Hinweistext nebeneinander, das Schrittbild bekommt die gewonnene Höhe */
@container (min-width: 700px) {
  .gt-ed-texte { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: start; }
  .gt-ed-texte > .gt-knopf { align-self: end; }
  .gt-ed-texte > .gt-ed-feld:first-child { grid-column: auto; }
}
@media (max-width: 1280px) {
  .gt-ed-raster { grid-template-columns: 220px minmax(0, 1fr) 280px; }
  .gt-ed-texte { grid-template-columns: 1fr; }
}
/* Teile-Aufklapper (nur in niedrigen Fenstern sichtbar, siehe unten) */
.gt-ed-teile-knopf, .gt-ed-teile-zu { display: none; }
/* Schmale Mitte (1366 × 650, Controller R2): Werkzeugzeile in zwei statt drei Zeilen — Ansicht, Blickrichtung und PDF-Auswahl
   kompakt in der ersten, ESD und Gruppe in der zweiten; das Schrittbild bekommt die Höhe */
@container (max-width: 660px) {
  .gt-ed-werkzeug { gap: 4px 8px; }
  .gt-ed-werkzeug .gt-wahl button { padding: 0 10px; }
  .gt-ed-werkzeug select.gt-ed-klein { max-width: 132px; padding: 0 4px 0 6px; font-size: .92em; }
  .gt-ed-gruppe-feld select { max-width: 190px; }
}
/* Niedrige Fenster bis 700 px Höhe (1366 × 650): leere Meldezeile nimmt keinen Platz, Kopfknöpfe etwas flacher */
@media (max-height: 700px) {
  .gt-ed > .gt-ed-meldung:empty { min-height: 0; margin-top: -4px; }
  .gt-ed-leiste .gt-knopf { min-height: 32px; padding: 0 10px; }
  .gt-ed-leiste .gt-aktionen { gap: 6px; }
}
/* Sehr niedrige Fenster (150 % auf 1640 × 650 ≈ 1093 × 433, Controller R1): keine Mindesthöhe, die Seite scrollt nie.
   Teile und Vorgaben liegen als Aufklapper über der Mitte (Knopf „Teile“ neben der Ansichtwahl, „Zum Bild“ und Esc schließen);
   Liste und Mitte bekommen die Breite, Titel und Hinweis stehen mit Beschriftung links in je einer Zeile. */
@media (max-height: 480px) {
  .gt-ed { min-height: 0; padding: 4px 10px; gap: 3px;
    height: calc(100vh - var(--ok-kopf-h, 56px) - 58px); height: calc(100dvh - var(--ok-kopf-h, 56px) - 58px); }
  .gt-ed > .gt-ed-meldung:empty { margin-top: -3px; }
  .gt-ed-leiste { gap: 3px 6px; }
  .gt-ed-leiste .gt-knopf { min-height: 30px; padding: 0 8px; font-size: .9em; }
  .gt-ed-leiste .gt-knopf svg { display: none; }
  .gt-ed-raster { position: relative; grid-template-columns: 220px minmax(0, 1fr); gap: 8px; }
  .gt-ed-rechts { display: none; }
  .gt-ed-raster.ist-teile-offen > .gt-ed-rechts { display: block; position: absolute; top: 0; bottom: 0; left: 228px; right: 0; z-index: 3;
    padding: 4px 8px; border: 1px solid var(--gt-rand); border-radius: 8px; background: var(--gt-karte); box-shadow: 0 6px 20px rgba(8, 14, 22, .25); }
  .gt-ed-teile-knopf { display: inline-flex; min-height: 30px; padding: 0 10px; }
  .gt-ed-teile-zu { display: inline-flex; float: right; min-height: 30px; }
  .gt-ed-teile-knopf[aria-expanded="true"] { background: var(--gt-haupt-bg); color: var(--gt-haupt-text); }
  .gt-ed-schritt { min-height: 34px; padding: 4px 6px; }
  /* höchstens zwei Zeilen Titel je Schritt (voller Titel bleibt im Knopf für Screenreader und im Editor), damit mehr Schritte sichtbar sind */
  .gt-ed-schritt .ti { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .gt-ed-gkopf { min-height: 30px; padding: 2px 6px; }
  .gt-ed-struktur .gt-knopf { min-height: 30px; padding: 2px 4px; font-size: .8em; }
  .gt-ed-mitte { gap: 4px; }
  .gt-ed-werkzeug .gt-wahl button, .gt-ed-werkzeug .gt-feld, .gt-ed-werkzeug .gt-ed-esd-wahl, .gt-ed-klein-knopf { min-height: 30px; }
  .gt-ed-bild { min-height: 90px; flex-basis: 90px; }
  /* Titel und Hinweis: Beschriftung links, je eine Zeile; „Speichern“ hinter dem Hinweis */
  .gt-ed-texte, .gt-ed-texte[class] { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
  .gt-ed-texte > .gt-ed-feld { display: contents; }
  .gt-ed-texte > .gt-ed-feld:first-child > .gt-feld { grid-column: 2 / 4; }
  .gt-ed-texte > .gt-ed-feld:first-child, .gt-ed-texte > .gt-ed-feld:first-child > label { grid-column: auto; }
  .gt-ed-texte > .gt-knopf { align-self: center; }
  .gt-ed-texte .gt-feld { min-height: 30px; }
  .gt-ed-texte .gt-ed-text, .gt-ed-texte .gt-ed-titelfeld { min-height: 0; padding: 4px 8px; }
  .gt-ed-label-zusatz { display: none; }
  .gt-ed-texte .gt-info { width: 24px; height: 24px; }
  /* R1b: Seitentitel und Kennzeile in einer Zeile; die Kennzeile im Editor bleibt für Vorlese-Programme */
  .gt-ed-aktiv > .gt-kopfzeile { min-height: 0; gap: 8px; }
  .gt-ed-aktiv > .gt-kopfzeile h1 { font-size: 1.05em; gap: 8px; flex: 1 1 auto; white-space: nowrap; }
  .gt-ed-aktiv > .gt-kopfzeile h1 svg { width: 16px; height: 16px; }
  .gt-ed-aktiv > .gt-kopfzeile > :not(h1) { flex: 0 0 auto; font-size: .86em; }
  .gt-ed-titelzusatz { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; font-family: 'Open Sans', system-ui, sans-serif; font-weight: 600; font-size: .86em; }
  .gt-ed-titeltext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gt-ed-titelzusatz .gt-ed-chip { flex: 0 0 auto; }
  .gt-ed-leiste > .gt-ed-chips { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gt-ed-step-oben { display: none; } .gt-ed-step-unten { display: inline-flex; }   /* P3/B1: STEP-Knopf bleibt sichtbar */
  .gt-ed-leiste { justify-content: flex-start; }
  /* Werkzeugzeile einzeilig: Blickrichtung und PDF-Bild hinter „Kamera“, ESD als Kurzwort, „Gruppen …“ als Symbol */
  .gt-ed-werkzeug { position: relative; flex-wrap: nowrap; gap: 4px 6px; }
  .gt-ed-werkzeug .gt-wahl button { padding: 0 8px; }
  .gt-ed-kamera-knopf { display: inline-flex; }
  .gt-ed-kamera-knopf[aria-expanded="true"] { background: var(--gt-haupt-bg); color: var(--gt-haupt-text); }
  .gt-ed-kamera { display: none; }
  .gt-ed-kamera.ist-offen { display: flex; flex-direction: column; align-items: stretch; gap: 6px; position: absolute; top: calc(100% + 4px); left: 0; z-index: 4;
    padding: 8px; border: 1px solid var(--gt-rand); border-radius: 8px; background: var(--gt-karte); box-shadow: 0 6px 20px rgba(8, 14, 22, .25); }
  .gt-ed-kamera.ist-offen > select { max-width: none; }
  .gt-ed-werkzeug .gt-ed-esd-wahl { gap: 4px; }
  .gt-ed-esd-wahl .gt-ed-lang, .gt-ed-schritt .gt-ed-lang { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gt-ed-esd-wahl .gt-ed-kurz, .gt-ed-schritt .gt-ed-kurz { display: inline; }
  .gt-ed-schritt .marken .gt-ed-chip { min-height: 20px; font-size: .78em; padding: 0 6px; }
  /* Hauptfläche: weniger Rand, damit Bild und Liste die Höhe bekommen */
  .gt-haupt:has(.gt-ed-aktiv) { padding-top: 4px; padding-bottom: 6px; }
  .gt-ansicht.gt-ed-aktiv { gap: 4px; }
  /* Kopfleiste in einer Zeile */
  .gt-ed-leiste .gt-aktionen { gap: 4px; }
  .gt-ed-leiste .gt-knopf { padding: 0 7px; font-size: .86em; }
  /* Wortzähler unter der Beschriftung: die Spalte bleibt schmal, der Hinweis bekommt die Breite */
  .gt-ed-labelzeile { flex-wrap: wrap; row-gap: 0; }
  .gt-ed-woerter { flex-basis: 100%; margin-left: 0; font-size: .8em; line-height: 1.2; white-space: normal; }
  .gt-ed-texte, .gt-ed-texte[class] { grid-template-columns: 6.5em minmax(0, 1fr) auto; }
  .gt-ed-texte .gt-ed-text, .gt-ed-texte .gt-ed-titelfeld { font-size: .94em; }
  .gt-ed-texte > .gt-knopf { padding: 0 10px; }
  .gt-ed-gruppe-feld { flex: 0 1 auto; }
  .gt-ed-gruppe-feld select { max-width: 150px; }
  .gt-ed-sym { display: inline-flex; }
  .gt-ed-symknopf { gap: 0; }
  .gt-ed-symknopf .gt-ed-symtext { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gt-ed-klein-knopf.gt-ed-symknopf { min-width: 32px; padding: 0 6px; }
  .gt-ed-klein-knopf.gt-ed-symknopf > svg { margin: 0; }
  .gt-ed-kamera-knopf { min-height: 30px; min-width: 32px; padding: 0 6px; }
  /* Struktur-Knöpfe als eine Symbolzeile */
  .gt-ed-struktur { grid-template-columns: repeat(4, 1fr); }
  .gt-ed-struktur .gt-knopf { min-height: 30px; padding: 0 4px; }
}
/* Hinweise: zwei Reiter, jede Tabelle füllt die ganze Höhe und scrollt in sich (B-3).
 * Beide Tafeln liegen übereinander (die unsichtbare mit visibility:hidden), damit die Tabelle ihre Breite schon kennt. */
#gt-hinweise { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; padding-bottom: 10px; }
.gt-hw-reiterzeile { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 12px; border-bottom: 1px solid var(--gt-rand); }
.gt-reiter { display: flex; flex-wrap: wrap; gap: 4px; }
.gt-reiter-knopf {
  min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: -1px;
  background: transparent; color: var(--gt-text2); font: inherit; font-weight: 600; cursor: pointer;
}
.gt-reiter-knopf:hover { background: var(--gt-bg); color: var(--gt-text); }
.gt-reiter-knopf[aria-selected="true"] { background: var(--gt-karte); color: var(--gt-text); border-color: var(--gt-rand); box-shadow: inset 0 3px 0 var(--gt-akzent); }
.gt-reiter-knopf:focus-visible { outline: 3px solid var(--gt-fokus); outline-offset: -3px; }
.gt-hw-aktionen { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 14px; flex: 1 1 auto; min-width: 0; padding-bottom: 4px; }
.gt-hw-aktionen[hidden] { display: none; }
.gt-hw-notiz { flex: 1 1 auto; min-width: 0; color: var(--gt-text2); font-size: .85em; text-align: right; }
.gt-hw-stapel { position: relative; flex: 1 1 0; min-height: 0; }
.gt-hw-abschnitt { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; visibility: hidden; }
.gt-hw-abschnitt.gt-hw-aktiv { visibility: visible; }
.gt-hw-abschnitt > .gt-tabelle { flex: 1 1 0; min-height: 96px; }
.gt-hw-abschnitt > p { flex: 0 0 auto; margin: 0; }
#gt-hinweise > .gt-ed-meldung { flex: 0 0 auto; min-height: 0; }
#gt-hinweise .gt-aktionen { margin: 0; }

/* Niedrige Fenster (zum Beispiel 150 % auf 1640×650): Übersicht zeigt mindestens 8 Zeilen (B-4) */
@media (max-height: 520px) {
  .gt-haupt { padding-top: 6px; padding-bottom: 8px; }
  .gt-ansicht { gap: 6px; }
  .gt-tabelle .ot[data-dichte="kompakt"] { --ot-zf: 2.1; }
  /* Ansicht Hinweise (B-3): Titel nur noch für Screenreader (der Pfad im Kopf nennt die Seite), Notiz und Zeilenumbruch weichen den Zeilen */
  .gt-ansicht:has(#gt-hinweise) > .gt-kopfzeile { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #gt-hinweise { padding-top: 4px; padding-bottom: 6px; gap: 4px; }
  .gt-reiter-knopf { min-height: 34px; }
  .gt-hw-notiz { display: none; }
  .gt-hw-aktionen .gt-knopf { min-height: 30px; padding-top: 0; padding-bottom: 0; }
  .gt-hw-aktionen { padding-bottom: 2px; }
  #gt-hinweise .gt-tabelle td.ot-frei .ot-kuerz { -webkit-line-clamp: 1; line-clamp: 1; }
  #gt-hinweise .gt-tabelle td .gt-knopf { min-height: 26px; padding-top: 0; padding-bottom: 0; }
}

/* ── AP-3: Symbole am Bauteil (js/plaketten.js), 3D im Editor, Tablet-Vorschau ─────────────────────────────── */
.gt-ed-plaketten { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gt-pl-halo { stroke: #FFFFFF; stroke-width: 6; stroke-linecap: round; fill: none; }
.gt-pl-linie { stroke: #111827; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.gt-pl-punkt { fill: #DC500F; stroke: #FFFFFF; stroke-width: 2; }
.gt-pl-grund { fill: #FFFFFF; stroke: #111827; stroke-width: 2; vector-effect: non-scaling-stroke; }
.gt-pl-zahl { fill: #111827; stroke: #FFFFFF; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.gt-pl-zahltext { fill: #FFFFFF; font-family: 'Open Sans', Arial, sans-serif; font-weight: 700; }
.gt-ed-bild--3d { align-items: stretch; justify-content: stretch; }
.gt-ed-3d { position: relative; flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; }      /* nie höher als die Bildfläche (B13) */
/* Nicht modal unter dem Kopf (UI-Standard §2, Controller B4): Kopf bleibt sichtbar */
.gt-vs { position: fixed; top: calc(var(--ok-kopf-h, 56px) + 8px); left: 0; right: 0; margin: 0 auto; z-index: 50;
  width: min(1340px, 98vw); height: calc(100vh - var(--ok-kopf-h, 56px) - 16px); height: calc(100dvh - var(--ok-kopf-h, 56px) - 16px);
  max-width: none; max-height: none; padding: 10px 12px; border: 1px solid var(--gt-rand); box-shadow: 0 12px 40px rgba(8, 14, 22, .35);
  border-radius: 12px; background: var(--gt-karte); color: var(--gt-text); display: flex; flex-direction: column; gap: 8px; }
.gt-vs:not([open]) { display: none; }
.gt-vs::backdrop { background: rgba(8, 14, 22, .6); }
.gt-vs-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 0 0 auto; }
.gt-vs-kopf h3 { margin: 0; font-size: 1.05em; flex: 1 1 auto; }
.gt-vs-kopf .gt-wahl button { min-height: 36px; padding: 0 12px; border: 0; background: var(--gt-feld); color: var(--gt-text); font: inherit; cursor: pointer; }
.gt-vs-kopf .gt-wahl button[aria-pressed="true"] { background: var(--gt-haupt-bg); color: var(--gt-haupt-text, #FFFFFF); font-weight: 600; }
.gt-vs-buehne { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--gt-bg); border-radius: 8px; }
.gt-vs-rahmen { position: absolute; left: 50%; top: 4px; border: 2px solid #1F2937; border-radius: 14px; background: #FFFFFF; transform-origin: 50% 0; margin-left: -640px; }
.gt-vs-buehne[data-lage="hoch"] .gt-vs-rahmen { margin-left: -400px; }
