/* Ansicht „Chat“ — nur Tokens aus app.css, Präfix .cht-. Mobil: Liste und Unterhaltung getrennt; ab 1024 px zweispaltig. */

.cht-side { display: flex; flex-direction: column; min-width: 0; }
.cht-main { min-width: 0; }
.cht--list .cht-main { display: none; }
.cht--conv .cht-side { display: none; }

/* Mobil: Unterhaltung füllt genau die Höhe über der Tab-Leiste (Seite selbst scrollt nicht) */
.page--chat-conv { padding-bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
.cht--conv { height: calc(100dvh - var(--tab-h) - 32px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); min-height: 420px; }
.cht--conv .cht-main { height: 100%; }
.cht .chat { height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr); }

/* ---------- Liste ---------- */
.cht-side__title { margin-bottom: var(--s4); font-size: var(--fs-xl); line-height: 1.12; font-weight: 700; letter-spacing: -.028em; }
.cht-side .vh { margin-bottom: var(--s4); }
.cht-tools { display: grid; gap: var(--s3); margin-bottom: var(--s3); }
.cht-scroll { min-height: 0; }
.cht-row + .cht-row::before { left: 68px; }
.cht-row[aria-current="page"] { background: var(--accent-soft); }
.cht-row__top, .cht-row__bot { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.cht-row__bot { margin-top: 2px; }
.cht-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cht-time { margin-left: auto; flex: none; }
.cht-prev { flex: 1; min-width: 0; margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cht-row .demo { flex: none; }
.cht-row .badge { flex: none; }

/* ---------- Unterhaltung: Kopf ---------- */
.cht-top { padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.cht-head { display: flex; align-items: center; gap: var(--s3); min-height: 56px; }
.cht-back { margin-left: -8px; flex: none; }
.cht-head__t { flex: 1; min-width: 0; }
.cht-head__t h1 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cht-sub { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-top: 2px; }
.cht-note { display: flex; align-items: flex-start; gap: var(--s2); margin-top: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-row);
  background: var(--surface); color: var(--ink-2); }
.cht-note .demo { flex: none; }
.cht-pin { display: flex; align-items: flex-start; gap: var(--s2); margin-top: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-row);
  box-shadow: inset 0 0 0 1px var(--line); }
.cht-pin .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--accent-ink); }
.cht-pin > div { min-width: 0; }
.cht-pin__t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Unterhaltung: Nachrichten ---------- */
.cht-msgs .bubble { overflow-wrap: anywhere; }
.cht-txt { display: block; white-space: pre-wrap; }
.cht-role { font-weight: 500; color: var(--ink-3); }
.cht-sys { align-self: center; width: min(100%, 420px); }
.cht-att { display: flex; align-items: center; gap: var(--s2); font-weight: 600; margin-bottom: 2px; }
.cht-att .ic { width: 18px; height: 18px; }
.cht-orig { display: flex; margin: -4px 0 -10px; font-size: var(--fs-foot); }
.cht-orig .ic { width: 16px; height: 16px; }

/* ---------- Unterhaltung: Eingabe ---------- */
.cht-foot { padding-top: var(--s3); }
.cht-hint { margin-top: var(--s1); text-align: center; }
.cht-ro { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 52px; padding: var(--s2) var(--s4);
  border-radius: 26px; background: var(--surface); color: var(--ink-2); font-size: var(--fs-sub); font-weight: 600; text-align: center; }
.cht-ro .ic { width: 18px; height: 18px; }

/* ---------- Leerer Zustand (Desktop) ---------- */
.cht-empty { height: 100%; min-height: 320px; display: grid; place-content: center; justify-items: center; gap: var(--s3); padding: var(--s5);
  text-align: center; border: 1px solid var(--line); border-radius: var(--r-card); }
.cht-empty p { max-width: 36ch; }

/* ---------- Desktop: zwei Spalten ---------- */
@media (min-width: 1024px) {
  .page--chat, .page--chat-conv { padding-bottom: var(--s7); }
  .page--chat.view-in { animation: none; }
  .cht, .cht--conv { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--s5); height: calc(100dvh - 2 * var(--s7)); min-height: 520px; }
  .cht--list .cht-main, .cht--conv .cht-main { display: block; min-height: 0; animation: view-in var(--dur-view) var(--ease-out) both; }
  .cht--conv .cht-side, .cht-side { display: flex; min-height: 0; }
  .cht-side .vh__title { font-size: var(--fs-xl); }
  .cht-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .cht-back { display: none; }
  .cht .chat { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
  .cht-top { padding: var(--s3) var(--s4); }
  .cht .msgs { padding: var(--s4); }
  .cht-foot { padding: var(--s3); }
}
