/* ══════════════════════════════════════════════════════════════════
   App-Shell — Layout und Komponenten (FE-1a)
   Werte ausschliesslich ueber tokens.css. Formen nach Alt app.css
   (Anker je Block). Ein Umschaltpunkt: 900px.
   ══════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--surface);
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.versteckt { display: none !important; }
[hidden] { display: none !important; }
.nur-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
/* Bis die Shell steht, keine halbfertige Oberflaeche zeigen. */
html.laedt .sidebar, html.laedt .topbar-knoepfe { visibility: hidden; }

.app { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* ─── Topbar (Alt app.css:153-257) ─────────────────────────────── */
.topbar {
  position: relative; z-index: 40;
  flex: 0 0 var(--topbar-h); height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: var(--flaeche);
  border-bottom: var(--topbar-rule);
}
.logo {
  flex: 0 0 auto;
  width: max(var(--logo-w), calc(var(--sb-w) - 76px));   /* Alt app.css:173: Abzug beruecksichtigt den Leisten-Schalter */
  height: var(--logo-h);
  background-image: var(--logo);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
}
.brotkrumen {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  color: var(--muted); font-size: var(--fs-krume); font-weight: var(--fw-mittel); white-space: nowrap;
}
.brotkrumen > * { flex: 0 0 auto; }
.brotkrumen .trenner { opacity: .5; }
.brotkrumen .krume-ikon { width: 15px; height: 15px; color: var(--text); }
.brotkrumen .aktuell {
  flex: 0 1 auto; min-width: 0; color: var(--text);
  font-size: var(--fs-titel); font-weight: var(--fw-halbfett);
  overflow: hidden; text-overflow: ellipsis;
}
.topbar-fueller { flex: 1 1 auto; }
.topbar-knoepfe { display: flex; align-items: center; gap: 2px; }
.icon-knopf {
  position: relative; width: var(--knopf-h); height: var(--knopf-h); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.icon-knopf:hover { background: var(--hover); }
.avatar {
  width: var(--avatar); height: var(--avatar); margin-left: 6px; border-radius: 50%;
  background: var(--pri); color: #fff; font-size: var(--fs-klein); font-weight: var(--fw-halbfett);
  display: flex; align-items: center; justify-content: center;
}
.mobil-titel { display: none; }

/* ─── Mandanten-Umschalter "Arbeiten als" (KARTE-1 K-10, V-6) ───── */
.mandant-umschalter {
  display: flex; align-items: center; gap: 6px; margin-right: 6px; min-width: 0;
  color: var(--muted); font-size: var(--fs-klein); white-space: nowrap;
}
.mandant-wahl {
  max-width: 220px; height: calc(var(--knopf-h) - 6px); padding: 0 6px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--flaeche); color: var(--text); font: inherit; font-size: var(--fs-zeile);
  text-overflow: ellipsis;
}
.mandant-wahl:focus-visible { outline: 2px solid var(--pri); outline-offset: 1px; }

/* ─── Nutzermenue (Alt app.css:289-357) ────────────────────────── */
.usermenue {
  position: absolute; top: calc(var(--topbar-h) + 6px); right: 12px;
  width: var(--usermenue-w); max-width: calc(100vw - 24px);
  background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--schatten-menue); padding: 6px; z-index: 60;
}
.usermenue-kopf { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenue-name { font-size: var(--fs-titel); font-weight: var(--fw-halbfett); overflow-wrap: anywhere; }
.usermenue-zeile { font-size: var(--fs-klein); color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.usermenue-punkt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border-radius: var(--r-sm); font-size: var(--fs-zeile); font-weight: var(--fw-mittel); text-align: left;
}
.usermenue-punkt:hover { background: var(--surface); }
.usermenue-punkt.gefahr { color: var(--err); }
.usermenue-punkt svg { width: 16px; height: 16px; }
.usermenue-block { margin: 6px 0; padding: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.usermenue-titel {
  font-size: var(--fs-label); font-weight: var(--fw-halbfett); letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.themewahl { display: flex; gap: 6px; }
.themeknopf {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; border-radius: var(--r-sm); font-size: var(--fs-krume); font-weight: var(--fw-halbfett);
  border: 1px solid var(--line); background: var(--flaeche); color: var(--text-2);
}
.themeknopf[aria-pressed="true"] { border-color: var(--pri); background: var(--pri-soft); color: var(--pri); }
.themepunkt { width: 10px; height: 10px; border-radius: 50%; }
.themepunkt.marine { background: var(--themepunkt-marine); }
.themepunkt.rot { background: var(--themepunkt-rot); }

/* ─── Mitte / Sidebar (Alt app.css:360-520) ────────────────────── */
.mitte { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.sidebar {
  position: relative; flex: 0 0 var(--sb-w); width: var(--sb-w);
  background: var(--flaeche); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar-inhalt {
  flex: 1 1 auto; overflow-y: auto; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-trenner { height: 1px; background: var(--line); margin: 10px 6px; flex: 0 0 auto; }
.sidebar-leer { padding: 10px; color: var(--muted); font-size: var(--fs-zeile); }
.bereichsliste { display: flex; flex-direction: column; gap: 2px; }
.bereich { display: flex; flex-direction: column; gap: 2px; }
.modulliste { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; }
.zeile {
  display: flex; align-items: center; gap: 10px; width: 100%; height: var(--row-h);
  padding: 0 10px; border-radius: var(--r-sm);
  font-size: var(--fs-zeile); font-weight: var(--fw-mittel); color: var(--text-2); text-align: left;
}
.zeile:hover { background: var(--hover); }
.zeile.aktiv { color: var(--pri); font-weight: var(--fw-halbfett); background: var(--pri-soft); }
.zeile .beschriftung { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .chevron { display: inline-flex; opacity: .55; }
.zeile[aria-expanded="true"] .chevron { opacity: .9; }
.zeile .icon, .modulzeile .icon { display: inline-flex; flex: 0 0 auto; }
.zeile svg, .modulzeile svg { width: 18px; height: 18px; }
.zeile .chevron svg { width: 16px; height: 16px; }
.modulzeile {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px;
  margin-left: 2px; padding: 5px 10px 5px 6px; border-radius: var(--r-sm);
  font-size: var(--fs-krume); line-height: 1.3; font-weight: var(--fw-normal); color: var(--text-2);
}
.modulzeile:hover { background: var(--hover); }
.modulzeile.aktiv { color: var(--pri); font-weight: var(--fw-halbfett); background: var(--pri-soft); }
.modulzeile .marke { flex: 0 0 auto; width: 3px; align-self: stretch; border-radius: 2px; background: transparent; }
.modulzeile.aktiv .marke { background: var(--pri); }
.modulzeile svg { width: 16px; height: 16px; }
.modulzeile .beschriftung { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-fuss {
  flex: 0 0 auto; border-top: 1px solid var(--line); padding: 8px 12px; min-height: 40px;
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-klein);
}

/* Schleier fuer den Drawer (Alt app.css:965-971) */
.schleier { display: none; position: absolute; inset: 0; background: var(--schleier); z-index: 45; }
.schleier.dunkel { background: var(--schleier-dunkel); }

/* ─── Arbeitsbereich (Alt app.css:545-715) ─────────────────────── */
.arbeitsbereich { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.arbeitsbereich:focus { outline: none; }
.blatt, .modulflaeche { flex: 1 1 auto; overflow-y: auto; padding: var(--pad); }
.h-start { font-size: var(--fs-h-start); font-weight: var(--fw-halbfett); letter-spacing: -.01em; }
.h-bereich { font-size: var(--fs-h-bereich); font-weight: var(--fw-halbfett); }
.nutzzeile, .unterzeile { margin-top: 6px; font-size: var(--fs-zeile); color: var(--muted); font-weight: var(--fw-mittel); }
.start-abschnitt {
  margin-top: 26px; font-size: var(--fs-label); font-weight: var(--fw-halbfett);
  letter-spacing: var(--label-spacing); text-transform: uppercase; color: var(--muted);
}
.kachel-raster {
  margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-tile);
}
.karten-raster {
  margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-card);
}
.modulkachel {
  display: block; width: 100%; text-align: left; background: var(--flaeche);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px;
}
.modulkachel:hover { border-color: var(--pri); }
.modulkachel .kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modulkachel .symbol {
  width: 34px; height: 34px; border-radius: 8px; background: var(--pri-soft); color: var(--pri);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.modulkachel .symbol svg { width: 18px; height: 18px; }
.modulkachel .name { margin-top: 13px; font-size: var(--fs-titel); font-weight: var(--fw-halbfett); }
.modulkachel .text { margin-top: 4px; font-size: var(--fs-krume); color: var(--muted); line-height: 1.5; }

.karte { background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.karte-titel { display: flex; align-items: center; gap: 9px; font-size: var(--fs-titel); font-weight: var(--fw-halbfett); }
.karte-titel svg { width: 18px; height: 18px; color: var(--pri); }

/* Knoepfe (Alt app.css:715-743) */
.knopf {
  height: var(--knopf-h); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 13px; border-radius: var(--r-sm); font-size: var(--fs-zeile); font-weight: var(--fw-mittel);
  white-space: nowrap; border: 1px solid var(--line); background: var(--flaeche); color: var(--text);
}
.knopf:hover { background: var(--surface); }
.knopf.primaer { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: var(--fw-halbfett); }
.knopf.primaer:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
.knopf.gefahr { border-color: rgba(220, 53, 69, .35); background: rgba(220, 53, 69, .05); color: var(--err); font-weight: var(--fw-halbfett); }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.knopf svg { width: 16px; height: 16px; }

/* Chips (Alt app.css:745-756) */
.chip { font-size: var(--fs-label); font-weight: var(--fw-halbfett); padding: 3px 9px; border-radius: var(--r-chip); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.pri { background: var(--pri-soft); color: var(--pri); }
.chip.neutral { background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.err { background: var(--err-soft); color: var(--err); }
.hinweis { color: var(--muted); font-size: var(--fs-zeile); line-height: 1.55; }

/* ─── ui/leerzustand.js ────────────────────────────────────────── */
.leerzustand {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 48px 16px; color: var(--muted);
}
.leerzustand-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--pri-soft); color: var(--pri);
  display: inline-flex; align-items: center; justify-content: center;
}
.leerzustand-icon svg { width: 24px; height: 24px; }
.leerzustand-titel { margin-top: 6px; font-size: var(--fs-titel); font-weight: var(--fw-halbfett); color: var(--text); }
.leerzustand-text { max-width: 420px; font-size: var(--fs-zeile); line-height: 1.55; }
.leerzustand-aktion { margin-top: 10px; }

/* ─── ui/tabelle.js ────────────────────────────────────────────── */
.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--r-md); }
.tabelle { width: 100%; border-collapse: collapse; font-size: var(--fs-zeile); }
.tabelle th {
  text-align: left; font-size: var(--fs-label); font-weight: var(--fw-halbfett); letter-spacing: var(--label-spacing);
  text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.tabelle td { padding: 9px 12px; border-top: 1px solid var(--line); }
.tabelle tbody tr:first-child td { border-top: 0; }
.tabelle .rechts { text-align: right; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover { background: var(--hover); }

/* ─── ui/formular.js ───────────────────────────────────────────── */
.formular { display: flex; flex-direction: column; gap: 14px; }
.feld { display: flex; flex-direction: column; gap: 5px; }
.feld label { font-size: var(--fs-zeile); font-weight: var(--fw-mittel); color: var(--text-2); }
.feld input, .feld select {
  height: 38px; padding: 0 10px; font: inherit; font-size: var(--fs-body); color: var(--text);
  background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.feld input:focus, .feld select:focus { outline: 2px solid var(--pri-soft); border-color: var(--pri); }
.feld input[aria-invalid="true"] { border-color: var(--err); }
.feld-hinweis { font-size: var(--fs-klein); color: var(--muted); }
.feld-fehler { font-size: var(--fs-klein); color: var(--err); font-weight: var(--fw-mittel); }
.formular-meldung {
  padding: 10px 12px; border-radius: var(--r-sm); background: var(--err-soft); color: var(--err);
  font-size: var(--fs-zeile); font-weight: var(--fw-mittel); line-height: 1.45;
}
.formular-meldung.ok { background: var(--ok-soft); color: var(--ok); }
.formular-fuss { display: flex; gap: 8px; }
.formular-fuss .knopf { height: 38px; }

/* ─── ui/modal.js (Alt app.css:1055-1120) ──────────────────────── */
.dialogschleier {
  position: fixed; inset: 0; background: var(--schleier-dialog); z-index: 80;
  display: flex; justify-content: center; padding-top: 12vh;
}
.dialog {
  width: 460px; max-width: calc(100% - 32px); height: max-content; max-height: 70vh;
  background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--schatten-dialog); display: flex; flex-direction: column; overflow: hidden;
}
.dialog-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); font-size: var(--fs-titel); font-weight: var(--fw-halbfett);
}
.dialog-kopf .icon-knopf { width: 28px; height: 28px; }
.dialog-koerper { padding: 16px; overflow: auto; }
.dialog-text { margin: 0; font-size: var(--fs-zeile); color: var(--text-2); line-height: 1.55; }
.dialog-fuss {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.dialog-fueller { flex: 1; }

/* ─── ui/hilfereiter.js (FE-09, FE-2 TW-1a E3) ─────────────────── */
.hilfereiter { display: flex; flex-direction: column; gap: 12px; max-width: 960px; }
.hilfereiter-titel { margin: 0; font-size: var(--fs-titel); font-weight: var(--fw-halbfett); color: var(--text); }
.hilfereiter-meldung { color: var(--muted); font-size: var(--fs-zeile); line-height: 1.55; }
.hilfereiter[data-zustand="fehler"] .hilfereiter-meldung,
.hilfereiter[data-grund="fehler"] .hilfereiter-meldung { color: var(--err); }
.hilfereiter-artikelliste { display: flex; flex-direction: column; gap: 10px; }
.hilfereiter-artikel {
  background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 var(--gap-card);
}
.hilfereiter-artikeltitel {
  cursor: pointer; padding: 12px 0; font-size: var(--fs-titel); font-weight: var(--fw-halbfett); color: var(--pri);
}
.hilfereiter-artikel[open] .hilfereiter-artikeltitel { border-bottom: 1px solid var(--line); }
.hilfereiter-kurz { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-zeile); line-height: 1.55; }
.hilfereiter-inhalt { padding: 4px 0 var(--gap-card); font-size: var(--fs-zeile); line-height: 1.6; color: var(--text-2); overflow-x: auto; }
.hilfereiter-inhalt h4, .hilfereiter-inhalt h5, .hilfereiter-inhalt h6 {
  margin: 16px 0 6px; font-size: var(--fs-titel); font-weight: var(--fw-halbfett); color: var(--text);
}
.hilfereiter-inhalt code { padding: 1px 5px; border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-klein); }
.hilfereiter-inhalt pre { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); overflow-x: auto; }
.hilfereiter-inhalt pre code { padding: 0; background: none; }
.hilfereiter-inhalt table { border-collapse: collapse; margin: 8px 0; }
.hilfereiter-inhalt th, .hilfereiter-inhalt td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.hilfereiter-inhalt th { background: var(--surface); font-weight: var(--fw-halbfett); }
.hilfereiter-inhalt a { color: var(--pri); }

/* ─── Startseite (shell/start.js; Alt app.css:560-670) ────────── */
.startblatt-laedt { flex: 1 1 auto; overflow-y: auto; padding: var(--pad); }
.nutzzeile.schmal { max-width: 560px; }
.karte-titel .icon { display: inline-flex; color: var(--pri); }
.karte-titel.mit-abstand { margin-bottom: 14px; }
.karte-link { font-size: var(--fs-klein); font-weight: var(--fw-halbfett); color: var(--pri); }
.karte-zeile { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.karte-zeile .name {
  flex: 1; font-size: var(--fs-zeile); font-weight: var(--fw-mittel);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.punkt { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.punkt.err { background: var(--err); }
.punkt.warn { background: var(--warn); }
.punkt.neutral { background: var(--line); }
.faellig { font-size: var(--fs-label); font-weight: var(--fw-halbfett); }
.faellig.err { color: var(--err); }
.faellig.warn { color: var(--warn-text); }
.faellig.neutral { color: var(--muted); font-weight: var(--fw-mittel); }
.grosszahl { display: flex; align-items: baseline; gap: 8px; }
.grosszahl b { font-size: var(--fs-grosszahl); font-weight: var(--fw-halbfett); line-height: 1; }
.grosszahl span { font-size: var(--fs-klein); color: var(--muted); font-weight: var(--fw-mittel); }
.liste-eng { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.liste-eng.ohne-abstand { margin-top: 0; }
.liste-eng > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-zeile); }
.liste-eng .name { font-weight: var(--fw-mittel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karte.klickbar { cursor: pointer; }
.karte.klickbar:hover { border-color: var(--pri); }
.einstiegskarte { display: block; text-align: left; width: 100%; }
.einstiegskarte:hover { border-color: var(--pri); }
.einstieg-icon {
  width: 38px; height: 38px; border-radius: 9px; background: var(--pri-soft); color: var(--pri);
  display: inline-flex; align-items: center; justify-content: center;
}
.einstieg-name { margin-top: 14px; font-size: var(--fs-einstieg); font-weight: var(--fw-halbfett); }
.einstieg-text { margin-top: 5px; font-size: var(--fs-zeile); color: var(--muted); line-height: 1.5; }
.einstieg-cta {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-zeile); font-weight: var(--fw-halbfett); color: var(--pri);
}

/* Topbar-Knoepfe Hilfe/Panel/Glocke (Alt app.css:239-266) */
.icon-knopf[aria-pressed="true"] { background: var(--pri-soft); color: var(--pri); }
.zaehler-punkt {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; background: var(--err); color: #fff;
  font-size: var(--fs-zaehler); font-weight: var(--fw-halbfett); line-height: 15px; text-align: center;
}

/* Favoriten und Stern in der Sidebar (Alt app.css:394-401, :487-497) */
.sidebar-titel {
  font-size: var(--fs-label); font-weight: var(--fw-halbfett); letter-spacing: var(--label-spacing);
  text-transform: uppercase; color: var(--muted); padding: 6px 10px;
}
.favzeile .icon { color: var(--acc); }
.modulzeile .stern { flex: 0 0 auto; display: inline-flex; color: var(--muted); opacity: 0; border-radius: var(--r-sm); }
.modulzeile:hover .stern, .modulzeile .stern:focus-visible, .modulzeile .stern.gesetzt { opacity: 1; }
.modulzeile .stern.gesetzt { color: var(--acc); }

/* ─── Kontextpanel (shell/kontextpanel.js; Alt app.css:761-890) ── */
.panel {
  flex: 0 0 var(--panel-w); width: var(--panel-w); background: var(--flaeche);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.panel-schleier { display: none; }
.panel-tabs { flex: 0 0 auto; display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.panel-tab {
  padding: 8px 14px 9px; font-size: var(--fs-zeile); font-weight: var(--fw-mittel); color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.panel-tab[aria-selected="true"] { font-weight: var(--fw-halbfett); color: var(--pri); border-bottom-color: var(--pri); }
.panel-koerper { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.panel-blatt { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px; }
.panel-hilfe .hilfereiter-artikel { padding: 0 12px; }
.panel-h { font-size: var(--fs-titel); font-weight: var(--fw-halbfett); }
.panel-unter { margin-top: 2px; font-size: var(--fs-klein); color: var(--muted); font-weight: var(--fw-mittel); }
.panel-abschnitt {
  margin-top: 20px; font-size: var(--fs-label); font-weight: var(--fw-halbfett);
  letter-spacing: var(--label-spacing); text-transform: uppercase; color: var(--muted);
}
.abstand-oben { margin-top: 9px; }
.datenliste {
  margin-top: 12px; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.datenliste > div {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: var(--fs-krume);
}
.datenliste > div + div { border-top: 1px solid var(--line); }
.datenliste .bezeichnung { color: var(--muted); }
.datenliste .wert { font-weight: var(--fw-mittel); text-align: right; }
.portalliste { margin-top: 9px; display: flex; flex-direction: column; gap: 8px; }
.portalzeile {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px;
}
.portalzeile .name { font-size: var(--fs-zeile); font-weight: var(--fw-mittel); }
.portalzeile .chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.knopfpaar { margin-top: 9px; display: flex; gap: 8px; }
.knopfpaar .knopf { flex: 1; justify-content: center; }
.gefahrblock { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.gefahrblock .hinweis { font-size: var(--fs-mini); margin-bottom: 9px; }
.gefahrblock .knopf { width: 100%; justify-content: center; }

/* ─── ui/toast.js (Alt app.css:1185-1199) ──────────────────────── */
.meldung {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  max-width: min(480px, calc(100vw - 32px)); padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--dunkel); color: #fff; font-size: var(--fs-zeile); box-shadow: var(--schatten-meldung);
}
.meldung.fehler { background: var(--err); }

/* ─── Seitenleiste einklappen (Alt APP-2c, app.css:216/378-402/447-449/510-545; cutover-nachlauf-2) ── */
.sidebar-schalter { flex: 0 0 auto; }
.sidebar-schalter svg { width: 20px; height: 20px; }
.klappknopf {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.klappknopf:hover { background: var(--hover); }
.klappknopf svg { width: 16px; height: 16px; }
@media (min-width: 901px) {
  .app[data-sidebar="schmal"] .sidebar { flex-basis: var(--sb-w-schmal); width: var(--sb-w-schmal); }
  .app[data-sidebar="schmal"] .logo { width: var(--logo-w); }
  .app[data-sidebar="schmal"] .sidebar-titel,
  .app[data-sidebar="schmal"] .sidebar-fuss-text,
  .app[data-sidebar="schmal"] .zeile .beschriftung,
  .app[data-sidebar="schmal"] .zeile .chevron,
  .app[data-sidebar="schmal"] .modulliste { display: none; }
  /* Nur Icons: die Liste passt ohne Scrollen; sichtbarer Ueberlauf, damit der Tooltip neben der Leiste steht. */
  .app[data-sidebar="schmal"] .sidebar { z-index: 30; }
  .app[data-sidebar="schmal"] .sidebar-inhalt { overflow: visible; }
  .app[data-sidebar="schmal"] .zeile { justify-content: center; padding: 0; position: relative; }
  .app[data-sidebar="schmal"] .sidebar-fuss { justify-content: center; padding: 8px 0; }
  /* Tooltip im schmalen Zustand (Alt app.css:523-545); Text aus data-tooltip, kein Inline-Stil. */
  .app[data-sidebar="schmal"] .zeile[data-tooltip]:hover::after,
  .app[data-sidebar="schmal"] .zeile[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: var(--dunkel); color: #fff; font-size: var(--fs-klein); font-weight: var(--fw-mittel);
    padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap; z-index: 70;
    box-shadow: var(--schatten-meldung); pointer-events: none;
  }
}

/* ─── Brotkrumen als Links (cutover-nachlauf-2 Aufgabe 8a) ── */
.brotkrumen .krume-link { color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.brotkrumen .krume-link:hover { color: var(--pri); text-decoration: underline; }
.brotkrumen .krume-link:focus-visible { outline: 2px solid var(--pri-soft); outline-offset: 2px; }
.brotkrumen a.aktuell { color: var(--text); }
.bereichsseite .kachel-raster { margin-top: 18px; }

/* ─── CRM-Ampel in der Kopfzeile (Alt js/crm-status.js STIL :30-37: nur ein Punkt 10px, Knopf ohne Rahmen) ── */
.crm-status {
  flex: 0 0 auto; display: inline-flex; align-items: center; padding: 4px; margin: 0 6px 0 0; line-height: 0;
  border: 0; background: none; border-radius: 999px; color: inherit;
}
.crm-status:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
.crm-punkt { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.crm-status[data-crm-status="verbunden"] .crm-punkt { background: var(--ok); }
.crm-status[data-crm-status="laeuft_ab"] .crm-punkt { background: var(--warn); }
.crm-status[data-crm-status="getrennt"] .crm-punkt { background: var(--err); }

/* CRM-Modal (Nachtrag 7b) */
.dialog.crm-dialog { width: 720px; }
.crm-modal { display: flex; flex-direction: column; gap: 12px; }
.crm-modal-hinweis { margin: 0; font-size: var(--fs-klein); color: var(--muted); }
.crm-modal-hinweis:empty { display: none; }
.crm-modal-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.crm-chip[data-crm-status="verbunden"] .crm-punkt { background: var(--ok); }
.crm-chip[data-crm-status="laeuft_ab"] .crm-punkt { background: var(--warn); }
.crm-chip[data-crm-status="getrennt"] .crm-punkt { background: var(--err); }

/* ─── Responsiv: ein Umschaltpunkt 900px (Alt app.css:1205-1222) ── */
@media (max-width: 900px) {
  .logo, .brotkrumen, .sidebar-schalter, .klappknopf { display: none; }
  .mobil-titel {
    display: block; flex: 1 1 auto; min-width: 0; font-size: var(--fs-titel); font-weight: var(--fw-halbfett);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-fueller { display: none; }
  .mandant-umschalter-text { display: none; }
  .mandant-wahl { max-width: 140px; }
  .kachel-raster, .karten-raster { grid-template-columns: 1fr; }
  .hilfereiter-artikel { padding: 0 12px; }
  .hilfereiter-inhalt th, .hilfereiter-inhalt td { padding: 5px 7px; }
  .sidebar {
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 50;
    width: var(--drawer-w); flex-basis: var(--drawer-w);
    box-shadow: var(--schatten-drawer);
    display: none;
  }
  .app[data-drawer="offen"] .sidebar { display: flex; }
  .app[data-drawer="offen"] .schleier { display: block; }
  /* Kontextpanel als Blatt von unten (Alt app.css:980-995 .panel.sheet) */
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 50;
    width: auto; height: var(--sheet-h); border-left: 0;
    border-top-left-radius: var(--r-sheet); border-top-right-radius: var(--r-sheet);
    box-shadow: var(--schatten-sheet); overflow: hidden;
  }
  .app[data-panel="offen"] .panel-schleier {
    display: block; position: absolute; inset: 0; background: var(--schleier); z-index: 45;
  }
}
@media (min-width: 901px) {
  .burger { display: none; }
}

/* ─── Leiste "Du siehst MIH als …" (cutover-nachlauf-3 AUFTRAG-ADMIN-ANSICHT-2FA, shell/ansicht.js) ─── */
.ansicht-leiste {
  flex: 0 0 auto; z-index: 45;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 14px;
  background: var(--warn); color: #1f1600; font-size: var(--fs-small, 14px);
}
.ansicht-leiste .ansicht-ende {
  padding: 2px 10px; border-radius: 6px; background: #1f1600; color: #fff; font-weight: 600;
}
.ansicht-leiste .ansicht-ende:disabled { opacity: .6; cursor: default; }
.ansicht-leiste .ansicht-rest { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ─── Zwei-Faktor-Bausteine (shell/zwei-faktor.js: Mein Konto + /app/totp/) ─── */
.zf-qr { display: inline-block; padding: 8px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--r-sm); }
.zf-qr .qr-code { display: block; width: 200px; height: 200px; }
.zf-codes {
  margin: 4px 0 10px; padding-left: 28px; columns: 2; column-gap: 28px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.8;
}
.zf-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.zf-status { color: var(--muted); font-size: var(--fs-klein); }
.zf-bestaetigung { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

/* AUFTRAG JV10 B: einmaliger Hinweis "Zum Home-Bildschirm" (iPhone/iPad in Safari) */
.ios-hinweis { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 900; display: flex; gap: 10px;
  align-items: center; padding: 12px 14px; background: var(--flaeche); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 6px 24px rgba(0, 0, 0, .12); font-size: var(--fs-zeile); }
.ios-hinweis span { flex: 1; }
