/* Kontowechsler (kontowechsler.js) und Kontoauswahl für Dienste (/oidc/konto). Nur Klassen kw-*, nur bestehende Tokens. */

/* ---------- Konto-Menü unten in der Leiste ---------- */
.kw-wurzel { position: relative; }
.kw-ausloeser { cursor: pointer; border-radius: var(--r-m); padding: var(--a-1); margin: calc(-1 * var(--a-1)); transition: background var(--dauer-1) var(--kurve-aus); }
.kw-ausloeser:hover, .kw-ausloeser[aria-expanded=true] { background: var(--hover); }
.kw-ausloeser:focus-visible { outline: none; box-shadow: var(--fokus-ring); }
.kw-ausloeser > div { flex: 1; }
.kw-pfeil { flex: none; color: var(--leise); font-size: var(--t-s); line-height: 1; transition: transform var(--dauer-2) var(--kurve-aus); }
.kw-ausloeser[aria-expanded=false] .kw-pfeil { transform: rotate(180deg); }

.kw-menue { position: absolute; left: 0; right: 0; bottom: calc(100% + var(--a-2)); z-index: 30; display: flex; flex-direction: column; gap: 2px;
  padding: var(--a-2); background: var(--flaeche-hoch); border: 1px solid var(--linie-stark); border-radius: var(--r); box-shadow: var(--schatten-3);
  max-height: min(70vh, 460px); overflow-y: auto; min-width: 220px; }
.kw-menue[hidden] { display: none; }
.kw-titel { font-size: var(--t-xs); padding: var(--a-1) var(--a-2); }
.kw-laedt { padding: var(--a-2); font-size: var(--t-s); }
.kw-trenner { height: 1px; background: var(--linie); margin: var(--a-1) 0; }

.kw-konto, .kw-punkt { display: flex; align-items: center; gap: var(--a-2); width: 100%; text-align: left; font: inherit; color: var(--text);
  background: transparent; border: 0; border-radius: var(--r-s); padding: var(--a-2); cursor: pointer; min-height: 40px; }
.kw-konto:hover, .kw-punkt:hover, .kw-konto:focus-visible, .kw-punkt:focus-visible { background: var(--hover-stark); outline: none; }
.kw-konto:focus-visible, .kw-punkt:focus-visible { box-shadow: var(--fokus-ring); }
.kw-konto[aria-checked=true] { background: var(--akzent-flaeche); }
.kw-konto:disabled { opacity: .6; cursor: progress; }
.kw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kw-text b, .kw-text .leise { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-text .leise { font-size: var(--t-xs); }
.kw-haken { flex: none; width: 1.2em; text-align: center; color: var(--akzent); font-weight: 650; }
.kw-punkt { color: var(--text-2); font-size: var(--t-s); min-height: 34px; }
.kw-punkt svg { width: 16px; height: 16px; flex: none; }
.kw-punkt.kw-alle { color: var(--fehl-text); }
.kw-avatar { width: 28px; height: 28px; font-size: var(--t-s); }

/* ---------- Anmeldeseite: weiteres Konto / erwartetes Konto, Passkey-Feld (Conditional UI) ---------- */
.kw-hinweis { display: flex; align-items: center; justify-content: space-between; gap: var(--a-3); margin-bottom: var(--a-3); }
.kw-abbrechen { flex: none; }
.kw-feld { display: block; width: 100%; margin-bottom: var(--a-3); }

/* ---------- Kontoauswahl für Dienste (/oidc/konto, ohne Skript) ---------- */
.kw-auswahl .kw-liste { display: flex; flex-direction: column; gap: var(--a-2); margin: var(--a-4) 0; }
.kw-auswahl .kw-konto { border: 1px solid var(--linie-stark); background: var(--feld); padding: var(--a-3); }
.kw-auswahl .kw-konto:hover { border-color: var(--akzent-rand); background: var(--akzent-flaeche); }
.kw-auswahl .kw-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; font-weight: 650;
  color: var(--akzent-text); background: var(--akzent-flaeche-stark); box-shadow: inset 0 0 0 1px var(--akzent-rand); }
.kw-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--a-1) var(--a-4); font-size: var(--t-s); color: var(--leise); margin-bottom: 0; }
/* Kopf der Kontowahl: Logo und Marke wie auf der Anmeldeseite (Klassen anmelde-* aus stil.css), klein über der Überschrift. */
.kw-marke { display: flex; align-items: center; gap: var(--a-2); margin-bottom: var(--a-4); font-weight: 650; }
.kw-marke .anmelde-logo { width: 36px; height: 36px; border-radius: var(--r-m); }
.karte .kw-marke .anmelde-logo img { width: 24px; height: 24px; }
.kw-auswahl h1 { font-size: var(--t-xl); }

/* Handy (≤ 560): Links als Tipp-Ziele (--touch-min hoch, Abstand nach außen ausgeglichen – das Bild bleibt gleich), Hinweis umbrechend. */
@media (max-width: 560px) {
  .kw-hinweis { flex-wrap: wrap; row-gap: 0; }
  :is(.kw-abbrechen, .kw-fuss a) { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 var(--a-2); margin: calc(-1 * var(--a-3)) calc(-1 * var(--a-2)); }
  .kw-fuss { row-gap: 0; padding-top: var(--a-1); }
  .kw-auswahl .kw-liste { margin: var(--a-3) 0 var(--a-4); }
}

@media (prefers-reduced-motion: reduce) { .kw-ausloeser, .kw-pfeil { transition: none; } }
