/* layout-v3.css — eigenständiger Klon von layout-v2.css, gescoped auf [data-layout="v3"].
   V3 ist initial identisch zu V2 und wird ab hier unabhängig weiterentwickelt. V1/V2 bleiben unberührt. */
/* ---------- Layout V2 (Layout-Switch V1↔V2) — Phase 2: Optik (Figma „Redesign B") ----------
   ADDITIV & HART V2-GEGATET: JEDE Regel steht unter `.shell[data-layout="v3"]` → V1 bleibt unberührt
   (kein Match, wenn das Attribut fehlt; in V1 wird data-layout gar nicht erst emittiert). KEINE Änderung
   an blocks.js oder V1-CSS-Pfaden — V2 reicht block-interne Optik NICHT an (Warndreieck/Range-Farben/
   Tabellen-Icons/Wert-Kacheln bleiben Renderer-Ebene → separat nach dem Merge, Phase 3+).

   Vier Zonen: Sequencer links (geteilt, default ausgeklappt) · Anweisung+Aktion auf grauem Grund ·
   weiße Content-Card rechts · Meta-Leiste als Slide-in/out-Drawer (default eingeklappt). */

/* ===== Äußeres Grid: Main (grau+weiß) links, Sequence-Liste rechts (ein-/ausklappbar). Kein Settings-Panel. ===== */
.shell[data-layout="v3"] .cockpit {
  position: relative;
  --seq-w: 340px;
  grid-template-columns: 1fr var(--seq-w);
  grid-template-areas: "main seq";
  transition: grid-template-columns .2s ease;
}
.shell[data-layout="v3"] .cockpit--seq-collapsed { --seq-w: 56px; }
/* Einheitliches Sheet-Padding (Card) — gilt als Innenabstand UND als Abstand zwischen Komponentengruppen.
   normal 60 · Tablet 40 · große Screens 80. */
.shell[data-layout="v3"] { --sheet-pad: 60px; }
.shell[data-layout="v3"][data-profile="tablet"] { --sheet-pad: 40px; }
/* MN-Eingabe / Repair: keine Sequence-Komponente → eine Spalte, Dialog mittig. */
.shell[data-layout="v3"] .cockpit--seq-hidden { grid-template-columns: 1fr; grid-template-areas: "main"; }
.shell[data-layout="v3"] .cockpit--seq-hidden .c-main { align-items: center; justify-content: center; }
/* Reparatur-Auswahl: feste Sheet-Breite (860px), unabhängig vom Inhalt — bis der Test startet. */
.shell[data-layout="v3"] .cockpit--seq-hidden .scope { width: 860px; max-width: 100%; }
.shell[data-layout="v3"] .c-main { grid-area: main; }
.shell[data-layout="v3"] .c-left { grid-area: seq; }   /* Sequence-Liste an die rechte Seite */

/* ===== Sequence-Liste rechts: heller Grund, Kopf „TEST SEQUENCE" + Ein-/Ausklapp-Schalter (» / «) ===== */
.shell[data-layout="v3"] .c-left.seq {
  grid-area: seq;
  background: transparent; border: 0; box-shadow: none;   /* kein Panel — Liste steht direkt auf dem grauen Grund */
  padding: var(--sp-l) var(--sp-m); overflow: hidden;
}
.shell[data-layout="v3"] .seq-head { display: flex; align-items: center; gap: var(--sp-xs); flex: 0 0 auto; margin-bottom: var(--sp-m); }
.shell[data-layout="v3"] .seq-head__title { font-family: var(--font-header); font-size: var(--fs-h6); line-height: 1.2;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); white-space: nowrap; }
.shell[data-layout="v3"] .seq-toggle { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: var(--text-secondary); border-radius: var(--radius-s); }
.shell[data-layout="v3"] .seq-toggle:hover { background: var(--surface-grey); color: var(--text-primary); }
.shell[data-layout="v3"] .seq--collapsed { padding-left: var(--sp-xs); padding-right: var(--sp-xs); }
.shell[data-layout="v3"] .seq--collapsed .seq-toggle svg { transform: rotate(180deg); }

/* ===== Mittig-links: Anweisung + Aktion auf grauem Grund (.c-main ist transparent → erbt --surface-grey) ===== */
.shell[data-layout="v3"] .csv2 {
  position: relative;
  flex: 1 1 auto; min-height: 0; min-width: 0;
  display: grid; gap: var(--sp-xl); align-items: stretch;
  /* Grauer Anweisungsbereich fix auf 1/3 der Bildschirmbreite; die Content-Card nimmt den Rest —
     der Sequencer teilt sich mit ihr die restlichen 2/3, ohne die graue Spalte zu verändern. */
  grid-template-columns: calc(100vw / 3) 1fr;
}
.shell[data-layout="v3"] .csv2--no-content { grid-template-columns: 1fr; }

.shell[data-layout="v3"] .csv2__instruction {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  padding: var(--sp-l) var(--sp-m); gap: var(--sp-m);
}
/* Meta-Buttons oben (Test stoppen · Problem melden) */
.shell[data-layout="v3"] .csv2__meta { display: flex; align-items: center; justify-content: center; gap: var(--sp-l); flex: 0 0 auto; }
/* Mitte: Step-Name an FESTER vertikaler Position (springt nicht mit der Zeilenzahl), Anweisung fließt darunter.
   Anker so gewählt, dass ein zweizeiliger Beschreibungstext den Block etwa in die Bildschirmmitte legt. */
.shell[data-layout="v3"] .csv2__center { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  justify-content: flex-start; align-items: flex-start; gap: var(--sp-m); width: 100%;
  padding-top: max(var(--sp-l), calc(50vh - 170px)); }
/* Fehlerbox oben im grauen Bereich, absolut positioniert → Step-Name/Beschreibung bleiben an fester Position. */
.shell[data-layout="v3"] .csv2__instruction { position: relative; }
.shell[data-layout="v3"] .stage-error--top { position: absolute; top: var(--sp-l); left: var(--sp-m); right: var(--sp-m); z-index: 3; margin: 0; }
/* Hauptbuttons unten, horizontal zentriert */
.shell[data-layout="v3"] .csv2__actions { flex: 0 0 auto; justify-content: center; padding-top: var(--sp-m); margin-top: 0; }
/* Anweisungs-Kopf: Eyebrow (klein) über großem Titel; linksbündig, distanztauglich. */
.shell[data-layout="v3"] .csv2__instruction .stage__head { align-items: flex-start; gap: var(--sp-xs); width: 100%; }
.shell[data-layout="v3"] .csv2__instruction .stage__name {
  margin: 0; text-align: left; font-size: 20px; line-height: 1.3; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .04em;
}
.shell[data-layout="v3"] .csv2__instruction .stage__heading {
  margin: 0; text-align: left; max-width: 22ch;
  font-size: 40px; line-height: 1.12; font-weight: 700; color: var(--text-primary);
}
/* Beschreibung / Anweisungs-Blöcke (Text/Help) linksbündig, ~22px. */
.shell[data-layout="v3"] .csv2__instruction .stage__body { align-items: flex-start; justify-content: flex-start; flex: 0 1 auto; width: 100%; gap: var(--sp-m); }
.shell[data-layout="v3"] .csv2__instruction .blk-text { font-size: 22px; line-height: 1.45; max-width: 46ch; }
.shell[data-layout="v3"] .csv2__instruction .blk-help { align-self: flex-start; }
.shell[data-layout="v3"] .csv2__instruction .blk-help__txt { font-size: 24px; line-height: 1.3; }
/* Range-Indikator in der linken Zone linksbündig statt zentriert (Hülle; Block-interne Farben bleiben V1). */
.shell[data-layout="v3"] .csv2__instruction .rangewrap { justify-content: flex-start; }

/* Aktions-Zeile unten in der Zone, horizontal zentriert (große Buttons; D-021 schwarz auf Lime bleibt). */
.shell[data-layout="v3"] .csv2__instruction .c-actions {
  justify-content: center; padding-top: var(--sp-m); flex-wrap: wrap;
}

/* „Nur Anweisung" (kein Medium): KEINE leere Card → komfortabel breitere, gut lesbare Anweisungsspalte. */
.shell[data-layout="v3"] .csv2--no-content .csv2__instruction { padding-right: var(--sp-xl); max-width: 70ch; }
.shell[data-layout="v3"] .csv2--no-content .stage__heading { max-width: 28ch; }
.shell[data-layout="v3"] .csv2--no-content .blk-text { max-width: 64ch; }

/* Fehler-State: Content-Card bekommt einen roten Rahmen (+ kurzer Aufmerksamkeits-Puls). */
.shell[data-layout="v3"] .csv2--attention .csv2__card { border: 2px solid var(--status-nok); animation: pulse-error 1.2s ease-in-out 3; }
@keyframes pulse-error { 0%, 100% { box-shadow: 0 0 0 0 rgba(227,27,12,0); } 50% { box-shadow: 0 0 0 6px rgba(227,27,12,0.45); } }
/* Fehlerbox links: rote Border, hellroter Grund, größere Schrift; füllt die linke Spalte. */
.shell[data-layout="v3"] .csv2 .stage-error {
  align-self: stretch; max-width: none; margin: 0;
  border: 2px solid var(--status-nok); border-radius: 8px; padding: var(--sp-l) var(--sp-l);
}
.shell[data-layout="v3"] .csv2 .stage-error__title { font-size: 26px; line-height: 1.25; color: var(--status-nok); }
.shell[data-layout="v3"] .csv2 .stage-error__line { font-size: 20px; line-height: 1.4; color: var(--text-secondary); }

/* ===== Rechts: weiße Content-Card (Radius 8, dezenter Schatten/Border) — Medium füllt die Zone ===== */
.shell[data-layout="v3"] .csv2__card {
  background: var(--surface); border: 1px solid var(--border-faint); border-radius: 8px;
  box-shadow: var(--elevation-1); padding: var(--sheet-pad); gap: var(--sheet-pad);
  min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column;
  container-type: inline-size;   /* Basis für die kondensierte KPI-Variante (Container-Query) */
}
.shell[data-layout="v3"] .csv2__card .stage__body { flex: 1 1 auto; min-height: 0; width: 100%; padding: 0; }
/* Bild seitenverhältnis-treu „contain" (kein Crop) — füllt die Card. */
.shell[data-layout="v3"] .csv2__card .blk-image { flex: 1 1 auto; min-height: 0; width: 100%; padding: 0; }
.shell[data-layout="v3"] .csv2__card .blk-image img { width: 100%; height: 100%; object-fit: contain; }
/* Tabelle nutzt die volle Card-Breite. */
.shell[data-layout="v3"] .csv2__card table.blk-table { max-width: 100%; width: 100%; }
/* Liniendiagramm füllt die Card in Breite UND Höhe. */
.shell[data-layout="v3"] .csv2__card .blk-graph { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; display: flex; }
.shell[data-layout="v3"] .csv2__card .blk-graph .blk-graph__svg { flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; }
/* Lange Beschreibung/Hilfetext rechts im Sheet: vertikal zentriert, linksbündig, gut lesbar. */
.shell[data-layout="v3"] .csv2__card .blk-help,
.shell[data-layout="v3"] .csv2__card .blk-text { margin: auto 0; align-self: flex-start; max-width: 100%; }
.shell[data-layout="v3"] .csv2__card .blk-help__txt { font-size: 28px; line-height: 1.3; }
.shell[data-layout="v3"] .csv2__card .blk-text { font-size: 24px; line-height: 1.5; }

/* Mess-Schritt: Diagramm möglichst groß oben, darunter KPI-Kacheln (bis zu 8). */
.shell[data-layout="v3"] .csv2__card .brake { position: relative; display: flex; flex-direction: column; height: 100%; width: 100%; max-width: none; align-self: stretch; gap: 0; justify-content: space-between; }
.shell[data-layout="v3"] .csv2__card .brake__legend { flex: 0 0 auto; margin-bottom: var(--sp-m); }
/* Diagramm füllt die verfügbare Höhe (über den KPI-Kacheln) — Cap der Chart-Klasse aufheben. */
.shell[data-layout="v3"] .csv2__card .brake__chart { flex: 1 1 auto; min-height: 0; width: 100%; height: 100%; max-height: none; }
/* Variante „2 Diagramme": beide Diagramme füllen zusammen die volle Card-Höhe. */
.shell[data-layout="v3"] .csv2__card .brake--twoDiagrams { justify-content: stretch; }
.shell[data-layout="v3"] .csv2__card .brake2d__chart { max-height: none; height: 100%; }
/* Abstand zwischen Diagramm und KPI-Kacheln = Sheet-Padding. */
.shell[data-layout="v3"] .csv2__card .kpis { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: var(--sp-xl); justify-content: center; margin-top: var(--sheet-pad); }
.shell[data-layout="v3"] .csv2__card .kpi {
  flex: 1 1 260px; min-width: 200px; max-width: 420px;
  display: flex; flex-direction: column; gap: var(--sp-l);
  background: var(--surface-grey); border-left: 6px solid var(--kpi-accent, var(--claas-lime));
  border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: var(--sp-l) var(--sp-l);
}
/* KPI-Kacheln OHNE Chart (AutoTable): kein Farb-Akzent, 2-Spalten-Raster, vertikal zentriert. */
.shell[data-layout="v3"] .csv2__card .kpis--grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-xl); margin: auto 0; align-content: center; justify-content: stretch; }
.shell[data-layout="v3"] .csv2__card .kpi--plain { border-left: 0; border-radius: var(--radius-s); max-width: none; }
.shell[data-layout="v3"] .csv2__card .kpi__name { margin: 0; text-align: center; font-family: var(--font-header);
  font-size: 24px; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.shell[data-layout="v3"] .csv2__card .kpi__vals { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-l); }
.shell[data-layout="v3"] .csv2__card .kpi__mm { display: flex; flex-direction: column; align-items: center; gap: var(--sp-xs);
  font-variant-numeric: tabular-nums; font-size: 24px; color: var(--text-secondary); }
.shell[data-layout="v3"] .csv2__card .kpi__mm-lbl { font-size: 16px; color: var(--text-secondary); }
.shell[data-layout="v3"] .csv2__card .kpi__badge { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-xs);
  min-width: 160px; min-height: 56px; padding: 8px 16px; border-radius: var(--radius-s); font-weight: 700; color: #fff; font-size: 28px; font-variant-numeric: tabular-nums; }
.shell[data-layout="v3"] .csv2__card .kpi__badge svg { width: 30px; height: 30px; flex: 0 0 auto; }
.shell[data-layout="v3"] .csv2__card .kpi__badge.is-ok { background: var(--status-ok); }
.shell[data-layout="v3"] .csv2__card .kpi__badge.is-nok { background: var(--status-nok); }
.shell[data-layout="v3"] .csv2__card .kpi__badge.is-pending { background: #676767; }
.shell[data-layout="v3"] .csv2__card .kpi__spin { width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: cal-spin .8s linear infinite; }
/* Kondensierte KPI-Variante: NUR wenn die Card zu schmal wird (z. B. Sequencer ausgeklappt) —
   ausschließlich Abstände kleiner, Schriftgrößen bleiben unverändert. */
@container (max-width: 820px) {
  .shell[data-layout="v3"] .csv2__card .kpis { gap: var(--sp-l); }
  .shell[data-layout="v3"] .csv2__card .kpis--grid { gap: var(--sp-l); }
  .shell[data-layout="v3"] .csv2__card .kpi { min-width: 170px; padding: var(--sp-1_5) var(--sp-m); gap: var(--sp-xs); }
  .shell[data-layout="v3"] .csv2__card .kpi__vals { gap: var(--sp-m); }
  .shell[data-layout="v3"] .csv2__card .kpi__mm { gap: 2px; }
  /* Wert-Badge eng um den Wert (kleineres Padding, keine Mindestbreite) — Schrift bleibt gleich. */
  .shell[data-layout="v3"] .csv2__card .kpi__badge { min-width: 0; padding: 8px 12px; gap: 6px; }
}
/* Zweite Stufe — sehr schmale Card (kleine Bildschirme): erst hier, wenn die Abstände schon minimal
   sind, werden ZUSÄTZLICH die Schriftgrößen reduziert, damit die KPIs nicht überlaufen/kollabieren. */
@container (max-width: 560px) {
  .shell[data-layout="v3"] .csv2__card .kpi { flex-basis: 200px; min-width: 150px; }
  .shell[data-layout="v3"] .csv2__card .kpi__name { font-size: 20px; }
  .shell[data-layout="v3"] .csv2__card .kpi__mm { font-size: 20px; }
  .shell[data-layout="v3"] .csv2__card .kpi__mm-lbl { font-size: 14px; }
  .shell[data-layout="v3"] .csv2__card .kpi__badge { min-height: 46px; font-size: 22px; }
  .shell[data-layout="v3"] .csv2__card .kpi__badge svg { width: 24px; height: 24px; }
}
/* Dritte Stufe — extrem schmal: KPIs einspaltig stapeln statt nebeneinander quetschen. */
@container (max-width: 380px) {
  .shell[data-layout="v3"] .csv2__card .kpis--grid { grid-template-columns: 1fr; }
  .shell[data-layout="v3"] .csv2__card .kpi { flex-basis: 100%; min-width: 0; }
  .shell[data-layout="v3"] .csv2__card .kpi__name { font-size: 18px; }
  .shell[data-layout="v3"] .csv2__card .kpi__mm { font-size: 18px; }
  .shell[data-layout="v3"] .csv2__card .kpi__badge { font-size: 20px; }
}
/* „Automatischer Test läuft": fahrender Mähdrescher mittig auf dem weißen Sheet. */
.shell[data-layout="v3"] .csv2__harvester { margin: auto; width: clamp(220px, 42%, 480px); height: auto; display: block; }
/* Indikatoren (Range · Countdown · Ladebalken · Uhr) mittig in der Card. */
.shell[data-layout="v3"] .csv2__card .rangewrap,
.shell[data-layout="v3"] .csv2__card .cdwrap,
.shell[data-layout="v3"] .csv2__card .loadwrap,
.shell[data-layout="v3"] .csv2__card .autowait {
  flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center;
}

/* ===== Meta-Leiste rechts: Slide-in/out-Drawer (default eingeklappt) ===== */
.shell[data-layout="v3"] .c-right {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--rail-right-w); z-index: 6;
  transform: translateX(100%); transition: transform .22s ease;
  border-left: 1px solid var(--border-faint);
}
.shell[data-layout="v3"] .cockpit--meta-open .c-right {
  transform: translateX(0); box-shadow: -8px 0 24px rgba(0,0,0,0.12);
}
/* Ausklapp-/Einklapp-Tab am rechten Rand (immer sichtbar in V2). */
.shell[data-layout="v3"] .meta-fab {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%); z-index: 7;
  width: 28px; height: 84px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border-faint); border-right: 0; border-radius: 8px 0 0 8px;
  transition: right .22s ease;
}
.shell[data-layout="v3"] .meta-fab:hover { background: var(--surface-grey); }
.shell[data-layout="v3"] .cockpit--meta-open .meta-fab { right: var(--rail-right-w); }
.shell[data-layout="v3"] .meta-fab svg { transition: transform .15s ease; }
.shell[data-layout="v3"] .cockpit--meta-open .meta-fab svg { transform: rotate(180deg); }

/* prefers-reduced-motion: Slide/Puls aus (Endzustände bleiben korrekt). */
@media (prefers-reduced-motion: reduce) {
  .shell[data-layout="v3"] .c-right,
  .shell[data-layout="v3"] .meta-fab,
  .shell[data-layout="v3"] .meta-fab svg { transition: none; }
  .shell[data-layout="v3"] .csv2--attention .csv2__card { animation: none; }
}

/* ===== Phase 3: Sonderfälle im V2-Split (flash · autoRun · cal · brake · Fehler) ===== */
/* Flash: Slot-Grid füllt die Fläche VOLL (kein Zonen-Split), Action-Bar unten (breite Figma-Flash-Ansicht). */
.shell[data-layout="v3"] .csv2--flash { display: flex; flex-direction: column; gap: var(--sp-m); }
.shell[data-layout="v3"] .csv2--flash .stage__body { flex: 1 1 auto; min-height: 0; width: 100%; padding: 0; }
.shell[data-layout="v3"] .csv2--flash .c-actions { flex: 0 0 auto; margin: 0; padding-top: 0; justify-content: center; }

/* Linke Zone: Range / autoRun-Wartezustand linksbündig, fixe Höhe (Buttons bleiben unten verankert). */
.shell[data-layout="v3"] .csv2__instruction .rangewrap,
.shell[data-layout="v3"] .csv2__instruction .autowait,
.shell[data-layout="v3"] .csv2__instruction .cdwrap,
.shell[data-layout="v3"] .csv2__instruction .loadwrap {
  flex: 0 0 auto; justify-content: flex-start; align-items: flex-start; padding: var(--sp-m) 0; min-height: 0;
}

/* Kalibrierung ohne min/max: zentrierte Liste — Name links, Wert-Badge rechts (2-Spalten-Raster). */
.shell[data-layout="v3"] .csv2__card .callist { display: grid; grid-template-columns: auto auto;
  column-gap: var(--sp-xl); row-gap: var(--sp-l); justify-content: center; align-content: center; margin: auto 0; }
.shell[data-layout="v3"] .csv2__card .callist__name { align-self: center; text-align: left;
  font-family: var(--font-header); font-weight: 700; font-size: var(--fs-h5); color: var(--text-primary); }
.shell[data-layout="v3"] .csv2__card .callist__badge { display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-xs); min-width: 130px; padding: 10px 16px; border-radius: var(--radius-s); color: #fff; font-weight: 700;
  font-size: var(--fs-h5); font-variant-numeric: tabular-nums; }
.shell[data-layout="v3"] .csv2__card .callist__badge.is-ok { background: var(--status-ok); }   /* weißer Text (default) auf Notification-Grün */
.shell[data-layout="v3"] .csv2__card .callist__badge.is-pending { background: #676767; }
.shell[data-layout="v3"] .csv2__card .callist__spin { width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: cal-spin .8s linear infinite; }

/* Kalibrier: Zähler unten im Sheet, horizontal zentriert. */
.shell[data-layout="v3"] .csv2__cal-counter { margin: auto 0 0; text-align: center; flex: 0 0 auto;
  font-family: var(--font-header); font-weight: 700; font-size: var(--fs-h5); color: var(--text-primary); }

/* Inline-Fehler (D-032) in der rechten Card: volle Breite, oben angedockt; Card pulst via csv2--attention. */
.shell[data-layout="v3"] .csv2__card .stage-error { max-width: 100%; align-self: stretch; margin: 0 0 var(--sp-l); }

/* ===== Responsive / Profile (V2-seitig) ===== */
@media (max-width: 1280px) {
  .shell[data-layout="v3"] .csv2 { gap: var(--sp-l); grid-template-columns: minmax(300px, 0.9fr) 1.1fr; }
  .shell[data-layout="v3"] .csv2__instruction .stage__name { font-size: 16px; }
  .shell[data-layout="v3"] .csv2__instruction .stage__heading { font-size: 30px; max-width: 24ch; }
  .shell[data-layout="v3"] .csv2__instruction .blk-text { font-size: 18px; }
  .shell[data-layout="v3"] .csv2__instruction .blk-help__txt { font-size: 20px; }
}
@media (min-width: 2000px) {
  .shell[data-layout="v3"] { --sheet-pad: 80px; }   /* große Screens: 80 px Sheet-Padding */
  .shell[data-layout="v3"] .csv2__instruction .stage__name { font-size: 24px; }
  .shell[data-layout="v3"] .csv2__instruction .stage__heading { font-size: 56px; max-width: 24ch; }
  .shell[data-layout="v3"] .csv2__instruction .blk-text { font-size: 28px; }
}
/* Hall (55″, Distanz): Anweisung sehr groß; Sequencer SCHMALER → Content-Card priorisiert (löst Hall×Sequencer). */
.shell[data-layout="v3"][data-profile="hall"] .cockpit { grid-template-columns: 220px 1fr; }
.shell[data-layout="v3"][data-profile="hall"] .csv2 { grid-template-columns: minmax(360px, 0.8fr) 1.2fr; }
.shell[data-layout="v3"][data-profile="hall"] .csv2__instruction .stage__name { font-size: 24px; }
.shell[data-layout="v3"][data-profile="hall"] .csv2__instruction .stage__heading { font-size: 48px; line-height: 1.1; }
.shell[data-layout="v3"][data-profile="hall"] .csv2__instruction .blk-text { font-size: 26px; }
/* Hall: Sequencer-Schrift im schmalen Rail etwas kompakter, damit IDs/Labels nicht abschneiden. */
.shell[data-layout="v3"][data-profile="hall"] .c-left { padding-left: var(--sp-xs); padding-right: var(--sp-xs); }
.shell[data-layout="v3"][data-profile="hall"] .c-left .seq-node { font-size: 16px; gap: 7px; }
/* Tablet (Touch): etwas kompakter, Card-Priorität bleibt. */
.shell[data-layout="v3"][data-profile="tablet"] .csv2 { gap: var(--sp-l); }
.shell[data-layout="v3"][data-profile="tablet"] .csv2__instruction .stage__heading { font-size: 36px; }

/* ===== Layout-Switch-Steuerelement im Footer (D-039 Merge-Prep) =====
   BEWUSST NICHT [data-layout]-gegatet — in BEIDEN Layouts sichtbar (man muss aus V1 UND V2 wechseln können).
   Stylt ausschließlich das NEUE .foot-layout-Element (existiert in `main` nicht) → kein Eingriff in bestehende
   V1-Footer-Optik; app.css/tokens.css bleiben unangetastet. Touch-Target ≥ --touch-min, schwarz auf Lime (D-021). */
.foot-layout { display: inline-flex; align-items: center; flex: 0 0 auto;
  border: 1px solid var(--outline); border-radius: var(--radius-s); overflow: hidden; }
.foot-layout__btn { border: 0; background: transparent; cursor: pointer; font: inherit;
  font-family: var(--font-header); font-weight: 500; font-size: var(--fs-body2); color: var(--text-secondary);
  min-height: var(--touch-min); padding: 0 var(--sp-1_5); display: inline-flex; align-items: center; }
.foot-layout__btn + .foot-layout__btn { border-left: 1px solid var(--outline); }
.foot-layout__btn--on { background: var(--claas-lime); color: var(--on-primary); }   /* D-021: schwarz auf Lime */
.foot-layout__btn:not(.foot-layout__btn--on):hover { background: var(--surface-grey); color: var(--text-primary); }
.foot-layout__btn:focus-visible { outline: 2px solid var(--claas-lime); outline-offset: -2px; }

/* Versions-Toggle (ein Klick V1↔V2), rechts links neben Reload. Aktiv (V2) = schwarz auf Lime (D-021).
   Bewusst NICHT [data-layout]-gegatet — in beiden Layouts sichtbar. */
/* Minimalistisch wie Pause/Reset: nur „V1"/„V2" in Schwarz, randlos. */
.foot-vtoggle { display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; font: inherit;
  font-family: var(--font-header); font-weight: 500; font-size: var(--fs-body1); color: var(--text-primary);
  background: transparent; border: 0; padding: var(--sp-xs); white-space: nowrap; }
.foot-vtoggle:hover { color: var(--claas-lime-dark); }
.foot-vtoggle:focus-visible { outline: 2px solid var(--claas-lime); outline-offset: 2px; border-radius: var(--radius-s); }

/* Maschinennummer links im Footer: Label über Wert, linksbündig. */
.foot-tb--start { align-items: flex-start; }

/* === V3-Interaktionsprinzip: CLAAS-Lime (Sattengrün) NUR für interaktive Elemente ===
   Alles Nicht-Interaktive (Feedback/Status) wird farblich stark zurückgefahren (grau).
   Gilt ausschließlich für V3 ([data-layout="v3"]) — V1/V2 bleiben unberührt. CTAs (btn--primary)
   behalten Lime, weil dort etwas zu tun ist. */
/* Traktor-/Mähdrescher-Animation grau statt lime (nur V3). */
.shell[data-layout="v3"] .csv2__harvester { filter: grayscale(1) opacity(.92); }
/* Fortschrittsbalken im Footer ist reines Feedback → grau statt lime. */
.shell[data-layout="v3"] .foot-bar { background: rgba(0,0,0,0.10); }
.shell[data-layout="v3"] .foot-bar > i { background: #9a9a9a; }

/* V3-Header: kleiner Übersicht-Toggle (ersetzt den großen Segmented Button).
   48x48 Icon-Button, 4px Radius. Interaktiv → Lime erlaubt: inaktiv = transparent,
   aktiv = hellgrüner (Lime-Tint) Hintergrund, Icon bleibt dunkel. */
.shell[data-layout="v3"] .ov-toggle { display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: 0; background: transparent; cursor: pointer;
  color: var(--text-primary); border-radius: 4px; transition: background-color .12s ease, color .12s ease; }
.shell[data-layout="v3"] .ov-toggle:hover { background: rgba(0,0,0,0.06); }
.shell[data-layout="v3"] .ov-toggle--on,
.shell[data-layout="v3"] .ov-toggle--on:hover { background: rgba(179,198,24,0.35); color: var(--text-primary); }
.shell[data-layout="v3"] .ov-toggle:focus-visible { outline: 2px solid var(--claas-lime); outline-offset: 2px; }

/* V3-Sequencer: aktiver Schritt, der eine echte Nutzer-Eingabe braucht, „poppt" stark —
   kräftiges Lime statt gedämpft, Label fett/dunkel, Status-Punkt weiß. NUR V3, nur interaktive Steps. */
.shell[data-layout="v3"] .seq-node--await.seq-node--current { background: var(--claas-lime); }
.shell[data-layout="v3"] .seq-node--await.seq-node--current .seq-lbl { color: var(--text-primary); font-weight: 700; }
.shell[data-layout="v3"] .seq-node--await .seq-dot--current { background: #fff; }
.shell[data-layout="v3"] .seq-node--await .seq-dot--current::after { border-color: #fff; }

/* V3-Sequencer eingeklappt: Chevron oben, darunter vertikal gedrehtes „TEST SEQUENCE"-Label. */
.shell[data-layout="v3"] .seq--collapsed .seq-head { flex-direction: column; align-items: center; gap: var(--sp-m); }
.shell[data-layout="v3"] .seq-head__vlabel { writing-mode: vertical-rl; white-space: nowrap; line-height: 1;
  font-family: var(--font-header); font-size: var(--fs-h6); text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-secondary); margin-top: var(--sp-xs); }

/* === V3-Footer (Figma 501:14621): Takt/Sitzung links, globaler System-Status rechts === */
.shell[data-layout="v3"] .footv3-times { display: flex; align-items: center; gap: var(--sp-xl); }
/* Globaler System-Status: Punkt (togglet Zustand) + Label (öffnet Dialog). grün / orange / rot. */
.shell[data-layout="v3"] .foot-sys { display: inline-flex; align-items: center; gap: var(--sp-xs);
  font-size: 18px; letter-spacing: .08px; color: var(--text-secondary); white-space: nowrap; }
.shell[data-layout="v3"] .foot-sys__dot { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%;
  background: #6b6b6b; flex: 0 0 auto; cursor: pointer; }
.shell[data-layout="v3"] .foot-sys__lbl { border: 0; background: transparent; cursor: pointer; padding: 0;
  font: inherit; color: inherit; }
.shell[data-layout="v3"] .foot-sys__lbl:hover { color: var(--text-primary); }
.shell[data-layout="v3"] .foot-sys--ok .foot-sys__dot { background: var(--status-ok); }
.shell[data-layout="v3"] .foot-sys--error .foot-sys__dot { background: #ed6c02; }
.shell[data-layout="v3"] .foot-sys--critical .foot-sys__dot { background: var(--status-nok); }

/* System-Status-Dialoge (teleported nach body → UNSCOPED; erscheinen nur in V3). */
.sysdlg { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 40px; background: rgba(0,0,0,0.4); }
.sysdlg__card { width: min(560px, 92vw); background: var(--surface); border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,0.35); padding: var(--sp-l) var(--sp-xl) var(--sp-xl); }
.sysdlg__head { display: flex; align-items: center; gap: var(--sp-m); }
.sysdlg__ico { flex: 0 0 auto; }
.sysdlg__ico--critical { color: var(--status-nok); }
.sysdlg__ico--error { color: #ed6c02; }
.sysdlg__title { flex: 1 1 auto; margin: 0; font-family: var(--font-header); font-size: 24px; line-height: 1.2; color: var(--text-primary); }
.sysdlg__x { flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer; color: var(--text-primary); border-radius: 4px; }
.sysdlg__x:hover { background: var(--surface-grey); }
.sysdlg__body { margin-top: var(--sp-m); font-size: 18px; line-height: 1.5; color: var(--text-secondary); }
.sysdlg__body p { margin: 0 0 var(--sp-m); }
.sysdlg__body p:last-child { margin-bottom: 0; }
.sysdlg__list { margin: 0 0 var(--sp-m); padding-left: 1.4em; }
.sysdlg__actions { display: flex; justify-content: flex-end; margin-top: var(--sp-l); }

/* OK-Bereich im Diagramm (Live-/Brems-Chart): kräftigerer Grünton für bessere Sichtbarkeit auf
   kontrastschwachen Displays. CSS-`fill` überschreibt das inline-Presentation-Attribut → V1/V2 bleiben unberührt. */
.shell[data-layout="v3"] .ok-band { fill: rgba(179,198,24,0.34); stroke: none; }

/* V3: Steps im Sequencer sind nicht mehr navigierbar (nur Overview/Report springt) → kein Klick-Cursor/Hover.
   Module (Cluster) bleiben auf-/zuklappbar, daher ausgenommen. */
.shell[data-layout="v3"] .seq-node:not(.seq-node--module) { cursor: default; }
.shell[data-layout="v3"] .seq-node:not(.seq-node--module):not(.seq-node--current):hover { background: transparent; }

/* === V3: Bild vergrößern (Lightbox) === */
/* Vergrößern-Icon oben rechts auf dem Bild (nur V3). */
.shell[data-layout="v3"] .blk-image { position: relative; }
.shell[data-layout="v3"] .blk-image__expand { position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; cursor: pointer; color: var(--text-primary);
  background: rgba(255,255,255,0.82); box-shadow: var(--elevation-1); transition: background-color .12s ease; }
.shell[data-layout="v3"] .blk-image__expand:hover { background: #fff; }
.shell[data-layout="v3"] .blk-image__expand:focus-visible { outline: 2px solid var(--claas-lime); outline-offset: 2px; }
/* Bild-Dialog — via <teleport to="body"> außerhalb der .shell, daher UNSCOPED (rendert nur in V3).
   Weißer Dialog mit Titel „Step Name | Step Description", Schließen-X, Bild max. im Rahmen. */
.imgview { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center;
  padding: 60px; background: rgba(0,0,0,0.5); }   /* 60px Rand zu allen Bildschirmkanten (fast Vollbild) */
.imgview__dialog { display: flex; flex-direction: column; width: 100%; height: 100%;
  background: var(--surface); border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,0.35); overflow: hidden; }
.imgview__bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-l); padding: var(--sp-l) var(--sp-l) var(--sp-m); }
.imgview__title { margin: 0; font-family: var(--font-header); font-size: 22px; line-height: 1.25; color: var(--text-primary); }
.imgview__close { flex: 0 0 auto; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; cursor: pointer; color: var(--text-primary); background: transparent; }
.imgview__close:hover { background: var(--surface-grey); }
.imgview__close:focus-visible { outline: 2px solid var(--claas-lime); outline-offset: 2px; }
/* Definite Box (position:relative + absolut gefülltes Medium) → object-fit:contain skaliert zuverlässig
   auf maximale Größe, hochskalierend, ohne jemals zu beschneiden. */
.imgview__body { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 var(--sp-l) var(--sp-l); }
.imgview__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* max-* zurücksetzen: die Chart-Klassen (.brake__chart max-height:400px, .blk-graph max-width) begrenzen
   das SVG sonst auch im Dialog, weil sie als reine Klassen-Selektoren weiter greifen. */
.imgview__body svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
/* OK-Band auch im Dialog randlos + kräftig (Dialog liegt außerhalb der .shell → separat). */
.imgview .ok-band { stroke: none; fill: rgba(179,198,24,0.34); }
/* Wrapper des Diagramm-Zooms: außerhalb des Zooms unsichtbar (SVG bleibt inline in der Card). */
.mz-pass { display: contents; }

/* V3: Fortschrittsleiste sitzt zentral im Header (statt im Footer) → Footer-Offset entfernen. */
.shell[data-layout="v3"] .c-header__progress { padding-left: 0; flex: 0 1 auto; }

/* V3-Footer: Zeit-/MN-Blöcke links linksbündig (Standard-.foot-tb ist rechtsbündig). */
.shell[data-layout="v3"] .footv3-times .foot-tb { align-items: flex-start; }

/* V3-Footer links: auch die Werte (Timestamps/MN) linksbündig — Standard-.foot-tb__val ist rechtsbündig mit min-width. */
.shell[data-layout="v3"] .footv3-times .foot-tb__val { text-align: left; min-width: 0; }

/* V3: tertiärer „Überspringen"-Button unter der Hauptbutton-Reihe — dezent, kein Button-Styling. */
.shell[data-layout="v3"] .csv2__skip { flex: 0 0 auto; align-self: center; margin-top: var(--sp-xs);
  display: inline-flex; align-items: center; gap: var(--sp-xs); border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 18px; color: var(--text-secondary); }
.shell[data-layout="v3"] .csv2__skip:hover { color: var(--text-primary); }
.shell[data-layout="v3"] .csv2__skip:focus-visible { outline: 2px solid var(--claas-lime); outline-offset: 2px; border-radius: var(--radius-s); }

/* V3: „Test stoppen" im Hover rot statt lime (Stop-Aktion). */
.shell[data-layout="v3"] .btn-stop:hover { color: var(--status-nok); }

/* V3: Zieh-Griff zwischen grauem Bereich und Card (Breite grau = 25–50vw, per Pointer). */
.shell[data-layout="v3"] .csv2__resizer { position: absolute; top: 0; bottom: 0; width: var(--sp-xl); z-index: 5;
  cursor: col-resize; display: flex; align-items: center; justify-content: center; touch-action: none; }
.shell[data-layout="v3"] .csv2__resizer::before { content: ""; width: 4px; height: 56px; border-radius: 2px;
  background: var(--divider); transition: background-color .12s ease, height .12s ease; }
.shell[data-layout="v3"] .csv2__resizer:hover::before { background: var(--claas-lime-dark); height: 96px; }

/* V3-Einstellung: Sequenz-Liste links statt rechts (greift nicht, wenn Sequenz ohnehin ausgeblendet ist). */
.shell[data-layout="v3"] .cockpit--seq-left:not(.cockpit--seq-hidden) {
  grid-template-columns: var(--seq-w) 1fr; grid-template-areas: "seq main";
}

/* V3-Einstellungsseite: weißes Sheet mit Optionen. */
.shell[data-layout="v3"] .settings { width: 100%; height: 100%; box-sizing: border-box; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-faint); border-radius: 8px; box-shadow: var(--elevation-1);
  padding: 48px 56px; }
.shell[data-layout="v3"] .settings__title { margin: 0 0 var(--sp-xl); font-family: var(--font-header); font-size: 32px; color: var(--text-primary); }
.shell[data-layout="v3"] .settings__group { margin-bottom: var(--sp-xl); }
.shell[data-layout="v3"] .settings__label { margin: 0 0 var(--sp-m); font-weight: 700; font-size: 18px; color: var(--text-primary); }
.shell[data-layout="v3"] .settings__opts { display: flex; gap: var(--sp-xl); }
.shell[data-layout="v3"] .settings__opt { display: inline-flex; align-items: center; gap: var(--sp-xs); font-size: 18px; cursor: pointer; }
.shell[data-layout="v3"] .settings__opt input { accent-color: var(--claas-lime-dark); width: 18px; height: 18px; }

/* V3-Kalibrierung: Zähler als Indication Bar unten in der Card (Live-Wert links, Ziel rechts). */
.shell[data-layout="v3"] .cal-bar { flex: 0 0 auto; margin-top: auto; display: flex; align-items: center; gap: var(--sp-m); width: 100%; }
.shell[data-layout="v3"] .cal-bar__num { font-family: var(--font-header); font-size: 22px; font-variant-numeric: tabular-nums; color: var(--text-primary); min-width: 72px; }
.shell[data-layout="v3"] .cal-bar__num--l { text-align: right; }
.shell[data-layout="v3"] .cal-bar__track { flex: 1 1 auto; height: 16px; background: rgba(179,198,24,0.35); overflow: hidden; }
.shell[data-layout="v3"] .cal-bar__track > i { display: block; height: 100%; background: var(--claas-lime-dark); transition: width .15s linear; }

/* V3: wartet der Schritt auf Nutzer-Eingabe (interaktiv, kein Fehler) → hellgrüner, sanft blinkender
   Rahmen um die weiße Card (analog zum roten Puls im Fehlerfall). */
.shell[data-layout="v3"] .csv2--await .csv2__card { border: 2px solid var(--claas-lime); animation: pulse-lime 1.6s ease-in-out infinite; }
@keyframes pulse-lime { 0%, 100% { box-shadow: 0 0 0 0 rgba(179,198,24,0); } 50% { box-shadow: 0 0 0 6px rgba(179,198,24,0.5); } }
