/* heizung.ferrano.de – Heizzentrale (Entwurf 2), hell/dunkel */

/* Schriften lokal (DSGVO: keine Google-Server). Dateien siehe fonts/LIESMICH.txt.
   Fehlen sie, greifen die Systemschriften. */
@font-face { font-family: 'IBM Plex Sans'; src: url('fonts/ibm-plex-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('fonts/ibm-plex-sans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('fonts/ibm-plex-sans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('fonts/ibm-plex-sans-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --sans: 'IBM Plex Sans', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
}
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D10; --card: #1D242D; --line: #3A4553; --ink: #ECE9E3; --muted: #A3ACB7;
  --track: #28303A; --chip-on: #2F3843; --dashed: #56606B; --dot-off: #5E6772;
  --accent: #FF8A3D; --on-accent: #1A0E05; --mid: #7A4A2A; --on-mid: #FFFFFF;
  --ok: #34D399; --warn: #F5B14C; --warn-bg: #33250F; --warn-line: #7A5418; --warn-ink: #FFE1B0;
  --tank1: #C2410C; --tank2: #9A4A1E; --tank3: #4A3A33; --tt1: #FFFFFF; --tt2: #FFFFFF; --tt3: #FFFFFF;
  --s-kessel: #FF8A3D; --s-ruecklauf: #FFC247; --s-p-oben: #FF5A5F; --s-p-mitte: #D98CFF; --s-p-unten: #B58B7A;
  --s-ww: #F2E27A; --s-hk1: #5AA9FF; --s-hk2: #9CD1FF; --s-kol: #34D399; --s-aussen: #E6E6E6;
  --s-abgas: #C9CED6; --s-o2: #5AA9FF; --s-lade: #FF8A3D;
  --a1: #F5B14C; --a1-bg: #33250F; --a1-ink: #FFE1B0;
  --a2: #F04438; --a2-bg: #B42318; --a2-ink: #FFFFFF; --a2-soft: #3A1414;
  --ar: #A78BFA; --ar-bg: #221B3A; --ar-ink: #E9E2FF;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #E6EAEF; --card: #FFFFFF; --line: #CCD3DC; --ink: #14181D; --muted: #56606B;
  --track: #E6E9ED; --chip-on: #E1E6EC; --dashed: #9AA3AD; --dot-off: #9AA3AD;
  --accent: #C2410C; --on-accent: #FFFFFF; --mid: #EE9A5E; --on-mid: #14181D;
  --ok: #059669; --warn: #B45309; --warn-bg: #FFF4E5; --warn-line: #F2C38B; --warn-ink: #5C3A0B;
  --tank1: #C2410C; --tank2: #EE9A5E; --tank3: #F7D3B5; --tt1: #FFFFFF; --tt2: #14181D; --tt3: #14181D;
  --s-kessel: #C2410C; --s-ruecklauf: #B7791F; --s-p-oben: #B91C1C; --s-p-mitte: #9333EA; --s-p-unten: #8B5E4A;
  --s-ww: #A16207; --s-hk1: #1D4ED8; --s-hk2: #0284C7; --s-kol: #047857; --s-aussen: #14181D;
  --s-abgas: #475569; --s-o2: #1D4ED8; --s-lade: #C2410C;
  --a1: #D97706; --a1-bg: #FFF4E5; --a1-ink: #5C3A0B;
  --a2: #B42318; --a2-bg: #B42318; --a2-ink: #FFFFFF; --a2-soft: #FEECEB;
  --ar: #6D28D9; --ar-bg: #F3EEFF; --ar-ink: #3B1782;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 40px 56px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .wrap { padding: 18px 16px 40px; gap: 14px; } }

/* Kopf */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand svg { flex-shrink: 0; stroke: var(--accent); }
.brand-name { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 13px; color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 20px; }
.tabs { display: flex; gap: 28px; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
:root[data-theme="light"] .theme-btn .i-sun, :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }

/* Hinweise */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r); color: var(--warn-ink); font-size: 15px; }
.notice svg { flex-shrink: 0; margin-top: 2px; stroke: currentColor; }

/* Karten allgemein */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.h-label { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 800px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.kpi-label { font-size: 13px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.kpi-value { display: flex; align-items: baseline; gap: 6px; }
.kpi-value .num { font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi-value .text { font-size: 26px; font-weight: 600; line-height: 1.15; }
.kpi-unit { font-size: 15px; color: var(--muted); }
.kpi-sub { font-size: 13px; color: var(--muted); }
.live-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--ok); display: inline-block; }
.live-dot.stale { background: var(--warn); }

/* Anlagenschema */
.schema { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.05fr) 64px minmax(0, 1fr); gap: 0 8px; align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 14px; }
.col-head { font-size: 12px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; min-height: 18px; }
.arrows { display: flex; flex-direction: column; justify-content: space-around; padding-top: 32px; }
.arrow { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); text-align: center; }
.arrow-down { display: none; align-items: center; justify-content: center; gap: 10px; font-size: 12px; color: var(--muted); }
.flow line, .flow path { stroke: var(--dashed); stroke-width: 2; fill: none; }
.flow line { stroke-dasharray: 4 4; }
.flow.on line, .flow.on path { stroke: var(--accent); stroke-dasharray: none; }
@media (max-width: 900px) {
  .schema { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .arrows { display: none; }
  .arrow-down { display: flex; }
}

.node { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.node.active { border-color: var(--accent); }
.node-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.node-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.node-status::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--dot-off); }
.node.active .node-status::before { background: var(--accent); }
.node-main { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.node-main .num { font-size: 38px; font-weight: 600; line-height: 1; }
.node-main .unit { font-size: 15px; color: var(--muted); }
.node-main .sub { font-size: 13px; color: var(--muted); margin-left: 6px; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-top: 1px solid var(--line); }
.row > span:first-child { color: var(--muted); }

.tank-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; height: 100%; }
.tank { display: flex; flex-direction: column; flex-grow: 1; min-height: 240px; border: 2px solid var(--dashed); border-radius: 22px; overflow: hidden; }
.layer { flex-grow: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.layer > span:first-child { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.layer .num { font-size: 24px; font-weight: 600; }
.layer.l1 { background: var(--tank1); color: var(--tt1); }
.layer.l2 { background: var(--tank2); color: var(--tt2); }
.layer.l3 { background: var(--tank3); color: var(--tt3); }
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.4s ease; }
@media (prefers-reduced-motion: reduce) { .bar > div { transition: none; } }

.foot { margin: 0; font-size: 13px; color: var(--muted); }

/* Verlauf */
.controls { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.period { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); flex-wrap: wrap; }
.seg button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.04em; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.nav-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.custom { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; }
.custom label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.custom input { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
.btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--ink); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer; }

.panel { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
@media (max-width: 700px) { .panel { padding: 16px 14px; } }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--chip-on); }
.chip[aria-pressed="false"] { color: var(--muted); }
.chip .sw { width: 12px; height: 3px; border-radius: 2px; }
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ylab, .chart .xlab { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart .cursor { stroke: var(--muted); stroke-width: 1; }
.chart .empty { margin: 0; padding: 40px 0; text-align: center; color: var(--muted); }
.tip { position: absolute; top: 8px; z-index: 2; min-width: 160px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); font-size: 13px; pointer-events: none; }
.tip-time { font-family: var(--mono); color: var(--muted); margin-bottom: 6px; }
.tip-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip-row .sw { width: 10px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.tip-row .l { display: flex; align-items: center; gap: 6px; }
.small-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.small-grid h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.lane { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; }
@media (max-width: 700px) { .lane { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; } }
.lane-label { font-size: 14px; color: var(--muted); }
.lane-track { position: relative; height: 26px; border-radius: 5px; overflow: hidden; background: var(--track); }
.lane-seg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 6px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.lane-seg.on { background: var(--accent); color: var(--on-accent); }
.lane-seg.mid { background: var(--mid); color: var(--on-mid); }
.lane-seg.idle { background: var(--chip-on); color: var(--ink); }
.lane-seg.warn { background: var(--warn); color: #1A0E05; }
.lane-axis { position: relative; height: 16px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.lane-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* ===== Version 3: Kessel prominent, Nachlege-Alarm, Rückblick, Fuß ===== */

/* Alarm- und Rückblick-Balken oben */
.alarm { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-radius: var(--r); }
.alarm svg { flex-shrink: 0; stroke: currentColor; }
.alarm strong { display: block; font-size: 22px; letter-spacing: -0.01em; line-height: 1.2; }
.alarm span { font-size: 15px; }
.alarm[data-level="low"] { background: var(--a1-bg); color: var(--a1-ink); border: 1px solid var(--a1); border-left: 6px solid var(--a1); }
.alarm[data-level="low"] strong { font-size: 17px; }
.alarm[data-level="crit"] { background: var(--a2-bg); color: var(--a2-ink); }
.archive-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r); background: var(--ar); color: var(--bg); font-size: 15px; font-weight: 600; }
.archive-bar svg { flex-shrink: 0; stroke: currentColor; }

/* Kessel groß + Puffer-Anzeige */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 16px; align-items: stretch; }
.hero .gauge { order: -1; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.kessel { display: flex; flex-direction: column; gap: 18px; padding: 24px 26px; border-radius: 12px; min-width: 0; }
.kessel.active { border-color: var(--accent); }
.kessel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kessel-title { display: flex; align-items: center; gap: 12px; }
.kessel-title svg { stroke: var(--accent); flex-shrink: 0; }
.kessel-title h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--chip-on); font-size: 16px; font-weight: 600; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 999px; background: var(--dot-off); }
.kessel.active .pill::before { background: var(--accent); }
.kessel-main { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.kessel-temp { display: flex; align-items: baseline; gap: 8px; }
.kessel-temp .num { font-size: 72px; font-weight: 600; line-height: 0.95; letter-spacing: -0.03em; }
.kessel-temp .unit { font-size: 26px; color: var(--muted); }
@media (max-width: 700px) { .kessel { padding: 18px; } .kessel-temp .num { font-size: 72px; } }
.kessel-soll { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; flex-grow: 1; min-width: 180px; }
.kessel-soll-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.kessel-bar { height: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--track); border-radius: 8px; min-width: 0; }
.stat > span:first-child { font-size: 13px; color: var(--muted); }
.stat .num { font-size: 18px; font-weight: 600; }

.gauge { display: flex; gap: 22px; padding: 22px 24px; border-radius: 12px; align-items: stretch; }
.gauge[data-level="low"] { border: 2px solid var(--a1); }
.gauge[data-level="crit"] { border: 2px solid var(--a2); background: var(--a2-soft); }
.g-bar { position: relative; width: 44px; flex-shrink: 0; min-height: 200px; margin-right: 38px; }
.g-track { position: absolute; inset: 0; border-radius: 10px; background: var(--track); overflow: hidden; }
.g-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--accent); transition: height 0.4s ease; }
.gauge[data-level="low"] .g-fill { background: var(--a1); }
.gauge[data-level="crit"] .g-fill { background: var(--a2); }
.g-mark { position: absolute; left: -6px; right: -6px; border-top: 2px dashed var(--muted); }
.g-mark span { position: absolute; left: calc(100% + 10px); top: 0; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.g-info { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; flex-grow: 1; }
.g-num { display: flex; align-items: baseline; gap: 6px; }
.g-num .num { font-size: 72px; font-weight: 600; line-height: 1; }
.g-num .unit { font-size: 22px; color: var(--muted); }
.gauge[data-level="low"] .g-num .num { color: var(--a1); }
.gauge[data-level="crit"] .g-num .num { color: var(--a2); }
.g-label { font-size: 16px; font-weight: 700; color: var(--muted); }
.gauge[data-level="low"] .g-label { color: var(--a1-ink); }
.gauge[data-level="crit"] .g-label { color: var(--a2); }
@media (prefers-reduced-motion: reduce) { .g-fill { transition: none; } }

/* Außen + Datenstand */
.kpis2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
@media (max-width: 700px) { .kpis2 { grid-template-columns: minmax(0, 1fr); } }
.stand { flex-direction: row; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.stand-time { display: inline-flex; align-items: center; gap: 8px; font-size: 24px; }
.stand[data-mode="archive"] { background: var(--ar-bg); border: 2px solid var(--ar); color: var(--ar-ink); }
.stand[data-mode="archive"] .kpi-label { color: var(--ar-ink); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.stand[data-mode="archive"] .kpi-sub { color: var(--ar-ink); }
.stand[data-mode="archive"] .live-dot { display: none; }
.btn-archive { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--ar); color: var(--bg); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }

.mini-kessel { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; }
.mini-kessel .num { font-size: 22px; font-weight: 600; }

/* Fuß */
.site-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-foot nav { display: flex; gap: 20px; }
.site-foot nav a { color: var(--ink); display: inline-flex; align-items: center; min-height: 44px; }
.picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.picker label svg { stroke: currentColor; }
.picker input { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-family: var(--mono); font-size: 14px; }
.archive .picker input { border-color: var(--ar); }

/* Rechtstexte */
.legal { max-width: 68ch; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.6; }
.legal h1 { margin: 0 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
.legal h2 { margin: 18px 0 0; font-size: 19px; font-weight: 700; }
.legal p, .legal ul { margin: 0; }
.legal ul { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }

/* ===== Version 4: Puffer als Farbverlauf mit Temperaturprofil (Vorschlag E) ===== */
.puffer-e .pe-grid { display: grid; grid-template-columns: 40px 46px minmax(0, 1fr); column-gap: 10px; flex-grow: 1; min-height: 300px; margin-top: 22px; }
.pe-labels { position: relative; }
.pe-labels span { position: absolute; right: 0; transform: translateY(-50%); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.pe-col { border-radius: 24px; border: 2px solid var(--dashed); background: var(--track); }
.pe-chart { position: relative; margin-right: 74px; }
.pe-guide { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.pe-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#pe-line { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
#pe-soll { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.pe-dot { position: absolute; width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--ink); box-sizing: border-box; transform: translate(-50%, -50%); }
.pe-val { position: absolute; transform: translateY(-50%); margin-left: 12px; font-family: var(--mono); font-size: 20px; font-weight: 600; white-space: nowrap; }
.pe-soll-label { position: absolute; top: -4px; transform: translate(-50%, -100%); font-size: 12px; color: var(--accent); white-space: nowrap; }
.pe-axis-row { display: grid; grid-template-columns: 40px 46px minmax(0, 1fr); column-gap: 10px; }
.pe-axis { position: relative; height: 16px; margin-right: 74px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pe-axis span { position: absolute; transform: translateX(-50%); }

/* ===== Version 5 (Variante G): Live-Kopfreihe, Verlauf mit gemeinsamer Zeitachse ===== */
:root, :root[data-theme="dark"] { --l-kp: #7A4424; --l-sol: #1E5E4A; --l-ww: #6B5A1F; --l-hk: #284E78; --l-txt: #F1EEE8; }
:root[data-theme="light"] { --l-kp: #F7CFB2; --l-sol: #C4E8D8; --l-ww: #F1E2A8; --l-hk: #CADDF5; --l-txt: #14181D; }

/* Live: Ladezustand | Kessel | Außen + Datenstand */
.hero3 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.hero3 .side { display: flex; flex-direction: column; gap: 12px; }
.hero3 .side { align-content: start; }
.hero3 .side .kpi { justify-content: flex-start; gap: 2px; padding: 14px 16px; }
.hero3 .side .kpi-value .num, .hero3 .side .stand-time { font-size: 24px; font-weight: 600; }
.hero3 .side .stand { justify-content: space-between; align-items: center; }
@media (max-width: 1100px) {
  .hero3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .hero3 .side { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
@media (max-width: 900px) {
  .hero3 { grid-template-columns: minmax(0, 1fr); }
  .hero3 .side { grid-template-columns: minmax(0, 1fr); }
}

/* Verlauf: Diagramm, Zustände und Zeitachse teilen sich die Breite */
.timeline { position: relative; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }
.chart .ylab.in { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.chart .vgrid { stroke: var(--line); stroke-width: 1; opacity: 0.6; }
.tl-divider { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.tl-divider::after { content: ""; flex-grow: 1; border-top: 1px solid var(--line); }
.lanes-g { display: flex; flex-direction: column; gap: 8px; }
.lane-g { position: relative; height: 28px; border-radius: 5px; overflow: hidden; background: var(--track); }
.lane-g .lane-seg { justify-content: flex-end; }
.lane-g .vline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); opacity: 0.6; pointer-events: none; }
.lane-chip { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); z-index: 3; padding: 2px 8px; border-radius: 4px; background: var(--card); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.lane-seg.on.k-kessel_pumpe { background: var(--l-kp); color: var(--l-txt); }
.lane-seg.on.k-solar_pumpe { background: var(--l-sol); color: var(--l-txt); }
.lane-seg.on.k-ww_ladepumpe { background: var(--l-ww); color: var(--l-txt); }
.lane-seg.on.k-hk1_pumpe, .lane-seg.on.k-hk2_pumpe { background: var(--l-hk); color: var(--l-txt); }
.tl-axis { position: relative; height: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-axis span.first { transform: none; }
.tl-axis span.last { transform: translateX(-100%); }
.tl-axis .tl-now { top: -2px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--bg); font-weight: 600; z-index: 4; }
.tl-cursor { position: absolute; top: 0; bottom: 18px; width: 0; border-left: 1.5px solid var(--ink); z-index: 2; pointer-events: none; }
.tl-note { margin: 0; font-size: 14px; color: var(--muted); }
.tip .tip-sep { border-top: 1px solid var(--line); margin: 8px 0 6px; }
.tip .tip-row .st { color: var(--muted); }

/* ===== Version 6: Admin-Link im Fuß, Admin-Bereich ===== */
.site-foot nav { align-items: center; }
.foot-sep { width: 1px; height: 18px; background: var(--line); }
.site-foot nav a.foot-admin { gap: 6px; text-decoration: none; }
.site-foot nav a.foot-admin span { text-decoration: underline; }
.site-foot nav a.foot-admin[aria-current="page"] { color: var(--accent); }
.nw { white-space: nowrap; }

.login-card { max-width: 420px; width: 100%; margin: 24px auto; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.login-form input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
.login-msg { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--a2-soft); border: 1px solid var(--a2); color: var(--ink); font-size: 14px; }

.admin-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--ar-bg); border: 1px solid var(--ar); border-radius: var(--r); color: var(--ar-ink); font-size: 14px; }
.admin-bar svg { stroke: currentColor; }
.admin-bar form { margin: 0; }
.btn-outline { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.admin-bar .btn-outline { border-color: var(--ar); color: var(--ar-ink); }
.btn-outline svg { stroke: currentColor; }

.admin-card { display: flex; flex-direction: column; gap: 20px; padding: 24px 26px; border-radius: 12px; min-width: 0; }
@media (max-width: 700px) { .admin-card { padding: 18px 16px; } }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-title { display: flex; align-items: center; gap: 12px; }
.admin-title svg { stroke: var(--accent); flex-shrink: 0; }
.admin-title h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--chip-on); font-size: 15px; font-weight: 600; }
.state-pill::before { content: ""; width: 9px; height: 9px; border-radius: 999px; background: var(--ok); }
.state-pill[data-state="late"]::before { background: var(--a1); }
.state-pill[data-state="off"]::before { background: var(--a2); }

.big-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.big-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .big-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .big-grid, .big-grid.two { grid-template-columns: minmax(0, 1fr); } }
.big { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--track); border-radius: var(--r); min-width: 0; }
.big > span:first-child, .big .sub { font-size: 13px; color: var(--muted); }
.big > div { display: flex; align-items: baseline; gap: 6px; }
.big .num { font-family: var(--mono); font-size: 28px; font-weight: 600; line-height: 1.1; }
.big .unit { font-size: 15px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.db-table th { text-align: left; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.db-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.db-table .r { text-align: right; }
.db-table .b, .db-table .sum td { font-weight: 600; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
@media (max-width: 700px) { .info-grid { grid-template-columns: minmax(0, 1fr); } }
.info-grid .row { font-size: 15px; padding: 9px 0; }
.info-grid .row > span:last-child { text-align: right; }

.log-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.log-tools .seg a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
.log-tools .seg a[aria-current="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.legend { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 7px; vertical-align: middle; background: var(--muted); }
.legend .ev-dot { margin-right: 0; }
.ev-dot.luecke { background: var(--a1); }
.ev-dot.pi { background: var(--ar); }
.ev-dot.server { background: var(--a2); }

/* ===== Version 7: Push-Nachrichten im Admin-Bereich ===== */
.push-form { display: flex; flex-direction: column; gap: 18px; }
.push-form fieldset { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.push-form legend { padding: 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .fgrid, .fgrid.three { grid-template-columns: minmax(0, 1fr); } }
.fgrid .wide { grid-column: 1 / -1; }
.push-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; }
.push-form input:not([type="checkbox"]), .push-form select { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; width: 100%; box-sizing: border-box; }
.push-form label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); min-height: 44px; }
.push-form input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.push-form .hint { margin: 0; font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions .btn-outline { min-height: 44px; }
.form-msg { padding: 12px 14px; border-radius: 8px; font-size: 14px; border: 1px solid var(--line); }
.form-msg.ok { border-color: var(--ok); }
.form-msg.err { border-color: var(--a2); background: var(--a2-soft); }
.form-msg ul { margin: 6px 0 0; padding-left: 20px; }

/* ===== Version 8: Bereichsumschalter, Solar ===== */
.area-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.area-switch a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.area-switch a svg { stroke: currentColor; }
.area-switch a[aria-current="page"] { background: var(--ink); color: var(--bg); font-weight: 700; }
@media (max-width: 700px) { .area-switch { order: 3; width: 100%; } .area-switch a { flex: 1; justify-content: center; } }

:root, :root[data-theme="dark"] { --p-pv: #F5B14C; --p-bat: #34D399; --p-gin: #F97066; --p-gout: #A78BFA; --p-house: #5AA9FF; --p-wb: #22D3EE; --p-dis: #5AA9FF; }
:root[data-theme="light"] { --p-pv: #B45309; --p-bat: #047857; --p-gin: #B42318; --p-gout: #6D28D9; --p-house: #1D4ED8; --p-wb: #0E7490; --p-dis: #1D4ED8; }

.solar-top { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.solar-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .solar-top { grid-template-columns: minmax(0, 1fr); } .solar-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .solar-cards { grid-template-columns: minmax(0, 1fr); } }
.s-card { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; border-radius: 12px; min-width: 0; }
@media (max-width: 700px) { .s-card { padding: 16px; } }
.s-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.s-title { display: flex; align-items: center; gap: 10px; }
.s-title svg { flex-shrink: 0; }
.s-title h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.s-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--chip-on); font-size: 14px; font-weight: 600; }
.s-pill i { width: 8px; height: 8px; border-radius: 999px; background: var(--dot-off); }
.s-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.s-big .num { font-size: 52px; font-weight: 600; line-height: 1; }
.s-big .unit { font-size: 20px; color: var(--muted); }
.s-big .side { margin-left: auto; font-family: var(--mono); font-size: 18px; }
.s-bar { height: 12px; border-radius: 999px; background: var(--track); overflow: hidden; display: flex; }
.s-bar > div { height: 100%; transition: width 0.4s ease; }
@media (prefers-reduced-motion: reduce) { .s-bar > div { transition: none; } }
.s-string { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.s-string .top { display: flex; justify-content: space-between; align-items: baseline; }
.s-string .top .num { font-size: 20px; font-weight: 600; }
.s-string .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.s-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.s-legend span { display: inline-flex; align-items: center; gap: 6px; }
.s-legend b { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--track); border-radius: var(--r); min-width: 0; }
.tile > span:first-child, .tile .sub { font-size: 13px; color: var(--muted); }
.tile .sub { font-size: 12px; }
.tile .v { display: flex; align-items: baseline; gap: 6px; }
.tile .v .num { font-size: 26px; font-weight: 600; }
.tile .v .unit { font-size: 14px; color: var(--muted); }

/* Energiefluss */
.flow-stage { position: relative; height: 440px; }
.flow-stage svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-stage .ln { stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 9; vector-effect: non-scaling-stroke; }
.flow-stage .ln.off { stroke: var(--line) !important; stroke-dasharray: none; stroke-width: 1.5; }
.flow-stage .ln.on { animation: flowdash 1.2s linear infinite; }
.flow-stage .ln.rev.on { animation-direction: reverse; }
@keyframes flowdash { to { stroke-dashoffset: -10; } }
@media (prefers-reduced-motion: reduce) { .flow-stage .ln.on { animation: none; } }
.flow-stage .chip { position: absolute; transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.flow-stage .chip.off { opacity: 0.5; }
.flow-stage .node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 150px; }
.flow-stage .ring { width: 96px; height: 96px; border-radius: 999px; border: 3px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.flow-stage .ring svg { stroke: currentColor; }
.flow-stage .ring .num { font-size: 20px; font-weight: 600; line-height: 1; }
.flow-stage .ring small { font-size: 11px; color: var(--muted); }
.flow-stage .lbl { font-size: 13px; font-weight: 600; text-align: center; }
.flow-stage .hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 14px; background: var(--track); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.flow-stage .hub svg { stroke: currentColor; }
@media (max-width: 640px) {
  .flow-stage { height: 380px; }
  .flow-stage .node { width: 110px; }
  .flow-stage .ring { width: 74px; height: 74px; }
  .flow-stage .ring .num { font-size: 16px; }
  .flow-stage .chip { font-size: 11px; padding: 1px 6px; }
}
.thermal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 800px) { .thermal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Solar-Verlauf */
.s-chart { position: relative; }
.s-chart svg { display: block; }
.s-chart .ylab { font-family: var(--mono); font-size: 11px; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.bars { position: relative; height: 200px; display: flex; gap: 3px; align-items: stretch; padding-left: 44px; }
.bars .day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.bars .ex { background: var(--p-gout); border-radius: 3px 3px 0 0; }
.bars .own { background: var(--p-pv); }
.bars .yl { position: absolute; left: 0; font-family: var(--mono); font-size: 11px; color: var(--muted); transform: translateY(-50%); }
.bars-x { display: flex; justify-content: space-between; padding-left: 44px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lane-seg.bat-c { background: var(--p-bat); color: var(--on-accent); }
.lane-seg.bat-d { background: var(--l-hk); color: var(--l-txt); }
.lane-seg.g-in { background: var(--p-gin); color: #FFFFFF; }
.lane-seg.g-out { background: var(--p-gout); color: #FFFFFF; }
.lane-seg.wb-on { background: var(--p-wb); color: var(--on-accent); }

/* ===== Version 10: Anlagenschema als festes Raster (Pfeile auf Höhe der Karten) ===== */
.schema-g { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.05fr) 64px minmax(0, 1fr);
  grid-template-rows: auto repeat(3, auto); gap: 14px 8px; align-items: start; }
.schema-g .s-hp  { grid-column: 1; grid-row: 1; }
.schema-g .s-hs  { grid-column: 3; grid-row: 1; }
.schema-g .s-hc  { grid-column: 5; grid-row: 1; }
.schema-g .s-sol { grid-column: 1; grid-row: 2; }
.schema-g .s-kes { grid-column: 1; grid-row: 3; }
.schema-g .a-sol { grid-column: 2; grid-row: 2; }
.schema-g .a-kes { grid-column: 2; grid-row: 3; }
.schema-g .s-sto { grid-column: 3; grid-row: 2 / 5; align-self: stretch; height: auto; }
.schema-g .a-ww  { grid-column: 4; grid-row: 2; }
.schema-g .a-hk1 { grid-column: 4; grid-row: 3; }
.schema-g .a-hk2 { grid-column: 4; grid-row: 4; }
.schema-g .s-ww  { grid-column: 5; grid-row: 2; }
.schema-g .s-hk1 { grid-column: 5; grid-row: 3; }
.schema-g .s-hk2 { grid-column: 5; grid-row: 4; }
.schema-g > .arrow { align-self: center; }
.schema-g .arrow-down { display: none; }
.schema-g .puffer-e .pe-grid { flex: 1 0 280px; min-height: 280px; }
@media (max-width: 900px) {
  .schema-g { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 12px; }
  .schema-g > * { grid-column: auto !important; grid-row: auto !important; }
  .schema-g > .arrow { display: none; }
  .schema-g .arrow-down { display: flex; }
}

/* ===== Version 11: Energiefluss auf dem Handy als Liste ===== */
.flow-list { display: none; flex-direction: column; gap: 18px; }
.fl-group { display: flex; flex-direction: column; gap: 10px; }
.fl-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.fl-head b { font-family: var(--mono); font-size: 13px; color: var(--ink); letter-spacing: 0; text-transform: none; font-weight: 600; }
.fl-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px; align-items: center; }
.fl-row .ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 999px; border: 2px solid currentColor; display: flex; align-items: center; justify-content: center; }
.fl-row .ic svg { stroke: currentColor; }
.fl-row .nm { font-size: 15px; font-weight: 600; min-width: 0; }
.fl-row .nm small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.fl-row .kw { font-family: var(--mono); font-size: 17px; font-weight: 600; text-align: right; }
.fl-row .br { grid-column: 2 / 4; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.fl-row .br > div { height: 100%; border-radius: 999px; }
.fl-row.off { opacity: 0.45; }
@media (max-width: 640px) {
  .flow-stage { display: none; }
  .flow-list { display: flex; }
}

/* ===== Version 14: drittes Design „Terminal“ (Phosphor-Bildschirm) ===== */
/* Zeilenraster des Röhrenbildschirms */

/* Symbol im Umschalter: zeigt immer das nächste Design */
.theme-btn .i-plan { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-plan { display: inline; }


/* ===== Version 15: Karten deutlicher absetzen, Admin mit Seitenleiste ===== */
:root, :root[data-theme="dark"] { --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 10px 28px rgba(0, 0, 0, 0.50), 0 2px 4px rgba(0, 0, 0, 0.40); }
:root[data-theme="light"] { --card-shadow: 0 1px 3px rgba(16, 24, 40, 0.10), 0 10px 24px rgba(16, 24, 40, 0.09); }

.admin-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-radius: 12px; }
.admin-side .side-group { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.admin-side .side-group:first-child { margin-top: 4px; }
.admin-side a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.admin-side a svg { stroke: currentColor; flex-shrink: 0; }
.admin-side a span { flex-grow: 1; }
.admin-side a:hover { background: var(--track); }
.admin-side a[aria-current="page"] { background: var(--chip-on); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); display: inline-block; flex-shrink: 0; }
.dot[data-state="late"] { background: var(--a1); }
.dot[data-state="off"] { background: var(--a2); }
.dot[data-state="info"] { background: var(--ar); }
.dot[data-state="none"] { background: var(--dot-off); }
.state-pill[data-state="info"]::before { background: var(--ar); }
.state-pill[data-state="none"]::before { background: var(--dot-off); }
.admin-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.admin-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.admin-title-row .crumb { font-size: 13px; color: var(--muted); }
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.health { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 12px; border-top: 4px solid var(--ok); color: var(--ink); text-decoration: none; min-width: 0; }
.health[data-state="late"] { border-top-color: var(--a1); }
.health[data-state="off"] { border-top-color: var(--a2); }
.health[data-state="info"] { border-top-color: var(--ar); }
.health[data-state="none"] { border-top-color: var(--dot-off); }
.health .hl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.health .hl svg { stroke: currentColor; }
.health .hl .dot { margin-left: auto; width: 10px; height: 10px; }
.health .hv { font-size: 19px; font-weight: 700; line-height: 1.2; }
.health .hs { font-size: 13px; color: var(--muted); }
.health .hg { font-size: 13px; color: var(--accent); margin-top: auto; }
.admin-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mini-log { display: flex; flex-direction: column; }
.mini-log > div { display: grid; grid-template-columns: 96px 100px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.more { font-size: 13px; color: var(--accent); text-decoration: none; }
.status-line { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 12px 16px; background: var(--track); border-radius: var(--r); font-size: 14px; }
.status-line > span { color: var(--muted); }
.inline-form { margin: 0; display: inline-flex; }
.tool-list { display: flex; flex-direction: column; }
.tool-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.tool-row .ti { color: var(--accent); display: inline-flex; }
.tool-row .ti.danger { color: var(--a2); }
.tool-row .ti svg { stroke: currentColor; }
.tool-row div { display: flex; flex-direction: column; gap: 2px; }
.tool-row div span { font-size: 13px; color: var(--muted); }
.btn-outline.danger { border-color: var(--a2); color: var(--a2); }
@media (max-width: 1000px) { .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-2col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; }
  .admin-side .side-group { display: none; }
  .admin-side a { flex-shrink: 0; white-space: nowrap; }
}
@media (max-width: 520px) { .health-grid { grid-template-columns: minmax(0, 1fr); } .tool-row { grid-template-columns: 28px minmax(0, 1fr); } .tool-row .inline-form { grid-column: 2; } .mini-log > div { grid-template-columns: 1fr; gap: 2px; } }

/* ===== Version 16: Kessel-Zustände, Zeitreise, angehefteter Cursor ===== */
:root, :root[data-theme="dark"] { --k-ready: #8EA4BC; --k-door: #C084FC; --k-ignite: #FFAA5C; --k-heat: #FF6A2B; --k-burn: #E2553A; --k-unknown: #7D8793; --k-ink: #14100C; }
:root[data-theme="light"] { --k-ready: #64748B; --k-door: #9333EA; --k-ignite: #D97706; --k-heat: #C2410C; --k-burn: #B91C1C; --k-unknown: #9AA3AD; --k-ink: #FFFFFF; }
[data-kstate="ready"] { --kc: var(--k-ready); }
[data-kstate="door"] { --kc: var(--k-door); }
[data-kstate="ignite"] { --kc: var(--k-ignite); }
[data-kstate="heat"] { --kc: var(--k-heat); }
[data-kstate="burn"] { --kc: var(--k-burn); }
[data-kstate="unknown"] { --kc: var(--k-unknown); }

.k-card { background: linear-gradient(180deg, color-mix(in srgb, var(--kc) 14%, transparent), transparent 55%), var(--card); }
.k-card:not([data-kstate="ready"]):not([data-kstate="unknown"]) { border-color: var(--kc); }
.k-card .kessel-title svg { stroke: var(--kc); }
.k-eta { font-size: 12px; color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-main { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; align-items: center; }
.k-fire svg { display: block; width: 120px; height: 142px; }
.k-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.k-badge { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 6px 16px 6px 8px; border-radius: 999px; background: var(--kc); color: var(--k-ink); font-size: 20px; font-weight: 800; position: relative; }
.k-card[data-kstate="door"] .k-badge, .k-card[data-kstate="heat"] .k-badge { box-shadow: 0 0 0 4px color-mix(in srgb, var(--kc) 30%, transparent); }
.k-ico { display: inline-flex; width: 28px; height: 28px; border-radius: 999px; background: rgba(0, 0, 0, 0.18); align-items: center; justify-content: center; }
.k-ico svg { stroke: currentColor; }
.k-since { font-size: 13px; color: var(--ink); min-height: 1.2em; }
.k-soll { margin-left: 8px; font-size: 13px; color: var(--muted); }
.k-card .kessel-temp .num { font-size: 56px; }
.k-steps { position: relative; display: flex; }
.k-steps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 8px; height: 2px; background: var(--track); }
.k-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 0; }
.k-step i { width: 10px; height: 10px; border-radius: 999px; background: var(--track); margin-top: 3px; z-index: 1; }
.k-step b { font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.k-step.done i { background: var(--sc); }
.k-step.cur i { width: 16px; height: 16px; margin-top: 0; background: var(--sc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc) 25%, transparent); }
.k-step.cur b { color: var(--ink); font-weight: 700; }
.k-step[data-step="ready"] { --sc: var(--k-ready); } .k-step[data-step="door"] { --sc: var(--k-door); }
.k-step[data-step="ignite"] { --sc: var(--k-ignite); } .k-step[data-step="heat"] { --sc: var(--k-heat); } .k-step[data-step="burn"] { --sc: var(--k-burn); }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .k-main { grid-template-columns: 90px minmax(0, 1fr); } .k-fire svg { width: 90px; height: 106px; } .k-step b { font-size: 10px; } }
/* kleine Kesselkarte im Schema */
.node.k-node .node-status::before, .node.active.k-node .node-status::before { background: var(--kc); }
.node.k-node:not([data-kstate="ready"]):not([data-kstate="unknown"]) { border-color: var(--kc); }

/* Zeitreise */
.zr { display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; border-radius: 12px; border-color: var(--ar); }
.zr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.zr-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zr-title svg { stroke: var(--ar); }
.zr-title h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.zr-title .muted { font-size: 13px; }
.zr-track { position: relative; padding-top: 30px; cursor: ew-resize; touch-action: none; user-select: none; outline: none; }
.zr-track:focus-visible .zr-knob { outline: 2px solid var(--ink); outline-offset: 2px; }
.zr-chart { position: relative; height: 70px; }
.zr-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.zr-chart .lbl { position: absolute; left: 6px; top: 2px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.zr-band { position: relative; height: 14px; margin-top: 6px; border-radius: 4px; overflow: hidden; background: var(--track); }
.zr-band > div { position: absolute; top: 0; bottom: 0; background: var(--kc); }
.zr-shade { position: absolute; top: 30px; bottom: 0; right: 0; background: color-mix(in srgb, var(--bg) 50%, transparent); pointer-events: none; }
.zr-handle { position: absolute; top: 0; bottom: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.zr-time { padding: 3px 10px; border-radius: 6px; background: var(--ar); color: var(--bg); font-size: 13px; font-weight: 700; white-space: nowrap; }
.zr-line { flex-grow: 1; width: 2px; background: var(--ar); }
.zr-knob { width: 22px; height: 22px; border-radius: 999px; background: var(--ar); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--ar); margin-bottom: -11px; }
.zr-axis { margin-top: 10px; }
.zr-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.zr-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.zr-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.zr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.k-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--kc); display: inline-block; }
#zr-open { min-height: 44px; }

/* Verlauf: angehefteter Cursor */
.tip.pinned { pointer-events: auto; border-color: var(--ar); }
.tip .tip-close { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; min-width: 28px; min-height: 28px; }
.tip .tip-go { display: flex; align-items: center; justify-content: center; min-height: 40px; margin-top: 10px; border-radius: 8px; background: var(--ar); color: var(--bg); font-weight: 700; text-decoration: none; }
.tl-cursor.pinned { border-left-color: var(--ar); border-left-width: 2px; }

.lane-seg[data-kstate] { background: var(--kc); color: var(--k-ink); }

/* kleine Kesselkarte: gleiches Schild und Brennraum in klein */
.k-badge.sm { font-size: 14px; padding: 3px 10px 3px 4px; gap: 6px; }
.k-badge.sm .k-ico { width: 20px; height: 20px; }
.k-badge.sm .k-ico svg { width: 13px; height: 13px; }
.km-main { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; align-items: center; }
.kn-fire svg { width: 54px; height: 64px; }

/* ===== Version 17: Kopf „H26“ (Variante A) und Design-Menü ===== */
.hdr { display: grid; grid-template-columns: auto 1fr auto auto; grid-template-areas: "brand area view theme"; align-items: center; gap: 12px 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hdr .brand { grid-area: brand; gap: 10px; }
.brand-ic { display: inline-flex; width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 16%, transparent); flex-shrink: 0; }
.hdr .brand svg { stroke: var(--accent); }
.hdr .brand-name { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.1; }
.hdr .brand-sub { font-size: 12px; }
.area-tabs { grid-area: area; display: flex; gap: 24px; }
.area-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px; font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.area-tabs a svg { stroke: currentColor; }
.area-tabs a:hover { color: var(--ink); }
.area-tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.area-tabs a[aria-current="page"] svg { stroke: var(--accent); }
.view-pill { grid-area: view; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--track); }
.view-pill a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--muted); text-decoration: none; }
.view-pill a svg { stroke: currentColor; }
.view-pill a:hover { color: var(--ink); }
.view-pill a[aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.theme-menu { grid-area: theme; position: relative; }
.theme-trigger { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.theme-trigger:hover, .theme-trigger[aria-expanded="true"] { background: var(--track); }
.theme-trigger svg { stroke: currentColor; }
.theme-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 220px; padding: 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.theme-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.theme-item svg { stroke: currentColor; flex-shrink: 0; }
.theme-item span { flex-grow: 1; }
.theme-item i { font-style: normal; visibility: hidden; color: var(--accent); }
.theme-item[aria-checked="true"] { background: var(--track); font-weight: 700; }
.theme-item[aria-checked="true"] i { visibility: visible; }
.theme-item:hover, .theme-item:focus-visible { background: var(--chip-on); outline: none; }
.theme-sep { display: block; border-top: 1px solid var(--line); margin: 6px 4px; }
.theme-menu { justify-self: end; }
@media (max-width: 700px) {
  .hdr { grid-template-columns: 1fr auto; grid-template-areas: "brand theme" "area area" "view view"; gap: 8px 12px; }
  .area-tabs { gap: 20px; }
  .view-pill { display: flex; }
  .view-pill a { flex: 1; justify-content: center; }
}

/* ===== Version 18: Photovoltaik „Heute“ (D), Überblick, Zeitstrahl, Jahreskalender ===== */
.pv-today { gap: 18px; }
.pt-blk { display: flex; flex-direction: column; gap: 8px; }
.pt-row { display: flex; justify-content: space-between; align-items: baseline; }
.pt-t { font-size: 14px; font-weight: 700; }
.pt-v .mono { font-size: 22px; font-weight: 600; }
.pt-v small { font-size: 13px; color: var(--muted); }
.pt-bar { display: flex; gap: 2px; height: 16px; border-radius: 999px; overflow: hidden; background: var(--track); }
.pt-bar div { flex: 0 0 0%; transition: flex-basis 0.4s ease; }
.pt-leg { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.pt-leg span { display: inline-flex; align-items: center; gap: 6px; }
.pt-leg b { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pt-leg strong { font-weight: 600; }
.pt-rings { flex-grow: 1; display: flex; gap: 10px; align-items: center; }
.pt-ring { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pt-ring-c { position: relative; width: 120px; height: 120px; }
.pt-ring-c svg { width: 120px; height: 120px; }
.pt-ring-c .pt-track { fill: none; stroke: var(--track); stroke-width: 10; }
.pt-ring-c .pt-val { fill: none; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 0 300; transition: stroke-dasharray 0.6s ease; }
.pt-ring-c > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pt-ring-c .mono { font-size: 28px; font-weight: 600; line-height: 1; }
.pt-ring-c small { font-size: 12px; color: var(--muted); }
.pt-lab { font-size: 14px; font-weight: 700; }
.pt-feed { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: var(--r); background: color-mix(in srgb, var(--p-gout) 14%, transparent); border: 1px solid color-mix(in srgb, var(--p-gout) 45%, transparent); }
.pt-feed > div { display: flex; flex-direction: column; gap: 2px; }
.pt-feed strong { font-size: 15px; }
.pt-feed span { font-size: 13px; color: var(--muted); }
.pt-feed .pt-eur { font-size: 28px; font-weight: 600; color: var(--p-gout); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .pt-bar div, .pt-ring-c .pt-val { transition: none; } }

.pz-title { display: flex; flex-direction: column; gap: 4px; }
.sec-title { margin: 12px 0 0; font-size: 18px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.pz-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .pz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pz-tiles { grid-template-columns: minmax(0, 1fr); } }
.pz-tile { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid transparent; border-radius: 12px; background: var(--track); color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.pz-tile:hover { border-color: var(--p-gout); }
.pz-th { display: flex; justify-content: space-between; align-items: baseline; }
.pz-th b { font-size: 15px; }
.pz-th span, .pz-cap { font-size: 12px; color: var(--muted); }
.pz-eur { font-size: 28px; font-weight: 600; color: var(--p-gout); line-height: 1.1; }
.pz-split { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--card); }
.pz-split i { flex: 0 0 0%; }
.pz-nums { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.pz-nums b { color: var(--ink); font-weight: 600; }
.pz-tile svg { width: 100%; height: 42px; }
.pz-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.pz-nav { display: flex; align-items: center; gap: 8px; }
.pz-label { font-size: 17px; font-weight: 700; min-width: 4ch; }
.pz-sums { display: flex; gap: 22px; flex-wrap: wrap; }
.pz-sums div { display: flex; flex-direction: column; }
.pz-sums span { font-size: 12px; color: var(--muted); }
.pz-sums b { font-size: 22px; font-weight: 600; }
.pz-chart { position: relative; }
.pz-cols { display: flex; gap: 4px; align-items: stretch; }
.pz-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pz-col.drill { cursor: pointer; }
.pz-col.drill:hover .pz-stack { outline: 1px solid var(--line); outline-offset: 2px; border-radius: 3px; }
.pz-col.future { opacity: 0.35; }
.pz-ce { height: 16px; font-size: 11px; font-weight: 600; color: var(--p-gout); white-space: nowrap; }
.pz-stack { width: 100%; height: 200px; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; }
.pz-stack .ex { background: var(--p-gout); border-radius: 3px 3px 0 0; }
.pz-stack .own { background: var(--p-pv); }
.pz-cl { height: 16px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pz-cum { position: absolute; left: 0; right: 0; top: 22px; width: 100%; height: 200px; pointer-events: none; }
.pz-cummax { position: absolute; right: 0; top: 0; font-size: 11px; color: var(--muted); background: var(--card); padding: 0 4px; }
@media (max-width: 640px) { .pz-stack, .pz-cum { height: 150px; } .pz-cols { gap: 2px; } }
.pz-cal-wrap { overflow-x: auto; padding-bottom: 4px; }
.pz-cal { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; width: max-content; }
.pz-day { width: 13px; height: 13px; padding: 0; border: 0; border-radius: 3px; background: var(--track); cursor: pointer; }
.pz-day.empty { background: transparent; cursor: default; }
.pz-day.future { opacity: 0.4; cursor: default; }
.pz-day:not(.empty):not(.future):hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.pz-scale { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pz-scale i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.pz-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 800px) { .pz-months { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pz-month { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border: 0; border-radius: 8px; background: var(--track); color: var(--ink); font: inherit; cursor: pointer; }
.pz-month span { font-size: 12px; color: var(--muted); }
.pz-month b { font-size: 14px; font-weight: 600; }
.pz-month em { font-style: normal; font-size: 12px; color: var(--p-gout); }
.pz-month.future { background: transparent; opacity: 0.4; cursor: default; }
.pz-title + .controls .sec-title { margin-top: 4px; }

/* Zeitreise: alle Kurven */
.zr-chart { height: 120px; }
.zr-chart .lbl.lo { top: auto; bottom: 2px; }
.zr-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.zr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.zr-legend b { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.zr-legend b.area { height: 10px; width: 12px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 45%, transparent); border-top: 2px solid var(--accent); }
@media (max-width: 640px) { .zr-chart { height: 96px; } }

/* Kessel-Kennwerte: Einheit klein hinter dem Wert, nichts läuft über */
.stat .sv { display: flex; align-items: baseline; gap: 4px; min-width: 0; flex-wrap: wrap; }
.stat .sv .num { white-space: nowrap; }
.stat .sv small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stats.four .stat { padding: 10px 12px; }
.stats.four .stat .sv { gap: 3px; }
.stats.four .stat .num { font-size: 17px; }

/* ===== Version 24: Puffer-Karte mit Tank, Trend und Restzeit ===== */
:root, :root[data-theme="dark"] { --pk-cold: #5AA9FF; --pk-mid: #F5B14C; --pk-hot: #FF6A2B; --pk-heat: #FF6A2B; }
:root[data-theme="light"] { --pk-cold: #3B82F6; --pk-mid: #E3A008; --pk-hot: #EA580C; --pk-heat: #E2550F; }
.pk { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 16px; border-radius: 12px; min-width: 0; --pkc: var(--ok); }
.pk[data-level="low"] { border: 2px solid var(--a1); --pkc: var(--a1); }
.pk[data-level="crit"] { border: 2px solid var(--a2); --pkc: var(--a2); background: var(--a2-soft); }
.pk[data-level="heat"] { --pkc: var(--pk-heat); }
.pk[data-level="none"] { --pkc: var(--dot-off); }
.pk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pk-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, var(--pkc) 18%, transparent); color: var(--pkc); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pk-pill i { width: 8px; height: 8px; border-radius: 999px; background: var(--pkc); }
:root[data-theme="light"] .pk[data-level="low"] .pk-pill { color: var(--a1-ink); }
.pk-body { display: flex; gap: 10px; flex-grow: 1; align-items: stretch; min-height: 0; }
.pk-tank { flex: 0 0 auto; display: flex; align-items: center; }
.pk-tank svg { height: 280px; width: auto; display: block; }
.pk-tank .pk-bg { fill: var(--track); }
.pk-tank .pk-frame { fill: none; stroke: var(--line); stroke-width: 2; }
.pk-tank .pk-wave { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 2; }
.pk-tank .pk-chip { fill: rgba(11, 13, 16, 0.72); }
.pk-tank .pk-chipt { fill: #ECE9E3; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.pk-low { stroke: var(--a1); stroke-width: 2.5; }
.pk-crit { stroke: var(--a2); stroke-width: 2.5; }
.pk-lowt { fill: var(--a1); font-family: var(--mono); font-size: 10px; }
.pk-critt { fill: var(--a2); font-family: var(--mono); font-size: 10px; }
.pk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.pk-info > div + div { padding-top: 10px; border-top: 1px solid var(--line); }
.pk-top { display: flex; flex-direction: column; gap: 6px; }
.pk-cap { font-size: 12px; color: var(--muted); }
.pk-val { display: flex; align-items: baseline; gap: 4px; }
.pk-val .num { font-size: 52px; font-weight: 600; line-height: 0.95; }
.pk-val .unit { font-size: 20px; color: var(--muted); }
.pk[data-level="low"] .pk-val .num { color: var(--a1); }
.pk[data-level="crit"] .pk-val .num { color: var(--a2); }
.pk-trend { align-self: flex-start; padding: 3px 7px; border-radius: 7px; background: var(--track); font-size: 11px; white-space: nowrap; }
.pk-trend[data-dir="up"], .pk-trend[data-dir="down"] { color: var(--pkc); }
.pk-rest { display: flex; flex-direction: column; gap: 2px; }
.pk-rest .mono { font-size: 20px; font-weight: 600; white-space: nowrap; }
.pk-spark { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.pk-spark svg { width: 100%; height: 44px; display: block; }
.pk-spark .pk-low, .pk-spark .pk-crit { stroke-width: 1; opacity: 0.6; }
.pk-line { fill: none; stroke: var(--pkc); stroke-width: 2; }
.pk-foot { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.pk-foot span:nth-child(odd) { color: var(--muted); }
.pk-foot span:nth-child(2) { justify-self: start; }
@media (max-width: 640px) { .pk-tank svg { height: 230px; } .pk-val .num { font-size: 44px; } }

/* Kopf: feste Zeilenhöhen, damit Schriftwechsel ihn nicht verschieben */
.hdr .brand-name { line-height: 26px; }
.hdr .brand-sub { line-height: 16px; }
.hdr .brand > span:last-child { display: flex; flex-direction: column; height: 42px; justify-content: center; }
/* Design-Knopf: Hülle ohne Textzeile, damit der leere Knopf vor dem Skript nicht höher ist (Kopf sprang um 5 px) */
.theme-menu { display: flex; align-items: center; height: 44px; }
/* Platz für nachladende Teile der Karten reservieren (verhindert Springen beim Laden) */
.k-fire { min-height: 142px; min-width: 120px; }
.kn-fire { min-height: 64px; min-width: 54px; }
#pk-spark { min-height: 44px; }
.pk-tank { min-height: 280px; }
.pk-trend { min-height: 20px; }
#k-since { min-height: 1.4em; }
@media (max-width: 520px) { .k-fire { min-height: 106px; min-width: 90px; } }
@media (max-width: 640px) { .pk-tank { min-height: 230px; } }
.pt-feed .pt-eur { min-width: 8.5ch; text-align: right; }

/* ===== Version 31: Admin-Zugang als Zahnrad im Kopf ===== */
.hdr { grid-template-columns: auto 1fr auto auto auto; grid-template-areas: "brand area view admin theme"; }
.admin-link { grid-area: admin; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; color: var(--muted); }
.admin-link svg { stroke: currentColor; }
.admin-link:hover, .admin-link:focus-visible { background: var(--track); color: var(--ink); }
.admin-link[aria-current="page"] { color: var(--accent); }
.hdr .theme-menu { justify-self: auto; }
.hdr > .admin-link + .theme-menu { margin-left: -20px; }
@media (max-width: 700px) {
  .hdr { grid-template-columns: 1fr auto auto; grid-template-areas: "brand admin theme" "area area area" "view view view"; }
  .hdr > .admin-link + .theme-menu { margin-left: -8px; }
}

/* ===== Version 34: Wallbox & Fahrzeuge (Admin) ===== */
.veh-list { display: flex; flex-direction: column; }
.veh-row { display: grid; grid-template-columns: 44px minmax(0, 1.3fr) minmax(0, 0.9fr) minmax(0, 1.2fr) auto auto; gap: 12px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.veh-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.veh-row input:not([type="checkbox"]) { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; }
.veh-row input.mono { font-family: var(--mono); }
.veh-row label.check { flex-direction: row; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; color: var(--ink); }
.veh-ic { display: inline-flex; width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center; background: color-mix(in srgb, var(--k-door) 20%, transparent); color: var(--k-door); align-self: center; }
.veh-ic.company { background: color-mix(in srgb, var(--p-house) 20%, transparent); color: var(--p-house); }
.veh-ic.unk { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.veh-ic svg { stroke: currentColor; }
.veh-act { display: flex; gap: 6px; }
.veh-row.unknown { grid-template-columns: 44px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) auto auto; border: 1px dashed var(--accent); border-radius: 10px; padding: 12px; margin-top: 10px; }
.unk-info { font-size: 13px; align-self: center; }
.veh-new summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--accent); }
@media (max-width: 900px) { .veh-row, .veh-row.unknown { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); } .veh-act { grid-column: 2 / -1; } .unk-info { grid-column: 2 / -1; } }

/* ===== Version 34: Seite „Laden“ ===== */
.ld-ic { color: var(--p-wb); display: inline-flex; }
.ld-live { border-color: var(--p-wb); }
.ld-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 22px; align-items: stretch; }
@media (max-width: 900px) { .ld-grid { grid-template-columns: minmax(0, 1fr); } }
.ld-left, .ld-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ld-veh { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--track); }
.ld-veh > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-veh strong { font-size: 16px; }
.ld-veh .mono { font-size: 12px; color: var(--muted); }
.ld-veh .ld-tag { margin-left: auto; }
.ld-vic { display: inline-flex; width: 44px; height: 44px; border-radius: 10px; align-items: center; justify-content: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.ld-vic[data-kind="company"] { background: color-mix(in srgb, var(--p-house) 20%, transparent); color: var(--p-house); }
.ld-vic[data-kind="private"] { background: color-mix(in srgb, var(--k-door) 20%, transparent); color: var(--k-door); }
.ld-vic svg { stroke: currentColor; }
.ld-big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ld-big > div { display: flex; flex-direction: column; gap: 2px; }
.ld-big b { font-size: 40px; font-weight: 600; line-height: 1; }
.ld-big small { font-size: 15px; color: var(--muted); }
.ld-energy b { color: var(--p-wb); }
.ld-origin { display: flex; flex-direction: column; gap: 6px; }
.ld-row { display: flex; justify-content: space-between; gap: 10px; }
.ld-spark svg, .ld-curve svg { width: 100%; height: 110px; display: block; }
.ld-curve svg { height: 120px; }
.ld-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.ld-meters div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--track); min-width: 0; }
.ld-meters span { font-size: 11px; color: var(--muted); }
.ld-meters b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ld-tools .seg button { min-height: 36px; font-size: 13px; padding: 0 12px; }
.ld-csv { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; text-decoration: none; }
.ld-csv svg { stroke: currentColor; }
.ld-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .ld-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ld-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ld-tag.company { background: color-mix(in srgb, var(--p-house) 18%, transparent); color: var(--p-house); }
.ld-tag.private { background: color-mix(in srgb, var(--k-door) 18%, transparent); color: var(--k-door); }
.ld-tag.unknown { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.ld-table td { vertical-align: middle; }
.ld-tr { cursor: pointer; }
.ld-tr:hover td { background: var(--track); }
.ld-tr.running td { background: color-mix(in srgb, var(--p-wb) 8%, transparent); }
.ld-run { color: var(--p-wb); }
.ld-vn { display: inline-flex; align-items: center; gap: 8px; }
.ld-vn svg { stroke: currentColor; flex-shrink: 0; }
.ld-vn[data-kind="company"] svg { stroke: var(--p-house); }
.ld-vn[data-kind="private"] svg { stroke: var(--k-door); }
.ld-vn[data-kind="unknown"] svg { stroke: var(--accent); }
.ld-meter { font-size: 12px; color: var(--muted); }
.ld-own { display: flex; align-items: center; gap: 6px; min-width: 110px; }
.ld-own > div { flex: 1; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.ld-own i { display: block; height: 100%; background: var(--p-pv); }
.ld-own span { font-size: 12px; color: var(--muted); }
.ld-eur { color: var(--ok); }
.ld-detail td { background: var(--track); }
.ld-curve { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px; }
@media (max-width: 640px) { .ld-meters { grid-template-columns: minmax(0, 1fr); } .ld-meters div { flex-direction: row; justify-content: space-between; align-items: baseline; } .ld-big b { font-size: 34px; } }


/* ===== Poferl: Anlagenschema ohne Erzeuger (Speicher links, Verbraucher rechts) ===== */
.schema-p { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto repeat(3, auto); gap: 14px 16px; align-items: start; }
.schema-p .s-hs { grid-column: 1; grid-row: 1; }
.schema-p .s-hc { grid-column: 2; grid-row: 1; }
.schema-p .s-sto { grid-column: 1; grid-row: 2 / 5; align-self: stretch; height: auto; }
.schema-p .s-ww { grid-column: 2; grid-row: 2; }
.schema-p .s-hk1 { grid-column: 2; grid-row: 3; }
.schema-p .s-hk2 { grid-column: 2; grid-row: 4; }
.schema-p .puffer-e .pe-grid { flex: 1 0 280px; min-height: 280px; }
@media (max-width: 900px) {
  .schema-p { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .schema-p > * { grid-column: auto !important; grid-row: auto !important; }
}
@media (max-width: 1100px) { .hero3 { grid-template-columns: minmax(0, 1fr); } .hero3 .side { grid-column: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hero3 .side { grid-template-columns: minmax(0, 1fr); } }

/* Poferl: weniger Karten */
.health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .health-grid { grid-template-columns: minmax(0, 1fr); } }
.solar-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .solar-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .solar-cards { grid-template-columns: minmax(0, 1fr); } }
