
#aiProviderSelect{display:none}

/* ===============================================
   PlattesGroup Unternehmensfarben
   - Primär (Dunkelblau): #284259
   - Akzent (Gold):       #AD966B
   =============================================== */
:root {
  --pg-primary: #284259;
  --pg-accent: #AD966B;
}

/* ==============================================
   HERVORHEBUNGEN: Blau + Bold (im Fließtext)
   ============================================== */
.mk-strong {
  font-weight: 700;
  color: var(--pg-primary);  /* Blau für Inline-Hervorhebungen */
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* ==============================================
   ÜBERSCHRIFTEN: Gold + Bold (ohne Unterstrich)
   ============================================== */
/* Hauptüberschrift (erste Zeile der Bubble) */
.bubble > p:first-child > .mk-strong:only-child {
  display: block;
  font-size: 1.1em;
  color: var(--pg-accent);  /* Gold für Überschriften */
  margin-bottom: .75rem;
}

/* Sekundäre Überschriften (alleinstehende Fettzeilen + Markdown ###) */
.bubble .mk-header {
  margin-top: 1.25rem;
  margin-bottom: .35rem;
  padding-top: .75rem;
  border-top: 2px solid transparent;
  border-image: linear-gradient(to right, var(--pg-accent), transparent 80%) 1;
}

/* Erste Überschrift braucht keine Trennlinie darüber */
.bubble > .mk-header:first-child,
.bubble > p:first-child + .mk-header {
  border-top: none;
  border-image: none;
  padding-top: 0;
  margin-top: 0;
}

.bubble .mk-header .mk-strong {
  display: inline-block;
  font-size: 1.02em;
  color: var(--pg-accent) !important;  /* Gold für Überschriften */
}

/* Markdown # Hauptüberschrift */
.bubble .mk-h1 .mk-strong {
  font-size: 1.15em;
}

/* Markdown ## Unterüberschrift */
.bubble .mk-h2 .mk-strong {
  font-size: 1.08em;
}

/* Markdown ### Dritte Ebene */
.bubble .mk-h3 .mk-strong {
  font-size: 1.02em;
}

/* Unter-Überschriften in Listen (z.B. "Steuerpflichtige Vermögenswerte:") */
.bubble .mk-subheader {
  margin: .75rem 0 .25rem 0;
  font-weight: 700;
}

.bubble .mk-subheader .mk-strong {
  color: var(--pg-accent) !important;
  font-size: 0.98em;
}

/* ==============================================
   NUMMERIERTE ZEILEN: Links, nicht eingerückt
   ============================================== */
.mk-numbered {
  margin: .5rem 0 .2rem 0;
  line-height: 1.5;
}

.mk-numbered .mk-num {
  font-weight: 700;
  color: var(--pg-accent);
  margin-right: .25rem;
}

/* ==============================================
   LISTEN: Eingerückt unter nummerierten Zeilen
   ============================================== */
.mk-list {
  margin: .2rem 0 .4rem 1.5rem;
  padding-left: 0;
  list-style: none;
}

.mk-list li {
  margin: .2rem 0;
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.mk-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--pg-accent);
  font-weight: bold;
}

/* Bullet-Inhalt: Titel + Fließtext zusammen */
.mk-list li > .mk-strong:first-child {
  display: inline;
}

/* Fließtext nach Zeilenumbruch im Bullet eingerückt */
.mk-list li {
  text-indent: 0;
}

.mk-list li br + * {
  display: block;
  margin-top: .15rem;
}

/* Verschachtelte Listen weiter einrücken */
.mk-list .mk-list {
  margin-left: 0;
  margin-top: .2rem;
  padding-left: 1.25rem;
}

/* ==============================================
   PARAGRAPHEN & BUBBLE
   ============================================== */
.bubble p {
  margin: .4rem 0;
  line-height: 1.6;
}

.bubble {
  max-width: 140ch;
}

/* ==============================================
   TRENNLINIEN: Dezenter Gold-Verlauf
   ============================================== */
.bubble hr,
.bubble .mk-divider {
  border: none;
  height: 2px;
  background: linear-gradient(to right, var(--pg-accent), transparent 80%);
  margin: 1rem 0;
}
.chip { padding:.35rem .8rem; border:1px solid #e5e7eb; border-radius:9999px; font-size:.92rem; text-align:left }
.btn  { padding:.5rem 1rem; border-radius:.75rem; box-shadow:0 1px 2px rgba(0,0,0,.07); border:1px solid #e5e7eb }
    /* Deutliche Disabled-Zustände für Buttons & Eingaben */
.btn:disabled,
.btn[disabled],
button:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  border-color: #d1d5db;
  background-color: #f9fafb;
  color: #9ca3af;
}

input[disabled],
textarea[disabled] {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.mono { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace }

/* Progress Bar (in Bubble) */
.progress { position:relative; height:3px; overflow:hidden; border-radius:9999px; background:#e5e7eb }
.progress::after { content:""; position:absolute; left:-40%; top:0; height:100%; width:40%; background:#60a5fa; animation:load 1s linear infinite; }
@keyframes load { 0%{left:-40%} 100%{left:100%} }

/* Thinking status bar */
.thinking-bar{ display:none !important; }
.thinking-dot{ display:inline-block; width:.35rem; height:.35rem; border-radius:9999px; background:#3b82f6; margin-left:.25rem; animation:bounce 1s infinite ease-in-out; }
.thinking-dot:nth-child(2){ animation-delay:.15s }
.thinking-dot:nth-child(3){ animation-delay:.3s }
@keyframes bounce{ 0%,80%,100%{ transform:translateY(0); opacity:.35 } 40%{ transform:translateY(-3px); opacity:1 } }

/* Skeleton placeholder für die Assistant-Bubble */
.skeleton{ position:relative; overflow:hidden; }
.skeleton::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 100%);
  transform:translateX(-100%); animation:shimmer 1.4s infinite;
}
@keyframes shimmer{ 0%{ transform:translateX(-100%) } 100%{ transform:translateX(100%) } }

/* Drawer */
.drawer{ position:fixed; top:0; right:0; bottom:0; width:22rem; max-width:100%; background:#fff; border-left:1px solid #e5e7eb; transform:translateX(100%); transition:transform .2s ease; z-index:50; box-shadow:-8px 0 24px rgba(0,0,0,.08) }
.drawer.open{ transform:translateX(0) }
.backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.25); opacity:0; pointer-events:none; transition:opacity .2s ease; z-index:40 }
.backdrop.show{ opacity:1; pointer-events:auto }

/* Quellen-Favicons an der Bubble */
.src-icons{
  position:absolute; right:.5rem; bottom:-.35rem; z-index:20;
  display:flex; gap:.3rem; background:#fff; padding:.25rem .35rem;
  border:1px solid #e5e7eb; border-radius:.6rem; box-shadow:0 6px 16px rgba(0,0,0,.12)
}
.src-icons a{
  display:inline-flex; width:18px; height:18px; border-radius:9999px; overflow:hidden;
  border:1px solid #e5e7eb; background:#fff
}
.src-icons img{ width:100%; height:100%; display:block }

/* Dezente Quellen-Footerleiste IN der Bubble */
.src-strip{
  margin-top:.5rem; padding:.35rem .45rem;
  border-top:1px dashed rgba(30,64,175,.18);  /* dezente Linie in Blau-Ton */
  display:flex; gap:.35rem; align-items:center; flex-wrap:wrap;
  background:rgba(255,255,255,.35); border-radius:.5rem;
}

/* Feedback-Buttons (Daumen hoch/runter) */
.feedback-buttons {
  border-top: 1px dashed rgba(30,64,175,.18);
  padding-top: .5rem;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.feedback-btn.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #2563eb;
}

.feedback-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.feedback-btn svg {
  width: 14px;
  height: 14px;
}

/* Sofort-Tooltip für Favicons (voller Link, kein Truncation) */
/* Sofort-Tooltip für Favicons: volle URL, kein Truncate */
.src-icon-wrap{ position:relative }

.src-tip{
  position:absolute;
  left:50%; bottom:2.0rem; transform:translateX(-50%);  /* zentriert über dem Icon */
  z-index:9999;
  background:#111; color:#fff;
  font-size:.72rem; line-height:1.25;
  padding:.45rem .6rem; border-radius:.5rem;
  box-shadow:0 10px 24px rgba(0,0,0,.35);

  /* WICHTIG: nichts umbrechen, lieber horizontal scrollen */
  white-space:nowrap;            /* keine Zeilenumbrüche */
  max-width:90vw;                /* begrenze auf Bildschirmbreite */
  overflow-x:auto; overflow-y:hidden;  /* Scrollbar wenn nötig */
  scrollbar-width:thin;

  display:none;
}

.src-tip:before{
  content:""; position:absolute;
  left:50%; transform:translateX(-50%);
  bottom:-6px; width:0; height:0;
  border-left:6px solid transparent;
  border-right:6px solid transparent;
  border-top:6px solid #111;
}


.src-icon{
  display:inline-flex; width:18px; height:18px; border-radius:9999px; overflow:hidden;
  border:1px solid rgba(0,0,0,.08); opacity:.65; transition:opacity .15s ease;
  background:#fff;
}
.src-icon:hover{ opacity:1 }

.src-more{
  font-size:.7rem; padding:.05rem .4rem; border-radius:.5rem;
  background:rgba(255,255,255,.6); border:1px solid rgba(0,0,0,.08);
  color:#1e40af; opacity:.75;
}

/* ===== Composer immer sichtbar am unteren Bildschirmrand ===== */
.chat-composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 96rem; /* Doppelte Breite für mehr Platz */
  padding: 0.75rem 0.75rem 0.9rem 0.75rem;
  background: linear-gradient(to top, rgba(249,250,251,0.98), rgba(249,250,251,0.92));
  z-index: 30;
}

/* Auf Desktop die Composer-Leiste exakt unter der Chat-Spalte zentrieren */
@media (min-width: 1024px) {
  /* Vollbreite Sidebar (19rem) → Mittelpunkt um 9.5rem nach rechts verschieben */
  body.sidebar-expanded .chat-composer {
    left: calc(50% + 9.5rem);   /* Hälfte der Sidebar-Breite */
  }

  /* Icon-Leiste (3.75rem) → Mittelpunkt nur leicht nach rechts verschieben */
  body.sidebar-collapsed .chat-composer {
    left: calc(50% + 1.875rem); /* Hälfte der Icon-Leisten-Breite */
  }
}

/* Auf Desktop die Composer-Leiste exakt unter der Chat-Spalte zentrieren */
@media (min-width: 1024px) {
  /* Vollbreite Sidebar (19rem) → Mittelpunkt um 9.5rem nach rechts verschieben */
  body.sidebar-expanded .chat-composer {
    left: calc(50% + 9.5rem);   /* Hälfte der Sidebar-Breite */
  }

  /* Icon-Leiste (3.75rem) → Mittelpunkt nur leicht nach rechts verschieben */
  body.sidebar-collapsed .chat-composer {
    left: calc(50% + 1.875rem); /* Hälfte der Icon-Leisten-Breite */
  }
}

.chat-composer textarea {
  width: 100%;
  min-height: 2.5rem;
  max-height: 10rem;
  resize: vertical;
}

/* Button-Labels (Basis) */
#feedbackBtn .feedback-label-short {
  display: none;          /* Standard: nur langer Text */
}

#voiceBtn .voice-icon {
  margin-right: .25rem;
}

#voiceBtn .voice-label {
  display: inline;
}

/* Unteren Bereich des Chats freihalten, damit nichts unter der Leiste verschwindet */
#mainShell{
  padding-bottom: 12rem;  /* mehr als die Höhe der Composer-Leiste */
}

@media (max-width: 640px) {
  .chat-composer input,
  .chat-composer textarea {
    width: 100%;
  }

  /* Buttons: schmaler und in einer Zeile */
  .chat-composer .actions-row {
    justify-content: center;
    flex-wrap: nowrap;
  }

  .chat-composer .actions-row .btn {
    width: auto;
    flex: 0 0 auto;
    font-size: .85rem;
    padding-inline: .75rem;
    white-space: nowrap;
  }

  /* Nur mobil: Audio-Text ausblenden, nur Mikro-Symbol zeigen */
  #voiceBtn .voice-label {
    display: none;
  }

  /* Nur mobil: „Probandenfeedback“ → „Feedback“ */
  #feedbackBtn .feedback-label-long {
    display: none;
  }
  #feedbackBtn .feedback-label-short {
    display: inline;
  }

  /* Hinweiszeile unter Buttons, zentriert */
  #aiWarning {
    margin-top: .5rem;
    text-align: center;
  }
}

/* ===== Quellenbereich: lange URLs + Typ-Icons ===== */
#sourcesBox {
  max-height: none;      /* Höhe passt sich dynamisch an */
  overflow-y: visible;   /* kein eigener Scrollbalken */
  padding-right: 0;      /* kein extra Innenabstand nötig */
}

/* Liste: Icon + Link/Button nebeneinander */
#sourcesBox ul li {
  display: flex;
  align-items: flex-start;
  gap: .35rem;
}

/* Links und Buttons sollen sauber umbrechen können */
#sourcesBox a,
#sourcesBox button {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  display: inline-block;
  max-width: 100%;
}

/* Mehrzeilige Quellen immer linksbündig ausrichten */
#sourcesBox ul {
  text-align: left;
}

#sourcesBox li,
#sourcesBox a,
#sourcesBox button {
  text-align: left !important;
}

/* Typ-Icons vor jeder Quelle */
.src-type-icon{
  flex: 0 0 auto;
  font-size: .9rem;
  line-height: 1.4;
  margin-top: .05rem;
  opacity: .85;
}

.src-type-doc{
  color: #1d4ed8;   /* Blau für Dokumente */
}

.src-type-web{
  color: #6b7280;   /* Grau für Websites */
}

/* === Left Sidebar (ChatGPT-like) === */
.sidebar-left{
  position:fixed; top:0; bottom:0; left:0;
  width:19rem; max-width:100%;
  background:#fff; border-right:1px solid #e5e7eb;
  transform:translateX(-100%); transition:transform .2s ease;
  z-index:60; box-shadow:8px 0 24px rgba(0,0,0,.08);
  display:flex; flex-direction:column;
}
.sidebar-left.open{ transform:translateX(0) }
.sidebar-left .nav-header{
  padding:.75rem;
  border-bottom:1px solid #e5e7eb;
  display:flex;
  align-items:center;
  gap:.5rem;
}
.sidebar-left .nav-body{
  display:flex;
  flex-direction:column;
  gap:.5rem;
  padding:.75rem;
  height:calc(100vh - 56px);
}
#myChatList{ overflow-y:auto; }

/* Collapsed: nur Icons, keine Chatliste (wie ChatGPT) */
.sidebar-left.collapsed{
  width:3.75rem;
}
.sidebar-left.collapsed .nav-brand-text,
.sidebar-left.collapsed .nav-section-title,
.sidebar-left.collapsed .nav-search,
.sidebar-left.collapsed #myChatList,
.sidebar-left.collapsed .nav-language-section{
  display:none;
}
.sidebar-left.collapsed .sb-label,
.sidebar-left.collapsed .nav-close-label{
  display:none;
}
.sidebar-left.collapsed .nav-close-btn{
  padding:.4rem;
}
.sidebar-left.collapsed .btn{
  justify-content:center;
}
.sidebar-left.collapsed .nav-header{
  justify-content:center;
}

/* Desktop: Platz je nach Sidebar-Zustand */
@media (min-width: 1024px) {
  body.sidebar-expanded { padding-left:19rem; }
  body.sidebar-collapsed { padding-left:3.75rem; }

  #sidebarBackdrop {
    display:none; /* auf Desktop kein Overlay */
  }
}

/* Mobile: Sidebar-Menü-Button dauerhaft sichtbar (floating oben links) */
#mobileSidebarToggleBar{
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 35;          /* über dem Chat/Composer (30), unter Sidebar (60) */
  pointer-events: none; /* Container durchklickbar */
}

#mobileSidebarToggleBar > button{
  pointer-events: auto; /* nur der Button ist klickbar */
}

/* Auf Desktop: Fallback (wird durch lg:hidden ohnehin ausgeblendet) */
@media (min-width: 1024px){
  #mobileSidebarToggleBar{
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    pointer-events: auto;
  }
}

/* Hero-Startseite (neuer Chat, noch keine Unterhaltung) */
body.hero-mode #thinkingBar {
  display:none !important;
}
body.hero-mode #chat {
  display:none;
}
body.hero-mode #shelf,
body.hero-mode #sourcesBox{
  display:none;
}
body.hero-mode #heroIntro {
  display:block;
}

/* Hero-Layout: Inhalt im rechten Bereich mittig zentrieren */
body.hero-mode #mainShell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;        /* horizontal zentrieren */
  padding-bottom:0;          /* im Startscreen kein zusätzlicher Abstand nötig */
}

/* Gemeinsame Breite für Begrüßungstext UND Eingabeleiste */
body.hero-mode #heroIntro,
body.hero-mode .chat-composer{
  width:100%;
  max-width:84rem;           /* Doppelte Breite für mehr Platz */
}

body.hero-mode #heroIntro{
  margin-top:0;
  margin-bottom:1.5rem;
}

body.hero-mode .chat-composer{
  position: static;
  left: auto;          /* Basis-Left (50%) neutralisieren */
  transform: none;     /* translateX(-50%) deaktivieren */
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0 auto;      /* falls align-items mal wegfällt, trotzdem mittig */
}

body.hero-mode .chat-composer textarea{
  min-height:3rem;
}

#cookieBanner{position:fixed;left:0;right:0;bottom:0;z-index:99999;background:#111;color:#fff}
#cookieBanner .box{max-width:56rem;margin:0 auto;padding:1rem;display:flex;gap:.75rem;align-items:center}
#cookieBanner .btn{background:#fff;color:#111;border-radius:.5rem;padding:.5rem .75rem}
#cookieBanner .btn.primary{background:#AD966B;color:#1A2A37}
#cookieModal{position:fixed;inset:0;z-index:100000;background:rgba(0,0,0,.6);display:none}
#cookieModal .inner{max-width:42rem;margin:10vh auto;background:#fff;color:#111;border-radius:.75rem;padding:1rem}
#cookieModal h3{font-weight:600;margin-bottom:.25rem}
#cookieModal .row{display:flex;justify-content:space-between;align-items:center;padding:.5rem 0;border-bottom:1px solid #eee}
