/* ZEV-Abrechnung · Gestaltung siehe docs/DESIGN.md
   Welt: der Zählerschrank im Keller. Lichtgraues Blech, Typenschilder, schwarze Beschriftungsetiketten,
   das Dunkelblau des Solarmoduls. Schrift nach DIN, wie auf jedem Zähler.
   Signatur: das Herkunftsband Sonne | Batterie | Netz | Laden. Farbe heisst hier immer Energie oder Zustand. */

@font-face { font-family: "Sofia Sans"; src: url("schrift/sofia-sans.woff") format("woff"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Sofia Sans"; src: url("schrift/sofia-sans-kursiv.woff") format("woff"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Sofia Sans Schmal"; src: url("schrift/sofia-sans-schmal.woff") format("woff"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* Grund und Schrift */
  --grund: #e7e9e6;            /* Lichtgrau wie das Blech des Zählerschranks (RAL 7035, aufgehellt) */
  --grund-2: #d9dcd8;
  --flaeche: #ffffff;
  --flaeche-2: #f3f4f2;
  --tinte: #121a27;            /* Modulblau: Schrift, Knöpfe, Seitenleiste */
  --tinte-2: #2b3443;
  --leise: #56606d;
  --linie: #d3d6d2;
  --linie-2: #b4b9b5;
  --feld-rand: #959c98;
  /* Seitenleiste */
  --leiste: #121a27;
  --leiste-text: #b3bece;
  --leiste-hier: #ffffff;       /* aktiver Eintrag als helles Etikett */
  --leiste-hier-text: #121a27;
  /* Datenfarben: feste Bedeutung */
  --sonne: #e9a400;
  --sonne-text: #7a5600;
  --batterie: #23966a;
  --batterie-text: #17694a;
  --netz: #2f5f8f;
  --laden: #7656a8;
  /* Zustände */
  --gut: #1f7a4d;
  --gut-grund: #e6f2ea;
  --achtung: #8a5a00;
  --achtung-grund: #fbf1d6;
  --schlecht: #b23a22;
  --schlecht-grund: #fbebe6;
  --info-grund: #e8eef5;
  /* abgeleitete Rollen (Version 26, für Hell und Dunkel) */
  --auf-tinte: #ffffff;            /* Text auf Tinte-Flächen (Primärknopf, Auswahl) */
  --auf-tinte-leise: #b3bece;
  --gut-text: #14462d; --gut-rand: #c4e0cd;
  --schlecht-text: #6a1f10; --schlecht-rand: #e2a99b;
  --info-text: #1e3a56; --info-rand: #c9d7e6;
  --achtung-text: #4d3600; --achtung-rand: #ecd7a0;
  --hinweis-grund: #fdf9ea; --hinweis-rand: #e3cf90; --warn-grund: #fdf6f3;
  --feld-rand-hover: #6f7781; --platzhalter: #6b7480; --aus: #b3b8b6;
  --zeile-hover: #f5f6f4; --gefunden: #fdf7e0;
  --auswahl: #f3cf63; --auswahl-text: #121a27;
  --schatten: rgba(18, 26, 39, .14); --schatten-stark: rgba(18, 26, 39, .4);
  --vorlage: #121a27; --vorlage-text: #e3e8ee; --vorlage-mark: #f2c14e;
  color-scheme: light;
  /* Masse */
  --r-s: 2px; --r: 3px; --r-l: 5px;          /* knappe Ecken wie gestanzte Schilder */
  --schrift: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --schmal: "Sofia Sans Schmal", "Sofia Sans", "Arial Narrow", sans-serif;   /* Titel, Tabellenköpfe, Kennzahlen, Etiketten */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --zahl: var(--schrift);
  --kurve: cubic-bezier(.16, 1, .3, 1);
  --leistenbreite: 220px;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--tinte); font-family: var(--schrift); font-size: 1rem;
  line-height: 1.45; font-feature-settings: "kern"; font-variant-numeric: lining-nums; text-rendering: optimizeLegibility;
  caret-color: var(--tinte); scrollbar-color: var(--linie-2) transparent;
}
::selection { background: var(--auswahl); color: var(--auswahl-text); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--tinte); outline-offset: 2px; border-radius: var(--r-s); }
input[type=checkbox], input[type=radio] { accent-color: var(--tinte); width: 16px; height: 16px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

h1 { font: 800 2.15rem/1.05 var(--schmal); letter-spacing: .005em; margin: 0 0 4px; text-wrap: balance; }
h2 { font: 700 1.35rem/1.2 var(--schmal); letter-spacing: .01em; margin: 34px 0 10px; text-wrap: balance; }
h3 { font-size: 1.02rem; line-height: 1.3; font-weight: 700; margin: 20px 0 6px; }
p { margin: 0 0 12px; max-width: 72ch; }
code { font-family: var(--mono); font-size: .86em; background: var(--grund-2); padding: 1px 5px; border-radius: var(--r-s); }
.leise { color: var(--leise); }
.klein { font-size: .875rem; }
.n, td.n, .kz-wert, .mini-zahl { font-variant-numeric: tabular-nums; }
.umbruch { overflow-wrap: anywhere; }
.inline { display: inline; }
.pflicht { color: var(--schlecht); font-weight: 600; text-decoration: none; }
.zustand-gut { color: var(--gut); font-weight: 600; }
.zustand-warn { color: var(--schlecht); font-weight: 600; }
.status-ok { color: var(--gut); font-weight: 600; } .status-fehler { color: var(--schlecht); font-weight: 600; }

/* ---------- Schale: Seitenleiste links, auf dem Handy oben ---------- */
.kopf { background: var(--leiste); color: var(--leiste-text); }
.marke { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 1.3rem/1 var(--schmal); letter-spacing: .02em; }
.band { display: inline-flex; width: 30px; height: 14px; border-radius: 1px; overflow: hidden; flex: 0 0 auto; }
.band i { display: block; height: 100%; }
.band .s { width: 40%; background: var(--sonne); } .band .b { width: 20%; background: var(--batterie); }
.band .n { width: 25%; background: #5b8cc0; } .band .w { width: 15%; background: #9c80cc; }
.kopf nav { display: flex; }
.kopf nav a, .konto-menu a, .konto-menu button {
  display: flex; align-items: center; gap: 11px; color: var(--leiste-text); text-decoration: none; font: inherit; font-size: .92rem;
  border: 0; background: none; cursor: pointer; border-radius: var(--r); transition: background .15s, color .15s; font-weight: 500;
}
.kopf nav a:hover, .konto-menu a:hover, .konto-menu button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.kopf nav a.hier { color: var(--leiste-hier-text); background: var(--leiste-hier); font-weight: 700; }
.kopf nav a.hier .ic { color: inherit; }
.kopf :focus-visible { outline-color: #9cc0e6; }
.zahlmarke { margin-left: auto; min-width: 22px; padding: 1px 6px; border-radius: var(--r-s); background: var(--sonne); color: #121a27; font: 800 .82rem/1.4 var(--schmal); text-align: center; font-variant-numeric: tabular-nums; }
.konto-menu form { margin: 0; }
.konto-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.konto-kurz { display: none; }
.admin-marke { display: inline-block; background: var(--sonne); color: var(--tinte); font-size: .7rem; font-weight: 700; padding: 0 6px; border-radius: var(--r-s); margin-right: 6px; vertical-align: 1px; }

main { max-width: 1180px; margin: 0 auto; padding: 30px 28px 96px; }

@media (min-width: 1000px) {
  body.mit-leiste { padding-left: var(--leistenbreite); }
  .mit-leiste .kopf { position: fixed; inset: 0 auto 0 0; width: var(--leistenbreite); display: flex; flex-direction: column; padding: 20px 12px 14px; z-index: 20; }
  .mit-leiste .marke { padding: 4px 10px 22px; }
  .mit-leiste .kopf nav { flex-direction: column; gap: 2px; }
  .mit-leiste .kopf nav a { padding: 9px 10px; }
  .mit-leiste .konto-menu { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: grid; gap: 2px; }
  .mit-leiste .konto-menu a, .mit-leiste .konto-menu button { padding: 8px 10px; width: 100%; min-width: 0; font-size: .86rem; }
}
@media (max-width: 999px) {
  .kopf { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 0 12px; position: sticky; top: 0; z-index: 20; }
  .marke { padding: 12px 4px; }
  .kopf nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 8px 8px; gap: 2px; }
  .kopf nav::-webkit-scrollbar { display: none; }
  .kopf nav a { padding: 7px 10px; white-space: nowrap; flex: 0 0 auto; }
  .kopf nav a .zahlmarke { margin-left: 2px; }
  .konto-menu { display: flex; gap: 2px; }
  .konto-menu a, .konto-menu button { padding: 8px; }
  .konto-mail, .konto-menu button span { display: none; }
  main { padding: 22px 16px 80px; }
}

/* ---------- Seitenkopf ---------- */
.titelzeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.titelzeile > div:first-child > p:last-child, .titelzeile .leise:last-child { margin-bottom: 0; }
.titelzeile .knoepfe, .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
section.blatt > .titelzeile, .blatt > .titelzeile { margin-bottom: 12px; align-items: flex-start; }
.titelzeile input[type=search] { width: 240px; }

/* ---------- Meldungen, Hinweise, Banner ---------- */
.meldung, .banner, .linkbox {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; margin: 0 0 14px; max-width: none;
  border-radius: var(--r); background: var(--gut-grund); color: var(--gut-text); border: 1px solid var(--gut-rand);
}
.meldung > .ic { margin-top: 2px; color: var(--gut); }
.meldung.fehler { background: var(--schlecht-grund); color: var(--schlecht-text); border-color: var(--schlecht-rand); }
.meldung.fehler > .ic { color: var(--schlecht); }
.meldung > span { flex: 1; }
.banner { background: var(--info-grund); color: var(--info-text); border-color: var(--info-rand); display: block; }
.banner.archiv { background: var(--grund-2); color: var(--tinte-2); border-color: var(--linie-2); }
.linkbox { display: block; background: var(--achtung-grund); color: var(--achtung-text); border-color: var(--achtung-rand); }
.linkbox code { display: block; word-break: break-all; background: var(--flaeche); padding: 8px 10px; margin-top: 6px; user-select: all; }
ul.liste, ol.liste { margin: 0 0 12px; padding-left: 20px; }
.liste li { margin-bottom: 4px; max-width: 80ch; }

/* ---------- Flächen ---------- */
.blatt { background: var(--flaeche); border: 1px solid var(--linie-2); border-radius: var(--r-l); padding: 20px 22px; margin-bottom: 16px; }
.blatt > h2:first-child, .blatt > h3:first-child { margin-top: 0; }
.blatt.aufgabe { background: var(--hinweis-grund); border-color: var(--hinweis-rand); }
.blatt.aufgabe.warn { background: var(--warn-grund); border-color: var(--schlecht-rand); }
.gefahrzone { border-color: var(--schlecht-rand); background: var(--warn-grund); }
.leer { padding: 40px 24px; text-align: center; background: var(--flaeche); border: 1px dashed var(--linie-2); border-radius: var(--r-l); }
.leer p { margin-left: auto; margin-right: auto; }
.schmal-seite, .anmeldung { max-width: 420px; margin: 8vh auto 0; }
.schmal-seite h1 { margin-bottom: 4px; }
.ohne-leiste main { padding-top: 40px; }

/* ---------- Knöpfe ---------- */
.knopf, button.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px;
  font: 700 .94rem/1 var(--schrift); letter-spacing: .005em; color: var(--auf-tinte); background: var(--tinte); border: 1px solid var(--tinte);
  border-radius: var(--r); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.knopf:hover { background: var(--tinte-2); }
.knopf:active { transform: translateY(1px); }
.knopf.zweit { background: var(--flaeche); color: var(--tinte); border-color: var(--feld-rand); }
.knopf.zweit:hover { background: var(--flaeche-2); border-color: var(--tinte); }
.knopf.gefahr { background: var(--flaeche); color: var(--schlecht); border-color: var(--schlecht-rand); }
.knopf.gefahr:hover { background: var(--schlecht-grund); }
.knopf.schmal { min-height: 30px; padding: 0 10px; font-size: .86rem; border-radius: var(--r-s); }
.knopf[disabled], .knopf[aria-disabled=true] { opacity: .45; cursor: not-allowed; transform: none; }
.linkknopf { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.linkknopf:hover { text-decoration-color: currentColor; }
.linkknopf.gefahr { color: var(--schlecht); }

/* ---------- Formulare ---------- */
label { display: block; font-size: .875rem; font-weight: 700; margin-bottom: 4px; color: var(--tinte); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=month], input[type=date],
input[type=number], input[type=url], input[type=tel], select, textarea {
  width: 100%; min-height: 38px; font: inherit; font-size: .92rem; padding: 7px 10px; color: var(--tinte); background: var(--flaeche);
  border: 1px solid var(--feld-rand); border-radius: var(--r); transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--feld-rand-hover); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tinte); box-shadow: 0 0 0 1px var(--tinte); }
input::placeholder, textarea::placeholder { color: var(--platzhalter); }
input[type=file] { font: inherit; font-size: .86rem; }
input[type=file]::file-selector-button { font: 600 .84rem var(--schrift); border: 1px solid var(--linie-2); background: var(--flaeche); border-radius: var(--r-s); padding: 6px 10px; margin-right: 10px; cursor: pointer; }
textarea { font-family: var(--mono); font-size: .86rem; min-height: 200px; line-height: 1.5; }
input.zahl { text-align: right; font-variant-numeric: tabular-nums; }
select.fehlt { border-color: var(--schlecht); }
.felder { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; margin-bottom: 14px; }
.felder > div { grid-column: span 6; min-width: 0; }
.felder .b2 { grid-column: span 2; } .felder .b3 { grid-column: span 3; } .felder .b4 { grid-column: span 4; }
.felder .b6 { grid-column: span 6; } .felder .b8 { grid-column: span 8; } .felder .b9 { grid-column: span 9; } .felder .b12 { grid-column: span 12; }
.hilfe { font-size: .84rem; color: var(--leise); margin-top: 4px; line-height: 1.4; }
.formfeld { margin-bottom: 14px; }
.reihe { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.reihe > div { flex: 1; min-width: 120px; }
.neuzeile { margin: 12px 0 14px; }
.haken { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.haken-zeile { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-weight: 400; }
.haken-zeile input { margin-top: 3px; }
.unterlinks { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: .88rem; }
.pwzeile { display: flex; gap: 8px; align-items: center; }
.pwzeile input { flex: 1; }
.aktion { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.aktion select { width: auto; max-width: 250px; min-height: 30px; padding: 3px 30px 3px 8px; background-position: right 8px center; font-size: .84rem; }
details > summary { cursor: pointer; font-weight: 600; font-size: .9rem; list-style-position: outside; }
details > summary:hover { color: var(--tinte-2); }
details[open] > summary { margin-bottom: 12px; }

/* Auswahlkarten (Standort-Art, Datenquelle) */
.typwahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0 0 14px; }
.typwahl legend { font-size: .84rem; font-weight: 600; margin-bottom: 8px; padding: 0; color: var(--tinte-2); }
.typwahl label { display: block; border: 1px solid var(--linie-2); border-radius: var(--r-l); padding: 14px 16px; cursor: pointer; font-weight: 400; background: var(--flaeche); margin: 0; transition: border-color .15s, box-shadow .15s; }
.typwahl label:hover { border-color: var(--feld-rand); }
.typwahl label:has(input:checked) { border-color: var(--tinte); box-shadow: 0 0 0 1px var(--tinte); }
.typwahl input { margin-right: 8px; vertical-align: -2px; }
.typwahl strong { font-size: .98rem; }
.typwahl .hilfe { display: block; }
.typwahl .muster { display: flex; height: 6px; margin: 10px 0 8px; border-radius: var(--r-s); overflow: hidden; }
.muster i { display: block; height: 100%; }
.muster .s { background: var(--sonne); } .muster .b { background: var(--batterie); } .muster .n { background: var(--netz); } .muster .w { background: var(--laden); }

/* ---------- Tabellen ---------- */
.rollen { overflow-x: auto; border-radius: var(--r-l); }
table { border-collapse: collapse; width: 100%; background: var(--flaeche); font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font: 700 .86rem/1.3 var(--schmal); letter-spacing: .03em; color: var(--tinte); white-space: nowrap; background: var(--flaeche); }
thead th { border-bottom: 2px solid var(--tinte); }
td.r, th.r { text-align: right; }
td.n { white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--zeile-hover); }
tr:last-child td { border-bottom: 0; }
table.rahmen { border: 1px solid var(--linie-2); border-radius: var(--r-l); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.rahmen th:first-child, .rahmen td:first-child { padding-left: 16px; }
.rahmen th:last-child, .rahmen td:last-child { padding-right: 16px; }
.rahmen.kompakt td, .rahmen.kompakt th { padding-top: 8px; padding-bottom: 8px; }
.rahmen tr[hidden] { display: none; }
tfoot th { background: var(--flaeche); color: var(--tinte); border-top: 2px solid var(--tinte); font: 700 .95rem var(--schrift); letter-spacing: 0; }
.rliste td:nth-child(1), .rliste td:nth-child(3), .rliste td:nth-child(5) { white-space: nowrap; }
.rliste td:nth-child(2) { min-width: 160px; }
.rliste th, .rliste td { padding-left: 10px; padding-right: 10px; }
.rliste .mahnzeile { display: flex; flex-direction: column; color: var(--leise); }
.rliste .mahnzeile a { color: inherit; font-weight: 600; }
td.gefunden { background: var(--gefunden); }

/* ---------- Kleine Zeichen ---------- */
.etikett, .rolle, .quelle, .vt-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 7px 1px 6px; font: 700 .84rem/1.5 var(--schmal); letter-spacing: .03em;
  border-radius: var(--r-s); background: var(--flaeche-2); color: var(--tinte-2); white-space: nowrap;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
}
.etikett::before, .vt-status::before { content: ""; width: 7px; height: 7px; background: currentColor; }
.etikett.warn { background: var(--schlecht-grund); color: var(--schlecht); }
.etikett.tun { background: var(--achtung-grund); color: var(--achtung); }
.etikett.gut { background: var(--gut-grund); color: var(--gut); }
.etiketten { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.rolle.owner { background: var(--tinte); color: var(--auf-tinte); } .rolle.admin { background: var(--sonne); color: var(--tinte); }
.quelle { font-size: .7rem; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
.quelle.ui { background: var(--gut-grund); color: var(--gut); } .quelle.env { background: var(--grund-2); color: var(--leise); }
.punkt { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.punkt.s { background: var(--sonne); } .punkt.b { background: var(--batterie); } .punkt.n { background: var(--netz); }

/* ---------- Herkunftsband (die Signatur) ---------- */
.balken { display: flex; height: 10px; min-width: 2px; background: var(--grund-2); border-radius: 1px; overflow: hidden; gap: 1px; }
.balken i { display: block; height: 100%; min-width: 0; }
.balken .s, .mini .s { background: var(--sonne); } .balken .b, .mini .b { background: var(--batterie); }
.balken .n, .mini .n { background: var(--netz); } .balken .w { background: var(--laden); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--leise); margin: 6px 0 10px; }
.legende span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legende span:has(> i)::before { display: none; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legende .s::before { background: var(--sonne); } .legende .b::before { background: var(--batterie); } .legende .n::before { background: var(--netz); }

/* ---------- Übersicht der Standorte ---------- */
.zev-zeile {
  display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr) 230px; gap: 28px; align-items: center;
  background: var(--flaeche); border: 1px solid var(--linie-2); border-radius: var(--r-l); padding: 16px 20px; margin-bottom: 8px;
  text-decoration: none; transition: border-color .15s;
}
.zev-zeile:hover { border-color: var(--tinte); }
.zev-zeile strong { font: 800 1.3rem/1.15 var(--schmal); letter-spacing: .01em; display: block; margin-bottom: 3px; }
.zev-zeile .werte { font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 6px; }
.zev-zeile .balken { height: 14px; }

/* ---------- Kennzahlen: ruhige Zeile statt Riesenkacheln ---------- */
.kennzahlen { display: flex; flex-wrap: wrap; gap: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l); margin-bottom: 16px; overflow: hidden; }
.kennzahlen > div { flex: 1 1 150px; padding: 12px 16px; border-right: 1px solid var(--linie); display: flex; flex-direction: column; gap: 1px; }
.kennzahlen > div:last-child { border-right: 0; }
.kz-wert { display: block; font: 800 1.45rem/1.15 var(--schmal); letter-spacing: .01em; }
.kz-wert.s { color: var(--sonne-text); } .kz-wert.b { color: var(--batterie-text); } .kz-wert.n { color: var(--netz); } .kz-wert.warn { color: var(--schlecht); }
.kz-text { font-size: .8rem; color: var(--leise); }

/* ---------- Reiter eines Standorts ---------- */
.reiter { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--linie-2); margin: 18px 0 24px; }
.reiter::-webkit-scrollbar { display: none; }
.reiter a { position: relative; flex: 0 0 auto; padding: 9px 9px 11px; text-decoration: none; color: var(--leise); font: 600 1.04rem/1.2 var(--schmal); letter-spacing: .02em; white-space: nowrap; transition: color .15s; }
.reiter a:hover { color: var(--tinte); }
.reiter a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; transition: background .15s; }
.reiter a.hier { color: var(--tinte); font-weight: 800; }
.reiter a.hier::after { background: var(--tinte); }
.reiter a.reiter-gruppe { font: 500 .82rem/1.2 var(--schrift); letter-spacing: 0; color: var(--leise); padding-left: 0; padding-right: 8px; }
.reiter a.reiter-gruppe::after { display: none; }
.reiter a.reiter-gruppe:hover { color: var(--tinte); }
.reiter a + a.reiter-gruppe { margin-left: 4px; padding-left: 11px; }
.reiter a + a.reiter-gruppe::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 12px; width: 1px; background: var(--linie-2); }
@media (max-width: 999px) { .reiter { margin: 12px -16px 20px; padding: 0 16px; } }

/* ---------- Checkliste ---------- */
.checkliste { background: var(--hinweis-grund); border-color: var(--hinweis-rand); }
.fortschritt { height: 6px; background: var(--grund-2); border-radius: var(--r-s); overflow: hidden; margin: 6px 0 16px; }
.fortschritt i { display: block; height: 100%; background: var(--gut); border-radius: var(--r-s); transition: width .6s var(--kurve); }
.schritte { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.schritte li { display: flex; gap: 10px; align-items: center; }
.schritte .haken { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 600; border: 1px solid var(--feld-rand); color: var(--leise); background: var(--flaeche); font-variant-numeric: tabular-nums; }
.schritte li.ok { color: var(--leise); }
.schritte li.ok .haken { background: var(--gut); border-color: var(--gut); color: #fff; }
.schritte li.ok .haken .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.schritte a { font-weight: 600; }

/* ---------- Listen: Filter, Seiten, Zahlungen ---------- */
.filterleiste { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l); padding: 12px 14px; margin: 14px 0; }
.filterleiste > div { flex: 0 1 200px; min-width: 150px; }
.filterleiste > .wachsen { flex: 1 1 240px; }
.filterleiste label { font-size: .78rem; }
.filterleiste a.klein { align-self: center; }
.seiten { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.zahlleiste { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l); padding: 14px 16px; margin: 14px 0; }
.zahlleiste > div { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.zahlleiste .kz-wert { font-size: 1.15rem; }
.zahlleiste .bankdatei { margin-left: auto; }
.zahlleiste .bankdatei label { font-size: .8rem; }
.zahlleiste input[type=file] { max-width: 270px; }

/* ---------- Fenster ---------- */
dialog.fenster, dialog.mwdialog {
  border: 1px solid var(--linie); border-radius: var(--r-l); padding: 22px 24px; width: min(480px, calc(100vw - 32px)); color: var(--tinte);
  background: var(--flaeche); box-shadow: 0 24px 60px -20px var(--schatten-stark), 0 2px 6px var(--schatten);
  white-space: normal; text-align: left; font-weight: 400; overflow-x: hidden;
}
dialog.fenster.breit { width: min(760px, calc(100vw - 32px)); }
dialog.mwdialog { width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(18, 26, 39, .5); }
dialog[open] { animation: auf .18s var(--kurve); }
@keyframes auf { from { opacity: 0; transform: translateY(4px); } }
.fenster label { display: block; margin-bottom: 12px; white-space: normal; }
.fenster label > input, .fenster label > select { display: block; width: 100%; margin-top: 5px; }
.fenster-knoepfe { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.fenster h3 { font-size: 1.05rem; }
.wechsel { margin-top: 18px; border-top: 1px solid var(--linie); padding-top: 14px; }

/* ---------- Sammelerfassung, aufklappbare Teile ---------- */
.sammel { margin-top: 16px; border-top: 1px solid var(--linie); padding-top: 14px; }
.sammel textarea { width: 100%; font-size: .84rem; margin: 6px 0 10px; min-height: 140px; }
.sammel label { font-weight: 400; }
.sammel .hilfe { display: block; margin-top: 6px; }
.geraete { display: grid; gap: 6px; margin: 10px 0 12px; }
.geraete label { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 0; }
.geraete input[type=text] { max-width: 280px; }
.kartenform { display: flex; gap: 8px; flex-wrap: wrap; }
.kartenform input { flex: 1 1 160px; } .kartenform select { flex: 1 1 180px; width: auto; }

/* ---------- Mail-Vorlage und Rechnungsmail ---------- */
pre.vorlage { background: var(--vorlage); color: var(--vorlage-text); padding: 16px 18px; border-radius: var(--r-l); overflow-x: auto; font: .84rem/1.6 var(--mono); margin: 0 0 14px; }
pre.vorlage b { color: var(--vorlage-mark); font-weight: 400; }
.mailraster { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.vorschau { position: sticky; top: 16px; }
.mailkopf { display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--linie); font-size: .9rem; }
.mailkopf > span:first-child { color: var(--leise); }
.mailkopf .datei::before { content: "PDF"; display: inline-block; font-size: .66rem; font-weight: 700; background: var(--schlecht); color: #fff; padding: 0 5px; margin-right: 6px; border-radius: var(--r-s); vertical-align: 1px; }
.mailtext { white-space: pre-wrap; padding: 14px 0 4px; font-size: .92rem; max-width: 70ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { font: .8rem/1 var(--mono); padding: 6px 9px; border: 1px solid var(--linie-2); background: var(--flaeche); border-radius: var(--r-s); cursor: pointer; color: var(--tinte); transition: background .12s, border-color .12s; }
.chip:hover { border-color: var(--tinte); background: var(--grund); }
.testergebnis { display: grid; gap: 8px; margin-bottom: 16px; }

/* ---------- Messwerte: Jahr × Zähler ---------- */
.mwleiste { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.jahrwahl { display: flex; gap: 6px; align-items: center; }
.jahrwahl select { width: auto; font-weight: 600; }
.mwsuche { flex: 1 1 240px; }
.mwraster { overflow: auto; max-height: 72vh; border: 1px solid var(--linie); border-radius: var(--r-l); background: var(--flaeche); }
.mwraster table { border-collapse: separate; border-spacing: 0; min-width: 880px; }
.mwraster th, .mwraster td { border-bottom: 1px solid var(--linie); padding: 0; }
.mwraster thead th { position: sticky; top: 0; z-index: 2; background: var(--flaeche-2); border-bottom: 1px solid var(--linie-2); padding: 9px 4px 7px; text-align: center; color: var(--tinte-2); font-size: .8rem; font-weight: 600; }
.mwraster .mw-zaehler { position: sticky; left: 0; z-index: 1; background: var(--flaeche); text-align: left; padding: 6px 12px; min-width: 150px; max-width: 210px; border-right: 1px solid var(--linie); }
.mwraster thead .mw-zaehler { z-index: 3; background: var(--flaeche-2); }
.mw-name { display: block; font-weight: 600; font-size: .86rem; color: var(--tinte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-nr { display: block; font-size: .76rem; font-weight: 400; color: var(--leise); }
.mw-stand { display: block; font-size: .72rem; color: var(--leise); margin-top: 1px; }
.mw-stand.unvollstaendig { color: var(--schlecht); font-weight: 600; }
.mw-verrechnet { display: block; font-size: .66rem; color: var(--gut); }
.mw-zelle { width: 7.4%; min-width: 58px; height: 46px; }
.zelle { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 100%; height: 46px; padding: 4px 7px; border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; text-align: left; transition: background .12s; }
.zelle:hover { background: var(--grund); }
.mini { display: flex; height: 6px; min-width: 4px; border-radius: var(--r-s); overflow: hidden; }
.mini i { display: block; height: 100%; min-width: 1px; }
.mini-zahl { font-size: .74rem; color: var(--leise); }
.mini-fehlt { font-size: .72rem; color: var(--schlecht); border: 1px dashed var(--schlecht-rand); border-radius: var(--r-s); padding: 0 5px; align-self: flex-start; }
.mw-zelle.problem .zelle { box-shadow: inset 0 0 0 2px var(--schlecht); background: var(--schlecht-grund); }
.mw-zelle.problem .mini-zahl { color: var(--schlecht); font-weight: 700; }
.mw-zelle.zukunft { background: var(--flaeche-2); }
.mw-zelle.vorher .zelle { opacity: 0; } .mw-zelle.vorher .zelle:hover, .mw-zelle.vorher .zelle:focus-visible { opacity: 1; }
.mw-zelle.vorher .zelle:hover::after, .mw-zelle.vorher .zelle:focus-visible::after { content: "+ erfassen"; font-size: .72rem; color: var(--leise); }
.mw { min-width: 118px; }
.mw .zahlen { font-variant-numeric: tabular-nums; font-size: .86rem; display: flex; justify-content: space-between; gap: 8px; }
.mw .zahlen .s { color: var(--sonne-text); } .mw .zahlen .n { color: var(--netz); } .mw .zahlen .b { color: var(--batterie-text); }

/* ---------- Verteilung ---------- */
.vtleiste { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 6px; }
.vtliste { display: grid; gap: 6px; margin: 10px 0 8px; }
.vtzeile { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l); overflow: hidden; }
.vtzeile > summary { text-decoration: none; margin: 0; display: grid; grid-template-columns: minmax(150px, 1.1fr) 2.4fr auto auto; gap: 14px; align-items: center; padding: 11px 16px; cursor: pointer; list-style: none; font-weight: 400; font-size: .9rem; }
.vtzeile > summary::-webkit-details-marker { display: none; }
.vtzeile > summary:hover { background: var(--flaeche-2); }
.vtzeile[open] > summary { border-bottom: 1px solid var(--linie); margin: 0; }
.vt-name { display: flex; flex-direction: column; }
.vt-was { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.vt-status { background: var(--gut-grund); color: var(--gut); }
.vtzeile.offen .vt-status, .vtzeile.teil .vt-status { background: var(--achtung-grund); color: var(--achtung); }
.vtzeile.fehler .vt-status { background: var(--schlecht-grund); color: var(--schlecht); }
.vtzeile.fehler { border-color: var(--schlecht-rand); }
.vt-bearbeiten { font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; color: var(--leise); }
.vtzeile[open] .vt-bearbeiten { visibility: hidden; }
.vt-editor { padding: 16px; background: var(--flaeche-2); }
.vt-modi { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0 0 14px; }
.vt-modus { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .86rem; padding: 6px 12px; border: 1px solid var(--linie-2); border-radius: var(--r-s); background: var(--flaeche); cursor: pointer; margin: 0; }
.vt-modus:has(input:checked) { border-color: var(--tinte); background: var(--tinte); color: var(--auf-tinte); }
.vt-modus input { accent-color: #fff; width: 14px; height: 14px; }
.vt-editor select { max-width: 460px; }
.vt-chips { max-height: 220px; overflow: auto; padding: 2px; }
.chipwahl { display: inline-flex; margin: 0; font-weight: 400; cursor: pointer; }
.chipwahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipwahl span { padding: 5px 11px; border: 1px solid var(--linie-2); border-radius: var(--r-s); background: var(--flaeche); font-size: .84rem; transition: background .12s, border-color .12s; }
.chipwahl span em { font-style: normal; color: var(--leise); font-size: .78rem; }
.chipwahl input:checked + span { border-color: var(--tinte); background: var(--tinte); color: var(--auf-tinte); }
.chipwahl input:checked + span em { color: var(--auf-tinte-leise); }
.chipwahl input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--netz) 70%, transparent); outline-offset: 2px; }
.vt-prozente { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; max-height: 260px; overflow: auto; margin-bottom: 6px; }
.vt-prozente label { display: grid; grid-template-columns: 1fr 80px auto; align-items: center; gap: 6px; font-weight: 400; font-size: .88rem; margin: 0; }
.vt-prozente label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-rueck td { vertical-align: top; }
.vt-anteil { display: inline-block; margin: 0 10px 4px 0; font-size: .86rem; white-space: nowrap; }
.vt-anteil b { font-variant-numeric: tabular-nums; font-weight: 600; }
.vorschlag { background: var(--hinweis-grund); border-color: var(--hinweis-rand); }
.verteil input { width: 78px; }
.verteil td.summe { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.verteil td.summe.voll { color: var(--gut); } .verteil td.summe.zuviel { color: var(--schlecht); }

/* ---------- Bericht ---------- */
.bericht .balken-sp { width: 40%; min-width: 120px; }
.bericht .balken { height: 12px; }
.bericht tr.leer td { color: var(--leise); }

/* ---------- Druck und Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 760px) {
  h1 { font-size: 1.45rem; }
  .felder > div, .felder .b2, .felder .b3, .felder .b4, .felder .b6, .felder .b8, .felder .b9 { grid-column: span 12; }
  .zev-zeile { grid-template-columns: 1fr; gap: 10px; }
  .etiketten { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .kennzahlen > div { flex-basis: 45%; border-bottom: 1px solid var(--linie); }
  .mwraster .mw-zaehler { min-width: 112px; max-width: 130px; padding: 6px 8px; }
  .mw-name { font-size: .8rem; }
  .vtzeile > summary { grid-template-columns: 1fr auto; }
  .vt-was { grid-column: 1 / -1; order: 3; }
  .vt-bearbeiten { display: none; }
  .filterleiste > div { flex: 1 1 100%; }
  .titelzeile input[type=search] { width: 100%; }
  .zahlleiste .bankdatei { margin-left: 0; }
  .blatt { padding: 16px; }
  .mailraster { grid-template-columns: 1fr; } .vorschau { position: static; }
}

/* Icon-Aktionen in Tabellen */
td.aktionen { white-space: nowrap; }
td.aktionen > *, td.aktionen form { display: inline-flex; vertical-align: middle; }
.ikon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-s); border: 0; background: none; color: var(--tinte-2); cursor: pointer; transition: background .12s, color .12s; }
.ikon:hover { background: var(--grund-2); color: var(--tinte); }
.ikon.gefahr { color: var(--schlecht); }
.ikon.gefahr:hover { background: var(--schlecht-grund); }
.aussen-marke { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 11vh; color: #fff; font: 800 1.9rem/1 var(--schmal); letter-spacing: .02em; }
.aussen-marke + main .schmal-seite, .aussen-marke + main .anmeldung { margin-top: 20px; }
.ohne-leiste main { padding-top: 0; }

/* Umschalter Monate | Tage */
.umschalter { display: inline-flex; padding: 3px; background: var(--grund-2); border-radius: var(--r-l); margin-bottom: 16px; }
.umschalter a { padding: 6px 16px; border-radius: var(--r); text-decoration: none; font-size: .88rem; font-weight: 500; color: var(--leise); }
.umschalter a.hier { background: var(--flaeche); color: var(--tinte); font-weight: 600; box-shadow: 0 1px 2px var(--schatten); }

/* Tagesverlauf als Säulen */
.saeulen { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 6px; }
.saeule { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.saeule .stapel { width: 100%; max-width: 22px; display: flex; flex-direction: column; border-radius: var(--r-s) var(--r-s) 0 0; overflow: hidden; min-height: 1px; }
.saeule .stapel i { display: block; min-height: 0; }
.saeule .stapel .s { background: var(--sonne); } .saeule .stapel .b { background: var(--batterie); } .saeule .stapel .n { background: var(--netz); }
.saeule span { font-size: .66rem; color: var(--leise); margin-top: 4px; font-variant-numeric: tabular-nums; }
.saeule:hover .stapel { filter: brightness(1.08); }

/* Raster Zähler × Tage */
.tagraster table { min-width: 1400px; }
.tagraster thead th { padding: 6px 2px; min-width: 38px; }
.tagraster thead th.we { color: var(--leise); background: var(--grund-2); }
.tagraster .wt { display: block; font-size: .64rem; font-weight: 400; color: var(--leise); }
.tz { padding: 4px 3px !important; text-align: center; vertical-align: middle; height: 44px; }
.tz-zahl { display: block; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--tinte-2); }
.tz .mini { margin: 3px auto 0; height: 5px; }
.tz-fehlt { color: var(--feld-rand); font-size: .8rem; }
.tz.problem { background: var(--schlecht-grund); box-shadow: inset 0 0 0 1px var(--schlecht); }
.tz.zukunft { background: var(--flaeche-2); }
.tz-summe { padding: 4px 10px !important; font-size: .82rem; white-space: nowrap; }
@media (max-width: 760px) {
  .saeulen { gap: 2px; height: 120px; }
  .saeule span { visibility: hidden; }
  .saeule:nth-child(5n+1) span { visibility: visible; }
}

/* Meldungen: gespeichert gegen neu */
.vergleich { width: auto; min-width: 380px; margin: 10px 0 4px; border: 1px solid var(--linie); border-radius: var(--r); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.vergleich th, .vergleich td { padding: 5px 12px; font-size: .86rem; border-bottom: 1px solid var(--linie); }
.vergleich thead th { background: var(--flaeche-2); font-weight: 500; color: var(--leise); }
.vergleich tr:last-child td { border-bottom: 0; }
.vergleich tr.summe td { font-weight: 600; background: var(--flaeche-2); }
.vergleich .plus, .vergleich .minus { color: var(--tinte); font-weight: 500; }
.knopfstapel { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* ---- Messwerte → Tage (Version 24) ---------------------------------------------- */
.herkunft { padding: 20px 22px 18px; }
.hk-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.hk-kopf h3 { margin: 0; }
.hk-total { margin: 0; color: var(--leise); font-size: .9rem; }
.hk-total .n { color: var(--tinte); font: 800 1.35rem/1 var(--schmal); letter-spacing: .01em; }
.hk-band { display: flex; height: 38px; border-radius: 1px; overflow: hidden; gap: 2px; background: var(--grund-2); }
.hk-band i { display: flex; align-items: center; min-width: 2px; padding: 0 10px; font: 800 1rem/1 var(--schmal); letter-spacing: .02em; white-space: nowrap; overflow: hidden; }
.hk-band .s { background: var(--sonne); color: #3d2b00; }
.hk-band .b { background: var(--batterie); color: #fff; }
.hk-band .n { background: var(--netz); color: #fff; }
.hk-werte { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 20px; margin: 16px 0 0; }
.hk-werte > div { display: flex; flex-direction: column; gap: 2px; }
.hk-werte dt { font-size: .8rem; color: var(--leise); display: flex; align-items: center; }
.hk-werte dd { margin: 0; font-size: .86rem; color: var(--leise); }
.hk-werte dd b { font: 800 1.45rem/1.15 var(--schmal); letter-spacing: .01em; color: var(--tinte); margin-right: 3px; }
.tagpunkte { display: flex; gap: 2px; margin-top: 6px; flex-wrap: wrap; max-width: 220px; }
.tagpunkte i { width: 5px; height: 10px; border-radius: 1.5px; background: var(--linie); }
.tagpunkte i.da { background: var(--gut); }
.tagpunkte i.fehlt { background: var(--schlecht); opacity: .55; }
.tagpunkte i.zuk { background: var(--grund-2); }
.tagpunkte.monate i { width: 12px; }
/* Monatsansicht: offene Punkte unter dem Herkunftsband, unvollständige Monate blasser */
.hk-offen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--linie); font-size: .875rem; color: var(--achtung); font-weight: 600; }
.hk-offen .ic { flex: none; }
.hk-offen a { font-weight: 400; }
.hk-offen.allein { border: 0; padding: 0; margin: 12px 0; }
.dg .sl .teil { opacity: .5; }
.dg-tage.monate span { font-size: .78rem; }

.diagramm { padding: 18px 22px 14px; }
.dg-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.dg-kopf h3 { margin: 0; }
.hinweis-klick { color: var(--leise); }
.hinweis-klick::before { display: none !important; }
.dg-flaeche { position: relative; }
.dg-achse, .dg-werte { position: absolute; left: 0; right: 0; top: 0; height: 266px; pointer-events: none; }
.dg { display: block; width: 100%; height: 266px; overflow: visible; }
.dg .gitter { stroke: var(--linie); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 3; }
.dg .gitter.null { stroke: var(--linie-2); stroke-dasharray: none; }
.dg .zone { fill: transparent; }
.dg .zone.we { fill: var(--flaeche-2); }
.dg .sl .s { fill: var(--sonne); } .dg .sl .b { fill: var(--batterie); } .dg .sl .n { fill: var(--netz); }
.dg .sl .fehlt { fill: var(--schlecht); opacity: .35; }
.dg .sl rect:not(.zone) { transition: opacity .15s var(--kurve); }
.dg .sl:hover .zone, .dg .sl:focus .zone { fill: var(--grund-2); }
.dg .sl.gew .zone { fill: var(--info-grund); }
.dg:has(.sl:hover) .sl:not(:hover) rect:not(.zone) { opacity: .45; }
.dg .sl:focus { outline: none; }
.dg .sl:focus-visible .zone { stroke: var(--netz); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dg-achse span { position: absolute; left: 0; transform: translateY(-115%); font-size: .7rem; color: var(--leise); background: color-mix(in srgb, var(--flaeche) 85%, transparent); padding: 0 4px 0 1px; border-radius: var(--r-s); font-variant-numeric: tabular-nums; pointer-events: none; }
.dg-werte span { position: absolute; transform: translate(-50%, -125%); font-size: .68rem; color: var(--tinte-2); font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; }
.dg-werte span.gew { font-weight: 700; color: var(--tinte); }
.dg-tage { position: relative; height: 22px; margin-top: 6px; }
.dg-tage span { position: absolute; top: 0; transform: translateX(-50%); font-size: .72rem; color: var(--tinte-2); font-variant-numeric: tabular-nums; }
.dg-tage span.we { color: var(--leise); }
.dg-tage span.gew { background: var(--tinte); color: var(--auf-tinte); border-radius: var(--r-s); padding: 0 5px; font-weight: 600; }
.dg-tip { position: absolute; z-index: 5; min-width: 170px; padding: 10px 12px; background: var(--flaeche); border: 1px solid var(--linie-2); border-radius: var(--r-l); box-shadow: 0 8px 24px rgba(21, 33, 28, .14); font-size: .8rem; pointer-events: none; }
.dg-tip strong { display: block; margin-bottom: 4px; }
.dg-tip .tz-z { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.dg-tip .tz-z b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.dg-tip .tz-z i { width: 9px; height: 9px; border-radius: 2px; }
.dg-tip .tz-z i.s { background: var(--sonne); } .dg-tip .tz-z i.b { background: var(--batterie); } .dg-tip .tz-z i.n { background: var(--netz); }
.dg-tip .tz-t { border-top: 1px solid var(--linie); margin-top: 4px; padding-top: 4px; }
.dg-tip .leise { margin-top: 4px; font-size: .74rem; }

.tagdetail { padding: 16px 0 0; scroll-margin-top: 16px; }
.td-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 0 22px 12px; }
.td-nav { display: flex; align-items: center; gap: 10px; }
.td-nav h3 { margin: 0; min-width: 0; }
.knopf.aus { opacity: .35; pointer-events: none; }
.tagdetail .rollen { border: 0; border-radius: 0; }
.tdtab { border: 0 !important; border-radius: 0 !important; }
.tdtab th[scope=row] { font-weight: 400; }
.tdtab .mw-name { display: block; font-weight: 500; }
.tdtab .mw-nr { display: block; font-size: .74rem; color: var(--leise); }
.td-bandk { width: 34%; min-width: 160px; }
.tdband { display: flex; height: 12px; border-radius: var(--r-s); overflow: hidden; gap: 1px; min-width: 4px; }
.tdband i { display: block; min-width: 0; }
.tdband .s { background: var(--sonne); } .tdband .b { background: var(--batterie); } .tdband .n { background: var(--netz); }
.td-total { font-weight: 600; }
.td-problem { display: block; font-size: .74rem; color: var(--schlecht); margin-top: 3px; }
.tdtab tr.problem { background: var(--schlecht-grund); }
.tdtab tr.ohne th, .tdtab tr.ohne td { color: var(--leise); }
.tdtab tfoot th, .tdtab tfoot td { background: var(--flaeche-2); font-weight: 600; border-top: 1px solid var(--linie-2); }

.raster-titel { margin: 26px 0 10px; }
.tagraster thead th a { color: inherit; text-decoration: none; display: block; }
.tagraster thead th.gew { background: var(--tinte); color: var(--auf-tinte); }
.tagraster thead th.gew .wt { color: var(--auf-tinte-leise); }
.tz { background: color-mix(in srgb, var(--netz) calc(var(--a, 0) * 16%), var(--flaeche)); }
.tz.gew { box-shadow: inset 1px 0 0 var(--tinte-2), inset -1px 0 0 var(--tinte-2); }
.tz a.tz-zahl { color: var(--tinte-2); text-decoration: none; }
.tz a.tz-zahl:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .dg-werte { display: none; }
  .dg-tage span { font-size: .62rem; }
  .dg-tage span:not(.gew):not(:nth-child(5n+1)) { visibility: hidden; }
  .dg-tage.monate span:not(.gew):not(:nth-child(5n+1)) { visibility: visible; }
  .herkunft, .diagramm { padding: 14px; }
  .td-kopf { padding: 0 14px 10px; }
  .hk-werte { grid-template-columns: 1fr 1fr; }
  .tdtab .td-bandk { display: none; }
  .tdtab tr.ohne td.td-bandk { display: table-cell; }
  .dg, .dg-achse, .dg-werte { height: 200px; }
}

/* ---- Eingabefelder (Version 25): ruhig, präzise, eine Höhe -------------------------
   Vorbild: shadcn/ui Input + Input-Group, impeccable «Browser surfaces», ui-ux-pro-max Formularregeln. */
:root { --feld-h: 40px; --feld-schatten: 0 1px 1px rgba(21, 33, 28, .04), inset 0 1px 0 rgba(255, 255, 255, .6); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input[type=tel], select {
  min-height: var(--feld-h); box-shadow: var(--feld-schatten);
}
textarea { box-shadow: var(--feld-schatten); }
input:disabled, select:disabled, textarea:disabled { background: var(--flaeche-2); color: var(--leise); cursor: not-allowed; }
input[readonly] { background: var(--flaeche-2); }
input:user-invalid, select:user-invalid { border-color: var(--schlecht); box-shadow: 0 0 0 3px color-mix(in srgb, var(--schlecht) 16%, transparent); }
input[type=search] { padding-left: 34px; background: var(--flaeche) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f7a75' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 11px 50%; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; height: 14px; width: 14px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7a75' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* Auswahl: eigener Pfeil statt Browser-Standard */
select { -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--flaeche) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2315211c' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
select[multiple] { background-image: none; padding-right: 10px; }

/* Häkchen und Optionen */
input[type=checkbox], input[type=radio] {
  -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 0; vertical-align: -4px; cursor: pointer;
  border: 1.5px solid var(--feld-rand); background: var(--flaeche); display: inline-grid; place-content: center;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
input[type=checkbox] { border-radius: var(--r-s); }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]::before { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .12s var(--kurve);
  background: var(--auf-tinte); clip-path: polygon(14% 52%, 0 66%, 40% 100%, 100% 22%, 86% 8%, 40% 72%); }
input[type=radio]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; transform: scale(0); transition: transform .12s var(--kurve); background: var(--auf-tinte); }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--tinte); border-color: var(--tinte); }
input[type=checkbox]:checked::before, input[type=radio]:checked::before { transform: scale(1); }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--tinte-2); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--netz) 26%, transparent); }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .45; cursor: not-allowed; }

/* Einheit im Feld: CHF/kWh, %, CHF */
.feldgruppe { position: relative; display: flex; align-items: stretch; width: 100%; }
.feldgruppe input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.feld-einheit { display: flex; align-items: center; padding: 0 11px; font-size: .82rem; font-weight: 500; color: var(--leise); white-space: nowrap;
  background: var(--flaeche-2); border: 1px solid var(--feld-rand); border-left: 0; border-radius: 0 var(--r) var(--r) 0; }
label .feldgruppe { margin-top: 5px; font-weight: 400; }

/* Monat und Datum */
.wahl { position: relative; display: block; width: 100%; }
.wahl.eng { width: auto; display: inline-block; }
label .wahl { margin-top: 5px; font-weight: 400; }
.wahl-knopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: var(--feld-h);
  padding: 7px 10px 7px 12px; font: inherit; font-size: .92rem; font-weight: 500; color: var(--tinte); text-align: left; cursor: pointer;
  background: var(--flaeche); border: 1px solid var(--feld-rand); border-radius: var(--r); box-shadow: var(--feld-schatten);
  transition: border-color .15s, box-shadow .15s; font-variant-numeric: tabular-nums; }
.wahl.eng .wahl-knopf { min-width: 176px; }
.wahl-knopf:hover { border-color: var(--feld-rand-hover); }
.wahl-knopf:focus-visible, .wahl-knopf[aria-expanded=true] { outline: none; border-color: var(--netz); box-shadow: 0 0 0 3px color-mix(in srgb, var(--netz) 22%, transparent); }
.wahl-knopf .ic { color: var(--leise); flex: none; }
.wahl-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wahl-leer { color: var(--platzhalter); font-weight: 400; }
.wahl-pruef { position: absolute; left: 12px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wahl-platte { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 280px; padding: 12px;
  background: var(--flaeche); border: 1px solid var(--linie-2); border-radius: var(--r-l); box-shadow: 0 12px 32px var(--schatten), 0 2px 6px var(--schatten);
  animation: wahl-auf .16s var(--kurve); }
.wahl.oben .wahl-platte { top: auto; bottom: calc(100% + 6px); }
.wahl.rechts .wahl-platte { left: auto; right: 0; }
@keyframes wahl-auf { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wahl-platte { animation: none; } }
.wahl-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wahl-kopf strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
.wahl-pfeil { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--linie); background: var(--flaeche); border-radius: var(--r); cursor: pointer; color: var(--tinte); }
.wahl-pfeil:hover { background: var(--flaeche-2); border-color: var(--linie-2); }
.wahl-pfeil .ic { width: 16px; height: 16px; }
.wahl-raster { display: grid; gap: 4px; }
.wahl-raster.monate { grid-template-columns: repeat(3, 1fr); }
.wahl-raster.tage { grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wahl-wt { font-size: .72rem; color: var(--leise); text-align: center; padding: 4px 0; font-weight: 500; }
.wahl-zelle { height: 38px; border: 0; border-radius: var(--r); background: transparent; font: inherit; font-size: .88rem; color: var(--tinte); cursor: pointer; font-variant-numeric: tabular-nums; }
.wahl-raster.tage .wahl-zelle { height: 34px; }
.wahl-zelle:hover { background: var(--grund-2); }
.wahl-zelle:focus-visible { outline: 2px solid var(--netz); outline-offset: -2px; }
.wahl-zelle.jetzt { box-shadow: inset 0 0 0 1px var(--linie-2); font-weight: 600; }
.wahl-zelle.gew { background: var(--tinte); color: var(--auf-tinte); font-weight: 600; }
.wahl-zelle:disabled { color: var(--aus); cursor: not-allowed; background: transparent; }
.wahl-fuss { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--linie); }
.wahl-fuss .linkknopf { font-size: .84rem; }
.wahl-fuss .linkknopf:disabled { opacity: .4; cursor: not-allowed; }

/* Datei: Ablagefläche */
.ablage { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin: 0; padding: 10px 14px;
  font-weight: 400; font-size: .88rem; color: var(--tinte-2); cursor: pointer;
  background: var(--flaeche); border: 1px dashed var(--feld-rand); border-radius: var(--r); transition: border-color .15s, background-color .15s; }
.ablage:hover, .ablage.drueber { border-color: var(--netz); background: color-mix(in srgb, var(--netz) 5%, var(--flaeche)); }
.ablage:focus-within { border-style: solid; border-color: var(--netz); box-shadow: 0 0 0 3px color-mix(in srgb, var(--netz) 22%, transparent); }
.ablage > .ic { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: var(--r); background: var(--grund-2); color: var(--tinte-2); }
.ablage.voll { border-style: solid; }
.ablage.voll > .ic { background: color-mix(in srgb, var(--gut) 14%, var(--flaeche)); color: var(--gut); }
.ablage-name { display: flex; flex-direction: column; min-width: 0; }
.ablage-name strong { font-weight: 600; color: var(--tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ablage-typ { font-size: .76rem; color: var(--leise); }
.ablage input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.zahlleiste .ablage { width: auto; flex: 1 1 250px; max-width: 360px; min-height: 40px; padding: 4px 10px; gap: 10px; }
.zahlleiste .ablage-name { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 5px; font-size: .84rem; }
.zahlleiste .reihe { flex-wrap: nowrap; }
.zahlleiste .ablage > .ic { width: 28px; height: 28px; padding: 6px; }

/* ---- Quelle Monate oder Tage (Version 25) ---- */
.quellwahl { border: 0; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quellwahl label { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 0; font-weight: 400; cursor: pointer;
  border: 1px solid var(--linie-2); border-radius: var(--r); background: var(--flaeche); transition: border-color .15s, background-color .15s; }
.quellwahl label:hover { border-color: var(--tinte-2); }
.quellwahl label:has(input:checked) { border-color: var(--tinte); box-shadow: inset 0 0 0 1px var(--tinte); background: var(--flaeche-2); }
.quellwahl input { margin-top: 2px; }
.quellwahl strong { display: block; color: var(--tinte); margin-bottom: 3px; }
.quellwahl .hilfe { display: block; margin: 0; }
.quellwahl-info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--r);
  background: var(--info-grund); color: var(--tinte); }
.quellwahl-info p { margin: 0; }
.quellwahl-info .ic { flex: none; margin-top: 2px; color: var(--netz); }
.mw-zelle.vorlaeufig .zelle { outline: 1px dashed var(--tinte-2); outline-offset: -3px; background: var(--flaeche-2); }
.mw-zelle.vorlaeufig .mini-zahl { color: var(--leise); font-style: italic; }
@media (max-width: 760px) { .quellwahl { grid-template-columns: 1fr; } }

/* ==== Dunkles Design (Version 26) ===================================================
   «Schaltschrank bei Nacht»: nicht invertiert, sondern eigene Ebenen. Grund am dunkelsten,
   Flächen heben sich mit jeder Ebene leicht an. Datenfarben aufgehellt, damit sie auf
   Dunkel die gleiche Wirkung haben. Umschalter unten in der Seitenleiste (Cookie «thema»). */
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --grund: #0c1017; --grund-2: #19202b; --flaeche: #131922; --flaeche-2: #18202a;
    --tinte: #e6e9ee; --tinte-2: #c8ced7; --leise: #929cab;
    --linie: #242c39; --linie-2: #323c4c; --feld-rand: #4b5669;
    --leiste: #080b11; --leiste-hier: #e6e9ee; --leiste-hier-text: #0c1017;
    --sonne: #f0b429; --sonne-text: #f3c75a; --batterie: #3cb98a; --batterie-text: #5fd0a2;
    --netz: #6b9bd1; --laden: #a68ad6;
    --gut: #4cc38a; --gut-grund: #12261b; --achtung: #e9b44c; --achtung-grund: #2a2210;
    --schlecht: #f07a5e; --schlecht-grund: #2b1612; --info-grund: #142130;
    --auf-tinte: #0c1017; --auf-tinte-leise: #4b5669;
    --gut-text: #a7e3c4; --gut-rand: #24543a; --schlecht-text: #ffc2b2; --schlecht-rand: #6a3328;
    --info-text: #bcd4ef; --info-rand: #2b4561; --achtung-text: #f3d79c; --achtung-rand: #5a4719;
    --hinweis-grund: #1d1b12; --hinweis-rand: #4d4320; --warn-grund: #22140f;
    --feld-rand-hover: #6d798c; --platzhalter: #7c8696; --aus: #454f5e;
    --zeile-hover: #171e28; --gefunden: #262111;
    --auswahl: #6b5a17; --auswahl-text: #fff6d6;
    --schatten: rgba(0, 0, 0, .45); --schatten-stark: rgba(0, 0, 0, .7);
    --vorlage: #080b11; --vorlage-text: #d8dee6; --vorlage-mark: #f2c14e;
    --feld-schatten: none;
    color-scheme: dark;
  }
}
:root[data-thema="dunkel"] {
  --grund: #0c1017; --grund-2: #19202b; --flaeche: #131922; --flaeche-2: #18202a;
  --tinte: #e6e9ee; --tinte-2: #c8ced7; --leise: #929cab;
  --linie: #242c39; --linie-2: #323c4c; --feld-rand: #4b5669;
  --leiste: #080b11; --leiste-hier: #e6e9ee; --leiste-hier-text: #0c1017;
  --sonne: #f0b429; --sonne-text: #f3c75a; --batterie: #3cb98a; --batterie-text: #5fd0a2;
  --netz: #6b9bd1; --laden: #a68ad6;
  --gut: #4cc38a; --gut-grund: #12261b; --achtung: #e9b44c; --achtung-grund: #2a2210;
  --schlecht: #f07a5e; --schlecht-grund: #2b1612; --info-grund: #142130;
  --auf-tinte: #0c1017; --auf-tinte-leise: #4b5669;
  --gut-text: #a7e3c4; --gut-rand: #24543a; --schlecht-text: #ffc2b2; --schlecht-rand: #6a3328;
  --info-text: #bcd4ef; --info-rand: #2b4561; --achtung-text: #f3d79c; --achtung-rand: #5a4719;
  --hinweis-grund: #1d1b12; --hinweis-rand: #4d4320; --warn-grund: #22140f;
  --feld-rand-hover: #6d798c; --platzhalter: #7c8696; --aus: #454f5e;
  --zeile-hover: #171e28; --gefunden: #262111;
  --auswahl: #6b5a17; --auswahl-text: #fff6d6;
  --schatten: rgba(0, 0, 0, .45); --schatten-stark: rgba(0, 0, 0, .7);
  --vorlage: #080b11; --vorlage-text: #d8dee6; --vorlage-mark: #f2c14e;
  --feld-schatten: none;
  color-scheme: dark;
}
:root[data-thema="hell"] { color-scheme: light; }
/* Pfeil im Auswahlfeld und Lupe im Suchfeld folgen der Schriftfarbe */
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e6e9ee' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
  :root:not([data-thema="hell"]) .wahl-zelle.jetzt { box-shadow: inset 0 0 0 1px var(--feld-rand); }
  :root:not([data-thema="hell"]) .hk-band .s, :root:not([data-thema="hell"]) .dg-tip .tz-z i.s { color: #2a1d00; }
}
:root[data-thema="dunkel"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e6e9ee' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* Themenwahl in der Seitenleiste */
.thema { display: flex; gap: 2px; padding: 3px; margin: 0 10px 8px; border-radius: var(--r); background: rgba(255, 255, 255, .05); }
.konto-menu .thema button, .mit-leiste .konto-menu .thema button { flex: 1; display: grid; place-items: center; height: 28px; min-height: 0;
  width: auto; padding: 0; border: 0; border-radius: var(--r-s); background: transparent; color: var(--leiste-text); cursor: pointer; }
.konto-menu .thema button .ic { width: 16px; height: 16px; }
.konto-menu .thema button[aria-pressed=true] { background: rgba(255, 255, 255, .16); color: #fff; }
.konto-menu .thema button:hover { color: #fff; }
.version { font-size: .76rem; color: #7b8799; padding: 4px 10px 0; }
@media (max-width: 999px) {
  .konto-menu .thema { margin: 0 4px 0 0; align-self: center; }
  .konto-menu .thema button { width: 30px; flex: none; }
  .version { display: none; }
}

/* Grosse Bedienelemente auf Touch-Geräten (Tablet im Technikraum) */
@media (pointer: coarse) {
  .knopf, .wahl-knopf, input[type=text], input[type=email], input[type=password], input[type=search], select { min-height: 44px; }
  .knopf.schmal { min-height: 38px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .reiter a { padding-top: 12px; padding-bottom: 12px; }
}

/* ==== Knowledge Base (Version 26) ==== */
.kb-kopf { max-width: 760px; margin-bottom: 26px; }
.kb-kopf h1 { font-size: 2rem; }
.kb-suche { display: flex; gap: 8px; margin-top: 14px; }
.kb-suche input { flex: 1; min-height: 46px; font-size: 1rem; }
.kb-suche .knopf { min-height: 46px; }
.kb-kategorien { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.kb-kategorie { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l); padding: 16px 18px 8px; }
.kb-kategorie h2 { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; font-size: 1.02rem; }
.kb-kategorie h2 .ic { color: var(--leise); }
.kb-kategorie ul { list-style: none; margin: 0; padding: 0; }
.kb-kategorie li + li { border-top: 1px solid var(--linie); }
.kb-kategorie a { display: block; padding: 10px 0; text-decoration: none; }
.kb-kategorie a strong { display: block; font-weight: 600; }
.kb-kategorie a span { display: block; font-size: .84rem; color: var(--leise); }
.kb-kategorie a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.kb-treffer { max-width: 760px; margin-bottom: 30px; }
.kb-treffer h2 { margin-top: 0; }
.kb-treffer-eintrag { display: grid; gap: 2px; padding: 12px 14px; margin-bottom: 8px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); text-decoration: none; }
.kb-treffer-eintrag:hover { border-color: var(--linie-2); }
.kb-auszug { font-size: .86rem; color: var(--tinte-2); }
.kb-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.kb-seite { position: sticky; top: 20px; font-size: .88rem; }
.kb-seite h3 { font-size: .78rem; color: var(--leise); margin: 16px 0 4px; font-weight: 600; }
.kb-seite ul { list-style: none; margin: 0; padding: 0; }
.kb-seite li a { display: block; padding: 4px 8px; margin-left: -8px; border-radius: var(--r-s); text-decoration: none; color: var(--tinte-2); }
.kb-seite li a:hover { background: var(--grund-2); }
.kb-seite li a.hier { background: var(--flaeche); color: var(--tinte); font-weight: 600; box-shadow: inset 0 0 0 1px var(--linie); }
.kb-seite input { margin-top: 10px; }
.kb-zurueck { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; text-decoration: none; }
.kb-artikel { max-width: 760px; }
.kb-pfad { font-size: .84rem; color: var(--leise); margin-bottom: 4px; }
.kb-artikel h1 { font-size: 2rem; }
.kb-kurz { font-size: 1.08rem; color: var(--tinte-2); margin-bottom: 22px; }
.kb-inhalt { line-height: 1.6; }
.kb-inhalt h2 { margin-top: 30px; }
.kb-inhalt ul { padding-left: 20px; }
.kb-inhalt li { margin-bottom: 6px; }
.kb-inhalt pre { background: var(--vorlage); color: var(--vorlage-text); padding: 12px 14px; border-radius: var(--r); overflow-x: auto; font: .82rem/1.55 var(--mono); }
.kb-inhalt kbd { font: 600 .78rem var(--schrift); padding: 1px 6px; border: 1px solid var(--linie-2); border-bottom-width: 2px; border-radius: var(--r-s); background: var(--flaeche); }
.anleitung { list-style: none; counter-reset: schritt; padding: 0; margin: 18px 0 22px; }
.anleitung > li { counter-increment: schritt; position: relative; padding: 0 0 18px 46px; }
.anleitung > li::before { content: counter(schritt); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--tinte); color: var(--auf-tinte); font-weight: 600; font-size: .86rem; font-variant-numeric: tabular-nums; }
.anleitung > li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 32px; bottom: 4px; width: 1px; background: var(--linie-2); }
.anleitung h3 { margin: 2px 0 4px; }
.anleitung p { margin: 0 0 6px; }
.kb-bild { margin: 8px 0 24px; }
.kb-bild img { display: block; max-width: 100%; height: auto; border: 1px solid var(--linie); border-radius: var(--r-l); box-shadow: 0 8px 24px -14px var(--schatten-stark); }
.kb-bild figcaption { font-size: .82rem; color: var(--leise); margin-top: 6px; }
.tipp { padding: 12px 14px; background: var(--info-grund); color: var(--info-text); border-radius: var(--r); margin: 14px 0; }
.beispiel { border-collapse: collapse; font-size: .86rem; margin: 8px 0 16px; }
.beispiel th, .beispiel td { border: 1px solid var(--linie-2); padding: 4px 10px; text-align: left; }
.beispiel th { background: var(--flaeche-2); }
.kb-weiter { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--linie); }
.kb-weiter a { display: grid; text-decoration: none; padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche); max-width: 48%; }
.kb-weiter a.r { text-align: right; margin-left: auto; }
.kb-weiter a:hover { border-color: var(--linie-2); }
.hilfe-link { display: inline-flex; vertical-align: middle; color: var(--leise); margin-left: 4px; text-decoration: none; }
.hilfe-link:hover { color: var(--netz); }
.hilfe-link .ic { width: 16px; height: 16px; }
h1 .hilfe-link .ic, h2 .hilfe-link .ic { width: 18px; height: 18px; }
@media (max-width: 860px) {
  .kb-layout { grid-template-columns: 1fr; }
  .kb-seite { position: static; display: none; }
  .kb-weiter a { max-width: none; }
}

/* ==== Import aus Excel ==== */
.ablauf { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 4px 0 18px; font-size: .9rem; color: var(--leise); }
.ablauf li { display: flex; align-items: center; gap: 8px; }
.ablauf span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--feld-rand); background: var(--flaeche); }
.ablauf li.jetzt { color: var(--tinte); font-weight: 600; }
.ablauf li.jetzt span { background: var(--tinte); color: var(--auf-tinte); border-color: var(--tinte); }
.ablauf li.fertig span { background: var(--gut); color: #fff; border-color: var(--gut); }
.zuordnen { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; }
.vorschau tr.problem td { background: var(--schlecht-grund); }
.krume { margin: 0 0 6px; font-size: .88rem; }
.krume a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--leise); }
.krume a:hover { color: var(--tinte); }

/* ==== Mehrere Empfänger ändern ==== */
.wahlspalte { width: 36px; }
#etab tr.gewaehlt td { background: color-mix(in srgb, var(--netz) 8%, var(--flaeche)); }
.massenleiste { position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-top: 12px;
  padding: 12px 14px; background: var(--tinte); color: var(--auf-tinte); border-radius: var(--r-l); box-shadow: 0 12px 30px -10px var(--schatten-stark); }
.massenleiste strong { align-self: center; }
.massenleiste label { color: var(--auf-tinte-leise); margin: 0; font-weight: 500; }
.massenleiste .feldgruppe { width: 150px; margin-top: 4px; }
.massenleiste input[type=text] { min-height: 36px; }
.massenleiste .knopf { background: var(--auf-tinte); color: var(--tinte); border-color: var(--auf-tinte); }
.massenleiste .linkknopf { color: var(--auf-tinte-leise); align-self: center; }
.massenleiste .tasten { flex-basis: 100%; font-size: .78rem; color: var(--auf-tinte-leise); }
.massenleiste kbd { font: 600 .74rem var(--schrift); padding: 0 5px; border: 1px solid var(--auf-tinte-leise); border-radius: var(--r-s); }
.jahrleiste { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; margin: 6px 0 10px; color: var(--leise); }
.jahrleiste select { width: auto; min-height: 32px; padding: 3px 30px 3px 8px; }
.massenleiste label > input[type=text] { width: 130px; display: block; margin-top: 4px; }
.knopf.ikon { padding: 0 8px; }
.nowrap { white-space: nowrap; }

/* ---- Version 27: Rechnungsliste auf dem Handy als Kartenliste statt quer scrollender Tabelle ---- */
@media (max-width: 700px) {
  table.rahmen.rliste, table.rahmen.rliste tbody { display: block; }
  table.rahmen.rliste thead { display: none; }
  table.rahmen.rliste tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--linie); }
  table.rahmen.rliste tr:last-child { border-bottom: 0; }
  table.rahmen.rliste td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  table.rahmen.rliste td:nth-child(1) { grid-column: 1 / -1; font-size: .78rem; color: var(--leise); }
  table.rahmen.rliste td:nth-child(2) { grid-column: 1; grid-row: 2; font-weight: 600; }
  table.rahmen.rliste td:nth-child(2) .klein { font-weight: 400; }
  table.rahmen.rliste td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; font-weight: 600; }
  table.rahmen.rliste td:nth-child(4)::before { content: "CHF "; font-weight: 400; color: var(--leise); font-size: .78rem; }
  table.rahmen.rliste td:nth-child(3) { grid-column: 1 / -1; font-size: .875rem; color: var(--tinte-2); }
  table.rahmen.rliste td:nth-child(5) { grid-column: 1 / -1; margin-top: 6px; }
  table.rahmen.rliste td:nth-child(6) { grid-column: 1 / -1; text-align: left; margin: 6px 0 0 -8px; }
}

/* ==== Version 28: Zählerschrank ==== */
/* Beschriftungsetikett: Zählernummern und Kennungen stehen wie auf dem Band aus dem Beschriftungsgerät */
.schild { display: inline-block; padding: 0 6px; background: var(--tinte); color: var(--auf-tinte); border-radius: 1px;
  font: 700 .86rem/1.55 var(--schmal); letter-spacing: .06em; font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: 1px; }
.mw-nr .schild { font-size: .78rem; line-height: 1.4; }

/* Typenschild: die festen Angaben eines Standorts in einer Zeile mit Feldern */
.typenschild { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 10px 0 0; background: var(--flaeche);
  border: 1px solid var(--linie-2); border-radius: var(--r); }
.typenschild > div { padding: 5px 16px 6px 12px; border-right: 1px solid var(--linie); }
.typenschild > div:last-child { border-right: 0; }
.typenschild dt { font-size: .74rem; line-height: 1.3; color: var(--leise); }
.typenschild dd { margin: 0; font: 700 1.04rem/1.25 var(--schmal); letter-spacing: .02em; }

/* Seiten ohne Anmeldung: Modulblau, oben das Herkunftsband über die ganze Breite */
body.ohne-leiste { background: var(--leiste); min-height: 100vh; }
body.ohne-leiste::before { content: ""; display: block; height: 8px;
  background: linear-gradient(90deg, var(--sonne) 0 46%, var(--batterie) 46% 62%, var(--netz) 62% 88%, var(--laden) 88%); }
.ohne-leiste .aussen-marke .band { width: 44px; height: 20px; }
.ohne-leiste .blatt { border-color: transparent; padding: 26px 28px; }
.ohne-leiste main > .meldung { max-width: 420px; margin-left: auto; margin-right: auto; }
.ohne-leiste .schmal-seite h1 { font-size: 1.7rem; }

@media (max-width: 999px) {
  .kopf nav a { font-size: .95rem; }
  .typenschild > div { padding: 4px 12px 5px 10px; }
}
.tauschnotiz { min-width: 220px; }
