/* Konto-Seite „Einstellungen“: Gruppen als ruhige Karten mit Zeilen (Name und eine Unterzeile links,
   Wert oder Knopf rechts), am Handy untereinander. Ergänzt konto.css, rechnungen.css (Dialog) und bewegung.css. */

.e-bereiche { display: flex; flex-direction: column; gap: 16px; }
.e-bereiche > .k-karte + .k-karte { margin-top: 0; }
.e-seitenkopf { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.e-seitenkopf .k-titel, .e-seitenkopf .k-unter { margin: 0; }

.e-gruppe { padding-top: 8px; padding-bottom: 8px; }
.e-zeilen { margin: 0; display: flex; flex-direction: column; }
.e-zeile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
  padding: 14px 0; min-height: 44px;
}
.e-zeilen .e-zeile + .e-zeile { border-top: 1px solid var(--border); }
.e-zeile dt, .e-zeile > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.e-zeile dd { margin: 0; color: var(--text); font-weight: 550; overflow-wrap: anywhere; text-align: right; }
.e-name { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; }
.e-unter { margin: 0; color: var(--text-3); font-size: 14px; line-height: 1.45; }
.e-aktion { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

.e-gefahr { border-color: var(--error-border); }
.e-gefahr .e-name { color: var(--error-text); }

#export-status { display: inline-flex; align-items: center; min-height: 24px; }
#export-status:empty { display: none; }

/* Was beim Löschen passiert */
#plan-huelle:has(.e-plan:empty) { display: none; }
.e-plan { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.e-plan:empty { display: none; }
.e-punkt {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--surface-2);
}
.e-punkt-firma { color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.e-punkt-text { color: var(--text-2); font-size: 14px; line-height: 1.45; }
#plan-blockiert { margin: 0 0 12px; }

.e-archiv { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.e-archiv .k-klein { margin: 0; }

@media (max-width: 480px) {
  .e-zeile { grid-template-columns: minmax(0, 1fr); }
  .e-zeile dd { text-align: left; }
  .e-aktion { justify-content: flex-start; flex-wrap: wrap; }
}

/* Darstellung: ein Knopf, Text passend zum aktuellen Modus (thema.js schaltet um) */
.e-thema-hell { display: none; }
:root[data-theme="dark"] .e-thema-dunkel { display: none; }
:root[data-theme="dark"] .e-thema-hell { display: inline; }

/* Reiter Firma, Rechnung, Konto (wie die unterstrichenen Reiter in Untitled UI) */
.e-reiter {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  margin-bottom: 4px;
}
.e-reiter::-webkit-scrollbar { display: none; }
.e-reiter-knopf {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 0; background: none; cursor: pointer; color: var(--text-3); font: inherit; font-size: 15px; font-weight: 600;
}
.e-reiter-knopf .k-ikon, .e-reiter-ikon { width: 20px; height: 20px; }
/* Schmal: nur die Wörter, damit alle vier Reiter ohne Wischen passen */
@media (max-width: 520px) { .e-reiter-knopf .k-ikon, .e-reiter-ikon { display: none; } }
.e-reiter-knopf:hover { color: var(--text-2); }
.e-reiter-knopf[aria-selected="true"] { color: var(--primary); }
.e-reiter-knopf[aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary);
}
.e-reiter-knopf:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.e-bereich { display: flex; flex-direction: column; gap: 16px; }

/* Formulare: Abschnitte mit Titel links (ab 760 px) und Feldern rechts */
/* Etwas breiter als die schmalen Formularseiten, damit Titel und Felder nebeneinander passen */
.e-haupt { max-width: calc(760px + 2 * var(--rand)); }
.e-formular { --karte-innen: 32px; gap: 0; padding-top: 4px; padding-bottom: 0; container-type: inline-size; }
.e-abschnitt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 0; }
.e-abschnitt + .e-abschnitt { border-top: 1px solid var(--border); }
.e-abschnitt-kopf { display: flex; flex-direction: column; gap: 2px; }
.e-felder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.e-felder > * { grid-column: span 6; }
.e-felder > .e-halb { grid-column: span 3; }
.e-felder > .e-plz { grid-column: span 2; }
.e-felder > .e-ort { grid-column: span 4; }
.e-felder .k-feld-hinweis:empty { display: none; }
.e-felder [hidden] { display: none; }
.e-optional { color: var(--text-3); font-weight: 400; }
@container (min-width: 600px) {
  .e-abschnitt { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
}
@container (max-width: 380px) {
  .e-felder > .e-halb { grid-column: span 6; }
}

/* Eine Leiste „Verwerfen | Speichern“ für die ganze Seite (#e-fuss, einstellungen-sammeln.js). Sie steht am
   Ende von #bereiche außerhalb aller Formulare und gilt für alle Reiter zusammen.
   Desktop: immer im Fluss (Platz ist reserviert, kein Layout-Sprung), sticky am unteren Rand und nur sichtbar,
   solange etwas ungespeichert ist oder eine Meldung dasteht.
   Handy und Tablet: fest über der Tab-Leiste (Media Query weiter unten). */
.e-fuss {
  --karte-innen: 24px;
  position: sticky; bottom: 16px; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 14px var(--karte-innen);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: 0 12px 24px -12px rgb(16 24 40 / .22), var(--shadow-sm);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s var(--ease, ease), transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .22s;
}
.e-bereiche.ist-geaendert > .e-fuss, .e-fuss:has(.e-status:not(:empty)) {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .18s var(--ease, ease), transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
.e-fuss .k-knopf { min-width: 120px; }
/* Einblenden der Seite (bewegung.css) setzte sonst ein eigenes transform auf die Leiste */
.einblenden-folge > .e-fuss { animation: none; }
.e-status, .e-fuss-hinweis { margin-right: auto; min-width: 0; color: var(--text-3); font-size: 14px; }
.e-status:empty { display: none; }
/* Kurzer Hinweis links, solange nichts anderes im Status steht */
.e-fuss-hinweis { display: none; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.e-fuss-hinweis::before, .e-reiter-knopf[data-geaendert]::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warning-text);
}
.e-bereiche.ist-geaendert > .e-fuss .e-status:empty + .e-fuss-hinweis { display: inline-flex; }
/* Reiter mit ungespeicherten Änderungen bekommen denselben Punkt, absolut gesetzt: die Reiter springen nicht */
.e-reiter-knopf[data-geaendert]::before { position: absolute; top: 9px; right: 3px; width: 6px; height: 6px; }

/* Logo: Upload-Zone in logo-feld.css */

/* Farbe und Tabellenkopf */
.e-gruppe-feld { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.e-farben { display: flex; flex-wrap: wrap; gap: 10px; }
.e-farbe {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--surface); cursor: pointer;
  background: var(--farbe); box-shadow: 0 0 0 1px var(--border-strong);
}
.e-farbe[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--farbe); }
.e-farbe:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.e-wahl { display: flex; gap: 20px; flex-wrap: wrap; }
.e-wahl-punkt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: var(--text); cursor: pointer; }
.e-wahl-punkt input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
#nummer-beispiel { margin: 0; }
@media (max-width: 600px) { .e-formular, .e-fuss { --karte-innen: 20px; } .e-formular { gap: 0; } }
@media (max-width: 360px) { .e-formular, .e-fuss { --karte-innen: 14px; } }
/* Handy und Tablet: Leiste fest über der Tab-Leiste, volle Bildschirmbreite, zwei gleich breite Knöpfe.
   Sie liegt immer außerhalb des Flusses und wird nur per transform eingeblendet: kein Layout-Sprung.
   Unten ist dauerhaft Platz reserviert, damit am Seitenende nichts verdeckt bleibt. */
@media (max-width: 899.98px) {
  .e-bereiche:has(> .e-fuss) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .e-fuss {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; margin: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px;
    padding: 10px var(--rand, 16px) calc(10px + env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid var(--border); border-radius: 0;
    box-shadow: 0 -6px 16px -8px rgb(16 24 40 / .16);
    opacity: 1; transform: translateY(calc(100% + 16px)); visibility: hidden;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .22s;
  }
  /* Mit Tab-Leiste: direkt darüber, gleitet unter ihr hervor (z-index knapp unter navigation.css) */
  .k-seite--nav .e-fuss {
    bottom: calc(var(--k-tab-hoehe, 60px) + env(safe-area-inset-bottom)); padding-bottom: 10px; z-index: 49;
  }
  .e-bereiche.ist-geaendert > .e-fuss, .e-fuss:has(.e-status:not(:empty)) {
    transform: none; visibility: visible; transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s;
  }
  .e-fuss .k-knopf { min-width: 0; width: 100%; min-height: 44px; }
  /* Beim Ausblenden behält Verwerfen seinen Platz, sonst springt Speichern auf volle Breite */
  .e-fuss [data-verwerfen][hidden] { display: inline-flex; }
  /* Nach dem Speichern zeigt die Leiste kurz nur den Status */
  .e-bereiche:not(.ist-geaendert) > .e-fuss:has(.e-status:not(:empty)) .k-knopf { display: none; }
  .e-status, .e-fuss-hinweis { grid-column: 1 / -1; margin: 0; font-size: 13px; }
  .e-bereiche.ist-geaendert > .e-fuss .e-status:empty + .e-fuss-hinweis { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .e-fuss, .e-bereiche.ist-geaendert > .e-fuss, .e-fuss:has(.e-status:not(:empty)) { transition: none; }
}

/* Reiter Erinnerungen */
.e-zahl { max-width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.e-eigen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.e-eigen[hidden] { display: none; }
.e-eigen .e-zahl { max-width: none; }
.e-mehr { display: flex; flex-direction: column; gap: 16px; }
.e-mehr > summary {
  display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--primary); font-weight: 600; font-size: 15px;
  list-style: none;
}
.e-mehr > summary::-webkit-details-marker { display: none; }
.e-mehr > summary::after { content: ""; width: 8px; height: 8px; margin-left: 10px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -2px; transition: rotate .2s; }
.e-mehr[open] > summary::after { rotate: -135deg; translate: 0 2px; }
.e-mehr[open] { gap: 16px; }
.e-mehr[open] > :not(summary) { margin-top: 12px; }
.e-stufen .e-zahl { width: 84px; }
.e-haken { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Kontodaten (Reiter Konto, E-Mail und Passwort ändern) ----------
   Karte „Persönliche Daten“ wie Untitled UI „Settings / My details“: Name links, Wert oder Knopf rechts.
   Dazu die Ganzseiten konto/email-aendern.html, passwort-aendern.html und email-bestaetigen.html. */
.ek-kopf { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 14px; border-bottom: 1px solid var(--border); }
.ek-zeile > div:first-child { min-width: 0; }
.ek-wert { color: var(--text); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.ek-punkte { letter-spacing: .12em; color: var(--text-3); }
.ek-voll { grid-column: 1 / -1; margin: -4px 0 0; }
.ek-voll:empty { display: none; }
.ek-name .k-eingabe { width: min(260px, 100%); }
.ek-auswahl { width: auto; min-width: 160px; }
.ek-ausstehend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0 0;
  color: var(--text-2); font-size: 14px; line-height: 1.45;
}
.ek-ausstehend[hidden] { display: none; }
.ek-ausstehend-ikon { width: 16px; height: 16px; flex: none; color: var(--warning-text); }
.ek-textknopf {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; margin: 0 -4px;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--primary); font-weight: 600; font-size: 14px;
}
.ek-textknopf:hover { text-decoration: underline; }
.ek-textknopf:focus-visible { outline: none; box-shadow: var(--ring); }
.ek-textknopf:disabled { opacity: .6; cursor: default; }
@media (max-width: 480px) {
  .ek-name { flex-wrap: wrap; }
  .ek-name .k-eingabe { flex: 1; width: auto; min-width: 0; }
  .ek-auswahl { width: 100%; }
}

/* Ganzseiten: Zurück-Pfeil links neben dem Titel (wie DATEV-Daten), ein schmales Formular darunter */
.ek-haupt { max-width: calc(520px + 2 * var(--rand)); }
.ek-seite { display: flex; flex-direction: column; gap: 16px; }
.ek-seite[hidden] { display: none; }
.ek-seitenkopf { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ek-zurueck {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: -10px;
  border-radius: 99px; color: var(--text-2); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.ek-zurueck:hover { background: var(--surface-2); color: var(--text); }
.ek-zurueck:focus-visible { outline: none; box-shadow: var(--ring); }
.ek-zurueck .k-ikon, .ek-zurueck .k-ikon-platz { width: 22px; height: 22px; }
.ek-seitenkopf-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 7px; }
.ek-seitenkopf-text .k-titel, .ek-seitenkopf-text .k-unter { margin: 0; }
.ek-karte { display: flex; flex-direction: column; gap: 16px; }
.ek-karte .k-feld-hinweis:empty { display: none; }
.ek-aktuell { margin: 0; color: var(--text-3); font-size: 14px; }
.ek-aktuell strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.ek-leiste { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.ek-leiste .k-knopf { min-width: 140px; }
@media (max-width: 480px) {
  .ek-leiste { flex-direction: column-reverse; }
  .ek-leiste .k-knopf { width: 100%; min-height: 44px; }
}
/* Ende Kontodaten */

/* Sprachwahl mit Flaggen: drei Auswahlknöpfe nebeneinander (Segment), am Handy volle Breite */
.ek-sprache-aktion { flex-wrap: wrap; justify-content: flex-end; }
.ek-sprachen {
  display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface-2);
}
.ek-sprache {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.ek-sprache input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ek-sprache img { display: block; width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / .08); }
.ek-sprache:hover { color: var(--text); }
.ek-sprache:has(input:checked) { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.ek-sprache:has(input:focus-visible) { box-shadow: var(--ring); }
.ek-sprache:has(input:disabled) { cursor: default; opacity: .7; }
@media (max-width: 480px) {
  .ek-sprache-aktion { justify-content: stretch; }
  .ek-sprachen { display: flex; width: 100%; }
  .ek-sprache { flex: 1; justify-content: center; padding: 0 8px; }
}

/* Deine Firmen: Liste im Qonto-Muster (Symbol, Name mit Rolle, Aktionen rechts) */
.ef-karte[hidden] { display: none; }
.ef-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ef-neu { flex: none; }
.ef-liste { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.ef-zeile {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0;
  border-top: 1px solid var(--border);
}
.ef-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ef-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-unter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.ef-chip {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 99px;
  background: var(--success-soft); color: var(--success-text); font-size: 12px; font-weight: 600;
}
.ef-aktionen { display: flex; align-items: center; gap: 4px; flex: none; }
.ef-loeschen {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-3); cursor: pointer;
}
.ef-loeschen:hover { background: var(--error-soft); color: var(--error-text); }
.ef-loeschen:focus-visible { outline: none; box-shadow: var(--ring); }
.ef-loeschen .k-ikon, .ef-loeschen .k-ikon-platz { width: 20px; height: 20px; }
@media (max-width: 480px) {
  /* Eine Zeile bleibt eine Zeile: Symbol klein, Name kürzt, Aktionen rechts */
  .ef-zeile { gap: 10px; }
  .ef-zeile > .k-featured { --kf-groesse: 32px; --kf-ikon: 16px; --kf-ring: 4px; }
  .ef-aktionen .k-knopf { padding-inline: 12px; }
}

/* Code aus der E-Mail beim Konto löschen: große, gut lesbare Ziffern */
.e-code { font-size: 20px; letter-spacing: .3em; font-variant-numeric: tabular-nums; max-width: 12ch; }
