/* Layout: Kopfband mit Serverdaten und Statuszeile, darunter Raster aus Strom, Forschung, Produktion, Maschinen; unten der Produktionsrechner über die volle Breite. */
:root {
  --bg: #e6e9ec; --panel: #f4f6f7; --ink: #1c2229; --muted: #566570; --line: #cbd2d8;
  --accent: #b85a08; --accent-soft: #f1dcc8;
  --good: #2b7a4b; --warn: #9a6a08; --bad: #b0372b; --blue: #2c6a99;
  --f-display: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --f-body: system-ui, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #13171b; --panel: #1b2126; --ink: #e4e8eb; --muted: #8f9ba5; --line: #2b343b;
    --accent: #f0933a; --accent-soft: #3a2a1a;
    --good: #5cc08a; --warn: #e0b04a; --bad: #f0766a; --blue: #6aa9d6;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--f-body); }
.wrap {
  max-width: 1180px; margin: 0 auto; padding-block: 20px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h1 { font-size: 28px; letter-spacing: .01em; }
h2 { font-size: 17px; letter-spacing: .02em; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
header { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fact { display: flex; flex-direction: column; min-width: 0; }
.fact b { font: 500 15px var(--f-mono); overflow-wrap: anywhere; }
.mods { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.chip { font: 500 11px var(--f-mono); padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.chip.on { color: var(--ink); border-color: var(--ink); }
.status { margin-top: 12px; padding: 8px 12px; background: var(--panel); border-left: 4px solid var(--good); font-size: 13px; }
.status.idle { border-left-color: var(--blue); }
.status.warn { border-left-color: var(--warn); background: var(--accent-soft); }
.status.bad { border-left-color: var(--bad); background: var(--accent-soft); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 16px; }
.grid.inner { margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.c7 { grid-column: span 7; } .c5 { grid-column: span 5; } .c12 { grid-column: span 12; }
@media (max-width: 860px) { .c7, .c5 { grid-column: span 12; } }
.head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }
.row.end { align-items: flex-end; }
.src { font: 400 11px var(--f-mono); color: var(--muted); }
.pill { font: 500 11px var(--f-mono); padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; color: var(--muted); }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); } .blue { color: var(--blue); } .muted { color: var(--muted); }
.accent { color: var(--accent); }
svg { display: block; width: 100%; height: auto; max-width: 100%; }
svg text { fill: var(--muted); font: 400 10px var(--f-mono); }
.grid-l { stroke: var(--line); stroke-width: 1; }
.l-prod { stroke: var(--accent); fill: none; stroke-width: 2; }
.l-cons { stroke: var(--blue); fill: none; stroke-width: 2; }
.a-prod { fill: var(--accent); opacity: .14; }
.d-prod { fill: var(--accent); } .d-cons { fill: var(--blue); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; }
.sw-prod { background: var(--accent); } .sw-cons { background: var(--blue); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { font: 500 11px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; padding: 4px 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.r, td.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
.bar { height: 16px; position: relative; min-width: 120px; }
.bar i { position: absolute; top: 3px; height: 10px; display: block; }
.bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--muted); }
.bar .pos { background: var(--good); left: 50%; } .bar .neg { background: var(--bad); right: 50%; }
.prog { height: 10px; background: var(--line); position: relative; }
.prog i { position: absolute; inset: 0 auto 0 0; background: var(--accent); display: block; }
.tabs { display: flex; }
button, select, input { font: 500 13px var(--f-mono); color: var(--ink); background: var(--panel); border: 1px solid var(--line); padding: 5px 10px; border-radius: 0; min-width: 0; max-width: 100%; }
button { cursor: pointer; }
button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stack { display: flex; height: 22px; border: 1px solid var(--line); }
.stack i { display: block; min-width: 2px; }
.k-active { background: var(--good); } .k-input_missing { background: var(--warn); } .k-output_full { background: var(--blue); }
.k-no_power_or_fuel { background: var(--bad); } .k-idle { background: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
ul.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
ul.plain li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.set { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.set label { display: flex; flex-direction: column; gap: 4px; }
.inputs { display: flex; flex-direction: column; gap: 8px; }
.tgt { align-items: center; }
.tgt select { flex: 1 1 220px; } .tgt input { width: 110px; }
.sentence { align-items: center; gap: 8px 10px; }
.sentence select { flex: 1 1 200px; } .sentence input { width: 120px; }
.chead { font: 600 18px/1.3 var(--f-display); text-wrap: balance; }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack-col { display: flex; flex-direction: column; gap: 14px; }
footer { margin-top: 20px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) { .prog i, .stack i { transition: width .4s; } }
