/* =====================================================================
   style.css — Pilot. Modernes Chat-Tool im Stil von ChatGPT/Claude.
   Türkis-Akzent, Liquid-Glass, lokale Schriften (Inter + Fraunces kursiv).
   Dependency-frei. Echte deutsche Umlaute durchgängig.
   ===================================================================== */

/* ── Lokale Schriften ─────────────────────────────────────────────── */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/inter-700.woff2") format("woff2");
}
/* Fraunces gibt es hier NUR kursiv — als Marken-/Akzentschrift. */
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/fraunces-italic-400.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("fonts/fraunces-italic-500.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 600; font-display: swap;
  src: url("fonts/fraunces-italic-600.woff2") format("woff2");
}

/* ── Design-Tokens ────────────────────────────────────────────────── */
:root {
  --tuerkis:        #0097b2;
  --tuerkis-hell:   #00b8d9;
  --tuerkis-dunkel: #007a91;
  --tuerkis-tief:   #005d6e;

  --bg:             #fafbfc;
  --bg-tief:        #eef2f5;
  --karte:          #ffffff;
  --du-blase:       #e3f7fb;   /* zarter Türkis-Ton für eigene Nachrichten */
  --du-rand:        #b7e8f1;

  --text:           #14202b;
  --text-leise:     #5d6b78;
  --text-zart:      #8a97a3;
  --rand:           #e4e9ee;
  --rand-zart:      #eef1f4;

  --glas:           rgba(255, 255, 255, 0.72);
  --glas-rand:      rgba(255, 255, 255, 0.55);

  --radius:         16px;
  --radius-klein:   12px;
  --radius-blase:   18px;

  --schatten-klein: 0 1px 2px rgba(16, 38, 52, 0.06);
  --schatten:       0 6px 22px rgba(16, 38, 52, 0.09);
  --schatten-gross: 0 18px 50px rgba(16, 38, 52, 0.18);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Menlo", "Cascadia Code", "Consolas", monospace;

  --seite-breite: 280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

/* [hidden] muss IMMER gewinnen — sonst überschreibt z.B. display:grid das
   eingebaute display:none des hidden-Attributs (klassische Falle). */
[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;            /* nur die inneren Bereiche scrollen */
}

/* Marken-/Akzentschrift: jedes <em> in Marken-/Überschriftskontext wird
   zur eleganten kursiven Fraunces. */
.marke-wort, .dialog-titel em, .willkommen .will-text em,
.willkommen h2 em { font-family: var(--serif); font-style: italic; }

/* ====================================================================
   App-Gerüst
   ==================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--seite-breite) 1fr;
  height: 100dvh;
  background:
    radial-gradient(1200px 700px at -10% -20%, rgba(0, 184, 217, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 110% 120%, rgba(0, 122, 145, 0.08), transparent 55%),
    var(--bg);
}

/* ── Seitenleiste (Liquid Glass) ─────────────────────────────────── */
.seitenleiste {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
  padding-top: max(16px, env(safe-area-inset-top));
  background: var(--glas);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-right: 1px solid var(--glas-rand);
  box-shadow: 1px 0 0 rgba(16, 38, 52, 0.03);
  z-index: 30;
}

.marke {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
}
.marke-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis-dunkel));
  box-shadow: 0 4px 12px rgba(0, 122, 145, 0.34);
}
.marke-wort {
  font-size: 1.5rem;
  font-weight: 600;     /* Fraunces italic */
  letter-spacing: 0.01em;
  color: var(--tuerkis-dunkel);
  line-height: 1;
}

.neu-knopf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 0.94rem;
  color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis));
  border: none;
  border-radius: var(--radius-klein);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 151, 178, 0.32);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}
.neu-knopf:hover  { filter: brightness(1.04); box-shadow: 0 6px 18px rgba(0, 151, 178, 0.4); }
.neu-knopf:active { transform: translateY(1px); }

.themen-kopf {
  margin: 18px 8px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-zart);
}

.themen {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--rand) transparent;
}
.themen::-webkit-scrollbar { width: 8px; }
.themen::-webkit-scrollbar-thumb { background: var(--rand); border-radius: 8px; }

.thema {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-leise);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background .12s ease, color .12s ease;
  position: relative;
}
.thema:hover { background: rgba(0, 151, 178, 0.07); color: var(--text); }
.thema.aktiv {
  background: #fff;
  color: var(--text);
  border-color: var(--rand);
  box-shadow: var(--schatten-klein);
  font-weight: 500;
}
.thema-titel {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thema-loeschen {
  flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border: none; background: transparent;
  color: var(--text-zart);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.thema:hover .thema-loeschen,
.thema.aktiv .thema-loeschen { opacity: 1; }
.thema-loeschen:hover { background: rgba(210, 63, 63, 0.12); color: #c63030; }

.themen-leer {
  margin: 10px;
  font-size: 0.85rem;
  color: var(--text-zart);
}

.seitenleiste-fuss {
  padding: 12px 6px 2px;
  border-top: 1px solid var(--rand-zart);
  margin-top: 8px;
}
.leise-link {
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-leise);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 4px;
}
.leise-link:hover { color: var(--tuerkis-dunkel); text-decoration: underline; }

/* ====================================================================
   Gesprächsbereich
   ==================================================================== */
.gespraech {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-width: 0;
  position: relative;
}

/* Topbar (Liquid Glass) — auf Desktop minimal, auf Mobil mit Hamburger. */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  height: calc(56px + env(safe-area-inset-top));
  background: var(--glas);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--glas-rand);
  z-index: 20;
}
.topbar-titel {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  text-align: center;
}
.icon-knopf {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: none; background: transparent;
  color: var(--text-leise);
  border-radius: 10px;
  cursor: pointer;
}
.icon-knopf:hover { background: rgba(0, 151, 178, 0.08); color: var(--tuerkis-dunkel); }
.nur-mobil { display: none; }

/* Nachrichten-Strom */
.strom {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 24px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--rand) transparent;
}
.strom::-webkit-scrollbar { width: 10px; }
.strom::-webkit-scrollbar-thumb { background: var(--rand); border-radius: 10px; }
.strom::-webkit-scrollbar-thumb:hover { background: #d3dae0; }

/* ── Willkommen / leerer Zustand ─────────────────────────────────── */
.willkommen {
  max-width: 720px;
  margin: 0 auto;
  padding: 7vh 24px 24px;
  text-align: center;
  animation: auftauchen .5s ease both;
}
.will-icon {
  display: inline-grid; place-items: center;
  width: 68px; height: 68px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis-dunkel));
  box-shadow: 0 12px 30px rgba(0, 122, 145, 0.34);
  margin-bottom: 20px;
}
.willkommen h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.will-text {
  margin: 0 auto 26px;
  max-width: 480px;
  color: var(--text-leise);
  font-size: 1.02rem;
}
.will-text em { color: var(--tuerkis-dunkel); font-style: italic; }

.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}
.chip {
  text-align: left;
  padding: 13px 15px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--schatten-klein);
  transition: transform .1s ease, border-color .15s ease, box-shadow .2s ease;
  line-height: 1.4;
}
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--tuerkis-hell);
  box-shadow: 0 8px 20px rgba(0, 151, 178, 0.14);
}

/* ── Nachrichten-Reihen ───────────────────────────────────────────── */
.reihe {
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 24px;
  display: flex;
  animation: auftauchen .32s ease both;
}
.reihe.du   { justify-content: flex-end; }
.reihe.pilot{ justify-content: flex-start; }

.blase {
  max-width: 86%;
  border-radius: var(--radius-blase);
  padding: 12px 16px;
  font-size: 1rem;
  position: relative;
}
/* Eigene Nachricht: rechts, türkis-getönt */
.reihe.du .blase {
  background: var(--du-blase);
  border: 1px solid var(--du-rand);
  border-bottom-right-radius: 6px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Pilot-Antwort: links, weiße Karte */
.reihe.pilot .blase {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-bottom-left-radius: 6px;
  box-shadow: var(--schatten);
  max-width: 100%;
  width: 100%;
}

/* Pilot-Kopfzeile (kleines Logo + Name) */
.pilot-kopf {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tuerkis-dunkel);
}
.pilot-kopf .punkt-icon {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 6px; color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis-dunkel));
}

/* Tipp-Cursor während Streaming */
.tipp-cursor {
  display: inline-block;
  width: 7px; height: 1.05em;
  margin-left: 1px;
  vertical-align: -2px;
  background: var(--tuerkis);
  border-radius: 2px;
  animation: blinken 1s steps(2) infinite;
}
@keyframes blinken { 0%,50%{opacity:1} 50.01%,100%{opacity:0} }

/* "denkt nach"-Punkte vor dem ersten Token */
.denkt {
  display: inline-flex; gap: 4px; padding: 2px 0;
}
.denkt span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tuerkis-hell);
  animation: huepfen 1.1s ease-in-out infinite;
}
.denkt span:nth-child(2) { animation-delay: .15s; }
.denkt span:nth-child(3) { animation-delay: .3s; }
@keyframes huepfen {
  0%,60%,100% { transform: translateY(0); opacity: .45; }
  30%         { transform: translateY(-5px); opacity: 1; }
}

/* Live-Status-Zeile ("📄 Liest Datei …") während eines laufenden Auftrags.
   Zeigt, dass Assist gerade arbeitet — kein "leeres Fenster" mehr. */
.fortschritt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 8px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: rgba(0, 151, 178, 0.08);
  border: 1px solid rgba(0, 151, 178, 0.18);
  color: var(--tuerkis-dunkel);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  max-width: 100%;
}
.fortschritt[hidden] { display: none; }   /* hidden-Attribut muss display schlagen */
.fortschritt-punkt {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tuerkis);
  animation: pulsen 1.1s ease-in-out infinite;
}
.fortschritt-text { overflow-wrap: anywhere; }
@keyframes pulsen {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50%      { transform: scale(1);   opacity: 1; }
}

/* Aktionsleiste unter Pilot-Antworten */
.aktionen {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rand-zart);
}
.akt-knopf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-leise);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.akt-knopf:hover { background: rgba(0, 151, 178, 0.08); color: var(--tuerkis-dunkel); }
.akt-knopf.aktiv { color: var(--tuerkis-dunkel); background: rgba(0, 151, 178, 0.1); }
.akt-knopf svg { flex: none; }
.akt-knopf.geklappt { color: #1aa05a; }
/* Tempo-Knopf: zeigt die aktuelle Vorlese-Geschwindigkeit, klick = nächste */
.tempo-knopf { font-variant-numeric: tabular-nums; }
.tempo-knopf.gesetzt { color: var(--tuerkis-dunkel); }

/* Fehler-Blase */
.fehler-blase {
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #9a2c2c;
  background: #fdecec;
  border: 1px solid #f6c9c9;
  border-radius: 12px;
}

/* ====================================================================
   Markdown im Antwort-Körper
   ==================================================================== */
.md { font-size: 1rem; color: var(--text); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child  { margin-bottom: 0; }
.md p { margin: 0.7em 0; }
.md h1, .md h2, .md h3, .md h4 {
  line-height: 1.3; margin: 1.1em 0 0.5em; font-weight: 700; letter-spacing: -0.01em;
}
.md h1 { font-size: 1.5em; }
.md h2 { font-size: 1.3em; }
.md h3 { font-size: 1.12em; }
.md h4 { font-size: 1em; }
.md ul, .md ol { margin: 0.6em 0; padding-left: 1.4em; }
.md li { margin: 0.3em 0; }
.md li::marker { color: var(--tuerkis); }
.md a { color: var(--tuerkis-dunkel); text-decoration: underline; text-underline-offset: 2px; }
.md a:hover { color: var(--tuerkis); }
.md strong { font-weight: 700; }
.md hr { border: none; border-top: 1px solid var(--rand); margin: 1.4em 0; }

.md blockquote {
  margin: 0.9em 0;
  padding: 4px 16px;
  border-left: 3px solid var(--tuerkis-hell);
  background: rgba(0, 184, 217, 0.06);
  border-radius: 0 10px 10px 0;
  color: var(--text-leise);
}
.md blockquote p { margin: 0.4em 0; }

/* Inline-Code */
.md :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: #eef3f6;
  color: #0d5566;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: 1px solid #e0e8ec;
}

/* Tabellen */
.md table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 1em 0;
  font-size: 0.92em;
  border: 1px solid var(--rand);
  border-radius: 10px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}
.md thead { background: var(--bg-tief); }
.md th {
  text-align: left;
  font-weight: 600;
  padding: 9px 13px;
  color: var(--text);
  border-bottom: 1px solid var(--rand);
  white-space: nowrap;
}
.md td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--rand-zart);
}
.md tbody tr:last-child td { border-bottom: none; }
.md tbody tr:nth-child(even) { background: #fbfcfd; }

/* ── Code-Blöcke ──────────────────────────────────────────────────── */
.code-block {
  margin: 1em 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8ec;
  background: #f6f8fa;
}
.code-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #eef2f5;
  border-bottom: 1px solid #e2e8ec;
}
.code-sprache {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-leise);
}
.code-kopieren {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-leise);
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: 7px;
  cursor: pointer;
  transition: all .12s ease;
}
.code-kopieren:hover { color: var(--tuerkis-dunkel); border-color: var(--tuerkis-hell); background: #fff; }
.code-kopieren.geklappt { color: #1aa05a; border-color: #b6e3c8; background: #f1faf4; }
.code-block pre {
  margin: 0;
  padding: 14px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.55;
  background: #f6f8fa;
}
.code-block pre code { font-family: var(--mono); background: none; padding: 0; border: none; }

/* ====================================================================
   Eingabe-Leiste (Composer)
   ==================================================================== */
.composer-huelle {
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 55%, rgba(250, 251, 252, 0));
}
.composer {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 8px 10px;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 24px;
  box-shadow: var(--schatten);
  transition: border-color .15s ease, box-shadow .2s ease;
}
.composer:focus-within {
  border-color: var(--tuerkis-hell);
  box-shadow: 0 6px 22px rgba(0, 151, 178, 0.16);
}
/* sichtbarer Hinweis beim Bild-Reinziehen */
.composer.zieht-drueber {
  border-color: var(--tuerkis);
  box-shadow: 0 6px 22px rgba(0, 151, 178, 0.22);
  background: rgba(0, 151, 178, 0.04);
}
/* die eigentliche Eingabe-Zeile (Anhängen + Textfeld + Senden) */
.composer-zeile {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
/* Werkzeug-Knopf (Anhängen) — schlichter Geist-Knopf links */
.werkzeug-knopf {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  color: var(--text-leise);
  background: transparent;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .08s ease;
}
.werkzeug-knopf:hover { background: rgba(0, 151, 178, 0.08); color: var(--tuerkis-dunkel); }
.werkzeug-knopf:active { transform: scale(0.94); }

/* „Second Brain"-Schalter (🧠): blass im Aus-Zustand, deutlich umrandet wenn an */
.sb-knopf .sb-emoji {
  font-size: 19px; line-height: 1;
  filter: grayscale(0.4); opacity: 0.65;
  transition: filter .12s ease, opacity .12s ease;
}
.sb-knopf:hover .sb-emoji { filter: grayscale(0); opacity: 1; }
.sb-knopf.aktiv {
  background: rgba(0, 151, 178, 0.12);
  box-shadow: inset 0 0 0 1.5px rgba(0, 151, 178, 0.45);
}
.sb-knopf.aktiv .sb-emoji { filter: grayscale(0); opacity: 1; }

/* Anhang-Vorschau-Streifen oben im Composer */
.anhaenge {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 6px 10px;
}
.anhang {
  position: relative;
  width: 60px; height: 60px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rand);
  background: var(--bg-zart, #f0f2f4);
  flex: none;
}
.anhang img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anhang.laedt::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.55);
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
}
.anhang-weg {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(20, 28, 33, 0.72);
  color: #fff; cursor: pointer; padding: 0;
  line-height: 0;
}
.anhang-weg:hover { background: rgba(20, 28, 33, 0.9); }
.anhang-fehler {
  outline: 2px solid #e0584e;
  outline-offset: -2px;
}

/* Angehängte Bilder in der Nutzer-Sprechblase */
.blase-bilder {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.blase-bilder:last-child { margin-bottom: 0; }
.blase-bild {
  display: block;
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: zoom-in;
}
.eingabe {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
  max-height: 200px;
  padding: 8px 0;
  scrollbar-width: thin;
}
.eingabe::placeholder { color: var(--text-zart); }
.senden {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis));
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 151, 178, 0.34);
  transition: transform .08s ease, filter .15s ease, opacity .15s ease;
}
.senden:hover:not(:disabled) { filter: brightness(1.06); }
.senden:active:not(:disabled){ transform: scale(0.94); }
.senden:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.composer-fuss {
  max-width: 760px;
  margin: 6px auto 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-zart);
}

/* ====================================================================
   Zugangs-Schlüssel-Dialog
   ==================================================================== */
.dialog-huelle {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(0, 184, 217, 0.16), transparent 60%),
    rgba(20, 32, 43, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 100;
  animation: auftauchen .25s ease both;
}
.dialog {
  width: 100%;
  max-width: 400px;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 22px;
  box-shadow: var(--schatten-gross);
  padding: 30px 28px 26px;
  text-align: center;
}
.dialog-icon {
  display: inline-grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 17px; color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis-dunkel));
  box-shadow: 0 10px 24px rgba(0, 122, 145, 0.34);
  margin-bottom: 14px;
}
.dialog-titel {
  margin: 0 0 6px;
  font-size: 1.7rem;
  color: var(--tuerkis-dunkel);
  font-weight: 500;
}
.dialog-titel em { font-style: italic; }
.dialog-text {
  margin: 0 0 18px;
  color: var(--text-leise);
  font-size: 0.92rem;
}
#schluessel-eingabe {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 13px 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rand);
  border-radius: 13px;
  text-align: center;
}
#schluessel-eingabe:focus {
  outline: none;
  border-color: var(--tuerkis-hell);
  box-shadow: 0 0 0 3px rgba(0, 184, 217, 0.18);
}
.dialog-fehler {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: #c63030;
}
.dialog-knopf {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--tuerkis-hell), var(--tuerkis));
  border: none;
  border-radius: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 151, 178, 0.32);
  transition: filter .15s ease, transform .08s ease;
}
.dialog-knopf:hover  { filter: brightness(1.05); }
.dialog-knopf:active { transform: translateY(1px); }

/* Abdunkelung hinter mobiler Seitenleiste */
.scrim {
  position: fixed; inset: 0;
  background: rgba(20, 32, 43, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 25;
  animation: auftauchen .2s ease both;
}

/* ── Animationen ──────────────────────────────────────────────────── */
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dreht { animation: drehen .8s linear infinite; transform-origin: 50% 50%; }
@keyframes drehen { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .strom { scroll-behavior: auto; }
}

/* ====================================================================
   Mobil — Seitenleiste als ausklappbares Panel
   ==================================================================== */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .nur-mobil { display: grid; }

  .seitenleiste {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 320px);
    transform: translateX(-104%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--schatten-gross);
    will-change: transform;
  }
  .app.menue-auf .seitenleiste { transform: translateX(0); }

  .topbar-titel { text-align: center; }

  .reihe, .willkommen, .composer, .composer-fuss { padding-left: 14px; padding-right: 14px; }
  .reihe .blase { max-width: 90%; }
  .reihe.pilot .blase { max-width: 100%; }
  .chips { grid-template-columns: 1fr; max-width: 420px; }
  .willkommen { padding-top: 5vh; }

  /* Größere Touch-Ziele */
  .thema { padding: 12px 12px; }
  .thema-loeschen { opacity: 1; }
}

@media (min-width: 821px) {
  .scrim { display: none !important; }
}
