/* Unterer Bildschirmrand am Handy ordnen (01.11.): Tab-Leiste unten, darüber links die Ansicht-Pille (nur Admins),
   rechts Lenas bzw. Max' runder Knopf ohne Beschriftung – nichts überlappt, Inhalte bekommen genug Abstand.
   Wird als letztes Stylesheet geladen; höhere Spezifität, damit ältere Regeln (admin.css, v20/v24) nicht dazwischenfunken. */
@media (max-width:767.98px){
  /* Lena (öffentliche Seiten, Konto, Postfach): nur der runde Avatar, über der Tab-Leiste mit Abstand */
  html body .as-fab{right:14px!important;bottom:calc(86px + env(safe-area-inset-bottom))!important}
  /* Beschriftung aus – auch gegen die Regel „body:has(.vc) .as-fab>.as-fab-t.as-fab-t.as-fab-t“ aus v24.css (deshalb die gehäuften Klassen) */
  html body .as-fab.as-fab>.as-fab-t.as-fab-t.as-fab-t.as-fab-t,html body .fa-fab.fa-fab .as-fab-t.as-fab-t.as-fab-t.as-fab-t{display:none!important}
  /* Ansicht-Leiste eingeklappt: kleine Pille links über der Tab-Leiste (Lena sitzt rechts) */
  html body .av-sw{left:14px!important;right:auto!important;bottom:calc(86px + env(safe-area-inset-bottom))!important;transform:none!important;margin:0!important;width:auto!important;max-width:calc(100vw - 96px)}
  html body .av-sw .av-zu{padding:7px 11px 7px 10px}
  /* aufgeklappt: volle Breite über allem, mit Schließen (×) */
  html body .av-sw.auf{right:12px!important;left:12px!important;max-width:none;z-index:120;justify-content:space-between;overflow-x:auto}
  html body .av-sw.auf .av-opt{flex:1;justify-content:space-around}
  html body .av-sw.auf .av-opt a,html body .av-sw.auf .av-opt .av-btn{padding:8px 10px}
  html body:has(.av-sw.auf) .as-fab{visibility:hidden}
  /* Fotografen-Bereich: eigene Tab-Leiste unten, Max rechts darüber */
  html body:has(.dsh-tabs) .av-sw{bottom:calc(84px + env(safe-area-inset-bottom))!important}
  html body:has(.dsh-tabs) .fa-fab{right:14px!important;bottom:calc(84px + env(safe-area-inset-bottom))!important}
  /* Chat (Eingabefeld unten) und Profil-Editor (Speichern-Leiste unten): Pille höher */
  html body:has([data-testid="sec-thread"]) .av-sw:not(.auf){bottom:calc(136px + env(safe-area-inset-bottom))!important}
  html body:has([data-testid="sec-thread"]) .av-sw:not(.auf) .av-zu em{display:none}
  html body:has(.pe-bar) .av-sw:not(.auf){bottom:calc(134px + env(safe-area-inset-bottom))!important}
  /* Inhalt endet über den schwebenden Elementen */
  html body:has(.av-sw) .dsh-page:not(.dsh-inbox){padding-bottom:calc(150px + env(safe-area-inset-bottom))}
  html body:has(.mtabs) main{scroll-padding-bottom:160px}
}
/* Desktop im Fotografen-Bereich: Pille oben rechts (auf Höhe des Testkonto-Hinweises) – unten links lag sie über Karten und Formularen */
@media (min-width:768px){html body:has(.dsh-side) .av-sw{left:auto!important;right:18px!important;top:2px!important;bottom:auto!important;transform:none!important}}
/* Fotografen-Chat am Handy: Testkonto-Hinweis einzeilig und von der Chat-Höhe abgezogen (sonst lag die Eingabe unter der Tab-Leiste);
   Eingabezeile kompakter – Senden als Pfeil-Symbol, Hinweistext aus (steht schon oben im Kopf: „Kontaktdaten werden nicht weitergegeben“) */
@media (max-width:760px){
  html body:has([data-testid="sec-thread"]) .dsh-test{padding:6px 14px;height:30px;line-height:18px;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body:has(.dsh-test) .dsh-inbox[data-testid="sec-thread"]{height:calc(100dvh - 54px - 66px - 30px - env(safe-area-inset-bottom))}
  /* Chat füllt genau den Bildschirm: kein zusätzliches Scrollen der ganzen Seite (Body-Abstand gilt der Tab-Leiste der Website) */
  html body:has([data-testid="sec-thread"]){padding-bottom:0}
  html body:has([data-testid="sec-thread"]) .dsh{padding-bottom:calc(66px + env(safe-area-inset-bottom));min-height:0}
  html body [data-testid="sec-thread"] .chat-in{padding:8px 10px}
  html body [data-testid="sec-thread"] .chat-in>.tiny{display:none}
  html body [data-testid="sec-thread"] .chat-row{gap:5px}
  html body [data-testid="sec-thread"] .chat-row .ic{width:40px}
  /* Platzhalter „Nachricht schreiben …“ passt in eine Zeile (vorher 74 statt 44 px hoch) */
  html body [data-testid="sec-thread"] .chat-row .ta{padding-left:10px;padding-right:8px;font-size:16px;min-width:0}
  html body [data-testid="sec-thread"] .chat-row .ic{width:36px;min-width:36px}
  html body [data-testid="sec-thread"] .chat-row>.btn-p{width:44px;min-width:44px;height:44px;padding:0;font-size:0;flex:none;border-radius:999px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='M22 2 15 22l-4-9-9-4 20-7z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;background-size:20px}
}
/* Paar-Postfach am Handy: Unterhaltung nie breiter als der Bildschirm (Raster-Spalte 1fr wuchs mit Tabelle/Fakten mit) */
@media (max-width:900px){html body .inbox{grid-template-columns:minmax(0,1fr)}html body .inbox>section,html body .inbox>aside{min-width:0}html body .inbox .tbl{width:100%}}
/* QA 01.11.: Im Fotografen-Bereich ist die Cookie-Leiste ausgeblendet (v15-dash.css) – die Regel „Cookie-Leiste da → Assistent aus“ (v9.css)
   hat Max deshalb am Handy dauerhaft versteckt. Max bleibt sichtbar, außer im Chat (dort hat das Eingabefeld Vorrang). */
@media (max-width:767.98px){html body:has(.dsh):not(:has([data-testid="sec-thread"])) .fa-fab{display:flex!important}}
html body .av-sw a{text-decoration:none}

/* Fotografen-Chat am Handy (01.11. abends): Kopf, Übungs-Hinweis und Angebots-/Termin-Karten scrollen mit den Nachrichten –
   vorher blieben bei 390×667 neben Kopf, Übungs-Hinweis und Angebotskarte nur wenige Pixel für die Unterhaltung.
   Die Eingabe bleibt unten fest (sticky); Chat.tsx scrollt die Spalte beim Öffnen ans Ende. Die Ansicht-Pille ist im Chat aus. */
@media (max-width:760px){
  /* Unten kein Innenabstand (sonst schauten Nachrichten unter der festen Eingabe hervor); die Unterhaltung geht über die ganze Breite,
     die Karten stehen bündig mit Kopf und Angebot (Karten-Stapel ohne eigenen Rand) */
  /* Spalte als Ganzes: Kopf und Karten so hoch wie ihr Inhalt, die Unterhaltung füllt den Rest – bei wenigen Nachrichten steht die
     Eingabe trotzdem unten über der Tab-Leiste (vorher hing sie mitten im Bild) */
  html body [data-testid="sec-thread"] .ib-r{display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;padding-bottom:0}
  html body [data-testid="sec-thread"] .ib-r>*{flex:none}
  html body [data-testid="sec-thread"] .ib-r>.chat{flex:1 0 auto;display:flex;flex-direction:column;min-height:0;margin-left:-16px;margin-right:-16px}
  html body [data-testid="sec-thread"] .ib-r>.ck-stapel{padding:0;border-bottom:0;background:none;margin:0 0 12px}
  html body [data-testid="sec-thread"] .chat-msgs{flex:1 0 auto;overflow:visible;min-height:140px}
  html body [data-testid="sec-thread"] .chat-in{position:sticky;bottom:0;z-index:5;background:var(--panel,#fff);box-shadow:0 -8px 18px -14px rgba(16,20,24,.45)}
  html body:has([data-testid="sec-thread"]) .av-sw:not(.auf){display:none!important}
}
/* Desktop, Seiten mit Profilkarten (Liste, Suche, Startseite, Profil): Lena nur als runder Avatar, Beschriftung erst bei Hover/Fokus –
   die Pille verdeckte sonst „Profil ansehen“ in der rechten Spalte der Karten (Review 02.11.). */
@media (min-width:768px){
  html body:has(.vc) .as-fab.as-fab>.as-fab-t.as-fab-t.as-fab-t.as-fab-t{display:none!important}
  html body:has(.vc) .as-fab.as-fab:hover>.as-fab-t.as-fab-t.as-fab-t.as-fab-t,html body:has(.vc) .as-fab.as-fab:focus-visible>.as-fab-t.as-fab-t.as-fab-t.as-fab-t{display:block!important}
}
