/* Werkzeug-Root-Overlays (SPEC-0124) — 1:1-Port der scoped Styles aus
 * LoadTestOverlay.vue / HmiRuntimeOverlay.vue / IntegrationDesignerView.vue.
 * Light DOM: die Klassen sitzen direkt am Custom-Element-Host.
 * Read-only-Zusätze: .loadtest-config__foot-Hinweis, .hmi-runtime-interim und
 * .designer-probe (ersetzt das <iframe> bei nicht erreichbarem Upstream).
 * Farben/Abstände ausschließlich über den Token-Stack (SPEC-0002). */

/* ------------------------------------------------------------- Lasttest --- */
.loadtest-overlay {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px);
  color: var(--text);
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
}
.loadtest-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3, 12px);
}
.loadtest-header__lead h3 { margin: 0; }
.loadtest-header__lead p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.85rem; }
.loadtest-actions { display: flex; gap: var(--space-1, 6px); }
.loadtest-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.loadtest-icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.loadtest-icon-btn:hover:not(:disabled) { border-color: var(--primary); }
.loadtest-icon-btn--primary { border-color: var(--primary); color: var(--primary); }
.loadtest-icon-btn--primary:hover:not(:disabled) { background: var(--surface-elevated); }

/* Blaue „was passiert gerade"-Zeile — eine Zeile, abgeschnitten. */
.loadtest-activity {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: 6px 12px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--blue, var(--primary));
  border-left-width: 3px;
  background: var(--surface-elevated);
  color: var(--blue, var(--primary));
  font-size: 0.85rem;
}
.loadtest-activity__icon { font-size: 18px; flex: 0 0 auto; }
.loadtest-activity__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.loadtest-body { display: flex; flex-direction: column; gap: var(--space-3, 12px); }
.loadtest-muted { color: var(--text-muted); font-size: 0.82rem; margin: 0; }
.loadtest-config input[type="number"],
.loadtest-config input[type="range"] {
  width: 100%;
  background: var(--control-bg, var(--surface));
  color: var(--control-text, var(--text));
  border: 1px solid var(--control-border, var(--border));
  border-radius: var(--radius-sm, 6px);
  padding: 6px 8px;
}
.loadtest-config__group {
  margin: var(--space-3, 12px) 0 var(--space-1, 6px);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.loadtest-config__group:first-of-type { margin-top: var(--space-2, 8px); }
.loadtest-provisioned {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 6px);
  margin-bottom: var(--space-3, 12px);
}
.loadtest-provisioned__label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.loadtest-provisioned__grid { display: flex; flex-wrap: wrap; gap: var(--space-1, 6px); }
.loadtest-config__foot {
  margin-top: var(--space-3, 12px);
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
}

/* Bestand LoadTestOverlay.vue:723-728 — Fortschrittsraster und Ergebnisraster
   teilen sich dieselbe Rasterregel; nur das Ergebnisraster traegt den unteren
   Abstand. Das Fortschrittsraster fehlte im Port, weil auch die Karte fehlte. */
.loadtest-progress__grid,
.loadtest-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-2, 8px);
}
.loadtest-summary { margin-bottom: var(--space-3, 12px); }
.loadtest-metric { display: flex; flex-direction: column; gap: 2px; }
.loadtest-metric--card {
  padding: var(--space-2, 8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-elevated);
}
.loadtest-metric__label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.loadtest-metric__value { font-size: 1.25rem; font-weight: 600; }
.loadtest-metric__value small { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); margin-left: 2px; }
/* Bestand :743-744 — gruen/rot eingefaerbte Kennzahlen (Erfolg, Fehler,
   Fehlerrate). Der Port trug die Klassennamen nicht, also fehlte die Farbe. */
.loadtest-metric__value--ok { color: var(--success); }
.loadtest-metric__value--bad { color: var(--danger); }

.loadtest-results__head {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-2, 8px);
  flex-wrap: wrap;
}

.loadtest-table-wrap { overflow-x: auto; }
.loadtest-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.loadtest-table th,
.loadtest-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.loadtest-table th { color: var(--text-muted); font-weight: 600; }
.loadtest-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.loadtest-table .bad { color: var(--danger); }

.loadtest-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.loadtest-run {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 8px);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-elevated);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.loadtest-run--active { border-color: var(--primary); }
.loadtest-run__id { font-family: monospace; font-size: 0.8rem; }
.loadtest-run__meta { display: inline-flex; align-items: center; gap: var(--space-2, 8px); }
.loadtest-run__meta small { color: var(--text-muted); }

/* ---------------------------------------------------------- HMI Runtime --- */
.hmi-runtime-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  box-sizing: border-box;
  color: var(--text);
  background: var(--surface);
}
.hmi-runtime-header,
.hmi-runtime-contextbar,
.hmi-runtime-workspace { min-width: 0; }
.hmi-runtime-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 0 2px;
}
.hmi-runtime-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 38px;
  border-radius: 4px;
  background: var(--surface-elevated);
  overflow: hidden;
}
.hmi-runtime-tab {
  min-width: 86px;
  height: 38px;
  border: 0;
  border-top: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
}
.hmi-runtime-tab.active {
  border-top-color: var(--primary);
  background: var(--surface-elevated);
  color: var(--text);
}
.hmi-runtime-tab:disabled { opacity: 0.45; cursor: not-allowed; }
.store-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--primary);
  margin-bottom: 6px;
}
.hmi-runtime-store .store-head h4 { margin: 0; font-size: 1.4rem; }
.hmi-runtime-actions,
.hmi-runtime-contextbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.hmi-runtime-contextbar {
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-card);
}
.hmi-runtime-contextbar__pills,
.hmi-runtime-contextbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.hmi-runtime-actions select {
  min-height: 34px;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--control-border, var(--border));
  background: var(--control-bg, var(--surface));
  color: var(--control-text, var(--text));
}
.hmi-runtime-workspace { display: block; flex: 1; min-height: 0; }
.hmi-runtime-store {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}
.hmi-runtime-store .store-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 4px 0;
}
.hmi-runtime-grid-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}
.hmi-runtime-groups {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding: 4px 2px 28px;
  box-sizing: border-box;
}
.hmi-runtime-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hmi-runtime-group__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 2px;
}
.hmi-runtime-group__title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}
.hmi-runtime-grid {
  min-height: 100%;
  display: grid;
  gap: 18px;
  box-sizing: border-box;
  grid-template-columns: repeat(auto-fill, minmax(260px, 280px));
  grid-auto-rows: minmax(150px, auto);
}
.hmi-runtime-tile {
  position: relative;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-elevated);
  color: inherit;
  padding: 18px;
  min-height: 148px;
  display: grid;
  gap: 24px;
  align-content: start;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
.hmi-runtime-tile:disabled { cursor: not-allowed; opacity: 0.72; }
.hmi-runtime-tile:hover,
.hmi-runtime-tile:focus-visible {
  border-color: var(--primary);
  outline: none;
}

/* SPEC-0646 — Klasse B: der Ersatz war ein reiner Rahmenwechsel und damit
   (a) nicht von :hover zu unterscheiden und (b) im Windows-Kontrastmodus
   wirkungslos, weil dort jeder Rahmen dieselbe Systemfarbe traegt. Ring aus
   primitives.css nachgezogen. */
.hmi-runtime-tile:focus-visible {
  box-shadow: var(--shadow-card), 0 0 0 3px var(--primary-soft);
}
.tile-topline { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tile-icon {
  color: var(--text);
  font-size: 30px;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: none;
}
.tile-title { font-size: 1.14rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.18; }
.hmi-runtime-interim {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.hmi-runtime-interim code {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text);
}

.hmi-runtime-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 36px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  box-sizing: border-box;
}

.hmi-runtime-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 900;
}

.hmi-runtime-panel__dialog {
  width: min(1500px, 94vw);
  max-height: min(880px, 86vh);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-elevated) 90%, transparent);
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hmi-runtime-panel.is-fullscreen .hmi-runtime-panel__dialog {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
}

.hmi-runtime-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
}

.hmi-runtime-panel__head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.hmi-runtime-panel__head p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.hmi-runtime-panel__actions {
  display: flex;
  gap: 8px;
}

.hmi-runtime-panel__actions button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface-elevated));
  color: var(--text);
  cursor: pointer;
}

.hmi-assembly {
  margin: 0 20px 20px;
  min-height: 620px;
  background: var(--surface-elevated);
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  box-shadow: 0 12px 40px rgb(0 0 0 / 28%);
}

.hmi-assembly__top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 12px 22px;
}

.hmi-assembly__brand,
.hmi-assembly__user,
.hmi-assembly__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hmi-avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--success);
  color: var(--surface-elevated);
  font-weight: 800;
}

.hmi-assembly__brand strong { display: block; font-size: 1.2rem; }
.hmi-assembly__brand span:not(.hmi-avatar),
.hmi-assembly__user span:not(.hmi-avatar) { color: var(--text-muted); }

.hmi-assembly__actions button {
  border: 0;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface-sunken));
  color: var(--surface-elevated);
  min-height: 42px;
  padding: 0 22px;
  font-weight: 800;
  font-size: 1rem;
}

.hmi-assembly__tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.hmi-assembly__tabs button {
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--text-muted);
  color: var(--surface-elevated);
  min-height: 54px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1rem;
}

.hmi-assembly__tabs button.active {
  background: var(--surface-elevated);
}

.hmi-assembly__body {
  display: grid;
  grid-template-columns: minmax(360px, 38%) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  background: var(--surface-elevated);
}

.hmi-assembly__orders,
.hmi-assembly__main,
.hmi-assembly__selected,
.hmi-assembly__stats article {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: 0 3px 12px rgb(0 0 0 / 10%);
}

.hmi-assembly__orders {
  padding: 22px;
}

.hmi-section-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 900;
}

.hmi-assembly h3 {
  margin: 8px 0 28px;
  font-size: 1.55rem;
}

.hmi-assembly input {
  width: 100%;
  box-sizing: border-box;
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface-sunken), var(--surface-sunken));
  color: var(--text-muted);
  padding: 0 18px;
  font-size: 1rem;
}

.hmi-assembly__main {
  padding: 18px;
}

.hmi-assembly__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hmi-assembly__stats article {
  min-height: 116px;
  display: grid;
  place-items: center;
  text-align: center;
}

.hmi-assembly__stats strong {
  color: var(--text-muted);
  text-transform: uppercase;
}

.hmi-assembly__stats span {
  font-size: 4rem;
  font-weight: 900;
  line-height: 0.9;
}

.hmi-assembly__selected {
  margin-top: 16px;
  min-height: 230px;
  padding: 18px;
  box-shadow: none;
}

.hmi-assembly__serial {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-top: 16px;
}

.hmi-assembly__serial button,
.hmi-assembly__footer button {
  border: 0;
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface-sunken));
  color: var(--surface-elevated);
  font-weight: 800;
  font-size: 1rem;
}

.hmi-assembly__footer {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: center;
  min-height: 82px;
  border-top: 1px solid var(--border);
}

.hmi-progress {
  width: 42px;
  height: 8px;
  background: var(--success);
  justify-self: start;
  margin-left: 34px;
}

/* -------------------------------------------------- Integration Designer --- */
.integration-designer-view {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
  gap: 6px;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
}
.designer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  padding: 3px 10px;
  min-height: 28px;
  max-height: 28px;
  box-sizing: border-box;
  overflow: hidden;
}
.dialog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dialog-breadcrumb .current { color: var(--text); }
.dialog-breadcrumb .sep { opacity: 0.6; }
/* Der Menue-Kruemel ist ein echter <button> (Bestand
   IntegrationDesignerView.vue) — diese Regeln nehmen ihm die
   Browser-Schaltflaechenoptik, damit er wie Kruemeltext aussieht, und geben
   ihm beim Ueberfahren die Anfassbarkeit zurueck. Deklarationen zeichengleich
   zum Bestand; keine harten Farbwerte, nur Themen-Variablen. */
.crumb-btn {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.crumb-btn:hover {
  color: var(--text);
  text-decoration: underline;
}
.designer-link { color: var(--primary); font-weight: 600; white-space: nowrap; font-size: 0.85rem; }
.designer-stage {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.designer-frame { width: 100%; height: 100%; border: none; display: block; }
.designer-probe {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.designer-probe--error { color: var(--text); }
.designer-probe h4 { margin: 0 0 4px; font-size: 1rem; }
.designer-probe p { margin: 0 0 4px; font-size: 0.85rem; color: var(--text-muted); }
.designer-probe__hint { max-width: 68ch; }
.designer-probe .material-icons { color: var(--danger); font-size: 26px; flex: 0 0 auto; }

/* ===== HMI-Bedienpanels =====================================================
 * Stile aus den Bestands-Panels (components/Hmi*Panel.vue, scoped styles).
 * Der Port lagert CSS aus, deshalb liegen sie hier statt im Element.
 */

.hmi-runtime-panelhost {
  margin: 12px 0;
  padding: 0;
}

.hmi-app-panel {
  display: block;
  padding: 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 12px);
  box-shadow: var(--shadow-card);
}

.hmi-app-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hmi-app-panel .panel-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hmi-app-panel .panel-head h4 { margin: 2px 0 4px; font-size: 1.05rem; }
.hmi-app-panel .panel-head p { margin: 0; font-size: 0.84rem; color: var(--text-muted); }

.hmi-app-panel .context-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hmi-app-panel .search-row {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.hmi-app-panel .search-row .search-icon {
  position: absolute;
  left: 8px;
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.hmi-app-panel .search-row input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  color: var(--control-text, inherit);
  background: var(--control-bg, transparent);
  border: 1px solid var(--control-border, currentColor);
  border-radius: var(--radius-control, 8px);
  font: inherit;
}

.hmi-app-panel .ghost-btn,
.hmi-app-panel .primary-btn {
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  border-radius: var(--radius-control, 8px);
  border: 1px solid var(--control-border, currentColor);
  color: var(--control-text, inherit);
  background: var(--control-bg, transparent);
}

.hmi-app-panel .primary-btn {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.hmi-app-panel .ghost-btn--compact { padding: 4px 8px; font-size: 0.78rem; }
.hmi-app-panel .ghost-btn:disabled,
.hmi-app-panel .primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- Linien-/Stationsliste ---------------------------------------------- */
.workcenter-list {
  display: grid;
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
}

.workcenter-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 12px);
  background: var(--surface);
}

.workcenter-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.workcenter-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.workcenter-code { font-size: 0.76rem; color: var(--text-muted); }
.workcenter-name { font-weight: 600; }
.workcenter-meta { font-size: 0.76rem; color: var(--text-muted); }

.station-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.station-chip {
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.station-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.station-chip__main { font-size: 0.82rem; font-weight: 600; }
.station-chip__sub { font-size: 0.7rem; color: var(--text-muted); }

.empty-state--inline {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-line--error {
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-control, 8px);
  font-size: 0.82rem;
}

/* === HMI-Bedienpanel „Auftrag starten / stoppen" =========================
   Portierte Stile aus HmiOrderControlPanel.vue (<style scoped>). Der Bestand
   kapselt ueber Vue-Scoping; hier uebernimmt das die Panel-Klasse.
   Die Regeln stehen bewusst NACH den generischen `.hmi-app-panel`-Regeln:
   beide haben dieselbe Spezifitaet (0,2,0), die Quellreihenfolge entscheidet,
   und das Auftragsterminal braucht seine eigene, groessere Suchzeile. */

.hmi-order-control-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.hmi-order-control-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hmi-order-control-panel .panel-eyebrow, .hmi-order-control-panel .order-detail__eyebrow, .hmi-order-control-panel .table-headline__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.hmi-order-control-panel .panel-head h4, .hmi-order-control-panel .order-detail__head h5, .hmi-order-control-panel .action-dialog__head h5 {
  margin: 0;
  font-size: 1.2rem;
}

.hmi-order-control-panel .panel-head p, .hmi-order-control-panel .order-detail__head p, .hmi-order-control-panel .action-dialog__head p {
  margin: 4px 0 0;
  opacity: 0.76;
  line-height: 1.4;
}

.hmi-order-control-panel .context-strip, .hmi-order-control-panel .order-terminal__toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hmi-order-control-panel .order-terminal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.hmi-order-control-panel .order-terminal__toolbar {
  justify-content: space-between;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hmi-order-control-panel .search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hmi-order-control-panel .search-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: inherit;
  outline: none;
  font-size: 1.05rem;
}

/* SPEC-0646 — Klasse A: hier stand `outline: none` ohne jeden Ersatz. Das Feld
   ist rahmenlos und liegt in einer umrandeten Zeile; wer es mit der Tastatur
   erreicht, sah GAR NICHTS. Der Ring gehoert an die ZEILE, nicht an das Feld —
   das Feld hat keine eigene sichtbare Kante, an der ein Ring haengen koennte. */
.hmi-order-control-panel .search-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.hmi-order-control-panel .search-icon {
  color: var(--primary);
}

.hmi-order-control-panel .toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
}

.hmi-order-control-panel .toggle-field input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.hmi-order-control-panel .order-terminal__body {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(340px, 0.42fr);
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.hmi-order-control-panel .order-table-card, .hmi-order-control-panel .order-detail {
  min-height: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: none;
}

.hmi-order-control-panel .order-table-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hmi-order-control-panel .table-headline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.hmi-order-control-panel .order-table-wrap {
  min-height: 0;
  overflow: auto;
}

.hmi-order-control-panel .order-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.hmi-order-control-panel .order-table th, .hmi-order-control-panel .order-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.hmi-order-control-panel .order-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--surface);
}

.hmi-order-control-panel .order-table tr {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.hmi-order-control-panel .order-table tbody tr:hover {
  background: var(--primary-soft);
}

.hmi-order-control-panel .order-table tbody tr.selected {
  background: var(--primary-soft);
  box-shadow: inset 4px 0 0 var(--primary);
}

.hmi-order-control-panel .order-table tbody tr.activated {
  background: var(--success-soft);
}

.hmi-order-control-panel .order-table td small {
  display: block;
  margin-top: 4px;
  opacity: 0.68;
}

.hmi-order-control-panel .order-detail {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.hmi-order-control-panel .detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hmi-order-control-panel .detail-item {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 4px;
}

.hmi-order-control-panel .detail-item--wide {
  grid-column: 1 / -1;
}

.hmi-order-control-panel .detail-item span, .hmi-order-control-panel .confirmation-summary span {
  opacity: 0.7;
  font-size: 0.78rem;
}

.hmi-order-control-panel .terminal-actions {
  display: grid;
  gap: 10px;
}

.hmi-order-control-panel .terminal-action {
  min-height: 58px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  cursor: pointer;
}

.hmi-order-control-panel .terminal-action--primary {
  border-color: var(--success);
  box-shadow: var(--shadow-card);
}

.hmi-order-control-panel .terminal-action--danger {
  border-color: var(--warning);
}

.hmi-order-control-panel .terminal-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.hmi-order-control-panel .state-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
}

.hmi-order-control-panel .state-pill--new {
  border-color: var(--border);
}

.hmi-order-control-panel .state-pill--started {
  border-color: var(--success);
  color: var(--success);
}

.hmi-order-control-panel .state-pill--finished {
  border-color: var(--warning);
  color: var(--warning);
}

.hmi-order-control-panel .hint-box, .hmi-order-control-panel .empty-state {
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--surface);
  padding: 14px;
}

.hmi-order-control-panel .hint-box {
  margin-top: auto;
  display: grid;
  gap: 4px;
}

.hmi-order-control-panel .hint-box span {
  opacity: 0.76;
  line-height: 1.4;
}

.hmi-order-control-panel .empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
}

.hmi-order-control-panel .empty-state--large {
  min-height: 320px;
}

.hmi-order-control-panel .empty-state--inline {
  margin: 14px;
  min-height: 140px;
}

.hmi-order-control-panel .empty-state__title {
  font-weight: 700;
}

.hmi-order-control-panel .status-line {
  min-height: 26px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
}

.hmi-order-control-panel .status-line--success {
  border-color: var(--success);
  color: var(--success);
}

.hmi-order-control-panel .status-line--error {
  border-color: var(--danger);
  color: var(--danger);
}

.hmi-order-control-panel .action-dialog {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 18px;
}

.hmi-order-control-panel .action-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface);
  backdrop-filter: blur(4px);
}

.hmi-order-control-panel .action-dialog__card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-overlay);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.hmi-order-control-panel .action-dialog__head, .hmi-order-control-panel .action-dialog__actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hmi-order-control-panel .action-dialog__actions {
  align-items: center;
  justify-content: flex-end;
}

.hmi-order-control-panel .confirmation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hmi-order-control-panel .confirmation-summary > div, .hmi-order-control-panel .field-stack {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.hmi-order-control-panel .field-stack select, .hmi-order-control-panel .field-stack textarea, .hmi-order-control-panel .order-terminal__toolbar select {
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  padding: 8px 10px;
}

@media (max-width: 1100px) {
  .hmi-order-control-panel .order-terminal__body, .hmi-order-control-panel .confirmation-summary {grid-template-columns: 1fr;
  }
  .hmi-order-control-panel .detail-grid {grid-template-columns: 1fr;
  }
}

/* === HMI-Bedienpanel „Auftrag anlegen" ==================================
   Portierte Stile aus HmiOrderCreationPanel.vue (<style scoped>), auf die
   Konsolen-Klasse eingeschraenkt — der Bestand kapselt ueber Vue-Scoping. */

.hmi-order-creation-console {
  --hmi-bg: var(--surface);
  --hmi-ink: var(--text);
  --hmi-muted: var(--text-muted);
  --hmi-navy: var(--surface-elevated);
  --hmi-line: var(--border);
  height: 100%;
  /* ERGAENZUNG gegenueber dem Bestand: dort ist das Wurzelelement ein <section>
     in einer Flex-Spalte mit Hoehe, hier ein Custom Element. Ohne vorgegebene
     Hoehe loest `height: 100%` zu 0 auf, das Grid mit `minmax(0, 1fr)` faellt
     zusammen und `overflow: hidden` schiebt die Karten uebereinander — gemessen
     daran, dass ein <select> den Klick auf „Auftrag anlegen" abfing. Die
     Mindesthoehe greift nur, wenn der Wirt keine eigene vorgibt. */
  min-height: min(720px, 100dvh);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--hmi-bg);
  color: var(--hmi-ink);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-overlay);
}

.hmi-order-creation-console .assembly-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 0 16px;
  align-items: center;
  background: var(--hmi-navy);
  color: var(--text-inverse);
}

.hmi-order-creation-console .assembly-brand, .hmi-order-creation-console .assembly-top-actions, .hmi-order-creation-console .operator-badge, .hmi-order-creation-console .footer-primary {
  display: flex;
  align-items: center;
}

.hmi-order-creation-console .assembly-logo, .hmi-order-creation-console .operator-badge span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 950;
}

.hmi-order-creation-console .assembly-brand {
  gap: 12px;
}

.hmi-order-creation-console .assembly-brand strong {
  display: block; font-size: 1.2rem; letter-spacing: 0.08em;
}

.hmi-order-creation-console .assembly-brand small, .hmi-order-creation-console .operator-badge small {
  display: block; color: var(--text-soft);
}

.hmi-order-creation-console .assembly-top-actions {
  gap: 10px;
}

.hmi-order-creation-console .top-action {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-inverse);
  font-weight: 800;
  cursor: pointer;
}

.hmi-order-creation-console .top-action:disabled {
  opacity: 0.45; cursor: not-allowed;
}

.hmi-order-creation-console .operator-badge {
  gap: 10px;
  min-width: 190px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.hmi-order-creation-console .assembly-toast {
  margin: 10px 14px 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
}

.hmi-order-creation-console .assembly-toast--success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success);
}

.hmi-order-creation-console .assembly-toast--error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.hmi-order-creation-console .order-create-layout {
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(680px, 1.15fr);
  grid-template-rows: minmax(0, 1fr) 260px;
  gap: 14px;
  background: var(--hmi-bg);
}

.hmi-order-creation-console .product-panel {
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 16px;
}

.hmi-order-creation-console .form-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
}

.hmi-order-creation-console .recent-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.hmi-order-creation-console .hmi-card {
  border: 1px solid var(--hmi-line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 16px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.hmi-order-creation-console .hmi-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hmi-order-creation-console .hmi-card-head span, .hmi-order-creation-console .panel-copy, .hmi-order-creation-console .field-stack span, .hmi-order-creation-console .metric-row span, .hmi-order-creation-console .selection-meta, .hmi-order-creation-console .selection-code {
  color: var(--hmi-muted);
}

.hmi-order-creation-console .hmi-card-head span, .hmi-order-creation-console .field-stack span, .hmi-order-creation-console .metric-row span, .hmi-order-creation-console .selection-meta, .hmi-order-creation-console .selection-code {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  font-size: 0.78rem;
}

.hmi-order-creation-console .panel-copy {
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.hmi-order-creation-console .hmi-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--hmi-ink);
  padding: 0 14px;
  box-sizing: border-box;
  font: inherit;
}

.hmi-order-creation-console .hmi-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.hmi-order-creation-console .product-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hmi-order-creation-console .legend-chip, .hmi-order-creation-console .type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hmi-order-creation-console .legend-chip--fg, .hmi-order-creation-console .type-badge--fg {
  background: var(--primary-soft);
  color: var(--primary);
}

.hmi-order-creation-console .legend-chip--sfg, .hmi-order-creation-console .type-badge--sfg {
  background: var(--warning-soft);
  color: var(--warning);
}

.hmi-order-creation-console .type-badge--generic {
  background: var(--surface-elevated);
  color: var(--text-muted);
}

.hmi-order-creation-console .product-list, .hmi-order-creation-console .recent-list {
  display: grid;
  gap: 12px;
  overflow: auto;
  min-height: 0;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.hmi-order-creation-console .product-card, .hmi-order-creation-console .recent-row {
  width: 100%;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--hmi-ink);
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: var(--shadow-card);
}

.hmi-order-creation-console .product-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
}

.hmi-order-creation-console .product-card.active, .hmi-order-creation-console .recent-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
}

.hmi-order-creation-console .product-card__visual {
  min-height: 116px;
  border-radius: 4px;
  background: var(--surface-elevated);
  overflow: hidden;
}

.hmi-order-creation-console .product-card__visual img, .hmi-order-creation-console .product-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hmi-order-creation-console .product-card__placeholder, .hmi-order-creation-console .product-preview__placeholder {
  height: 100%;
  display: grid;
  gap: 8px;
  place-items: center;
  color: var(--text-muted);
  padding: 10px;
  text-align: center;
}

.hmi-order-creation-console .product-card__placeholder .material-icons, .hmi-order-creation-console .product-preview__placeholder .material-icons {
  font-size: 46px;
}

.hmi-order-creation-console .product-card__content, .hmi-order-creation-console .product-card__header {
  display: grid;
  gap: 8px;
}

.hmi-order-creation-console .product-card__header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.hmi-order-creation-console .product-card__header strong {
  font-size: 1.35rem;
  line-height: 1.15;
}

.hmi-order-creation-console .product-card__header small {
  color: var(--hmi-muted);
  font-size: 0.92rem;
}

.hmi-order-creation-console .product-card__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--hmi-muted);
  font-weight: 700;
}

.hmi-order-creation-console .metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hmi-order-creation-console .metric-row article {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  min-height: 118px;
}

.hmi-order-creation-console .metric-row strong {
  display: block;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.08;
  color: var(--text);
  margin-top: 18px;
}

.hmi-order-creation-console .form-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 280px;
  gap: 18px;
  min-height: 0;
  /* ERGAENZUNG gegenueber dem Bestand: die Karte sitzt in der 1fr-Zeile von
     .form-panel, traegt dort aber kein overflow. Reicht die Hoehe nicht, quillt
     das Formular ueber den Aktionsstreifen und deckt „Auftrag anlegen" ab —
     gemessen daran, dass das Arbeitsplan-<select> den Klick abfing. Mit
     eigenem Bildlauf bleibt der Streifen immer erreichbar; bei ausreichender
     Hoehe ist die Darstellung unveraendert. Gleiches Muster wie .order-detail
     im Schwesterpanel. */
  overflow: auto;
  border: 1px solid var(--border);
  padding: 16px;
  background: var(--surface);
}

.hmi-order-creation-console .form-card__preview {
  display: grid;
  gap: 12px;
}

.hmi-order-creation-console .product-preview {
  min-height: 180px;
  border-radius: 4px;
  background: var(--surface-elevated);
  overflow: hidden;
}

.hmi-order-creation-console .product-preview__details h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.hmi-order-creation-console .product-preview__details p {
  margin: 0 0 10px;
  color: var(--hmi-muted);
  font-weight: 700;
}

.hmi-order-creation-console .order-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.hmi-order-creation-console .field-stack {
  display: grid;
  gap: 6px;
}

.hmi-order-creation-console .field-stack--full {
  grid-column: 1 / -1;
}

.hmi-order-creation-console .field-note {
  color: var(--hmi-muted);
  font-size: 0.84rem;
}

.hmi-order-creation-console .field-note--warning {
  color: var(--warning);
}

.hmi-order-creation-console .summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--surface);
}

.hmi-order-creation-console .summary-strip span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hmi-muted);
  font-weight: 900;
  font-size: 0.78rem;
}

.hmi-order-creation-console .summary-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.04rem;
}

.hmi-order-creation-console .footer-primary {
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 900;
  cursor: pointer;
  justify-content: center;
  gap: 10px;
}

.hmi-order-creation-console .footer-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hmi-order-creation-console .recent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.hmi-order-creation-console .selection-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hmi-order-creation-console .selection-main strong {
  font-size: 1rem;
  font-weight: 900;
}

.hmi-order-creation-console .selection-main small, .hmi-order-creation-console .empty-note {
  color: var(--hmi-muted);
}

.hmi-order-creation-console .selection-meta, .hmi-order-creation-console .selection-code {
  justify-self: end;
}

@media (max-width: 1480px) {
  .hmi-order-creation-console .order-create-layout {grid-template-columns: minmax(360px, 0.8fr) minmax(560px, 1.2fr);
  }
  .hmi-order-creation-console .form-card {grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .hmi-order-creation-console .order-create-layout {grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 0.9fr) minmax(0, 1fr) 240px;
  }
  .hmi-order-creation-console .product-panel {grid-row: auto;
  }
  .hmi-order-creation-console .metric-row, .hmi-order-creation-console .order-form-grid {grid-template-columns: 1fr;
  }
  .hmi-order-creation-console .field-stack--full {grid-column: auto;
  }
  .hmi-order-creation-console .summary-strip, .hmi-order-creation-console .assembly-topbar {flex-wrap: wrap;
  }
  .hmi-order-creation-console .operator-badge {min-width: 0;
    width: 100%;
    border-left: 0;
    padding-left: 0;
  }
}

/* === HMI-Bedienpanel „Montage" ==========================================
   THEME-VORGABE, Stand der Umsetzung: die Token-Ueberschreibungen des
   Bestands sind entfernt und die semantischen Festwerte (Gut-/Schlecht-
   Banner, gedaempfte Texte, Rahmen) auf Theme-Token gezogen. NICHT
   umgestellt sind bewusst zwei Gruppen, weil sie Bildsprache und nicht
   Farbschema sind: die dunkle Cockpit-Optik der Stufenleiste
   (.stage-tab.active) und die Drohnen-Illustration (.drone-*). Beide
   traegt der Bestand als festes Bedienbild; sie ueber Theme-Token zu
   fuehren waere eine Gestaltungsaenderung, keine Portierung. Wer das
   umdreht, aendert das Erscheinungsbild der Maske — bitte nicht nebenbei.
   Portierte Stile aus HmiGuidedAssemblyPanel.vue (<style scoped>), auf die
   Konsolen-Klasse eingeschraenkt — der Bestand kapselt ueber Vue-Scoping. */

.hmi-assembly-console {
  /* BEWUSSTE ABWEICHUNG vom Bestand (Theme-Vorgabe): dort ueberschreibt dieser
     Block die GLOBALEN Design-Token (--surface, --text, --border, --primary,
     --shadow-*) mit festen Hellwerten. Im Bestand faellt das nicht auf, weil
     die Konsole dort ein eigenes, immer helles Bedienbild ist — im Port wuerde
     die Maske dadurch in JEDEM der vier Themes hell bleiben und als einzige
     Flaeche aus dem Farbschema fallen. Die Ueberschreibungen sind deshalb
     entfernt; die --hmi-*-Zuordnungen darunter greifen unveraendert auf die
     Theme-Token durch, Geometrie und Aufbau bleiben 1:1. */
  --hmi-bg: var(--surface);
  --hmi-ink: var(--text);
  --hmi-muted: var(--text-muted);
  --hmi-navy: var(--surface-elevated);
  --hmi-blue: var(--primary);
  --hmi-accent: var(--primary-soft);
  --hmi-line: var(--border);
  --hmi-danger: var(--danger);
  --hmi-ok: var(--success);
  
  --hmi-tile-bg: var(--surface);
  --hmi-tile-fg: var(--text);
  --hmi-tile-muted: var(--text-muted);
  --hmi-tile-border: var(--border);
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: min(68vh, 760px);
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--hmi-bg);
  color: var(--hmi-ink);
  box-shadow: var(--shadow-overlay);
}

.hmi-assembly-console .assembly-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 0 16px;
  align-items: center;
  background: var(--hmi-navy);
  color: var(--text-inverse);
}

.hmi-assembly-console .assembly-brand, .hmi-assembly-console .assembly-top-actions, .hmi-assembly-console .operator-badge, .hmi-assembly-console .stage-tab, .hmi-assembly-console .footer-primary, .hmi-assembly-console .footer-secondary, .hmi-assembly-console .screen-title-row, .hmi-assembly-console .ticket-head, .hmi-assembly-console .signature-title-row {
  display: flex;
  align-items: center;
}

.hmi-assembly-console .assembly-logo, .hmi-assembly-console .operator-badge span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 950;
}

.hmi-assembly-console .assembly-brand {
  gap: 12px;
}

.hmi-assembly-console .assembly-brand strong, .hmi-assembly-console .assembly-brand .assembly-title {
  display: block; font-size: 1.2rem; letter-spacing: 0.08em; margin: 0; font-weight: 700;
}

.hmi-assembly-console .assembly-brand small, .hmi-assembly-console .operator-badge small {
  display: block; color: var(--text-soft);
}

.hmi-assembly-console .assembly-top-actions {
  gap: 10px;
}

.hmi-assembly-console .top-action {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-inverse);
  font-weight: 800;
  cursor: pointer;
}

.hmi-assembly-console .operator-badge {
  gap: 10px;
  min-width: 190px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.hmi-assembly-console .assembly-stagebar {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--hmi-line);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hmi-assembly-console .stage-tab {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
  cursor: pointer;
}

.hmi-assembly-console .stage-tab.active {
  border-color: var(--primary);
  color: var(--text);
  background: var(--surface);
}

.hmi-assembly-console .stage-tab:disabled {
  opacity: 0.36; cursor: not-allowed;
}

.hmi-assembly-console .assembly-screen {
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  background:
    radial-gradient(circle at 82% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 32%),
    var(--hmi-bg);
}

.hmi-assembly-console .order-screen, .hmi-assembly-console .material-screen, .hmi-assembly-console .work-screen, .hmi-assembly-console .defect-screen {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.hmi-assembly-console .order-screen {
  grid-template-columns: minmax(380px, 0.82fr) minmax(560px, 1.35fr);
}

.hmi-assembly-console .material-screen {
  grid-template-columns: minmax(220px, 0.34fr) minmax(640px, 1fr);
}

.hmi-assembly-console .work-screen {
  grid-template-columns: minmax(220px, 0.38fr) minmax(480px, 1fr) minmax(240px, 0.36fr);
}

.hmi-assembly-console .defect-screen {
  grid-template-columns: minmax(480px, 0.9fr) minmax(520px, 1fr);
}

.hmi-assembly-console .metrics-panel, .hmi-assembly-console .material-scan-panel, .hmi-assembly-console .current-order-panel, .hmi-assembly-console .progress-panel, .hmi-assembly-console .defect-items, .hmi-assembly-console .defect-ticket {
  display: grid;
  min-height: 0;
}

.hmi-assembly-console .metrics-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.hmi-assembly-console .material-scan-panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.hmi-assembly-console .current-order-panel, .hmi-assembly-console .defect-items, .hmi-assembly-console .defect-ticket {
  align-content: start;
  gap: 12px;
}

.hmi-assembly-console .defect-table, .hmi-assembly-console .work-sequence, .hmi-assembly-console .component-inputs {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.hmi-assembly-console .hmi-card {
  border: 1px solid var(--hmi-line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 16px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.hmi-assembly-console .hmi-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}

.hmi-assembly-console .hmi-card-head span, .hmi-assembly-console .screen-title-row span, .hmi-assembly-console .stage-tab, .hmi-assembly-console .instruction-headline span {
  text-transform: uppercase;
}

.hmi-assembly-console .hmi-card-head span, .hmi-assembly-console .screen-title-row span, .hmi-assembly-console .instruction-headline span {
  letter-spacing: 0.16em;
  color: var(--hmi-muted);
  font-weight: 900;
  font-size: 0.78rem;
}

.hmi-assembly-console .hmi-card h2, .hmi-assembly-console .hmi-card h3 {
  margin: 0 0 10px;
}

.hmi-assembly-console .hmi-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--hmi-ink);
  padding: 0 14px;
  box-sizing: border-box;
  font: inherit;
}

.hmi-assembly-console .hmi-input--large {
  min-height: 50px; font-size: 1.08rem;
}

.hmi-assembly-console textarea.hmi-input {
  padding: 12px 14px;
}

.hmi-assembly-console .order-table, .hmi-assembly-console .work-sequence, .hmi-assembly-console .defect-table, .hmi-assembly-console .component-inputs {
  display: grid; gap: 10px;
}

.hmi-assembly-console .order-list-panel {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px;
}

.hmi-assembly-console .order-table {
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
  align-content: start;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.hmi-assembly-console .order-row, .hmi-assembly-console .component-scan-card, .hmi-assembly-console .sequence-card, .hmi-assembly-console .defect-row {
  width: 100%;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--hmi-ink);
  text-align: left;
  cursor: pointer;
}

.hmi-assembly-console .order-row {
  display: grid;
  grid-template-columns: minmax(124px, 0.9fr) minmax(0, 1.7fr) minmax(70px, 0.4fr);
  gap: 16px;
  align-items: start;
  min-height: 92px;
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 3px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-elevated) 96%, transparent), color-mix(in srgb, var(--surface-elevated) 98%, transparent)),
    var(--surface-elevated);
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--primary) 48%, transparent),
    var(--shadow-card);
}

.hmi-assembly-console .order-row.active, .hmi-assembly-console .defect-row.active {
  background: var(--primary-soft); border-color: var(--primary);
}

.hmi-assembly-console .order-row.active {
  border-color: color-mix(in srgb, var(--primary) 95%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-elevated) 98%, transparent), color-mix(in srgb, var(--surface-elevated) 98%, transparent)),
    var(--surface-elevated);
  box-shadow:
    inset 5px 0 0 var(--primary),
    0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent),
    0 14px 28px color-mix(in srgb, var(--surface-elevated) 18%, transparent);
}

.hmi-assembly-console .order-row:hover {
  border-color: color-mix(in srgb, var(--primary) 72%, transparent);
  filter: brightness(1.08);
}

.hmi-assembly-console .order-row-id, .hmi-assembly-console .order-row-main, .hmi-assembly-console .order-row-meta {
  min-width: 0;
}

.hmi-assembly-console .order-row-id {
  color: var(--text-inverse);
  font-size: clamp(0.92rem, 1vw, 1.02rem);
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hmi-assembly-console .order-row-main {
  display: grid;
  gap: 6px;
}

.hmi-assembly-console .order-row-main strong {
  color: var(--text-inverse);
  font-size: clamp(1rem, 1.08vw, 1.14rem);
  line-height: 1.18;
  overflow-wrap: anywhere;
  text-shadow: none;
}

.hmi-assembly-console .order-row-main small {
  color: var(--primary);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hmi-assembly-console .order-row-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--text-soft);
  font-weight: 900;
  text-transform: uppercase;
}

.hmi-assembly-console .order-row-meta em {
  color: var(--text-inverse);
  font-style: normal;
  font-size: 1.28rem;
  line-height: 1;
  text-align: right;
  text-shadow: none;
}

.hmi-assembly-console .metric-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}

.hmi-assembly-console .metric-row article {
  min-height: 110px;
  border: 1px solid var(--hmi-tile-border);
  background: var(--hmi-tile-bg);
  color: var(--hmi-tile-fg);
  display: grid;
  place-items: center;
  text-align: center;
}

.hmi-assembly-console .metric-row span {
  text-transform: uppercase; color: var(--hmi-tile-muted); font-weight: 900;
}

.hmi-assembly-console .metric-row strong {
  display: block; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1; color: var(--hmi-tile-fg);
}

.hmi-assembly-console .selected-order-box {
  margin-top: 12px;
  border: 1px solid var(--hmi-tile-border);
  background: var(--hmi-tile-bg);
  color: var(--hmi-tile-fg);
  padding: 14px;
  min-height: 160px;
}

.hmi-assembly-console .selected-order-detail {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
}

.hmi-assembly-console .product-visual {
  display: grid;
  place-items: center;
  min-height: 120px;
  background: color-mix(in srgb, var(--hmi-tile-bg) 88%, var(--hmi-tile-border) 12%);
  border-radius: 6px;
}

.hmi-assembly-console .product-visual .material-icons {
  font-size: 4.5rem; color: var(--hmi-tile-fg);
}

.hmi-assembly-console .selected-order-box dl {
  display: grid; grid-template-columns: minmax(110px, 0.38fr) 1fr; gap: 10px 18px; margin: 0;
}

.hmi-assembly-console .selected-order-box dt {
  color: var(--hmi-tile-muted);
}

.hmi-assembly-console .selected-order-box dd {
  margin: 0; font-weight: 850; color: var(--hmi-tile-fg);
}

.hmi-assembly-console dl {
  display: grid; grid-template-columns: minmax(110px, 0.38fr) 1fr; gap: 10px 18px; margin: 0;
}

.hmi-assembly-console dt {
  color: var(--text-muted);
}

.hmi-assembly-console dd {
  margin: 0; font-weight: 850;
}

.hmi-assembly-console .serial-launch, .hmi-assembly-console .scan-footer {
  display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 12px; align-items: center; margin-top: 12px;
}

.hmi-assembly-console .scan-footer {
  grid-template-columns: minmax(300px, 1fr) auto auto auto;
}

.hmi-assembly-console .scan-footer--equipment {
  grid-template-columns: minmax(300px, 1fr) auto auto;
}

.hmi-assembly-console .current-order-panel {
  align-self: stretch;
}

.hmi-assembly-console .component-map {
  display: grid; grid-template-columns: minmax(300px, 0.82fr) minmax(320px, 1fr); gap: 14px; min-height: 0; height: 100%;
}

.hmi-assembly-console .component-map--equipment {
  grid-template-columns: minmax(220px, 0.5fr) minmax(320px, 1fr);
}

.hmi-assembly-console .equipment-stage-summary {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 280px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 24px;
}

.hmi-assembly-console .equipment-stage-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.hmi-assembly-console .equipment-stage-icon .material-icons {
  font-size: 2.6rem;
}

.hmi-assembly-console .drone-visual {
  position: relative;
  min-height: 280px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.hmi-assembly-console .drone-body, .hmi-assembly-console .drone-arm, .hmi-assembly-console .drone-dot {
  position: absolute;
}

.hmi-assembly-console .drone-body {
  width: 180px; height: 180px; border-radius: 34px; background: var(--surface-sunken); left: 50%; top: 44%; transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 26px 55px rgba(0,0,0,0.18);
}

.hmi-assembly-console .drone-arm {
  width: 330px; height: 18px; background: var(--warning); left: 50%; top: 44%; transform-origin: center;
}

.hmi-assembly-console .drone-arm--a {
  transform: translate(-50%, -50%) rotate(25deg);
}

.hmi-assembly-console .drone-arm--b {
  transform: translate(-50%, -50%) rotate(-25deg);
}

.hmi-assembly-console .drone-dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 25%, transparent);
}

.hmi-assembly-console .drone-dot--a {
  left: 25%; top: 30%;
}

.hmi-assembly-console .drone-dot--b {
  right: 25%; top: 48%;
}

.hmi-assembly-console .drone-dot--c {
  left: 56%; bottom: 24%;
}

.hmi-assembly-console .component-scan-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 10px 46px 10px 12px;
  border-color: var(--warning);
}

.hmi-assembly-console .component-scan-card--foreign {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.hmi-assembly-console .component-scan-card.active {
  outline: 3px solid var(--warning-soft);
}

.hmi-assembly-console .component-scan-card.valid {
  border-color: var(--success);
}

.hmi-assembly-console .component-scan-card i {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--hmi-ok);
}

.hmi-assembly-console .material-warning-icon {
  top: 16px !important;
  transform: none !important;
  color: var(--warning) !important;
}

.hmi-assembly-console .foreign-action {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--warning);
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 900;
  padding: 4px 9px;
  cursor: pointer;
}

.hmi-assembly-console .validation-banner {
  margin-top: 14px; padding: 14px; font-weight: 900;
}

.hmi-assembly-console .validation-banner.ok {
  color: var(--success); background: var(--success-soft, var(--surface)); border: 1px solid var(--success);
}

.hmi-assembly-console .validation-banner.bad {
  color: var(--danger); background: var(--danger-soft, var(--surface)); border: 1px solid var(--danger);
}

.hmi-assembly-console .instruction-panel {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}

.hmi-assembly-console .progress-panel {
  align-content: stretch;
  gap: 10px;
}

.hmi-assembly-console .instruction-headline h2 {
  font-size: clamp(1.25rem, 2vw, 1.9rem);
}

.hmi-assembly-console .instruction-headline p {
  font-size: 1rem; color: var(--text-muted);
}

.hmi-assembly-console .instruction-media {
  min-height: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hmi-assembly-console .instruction-media img, .hmi-assembly-console .instruction-media iframe {
  width: 100%; height: 100%; min-height: 260px; border: 0; object-fit: contain;
}

.hmi-assembly-console .instruction-placeholder {
  display: grid; gap: 10px; place-items: center; color: var(--text-muted); text-align: center;
}

.hmi-assembly-console .instruction-placeholder .material-icons {
  font-size: 8rem; color: var(--text); opacity: 0.18;
}

.hmi-assembly-console .document-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}

.hmi-assembly-console .doc-tab {
  min-height: 36px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}

.hmi-assembly-console .doc-tab.active {
  border-color: var(--primary); color: var(--primary);
}

.hmi-assembly-console .sequence-card {
  min-height: 58px; padding: 10px; border-bottom: 1px solid var(--border);
}

.hmi-assembly-console .sequence-card.active {
  border-color: var(--primary); box-shadow: inset 5px 0 0 var(--primary);
}

.hmi-assembly-console .sequence-card.done {
  box-shadow: inset 5px 0 0 var(--hmi-ok);
}

.hmi-assembly-console .progress-panel {
  display: grid; gap: 10px; align-content: stretch;
}

.hmi-assembly-console .counter-box {
  border: 1px solid var(--border); text-align: center;
}

.hmi-assembly-console .counter-box span {
  display: block; background: var(--text-muted); color: white; padding: 10px; font-weight: 900;
}

.hmi-assembly-console .counter-box strong {
  display: block; color: var(--hmi-ok); font-size: 3rem;
}

.hmi-assembly-console .side-button, .hmi-assembly-console .footer-primary, .hmi-assembly-console .footer-secondary {
  min-height: 50px; border: 0; font-weight: 950; cursor: pointer;
}

.hmi-assembly-console .side-button {
  background: var(--text-muted); color: white;
}

.hmi-assembly-console .side-button--warn {
  background: var(--warning);
}

.hmi-assembly-console .side-button--danger {
  background: var(--surface-elevated);
}

.hmi-assembly-console .measurement-box {
  display: grid; gap: 8px;
}

.hmi-assembly-console .defect-row {
  display: grid; grid-template-columns: 120px 1fr 1fr 1fr; gap: 12px; align-items: center; min-height: 104px; border-bottom: 1px solid var(--border); padding: 10px;
}

.hmi-assembly-console .defect-photo {
  display: grid; place-items: center; height: 86px; background: var(--surface);
}

.hmi-assembly-console .defect-ticket {
  display: grid; gap: 18px;
}

.hmi-assembly-console .ticket-head {
  justify-content: space-between;
}

.hmi-assembly-console .toggle-line {
  display: flex; gap: 10px; align-items: center;
}

.hmi-assembly-console .barcode-strip {
  min-height: 70px; display: grid; place-items: center; letter-spacing: 0.32em; color: var(--text); background: repeating-linear-gradient(90deg, var(--text) 0 2px, var(--surface-elevated) 2px 5px, var(--text) 5px 6px, var(--surface-elevated) 6px 10px); font-size: 0.7rem; overflow: hidden;
}

.hmi-assembly-console .signature-screen {
  display: grid; place-items: center;
}

.hmi-assembly-console .signature-dialog {
  width: min(1100px, 100%);
}

.hmi-assembly-console .signature-title-row {
  justify-content: space-between;
}

.hmi-assembly-console .signature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
}

.hmi-assembly-console table {
  width: 100%; border-collapse: collapse;
}

.hmi-assembly-console th, .hmi-assembly-console td {
  border: 1px solid var(--border); padding: 12px; text-align: left; vertical-align: top;
}

.hmi-assembly-console .assembly-footer {
  display: grid; grid-template-columns: 210px 1fr 300px; background: var(--hmi-navy); min-height: 60px;
}

.hmi-assembly-console .footer-secondary {
  background: var(--text-muted); color: white; justify-content: center; gap: 10px;
}

.hmi-assembly-console .footer-primary {
  background: var(--hmi-accent); color: var(--surface-elevated); justify-content: center; gap: 10px;
}

.hmi-assembly-console .footer-primary:disabled, .hmi-assembly-console .side-button:disabled {
  opacity: 0.45; cursor: not-allowed;
}

.hmi-assembly-console .footer-progress {
  align-self: center; height: 8px; margin: 0 24px; background: color-mix(in srgb, var(--text) 16%, transparent); overflow: hidden;
}

.hmi-assembly-console .footer-progress span {
  display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); transition: width 0.18s ease;
}

.hmi-assembly-console .assembly-toast {
  position: absolute; z-index: 4; left: 50%; bottom: 88px; transform: translateX(-50%); max-width: 760px; padding: 14px 22px; border-radius: 3px; color: var(--text-inverse); background: var(--success); font-weight: 900; box-shadow: 0 18px 40px rgba(0,0,0,0.24);
}

.hmi-assembly-console .assembly-toast--error {
  background: var(--danger);
}

.hmi-assembly-console .empty-note {
  color: var(--hmi-muted);
}

@media (max-width: 1280px) {
  .hmi-assembly-console .order-screen, .hmi-assembly-console .material-screen, .hmi-assembly-console .work-screen, .hmi-assembly-console .defect-screen, .hmi-assembly-console .component-map, .hmi-assembly-console .signature-grid, .hmi-assembly-console .selected-order-detail {grid-template-columns: 1fr;
  }
  .hmi-assembly-console .assembly-topbar, .hmi-assembly-console .assembly-footer {grid-template-columns: 1fr;
  }
  .hmi-assembly-console .assembly-footer {display: flex; flex-wrap: wrap;
  }
  .hmi-assembly-console .footer-secondary, .hmi-assembly-console .footer-primary {flex: 1 1 220px;
  }
}

@media (max-width: 1100px) {
  .hmi-assembly-console {height: 100%;
    border-radius: 12px;
  }
  .hmi-assembly-console .assembly-topbar {flex-wrap: wrap;
    padding: 10px 14px;
    align-items: flex-start;
  }
  .hmi-assembly-console .assembly-brand {flex: 1 1 auto;
    min-width: 0;
  }
  .hmi-assembly-console .assembly-brand strong, .hmi-assembly-console .assembly-brand .assembly-title {font-size: 1.08rem;
    line-height: 1.1;
  }
  .hmi-assembly-console .assembly-top-actions {width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .hmi-assembly-console .top-action {flex: 0 0 auto;
    min-height: 42px;
  }
  .hmi-assembly-console .operator-badge {min-width: 0;
    flex: 1 1 100%;
    border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
    padding-left: 0;
    padding-top: 10px;
  }
  .hmi-assembly-console .assembly-screen {padding: 10px;
  }
  .hmi-assembly-console .metric-row {grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hmi-assembly-console .selected-order-detail {grid-template-columns: 110px 1fr;
  }
  .hmi-assembly-console .product-visual {min-height: 96px;
  }
  .hmi-assembly-console .product-visual .material-icons {font-size: 3.2rem;
  }
  .hmi-assembly-console .scan-footer, .hmi-assembly-console .scan-footer--equipment, .hmi-assembly-console .serial-launch {grid-template-columns: 1fr;
  }
  .hmi-assembly-console .order-row {grid-template-columns: minmax(120px, 0.82fr) minmax(0, 1fr);
  }
  .hmi-assembly-console .order-row-meta {grid-column: 1 / -1;
    grid-template-columns: auto auto;
    justify-content: space-between;
    justify-items: start;
    align-items: center;
  }
  .hmi-assembly-console .order-row-meta em {text-align: left;
  }
  .hmi-assembly-console .defect-row {grid-template-columns: 88px 1fr;
  }
  .hmi-assembly-console .defect-row small, .hmi-assembly-console .defect-row span:last-of-type {grid-column: 2;
  }
  .hmi-assembly-console .assembly-footer {position: sticky;
    bottom: 0;
    z-index: 2;
  }
}

@media (max-width: 820px) {
  .hmi-assembly-console {border-radius: 0;
    border: 0;
  }
  .hmi-assembly-console .assembly-stagebar {padding: 0 8px;
  }
  .hmi-assembly-console .stage-tab {min-height: 46px;
    padding: 0 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .hmi-assembly-console .hmi-card {padding: 12px;
  }
  .hmi-assembly-console .metric-row {grid-template-columns: 1fr 1fr;
  }
  .hmi-assembly-console .metric-row article {min-height: 92px;
  }
  .hmi-assembly-console .metric-row strong {font-size: clamp(2rem, 7vw, 3.2rem);
  }
  .hmi-assembly-console .selected-order-box {min-height: 0;
  }
  .hmi-assembly-console .selected-order-detail, .hmi-assembly-console .defect-screen, .hmi-assembly-console .signature-grid {grid-template-columns: 1fr;
  }
  .hmi-assembly-console .order-row {grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
  }
  .hmi-assembly-console .order-row-id, .hmi-assembly-console .order-row-main, .hmi-assembly-console .order-row-meta {width: 100%;
  }
  .hmi-assembly-console .component-map, .hmi-assembly-console .component-map--equipment {grid-template-columns: 1fr;
  }
  .hmi-assembly-console .drone-visual, .hmi-assembly-console .equipment-stage-summary, .hmi-assembly-console .instruction-media {min-height: 220px;
  }
  .hmi-assembly-console .instruction-placeholder .material-icons {font-size: 5rem;
  }
  .hmi-assembly-console .assembly-toast {left: 12px;
    right: 12px;
    bottom: 78px;
    transform: none;
    max-width: none;
  }
}

/* HMI-Panel-Dialog — Port von HmiRuntimeOverlay.vue:1055-1150.
   BEFUND 2026-08-02: der Dialog war im Port nie gebaut worden, deshalb fehlten
   auch seine Stile vollstaendig. Nur Tokens, keine harten Farbwerte
   (Theme-Pflicht). */
.hmi-runtime-overlay { position: relative; }

.hmi-runtime-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 28px;
  overscroll-behavior: contain;
}
.hmi-runtime-panel__backdrop {
  position: absolute;
  inset: 0;
  background: var(--core-color-surface);
  backdrop-filter: blur(6px);
}
.hmi-runtime-panel__dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  min-height: min(680px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  border-radius: var(--core-radius-md, 8px);
  border: 1px solid var(--core-color-border);
  background: var(--core-color-surface-elevated, var(--core-color-surface));
  box-shadow: var(--core-shadow-overlay, 0 18px 48px rgb(0 0 0 / 32%));
  overflow: hidden;
}
.hmi-runtime-panel__dialog--fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}
.hmi-runtime-overlay .panel-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  flex: 1;
  padding: 18px;
  overflow: auto;
}
.hmi-runtime-panel__dialog--fullscreen .panel-shell {
  gap: 8px;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  overflow: hidden;
}
.hmi-runtime-overlay .panel-shell__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 2px 0;
}
.hmi-runtime-panel__dialog--fullscreen .panel-shell__head { align-items: center; padding: 0 8px; }
.hmi-runtime-panel__dialog--fullscreen .panel-shell__head p { display: none; }
.hmi-runtime-overlay .panel-shell__head h4 { margin: 0; font-size: 1.2rem; }
.hmi-runtime-overlay .panel-shell__head p { margin: 0.2rem 0 0; color: var(--core-color-text-muted); }
.hmi-runtime-overlay .panel-shell__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--core-color-text-muted);
}
.hmi-runtime-overlay .panel-shell__actions { display: flex; gap: 8px; align-items: center; }
.hmi-runtime-overlay .icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--core-radius-sm, 6px);
  border: 1px solid var(--core-color-border);
  background: var(--core-color-surface-elevated, var(--core-color-surface));
  color: inherit;
  cursor: pointer;
}
.hmi-runtime-overlay .icon-btn:hover { border-color: var(--core-color-accent-blue); }
.hmi-runtime-overlay .panel-landing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  align-items: flex-start;
}
.hmi-runtime-overlay .panel-landing__title { font-size: 1.1rem; font-weight: 700; }
.hmi-runtime-overlay .panel-landing__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Layoutmodus: die Kachel wird zum Ziehgriff (Bestand .hmi-runtime-tile.draggable). */
.hmi-runtime-tile.draggable { cursor: grab; touch-action: none; }
.hmi-runtime-tile.draggable:active { cursor: grabbing; }
.hmi-runtime-tile.active { border-color: var(--core-color-accent-blue); }

/* Drehendes Symbol, solange ein Lasttest laeuft — Bestand
 * LoadTestOverlay.vue:671. Der Port kannte den Zustand, hatte aber weder die
 * Klasse noch den Keyframe: der Knopf war nur gesperrt, ohne Lebenszeichen. */
.loadtest-icon-btn--busy .material-icons {
  animation: loadtest-spin 1s linear infinite;
}

@keyframes loadtest-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .loadtest-icon-btn--busy .material-icons { animation: none; }
}

/* --- Bestandsregeln ohne Portentsprechung (measure:class-coverage 2026-08-07) */

/* Bestand HmiLineStationPanel.vue: der Rumpf der Linien-/Stationsmaske. Ohne
 * Regel fehlte der Spaltenfluss samt Abstaenden, und `min-height: 0` — ohne das
 * kann ein Kind mit eigenem Scrollbereich die Maske aufblaehen. */
.hmi-line-station-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.hmi-line-station-panel .workcenter-title-block {
  min-width: 0;
}

/* Bestand HmiRuntimeOverlay.vue: die Ueberschriftszeile ueber dem Titel. */
.hmi-runtime-overlay .hmi-runtime-header__copy .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--primary);
  margin-bottom: 6px;
}

/* ====== SPEC-0646 — Windows-Kontrastmodus =============================== *
 * Edge/Chromium zeichnen unter `forced-colors: active` KEINEN `box-shadow`
 * und zwingen jede Rahmen- und Flaechenfarbe auf eine Systemfarbe. Damit
 * faellt jeder Fokusring dieses Blattes dort ersatzlos aus — der ring-lose
 * Rahmenwechsel ebenso, weil dann jeder Rahmen dieselbe Farbe traegt.
 * `outline` WIRD gezeichnet und ist das einzige Mittel, das dort traegt.
 * `Highlight` ist die Systemfarbe fuer Auswahl und hebt sich per Definition
 * vom `Canvas` des Nutzers ab; `outline-offset` haelt den Ring von der
 * eigenen Kante frei, die dort ebenfalls `CanvasText` traegt.
 * KEIN `forced-color-adjust: none` — das naehme dem Nutzer genau die
 * Farbwahl, um die es hier geht (SPEC-0646, Entscheidung E3).
 * ====================================================================== */
@media (forced-colors: active) {
  .hmi-runtime-tile:focus-visible,
  .hmi-order-control-panel .search-row:focus-within {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}
