/* All selectors are prefixed to avoid changing the active theme. */
.bh-ai-consult-button,
.bh-ai-consult-modal {
  --bh-ai-bg: #f7f9fc;
  --bh-ai-surface: rgba(255, 255, 255, .88);
  --bh-ai-text: #172033;
  --bh-ai-muted: #526078;
  --bh-ai-border: rgba(62, 81, 112, .24);
  --bh-ai-accent: #2459c8;
  --bh-ai-accent-contrast: #fff;
  --bh-ai-focus: #ff9f1c;
  --bh-ai-shadow: 0 18px 60px rgba(20, 35, 70, .24);
}
.bh-ai-consult-button {
  position: fixed;
  /* Leave room for the active theme's fixed back-to-top control. */
  right: 7rem;
  bottom: 1rem;
  z-index: 9998;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  padding: .78rem 1.15rem;
  background: var(--bh-ai-button-background, var(--bh-ai-accent));
  color: var(--bh-ai-accent-contrast);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(13, 47, 126, .28);
  font: inherit;
}
.bh-ai-consult-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: auto;
  background: rgba(3, 11, 27, .62);
  color: var(--bh-ai-text);
  color-scheme: light dark;
}
.bh-ai-consult-modal[hidden] { display: none; }
/* Contract marker kept compact for older installations that inspect this rule. */
.bh-ai-consult-modal[hidden]{display:none}
.bh-ai-consult-dialog {
  position: relative;
  width: min(100%, 36rem);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--bh-ai-border);
  border-radius: 1rem;
  padding: 1.5rem;
  background: var(--bh-ai-surface);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: var(--bh-ai-shadow);
}
.bh-ai-consult-close {
  position: absolute;
  right: .75rem;
  top: .5rem;
  border: 0;
  background: transparent;
  color: var(--bh-ai-text);
  font-size: 1.5rem;
  cursor: pointer;
}
.bh-ai-consult-questions button,
.bh-ai-consult-free,
.bh-ai-consult-providers button,
.bh-ai-consult-copy {
  display: block;
  width: 100%;
  margin: .5rem 0;
  padding: .72rem .8rem;
  text-align: left;
  border: 1px solid var(--bh-ai-border);
  border-radius: .5rem;
  background: rgba(127, 151, 190, .13);
  color: var(--bh-ai-text);
  cursor: pointer;
  font: inherit;
}
.bh-ai-consult-questions button:hover,
.bh-ai-consult-free:hover,
.bh-ai-consult-providers button:hover,
.bh-ai-consult-copy:hover { background: rgba(36, 89, 200, .16); }
.bh-ai-consult-providers { border-top: 1px solid var(--bh-ai-border); margin-top: 1rem; padding-top: 1rem; }
.bh-ai-consult-providers-label { margin: 0 0 .75rem; color: var(--bh-ai-muted); font-weight: 600; }
.bh-ai-consult-fallback { margin-top: 1rem; color: var(--bh-ai-muted); }
.bh-ai-consult-free-form { margin: .75rem 0 1rem; padding: .75rem; border: 1px solid var(--bh-ai-border); border-radius: .65rem; background: rgba(127, 151, 190, .08); }
.bh-ai-consult-free-label { display: block; font-weight: 600; }
.bh-ai-consult-free-label span, .bh-ai-consult-free-help { color: var(--bh-ai-muted); font-size: .9rem; }
.bh-ai-consult-free-question { display: block; width: 100%; box-sizing: border-box; margin-top: .4rem; padding: .65rem; resize: vertical; border: 1px solid var(--bh-ai-border); border-radius: .5rem; background: rgba(127, 151, 190, .12); color: var(--bh-ai-text); font: inherit; line-height: 1.5; }
.bh-ai-consult-free-help { margin: .35rem 0; }
.bh-ai-consult-free-error { margin: .35rem 0; color: #b42318; font-weight: 600; }
.bh-ai-consult-free-submit { width: 100%; margin-top: .5rem; padding: .7rem .8rem; border: 1px solid var(--bh-ai-accent); border-radius: .5rem; background: var(--bh-ai-accent); color: var(--bh-ai-accent-contrast); cursor: pointer; font: inherit; }
.bh-ai-consult-prompt-label { display: block; margin-top: .75rem; font-size: .9rem; }
.bh-ai-consult-prompt {
  display: block;
  width: 100%;
  min-height: 10rem;
  box-sizing: border-box;
  margin-top: .35rem;
  padding: .75rem;
  resize: vertical;
  border: 1px solid var(--bh-ai-border);
  border-radius: .5rem;
  background: rgba(127, 151, 190, .12);
  color: var(--bh-ai-text);
  font: inherit;
  line-height: 1.5;
}
.bh-ai-consult-fallback-actions { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.bh-ai-consult-fallback-actions .bh-ai-consult-copy { width: auto; margin: 0; }
.bh-ai-consult-provider-link { display: inline-block; padding: .72rem .8rem; border: 1px solid var(--bh-ai-accent); border-radius: .5rem; color: var(--bh-ai-accent); text-decoration: none; }
.bh-ai-consult-provider-link:hover { background: rgba(36, 89, 200, .16); }
.bh-ai-consult-provider-link[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.bh-ai-consult-copy-status { display: block; min-height: 1.5em; margin-top: .35rem; color: var(--bh-ai-muted); }
.bh-ai-consult-button:focus-visible,
.bh-ai-consult-dialog button:focus-visible,
.bh-ai-consult-dialog a:focus-visible,
.bh-ai-consult-dialog textarea:focus-visible { outline: 3px solid var(--bh-ai-focus); outline-offset: 2px; }
.bh-ai-consult-free-submit:focus-visible { outline: 3px solid var(--bh-ai-focus); outline-offset: 2px; }
@media (prefers-color-scheme: dark) {
  .bh-ai-consult-button,
  .bh-ai-consult-modal {
    --bh-ai-bg: #0e1626;
    --bh-ai-surface: rgba(18, 29, 49, .9);
    --bh-ai-text: #f0f5ff;
    --bh-ai-muted: #bac7dc;
    --bh-ai-border: rgba(205, 222, 255, .24);
    --bh-ai-accent: #76a5ff;
    --bh-ai-accent-contrast: #081329;
    --bh-ai-focus: #ffd166;
  }
}
@media (prefers-color-scheme: dark) {
  .bh-ai-consult-free-error { color: #ffb4ab; }
}
@media (max-width: 40rem) {
  .bh-ai-consult-button {
    /* Keep clear of both the back-to-top control and the mobile footer menu. */
    right: 5.5rem;
    bottom: 3.5rem;
    bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }
  .bh-ai-consult-modal { align-items: end; padding: .5rem; }
  .bh-ai-consult-dialog { max-height: calc(100vh - 1rem); padding: 1rem; }
  .bh-ai-consult-fallback-actions { align-items: stretch; flex-direction: column; }
  .bh-ai-consult-fallback-actions .bh-ai-consult-copy { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .bh-ai-consult-modal *, .bh-ai-consult-modal { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
