/* ══════════════════════════════════════════════════════════════════════════
   core/mobile.css — Mobile-Muster (< 768px)

   Additive Datei. Lädt NACH theme.css und VOR allen Modul-CSS. Sie definiert
   die Muster aus MOBILE-REDESIGN.md als Klassen, damit sie nicht in 16 Modulen
   erneut erfunden werden.

   Regeln für diese Datei:
   • Kein Hex-Wert. Farben, Radien, Abstände, Tap-Maße nur als Token.
   • Alles innerhalb @media (max-width: 767px). Der Desktop bleibt unberührt.
   • Klassen-Präfix `m-`. Modul-CSS überschreibt nichts davon, es benutzt es.
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── Typo eine Stufe größer ────────────────────────────────────────────
     13px ist eine Desktop-Dichte-Entscheidung; am Handy fehlt dadurch jede
     Hierarchie zwischen Titel, Abschnitt und Fliesstext. */
  body {
    --fs-page-title: 17px;
    --fs-body:       14px;
    --fs-label:      12px;
    line-height: var(--lh-body);
  }

  /* ══ KOPFZEILE ══════════════════════════════════════════════════════ */
  .m-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--topnav-h);
    padding: 0 var(--space-3);
    padding-top: var(--safe-t);
    background: var(--topnav-bg);
    color: #fff;
    flex-shrink: 0;
  }
  .m-head-title {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-page-title);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-head-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-head-btn.primaer { background: rgba(255,255,255,0.10); color: var(--accent); }
  .m-head-btn:active  { background: rgba(255,255,255,0.16); }

  /* Zweizeilig — Detail-Ansichten: Titel + Herkunft/Meta. */
  .m-head-sub { align-items: center; height: auto; padding: 9px var(--space-3); }
  .m-head-sub .m-head-title { font-size: 15px; }
  .m-head-meta {
    margin-top: 2px;
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 11.5px;
    color: rgba(255,255,255,0.62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ══ KONTEXT-STREIFEN ═══════════════════════════════════════════════
     Suche und Filter bleiben beim Scrollen stehen — sie sind der Zugang zur
     Liste, nicht ihr Vorwort. */
  .m-ctxbar {
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 9px;
  }
  .m-ctxbar-reihe { display: flex; gap: var(--space-2); }

  .m-search {
    flex: 1;
    min-width: 0;
    min-height: var(--tap);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
  }
  .m-search::placeholder { color: var(--text-muted); }

  .m-filterpill {
    flex-shrink: 0;
    min-height: var(--tap);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--accent-tint);
    color: var(--brand);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .m-filterpill-zahl {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--brand-surface);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
  }

  /* Horizontal scrollende Chips. Kein Wrap: zwei Zeilen Chips schieben die
     Liste unter die Falz. */
  .m-chiprow {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--space-3) * -1);
    padding: 0 var(--space-3);
  }
  .m-chiprow::-webkit-scrollbar { height: 0; }
  .m-chiprow > * { flex-shrink: 0; }

  .m-tab {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .m-tab.active {
    background: var(--brand-surface);
    border-color: var(--brand-surface);
    color: #fff;
  }

  /* ══ LISTE STATT TABELLE ════════════════════════════════════════════
     Die Tabelle bleibt im DOM (Desktop, Druck) und wird hier ausgeblendet.
     `.m-list` rendert dieselben Daten. */
  .m-tabelle-desktop { display: none; }

  .m-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }
  /* Nachschlage-Listen ohne Rahmen: der Karten-Look kostet 32px Breite und
     bringt bei einer reinen Namensliste nichts. */
  .m-list.flat {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .m-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 64px;
    padding: 12px 13px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
    text-align: left;
    width: 100%;
    border-left: 4px solid transparent;
    font-family: inherit;
    cursor: pointer;
  }
  .m-row:last-child { border-bottom: 0; }
  .m-row:active     { background: var(--surface-3); }

  .m-row-txt   { flex: 1; min-width: 0; }
  .m-row-titel {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-row-meta {
    margin-top: 3px;
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Rechte Zahlenspalte. Mono und rechtsbündig, damit Beträge untereinander
     vergleichbar bleiben — proportionale Ziffern sind es nicht. */
  .m-row-num {
    flex-shrink: 0;
    text-align: right;
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
  }
  .m-row-num small {
    display: block;
    margin-top: 2px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-muted);
  }
  .m-row-chevron { flex-shrink: 0; color: var(--border-strong); font-size: 17px; }

  /* Links-Rand statt Farbfläche: er markiert Portal oder Status ohne die
     Lesbarkeit des Textes anzutasten. */
  .m-row-lead-ok      { border-left-color: var(--success); }
  .m-row-lead-warn    { border-left-color: var(--warning); }
  .m-row-lead-bad     { border-left-color: var(--danger); }
  .m-row-lead-info    { border-left-color: var(--info-ink); }
  .m-row-lead-neutral { border-left-color: var(--text-muted); }

  /* Ungelesen: Rand UND Fläche. Fette Schrift allein trägt bei Sonnenlicht
     nicht. */
  .m-row.ungelesen {
    background: var(--accent-soft);
    border-left-color: var(--accent);
  }
  .m-row.ungelesen .m-row-titel { font-weight: 700; }

  /* ══ KARTE ══════════════════════════════════════════════════════════ */
  .m-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 13px;
  }
  .m-card + .m-card { margin-top: 9px; }
  .m-card-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: 9px;
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 11.5px;
    color: var(--text-muted);
  }
  .m-card-titel { font-size: 15.5px; font-weight: 600; color: var(--text); }
  .m-card-meta  { margin-top: 4px; font-size: 12.5px; color: var(--text-muted); }
  /* Die Fußzeile ist das Muster für alles mit einem Betrag: Zeitraum links,
     Summe rechts, getrennt durch eine Linie. */
  .m-card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid var(--border-light);
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 12px;
    color: var(--text);
  }
  .m-card-summe { font-size: 16px; font-weight: 700; }

  /* ══ STATUSCHIP ═════════════════════════════════════════════════════ */
  .m-chip {
    flex-shrink: 0;
    display: inline-block;
    padding: 5px 9px;
    border-radius: var(--radius-pill);
    background: var(--neutral-soft);
    color: var(--neutral-ink);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }
  .m-chip-ok   { background: var(--success-soft); color: var(--success-ink); }
  .m-chip-warn { background: var(--warning-soft); color: var(--warning-ink); }
  .m-chip-bad  { background: var(--danger-soft);  color: var(--danger-ink); }
  .m-chip-info { background: var(--info-soft);    color: var(--info-ink); }
  .m-chip-klein { padding: 3px 7px; font-size: 10.5px; }

  /* ══ GRUPPEN-TRENNER ════════════════════════════════════════════════
     Klebend, weil er beim Scrollen die Antwort auf „wo bin ich" ist —
     Datum im Kalender, Buchstabe in der Kundenliste. */
  .m-groupbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 7px var(--space-3);
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
  }
  /* In einer Karten-Liste sitzt der Trenner ausserhalb und trägt Akzentfarbe. */
  .m-abschnitt {
    margin: 0 2px var(--space-2);
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent2);
  }

  /* ══ KENNZAHLEN ═════════════════════════════════════════════════════ */
  .m-kpirow { display: flex; gap: var(--space-2); }
  .m-kpi {
    flex: 1;
    min-width: 0;
    padding: 10px 11px;
    border-radius: var(--radius-lg);
    background: var(--neutral-soft);
    color: var(--neutral-ink);
  }
  .m-kpi-wert {
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .m-kpi-label { margin-top: 2px; font-size: 11px; font-weight: 600; }
  .m-kpi-ok   { background: var(--success-soft); color: var(--success-ink); }
  .m-kpi-warn { background: var(--warning-soft); color: var(--warning-ink); }
  .m-kpi-bad  { background: var(--danger-soft);  color: var(--danger-ink); }

  /* ══ NAVIGATIONS- / EINSTELLUNGS-LISTE ═════════════════════════════ */
  .m-nav-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }
  .m-nav-list + .m-abschnitt { margin-top: var(--space-4); }
  .m-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 52px;
    padding: 8px var(--space-3);
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }
  .m-nav-item:last-child { border-bottom: 0; }
  .m-nav-item:active     { background: var(--surface-3); }
  .m-nav-icon {
    width: 20px;
    flex-shrink: 0;
    color: var(--accent2);
    font-size: 16px;
    text-align: center;
  }
  .m-nav-txt  { flex: 1; min-width: 0; }
  .m-nav-unter {
    margin-top: 1px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
  }
  .m-nav-badge {
    flex-shrink: 0;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
  }

  /* ══ FORMULAR ═══════════════════════════════════════════════════════
     Label über Wert. Label-neben-Feld braucht unter 390px so viel Breite,
     dass für den Wert nichts bleibt. */
  .m-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px var(--space-3);
    border-top: 1px solid var(--border-light);
  }
  .m-field-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
  .m-field-wert  { font-size: 14.5px; color: var(--text); line-height: 1.5; }
  .m-field-wert.mono {
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 14px;
    font-weight: 500;
  }
  .m-field input,
  .m-field select,
  .m-field textarea {
    width: 100%;
    min-height: var(--tap);
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    /* 16px verhindert den Auto-Zoom von iOS-Safari beim Fokus. */
    font-size: 16px;
  }

  /* ══ PILLEN-REITER (Detail-Bereiche) ═══════════════════════════════ */
  .m-pilltabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 9px var(--space-3);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .m-pilltabs::-webkit-scrollbar { height: 0; }
  .m-pilltab {
    flex-shrink: 0;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
  }
  .m-pilltab.active {
    background: var(--brand-surface);
    border-color: var(--brand-surface);
    color: #fff;
  }

  /* ══ SEGMENT-SCHALTER ═══════════════════════════════════════════════
     Zwei bis drei Ansichten DERSELBEN Daten (Kalender: Liste / Raster).
     Nicht zu verwechseln mit .m-chiprow — das filtert, dies schaltet um. */
  .m-segment {
    display: flex;
    gap: 6px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-3);
  }
  .m-segment > button {
    flex: 1;
    min-height: 36px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .m-segment > button.active { background: var(--brand-surface); color: #fff; }

  /* ══ BELEGUNGSRASTER ════════════════════════════════════════════════
     Die Ansicht für „was ist frei" — Lücken sind in einer Liste unsichtbar.
     Zwei Achsen zu scrollen ist der Preis; tragbar, weil Einheiten-Spalte UND
     Tages-Kopfzeile kleben: man verliert nie beide Bezugsachsen zugleich.

     Die Tagesbreite steht als Token, weil JS sie kennen muss — der Startversatz
     („heute links im Bild") rechnet damit. Wer sie ändert, ändert sie überall. */
  .m-gantt {
    --gantt-tag:   34px;  /* 14 Tage = 476px. Bei 28px wird Balkentext unlesbar. */
    --gantt-spur:  96px;  /* Einheiten-Spalte */
    --gantt-zeile: 40px;  /* Balken 26px + Luft */
    overflow: auto;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
  }
  .m-gantt-innen { min-width: calc(var(--gantt-spur) + var(--gantt-tag) * 14); }

  .m-gantt-kopf {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--border);
  }
  /* Die Ecke oben links liegt in BEIDEN Richtungen fest — sonst wandert sie beim
     Diagonalscrollen unter die Tagesspalten. */
  .m-gantt-ecke {
    width: var(--gantt-spur);
    flex-shrink: 0;
    height: 38px;
    position: sticky;
    left: 0;
    z-index: 22;
    background: var(--surface);
    border-right: 1px solid var(--border);
  }
  .m-gantt-tag {
    width: var(--gantt-tag);
    flex-shrink: 0;
    height: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
  }
  .m-gantt-tag-wd {
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 8.5px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
  }
  .m-gantt-tag-num { font-size: 12px; font-weight: 700; color: var(--text); }
  .m-gantt-tag.we { background: var(--surface-2); }
  .m-gantt-tag.we .m-gantt-tag-wd { color: var(--accent2); }
  .m-gantt-tag.heute { background: var(--accent-tint); }
  .m-gantt-tag.heute .m-gantt-tag-wd,
  .m-gantt-tag.heute .m-gantt-tag-num { color: var(--accent2); }

  /* Standort-Trenner: klebt LINKS, nicht oben — beim Horizontalscrollen muss
     sichtbar bleiben, in welchem Standort man sich befindet. */
  .m-gantt-gruppe {
    display: flex;
    height: 26px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .m-gantt-gruppe > span {
    position: sticky;
    left: 0;
    display: flex;
    align-items: center;
    padding-left: var(--space-3);
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent2);
  }

  .m-gantt-zeile {
    display: flex;
    height: var(--gantt-zeile);
    border-bottom: 1px solid var(--border-light);
  }
  .m-gantt-name {
    width: var(--gantt-spur);
    flex-shrink: 0;
    position: sticky;
    left: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    padding-left: var(--space-3);
    background: var(--surface);
    border-right: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-gantt-spur   { position: relative; flex: 1; }
  .m-gantt-zellen { position: absolute; inset: 0; display: flex; }
  .m-gantt-zelle {
    width: var(--gantt-tag);
    flex-shrink: 0;
    border-right: 1px solid var(--kal-grid-line, var(--border-light));
  }
  /* Spalten-Zebra wie im Desktop-Raster: jede zweite Tagesspalte minimal
     getönt, damit die Spalte über die Zeilen hinweg zusammenhält. Steht VOR
     .we/.heute — die beiden Flächen sollen es überschreiben, nicht umgekehrt. */
  .m-gantt-zelle:nth-child(even) { background: var(--kal-grid-band); }
  .m-gantt-zelle.we    { background: var(--bg-soft); }
  .m-gantt-zelle.heute { background: var(--accent-soft); }

  /* Balken: left/width setzt JS als Vielfaches von --gantt-tag.
     Text ist der NACHNAME — bei 34px Tagesbreite fasst eine Drei-Nächte-Buchung
     ~90px. Der Vollname steht im Sheet. */
  .m-gantt-balken {
    position: absolute;
    top: 7px;
    height: 26px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .m-gantt-balken:active { filter: brightness(1.12); }

  /* Mobil fällt weg: Fenster-Erweitern, Größenziehen, Tooltip (kein Hover). */
  .kal-extend-btn,
  .kal-griff,
  #kal-tooltip { display: none !important; }

  /* ══ AKTIONSLEISTE ══════════════════════════════════════════════════
     Fest über der Bottom-Navigation. Die Höhe der Navigation steckt im
     Abstand — dieselbe Summe wie überall sonst. */
  .m-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottomnav-h) + var(--safe-b));
    z-index: var(--z-nav);
    display: flex;
    gap: 9px;
    padding: 10px var(--space-3);
    padding-left:  calc(var(--space-3) + var(--safe-l));
    padding-right: calc(var(--space-3) + var(--safe-r));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  /* Ohne Bottom-Navigation (Thread, Vollbild-Editor). */
  .m-actionbar.solo { bottom: 0; padding-bottom: calc(10px + var(--safe-b)); }
  .m-actionbar .btn { min-height: 46px; border-radius: var(--radius-lg); }
  .m-actionbar .btn-primary { flex: 1; }
  /* Der Scroll-Container muss den Platz selbst freihalten. */
  .m-hat-actionbar {
    padding-bottom: calc(66px + var(--bottomnav-h) + var(--safe-b));
  }

  /* ══ BOTTOM-SHEET ═══════════════════════════════════════════════════ */
  .m-sheet-bd {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-hi);
    background: var(--overlay);
    display: flex;
    align-items: flex-end;
  }
  .m-sheet {
    width: 100%;
    max-height: 86dvh;
    overflow-y: auto;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-5) + var(--safe-b));
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-float);
  }
  .m-sheet-griff {
    width: 38px;
    height: 4px;
    margin: 0 auto var(--space-4);
    border-radius: 2px;
    background: var(--border-strong);
  }
  .m-sheet-titel {
    margin-bottom: var(--space-3);
    font-size: var(--fs-section);
    font-weight: 700;
    color: var(--text);
  }

  /* ══ THREAD-BLASEN ══════════════════════════════════════════════════ */
  .m-bubbles {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-3) 10px;
  }
  .m-bubble { max-width: 80%; }
  .m-bubble-txt {
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
    background: var(--surface);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-line;
  }
  .m-bubble-meta {
    margin: 4px 0 0 4px;
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 10.5px;
    color: var(--text-muted);
  }
  .m-bubble.eigen { align-self: flex-end; }
  .m-bubble.eigen .m-bubble-txt {
    background: var(--accent-tint);
    border-color: var(--accent2);
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  }
  .m-bubble.eigen .m-bubble-meta { margin: 4px 4px 0 0; text-align: right; }
  .m-bubble-trenner {
    align-self: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--neutral-soft);
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--neutral-ink);
  }
  /* Frist-Streifen: bleibt sichtbar, weil er handlungsrelevant ist. */
  .m-fristbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 9px var(--space-3);
    background: var(--warning-soft);
    border-bottom: 1px solid var(--warning-line);
    font-size: 12px;
    font-weight: 600;
    color: var(--warning-ink);
  }

  /* ══ AVATAR ═════════════════════════════════════════════════════════ */
  .m-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--neutral-soft);
    color: var(--neutral-ink);
    font-size: 14px;
    font-weight: 700;
  }
  .m-avatar.aktiv { background: var(--accent); color: var(--on-accent); }

  /* ══ LEERZUSTAND ════════════════════════════════════════════════════ */
  .m-leer {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--text-muted);
  }
  .m-leer-titel {
    margin-bottom: var(--space-2);
    font-size: var(--fs-section);
    font-weight: 600;
    color: var(--text);
  }

  /* ── Thread und Vollbild-Editor verdecken die Navigation ─────────────
     Ein Thread ist eine Sackgasse mit Zurück-Weg, keine Ebene. Zwei Leisten
     übereinander kosten 112px, die die Eingabe braucht. */
  body.m-ohne-nav #bottomnav { display: none; }

  /* ── Vertrags-/Angebotseditor: eigene Ebene ohne Navigation ──────────
     Der Editor hat eine eigene Fußleiste (← Zurück / Speichern). Läge die
     Bottom-Navigation darüber, wären es zwei Leisten übereinander — und die
     obere verdeckte genau die Knöpfe, mit denen der Vertrag gespeichert oder
     geschlossen wird. Bewusst eine EIGENE Klasse statt `m-ohne-nav`: das
     Vertragsfenster wird aus der Kommunikation heraus über einen bereits
     offenen Thread gelegt, der `m-ohne-nav` selbst gesetzt hat. Zwei
     unabhängige Merker können sich nicht gegenseitig zurücknehmen.
     Gesetzt/entfernt von modules/bhbgv/view.js → _syncEditorChrome(). */
  body.bhbgv-editor-offen #bottomnav { display: none; }
  /* #main hält den Auslauf für die Leiste frei (Block „KORREKTUR v10.51.3"
     in core/shell.css). Ohne Leiste wäre das ein toter Streifen UNTER der
     Fußleiste des Editors. Spezifität 0,2,1 schlägt `body #main` (0,1,1). */
  body.bhbgv-editor-offen #main { padding-bottom: 0; }
}

/* Sehr kleine Geräte: eine Stufe herunter, damit nichts abschneidet. */
@media (max-width: 359px) {
  .m-row-titel  { font-size: 14.5px; }
  .m-card-titel { font-size: 15px; }
  .m-kpi-wert   { font-size: 17px; }
  .m-chip       { font-size: 10.5px; padding: 4px 8px; }
}
