/* ============================================================================
   V131 — Admin<->Talent Chat (geteilt zwischen beiden Portalen)
   Namespace: .ttchat-*  | Floating-Bubble + Widget + Voll-Reiter + Badges
   ============================================================================ */

:root {
  --ttchat-navy: #16203a;
  --ttchat-navy-2: #24304f;
  --ttchat-line: #e6e9ef;
  --ttchat-mine-bg: #16203a;
  --ttchat-mine-fg: #ffffff;
  --ttchat-their-bg: #f1f3f6;
  --ttchat-their-fg: #1f2937;
  --ttchat-muted: #8a94a3;
  --ttchat-unread: #ef4444;
  --ttchat-z-fab: 8500;
  --ttchat-z-widget: 8600;
}

/* ---------- Floating Action Button (Bubble unten rechts) ---------- */
.ttchat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--ttchat-z-fab);
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--ttchat-navy); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(16,24,40,.28); transition: transform .18s ease, background .12s, opacity .18s ease;
}
.ttchat-fab:hover { background: var(--ttchat-navy-2); transform: translateY(-1px); }
.ttchat-fab:active { transform: scale(.96); }
.ttchat-fab svg { width: 26px; height: 26px; }
.ttchat-fab-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--ttchat-unread); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px #fff; display: none;
}
.ttchat-fab.has-unread .ttchat-fab-badge { display: block; animation: ttchat-pop .28s ease; }
@keyframes ttchat-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Kleine "Vorschau"-Sprechblase, die bei neuer Nachricht aufpoppt */
.ttchat-peek {
  position: fixed; right: 20px; bottom: 86px; z-index: var(--ttchat-z-fab);
  max-width: 260px; background: #fff; border: 1px solid var(--ttchat-line);
  border-radius: 14px 14px 4px 14px; box-shadow: 0 8px 24px rgba(16,24,40,.16);
  padding: 10px 12px; cursor: pointer; display: none; animation: ttchat-peek-in .2s ease;
}
.ttchat-peek.show { display: block; }
@keyframes ttchat-peek-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ttchat-peek-title { font-size: 12px; font-weight: 700; color: var(--ttchat-navy); margin: 0 0 2px; }
.ttchat-peek-body { font-size: 12.5px; color: #4b5563; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Widget (ausgeklappt) ---------- */
.ttchat-widget {
  position: fixed; right: 20px; bottom: 88px; z-index: var(--ttchat-z-widget);
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px);
  background: #fff; border: 1px solid var(--ttchat-line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(16,24,40,.28); display: none; flex-direction: column; overflow: hidden;
}
.ttchat-widget.open { display: flex; animation: ttchat-widget-in .16s ease; }
@keyframes ttchat-widget-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Voll-Reiter im Portal: gleiche Bauteile, nur eingebettet statt fixed */
.ttchat-section .ttchat-shell { height: calc(100vh - 220px); min-height: 460px; }
.ttchat-shell {
  display: flex; flex-direction: column; height: 100%; position: relative;
  border: 1px solid var(--ttchat-line); border-radius: 14px; background: #fff; overflow: hidden;
}

/* ---------- Kopf ---------- */
.ttchat-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--ttchat-navy); color: #fff;
}
.ttchat-head .ttchat-avatar { background: rgba(255,255,255,.16); color: #fff; }
.ttchat-head-title { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.2; }
.ttchat-head-sub { font-size: 11.5px; opacity: .75; margin: 0; }
.ttchat-head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ttchat-head-btn { border: 0; background: transparent; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; opacity: .85; }
.ttchat-head-btn:hover { background: rgba(255,255,255,.12); opacity: 1; }
.ttchat-head-btn svg { width: 18px; height: 18px; }
.ttchat-back-btn { display: none; }
.ttchat-shell.in-thread .ttchat-back-btn { display: inline-flex; }

.ttchat-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: #eef0f4; color: var(--ttchat-navy); display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
}

/* ---------- Body ---------- */
.ttchat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fbfbfc; }

/* Admin-Uebersicht (Konversationsliste) */
.ttchat-convo {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer;
  border-bottom: 1px solid #f0f2f5; background: #fff;
}
.ttchat-convo:hover { background: #f7f8fa; }
.ttchat-convo-main { min-width: 0; flex: 1 1 auto; }
.ttchat-convo-name { font-size: 13.5px; font-weight: 600; color: #1f2937; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttchat-convo-last { font-size: 12px; color: var(--ttchat-muted); margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttchat-convo-meta { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ttchat-convo-time { font-size: 10.5px; color: #b0b7c3; }
.ttchat-convo.unread .ttchat-convo-name { font-weight: 800; }
.ttchat-convo.unread .ttchat-convo-last { color: #374151; font-weight: 600; }
.ttchat-pill {
  min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: var(--ttchat-unread); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.ttchat-search { padding: 10px 12px; border-bottom: 1px solid var(--ttchat-line); background: #fff; }
.ttchat-search input { width: 100%; height: 36px; border: 1px solid var(--ttchat-line); border-radius: 9px; padding: 0 12px; font-size: 13px; font-family: inherit; box-sizing: border-box; }

/* Thread (Nachrichten) */
.ttchat-thread { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ttchat-day { align-self: center; font-size: 10.5px; color: var(--ttchat-muted); background: #eceef2; padding: 2px 10px; border-radius: 999px; margin: 4px 0; }
.ttchat-newdiv { align-self: center; font-size: 10.5px; font-weight: 700; color: var(--ttchat-unread); margin: 4px 0; display: flex; align-items: center; gap: 8px; width: 100%; }
.ttchat-newdiv::before, .ttchat-newdiv::after { content: ""; flex: 1; height: 1px; background: #f3c2c2; }
/* V228o (N5): WhatsApp-Look — weichere/groessere Radien, dezenter Schatten, klare Sprecher-Trennung */
.ttchat-msg { max-width: 80%; padding: 7px 12px; border-radius: 18px; font-size: 13.5px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; position: relative; box-shadow: 0 1px 1.5px rgba(16,24,40,.08); }
.ttchat-msg-time { display: block; font-size: 10px; margin-top: 2px; opacity: .6; }
.ttchat-msg.them { align-self: flex-start; background: var(--ttchat-their-bg); color: var(--ttchat-their-fg); border-bottom-left-radius: 6px; }
.ttchat-msg.me { align-self: flex-end; background: var(--ttchat-mine-bg); color: var(--ttchat-mine-fg); border-bottom-right-radius: 6px; }
.ttchat-msg.me .ttchat-msg-time { text-align: right; }
.ttchat-msg.unread-in { box-shadow: 0 0 0 2px rgba(239,68,68,.35); }
/* V228j: Sende-Status + Retry bei fehlgeschlagenem Versand */
.ttchat-msg.pending { opacity: .72; }
.ttchat-msg.failed { box-shadow: 0 0 0 1px rgba(220,38,38,.45); }
.ttchat-msg.failed .ttchat-msg-time { color: #dc2626; opacity: .95; }
.ttchat-retry { margin-left: 6px; padding: 1px 7px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.ttchat-retry:hover { background: rgba(220,38,38,.12); }

.ttchat-empty { padding: 40px 20px; text-align: center; color: var(--ttchat-muted); font-size: 13px; }
.ttchat-loading { padding: 24px; text-align: center; color: var(--ttchat-muted); font-size: 12.5px; }

/* ---------- Eingabe (V228o (N5): WhatsApp-Composer — abgerundetes Feld + runder Sende-Button) ---------- */
.ttchat-input {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-top: 1px solid var(--ttchat-line); background: #f5f6f8;
}
.ttchat-input textarea {
  flex: 1 1 auto; resize: none; border: 1px solid var(--ttchat-line); border-radius: 21px;
  padding: 8px 14px; font-size: 16px; font-family: inherit; line-height: 1.3; max-height: 110px; min-height: 40px; box-sizing: border-box;
  background: #fff; transition: border-color .12s, box-shadow .12s;
  white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; /* V228x/V228aa: leer -> Platzhalter einzeilig (nowrap); beim Tippen schaltet .tt-grow auf pre-wrap um */
}
.ttchat-input textarea:focus { outline: none; border-color: var(--ttchat-navy); box-shadow: 0 0 0 3px rgba(22,32,58,.1); }
/* V228aa: sobald getippt wird (JS setzt .tt-grow), darf der Text umbrechen und das Feld waechst (JS-Hoehe). */
.ttchat-input textarea.tt-grow { white-space: pre-wrap; overflow-x: hidden; overflow-y: auto; text-overflow: clip; }
.ttchat-send {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--ttchat-navy); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .08s; box-shadow: 0 2px 6px rgba(16,24,40,.22);
}
.ttchat-send:hover { background: var(--ttchat-navy-2); }
.ttchat-send:active { transform: scale(.94); }
.ttchat-send:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ttchat-send svg { width: 18px; height: 18px; }
.ttchat-input.disabled { opacity: .6; }

/* ---------- Mobil ---------- */
@media (max-width: 768px) {
  /* V228n (Notiz 24.07.): Chat-Button klar ueber die untere Tab-Leiste heben (beruehrte den
     Footer) + minimal weiter rechts. bottom deckt Nav-Hoehe (~78px) + sicheren Abstand ab. */
  /* V228ah: Bottom-Nav ist jetzt ein Drawer (kein Bodenstreifen mehr) -> FAB/Peek/Widget auf
     normalen Offset + env(safe-area) statt ~78px Nav-Hoehe zu reservieren. */
  .ttchat-fab { right: 11px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: 50px; height: 50px; }
  /* V228av: Beim Scrollen nach unten tuckt die Bubble weg, damit sie keine rechtsbuendigen
     Kartenwerte (z.B. Saldo auf der Rechnungskarte) verdeckt; erscheint bei Scroll-up/Ruhe wieder. */
  .ttchat-fab.ttchat-fab--tuck { transform: translateY(160%) scale(.9); opacity: 0; pointer-events: none; }
  /* V228aw: Bei offenem Hamburger-Drawer FAB + Peek ausblenden — sonst schweben sie ueber dem
     abgedunkelten Menue-Overlay (Drawer z-index 4000, FAB/Peek 8500). */
  html.tt-drawer-open .ttchat-fab, html.tt-drawer-open .ttchat-peek { display: none !important; }
  .ttchat-peek { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  /* V228bc: Widget schliesst unten fast buendig ab (12px). Vorher 78px Bodenluft fuer die Bubble —
     die wird jetzt beim Oeffnen ausgeblendet (toggleWidget), also braucht das Widget den Platz nicht mehr. */
  .ttchat-widget { right: 8px; left: 8px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; height: calc(100dvh - var(--tt-header-h, 64px) - 24px); }
  /* V228o (Notiz 24.07.): Section-Überschrift "Chat mit TrueTalent" am Handy entfernen — der innere
     .ttchat-head ("TrueTalent Management") labelt den Chat bereits (keine doppelte Ebene). */
  html body #dashboard-view #chat-panel > .talent-panel-header { display: none !important; }
  /* Chat füllt stabil den Platz zwischen Portal-Header und Fußleiste; min-height:460 (Basis) zwang
     die Höhe zu groß -> Eingabefeld rutschte unter die Tab-Leiste. dvh + min-height:0 fixiert das. */
  /* V228ai: Chat-Panel unten NICHT die generische 24px-Bodenluft geben (Composer IST der Boden). */
  html body #dashboard-view #chat-panel { padding-bottom: 0 !important; }
  .ttchat-section .ttchat-shell {
    height: calc(100dvh - var(--tt-header-h, 64px) - 6px - env(safe-area-inset-bottom, 0px)) !important;   /* V228ai: exakt fuellen (Header + 6px Panel-Top + Safe-Area), Composer klebt am Rand */
    min-height: 0 !important;
    max-height: none !important;
  }
  /* V228ai: Nachrichten unten-ausrichten (WhatsApp) -> keine Luecke zum Composer. Banner + Composer bleiben fix, nur der Body scrollt. */
  .ttchat-section .ttchat-body { display: flex !important; flex-direction: column !important; }
  .ttchat-section .ttchat-body .ttchat-thread { margin-top: auto !important; }
  /* V228o (N5): Bubbles am Handy breiter (WhatsApp-Gefuehl); Thread hat eigenes Padding -> kein Body-Scroll */
  .ttchat-msg { max-width: 88%; }
  .ttchat-msg.has-card { max-width: 92%; }
}

/* ============================================================================
   V132 — Objekt-Karten (Rechnung/Vertrag/Kampagne) im Chat + Anhaengen-Picker
   ============================================================================ */
/* Nachricht mit Karte darf etwas breiter werden */
.ttchat-msg.has-card { max-width: 90%; }
.ttchat-msg.me.has-card, .ttchat-msg.them.has-card { }

/* Die kompakte Vorschau-Karte in der Blase (klickbar) */
.ttchat-card {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  background: #fff; border: 1px solid #dfe3ea; border-radius: 12px;
  padding: 9px 10px; cursor: pointer; text-align: left;
  box-shadow: 0 1px 2px rgba(16,24,40,.06); transition: border-color .12s, box-shadow .12s, transform .06s;
}
.ttchat-card:hover { border-color: #16203a; box-shadow: 0 3px 10px rgba(16,24,40,.14); }
.ttchat-card:active { transform: translateY(1px); }
.ttchat-card-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px;
  background: #eef1f7; color: #16203a; display: flex; align-items: center; justify-content: center;
}
.ttchat-card-ic svg { width: 20px; height: 20px; }
.ttchat-card-main { min-width: 0; flex: 1 1 auto; display: block; }
.ttchat-card-title { display: block; font-size: 13px; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttchat-card-sub { display: block; font-size: 11.5px; color: #6b7280; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttchat-card-pill { display: inline-block; margin-top: 5px; font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eef0f4; color: #55607a; }
.ttchat-card-chev { flex: 0 0 auto; color: #b0b7c3; display: flex; }
.ttchat-card-chev svg { width: 17px; height: 17px; }

/* Status-Toene der Pille (auch im Picker verwendet) */
.ttchat-tone-ok     { background: #e7f6ec; color: #1f7a3d; }
.ttchat-tone-warn   { background: #fdf0dd; color: #a15c00; }
.ttchat-tone-info   { background: #e6eefc; color: #1d4ed8; }
.ttchat-tone-danger { background: #fdecec; color: #c62828; }
.ttchat-tone-muted  { background: #eef0f4; color: #55607a; }

/* Eingabe-Wrapper (haelt Chip + Eingabezeile) */
.ttchat-inputwrap { flex: 0 0 auto; border-top: 1px solid var(--ttchat-line); background: #fff; }
.ttchat-inputwrap .ttchat-input { border-top: 0; }

/* Globale button{padding}-Leaks neutralisieren, sonst staucht der Flex-Container das Icon auf 2px */
.ttchat-attach-btn, .ttchat-input .ttchat-send { padding: 0 !important; }
.ttchat-attach-btn svg, .ttchat-input .ttchat-send svg { flex: 0 0 auto; }

/* Anhaengen-Button (Bueroklammer) links in der Eingabe — V228o (N5): dezent, transparent, rund */
.ttchat-attach-btn {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: transparent; color: #7b8494; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ttchat-attach-btn:hover { background: rgba(22,32,58,.07); color: #16203a; }
.ttchat-attach-btn svg { width: 20px; height: 20px; }

/* V228ab (P4b): EIN Büroklammer-Icon -> Mini-Menü (Objekt anhängen / Bild-Datei) statt zwei Icons */
.ttchat-attach-wrap { position: relative; flex: 0 0 auto; display: inline-flex; }
.ttchat-attach-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 60;
  background: #fff; border: 1px solid var(--ttchat-line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(16,24,40,.18);
  padding: 6px; min-width: 224px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; gap: 2px;
}
.ttchat-attach-menu[hidden] { display: none; }
.ttchat-attach-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; background: transparent; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; font-weight: 500; font-family: inherit;
  color: #16203a; text-align: left; line-height: 1.2;
}
.ttchat-attach-menu-item:hover { background: rgba(22,32,58,.06); }
.ttchat-attach-menu-item svg { width: 18px; height: 18px; flex: 0 0 auto; color: #5a6473; }

/* Chip ueber der Eingabe = aktuell angehaengtes Objekt */
.ttchat-attach-chip {
  display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 7px 8px 7px 10px;
  background: #f2f5fb; border: 1px solid #d9e0ee; border-radius: 11px;
}
.ttchat-attach-chip-ic { flex: 0 0 auto; color: #16203a; display: flex; }
.ttchat-attach-chip-ic svg { width: 16px; height: 16px; }
.ttchat-attach-chip-txt { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttchat-attach-x { flex: 0 0 auto; border: 0; background: transparent; color: #8a94a3; cursor: pointer; padding: 3px; border-radius: 6px; display: inline-flex; }
.ttchat-attach-x:hover { background: #e6e9ef; color: #374151; }
.ttchat-attach-x svg { width: 14px; height: 14px; }

/* Picker-Panel (schwebt ueber der Eingabe) */
.ttchat-attach-panel {
  position: absolute; left: 10px; right: 10px; bottom: 62px; z-index: 5;
  background: #fff; border: 1px solid #d9dee7; border-radius: 14px;
  box-shadow: 0 14px 40px rgba(16,24,40,.22); display: flex; flex-direction: column;
  max-height: 62%; overflow: hidden; animation: ttchat-widget-in .14s ease;
}
.ttchat-attach-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #eef0f4; font-size: 13px; font-weight: 700; color: #16203a; }
.ttchat-attach-tabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 10px 12px 4px; }
.ttchat-attach-tab { flex: 1 1 0; border: 1px solid var(--ttchat-line); background: #fff; border-radius: 9px; padding: 7px 4px; font-size: 12px; font-weight: 600; color: #55607a; cursor: pointer; font-family: inherit; }
.ttchat-attach-tab:hover { background: #f4f6f9; }
.ttchat-attach-tab.active { background: #16203a; border-color: #16203a; color: #fff; }
.ttchat-attach-list { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px; }
.ttchat-attach-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.ttchat-attach-item:hover { background: #f4f6f9; }
.ttchat-attach-empty { padding: 26px 16px; text-align: center; color: var(--ttchat-muted); font-size: 12.5px; }

/* Ungelesen-Badge am Nav-Reiter (beide Portale) */
.dashboard-tab, .admin-main-nav .view-btn { position: relative; }
.ttchat-nav-badge {
  position: absolute; top: 5px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--ttchat-unread); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px #fff; z-index: 2;
}

/* ============ Datei-/Bild-Teilen (V228) ============ */
.ttchat-inputwrap { position: relative; }

/* + Button zum Bild/Datei anhaengen — V228o (N5): dezent, transparent, rund (gleiche Optik wie Klammer) */
.ttchat-file-btn {
  flex: 0 0 auto; width: 42px; height: 42px; padding: 0 !important; border: 0; border-radius: 50%;
  background: transparent; color: #7b8494; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ttchat-file-btn:hover { background: rgba(22,32,58,.07); color: var(--ttchat-navy); }
.ttchat-file-btn svg { flex: 0 0 auto; width: 20px; height: 20px; }

/* Bild-Nachricht: Blase transparent, Bild spricht fuer sich */
.ttchat-msg.has-img { background: transparent !important; box-shadow: none !important; padding: 0; max-width: 250px; }
.ttchat-msg.has-img .ttchat-msg-time { color: #9099a8; margin-top: 3px; padding: 0 2px; }
.ttchat-msg.me.has-img { align-items: flex-end; }
.ttchat-img { display: block; line-height: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--ttchat-line); background: #f4f6f9; }
.ttchat-img img { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; }
.ttchat-img:hover { filter: brightness(.97); }

/* Datei-Nachricht (Dokument): Download-Karte */
.ttchat-file {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 9px 11px; min-width: 200px; max-width: 260px;
  background: #fff; border: 1px solid var(--ttchat-line); border-radius: 12px; text-decoration: none; cursor: pointer;
}
.ttchat-file:hover { border-color: var(--ttchat-navy); box-shadow: 0 3px 10px rgba(16,24,40,.12); }
.ttchat-msg.me .ttchat-file { background: #fff; }
.ttchat-file.is-missing { cursor: default; opacity: .7; }
.ttchat-file-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; background: #eef1f6; color: var(--ttchat-navy); display: flex; align-items: center; justify-content: center; }
.ttchat-file-ic svg { width: 18px; height: 18px; }
.ttchat-file-main { min-width: 0; flex: 1 1 auto; }
.ttchat-file-name { display: block; font-size: 13px; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttchat-file-meta { display: block; font-size: 11px; color: #6b7280; margin-top: 1px; }
.ttchat-file-dl { flex: 0 0 auto; color: #9099a8; display: flex; }
.ttchat-file-dl svg { width: 17px; height: 17px; }

/* Drag-Over-Schleier ueber der Eingabe */
.ttchat-dropveil {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(22,32,58,.055); border: 2px dashed var(--ttchat-navy); border-radius: 14px; margin: 6px;
  pointer-events: none; z-index: 3;
}
.ttchat-dropveil span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ttchat-navy); background: #fff; padding: 6px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(16,24,40,.12); }
.ttchat-dropveil svg { width: 17px; height: 17px; }
.ttchat-shell.ttchat-dragging .ttchat-dropveil { display: flex; }
