/**
 * AI Frame Assist — zwevende chatwidget (v8.10.0)
 * Design system: licht, warm clay accent (#B7791F), Inter + Space Mono.
 * Prefix iax- (Elementor-proof, scoped op .iax-root).
 */
.iax-root {
  --iax-bg: #ffffff;
  --iax-page: #FAFAF7;
  --iax-border: #E6E4DD;
  --iax-fg1: #14140F;
  --iax-fg2: #5C5A52;
  --iax-fg3: #8A887E;
  --iax-accent: #B7791F;
  --iax-accent-h: #D69E2E;
  --iax-accent-dim: rgba(183, 121, 31, .08);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Launcher ── */
.iax-launcher {
  width: 54px; height: 54px; border-radius: 50%;
  background: #14140F; color: #FAFAF7;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(20, 20, 15, .28);
  transition: transform .18s ease, background .18s ease;
  position: relative;
}
.iax-launcher:hover { transform: translateY(-2px); background: #26261E; }
.iax-launcher .iax-launcher-close { display: none; }
.iax-root.open .iax-launcher .iax-launcher-icon { display: none; }
.iax-root.open .iax-launcher .iax-launcher-close { display: flex; }

/* ── Paneel ── */
.iax-panel {
  position: absolute; right: 0; bottom: 68px;
  width: 372px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 120px);
  background: var(--iax-bg);
  border: 1px solid var(--iax-border);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(20, 20, 15, .18);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.iax-root.open .iax-panel { opacity: 1; transform: none; pointer-events: auto; }

/* Kop */
.iax-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; background: #14140F; color: #FAFAF7;
  flex-shrink: 0;
}
.iax-head-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(250, 250, 247, .1); color: var(--iax-accent-h);
  display: flex; align-items: center; justify-content: center;
}
.iax-head-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.iax-head-txt strong { font-size: 13.5px; font-weight: 700; letter-spacing: .01em; }
.iax-head-txt span { font-size: 11px; color: rgba(250, 250, 247, .55); }
.iax-reset {
  margin-left: auto; width: 28px; height: 28px; border-radius: 8px;
  background: transparent; border: none; color: rgba(250, 250, 247, .55);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.iax-reset:hover { background: rgba(250, 250, 247, .1); color: #FAFAF7; }

/* Berichten */
.iax-berichten {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--iax-page);
  scroll-behavior: smooth;
}
.iax-msg {
  max-width: 86%; padding: 9px 12px; border-radius: 13px;
  font-size: 13px; line-height: 1.55; color: var(--iax-fg1);
  white-space: pre-wrap; overflow-wrap: break-word;
}
.iax-msg.iax-user {
  align-self: flex-end; background: #14140F; color: #FAFAF7;
  border-bottom-right-radius: 4px;
}
.iax-msg.iax-bot {
  align-self: flex-start; background: var(--iax-bg);
  border: 1px solid var(--iax-border); border-bottom-left-radius: 4px;
}
.iax-msg.iax-bot a { color: var(--iax-accent); font-weight: 600; text-decoration: none; }
.iax-msg.iax-bot a:hover { text-decoration: underline; }
.iax-msg.iax-fout { border-color: #E8C4C4; background: #FBF3F3; color: #8A3A3A; }

/* Feedback-duimpjes onder een botantwoord */
.iax-fb { display: flex; gap: 4px; align-self: flex-start; margin: -4px 0 0 4px; }
.iax-fb button {
  border: none; background: transparent; cursor: pointer; padding: 2px 4px;
  font-size: 12px; color: var(--iax-fg3); border-radius: 6px; line-height: 1;
}
.iax-fb button:hover { background: var(--iax-accent-dim); color: var(--iax-fg1); }
.iax-fb button.actief { color: var(--iax-accent); }
.iax-fb.klaar button:not(.actief) { opacity: .35; pointer-events: none; }

/* Typing-indicator */
.iax-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.iax-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--iax-fg3);
  animation: iax-blink 1.1s infinite ease-in-out;
}
.iax-typing i:nth-child(2) { animation-delay: .15s; }
.iax-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes iax-blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

/* Suggestie-chips */
.iax-suggesties {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px;
  background: var(--iax-page); flex-shrink: 0;
}
.iax-suggesties:empty { display: none; }
.iax-chip {
  border: 1px solid var(--iax-border); background: var(--iax-bg);
  border-radius: 999px; padding: 5px 11px; font-size: 11.5px;
  color: var(--iax-fg2); cursor: pointer; font-family: inherit;
  transition: border-color .15s ease, color .15s ease;
}
.iax-chip:hover { border-color: var(--iax-accent); color: var(--iax-accent); }

/* Invoer */
.iax-invoer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--iax-border);
  background: var(--iax-bg); flex-shrink: 0; margin: 0;
}
.iax-invoer textarea {
  flex: 1; resize: none; border: 1px solid var(--iax-border);
  border-radius: 11px; padding: 8px 11px; font-size: 13px; line-height: 1.45;
  font-family: inherit; color: var(--iax-fg1); background: var(--iax-page);
  max-height: 96px; outline: none; min-height: 36px;
}
.iax-invoer textarea:focus { border-color: var(--iax-accent); box-shadow: 0 0 0 3px var(--iax-accent-dim); }
.iax-verstuur {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: var(--iax-accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.iax-verstuur:hover { background: var(--iax-accent-h); }
.iax-verstuur:disabled { opacity: .45; cursor: default; }

/* Voet */
.iax-voet {
  padding: 6px 14px 9px; font-size: 10px; color: var(--iax-fg3);
  background: var(--iax-bg); text-align: center; flex-shrink: 0;
}
.iax-voet a { color: var(--iax-fg2); }

/* Mobiel */
@media (max-width: 640px) {
  .iax-root { right: 14px; bottom: 14px; }
  .iax-panel {
    position: fixed; right: 12px; left: 12px; bottom: 80px;
    width: auto; height: min(560px, calc(100dvh - 100px));
  }
  .iax-launcher { width: 50px; height: 50px; }
}

/* Upsell-nudge schuift boven de Assist-launcher zodra beide aanwezig zijn
   (dit bestand laadt alleen als de widget actief is, dus veilig globaal). */
body .imgx-nudge { bottom: 92px !important; }
@media (max-width: 600px) { body .imgx-nudge { bottom: 84px !important; } }
