/* =================================================================
   Energietracker v1.0.0 — Components
   ================================================================= */

/* ── Grafiken (lib/icons.js) ────────────────────────────────────────
   Kontur --ico, getönte Fläche --ico-f; die Verbrauchsarten färbt --c aus der
   SSOT (utility-theme.js setzt .art-<key>). */
.ico {
  width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px;
  fill: none; stroke: var(--ico, var(--ill-line)); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.ico--16 { width: 16px; height: 16px; }
.ico--20 { width: 20px; height: 20px; }
.ico--22 { width: 22px; height: 22px; }
.ico--24 { width: 24px; height: 24px; }
.ico--48 { width: 48px; height: 48px; stroke-width: 1.25; }
.f { fill: var(--ico-f, var(--ill-fill)); stroke: none; }
.ico--art { --ico: var(--c, var(--ill-line)); --ico-f: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); }
.ico-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico-eigen { font-size: var(--fs-lg); line-height: 1; }

/* ── Knöpfe: Haupt, normal, zurückhaltend; 36 und 30 px; kein Schatten ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1h);
  min-height: 36px; padding: var(--sp-1h) var(--sp-3);
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: var(--fs-body); font-weight: 500;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; line-height: 1.2;
  /* v3.12.0 (Sichtung S6) — Knopf nur mit Grafik hat keine Grundlinie: Ohne das stand er versetzt neben dem Nachbarn */
  vertical-align: middle;
}
.btn:hover  { background: var(--bg-2); border-color: var(--border-strong); color: var(--text-1); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* v3.12.0 (Sichtung S11) — Knopf einer Verbrauchsart in ihrer Farbe aus der SSOT (`data-utility` setzt --util, lib/utility-theme.js);
   der Name steht im Knopf, die Farbe ist nicht das einzige Zeichen */
.btn--art {
  background: var(--util-soft); border-color: color-mix(in srgb, var(--util) 40%, transparent);
  color: color-mix(in srgb, var(--util) 70%, var(--text-1));
}
.btn--art:hover { background: var(--util); border-color: var(--util); color: var(--util-fg); }
.btn .ico { width: 16px; height: 16px; }

/* v2.11.0 (Review UI-09) — Schrift auf Akzent- und Warnfläche aus den Tokens:
   im Hellmodus weiß (5,2:1), im Dunkelmodus dunkel (5,9:1). Rot mit weißer
   Schrift auf --danger-strong (4,8:1). */
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); --ico: currentColor; --ico-f: transparent; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.infobox:empty { display: none; }
.btn--danger  { background: var(--danger-strong); border-color: var(--danger-strong); color: var(--on-danger); --ico: currentColor; --ico-f: transparent; }
.btn--danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); color: var(--on-danger); }
/* Entfernen-Kreuz einer Zeile und Löschen auf Karten: Umriss statt roter Vollfläche (Review UI-20) */
.btn--danger.btn--icon, .btn--danger.btn--quiet { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); --ico: currentColor; }
.btn--danger.btn--icon:hover, .btn--danger.btn--quiet:hover { background: var(--danger-strong); border-color: var(--danger-strong); color: var(--on-danger); }
.btn--ghost   { background: transparent; border-color: var(--border-2); }
.btn--ghost:hover { background: var(--bg-2); }
.btn--sm { min-height: 30px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.btn--icon { padding: var(--sp-1h) var(--sp-2); }

/* ── Abzeichen: eine Form, Farbe nur als Zustand ──────────────────── */
.tag, .badge, .status-pill, .chip {
  display: inline-block; padding: var(--sp-0) var(--sp-2);
  border: 1px solid var(--border-1); border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 500; line-height: 1.5;
  background: var(--bg-2); color: var(--text-2);
  white-space: nowrap;
}
.tag .ico, .badge .ico, .status-pill .ico, .chip .ico { width: 14px; height: 14px; vertical-align: -2px; --ico: currentColor; --ico-f: transparent; }
.badge { margin-left: var(--sp-2); vertical-align: 1px; }
.tag--success, .badge--success, .status-pill.active { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.tag--warning, .badge--warning, .status-pill.suspect, .status-pill.implausible { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.tag--danger, .badge--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.badge--info, .status-pill.future { background: var(--c-blue-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--c-blue-text); }
/* v3.13.0 — die Farbe der Verbrauchsart tragen Tönung und Rand; die Schrift in --text-1 (in der Farbe der Art lag
   sie auf der eigenen Tönung bei 3,8 bis 4,5:1, tests/contrast.test.mjs) */
.tag--util { background: var(--util-soft, var(--bg-2)); border-color: color-mix(in srgb, var(--util, var(--text-2)) 40%, transparent); color: var(--text-1); }
/* v2.2.0 — Schattenvertrag: hypothetisch, zählt in keiner Kostenrechnung mit. v3.13.0 — Schrift im Schriftton (4,5:1 auf jeder Fläche) */
.badge--shadow, .status-pill.shadow { background: var(--c-violet-soft); border-color: transparent; color: var(--c-violet-text); }
.status-pill.past { background: var(--bg-2); color: var(--text-2); }
.status-pill.suspect, .status-pill.implausible { cursor: help; }

/* ── Infobox: fünf Töne, eine Form, immer mit Grafik ──────────────────
   Die Grafik ist eine Maske in der Farbe des Tons (tokens.css), sie braucht kein
   Markup: Der Text steht frei in der Box, auch wenn eine Ansicht nur textContent setzt. */
.infobox {
  --tone: var(--ton-neutral); --tone-mask: var(--mask-neutral);
  position: relative;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) calc(var(--sp-4) + 20px + var(--sp-3));
  font-size: var(--fs-body); line-height: 1.5; color: var(--text-1);
  background: color-mix(in srgb, var(--tone) 7%, var(--bg-1));
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border-1));
  border-radius: var(--r-md);
  max-width: 100%;
}
/* v3.12.0 (Sichtung S3) — die Box füllt ihren Behälter wie alle anderen in derselben Karte, die Zeile bleibt lesbar */
p.infobox { padding-right: max(var(--sp-4), calc(100% - 72ch - var(--sp-4) - 20px - var(--sp-3))); }
.infobox::before {
  content: ''; position: absolute; left: var(--sp-4); top: calc(var(--sp-3) + 1px);
  width: 20px; height: 20px; background: var(--tone);
  -webkit-mask: var(--tone-mask) center / contain no-repeat;
  mask: var(--tone-mask) center / contain no-repeat;
}
.infobox--info    { --tone: var(--ton-info);    --tone-mask: var(--mask-info); }
.infobox--erfolg  { --tone: var(--ton-erfolg);  --tone-mask: var(--mask-erfolg); }
.infobox--achtung { --tone: var(--ton-achtung); --tone-mask: var(--mask-achtung); }
.infobox--fehler  { --tone: var(--ton-fehler);  --tone-mask: var(--mask-fehler); }
.infobox--neutral { --tone: var(--ton-neutral); --tone-mask: var(--mask-neutral); }
.infobox > p { margin: 0 0 var(--sp-2); }
.infobox > p:last-child { margin-bottom: 0; }
.infobox a:not(.btn) { color: inherit; font-weight: 600; text-decoration: underline; }
.infobox > .btn { margin-top: var(--sp-2); }
/* Text und Aktion in einer Zeile; schmal steht die Aktion darunter */
.infobox--zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); }
.infobox--zeile > .btn { margin-top: 0; }
.infobox__text { flex: 1 1 18rem; min-width: 0; max-width: 72ch; }
.infobox__text > p { margin: 0 0 var(--sp-1); }
.infobox__text > p:last-child { margin-bottom: 0; }
.infobox__aktion { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1h); }
.infobox__liste { margin: var(--sp-1h) 0 0; padding-left: 1.2em; font-size: var(--fs-sm); }
.infobox__liste li { margin: var(--sp-1) 0; overflow-wrap: anywhere; }
/* Über dem Inhalt schwebend (Neuigkeiten einer Version) */
.infobox--schwebend {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--tabbar-h, 0px) + env(safe-area-inset-bottom, 0px) + var(--sp-3));
  width: min(36rem, calc(100% - 2 * var(--sp-3))); margin: 0;
  box-shadow: var(--shadow-2);
}
/* Fußnote unter einem Bild: kein Kasten */
.fussnote { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--text-2); max-width: 72ch; }

/* ── Forms ──────────────────────────────────────────────────────── */
/* v3.4.0 (N1021) — Steuerhöhe an einer Stelle: 36 px mit Maus, 44 px bei
   Touch (Apple HIG). Eingaben, Auswahlfelder und die Knöpfe einer
   Formularzeile sind damit gleich hoch; bis v3.3 waren Textfelder 34 px,
   Datumsfelder 36 px und „Ab Beginn" 24 px hoch. */
:root { --control-h: 36px; }
@media (pointer: coarse), (max-width: 899.98px) { :root { --control-h: 44px; } }

/* v3.4.0 (N1021) — `hidden` gilt immer, auch gegen display:flex/grid einer
   Klasse. In „Angebot erfassen" standen die Felder für dynamische Tarife
   trotz `hidden` neben dem Arbeitspreis, weil `.form-grid label{display:flex}`
   gewann. Ersetzt sieben Einzelregeln der Art `.x[hidden]{display:none}`. */
[hidden] { display: none !important; }

.field { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-3); min-width: 0; }
/* v3.4.0 (N1021) — Versalien nur für die Beschriftung direkt über einem Feld.
   Bis v3.3 traf `.field label` jedes Label, auch die Texte neben Checkboxen
   („BALKONKRAFTWERK …") und Datei-Knöpfe; neun Stellen flickten das inline. */
.field > label:not(.btn, .check, .settings-field__check), .label {
  font-size: var(--fs-body); font-weight: 500; color: var(--text-1);
  /* v3.12.0 (M5) — lange Fachwörter („Volumeherleidingsfactor“) in schmalen Feldern trennen */
  overflow-wrap: anywhere; hyphens: auto;
}
/* Checkbox und Radio mit Text: Satzschreibung, Text neben dem Kästchen */
.check, .settings-field__check {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 400;
  color: var(--text-1);
  cursor: pointer;
}
.check > input, .settings-field__check > input { flex: none; margin: 0; }
.settings-field__check { padding: var(--sp-1h) 0; }
/* ohne Klasse: Label mit Kästchen als direktes Kind eines Feldes (Rückfall) */
.field > label:has(> input[type="checkbox"]), .field > label:has(> input[type="radio"]) {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--text-1);
}

.input, .select, textarea.input {
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: var(--sp-1h) var(--sp-3); font-family: var(--font-sans); font-size: var(--fs-body);
  width: 100%;
  min-height: var(--control-h);
  transition: var(--transition);
}
/* v3.5.1 — Safari (iPad, iPhone): Datums- und Zeitfelder bringen eine eigene
   Mindestbreite mit, ignorieren width: 100% und ragten in die Nachbarspalte
   („Rechnung prüfen“). Ohne Eigendarstellung folgen sie dem Raster; die
   Auswahl öffnet weiter der Systemdialog. */
.input[type="date"], .input[type="month"], .input[type="time"], .input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%;
}
.input::-webkit-date-and-time-value { min-width: 0; margin: 0; text-align: start; }
/* v3.6.0 — Safari (iPad): Auswahlfelder behielten ihre Systemdarstellung —
   26 px hoch neben 44 px hohen Eingaben, Höhe und Innenabstand ignoriert;
   Textfelder trugen Safaris Innenschatten. Ohne Eigendarstellung folgen beide
   dem Raster (--control-h). Der Pfeil kommt aus zwei Verläufen in der
   Textfarbe des Themes (kein Bild, kein Platzhalter für Canvas). Auswahl in
   der Textschrift: Mono nur für Zahlen. */
.input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"]) {
  -webkit-appearance: none; appearance: none;
}
.select:not([multiple]):not([size]) {   /* (0,3,0): gewinnt gegen `background:` in .fgroup */
  -webkit-appearance: none; appearance: none;
  font-family: var(--font-sans);
  padding-right: var(--sp-8);
  /* Pfeil als Maske wäre für ein Eingabefeld zu viel: zwei Dreiecke in der Textfarbe des Themas */
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
                    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.input.invalid, .select.invalid { border-color: var(--danger); }
.input.invalid:focus { outline: 2px solid var(--danger); outline-offset: 1px; }

.input--text { font-family: var(--font-sans); }
/* v3.10.0 — Zertifikat im PEM-Format: feste Breite, kleiner */
.input--mono { font-family: var(--font-code); font-size: var(--fs-xs); }

textarea.input { min-height: 80px; resize: vertical; }
.input[type="checkbox"], .input[type="radio"] { width: auto; min-height: 0; }

.field-error { font-size: var(--fs-sm); color: var(--ton-fehler); margin-top: var(--sp-0); }
/* v3.13.0 (Paket F) — Zähler unter langen Feldern (lib/text-limits.js), ab 80 % der Grenze */
.char-count { display: block; font-size: var(--fs-sm); color: var(--text-2); margin-top: var(--sp-0); text-align: right; }
.char-count--over { color: var(--ton-fehler); }

/* Ältere Zeile mit gleich breiten Spalten (Zeitreihen-Import, Auswertungen) */
.form-row {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.form-actions {
  display: flex; gap: var(--sp-2); justify-content: flex-end;
  margin-top: var(--sp-5); flex-wrap: wrap;
}

/* ── v3.4.0 (N1021) — ein Formularraster für alle Dialoge ──────────────
   Bis v3.3 lagen in einem Vertragsdialog fünf Spaltensysteme übereinander
   (`.form-row` je nach Feldzahl, Preis-, Bonus-, Sonderzahlungs- und
   Zeitfensterzeilen), dazu `.form-grid` in Termin und Angebot. Jetzt:
   sechs Spalten, die Breite eines Feldes nach seinem Inhalt —
     .field--xs  1 Spalte  (Stellen, Einheit)
     .field--s   2 Spalten (Datum, Zahl, Betrag, Uhrzeit)
     .field--m   2 Spalten, schmal ganze Zeile (kurzer Text, Auswahl)
     .field      3 Spalten (Text, Auswahl mit langem Text)
     .field--l   4 Spalten
     .field--full ganze Zeile (Notiz, Checkbox mit Erklärung, Listen)
   Schmal (unter 34 rem Rasterbreite, am iPhone) zwei Spalten: Datum und Zahl
   je eine halbe Zeile, alles andere die ganze. Das Raster richtet sich nach
   seiner eigenen Breite (Container-Abfrage), nicht nach dem Fenster — im
   Dialog wie in einer schmalen Einstellungskarte. */
.fgrid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--sp-3); row-gap: 0; align-items: start;
  container-type: inline-size;
}
/* Abstand nach unten statt `row-gap`: mit Unterraster (unten) kostete jede
   leere Teilzeile eines Feldes sonst einen ganzen Zeilenabstand */
.fgrid > * { grid-column: 1 / -1; min-width: 0; margin: 0 0 var(--sp-4); }
/* Breite als Ende (`auto / span n`), damit `.field--new` nur den Anfang setzt */
.fgrid > .field { grid-column: auto / span 3; }
.fgrid > .field--xs { grid-column: auto / span 1; }
.fgrid > .field--s, .fgrid > .field--m { grid-column: auto / span 2; }
.fgrid > .field--l { grid-column: auto / span 4; }
.fgrid > .field--full { grid-column: 1 / -1; }
.fgrid > .field--new { grid-column-start: 1; }   /* beginnt eine neue Zeile */
@media (max-width: 600px) {   /* Rückfall ohne Container-Abfrage */
  .fgrid > .field, .fgrid > .field--m, .fgrid > .field--l { grid-column: 1 / -1; }
  .fgrid > .field--s, .fgrid > .field--xs { grid-column: auto / span 3; }
  .fgrid > .field--new { grid-column-start: 1; }
}
@container (max-width: 34rem) {
  .fgrid > .field, .fgrid > .field--m, .fgrid > .field--l { grid-column: 1 / -1; }
  .fgrid > .field--s, .fgrid > .field--xs { grid-column: auto / span 3; }
  .fgrid > .field--new { grid-column-start: 1; }
}
/* Datumsfelder haben eine eigene Mindestbreite und liefen sonst aus der Spalte */
.fgrid .input, .fgrid .select, .rowlist .input, .rowlist .select { min-width: 0; }
/* Beschriftung, Feld und Hinweis einer Zeile auf gleicher Höhe: Jedes Feld
   teilt die Zeilen des Rasters (Unterraster). Bricht eine Beschriftung um,
   rückt das Feld daneben nicht mehr nach oben. Ohne Unterraster (Safari < 16)
   bleibt das Feld eine Spalte — benutzbar, nur nicht ausgerichtet. */
@supports (grid-template-rows: subgrid) {
  .fgrid > .field { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 4; row-gap: var(--sp-1); align-content: start; }
  .fgrid > .field > :first-child { grid-row: 1; align-self: end; }
}
/* Feld ohne Beschriftung (Checkbox, Knopf): auf Höhe der Eingaben daneben.
   Ersetzt das Muster `style="display:flex;align-items:flex-end"`, das den
   Knopf waagerecht statt senkrecht ausrichtete (✕ schwebte über der Zeile). */
.fgrid > .field > :first-child:is(.check, .btn, .field__actions) { grid-row: 1 / span 2; align-self: end; }
.field__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.fgrid > .field > .check:first-child { min-height: var(--control-h); }
.fgrid > .field > .btn:first-child { justify-self: start; justify-content: center; }
.fgrid .btn, .rowlist .btn { min-height: var(--control-h); }

/* Feldgruppe: eigener Kasten, die Legende steht im Kasten (nicht auf der
   Rahmenlinie wie beim Browser-Standard). Rechts im Kopf darf ein Knopf
   stehen („+ Zeile"); er bricht nicht um. */
fieldset.fgroup, .fgroup {
  border: 1px solid var(--border-1); border-radius: var(--r-md);
  background: var(--bg-2);
  padding: var(--sp-4); margin: 0 0 var(--sp-4); min-inline-size: 0;
}
.fgroup > legend, .fgroup__title {
  font-size: var(--fs-sm); color: var(--text-2);
}
.fgroup > legend {
  float: left; max-width: 100%; padding: 0; margin: 0 var(--sp-3) var(--sp-3) 0;
  line-height: 1.4; min-height: 28px; display: flex; align-items: center; gap: var(--sp-1);
}
.fgroup > .fgroup__add { float: right; flex: none; white-space: nowrap; margin: 0 0 var(--sp-3); }
.fgroup > :not(legend, .fgroup__add) { clear: both; }
.fgroup > :last-child { margin-bottom: 0; }
/* der Abstand unter der letzten Rasterzeile gehört nicht in den Kasten */
.fgroup > .fgrid:last-child, form > .fgrid:last-child { margin-bottom: calc(-1 * var(--sp-4)); }
.fgroup__hint { margin: 0 0 var(--sp-3); font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; }
.fgroup > .field-error { margin: 0 0 var(--sp-2); }
/* Felder in einer Gruppe mit eigener Fläche — auch im Dunkelmodus vom
   Gruppenkasten zu unterscheiden (bis v3.3 beide --bg-2) */
.fgroup :is(.input, .select) { background: var(--bg-1); }

/* Zeilenlisten (Preise, Boni, Sonderzahlungen, Zeitfenster, Umlagen …): ein
   Raster für alle — Datum 10,5 rem | Betrag 9 rem | Zusatz | ✕. Andere
   Spaltenfolgen setzen --row-cols. Die Beschriftung steht nur über der
   ersten Zeile; in den folgenden bleibt sie für Screenreader (sr-only). */
.rowlist { container-type: inline-size; display: flex; flex-direction: column; gap: var(--sp-2); }
.rowlist__row {
  display: grid; gap: var(--sp-2); align-items: end;
  grid-template-columns: var(--row-cols, 10.5rem 9rem minmax(0, 1fr) auto);
}
.rowlist__row > .field { margin: 0; }
.rowlist__row > .btn { justify-self: start; }
.rowlist__row > .rowlist__del { grid-column: -2 / -1; grid-row: 1; justify-self: end; }
.rowlist__row .btn--icon { min-width: var(--control-h); justify-content: center; }
.rowlist__row > .rowlist__sub { grid-column: 1 / -2; }
/* v3.11.0 (F1035, Paket vertrag) — unter einer Preiszeile: „Schreiben vom“ und Steuersatz, immer beschriftet */
.entry-origin { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; font-size: var(--fs-sm); }
.entry-origin__field { display: inline-flex; align-items: center; gap: var(--sp-1); }
.entry-origin__field > .input { width: auto; min-width: 0; }
.entry-origin__field > .input[data-role="vat-pct"] { width: 5rem; }
.rowlist__row + .rowlist__row > .field:not(.rowlist__sub) > :is(label, .label) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.rowlist--period { --row-cols: 10.5rem 10.5rem 9rem minmax(0, 1fr) auto; }
.rowlist--tou    { --row-cols: 7.5rem 7.5rem 8rem minmax(0, 1fr) auto; }
.rowlist--label  { --row-cols: minmax(0, 1fr) 9rem auto; }
/* v3.11.0 (Paket rechnung) — Posten einer Rechnung: Bezeichnung | Betrag | Art | netto/brutto | Satz | ✕ */
.rowlist--item   { --row-cols: minmax(0, 1fr) 8rem 10rem 8rem 6.5rem auto; }
.rowlist--three  { --row-cols: 10.5rem 9rem 9rem minmax(0, 1fr) auto; }
.rowlist--four   { --row-cols: 10.5rem 8rem 8rem 8rem minmax(0, 1fr) auto; }
.rowlist--pos    { --row-cols: minmax(0, 1fr) 10rem 8rem 8rem auto; }
.rowlist--fixed  { --row-cols: 10.5rem minmax(0, 1fr) 9rem auto; }
/* Schmal (iPhone): zwei Spalten — die ersten beiden Angaben stehen unter der
   Beschriftung der ersten Zeile, jede weitere Angabe trägt ihre eigene; ✕
   rechts in der letzten Zeile (bei der Sonderzahlung neben der Art) */
@container (max-width: 34rem) {
  .rowlist__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rowlist__row > .rowlist__del { grid-column: 2; grid-row: auto; }
  .rowlist__row > .rowlist__sub { grid-column: 1 / -1; }
  .special-row > .rowlist__del { grid-row: 2; }
  .rowlist__row + .rowlist__row { border-top: 1px dashed var(--border-1); padding-top: var(--sp-2); }
  .rowlist__row + .rowlist__row > .field:nth-child(n+3) > :is(label, .label) {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal;
  }
}
@media (max-width: 600px) {   /* Rückfall ohne Container-Abfrage */
  .rowlist__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rowlist__row > .rowlist__del { grid-column: 2; grid-row: auto; }
  .rowlist__row > .rowlist__sub { grid-column: 1 / -1; }
  .special-row > .rowlist__del { grid-row: 2; }
}
/* Sonderzahlung: Notiz und — nur bei Arten „mit Auswirkung" — die
   Abschlagsanpassung unter der Zeile, immer beschriftet */
.special-row { padding-bottom: var(--sp-2); border-bottom: 1px dashed var(--border-1); }
.special-advance { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 12rem)); }
.special-advance > .field { margin: 0; }

/* Liste innerhalb einer Gruppe (Preise je Zähler einer Gruppe) */
.entry-group--nested { margin: var(--sp-3) 0 0; }
.entry-group__head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.entry-group__head > .btn { flex: none; white-space: nowrap; }
/* v2.7.0 — Umrechnungshilfe „Preis je m³" unter den Gas-Arbeitspreisen */
.perm3 { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.perm3 > summary { cursor: pointer; color: var(--text-2); }
.perm3 > .fgrid { margin-top: var(--sp-2); }
.perm3__result { margin: var(--sp-1) 0 0; font-variant-numeric: tabular-nums; }
/* Uhrzeit, Quartale (§ 14a Modul 3) */
.tou-quarters { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); min-height: var(--control-h); align-items: center; }
/* Zweistellige Eingabe in einem breiten Feld (Stellen des Zählwerks) */
.input--short { max-width: 8rem; }
.fgroup__list { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); }
.fgroup__list p { margin: 0; }
/* Wasservertrag: Zeilen als Tabelle mit Eingaben — feste Spalten, damit sie
   am iPhone nicht über den Dialog hinauslaufen */
.water-table { table-layout: fixed; width: 100%; }
.water-table th, .water-table td { padding: var(--sp-1); }
.water-table .input { min-width: 0; padding-inline: var(--sp-1h); }
.water-table th:last-child, .water-table td:last-child { width: calc(var(--control-h) + 8px); }
/* Kästchen untereinander in einem Feld (Wärmepumpe, Mietverhältnis), bei Platz in Spalten */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: 0 var(--sp-3); }
.check-grid > .check { min-height: 32px; }
.check-scroll { max-height: 14rem; overflow-y: auto; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-body);
}
.table th, .table td {
  padding: var(--sp-2) var(--sp-3); text-align: left;
  border-bottom: 1px solid var(--border-1);
}
.table thead th {
  background: var(--bg-1);
  color: var(--text-2); font-weight: 600; font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-2);
  position: sticky; top: 0;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-2); }
/* v2.0.0 (UX) — Zeilen-Hover auch für .data-table (Erinnerungen, Tarif,
   Settings-Export), damit alle Tabellen gleich auf Mausführung reagieren. */
.data-table tbody tr:hover { background: var(--bg-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-actions { display: flex; gap: var(--sp-1); justify-content: flex-end; }
/* v2.5.3 (UI-01) — position: relative, damit der Rahmen auch absolut
   positionierte Kinder beschneidet: Das .sr-only-Label „Aktionen" im
   Tabellenkopf entkam sonst dem Scrollbereich und verbreiterte die Seite. */
.table-wrap {
  position: relative;
  overflow-x: auto; border: 1px solid var(--border-1);
  border-radius: var(--r-md); background: var(--bg-1);
}
/* v3.13.0 (Paket K2e) — Spalte der Zeilenaktionen: ab 900 px am rechten Rand des Rahmens angeheftet. Wischt eine breite
   Tabelle in ihrem Rahmen quer, bleiben die Knöpfe sichtbar (bis v3.12 lagen „Rechnung erfassen“ und „Ansehen“ der
   früheren Verträge zwischen 900 und 1280 px außerhalb). Prüfung: tests/box-raster.test.mjs (Tabellenrahmen). */
@media (min-width: 900px) {
  .table .spalte-aktionen, .data-table .spalte-aktionen { position: sticky; right: 0; z-index: 1; background: var(--bg-1); border-left: 1px solid var(--border-1); text-align: right; white-space: nowrap; }
  .table tbody tr:hover > .spalte-aktionen, .data-table tbody tr:hover > .spalte-aktionen { background: var(--bg-2); }
}
/* Kopierbare Konfiguration (Home Assistant): scrollt in sich, statt die
   Seite zu verbreitern. */
.code-block {
  position: relative; max-width: 100%; overflow-x: auto;
  margin: 0 0 var(--sp-2); padding: var(--sp-3);
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-md);
  font-family: var(--font-code); font-size: var(--fs-xs); line-height: 1.5;
}


/* ── Modals ─────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--bg-overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: var(--sp-4); animation: fadeIn 120ms ease-out;
}
/* v2.11.0 (Review UI-16) — Kopf und Fußleiste bleiben stehen, nur der
   Inhalt scrollt: „Speichern" lag bei langen Formularen erst ganz unten. */
.modal {
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  width: min(720px, 100%);
  max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-3);
  animation: slideUp 160ms ease-out;
}
.modal--sm { width: min(440px, 100%); }
.modal--lg { width: min(960px, 100%); }
.modal__head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-1);
  display: flex; justify-content: space-between; align-items: center;
}
/* v3.7.0 (Qualität) — Titel ist eine <h2> (Überschriften-Navigation der
   Bildschirmleser); der Dialog selbst nimmt den Fokus nur als Rückfall an,
   ohne Rahmen um die ganze Fläche. */
.modal__title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.modal:focus { outline: none; }
.modal__close { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; background: transparent; border: none; border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-lg); cursor: pointer; }
.modal__close:hover { background: var(--bg-2); color: var(--text-1); }
.modal__body { padding: var(--sp-5); overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.modal__head, .modal__foot { flex: none; }
.modal__foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-1);
  /* v3.9.0 — Text neben den Knöpfen (etwa „Schritt 2 von 5“) mittig, nicht oben */
  display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-2);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── Toast stack ────────────────────────────────────────────────── */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: var(--sp-2);
  z-index: 200; max-width: 380px;
}
/* v2.6.0 — Bei offenem Dialog oben: Unten rechts lag eine Fehlermeldung
   genau über „Speichern" und fing die Klicks ab, bis sie verschwand. */
body:has(.modal-backdrop) .toast-stack { bottom: auto; top: 20px; }
@media (max-width: 899.98px) {
  /* über der Tab-Leiste (v2.11.0) */
  .toast-stack { left: 12px; right: 12px; bottom: calc(12px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); max-width: none; }
  body:has(.modal-backdrop) .toast-stack { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); }
}
/* Gleiche Form und Töne wie die Infobox, dazu der Schatten eines schwebenden Hinweises */
.toast {
  --tone: var(--ton-info); --tone-mask: var(--mask-info);
  display: flex; align-items: flex-start; gap: var(--sp-3);
  background: color-mix(in srgb, var(--tone) 7%, var(--bg-1));
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border-1));
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-body); box-shadow: var(--shadow-2);
  animation: slideIn 160ms ease-out;
}
.toast::before {
  content: ''; flex: none; width: 20px; height: 20px; background: var(--tone);
  -webkit-mask: var(--tone-mask) center / contain no-repeat;
  mask: var(--tone-mask) center / contain no-repeat;
}
.toast--success { --tone: var(--ton-erfolg);  --tone-mask: var(--mask-erfolg); }
.toast--warning { --tone: var(--ton-achtung); --tone-mask: var(--mask-achtung); }
.toast--error   { --tone: var(--ton-fehler);  --tone-mask: var(--mask-fehler); }
/* v2.2.0 — Schließen-Knopf: eine Meldung verschwand nach wenigen Sekunden
   unwiderruflich (WCAG 2.2.1). */
.toast__msg { flex: 1; min-width: 0; }
.toast__close {
  flex: none; background: transparent; border: none;
  line-height: 0; padding: var(--sp-0); cursor: pointer; border-radius: var(--r-sm);
}
.toast__close:hover { background: var(--bg-2); }
.toast__close:hover { color: var(--text-1); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Chart container ────────────────────────────────────────────── */
.chart-wrap {
  position: relative; height: 360px; width: 100%;
}
.chart-wrap.tall   { height: 480px; }
.chart-wrap.short  { height: 220px; }

/* v2.15.0 (Review FE-20) — die Zahlen hinter einem Diagramm, aufklappbar;
   die Zeile ist am iPhone 44 px hoch antippbar */
.chart-data { margin-top: var(--sp-2); }
.chart-data > summary {
  cursor: pointer; color: var(--text-2); font-size: var(--fs-sm);
  min-height: 44px; display: flex; align-items: center;
}
.chart-data > summary:hover { color: var(--text-1); }
.chart-data .table-wrap { max-height: 360px; overflow: auto; }
/* v2.15.0 (Review FE-08) — Teilmonate */
.table tr.is-partial td { color: var(--text-2); }
.dash-window { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); font-size: var(--fs-xs); color: var(--text-2); }
/* v2.16.0 (Review FE-17) — Mini-Verlauf je Karte der Übersicht */
.dash-spark { position: relative; height: 64px; margin-top: var(--sp-3); }
/* ── Device chain / meter card ─────────────────────────────────── */
.meter-card {
  background: var(--bg-1); border: 1px solid var(--border-1);
  border-radius: var(--r-md); padding: var(--sp-4);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
/* v3.12.0 (Sichtung S8) — Zählerbaum: Unterzähler eingerückt, feine Linie in der Farbe der Zeichnungen (wie im Messkonzept).
   Die Senkrechte überbrückt den Abstand zwischen den Karten und endet am Knie des letzten Kinds. */
.zaehlerbaum { --baum-einzug: var(--sp-6); --baum-knie: 30px; --baum-luecke: var(--sp-3); }
@media (max-width: 600px) { .zaehlerbaum { --baum-einzug: var(--sp-3); } }
.zaehlerbaum, .zaehlerbaum__kinder { list-style: none; margin: 0; padding: 0; }
.zaehlerbaum__kinder { margin-left: var(--baum-einzug); }
.zaehlerbaum__kinder > .zaehlerbaum__knoten { position: relative; padding-left: var(--baum-einzug); }
.zaehlerbaum__kinder > .zaehlerbaum__knoten::before {
  content: ''; position: absolute; left: 0; top: calc(-1 * var(--baum-luecke)); bottom: 0;
  border-left: 1px solid var(--ill-line);
}
.zaehlerbaum__kinder > .zaehlerbaum__knoten:last-child::before { bottom: auto; height: calc(var(--baum-luecke) + var(--baum-knie)); }
.zaehlerbaum__kinder > .zaehlerbaum__knoten::after {
  content: ''; position: absolute; left: 0; top: var(--baum-knie); width: var(--baum-einzug);
  border-top: 1px solid var(--ill-line);
}
.meter-card__icon { line-height: 1; white-space: nowrap; }
.meter-card { flex-wrap: wrap; }
.meter-card__main { flex: 1 1 16rem; min-width: 0; }
.meter-card__aktionen { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
/* v3.12.0 (Sichtung S8) — am iPhone stehen die Knöpfe unter dem Zähler: Daneben liefen sie aus der Karte */
@media (max-width: 600px) { .meter-card__aktionen { width: 100%; } .meter-card__aktionen .btn { flex: 1 1 auto; } }
.meter-card__name { font-weight: 600; font-size: var(--fs-md); }
.meter-card__meta { color: var(--text-3); font-size: var(--fs-xs); margin-top: var(--sp-0); }
.device-list { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.device-list li { font-size: var(--fs-xs); color: var(--text-2);
  padding: var(--sp-1) 0; border-top: 1px dashed var(--border-1);
}
.device-list li:first-child { border-top: none; }
.device-list .open { color: var(--success); }
.device-list .closed { color: var(--text-3); }

/* ── Drag-drop zone (CSV) ───────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-md);
  padding: var(--sp-8) var(--sp-4);
  text-align: center; color: var(--text-2);
  background: var(--bg-1); transition: var(--transition);
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--text-1);
}


/* ── Compact table variant (for nested analysis summaries) ─────── */
.table--compact th, .table--compact td {
  padding: var(--sp-1h) var(--sp-3);
  font-size: var(--fs-xs);
}
.table--compact thead th { background: transparent; border-bottom: 1px solid var(--border-1); }
.table--compact tbody tr.is-best { background: color-mix(in srgb, var(--success) 8%, transparent); }
.table--compact tbody tr.is-best:hover { background: color-mix(in srgb, var(--success) 14%, transparent); }

/* ── Legend swatch (inline color marker for regression models) ── */
.legend-swatch {
  display: inline-block; width: 14px; height: 3px;
  margin-right: var(--sp-1h); vertical-align: middle;
  border-radius: var(--r-sm);
}


/* ── Regression summary block (analysis view) ─────────────────── */
.regression-summary {
  overflow-x: auto;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-1);
}
.regression-summary .table { }
.regression-summary .muted { font-size: var(--fs-xs); }


/* ── Meter card hover ──────────────────────────────────────────── */
.meter-card { transition: var(--transition); }
.meter-card:hover {
  border-color: var(--border-strong);
}

/* =================================================================
   v1.0.2 — restored v0.9.0 patterns
   ================================================================= */

/* ── Year pills row ─────────────────────────────────────────────── */
.year-pills { margin-bottom: var(--sp-4); }
/* v3.6.0 — Umschalter Kalenderjahr · Abrechnungsjahr: eigene Zeile im selben
   Abstand wie Jahres- und Periodenwahl darunter (klebte sonst an ihr) */
.period-mode-bar {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

/* ── Balance grid (Saldo-Karte: 4 Spalten) ──────────────────────── */
/* v2.5.3 (UI-01) — minmax(0, …): „Vergütungsanspruch" in Großbuchstaben
   dehnte die Spalte auf dem iPhone SE über den Rand. Beschriftungen brechen
   jetzt um. */
.balance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: var(--sp-5);
  align-items: stretch;
}
@media (max-width: 900px) { .balance-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.balance-col__label { overflow-wrap: anywhere; hyphens: auto; }
.balance-col__label {
  font-size: var(--fs-xs); font-weight: 500; color: var(--text-2);
  margin-bottom: var(--sp-1h);
}
.balance-col__value { font-size: var(--fs-lg); font-weight: 500;
  color: var(--text-1);
}
.balance-col__sub {
  font-size: var(--fs-xs); color: var(--text-2);
  margin-top: var(--sp-1);
}
/* v2.8.0 — Abschlagsvorschlag unter der Saldo-Karte (UI-36), als Infobox */
/* v2.16.0 (Review FE-31) — Saldo-Verlauf unter den Kennzahlen der Karte */
.balance-path { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border-1); }/* v2.10.0 — Tankbuch: Peilstände kompakt, damit sie am iPhone in die Karte passen */
.tank-levels .table td { padding: var(--sp-2) var(--sp-3); }
.tank-levels .table td.actions { width: 1%; white-space: nowrap; }
.balance-col__breakdown { font-size: var(--fs-xs);
  color: var(--text-3);   /* v2.11.0: --text-disabled lag unter 3:1 */
  margin-top: var(--sp-1);
}
/* v2.13.0 (Review UI-18) — Farbe nach Bedeutung; bis v2.12 war die rote
   Klasse „positive" (positiver Saldo = Nachzahlung) */
.balance-col__value--credit { color: var(--success); }
.balance-col__value--due { color: var(--danger); }

/* Verdict box (rechte Spalte) */
.balance-verdict {
  padding: var(--sp-4) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-1);
  display: flex; flex-direction: column; justify-content: center;
}
.balance-verdict.refund   { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.balance-verdict.surcharge{ background: var(--danger-soft);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.balance-verdict.balanced { background: var(--bg-2); border-color: var(--border-2); }
.balance-verdict__label {
  font-size: var(--fs-xs); font-weight: 500;
  color: var(--text-2);
  margin-bottom: var(--sp-1);
}
.balance-verdict__value { font-size: var(--fs-xl); font-weight: 600;
}
/* v3.9.0 (A2) — unsichere Schätzung: die Spanne ist ein Satz, kein Betrag — kleiner
   und in Fließschrift, damit sie am Telefon nicht über fünf Zeilen läuft */
.balance-verdict__value[data-role="verdict-range"] {
  font-family: var(--font-sans, inherit); font-size: var(--fs-sm); font-weight: 600; line-height: 1.35;
}
.balance-verdict__verdict {
  font-size: var(--fs-xs); font-weight: 600;
  margin-top: var(--sp-1);
}
.balance-verdict.refund   .balance-verdict__value,
.balance-verdict.refund   .balance-verdict__verdict { color: var(--success); }
.balance-verdict.surcharge .balance-verdict__value,
.balance-verdict.surcharge .balance-verdict__verdict { color: var(--danger); }
.balance-verdict__date {
  font-size: var(--fs-xs); color: var(--text-2);
  margin-top: var(--sp-2);
}

/* ── Contract table specific styling ────────────────────────────── */
.contracts-table .provider-cell { font-weight: 600; color: var(--text-1); }
.contracts-table .provider-cell small {
  display: block; font-weight: 400;
  font-size: var(--fs-xs); color: var(--text-2);
  margin-top: var(--sp-0);
}
.contracts-table .period-cell { font-size: var(--fs-xs);
  color: var(--text-2);
}.table tr.row--flagged > td { background: color-mix(in srgb, var(--warning-soft) 60%, transparent); }

/* v3.4.0 (N1021) — Vertragslisten nach Phase: Zukünftig · Aktuell · Beendet ·
   Angebote; „Beendet“ zum Aufklappen (Kosten → Verträge als <details>, in der
   Tabelle der Verbrauchsart als Kopfzeile mit Knopf) */
.contract-group { margin-top: var(--sp-4); }
.contract-group__title { margin: 0 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
details.contract-group > summary.contract-group__title { cursor: pointer; }
.contract-card__years { font-size: var(--fs-xs); font-weight: 400; margin-left: var(--sp-1); }
.contracts-table tr.contracts-table__group > th {
  text-align: left; background: var(--bg-2); color: var(--text-2);
  font-size: var(--fs-xs); font-weight: 600;
}
.contracts-table__toggle {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent, var(--text-1));
  text-transform: inherit; cursor: pointer; text-decoration: underline;
}
.contracts-table__toggle::before { content: '▸ '; text-decoration: none; display: inline-block; }
.contracts-table__toggle[aria-expanded="true"]::before { content: '▾ '; }

/* v3.4.0 (N1021) — Liste der Ablesungen: Jahr in der Karte, Filter, Blätterleiste */
/* v3.12.0 (m4b) — kein Feld unter 120 px: „Alle Jahre“ und die Jahreszahl lesbar, auch mit großem Pfeil (WebKit) */
.list-year { width: auto; min-width: 120px; margin-right: var(--sp-2); }
.list-count { font-size: var(--fs-xs); margin-right: var(--sp-2); }
.list-filter { margin: 0 0 var(--sp-2); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.pager__range { font-variant-numeric: tabular-nums; color: var(--text-2); }
.pager__size { display: inline-flex; align-items: center; gap: var(--sp-1); margin-left: auto; font-size: var(--fs-sm); color: var(--text-2); }
.pager__size .select { width: auto; }
/* v3.4.0 (N1021) — Rechnung prüfen: „Rechnung des Versorgers erfassen“ eingeklappt unter dem Ergebnis */
details.bill-capture > summary { cursor: pointer; margin-bottom: 0; }
details.bill-capture[open] > summary { margin-bottom: var(--sp-3); }

/* v2.6.0 — Listen in Hinweisen und Dialogen (Warnungen, Rückfragen,
   Backup-Vorschau und -Fundstellen) */
.check-list,
.problem-list,
.import-preview{ margin: var(--sp-1h) 0 0; padding-left: 1.2em; }
.check-list li,
.problem-list li,
.import-preview li{ margin: var(--sp-1) 0; overflow-wrap: anywhere; }.check-list li { margin: var(--sp-1h) 0; }
.problem-list { max-height: 16rem; overflow-y: auto; font-size: var(--fs-xs); }
.import-preview { margin-bottom: var(--sp-3); }

/* v2.6.0 — Snapshot-Liste in den Einstellungen */
.snapshot-list { max-height: 22rem; overflow-y: auto; }
.snapshot-list__actions { text-align: right; white-space: nowrap; }
@media (max-width: 420px) { .snapshot-list__size { display: none; } }
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ── Monthly table with full v0.9.0 column set ──────────────────── */
.table .col-violet { color: var(--c-violet-text); }   /* v3.12.0 — Schriftton, WCAG AA auf --bg-1 und --bg-2 */
.table .col-blue   { color: var(--c-blue); }
.table .col-yellow { color: var(--c-yellow-text); }
.table tfoot tr { background: var(--bg-2); font-weight: 600; }
.table tfoot td { border-top: 1px solid var(--border-2); }

/* ── Icon buttons (inline edit / delete) ────────────────────────── */
.icon-btn {
  background: transparent; border: none;
  color: var(--text-2);
  padding: var(--sp-0) var(--sp-1h); border-radius: var(--r-sm);
  cursor: pointer; font-size: var(--fs-sm);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-1); }

/* ── Refined buttons for utility-tinted CTAs ────────────────────── */
/* .btn-<key> wird seit v2.2.0 aus der SSOT erzeugt (utility-theme.js). */

/* Toolbar inside cards */
.toolbar {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.toolbar .spacer { flex: 1; }

/* Chart wrappers with named heights */
.chart-wrap.h220 { height: 220px; }
.chart-wrap.h300 { height: 300px; }
.chart-wrap.h360 { height: 360px; }

/* =================================================================
   v1.1.0 — Settings rework, CSV export tiles, water spar-index
   ================================================================= */

/* ── section-head (used across views, previously unstyled) ───────── */
.section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.section-head h1 {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; color: var(--text-1);
}
.section-actions {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
}
/* v3.12.0 (Sichtung S7) — Auswahl im Kopf einer Seite: so breit wie ihr Inhalt, neben dem Knopf */
.section-actions > .select { width: auto; }

/* ── Settings: grouped cards in a responsive grid ───────────────── */
/* v3.4.0 (N1021) — Jede Unterseite legt alle Karten in dieses Raster; die
   Karten stehen oben bündig (bis v3.3 wurde eine Reihe auf die höchste Karte
   gestreckt: Energieträger 1555 px hoch neben CO₂). Breite Karten
   (`settings-card--wide`) über die ganze Zeile; sie stehen am Seitenende,
   statt `grid-auto-flow: dense` Lücken füllen zu lassen — das trennte die
   Lese- und Tab-Reihenfolge von der Anzeige. */
/* Regel R2: Formulare stehen untereinander, eine Spalte, Beschriftung links, Feld rechts.
   Boxen mit ungleich viel Inhalt stehen nie nebeneinander. */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  gap: var(--sp-4);
  align-items: stretch;
  margin-bottom: var(--sp-4);
}
.settings-card { margin-bottom: 0; min-width: 0; }
/* Zahlen und Stichtage in breiten Karten nicht über 1000 px ziehen */

/* Aktive Verbrauchsarten: Kästchen in Spalten statt neun Zeilen untereinander */
.settings-fields.check-grid { display: grid; gap: 0 var(--sp-3); }
/* Unterstützen (System): Link als Knopf */
.support-card__link { margin-top: var(--sp-2); }
.settings-card__hint {
  font-size: var(--fs-body); color: var(--text-2);
  margin: -6px 0 var(--sp-4); line-height: 1.5;
}
/* v3.6.0 — Abstände wie im Formularraster (.fgrid): 16 px von Feld zu Feld,
   4 px zwischen Beschriftung, Feld und Hinweis. Bis v3.5 standen Karten mit
   Raster (Passwort, Schlüssel) und ohne (Hostnamen) mit 16 bzw. 12 px nebeneinander. */
.settings-fields { display: block; }
.settings-field, .field.settings-field {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; column-gap: var(--sp-6); row-gap: var(--sp-0);
  align-items: start; margin: 0; padding: var(--sp-3) 0; border-top: 1px solid var(--border-1);
}
.settings-fields > .settings-field:first-child { border-top: 0; padding-top: 0; }
.settings-field > label { grid-column: 1; }
.settings-field > .input, .settings-field > .select, .settings-field > textarea, .settings-field > .input-row, .settings-field > div:not(.field-error) { grid-column: 2; grid-row: 1 / span 4; width: 100%; }
.settings-field > .settings-field__hint, .settings-field > .field-error { grid-column: 1; }
/* v3.13.0 (#64) — Knöpfe zu einem Feld (Neue ID, Löschen) unter dem Feld, nicht in seiner Zelle: Die Regel darüber
   legte jedes `div` auf Zeile 1 bis 4 der rechten Spalte, also über das Eingabefeld. Das Feld bleibt in Zeile 1,
   die Knopfreihe folgt in Zeile 2 derselben Spalte (`div.section-actions`, damit sie die Regel darüber schlägt).
   Unter 900 px steht ohnehin alles untereinander (Regel unten). */
@media (min-width: 900px) {
  .settings-field:has(> div.section-actions) > :is(.input, .select) { grid-row: 1; }
  .settings-field > div.section-actions { grid-column: 2; grid-row: 2 / span 3; }
}
.settings-field > div.section-actions { margin-top: var(--sp-2); }
.settings-field.settings-field:has(> .settings-field__check), .settings-field.settings-field:has(> textarea), .settings-field.settings-field:has(table) { grid-template-columns: minmax(0, 1fr); }
.settings-field.settings-field:has(> .settings-field__check) > *, .settings-field.settings-field:has(> textarea) > *, .settings-field.settings-field:has(table) > * { grid-column: 1; grid-row: auto; }
/* v3.12.0 (Sichtung S4) — unter 900 px Beschriftung über dem Feld, Feld in voller Breite. Die Regel braucht denselben
   Selektor wie oben: `.field.settings-field` behielt sonst die 240-px-Spalte, und das Feld war am iPhone 52 px breit. */
@media (max-width: 899.98px) {
  .settings-field, .field.settings-field { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .settings-field > * { grid-column: 1; grid-row: auto; }
  .settings-field > .input, .settings-field > .select, .settings-field > textarea, .settings-field > .input-row, .settings-field > div:not(.field-error) { grid-column: 1; grid-row: auto; }
}
.settings-field > label {
  display: flex; align-items: baseline; gap: var(--sp-1h); flex-wrap: wrap;
}
/* v3.9.0 — Kästchen und Radio mit langem Text: der Text bricht neben dem
   Kästchen um, nicht darunter (die Regel darüber hatte Vorrang) */
.settings-field > label.settings-field__check { flex-wrap: nowrap; align-items: center; }
/* v3.9.0 — Gruppe von Kästchen bzw. Radios in einer Einstellungskarte
   (Benachrichtigungen an Home Assistant): ohne den Rahmen des Browsers, die
   Legende wie die Beschriftung eines Feldes */
fieldset.settings-field { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
fieldset.settings-field > legend {
  padding: 0; margin-bottom: var(--sp-1);
  font-size: var(--fs-body); font-weight: 500; color: var(--text-1);
}
/* Ziel eines Sprungs aus der Übersicht (`?field=`) */
.settings-field[data-target] > label { color: var(--accent); }
.settings-field__unit { font-size: var(--fs-sm); font-weight: 400; color: var(--text-2); }
.settings-field__hint {
  font-size: var(--fs-sm); color: var(--text-2);
  line-height: 1.45; margin-top: 0; max-width: 72ch;
}
/* v2.9.0 — Zahl mit Einheit nebeneinander (Kündigungsfrist); minmax(0,1fr),
   damit das Paar auf dem iPhone nicht über den Rand wächst */
.input-pair {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2);
}
/* v3.12.0 (Sichtung S4) — Adresse und Knopf: am iPhone untereinander, sonst bleibt von der Adresse nichts zu lesen */
@media (max-width: 480px) { .input-pair--stapel { grid-template-columns: minmax(0, 1fr); } }
.settings-rule {
  border: none; border-top: 1px solid var(--border-1);
  margin: var(--sp-4) 0;
}
.settings-subhead {
  margin: 0 0 var(--sp-2); font-size: var(--fs-sm); color: var(--text-1); font-weight: 600;
}

/* ── CSV export tiles (F-07) ────────────────────────────────────── */
.export-grid { gap: var(--sp-3); }
.export-tile {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-1h);
}
.export-tile__label {
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-1);
}
.export-tile__hint {
  font-size: var(--fs-xs); color: var(--text-2); line-height: 1.45;
  flex: 1;
}
.export-tile__actions {
  display: flex; gap: var(--sp-1h); flex-wrap: wrap; margin-top: var(--sp-2);
}

/* ── Water spar-index (F-10) ────────────────────────────────────── */
.sparindex {
  display: flex; align-items: center; gap: var(--sp-5);
  flex-wrap: wrap;
}
.sparindex__main {
  display: flex; align-items: baseline; gap: var(--sp-3);
}
.sparindex__value { font-size: var(--fs-2xl); font-weight: 500;
  line-height: 1;
}
.sparindex__badge { vertical-align: middle; }
.sparindex__detail { font-size: var(--fs-sm);
  display: flex; flex-direction: column; gap: var(--sp-0);
}
.sparindex__bar { margin-top: var(--sp-4); }
.sparindex__bar-track {
  position: relative; height: 12px;
  border-radius: var(--r-sm); overflow: hidden;
  background: var(--bg-3);
}
.sparindex__bar-zone {
  position: absolute; top: 0; bottom: 0;
}
.sparindex__bar-zone--gut     { left: 0; background: var(--success-soft); }
.sparindex__bar-zone--mittel  { background: var(--warning-soft); }
.sparindex__bar-zone--warnung { background: var(--danger-soft); }
.sparindex__bar-marker {
  position: absolute; top: -3px; bottom: -3px; width: 3px;
  background: var(--text-1);
  border-radius: var(--r-sm);
  transform: translateX(-50%);
}
.sparindex__bar-labels {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--text-3);
  margin-top: var(--sp-1h);
}

/* =================================================================
   v1.2.0 — System-Diagnose Layout + Chip-Listen
   ================================================================= */

/* Zweispaltiges Definition-Grid für die Diag-Header-Zeilen. */
.diag-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--sp-2) var(--sp-4);
  margin: 0 0 var(--sp-5);
  padding: 0;
}
.diag-grid dt {
  font-size: var(--fs-xs);
  color: var(--text-2);
  align-self: center;
}
.diag-grid dd {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-1);
  word-break: break-word;
}
.diag-grid dd.mono { font-family: var(--font-code); font-size: var(--fs-xs); }
.diag-grid dd.path {
  background: var(--bg-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  display: inline-block;
  border: 1px solid var(--border-1);
}

.diag-subhead {
  font-size: var(--fs-xs);
  color: var(--text-2);
  margin: var(--sp-5) 0 var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-1);
}
.diag-line { font-size: var(--fs-sm); margin: 0 0 var(--sp-3); }

.diag-chips {
  display: flex; flex-wrap: wrap; gap: var(--sp-1h);
}
@media (max-width: 600px) {
  .diag-grid { grid-template-columns: 1fr; gap: var(--sp-0) var(--sp-4); }
  .diag-grid dt { padding-top: var(--sp-2); }
}

/* =====================================================================
   v1.3.0 — Neue Komponenten (Empfehlungen, Termine, Tarifvergleich,
   dynamische Sidebar, generische Datentabelle)
   ===================================================================== */

/* Sidebar-Badges (offene Empfehlungen / fällige Termine) */
.sidebar__badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 var(--sp-1);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 600;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.sidebar__badge--alert {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
}
/* v3.13.0 — eine Zahl ohne Handlungsbedarf (Frühere Verträge): ruhig, ohne Akzentfarbe */
.sidebar__badge--neutral {
  background: color-mix(in srgb, var(--text-2) 14%, transparent);
  color: var(--text-1);
}

/* v2.12.0 (Review UI-20) — `.view-head` entfernt: Termine, Empfehlungen und
   Tarifvergleich nutzen jetzt `.view-header` wie alle anderen Seiten. Ihr
   <h1> hatte keine eigene Größe und erschien mit 32 px statt 20 px. */

/* Segmentierter Filter-Umschalter */
.seg { display: inline-flex; gap: var(--sp-1); flex-wrap: wrap; }
/* v3.13.0 — die Form kommt aus der einen Regel des Untermenüs (app.css); hier stand bis dahin eine zweite
   (Innenabstand, Fläche, Rand), die sie überschrieb. tests/design-rules.test.mjs übersah sie. */
.seg__btn { cursor: pointer; }
.seg__btn:hover { background: var(--bg-3); color: var(--text-1); }
.seg__btn.active {
  background: var(--accent); color: var(--accent-fg);
  border-color: var(--accent); font-weight: 600;
}
/* v3.7.0 (Karte „Auslesen“) — derselbe Umschalter als Radiogruppe (Lokal | Cloud) */
.seg--radio { border: 0; margin: 0 0 var(--sp-2); padding: 0; min-width: 0; }
.seg--radio legend { width: 100%; padding: 0; margin-bottom: var(--sp-1); font-size: var(--fs-sm); color: var(--text-2); }
.seg--radio .seg__btn { position: relative; display: inline-flex; align-items: center; }
.seg--radio .seg__btn input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg--radio .seg__btn:has(input:checked) { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.seg--radio .seg__btn:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg--radio .seg__btn:has(input:disabled) { opacity: .7; cursor: not-allowed; }

/* Empfehlungs-Karten */
.rec-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.rec-card {
  background: var(--bg-1); border: 1px solid var(--border-1);
  border-radius: var(--r-md); padding: var(--sp-4);
}/* v3.12.0 — Sprungmarke `#/recommendations?rec=<id>`: ohne Bewegung, nur ein Rahmen */
.rec-card--target { outline: 2px solid var(--accent); outline-offset: 2px; scroll-margin-top: calc(var(--topbar-total) + 12px); }
.rec-card__head {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.rec-card__cat { font-size: var(--fs-xs); color: var(--text-2); }
/* v2.11.0 (Review UI-26) — „30 Tage ausblenden" als Text statt ✕ */
.rec-card__dismiss { margin-left: auto; }
.rec-card__title { font-weight: 600; margin-bottom: var(--sp-1); }
.rec-card__detail { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
/* v3.11.0 (Rechte als Kunde) — „Brief entwerfen“ und „Was die App prüft“ nebeneinander */
.rec-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); }
.rec-card__actions [data-role="rights-doc"] { font-size: var(--fs-sm); }

/* Generische Datentabelle */
.data-table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
}
.data-table th {
  text-align: left; padding: var(--sp-2) var(--sp-3);
  color: var(--text-2); font-weight: 600;
  border-bottom: 1px solid var(--border-2);
}
.data-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border-1);
}
.data-table tr:last-child td { border-bottom: none; }
/* v2.2.0 — violett statt Akzentblau, damit die Schattenzeile dieselbe Farbe
   trägt wie ihr Badge und der Vertragsstatus. */
.data-table .row-shadow { background: color-mix(in srgb, var(--c-violet) 6%, transparent); }
/* v2.3.0 — die Referenzzeile (laufender Vertrag) trägt die Utility-Farbe und
   einen Balken links: Sie ist der Maßstab, gegen den alles andere gelesen
   wird, und darf in der Rangliste nicht wie ein weiteres Angebot wirken. */
.data-table .row-reference {
  background: color-mix(in srgb, var(--util, var(--c-blue)) 7%, transparent);
}
.data-table .row-reference td:first-child {
}
.data-table .delta.pos { color: var(--success); }
.data-table .delta.neg { color: var(--danger); }
.cell-actions { white-space: nowrap; text-align: right; }
/* v3.12.0 (Sichtung S6) — mehrere Knöpfe in einer Tabellenzelle: gleicher Abstand, auch über den Umbruch */
.cell-actions__reihe { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--sp-1h); }

.small { font-size: var(--fs-xs); }

/* v3.4.0 (N1021) — `.form-grid` (Termin, Angebot) ist im Formularraster
   `.fgrid` aufgegangen: eigene Schrift, Höhe und Satzschreibung der Labels
   waren ein zweites System neben `.field`. */

/* v1.3.0 — Tank-Bestandsbalken (Heizöl/Pellets) */
.tank-bar-wrap { padding: var(--sp-2) 0; }
.tank-bar {
  position: relative; height: 28px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--r-sm); overflow: hidden;
}
.tank-bar__fill {
  height: 100%; transition: width 300ms ease;
  background: color-mix(in srgb, var(--success) 65%, transparent);
}
.tank-bar__fill--warn  { background: color-mix(in srgb, var(--warning) 70%, transparent); }
.tank-bar__fill--alert { background: color-mix(in srgb, var(--danger) 70%, transparent); }
.tank-bar__legend {
  display: flex; justify-content: space-between;
  margin-top: var(--sp-2); font-size: var(--fs-sm);
}

/* v1.3.0 — Dashboard-Insight-Karten */

.dash-eff { display: flex; align-items: baseline; gap: var(--sp-3); margin: var(--sp-2) 0; }
.dash-eff__class {
  font-size: var(--fs-2xl); font-weight: 600; color: var(--accent);
  line-height: 1;
}
.dash-eff__val { font-size: var(--fs-lg); color: var(--text-1); }
.dash-tank { margin-bottom: var(--sp-3); }
.dash-tank:last-child { margin-bottom: 0; }
.dash-tank__label {
  display: flex; justify-content: space-between;
  font-size: var(--fs-sm); margin-bottom: var(--sp-1);
}
.dash-rec { flex-direction: row; align-items: flex-start; gap: var(--sp-3); }
.dash-rec__text { display: flex; flex-direction: column; gap: var(--sp-0); min-width: 0; }
.dash-rec > .ico { margin-top: var(--sp-0); }
.ton-ico--danger { --ico: var(--ton-fehler); --ico-f: color-mix(in srgb, var(--ton-fehler) 16%, transparent); }
.ton-ico--warning { --ico: var(--ton-achtung); --ico-f: color-mix(in srgb, var(--ton-achtung) 16%, transparent); }
.ton-ico--info { --ico: var(--ton-info); }
.dash-rec {
  display: flex; flex-direction: column; gap: var(--sp-0);
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-1);
}
.dash-rec:last-child { border-bottom: none; }
.dash-rec span.muted { font-size: var(--fs-xs); }
/* v3.6.0 — Einordnung als Ampel: Punkt in der Farbe, dasselbe als Wort (nicht
   nur Farbe), darunter die Grundlage. Einladung mit einem Link als Knopfziel
   (44 px bei Touch, über --control-h). */
.cmp-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.cmp-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: var(--sp-2); align-items: start; font-size: var(--fs-sm); line-height: 1.45; }
.cmp-row__dot { width: 12px; height: 12px; margin-top: 0.3em; border-radius: 50%; background: var(--text-3); }
.cmp-row--good .cmp-row__dot { background: var(--success); }
.cmp-row--near .cmp-row__dot { background: var(--warning); }
.cmp-row--high .cmp-row__dot { background: var(--danger); }
.cmp-row--good .cmp-row__label { color: var(--success); }
.cmp-row--near .cmp-row__label { color: var(--warning); }
.cmp-row--high .cmp-row__label { color: var(--danger); }
.cmp-row__sub { display: block; margin-top: var(--sp-0); font-size: var(--fs-xs); color: var(--text-2); }
.cmp-invite { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; }
/* eigene Zeile: ein 44-px-Ziel mitten im Satz zog die Zeile auseinander */
.cmp-invite a { display: flex; width: fit-content; align-items: center; min-height: var(--control-h); font-weight: 600; }
.cmp-list + .cmp-invite { padding-top: var(--sp-3); border-top: 1px solid var(--border-1); }

/* v1.4.0 — Effizienz pro Heizquelle (Dashboard-Karte) */
.dash-eff-list { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-2) 0; }
.dash-eff-row {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-1);
}
.dash-eff-row:last-child { border-bottom: none; }
.dash-eff-row__src { font-size: var(--fs-sm); }
.dash-eff-row__val { font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
/* v2.7.0 — Länder ohne Effizienzskala: Kennzahl ohne Klasse, Hinweis darunter */
.dash-eff__note { font-size: var(--fs-xs); margin: var(--sp-2) 0 0; }

/* F1005 (v1.7.0) — Strom-Saldo-Insight: KPIs (Bezug, PV-Erlös, Netto, Autarkie, EV-Quote) als auto-fit Grid */
.dash-strom-saldo .kpi--accent { border: 1px solid var(--accent); border-radius: var(--r-md); padding: var(--sp-2); }

/* v2.0.0 (UX) — Trend-Indikator auf Dashboard-KPIs (letzte 12 vs. vorherige 12
   Monate). Als dezent getönter Chip, damit Richtung/Wert auf einen Blick
   erfassbar sind statt nur als farbiger Text. */
.kpi__trend {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-left: var(--sp-1, 4px);
  padding: var(--sp-0) var(--sp-1h);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.kpi__trend--danger  { color: var(--danger);  background: var(--danger-soft); }
.kpi__trend--success { color: var(--success); background: var(--success-soft); }
/* v3.10.0 (Skeptiker M1) — statt eines Prozentpfeils: Ablesung prüfen (Link zu den Ablesungen) */
.kpi__trend--check   { color: var(--warning); background: var(--warning-soft); text-decoration: none; }
a.kpi__trend--check:hover, a.kpi__trend--check:focus-visible { text-decoration: underline; }

/* v2.0.0 (UX) — Leerwert (z.B. Kosten ohne hinterlegten Tarif): gedämpfter
   Gedankenstrich statt „€0.00", damit „kein Tarif" nicht wie echte 0 € wirkt. */
.kpi__empty { color: var(--text-3); font-weight: 500; }

/* v2.0.1 — F1006-Bugfix (#16): Zähler-Gruppen als aufklappbare Dashboard-Summe
   in der Utility-Karte. */
.dash-groups {
  margin-top: var(--sp-3);
  border-top: 1px solid var(--border-1);
  padding-top: var(--sp-2);
}
.dash-groups__summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-1) 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}
.dash-groups__summary::-webkit-details-marker { display: none; }
.dash-groups__summary::before {
  content: "▸";
  display: inline-block;
  margin-right: var(--sp-1h);
  transition: transform .15s ease;
}
.dash-groups[open] .dash-groups__summary::before { transform: rotate(90deg); }
.dash-groups__list {
  list-style: none;
  margin: var(--sp-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.dash-groups__item {
  display: flex;
  justify-content: space-between;
  /* v3.12.0 (M5) — am iPhone rückt der Wert unter den Namen, statt aus der Kachel zu ragen */
  flex-wrap: wrap;
  gap: 0 var(--sp-3);
  font-size: var(--fs-sm);
}
.dash-groups__name { color: var(--text-1); }
.dash-groups__count { color: var(--text-3); font-weight: 400; }
.dash-groups__val {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* v2.13.0 (Review UI-32, UI-27) — Einstieg auf der leeren Übersicht: links
   ausgerichtet wie der Rest der Seite (bis v2.12 stand die Überschrift links,
   der Rest zentriert), mit den ersten Schritten */
.dash-welcome { padding: var(--sp-5); position: relative; }
/* v3.9.0 — Zeichnung rechts neben dem Text (Zier); am Telefon ohne, dort zählt der Platz */
.dash-welcome__art { position: absolute; top: var(--sp-5); right: var(--sp-6); width: 200px; pointer-events: none; }
@media (max-width: 1199.98px) { .dash-welcome__art { display: none; } }
.dash-welcome__title { font-size: var(--fs-xl); font-weight: 600; margin: 0 0 var(--sp-2); }
.dash-welcome__text { max-width: 62ch; margin: 0 0 var(--sp-4); color: var(--text-2); }
.dash-welcome__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.dash-welcome__steps { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 var(--sp-2); }

/* ─────────────────────────────────────────────────────────────────────
   v2.3.0 — Tarifvergleich: Wechselentscheidung
   ───────────────────────────────────────────────────────────────────── */

.section-title {
  font-size: var(--fs-md);
  margin: 0 0 var(--sp-3);
}

/* Zwei Karten nebeneinander: der erwartete Verbrauch (die Zahl, die zum
   Vergleichsportal mitgenommen wird) und der Wechseltermin. Auf schmalen
   Schirmen untereinander — die Verbrauchszahl zuerst, sie trägt die
   Handlung. */
.switch-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.switch-card { padding: var(--sp-4); }
.switch-card--consumption { }

.switch-bignum {
  margin: var(--sp-2) 0 var(--sp-1);
  line-height: 1.1;
}
.switch-bignum strong {
  font-size: var(--fs-2xl);
  font-variant-numeric: tabular-nums;
  color: var(--util, var(--text-1));
}
.switch-bignum .unit { font-size: var(--fs-sm); color: var(--text-2); }

.switch-date-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-2);
}
.switch-date-row input[type="date"] { min-width: 9.5rem; }

.switch-empty { display: grid; gap: var(--sp-3); justify-items: start; }

/* Der Rückblick ist eingeklappt: Er belegt, dass die Rechnung auf echten
   Daten aufgeht, ist aber nicht der Grund, warum jemand die Ansicht
   öffnet. */
.retro-block > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.retro-block > summary::-webkit-details-marker { display: none; }
.retro-block > summary::before {
  content: "▸";
  color: var(--text-2);
  transition: transform 120ms ease;
}
.retro-block[open] > summary::before { transform: rotate(90deg); }
.retro-block > summary .section-title { margin: 0; }
.retro-block > summary:focus-visible {
  outline: 2px solid var(--util, var(--c-blue));
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.toolbar--sub {
  margin: var(--sp-3) 0;
  align-items: center;
  gap: var(--sp-3);
}

@media (prefers-reduced-motion: reduce) {
  .retro-block > summary::before { transition: none; }
}

/* =====================================================================
   v2.11.0 — Mobil und aufgeräumt (Review UI-10, UI-16, UI-12)
   ===================================================================== */

/* Erfassen-Blatt (＋): Zählerstände, Lieferung, Peilstand, Termin */
.capture-sheet { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.capture-sheet__item {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 52px; padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text-1);
}
.capture-sheet__item:hover { background: var(--bg-3); text-decoration: none; color: var(--text-1); }
.capture-sheet__icon { width: 24px; line-height: 0; flex: none; }
.capture-sheet__label { display: block; font-weight: 600; }
.capture-sheet__hint { display: block; font-size: var(--fs-sm); color: var(--text-2); }

/* Verträge & Abschläge — je Verbrauchsart eine Karte */
.contract-overview__row + .contract-overview__row { border-top: 1px solid var(--border-1); margin-top: var(--sp-3); padding-top: var(--sp-3); }
.contract-overview__meter { font-size: var(--fs-xs); color: var(--text-2); margin-bottom: var(--sp-0); }
.contract-overview__name { font-weight: 600; font-size: var(--fs-md); }
.contract-overview__facts { margin-top: var(--sp-2); font-size: var(--fs-sm); }
.contract-overview__expected { margin-top: var(--sp-2); font-size: var(--fs-sm); }
/* v3.9.0 (A5) — Karte ohne Vertrag: unten nicht mehr Abstand als oben (Absatzrand) */
.contract-overview__row > p:last-child { margin-bottom: 0; }

/* Verweis-Karte (Rechnungsprüfung auf der Gas-Seite, Jahresbericht in den Einstellungen) */
.card--link p { margin: 0 0 var(--sp-3); }

.report-actions { flex-direction: row; flex-wrap: wrap; gap: var(--sp-2); }
/* ── Touch-Bedienung (Review UI-10) ─────────────────────────────────
   Auf dem iPhone lagen alle Bedienelemente unter 44 pt (Apple HIG), rote
   „Löschen"-Knöpfe mit 28 × 24 px direkt neben „Bearbeiten". Eingaben unter
   16 px lassen Safari bei jedem Fokus in die Seite zoomen. */
@media (pointer: coarse), (max-width: 899.98px) {
  .btn { min-height: 44px; }
  /* v3.9.0 — auch kleine Knöpfe 44 px (bis v3.8 40 px): in einer Zeile mit
     normalen Knöpfen sprangen die Höhen, und das „✕“ des Stufenhinweises war
     36 × 40 px groß */
  .btn--sm { min-height: 44px; padding: var(--sp-1h) var(--sp-3); font-size: var(--fs-sm); }
  .btn--sm[aria-label]:not(:has(*)) { min-width: 44px; justify-content: center; }
  .btn--icon { min-width: 44px; justify-content: center; }
  .pill, .seg__btn { min-height: 44px; display: inline-flex; align-items: center; }
  .topbar__btn { width: 44px; height: 44px; }
  /* v3.9.0 — die Stufenwahl daneben war 32 px hoch (neben 44-px-Knöpfen) */
  .topbar__select { height: 44px; }
  .modal__close { min-width: 44px; min-height: 44px; }
  /* Höhe über --control-h (oben); unter 16 px zoomt Safari beim Antippen */
  .input, .select, textarea.input { font-size: 16px; }
  .input[type="checkbox"], .input[type="radio"] { min-height: 0; }
  /* Abstand zwischen nebeneinanderliegenden Aktionen einer Tabellenzeile */
  td > .btn + .btn, td > .btn + a.btn, td > a.btn + .btn { margin-left: var(--sp-2); }
  .table td, .data-table td { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
}
/* v3.6.0 — iPad mit Tastatur und Trackpad meldet einen feinen Zeiger (breit,
   kein `pointer: coarse`), getippt wird trotzdem auf dem Glas: Ohne 16 px
   zoomte Safari beim Fokus ins Feld und die Seite sprang. */
@media (any-pointer: coarse) {
  .input, .select, textarea.input { font-size: 16px; }
}

/* ── Dialoge auf dem iPhone als Blatt von unten (Review UI-16) ─────── */
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-height: calc(100vh - 8px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px);
    border-radius: var(--r-md) var(--r-md) 0 0;
    border-left: none; border-right: none; border-bottom: none;
    animation: sheetUp 200ms ease-out;
  }
  .modal__head { padding: var(--sp-3) var(--sp-4); }
  .modal__body { padding: var(--sp-4); }
  .modal__foot {
    padding: var(--sp-3) var(--sp-4);
    padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  }
  .modal__foot .btn { flex: 1 1 0; justify-content: center; }
  /* Ohne Fußleiste trägt der Inhalt den Abstand zum Home-Balken */
  .modal__body:last-child { padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px)); }
}

/* =====================================================================
   v2.12.0 — Einstellungen als Unterseiten (Review UI-13)
   ===================================================================== */
/* Karten mit breiter Tabelle (Gas-Faktoren) über die ganze Zeile — die
   „Entfernen"-Knöpfe lagen bisher hinter einem unsichtbaren Querscroll */


/* Speicherleiste: steht nur, solange es ungespeicherte Änderungen gibt */
.settings-savebar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.settings-savebar__text { flex: 1; font-weight: 600; color: var(--warning); }
@media (max-width: 899.98px) {
  /* über der Tab-Leiste */
  .settings-savebar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-2)); }
}
@media (max-width: 600px) {
  /* eine Zeile: kurzer Hinweis, zwei Knöpfe — die Leiste verdeckt sonst ein
     Drittel des Formulars */
  .settings-savebar { flex-wrap: nowrap; padding: var(--sp-2) var(--sp-3); }
  .settings-savebar__text { font-size: var(--fs-sm); line-height: 1.2; min-width: 0; }
  .settings-savebar .btn { white-space: nowrap; }
}

/* Experte: eingeklappt, mit Warnung */
.settings-expert > summary {
  cursor: pointer; font-weight: 600; padding: var(--sp-3) 0;
  list-style: revert;
}
.settings-expert[open] > summary { margin-bottom: var(--sp-3); }

/* v3.6.0 — Aufklappbereich (components/disclosure.js): lange Listen in einer
   Kachel standardmäßig zu (CO₂-Faktoren, Prognose im Detail). Die Zeile ist
   bei Touch so hoch wie ein Knopf. */
.disclosure > summary { cursor: pointer; font-weight: 600; padding: var(--sp-2) 0; list-style: revert; }
.disclosure[open] > summary { margin-bottom: var(--sp-3); }
@media (pointer: coarse), (max-width: 899.98px) { .disclosure > summary { min-height: var(--control-h); padding: var(--sp-3) 0; } }
.settings-card .disclosure > summary { font-size: var(--fs-sm); color: var(--text-2); }
.settings-card .disclosure__body > .settings-fields { padding-top: var(--sp-1); }
/* v3.12.0 (F1037) — KI-Assistenten: Adresse in Schreibmaschinenschrift, je Programm eine
   aufklappbare Vorlage mit Trennlinie (Programmnamen in normaler Textfarbe) */

#mcp-connect-card .disclosure { border-top: 1px solid var(--border-1); }
#mcp-connect-card .disclosure > summary { color: var(--text-1); }
#mcp-connect-card, #mcp-activity-card, #mcp-value { scroll-margin-top: calc(var(--topbar-total) + 12px); }

/* v2.12.0 — Ortssuche auf der Wetterdaten-Seite (Review UI-30) */
.geo-search { display: flex; gap: var(--sp-2); }
.geo-search .input { flex: 1; min-width: 0; }
.geo-results { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.geo-results__item { width: 100%; justify-content: space-between; text-align: left; white-space: normal; }

/* v2.12.0 — „Zu tun" oben auf der Übersicht (Review UI-21) */
.dash-todo { margin-bottom: var(--sp-5); }
.dash-todo__list { list-style: none; margin: 0; padding: 0; }
.dash-todo__item { border-top: 1px solid var(--border-1); }
.dash-todo__item:first-child { border-top: none; }
.dash-todo__link {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 44px;
  padding: var(--sp-2) 0; color: inherit; text-decoration: none;
}
.dash-todo__item:first-child .dash-todo__link { padding-top: 0; }
.dash-todo__link:hover .dash-todo__go { background: var(--bg-2); }
.dash-todo__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.dash-todo__icon { width: 24px; line-height: 0; flex: none; }
.dash-todo__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dash-todo__go { flex: none; white-space: nowrap; }
.dash-todo__chev { display: none; flex: none; line-height: 0; }
.dash-todo__item--alert .dash-todo__text strong { color: var(--danger); }
@media (max-width: 600px) {
  .dash-todo__go { display: none; }
  .dash-todo__chev { display: block; }
}
/* v3.4.0 (F1024) — Haken neben der Zeile (eigenes Tippziel, nicht im Link) */
.dash-todo__item--check { display: flex; align-items: center; gap: var(--sp-2); }
.dash-todo__item--check .dash-todo__link { flex: 1 1 auto; min-width: 0; }
.dash-todo__done { flex: none; min-width: 44px; min-height: 44px; justify-content: center; }
/* v3.9.0 (#38) — Heizgrenze: zwei Knöpfe unter dem Eintrag, eingerückt wie der Text */
.dash-todo__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0 0 var(--sp-3) calc(24px + var(--sp-3)); }/* v3.9.0 (Skeptiker N4) — Einsteiger: die Fachzeilen aufklappbar unter den Knöpfen */
.dash-todo__more { padding: 0 0 var(--sp-3) calc(24px + var(--sp-3)); }
.dash-todo__more summary { cursor: pointer; font-size: var(--fs-sm); color: var(--text-2); }
.dash-todo__more p { margin: var(--sp-2) 0 0; }
.heat-limit-hint__more { margin-top: var(--sp-2); }
.heat-limit-hint__more summary { cursor: pointer; font-size: var(--fs-sm); }
.heat-limit-hint__more p { margin: var(--sp-2) 0 0; }

/* v3.4.0 (F1024) — Dialog „Erledigt" und Tab „Erledigt" */
.done-dialog__what { margin: 0 0 var(--sp-3); }
.activity-filters { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.activity-month { margin-bottom: var(--sp-4); }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--border-1); }
.activity-item:first-child { border-top: none; }
.activity-item__icon { flex: none; width: 24px; line-height: 0; }
.activity-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-0); }
.activity-item__title { font-weight: 600; overflow-wrap: anywhere; }
.activity-item__note { white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-item__actions { flex: none; display: flex; gap: var(--sp-1); }
.activity-item--undone .activity-item__title,
.activity-item--undone .activity-item__icon { color: var(--text-2); opacity: .75; }
.contract-overview__history { margin-top: var(--sp-2); }

/* v3.5.0 (F1028) — Zuständig: Namens-Chip und Filter in Terminen und „Zu tun" */
.chip--assignee {
  font-family: inherit; font-size: var(--fs-xs); border-radius: var(--r-sm); padding: var(--sp-0) var(--sp-2);
  vertical-align: middle; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chip--former { color: var(--text-2); font-style: italic; }
.assignee-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.assignee-filter label { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.assignee-filter .select { width: auto; min-width: 10rem; }
.dash-todo__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--sp-3); }
.dash-todo__head .assignee-filter { margin-bottom: var(--sp-2); }
.dash-todo__text .chip--assignee { align-self: flex-start; margin-top: var(--sp-0); }
/* v3.7.0 — geerbt (über den Vertrag / den Zähler): gestrichelt, Zusatz leiser */
.chip--via { border-style: dashed; }
.chip__via { color: var(--text-2); }

/* v2.12.0 (Review UI-20) — Werkzeugleisten: beschriftete Auswahlfelder in
   Inhaltsbreite statt 100 %, Umbruch auf schmalen Bildschirmen */
.toolbar { flex-wrap: wrap; }
.toolbar label { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.toolbar .select, .toolbar .input, .switch-date-row .input { width: auto; min-width: 10rem; }

/* v2.12.0 — Vorschau des CSV-Imports (Review UI-23) */
.import-preview { display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); }
.import-preview__summary { font-weight: 600; margin: 0; }
.import-preview__errors { margin: 0; padding-left: 1.2em; color: var(--text-2); font-size: var(--fs-xs); }
.import-preview__table td { vertical-align: top; }
.import-preview__table td.num, .import-preview__table td:first-child { white-space: nowrap; }
.import-preview__row--warn td { background: var(--warning-soft); }
.import-preview__row--warn td:last-child { color: var(--text-1); }
.import-preview__actions { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }


/* ─────────────────────────────────────────────────────────────────────
   v2.13.0 — Hilfe (Review DOC-10, UI-17, UI-32)
   ───────────────────────────────────────────────────────────────────── */
/* ⓘ neben einem Label: öffnet die Erklärung aus dem Glossar */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: var(--sp-1); padding: 0; vertical-align: middle;
  border: none; border-radius: var(--r-sm); background: transparent;
  line-height: 0; cursor: pointer;
}
.info-btn .ico { --ico-f: transparent; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--bg-2); --ico: var(--accent); }
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Tippziel 32 px, ohne die Zeile zu verschieben */
@media (pointer: coarse) { .info-btn { width: 32px; height: 32px; margin: -6px -6px -6px -2px; } }
.info-pop {
  position: absolute; z-index: 1200; max-width: 340px;
  padding: var(--sp-3) var(--sp-10) var(--sp-3) var(--sp-4);
  background: var(--bg-1); color: var(--text-1);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.45; text-align: left;
}
.info-pop__term { display: block; margin-bottom: var(--sp-1); }
.info-pop__text { margin: 0 0 var(--sp-1h); }
/* v3.1.0 (I18N-27) — Rechnungsbegriff des Landes */
.info-pop__bill { margin: 0 0 var(--sp-1h); font-size: var(--fs-xs); color: var(--text-2); }
.info-pop__more { font-size: var(--fs-xs); }
.info-pop__close {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px;
  border: none; background: transparent; color: var(--text-2); font-size: var(--fs-lg); cursor: pointer;
}
/* iPhone: als Blatt über der Tab-Leiste statt als schwebende Box */
@media (max-width: 600px) {
  .info-pop {
    position: fixed; left: 8px !important; right: 8px; top: auto !important; max-width: none;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px);
  }
}

/* Erste Schritte (Übersicht und Hilfe) */
.setup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.setup-list__item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.setup-list__mark {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600;
}
.setup-list__item--done .setup-list__mark { background: var(--success); border-color: var(--success); color: var(--bg-1); }
.setup-list__body { display: flex; flex-direction: column; gap: var(--sp-0); min-width: 0; }
.setup-list__item--done .setup-list__body a { color: var(--text-2); text-decoration: line-through; }

/* Hilfe-Ansicht */
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.help-grid > .card { margin-bottom: 0; }
.help-links { margin: 0 0 var(--sp-2); padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--sp-1); }
.help-subtitle { margin-top: var(--sp-4); }
.help-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 0; }
/* v3.12.0 (M6) — Linkreihe wie im README: Demo, Handbuch, Roadmap, Discussions */
.help-links-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
/* v3.3.0 (F1021) — Flexibilität und Modul-3-Zeitfenster */
.flex-months summary { cursor: pointer; margin: var(--sp-2) 0; color: var(--text-2); }
/* v3.6.0 — Flexibilität lenkt: Ergebnis, Handlungssätze, Ampel, Hebel.
   Stufenfarben aus den Tokens (--success/--warning/--danger), Sonne in der
   Farbe der PV-Erzeugung (--util-pv_erzeugung, nur CSS — kein Canvas). */
.flex-result { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-4); min-width: 0; }
/* v3.12.0 (Sichtung S7) — Zeile: Grafik, Satz, Aktion rechts (schmal darunter); baut auf der Art „Zeile“ der Designsprache */
.flex-missing__list { list-style: none; margin: 0 0 var(--sp-2); padding: 0; }
.zeile { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--border-1); }
.zeile:first-child { border-top: 0; padding-top: 0; }
.zeile > .ico { flex: none; margin-top: var(--sp-0); }
.zeile__text { flex: 1 1 18rem; min-width: 0; max-width: 72ch; }
.zeile__aktion { flex: none; margin-left: auto; }
.flex-actions__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.flex-action { display: flex; gap: var(--sp-3); align-items: flex-start; }
.flex-action__icon { font-size: var(--fs-xl); line-height: 1.2; flex: 0 0 1.6em; text-align: center; }
.flex-action__body { min-width: 0; }
.flex-action__other { display: block; margin-top: var(--sp-0); }
.flex-tag { font-weight: 600; white-space: nowrap; }
.flex-tag--real { background: var(--success-soft); color: var(--success); }
.flex-tag--dynamic { background: var(--bg-2); color: var(--text-2); }
.flex-tag--assumed { background: var(--warning-soft); color: var(--warning); }
/* v3.6.0 (Paket flexplus) — Auto mit Steckzeiten aus evcc */
.flex-tag--sessions { background: var(--success-soft); color: var(--success); }
/* v3.7.0 — eigener Wert aus den Einstellungen statt Beispielwert */
.flex-tag--own { background: var(--success-soft); color: var(--success); }
/* v3.7.0 (#33) — Bonus als eigene Zeile unter der Kachel „Kosten“ */
.kpi__bonus { color: var(--success); }
/* Nachtrag — reiner Börsenanteil: „netto, ohne USt“ (neben den Hebeln inkl. USt) */
.flex-tag--net { background: var(--bg-2); color: var(--text-2); font-weight: 500; font-size: var(--fs-xs); }
.flex-ampel__head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.flex-ampel__head .card__title { margin: 0; }
.flex-ampel__sub { font-size: var(--fs-sm); color: var(--text-2); margin: var(--sp-4) 0 var(--sp-2); }
.flex-lv--cheap { --flex-lv: var(--success); }
.flex-lv--mid { --flex-lv: var(--warning); }
.flex-lv--expensive { --flex-lv: var(--danger); }
.flex-lv--none { --flex-lv: var(--bg-3); }
.flex-band { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: var(--sp-0); }
.flex-band__h { display: grid; grid-template-rows: 1.15em 1.9em 1.15em; text-align: center; min-width: 0; }
.flex-band__sun { font-size: var(--fs-xs); line-height: 1.15em; overflow: hidden; }
.flex-sun--strong { color: var(--util-pv_erzeugung, var(--warning)); --ico: currentColor; --ico-f: transparent; }
.flex-sun--some { color: var(--util-pv_erzeugung, var(--warning)); opacity: .55; --ico: currentColor; --ico-f: transparent; }
.flex-band__cell .ico, .flex-key .ico { width: 12px; height: 12px; vertical-align: -1px; --ico: currentColor; --ico-f: transparent; }
.flex-band__cell { background: color-mix(in srgb, var(--flex-lv) 58%, var(--bg-1)); border-radius: var(--r-sm); font-size: var(--fs-xs); line-height: 1.9em; color: var(--text-1); overflow: hidden; }
.flex-band__label { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.15em; font-variant-numeric: tabular-nums; }
.flex-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; margin: var(--sp-2) 0; }
.flex-key { display: inline-block; min-width: 1.5em; text-align: center; border-radius: var(--r-sm); font-size: var(--fs-xs); background: color-mix(in srgb, var(--flex-lv, transparent) 58%, var(--bg-1)); }
.flex-key.flex-sun--strong { background: none; font-size: var(--fs-sm); }
.flex-ampel__summary { font-weight: 600; margin: var(--sp-2) 0; }
.flex-week-wrap { min-width: 0; }
.flex-week { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 1px; }
.flex-week th { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); padding: 0; text-align: center; overflow: hidden; }
.flex-week thead td, .flex-week tbody th { width: 2.4em; text-align: left; }
.flex-week td { height: 16px; padding: 0; background: color-mix(in srgb, var(--flex-lv) 58%, var(--bg-1)); border-radius: var(--r-sm); }
.flex-week thead td { background: none; }
.flex-solar__bars { display: flex; height: 12px; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); margin: var(--sp-2) 0 var(--sp-3); }
.flex-solar__bar--self { background: var(--util-pv_erzeugung, var(--warning)); }
.flex-solar__bar--more { background: color-mix(in srgb, var(--util-pv_erzeugung, var(--warning)) 40%, var(--bg-2)); }
/* Telefon: Betrag und Signal bleiben sichtbar, die Nebenspalte entfällt (die Tabelle passt ohne Querscrollen) */
@media (max-width: 600px) { .flex-col-opt { display: none; } }
.flex-check { margin-top: var(--sp-6); }
.flex-check__title { font-size: var(--fs-lg); font-weight: 600; margin: var(--sp-5) 0 var(--sp-1); }

/* v3.2.0 — Anwendungsfälle */
.help-cases__list { margin: var(--sp-2) 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--sp-3) var(--sp-5); }
.help-cases__item dt { font-weight: 600; margin-bottom: var(--sp-1); }
.help-cases__item dd { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.help-glossary .card__head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.help-glossary__search { max-width: 260px; }
.glossary-list { margin: var(--sp-3) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-3) var(--sp-5); }
.glossary-list__item { scroll-margin-top: 80px; padding: var(--sp-2); border-radius: var(--r-sm); }
.glossary-list__item dt { font-weight: 600; margin-bottom: var(--sp-0); }
.glossary-list__item dd { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.glossary-list__item--focus { background: var(--c-blue-soft); }

/* v3.4.0 (N1019) — Handbuch in der App (views/help-doc.js, lib/markdown.js).
   Tabellen und Codeblöcke scrollen in sich, damit die Seite am iPhone nicht
   breiter wird; position: relative, damit der Rahmen alles beschneidet. */
.help-docs__open { margin: 0 0 var(--sp-3); }
.help-cases__item dd.help-cases__more { margin-top: var(--sp-1); }
.help-doc { max-width: 920px; }
.doc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); font-size: var(--fs-sm); }
.doc-bar__path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); color: var(--text-2); }
.doc-langs { display: inline-flex; gap: var(--sp-0); padding: var(--sp-0); border: 1px solid var(--border-2); border-radius: var(--r-sm); }
.doc-langs__item { display: inline-flex; align-items: center; min-height: 32px; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); }
.doc-langs__item--current { background: var(--bg-3); color: var(--text-1); font-weight: 600; }.doc-toc { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--r-md); }
.doc-toc summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.doc-body .doc-toc__list { margin: var(--sp-2) 0 0; padding: 0; list-style: none; columns: 2 280px; column-gap: var(--sp-6); font-size: var(--fs-sm); line-height: 1.5; }
.doc-body .doc-toc__item { break-inside: avoid; margin: var(--sp-1) 0; }
.doc-body .doc-toc__item--3 { padding-left: 1.2em; font-size: var(--fs-xs); }
.doc-body { line-height: 1.6; overflow-wrap: break-word; }
.doc-body [id] { scroll-margin-top: calc(var(--topbar-total) + 12px); }
.doc-body picture { display: block; max-width: 100%; }
.doc-body h1 { font-size: var(--fs-2xl); line-height: 1.2; margin: 0 0 var(--sp-4); }
.doc-body h2 { font-size: var(--fs-xl); line-height: 1.3; margin: var(--sp-8) 0 var(--sp-3); padding-bottom: var(--sp-1h); border-bottom: 1px solid var(--border-1); }
.doc-body h3 { font-size: var(--fs-lg); margin: var(--sp-6) 0 var(--sp-2); }
.doc-body h4, .doc-body h5, .doc-body h6 { font-size: var(--fs-md); margin: var(--sp-4) 0 var(--sp-2); }
.doc-body p, .doc-body ul, .doc-body ol, .doc-body blockquote, .doc-body .doc-table, .doc-body .doc-code { margin: 0 0 var(--sp-3); }
.doc-body li > ul, .doc-body li > ol, .doc-body li > p { margin: var(--sp-1) 0; }
.doc-body li + li { margin-top: var(--sp-0); }
/* v3.12.0 (M6) — Zitate der Doku sind Infoboxen (lib/markdown.js); Text in voller Stärke, Rand nach unten wie Absätze */
.doc-body blockquote.infobox { margin: 0 0 var(--sp-4); max-width: 72ch; }
.doc-body blockquote.infobox > * { margin: 0 0 var(--sp-2); }
.doc-body blockquote > :last-child { margin-bottom: 0; }
.doc-body hr { border: 0; border-top: 1px solid var(--border-1); margin: var(--sp-6) 0; }
.doc-body code { font-family: var(--font-code); font-size: 0.9em; padding: var(--sp-0) var(--sp-1); background: var(--bg-2); border-radius: var(--r-sm); overflow-wrap: anywhere; }
.doc-body img { max-width: 100%; height: auto; border: 1px solid var(--border-1); border-radius: var(--r-sm); }
.doc-body input[type="checkbox"] { margin: 0 var(--sp-1h) 0 0; vertical-align: middle; }
.doc-figures { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3); }
.doc-code { position: relative; max-width: 100%; overflow-x: auto; padding: var(--sp-3); background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-md); font-size: var(--fs-xs); line-height: 1.5; -webkit-overflow-scrolling: touch; }
.doc-body .doc-code code, .doc-code code { padding: 0; background: none; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.doc-plain code { white-space: pre-wrap; }
.doc-table { position: relative; max-width: 100%; overflow-x: auto; border: 1px solid var(--border-1); border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.doc-table table { min-width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.doc-table th, .doc-table td { padding: var(--sp-1h) var(--sp-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-1); }
.doc-table thead th { background: var(--bg-2); font-weight: 600; }
.doc-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) {
  .doc-body h1 { font-size: var(--fs-xl); }
  .doc-body h2 { font-size: var(--fs-lg); }
}

/* v2.13.0 — Quellenangabe unter Diagrammen */
.attribution { margin: var(--sp-2) 0 0; }

/* v2.13.0 — Schalter mit ⓘ daneben */
.toggle-wrap { display: inline-flex; align-items: center; }

/* v2.13.0 (Review UI-17) — Einzelposten der Sonderzahlungen zum Aufklappen
   (vorher nur im Tooltip, auf dem iPhone unsichtbar) */
.special-details > summary { cursor: pointer; list-style: none; }
.special-details > summary::-webkit-details-marker { display: none; }
.special-details > summary::after { content: ' ▾'; font-size: var(--fs-xs); color: var(--text-2); }
.special-details[open] > summary::after { content: ' ▴'; }
.special-details__list { margin: var(--sp-1) 0 0; padding: 0; list-style: none; text-align: left; min-width: 14rem; font-size: var(--fs-xs); color: var(--text-2); white-space: normal; }
.special-details__list li + li { margin-top: var(--sp-1); }
.contracts-table .tariff-part { white-space: nowrap; }

/* v2.13.0 — Leerzustand der Verbrauchsansicht */
.empty-card p { max-width: 62ch; color: var(--text-2); margin: 0 0 var(--sp-3); }

/* v3.0.0 — Öffentliche Demo (GitHub Pages): Kennzeichen in der Kopfleiste und
   Hinweisleiste unten. Die Leiste liegt außerhalb des Seitenrasters (fest
   positioniert) und auf dem iPhone über der Tab-Leiste. */
.demo-chip {
  margin-left: var(--sp-2); padding: var(--sp-0) var(--sp-2); border-radius: var(--r-sm);
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
/* v3.7.1 — Umgebungsname im Design des Demo-Abzeichens: kein Knopf, nie umbrochen */
.demo-chip--env { cursor: default; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 420px) {
  .topbar__brand:has(.demo-chip--env) .topbar__title { display: none; }
  /* v3.9.0 — mit „Abmelden“ und zwölf Zeichen ragte die Kopfzeile am iPhone 5 px über:
     engere Abstände, und ein sehr langer Name endet mit „…“ statt die Zeile zu sprengen */
  .topbar__brand:has(.demo-chip--env), .topbar:has(.demo-chip--env) .topbar__actions { gap: var(--sp-2); }
  .demo-chip--env { margin-left: 0; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
}
.demo-bar {
  position: fixed; z-index: 55; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  width: min(760px, calc(100vw - 2 * var(--sp-4)));
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--bg-1); color: var(--text-1);
  border: 1px solid var(--accent);
}
.demo-bar__text { flex: 1 1 22rem; margin: 0; font-size: var(--fs-sm); }
.demo-bar__news { flex-basis: 100%; margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.demo-bar__lang { font: inherit; font-size: var(--fs-sm); min-height: 32px; }
.demo-bar__close {
  min-width: 32px; min-height: 32px; border: none; background: none;
  color: var(--text-2); font-size: var(--fs-lg); line-height: 1; cursor: pointer;
}
/* v3.12.0 (Skeptiker N10) — am Telefon kürzer: Die Leiste deckte mit der Zeile „Neu in …“ gut ein Fünftel der Höhe */
@media (max-width: 599.98px) {
  .demo-bar { padding: var(--sp-2) var(--sp-3); gap: var(--sp-1) var(--sp-2); }
  .demo-bar__text { flex-basis: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* v3.12.0 — „Was bringt dir das?“ auf der Karte KI-Assistenten */
.mcp-value { margin: var(--sp-2) 0; display: grid; gap: var(--sp-3); }
.mcp-value dt { font-weight: 600; font-size: var(--fs-sm); }
.mcp-value dd { margin: var(--sp-1) 0 0; font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
/* v3.12.0 (Skeptiker M1) — schmal: der Satz zuerst, „Übernehmen“ und „Ablehnen“ sichtbar, ohne die Tabelle zu schieben */
@media (max-width: 899.98px) {
  .mcp-proposals, .mcp-proposals tbody { display: block; }
  .mcp-proposals thead { display: none; }
  .mcp-proposals tr { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: var(--sp-3); }
  .mcp-proposals tr + tr { border-top: 1px solid var(--border-1); }
  .mcp-proposals td { border: 0; padding: 0; font-size: var(--fs-sm); color: var(--text-2); }
  .mcp-proposals td[data-label]::before { content: attr(data-label) ": "; }
  .mcp-proposals td[data-role="mcp-proposal-summary"] { order: -1; flex-basis: 100%; color: inherit; font-size: inherit; overflow-wrap: anywhere; }
  .mcp-proposals td[data-role="mcp-proposal-actions"] { flex-basis: 100%; display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
  .mcp-proposals td[data-role="mcp-proposal-actions"] .btn { flex: 1; min-height: 44px; }
}
@media (max-width: 899.98px) {
  .demo-bar { bottom: calc(var(--tabbar-h) + var(--sp-3) + env(safe-area-inset-bottom, 0px)); }
  .demo-bar__lang, .demo-bar__close { min-height: 44px; }
  .demo-bar__close { min-width: 44px; }
}

/* v3.1.0 (Paket H2) — Belege: Vorschaubild in der Ablesetabelle, Großansicht */
.icon-btn--thumb { padding: 0; width: 36px; height: 36px; overflow: hidden; vertical-align: middle; }
.reading-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); display: block; }
.photo-lightbox { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--r-sm); }
.settings-card__hint--warn { color: var(--warning); }

/* ── v3.2.0 (F1020) — Schaubilder (components/explainer.js) ─────────────
   Ausgangszustände gelten erst mit .ex--ready (playExplainers); ohne Skript
   und beim Drucken steht das Endbild. Bei „Bewegung reduzieren“ gibt es keine
   Animation, nur das Endbild. */
.explainer { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
/* v3.9.0 (A1) — Titel der Schaubilder im Stil der Kartentitel (.card__title) */
.explainer__title { font-size: var(--fs-base); font-weight: 600; color: var(--text-1); }
.explainer__svg { width: 100%; max-width: 560px; height: auto; overflow: visible; }
.explainer__text { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.explainer .ex-label { fill: var(--text-1); font-size: var(--fs-xs); font-family: var(--font-sans, inherit); }
.explainer .ex-small { font-size: var(--fs-xs); }
.explainer .ex-muted { fill: var(--text-2); }
.explainer .ex-value { font-size: var(--fs-xs); }
.explainer .ex-icon { font-size: var(--fs-lg); }
.explainer .ex-bar--paid { fill: var(--accent); }
.explainer .ex-bar--estimate { opacity: .3; stroke: currentColor; stroke-dasharray: 3 2; }
.explainer .ex-bar--prev { fill: var(--text-2); opacity: .45; }
.explainer .ex-bar--now { fill: var(--accent); }
.explainer .ex-bar--cold { fill: var(--info); }
.explainer .ex-gap--credit { fill: var(--success); }
.explainer .ex-gap--due { fill: var(--warning); }
.explainer .ex-badge { stroke: none; }
.explainer .ex-badge--less { fill: var(--success-soft, rgba(45,232,164,.14)); }
.explainer .ex-badge--more { fill: var(--warning-soft, rgba(245,200,66,.16)); }
.explainer .ex-badge--same { fill: var(--bg-2); }
.explainer .ex-badge__text { font-weight: 600; }
/* Zeitstrahl (v3.4.0 F1026: Preisgarantie, Folgevertrag, Fenster um heute) */
.explainer .ex-axis { stroke: var(--border-2); stroke-width: 3; stroke-linecap: round; }
.explainer .ex-axis--cut { stroke-dasharray: 2 3; stroke-linecap: butt; }
.explainer .ex-progress { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.explainer .ex-range--guarantee { stroke: var(--success); stroke-width: 7; stroke-linecap: round; opacity: .35; }
.explainer .ex-range--next { stroke: var(--info); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 3; }
.explainer .ex-range--gap { stroke: var(--danger); stroke-width: 3; stroke-dasharray: 2 3; }
.explainer .ex-mark circle { fill: var(--bg-1); stroke: var(--text-1); stroke-width: 2; }
.explainer .ex-mark--cancel circle { stroke: var(--warning); }
.explainer .ex-mark--missed circle { stroke: var(--danger); fill: var(--danger); }
.explainer .ex-mark--price circle { stroke: var(--danger); }
.explainer .ex-mark--guarantee circle { stroke: var(--success); }
.explainer .ex-mark--minTerm circle { stroke: var(--text-2); }
.explainer .ex-mark--earliest circle { stroke: var(--accent); stroke-dasharray: 2 2; }
.explainer .ex-mark--successor circle { stroke: var(--info); fill: var(--info); }
.explainer .ex-mark--past circle { opacity: .7; }
.explainer .ex-mark--clip circle { stroke-dasharray: 2 2; }
.explainer .ex-today line { stroke: var(--accent); stroke-width: 2; }

.explainer.ex--ready .ex-grow { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }
.explainer.ex--ready .ex-fade { opacity: 0; }
.explainer.ex--play .ex-grow { animation: ex-grow .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: var(--d, 0s); }
.explainer.ex--play .ex-fade { animation: ex-fade .6s ease-out forwards; animation-delay: var(--d, .6s); }
@keyframes ex-grow { to { transform: scaleX(1); } }
@keyframes ex-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .explainer.ex--ready .ex-grow { transform: none; }
  .explainer.ex--ready .ex-fade { opacity: 1; }
  .explainer.ex--play .ex-grow, .explainer.ex--play .ex-fade { animation: none; }
}
@media print {
  .explainer .ex-grow { transform: none !important; animation: none !important; }
  .explainer .ex-fade { opacity: 1 !important; animation: none !important; }
}
/* Schaubilder: drei gleiche Spalten, der Energiefluss bekommt eine eigene Reihe */
.explainer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); align-items: stretch; }
.dash-explainer:has(.ex-energy) { grid-column: 1 / -1; order: 9; }
@media (max-width: 899.98px) { .explainer-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── v3.4.0 (F1026) — Energiefluss im Haus (components/energy-flow.js) ──
   Farben aus der Utilities-SSOT (--util-*, je Thema getönt von
   utility-theme.js), Rückfall auf Token, wenn eine Art nicht aktiv ist.
   Ausgangszustände der Bewegung nur zwischen .ex--ready und .ex--play; ohne
   Skript, im Druck und bei „Bewegung reduzieren“ steht das Endbild mit
   Pfeilen statt Punkten. */
.ef-c-pv   { --c: var(--util-pv_erzeugung, var(--warning)); }
.ef-c-feed { --c: var(--util-pv_einspeisung, var(--success)); }
.ef-c-grid { --c: var(--util-strom, var(--info)); }
.ef-c-bat  { --c: var(--accent); }
.ef-c-hp   { --c: var(--util-waerme, var(--danger)); }
.ef-c-ev   { --c: var(--util-strom, var(--info)); }
.ef-c-rest { --c: var(--text-2); }
.ef-c-house { --c: var(--text-1); }
.ef-period { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.ef-step { display: inline-flex; align-items: center; gap: var(--sp-1); }
.ef-step__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; min-height: 30px; padding: 0 var(--sp-2); background: var(--bg-1); color: var(--text-1);
  border: 1px solid var(--border-2); border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.ef-step__btn:hover:not(:disabled) { background: var(--bg-2); }
.ef-step__btn:disabled { opacity: .4; cursor: default; }
.ef-period__label { min-width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.ef-stage { position: relative; }
.explainer__svg.ef { display: block; margin: 0 auto; max-width: 380px; }
.ef-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ef-chip {
  min-height: 32px; padding: var(--sp-1) var(--sp-3); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border-2));
  border-radius: var(--r-sm); background: transparent; color: var(--text-1); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.ef-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); }
.ef-detail { margin: 0; min-height: 1.4em; font-size: var(--fs-sm); color: var(--text-1); }
.ef-detail:empty { min-height: 0; }.ef .ef-track { fill: none; stroke: var(--border-2); stroke-width: 1.5; }
.ef .ef-band { fill: none; stroke: var(--c); stroke-linecap: round; opacity: .38; transition: stroke-width .6s ease, opacity .4s ease; }
.ef .ef-calc { fill: none; stroke: var(--bg-1); stroke-dasharray: 3 4; stroke-linecap: butt; transition: stroke-width .6s ease, opacity .4s ease; }
.ef .ef-bridge { fill: none; stroke: var(--bg-1); stroke-width: 12; }
.ef .ef-dot { fill: var(--c); }
.ef .ef-arrow { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: none; }
.ef .ef-flow--off .ef-band, .ef .ef-flow--off .ef-calc, .ef .ef-flow--off .ef-arrow { opacity: 0; }
.ef .ef-flow--off.ef-flow--bridge { opacity: 0; }
.ef .ef-disc { fill: var(--bg-2); stroke: var(--border-2); stroke-width: 1; }
.ef .ef-arc { fill: none; stroke: var(--c); stroke-width: 4; transition: stroke-dasharray .6s ease, stroke-dashoffset .6s ease; }
.ef .ef-icon { color: var(--c); }
.ef .ef-ico { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ef .ef-ico .ef-batfill { fill: currentColor; stroke: none; opacity: .35; transform-box: fill-box; transform-origin: bottom; }
.ef .ef-val { fill: var(--text-1); font-weight: 600; }
.ef .ef-val--sm { font-weight: 500; }
.ef .ef-val--out { fill: var(--util-pv_einspeisung, var(--success)); }
.ef .ef-unit, .ef .ef-name { fill: var(--text-2); font-family: var(--font-sans, inherit); }
.ef .ef-node { cursor: pointer; transition: opacity .3s; }
.ef .ef-node--hp, .ef .ef-node--ev, .ef .ef-node--rest { cursor: default; }
.ef .ef-flow { transition: opacity .3s; }
/* Hervorhebung: nur die Flüsse des gewählten Knotens bleiben kräftig */
.ef[data-focus] .ef-flow:not(.ef-on) { opacity: .12; }
.ef[data-focus] .ef-node:not(.ef-on) { opacity: .45; }
/* Einblendung: Knoten springen auf, Bänder zeichnen sich, Ringe drehen ein,
   dann setzen die Punkte ein; dauerhaft drehen Sonnenstrahlen und Lüfter */
.explainer.ex--ready:not(.ex--play) .ef-node, .explainer.ex--ready:not(.ex--play) .ef-dots { opacity: 0; }
.explainer.ex--ready:not(.ex--play) .ef-band { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
.explainer.ex--play .ef-node { animation: ef-pop .55s cubic-bezier(.2, .9, .3, 1.35) backwards; animation-delay: var(--d); transform-box: fill-box; transform-origin: center; }
.explainer.ex--play .ef-band { stroke-dasharray: var(--len) var(--len); animation: ef-draw .8s cubic-bezier(.3, .7, .2, 1) backwards; animation-delay: var(--d); }
.explainer.ex--play .ef-arc { animation: ef-ring 1s cubic-bezier(.3, .7, .2, 1) backwards; animation-delay: var(--d); }
.explainer.ex--play .ef-dots { animation: ef-in .5s ease-out 1.35s backwards; }
.explainer.ex--play .ef-rays { animation: ef-spin 30s linear infinite; transform-box: fill-box; transform-origin: center; }
.explainer.ex--play .ef-fan { animation: ef-spin 3s linear infinite; transform-box: fill-box; transform-origin: center; }
.explainer.ex--play .ef-batfill { animation: ef-fill 1.2s ease-out 1s backwards; }
.ef.ef--enter { animation: ef-in .35s ease-out; }
@keyframes ef-in { from { opacity: 0; } }
@keyframes ef-pop { from { opacity: 0; transform: scale(.55); } }
@keyframes ef-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes ef-ring { from { stroke-dasharray: 0 var(--cl, 400); } }
@keyframes ef-spin { to { transform: rotate(360deg); } }
@keyframes ef-fill { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) {
  .explainer .ef-node, .explainer .ef-band, .explainer .ef-arc, .explainer .ef-dots, .explainer .ef-rays,
  .explainer .ef-fan, .explainer .ef-batfill, .ef.ef--enter { animation: none !important; transition: none !important; opacity: 1; stroke-dashoffset: 0; }
  .explainer .ef-dots { display: none; }
  .explainer .ef-arrow { display: inline; }
}
@media print {
  .explainer .ef-node, .explainer .ef-arc { animation: none !important; opacity: 1 !important; }
  .explainer .ef-band { animation: none !important; stroke-dashoffset: 0 !important; }
  .explainer .ef-dots, .ef-period, .ef-detail { display: none; }
  .explainer .ef-arrow { display: inline; }
}
/* v3.5.0 (F1027) — Tagesfilm: Auswahl (Ein Tag / Typischer Tag, Monat, Tag),
   Abspieler mit Schieberegler, Leiste mit Börsenpreis, Lücken und Cursor */
.ef-day { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.ef-day__mode { display: inline-flex; align-items: center; gap: var(--sp-1); }
.ef-day__pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ef-pick { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); max-width: 100%; }
.ef-pick__label { color: var(--text-2); }
.ef-pick select { min-height: 36px; max-width: 100%; }
.ef-day__status { flex-basis: 100%; margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.ef-player { display: flex; flex-direction: column; gap: var(--sp-0); }
.ef-player__row { display: flex; align-items: center; gap: var(--sp-2); }
.ef-play {
  min-width: 40px; min-height: 40px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: transparent; color: var(--text-1); font: inherit; cursor: pointer;
}
.ef-play--on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.ef-slider { flex: 1; min-width: 0; min-height: 32px; accent-color: var(--accent); }
.ef-time { min-width: 3.2em; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); text-align: right; }
.ef-strip { display: block; width: 100%; height: 40px; }
.ef-strip__base { fill: var(--border-1); }
.ef-strip__gap { fill: var(--danger); }
.ef-strip__price { fill: none; stroke: var(--text-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ef-strip__zero { stroke: var(--border-2); stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.ef-strip__cursor { stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ef-price, .ef-sums { margin: 0; font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
/* Im Film wechseln die Viertelstunden schneller als die Übergänge von Jahr und Monat */
.ef--film .ef .ef-band, .ef--film .ef .ef-calc, .ef--film .ef .ef-arc { transition-duration: .15s; }
@media (prefers-reduced-motion: reduce) {
  .ef--film .ef .ef-band, .ef--film .ef .ef-calc, .ef--film .ef .ef-arc { transition: none; }
}
@media print { .ef-day, .ef-player, .ef-sums { display: none; } }

/* v3.2.0 (F1019) — Übersicht der Einsteiger: drei Antworten */
.dash-answer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.dash-answer__row { display: flex; gap: var(--sp-2); align-items: baseline; }
.dash-explainer + .dash-explainer { border-top: 1px solid var(--border-1); padding-top: var(--sp-4); }
@media (min-width: 900px) { .dash-explainer + .dash-explainer { border-top: 0; padding-top: 0; } }

/* ── v3.2.0 (F1018) — Einrichtungsassistent ─────────────────────────── */
.setup { display: flex; flex-direction: column; gap: var(--sp-3); }
.setup__question { margin: 0; font-size: var(--fs-lg); }
.setup__progress { margin-right: auto; }
.setup-choices { display: grid; gap: var(--sp-2); }
@media (min-width: 640px) { .setup-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.setup-choice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3); border: 1px solid var(--border-2); border-radius: var(--r-md);
  cursor: pointer; background: var(--bg-1);
}
/* v3.5.1 — Hover nur mit echter Maus: Safari am iPad lässt :hover nach dem
   Antippen stehen; der Fokusrahmen nur bei Tastatur (:focus-visible), sonst
   wirkten am iPad mehrere Karten ausgewählt. */
@media (hover: hover) { .setup-choice:hover { border-color: var(--border-strong); } }
.setup-choice--on { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.setup-choice input { position: absolute; opacity: 0; pointer-events: none; }
.setup-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.setup-choice__icon { line-height: 0; }
.setup-choice__body { display: flex; flex-direction: column; gap: var(--sp-0); }
.setup-utilities { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-2); }
/* v3.5.0 (N1022) — Schritt 1: was das Länderprofil setzt, als kurze Liste */
.setup .fgrid { margin-bottom: calc(-1 * var(--sp-4)); }
.setup-profile {
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-1); border-radius: var(--r-md);
  background: var(--bg-2);
}
.setup-profile__title { margin: 0 0 var(--sp-2); font-weight: 600; font-size: var(--fs-sm); }
.setup-profile__list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-2);
}
.setup-profile__row { min-width: 0; }
.setup-profile__row dt { font-size: var(--fs-xs); color: var(--text-2); }
.setup-profile__row dd { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.setup-profile > :last-child { margin-bottom: 0; }
/* v3.5.0 — Dialog „Jahresbericht“; Teilbericht in der Druckansicht kenntlich */
.report-print__partial { margin: 0 0 var(--sp-3); font-weight: 600; }
.settings-level-list { margin: var(--sp-2) 0 var(--sp-3); padding-left: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sm); }
.settings-subtitle { font-size: var(--fs-md); margin: var(--sp-4) 0 var(--sp-2); }

/* ── v3.9.0 (Paket oberflaeche) — Personen im Haushalt ─────────────────
   Liste mit Name, Nummer und Aktionen; am Telefon rutschen die Aktionen unter
   den Namen. Anlegen: ein Feld und ein Knopf in einer Zeile (gleich hoch über
   --control-h). */
.people-list { list-style: none; margin: 0 0 var(--sp-3); padding: 0; border-top: 1px solid var(--border-1); }
.people-list__item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-1);
}
.people-list__who { min-width: 0; overflow-wrap: anywhere; }
.people-list__name { font-weight: 600; }
.people-list__actions { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; }
.people-add { display: flex; align-items: flex-end; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.people-add .field { flex: 1 1 12rem; margin-bottom: 0; }
.people-add .btn { min-height: var(--control-h); flex: none; }
/* Benutzer und Rechte: Rollenauswahl schrumpft nicht auf ihren Pfeil, Aktionen umbrechen */
.users-table .select { min-width: 8.5rem; }
.users-table .row-actions { flex-wrap: wrap; }
/* am Telefon je Person ein Block: Name und Rolle oben, Aktionen darunter in voller Breite
   (in der Tabelle waren sie am rechten Rand abgeschnitten) */
@media (max-width: 600px) {
  .users-table, .users-table tbody { display: block; }
  .users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .users-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3); border-bottom: 1px solid var(--border-1); }
  .users-table tr:last-child { border-bottom: 0; }
  .users-table td { padding: 0; border: 0; }
  .users-table td.row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ── v3.9.0 (Paket oberflaeche) — Illustrationen (lib/illustrations.js) ──
   Gemeinsame Grundlage für Zeichnungen der Ersteinrichtung und die Schaltbilder
   des Assistenten „Messkonzept“: Strichzeichnung wie die Piktogramme des
   Energieflusses (.ef-ico), Farben aus den Tokens, hell und dunkel über die
   Themen-Variablen. Die Variablen stehen in tokens.css (--ill-*). */
.ill { display: block; width: 100%; height: auto; overflow: visible; color: var(--ill-line); }
.ill * { vector-effect: non-scaling-stroke; }
.ill .ill-line   { fill: none; stroke: var(--ill-line); stroke-width: var(--ill-stroke); stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-ink    { fill: none; stroke: var(--ill-ink); stroke-width: var(--ill-stroke-strong); stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-accent { fill: none; stroke: var(--ill-accent); stroke-width: var(--ill-stroke-strong); stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-fill   { fill: var(--ill-fill); stroke: none; }
.ill .ill-face   { fill: var(--ill-surface); stroke: var(--ill-line); stroke-width: var(--ill-stroke); stroke-linejoin: round; }
.ill .ill-ground { fill: none; stroke: var(--ill-ground); stroke-width: var(--ill-stroke); stroke-linecap: round; }
.ill .ill-dot    { fill: var(--ill-accent); stroke: none; }
.ill .ill-text   { fill: var(--ill-ink); font-size: var(--fs-xs); stroke: none; }
/* Farbe einer Verbrauchsart: --c am Element, Rückfall der Akzent (wie .ef-c-*) */
.ill .ill-util   { fill: none; stroke: var(--c, var(--ill-accent)); stroke-width: var(--ill-stroke-strong); stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-util-fill { fill: color-mix(in srgb, var(--c, var(--ill-accent)) 16%, transparent); stroke: none; }
.ill-c-strom   { --c: var(--util-strom, var(--info)); }
.ill-c-gas     { --c: var(--util-gas, var(--warning)); }
.ill-c-wasser  { --c: var(--util-wasser, var(--info)); }
.ill-c-waerme  { --c: var(--util-waerme, var(--danger)); }
.ill-c-pv      { --c: var(--util-pv_erzeugung, var(--warning)); }
.ill-c-feed    { --c: var(--util-pv_einspeisung, var(--success)); }
/* v3.9.0 (Paket messkonzepte) — Schaltbilder: Knoten an Abzweigen, kleine Beschriftung (Zählwerke, „Z1 − Z2“) */
.ill .ill-node  { fill: var(--ill-ink); stroke: none; }
.ill .ill-small { fill: var(--ill-line); font-size: var(--fs-xs); stroke: none; }

/* v3.12.0 (Paket wegweiser) — Schaubilder im Wegweiser (lib/setup-scenes.js). Die Schriftgröße
   setzt der Code je Fassung (er braucht sie auch zum Umbrechen), hier stehen nur Farbe und Schnitt. */
.ill .ill-zone       { fill: color-mix(in srgb, var(--accent) 4%, transparent); stroke: none; }
.ill .ill-boundary   { fill: none; stroke: var(--ill-ink); stroke-width: var(--ill-stroke-strong); stroke-dasharray: 7 5; stroke-linecap: round; }
.ill .ill-frame      { fill: none; stroke: var(--ill-line); stroke-width: 1px; }
.ill .ill-flow       { fill: none; stroke: var(--ill-line); stroke-width: var(--ill-stroke); stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-flow--ink  { stroke: var(--ill-ink); stroke-width: var(--ill-stroke-strong); }
.ill .ill-flow--out  { stroke: var(--ill-accent); stroke-width: var(--ill-stroke-strong); }
.ill .ill-flow--dash { stroke-dasharray: 5 4; }
.ill .ill-name       { fill: var(--ill-ink); font-family: var(--font-sans); font-weight: 600; stroke: none; }
.ill .ill-sub        { fill: var(--ill-line); font-family: var(--font-sans); stroke: none; }
.ill .ill-port       { fill: var(--ill-ink); stroke: none; }
.ill .ill-flow-label { fill: var(--ill-line); font-family: var(--font-sans); stroke: none; }
.ill .ill-zone-label { fill: var(--ill-ink); font-family: var(--font-sans); font-weight: 600; stroke: none; }
.ill .ill-frame-label { fill: var(--ill-line); font-family: var(--font-sans); font-weight: 600; stroke: none; }
.ill--thumb { width: auto; height: 32px; }
.guide-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.guide-hero > div { flex: 1 1 18rem; }
.guide-hero p { margin: 0; }
.guide-intro { max-width: 46rem; margin: 0 0 var(--sp-3); }
.guide-quick__form { display: flex; flex-direction: column; gap: var(--sp-2); }
.guide-q { border: 0; margin: 0; padding: 0; }
.guide-q > legend { padding: 0; margin-bottom: var(--sp-1); font-size: var(--fs-sm); font-weight: 600; }
.guide-q__options { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.guide-chip { position: relative; cursor: pointer; }
.guide-chip input { position: absolute; opacity: 0; pointer-events: none; }
.guide-chip > span { display: inline-block; padding: var(--sp-1h) var(--sp-3); min-height: 36px; font-size: var(--fs-sm); line-height: 24px;
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--r-md); }
.guide-chip input:checked + span { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; font-weight: 600; }
.guide-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.guide-result { margin-top: var(--sp-3); }
.guide-result p { margin: 0 0 var(--sp-1); }
.guide-none { margin: var(--sp-3) 0; }
.guide-tiles { gap: var(--sp-3); margin-bottom: var(--sp-4); }
.guide-tile { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3); color: inherit; text-decoration: none;
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--r-md); }
.guide-tile:hover { border-color: var(--ill-accent); }
.guide-tile--on { border-color: var(--ill-accent); }
.guide-tile__art { display: block; margin-bottom: var(--sp-1); }
.guide-scenario { scroll-margin-top: calc(var(--topbar-total) + 12px); }
.guide-scenario > .card__title { margin-bottom: var(--sp-1); font-size: var(--fs-xl); font-weight: 600; color: var(--text-1); text-transform: none; }
.guide-scenario__teaser { margin: 0 0 var(--sp-3); color: var(--text-2); }
.guide-figure { margin: 0 0 var(--sp-3); }
/* Zwei Fassungen desselben Bilds: Skalieren ergäbe am Handy winzige Schrift. */
.guide-scene { container-type: inline-size; margin-bottom: var(--sp-3); }
.guide-scene__wide { max-width: 56rem; margin-inline: auto; }
.guide-scene__narrow { display: none; max-width: 26rem; margin-inline: auto; }
@container (max-width: 46rem) {
  .guide-scene__wide { display: none; }
  .guide-scene__narrow { display: block; }
}
.guide-flows { font-size: var(--fs-sm); color: var(--text-2); }
.guide-flows__title { margin: var(--sp-2) 0 var(--sp-0); font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }
.guide-flows ul { margin: 0; padding-left: 1.2em; }
.guide-blocks { display: grid; gap: var(--sp-3) var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); margin-bottom: var(--sp-3); }
.guide-block h3 { margin-bottom: var(--sp-1); font-size: var(--fs-md); font-weight: 600; }
.guide-block p { margin: 0 0 var(--sp-2); }
.guide-block--wide { margin-bottom: var(--sp-3); }
.guide-list { margin: 0; padding-left: 1.2em; }
.guide-list > li + li { margin-top: var(--sp-1); }
.guide-steps { margin: 0; padding-left: 1.4em; }
.guide-steps > li + li { margin-top: var(--sp-2); }
.guide-link { margin-right: var(--sp-2); overflow-wrap: anywhere; }
.guide-detail { border-top: 1px solid var(--border-1); padding-top: var(--sp-3); }
.guide-detail > summary { cursor: pointer; font-weight: 600; }
.guide-detail[open] > summary { margin-bottom: var(--sp-3); }
.guide-detail h4 { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 600; }
.guide-rows { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.guide-rows dt { font-weight: 600; font-size: var(--fs-sm); }
.guide-rows dd { margin: 0; }
.guide-detail code { overflow-wrap: anywhere; }
/* Kein Querscrollen am Handy: lange Zeilen brechen um, statt die Seite zu verbreitern. */
.guide-code { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; }
.guide-sources { margin: var(--sp-3) 0 0; }
/* Ersteinrichtung: kleines Bild neben der Frage, am Telefon darüber */
.setup__head { display: flex; align-items: center; gap: var(--sp-4); }
.setup__art { flex: none; width: 112px; }
.setup__lead { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.setup__lead > p { margin: 0; }
.setup-choice__art { flex: none; width: 40px; height: 40px; }
.setup-choice__art .ill { width: 40px; height: 40px; }
@media (max-width: 480px) {
  .setup__head { gap: var(--sp-3); }
  .setup__art { width: 76px; }
  /* Fußleiste: „Schritt n von m“ über den Knöpfen, damit „Los geht’s“ nicht umbricht */
  .modal__foot:has(.setup__progress) { flex-wrap: wrap; }
  .modal__foot .setup__progress { order: -1; flex-basis: 100%; margin: 0; text-align: center; }
}
/* v3.9.0 (F1032) — Assistent „Messkonzept“: Aufbauten als Karten mit Schaltbild,
   Stellen als Feldgruppen mit Kürzel (Z1, Z2 …), Zusammenfassung mit Legende */
.concept-setup { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.concept-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.concept-fieldset > legend { font-weight: 600; margin-bottom: var(--sp-1); padding: 0; }
.concept-fieldset > p { margin: var(--sp-1) 0 0; }
.concept-layouts { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.concept-layout { flex-direction: column; align-items: stretch; }
.concept-layout__art { display: block; padding: var(--sp-2); border-radius: var(--r-sm); background: var(--bg-2); }
.concept-layout--off { cursor: not-allowed; opacity: .6; }
.concept-slot { border: 1px solid var(--border-1); border-radius: var(--r-md); margin: 0; padding: var(--sp-3) var(--sp-4) 0; min-width: 0; }
.concept-slot > legend { padding: 0 var(--sp-1); font-weight: 600; }
.concept-slot > p { margin: 0 0 var(--sp-3); }
.concept-tag {
  display: inline-block; min-width: 2.2em; padding: 0 var(--sp-1h); border-radius: var(--r-sm); text-align: center;
  background: var(--bg-3); color: var(--text-1); font-size: var(--fs-xs); font-weight: 600;
}
.concept-summary { display: grid; gap: var(--sp-3); align-items: start; }
@media (min-width: 720px) { .concept-summary { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.concept-summary__art { padding: var(--sp-2); border-radius: var(--r-md); background: var(--bg-2); }
.concept-legend, .concept-actions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-1); }
.concept-actions { padding-left: var(--sp-4); list-style: disc; }

/* „empfohlen“ als Abzeichen in Textbreite, nicht über die ganze Karte */
.setup-choice__body .badge { align-self: flex-start; }
@media print { .setup__art { display: none; } }

/* v3.4.0 (N1020) — Sicherheits-Check unter Einstellungen → Zugriff und System */
.security-check { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
/* v3.5.1 — arbeitende Knöpfe (guardSubmit, Abrufe) zeigen ein drehendes Rad;
   bei „Bewegung reduzieren“ steht es still. Dazu ein Fortschrittsbalken für
   Abrufe in Schritten (Börsenpreise von SMARD). */
.btn[aria-busy="true"]::after {
  content: ''; display: inline-block; width: 0.9em; height: 0.9em; margin-left: 0.5em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -0.15em; animation: et-spin 0.8s linear infinite;
}
@keyframes et-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::after { animation: none; } }
.load-progress { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: var(--sp-2) 0; }
.load-progress progress { width: min(16rem, 100%); accent-color: var(--accent); }/* Skeptiker N11 — mit Abstand am Ende eines Ergebnisses, nicht direkt unter einer Zahl */
.thanks-note--apart { margin-top: var(--sp-6); }/* v3.5.1 — gleiche Schriftgröße wie die übrigen Hinweise unter Zugriff */
.security-check__item { position: relative; padding-left: 1.6em; font-size: var(--fs-sm); }
.security-check__item::before { content: '…'; position: absolute; left: 0; font-weight: 600; }
.security-check__item--ok::before { content: '✓'; color: var(--success); }
.security-check__item--warn::before { content: '!'; color: var(--warning); }
.security-check__item--bad { color: var(--danger); font-weight: 600; }
.security-check__item--bad::before { content: '✗'; }

/* ── v3.6.0 (F1031) — Prognose-Werkstatt ────────────────────────────────
   Regler links (am Telefon oben), Kurven und Kennzahlen rechts. Die Stufen
   blenden über data-min-level aus (levels.js); Hover nur mit Zeiger. */
.ws-lead { font-size: var(--fs-md); margin: 0 0 var(--sp-3); max-width: 60rem; }
.ws-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-4); align-items: center; }
.ws-chip {
  border: 1px solid var(--border-2); background: var(--bg-1); color: var(--text-1);
  border-radius: var(--r-sm); padding: var(--sp-1h) var(--sp-4); min-height: 40px; font: inherit; cursor: pointer;
}
.ws-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.ws-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .ws-chip:hover { border-color: var(--border-strong); } }
.ws { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.ws__controls { position: sticky; top: calc(var(--topbar-total, 0px) + var(--sp-3)); max-height: calc(100vh - var(--topbar-total, 0px) - var(--sp-6)); overflow: auto; }
.ws__results { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); min-width: 0; }
/* iPad hochkant: schmalere Reglerspalte, Ergebnis bleibt daneben sichtbar */
@media (max-width: 1100px) { .ws { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: var(--sp-4); } }
.ws-mini { display: none; }
@media (max-width: 720px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ws__controls { position: static; max-height: none; overflow: visible; }
  /* Telefon: Regler oben, das Ergebnis klebt darüber — Wirkung sofort sichtbar */
  .ws-mini:not(:empty) {
    display: flex; gap: var(--sp-3); align-items: baseline; position: sticky; z-index: 3;
    top: calc(var(--topbar-total, 0px) + var(--sp-1)); margin: 0 calc(-1 * var(--sp-2)) var(--sp-3);
    padding: var(--sp-2) var(--sp-3); background: var(--bg-2); border: 1px solid var(--border-1);
    border-radius: var(--r-md);
  }
  .ws-mini__big { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
  .ws-mini--more { color: var(--danger); }
  .ws-mini--less { color: var(--success); }
}
.ws-range { display: grid; gap: var(--sp-1); margin: 0 0 var(--sp-4); }
.ws-range__head { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: baseline; }
.ws-range__head label { font-weight: 600; }
.ws-range output { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ws-range input[type="range"] { width: 100%; min-height: 36px; accent-color: var(--accent); margin: 0; }
.ws-range__hint { font-size: var(--fs-xs); color: var(--text-2); margin: 0; }
.ws-group { border-top: 1px solid var(--border-1); padding-top: var(--sp-3); margin-top: var(--sp-2); }
.ws-group > h3 { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 var(--sp-3); }
.ws-measures { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.ws-measure { border: 1px solid var(--border-1); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-3) 0; }
.ws-measure__head { display: flex; gap: var(--sp-2); align-items: center; justify-content: space-between; margin: 0 0 var(--sp-2); }
.ws-measure__head label { display: inline-flex; gap: var(--sp-1); align-items: center; }
.ws-kpis { margin-bottom: 0; }
.ws-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }.ws-card {
  margin: 0; border-radius: var(--r-md); padding: var(--sp-5) var(--sp-6); background: var(--bg-1);
  border: 1px solid var(--border-1);
}
.ws-card--more { background: var(--danger-soft); }
.ws-card--less { background: var(--success-soft); }
.ws-card__brand { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); margin: 0; }
.ws-card__title { font-weight: 600; margin: var(--sp-1) 0 0; }
.ws-card__big { font-size: var(--fs-2xl); line-height: 1.05; font-weight: 600; margin: var(--sp-2) 0; font-variant-numeric: tabular-nums; }
.ws-card--more .ws-card__big { color: var(--danger); }
.ws-card--less .ws-card__big { color: var(--success); }
.ws-card__sentence { font-size: var(--fs-base); font-weight: 600; margin: 0 0 var(--sp-3); }
.ws-card__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.ws-card__facts dt { font-size: var(--fs-xs); color: var(--text-2); }
.ws-card__facts dd { margin: 0; font-weight: 600; }
.ws-card__footer { font-size: var(--fs-xs); color: var(--text-2); margin: 0; }
/* v3.6.0 — „Prognose im Detail“ über den Aufklappbereich (components/disclosure.js) */
.fc-classic { margin-top: var(--sp-6); }
.fc-classic > summary { font-weight: 600; font-size: var(--fs-lg); }
.fc-classic[open] > summary { margin-bottom: var(--sp-4); }
.dash-whatif { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; }
.dash-whatif__text { margin: 0; }
/* v3.6.0 (Paket flexplus) — Kachel „Dein Hebel“: große Zahl wie die Effizienzklasse, daneben wofür */
.dash-lever__figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); margin: var(--sp-2) 0 0; }
.dash-lever__big { font-size: var(--fs-2xl); font-weight: 600; line-height: 1; color: var(--success); font-variant-numeric: tabular-nums; }
.dash-lever__per { color: var(--text-2); font-size: var(--fs-sm); min-width: 0; }
.dash-lever__upto { margin-top: var(--sp-1); }
.dash-lever__action { margin: var(--sp-3) 0 0; }
@media (prefers-reduced-motion: reduce) { .ws-chip, .ws-card { transition: none; } }
/* v3.9.0 (A4) — Werkstatt am Touchgerät: Felder, Auswahl, Regler und Chips 44 px hoch */
@media (pointer: coarse) {
  .ws-chip, .ws__controls .input, .ws__controls select, .ws__controls input[type="text"],
  .ws__controls input[type="number"], .ws-range input[type="range"] { min-height: 44px; }
}
/* v3.11.0 (F1036) — Dialog „Brief entwerfen“: Vorschau wie ein Blatt, Bestätigung abgesetzt */
/* v3.12.0 — „Brief schreiben“ an der Vertragskarte: Auswahl */
.letter-menu__list { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.letter-menu__list .btn { justify-content: flex-start; white-space: normal; text-align: left; height: auto; }
.letter-dialog__what { margin: 0 0 var(--sp-2); }
.letter-dialog__confirm { border: 1px solid var(--warning); background: var(--warning-soft); border-radius: var(--r-md); padding: var(--sp-3); margin: 0 0 var(--sp-4); }
.letter-dialog__confirm p { margin: var(--sp-2) 0 0; }
.letter-dialog__refs { border: 0; padding: 0; margin: 0; min-width: 0; }
.letter-dialog__refs > legend { font-weight: 600; padding: 0; margin: 0 0 var(--sp-2); }
.letter-dialog__h { font-size: var(--fs-md); margin: var(--sp-2) 0; }
/* v3.12.0 (m4b) — woher eine Angabe kommt, wo man sie einträgt, „übernehmen“ */
.letter-dialog__source { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); }
.letter-dialog__source p { margin: 0; flex: 1 1 14rem; }
.letter-dialog__source:empty { display: none; }
.letter-preview { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.5;
  background: var(--bg-1); color: var(--text-1); border: 1px solid var(--border-1); border-radius: var(--r-md);
  padding: var(--sp-4); margin: 0; max-height: 24rem; overflow: auto; }
/* vier Knöpfe: am Telefon zwei Zeilen statt über den Rand */
.modal__foot:has(.letter-dialog__sent) { flex-wrap: wrap; }
@media (max-width: 600px) { .modal__foot:has(.letter-dialog__sent) .btn { flex: 1 1 40%; } }

/* v3.12.0 (M2) — Zeilen mit Sprung: Verbindungen, Schlüssel, KI-Assistenten. Baut auf .zeile der Designsprache. */
.zeilen { padding: 0; overflow: hidden; }
.zeilen__kopf { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border-1); }
.zeilen__kopf .card__title { margin: 0; }
.zeilen__liste { list-style: none; margin: 0; padding: 0; }
.zeile-wrap { border-bottom: 1px solid var(--border-1); }
.zeile-wrap:last-child { border-bottom: 0; }
.zeilen .zeile { flex-wrap: nowrap; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-3) var(--sp-5); border-top: 0; color: inherit; text-decoration: none; }
.zeilen a.zeile:hover { background: var(--bg-2); text-decoration: none; }
.zeile__icon { flex: none; display: inline-flex; }
.zeilen .zeile__text { flex: 1 1 auto; max-width: none; display: flex; flex-direction: column; gap: var(--sp-0); }
.zeile__titel { font-weight: 600; color: var(--text-1); overflow-wrap: anywhere; }
.zeile__meta { font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
.zeile__status { flex: none; }
.zeile__chev { flex: none; display: inline-flex; color: var(--text-3); }
.view-crumb { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.view-crumb a { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text-2); }
.todo-filter, .rec-sev { margin-bottom: var(--sp-4); }
.rec-intro { margin: 0 0 var(--sp-3); }
.todo-note { margin-top: var(--sp-3); }
.dash-todo__head--filter { justify-content: flex-end; }
@media (max-width: 899.98px) {
  .zeilen .zeile { position: relative; flex-wrap: wrap; row-gap: var(--sp-1); padding: var(--sp-3) calc(var(--sp-4) + 18px) var(--sp-3) var(--sp-4); }
  .zeilen .zeile__text { flex: 1 1 calc(100% - 32px); }
  .zeile__status { margin-left: calc(20px + var(--sp-3)); }
  .zeile__chev { position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%); }
  /* wie die Reiter: querwischbar statt drei Reihen über der Liste */
  .seg.todo-filter { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg.todo-filter .seg__btn { flex: none; }
}
.seg__btn.active .muted, .seg__btn[aria-pressed="true"] .muted { color: inherit; }

/* v3.12.0 (M3) — Einstellungen: Suche; Haushalt: je Art ein Abschnitt */
.such { position: relative; max-width: 860px; margin-bottom: var(--sp-4); }
.such__lupe { position: absolute; left: var(--sp-3); top: 13px; color: var(--text-2); pointer-events: none; }
.such__feld { width: 100%; max-width: none; min-height: 44px; padding-left: calc(var(--sp-3) + 26px); font-size: 16px; }
.such__treffer { margin-top: var(--sp-2); }
.such__leer { margin: 0; padding: var(--sp-3) var(--sp-4); color: var(--text-2); }
.zeilen__fuss { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); }
.settings-topics { max-width: 860px; margin-top: var(--sp-4); }   /* gleiche Breite wie .settings-grid */
.settings-more { margin-top: var(--sp-3); }
.settings-more:empty { display: none; }
.household-art { margin-top: var(--sp-4); }
@media (max-width: 899.98px) { .household-art { padding-inline: var(--sp-2); } }   /* Unterzähler bleiben breit genug */
.household-art .section-head { margin-top: 0; }
.household-art .section-head h2 { margin: 0; display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-lg); }
.section-tabs--filter { margin-bottom: var(--sp-3); }
.settings-card[data-target] { outline: 2px solid var(--accent); outline-offset: 2px; }
.section-tabs--filter .section-tabs__tab.active .ico, .section-tabs--filter .section-tabs__tab.active svg { color: currentColor; }

/* ── v3.12.0 (M4) — Übersicht: Kachel je Verbrauchsart ───────────────
   Feste Plätze: Kopf, Zeitraum, Werte, Spur, Fuß. Die Reihe ist gleich hoch (fit-grid), der Fuß steht
   unten. Die ganze Kachel führt zur Verbrauchsart (Fläche über dem Kopf-Link); was darin selbst
   bedienbar ist, liegt darüber. */
.art-bereich { margin-top: var(--sp-5); }
.art-bereich__kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.art-bereich__kopf .card__title { margin: 0; }
.art-bereich__kopf .period-mode-bar { margin: 0; }
.art-kachel { position: relative; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); margin: 0; container-type: inline-size; }
.art-kachel:hover { border-color: var(--border-strong); }
/* v3.12.0 (M5) — lange Namen der Art („Teleriscaldamento“, „Stadsverwarming“) trennen statt aus der Kachel zu ragen */
.art-kachel__titel { margin: 0; font-size: var(--fs-base); font-weight: 600; overflow-wrap: anywhere; hyphens: auto; }
.art-kachel__kopf { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-1); text-decoration: none; }
.art-kachel__kopf:hover { text-decoration: none; color: var(--text-1); }
.art-kachel__kopf::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-md); }
.art-kachel__kopf:focus-visible { outline: 0; }
.art-kachel__kopf:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.art-kachel__zeit { margin: 0; min-height: 2.6em; font-size: var(--fs-xs); line-height: 1.3; color: var(--text-2); }
.art-kachel__werte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.art-kachel__wert.kpi { padding: 0; background: none; border: 0; border-radius: 0; gap: var(--sp-1); }
.art-kachel__wert .kpi__label { margin: 0; font-size: var(--fs-xs); hyphens: none; }
.art-kachel__wert .kpi__value { font-size: var(--fs-base); line-height: 1.25; white-space: nowrap; }
.art-kachel__wert .kpi__sub { margin: 0; font-size: var(--fs-xs); line-height: 1.3; }
.art-kachel .kpi__trend, .art-kachel .kpi__label[title], .art-kachel .dash-groups, .art-kachel__spur, .art-kachel__fuss a { position: relative; z-index: 1; }
.art-kachel__spur { flex: none; height: 44px; margin-top: auto; }
.art-kachel .dash-groups { margin-top: 0; padding-top: var(--sp-1); }
.art-kachel__fuss { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border-1); font-size: var(--fs-xs); line-height: 1.3; color: var(--text-2); }
.art-kachel__fuss a { color: var(--text-2); white-space: nowrap; }
.art-kachel__fuss a:hover { color: var(--accent); }

/* Trend: Grafik, Vorzeichen, Wert; darunter der Bezug. Farbe ist nie das einzige Zeichen. */
.kpi__trend-reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-1); }
.kpi__trend-reihe .kpi__trend { margin: 0; }
.kpi__trend .ico { --ico: currentColor; --ico-f: transparent; flex: none; }
.kpi__trend--gleich { color: var(--text-2); background: var(--bg-3); }
.kpi__trend-bezug { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; }
.kpi__trend-keiner { font-size: var(--fs-xs); color: var(--text-2); }
.art-kachel .kpi__trend--check { margin: 0; white-space: normal; }

/* Zwei Werte nebeneinander nur, wenn beide Platz haben: gilt je Kachel, nicht je Bildschirm (iPad: vier schmale Spalten) */
@container (max-width: 235px) {
  .art-kachel__werte { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
}
@media (max-width: 599.98px) {
  .art-kachel { padding: var(--sp-3); }
  .art-kachel__werte { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
}

/* Zahlenreihe der Übersicht und Karten der Kennzahlen */
.dash-zahlen { margin-top: var(--sp-5); }
.zahl-link { display: block; color: inherit; text-decoration: none; }
.zahl-link:hover { text-decoration: none; }
.zahl-link:hover .kpi { border-color: var(--border-strong); }
.kpi__unit { font-size: var(--fs-sm); font-weight: 400; color: var(--text-2); }
.dash-zahlen .dash-lever { padding: var(--sp-3) var(--sp-4); }
.dash-gesamt { margin-top: var(--sp-5); }
.dash-answer__fuss { margin: var(--sp-3) 0 0; }
.dash-answer { display: flex; flex-direction: column; }
.dash-answer.dash-todo { margin-bottom: 0; }
.dash-answer__fuss { margin-top: auto; padding-top: var(--sp-3); }
.kennzahl { display: flex; flex-direction: column; height: 100%; }
.kennzahl-raster { margin-bottom: var(--sp-5); }
/* v3.12.0 (m4b) — Effizienz in eigener Reihe: ab 900 px die Zeilen je Heizquelle zweispaltig, die Hinweise darunter */
@media (min-width: 900px) {
  .kennzahl-raster--eff .dash-eff-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-6); row-gap: 0; }
}
.kennzahl-reihe { margin-bottom: var(--sp-5); }
.kennzahl-reihe .dash-strom-saldo { margin-top: 0; }
.kennzahl-schaubilder { margin-top: var(--sp-5); }

/* v3.12.0 (M4) — Sichten der Verbrauchsart: am schmalen Bildschirm ohne Umbruch querwischbar */
.sichten { display: flex; margin-bottom: var(--sp-4); }
@media (max-width: 899.98px) {
  .sichten { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sichten .seg__btn { flex: none; }
}

/* v3.12.0 (M4) — Tabellen unter 900 px gestapelt (lib/table-stack.js): erste Spalte als Titel, darunter Spalte und Wert */
@media (max-width: 899.98px) {
  .tabelle-stapel, .tabelle-stapel tbody { display: block; width: 100%; min-width: 0; }
  .tabelle-stapel thead { display: none; }
  .tabelle-stapel tr { display: block; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-1); }
  .tabelle-stapel tr:last-child { border-bottom: 0; }
  .tabelle-stapel tr > th, .tabelle-stapel tr > td { display: block; width: auto; min-width: 0; padding: var(--sp-1) var(--sp-3); border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .tabelle-stapel tr > *::after { content: ''; display: block; clear: both; }
  .tabelle-stapel tr > *[data-label]:not([data-label=""]):not(:first-child)::before { content: attr(data-label); float: left; max-width: 55%; margin-right: var(--sp-2); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); text-align: left; }
  .tabelle-stapel tr > :first-child { font-weight: 600; text-align: left; }
  .tabelle-stapel tr > *[data-label=""] { text-align: left; }
  .tabelle-stapel td > small, .tabelle-stapel td > .btn { display: block; }
  .tabelle-stapel td .input, .tabelle-stapel td .select { width: 100%; max-width: none; margin-top: var(--sp-1); clear: both; }
  .tabelle-stapel td > .btn { display: inline-flex; }
}

/* v3.12.0 (M4) — Kosten: Zeilen mit Werten rechts und Knöpfen darunter */
.contract-rows { padding: 0; }
.contract-overview + .contract-overview { border-top: 1px solid var(--border-1); }
.contract-overview__rows .zeile-wrap:last-child { border-bottom: 0; }
.contract-overview__row + .contract-overview__row { margin-top: 0; padding-top: 0; }
.zeile__werte { flex: none; display: flex; align-items: flex-start; justify-content: flex-end; gap: var(--sp-5); text-align: right; }
.zeile__wert { font-weight: 600; white-space: nowrap; }
.zeile__werte .contract-overview__expected { margin: 0; max-width: 18rem; font-size: var(--fs-sm); }
.zeile__werte .contract-overview__expected strong { display: block; font-size: var(--fs-base); }
.zeile__aktionen { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-3) calc(20px + var(--sp-3) + var(--sp-4)); }
.zeile__aktionen .contract-overview__history { margin: 0; }
/* v3.12.0 (m4b) — ein Knopf und das Menü der Zeile rechts unter dem Abschlag, keine eigene Reihe mehr */
.contract-rows { overflow: visible; }
.zeile__wertspalte { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); }
.zeile__aktionen--rechts { flex-wrap: nowrap; padding: 0; justify-content: flex-end; }
.zeilenmenue { position: relative; display: inline-flex; }
.zeilenmenue__liste { position: absolute; right: 0; top: calc(100% + var(--sp-1)); z-index: 30; display: flex; flex-direction: column; align-items: stretch;
  min-width: 13rem; padding: var(--sp-1); background: var(--bg-1); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-2); text-align: left; }
.zeile__aktionen .zeilenmenue__liste .btn { flex: none; justify-content: flex-start; width: 100%; border-color: transparent; white-space: nowrap; }
@media (max-width: 899.98px) {
  .zeile__werte { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; gap: var(--sp-2) var(--sp-4); margin-left: calc(20px + var(--sp-3)); text-align: left; }
  .zeile__wertspalte { align-items: flex-start; }
  .zeile__aktionen { padding-left: var(--sp-4); }
  .zeile__aktionen .btn { flex: 1 1 auto; justify-content: center; }
  .zeile__aktionen--rechts { padding-left: 0; justify-content: flex-start; }
  .zeile__aktionen--rechts .btn { flex: none; }
  .zeile__aktionen .zeilenmenue__liste .btn { justify-content: flex-start; }
}

/* v3.12.0 (M4) — Frühere Verträge */
.past__arten { display: flex; margin-bottom: var(--sp-3); }
.past__filter { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.past__filter .field { min-width: 11rem; }
.past__name { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: 600; }
.past__tabelle small { display: block; color: var(--text-2); font-weight: 400; }
.past__tabelle small.ton-ok { color: var(--ton-erfolg); }
.past__tabelle small.ton-fehler { color: var(--ton-fehler); }
@media (max-width: 899.98px) {
  .past__arten { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .past__arten .seg__btn { flex: none; }
}

.past__tabelle .tariff-part { white-space: nowrap; }
/* v3.13.0 (Paket K2e) — beide Knöpfe der Zeile untereinander in der angehefteten Spalte: schmal, damit vom Rahmen genug für
   die Zahlen bleibt */
@media (min-width: 900px) {
  .past__aktionen > .btn { display: flex; justify-content: center; width: 100%; white-space: normal; text-align: center; }
  .past__aktionen > .btn + .btn { margin-top: var(--sp-1); }
}
@media (max-width: 899.98px) {
  .past__aktionen > .btn + .btn { margin-left: var(--sp-2); }
}

/* v3.12.0 (M4) — Saldo kurz im Überblick der Verbrauchsart */
.saldo-kurz { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-6); }
.saldo-kurz > div { min-width: 0; }
.saldo-kurz small { display: block; font-size: var(--fs-sm); color: var(--text-2); }
.saldo-kurz__wert { font-size: var(--fs-lg); font-weight: 600; }
.saldo-kurz > .btn { margin-left: auto; }
@media (max-width: 899.98px) { .saldo-kurz > .btn { margin-left: 0; } }

.dash-eff__mehr { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.dash-eff__mehr summary { cursor: pointer; }

/* Zeilen kompakt: Titel, Stand, Frist ohne Abstände wie im Fließtext */
.contract-rows .zeile__text p { margin: 0; }
.contract-rows .contract-overview__meter { margin: 0; }
.contract-rows .contract-overview__facts { margin: 0; }
.contract-rows .zeile { padding-bottom: var(--sp-2); }
