/* hpDashboardCloud – Gestaltung nach hpDashboard (static/index.html): gleiche Farben, Schrift, Kacheln, Diagramme.
   Mandanten-Farben kommen als --brand-* von app.js (branding.colors); ohne Wert gelten die Standardfarben. */

@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700; font-style: normal; font-display: swap; }

/* ───────────── Grundfarben und Messreihen ───────────── */
:root {
  color-scheme: light;
  --page: var(--brand-page, #e9ecea);
  --surface: var(--brand-surface, #fbfcfb);
  --surface-2: var(--brand-surface-2, #eef1ef);
  --text: var(--brand-text, #12262a);
  --text-2: var(--brand-text-2, #475558);
  --muted: var(--brand-muted, #5d6b6e);
  --grid: #dde2e0;
  --axis: #bcc6c4;
  --border: rgba(18,38,42,0.13);
  /* Entitäten – überall gleiche Farbe */
  --c-aussen: #1e6b3a;
  --c-vorlauf: #eb6834;
  --c-ruecklauf: #2a78d6;
  --c-ww: #eda100;
  --c-waerme: #e87ba4;
  --c-strom: #6250d6;
  --c-umwelt: #4f8a5b;
  --c-defrost: #2a78d6;      /* Abtauen/Schwimmbad behalten ihre bisherige Farbe */
  --c-pool: #1baf7a;
  --c-fc-rl: #1d5fc4;
  --c-fc-rls: #c278e8;
  /* Status (reserviert, immer mit Text) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-text: #006300;
  --danger-text: #b02a2a;
  --accent: var(--brand-accent, #0e5c63);
  --on-accent: var(--brand-on-accent, #fff);
  --radius: 12px;
  --r-ctl: 6px;
  --mode-heizen: #a9441f; --mode-ww: #a85b00; --mode-abtauen: #1f5fae;   /* weißer Text ≥ 5:1 */
  --z-tooltip: 20;
  font-family: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: var(--brand-page-dark, #0c1415);
    --surface: var(--brand-surface-dark, #151f21);
    --surface-2: var(--brand-surface-2-dark, #1d2a2c);
    --text: var(--brand-text-dark, #eaf0ef);
    --text-2: var(--brand-text-2-dark, #b9c6c5);
    --muted: var(--brand-muted-dark, #85969a);
    --grid: #263436; --axis: #35474a; --border: rgba(255,255,255,0.12);
    --c-aussen: #3f9a5f; --c-vorlauf: #d95926; --c-ruecklauf: #3987e5; --c-ww: #c98500;
    --c-waerme: #d55181; --c-strom: #9085e9; --c-umwelt: #5fa36f; --c-fc-rl: #2d63cc; --c-defrost: #3987e5; --c-pool: #199e70; --c-fc-rls: #b272e4;
    --good-text: #0ca30c; --danger-text: #ff8a80;
    --accent: var(--brand-accent-dark, #6fc8cc);
    --on-accent: var(--brand-on-accent-dark, #0c1415);
  }
}

/* ───────────── Grundlayout ───────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent); }
body { margin: 0; background: var(--page); color: var(--text); font-size: 15px; line-height: 1.45; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 36px) 40px; }
h1, h2, h3 { margin: 0; font-weight: 650; text-wrap: balance; }
h1 { font-size: clamp(22px, 2.5vw, 28px); line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { text-wrap: pretty; margin: 0; }
a { color: var(--accent); }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; overflow-wrap: anywhere; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.sub { color: var(--text-2); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -64px; z-index: var(--z-tooltip); padding: 10px 14px; border-radius: var(--r-ctl);
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
main:focus, h1:focus { outline: none; }
button, a, summary, label, input, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1[tabindex]:focus-visible, main:focus-visible { outline: none; }

/* ───────────── Knöpfe und Formulare ───────────── */
button, .btn {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 8px 14px; cursor: pointer; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; font-weight: 550;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 650; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn.danger { color: #fff; background: var(--critical); border-color: var(--critical); font-weight: 650; }
.btn.danger:hover { background: color-mix(in srgb, var(--critical) 88%, #000); }
.btn.wide { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; font-size: 16px; padding: 9px 11px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  background: var(--page); color: var(--text); width: 100%; min-height: 44px;
}
input::placeholder { color: var(--muted); opacity: 1; }
.code-input { font-size: 22px; letter-spacing: .12em; font-weight: 650; text-transform: uppercase; max-width: 15ch; }
.hint { font-size: 13px; color: var(--text-2); }
.check { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.check label { font-size: 14px; }
.check .hint { grid-column: 2; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.actions.start { justify-content: flex-start; margin: 12px 0; }
.msg { padding: 10px 14px; border-radius: var(--r-ctl); background: var(--surface-2); font-size: 14px; border-left: 4px solid var(--muted); }
.msg[data-s="good"] { border-left-color: var(--good); }
.msg[data-s="warning"] { border-left-color: var(--warning); }
.msg[data-s="serious"] { border-left-color: var(--serious); background: color-mix(in srgb, var(--serious) 12%, var(--surface)); }
.msg.flash { margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; }
.alt { margin-top: 18px; font-size: 14px; }

/* ───────────── Kopfzeile ───────────── */
header.top { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { flex: none; }
.brand-mark rect { fill: var(--accent); }
.brand-mark path { fill: none; stroke: var(--on-accent); stroke-width: 2; stroke-linecap: round; }
.brand-logo { height: 40px; width: auto; max-width: 160px; object-fit: contain; }
.brand-name { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.account-nav { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.navlink { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 10px; border-radius: var(--r-ctl);
  min-height: 40px; display: inline-flex; align-items: center; }
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

/* ───────────── Karten und Raster ───────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card + .card, .grid + .card, .card + .grid { margin-top: 16px; }
.card > h2, .card > h3 { margin-bottom: 12px; }
.card > h3:not(:first-child) { margin-top: 18px; }
.card.narrow { max-width: 460px; margin: 4vh auto 0; padding: 26px clamp(18px, 4vw, 30px); }
.card.narrow h1 { margin-bottom: 6px; }
.card.narrow .sub { margin-bottom: 20px; }
.card.empty { text-align: center; padding: 34px 20px; }
.card.empty p { margin: 8px auto 16px; max-width: 52ch; color: var(--text-2); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid.two > .card + .card { margin-top: 0; }
.help ul { padding-left: 20px; margin: 10px 0; }
.help li { margin: 6px 0; }
.help p + p { margin-top: 10px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.danger-zone { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.danger-zone p { margin-bottom: 12px; }
footer.foot { margin-top: 32px; font-size: 12px; color: var(--muted); }

/* ───────────── Status-Punkte ───────────── */
.pill, .chip, .status-pill, .rating { display: inline-flex; align-items: center; gap: 7px; }
.pill .dot, .chip .dot, .status-pill .dot, .rating .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
[data-s="good"] > .dot { background: var(--good); }
[data-s="warning"] > .dot { background: var(--warning); }
[data-s="serious"] > .dot { background: var(--serious); }
[data-s="critical"] > .dot { background: var(--critical); }
.pill { font-size: 14px; font-weight: 600; }
.status-pill { padding: 6px 12px 6px 10px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:not(:empty) { margin-top: 16px; }
.chip { font-size: 15px; padding: 6px 12px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text-2); }
.rating { font-size: 13px; font-weight: 600; }

/* ───────────── Geräteliste ───────────── */
.device-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.device-list > .card + .card { margin-top: 0; }
.device-list > .empty { grid-column: 1 / -1; }
.card.device { display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.card.device:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.device-name { font-size: 19px; font-weight: 650; overflow-wrap: anywhere; }
.device-meta { font-size: 14px; color: var(--text-2); }

/* ───────────── Geräteseite ───────────── */
.device-head { margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; font-size: 14px; font-weight: 600; text-decoration: none; }
.device-title { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.device-title h1 { overflow-wrap: anywhere; }
.device-status { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; }
.tabs { display: flex; gap: 2px; margin: 0 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.more-end { mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.tabs.more-start { mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.tabs.more-start.more-end { mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.tabs a {
  flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; margin-bottom: -1px; min-height: 44px;
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface); border-bottom-color: var(--accent); }
.tabs a:focus-visible { outline-offset: -2px; border-radius: 6px; }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.section-head h2 { font-size: 22px; margin-right: auto; }

/* ───────────── Übersicht: „Gerade jetzt“ ───────────── */
.hero { padding: clamp(20px, 3vw, 36px); }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.hero .headline { font-size: clamp(26px, 2.8vw, 40px); line-height: 1.08; font-weight: 700; margin: 0 0 12px; }
.hero .story { font-size: 18px; line-height: 1.5; color: var(--text-2); max-width: 60ch; }
.hero .story strong { color: var(--text); font-weight: 650; }
.hero .stamp { margin-top: 14px; font-size: 13px; }
/* Nach Zustand einfärben (aus der Ferne lesbar): Abtauen blau, Heizen kupfer, Warmwasser messing */
.hero[data-mode] { border-color: transparent; color: #fff; }
.hero[data-mode="heizen"] { background: var(--mode-heizen); }
.hero[data-mode="warmwasser"] { background: var(--mode-ww); }
.hero[data-mode="abtauen"] { background: var(--mode-abtauen); }
.hero[data-mode] .headline, .hero[data-mode] .story, .hero[data-mode] .story strong, .hero[data-mode] .eyebrow, .hero[data-mode] .stamp { color: #fff; }
.hero[data-mode] .chip { background: rgba(255,255,255,.18); color: #fff; }

/* ───────────── Kacheln ───────────── */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.cyc-card, .ops-card { margin-top: 16px; }
.tiles.few { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
@media (max-width: 650px) { .tiles, .tiles.few { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px clamp(10px, 1.4vw, 19px); min-width: 0; }
.tile .t-label { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-2); font-weight: 550; }
.tile .t-label .k { flex: none; width: 12px; height: 3px; border-radius: 2px; }
.tile .t-value { font-size: clamp(26px, 3.2vw, 38px); font-weight: 650; line-height: 1.1; }
.tile .t-value small { font-size: 16px; font-weight: 600; color: var(--text-2); margin-left: 3px; }
.tile .t-value.t-text { font-size: clamp(22px, 2.4vw, 30px); overflow-wrap: anywhere; }
.tile .t-sub { font-size: 14px; color: var(--text-2); margin-top: auto; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 6px 0 2px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--c-ww); }
.gauge { width: 100%; max-width: 106px; display: block; margin: 0 auto -4px; }
.gauge-val { font-size: 22px; font-weight: 700; fill: var(--text); }
.gauge-val-sm { font-size: 15px; }     /* Laufzeit liegt ganz innerhalb des Bogens */
.gauges { display: flex; gap: 6px; justify-content: center; }
.gauge-box { flex: 1 1 0; min-width: 0; max-width: 106px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gauge-label { font-size: 13px; font-weight: 650; color: var(--text-2); }

/* ───────────── Verlauf ───────────── */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 6px; min-height: 36px; }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.series-picker { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 12px; padding: 10px 16px 12px;
  display: flex; flex-wrap: wrap; gap: 6px 28px; }
.series-picker legend { font-weight: 650; font-size: 14px; padding: 0 4px; }
.series-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.group-title { font-size: 13px; color: var(--muted); font-weight: 600; width: 100%; }
.series-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; min-height: 36px; cursor: pointer; }
.series-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.lk { width: 14px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
.charts > .card + .card { margin-top: 16px; }
.charts.loading { opacity: .55; transition: opacity .2s; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis-text { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .end-label { font-size: 12px; fill: var(--text-2); font-weight: 600; }
.chart svg line, .chart svg text, .chart svg path, .chart svg circle { pointer-events: none; }
.chart .overlay { fill: transparent; cursor: crosshair; }
.chart .overlay:focus-visible { outline: 2px solid var(--accent); }
.chart-empty { color: var(--muted); margin: 0; padding: 26px 8px; text-align: center; }
.tooltip { position: absolute; pointer-events: none; z-index: var(--z-tooltip); min-width: 150px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); padding: 8px 10px; font-size: 13px; display: none; }
.tooltip .tt-time { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row .lk { width: 12px; }
.tooltip .tt-row span { color: var(--text-2); }
.tooltip .tt-group { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 2px; }
.tooltip .tt-time + .tt-group { margin-top: 0; }
.chart .brush { fill: var(--accent); fill-opacity: .15; stroke: var(--accent); stroke-width: 1; pointer-events: none; }
.seg button:disabled { opacity: .4; cursor: default; }
.seg button:disabled:hover { background: transparent; }

/* ───────────── Tabellen ───────────── */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data th { font-size: 13px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
table.data td.detail { color: var(--text-2); overflow-wrap: anywhere; min-width: 12ch; }

/* ───────────── Dialog ───────────── */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 22px; width: min(460px, 92vw); max-height: 92dvh; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin-bottom: 10px; }
dialog p { color: var(--text-2); }
.dlg-extra:not(:empty) { margin-top: 14px; }

/* ───────────── Analyse und Prognose (nach hpDashboard) ───────────── */
.an-card > h3 { margin: 22px 0 10px; }
.an-stand { margin-bottom: 12px; }
.an-stand + .msg { margin-bottom: 16px; }
.an-hint { color: var(--text-2); background: var(--surface-2); border-radius: var(--r-ctl); padding: 12px 14px; font-size: 14px; }
.an-tip { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--text-2); }
.an-tip strong { color: var(--text); }
.verdict { font-size: 15px; color: var(--text-2); margin-bottom: 8px; }
.verdict .rating { font-size: 15px; color: var(--text); }
.sc-hero { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 10px; flex-wrap: wrap; }
.sc-num { font-size: 56px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sc-of { font-size: 16px; font-weight: 600; color: var(--text-2); }
.sc-cov { margin-left: auto; }
.sc-list { margin-top: 6px; }
.sc-row { display: grid; grid-template-columns: 190px 1fr 44px; gap: 3px 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--grid); }
.sc-row:first-child { border-top: 0; }
.sc-name { font-size: 14px; font-weight: 600; }
.sc-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sc-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.sc-bar[data-s="good"] > i { background: var(--good); }
.sc-bar[data-s="warning"] > i { background: var(--warning); }
.sc-bar[data-s="serious"] > i { background: var(--serious); }
.sc-score { text-align: right; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-meta { font-size: 12px; color: var(--muted); }
.sc-val { grid-column: 2 / -1; font-size: 13px; color: var(--text-2); }
.sc-row.na .sc-name, .sc-row.na .sc-score { color: var(--muted); }
.sc-row.acc-p { grid-template-columns: 190px 1fr 64px; }
.fc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.fc-wide { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--border); }
.fc-panel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.fc-top .k, .phase-chip .k { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.fc-main { font-size: 26px; font-weight: 700; line-height: 1.15; }
.fc-when, .fc-note { font-size: 14px; color: var(--text-2); }
.fc-meta { font-size: 13px; color: var(--muted); display: flex; gap: 4px 12px; flex-wrap: wrap; }
.fc-hy { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.fc-more > summary { cursor: pointer; font-size: 13px; color: var(--text-2); padding: 6px 0; width: fit-content; min-height: 32px; }
.fc-more > summary:hover { color: var(--text); }
.fc-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.fc-more > .fc-note, .fc-more > .fc-meta { margin-top: 6px; }
.conf { display: inline-flex; gap: 3px; align-items: center; margin-left: 6px; vertical-align: middle; }
.conf i { width: 7px; height: 7px; border-radius: 50%; background: var(--grid); display: inline-block; }
.conf i.on { background: var(--text-2); }
.fc-prog { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin: 6px 0 2px; }
.fc-prog > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.fc-prog-l { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phase-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-ctl); background: var(--surface-2); font-size: 14px; margin-bottom: 14px; }
.fc-events { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.fc-events li { display: flex; align-items: center; gap: 8px; }
.lk.dashed { background: none; border-top: 2px dashed var(--text-2); height: 0; }
.rk { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.chart .fc-label { font-size: 12px; fill: var(--muted); font-weight: 600; }
.chart .empty { font-size: 14px; fill: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.an-card .stats { margin: 12px 0; }
.an-card .split { margin-bottom: 8px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats + .chart, .an-card .chart { margin-top: 12px; }
.rk.ring { border-radius: 50%; background: none; border: 2px solid var(--serious); box-sizing: border-box; }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.an-table th, .an-table td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
.an-table th:first-child, .an-table thead th { text-align: left; font-weight: 600; color: var(--text-2); }
.stat .s-label { font-size: 13px; color: var(--text-2); }
.stat .s-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat .s-note { font-size: 12px; color: var(--muted); }
.split { display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 10px 0 8px; }
.split > div { overflow: hidden; display: flex; align-items: center; padding: 0 10px; color: #fff; font-size: 13px; font-weight: 650; white-space: nowrap; min-width: 0; text-shadow: 0 0 3px rgb(0 0 0 / .45); }
.split-legend { list-style: none; padding: 0; margin: 0; }
.split-legend li { display: inline-flex; align-items: center; gap: 6px; }
.grid.two.flat > div { min-width: 0; }
.grid.two.flat h3 { margin-bottom: 6px; }
@media (max-width: 800px) {
  .fc-grid { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sc-row, .sc-row.acc-p { grid-template-columns: 1fr 64px; }
  .sc-bar { grid-column: 1 / -1; grid-row: 2; }
  .sc-meta, .sc-val { grid-column: 1 / -1; }
  .sc-row.acc-p .sc-meta { grid-row: 2; }
  .sc-num { font-size: 46px; }
  .fc-main { font-size: 22px; }
}

/* ───────────── Schmale Bildschirme ───────────── */
@media (max-width: 760px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding-top: 12px; }
  header.top { gap: 8px; margin-bottom: 14px; }
  .account-nav { order: 3; width: 100%; gap: 2px; }
  .navlink { padding: 8px 8px; font-size: 13px; }
  .card { padding: 16px 14px; }
  .tile { padding: 12px 12px; }
  .tabs a { padding: 7px 10px; font-size: 13px; }
  .hero .story { font-size: 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { text-align: left; margin-bottom: 8px; }
  .section-head h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .charts.loading { transition: none; }
}

/* Verdichter-Karte und Seite „Allgemeine Einstellungen“ */
.card-head.sub-head { margin: 18px 0 8px; }
.zoom-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.chart .lane-label { font-size: 12px; fill: var(--muted); font-weight: 600; }
.chart .bar-label { font-size: 11px; fill: var(--text-2); }
.cyc-card .chart { margin-top: 8px; }
.status-slot { display: inline-flex; align-items: center; }

/* ───────────── Anlagenbild „Wärmefluss“ (nach hpDashboard) ───────────── */
.schematic { margin-top: 16px; }
.schematic .card-head { margin-bottom: 4px; }
.diagram { overflow-x: auto; margin-top: 6px; overscroll-behavior: contain; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram svg text { font-variant-numeric: tabular-nums; font-family: inherit; fill: var(--text); }
.diagram .lbl { font-size: 13px; fill: var(--text-2); }
.diagram .val { font-size: 18px; font-weight: 650; }
.diagram .tank-value { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.diagram .shape { fill: var(--surface-2); stroke: var(--axis); stroke-width: 1.5; }
.diagram-v { display: none; }        /* nur auf dem Handy: Anlagenbild im Hochformat */
@media (max-width: 650px) {
  .diagram-h { display: none; }
  .diagram-v { display: block; overflow-x: visible; max-width: 380px; margin-inline: auto; }
}
.pipe-base { fill: none; stroke: var(--grid); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.pipe { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 12; opacity: .28; }
.pipe.active { opacity: 1; animation: flow var(--flow-dur, 1.4s) linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.fan { transform-box: fill-box; transform-origin: center; }
.fan.spin { animation: spin var(--fan-dur, 1.2s) linear infinite; }
.fan.spin.reverse { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.schematic[data-current="false"] .pipe.active, .schematic[data-current="false"] .fan.spin { animation: none; }   /* alte Werte: nichts bewegen */
@media (prefers-reduced-motion: reduce) { .pipe.active, .fan.spin { animation: none; } }

/* ───────────── Telegram (Konto und Gerät) ───────────── */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.row:last-of-type { border-bottom: 0; }

/* ───────────── Schaltabstand (nach hpDashboard) ───────────── */
.sw-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
/* gleiche Höhe, Skala unten bündig; kein .card + .card-Abstand */
.sw-row > .sw { margin-top: 0; }
.sw-text { flex: 1 1 auto; }
.sw-row[hidden], .sw[hidden] { display: none; }
.sw.running { border-color: var(--sw-c); box-shadow: 0 0 0 1px var(--sw-c); }
@media (max-width: 760px) { .sw-row { grid-template-columns: 1fr; } }
.sw { display: flex; flex-direction: column; gap: 2px; }
.sw-top { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-2); font-weight: 550; }
.sw-top .k { width: 12px; height: 3px; border-radius: 2px; }
.sw-big { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: clamp(26px, 3vw, 36px); font-weight: 750; line-height: 1.15; }
.sw-big .k { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--sw-s); }
.sw-text { font-size: 14px; color: var(--text-2); }
.sw-stops { font-size: 13px; color: var(--text-2); }
.sw-stops[hidden] { display: none; }
.sw-big, .sw-ptr { --sw-s: var(--muted); }
.sw-big[data-s="good"], .sw-ptr[data-s="good"] { --sw-s: var(--good); }
.sw-big[data-s="warning"], .sw-ptr[data-s="warning"] { --sw-s: var(--warning); }
.sw-big[data-s="serious"], .sw-ptr[data-s="serious"] { --sw-s: var(--serious); }
.sw-big[data-s="run"], .sw-ptr[data-s="run"] { --sw-s: var(--sw-c); }
.sw-track { position: relative; height: 12px; margin-top: 42px; border-radius: 6px; background: var(--surface-2); }
.sw-zone { position: absolute; top: 0; bottom: 0; display: block; }
.sw-zone[hidden] { display: none; }
.sw-zone.start { left: 0; border-radius: 6px 0 0 6px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--serious) 55%, transparent) 0 4px, transparent 4px 8px); }
.sw-zone.band { background: var(--sw-c); opacity: .3; }
.sw-tick { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text-2); display: block; }
.sw-tick.start { background: var(--serious); }
.sw-labels { position: relative; height: 18px; margin-top: 7px; font-size: 13px; color: var(--text-2); }
.sw-lbl { position: absolute; top: 0; white-space: nowrap; }
.sw-lbl.start { color: var(--text); font-weight: 600; }
.sw-ptr { position: absolute; top: 50%; left: 0; }
.sw-ptr::after { content: ""; position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%;
  background: var(--surface); border: 5px solid var(--sw-s); }
.sw-ptr span { position: absolute; bottom: 14px; left: 0; transform: translateX(-50%); white-space: nowrap; padding: 2px 9px; border-radius: var(--r-ctl);
  background: var(--surface); border: 2px solid var(--sw-s); color: var(--text); font-size: 13px; font-weight: 700; }

@media (min-width: 651px) { .kv-2 { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px 14px; } .kv-2 dd { margin-right: 14px; } }
.hm-scale { display: inline-block; width: 90px; height: 10px; border-radius: 5px; margin: 0 6px; vertical-align: middle; }
