:root{
  --fc-accent:#2563eb; --fc-accent-2:#60a5fa;
  --fc-bg:#fff; --fc-text:#0f172a; --fc-border:rgba(2,6,23,.12);
  --fc-shadow:0 10px 30px rgba(2,6,23,.18),0 2px 8px rgba(2,6,23,.08);
  --fc-radius:18px; --fc-z:999999;
  --fc-bottom-closed:128px; --fc-bottom-open:22px; --fc-side:22px;
  --fc-width:390px; --fc-height:680px;
  --fc-bubble-user:#0b5fff; --fc-bubble-bot:#0f172a0d;
  --fc-bubble-agent:var(--fc-bubble-bot); --fc-bubble-system:rgba(15,23,42,.06);
  --fc-font: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
  --fc-font-size: 16px; --fc-font-size-title: 16px; --fc-font-size-small: 12px; --fc-line: 1.45;
}

.fc-visually-hidden{
  position:absolute !important;
  width:1px; height:1px;
  padding:0 !important; margin:-1px !important;
  overflow:hidden; clip:rect(0,0,0,0); clip-path:inset(50%);
  white-space:nowrap; border:0;
}
@media (prefers-color-scheme: dark){
  :root{
    --fc-bg:#0b1220; --fc-text:#e5e7eb; --fc-border:rgba(148,163,184,.18);
    --fc-shadow:0 12px 32px rgba(0,0,0,.45),0 2px 10px rgba(0,0,0,.25);
    --fc-bubble-bot:#0f172a;
  }
}
#fc-chat-root, #fc-chat-root * { -ms-overflow-style:none; scrollbar-width:none; }
#fc-chat-root::-webkit-scrollbar, #fc-chat-root *::-webkit-scrollbar { width:0!important; height:0!important; display:none!important; }
#fc-chat-root, .fc-box { overscroll-behavior: none; }
.fc-thread { -webkit-overflow-scrolling:touch; overflow:auto; overscroll-behavior: contain; }
.fc-input { overflow:auto; }

#fc-chat-root{
  position:fixed; right:var(--fc-side); bottom:var(--fc-bottom-closed);
  width:var(--fc-width); height:var(--fc-height);
  min-width:340px; max-width:calc(min(720px, 100vw - 28px));
  min-height:380px; max-height:calc(100svh - 140px);
  z-index:var(--fc-z); opacity:0; visibility:hidden; pointer-events:none;
  transform:translateY(10px) scale(.98);
  transition:opacity .2s ease, transform .25s ease, visibility 0s .2s, bottom .25s ease, width .05s linear, height .05s linear;
  font-family: var(--fc-font) !important; font-size: var(--fc-font-size) !important; line-height: var(--fc-line) !important;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.fc-box, .fc-body, .fc-thread, .fc-msg, .fc-input, .fc-mini {
  font-family: var(--fc-font) !important; font-size: var(--fc-font-size) !important; line-height: var(--fc-line) !important;
}
.fc-title{ font-family: var(--fc-font) !important; font-size: var(--fc-font-size-title) !important; line-height: calc(var(--fc-line) - .05) !important;
  font-weight:700; letter-spacing:.2px; display:flex; align-items:center; gap:8px; }
.fc-foot, .fc-mini { font-size: var(--fc-font-size-small) !important; }

#fc-chat-root.fc-open{ opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0) scale(1); bottom:var(--fc-bottom-open); }
#fc-chat-root.fc-open ~ #fc-chat-toggle{ opacity:0; pointer-events:none; transform:translateY(8px) scale(.92); }

#fc-chat-toggle{
  position:fixed; inset:auto var(--fc-side) var(--fc-bottom-open) auto; width:64px; height:64px; border:0; border-radius:999px;
  background:linear-gradient(135deg,var(--fc-accent),var(--fc-accent-2)); color:#fff; cursor:pointer; box-shadow:var(--fc-shadow);
  display:flex; align-items:center; justify-content:center; transition:transform .18s ease,box-shadow .18s ease,opacity .2s ease; z-index:var(--fc-z);
}
#fc-chat-toggle:hover{transform:translateY(-2px) scale(1.03)}
#fc-chat-toggle:active{transform:translateY(0) scale(.98)}
#fc-chat-toggle svg{width:28px;height:28px}

@media (max-width:768px){
  #fc-chat-root{right:0;bottom:0;left:0;top:0;width:100vw;height:100svh;max-width:100vw;max-height:100svh}
  .fc-box{border-radius:0}
  #fc-chat-toggle{inset:auto 16px 16px auto}
  #fc-chat-root.fc-open ~ #fc-chat-toggle{display:none}
  .fc-resize-handle{display:none!important}
}
@media (max-width:768px){
  html.fc-no-scroll, body.fc-no-scroll { overflow:hidden; position:fixed; width:100%; height:100%; touch-action:none; }
}
@supports (padding:max(0px)){
  #fc-chat-toggle{margin-bottom:max(0px,env(safe-area-inset-bottom));margin-right:max(0px,env(safe-area-inset-right))}
  #fc-chat-root{margin-bottom:max(0px,env(safe-area-inset-bottom));margin-right:max(0px,env(safe-area-inset-right))}
}

.fc-box{ position:relative; background:var(--fc-bg); color:var(--fc-text); border:1px solid var(--fc-border);
  border-radius:var(--fc-radius); box-shadow:var(--fc-shadow); width:100%; height:100%;
  display:flex; flex-direction:column; overflow:hidden }
.fc-head{ display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid var(--fc-border);
  background:linear-gradient(0deg,rgba(2,6,23,.03),transparent) }
.fc-dot{width:8px;height:8px;border-radius:999px;background:#22c55e;box-shadow:0 0 0 0 rgba(34,197,94,.8);animation:fc-pulse 2s infinite}
#fc-chat-root.fc-agent-queued .fc-dot{background:#f97316;box-shadow:0 0 0 0 rgba(249,115,22,.6)}
#fc-chat-root.fc-agent-active .fc-dot{background:#0ea5e9;box-shadow:0 0 0 0 rgba(14,165,233,.6)}
@keyframes fc-pulse{0%{box-shadow:0 0 0 0 rgba(34,197,94,.8)}70%{box-shadow:0 0 0 10px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}}
.fc-actions{margin-left:auto;display:flex;gap:6px}
.fc-btn{appearance:none;border:1px solid var(--fc-border);background:transparent;color:var(--fc-text);
  border-radius:10px;padding:6px;cursor:pointer;transition:background .18s ease,transform .12s ease}
.fc-btn:hover{background:rgba(2,6,23,.05)} .fc-btn:active{transform:scale(.98)} .fc-btn svg{width:18px;height:18px;display:block}
.fc-btn.fc-agent{
  position:relative;
  padding:6px;
  min-width:32px;
  min-height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--fc-accent);
  border-color:rgba(37,99,235,.35);
}
.fc-btn.fc-agent .icon{width:18px;height:18px;display:block}
.fc-btn.fc-agent:hover{background:transparent;}
.fc-btn.fc-agent[data-state="queued"],
.fc-btn.fc-agent[data-state="requesting"]{background:rgba(249,115,22,.12);border-color:rgba(249,115,22,.3);color:#b45309}
.fc-btn.fc-agent[data-state="active"],
.fc-btn.fc-agent[data-state="closing"]{background:rgba(14,165,233,.18);border-color:rgba(14,165,233,.4);color:#0e7490}
.fc-btn.fc-agent[disabled]{cursor:default;opacity:.75}

.fc-body{flex:1;display:flex;flex-direction:column;min-height:0}
.fc-thread{flex:1;padding:14px;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth;background:rgba(2,6,23,.03)}
.fc-msg{max-width:86%;padding:10px 12px;border-radius:14px;border:1px solid var(--fc-border);word-wrap:break-word;white-space:normal}
.fc-msg.user{align-self:flex-end;background:var(--fc-bubble-user);border-color:transparent;color:#fff}
.fc-msg.bot{align-self:flex-start;background:var(--fc-bubble-bot)}
.fc-msg.agent{align-self:flex-start;background:var(--fc-bubble-agent);border-color:var(--fc-border);color:var(--fc-text)}
.fc-msg.system{align-self:center;background:var(--fc-bubble-system);border-color:rgba(148,163,184,.35);color:#475569;font-size:.88em;text-align:center}

/* Markdown Typografie (GFM) */
.fc-msg p{margin:.25em 0}
.fc-msg h1,.fc-msg h2,.fc-msg h3,.fc-msg h4,.fc-msg h5,.fc-msg h6{margin:.3em 0 .2em;font-weight:700}
.fc-msg h1{font-size:1.35em}.fc-msg h2{font-size:1.25em}.fc-msg h3{font-size:1.15em}
.fc-msg ul,.fc-msg ol{margin:.25em 0 .25em 1.1em}
.fc-msg li{margin:.12em 0}
.fc-msg li > ul,.fc-msg li > ol{margin-top:.12em}
.fc-msg code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:.92em;background:rgba(2,6,23,.08);padding:.12em .32em;border-radius:6px}
.fc-msg pre{background:rgba(2,6,23,.08);padding:.6em;border-radius:10px;overflow:auto;white-space:pre}
.fc-msg blockquote{border-left:3px solid rgba(2,6,23,.2);margin:.25em 0;padding:.25em .6em;color:#475569}

/* Linkfarben */
.fc-msg a{color:var(--fc-accent);text-decoration:underline}
.fc-msg.user a,
.fc-msg.user a:visited,
.fc-msg.user a:hover,
.fc-msg.user a:focus{ color:#fff !important; text-decoration:underline; }

.fc-msg hr{border:0;border-top:1px solid var(--fc-border);margin:.5em 0}
.fc-msg table{width:100%;border-collapse:collapse;margin:.4em 0}
.fc-msg th,.fc-msg td{border:1px solid var(--fc-border);padding:.35em .5em;text-align:left;vertical-align:top}
.fc-msg thead th{background:rgba(2,6,23,.05);font-weight:700}
.fc-msg input[type="checkbox"]{margin-right:.5em; transform:translateY(1px); pointer-events:none}

/* Typing (HORIZONTAL) */
.fc-typing{display:inline-flex;align-items:center;gap:8px}
.fc-typing .dot{width:6px;height:6px;border-radius:999px;background:#94a3b8;opacity:.25;animation:fc-blink 1.1s infinite}
.fc-typing .dot:nth-child(2){animation-delay:.2s}
.fc-typing .dot:nth-child(3){animation-delay:.4s}
@keyframes fc-blink{0%,80%,100%{opacity:.25}40%{opacity:1}}

/* ---------- QUICK PROMPTS (zentriert & harmonisch) ---------- */
.fc-form{
  display:flex;
  flex-direction:column;
  gap:12px;                 /* Abstand zwischen Prompts und Eingabefeld */
  padding:12px;             /* konsistenter Innenabstand */
  border-top:1px solid var(--fc-border);
  background:var(--fc-bg);
}
.fc-quickprompts{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* zwei Spalten */
  gap:10px;                                       /* gleichmäßiger Abstand */
  padding:0;                                      /* Rand kommt von .fc-form */
  justify-items:stretch;
  align-items:stretch;
}
.fc-qbtn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  padding:12px 14px;
  border:1px solid var(--fc-border);
  border-radius:12px;
  background:transparent;
  color:var(--fc-text);
  font:inherit;
  line-height:1.2;
  white-space:nowrap;
  text-align:center;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .12s ease;
  touch-action:manipulation;
}
.fc-qbtn:hover{ border-color:var(--fc-accent); box-shadow:0 0 0 3px rgba(37,99,235,.12); background:rgba(2,6,23,.02); }
.fc-qbtn:focus-visible{ outline:none; border-color:var(--fc-accent); box-shadow:0 0 0 3px rgba(37,99,235,.15); }
.fc-qbtn:active{ transform:scale(.98); }
.fc-qbtn[disabled]{ opacity:.65; cursor:not-allowed; }

/* Auf sehr schmalen Screens automatisch 1 Spalte */
@media (max-width: 420px){
  .fc-quickprompts{ grid-template-columns: 1fr; }
}

/* Eingabebereich */
.fc-input-wrap{position:relative;flex:1;display:flex}
.fc-input{
  flex:1; resize:none; min-height:44px; max-height:160px; padding:12px 52px 12px 12px;
  border-radius:12px; border:1px solid var(--fc-border); outline:none; background:transparent; color:var(--fc-text);
  caret-color:var(--fc-accent); transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.fc-input::placeholder{color:#94a3b8; font-size:inherit;}
.fc-input:focus{ border-color:var(--fc-accent); box-shadow:0 0 0 3px rgba(37,99,235,.15); background:rgba(2,6,23,.02); }

.fc-sendicon{
  position:absolute; right:8px; top:50%; transform:translateY(-50%); width:36px; height:36px; border:0; border-radius:10px;
  background:linear-gradient(135deg,var(--fc-accent),var(--fc-accent-2)); color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer; box-shadow:var(--fc-shadow); transition:transform .12s ease, opacity .12s ease;
}
.fc-sendicon:hover{transform:translateY(-50%) scale(1.04)}
.fc-sendicon:active{transform:translateY(-50%) scale(.97)}
.fc-sendicon[disabled]{opacity:.65; cursor:not-allowed}
.fc-sendicon svg{width:18px;height:18px; display:block}
.fc-sendicon .dots{display:inline-flex;align-items:center;gap:5px}
.fc-sendicon .dots span{width:4px;height:4px;border-radius:999px;background:#fff;opacity:.35;animation:fc-dots 1.1s infinite}
.fc-sendicon .dots span:nth-child(2){animation-delay:.2s}
.fc-sendicon .dots span:nth-child(3){animation-delay:.4s}
@keyframes fc-dots{0%,80%,100%{opacity:.35; transform:translateY(0)}40%{opacity:1; transform:translateY(-1px)}}

.fc-foot{padding:8px 12px;color:#64748b;border-top:1px solid var(--fc-border);display:flex;align-items:center;gap:8px;justify-content:space-between}
.fc-mini{display:inline-flex;align-items:center;gap:6px;background:rgba(2,6,23,.05);border:1px solid var(--fc-border);border-radius:10px;padding:6px 10px}

.fc-resize-handle{ position:absolute; z-index:5; background:transparent; touch-action:none; }
.fc-resize-l{ left:0; top:0; width:10px; height:100%; cursor:ew-resize; }
.fc-resize-t{ left:0; top:0; width:100%; height:10px; cursor:ns-resize; }
.fc-resize-tl{ left:0; top:0; width:16px; height:16px; cursor:nwse-resize; }
.fc-resize-handle:hover{ background:transparent; }

