/* Sunnyware.Widgets — Raster und Widgets der Dashboards (Dashboards.md §3, §13). Reines CSS: zum Anzeigen braucht es weder
   JavaScript noch eine Bibliothek. Ausgeliefert als Static Web Asset: _content/Sunnyware.Widgets.Razor/widgets.css.

   Farben: nur eigene Variablen (--w-…), jede mit Rückfall auf die Tokens aus _Branding/tokens.css und dahinter auf deren Wert — so
   tragen der dunkle netLogger-Look, eine helle Fassung für Druck und Mail und der SunnyLogger dieselben Widgets ohne Codeänderung.
   Klassen mit Vorsilbe (w-, g-, b-, k-, bk-, vl-): der Gastgeber hat eigene Namen (der SunnyLogger etwa .kurve-legende, .legende, .tile).

   Schrift: Titel und Zahlen in der Anzeigeschrift des Gastgebers (--font-display aus _Branding/tokens.css, dahinter ihr Wert), alles
   andere erbt seine Textschrift. Die Dateien bringt der Gastgeber mit — hier wird nichts geladen. Nur Schnitte, die als Datei vorliegen
   (_Branding/README.md, „Schrift"): 500, 600, 700. */

/* Die Variablen gelten im Dashboard und in jedem Baustein außerhalb (.w-baustein, A06: Zeitraumleiste, Wasserfall, Kennzahl-Kachel). */
.w-dashboard, .w-baustein {
    --w-grund: var(--bg, #0f172a);
    --w-panel: var(--panel, #1e293b);
    --w-kante: var(--panel-edge, #334155);
    --w-text: var(--text, #e2e8f0);
    --w-text-dim: var(--text-dim, #94a3b8);
    --w-akzent: var(--accent, #f59e0b);
    --w-ok: var(--ok, #10b981);
    --w-achtung: var(--achtung, #eab308);
    --w-warn: var(--warn, #ef4444);
    /* Fachfarben (§4.5, §13.9) — geprüft gegen Farbfehlsichtigkeit, Quelle _Branding/tokens.css */
    --w-erzeugung: var(--f-erzeugung, #facc15);
    --w-verbrauch: var(--f-verbrauch, #38bdf8);
    --w-bezug: var(--f-bezug, #e11d48);
    --w-einspeisung: var(--f-einspeisung, #34d399);
    --w-laden: var(--f-laden, #ea580c);
    --w-entladen: var(--f-entladen, #fb923c);
    --w-soc: var(--f-soc, #8b5cf6);
    /* Die Verbraucherfarben (A07): die drei größten Verbraucher behalten ihre Farbe, der Rest ist grau. */
    --w-v1: var(--f-v1, #3987e5);
    --w-v2: var(--f-v2, #d55181);
    --w-v3: var(--f-v3, #65a30d);
    --w-v-rest: var(--f-v-rest, #94a3b8);
    /* Die Reihenpalette (W35): für Reihen einer Kurve, deren Fachfarbe schon eine andere trägt. */
    --w-reihe-1: var(--f-reihe-1, #3987e5);
    --w-reihe-2: var(--f-reihe-2, #d95926);
    --w-reihe-3: var(--f-reihe-3, #199e70);
    --w-reihe-4: var(--f-reihe-4, #c98500);
    --w-reihe-5: var(--f-reihe-5, #d55181);
    --w-reihe-6: var(--f-reihe-6, #008300);
    --w-reihe-7: var(--f-reihe-7, #9085e9);
    --w-reihe-8: var(--f-reihe-8, #e66767);
    --w-schrift-display: var(--font-display, "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif);
    --w-auf-akzent: var(--auf-akzent, #1c1400);

    color: var(--w-text);
}

.w-dashboard {
    container: w-dashboard / inline-size;
    --spalten: 12;
    --zeile: 76px;
    --luecke: 12px;
}

/* Die Zeilenhöhe steht fest, je Dashboard als Dichte wählbar (entschieden mit W12a): die Breite atmet, die Schrift bleibt lesbar. */
.w-dichte-kompakt { --zeile: 64px; }
.w-dichte-normal { --zeile: 76px; }
.w-dichte-gross { --zeile: 96px; }

/* ---- Bereiche: <details> klappt ohne JavaScript zu --------------------------------------------------------------------------- */

.w-bereich { margin: 0 0 18px; }
.w-bereich > summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--w-schrift-display);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--w-text-dim);
    padding: 4px 0 8px;
    user-select: none;
}
.w-bereich > summary::-webkit-details-marker { display: none; }
.w-bereich > summary::before { content: "▾ "; }
.w-bereich:not([open]) > summary::before { content: "▸ "; }

/* ---- Das Raster: 12 Spalten, feste Zeilen, Platz als Custom Properties -------------------------------------------------------- */

.w-raster {
    display: grid;
    grid-template-columns: repeat(var(--spalten), minmax(0, 1fr));
    /* Jede Zeile ist mindestens --zeile hoch. Höher wird sie nur unter einem Widget, dessen Höhe dem Inhalt folgt (w-waechst, DA06): alle
       anderen sind Größen-Container — ihr Inhalt zählt für die Zeile nicht, sie bleiben genau so hoch wie eingestellt. */
    grid-auto-rows: minmax(var(--zeile), auto);
    gap: var(--luecke);
}
.w-widget {
    grid-column: var(--x) / span var(--b);
    grid-row: var(--y) / span var(--h);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--w-panel);
    border: 1px solid var(--w-kante);
    border-radius: 10px;
    padding: 8px 10px 10px;
}
/* Ein offener Tooltip liegt über den Nachbarn. */
.w-widget:has(.k-slot:hover), .w-widget:has(.k-slot:focus) { z-index: 20; }
.w-kopf { display: flex; align-items: center; gap: 2px 10px; min-height: 20px; margin-bottom: 4px; }
.w-titel {
    margin: 0;
    font-family: var(--w-schrift-display);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--w-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Die Inhaltsfläche ist ein Größen-Container: das Widget fragt seine EIGENE Größe ab (§3.3 Ebene 2). */
.w-inhalt { flex: 1 1 auto; min-height: 0; container-type: size; position: relative; }
/* Die Höhe folgt dem Inhalt (WidgetTyp.HoeheNachInhalt): nur die Breite ist abfragbar, die Höhe gibt der Inhalt vor — H ist die Mindesthöhe. */
.w-waechst > .w-inhalt { container-type: inline-size; }

/* Unter 720 px Dashboardbreite fließen die Widgets in Lesereihenfolge durch zwei Spalten — Breite nach der Handy-Regel, Höhe bleibt. */
@container w-dashboard (width < 720px) {
    .w-raster { --spalten: 2; grid-auto-flow: row dense; }
    .w-widget { grid-column: auto / span var(--b-handy); grid-row: auto / span var(--h); }
    .w-handy-aus { display: none; }
}

/* Rückfall für Geräte ohne Container Queries (iOS 15, iPhone 7 und älter, §7.4): das Handy-Raster nach der Fensterbreite, die Widgets
   in ihrer Grundfassung (Dreiviertelkreis, stehende Batterie). */
@supports not (container-type: inline-size) {
    @media (max-width: 760px) {
        .w-raster { --spalten: 2; grid-auto-flow: row dense; }
        .w-widget { grid-column: auto / span var(--b-handy); grid-row: auto / span var(--h); }
        .w-handy-aus { display: none; }
    }
}

/* ---- Gemeinsames ------------------------------------------------------------------------------------------------------------ */

.w-punkt { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.w-punkt.strich { width: 14px; height: 3px; border-radius: 2px; }
.w-zusatz { display: flex; gap: 14px; margin: 0; font-size: 0.78rem; }
.w-zusatz div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.w-zusatz dt { color: var(--w-text-dim); font-size: 0.7rem; white-space: nowrap; }
.w-zusatz dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-hinweis { font-size: 0.72rem; color: var(--w-text-dim); text-align: center; }
.w-warnung { color: var(--w-achtung); }
.w-nicht-lesbar {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--w-text-dim);
    border: 1px dashed var(--w-kante);
    border-radius: 8px;
    padding: 6px;
    overflow: hidden;
}
.w-nicht-lesbar b { color: var(--w-achtung); font-weight: 600; }
.w-nicht-lesbar .w-titel { max-width: 100%; }
.w-nicht-lesbar .w-titel:empty { display: none; }

/* ---- Gauge (Stil festgelegt, §13.1) ----------------------------------------------------------------------------------------- */

.w-gauge { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 4px; }
.w-gauge-bild { width: 100%; height: 100%; min-height: 0; display: block; }
.g-spur { fill: none; stroke: var(--w-kante); stroke-linecap: round; }
.g-band { fill: none; stroke-width: 3; }
.g-wert { fill: none; stroke-linecap: round; }
.g-strich { stroke: var(--w-text-dim); stroke-width: 1; opacity: 0.7; }
.g-strich.g-null { stroke: var(--w-text); stroke-width: 1.6; opacity: 1; }
/* Teilstriche (19.11.2026): zwischen je zwei Hauptstrichen, außen wie sie, kürzer und leiser — innen gibt es keine Striche. */
.g-teilstrich { stroke: var(--w-text-dim); stroke-width: 1; opacity: 0.5; }
.g-skala { fill: var(--w-text-dim); font-family: var(--w-schrift-display); font-size: 10px; }
.g-spitze { stroke: var(--w-text); stroke-width: 2.2; }
.g-zahl { fill: var(--w-text); font-family: var(--w-schrift-display); font-size: 31px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-einheit { fill: var(--w-text-dim); font-family: var(--w-schrift-display); font-size: 12px; font-weight: 500; }
.w-gauge-info { display: flex; flex-direction: column; gap: 3px; align-items: center; min-width: 0; }
.g-richtung { font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.w-veraltet .g-wert, .w-veraltet .g-zahl { opacity: 0.45; }
/* Beide Fassungen stehen in der Antwort; sichtbar ist nach dem Seitenverhältnis der Fläche eine. */
.g-halb:not(.g-fest) { display: none; }
@container (aspect-ratio > 1.7) {
    .g-rund:not(.g-fest) { display: none; }
    .g-halb:not(.g-fest) { display: block; }
    .w-gauge { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .w-gauge-info { align-items: flex-start; }
    .w-gauge .w-zusatz { flex-direction: column; gap: 6px; }
    .w-gauge .w-zusatz div { align-items: flex-start; }
    .w-gauge .w-hinweis { text-align: left; }
}
@container (height < 130px) and (aspect-ratio <= 1.7) { .w-gauge .w-zusatz { display: none; } }
@container (width < 150px) { .g-skala { display: none; } .w-gauge .w-zusatz { display: none; } }

/* ---- Batterie (§13.2) ------------------------------------------------------------------------------------------------------- */

.w-batt { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 5px; }
.w-batt-bild { width: 100%; height: 100%; min-height: 0; display: block; }
.w-batt.b-auto .batt-liegend { display: none; }
.b-koerper { fill: none; stroke: var(--w-text-dim); stroke-width: 3; }
.b-pol { fill: var(--w-text-dim); }
.b-fuell { fill: var(--w-ok); opacity: 0.9; }
.b-fuell.b-niedrig { fill: var(--w-warn); }
.b-zahl { fill: var(--w-text); font-family: var(--w-schrift-display); font-size: 24px; font-weight: 600; paint-order: stroke; stroke: #0f172acc; stroke-width: 3px; }
.b-blitz { fill: #fff7ed; stroke: #0f172a; stroke-width: 2.2; stroke-linejoin: round; paint-order: stroke; }
.b-fluss {
    fill: none;
    stroke: var(--w-text-dim);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.25;
    animation: w-lauf 0.9s linear infinite;
}
.modus-laden .b-fluss { stroke: var(--w-laden); }
.modus-entladen .b-fluss { stroke: var(--w-entladen); }
@keyframes w-lauf { 0%, 100% { opacity: 0.25; } 30% { opacity: 1; } 60% { opacity: 0.25; } }
/* Wer „Bewegung reduzieren" gewählt hat, sieht die Pfeile ruhig — die Richtung steckt schon in ihrer Form. */
@media (prefers-reduced-motion: reduce) { .b-fluss { animation: none; opacity: 0.9; } }
.w-batt-info { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.b-modus {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.b-modus.laden { background: var(--w-laden); color: #0f172a; }
.b-modus.entladen { background: var(--w-entladen); color: #0f172a; }
.b-modus.ruhe, .b-modus.unbekannt { background: var(--w-kante); color: var(--w-text-dim); }
.w-veraltet .b-fuell, .w-veraltet .b-zahl { opacity: 0.45; }
@container (aspect-ratio > 1.2) {
    .w-batt.b-auto .batt-stehend { display: none; }
    .w-batt.b-auto .batt-liegend { display: block; }
}
@container (aspect-ratio > 1.6) {
    .w-batt { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .w-batt-info { align-items: flex-start; }
    .w-batt .w-zusatz { flex-direction: column; gap: 6px; }
    .w-batt .w-zusatz div { align-items: flex-start; }
}
@container (height < 150px) and (aspect-ratio <= 1.6) { .w-batt .w-zusatz { display: none; } }
@container (width < 130px) { .w-batt .w-zusatz { display: none; } }

/* ---- Kachel (§13.3) --------------------------------------------------------------------------------------------------------- */

.w-kachel {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    position: relative;
    border-left: 3px solid var(--streifen, var(--w-kante));
    padding-left: 10px;
    min-width: 0;
}
.w-kachel.mit-balken { border-left: 0; padding-left: 20px; }
.w-kachel.mit-balken::before, .w-kachel.mit-balken::after { content: ""; position: absolute; left: 0; width: 9px; border-radius: 5px; }
.w-kachel.mit-balken::before { top: 2px; bottom: 2px; background: var(--w-kante); }
.w-kachel.mit-balken::after { bottom: 2px; height: calc((100% - 4px) * var(--anteil)); background: var(--streifen); }
/* Die Teile der Kachel gelten nur IN der Kachel: ein Gastgeber, der dieselben Wörter nutzt (die Übersicht der WebApp übernimmt
   .kachel-wert von der SunnyLogger-Box), bekäme sonst ihre Größe — so geschehen in W26 (12.10.2026: die Tageswerte unter den Tachos
   bis 2,6 rem statt 1,05 rem). Jede Regel hier hängt an einer Klasse der Bibliothek (WidgetsCssTests). */
.w-kachel .kachel-titel {
    font-family: var(--w-schrift-display);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--w-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.w-kachel .kachel-wert {
    /* Die Größe folgt der Höhe der Fläche — und ihrer Breite, geteilt durch die Zeichen des Werts (--zeichen, vom Server gezählt:
       die Zahl ganz, die Einheit halb): eine lange Zahl in einer schmalen Kachel wird kleiner, statt über den Rand zu ragen. Ohne
       Container-Einheiten (iOS 15) bleibt die erste Zeile. */
    font-size: 1.5rem;
    font-size: clamp(0.75rem, min(40cqh, calc((100cqw - 22px) / (var(--zeichen, 6) * 0.6))), 2.6rem);
    font-family: var(--w-schrift-display);
    font-weight: 600;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.w-kachel .kachel-einheit { font-size: max(0.5em, 0.6rem); font-weight: 500; color: var(--w-text-dim); margin-left: 0.25em; }
.w-kachel .kachel-unter { font-size: 0.75rem; color: var(--w-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-kachel .kachel-unter.w-warnung { color: var(--w-achtung); }
.w-kachel.w-veraltet .kachel-wert { opacity: 0.45; }
@container (height < 44px) { .w-kachel .kachel-unter { display: none; } }

/* ---- Kurve (§13.4): verzerrbare Zeichenfläche, Beschriftung als HTML, Tooltip ohne JavaScript ---------------------------------- */

.w-kurve {
    height: 100%;
    display: grid;
    grid-template-columns: 2.6em minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto 1.3em auto;
    font-size: 0.72rem;
    color: var(--w-text-dim);
}
/* Eine Achse je Einheit (W35): jede weitere steht rechts daneben, so breit wie ihre Beschriftung — eine ausgeblendete nimmt keinen Platz. */
.w-kurve.mehrachsig { grid-template-columns: 2.6em minmax(0, 1fr) repeat(var(--rechts), auto); }
/* Jeder Teil hat seinen festen Platz: Kopf, Einheiten, Zeichenfläche mit ihren Achsen, Leisten, Zeitachse, Fußzeile. Die Achsen rechts
   setzen ihre Spalte selbst (grid-column im HTML). */
/* Die Kopfzeile trägt die Kurve selbst: links der Titel (wie im Rahmen), rechts die Legende — reicht die Breite nicht, bricht sie um. */
.k-kopf { grid-row: 1; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 20px; margin-bottom: 4px; }
.k-kopf .w-titel { flex: 1 1 auto; min-width: min(11em, 100%); }
.k-einheit { grid-row: 2; grid-column: 1; font-size: 0.68rem; line-height: 1; padding: 0 6px 4px 0; text-align: right; align-self: end; }
.k-einheit.rechts { text-align: left; padding: 0 0 4px 6px; min-width: 2.6em; }
.k-legende {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 2px 10px;
    margin-left: auto;
    font-size: 0.72rem;
}
.k-leg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; position: relative; cursor: pointer; user-select: none; }
/* Die Legende ist ein Schalter je Reihe (W35): das Kästchen bleibt unsichtbar, aber per Tastatur erreichbar; aus heißt blass und durchgestrichen. */
.k-schalter { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.k-leg:has(.k-schalter:not(:checked)) { opacity: 0.45; text-decoration: line-through; }
.k-leg:has(.k-schalter:focus-visible) { outline: 2px solid var(--w-akzent); outline-offset: 2px; border-radius: 3px; }
.w-punkt.leiste { width: 12px; height: 7px; border-radius: 2px; }
.k-y, .k-x { position: relative; }
.k-y { grid-row: 3; grid-column: 1; }
.k-y.rechts { min-width: 2.6em; }
.k-y span { position: absolute; right: 6px; transform: translateY(-50%); font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-y.rechts span { right: auto; left: 6px; }
.k-x span { position: absolute; top: 3px; transform: translateX(-50%); }
/* 00 und 24 bündig in der Zeichenfläche — mittig ragten sie unter die Zahlen der Werteachsen. */
.k-x span:first-child { transform: none; }
.k-x span:last-child { transform: translateX(-100%); }
.k-plot { grid-row: 3; grid-column: 2; position: relative; min-height: 0; }
.k-x { grid-row: 5; grid-column: 2; }
.k-flaeche { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* Linienbreiten aus _Branding (Diagramme, 13.10.2026): Datenlinie 2 px, Hilfslinie 1 px — der Rückfall ist der Wert des Tokens. */
.k-gitter { stroke: var(--w-kante); stroke-width: var(--linie-hilfslinie, 1px); }
.k-null { stroke: var(--w-text-dim); stroke-width: var(--linie-hilfslinie, 1px); }
.k-jetzt { stroke: var(--w-akzent); stroke-width: var(--linie-hilfslinie, 1px); stroke-dasharray: 3 3; }
.k-zukunft { fill: #ffffff06; }
.k-linie { fill: none; stroke-width: var(--linie-diagramm, 1.5px); stroke-linejoin: round; stroke-linecap: round; }
.k-gestrichelt { stroke-dasharray: 7 5; }
/* Gepunktet (Darstellung.Punkte, D03 — Stephans Muster F, 24.10.2026): abgerundete Striche 2 / Lücke 5 in der Breite der gepunkteten Datenlinie. */
.k-punkte { stroke-dasharray: 2 5; stroke-width: var(--linie-diagramm-punkte, 2.5px); }
.k-flaechenpfad { opacity: 0.14; stroke: none; }
.k-balken { stroke: none; }   /* Mengen je Viertelstunde: voll gedeckt (Stephan, 03.11.2026) */
/* Eine aufgesetzte Reihe (D03, die Batterie auf dem Verbrauch): das Band darauf kräftiger als eine Fläche, was in die Reihe darunter hineinreicht
   schraffiert — so liest es sich als „dieser Teil kam aus der Batterie“. */
.k-band { opacity: 0.42; stroke: none; }
.k-band-innen { opacity: 0.8; stroke: none; }
.k-schraffur-grund { opacity: 0.25; }
.k-leer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    pointer-events: none;
}
.k-fuss { grid-row: 6; grid-column: 1 / -1; padding-top: 4px; font-size: 0.78rem; line-height: 1.35; }
@container (width < 460px) { .k-x span:nth-child(even) { display: none; } }

.k-hover { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.k-slot { position: relative; outline: none; }
.k-slot.aktiv { cursor: crosshair; }
.k-slot.aktiv:hover::before, .k-slot.aktiv:focus::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px solid var(--w-text);
    opacity: 0.55;
}
.k-pkt {
    display: none;
    position: absolute;
    left: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 0 2px var(--w-panel);
}
.k-slot:hover .k-pkt, .k-slot:focus .k-pkt { display: block; }
.k-tip {
    display: none;
    position: absolute;
    top: 2px;
    left: calc(50% + 12px);
    z-index: 30;
    pointer-events: none;
    grid-template-columns: 9px auto auto;
    gap: 3px 8px;
    align-items: center;
    white-space: nowrap;
    background: #0b1220f2;
    border: 1px solid var(--w-kante);
    border-radius: 7px;
    padding: 7px 10px;
    box-shadow: 0 6px 18px #0008;
    font-size: 0.76rem;
    color: var(--w-text);
}
/* Rechts der Mitte klappt der Tooltip nach links — sonst liefe er aus dem Widget. */
.k-slot.links .k-tip { left: auto; right: calc(50% + 12px); }
.k-slot:hover .k-tip, .k-slot:focus .k-tip { display: grid; }
.k-tip-kopf { grid-column: 1 / -1; font-weight: 600; margin-bottom: 2px; }
.k-tip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.k-tip b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
/* Eine Zeile des Tooltips je Reihe (ein <p> ohne eigene Box); ihre Farbe und die ihrer Punkte stehen einmal am Widget (--k-0 …, W35). */
.k-tip > p { display: contents; }

/* Leisten (W35): Statuskanäle unter der Zeichenfläche, auf derselben Zeitachse — der blasse Grund, wo ein Wert bekannt ist, darüber die
   Farbe der Reihe, solange er an war (eine angebrochene Viertelstunde blasser). Ihre Werte nennt der Tooltip der Kurve. */
.k-leisten { grid-row: 4; grid-column: 2; display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.k-leiste { position: relative; height: 14px; }
.k-leiste svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.k-leiste-grund { fill: var(--w-text-dim); opacity: 0.12; }
.k-leiste-name {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.66rem;
    line-height: 1;
    color: var(--w-text);
    text-shadow: 0 0 3px var(--w-panel), 0 0 2px var(--w-panel);
    white-space: nowrap;
    pointer-events: none;
}

/* Die Farbe einer Reihe (W35): steht als --k-{Stelle} am Widget, Punkte und Tooltipzeilen nehmen sie über data-reihe — unter der Null setzt
   die Kurve die Farbe der negativen Seite selbst (Einspeisung). */
.w-kurve [data-reihe="0"] { --c: var(--k-0); }
.w-kurve [data-reihe="1"] { --c: var(--k-1); }
.w-kurve [data-reihe="2"] { --c: var(--k-2); }
.w-kurve [data-reihe="3"] { --c: var(--k-3); }
.w-kurve [data-reihe="4"] { --c: var(--k-4); }
.w-kurve [data-reihe="5"] { --c: var(--k-5); }
.w-kurve [data-reihe="6"] { --c: var(--k-6); }
.w-kurve [data-reihe="7"] { --c: var(--k-7); }
.w-kurve [data-reihe="8"] { --c: var(--k-8); }
.w-kurve [data-reihe="9"] { --c: var(--k-9); }
.w-kurve [data-reihe="10"] { --c: var(--k-10); }
.w-kurve [data-reihe="11"] { --c: var(--k-11); }
.w-kurve [data-reihe="12"] { --c: var(--k-12); }
.w-kurve [data-reihe="13"] { --c: var(--k-13); }
.w-kurve [data-reihe="14"] { --c: var(--k-14); }
.w-kurve [data-reihe="15"] { --c: var(--k-15); }
.w-kurve [data-reihe="16"] { --c: var(--k-16); }
.w-kurve [data-reihe="17"] { --c: var(--k-17); }
.w-kurve [data-reihe="18"] { --c: var(--k-18); }
.w-kurve [data-reihe="19"] { --c: var(--k-19); }
.w-kurve [data-reihe="20"] { --c: var(--k-20); }
.w-kurve [data-reihe="21"] { --c: var(--k-21); }
.w-kurve [data-reihe="22"] { --c: var(--k-22); }
.w-kurve [data-reihe="23"] { --c: var(--k-23); }

/* Ausgeblendet (W35): Linie, Fläche, Punkte, Tooltipzeile und Leiste einer Reihe, deren Schalter aus ist — und eine Achse samt Einheit, sobald
   keine Reihe ihrer Einheit mehr an ist (die erste mit Gitter und Nulllinie). Je Stelle eine Regel: CSS kann zwei Attribute nicht vergleichen.
   Bis 24 Reihen (KurveEinstellungen.MaxReihen) und 8 Achsen — eine neunte Achse bliebe stehen, ihre Reihen nicht. */
.w-kurve:has(.k-schalter[data-r="0"]:not(:checked)) [data-reihe="0"],
.w-kurve:has(.k-schalter[data-r="1"]:not(:checked)) [data-reihe="1"],
.w-kurve:has(.k-schalter[data-r="2"]:not(:checked)) [data-reihe="2"],
.w-kurve:has(.k-schalter[data-r="3"]:not(:checked)) [data-reihe="3"],
.w-kurve:has(.k-schalter[data-r="4"]:not(:checked)) [data-reihe="4"],
.w-kurve:has(.k-schalter[data-r="5"]:not(:checked)) [data-reihe="5"],
.w-kurve:has(.k-schalter[data-r="6"]:not(:checked)) [data-reihe="6"],
.w-kurve:has(.k-schalter[data-r="7"]:not(:checked)) [data-reihe="7"],
.w-kurve:has(.k-schalter[data-r="8"]:not(:checked)) [data-reihe="8"],
.w-kurve:has(.k-schalter[data-r="9"]:not(:checked)) [data-reihe="9"],
.w-kurve:has(.k-schalter[data-r="10"]:not(:checked)) [data-reihe="10"],
.w-kurve:has(.k-schalter[data-r="11"]:not(:checked)) [data-reihe="11"],
.w-kurve:has(.k-schalter[data-r="12"]:not(:checked)) [data-reihe="12"],
.w-kurve:has(.k-schalter[data-r="13"]:not(:checked)) [data-reihe="13"],
.w-kurve:has(.k-schalter[data-r="14"]:not(:checked)) [data-reihe="14"],
.w-kurve:has(.k-schalter[data-r="15"]:not(:checked)) [data-reihe="15"],
.w-kurve:has(.k-schalter[data-r="16"]:not(:checked)) [data-reihe="16"],
.w-kurve:has(.k-schalter[data-r="17"]:not(:checked)) [data-reihe="17"],
.w-kurve:has(.k-schalter[data-r="18"]:not(:checked)) [data-reihe="18"],
.w-kurve:has(.k-schalter[data-r="19"]:not(:checked)) [data-reihe="19"],
.w-kurve:has(.k-schalter[data-r="20"]:not(:checked)) [data-reihe="20"],
.w-kurve:has(.k-schalter[data-r="21"]:not(:checked)) [data-reihe="21"],
.w-kurve:has(.k-schalter[data-r="22"]:not(:checked)) [data-reihe="22"],
.w-kurve:has(.k-schalter[data-r="23"]:not(:checked)) [data-reihe="23"] { display: none; }
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="0"]:checked)) [data-achse="0"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="1"]:checked)) [data-achse="1"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="2"]:checked)) [data-achse="2"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="3"]:checked)) [data-achse="3"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="4"]:checked)) [data-achse="4"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="5"]:checked)) [data-achse="5"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="6"]:checked)) [data-achse="6"],
.w-kurve:has(.k-schalter):not(:has(.k-schalter[data-a="7"]:checked)) [data-achse="7"] { display: none; }

/* ---- Balken (§13.5, W13a): Stapel in HTML, Beschriftung als HTML, Tooltip ohne JavaScript -------------------------------------
   Ein Stapel ist ein Block an der Null (--null der Spalten), seine Stücke teilen seine Höhe nach ihrem Anteil (flex-grow) — mit 2 px Luft
   dazwischen und rundem äußerem Ende, in echten Pixeln. Zukünftige Perioden stehen blass, die laufende abgesetzt. */

.w-balken {
    height: 100%;
    display: grid;
    grid-template-columns: 2.6em minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) 1.3em auto;
    font-size: 0.72rem;
    color: var(--w-text-dim);
}
.w-balken.zwei-achsen { grid-template-columns: 2.6em minmax(0, 1fr) 3em; }
/* Ohne Kopf (A06): Titel, Zeitraum, Pillen und Legende zeichnet der Gastgeber — es bleiben Einheit, Fläche, Zeitachse und Fußzeile. */
.w-balken.ohne-kopf { grid-template-rows: auto minmax(0, 1fr) 1.3em auto; }
/* Die Kopfzeile: links der Titel, dann ◀ Zeitraum ▶ und die Pillen — reicht die Breite nicht, brechen sie um. */
.bk-kopf { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 20px; margin-bottom: 2px; }
.bk-kopf .w-titel { flex: 1 1 auto; min-width: min(8em, 100%); }
.bk-zeit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-family: var(--w-schrift-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--w-text);
}
.bk-periode { font-variant-numeric: tabular-nums; }
.bk-pfeil {
    display: inline-grid;
    place-items: center;
    width: 1.6em;
    height: 1.6em;
    border: 1px solid var(--w-kante);
    border-radius: 6px;
    color: var(--w-text-dim);
    text-decoration: none;
    font-size: 0.66rem;
}
a.bk-pfeil:hover, a.bk-pfeil:focus-visible { color: var(--w-text); border-color: var(--w-text-dim); }
.bk-pfeil.aus { opacity: 0.35; cursor: default; }
.bk-pillen { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--w-kante); border-radius: 999px; }
.bk-pille { padding: 1px 9px; border-radius: 999px; color: var(--w-text-dim); text-decoration: none; white-space: nowrap; }
a.bk-pille:hover, a.bk-pille:focus-visible { color: var(--w-text); }
.bk-pille.aktiv { background: var(--w-kante); color: var(--w-text); font-weight: 600; }
.bk-legende { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-bottom: 4px; }
.bk-leg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bk-einheit { font-size: 0.68rem; line-height: 1; padding: 0 6px 4px 0; text-align: right; align-self: end; white-space: nowrap; }
.bk-einheit.rechts { text-align: left; padding: 0 0 4px 6px; }
.bk-y, .bk-x { position: relative; }
.bk-y span { position: absolute; right: 6px; transform: translateY(-50%); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-y.rechts span { right: auto; left: 6px; }
.bk-x span { position: absolute; top: 3px; transform: translateX(-50%); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-plot { position: relative; min-height: 0; }
.bk-gitter, .bk-null { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--w-kante); pointer-events: none; }
.bk-null { border-top-color: var(--w-text-dim); z-index: 1; }
.bk-spalten { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.bk-spalte { position: relative; outline: none; }
.bk-spalte[tabindex] { cursor: crosshair; }
.bk-spalte[tabindex]:hover, .bk-spalte[tabindex]:focus-within { background: #ffffff10; }
.bk-spalte.bk-zukunft { background: #ffffff06; }
.bk-stapel {
    position: absolute;
    left: 50%;
    width: clamp(1px, 70%, 30px);
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    overflow: hidden;
}
.bk-stapel.oben { bottom: calc(100% - var(--null)); flex-direction: column-reverse; border-radius: 3px 3px 0 0; }
.bk-stapel.unten { top: var(--null); flex-direction: column; border-radius: 0 0 3px 3px; }
.bk-stapel i { flex: 1 1 0; min-height: 0; }
/* Die laufende Periode ist noch nicht fertig — abgesetzt, damit ihr kurzer Balken nicht wie ein schwacher Tag aussieht. */
.bk-laufend .bk-stapel { opacity: 0.55; }
/* Ein Vergleich je Periode (25.10.2026, etwa das Vorjahr): zwei schmale Stapel nebeneinander — rechts der gezeigte, links gedimmt der Vergleich. */
.bk-paar > .bk-stapel { left: 50%; transform: none; width: clamp(1px, 34%, 14px); margin-left: 1px; }
.bk-paar > .bk-stapel.vgl { left: auto; right: 50%; margin-left: 0; margin-right: 1px; opacity: 0.32; }
.bk-leer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    pointer-events: none;
}
.bk-fuss { grid-column: 1 / -1; padding-top: 4px; font-size: 0.78rem; line-height: 1.35; }
.w-widget:has(.bk-spalte:hover), .w-widget:has(.bk-spalte:focus-within) { z-index: 20; }
.bk-tip {
    display: none;
    /* Zeilen bleiben ganz, ein Hinweissatz bricht um — ohne Höchstbreite wäre der Tooltip so breit wie sein längster Satz und liefe aus dem
       Bild (Anlage 1, 17.10.2026: „aus dem Netz“ ist negativ …). */
    max-width: min(24rem, calc(100vw - 32px));
    position: absolute;
    top: 2px;
    left: calc(50% + 8px);
    z-index: 30;
    pointer-events: none;
    grid-template-columns: 9px auto auto;
    gap: 3px 8px;
    align-items: center;
    white-space: nowrap;
    background: #0b1220f2;
    border: 1px solid var(--w-kante);
    border-radius: 7px;
    padding: 7px 10px;
    box-shadow: 0 6px 18px #0008;
    font-size: 0.76rem;
    color: var(--w-text);
}
.bk-spalte.bk-links .bk-tip { left: auto; right: calc(50% + 8px); }
.bk-spalte:hover .bk-tip, .bk-spalte:focus-within .bk-tip { display: grid; }
.bk-tip-kopf { grid-column: 1 / -1; font-weight: 600; margin-bottom: 2px; }
.bk-tip i { width: 9px; height: 9px; border-radius: 2px; }
.bk-tip b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bk-tip-fehlt { grid-column: 1 / -1; color: var(--w-text-dim); margin-top: 2px; white-space: normal; line-height: 1.35; }
/* Der Kopf einer Gruppe in einem Tooltip des Gastgebers (A06: „Verbrauch 12,0 kWh", darunter seine Teile). */
.bk-tip .bk-tip-gruppe { margin-top: 5px; font-weight: 600; color: var(--w-text); }
/* Die Haken für einen Gastgeber, der mehr weiß (A07): hinterlegte Perioden (die Wochenenden), der Extremwert am Ende des höchsten Stapels
   und Links an der Zeitachse — sie führen tiefer (vom Jahr in den Monat, vom Tag zur Tageskurve), seit W33 auch die ganze Säule. */
.bk-spalte.bk-hinterlegt { background: #ffffff09; }
.bk-spalte.bk-hinterlegt[tabindex]:hover, .bk-spalte.bk-hinterlegt[tabindex]:focus-within { background: #ffffff14; }
.bk-extrem {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, calc(-100% - 3px));
    padding: 0 3px;
    white-space: nowrap;
    pointer-events: none;
    font-family: var(--w-schrift-display);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--w-text);
}
.bk-extrem.unten { transform: translate(-50%, 3px); }
.bk-x a { position: absolute; top: 3px; transform: translateX(-50%); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--w-text-dim);
          text-decoration: none; padding: 0 2px; border-radius: 3px; }
.bk-x a:hover, .bk-x a:focus-visible { color: var(--w-text); background: var(--w-kante); }
/* Die Säule als Link (W33): ein leerer Link über der ganzen Spalte, nach dem Stapel und vor dem Tooltip — er führt dorthin, wohin die Marke an
   der Zeitachse führt, und ist der Tabstopp der Periode (Fokus zeigt den Tooltip wie Überfahren). Auf einem Gerät ohne Überfahren (Handy) öffnet
   das erste Antippen den Tooltip — die Spalte nimmt den Fokus, der Link lässt das Antippen bis dahin durch —, erst das zweite folgt dem Link.
   Der Tooltip steht dort nur am Fokus: am Überfahren allein zeigte iOS ihn und schluckte das Antippen, dann bräuchte es drei. */
.bk-ziel { position: absolute; inset: 0; cursor: pointer; border-radius: 3px; outline: none; }
.bk-ziel:focus-visible { outline: 1px solid var(--w-text-dim); outline-offset: -1px; }
@media (hover: none) {
    .bk-ziel { pointer-events: none; }
    .bk-spalte:focus-within > .bk-ziel { pointer-events: auto; }
    .bk-spalte:has(> .bk-ziel):not(:focus-within) .bk-tip { display: none; }
}
@container (width < 460px) {
    .bk-x span.bk-neben, .bk-x a.bk-neben { display: none; }
    .bk-pille { padding: 1px 6px; }
}

/* ---- Verlaufsübersicht (§13.8, W13a): je Zeile ein kleines Bild ohne Achsen, daneben die Summen ------------------------------- */

.w-verlauf { height: 100%; display: grid; grid-template-rows: repeat(var(--zeilen), minmax(0, 1fr)) auto; gap: 8px; }
.vl-zeile { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
.vl-bild { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.vl-kurve, .vl-balken {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    border-radius: 3px;
    background:
        repeating-linear-gradient(90deg, #ffffff06 0 1px, transparent 1px 12.5%),
        repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 25%);
}
.vl-balken { position: relative; overflow: hidden; }
.vl-flaeche { opacity: 0.35; stroke: none; }
.vl-mengen { stroke: none; }   /* Mengen je Viertelstunde als Balken, voll gedeckt */
.vl-linie { fill: none; stroke-width: var(--linie-diagramm, 1.5px); stroke-linejoin: round; stroke-linecap: round; }
.vl-null { stroke: var(--w-text-dim); stroke-width: var(--linie-hilfslinie, 1px); }
.vl-zukunft { fill: #ffffff08; }
.vl-name { font-size: 0.74rem; color: var(--w-text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-werte { display: flex; flex-direction: column; justify-content: center; gap: 6px; margin: 0; font-size: 0.78rem; min-width: 0; }
.vl-werte div { display: flex; flex-direction: column; min-width: 0; }
.vl-werte dt { order: 2; display: inline-flex; align-items: center; gap: 5px; color: var(--w-text-dim); white-space: nowrap; }
.vl-werte dd {
    order: 1;
    margin: 0;
    font-family: var(--w-schrift-display);
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--w-text);
}
.vl-werte i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.vl-fuss { font-size: 0.74rem; line-height: 1.35; }
@container (height < 200px) { .vl-name { display: none; } }

/* ---- Bausteine der Auswertung (A06): Zeitraumleiste, Wasserfall, Kennzahl-Kachel mit Mini-Verlauf ----------------------------------
   Keine Widget-Typen, sondern Teile einer Seite (der Energiebilanz) — gezeichnet aus denselben Variablen wie die Widgets (.w-baustein trägt
   sie). Was schmal wird, fragt die eigene Breite ab (Container Queries), nicht das Fenster. */

/* Die Zeitraumleiste klebt beim Scrollen oben: man weiß immer, welchen Zeitraum man liest. */
.zl {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 8px 14px;
    background: #0f172ae8;
    backdrop-filter: blur(6px);
    border: 1px solid var(--w-kante);
    border-radius: 12px;
    container-type: inline-size;
}
.zl-nav { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.zl-titel {
    min-width: 9.6rem;
    text-align: center;
    font-family: var(--w-schrift-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--w-text);
}
.zl-spanne { margin-left: 4px; color: var(--w-text-dim); font-size: 0.85rem; }
.zl-pfeil {
    display: inline-grid;
    place-items: center;
    min-width: 1.9em;
    height: 1.7em;
    border: 1px solid var(--w-kante);
    border-radius: 8px;
    color: var(--w-text-dim);
    text-decoration: none;
    font-size: 0.72rem;
}
a.zl-pfeil:hover, a.zl-pfeil:focus-visible { color: var(--w-text); border-color: var(--w-text-dim); }
.zl-pfeil.aus { opacity: 0.35; cursor: default; }
.zl-pillen { display: flex; gap: 6px; flex-wrap: wrap; }
.zl-pille {
    padding: 3px 13px;
    border: 1px solid var(--w-kante);
    border-radius: 999px;
    color: var(--w-text-dim);
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
}
a.zl-pille:hover, a.zl-pille:focus-visible { color: var(--w-text); border-color: var(--w-text-dim); }
.zl-pille.aktiv { background: var(--w-akzent); border-color: var(--w-akzent); color: var(--w-auf-akzent); font-weight: 600; }
/* Auf dem Handy zählt jede Zeile der klebenden Leiste: die Spanne fällt weg. */
@container (width < 520px) {
    .zl-spanne { display: none; }
    .zl-titel { min-width: 0; }
}

/* Der Wasserfall: je Zeile Name, schwebender Balken auf der gemeinsamen Achse, Wert. */
.wf { display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.wf-zeile { display: grid; grid-template-columns: minmax(150px, 13.5rem) minmax(0, 1fr) 6.6rem; align-items: center; gap: 14px; }
.wf-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.22; }
.wf-name { font-size: 0.92rem; color: var(--w-text); }
.wf-unter { font-size: 0.74rem; color: var(--w-text-dim); }
.wf-spur { position: relative; height: 22px; }
.wf-balken { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; }
.wf-null { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--w-text-dim); }
.wf-wert {
    text-align: right;
    white-space: nowrap;
    font-family: var(--w-schrift-display);
    font-size: 1.08rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--w-text);
}
.wf-ergebnis { border-top: 1px solid var(--w-kante); padding-top: 8px; }
.wf-ergebnis .wf-name { font-weight: 600; }
.wf-ergebnis .wf-wert { font-size: 1.3rem; }
.wf-geist .wf-balken { background: var(--w-kante); }
.wf-geist .wf-wert { color: var(--w-text-dim); }
/* Schmal: Name und Wert in einer Zeile, der Balken darunter über die ganze Breite. */
@container (width < 440px) {
    .wf-zeile { grid-template-columns: minmax(0, 1fr) 6rem; gap: 3px 10px; }
    .wf-text { grid-column: 1; grid-row: 1; }
    .wf-wert { grid-column: 2; grid-row: 1; }
    .wf-spur { grid-column: 1 / -1; grid-row: 2; }
}

/* Die Kennzahl-Kachel: Titel, Zahl (oder zwei), Unterzeile, Feinzeilen, unten der Mini-Verlauf. */
.kk {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 14px 18px;
    background: var(--w-panel);
    border: 1px solid var(--w-kante);
    border-radius: 12px;
    color: var(--w-text);
}
.kk-titel {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--w-text-dim);
    font-family: var(--w-schrift-display);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.kk-titel svg { width: 1.05rem; height: 1.05rem; flex: none; }
.kk-wert {
    margin: 2px 0;
    font-family: var(--w-schrift-display);
    font-size: 2.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.kk-einheit { margin-left: 0.35rem; font-size: 1rem; font-weight: 500; color: var(--w-text-dim); }
.kk-zwei { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 3px 0 2px; }
.kk-zwei > div { display: flex; flex-direction: column; }
.kk-name { font-size: 0.78rem; color: var(--w-text-dim); }
.kk-wert-zwei { margin: 0; font-size: 1.75rem; }
.kk-wert-zwei .kk-einheit { font-size: 0.85rem; }
.kk-unter { font-size: 0.85rem; color: var(--w-text-dim); }
.kk-fein { margin-top: 3px; font-size: 0.76rem; color: var(--w-text-dim); opacity: 0.8; font-variant-numeric: tabular-nums; }
.kk-verlauf { margin-top: auto; padding-top: 9px; }

/* Der Mini-Verlauf: eine verzerrbare Fläche, die Höhe steht hier. */
.mv { display: block; width: 100%; height: 30px; }
.mv.mv-zwei { height: 36px; }
.mv rect { fill: var(--w-text-dim); }
.mv-rest { opacity: 0.38; }
.mv-zwei rect { opacity: 0.7; }
.mv .mv-ziel { fill: var(--w-text); fill-opacity: 0; opacity: 1; }   /* die Fläche einer Periode: trägt den Tooltip (<title>) */
.mv .mv-ziel:hover { fill-opacity: 0.12; }
.mv-mitte { stroke: var(--w-kante); stroke-width: var(--linie-hilfslinie, 1px); vector-effect: non-scaling-stroke; }

/* ---- Bausteine der Energiebilanz, Teil 2 (A07): Energiefluss-Brücke, Linienverlauf, Rangliste ----------------------------------------- */

/* Die Brücke: das SVG auf fester Fläche, gleichmäßig skaliert. Schmal (das Handy) stehen stattdessen zwei Balken zu je 100 % ohne Bänder. */
.br { container-type: inline-size; }
.br-svg { display: block; width: 100%; height: auto; overflow: visible; }
.br-band { opacity: 0.15; }
.br-band-direkt { opacity: 0.13; }
.br-band-batterie { opacity: 0.17; }
.br-bandtext { fill: var(--w-text); font-size: 13px; font-weight: 600; }
.br-klein { fill: var(--w-text-dim); font-size: 11.5px; }
.br-text { fill: var(--w-grund); font-family: var(--w-schrift-display); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.br-text-hell { fill: #ffffff; }
.br-titel { fill: var(--w-text-dim); color: var(--w-text-dim); font-family: var(--w-schrift-display); font-size: 12.5px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.12em; }
.br-zahl { fill: var(--w-text); color: var(--w-text); font-family: var(--w-schrift-display); font-size: 17px; font-weight: 600;
           font-variant-numeric: tabular-nums; }
.br-verbinder { fill: none; stroke: var(--w-text-dim); stroke-width: 1.4; stroke-dasharray: 4 3; }
.br-pfeilspitze { fill: var(--w-text-dim); }
.br-knoten { fill: var(--w-grund); stroke: var(--w-kante); }
.br-knotensymbol { fill: none; stroke: var(--w-text-dim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.br-knotentext { fill: var(--w-text-dim); font-size: 11px; }
.br-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.15rem; margin-top: 10px; color: var(--w-text-dim); font-size: 0.8rem; }
.br-legende span { display: inline-flex; align-items: center; gap: 6px; }
.br-legende i { width: 0.72rem; height: 0.72rem; border-radius: 2px; }
.br-handy { display: none; }
.br-handy-kopf { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 5px; }
.br-handy-kopf .br-titel { font-size: 0.74rem; }
.br-handy-kopf .br-zahl { font-size: 1.05rem; }
.br-handy-balken { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; }
.br-handy-balken i { flex: 1 1 0; min-width: 2px; }
.br-handy-teile { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 0.78rem; color: var(--w-text-dim); }
.br-handy-teile li { display: inline-flex; align-items: center; gap: 5px; }
.br-handy-teile i { width: 9px; height: 9px; border-radius: 2px; }
.br-handy-teile b { color: var(--w-text); font-weight: 600; font-variant-numeric: tabular-nums; }
@container (width < 560px) {
    .br-svg, .br-legende { display: none; }
    .br-handy { display: block; }
}

/* Der Linienverlauf: aufgebaut wie der Balken — links die Achse, darüber die Fläche, unten die Zeitachse. Die Höhe gibt der Gastgeber. */
.lv {
    height: 100%;
    display: grid;
    grid-template-columns: 2.9em minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 1.3em;
    font-size: 0.72rem;
    color: var(--w-text-dim);
}
.lv-plot { position: relative; min-height: 0; }
.lv-linien { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lv-linien polyline { fill: none; stroke-width: var(--linie-diagramm, 1.5px); stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lv-punkt {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px var(--w-panel);
    pointer-events: none;
}
.lv-punkt.lv-laufend { opacity: 0.5; }

/* Die Rangliste: Rang · Name · Balken · Werte; Unterzähler eingerückt, der Rest blass. Schmal steht der Balken unter dem Namen. */
.rl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; container-type: inline-size; }
.rl-zeile {
    display: grid;
    grid-template-columns: 1.5rem minmax(7rem, 1.25fr) minmax(3rem, 1fr) repeat(var(--rl-werte, 2), max-content);
    align-items: center;
    gap: 4px 12px;
    padding: 5px 0;
    border-bottom: 1px solid #ffffff0a;
    color: var(--w-text);
}
.rl-zeile:last-child { border-bottom: none; }
.rl-rang { color: var(--w-text-dim); font-family: var(--w-schrift-display); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rl-name { display: flex; align-items: center; gap: 7px; min-width: 0; padding-left: calc(var(--ebene, 0) * 1.1rem); }
.rl-name > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.rl-name small { display: block; color: var(--w-text-dim); font-size: 0.74rem; }
.rl-name svg { width: 1rem; height: 1rem; flex: none; color: var(--w-text-dim); }
.rl-spur { position: relative; height: 10px; border-radius: 3px; background: #ffffff08; overflow: hidden; }
.rl-spur i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.rl-wert { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rl-wert + .rl-wert { color: var(--w-text-dim); min-width: 3.2em; }
/* A08: die Zusatzspalte (der Sonnenanteil bzw. die Kosten) — immer die letzte Spalte, auch bei einer Zeile mit weniger Werten. */
.rl-extra { grid-column: -2 / -1; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 3.6em; font-size: 0.92em; }
.rl-unter { font-size: 0.9em; color: var(--w-text-dim); }
.rl-blass .rl-spur i { opacity: 0.6; }
.rl-hinweis { grid-column: 2 / -1; display: block; color: var(--w-achtung); font-size: 0.78rem; line-height: 1.35; }
.rl-mit-hinweis { padding-bottom: 7px; }
.rl-hinweis::before { content: "⚠ "; }
@container (width < 430px) {
    .rl-zeile { grid-template-columns: 1.3rem minmax(0, 1fr) repeat(var(--rl-werte, 2), max-content); }
    .rl-spur { grid-column: 2 / -1; grid-row: 2; }
    .rl-hinweis { grid-row: 3; }
}

/* ---- Energiefluss als Sankey (Energiefluss.md): Quellen links, Stufen nach rechts, Bänder gelb/rot nach dem Sonnenanteil -------------------
   Das SVG auf fester Breite, gleichmäßig skaliert; ein Knoten mit Unterzählern ist ein Link, Tooltips sind <title>. Schmal (das Handy) steht
   statt des Bilds eine Liste der ersten Stufe mit 100-%-Balken. */
.sk { container-type: inline-size; }
.sk-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sk-spalte { fill: var(--w-text-dim); font-family: var(--w-schrift-display); font-size: 11px; font-weight: 600; text-transform: uppercase;
             letter-spacing: 0.12em; }
.sk-baender { isolation: isolate; }
.sk-band path { opacity: 0.42; transition: opacity 0.12s; }
.sk-band:hover path { opacity: 0.8; }
.sk-saeule { stroke: var(--w-grund); stroke-width: var(--linie-hilfslinie, 1px); vector-effect: non-scaling-stroke; }
.sk-knoten text { paint-order: stroke; stroke: var(--w-panel); stroke-width: 3px; stroke-linejoin: round; }
.sk-oeffnet { cursor: pointer; }
.sk-oeffnet:hover .sk-name, .sk-oeffnet:focus-visible .sk-name { fill: var(--w-akzent); text-decoration: underline; }
.sk-rand { cursor: default; }
.sk-name { fill: var(--w-text); font-size: 13px; font-weight: 600; }
.sk-wert { fill: var(--w-text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.sk-sonne { fill: var(--w-erzeugung); font-size: 12px; font-weight: 600; }
.sk-warnung { fill: var(--w-achtung); color: var(--w-achtung); font-size: 13px; font-weight: 700; }
.sk-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.15rem; margin-top: 10px; color: var(--w-text-dim); font-size: 0.8rem; }
.sk-legende span { display: inline-flex; align-items: center; gap: 6px; }
.sk-legende i { width: 0.72rem; height: 0.72rem; border-radius: 2px; }
.sk-handy { display: none; list-style: none; margin: 0; padding: 0; }
.sk-zeile { padding: 7px 0; border-bottom: 1px solid #ffffff0a; }
.sk-zeile-kopf { display: flex; align-items: baseline; gap: 6px; font-size: 0.88rem; color: var(--w-text); }
.sk-zeile-kopf a { color: var(--w-text); text-decoration: none; }
.sk-zeile-kopf a:hover, .sk-zeile-kopf a:focus-visible { text-decoration: underline; }
.sk-zeile-kopf b { margin-left: auto; color: var(--w-text-dim); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-zeile-balken { display: flex; height: 9px; min-width: 4px; margin-top: 4px; border-radius: 5px; overflow: hidden; }
.sk-zeile-balken i { flex: 1 1 0; min-width: 0; }
@container (width < 560px) {
    .sk-svg { display: none; }
    .sk-handy { display: block; }
}

/* ---- Gerätezeichnung (S06c): Batterie, Heizstab, Heizkörper, Wärmepumpe, Wallbox, Zähler ---------------------------------------------

   Vorsilbe gg-. Dieselbe Zeichnung in der Gerätekachel des Gastgebers und im Anlagenschema (Bausteine/Geraetezeichnung.razor) — übernommen
   aus der Kachel der WebApp (W26, W32), die sie von der Box hat. Die Wurzel trägt w-baustein (die Variablen der Bibliothek) und gg; was sich
   bewegt, nimmt die Phase der Zeit (--gg-phase) und steht bei reduzierter Bewegung still. */
.gg {
    --gg-korpus: var(--geraet-korpus, #334155);
    --gg-kante: var(--geraet-kante, #64748b);
    --gg-detail: var(--geraet-detail, #94a3b8);
    --gg-glut: #fb923c;
    --gg-glut-schein: #f97316;
    --gg-wasser-warm: #7c2d1240;
    --gg-temp-12: var(--f-temp-12, #3b82f6);
    --gg-temp-45: var(--f-temp-45, #f97316);
}
.gg-korpus { fill: var(--gg-korpus); stroke: var(--gg-kante); stroke-width: 1.5; }
.gg-sockel { fill: var(--gg-korpus); stroke: var(--gg-kante); stroke-width: 1.2; }
.gg-rippe { stroke: var(--gg-kante); stroke-width: 1.4; stroke-linecap: round; }
.gg-display { fill: var(--w-grund); stroke: var(--gg-detail); stroke-width: 0.8; }
.gg-kabel { stroke: var(--gg-kante); stroke-width: 2; stroke-linecap: round; }
.gg-gedaempft { opacity: 0.55; }

/* Batterie: Füllstand nach Ladezustand (grün, unter 30 % gelb, unter 15 % rot), der Pol in der Farbe der Richtung. */
.gg-batterie-pol { fill: var(--gg-korpus); stroke: var(--gg-kante); stroke-width: 1.2; }
.gg-batterie-pol.gg-pol-laden { fill: var(--w-einspeisung); stroke: var(--w-einspeisung); }
.gg-batterie-pol.gg-pol-entladen { fill: var(--w-entladen); stroke: var(--w-entladen); }
.gg-batterie-schacht { fill: var(--w-grund); stroke: var(--gg-kante); stroke-width: 0.8; }
.gg-batterie-fuellung.gg-soc-gut { fill: var(--w-ok); }
.gg-batterie-fuellung.gg-soc-knapp { fill: var(--w-achtung); }
.gg-batterie-fuellung.gg-soc-leer { fill: var(--w-warn); }
.gg-batterie-fuge { stroke: var(--gg-korpus); stroke-width: 1.6; }
.gg-batterie-zahl {
    fill: #fff;
    font-family: var(--w-schrift-display);
    font-size: 13px;
    font-weight: 700;
    paint-order: stroke;
    stroke: #0f172acc;
    stroke-width: 2.5px;
}

/* Heizstab und Heizkörper: Wendel und Sprossen glühen, solange sie heizen; über dem Heizkörper steigt Wärme auf. */
.gg-heiz-wasser { fill: var(--w-grund); stroke: var(--gg-kante); stroke-width: 0.8; }
.gg-an .gg-heiz-wasser { fill: var(--gg-wasser-warm); }
.gg-heiz-wendel { fill: none; stroke: var(--gg-detail); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gg-an .gg-heiz-wendel { stroke: var(--gg-glut); filter: drop-shadow(0 0 2.5px var(--gg-glut-schein)); }
.gg-hk-sprossen { fill: none; stroke: var(--gg-detail); stroke-width: 3; stroke-linecap: round; }
.gg-an .gg-hk-sprossen { stroke: var(--gg-glut); filter: drop-shadow(0 0 2.5px var(--gg-glut-schein)); }
.gg-hk-welle { fill: none; stroke: var(--gg-glut); stroke-width: 1.6; stroke-linecap: round; opacity: 0; }
.gg-an .gg-hk-welle { animation: gg-hk-steigen 2.4s ease-in-out infinite; animation-delay: var(--gg-phase, 0s); }
.gg-an .gg-hk-welle:nth-of-type(2) { animation-delay: calc(var(--gg-phase, 0s) - 0.8s); }
.gg-an .gg-hk-welle:nth-of-type(3) { animation-delay: calc(var(--gg-phase, 0s) - 1.6s); }
@keyframes gg-hk-steigen { 0% { opacity: 0; transform: translateY(3px); } 35% { opacity: 0.95; } 100% { opacity: 0; transform: translateY(-3px); } }
.gg-hk-led { fill: var(--gg-kante); }
.gg-an .gg-hk-led { fill: var(--gg-glut); }

/* Wärmepumpe: der Lüfter dreht, solange sie läuft (beim Abtauen steht er), die Lampe grün, Vorlauf warm, Rücklauf kühl. */
.gg-wp-schacht { fill: var(--w-grund); stroke: var(--gg-kante); stroke-width: 1.2; }
.gg-wp-gitter { fill: none; stroke: var(--gg-kante); stroke-width: 0.7; opacity: 0.8; }
.gg-wp-blatt { fill: var(--gg-kante); }
.gg-an .gg-wp-blatt { fill: var(--gg-detail); }
.gg-wp-nabe { fill: var(--gg-detail); }
.gg-wp-luefter { transform-box: view-box; transform-origin: 0 0; }
.gg-dreht .gg-wp-luefter { animation: gg-wp-drehen 1.2s linear infinite; animation-delay: var(--gg-phase, 0s); }
@keyframes gg-wp-drehen { to { transform: rotate(360deg); } }
.gg-wp-rohr { fill: none; stroke: var(--gg-kante); stroke-width: 2.6; stroke-linecap: round; }
.gg-an .gg-wp-vorlauf { stroke: var(--gg-temp-45); }
.gg-an .gg-wp-ruecklauf { stroke: var(--gg-temp-12); }
.gg-wp-led { fill: var(--gg-kante); }
.gg-an .gg-wp-led { fill: var(--w-ok); }

/* Wallbox: Leuchtring und Blitz in der Farbe des Verbrauchs, solange geladen wird. */
.gg-wallbox-ring { fill: var(--w-grund); stroke: var(--gg-kante); stroke-width: 0.8; }
.gg-an .gg-wallbox-ring { fill: var(--w-verbrauch); stroke: var(--w-verbrauch); filter: drop-shadow(0 0 2px var(--w-verbrauch)); }
.gg-wallbox-blitz { fill: var(--gg-detail); }
.gg-an .gg-wallbox-blitz { fill: var(--w-verbrauch); }
.gg-wallbox-kabel { fill: none; stroke: var(--gg-kante); stroke-width: 3; stroke-linecap: round; }

/* Zähler: Einspeisung ← grün, Bezug → rot, die Impuls-Lampe blinkt, solange Energie fließt. */
.gg-zaehler-ziffern { fill: var(--gg-detail); font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 7px; }
.gg-zaehler-pfeil { fill: none; stroke: var(--gg-detail); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.gg-zaehler-pfeil.gg-bezug { stroke: var(--w-bezug); opacity: 1; }
.gg-zaehler-pfeil.gg-einspeisung { stroke: var(--w-einspeisung); opacity: 1; }
.gg-zaehler-led { fill: var(--gg-kante); }
.gg-zaehler-led.gg-bezug { fill: var(--w-bezug); }
.gg-zaehler-led.gg-einspeisung { fill: var(--w-einspeisung); }
.gg-blinkt { animation: gg-zaehler-impuls 1.2s steps(2, jump-none) infinite; }
@keyframes gg-zaehler-impuls { from { opacity: 1; } to { opacity: 0.15; } }
.gg-zaehler-klemme { fill: var(--gg-detail); }

@media (prefers-reduced-motion: reduce) {
    .gg-an .gg-hk-welle { animation: none; opacity: 0.8; }
    .gg-dreht .gg-wp-luefter, .gg-blinkt { animation: none; }
}

/* ---- Klima (DA06, Klima.md — bis dahin die Seite „Klima“ der WebApp): Kennzahlen, je Halle eine Kachel (Boden = Temperatur, Lichtschein =
   Helligkeit, Ringe = Schall), je Sensor eine Karte mit Tageskurve. Die Farben der Böden rechnet Klimabau (gemischte Stufen, als Stil am
   Element); hier stehen Rahmen, Schild und Bewegung. Das Widget hat keinen eigenen Rahmen — seine Karten sind die Flächen —, und seine
   Höhe folgt dem Inhalt (w-waechst, wie beim Schema-Widget). Die Kurven sind Diagrammlinien: Breite aus den Tokens, non-scaling-stroke. ------------------------- */

.w-typ-klima { background: none; border: 0; padding: 0; }
.w-klima { color: var(--w-text); }
.kl-kopfzeile { display: flex; justify-content: flex-end; margin: 0 0 0.5rem; }
.kl-stand { padding: 0.15rem 0.6rem; border: 1px solid var(--w-kante); border-radius: 999px; color: var(--w-text-dim); font-size: 0.8rem; white-space: nowrap; }
.kl-hinweis { margin: 0 0 0.7rem; padding: 0.55rem 0.8rem; border: 1px solid var(--w-kante); border-radius: 10px; color: var(--w-text-dim); font-size: 0.875rem; }
.kl-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.kl-kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 0.7rem; margin-bottom: 0.9rem; }
.kl-kpi { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.8rem; background: var(--w-panel); border: 1px solid var(--w-kante);
    border-radius: 12px; color: var(--w-text); text-decoration: none; }
.kl-kpi:hover, .kl-kpi:focus-visible { border-color: var(--w-akzent); }
.kl-kpi-titel { font: 600 0.78rem var(--w-schrift-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--w-text-dim); }
.kl-kpi-wert { font: 600 1.5rem var(--w-schrift-display); font-variant-numeric: tabular-nums; }
.kl-kpi-wert.kl-gut, .kl-kpi-wert.kl-neutral { color: var(--w-text); }
.kl-kpi-halle { color: var(--w-text-dim); font-size: 0.875rem; }
.kl-panel { margin-bottom: 0.9rem; padding: 0.9rem 1rem 1rem; background: var(--w-panel); border: 1px solid var(--w-kante); border-radius: 14px; }
.kl-ebenen { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 0.8rem; background: var(--w-grund); border: 1px solid var(--w-kante);
    border-radius: 999px; }
.kl-ebenen a, .kl-ebenen span { padding: 0.3rem 0.85rem; border-radius: 999px; color: var(--w-text-dim); text-decoration: none; font: 600 0.85rem var(--w-schrift-display); }
.kl-ebenen .aktiv { background: var(--w-kante); color: var(--w-text); }
.kl-ebenen a:hover { color: var(--w-text); }
.kl-hallen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.8rem; }
.kl-halle { min-width: 0; }
.kl-halle-kopf { font: 600 0.95rem var(--w-schrift-display); letter-spacing: 0.01em; text-transform: uppercase; margin: 0 0 0.3rem 0.2rem; }
.kl-halle-kopf a { color: var(--w-text); text-decoration: none; }
.kl-halle-kopf a:hover { color: var(--w-akzent); }
.kl-halle-ohne .kl-halle-kopf { color: var(--w-text-dim); }
.kl-szene { display: block; width: 100%; height: auto; }
.kl-boden { fill: var(--w-panel); stroke: var(--w-kante); stroke-width: 1.5; }
.kl-lampe line { stroke: #fde68a; stroke-width: 2; stroke-linecap: round; }
.kl-ring { fill: none; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: kl-welle 2.4s linear infinite; }
@keyframes kl-welle { from { transform: scale(.35); opacity: .95; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kl-ring { animation: none; opacity: .45; } }
.kl-schild rect { fill: #0b1220; fill-opacity: .82; stroke: var(--w-kante); stroke-width: 1; }
.kl-schild:hover rect, .kl-schild:focus rect { stroke: var(--w-text); }
.kl-schild:focus { outline: none; }
.kl-schild-gross { font: 600 21px var(--w-schrift-display); font-variant-numeric: tabular-nums; fill: var(--w-text); }
.kl-schild-zeile { font-size: 11.5px; font-variant-numeric: tabular-nums; fill: #cbd5e1; }
.kl-schild-name { font: 600 9.5px var(--w-schrift-display); letter-spacing: 0.12em; fill: var(--w-text-dim); }
.kl-punkt { stroke: #0b1220; stroke-width: 2; }
.kl-punkt.kl-achtung { fill: var(--w-achtung); }
.kl-punkt.kl-grenze { fill: var(--w-warn); }
.kl-alt { opacity: 0.5; }
.kl-legende { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; margin-top: 0.8rem; color: var(--w-text-dim); font-size: 0.875rem; }
.kl-skala { display: inline-block; width: 9rem; height: 9px; margin: 0 0.35rem; border-radius: 5px; vertical-align: middle; }
.kl-zeichen { display: inline-block; width: 14px; height: 14px; margin-right: 0.35rem; border-radius: 50%; vertical-align: middle; }
.kl-zeichen-licht { background: radial-gradient(#fde68a 40%, transparent 70%); }
.kl-zeichen-schall { border: 2px solid #a5b4fc; box-shadow: 0 0 0 3px var(--w-panel), 0 0 0 5px #f97316; width: 8px; height: 8px; margin-left: 4px; }
.kl-zeichen-punkt { background: var(--w-achtung); width: 10px; height: 10px; }
.kl-kartenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 1rem; margin: 0.4rem 0 0.6rem; }
.kl-kartenkopf .kl-ebenen { margin-bottom: 0; }
.kl-zwischentitel { font-size: 1.0625rem; font-weight: 600; margin: 0; }
.kl-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0.8rem; margin-bottom: 0.9rem; }
.kl-karte { display: block; padding: 0.7rem 0.85rem 0.75rem; background: var(--w-panel); border: 1px solid var(--w-kante); border-radius: 14px;
    color: var(--w-text); text-decoration: none; }
.kl-karte:hover, .kl-karte:focus-visible { border-color: var(--w-akzent); }
.kl-karte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.kl-karte-kopf b { font: 600 1.05rem var(--w-schrift-display); }
.kl-karte-kopf span, .kl-karte-halle, .kl-karte-fuss { color: var(--w-text-dim); font-size: 0.875rem; }
.kl-karte-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 0.8rem; margin-top: 0.2rem; }
.kl-werte { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.9rem; margin: 0.55rem 0 0.45rem; }
.kl-wert { display: flex; flex-direction: column; min-width: 0; }
.kl-wert-titel { font: 600 0.66rem var(--w-schrift-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--w-text-dim); }
.kl-wert-zahl { font: 600 1.15rem var(--w-schrift-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kl-wert-zahl small { font-size: 0.72rem; color: var(--w-text-dim); font-weight: 400; }
.kl-balken { position: relative; height: 5px; margin-top: 2px; overflow: hidden; border-radius: 3px; background: var(--w-grund); }
.kl-balken i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--w-text-dim); }
.kl-balken i.kl-gut { background: var(--w-ok); }
.kl-balken i.kl-achtung { background: var(--w-achtung); }
.kl-balken i.kl-grenze { background: var(--w-warn); }
.kl-kpi-wert.kl-achtung { color: var(--w-achtung); }
.kl-kpi-wert.kl-grenze { color: var(--w-warn); }
.kl-weitere { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin: 0 0 0.35rem; color: var(--w-text-dim); font-size: 0.875rem; }
.kl-weitere b { color: var(--w-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kl-kurve { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.4rem; margin-top: 0.15rem; }
.kl-achse { display: flex; flex-direction: column; justify-content: space-between; text-align: right; color: var(--w-text-dim); font-size: 0.68rem;
    line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kl-zeitachse { display: flex; justify-content: space-between; color: var(--w-text-dim); font-size: 0.66rem; margin-top: 0.1rem; }
.kl-gitter { stroke: var(--w-kante); stroke-width: var(--linie-hilfslinie, 1px); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.kl-tip { fill: transparent; }
.kl-tip:hover { fill: rgba(226, 232, 240, 0.16); }
.kl-verlauf { display: block; width: 100%; height: 54px; }
.kl-linie { fill: none; stroke-width: var(--linie-diagramm, 1.5px); vector-effect: non-scaling-stroke; }
.kl-verlauf-leer { display: flex; align-items: center; color: var(--w-text-dim); font-size: 0.875rem; }
.kl-linie-temperatur { stroke: #22c55e; }
.kl-linie-licht { stroke: #facc15; }
.kl-linie-schall { stroke: #a5b4fc; }
.kl-linie-feuchte { stroke: #38bdf8; }
.kl-erklaerung h4 { font-family: var(--w-schrift-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0.01em; color: var(--w-text-dim); margin: 0 0 0.6rem; }
.kl-erklaerung ul { margin: 0; padding-left: 1.2rem; line-height: 1.55; }
.kl-erklaerung li { margin-bottom: 0.4rem; }

/* ---- Tagesbild der Strings (S13, Anlagenschema.md §12.4; Mockup svgHeatmap): je Viertelstunde ein Kästchen in der Stufe seiner Abweichung
   (Abweichungsfarbe) — grau im Rahmen, darunter von der Basis über Orange nach Rot, darüber nach Blau. Die Töne sind Tokens (_Branding,
   „Abweichungsstufen"), gemischt in sRGB wie das Mockup; ohne color-mix gilt die nähere Stufe davor.
   Ein Diagramm, kein Symbol: die Hilfslinien nehmen die Breite des Tokens (README „Diagramme“) — deshalb vor dem Abschnitt des Schemas. */
.as-tagesbild {
    --as-abw-rahmen: var(--f-abw-rahmen, #2a3952);
    --as-abw-basis: var(--f-abw-basis, #3a4660);
    --as-abw-unter: var(--f-abw-unter, #f59e0b);
    --as-abw-stark: var(--f-abw-stark, #ef4444);
    --as-abw-ueber: var(--f-abw-ueber, #60a5fa);
    --as-spur: #475569;
}
.as-tb-rahmen { overflow-x: auto; }
.as-tb-svg { display: block; width: 100%; min-width: 820px; height: auto; }
.as-tb-leer { color: var(--w-text-dim); margin: 0.4rem 0.3rem; }
.as-tb-legende { margin-top: 0.4rem; }
.as-tb-zelle { shape-rendering: crispEdges; }
.as-tb-zelle.as-tb-r { fill: var(--as-abw-rahmen); }
.as-tb-zelle.as-tb-u1 { fill: var(--as-abw-basis); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-unter) 25%); }
.as-tb-zelle.as-tb-u2 { fill: var(--as-abw-unter); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-unter) 50%); }
.as-tb-zelle.as-tb-u3 { fill: var(--as-abw-unter); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-unter) 75%); }
.as-tb-zelle.as-tb-u4 { fill: var(--as-abw-unter); }
.as-tb-zelle.as-tb-u5 { fill: var(--as-abw-unter); fill: color-mix(in srgb, var(--as-abw-unter), var(--as-abw-stark) 16.7%); }
.as-tb-zelle.as-tb-u6 { fill: var(--as-abw-unter); fill: color-mix(in srgb, var(--as-abw-unter), var(--as-abw-stark) 33.3%); }
.as-tb-zelle.as-tb-u7 { fill: var(--as-abw-stark); fill: color-mix(in srgb, var(--as-abw-unter), var(--as-abw-stark) 50%); }
.as-tb-zelle.as-tb-u8 { fill: var(--as-abw-stark); fill: color-mix(in srgb, var(--as-abw-unter), var(--as-abw-stark) 66.7%); }
.as-tb-zelle.as-tb-u9 { fill: var(--as-abw-stark); fill: color-mix(in srgb, var(--as-abw-unter), var(--as-abw-stark) 83.3%); }
.as-tb-zelle.as-tb-u10 { fill: var(--as-abw-stark); }
.as-tb-zelle.as-tb-o1 { fill: var(--as-abw-basis); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-ueber) 20%); }
.as-tb-zelle.as-tb-o2 { fill: var(--as-abw-basis); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-ueber) 40%); }
.as-tb-zelle.as-tb-o3 { fill: var(--as-abw-ueber); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-ueber) 60%); }
.as-tb-zelle.as-tb-o4 { fill: var(--as-abw-ueber); fill: color-mix(in srgb, var(--as-abw-basis), var(--as-abw-ueber) 80%); }
.as-tb-zelle.as-tb-o5 { fill: var(--as-abw-ueber); }
.as-tb-titel {
    font-family: var(--w-schrift-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    fill: var(--w-text-dim);
}
.as-tb-zeile { font-family: var(--w-schrift-display); font-size: 10.5px; font-weight: 500; fill: var(--w-text-dim); font-variant-numeric: tabular-nums; }
.as-tb-achse { font-family: var(--w-schrift-display); font-size: 10.5px; font-weight: 500; fill: #64748b; font-variant-numeric: tabular-nums; }
.as-tb-gitter { fill: none; stroke: var(--w-kante); stroke-width: var(--linie-hilfslinie, 1px); stroke-dasharray: 1 3; vector-effect: non-scaling-stroke; }
.as-tb-verlauf {
    display: inline-block;
    width: 150px;
    height: 0.55rem;
    border-radius: 99px;
    vertical-align: middle;
    margin: 0 0.3rem;
    background: linear-gradient(90deg, var(--as-abw-stark) 0%, var(--as-abw-unter) 30%, var(--as-abw-basis) 62%, var(--as-abw-basis) 70%, var(--as-abw-ueber) 100%);
}

/* ---- Anlagenschema (S02, Anlagenschema.md §5): Zeichnung, Symbole, Bewegung ohne JavaScript -------------------------------------------

   Vorsilbe as-. Gezeichnet wie das Mockup (_Konzept/Anlagenschema-Mockup.html): Kabel und Rohre sind Symbole, keine Diagrammlinien — sie
   behalten ihre eigenen Maße (_Branding/README.md, „Diagramme"): Kabel 4, Fluss 7, Rohr 13 mit Füllung 9 und Strichen 4, in Mäander und
   Wendel 8/5/3. Texte stehen im SVG und skalieren mit ihrem Symbol (§5.2). Die Kennzeichen der Gruppen (as-s-… je Symbol, as-l-… je
   Leitung) haben keine eigene Regel — sie sind ein Haken für den Gastgeber wie w-typ-…. */

/* Die Farben: Zonen und Geräte wie im Mockup (die Gerätefarben des Gastgebers mit Rückfall), die Temperaturstufen als Tokens (_Branding,
   --f-temp-…, mit dem Palette-Validator geprüft). Die Legende braucht dieselben. */
.as-rahmen, .as-legende {
    --as-zone: #172235;
    --as-zone-kante: #26354d;
    --as-zone-titel: #64748b;
    --as-korpus: var(--geraet-korpus, #334155);
    --as-kante: var(--geraet-kante, #64748b);
    --as-detail: var(--geraet-detail, #94a3b8);
    --as-dunkel: #0f172a;
    --as-rohrrand: #0b1220;
    --as-spur: #475569;
    --as-ohne: var(--geraet-kante, #64748b);
    --as-glut: #fb923c;
    --as-glut-schein: #f97316;
    --as-temp-12: var(--f-temp-12, #3b82f6);
    --as-temp-22: var(--f-temp-22, #6366f1);
    --as-temp-30: var(--f-temp-30, #a855f7);
    --as-temp-36: var(--f-temp-36, #ec4899);
    --as-temp-45: var(--f-temp-45, #f97316);
    --as-temp-60: var(--f-temp-60, #ef4444);
}

/* Das SVG auf fester Fläche, gleichmäßig skaliert; schmaler als 820 px scrollt es waagrecht (§5.6, bis S07 das Hochformat bringt). */
.as-rahmen { overflow-x: auto; }
.as-svg { display: block; width: 100%; min-width: 820px; height: auto; user-select: none; }

/* Das Schema als Widget eines Dashboards (DA04): das Bild füllt die Fläche des Widgets — in der Höhe eingepasst (das SVG skaliert über seine
   viewBox und bleibt mittig), in der Breite wie auf der Schemaseite: unter 820 px scrollt es waagrecht. Darunter die Legende, darüber — nur an
   einem anderen Tag — die Zeile „zeigt jetzt". */
/* Seit DA06 folgt die Höhe des Schema-Widgets dem Bild (w-waechst): das Schema nimmt die ganze Breite des Widgets und so viel Höhe, wie sein
   Seitenverhältnis verlangt — so groß und lesbar wie auf seiner eigenen Seite, gleich ob quer oder hochkant; H ist nur die Mindesthöhe. */
.w-schema { display: flex; flex-direction: column; }
.w-schema .as-legende { margin: 0.4rem 0.3rem 0; font-size: 0.78rem; gap: 0.3rem 1.2rem; }
.w-schema-jetzt { margin: 0 0.3rem 0.3rem; color: var(--w-text-dim); font-size: 0.8rem; }

.as-zone { fill: var(--as-zone); stroke: var(--as-zone-kante); stroke-width: 1; }
.as-zone-titel {
    font-family: var(--w-schrift-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    fill: var(--as-zone-titel);
}

/* Texte: Etiketten in Versalien, Zahlen in Barlow mit gleich breiten Ziffern, Temperaturen mit dunklem Rand über farbigen Flächen. */
.as-etikett {
    font-family: var(--w-schrift-display);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    fill: var(--w-text-dim);
}
.as-wert, .as-wert-klein, .as-temp, .as-temp-innen, .as-modus {
    font-family: var(--w-schrift-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    fill: var(--w-text);
}
.as-wert { font-size: 21px; }
.as-wert-klein { font-size: 16px; }
.as-wert.as-wert-erzeugung { fill: var(--w-erzeugung); }
.as-wert.as-wert-bezug { fill: var(--w-bezug); }
.as-wert.as-wert-einspeisung { fill: var(--w-einspeisung); }
.as-wert.as-wert-laden { fill: var(--w-laden); }
.as-wert.as-wert-entladen { fill: var(--w-entladen); }
.as-klein { font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; fill: var(--w-text-dim); }
.as-temp { font-size: 13.5px; paint-order: stroke; stroke: var(--as-dunkel); stroke-width: 3.5px; stroke-linejoin: round; }
.as-temp-innen { font-size: 14px; fill: #ffffff; paint-order: stroke; stroke: #0f172acc; stroke-width: 4px; stroke-linejoin: round; }
.as-still { opacity: 0.6; }

/* Geräte: Korpus, Kante, Detail wie die Gerätegrafiken. */
.as-korpus { fill: var(--as-korpus); stroke: var(--as-kante); stroke-width: 1.5; }
.as-korpus-dunkel { fill: var(--as-dunkel); stroke: var(--as-kante); stroke-width: 1.2; }
.as-dach { fill: none; stroke: var(--as-kante); stroke-width: 1.4; stroke-linecap: round; }
.as-mast { fill: none; stroke: var(--as-detail); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.as-isolator { fill: none; stroke: var(--as-detail); stroke-width: 2; }
/* Netz an der Mittelspannung (16.11.2026): das Gitter des Masts feiner. */
.as-mast-gitter { fill: none; stroke: var(--as-detail); stroke-width: 1; stroke-linecap: round; }

.as-pv-flaeche { fill: #0c4a6e; stroke: #7dd3fc; stroke-width: 1.4; stroke-linejoin: round; }
.as-pv-zellen { fill: none; stroke: #38bdf8; stroke-opacity: 0.55; stroke-width: 1; }
.as-pv-glanz { fill: #ffffff; opacity: 0.07; }
.as-sonne-kern { fill: var(--w-erzeugung); }
.as-sonne-strahl { fill: none; stroke: var(--w-erzeugung); stroke-width: 2.4; stroke-linecap: round; }
.as-mond { fill: var(--as-detail); }

.as-schiene { fill: var(--as-korpus); stroke: var(--as-kante); stroke-width: 1.2; }
.as-knoten { fill: #cbd5e1; }

/* Die Sonnenstrahlen drehen um den Ursprung ihrer Gruppe — die äußere Gruppe hat sie an ihren Platz verschoben. */
.as-strahlen { transform-box: view-box; transform-origin: 0 0; }

/* Batterie als Schrank und Container (S12, §12.3): die Stile sp- des Mockups (_Konzept/Anlagenschema-Modulfeld-Mockup.html) mit den Gerätefarben
   und Fachfarben der Bibliothek; der Hausspeicher bleibt die Gerätezeichnung (gg-batterie-). Füllung grün, unter 30 % gelb, unter 15 % rot; Pol,
   Kabeleinführung und Rundumleuchte in der Farbe der Richtung; der Lüfter des Containers dreht, solange Leistung fließt (as-drehen). */
.as-sp-pol { fill: var(--as-korpus); stroke: var(--as-kante); stroke-width: 1.2; }
.as-sp-pol.as-sp-laden { fill: var(--w-einspeisung); stroke: var(--w-einspeisung); filter: drop-shadow(0 0 3px #34d399); }
.as-sp-pol.as-sp-entladen { fill: var(--w-entladen); stroke: var(--w-entladen); filter: drop-shadow(0 0 3px #fb923c); }
.as-sp-gut { fill: var(--w-ok); }
.as-sp-knapp { fill: var(--w-achtung); }
.as-sp-leer { fill: var(--w-warn); }
.as-sp-fuge { stroke: var(--as-korpus); stroke-width: 1.6; }
.as-sp-gedaempft { opacity: 0.55; }
.as-sp-kante { fill: none; stroke: var(--as-kante); stroke-width: 1.4; stroke-linecap: round; }
.as-sp-tuer { fill: #2b3a4f; stroke: var(--as-kante); stroke-width: 1; }
.as-sp-display { fill: #0b1220; stroke: #94a3b8; stroke-width: 0.8; }
.as-sp-display-text { font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 8.5px; font-weight: 600; fill: #a7f3d0; text-anchor: middle; }
.as-sp-display-text.as-sp-dim { fill: #64748b; }
.as-sp-notaus-ring { fill: var(--w-achtung); stroke: #a16207; stroke-width: 1; }
.as-sp-notaus { fill: #dc2626; stroke: #7f1d1d; stroke-width: 1; }
.as-sp-schalter { fill: #1f2937; stroke: var(--as-detail); stroke-width: 1.2; }
.as-sp-griff { stroke: var(--as-detail); stroke-width: 2.4; stroke-linecap: round; }
.as-sp-warndreieck { fill: var(--w-achtung); stroke: #a16207; stroke-width: 0.8; stroke-linejoin: round; }
.as-sp-blitz { fill: #1f2937; }
.as-sp-schild { fill: #cbd5e1; stroke: #64748b; stroke-width: 0.6; }
.as-sp-schild-text { font-family: var(--w-schrift-display); font-size: 6.5px; font-weight: 700; fill: #1e293b; text-anchor: middle; letter-spacing: 0.04em; }
.as-sp-rack { fill: #0b1220; stroke: var(--as-kante); stroke-width: 1; }
.as-sp-modul { fill: #263347; stroke: #475569; stroke-width: 0.8; }
.as-sp-modul-griff { fill: #475569; }
.as-sp-modul-led { fill: #334155; }
.as-sp-sockel { fill: #1f2937; stroke: var(--as-kante); stroke-width: 1; }
.as-sp-schlitz { stroke: #1e293b; stroke-width: 2.2; stroke-linecap: round; }
.as-sp-streifen-grund { fill: #1f2937; }
.as-sp-streifen { fill: #eab308; opacity: 0.6; }
.as-sp-c-korpus { fill: #3a4a60; stroke: #7b8ba3; stroke-width: 1.5; }
.as-sp-c-rippe { stroke: #2c3a4e; stroke-width: 2.4; }
.as-sp-c-rippe-hell { stroke: #4b5d76; stroke-width: 1; }
.as-sp-c-rahmen { fill: #2f3d52; stroke: #7b8ba3; stroke-width: 1; }
.as-sp-c-ecke { fill: #1f2937; stroke: #7b8ba3; stroke-width: 0.8; }
.as-sp-c-fenster { fill: #0b1220; stroke: #7b8ba3; stroke-width: 1.2; }
.as-sp-c-rack { fill: #1b2638; stroke: #475569; stroke-width: 0.8; }
.as-sp-c-fuge { stroke: #0b1220; stroke-width: 1.4; }
.as-sp-c-stange { stroke: #94a3b8; stroke-width: 1.4; stroke-linecap: round; }
.as-sp-c-text { font-family: var(--w-schrift-display); font-size: 7.5px; font-weight: 600; letter-spacing: 0.18em; fill: #cbd5e1; text-anchor: middle; }
.as-sp-fundament { fill: #1f2937; stroke: #475569; stroke-width: 1; }
.as-sp-luefterring { fill: #0f172a; stroke: var(--as-kante); stroke-width: 1.5; }
.as-sp-blatt { fill: #64748b; }
.as-sp-nabe { fill: #94a3b8; }
.as-sp-luefter { transform-box: view-box; transform-origin: 0 0; }
.as-sp-leuchte { fill: #475569; stroke: #1f2937; stroke-width: 0.8; }
.as-sp-leuchte.as-sp-laden { fill: var(--w-einspeisung); filter: drop-shadow(0 0 4px #34d399); }
.as-sp-leuchte.as-sp-entladen { fill: var(--w-entladen); filter: drop-shadow(0 0 4px #fb923c); }

/* Wärmepumpe: gezeichnet von der Gerätezeichnung (gg-, S06c); hier nur die Betriebsart als Pille in ihrer Farbe. */
.as-modus { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--as-m); }
.as-modus-feld { fill: var(--as-m); fill-opacity: 0.13; stroke: var(--as-m); stroke-opacity: 0.53; stroke-width: 1; }
.as-modus-heizen { --as-m: #fb923c; }
.as-modus-warmwasser { --as-m: #f472b6; }
.as-modus-abtauen { --as-m: #60a5fa; }
.as-modus-kuehlen { --as-m: #67e8f9; }
.as-modus-standby, .as-modus-unbekannt { --as-m: #64748b; }

/* Speicher: das Wasser in der Farbe seiner Schichten, der Heizstab glüht, solange er heizt. */
.as-wasser { fill: var(--as-farbe, var(--as-ohne)); }
.as-glanz { stroke: none; }
.as-stopp { stop-color: var(--as-farbe, var(--as-ohne)); }
.as-flansch { fill: var(--as-spur); stroke: var(--as-detail); stroke-width: 1; }
.as-stab { fill: none; stroke: var(--as-detail); stroke-width: 3; stroke-linecap: round; }
.as-fuehler { fill: var(--w-text); }
.as-stab.as-an {
    stroke: var(--as-glut);
    filter: drop-shadow(0 0 4px var(--as-glut-schein));
    animation: as-gluehen 1.6s ease-in-out var(--as-phase, 0s) infinite alternate;
}

/* Armaturen: der offene Weg gefüllt; die Pumpe hell, solange sie läuft. */
.as-port { fill: var(--as-zone); stroke: var(--as-detail); stroke-width: 1.4; stroke-linejoin: round; }
.as-port.as-offen { fill: var(--w-text); stroke: var(--w-text); }
.as-ventil-stiel { fill: none; stroke: var(--as-detail); stroke-width: 1.6; }
.as-motor { fill: var(--as-korpus); stroke: var(--as-detail); stroke-width: 1.2; }
.as-motor-text { font-family: var(--w-schrift-display); font-size: 10px; font-weight: 600; fill: #cbd5e1; }
.as-pumpe-gehaeuse { fill: var(--as-zone); stroke: var(--as-kante); stroke-width: 1.6; }
.as-pumpe-pfeil { fill: none; stroke: var(--as-kante); stroke-width: 1.4; stroke-linejoin: round; }
.as-an .as-pumpe-gehaeuse { stroke: var(--w-text); }
.as-an .as-pumpe-pfeil { fill: var(--w-text); stroke: var(--w-text); }
.as-abzweig-scheibe { fill: var(--as-rohrrand); }

/* Netzzähler, Batterie, Wallbox, Heizkörper und Wärmepumpe zeichnet seit S06c die Gerätezeichnung (gg-) — dieselbe wie in der Gerätekachel. */

/* Weitere Symbole (S35, _Konzept/Anlagenschema-Symbole-Mockup.html): Trafo (as-tr-, Kessel und Station), Brauchwasser-Wärmepumpe (as-bw-),
   Biogasanlage (as-bg-), Wärmezähler (as-wz-), Wärmetauscher (as-wt-). Was läuft, trägt as-an an der Gruppe des Symbols. */
.as-tr-rippe { fill: none; stroke: var(--as-kante); stroke-width: 2.2; stroke-linecap: round; }
.as-tr-durchfuehrung, .as-tr-sockel { fill: var(--as-kante); }
.as-tr-griff { fill: var(--as-kante); }
.as-tr-wicklung { fill: none; stroke: var(--as-detail); stroke-width: 2.4; }
.as-an .as-tr-wicklung { stroke: var(--w-text); filter: drop-shadow(0 0 3px #facc1599); }
.as-tr-marke { font-family: var(--w-schrift-display); font-size: 9px; font-weight: 600; letter-spacing: 0.08em; fill: var(--as-detail); }
.as-tr-brumm { fill: none; stroke: var(--w-text-dim); stroke-width: 1.4; stroke-linecap: round; animation: as-brummen 1.1s ease-in-out infinite alternate; }
.as-tr-warnschild { fill: var(--w-achtung); stroke: #1c1400; stroke-width: 0.8; stroke-linejoin: round; }
.as-tr-warnblitz { fill: #1c1400; }
.as-tr-lamellen { fill: none; stroke: var(--as-kante); stroke-width: 1.6; }
.as-tr-lampe { fill: var(--as-kante); }
.as-an .as-tr-lampe { fill: var(--w-ok); animation: as-blinken 1.2s steps(2, jump-none) infinite; }

.as-bw-schacht { fill: var(--as-dunkel); stroke: var(--as-kante); stroke-width: 1.2; }
.as-bw-luefter { transform-box: view-box; transform-origin: 0 0; }
.as-bw-blatt { fill: var(--as-detail); }
.as-an .as-bw-blatt { fill: var(--w-text); }
.as-bw-nabe { fill: var(--as-kante); }
.as-bw-gitter { fill: none; stroke: var(--as-kante); stroke-width: 0.9; }
.as-bw-anzeige { fill: var(--as-rohrrand); stroke: var(--as-kante); stroke-width: 1; }
.as-bw-anzeige-text { font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 8.5px; font-weight: 500; fill: #34d399; }
.as-bw-lampe { fill: var(--as-kante); }
.as-an .as-bw-lampe { fill: var(--w-ok); }

.as-bg-haube { fill: #4d7c0f; fill-opacity: 0.55; stroke: #84cc16; stroke-width: 1.4; }
.as-an .as-bg-haube { fill-opacity: 0.9; }
.as-bg-ohne .as-bg-haube { fill: var(--as-ohne); fill-opacity: 0.4; stroke: var(--as-kante); }
.as-bg-ohne .as-bg-gasrohr { stroke: var(--as-kante); }
.as-bg-beton { fill: #3b4a5f; stroke: var(--as-kante); stroke-width: 1.4; }
.as-bg-fuge { fill: none; stroke: var(--as-detail); stroke-width: 1.4; opacity: 0.5; }
.as-bg-gasrohr { fill: none; stroke: #84cc16; stroke-width: 3; stroke-linecap: round; opacity: 0.7; }
.as-bg-flamme { fill: var(--as-kante); }
.as-an .as-bg-flamme {
    fill: var(--as-glut);
    filter: drop-shadow(0 0 4px var(--as-glut-schein));
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: as-flackern 0.5s ease-in-out infinite alternate;
}
.as-bg-blitz { fill: var(--as-kante); }
.as-an .as-bg-blitz { fill: var(--w-erzeugung); }
.as-bg-abgas {
    fill: #cbd5e1;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: as-abgas var(--as-dauer, 2.4s) ease-out var(--as-phase, 0s) infinite;
}
.as-wert.as-wert-waerme { fill: var(--as-glut); }

.as-wz-pfeil { fill: var(--as-kante); }
.as-an .as-wz-pfeil { fill: var(--w-text); }
.as-wz-stiel { fill: none; stroke: var(--as-detail); stroke-width: 1.4; stroke-linecap: round; }
.as-wz-anzeige-text { font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); font-size: 7.5px; font-weight: 500; fill: #34d399; }
.as-wz-impuls { fill: var(--as-kante); }
.as-an .as-wz-impuls { fill: var(--as-glut); animation: as-blinken 0.9s steps(2, jump-none) infinite; }

.as-wt-zuganker { fill: none; stroke: var(--as-detail); stroke-width: 1.6; }
.as-wt-gestell { fill: var(--as-kante); }
.as-wt-platte { stroke-width: 2.6; stroke-linecap: round; }
.as-wt-platte.as-wt-steht { opacity: 0.6; }

/* Lufterhitzer (S35-Nachtrag): Lüfter und Lamellen wie oben (as-bw-, as-tr-lamellen), warme Luft in drei Fäden. */
.as-lh-luft {
    fill: none;
    stroke: var(--as-glut);
    stroke-width: 2.2;
    stroke-linecap: round;
    animation: as-warme-luft var(--as-dauer, 1.5s) ease-out var(--as-phase, 0s) infinite;
}
@keyframes as-warme-luft { 0% { opacity: 0.9; transform: translateY(0); } 100% { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .as-lh-luft { animation: none; } }

/* S36 Wärmenetz: Heizkörper (Glieder in der Wassertemperatur, Wärme steigt auf), Torluftschleier (Tor, Luft fällt), Verteiler, Verlust. */
.as-hk-glied { stroke: var(--as-farbe, var(--as-ohne)); stroke-width: 4; stroke-linecap: round; opacity: 0.9; }
.as-hk-glied.as-hk-kalt { stroke: var(--as-kante); opacity: 0.55; }
.as-hk-steigt {
    fill: none;
    stroke: var(--as-glut);
    stroke-width: 1.8;
    stroke-linecap: round;
    animation: as-waerme-steigt var(--as-dauer, 1.5s) ease-out var(--as-phase, 0s) infinite;
}
@keyframes as-waerme-steigt { 0% { opacity: 0.9; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-8px); } }
.as-tl-tor { fill: none; stroke: var(--as-kante); stroke-width: 1; opacity: 0.4; }
.as-vt-balken { fill: var(--as-korpus); stroke: var(--as-kante); stroke-width: 1.5; }
.as-vt-teilung { stroke: var(--as-kante); stroke-width: 1; stroke-dasharray: 2 4; }
.as-vt-stutzen { fill: var(--as-dunkel); stroke: var(--as-kante); stroke-width: 1; }
.as-vt-titel { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--w-text-dim); }
.as-vl-pille { fill: color-mix(in srgb, #ef4444 12%, transparent); stroke: #ef4444; stroke-opacity: 0.55; stroke-width: 1.2; }
.as-vl-wert { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; fill: #f87171; }
.as-vl-welle {
    fill: none;
    stroke: #ef4444;
    stroke-width: 1.8;
    stroke-linecap: round;
    animation: as-waerme-steigt var(--as-dauer, 2.2s) ease-out var(--as-phase, 0s) infinite;
}
@media (prefers-reduced-motion: reduce) { .as-hk-steigt, .as-vl-welle { animation: none; } }

@keyframes as-brummen { from { opacity: 0.15; } to { opacity: 0.8; } }
@keyframes as-blinken { 50% { opacity: 0.15; } }
@keyframes as-flackern { from { transform: scaleY(0.85); } to { transform: scaleY(1.08); } }
@keyframes as-abgas {
    0% { opacity: 0.55; transform: translate(0, 0) scale(0.6); }
    100% { opacity: 0; transform: translate(6px, -22px) scale(1.5); }
}
@media (prefers-reduced-motion: reduce) {
    .as-tr-brumm, .as-an .as-tr-lampe, .as-an .as-bg-flamme, .as-bg-abgas, .as-an .as-wz-impuls { animation: none; }
}

.as-estrich { fill: var(--as-dunkel); stroke: var(--as-korpus); stroke-width: 1; }
.as-raster { fill: none; stroke: var(--w-panel); stroke-width: 1; }

/* Kabel: graue Spur, darüber die Punkte (Striche der Länge 0,01 mit runder Kappe). An einer Kreuzung unterbricht ein Stück in der Farbe der
   Zone das Rohr (§5.5). */
.as-kabel-spur { fill: none; stroke: var(--as-spur); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.as-kabel-fluss { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.as-kabel-fluss.as-sonne { stroke: var(--w-erzeugung); }
.as-kabel-fluss.as-bezug { stroke: var(--w-bezug); }
.as-kabel-fluss.as-einspeisung { stroke: var(--w-einspeisung); }
.as-kabel-fluss.as-laden { stroke: var(--w-laden); }
.as-kabel-fluss.as-entladen { stroke: var(--w-entladen); }
.as-kabel-fluss.as-grau { stroke: var(--w-text-dim); }
.as-kreuzung { fill: none; stroke: var(--as-zone); stroke-width: 20; }

/* Rohre: dunkler Rand, Füllung in der Farbe der Temperatur (gedämpft, solange es steht), Striche, solange Wasser fließt. */
.as-rohr-rand { fill: none; stroke: var(--as-rohrrand); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.as-rohr-fuellung {
    fill: none;
    stroke: var(--as-farbe, var(--as-ohne));
    stroke-width: 9;
    stroke-opacity: 0.28;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.as-fliesst > .as-rohr-fuellung { stroke-opacity: 0.5; }
.as-rohr-fluss { fill: none; stroke: var(--as-farbe, var(--as-ohne)); stroke-width: 4; stroke-dasharray: 11 9; stroke-linejoin: round; }
.as-schmal > .as-rohr-rand { stroke-width: 8; }
.as-schmal > .as-rohr-fuellung { stroke-width: 5; }
.as-schmal > .as-rohr-fluss { stroke-width: 3; stroke-dasharray: 8 7; }

/* Bewegung (§5.3): genau eine Periode des Musters (Kabel 160, Rohr 20, schmal 15); Dauer und Phase stehen am Element. Rückwärts gegen die
   Zeichenrichtung (Einspeisung). */
.as-lauf-160 { animation: as-lauf-160 var(--as-dauer, 4s) linear var(--as-phase, 0s) infinite; }
.as-lauf-20 { animation: as-lauf-20 var(--as-dauer, 1s) linear var(--as-phase, 0s) infinite; }
.as-lauf-15 { animation: as-lauf-15 var(--as-dauer, 1s) linear var(--as-phase, 0s) infinite; }
.as-drehen { animation: as-drehen var(--as-dauer, 3s) linear var(--as-phase, 0s) infinite; }
.as-lauf-160.as-rueckwaerts, .as-lauf-20.as-rueckwaerts, .as-lauf-15.as-rueckwaerts { animation-direction: reverse; }
@keyframes as-lauf-160 { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -160px; } }
@keyframes as-lauf-20 { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -20px; } }
@keyframes as-lauf-15 { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -15px; } }
@keyframes as-drehen { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes as-gluehen { from { opacity: 1; } to { opacity: 0.55; } }

/* Ohne Bewegung zeigt ein kleiner Pfeil an jeder fließenden Leitung die Richtung. */
.as-pfeil { display: none; fill: var(--w-text); stroke: var(--as-dunkel); stroke-width: 1; }
.as-pfeil.as-sonne { fill: var(--w-erzeugung); }
.as-pfeil.as-bezug { fill: var(--w-bezug); }
.as-pfeil.as-einspeisung { fill: var(--w-einspeisung); }
.as-pfeil.as-laden { fill: var(--w-laden); }
.as-pfeil.as-entladen { fill: var(--w-entladen); }
.as-pfeil.as-grau, .as-pfeil.as-pfeil-rohr { fill: var(--w-text); }
@media (prefers-reduced-motion: reduce) {
    .as-lauf-160, .as-lauf-20, .as-lauf-15, .as-drehen, .as-lauf-16, .as-lauf-12, .as-stab.as-an, .as-mf-led.as-mf-stoerung { animation: none; }
    .as-pfeil { display: inline; }
}

/* Modulfeld (S11, Anlagenschema.md §12.1, §12.7; Modulfeld-Mockup: Stile mf-, wr-, led, pille). Rahmen wie eine Zone, je Tracker eine Säule aus
   Modulen (Grund blau, Licht gelb nach kW/kWp, Fugen je Modul), schraffiert ohne Kanal, Rahmen und Chip bei Markierung — unter orange, über
   blau; die Grenze der Abregelung gestrichelt. Darunter die Wechselrichter mit Lampe (grün speist, orange begrenzt, rot blinkt bei Störung,
   grau schläft). Im Modulfeld laufen die Kabel nach Auslastung: DC dünn mit Periode 12, AC mit Periode 16 (as-lauf-12, as-lauf-16). */
.as-mf-rahmen { fill: var(--as-zone); stroke: var(--as-zone-kante); stroke-width: 1; }
.as-mf-titel {
    font-family: var(--w-schrift-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    fill: #cbd5e1;
}
.as-mf-titel.as-mf-gruppentitel { font-size: 12px; }
.as-mf-gruppensumme {
    font-family: var(--w-schrift-display);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    fill: var(--w-erzeugung);
}
.as-wert-klein.as-mf-erzeugung { fill: var(--w-erzeugung); }
.as-wert.as-mf-dim, .as-wert-klein.as-mf-dim, .as-mf-gruppensumme.as-mf-dim { fill: var(--w-text-dim); }
.as-mf-strahl { stroke-width: 2; }
.as-mf-mini {
    font-family: var(--w-schrift-display);
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    fill: var(--w-text);
}
.as-mf-mini.as-mf-dim { fill: var(--w-text-dim); font-weight: 500; }
.as-mf-mini.as-mf-unter { fill: #fbbf24; }
.as-mf-mini.as-mf-warntext { fill: #fca5a5; }
.as-mf-mini.as-mf-marke { font-size: 9.5px; }
.as-mf-grund { fill: #0c4a6e; stroke: #38bdf8; stroke-opacity: 0.45; stroke-width: 0.8; }
.as-mf-grund.as-mf-ohne { stroke: var(--as-spur); stroke-opacity: 1; }
.as-mf-grund.as-mf-grau { fill: #263347; stroke: var(--as-spur); stroke-opacity: 1; }
.as-mf-schraffur-grund { fill: var(--w-panel); }
.as-mf-schraffur-strich { stroke: var(--as-spur); stroke-width: 1.6; }
.as-mf-licht { fill: var(--w-erzeugung); opacity: 0.93; }
.as-mf-fuge { fill: none; stroke: #0b2235; stroke-width: 1.1; }
.as-mf-umriss { fill: none; stroke: #7dd3fc; stroke-opacity: 0.75; stroke-width: 1.2; }
.as-mf-umriss.as-mf-unter { stroke: var(--w-akzent); stroke-opacity: 1; stroke-width: 2.4; filter: drop-shadow(0 0 3px var(--w-akzent)); }
.as-mf-umriss.as-mf-ueber { stroke: #60a5fa; stroke-opacity: 1; stroke-width: 2.2; }
.as-mf-grenze { fill: none; stroke: var(--w-akzent); stroke-width: 1.6; stroke-dasharray: 3 2.4; }
.as-mf-chip rect { stroke-width: 1; }
.as-mf-chip text {
    font-family: var(--w-schrift-display);
    font-size: 9.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-anchor: middle;
}
.as-mf-chip.as-mf-unter rect { fill: #f59e0b2e; stroke: var(--w-akzent); }
.as-mf-chip.as-mf-unter text { fill: #fbbf24; }
.as-mf-chip.as-mf-ueber rect { fill: #3b82f62e; stroke: #60a5fa; }
.as-mf-chip.as-mf-ueber text { fill: #93c5fd; }
.as-kabel-spur.as-mf-dc { stroke: #3f5068; stroke-width: 2.4; }
.as-kabel-fluss.as-mf-dc { stroke-width: 4.6; }
.as-mf-korpus { fill: var(--as-korpus); stroke: var(--as-kante); stroke-width: 1.5; }
.as-mf-stoerung > .as-mf-korpus { stroke: var(--w-warn); stroke-width: 2.2; }
.as-mf-begrenzt > .as-mf-korpus { stroke: var(--w-akzent); }
.as-mf-display { fill: var(--as-dunkel); stroke: var(--as-spur); stroke-width: 0.8; }
.as-mf-led, .as-mf-led.as-mf-schlaeft, .as-mf-led.as-mf-unbekannt { fill: var(--as-spur); }
.as-mf-led.as-mf-speist { fill: var(--w-ok); filter: drop-shadow(0 0 2px var(--w-ok)); }
.as-mf-led.as-mf-begrenzt { fill: var(--w-akzent); filter: drop-shadow(0 0 2px var(--w-akzent)); }
.as-mf-led.as-mf-stoerung { fill: var(--w-warn); filter: drop-shadow(0 0 3px var(--w-warn)); animation: as-blinken 1s steps(2, jump-none) infinite; }
.as-mf-wert {
    font-family: var(--w-schrift-display);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    fill: var(--w-erzeugung);
}
.as-mf-wert.as-mf-dim { fill: var(--w-text-dim); font-size: 12.5px; font-weight: 500; }
.as-mf-wert.as-mf-warn { fill: #f87171; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.as-lauf-16 { animation: as-lauf-16 var(--as-dauer, 1s) linear var(--as-phase, 0s) infinite; }
.as-lauf-12 { animation: as-lauf-12 var(--as-dauer, 1s) linear var(--as-phase, 0s) infinite; }
@keyframes as-lauf-16 { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -16px; } }
@keyframes as-lauf-12 { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -12px; } }
@keyframes as-blinken { from { opacity: 1; } to { opacity: 0.2; } }

/* Die Pille der Abregelung am Netz (§12.2): Anteil, kW, Quelle, seit wann — bei vielen Geräten am Bus, wie viele bestätigt haben. */
.as-pille-feld { fill: #f59e0b1f; stroke: var(--w-akzent); stroke-width: 1.2; }
.as-pille-titel {
    font-family: var(--w-schrift-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    fill: #fbbf24;
}
.as-pille-wert {
    font-family: var(--w-schrift-display);
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    fill: var(--w-text);
}
.as-pille-zeile { font-size: 11.5px; font-weight: 400; fill: var(--w-text-dim); }

/* Ohne color-mix (ältere Browser) nimmt jede Temperatur ihre nächste Stufe. */
@supports not (color: color-mix(in oklch, red 50%, blue)) {
    .as-rohr-fuellung, .as-rohr-fluss { stroke: var(--as-farbe-stufe, var(--as-ohne)); }
    .as-wasser { fill: var(--as-farbe-stufe, var(--as-ohne)); }
    .as-stopp { stop-color: var(--as-farbe-stufe, var(--as-ohne)); }
    .as-hk-glied { stroke: var(--as-farbe-stufe, var(--as-ohne)); }
}

/* Die Legende unter dem Schema (HTML). */
.as-legende {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.6rem;
    margin: 0.7rem 0.3rem 0;
    color: var(--w-text-dim);
    font-size: 0.85rem;
}
.as-legende-gruppe { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; }
.as-legende-gruppe b {
    font-family: var(--w-schrift-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--w-text);
}
.as-legende-punkt { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; vertical-align: -0.02rem; margin-right: 0.25rem; }
.as-legende-punkt.as-sonne { background: var(--w-erzeugung); }
.as-legende-punkt.as-bezug { background: var(--w-bezug); }
.as-legende-punkt.as-einspeisung { background: var(--w-einspeisung); }
.as-legende-punkt.as-laden { background: var(--w-laden); }
.as-legende-punkt.as-entladen { background: var(--w-entladen); }
.as-legende-punkt.as-mf-speist { background: var(--w-ok); }
.as-legende-punkt.as-mf-begrenzt { background: var(--w-akzent); }
.as-legende-punkt.as-mf-stoerung { background: var(--w-warn); }
.as-legende-punkt.as-mf-schlaeft { background: var(--as-spur); }
.as-legende-saeule {
    display: inline-block;
    width: 0.7rem;
    height: 1rem;
    border-radius: 2px;
    vertical-align: -0.2rem;
    margin-right: 0.3rem;
    background: linear-gradient(to top, var(--w-erzeugung) 0 60%, #0c4a6e 60% 100%);
    outline: 1px solid #7dd3fc;
}
.as-legende-saeule.as-mf-unter { outline: 2px solid var(--w-akzent); }
.as-rampe { display: inline-block; width: 140px; height: 0.55rem; border-radius: 99px; vertical-align: middle; margin: 0 0.3rem; }

/* „Tracker im Vergleich" unter dem Schema (S11, Modulfeld-Mockup tabelleVergleich): je Fläche eine Gruppe, je Tracker eine Zelle mit Balken
   (kW/kWp, der Median als Strich), markierte Zellen wie ihre Säule; ab 20 Wechselrichtern zuerst nur die Auffälligen, der Rest in <details>. */
.as-vergleich { overflow-x: auto; }
.as-vg-liste { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.as-vg-liste th {
    text-align: left;
    font-family: var(--w-schrift-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--w-text-dim);
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--w-kante);
    white-space: nowrap;
}
.as-vg-liste td { padding: 0.38rem 0.5rem; border-bottom: 1px solid #33415580; vertical-align: middle; font-variant-numeric: tabular-nums; }
.as-vg-liste .as-vg-zahl { text-align: right; }
.as-vg-liste .as-vg-gruppe td {
    font-family: var(--w-schrift-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--w-text);
    background: #0f172a80;
}
.as-vg-liste small { display: block; color: var(--w-text-dim); font-size: 0.78rem; margin-top: 0.1rem; }
.as-vg-hinweis { color: var(--w-text-dim); }
.as-vg-hinweis.as-vg-warn { color: #fca5a5; }
.as-vg-hinweis.as-vg-begrenzt { color: #fbbf24; }
.as-vg-fehlt { color: var(--w-achtung); }
.as-vg-tz { white-space: nowrap; min-width: 150px; }
.as-vg-tz .as-vg-wert { font-family: var(--w-schrift-display); font-size: 0.95rem; font-weight: 600; }
.as-vg-tz .as-vg-abw { font-family: var(--w-schrift-display); font-size: 0.8rem; font-weight: 700; padding: 0 0.35rem; border-radius: 99px; margin-left: 0.2rem; }
.as-vg-tz.as-mf-unter { background: #f59e0b14; box-shadow: inset 2px 0 0 var(--w-akzent); }
.as-vg-tz.as-mf-unter .as-vg-abw { color: #fbbf24; border: 1px solid var(--w-akzent); }
.as-vg-tz.as-mf-ueber { background: #3b82f612; box-shadow: inset 2px 0 0 #60a5fa; }
.as-vg-tz.as-mf-ueber .as-vg-abw { color: #93c5fd; border: 1px solid #60a5fa; }
.as-vg-balken {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 0.55rem;
    background: var(--w-grund);
    border-radius: 99px;
    vertical-align: middle;
    margin-right: 0.45rem;
    overflow: hidden;
}
.as-vg-balken i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--w-erzeugung); border-radius: 99px; }
.as-vg-balken b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--w-text); }
.as-vg-fussnote { color: var(--w-text-dim); font-size: 0.85rem; margin: 0 0.2rem 0.5rem; }
.as-vg-fussnote b { color: var(--w-text); }
.as-vg-alle { margin-top: 0.6rem; }
.as-vg-alle summary { cursor: pointer; color: var(--w-text); font-weight: 600; margin: 0.3rem 0.2rem 0.5rem; }

/* ---- Autarkie (DA05b, Typ autarkie): zwei Balken im selben kWh-Maßstab, dazwischen das Band der selbst genutzten Energie. Die Regeln kommen
   aus der Übersicht der WebApp (dort .tile-quoten, .quote-…) — dieselben Maße, nur die Namen und die Variablen sind die der Bibliothek. ---- */
.w-autarkie { display: flex; flex-direction: column; gap: 0.15rem; }
.aut-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.aut-name { color: var(--w-text-dim); font-size: 0.86rem; }
.aut-zahl { font-family: var(--w-schrift-display); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.aut-fein { color: var(--w-text-dim); opacity: 0.85; font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.aut-bruecke { display: block; width: 100%; height: 56px; margin: 0.3rem 0; }
.aut-selbst { fill: var(--w-akzent); }
.aut-einspeisung { fill: var(--w-einspeisung); }
.aut-bezug { fill: var(--w-bezug); }
.aut-band { fill: var(--w-akzent); opacity: 0.2; }
.aut-legende { display: flex; justify-content: center; gap: 0.2rem 0.9rem; flex-wrap: wrap; margin-top: 0.35rem; color: var(--w-text-dim); font-size: 0.74rem; }
.aut-legende > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.aut-punkt { width: 0.65rem; height: 0.65rem; border-radius: 50%; flex: none; }
.aut-punkt.aut-selbst { background: var(--w-akzent); }
.aut-punkt.aut-einspeisung { background: var(--w-einspeisung); }
.aut-punkt.aut-bezug { background: var(--w-bezug); }
/* Im Dashboard steht die Brücke mittig in ihrer Fläche. */
.w-inhalt > .w-autarkie { height: 100%; justify-content: center; }

/* ---- Gerätekachel (DA05b, Typ geraet) — die Regeln kommen aus der Übersicht der WebApp (dort .device-…, .status-ecke, .progress, .karte-…).
   Die Kachel selbst (Fläche, Rand) gehört dem Gastgeber: im Dashboard der Rahmen des Widgets, auf der Übersicht die Kachel der Seite. ---- */
/* align-self: die Kachel füllt die Höhe ihres Gastgebers — nur so steht das Bild (unten ausgerichtet) auf dem Kachelboden, auch wenn die
   Nachbarkachel der Zeile höher ist, und gerät nie unter die Statusfahne. */
.w-geraet { display: flex; align-items: flex-start; align-self: stretch; gap: 0.6rem; flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }
.gk-inhalt { flex: 1 1 auto; min-width: 0; }
.gk-name { font-weight: 600; padding-right: 2.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-leistung { font-family: var(--w-schrift-display); font-size: var(--fs-zahl, 1.625rem); font-weight: 600; font-variant-numeric: tabular-nums; margin: 0.2rem 0; }
.gk-leistung .gk-einheit { font-size: 0.9rem; font-weight: 500; color: var(--w-text-dim); margin-left: 0.3rem; }
.gk-fein { color: var(--w-text-dim); opacity: 0.75; font-size: 0.76rem; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.gk-fein-warn { color: #fca5a5; opacity: 1; }
.gk-lage { display: flex; align-items: center; gap: .4rem; font-size: var(--fs-klein, 0.875rem); color: var(--w-text-dim); margin-top: .25rem; }
.gk-lagepunkt { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; flex: none; background: var(--w-kante); }
.gk-lage .gk-lagepunkt { width: .6rem; height: .6rem; }
.gk-lage-sonne { background: var(--w-ok); }
.gk-lage-netz { background: var(--nap, #38bdf8); }
.gk-lage-wartet { background: var(--w-achtung); }
.gk-lage-aus, .gk-lage-unbekannt { background: var(--w-text-dim); }
.gk-lage-unbekannt { opacity: .45; }
.gk-lage-rot { background: var(--w-warn); }
.gk-status {
    position: absolute;
    top: 0;
    right: 0;
    width: 38px;
    height: 38px;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1px 6px 0 0;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: default;
}
.gk-status-gruen { background: var(--w-ok); }
.gk-status-gelb  { background: var(--w-achtung); color: #422006; }
.gk-status-rot   { background: var(--w-warn); }
.gk-last { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; }
.gk-balken { flex: 1 1 auto; height: 5px; background: var(--w-kante); border-radius: 999px; overflow: hidden; margin: 0; }
.gk-fuellung { height: 100%; background: var(--w-akzent); }
.gk-last-wert { color: var(--w-text-dim); font-size: 0.76rem; font-variant-numeric: tabular-nums; min-width: 2.6rem; text-align: right; }
.gk-zweiseitig { position: relative; height: 7px; }
.gk-zweiseitig .gk-fuellung { border-radius: 0; }
.gk-null { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--w-text-dim); z-index: 1; }
.gk-heute { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin-top: 0.45rem; }
.gk-heute > div { display: flex; flex-direction: column; }
.gk-heute-wert { font-family: var(--w-schrift-display); font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gk-heute-name { color: var(--w-text-dim); font-size: 0.72rem; white-space: nowrap; }
.gk-bild { flex: none; width: 46px; height: 62px; align-self: flex-end; opacity: 0.9; display: flex; align-items: flex-end; justify-content: center; }
.gk-symbol { color: var(--w-text-dim); }
.gk-zeichnung { width: 52px; height: 70px; }
.gk-silhouette .w-geraetbild { width: 46px; height: 62px; }
.gk-symbol .w-geraetesymbol { width: 34px; height: 34px; }
/* Im Dashboard: die Statusfahne sitzt in der Ecke des Rahmens (nicht der Fläche darin), eine veraltete Kachel ist als Ganzes gedämpft. */
.w-typ-geraet { overflow: hidden; }
.w-typ-geraet .w-inhalt { container-type: normal; position: static; display: flex; }
.w-typ-geraet:has(.gk-veraltet) { border-color: var(--w-warn); opacity: 0.75; }
.w-typ-geraet:has(a.w-geraet):hover { border-color: var(--w-text-dim); }

/* ---- Bilder der Geräte ohne Live-Zustand (DA05b, vorher in der WebApp): die Silhouette der Bauform und das Symbol der Geräteart. Sie stehen
   auch außerhalb eines Bausteins (Menü, Datenblatt) — deshalb die Tokens des Gastgebers mit ihrem Wert dahinter statt der Variablen --w-…. ---- */
.w-geraetbild .korpus { fill: #475569; }
.w-geraetbild .rippe { stroke: #64748b; stroke-width: 2; }
.w-geraetbild .rippe-flaeche { fill: #64748b; }
.w-geraetbild .display { fill: var(--bg, #0f172a); }
.w-geraetbild .lampe { fill: var(--ok, #10b981); }
.w-geraetbild .sockel { fill: var(--panel-edge, #334155); }
.w-geraetbild .kabel { stroke: #64748b; stroke-width: 2.5; stroke-linecap: round; }
.w-geraetesymbol { width: 1.05rem; height: 1.05rem; flex: none; }
.w-symbol-erzeugung { color: var(--f-erzeugung, #facc15); }
.w-symbol-speicher { color: var(--f-entladen, #fb923c); }
.w-symbol-netz { color: var(--text, #e2e8f0); }
.w-symbol-verbrauch { color: var(--f-verbrauch, #38bdf8); }
.w-symbol-mess { color: var(--text-dim, #94a3b8); }
