/* -----------------------------------------------------------
   DOX – Chat UI Overrides (präzise für deine Struktur)
   - "+ Neuer Chat" Button füllt Sidebar-Breite
   - Frage/Antwort-Bubbles ohne Hintergrund (clean)
   ----------------------------------------------------------- */

/* "+ Neuer Chat" vollbreit – trifft #newChatBtn in Sidebar */
#sidebar #newChatBtn,
.sidebar #newChatBtn,
#newChatBtn {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  text-align: center !important;
}

/* Falls Button im Header/Footer der Sidebar liegt, spacing fix */
.sidebar-header #newChatBtn,
.sidebar-footer #newChatBtn {
  margin: 0 !important;
}

/* Bubbles clean – Hintergrund/Border weg, wirkt wie Plain Text */
.bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;   /* keine „Bubble“-Innenabstände mehr */
}

/* User-Bubble überschreiben (general.css färbt sie sonst noch ein) */
.msg.user .bubble {
  background: transparent !important;
  border: none !important;
}

/* Optional: Meta und Quellen weiterhin dezent belassen */
.ans-meta { color: var(--muted); }
.sources-group { border-color: var(--border); }

/* --- Mobile Viewport Fix für Chat --- */
/* Basis bleibt 100vh aus general.css; hier modernere Einheiten darüberlegen */
@supports (height: 100svh) {
  .chat-container {
    height: calc(100svh - var(--topbar-h, 64px) - var(--bottombar-h, 56px));
  }
}
@supports (height: 100dvh) {
  .chat-container {
    height: calc(100dvh - var(--topbar-h, 64px) - var(--bottombar-h, 56px));
  }
}

/* Scroll-/Safe-Area-Feinschliff */
.chat-container main, .chatbar { min-height: 0; } /* erlaubt dem Inhalt zu scrollen */
.chat-body { overflow-y: auto; }                   /* Sicherheit, falls überschrieben */

@media (max-width: 900px) {
  /* verhindert, dass der Composer im Home-Indicator versinkt */
  .chat-input {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: var(--bg);
  }
  /* Mobile-Overlay-Sidebar respektiert Safe Areas oben/unten */
  .sidebar {
    top: calc(var(--topbar-h, 64px) + 25px + env(safe-area-inset-top, 0px));
    bottom: calc(var(--bottombar-h, 56px) + 25px + env(safe-area-inset-bottom, 0px));
  }
}
