:root {
  --bg: #0f1216; --panel: #171b21; --panel2: #1e232b; --line: #2a313b;
  --txt: #e7ecf2; --muted: #8b95a3; --accent: #ff5c8a; --cleo: #6ea8fe;
  --code-bg: #0b0e12; --ok: #3ddc84; --warn: #ffb020;
}
* { box-sizing: border-box; }
/* hidden-Attribut gewinnt IMMER — auch gegen display:flex-Regeln (Stopp-Button-Bug 2026-07-08) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  display: flex; flex-direction: column;
}

/* Kopfleiste */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand small { color: var(--muted); font-weight: 400; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); margin-right: 4px; vertical-align: middle; transition: background .3s; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--accent); }

/* Sessions */
.sessionbox { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 220px; justify-content: center; }
.sessionbox select {
  background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 6px 10px; font-size: 14px; max-width: 260px; min-width: 130px;
}
.sessionbox select:focus { outline: 2px solid var(--cleo); border-color: transparent; }
.icon {
  background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; width: 34px; height: 34px; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, transform .1s;
}
.icon:hover { border-color: var(--cleo); }
.icon:active { transform: scale(.92); }

/* Name + Farbe */
.namefield { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.namefield input[type="text"] {
  background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 6px 10px; width: 130px; font-size: 14px;
}
.namefield input[type="text"]:focus { outline: 2px solid var(--cleo); border-color: transparent; }
/* (Farb-Auswahl: eigener Swatch-Button + Hue-Ring — colorwheel.css/.js) */

/* Chatverlauf */
.chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg {
  max-width: min(78%, 720px); padding: 10px 14px; border-radius: 14px;
  background: var(--panel2); border: 1px solid var(--line);
  animation: msg-in .28s ease-out both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #1d242c; border-left: 3px solid var(--line); }
.msg.cleo { align-self: flex-start; border-left: 3px solid var(--cleo); }
.msg.cleo .who b { color: var(--cleo); }
.msg.system { align-self: center; background: transparent; border: none; color: var(--muted); font-size: 13px; font-style: italic; animation: msg-in .3s ease-out both; }
.time { color: var(--muted); font-size: 11px; }

/* Emotion/Memory/Sources-Badges */
.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); animation: badge-in .4s ease-out both; }
.badge.emo { border-color: var(--cleo); color: var(--cleo); }
.mem { cursor: help; }
@keyframes badge-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

/* Code-Block */
.code { margin: 8px 0 2px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.code .chead { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; background: #12161c; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.code .copy { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.code .copy:hover { border-color: var(--cleo); }
.code pre { margin: 0; padding: 12px; overflow-x: auto; }
.code code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #d6e2f0; }

/* Media */
.media img, .media video { max-width: 100%; border-radius: 10px; margin-top: 8px; display: block; }
.media audio { width: 100%; margin-top: 8px; }
.media .cap { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── KI-Aktivität: Typing-Bubble mit Stage-Text ── */
.aibubble {
  align-self: flex-start; max-width: min(78%, 720px);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px; background: var(--panel2);
  border: 1px solid var(--line); border-left: 3px solid var(--cleo);
  animation: msg-in .25s ease-out both;
}
.aibubble .avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--cleo), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #0f1216;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(110,168,254,.45);} 50% { box-shadow: 0 0 0 8px rgba(110,168,254,0);} }
.aibubble .stage { font-size: 13px; color: var(--muted); }
.aibubble .stage b { color: var(--cleo); font-weight: 600; }
.aibubble .tdots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.aibubble .tdots span { width: 6px; height: 6px; border-radius: 50%; background: var(--cleo); animation: blink 1.2s infinite both; }
.aibubble .tdots span:nth-child(2) { animation-delay: .2s; }
.aibubble .tdots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.aibubble .memflash { font-size: 12px; color: var(--cleo); animation: badge-in .4s ease-out both; }

/* Typewriter-Cursor während Cleo „schreibt" */
.typing-caret::after { content: "▌"; color: var(--cleo); animation: blink 1s infinite; }

/* Eingabe */
.composer { display: flex; gap: 10px; padding: 12px 14px; background: var(--panel); border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1; resize: none; max-height: 160px; background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit;
}
.composer textarea:focus { outline: 2px solid var(--cleo); border-color: transparent; }
.composer button {
  min-width: 52px; border: none; border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-size: 20px; cursor: pointer; transition: transform .1s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.composer button:hover { filter: brightness(1.08); }
.composer button:active { transform: scale(.94); }
.composer button:disabled { opacity: .5; cursor: not-allowed; }

/* ── SVG-Tool-Icons (icons.js) — ersetzen die alten Emoji/ASCII-Glyphen ── */
svg.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: middle; flex: 0 0 auto; pointer-events: none; }
.icon svg.ico { width: 1.2em; height: 1.2em; }
.composer button svg.ico { width: 1.25em; height: 1.25em; }
.scrolldown, .stopbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ── Politur: Glas-Header, Emotions-Glow, Avatar, Pill, Toast, Shimmer, Tippen ── */
.bar { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--panel) 86%, transparent); }

/* Emotions-Glow (2026-07-08, Andi-Wunsch — ersetzt die alte „konstant blau"-Regel):
   JS setzt --emo (Farbe) + --emo-a (Alpha aus der Intensität) an .msg.cleo;
   Streifen + weicher Schein färben sich mit, Grundfläche bleibt Panel. Statisch, kein Dauer-Effekt. */
.msg.cleo { border-left-color: var(--emo, var(--cleo)); position: relative; }
.msg.cleo.glow {
  box-shadow: 0 0 18px color-mix(in srgb, var(--emo, var(--cleo)) calc(var(--emo-a, 0.2) * 100%), transparent);
  transition: box-shadow .6s ease;
}
.badge.emo { border-color: var(--cleo); color: var(--cleo); }

/* Cleo-Avatar an ihren Nachrichten */
.cavatar {
  width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #0f1216;
  background: linear-gradient(135deg, var(--emo, var(--cleo)), var(--accent));
}

/* „↓ neue Nachricht"-Pill */
.scrolldown {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%);
  background: var(--cleo); color: #0f1216; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; z-index: 6;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: msg-in .25s ease-out both;
}

/* Toast (Verbindung etc.) */
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 16px; font-size: 13px; z-index: 9; animation: msg-in .25s ease-out both;
}
.toast.ok { border-color: var(--ok); } .toast.bad { border-color: var(--accent); }

/* ── Chat-Ansichten (Toggle 🎭/💬/📜) ── */
/* Messenger: nur ICH rechts, alle anderen (inkl. Cleo) links */
body[data-view="me"] .msg.user { align-self: flex-start; background: var(--panel2); }
body[data-view="me"] .msg.user.mine { align-self: flex-end; background: #1d242c; }
/* Transkript: alles links, volle Breite, kompakt */
body[data-view="transcript"] .msg { align-self: flex-start; max-width: 100%; border-radius: 8px; }
body[data-view="transcript"] .msg.user { background: var(--panel2); }
body[data-view="transcript"] .aibubble { max-width: 100%; }

/* Modell-Status-Banner */
.modelbanner {
  padding: 8px 16px; text-align: center; font-size: 13.5px;
  background: color-mix(in srgb, var(--warn) 16%, var(--panel));
  border-bottom: 1px solid var(--warn); color: var(--txt);
}
.modelbanner.aus { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border-color: var(--accent); }
.modelbanner .spin {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--warn); border-top-color: transparent; border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ON-AIR-Schild (2026-07-08, ersetzt den Shimmer-Balken — Effekt-Budget) ── */
.onair {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  opacity: .55; transition: opacity .3s, color .3s, border-color .3s;
  user-select: none; white-space: nowrap;
}
.onair-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.onair.on {
  opacity: 1; color: #ff453a; border-color: #ff453a;
  animation: onair-pulse 1.6s ease-in-out infinite;
}
@keyframes onair-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 69, 58, .35); }
  50%      { box-shadow: 0 0 16px rgba(255, 69, 58, .75); }
}
:root[data-theme="light"] .onair.on { color: #d70015; border-color: #d70015; }
/* Kamera-Transparenz-Pille (K2): sichtbar für ALLE, solange die Studio-Kamera an ist */
.kamerapille { opacity: 1; color: var(--accent); border-color: var(--accent); animation: none; }

/* Empty-State für frische Sessions */
.empty {
  align-self: center; margin-top: 8vh; text-align: center; color: var(--muted);
  animation: msg-in .4s ease-out both;
}
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* „X tippt…"-Leiste über dem Eingabefeld */
.typingbar { padding: 0 18px 4px; font-size: 12.5px; color: var(--muted); min-height: 20px; display: flex; align-items: center; gap: 6px; }
.typingbar .tdots { display: inline-flex; gap: 3px; }
.typingbar .tdots span { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typingbar .tdots span:nth-child(2) { animation-delay: .2s; }
.typingbar .tdots span:nth-child(3) { animation-delay: .4s; }

/* ── A11y-Paket ── */
.icon { width: 44px; height: 44px; }                 /* Touch-Soll ≥44px */
.namefield input[type="text"], .sessionbox select { font-size: 1rem; }  /* kein iOS-Zoom */
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--hp-gelb); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Hirnparade-Akzente (aus dem Styleguide) ── */
:root { --hp-gelb: #f1c11f; --hp-lila: #9458c4; }
.brand .dot.on { background: var(--hp-gelb); }
.empty .big { filter: drop-shadow(0 0 12px var(--hp-lila)); }

/* ── Präsenz (wer ist online) ── */
.presence { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.presence .p { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px 2px 4px; }
.presence .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* ── Datum-Trenner ── */
.datesep { align-self: center; color: var(--muted); font-size: 12px; padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); }

/* ── Nachrichten-Gruppierung (Folge-Bubble gleicher Sprecher) ── */
.msg.compact { margin-top: -8px; border-top-left-radius: 6px; border-top-right-radius: 6px; }
.msg.compact .who { display: none; }

/* ── Links in Nachrichten ── */
.body a { color: var(--cleo); text-decoration: underline; }
.msg .body { cursor: pointer; }                       /* Klick = zitieren */

/* ── Modal ── */
#cleoModal { display: none; }
#cleoModal.open { display: block; }
#cleoModal .m-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; }
#cleoModal .m-box {
  position: fixed; top: 24vh; left: 50%; transform: translateX(-50%); z-index: 101;
  width: min(92vw, 380px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; animation: msg-in .2s ease-out both;
}
#cleoModal h3 { margin: 0 0 8px; font-size: 16px; }
#cleoModal .m-text { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
#cleoModal .m-input { width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 10px; padding: 10px 12px; font-size: 1rem; margin-bottom: 14px; }
#cleoModal .m-actions { display: flex; gap: 10px; justify-content: flex-end; }
#cleoModal button { border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); min-height: 44px; }
#cleoModal .m-ok { background: var(--cleo); color: #0f1216; border: none; font-weight: 600; }
#cleoModal .m-ok.danger { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .msg { max-width: 90%; }
  .namefield input[type="text"] { width: 100px; }
  .sessionbox { order: 3; width: 100%; }
  .presence { order: 4; width: 100%; }
}

/* ── Nachrichten-Feedback (Markieren → Trainingsdaten) ── */
.fb-flag {
  margin-left: auto; background: transparent; border: none; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 6px; border-radius: 8px; color: var(--muted);
  opacity: .3; transition: opacity .15s, background .15s; min-width: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
}
.fb-flag svg.ico { width: 14px; height: 14px; }
.fb-flagn { font-size: 11px; font-weight: 700; }
.msg:hover .fb-flag, .fb-flag:focus-visible { opacity: 1; }
.fb-flag:hover { background: var(--panel2); color: var(--txt); }
.msg.annotated { box-shadow: inset 3px 0 0 var(--warn); }
.msg.annotated .fb-flag { opacity: 1; color: var(--warn); }

#fbModal { display: none; }
#fbModal.open { display: block; }
#fbModal .m-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; }
#fbModal .fb-box {
  position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
}
#fbModal h3 { margin: 0 0 12px; font-size: 16px; }
.fb-target {
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--cleo);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--muted);
  margin-bottom: 6px; max-height: 90px; overflow-y: auto; white-space: pre-wrap;
}
.fb-label { font-size: 13px; color: var(--txt); margin: 12px 0 6px; }
.fb-label small { color: var(--muted); font-weight: 400; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip {
  font-size: 13px; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); color: var(--muted);
  min-height: 40px; transition: all .12s;
}
.fb-chip:hover { border-color: var(--cleo); color: var(--txt); }
.fb-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fb-ta {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 9px 11px; font-size: 14px; font-family: inherit; resize: vertical;
}
.fb-ta:focus { outline: 2px solid var(--cleo); border-color: transparent; }
#fbModal .m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
#fbModal .m-actions button {
  border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); color: var(--txt); min-height: 44px;
}
#fbModal .m-ok { background: var(--cleo); color: #0f1216; border: none; font-weight: 600; }

/* ── Feedback-Liste (Verwaltung) ── */
#fbListModal { display: none; }
#fbListModal.open { display: block; }
#fbListModal .m-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; }
#fbListModal .fb-list-box {
  position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.fb-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fb-list-head h3 { margin: 0; font-size: 16px; }
.fbl-close { min-width: 40px; min-height: 40px; }
.fb-list { overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.fb-empty { color: var(--muted); text-align: center; padding: 24px; }
.fb-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel2); }
.fb-item-head { font-size: 13px; margin-bottom: 4px; }
.fb-muted { color: var(--muted); font-weight: 400; }
.fb-item-quote { font-size: 13px; color: var(--muted); font-style: italic; border-left: 2px solid var(--cleo); padding-left: 8px; margin: 4px 0 8px; }
.fb-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fb-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.fb-item-note { font-size: 13px; margin: 2px 0; }
.fb-item-besser { font-size: 13px; margin: 2px 0; color: var(--ok); }
.fb-item-act { display: flex; gap: 8px; margin-top: 8px; }
.fb-mini { font-size: 12px; padding: 6px 12px; min-height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); cursor: pointer; }
.fb-mini:hover { border-color: var(--cleo); }
.fb-mini.danger { color: var(--accent); }

/* ── Mehrfach-Auswahl (mehrere Nachrichten markieren) ── */
body.selecting .fb-flag { display: none; }
body.selecting .msg:not(.system) { cursor: pointer; }
body.selecting .msg:not(.system):hover { outline: 1px dashed var(--cleo); outline-offset: 2px; }
.msg.fb-selected { position: relative; outline: 2px solid var(--cleo); outline-offset: 2px; }
.msg.fb-selected::after {
  content: '✓'; position: absolute; top: 6px; right: 8px;
  background: var(--cleo); color: #0f1216; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
#fbMulti.on { border-color: var(--cleo); background: var(--cleo); color: #0f1216; }
#fbSelBar {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 25;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--cleo); border-radius: 999px;
  padding: 8px 10px 8px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
#fbSelBar[hidden] { display: none; }
.fbsel-count { font-size: 14px; color: var(--txt); white-space: nowrap; }
#fbSelBar button { border-radius: 999px; padding: 8px 14px; font-size: 14px; min-height: 40px; cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); }
.fbsel-go { background: var(--cleo) !important; color: #0f1216 !important; border: none !important; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.fbsel-go:disabled { opacity: .5; cursor: not-allowed; }

/* Admin: Feedback-Zusammenfassung (welche Fehler häufen sich) */
.fbsummary { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.fbchip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); }

/* Stopp-Button (Cleo-Animation überspringen / Generierung abbrechen) */
.stopbtn {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 15;
  background: var(--panel2); border: 1px solid var(--accent); color: var(--accent);
  border-radius: 999px; padding: 8px 16px; min-height: 40px; font-size: 13px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); transition: background .15s, color .15s;
}
.stopbtn:hover, .stopbtn:focus-visible { background: var(--accent); color: #fff; outline: none; }

/* Emoji-Reaktionen */
.react-add { background: transparent; border: none; cursor: pointer; font-size: 13px; line-height: 1; padding: 6px; border-radius: 8px; opacity: .3; min-width: 32px; min-height: 32px; transition: opacity .15s, background .15s; }
.msg:hover .react-add, .react-add:focus-visible { opacity: 1; }
.react-add:hover { background: var(--panel2); }
body.selecting .react-add { display: none; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reactions:empty { display: none; }
.react-pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); min-height: 26px; }
.react-pill:hover { border-color: var(--cleo); }
.react-pill.mine { border-color: var(--cleo); background: rgba(110,168,254,.18); color: var(--cleo); }
.react-palette { position: fixed; z-index: 40; display: flex; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.react-opt { background: transparent; border: none; cursor: pointer; font-size: 20px; padding: 4px 6px; border-radius: 8px; min-height: 40px; transition: transform .1s, background .1s; }
.react-opt:hover { background: var(--panel2); transform: scale(1.15); }

/* Chat etwas größer & luftiger (Andi 2026-07-07) */
.chat { padding: 20px; gap: 15px; }
.msg { max-width: min(85%, 840px); padding: 13px 17px; border-radius: 15px; }
.msg .body { font-size: 1.05rem; line-height: 1.6; }
.msg .who { font-size: 13px; }
.time { font-size: 12px; }
.composer textarea { font-size: 16px; }
.aibubble { max-width: min(85%, 840px); }
body[data-view="transcript"] .msg { max-width: 100%; }
@media (max-width: 640px) { .chat { padding: 12px; } .msg { max-width: 92%; } }

/* ── Effekte-Paket 2026-07-08: Präsenz-Pop · Sende-Schwung · Reaktions-Physik ── */

/* Präsenz-Chips ploppen elastisch rein (nur NEUE Chips bekommen .new vom JS) */
@keyframes pop-in {
  0% { opacity: 0; transform: scale(.6); }
  70% { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
.presence .p.new { animation: pop-in .28s ease-out both; }

/* Eigene Nachricht springt beim Absenden leicht */
@keyframes sent-bounce {
  0% { transform: translateY(6px) scale(.985); }
  60% { transform: translateY(-2px) scale(1.005); }
  100% { transform: none; }
}
.msg.sent-bounce { animation: sent-bounce .28s ease-out both; }

/* Reaktions-Flug: Emoji-Klon fliegt von der Palette zur Nachricht (JS setzt Start/Ziel) */
.react-fly {
  position: fixed; z-index: 50; font-size: 20px; pointer-events: none;
  transition: transform .35s cubic-bezier(.2, .7, .3, 1.1), opacity .35s ease;
  will-change: transform, opacity;
}

/* Mini-Konfetti bei 🎉 (Hirnparade-Farben, JS erzeugt/entfernt die Partikel) */
.confetti {
  position: absolute; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; z-index: 5;
  opacity: 0; transform: translate(0, 0) rotate(0deg);
  transition: transform .7s cubic-bezier(.15, .6, .35, 1), opacity .7s ease-out;
  will-change: transform, opacity;
}

/* S1: Mikro-Button während der Aufnahme — roter Puls */
#micBtn.recording { color: #ff3b30; border-color: #ff3b30; }
#micBtn.recording svg { animation: onair-pulse 1.2s ease-in-out infinite; }

/* ── Toggle-Status SICHTBAR (UI-Audit 08.07.): AN = gefüllt + Punkt, AUS = gedimmt ──
   Greift für alle Schalter mit aria-pressed (Stimme/Lautsprecher/Kamera/Vorlesen/Sound),
   nie für Aktions-Buttons ohne aria-pressed. */
.icon[aria-pressed] { position: relative; opacity: .55; transition: opacity .2s, background-color .2s, border-color .2s, color .2s; }
.icon[aria-pressed]:hover, .icon[aria-pressed]:focus-visible { opacity: .85; }
.icon[aria-pressed="true"] {
  opacity: 1;
  color: var(--cleo);
  border-color: var(--cleo);
  background: color-mix(in srgb, var(--cleo) 15%, transparent);
}
.icon[aria-pressed="true"]::after {
  content: ""; position: absolute; right: 5px; bottom: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #2ecc71; box-shadow: 0 0 6px #2ecc71;
}
/* Privacy-Signale: Kamera + Studio-Lautsprecher AN = Hirnparade-Gelb (fällt auf — gewollt) */
#kameraBtn[aria-pressed="true"], #lautsprecherBtn[aria-pressed="true"] {
  color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
#kameraBtn[aria-pressed="true"]::after, #lautsprecherBtn[aria-pressed="true"]::after {
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
}
/* Aufnahme-Puls (micBtn.recording) behält Vorrang vor dem generischen AN-Stil */
#micBtn.recording[aria-pressed="true"] { color: #ff3b30; border-color: #ff3b30; background: color-mix(in srgb, #ff3b30 14%, transparent); }
#micBtn.recording[aria-pressed="true"]::after { background: #ff3b30; box-shadow: 0 0 6px #ff3b30; }
@media (prefers-reduced-motion: reduce) { .icon[aria-pressed] { transition: none; } }

/* K5: Kamera-Live-Vorschau (Pille-Klick) */
.kamera-vorschau { position: fixed; right: 16px; top: 64px; z-index: 55; width: min(340px, calc(100vw - 32px));
  background: var(--panel2, #191d24); border: 1px solid var(--accent, #f1c11f); border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.kamera-vorschau .kv-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 8px 8px 14px; font-size: .85rem; color: var(--accent, #f1c11f); }
.kamera-vorschau img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #000; }

/* VU-Meter in der Mikro-Pille */
.pegel { display: inline-block; width: 46px; height: 7px; margin-left: 6px; vertical-align: middle;
  border-radius: 4px; background: rgba(128,128,128,.25); overflow: hidden; }
.pegel span { display: block; height: 100%; width: 0%; border-radius: 4px;
  background: #2ecc71; transition: width .25s linear, background-color .3s; }

/* ── Charakter-Leiste + @-Autocomplete (kleo-chat) ── */
.charbar { display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 0; scrollbar-width: thin; }
.charchip {
  flex: 0 0 auto; border: 1px solid var(--line, #2a2f37); background: var(--panel, #171b21);
  color: var(--fg, #e8eaed); border-radius: 999px; padding: 4px 12px; font-size: .82rem;
  cursor: pointer; transition: border-color .15s, transform .1s;
}
.charchip:hover { border-color: var(--accent, #f1c11f); transform: translateY(-1px); }
.charchip:first-child { border-color: var(--accent2, #9458c4); }
.ac-box {
  position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 240px;
  background: var(--panel, #171b21); border: 1px solid var(--line, #2a2f37);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); overflow: hidden;
}
.ac-opt {
  text-align: left; padding: 9px 14px; background: none; border: 0; color: var(--fg, #e8eaed);
  cursor: pointer; font-size: .9rem;
}
.ac-opt:hover, .ac-opt:focus { background: rgba(148, 88, 196, .18); }
.charchip.aktiv {
  border-color: var(--accent, #f1c11f); background: rgba(241, 193, 31, .14);
  box-shadow: 0 0 0 1px var(--accent, #f1c11f) inset; font-weight: 600;
}
