html, body { margin:0; padding:0; font-family: Arial, sans-serif; background:#f5f6f7; color:#111; }
.topbar { display:flex; gap:16px; justify-content:space-between; align-items:flex-end; padding:14px 16px; background:#fff; border-bottom:1px solid #d9dde3; }
.brand .title { font-size:18px; font-weight:700; }
.brand .subtitle { font-size:12px; color:#444; margin-top:2px; }
.statusline { font-size:12px; color:#333; text-align:right; }
.grid { display:grid; grid-template-columns: 1fr; grid-template-areas:
  "controls"
  "kpi"
  "pfd"
  "charts"
  "log"
  "machine"
  "help";
  gap:12px; padding:12px; max-width:1100px; margin:0 auto; }
.card { background:#fff; border:1px solid #d9dde3; border-radius:10px; padding:12px; }
.cardTitle { font-weight:700; margin-bottom:10px; }
.controls .field { display:block; margin-bottom:10px; }
.label { font-size:12px; color:#333; margin-bottom:4px; }
.field input, .field select { width:100%; padding:8px; border:1px solid #c9cfd8; border-radius:8px; font-size:14px; }
.row { display:flex; gap:8px; align-items:center; }
.row input { flex:1; }
.btn { padding:9px 12px; border-radius:10px; border:1px solid #c9cfd8; background:#fff; cursor:pointer; font-size:14px; }
.btn.primary { background:#111; color:#fff; border-color:#111; }
.btn:active { transform: translateY(1px); }
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.note { font-size:12px; color:#444; padding:8px; background:#f1f3f6; border-radius:8px; border:1px solid #e2e6ee; }
.kpis { display:grid; grid-template-columns: repeat(2, 1fr); gap:10px; }
.kpi { border:1px solid #e2e6ee; border-radius:10px; padding:10px; background:#fafbfc; }
.kpi .k { font-size:12px; color:#333; }
.kpi .v { font-size:18px; font-weight:700; margin-top:6px; }
.kpi .u { font-size:12px; color:#444; margin-top:2px; }
.kv { display:grid; grid-template-columns: 1fr 1fr; gap:8px 12px; font-size:12px; }
.kv .key { color:#333; }
.kv .val { text-align:right; color:#111; font-variant-numeric: tabular-nums; }
.pfdWrap { border:1px solid #e2e6ee; border-radius:10px; overflow:hidden; background:#fff; }
.pfdHost { width:100%; height:340px; }
#chartCanvas { width:100%; height:auto; border:1px solid #e2e6ee; border-radius:10px; background:#fff; }
.chartLegend { font-size:12px; color:#333; margin-top:8px; display:flex; gap:14px; flex-wrap:wrap; }
.footer { font-size:12px; color:#444; padding:10px 16px 16px; max-width:1400px; margin:0 auto; }
@media (max-width: 980px) {
  .grid { display:grid; grid-template-columns: 1fr; grid-template-areas:
  "controls"
  "kpi"
  "pfd"
  "charts"
  "log"
  "machine"
  "help";
  gap:12px; padding:12px; max-width:1100px; margin:0 auto; }
  .pfdHost { height:280px; }
}

.helpText p { margin: 0 0 10px 0; font-size: 13px; line-height: 1.35; }

/* HMI / Leittechnik Panel */
.hmiLegend { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.hmiLegend .tag { font-size:12px; padding:4px 8px; border-radius:999px; border:1px solid #d0d6df; background:#f6f7f8; }
.hmiLegend .tag.air { border-color:#f28e2b; }
.hmiLegend .tag.cold { border-color:#4e79a7; }
.hmiLegend .tag.water { border-color:#7f7f7f; }
.hmiLegend .tag.pwr { border-color:#59a14f; }

.hmiHost { border:1px solid #e2e6ee; border-radius:10px; background:#fff; padding:10px; overflow:hidden; }
.hmiRow { display:flex; align-items:stretch; gap:10px; margin-bottom:10px; }
.hmiRow:last-child { margin-bottom:0; }

.hmiLaneTitle { width:120px; font-size:12px; color:#333; padding-top:8px; }
.hmiLane { display:flex; align-items:stretch; gap:10px; flex:1; min-width:0; }

.hmiNode { border:1px solid #d9dde3; border-radius:10px; padding:10px; background:#fafbfc; min-width:180px; flex:0 0 auto; cursor:pointer; }
.hmiNode:hover { background:#f1f3f6; }
.hmiNode .hTitle { font-size:13px; font-weight:700; margin-bottom:6px; }
.hmiNode .hKv { display:grid; grid-template-columns: 1fr auto; gap:4px 10px; font-size:12px; }
.hmiNode .hKv .k { color:#333; }
.hmiNode .hKv .v { color:#111; text-align:right; font-variant-numeric: tabular-nums; }

.hmiPipe { flex:1 1 auto; min-width:20px; display:flex; align-items:center; }
.hmiPipe .line { height:2px; width:100%; border-radius:999px; position:relative; }
.hmiPipe .line:after { content:""; position:absolute; right:-1px; top:50%; transform:translateY(-50%); width:0; height:0; border-left:6px solid #111; border-top:4px solid transparent; border-bottom:4px solid transparent; }
.hmiPipe.air .line { background:#f28e2b; }
.hmiPipe.air .line:after { border-left-color:#f28e2b; }
.hmiPipe.cold .line { background:#4e79a7; }
.hmiPipe.cold .line:after { border-left-color:#4e79a7; }
.hmiPipe.water .line { background:#7f7f7f; }
.hmiPipe.water .line:after { border-left-color:#7f7f7f; }
.hmiPipe.pwr .line { background:#59a14f; }
.hmiPipe.pwr .line:after { border-left-color:#59a14f; }

.hmiDetails { margin-top:10px; border:1px solid #e2e6ee; border-radius:10px; background:#fff; padding:10px; font-size:13px; line-height:1.35; }
.hmiDetails .dTitle { font-weight:700; margin-bottom:6px; }
.hmiDetails .dText { color:#111; }
.hmiDetails .dMeta { margin-top:8px; font-size:12px; color:#444; }
@media (max-width: 980px) {
  .hmiRow { flex-direction:column; }
  .hmiLaneTitle { width:auto; padding-top:0; }
  .hmiLane { overflow-x:auto; padding-bottom:6px; }
  .hmiNode { min-width:220px; }
}


/* Smartphone: bessere Lesbarkeit und Bedienbarkeit */
@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .statusline { text-align: left; }
  .grid { display:grid; grid-template-columns: 1fr; grid-template-areas:
  "controls"
  "kpi"
  "pfd"
  "charts"
  "log"
  "machine"
  "help";
  gap:12px; padding:12px; max-width:1100px; margin:0 auto; }
  .grid2 { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .btn { flex: 1 1 calc(50% - 8px); }
  #btnStart, #btnStop { flex: 1 1 calc(50% - 8px); }
  #btnReset, #btnExport { flex: 1 1 calc(50% - 8px); }
  .kpis { grid-template-columns: 1fr; }
}

/* Smartphone/Tablet: Kopfzeile fixiert (nur im kleinen Layout) */
@media (max-width: 980px) {
  .topbar { position: sticky; top: 0; z-index: 20; }
}

/* HMI: bessere Touch-Bedienung und Orientierung */
.hmiLane { overflow-x: auto; scroll-snap-type: x mandatory; }
.hmiNode { scroll-snap-align: start; }
.hmiNode.sel { background:#fff; border-color:#111; box-shadow: 0 0 0 2px rgba(0,0,0,0.08) inset; }
.hmiNode:active { transform: translateY(1px); }

/* Chart: Canvas wird in JS an Displaygröße angepasst; CSS bleibt responsiv */


/* Grid-Order (Desktop und Mobile) */
#controlsCard { grid-area: controls; }
#kpiCard { grid-area: kpi; }
#pfdCard { grid-area: pfd; }
#chartsCard { grid-area: charts; }
#logCard { grid-area: log; }
#machineCard { grid-area: machine; }
#helpCard { grid-area: help; }



/* Sehr kleine Smartphones */
@media (max-width: 420px) {
  .grid { padding: 8px; gap: 8px; }
  .card { padding: 10px; }
  .btn { flex: 1 1 100%; }
  .field input, .field select { font-size: 16px; } /* verhindert iOS Zoom */
  .hmiNode { min-width: 190px; } /* weniger Horizontal-Scroll */
  .pfdHost { height: 240px; }
}



@media (min-width: 1200px) {
  .grid { max-width: 1300px; }
}


.hmiLane { scrollbar-gutter: stable both-edges; }

/* =======================================================================
   MINIMAL BRAND BLUE THEME – #0c1754
   Ziel: alles im Brand-Blau, keine Verläufe/Glas/Schnickschnack.
   Nur CSS-Override, keine Funktionsänderung.
   ======================================================================= */

:root{
  --brand:#0c1754;
  --brand-2:#162a7a;
  --brand-3:#2a44a6;
  --bg:#f5f7fb;
  --card:#ffffff;
  --border:#d9dee8;
  --text:#0c1222;
  --muted:#44506a;
}

/* Bühne neutral */
html, body{
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Header: solid Brand-Blau, ohne Effekte */
.topbar{
  background: var(--brand) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
  backdrop-filter: none !important;
  position: static !important;
}
.topbar::before,
.topbar::after{
  display:none !important;
}

.brand .title{
  color:#fff !important;
}
.brand .subtitle{
  color: rgba(255,255,255,0.82) !important;
}
.statusline{
  color: rgba(255,255,255,0.88) !important;
}

/* Karten: klar, ohne Glas/Shadow */
.card{
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  min-width:0;
}
.cardTitle{
  color: var(--brand) !important;
}

/* Buttons: alles Brand-Blau */
.btn.primary{
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color:#fff !important;
}
.btn.primary:hover{
  background: var(--brand-2) !important;
  border-color: var(--brand-2) !important;
}
.btn{
  background: #fff !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.btn:hover{
  border-color: rgba(12,23,84,0.35) !important;
}

/* Links */
a{ color: var(--brand) !important; }
a:hover{ color: var(--brand-3) !important; }

/* Tags/Legende: alles in Blau (keine Semantikfarben) */
.hmiLegend .tag,
.tag{
  background: rgba(12,23,84,0.08) !important;
  border: 1px solid rgba(12,23,84,0.25) !important;
  color: var(--brand) !important;
}

/* Maschinenkonzept: Lesbarkeit erzwingen */
#machineCard{
  background: var(--card) !important;
  color: var(--text) !important;
}
#machineCard .cardTitle{ color: var(--brand) !important; }

#machineCard .mIntro,
#machineCard .mBlock,
#machineCard .mStep,
#machineCard .mDetails,
#machineCard .mFigure{
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
#machineCard .mMeta,
#machineCard .mStepHint,
#machineCard .mFigure figcaption{
  color: var(--muted) !important;
}

/* Keine Überläufe */
.row{ flex-wrap: wrap; }
.row > *{ min-width:0; }
#controlsCard .row .btn{ flex: 1 1 140px; }

#chartCanvas{
  width:100% !important;
  height:auto !important;
  display:block;
}

/* Smartphones: Eingabefelder nicht zoomen + 2er-Grid umbrechen */
@media (max-width: 760px){
  .grid2{ grid-template-columns: 1fr !important; }
  .field input, .field select{ font-size:16px; }
}



/* =========================================================
   Konsistenter Fix-Stand
   - grafische Einstimmung oben
   - Buttons einheitlich
   - Livewerte größer
   - Maschinenkonzept ohne Abschneiden
   - Diagramm-/Bildkarten sauber sichtbar
   ========================================================= */

:root{
  --brand-blue:#0c1754;
  --line:#d9dde3;
  --line-2:#c9cfd8;
  --text:#111;
  --muted:#444;
  --pwr:#c7332f;
  --air:#6bb7ff;
  --cold:#0c5fb8;
  --water:#18a7a7;
  --pwr-soft:#fff1f0;
  --air-soft:#eef7ff;
  --cold-soft:#eef4ff;
  --water-soft:#eefbfb;
}

/* Grundfarben */
.topbar .title,
.cardTitle,
.helpText p strong,
.helpText strong{
  color:var(--brand-blue);
}

/* obere grafische Einstimmung */
#introCard{
  border-color:var(--line);
}
#introCard .cardTitle{
  margin-bottom:12px;
}
.introLead{
  margin-bottom:12px;
}
.introLeadTitle{
  font-size:18px;
  line-height:1.2;
  font-weight:700;
  color:var(--brand-blue);
  margin-bottom:6px;
}
.introLeadText{
  font-size:14px;
  line-height:1.45;
  color:var(--text);
}
.introLeadMeta{
  margin-top:6px;
  font-size:13px;
  line-height:1.4;
  color:var(--muted);
}
.introDiagrams{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.mDiagrams{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.mFigure{
  margin:0;
  padding:12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
}
.mFigure img{
  display:block;
  width:100%;
  height:auto;
  max-height:360px;
  object-fit:contain;
  border:1px solid #eef1f4;
  border-radius:8px;
  background:#fff;
}
.mFigure figcaption{
  margin-top:8px;
  font-size:12px;
  line-height:1.4;
  color:var(--muted);
}

/* Einheitsoptik für Bedienbuttons */
#btnStart,
#btnStop,
#btnReset,
#btnExport{
  background:var(--brand-blue) !important;
  color:#fff !important;
  border-color:var(--brand-blue) !important;
}
#btnStart:hover,
#btnStop:hover,
#btnReset:hover,
#btnExport:hover{
  filter:brightness(1.04);
}

/* Livewerte größer */
.kv{
  gap:10px 14px;
}
.kv .key{
  font-size:13px;
  line-height:1.35;
}
.kv .val{
  font-size:15px;
  line-height:1.35;
  font-weight:700;
}
.kpi .v{
  font-size:20px;
}

/* Maschinenkonzept darf nicht abgeschnitten werden */
#machineCard,
#machineHost,
.machineWrap,
.machineGrid,
.mFlow,
.mDetails{
  overflow:visible !important;
}
#machineHost{
  height:auto !important;
  max-height:none !important;
  min-height:0 !important;
}
.machineWrap{
  display:block;
}
.machineGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.mBlock,
.mStep{
  min-height:0;
  cursor:pointer;
}
.mBlock{
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  text-align:left;
  background:#fff;
}
.mBlock[data-key="pwr"]{ border-left:4px solid var(--pwr); }
.mBlock[data-key="air"]{ border-left:4px solid var(--air); }
.mBlock[data-key="cold"]{ border-left:4px solid var(--cold); }
.mBlock[data-key="water"]{ border-left:4px solid var(--water); }

.mBlock.active[data-key="pwr"]{ background:var(--pwr-soft); }
.mBlock.active[data-key="air"]{ background:var(--air-soft); }
.mBlock.active[data-key="cold"]{ background:var(--cold-soft); }
.mBlock.active[data-key="water"]{ background:var(--water-soft); }

.mTitle{
  font-size:16px;
  font-weight:700;
  line-height:1.2;
}
.mMeta{
  margin-top:6px;
  font-size:13px;
  line-height:1.35;
  color:var(--muted);
}
.mFlow{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}
.mStep{
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  text-align:left;
}
.mStep.active{
  border-color:var(--brand-blue);
  box-shadow:0 0 0 1px rgba(12,23,84,0.10) inset;
}
.mStepTitle{
  font-size:14px;
  font-weight:700;
  line-height:1.25;
}
.mStepHint{
  margin-top:6px;
  font-size:13px;
  line-height:1.35;
  color:var(--muted);
}
.mDetails{
  margin-top:12px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.mDetails h3{
  margin:0 0 8px 0;
  font-size:18px;
  line-height:1.2;
  color:var(--brand-blue);
}
.mSub{
  margin-top:12px;
  font-weight:700;
  color:var(--brand-blue);
}

/* HMI didaktische Farbführung ohne Funktionsänderung */
.hmiNode.pwr{ border-left:3px solid var(--pwr); }
.hmiNode.air{ border-left:3px solid var(--air); }
.hmiNode.cold{ border-left:3px solid var(--cold); }
.hmiNode.water{ border-left:3px solid var(--water); }

.hmiNode.sel.pwr{ background:var(--pwr-soft); }
.hmiNode.sel.air{ background:var(--air-soft); }
.hmiNode.sel.cold{ background:var(--cold-soft); }
.hmiNode.sel.water{ background:var(--water-soft); }

.hmiPipe .line{
  height:4px;
}
.hmiPipe .line::after{
  border-left-width:10px;
  border-top-width:6px;
  border-bottom-width:6px;
}

.hmiPipe.pwr .line{ background:var(--pwr); }
.hmiPipe.pwr .line::after{ border-left-color:var(--pwr); }
.hmiPipe.air .line{ background:var(--air); }
.hmiPipe.air .line::after{ border-left-color:var(--air); }
.hmiPipe.cold .line{ background:var(--cold); }
.hmiPipe.cold .line::after{ border-left-color:var(--cold); }
.hmiPipe.water .line{ background:var(--water); }
.hmiPipe.water .line::after{ border-left-color:var(--water); }

/* pfdHost bleibt eigener Bereich; machineHost wird nicht mehr als feste Box behandelt */
#machineCard .pfdWrap,
#machineCard .pfdHost{
  height:auto !important;
  overflow:visible !important;
}

@media (max-width: 900px){
  .introDiagrams,
  .mDiagrams,
  .machineGrid,
  .mFlow{
    grid-template-columns:1fr;
  }
}

@media (max-width: 560px){
  .introLeadTitle{ font-size:17px; }
  .kv .key{ font-size:12px; }
  .kv .val{ font-size:14px; }
  .mTitle{ font-size:15px; }
  .mStepTitle{ font-size:13px; }
}


/* =======================================================================
   Stabiler Referenzstand 2026-03-06
   heroStrip fest im HTML, sichtbar auf Desktop und Mobil
   Monatssprung integriert in Haupt-CSS
   ======================================================================= */

.heroStrip{
  display:block !important;
  max-width:1300px;
  margin:12px auto 0 auto;
  padding:0 12px;
}

.heroStripInner{
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:14px;
}

.heroStripTitle{
  font-size:18px;
  line-height:1.2;
  font-weight:700;
  color:var(--brand);
  margin:0 0 6px 0;
}

.heroStripSub{
  font-size:14px;
  line-height:1.45;
  color:var(--text);
  margin:0;
}

.heroStripMeta{
  margin-top:6px;
  font-size:13px;
  line-height:1.4;
  color:var(--muted);
}

.heroStripGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}

.heroFig{
  margin:0;
  padding:12px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
}

.heroFig img{
  display:block;
  width:100%;
  height:auto;
  max-height:360px;
  object-fit:contain;
  border:1px solid #eef1f4;
  border-radius:8px;
  background:#fff;
}

.heroFig figcaption{
  margin-top:8px;
  font-size:13px;
  line-height:1.45;
  color:var(--text);
}

.heroFig figcaption strong{
  color:var(--brand);
}

/* Monatssprung als Teil der Haupt-CSS */
.monthJumpWrap{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:10px 0 0 0;
  flex-wrap:wrap;
}

.monthJumpLabel{
  font-size:13px;
  color:var(--brand);
  font-weight:700;
}

.monthJumpSelect{
  min-width:170px;
  height:38px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  color:var(--brand);
  font:inherit;
}

.monthJumpSelect:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 2px rgba(12,23,84,.12);
}

/* Grid-Zuordnung bleibt explizit und stabil */
#controlsCard { grid-area: controls; }
#kpiCard { grid-area: kpi; }
#pfdCard { grid-area: pfd; }
#chartsCard { grid-area: charts; }
#logCard { grid-area: log; }
#machineCard { grid-area: machine; }
#helpCard { grid-area: help; }

/* Intro immer sichtbar, unabhängig vom Desktop/Mobile-Layout */
body > .heroStrip{
  width:auto;
}

@media (max-width: 900px){
  .heroStripGrid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 700px){
  .monthJumpWrap{
    display:flex;
    width:100%;
  }

  .monthJumpLabel{
    width:100%;
  }

  .monthJumpSelect{
    width:100%;
    min-width:0;
  }
}

@media (max-width: 560px){
  .heroStrip{
    padding:0 8px;
  }

  .heroStripInner{
    padding:12px;
  }

  .heroStripTitle{
    font-size:17px;
  }

  .heroFig figcaption{
    font-size:12px;
  }
}
