/* Bichel Assistance – Website-Chat. Farben folgen den Tokens der Website (navy/gold), mit eigenem Fallback. */
.ba-bot {
  --ba-navy: #1B2A4A; --ba-gold: #B8913F; --ba-surface: #FFFFFF; --ba-bg: #F6F7FA; --ba-band: #ECEFF5;
  --ba-fg: #1B2A4A; --ba-muted: #56617A; --ba-line: #D9DEE8; --ba-in: #ECEFF5; --ba-out: #1B2A4A; --ba-out-fg: #FFFFFF;
  --ba-ok: #2E7D5B;
  --ba-display: Georgia, "Times New Roman", serif;
  --ba-body: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-family: var(--ba-body); color: var(--ba-fg);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ba-bot {
  --ba-navy: #E8ECF4; --ba-gold: #D4B26A; --ba-surface: #16213A; --ba-bg: #0E1628; --ba-band: #121C31;
  --ba-fg: #E8ECF4; --ba-muted: #A3ADC2; --ba-line: #2A3754; --ba-in: #1F2C49; --ba-out: #D4B26A; --ba-out-fg: #0E1628; --ba-ok: #6CCB9E; } }
:root[data-theme="dark"] .ba-bot {
  --ba-navy: #E8ECF4; --ba-gold: #D4B26A; --ba-surface: #16213A; --ba-bg: #0E1628; --ba-band: #121C31;
  --ba-fg: #E8ECF4; --ba-muted: #A3ADC2; --ba-line: #2A3754; --ba-in: #1F2C49; --ba-out: #D4B26A; --ba-out-fg: #0E1628; --ba-ok: #6CCB9E; }

.ba-bot * { box-sizing: border-box; }
/* das hidden-Attribut muss immer gewinnen, sonst ist das Chatfenster dauerhaft sichtbar */
.ba-bot [hidden] { display: none !important; }
/* gegen globale Stile der Seite absichern (z. B. section/form/p mit Abständen) */
.ba-bot div, .ba-bot form, .ba-bot p, .ba-bot dl, .ba-bot h4 { margin: 0; }
.ba-panel, .ba-log, .ba-chips, .ba-form { padding-block: 0; }
.ba-launch { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 9998;
  display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: #1B2A4A; color: #fff; font: 600 13.5px/1 var(--ba-body); box-shadow: 0 10px 24px -12px rgba(27,42,74,.55); }
.ba-launch { border: 1px solid rgba(201,165,90,.55) !important; }
.ba-launch svg { width: 24px; height: 27px; flex: none; }
.ba-launch:hover { background: #24375f; }
.ba-launch:focus-visible, .ba-bot button:focus-visible, .ba-bot input:focus-visible, .ba-bot textarea:focus-visible { outline: 3px solid var(--ba-gold); outline-offset: 2px; }

.ba-panel { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 9999;
  width: min(340px, calc(100vw - 36px)); height: min(500px, calc(100vh - 36px)); display: flex; flex-direction: column;
  background: var(--ba-surface); border: 1px solid var(--ba-line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 70px -28px rgba(14,22,40,.55); }
.ba-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: #1B2A4A; color: #fff; }
.ba-head svg { width: 26px; height: 29px; flex: none; }
.ba-head b { display: block; font: 700 15px/1.15 var(--ba-display); }
.ba-head small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .85; margin-top: 3px; }
.ba-head small i { width: 7px; height: 7px; border-radius: 50%; background: #7EE2A8; display: inline-block; }
.ba-close { margin-left: auto; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 30px; height: 30px; border-radius: 10px; cursor: pointer; font-size: 20px; line-height: 1; }
.ba-close:hover { background: rgba(255,255,255,.22); }

.ba-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px !important; display: flex; flex-direction: column; gap: 8px; background: var(--ba-bg); }
.ba-row { display: flex; }
.ba-row.me { justify-content: flex-end; }
.ba-msg { max-width: 86%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.ba-row.bot .ba-msg { background: var(--ba-surface); border: 1px solid var(--ba-line); border-bottom-left-radius: 5px; }
.ba-row.me .ba-msg { background: var(--ba-out); color: var(--ba-out-fg); border-bottom-right-radius: 5px; }
.ba-ki { font-size: 11.5px; color: var(--ba-muted); margin: -4px 0 0 4px; }
.ba-card { background: var(--ba-surface); border: 1px solid var(--ba-line); border-radius: 16px; padding: 14px; max-width: 92%; font-size: 14.5px; }
.ba-card h4 { margin: 0 0 8px; font: 700 15px/1.2 var(--ba-display); color: var(--ba-navy); }
.ba-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.ba-card dt { color: var(--ba-muted); }
.ba-card dd { margin: 0; overflow-wrap: anywhere; }
.ba-price { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--ba-line); }
.ba-price:last-of-type { border-bottom: 0; }
.ba-price b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ba-tag { display: inline-block; background: var(--ba-gold); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; border-radius: 999px; padding: 2px 8px; margin-bottom: 6px; }
.ba-note { font-size: 12.5px; color: var(--ba-muted); margin-top: 8px; }
.ba-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13px; color: var(--ba-muted); }
.ba-consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: #1B2A4A; }
.ba-consent a { color: inherit; }
.ba-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ba-btn { border: 0; border-radius: 10px; padding: 10px 16px; font: 600 14.5px var(--ba-body); cursor: pointer; background: #1B2A4A; color: #fff; }
.ba-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ba-btn.ghost { background: transparent; color: var(--ba-fg); border: 1px solid var(--ba-line); }
.ba-done { border-color: var(--ba-ok); }
.ba-done h4 { color: var(--ba-ok); }
.ba-typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.ba-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ba-muted); animation: ba-blink 1s infinite; }
.ba-typing span:nth-child(2) { animation-delay: .15s } .ba-typing span:nth-child(3) { animation-delay: .3s }
@keyframes ba-blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }

.ba-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 10px !important; background: var(--ba-bg); border-top: 1px solid var(--ba-line); }
.ba-chips::-webkit-scrollbar { display: none; }
.ba-chip { flex: none; }
.ba-chip { border: 1px solid var(--ba-line); background: var(--ba-surface); color: var(--ba-fg); border-radius: 999px; padding: 5px 10px; font: 600 12px var(--ba-body); cursor: pointer; }
.ba-chip:hover { border-color: var(--ba-gold); }
.ba-chip.main { background: #1B2A4A; color: #fff; border-color: #1B2A4A; }
.ba-form { display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid var(--ba-line); background: var(--ba-surface); }
.ba-form input { flex: 1; min-width: 0; border: 1px solid var(--ba-line); border-radius: 999px; padding: 9px 14px; font: 15px var(--ba-body); background: var(--ba-bg); color: var(--ba-fg); }
.ba-send { border: 0; border-radius: 999px; padding: 0 16px; background: #1B2A4A; color: #fff; font: 600 14.5px var(--ba-body); cursor: pointer; flex: none; }
.ba-foot { text-align: center; font-size: 10.5px; color: var(--ba-muted); padding: 0 0 6px; background: var(--ba-surface); }

@media (max-width: 480px) {
  .ba-panel { right: 0; bottom: 0; width: 100vw; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); }
}
@media (prefers-reduced-motion: reduce) { .ba-typing span { animation: none; opacity: .6 } }
