/* Aus der Kit-Vorlage demo/chat/chat.css kopiert (_werkzeuge/chat_bauen.py), Farben aus stil.css. */
/* =========================================================
   Fitness Track — Chatfenster auf der Demo-Seite
   Übernommen von Fabian Systems (chat.css, 14.09.2026), für die helle
   Leinen-Seite angepasst (30.10.2026). Das Markup baut chat.js selbst.
   Farben kommen aus stil.css (--accent-ink, --surface, …); die Ersatzwerte
   greifen nur, falls eine Seite die Variablen nicht setzt.
   Radien: keine eigenen :root-Werte — die Seite liefert --r-*, nur die
   Sprechblase bekommt hier ihre eigene, etwas weichere Rundung.
   ========================================================= */

.fsc{
  --fsc-grund:var(--surface, #FFFFFF);
  --fsc-grund-2:var(--surface-2, #EFEAE1);
  --fsc-linie:var(--line, #E5DFD4);
  --fsc-linie-stark:var(--line-strong, #CFC6B6);
  --fsc-schrift:var(--ink, #2A2721);
  --fsc-schrift-weich:var(--ink-soft, #4F4940);
  --fsc-schrift-blass:var(--ink-faint, #7A7367);
  --fsc-akzent:var(--accent-ink, #7D6020);
  --fsc-akzent-text:var(--accent-text, #FFFFFF);
  --fsc-akzent-hell:var(--accent-ink, #7D6020);
  --fsc-akzent-hauch:var(--accent-wash, rgba(201,162,74,.14));
  --fsc-ease:var(--ease, cubic-bezier(.22,1,.36,1));
  --fsc-r-blase:12px;
  font-family:var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* ---------- Schwebender Knopf (nur auf Seiten ohne .kanal-chat) ---------- */
.fsc-blase{
  position:fixed; right:18px; bottom:18px; z-index:60;
  display:flex; align-items:center; gap:10px;
  height:50px; padding:0 18px 0 14px;
  border:0; border-radius:999px;
  background:var(--fsc-akzent); color:var(--fsc-akzent-text);
  font:inherit; font-size:.9rem; font-weight:600; cursor:pointer;
  box-shadow:var(--shadow-lift, 0 10px 30px rgba(74,73,71,.2));
  transition:transform .3s var(--fsc-ease), opacity .25s;
}
.fsc-blase svg{width:20px; height:20px; fill:currentColor; flex:none}
.fsc-blase:hover,.fsc-blase:focus-visible{transform:translateY(-2px)}
.fsc-blase[hidden]{display:none}

/* ---------------------------- Das Fenster ---------------------------- */
.fsc-fenster{
  position:fixed; right:18px; bottom:18px; z-index:71;
  display:flex; flex-direction:column;
  width:min(396px, calc(100vw - 36px));
  height:min(620px, calc(100dvh - 36px));
  background:var(--fsc-grund);
  border:1px solid var(--fsc-linie-stark); border-radius:var(--r-gross, 16px);
  box-shadow:var(--shadow-lift, 0 26px 62px rgba(74,73,71,.16));
  overflow:hidden; padding:0; /* padding ausdrücklich 0, sonst erbt das Fenster Innenabstände aus stil.css (Fund Physio 02.11.2026) */
  opacity:0; transform:translateY(14px) scale(.98); pointer-events:none;
  transition:opacity .26s var(--fsc-ease), transform .26s var(--fsc-ease);
}
.fsc[data-offen="true"] .fsc-fenster{opacity:1; transform:none; pointer-events:auto}
.fsc[data-offen="true"] ~ .kanal-chat,.fsc[data-offen="true"] .fsc-blase{opacity:0; pointer-events:none}

/* ---------------------------- Kopfzeile ---------------------------- */
.fsc-kopf{
  display:flex; align-items:center; gap:12px;
  padding:14px 12px 14px 18px;
  border-bottom:1px solid var(--fsc-linie);
  background:var(--fsc-grund-2);
}
.fsc-kopf .fsc-zeichen{
  width:34px; height:34px; flex:none; border-radius:var(--r-feld, 6px);
  display:grid; place-items:center;
  background:var(--fsc-akzent-hauch); border:1px solid var(--fsc-linie-stark);
}
.fsc-kopf .fsc-zeichen svg{width:19px; height:19px; fill:var(--fsc-akzent)}
.fsc-titel{min-width:0; line-height:1.25}
.fsc-titel b{display:block; font-size:.97rem; font-weight:600; color:var(--fsc-schrift)}
.fsc-titel small{display:flex; align-items:center; gap:6px; font-size:.76rem; color:var(--fsc-schrift-blass); font-weight:400}
.fsc-titel small::before{content:""; width:6px; height:6px; border-radius:50%; background:var(--good, #3E8E6B); flex:none}
.fsc-werkzeuge{margin-left:auto; display:flex; gap:2px}
.fsc-werkzeuge button{
  width:34px; height:34px; display:grid; place-items:center;
  border:0; border-radius:var(--r-fein, 4px); background:transparent; cursor:pointer;
  color:var(--fsc-schrift-blass); font-size:1.15rem; line-height:1;
  transition:background .2s, color .2s;
}
.fsc-werkzeuge button:hover{background:var(--fsc-akzent-hauch); color:var(--fsc-schrift)}
.fsc-werkzeuge button svg{width:17px; height:17px; fill:currentColor}

/* ---------------------------- Gesprächslauf ---------------------------- */
.fsc-lauf{
  flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain;
  padding:18px 18px 6px; display:flex; flex-direction:column; gap:14px;
  scrollbar-width:thin; scrollbar-color:var(--fsc-linie-stark) transparent;
}
.fsc-lauf::-webkit-scrollbar{width:8px}
.fsc-lauf::-webkit-scrollbar-track{background:transparent}
.fsc-lauf::-webkit-scrollbar-thumb{background:var(--fsc-linie-stark); border-radius:var(--r-fein, 4px)}
.fsc-zeile{display:flex; max-width:100%}
.fsc-zeile.ich{justify-content:flex-end}
.fsc-blase-text{
  max-width:88%; padding:11px 15px; border-radius:var(--fsc-r-blase);
  font-size:.945rem; line-height:1.58; white-space:pre-wrap; overflow-wrap:anywhere;
}
.fsc-zeile.bot .fsc-blase-text{background:var(--fsc-grund-2); border:1px solid var(--fsc-linie); border-bottom-left-radius:var(--r-fein, 4px); color:var(--fsc-schrift)}
.fsc-zeile.ich .fsc-blase-text{background:var(--fsc-akzent); border-bottom-right-radius:var(--r-fein, 4px); color:var(--fsc-akzent-text); font-weight:500}
.fsc-blase-text a{color:var(--fsc-akzent-hell); text-decoration:underline; text-underline-offset:2px}
.fsc-zeile.ich .fsc-blase-text a{color:inherit}
.fsc-blase-text strong{font-weight:600}
.fsc-blase-text ul{margin:8px 0 0; padding-left:18px}
.fsc-blase-text li{margin:3px 0}
.fsc-notiz{
  align-self:center; max-width:90%; text-align:center;
  font-size:.79rem; color:var(--fsc-schrift-blass);
  padding:6px 12px; border:1px dashed var(--fsc-linie-stark); border-radius:var(--r-feld, 6px);
}
.fsc-punkte{display:flex; gap:5px; padding:14px 15px}
.fsc-punkte i{width:7px; height:7px; border-radius:50%; background:var(--fsc-schrift-blass); animation:fsc-huepf 1.25s infinite var(--fsc-ease)}
.fsc-punkte i:nth-child(2){animation-delay:.16s}
.fsc-punkte i:nth-child(3){animation-delay:.32s}
@keyframes fsc-huepf{0%,60%,100%{opacity:.28; transform:translateY(0)}30%{opacity:1; transform:translateY(-4px)}}

/* ---------------------------- Vorschläge ---------------------------- */
.fsc-vorschlaege{display:flex; flex-wrap:wrap; gap:7px; padding:8px 18px 4px}
.fsc-vorschlaege:empty{display:none}
.fsc-vorschlaege button{
  border:1px solid var(--fsc-linie-stark); background:transparent;
  color:var(--fsc-schrift-weich); font:inherit; font-size:.845rem;
  padding:7px 13px; border-radius:999px; cursor:pointer; text-align:left;
  transition:border-color .2s, color .2s, background .2s;
}
.fsc-vorschlaege button:hover,.fsc-vorschlaege button:focus-visible{border-color:var(--fsc-akzent); color:var(--fsc-akzent); background:var(--fsc-akzent-hauch)}
.fsc-karten{display:flex; flex-direction:column; gap:8px}
.fsc-karte{
  display:block; width:100%; text-align:left; cursor:pointer; font:inherit;
  padding:11px 15px; border-radius:var(--r-feld, 6px);
  border:1px solid var(--fsc-linie); background:var(--fsc-grund);
  transition:border-color .2s, transform .2s var(--fsc-ease);
}
.fsc-karte:hover,.fsc-karte:focus-visible{border-color:var(--fsc-akzent); transform:translateX(2px)}
.fsc-karte b{display:block; color:var(--fsc-akzent); font-size:.76rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase; margin-bottom:3px; font-family:var(--caps, inherit)}
.fsc-karte span{display:block; color:var(--fsc-schrift-weich); font-size:.9rem; line-height:1.45}

/* ---------------------------- Eingabe ---------------------------- */
.fsc-eingabe:focus-within{outline:2px solid var(--fsc-akzent);outline-offset:-2px}
.fsc-eingabe{display:flex; align-items:flex-end; gap:8px; padding:12px 12px 10px 16px; border-top:1px solid var(--fsc-linie); background:var(--fsc-grund-2)}
.fsc-eingabe textarea{flex:1; resize:none; border:0; outline:0; background:transparent; color:var(--fsc-schrift); font:inherit; font-size:.945rem; line-height:1.5; max-height:120px; padding:9px 0}
.fsc-eingabe textarea::placeholder{color:var(--fsc-schrift-blass)}
.fsc-senden{width:40px; height:40px; flex:none; border:0; border-radius:var(--r-feld, 6px); cursor:pointer; background:var(--fsc-akzent); display:grid; place-items:center; transition:opacity .2s, transform .2s var(--fsc-ease)}
.fsc-senden svg{width:19px; height:19px; fill:var(--fsc-akzent-text)}
.fsc-senden:hover:not(:disabled){transform:translateY(-1px)}
.fsc-senden:disabled{opacity:.35; cursor:default}
.fsc-fuss{margin:0; padding:0 16px 12px; background:var(--fsc-grund-2); font-size:.735rem; line-height:1.5; color:var(--fsc-schrift-blass)}
.fsc-fuss a{color:var(--fsc-schrift-weich)}

@media (max-width:560px){
  .fsc-fenster{left:0; right:0; bottom:0; width:100vw; height:100dvh; max-height:100dvh; border-radius:0; border-left:0; border-right:0; border-bottom:0}
  .fsc-blase{left:auto; right:12px; bottom:12px; height:46px; padding:0 14px} /* left:auto, sonst zieht sich der Knopf mit right:18px seitenbreit (Fund Café 02.11.2026) */
  .fsc-blase .fsc-blase-wort{display:none}
}
@media (prefers-reduced-motion:reduce){
  .fsc-fenster,.fsc-blase,.fsc-karte,.fsc-senden{transition:none}
  .fsc-punkte i{animation:none; opacity:.5}
}
