:root {
  --ada-ki-purple: #5b3b87;
  --ada-ki-ink: #172336;
  --ada-ki-muted: #5e6a7b;
  --ada-ki-border: rgba(23, 35, 54, .14);
  --ada-ki-shadow: 0 18px 48px rgba(15, 26, 43, .20);
}

body.ada-ki-berater-open { overflow: hidden; }

.ada-ki-berater,
.ada-ki-berater * { box-sizing: border-box; }

/* The advisor owns its visual surface. Some themes and accessibility/debug
 * helpers add red focus or element borders globally; those must not leak into
 * the public widget. Keep all controls borderless and use backgrounds/shadows
 * for separation instead. */
.ada-ki-berater,
.ada-ki-berater button,
.ada-ki-berater textarea {
  border: 0 !important;
  outline: 0 !important;
}

.ada-ki-berater,
.ada-ki-berater__launcher {
  background: transparent !important;
}

.ada-ki-berater,
.ada-ki-berater * {
  font-family: "Montserrat", var(--e-global-typography-text-font-family, system-ui, -apple-system, sans-serif) !important;
}

/* Theme and Elementor rules must not resurrect hidden steps or recolour the
 * advisor controls. Keep the widget self-contained on every template. */
.ada-ki-berater [hidden] { display: none !important; }
.ada-ki-berater__prompt,
.ada-ki-berater__option { color: var(--ada-ki-ink) !important; }
.ada-ki-berater__next { color: var(--ada-ki-purple) !important; }

.ada-ki-berater__launcher {
  position: fixed;
  z-index: 2147482000;
  isolation: isolate;
  left: clamp(10px, 2vw, 32px);
  right: auto;
  top: auto;
  /* Keep the fixed launcher clear of footer links and contact details on
   * every viewport. The safe-area addition prevents overlap with the iOS
   * home indicator while the same vertical lift applies on desktop. */
  bottom: calc(clamp(88px, 12vh, 128px) + env(safe-area-inset-bottom));
  width: min(760px, calc(100vw - 24px));
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  border: 0 !important;
  outline: 0 !important;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

/* The footer contains the contact details and legal links.  A fixed advisor
 * must never sit on top of that information.  The script adds this class as
 * soon as the footer enters the viewport; the advisor returns automatically
 * when the visitor scrolls back to the page content. */
.ada-ki-berater--footer-visible .ada-ki-berater__launcher {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(12px);
}

/* Cookie consent is legally primary on first visit.  Do not let the fixed
 * advisor invitation sit above or inside the consent surface. */
.ada-ki-berater--cookie-visible .ada-ki-berater__launcher {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(12px);
}

.ada-ki-berater__avatar-button,
.ada-ki-berater__prompt { pointer-events: auto; }

.ada-ki-berater__avatar-button {
  flex: 0 0 auto;
  border: 0 !important;
  background: transparent !important;
  color: transparent !important;
  padding: 0;
  width: clamp(340px, 27vw, 520px);
  height: auto;
  aspect-ratio: 1270 / 1904;
  max-height: min(78vh, 720px);
  cursor: pointer;
  overflow: visible;
  outline: 0 !important;
  box-shadow: none !important;
}

.ada-ki-berater__avatar-button:focus-visible,
.ada-ki-berater__prompt:focus-visible,
.ada-ki-berater__close:focus-visible,
.ada-ki-berater__option:focus-visible,
.ada-ki-berater__next:focus-visible {
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(112, 69, 232, .28) !important;
}

.ada-ki-berater__avatar,
.ada-ki-berater__dialog-avatar {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 16px rgba(17, 29, 48, .16));
  transition: opacity .16s ease, transform .16s ease;
}

.ada-ki-berater__avatar-button:hover .ada-ki-berater__avatar { transform: translateY(-3px); }
.ada-ki-berater__pose-in { animation: ada-ki-pose-in .28s ease both; }
@keyframes ada-ki-pose-in { from { opacity: .25; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.ada-ki-berater__prompt {
  position: relative;
  z-index: 2;
  flex: 0 1 360px;
  min-width: 0;
  width: min(360px, calc(100vw - 20px));
  max-width: 100%;
  /* The invitation is a clean, borderless card.  A solid fill keeps page
   * copy, hover overlays and diagnostic outlines from bleeding into it. */
  border: 0 !important;
  border-radius: 18px;
  background: #fff !important;
  background-color: rgb(255, 255, 255) !important;
  background-image: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  opacity: 1;
  mix-blend-mode: normal;
  box-shadow: var(--ada-ki-shadow);
  padding: 15px 17px 16px;
  text-align: left;
  color: var(--ada-ki-ink);
  cursor: pointer;
  outline: none !important;
}

.ada-ki-berater__prompt:hover { box-shadow: 0 20px 52px rgba(15, 26, 43, .24); }
.ada-ki-berater__prompt:focus-visible { outline: none !important; }
.ada-ki-berater__eyebrow { display: block; color: #7045e8; font-size: 11px; font-weight: 800; letter-spacing: .10em; margin-bottom: 8px; }
.ada-ki-berater__prompt-text { display: block; max-width: 100%; font-size: 15px; line-height: 1.28; font-weight: 700; overflow-wrap: anywhere; hyphens: auto; white-space: normal; }
.ada-ki-berater__prompt-link { display: block; margin-top: 14px; font-size: 13px; font-weight: 800; }
.ada-ki-berater__prompt-link span { color: #7045e8; font-size: 18px; }

.ada-ki-berater__dialog[hidden] { display: none; }
.ada-ki-berater__dialog { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: clamp(12px, 4vw, 40px); }
.ada-ki-berater__backdrop { position: absolute; inset: 0; z-index: 0; background: rgba(11, 23, 37, .72); backdrop-filter: blur(7px); }
.ada-ki-berater__shell { position: relative; z-index: 1; width: min(1120px, 100%); max-height: min(780px, 94vh); overflow: auto; display: grid; grid-template-columns: minmax(320px, 42%) minmax(0, 1fr); background: #fff; border: 0 !important; border-radius: 24px; box-shadow: 0 28px 90px rgba(0,0,0,.35); }
.ada-ki-berater__figure-panel { position: relative; z-index: 2; min-height: 660px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 20px 14px 22px; overflow: hidden; background: linear-gradient(155deg, #f8fbfa 0%, #eef5f1 100%); }
.ada-ki-berater__figure-orbit { position: absolute; width: 82%; aspect-ratio: 1; border: 1px solid rgba(112,69,232,.32); border-radius: 50%; transform: rotate(-16deg); }
.ada-ki-berater__dialog-avatar { position: relative; z-index: 3; width: min(100%, 520px); height: min(760px, 84vh); object-position: center bottom; }
.ada-ki-berater__figure-caption { position: relative; z-index: 2; margin: 4px 0 0; color: var(--ada-ki-purple); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.ada-ki-berater__content { position: relative; z-index: 3; min-width: 0; padding: clamp(26px, 4vw, 46px); color: var(--ada-ki-ink); }
.ada-ki-berater__close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border: 0 !important; border-radius: 50%; background: #fff !important; color: var(--ada-ki-muted) !important; font-size: 25px; line-height: 1; cursor: pointer; box-shadow: 0 3px 12px rgba(15, 26, 43, .12); }
.ada-ki-berater__kicker { margin: 0 42px 10px 0; color: var(--ada-ki-purple); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ada-ki-berater__content h2 { max-width: 100%; margin: 0 48px 12px 0; font-size: clamp(24px, 3vw, 36px); line-height: 1.14; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; hyphens: auto; }
.ada-ki-berater__intro { margin: 0 0 22px; color: var(--ada-ki-muted); font-size: 15px; line-height: 1.5; }
.ada-ki-berater__reaction { margin: 0 0 14px; padding: 11px 13px; border-radius: 12px; background: #f7f3ff; color: var(--ada-ki-purple); font-size: 13px; line-height: 1.45; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(112, 69, 232, .14); }
.ada-ki-berater__progress { margin-bottom: 8px; color: var(--ada-ki-purple); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.ada-ki-berater__question { margin: 0 0 15px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.ada-ki-berater__options { display: grid; gap: 9px; }
.ada-ki-berater__option,
.ada-ki-berater__next { width: 100%; border-radius: 12px; padding: 13px 15px; text-align: left; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.ada-ki-berater__option { border: 0 !important; background: #f8fafc !important; color: var(--ada-ki-ink) !important; box-shadow: inset 0 0 0 1px rgba(23, 35, 54, .12); }
.ada-ki-berater__option:hover, .ada-ki-berater__option:focus-visible { border: 0 !important; background: #f7f3ff !important; outline: none; box-shadow: inset 0 0 0 2px rgba(112, 69, 232, .28); }
.ada-ki-berater__free-text { width: 100%; margin-top: 12px; resize: vertical; min-height: 74px; border: 0 !important; border-radius: 12px; padding: 12px 14px; background: #fff !important; color: var(--ada-ki-ink) !important; font: inherit; font-size: 14px; box-shadow: inset 0 0 0 1px rgba(23, 35, 54, .14); }
.ada-ki-berater__next { margin-top: 10px; border: 0 !important; background: #f7f3ff !important; color: var(--ada-ki-purple) !important; text-align: center; box-shadow: inset 0 0 0 1px rgba(112, 69, 232, .24); }
.ada-ki-berater__result { display: grid; gap: 12px; padding: 18px; border-radius: 16px; background: #edf8f4; color: var(--ada-ki-ink); }
.ada-ki-berater__result strong { font-size: 19px; }
.ada-ki-berater__result span { color: var(--ada-ki-muted); line-height: 1.45; }
.ada-ki-berater__result .ada-ki-berater__technique { color: var(--ada-ki-purple); font-size: 13px; font-weight: 800; }
.ada-ki-berater__result .ada-ki-berater__application-note { font-size: 13px; }
.ada-ki-berater__result a { color: var(--ada-ki-purple); font-weight: 800; text-decoration: none; }
.ada-ki-berater__lead-open,
.ada-ki-berater__lead-submit { width: 100%; border: 0 !important; border-radius: 12px; padding: 12px 14px; background: var(--ada-ki-purple) !important; color: #fff !important; font: inherit; font-size: 14px; font-weight: 800; text-align: center; cursor: pointer; box-shadow: none !important; }
.ada-ki-berater__lead { display: grid; gap: 10px; margin-top: 14px; padding: 16px; border-radius: 16px; background: #f7f3ff; color: var(--ada-ki-ink); }
.ada-ki-berater__lead-title { margin: 0 0 2px; font-weight: 800; }
.ada-ki-berater__lead label:not(.ada-ki-berater__consent) { display: grid; gap: 5px; color: var(--ada-ki-muted); font-size: 12px; font-weight: 700; }
.ada-ki-berater__lead input[type="text"],
.ada-ki-berater__lead input[type="email"],
.ada-ki-berater__lead input[type="tel"],
.ada-ki-berater__lead input[type="url"] { width: 100%; min-height: 42px; border: 0 !important; border-radius: 10px; padding: 10px 12px; background: #fff !important; color: var(--ada-ki-ink) !important; font: inherit; font-size: 14px; box-shadow: inset 0 0 0 1px rgba(23, 35, 54, .14); }
.ada-ki-berater__consent { display: flex; align-items: flex-start; gap: 8px; color: var(--ada-ki-muted); font-size: 12px; line-height: 1.4; }
.ada-ki-berater__consent input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--ada-ki-purple); }
.ada-ki-berater__lead-status { min-height: 1.2em; margin: 0; color: var(--ada-ki-muted); font-size: 12px; line-height: 1.4; }

/* On desktop the advisor must never cover the primary hero copy.  Keep the
 * larger figure in the image zone on the right, where it remains visible but
 * leaves the H1, lead and primary CTA readable. */
@media (min-width: 768px) {
  .ada-ki-berater__launcher {
    left: auto;
    right: clamp(12px, 2vw, 32px);
    width: min(680px, calc(100vw - 24px));
  }
  .ada-ki-berater__avatar-button { width: clamp(420px, 36vw, 660px); max-height: min(82vh, 760px); }
  .ada-ki-berater__prompt { flex-basis: 300px; width: min(300px, calc(100vw - 20px)); }
}

@media (max-width: 767px) {
  /* The modal keeps the intentionally large advisor portrait.  The fixed
   * invitation is a different surface: it must not cover the first mobile
   * headline or create a fractional-pixel horizontal scrollbar.  Elementor
   * can retain a few pixels of intrinsic H1 width even when the visible
   * lines fit; clip that page-level artefact only on pages carrying the
   * advisor, never on unrelated pages. */
  html:has(#ada-ki-berater),
  body:has(#ada-ki-berater) { overflow-x: clip; }
  .ada-ki-berater { max-width: 100vw; overflow-x: clip; }
  .ada-ki-berater__launcher { left: 8px; right: auto; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); max-width: calc(100vw - 16px); gap: 8px; }
  .ada-ki-berater__avatar-button { width: clamp(170px, 46vw, 220px); max-height: 28vh; }
  .ada-ki-berater__prompt { flex: 1 1 auto; min-width: 0; width: auto; max-width: none; padding: 12px 14px; }
  .ada-ki-berater__prompt-text { font-size: 14px; line-height: 1.3; }
  .ada-ki-berater__prompt-link { margin-top: 10px; }
  .ada-ki-berater__dialog { padding: 8px; place-items: center; }
  .ada-ki-berater__shell { width: min(520px, 100%); max-height: calc(100dvh - 16px); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; }
  .ada-ki-berater__figure-panel { min-height: 380px; height: clamp(380px, 58vh, 520px); max-height: 520px; padding: 5px 12px 4px; flex: 0 0 auto; }
  .ada-ki-berater__dialog-avatar { width: min(420px, 102vw); height: 100%; }
  .ada-ki-berater__figure-caption { font-size: 9px; }
  .ada-ki-berater__content { min-height: 0; padding: 22px 18px 20px; overflow: auto; }
  .ada-ki-berater__content h2 { font-size: 24px; margin-right: 36px; overflow-wrap: anywhere; }
  .ada-ki-berater__intro { font-size: 14px; margin-bottom: 16px; }
  .ada-ki-berater__question { font-size: 16px; }
}
