/* Owner-Bereich – Stil. Werte übernommen aus dem Produktstil (ui.css, --ui-*): ruhig, eine Akzentfarbe (App-Grün),
   weiche kurze Bewegung (nur transform/opacity, 150–250 ms), hell/dunkel nach Systemeinstellung.
   Zuerst für 390 px gebaut, ab 900 px Navigation links. Keine Schriften von außen. */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light dark;
  --abstand-1: 4px; --abstand-2: 8px; --abstand-3: 12px; --abstand-4: 16px; --abstand-5: 24px; --abstand-6: 32px;
  --radius-s: 10px; --radius-m: 14px; --radius-l: 20px; --radius-rund: 999px;
  --schrift-titel: 1.625rem; --schrift-abschnitt: 1.0625rem; --schrift-text: 1rem; --schrift-klein: .8125rem;
  --seite: #F5F5F7;
  --flaeche: #FFFFFF;
  --flaeche-2: #F5F5F7;
  --linie: #E5E5EA;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --akzent: #0E7A5A;
  --auf-akzent: #FFFFFF;
  --ok: #0C6F47;
  --warn: #8A5D00;
  --fehler: #B42318;
  --info: #0B5BD3;
  --schatten: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px -8px rgba(0, 0, 0, .10);
  --schatten-hoch: 0 16px 40px -12px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .06);
  --schleier: rgba(0, 0, 0, .32);
  --feder: cubic-bezier(.2, .8, .2, 1);
  --feder-aus: cubic-bezier(.4, 0, 1, 1);
  --feder-schwung: cubic-bezier(.3, 1.4, .5, 1);
  --dauer-sofort: 100ms; --dauer-kurz: 150ms; --dauer: 200ms; --dauer-lang: 250ms;
  --ziel: 44px;
  --navi-hoehe: 64px;
  --akzent-zart: color-mix(in srgb, var(--akzent) 12%, var(--flaeche));
  --ok-zart: color-mix(in srgb, var(--ok) 12%, var(--flaeche));
  --warn-zart: color-mix(in srgb, var(--warn) 14%, var(--flaeche));
  --fehler-zart: color-mix(in srgb, var(--fehler) 11%, var(--flaeche));
  --info-zart: color-mix(in srgb, var(--info) 11%, var(--flaeche));
  --hover: color-mix(in srgb, var(--text) 6%, transparent);
  --druck: color-mix(in srgb, var(--text) 11%, transparent);
  --fokus: color-mix(in srgb, var(--akzent) 70%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root {
    --seite: #000000; --flaeche: #1C1C1E; --flaeche-2: #2C2C2E; --linie: #3A3A3C; --text: #F5F5F7; --text-2: #A1A1A6;
    --akzent: #34C38F; --auf-akzent: #06281C; --ok: #3DD68C; --warn: #F5B841; --fehler: #FF7A6E; --info: #64A8FF;
    --schatten: 0 1px 2px rgba(0, 0, 0, .5); --schatten-hoch: 0 16px 40px -12px rgba(0, 0, 0, .7); --schleier: rgba(0, 0, 0, .55);
    --akzent-zart: color-mix(in srgb, var(--akzent) 18%, var(--flaeche)); --ok-zart: color-mix(in srgb, var(--ok) 18%, var(--flaeche));
    --warn-zart: color-mix(in srgb, var(--warn) 18%, var(--flaeche)); --fehler-zart: color-mix(in srgb, var(--fehler) 18%, var(--flaeche));
    --info-zart: color-mix(in srgb, var(--info) 18%, var(--flaeche));
  }
}

/* ---------- 2. Grundlage ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--seite); color: var(--text);
  font: 400 var(--schrift-text)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--akzent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sym { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprung { position: absolute; left: var(--abstand-2); top: -100px; z-index: 50; padding: var(--abstand-2) var(--abstand-3); background: var(--flaeche); border-radius: var(--radius-s); }
.sprung:focus { top: var(--abstand-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.leise { color: var(--text-2); }
.klein { font-size: var(--schrift-klein); }

/* ---------- 3. Hülle, Navigation ---------- */
.huelle { min-height: 100dvh; }
.inhalt { padding: var(--abstand-4) var(--abstand-4) calc(var(--navi-hoehe) + var(--abstand-6) + env(safe-area-inset-bottom)); max-width: 1080px; margin: 0 auto; min-width: 0; }
.inhalt:focus { outline: none; }
.huelle--ohne-navi .inhalt { padding-bottom: var(--abstand-6); }

.navi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  height: calc(var(--navi-hoehe) + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--flaeche) 92%, transparent); border-top: 1px solid var(--linie);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
}
.navi-kopf, .navi-fuss { display: none; }
.navi-liste { display: contents; list-style: none; margin: 0; padding: 0; }
.navi-liste > li { display: contents; }
.navi-link {
  position: relative; flex: 1 1 0; min-width: 0; min-height: var(--ziel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--radius-m); color: var(--text-2); text-decoration: none; font-size: .6875rem; font-weight: 600; letter-spacing: .01em;
  transition: color var(--dauer-kurz) ease, transform var(--dauer-sofort) var(--feder);
}
.navi-link:active { transform: scale(.96); }
.navi-link[aria-current="page"] { color: var(--akzent); }
.navi-link--nur-pc { display: none; }
.navi-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.navi-zahl {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-rund);
  background: var(--fehler); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center;
}
.navi-zahl:empty { display: none; }

@media (min-width: 900px) {
  .huelle { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .huelle--ohne-navi { display: block; }
  .inhalt { padding: var(--abstand-6) var(--abstand-6) var(--abstand-6); width: 100%; }
  .navi {
    position: sticky; top: 0; bottom: auto; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: var(--abstand-5) var(--abstand-3); border-top: 0; border-right: 1px solid var(--linie); background: var(--flaeche); overflow-y: auto;
  }
  .navi-kopf { display: flex; align-items: center; gap: var(--abstand-2); padding: 0 var(--abstand-3) var(--abstand-5); font-weight: 700; font-size: 1.0625rem; }
  .navi-kopf img { width: 32px; height: 32px; border-radius: 8px; }
  .navi-liste { display: flex; flex-direction: column; gap: 2px; }
  .navi-liste > li { display: block; }
  .navi-link { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--abstand-3); padding: 0 var(--abstand-3); font-size: .9375rem; font-weight: 500; color: var(--text); }
  .navi-link:hover { background: var(--hover); }
  .navi-link[aria-current="page"] { background: var(--akzent-zart); color: var(--akzent); font-weight: 600; }
  .navi-link--nur-pc { display: flex; }
  .navi-link--nur-handy { display: none; }
  .navi-zahl { position: static; margin-left: auto; }
  .navi-fuss { display: block; margin-top: auto; padding: var(--abstand-4) var(--abstand-3) 0; color: var(--text-2); font-size: var(--schrift-klein); }
}

/* Not-Aus-Balken */
.notaus {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: var(--abstand-2);
  min-height: var(--ziel); padding: var(--abstand-2) var(--abstand-4); padding-top: calc(var(--abstand-2) + env(safe-area-inset-top));
  background: var(--warn); color: #fff; font-weight: 700; text-align: center;
}
@media (prefers-color-scheme: dark) { .notaus { color: #1D1D1F; } }
/* P4 (S-06): Grund und Zeit des Not-Aus als zweite Zeile im Balken */
.notaus { flex-wrap: wrap; }
.notaus-grund { flex-basis: 100%; font-weight: 600; font-size: var(--schrift-klein); overflow-wrap: anywhere; }

/* ---------- 4. Seite, Abschnitt ---------- */
.seiten-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: var(--abstand-2) var(--abstand-3); margin: var(--abstand-2) 0 var(--abstand-5); min-width: 0; }
.seiten-kopf-text { flex: 1 1 200px; min-width: 0; }
.seiten-titel { font-size: var(--schrift-titel); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.seiten-titel:focus { outline: none; }
.seiten-unter { margin-top: 2px; color: var(--text-2); }
.seiten-aktionen { display: flex; flex-wrap: wrap; gap: var(--abstand-2); }
.zurueck { display: inline-flex; align-items: center; justify-content: center; width: var(--ziel); height: var(--ziel); margin-left: calc(-1 * var(--abstand-2)); border-radius: var(--radius-rund); color: var(--akzent); }
.zurueck:hover { background: var(--hover); }

.abschnitt { margin: 0 0 var(--abstand-6); min-width: 0; }
.abschnitt-kopf { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--abstand-2) var(--abstand-3); margin-bottom: var(--abstand-3); }
.abschnitt-titel { font-size: var(--schrift-abschnitt); font-weight: 650; letter-spacing: -.01em; }
.abschnitt-text { margin-top: 2px; color: var(--text-2); font-size: var(--schrift-klein); }
.abschnitt-inhalt { display: flex; flex-direction: column; gap: var(--abstand-3); min-width: 0; }

.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--abstand-3); }
.raster--zahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .raster--zahlen { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.zwei-spalten { display: grid; gap: var(--abstand-5); }
@media (min-width: 1100px) { .zwei-spalten { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* ---------- 5. Karte, Liste ---------- */
.karte {
  position: relative; display: flex; flex-direction: column; gap: var(--abstand-3); min-width: 0; padding: var(--abstand-4);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-l); box-shadow: var(--schatten);
}
.karte-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--abstand-3); min-width: 0; }
.karte-kopf > .pille { flex: none; max-width: 60%; white-space: normal; text-align: right; }
.karte-titel { font-weight: 650; font-size: 1rem; line-height: 1.3; }
.karte-unter { color: var(--text-2); font-size: var(--schrift-klein); margin-top: 2px; }
.karte-fuss { display: flex; flex-wrap: wrap; gap: var(--abstand-2); align-items: center; }
.karte--warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--linie)); }
.karte--fehler { border-color: var(--fehler); background: var(--fehler-zart); }
.karte--hervor { border: 2px solid var(--akzent); }
.zahl-karte { gap: 2px; }
.zahl-karte .zahl { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.zahl-karte .zahl-text { color: var(--text-2); font-size: var(--schrift-klein); }

.liste { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-l); box-shadow: var(--schatten); overflow: hidden; }
.liste > li + li { border-top: 1px solid var(--linie); }
.zeile {
  display: flex; align-items: center; gap: var(--abstand-3); min-height: 60px; padding: var(--abstand-3) var(--abstand-4); color: inherit; text-decoration: none; min-width: 0;
}
a.zeile { transition: background-color var(--dauer-kurz) ease; }
a.zeile:hover { background: var(--hover); }
a.zeile:active { background: var(--druck); }
.zeile-haupt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zeile-titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.zeile-unter { color: var(--text-2); font-size: var(--schrift-klein); }
.zeile-rechts { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; max-width: 45%; }
.zeile-rechts .pille { max-width: 100%; }
.zeile .sym-pfeil { color: var(--text-2); }

/* ---------- 6. Knöpfe, Pillen ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--abstand-2); min-height: var(--ziel); padding: 0 var(--abstand-4);
  border: 1px solid transparent; border-radius: var(--radius-rund); font-weight: 600; font-size: .9375rem; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: transform var(--dauer-sofort) var(--feder), background-color var(--dauer-kurz) ease, border-color var(--dauer-kurz) ease, opacity var(--dauer-kurz) ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.knopf:active:not(:disabled) { transform: scale(.97); }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf--primaer { background: var(--akzent); color: var(--auf-akzent); }
.knopf--primaer:hover:not(:disabled) { background: color-mix(in srgb, var(--akzent) 88%, var(--text)); }
.knopf--sekundaer { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
.knopf--sekundaer:hover:not(:disabled) { background: var(--flaeche-2); }
.knopf--leise { background: transparent; color: var(--akzent); }
.knopf--leise:hover:not(:disabled) { background: var(--hover); }
.knopf--gefahr { background: var(--flaeche); color: var(--fehler); border-color: color-mix(in srgb, var(--fehler) 40%, var(--linie)); }
.knopf--gefahr:hover:not(:disabled) { background: var(--fehler-zart); }
.knopf--gefahr-voll { background: var(--fehler); color: #fff; }
@media (prefers-color-scheme: dark) { .knopf--gefahr-voll { color: #1D1D1F; } }
.knopf--klein { padding: 0 var(--abstand-3); font-size: .875rem; }
.knopf--voll { width: 100%; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: var(--abstand-2); }

.pille {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: var(--radius-rund);
  font-size: .75rem; font-weight: 650; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pille--ok { background: var(--ok-zart); color: var(--ok); }
.pille--warn { background: var(--warn-zart); color: var(--warn); }
.pille--fehler { background: var(--fehler-zart); color: var(--fehler); }
.pille--info { background: var(--info-zart); color: var(--info); }
.pille--grau { background: var(--flaeche-2); color: var(--text-2); }

/* ---------- 7. Formular ---------- */
.formular { display: flex; flex-direction: column; gap: var(--abstand-4); }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld-titel { font-weight: 600; font-size: .9375rem; }
.pflicht { color: var(--fehler); }
.feld input, .feld select, .feld textarea, .suchfeld input {
  width: 100%; min-height: var(--ziel); padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--flaeche); font-size: 1rem; /* ≥ 16 px: kein Zoom am iPhone */
  transition: border-color var(--dauer-kurz) ease;
}
.feld textarea { min-height: 88px; resize: vertical; }
.feld input:focus-visible, .feld select:focus-visible, .feld textarea:focus-visible, .suchfeld input:focus-visible { outline: 3px solid var(--fokus); outline-offset: 0; border-color: var(--akzent); }
.feld [aria-invalid="true"] { border-color: var(--fehler); }
.feld-hilfe { color: var(--text-2); font-size: var(--schrift-klein); }
.feld-fehler { color: var(--fehler); font-size: var(--schrift-klein); font-weight: 600; }
.feld-reihe { display: grid; gap: var(--abstand-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.feld input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--akzent); }
.ankreuzen { display: flex; align-items: center; gap: var(--abstand-3); min-height: var(--ziel); cursor: pointer; }
.ankreuzen input { width: 22px; height: 22px; accent-color: var(--akzent); flex: none; }
fieldset.gruppe { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--abstand-2); }
fieldset.gruppe > legend { padding: 0; margin-bottom: var(--abstand-2); font-weight: 600; }

.suchfeld { position: relative; display: block; flex: 1 1 220px; min-width: 0; }
.suchfeld .sym { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.suchfeld input { padding-left: 40px; background: var(--flaeche); }
.werkzeugleiste { display: flex; flex-wrap: wrap; gap: var(--abstand-2); align-items: center; margin-bottom: var(--abstand-3); }

/* Segment / Filter-Chips (waagrecht wischbar am Handy) */
.segment { display: flex; gap: var(--abstand-2); overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; max-width: 100%; }
.segment::-webkit-scrollbar { display: none; }
.segment-knopf {
  flex: none; min-height: var(--ziel); padding: 0 var(--abstand-4); border: 1px solid var(--linie); border-radius: var(--radius-rund);
  background: var(--flaeche); color: var(--text); font-weight: 600; font-size: .875rem; cursor: pointer;
  transition: background-color var(--dauer-kurz) ease, color var(--dauer-kurz) ease, transform var(--dauer-sofort) var(--feder);
}
.segment-knopf:active { transform: scale(.97); }
.segment-knopf[aria-pressed="true"] { background: var(--text); color: var(--flaeche); border-color: var(--text); }

/* Schalter */
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: var(--abstand-3); min-height: 52px; padding: var(--abstand-2) 0; }
.schalter-zeile + .schalter-zeile { border-top: 1px solid var(--linie); }
.schalter-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.schalter-titel { font-weight: 550; }
.schalter-hilfe { color: var(--text-2); font-size: var(--schrift-klein); }
.schalter { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 60px; height: var(--ziel); padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius-rund); }
.schalter:disabled { cursor: not-allowed; opacity: .55; }
.schalter-spur { position: relative; width: 51px; height: 31px; border-radius: var(--radius-rund); background: var(--linie); transition: background-color var(--dauer-kurz) ease; }
.schalter-knopf { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform var(--dauer-lang) var(--feder-schwung); }
.schalter[aria-checked="true"] .schalter-spur { background: var(--akzent); }
.schalter[aria-checked="true"] .schalter-knopf { transform: translateX(20px); }

/* ---------- 8. Hinweise, Leer, Laden ---------- */
.hinweis { display: flex; flex-direction: column; gap: var(--abstand-2); padding: var(--abstand-3) var(--abstand-4); border-radius: var(--radius-m); background: var(--info-zart); color: var(--text); border: 1px solid transparent; }
.hinweis > .knopf { align-self: flex-start; }
.hinweis--warn { background: var(--warn-zart); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.hinweis--fehler { background: var(--fehler-zart); border-color: color-mix(in srgb, var(--fehler) 35%, transparent); }
.hinweis--ok { background: var(--ok-zart); }
.leer { padding: var(--abstand-5) var(--abstand-4); text-align: center; color: var(--text-2); background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius-l); display: flex; flex-direction: column; align-items: center; gap: var(--abstand-2); }
.leer-titel { color: var(--text); font-weight: 600; }
.laedt { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-2); color: var(--text-2); padding: var(--abstand-3) 0; }
.laedt-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--akzent); animation: puls 1400ms ease-in-out infinite; }
.skelett { flex-basis: 100%; height: 56px; border-radius: var(--radius-m); background: linear-gradient(90deg, var(--flaeche-2) 0%, var(--flaeche) 50%, var(--flaeche-2) 100%); background-size: 200% 100%; animation: schimmer 1400ms linear infinite; }
.skelett--kurz { height: 56px; flex-basis: 70%; }
@keyframes puls { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes schimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- 9. Angaben (dl), Code, Geheimnis ---------- */
.angaben { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px var(--abstand-4); margin: 0; }
.angaben dt { color: var(--text-2); font-size: var(--schrift-klein); margin-top: var(--abstand-2); }
.angaben dd { margin: 0; font-weight: 500; min-width: 0; }
@media (min-width: 360px) { /* P2: vorher 560 px – am iPhone standen Begriff und Wert untereinander, Karten waren doppelt so hoch */
  .angaben { grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); row-gap: var(--abstand-2); }
  .angaben dt { margin-top: 0; }
}
.geheim { padding: var(--abstand-3); border-radius: var(--radius-m); background: var(--flaeche-2); border: 1px solid var(--linie); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9375rem; white-space: pre-wrap; word-break: break-all; user-select: all; }
.geheim--text { font-family: inherit; word-break: normal; overflow-wrap: anywhere; }

/* ---------- 10. Wartet auf Freischaltung ---------- */
.wartet-karte[data-stufe="bald"] { border-color: color-mix(in srgb, var(--warn) 55%, var(--linie)); }
.wartet-karte[data-stufe="ueberfaellig"] { border: 2px solid var(--fehler); background: var(--fehler-zart); }
.wartezeit { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wartet-karte[data-stufe="ueberfaellig"] .wartezeit { color: var(--fehler); }
.wartet-karte[data-stufe="bald"] .wartezeit { color: var(--warn); }
.wartet-zeilen { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--abstand-3); font-size: .9375rem; margin: 0; }
.wartet-zeilen dt { color: var(--text-2); }
.wartet-zeilen dd { margin: 0; }

/* ---------- 11. Fortschritt in Schritten ---------- */
.schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--abstand-2); }
.schritt { display: flex; align-items: center; gap: var(--abstand-3); min-height: 36px; color: var(--text-2); }
.schritt-punkt { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--linie); background: var(--flaeche); }
.schritt[data-zustand="laeuft"] { color: var(--text); font-weight: 600; }
.schritt[data-zustand="laeuft"] .schritt-punkt { border-color: var(--akzent); }
.schritt[data-zustand="laeuft"] .schritt-punkt::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--akzent); animation: puls 1400ms ease-in-out infinite; }
.schritt[data-zustand="fertig"] { color: var(--text); }
.schritt[data-zustand="fertig"] .schritt-punkt { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); animation: feder var(--dauer-lang) var(--feder-schwung); }
.schritt[data-zustand="fehler"] { color: var(--fehler); font-weight: 600; }
.schritt[data-zustand="fehler"] .schritt-punkt { border-color: var(--fehler); color: var(--fehler); }
@keyframes feder { from { transform: scale(.6); } to { transform: scale(1); } }

/* ---------- 12. Dialog ---------- */
.dialog {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0; border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--flaeche); color: var(--text); box-shadow: var(--schatten-hoch); display: flex; flex-direction: column; overflow: hidden;
}
.dialog:not([open]) { display: none; }
.dialog[open] { animation: blatt-ein var(--dauer-lang) var(--feder); }
.dialog::backdrop { background: var(--schleier); animation: blende-ein var(--dauer) var(--feder); }
.dialog-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--abstand-3); padding: var(--abstand-4) var(--abstand-4) var(--abstand-2); }
.dialog-titel { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.01em; }
.dialog-zu { flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--ziel); height: var(--ziel); margin-right: calc(-1 * var(--abstand-2)); border: 0; border-radius: var(--radius-rund); background: transparent; color: var(--text-2); cursor: pointer; }
.dialog-zu:hover { background: var(--hover); color: var(--text); }
.dialog-koerper { display: flex; flex-direction: column; gap: var(--abstand-4); padding: var(--abstand-2) var(--abstand-4) var(--abstand-4); overflow-y: auto; overscroll-behavior: contain; }
.dialog-fuss { display: flex; flex-direction: column-reverse; gap: var(--abstand-2); padding: var(--abstand-3) var(--abstand-4) calc(var(--abstand-4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); }
.dialog-fuss:empty { display: none; }
.dialog-fuss .knopf { width: 100%; }
@media (min-width: 640px) {
  .dialog { width: min(560px, calc(100% - 48px)); margin: auto; border-radius: var(--radius-l); max-height: min(86dvh, 820px); }
  .dialog--breit { width: min(720px, calc(100% - 48px)); }
  .dialog[open] { animation: dialog-ein var(--dauer-lang) var(--feder); }
  .dialog-fuss { flex-direction: row; justify-content: flex-end; padding-bottom: var(--abstand-4); }
  .dialog-fuss .knopf { width: auto; }
}
@keyframes blatt-ein { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dialog-ein { from { transform: scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes blende-ein { from { opacity: 0; } to { opacity: 1; } }

/* Vorher / Nachher */
.vergleich { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.vergleich th, .vergleich td { text-align: left; padding: var(--abstand-2); border-bottom: 1px solid var(--linie); vertical-align: top; }
.vergleich th { color: var(--text-2); font-weight: 600; font-size: var(--schrift-klein); }
.vergleich td.nachher { font-weight: 650; color: var(--akzent); }
.vergleich td.vorher { color: var(--text-2); }
.vergleich-leer { color: var(--text-2); font-size: var(--schrift-klein); }

/* Code-Eingabe 6-stellig */
.code-eingabe { font-size: 1.5rem !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- 13. Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--navi-hoehe) + var(--abstand-4) + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--abstand-2); width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: var(--abstand-5); } }
.toast { padding: var(--abstand-3) var(--abstand-4); border-radius: var(--radius-m); background: var(--text); color: var(--flaeche); box-shadow: var(--schatten-hoch); font-weight: 600; animation: blatt-ein var(--dauer) var(--feder); pointer-events: auto; }
.toast--fehler { background: var(--fehler); color: #fff; }
.toast--weg { opacity: 0; transform: translateY(8px); transition: opacity var(--dauer-kurz) var(--feder-aus), transform var(--dauer-kurz) var(--feder-aus); }

/* ---------- 14. Anmelden ---------- */
.anmelden { max-width: 420px; margin: 0 auto; padding-top: max(var(--abstand-6), 8vh); display: flex; flex-direction: column; gap: var(--abstand-5); }
.anmelden-marke { display: flex; align-items: center; gap: var(--abstand-3); }
.anmelden-marke img { width: 48px; height: 48px; border-radius: 12px; }
.anmelden-marke h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.trenner { display: flex; align-items: center; gap: var(--abstand-3); color: var(--text-2); font-size: var(--schrift-klein); }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }
.schluessel-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.0625rem; letter-spacing: .08em; word-break: break-all; }

/* ---------- 15. Messbalken (Kosten, Speicher) ---------- */
meter.mass { width: 100%; height: 10px; }
.mass-zeile { display: flex; flex-direction: column; gap: 4px; }
.mass-text { display: flex; justify-content: space-between; gap: var(--abstand-2); font-size: var(--schrift-klein); color: var(--text-2); }

/* Module/Berechtigungen als kleine Marken */
.marken { display: flex; flex-wrap: wrap; gap: 6px; }

/* Protokoll */
.protokoll-zeile .zeile-haupt { gap: 4px; }
.protokoll-details { font-size: var(--schrift-klein); }
.protokoll-details summary { cursor: pointer; min-height: var(--ziel); display: flex; align-items: center; color: var(--akzent); font-weight: 600; }
.protokoll-details pre { margin: 0; padding: var(--abstand-3); background: var(--flaeche-2); border-radius: var(--radius-s); white-space: pre-wrap; word-break: break-word; font-size: .75rem; max-height: 280px; overflow: auto; }

/* ---------- 15b. P2: Hinweise oben, „Für den Kunden“, Aktionsgruppen, „Noch zu erledigen“ ---------- */
.seiten-hinweise { display: flex; flex-direction: column; gap: var(--abstand-3); margin: 0 0 var(--abstand-5); }
.sicht-liste, .bereit-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--abstand-3); }
.bereit-liste { padding: var(--abstand-4); }
.sicht-liste li, .bereit-liste li { display: flex; align-items: flex-start; gap: var(--abstand-2); }
.sicht-liste li .sym, .bereit-liste li .sym { margin-top: 2px; }
.sicht-liste li[data-art="ok"] .sym { color: var(--ok); }
.sicht-liste li[data-art="warn"] .sym, .bereit-liste li[data-art="warn"] .sym { color: var(--warn); }
.sicht-liste li[data-art="fehler"], .bereit-liste li[data-art="fehler"] { font-weight: 600; }
.sicht-liste li[data-art="fehler"] .sym, .bereit-liste li[data-art="fehler"] .sym { color: var(--fehler); }
/* P4 (S-01): Knopf „Adresse jetzt einrichten“ unter dem Text in der Karte „Für den Kunden“ */
.sicht-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--abstand-2); min-width: 0; }
.sicht-knopf { font-weight: 400; }
/* P4 (T-10): Erklärung im Dialog „Kundendaten löschen“ */
.loesch-erklaerung { display: flex; flex-direction: column; gap: var(--abstand-2); }
.loesch-erklaerung:focus { outline: none; }
.loesch-ergebnis { display: flex; flex-direction: column; gap: var(--abstand-3); }
.loesch-liste { margin: 0 0 var(--abstand-2); padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--abstand-1, 4px); }
.bereit-liste li[data-art="info"] .sym { color: var(--text-2); }
.bereit-text { display: flex; flex-direction: column; min-width: 0; }
.bereit-link { display: inline-flex; align-items: center; min-height: var(--ziel); font-weight: 600; text-decoration: none; align-self: flex-start; }
.aktion-gruppe { display: flex; flex-direction: column; gap: var(--abstand-2); }
.aktion-gruppe + .aktion-gruppe { margin-top: var(--abstand-3); }
.aktion-gruppe-titel { font-size: var(--schrift-klein); font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
/* „an“ in der Lizenz, wirkt aber in Kunden-Instanzen nicht: grau statt grün */
.schalter--wirkungslos[aria-checked="true"] .schalter-spur { background: var(--text-2); }

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

/* R3-1 Kontingente: Zeile einer Nachberechnung (Monat, Betrag, Status, Knopf) – bricht um */
.nb-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.nb-zeile > span:first-child { flex: 1 1 12rem; min-width: 0; }
