/* ---------- Sphinx-Assistent (Chat) ---------- */
#sx-bot { position: fixed; right: 26px; bottom: 26px; z-index: 2150; font-family: var(--font-body); color: var(--ink); }
body.has-sx-bot .wa-float { bottom: 98px; }
/* Solange der Cookie-Hinweis offen ist, Buttons ausblenden (sonst verdeckt) */
body:has(.cookie.show) #sx-bot, body:has(.cookie.show) .wa-float { opacity: 0; pointer-events: none; transition: opacity 0.3s; }

.sx-launch {
  position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: var(--green-2);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 40px rgba(30, 25, 10, 0.22), 0 0 0 0 rgba(176, 138, 60, 0.45);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); animation: sx-pulse 3.2s ease-out 4s 3;
}
.sx-launch:hover { transform: translateY(-4px) scale(1.04); }
.sx-launch svg { width: 28px; height: 28px; position: absolute; transition: opacity 0.25s, transform 0.35s var(--ease); }
.sx-launch .sx-x { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.sx-open .sx-launch svg:first-child { opacity: 0; transform: rotate(90deg) scale(0.6); }
.sx-open .sx-launch .sx-x { opacity: 1; transform: none; }
.sx-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; border-radius: 10px; background: #C0392B; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
@keyframes sx-pulse { 0% { box-shadow: 0 14px 40px rgba(30, 25, 10, 0.22), 0 0 0 0 rgba(176, 138, 60, 0.5); } 100% { box-shadow: 0 14px 40px rgba(30, 25, 10, 0.22), 0 0 0 22px rgba(176, 138, 60, 0); } }

.sx-teaser {
  position: absolute; right: 72px; bottom: 6px; width: 250px; background: #fff; border: 1px solid var(--line-soft); border-radius: 14px 14px 4px 14px;
  padding: 12px 34px 12px 14px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-2); cursor: pointer; animation: sx-up 0.5s var(--ease);
}
.sx-teaser button { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; color: var(--ink-3); cursor: pointer; line-height: 1; }

.sx-win {
  position: absolute; right: 0; bottom: 76px; width: 390px; max-width: calc(100vw - 32px); height: 620px; max-height: calc(100vh - 120px);
  background: var(--ivory); border-radius: 20px; box-shadow: 0 24px 70px rgba(30, 25, 10, 0.28); overflow: hidden; display: flex; flex-direction: column;
  transform-origin: bottom right; animation: sx-up 0.45s var(--ease);
}
.sx-win[hidden], .sx-badge[hidden], .sx-teaser[hidden] { display: none !important; }
@keyframes sx-up { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }

.sx-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; background: linear-gradient(135deg, var(--green-2), var(--green-3)); color: var(--ivory); }
.sx-avatar, .sx-mini { flex: 0 0 auto; border-radius: 50%; background: var(--gold-2); color: var(--green-2); display: flex; align-items: center; justify-content: center; }
.sx-avatar { width: 42px; height: 42px; box-shadow: 0 0 0 3px rgba(201, 168, 96, 0.25); }
.sx-avatar svg { width: 22px; height: 22px; }
.sx-title { flex: 1; min-width: 0; line-height: 1.25; }
.sx-title strong { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: 0.01em; }
.sx-title span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(251, 248, 241, 0.75); }
.sx-dot { width: 8px; height: 8px; border-radius: 50%; background: #5CC489; box-shadow: 0 0 0 3px rgba(92, 196, 137, 0.25); }
.sx-close { border: 0; background: rgba(255, 255, 255, 0.08); color: var(--ivory); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.sx-close:hover { background: rgba(255, 255, 255, 0.18); }
.sx-close svg { width: 18px; height: 18px; }

.sx-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.sx-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; animation: sx-up 0.35s var(--ease); }
.sx-msg.sx-instant { animation: none; }
.sx-mini { width: 26px; height: 26px; margin-bottom: 2px; }
.sx-mini svg { width: 14px; height: 14px; }
.sx-bubble { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; word-wrap: break-word; }
.sx-bot .sx-bubble { background: #fff; border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; color: var(--ink); }
.sx-user { justify-content: flex-end; }
.sx-user .sx-bubble { background: var(--green); color: var(--ivory); border-bottom-right-radius: 4px; }
.sx-bubble p, .sx-bubble ul, .sx-bubble ol { margin: 0 0 8px; }
.sx-bubble > :last-child { margin-bottom: 0; }
.sx-bubble ul, .sx-bubble ol { padding-left: 18px; }
.sx-bubble li { margin: 3px 0; }
.sx-bubble a { color: var(--green-3); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.sx-bubble a:hover { color: var(--gold-3); }
.sx-bubble small { color: var(--ink-3); }
.sx-bubble .sx-in { animation: sx-fade 0.4s ease; }
@keyframes sx-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sx-products { list-style: none; padding: 0 !important; }
.sx-products li { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.sx-products li:last-child { border-bottom: 0; }
.sx-tag { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-3); background: rgba(176, 138, 60, 0.12); padding: 1px 6px; border-radius: 4px; }
.sx-ok { color: #2E7D4F; font-weight: 600; }
.sx-no { color: #B23A2E; font-weight: 600; }
.sx-bubble .sx-btn {
  display: inline-block; margin-top: 2px; padding: 9px 14px; border-radius: 999px; background: var(--green); color: var(--ivory) !important; text-decoration: none !important;
  font-size: 13px; font-weight: 600; transition: background 0.2s, transform 0.2s;
}
.sx-bubble .sx-btn:hover { background: var(--green-3); transform: translateY(-1px); }

.sx-typing .sx-bubble { display: flex; gap: 5px; padding: 14px 16px; }
.sx-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: sx-blink 1.2s infinite; }
.sx-typing span:nth-child(2) { animation-delay: 0.18s; }
.sx-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes sx-blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 16px 10px; }
.sx-chips:empty { display: none; }
.sx-chips button {
  border: 1px solid var(--green-3); background: transparent; color: var(--green); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s; animation: sx-fade 0.4s ease both;
}
.sx-chips button:nth-child(2) { animation-delay: 0.08s; } .sx-chips button:nth-child(3) { animation-delay: 0.16s; } .sx-chips button:nth-child(4) { animation-delay: 0.24s; }
.sx-chips button:hover { background: var(--green); color: var(--ivory); transform: translateY(-1px); }

.sx-form { display: flex; gap: 8px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line-soft); background: #fff; }
.sx-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 14px; background: var(--ivory); color: var(--ink); outline: none; min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sx-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 60, 0.18); }
.sx-form button { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--green); color: var(--gold-2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.2s; }
.sx-form button:hover { background: var(--green-3); transform: scale(1.05); }
.sx-form button svg { width: 18px; height: 18px; }
.sx-foot { padding: 6px 16px 9px; font-size: 10.5px; color: var(--ink-3); text-align: center; background: #fff; }
.sx-foot button { border: 0; background: none; color: var(--ink-3); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.sx-foot button:hover { color: var(--green); }

@media (max-width: 640px) {
  #sx-bot { right: 16px; bottom: 16px; }
  body.has-sx-bot .wa-float { right: 16px; bottom: 88px; }
  .sx-launch { width: 56px; height: 56px; }
  .sx-win { position: fixed; inset: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; bottom: 0; }
  .sx-open .sx-launch { display: none; }
  .sx-form input { font-size: 16px; }
  .sx-bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) { .sx-launch, .sx-win, .sx-msg, .sx-teaser, .sx-chips button, .sx-bubble .sx-in { animation: none !important; } }
