/* BildPal Assistant widget */
.bpa-root { --bpa-color: #1f6f5c; --bpa-bg: #fff; --bpa-fg: #1d2327; --bpa-muted: #646970; --bpa-line: #dcdcde; --bpa-bot: #f0f2f3;
  position: fixed; bottom: 18px; z-index: 99999; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--bpa-fg); }
.bpa-root[hidden] { display: none; }
.bpa-right { right: 18px; } .bpa-left { left: 18px; }
.bpa-root *, .bpa-root *::before, .bpa-root *::after { box-sizing: border-box; }
.bpa-launcher { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--bpa-color); color: #fff; cursor: pointer; font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.bpa-launcher:hover { filter: brightness(1.08); }
.bpa-launcher:focus-visible, .bpa-close:focus-visible, .bpa-send:focus-visible, .bpa-input:focus-visible { outline: 3px solid #2271b1; outline-offset: 2px; }
.bpa-root.bpa-is-open .bpa-launcher { display: none; }
.bpa-panel { width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: var(--bpa-bg); border: 1px solid var(--bpa-line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.bpa-panel[hidden] { display: none; }
.bpa-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--bpa-color); color: #fff; }
.bpa-title { font-weight: 700; } .bpa-sub { font-size: 12px; opacity: .9; }
.bpa-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.bpa-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bpa-bg); }
.bpa-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bpa-bot { align-self: flex-start; background: var(--bpa-bot); border-bottom-left-radius: 4px; }
.bpa-user { align-self: flex-end; background: var(--bpa-color); color: #fff; border-bottom-right-radius: 4px; }
.bpa-user a { color: #fff; } .bpa-bot a { color: var(--bpa-color); }
.bpa-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.bpa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--bpa-muted); animation: bpa-b 1.1s infinite ease-in-out; }
.bpa-typing span:nth-child(2) { animation-delay: .15s; } .bpa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bpa-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.bpa-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--bpa-line); background: var(--bpa-bg); }
.bpa-input { flex: 1; resize: none; border: 1px solid var(--bpa-line); border-radius: 10px; padding: 9px 10px; font: inherit; background: var(--bpa-bg); color: var(--bpa-fg); max-height: 110px; }
.bpa-send { border: 0; border-radius: 10px; padding: 0 16px; background: var(--bpa-color); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.bpa-clip { border: 0; background: transparent; color: var(--bpa-muted); cursor: pointer; padding: 0 4px; display: inline-flex; align-items: center; }
.bpa-clip[hidden] { display: none; }
.bpa-clip:hover { color: var(--bpa-color); }
.bpa-clip:focus-visible { outline: 3px solid #2271b1; outline-offset: 2px; border-radius: 6px; }
.bpa-send:disabled { opacity: .55; cursor: default; }
@media (prefers-color-scheme: dark) {
  .bpa-root { --bpa-bg: #1e2124; --bpa-fg: #f0f0f1; --bpa-muted: #a7aaad; --bpa-line: #3c434a; --bpa-bot: #2c3338; }
}
@media (max-width: 520px) {
  .bpa-root { bottom: 12px; } .bpa-right { right: 12px; } .bpa-left { left: 12px; }
  .bpa-root.bpa-is-open { inset: 0; bottom: 0; }
  .bpa-root.bpa-is-open .bpa-panel { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .bpa-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .bpa-typing span { animation: none; opacity: .6; } }
