/* =====================================================================
   ASK CAM — GLOBAL FLOATING ASSISTANT V2
   Clean chatbot launcher + panel. Uses existing backend endpoint.
   ===================================================================== */

.ai-cam-float {
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  z-index: 260 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  isolation: isolate;
  font-family: var(--ai4-font, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
}

/* Kill legacy decorative layers that created the blank white box. */
.ai-cam-float::before,
.ai-cam-float::after,
.ai-cam-launcher::before,
.ai-cam-launcher::after {
  content: none !important;
  display: none !important;
}

.ai-cam-launcher {
  min-width: 158px !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 8px 12px 8px 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  color: #f7fbfd !important;
  background: #18252d !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 38px rgba(20,32,39,.22), 0 2px 8px rgba(20,32,39,.10) !important;
  font: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
  overflow: hidden !important;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease !important;
}

.ai-cam-launcher:hover {
  transform: translateY(-2px) !important;
  background: #20313a !important;
  box-shadow: 0 20px 44px rgba(20,32,39,.26), 0 3px 10px rgba(20,32,39,.12) !important;
}

.ai-cam-launcher:focus-visible {
  outline: 3px solid rgba(65,124,154,.25) !important;
  outline-offset: 3px !important;
}

.ai-cam-launcher-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  color: #ffffff;
  background: #2e6078;
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

.ai-cam-launcher-icon svg {
  width: 21px;
  height: 21px;
}

.ai-cam-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  display: block;
  background: #59c48a;
  border: 2px solid #18252d;
  border-radius: 50%;
}

.ai-cam-launcher-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  flex: 1;
}

.ai-cam-launcher-copy strong {
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  letter-spacing: -.015em !important;
  line-height: 1.2 !important;
}

.ai-cam-launcher-copy small {
  color: rgba(255,255,255,.62) !important;
  font-size: 9.5px !important;
  font-weight: 580 !important;
  letter-spacing: .01em !important;
  line-height: 1.2 !important;
}

.ai-cam-launcher-chevron {
  width: 15px !important;
  height: 15px !important;
  flex: 0 0 15px;
  color: rgba(255,255,255,.55) !important;
  transition: transform 180ms ease !important;
}

.ai-cam-float.is-open .ai-cam-launcher-chevron {
  transform: rotate(90deg);
}

.ai-cam-panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 70px !important;
  width: min(390px, calc(100vw - 32px)) !important;
  height: min(590px, calc(100vh - 118px)) !important;
  min-height: 440px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none !important;
  grid-template-rows: auto auto minmax(0,1fr) auto;
  overflow: hidden !important;
  color: #182128 !important;
  background: #fff !important;
  border: 1px solid #dfe7eb !important;
  border-radius: 20px !important;
  box-shadow: 0 28px 80px rgba(29,43,51,.22), 0 5px 18px rgba(29,43,51,.08) !important;
  transform-origin: bottom right;
}

.ai-cam-float.is-open .ai-cam-panel {
  display: grid !important;
  animation: aiCamPanelIn 220ms cubic-bezier(.22,1,.36,1);
}

@keyframes aiCamPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-cam-head {
  min-height: 72px;
  padding: 13px 14px 13px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #18252d !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.ai-cam-head-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  color: #fff;
  background: #2e6078;
  border-radius: 13px;
}

.ai-cam-head-mark svg,
.ai-cam-welcome-mark svg {
  width: 21px;
  height: 21px;
}

.ai-cam-head-copy {
  min-width: 0;
  flex: 1;
}

.ai-cam-head-copy strong,
.ai-cam-head-copy small {
  display: block;
}

.ai-cam-head-copy strong {
  color: #fff !important;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -.015em;
}

.ai-cam-head-copy small {
  margin-top: 2px;
  color: rgba(255,255,255,.62) !important;
  font-size: 10px;
  font-weight: 520;
}

.ai-cam-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-cam-head-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.72) !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.ai-cam-head-action:hover {
  color: #fff !important;
  background: rgba(255,255,255,.08) !important;
}

.ai-cam-head-action svg {
  width: 15px;
  height: 15px;
}

.ai-cam-context {
  padding: 10px 15px;
  color: #617079 !important;
  background: #f7f9fa !important;
  border-bottom: 1px solid #e6ecef;
  font-size: 10.5px;
  line-height: 1.45;
}

.ai-cam-context strong {
  color: #31424c !important;
}

.ai-cam-float-messages {
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d0d9de transparent;
  background: #fff !important;
}

.ai-cam-float-welcome {
  margin: auto 0;
  padding: 20px 16px;
  text-align: center;
}

.ai-cam-welcome-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2e6078;
  border-radius: 15px;
}

.ai-cam-float-welcome h3 {
  margin: 0 0 7px;
  color: #172128 !important;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -.025em;
}

.ai-cam-float-welcome p {
  max-width: 290px;
  margin: 0 auto;
  color: #728089 !important;
  font-size: 11px;
  line-height: 1.55;
}

.ai-cam-float-suggestions {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.ai-cam-float-suggestions button {
  min-height: 36px;
  padding: 8px 11px;
  color: #3f505a !important;
  background: #f7f9fa !important;
  border: 1px solid #e2e9ed !important;
  border-radius: 10px;
  font: inherit;
  font-size: 10.5px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
}

.ai-cam-float-suggestions button:hover {
  color: #1f3948 !important;
  background: #edf3f6 !important;
  border-color: #d6e1e7 !important;
}

.ai-cam-float-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ai-cam-float-message.is-user {
  justify-content: flex-end;
}

.ai-cam-float-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  color: #fff;
  background: #2e6078;
  border-radius: 9px;
}

.ai-cam-float-avatar svg {
  width: 15px;
  height: 15px;
}

.ai-cam-float-bubble-wrap {
  max-width: 82%;
}

.ai-cam-float-bubble {
  padding: 10px 11px;
  color: #33434d !important;
  background: #f2f6f8 !important;
  border: 1px solid #e3eaee !important;
  border-radius: 4px 12px 12px 12px;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-cam-float-message.is-user .ai-cam-float-bubble {
  color: #fff !important;
  background: #203843 !important;
  border-color: #203843 !important;
  border-radius: 12px 4px 12px 12px;
}

.ai-cam-float-grounding {
  display: block;
  margin-top: 5px;
  color: #8a979f !important;
  font-size: 8.5px;
  line-height: 1.35;
}

.ai-cam-float-message.is-loading .ai-cam-float-bubble {
  color: #728089 !important;
  animation: aiCamPulse 1.15s ease-in-out infinite;
}

@keyframes aiCamPulse {
  50% { opacity: .55; }
}

.ai-cam-compose {
  padding: 11px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: end;
  background: #fff !important;
  border-top: 1px solid #e5ebee;
}

.ai-cam-compose textarea {
  min-height: 42px;
  max-height: 112px;
  padding: 10px 11px;
  resize: none;
  color: #172128 !important;
  background: #f7f9fa !important;
  border: 1px solid #dde6ea !important;
  border-radius: 11px !important;
  outline: none;
  font: inherit;
  font-size: 11px;
  line-height: 1.4;
}

.ai-cam-compose textarea:focus {
  border-color: #9eb8c6 !important;
  box-shadow: 0 0 0 3px rgba(75,120,143,.10) !important;
}

.ai-cam-compose textarea::placeholder {
  color: #97a2a9 !important;
}

.ai-cam-send {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff !important;
  background: #1c252a !important;
  border: 0 !important;
  border-radius: 11px !important;
  cursor: pointer;
}

.ai-cam-send:hover { background: #2b373e !important; }
.ai-cam-send:disabled { opacity: .5; cursor: wait; }
.ai-cam-send svg { width: 16px; height: 16px; }

.ai-cam-disabled {
  padding: 15px;
  color: #6f7e86 !important;
  background: #f8fafb !important;
  border-top: 1px solid #e4eaed;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 620px) {
  .ai-cam-float {
    right: 12px !important;
    bottom: 12px !important;
  }

  .ai-cam-launcher {
    min-width: 58px !important;
    width: 58px !important;
    min-height: 58px !important;
    padding: 9px !important;
    border-radius: 18px !important;
  }

  .ai-cam-launcher-copy,
  .ai-cam-launcher-chevron {
    display: none !important;
  }

  .ai-cam-launcher-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .ai-cam-panel {
    position: fixed !important;
    right: 12px !important;
    bottom: 82px !important;
    width: calc(100vw - 24px) !important;
    height: min(72vh, 590px) !important;
    min-height: 420px !important;
    border-radius: 18px !important;
  }
}

@media print {
  .ai-cam-float { display: none !important; }
}
