/* KI-Assistent als Chat (A-13; Chat-Ansicht seit Portal Phase 1, 12.10.2026) fuer Anmeldung (portal.css) und
   Kundenbereich (customer-area.css): beide Dateien liefern die Farben (--surface bzw. --card, --border, --muted …).
   Knopf unten rechts (erst durch das Skript sichtbar), Fenster darueber, „Vergroessern“ am Computer, am Handy ueber die
   ganze Breite und im Kundenbereich ueber der Navigation. */
.assist-toggle{position:fixed;right:20px;bottom:20px;z-index:60;width:56px;height:56px;border:0;border-radius:50%;display:grid;place-items:center;background:#1f6fd1;color:#fff;box-shadow:0 8px 22px rgba(0,0,0,.24);cursor:pointer;transition:transform .15s ease,background-color .15s ease}
.assist-toggle:hover{background:#185bb0;transform:translateY(-2px)}
.assist-toggle svg{width:28px;height:28px;display:block}
.assist-toggle[hidden],.assist[hidden],.assist-sugg[hidden]{display:none}
.assist-toggle:focus-visible,.assist button:focus-visible,.assist textarea:focus-visible{outline:3px solid #1f6fd1;outline-offset:2px}
.assist{position:fixed;right:20px;bottom:88px;z-index:61;width:400px;max-width:calc(100vw - 32px);height:min(600px,calc(100vh - 120px));display:flex;flex-direction:column;background:var(--surface,var(--card,#fff));color:var(--text);border:1px solid var(--border);border-radius:18px;box-shadow:0 22px 60px rgba(0,0,0,.3);overflow:hidden;font-size:.92rem;line-height:1.5}
.assist.wide{width:min(720px,calc(100vw - 40px));height:calc(100vh - 120px)}
.assist-head{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px;border-bottom:1px solid var(--border)}
.assist-avatar{width:36px;height:36px;flex:0 0 36px;border-radius:50%;display:grid;place-items:center;background:#1f6fd1;color:#fff}
.assist-avatar svg{width:19px;height:19px}
.assist-title{display:grid;line-height:1.25;min-width:0}
.assist-title strong{font-size:1rem;color:var(--heading)}
.assist-title small{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:.75rem}
.assist-dot{width:8px;height:8px;border-radius:50%;background:var(--ok-fg,#237a49);flex:0 0 8px}
.assist-tools{margin-left:auto;display:flex;gap:2px}
.assist-tools button{width:34px;height:34px;display:grid;place-items:center;border:0;border-radius:9px;background:none;color:var(--muted);cursor:pointer;padding:0}
.assist-tools button:hover{background:var(--accent-soft,var(--bg));color:var(--heading)}
.assist-tools button[aria-pressed="true"]{color:#1f6fd1}
.assist-tools svg{width:18px;height:18px}
.assist-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:12px;background:var(--bg)}
.assist-msg{display:flex;flex-direction:column;gap:3px;max-width:88%}
.assist-msg.bot{align-self:flex-start}
.assist-msg.me{align-self:flex-end;align-items:flex-end}
.assist-bubble{padding:9px 12px;border-radius:14px;overflow-wrap:anywhere}
.assist-msg.bot .assist-bubble{background:var(--surface,var(--card,#fff));border:1px solid var(--border);border-top-left-radius:4px}
.assist-msg.me .assist-bubble{background:#1f6fd1;color:#fff;border-top-right-radius:4px;white-space:pre-wrap}
.assist-bubble p{margin:0}
.assist-bubble p+p,.assist-bubble p+ul,.assist-bubble p+ol,.assist-bubble ul+p,.assist-bubble ol+p{margin-top:.5em}
.assist-bubble ul,.assist-bubble ol{margin:.35em 0 0;padding-left:1.25em;display:grid;gap:.2em}
.assist-bubble strong{color:var(--heading)}
.assist-msg.me .assist-bubble strong{color:inherit}
.assist-bubble a{color:var(--blue,#1f70b7);font-weight:600;text-decoration:underline}
.assist-meta{display:flex;align-items:center;gap:10px;font-size:.72rem;color:var(--muted);padding:0 4px}
.assist-copy{border:0;background:none;padding:0;font:inherit;color:var(--muted);cursor:pointer;text-decoration:underline}
.assist-copy:hover{color:var(--heading)}
/* 👍/👎 unter jeder Antwort (KI-Statistik, 12.10.2026) */
.assist-vote{width:26px;height:26px;display:inline-grid;place-items:center;border:0;border-radius:7px;background:none;color:var(--muted);cursor:pointer;padding:0}
.assist-vote svg{width:15px;height:15px}
.assist-vote:hover:not(:disabled){background:var(--accent-soft,var(--bg));color:var(--heading)}
.assist-vote[aria-pressed="true"]{color:var(--blue,#1f70b7)}
.assist-vote:disabled{cursor:default}
.assist-vote[hidden]{display:none}
.assist-thanks{color:var(--muted)}
.assist-sugg{display:flex;flex-wrap:wrap;gap:6px}
.assist-sugg button{font:inherit;font-size:.82rem;font-weight:600;padding:6px 11px;border-radius:999px;border:1px solid var(--border);background:var(--surface,var(--card,#fff));color:var(--blue,#1f70b7);cursor:pointer}
.assist-sugg button:hover{border-color:var(--blue,#1f70b7)}
.assist-note{margin:0;padding:8px 10px;border:1px dashed var(--border);border-radius:10px;color:var(--muted);font-size:.85rem}
.assist-handover{align-self:stretch;font:inherit;font-size:.84rem;font-weight:600;text-align:left;padding:8px 12px;border-radius:10px;border:1px dashed var(--border);background:none;color:var(--blue,#1f70b7);cursor:pointer}
.assist-handover:hover{border-style:solid}
.assist-typing{align-self:flex-start;display:inline-flex;gap:4px;padding:11px 13px;border-radius:14px;border-top-left-radius:4px;background:var(--surface,var(--card,#fff));border:1px solid var(--border)}
.assist-typing i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:assist-blink 1.2s infinite both}
.assist-typing i:nth-child(2){animation-delay:.2s}
.assist-typing i:nth-child(3){animation-delay:.4s}
@keyframes assist-blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.assist-form{display:flex;gap:8px;align-items:flex-end;padding:10px 12px;border-top:1px solid var(--border)}
.assist-form textarea{flex:1;resize:none;font:inherit;font-size:.92rem;padding:9px 12px;border-radius:12px;border:1px solid var(--border);background:var(--bg);color:inherit;min-height:42px;max-height:140px;line-height:1.4}
.assist-form button{width:42px;height:42px;flex:0 0 42px;display:grid;place-items:center;border:0;border-radius:12px;padding:0;background:#1f6fd1;color:#fff;cursor:pointer}
.assist-form button svg{width:19px;height:19px}
.assist-form button:disabled{opacity:.55;cursor:default}
.assist-hint{margin:0;padding:0 12px 10px;font-size:.72rem;line-height:1.4;color:var(--muted)}
.foot{padding-bottom:84px}
@media(max-width:620px){
  .assist-toggle{right:14px;bottom:14px;width:52px;height:52px}
  .assist,.assist.wide{left:8px;right:8px;width:auto;max-width:none;bottom:76px;height:calc(100vh - 96px)}
  .assist-wide{display:none}
}
/* Kundenbereich: unten liegt am Handy die Navigation, oben die Kopfzeile; Knopf und Fenster sitzen dazwischen */
@media(max-width:1023px){
  .area-body .assist-toggle{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  .area-body .assist,.area-body .assist.wide{top:calc(76px + env(safe-area-inset-top,0px));bottom:calc(146px + env(safe-area-inset-bottom,0px));height:auto}
}
@media(prefers-reduced-motion:reduce){.assist-toggle{transition:none}.assist-typing i{animation:none;opacity:.6}}
@media print{.assist-toggle,.assist{display:none}}
