






.chat-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }


.chat-messages {
  max-width: var(--lesebreite); width: 100%; margin: auto auto 0;
  padding: var(--s5) var(--s5) var(--s2);
  display: flex; flex-direction: column;
}



.chat-messages > .msg + .msg { margin-top: var(--s8); }
.chat-messages > .msg-user + .msg-assistant { margin-top: var(--s4); }


.chat-messages > .msg-user:has(> .msg-tools) + .msg-assistant { margin-top: var(--s1); }
.chat-empty {
  max-width: 560px; margin: auto; padding: var(--s7) var(--s5); text-align: center;
}
.chat-empty-titel { margin: var(--s4) 0 var(--s2); font-family: var(--schrift-titel); font-size: var(--fs-gruss);
                    font-weight: 480; letter-spacing: -0.016em; line-height: 1.2; }

.chat-empty .brand-logo-gross { box-shadow: 0 0 0 1px var(--kante-fein), 0 0 0 var(--s2) var(--bg),
                                            0 0 0 calc(var(--s2) + 1px) var(--accent-soft-stark); }
.chat-empty p { color: var(--text-dim); margin: 0 auto var(--s5); max-width: 46ch; }

.msg { display: flex; flex-direction: column; gap: var(--s2); }



.msg.rein { animation: aufsteigen var(--tempo-lang) var(--ease); }
.msg.rein .sources:not([hidden]), .msg.rein .msg-tools > .tool-icon, .msg.rein .msg-marke {
  animation: einblenden var(--tempo-lang) var(--ease);
}



.msg-user { align-items: flex-end; gap: 0; }
.msg-user > .msg-tools { flex: none; margin-right: calc(var(--s2) * -1); }
.msg-user > .edit-box { max-width: 100%; min-width: 0; }

.msg-user:has(> .edit-box) > .msg-tools { display: none; }
.msg-user .bubble {
  max-width: min(82%, 60ch); padding: var(--s3) var(--s4);

  border-radius: var(--r-xl) var(--r-xs) var(--r-xl) var(--r-xs);
  background: var(--bg-blase); white-space: pre-wrap; word-break: break-word;
}
.msg-assistant { align-items: stretch; }


.msg-assistant .md { line-height: 1.65; }
.msg-absender {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.03em;
}


.msg-absender { display: none; }





.msg-tools { display: flex; gap: var(--s1); }






.msg-tools > * { opacity: var(--msg-werkzeuge, 0); transition: opacity var(--tempo); }




.msg-assistant:last-child .msg-tools > *, .msg:hover .msg-tools > *, .msg-assistant:focus-within .msg-tools > *,
.msg-tools > .rueckmeldung-knopf[aria-pressed="true"] { opacity: 1; }
.msg-user:has(:focus-visible) { --msg-werkzeuge: 1; }
@media (pointer: coarse) {
  .msg-assistant .msg-tools > * { opacity: 1; }


  .msg-user.werkzeuge-an .msg-tools > * { opacity: 1; }
  .msg-user:not(.werkzeuge-an) > .msg-tools { visibility: hidden; }
}




.msg-assistant:not(:last-child) .neu-erzeugen:hover { color: var(--danger); background: var(--danger-soft); }




@media (hover: hover) and (pointer: fine) {
  .msg-assistant:not(:last-child) .msg-tools > .rueckmeldung-knopf[aria-pressed="true"] { order: -1; }
}




.msg-fuss { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg-fuss > .sources { align-self: stretch; min-width: 0; }
.msg-fuss > .msg-tools { flex: none; margin-top: var(--s1); margin-left: calc(var(--s2) * -1); }
.msg-status {
  display: flex; align-items: center; gap: var(--s2);
  color: var(--text-dim); font-size: var(--fs-md);
}
.msg-status::before {
  content: ""; width: var(--s6); height: var(--s6); flex-shrink: 0; border-radius: var(--r-pill);
  background: var(--marke-bewegt) center / contain no-repeat;
}


@media (prefers-reduced-motion: reduce) {
  .msg-status::before { background-image: var(--marke-zeichen); }
}





.edit-box textarea {
  width: min(560px, 84vw); min-height: var(--h-feld); padding: var(--s3);
  border: 1px solid var(--accent); border-radius: var(--r-md);
  background: var(--bg-panel); color: var(--text);
  resize: vertical; outline: none; box-shadow: var(--fokus);
  transition: border-color var(--tempo), box-shadow var(--tempo);
}
.edit-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s2); }







.zitate { font-size: var(--fs-xs); line-height: 0; vertical-align: super;
          color: var(--text-dim); white-space: nowrap; margin-left: 1px; }


.cite { color: var(--kern-text); background: var(--kern-grund); font-weight: 600; text-decoration: none;
        padding: 0 1px; border-radius: var(--r-xs); }
.cite:hover, .cite:focus-visible { color: var(--kern-text); background: var(--kern-flaeche); text-decoration: underline;
                                    text-decoration-color: var(--kern); text-decoration-thickness: 1px; }
.md .cite { color: var(--kern-text); }


.zitate .cite {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.45em; height: 1.45em;
  padding: 0 0.3em; border-radius: var(--r-pill); background: var(--kern-flaeche); line-height: 1;
  font-variant-numeric: tabular-nums; text-decoration: none; vertical-align: 0.15em;
}

.md .zitate { font-size: var(--fs-sm); line-height: inherit; vertical-align: baseline; margin-left: var(--s0); }
.zitate .cite:hover, .zitate .cite:focus-visible { background: var(--kern); color: var(--bg); text-decoration: none; }



.cite { position: relative; }
.cite::after { content: ""; position: absolute; inset: calc(-1 * var(--s2)); }


@media (pointer: coarse), (any-pointer: coarse) {
  .cite::after { inset: calc(-1 * var(--s3)); }
  .sources-liste a.beleg-nr::after { inset: calc(-1 * var(--s3)); }
  .sources-liste a.beleg-dok-name { padding-block: var(--s3); margin-block: calc(-1 * var(--s3)); }
}




.sources { margin-top: var(--s3); font-size: var(--fs-md);
           background: linear-gradient(var(--kern), var(--kern)) left top / var(--s9) 1px no-repeat;
           scroll-margin-block: var(--s4); }
.sources-kopf {
  display: inline-flex; align-items: center; gap: var(--s1);
  min-height: var(--h-ziel-klein); padding: 0 var(--s2); margin-left: calc(-1 * var(--s2));
  border-radius: var(--r-sm); color: var(--text-dim); cursor: pointer;
  list-style: none; user-select: none;
}
.sources-kopf::-webkit-details-marker { display: none; }

.sources-kopf::before {
  content: ""; flex: none; width: var(--s2); height: var(--s2); margin: 0 var(--s1) 0 var(--s0);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--tempo);
}
.sources[open] > .sources-kopf::before { transform: rotate(45deg); }

.sources-kopf { max-width: 100%; min-width: 0; }
.sources-satz { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


@supports (interpolate-size: allow-keywords) {
  .sources, .denk-block { interpolate-size: allow-keywords; }
  .sources::details-content, .denk-block::details-content { block-size: 0; overflow: clip; }
  .sources[open]::details-content, .denk-block[open]::details-content {
    block-size: auto;
    transition: block-size var(--tempo-lang) var(--ease), content-visibility var(--tempo-lang) allow-discrete;
  }
}
.sources-kopf:hover { color: var(--text); background: var(--bg-hover); }
.sources-liste { list-style: none; margin: 0; padding: var(--s2) 0 var(--s1); display: grid; gap: var(--s2); }
.sources-liste li { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-sm); }

.sources-liste li.belegt { background: var(--kern-flaeche); }

.sources-liste a { display: flex; align-items: center; gap: var(--s2); min-width: 0; min-height: var(--h-ziel-klein);
                   padding: 0 var(--s2) 0 0; border-radius: var(--r-sm); color: var(--accent); text-decoration: none; }
.sources-liste a:hover { background: var(--bg-hover); }
@media (pointer: coarse) { .sources-liste a { min-height: var(--h-ziel); } }



.sources-liste > li.beleg-dok {
  display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s4);
  border-radius: var(--r-md); background: var(--bg-hover);
}


.beleg-dok-kopf { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--s2); min-width: 0; }
.beleg-dok-kopf > .datei-symbol { flex: none; }

.beleg-dok-kopf > .beleg-nummern { flex: none; max-width: 50%; }
.sources-liste .beleg-dok-name {
  display: block; flex: 0 100 auto; min-width: 8ch; min-height: 0; padding: 0; background: none;
  color: var(--accent); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sources-liste span.beleg-dok-name { color: var(--text); }
.sources-liste a.beleg-dok-name:hover { background: none; text-decoration: underline; }


.sources-liste a.beleg-dok-name { padding-block: var(--s1); margin-block: calc(-1 * var(--s1)); }
.beleg-nummern { display: inline-flex; flex-wrap: wrap; gap: var(--s1); }
.sources-liste .beleg-nr {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.7em; height: 1.7em; min-height: 0; padding: 0 0.4em; border-radius: var(--r-pill);
  background: var(--kern-flaeche); color: var(--kern-text);
  font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none;
}
.sources-liste a.beleg-nr:hover, .sources-liste a.beleg-nr:focus-visible, .sources-liste .beleg-nr.belegt {
  background: var(--kern); color: var(--bg);
}

.sources-liste a.beleg-nr::after { content: ""; position: absolute; inset: calc(-1 * var(--s2)) calc(-1 * var(--s0)); }
@media (prefers-reduced-motion: reduce) {
  .sources-kopf::before { transition: none; }
}

.md { word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 var(--s3); }
.md ul, .md ol { padding-left: var(--s5); }
.md li { margin-bottom: var(--s1); }
.md h1, .md h2, .md h3 { font-size: var(--fs-xl); margin: var(--s5) 0 var(--s2); }
.md code { padding: 1px var(--s1); border-radius: var(--r-xs); background: var(--bg-hover);
           font-size: var(--fs-md); }
.md pre { padding: var(--s3); border-radius: var(--r-sm); background: var(--bg-hover);
          overflow-x: auto; }
.md pre code { padding: 0; background: none; }


.md table { border-collapse: collapse; width: 100%; margin: var(--s3) 0;
            font-size: var(--fs-bd); }


.md table { display: block; overflow-x: auto; max-width: 100%; }
.md .katex-display { overflow-x: auto; overflow-y: hidden; }


.md th, .md td { padding: var(--s2) var(--s4); border: 0; border-bottom: 1px solid var(--kante-fein);
                 text-align: left; white-space: nowrap; }
.md th { font-weight: 600; }
.md th:first-child, .md td:first-child { padding-left: 0; }
.md th:last-child, .md td:last-child { padding-right: 0; }
.md thead th { background: none; border-top: 1px solid var(--linie-satz); border-bottom-color: var(--border-stark);
               color: var(--text-dim); font-size: var(--fs-sm); }
.md tbody tr:last-child td { border-bottom-color: var(--linie-satz); }
.md th[align="right"], .md td[align="right"], .md th.zahl, .md td.zahl { text-align: right; }
.md th[align="center"], .md td[align="center"] { text-align: center; }
.md a { color: var(--accent); }
.md blockquote { margin: 0 0 var(--s3); padding-left: var(--s3);
                 border-left: 3px solid var(--border); color: var(--text-dim); }
.md details { margin-top: var(--s3); }
.md summary { cursor: pointer; color: var(--text-dim); font-size: var(--fs-md);
              min-height: var(--h-ziel-klein); display: flex; align-items: center; }
.md details table { margin-top: var(--s2); }


.chat-inputbar {
  max-width: var(--lesebreite); width: 100%; margin: 0 auto;
  padding: var(--s2) var(--s5) var(--s4);
  padding-bottom: max(var(--s4), env(safe-area-inset-bottom));
}


.ki-hinweis { margin: var(--s2) 0 0; padding: 0 var(--s2); color: var(--text-dim); font-size: var(--fs-xs);
              line-height: var(--lh-eng); text-align: center; text-wrap: balance; overflow-wrap: break-word; }
.ki-hinweis-kurz { display: none; }
@media (max-width: 759px) {
  .ki-hinweis { margin-top: var(--s1); }
  .ki-hinweis-lang { display: none; }
  .ki-hinweis-kurz { display: inline; }
}


@media (max-height: 320px) {
  .ki-hinweis { margin-top: var(--s1); }
  .chat-inputbar { padding-bottom: max(var(--s2), env(safe-area-inset-bottom)); }
}



.chat-neu-ort {
  display: flex; align-items: center; gap: var(--s1); width: fit-content; max-width: 100%;
  min-height: var(--h-ziel-klein); margin: 0 0 var(--s2); padding: 0 var(--s1) 0 var(--s2);
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-panel);
  color: var(--text); font-size: var(--fs-md); font-weight: 500;
}
.chat-neu-ort > svg { flex: none; color: var(--text-dim); }
.chat-neu-ort-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-neu-ort .modus-weg { color: var(--text-dim); }
.chat-neu-ort .modus-weg:hover { background: var(--bg-hover); color: var(--text); }
.model-banner {
  display: flex; align-items: center; gap: var(--s2);
  margin-bottom: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  background: var(--warn-soft); color: var(--warn); font-size: var(--fs-md);
  animation: einblenden var(--tempo) var(--ease);
}

.model-banner.error { display: block; padding: 0; background: none; color: var(--text); }



.model-banner.ruhig {
  flex-wrap: wrap; gap: 0 var(--s2); padding: 0 var(--s1);
  background: none; color: var(--text-dim); font-size: var(--fs-sm);
}
.banner-kopf { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; }
.banner-kopf::before {
  content: ""; width: var(--s2); height: var(--s2); border-radius: var(--r-pill);
  background: var(--warn); flex: none;
}


.banner-kopf.leise { align-items: baseline; font-weight: 500; line-height: var(--lh-eng); padding: var(--s1) 0; }
.banner-kopf.leise::before { position: relative; top: -1px; }
.banner-mehr {
  min-height: var(--h-ziel-klein); padding: 0 var(--s1); border: none; border-radius: var(--r-xs);
  background: none; color: var(--accent); font: inherit; cursor: pointer;
}
.banner-mehr:hover { background: var(--accent-soft); }
.banner-satz { flex: 1 0 100%; padding-bottom: var(--s2); line-height: var(--lh-eng); }

.msg-marke { margin: 0; color: var(--text-dim); font-size: var(--fs-md); }










.model-banner.wartung, .wartung-hinweis, .wartung-vorschau {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s1) var(--s2);
  padding: var(--s3); border-radius: var(--r-sm);
  border-left: 3px solid var(--warn);
  background: var(--warn-soft); color: var(--warn); font-size: var(--fs-md);
}
.model-banner.wartung { margin-bottom: var(--s2); }
.wartung-hinweis { margin-bottom: var(--s4); }
.wartung-vorschau { margin-top: var(--s3); }
.model-banner.wartung strong, .wartung-hinweis strong, .wartung-vorschau strong {
  font-weight: 600;
}


.model-banner.wartung span:not(.wartung-icon),
.wartung-hinweis span:not(.wartung-icon),
.wartung-vorschau span:not(.wartung-icon) { color: var(--text); flex: 1 1 16.875rem; }
.wartung-icon { flex-shrink: 0; font-size: var(--fs-lg); line-height: 1; }



.upload-zone.gesperrt {
  cursor: not-allowed; opacity: var(--deckkraft-aus); border-style: solid;
}
.upload-zone.gesperrt:hover { border-color: var(--border-stark); background: none; }








.inputbox {
  border: 1px solid var(--kante-eingabe); border-radius: var(--r-xl);
  background: var(--bg-panel); box-shadow: var(--schatten-eingabe);
  transition: border-color var(--tempo) var(--ease), box-shadow var(--tempo) var(--ease);
}



.inputbox:focus-within { border-color: var(--kante-ziel); box-shadow: var(--schatten-eingabe-fokus); }
.inputbox textarea {
  display: block; width: 100%; max-height: 40vh; padding: var(--s4) var(--s4) var(--s1);
  border: none; background: none; resize: none; outline: none; line-height: var(--lh);
  font-size: var(--fs-frage); transition: color var(--tempo) var(--ease);
}


@media (min-width: 760px) {
  .inputbox textarea { min-height: calc(var(--lh) * 2em + var(--s5)); }
}

.inputbox.praezisiert textarea { color: var(--text-dim); }


.input-tools { display: flex; align-items: center; gap: var(--s1);
               padding: var(--s1) var(--s3) var(--s3) var(--s2);
               min-height: calc(var(--h-ziel) + var(--s4)); }
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--h-ziel); height: var(--h-ziel); padding: 0;
  border: none; border-radius: var(--r-pill); background: none;
  color: var(--text-dim); cursor: pointer;
  transition: background var(--tempo) var(--ease), color var(--tempo) var(--ease);
}
.tool-btn:hover { background: var(--bg-hover); color: var(--text); }





.anhang-leiste {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  padding: var(--s3) var(--s3) 0;
}
.anhang-chip {
  position: relative; width: 56px; height: 56px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  overflow: hidden; background: var(--bg-hover);
}
.anhang-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }


.anhang-ansicht {
  display: block; width: 100%; height: 100%; padding: 0; border: none;
  background: none; cursor: zoom-in;
}
.anhang-ansicht:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }



.anhang-chip.datei { width: auto; max-width: 240px; display: flex; align-items: center;
                     padding-right: var(--s7); background: var(--bg-hover); }
.datei-kern, .datei-chip { display: flex; align-items: center; gap: var(--s2); min-width: 0; }

.datei-kern {
  flex: 1 1 auto; align-self: stretch; padding: 0 var(--s3);
  border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.datei-kern:hover { background: var(--bg-active); }
.datei-kern:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }






.datei-symbol { display: flex; flex-shrink: 0; color: var(--text-dim); }


.zellentext > .datei-symbol { display: inline-flex; vertical-align: middle; margin-right: var(--s2); }
.datei-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.datei-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm);
              font-weight: 500; color: var(--text); }
.datei-art { font-size: var(--fs-xs); color: var(--text-dim); letter-spacing: 0.04em; }


.datei-chip {
  align-self: flex-start;
  max-width: 260px; min-height: 48px; padding: var(--s2) var(--s3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-panel); color: inherit; font: inherit; text-align: left;
  text-decoration: none; cursor: pointer;
  transition: background var(--tempo) var(--ease);
}
.datei-chip:hover { background: var(--bg-hover); }
.datei-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }





.anhang-weg {
  position: absolute; top: 2px; right: 2px;
  width: 24px; height: 24px; display: flex; align-items: center;
  justify-content: center; padding: 0;
  border: none; border-radius: var(--r-pill); cursor: pointer;
  background: var(--auf-bild); color: var(--auf-bild-text);
}
.anhang-weg:hover { background: var(--auf-bild-stark); }
.anhang-weg:focus-visible { outline: 2px solid var(--auf-bild-text); outline-offset: -2px; }
@media (pointer: coarse) { .anhang-weg { width: 28px; height: 28px; } }
.anhang-chip.laedt { opacity: 0.5; }





.msg-anhaenge { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.bild-knopf {
  display: block; padding: 0; border: none; background: none;
  border-radius: var(--r-sm); line-height: 0; cursor: zoom-in;
}
.bild-knopf img {
  display: block; max-width: 220px; max-height: 190px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: opacity var(--tempo) var(--ease);
}
.bild-knopf:hover img { opacity: 0.92; }
.bild-knopf:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }










.dialog-backdrop:has(.bildansicht) { padding: 0; background: var(--bildschleier); }

.dialog.bildansicht { animation: einblenden var(--tempo) var(--ease); }
.dialog.bildansicht {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--s3);
  width: 100%; height: 100%; max-height: none; padding: var(--s7) var(--s9);
  border: none; border-radius: 0; background: none; box-shadow: none;
  overflow: hidden; pointer-events: none;
}
.bildansicht-buehne {

  position: relative;
  display: flex; align-items: center; justify-content: center; min-height: 0;

  touch-action: pinch-zoom pan-x pan-y;
}
.bildansicht-bild {
  display: block; max-width: 100%; max-height: calc(100dvh - 8.4375rem);
  object-fit: contain; border-radius: var(--r-sm); pointer-events: auto;
}
.bildansicht-buehne.kaputt .bildansicht-bild { display: none; }
.bildansicht-meldung {
  margin: 0; padding: var(--s4) var(--s5); border-radius: var(--r-md);
  background: var(--auf-schleier); color: var(--auf-bild-text); text-align: center;
  pointer-events: auto;
}
.bildansicht-meldung:empty { display: none; }


.dialog.bildansicht > .bildansicht-name {
  margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--auf-bild-text); font-size: var(--fs-bd); pointer-events: auto;
}
.bildansicht-zu, .bildansicht-pfeil {
  position: absolute; width: var(--h-ziel); height: var(--h-ziel);
  display: flex; align-items: center; justify-content: center; padding: 0;
  border: none; border-radius: var(--r-pill); cursor: pointer; pointer-events: auto;
  background: var(--auf-schleier); color: var(--auf-bild-text);
  transition: background var(--tempo) var(--ease);
}






.dialog.bildansicht .bildansicht-zu {
  top: calc(var(--h-ziel) / -2 - var(--s1)); left: 100%; margin-left: var(--s2);
  background: none; opacity: 0.8;
  transition: opacity var(--tempo) var(--ease);
}
.dialog.bildansicht .bildansicht-zu:hover { background: none; opacity: 1; }
.bildansicht-pfeil { top: 50%; transform: translateY(-50%); }
.bildansicht-pfeil.links { left: var(--s4); }
.bildansicht-pfeil.rechts { right: var(--s4); }
.bildansicht-zu:hover, .bildansicht-pfeil:hover { background: var(--auf-schleier-stark); }
.bildansicht-zu:focus-visible, .bildansicht-pfeil:focus-visible {
  outline: 2px solid var(--auf-bild-text); outline-offset: 2px;
}
.bildansicht-pfeil:disabled { opacity: var(--deckkraft-aus); cursor: default; }
@media (max-width: 759px) {


  .bild-knopf img { max-width: 136px; max-height: 120px; }


  .dialog.bildansicht { padding: calc(var(--h-ziel) + var(--s2)) var(--s2) var(--s6); }
  .bildansicht-bild { max-height: calc(100dvh - 8.4375rem); }

  .dialog.bildansicht .bildansicht-zu { top: calc(var(--h-ziel) * -1); left: auto; right: 0; margin-left: 0; }
  .bildansicht-pfeil.links { left: var(--s2); }
  .bildansicht-pfeil.rechts { right: var(--s2); }
}





.denk-block {
  margin-bottom: var(--s2); border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg-hover);
  font-size: var(--fs-sm);
}
.denk-block > summary {
  padding: var(--s2) var(--s3); cursor: pointer; color: var(--text-dim);
  list-style: none;
}
.denk-block > summary::-webkit-details-marker { display: none; }


.denk-block > summary::before {
  content: "▸" / ""; display: inline-block; margin-right: var(--s1); transition: transform var(--tempo) var(--ease);
}
.denk-block[open] > summary::before { transform: rotate(90deg); }
.denk-text {
  padding: 0 var(--s3) var(--s3); margin: 0; color: var(--text-dim);
  white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: auto;
}


.send-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--h-ziel); height: var(--h-ziel); margin-left: auto; flex-shrink: 0;
  border: none; border-radius: var(--r-pill); background: var(--accent);
  color: var(--auf-akzent); cursor: pointer;
  transition: background var(--tempo) var(--ease), transform var(--tempo) var(--ease);
}
.send-btn:hover { background: var(--accent-hover); }

.send-btn.stopp { background: var(--text); color: var(--bg); }
.send-btn:disabled { opacity: var(--deckkraft-aus); cursor: not-allowed; }


.input-tools > .send-btn:disabled { opacity: 1; background: var(--senden-aus); color: var(--senden-aus-text); }

.index-progress {
  margin-bottom: var(--s2); padding: var(--s3);
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-panel);
}
.index-progress-head { display: flex; gap: var(--s3); font-size: var(--fs-sm);
                       color: var(--text-dim); margin-bottom: var(--s2); }
.index-progress-head span:first-child { flex: 1; overflow: hidden;
                                        text-overflow: ellipsis; white-space: nowrap; }



.bestand-lauf-fuss {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-top: var(--s2);
}
.bestand-lauf-fuss .hint { margin: 0; min-width: 0; }
.bestand-lauf-fuss .btn { flex-shrink: 0; }




.doc-table th abbr {
  text-decoration: underline dotted; text-underline-offset: 3px;
  cursor: help;
}






@media (max-width: 599px) {
  .bestand-lauf-fuss { flex-wrap: wrap; }
  .bestand-lauf-fuss .btn { width: 100%; }
}


.scroll-down {
  position: absolute; left: 50%; translate: -50% 0; z-index: var(--z-schwebend);
  bottom: calc(var(--eingabe-hoehe, 120px) + var(--s3));
  display: flex; align-items: center; justify-content: center;
  width: var(--h-ziel); height: var(--h-ziel);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg-panel); color: var(--text-dim);
  box-shadow: var(--shadow-mittel); cursor: pointer;
  animation: einblenden var(--tempo) var(--ease);
}
.scroll-down:hover { color: var(--text); background: var(--bg-hover); }

.ws-box {
  margin-bottom: var(--s2); padding: var(--s4);
  border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--bg-panel);
  animation: einblenden var(--tempo) var(--ease);
}
.ws-box p { margin: 0 0 var(--s2); font-size: var(--fs-bd); }
.ws-box textarea { margin-bottom: var(--s3); }
.ws-box .ws-hinweis { color: var(--warn); font-size: var(--fs-sm); }
.ws-box .ws-legende { color: var(--text-dim); font-size: var(--fs-sm);
  overflow-wrap: anywhere; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }


.ws-box .confirm-actions { justify-content: flex-end; }




.chat-hinweis {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1);

  padding: var(--s3) var(--s4); border: 1px solid var(--danger); border-radius: var(--r-md);
  background: var(--danger-soft); color: var(--text); font-size: var(--fs-bd);
}
.chat-hinweis > .status { font-weight: 600; }
.chat-hinweis-satz { margin: 0; line-height: var(--lh-eng); }
.chat-hinweis-tun { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }

.msg-assistant:not(:last-child) .chat-hinweis.nur-zuletzt .chat-hinweis-tun { display: none; }
.msg-fehler > .msg-fuss > .msg-tools:empty { display: none; }



.namensschild {
  position: fixed; z-index: var(--z-menue); pointer-events: none; max-width: min(320px, calc(100vw - var(--s4)));
  padding: var(--s1) var(--s2); border-radius: var(--r-xs); background: var(--toast-grund); color: var(--toast-text);
  font-size: var(--fs-sm); font-weight: 500; line-height: var(--lh-eng); box-shadow: var(--shadow-mittel);
}



.chat-ablage {
  position: absolute; inset: var(--s3); z-index: var(--z-schwebend); pointer-events: none;
  display: flex; align-items: center; justify-content: center; padding: var(--s6);
  border: 2px dashed var(--accent); border-radius: var(--r-xl);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--bg);
  animation: einblenden var(--tempo) var(--ease);
}
.chat-ablage-innen {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); max-width: 30rem;
  color: var(--accent); text-align: center;
}
.chat-ablage-innen strong { color: var(--text); font-size: var(--fs-xl); font-weight: 600; }
.chat-ablage-innen span { color: var(--text-dim); font-size: var(--fs-md); }


.beleg-karte {
  position: fixed; z-index: var(--z-menue); display: flex; flex-direction: column; gap: var(--s1);
  width: max-content; max-width: min(20.625rem, calc(100vw - var(--s4)));
  padding: var(--s2) var(--s3); border: 1px solid var(--kante-ebene); border-radius: var(--r-lg);
  background: var(--flaeche-ebene); box-shadow: var(--shadow-stark); color: var(--text); font-size: var(--fs-md);
  animation: einblenden var(--tempo) var(--ease);
}
.beleg-karte-kopf { display: flex; align-items: center; gap: var(--s2); min-width: 0; font-weight: 600; }
.beleg-karte-nr { flex: none; color: var(--kern-text); font-size: var(--fs-xs); font-weight: 600;
                  font-variant-numeric: tabular-nums; }
.beleg-karte-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.beleg-karte { gap: var(--s2); padding: var(--s3) var(--s4); }
.beleg-karte-seite { flex: none; color: var(--text-dim); font-weight: 400; }
.beleg-karte-zitat { display: block; max-width: 22.5rem; color: var(--text); font-family: var(--schrift-titel);
                     font-size: var(--fs-lg); line-height: var(--lh-eng); }
.beleg-karte-hinweis { color: var(--text-dim); font-size: var(--fs-sm); }
.beleg-blatt h2 { display: flex; align-items: center; gap: var(--s2); }
.beleg-blatt-nr, .beleg-karte-nr {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 1.6em; height: 1.6em; padding: 0 0.35em; border-radius: var(--r-pill);
  background: var(--kern-flaeche); color: var(--kern-text); font-size: var(--fs-sm); font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.beleg-blatt-zitat { display: block; margin: var(--s3) 0 0; font-family: var(--schrift-titel); font-size: var(--fs-xl);
                     line-height: var(--lh-eng); color: var(--text); }
.beleg-blatt-ort { display: flex; align-items: center; gap: var(--s2); margin: var(--s3) 0 0; color: var(--text-dim);
                   font-size: var(--fs-md); }
.beleg-blatt .dialog-actions { margin-top: var(--s5); }
