.abaco-ai-root {
  --abaco-brand: #f07d00;
  --abaco-ink-900: #0f1c34;
  --abaco-ink-700: #334a75;
  --abaco-surface: #ffffff;
  --abaco-surface-soft: #f8fafc;
  --abaco-stroke: rgba(12, 31, 71, 0.14);
  --abaco-focus: #1363df;
  --abaco-shadow-strong: 0 34px 72px rgba(9, 22, 52, 0.34);
  --abaco-shadow-soft: 0 14px 28px rgba(9, 22, 52, 0.22);
  --abaco-ease: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.abaco-ai-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #f07d00 !important;
  background-color: #f07d00 !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(240, 125, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  cursor: pointer;
  z-index: 2147483000;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  appearance: none;
  -webkit-appearance: none;
  overflow: visible;
  padding: 0;
  line-height: 0;
  position: fixed;
  opacity: 1 !important;
  visibility: visible !important;
  isolation: isolate;
  transition: transform var(--abaco-ease), box-shadow var(--abaco-ease), filter var(--abaco-ease);
}

.abaco-ai-bubble:hover,
.abaco-ai-bubble:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 30px rgba(240, 125, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.34) inset;
  filter: saturate(1.05);
}

.abaco-ai-bubble:focus-visible,
.abaco-ai-close:focus-visible {
  outline: 2px solid var(--abaco-focus);
  outline-offset: 2px;
}

.abaco-ai-icon {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  transform: translateY(1px) scale(1.03);
}

.abaco-ai-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor !important;
  color: #ffffff !important;
}

.abaco-ai-beta {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(140deg, #ffffff 0%, #f4f6fa 100%);
  color: #4f5f80;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(18, 40, 84, 0.2);
  box-shadow: 0 7px 14px rgba(12, 25, 52, 0.18);
  text-transform: none;
  white-space: normal;
  text-align: left;
  width: max-content;
  max-width: min(60vw, 340px);
  pointer-events: none;
}

.abaco-ai-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 12%, rgba(27, 49, 91, 0.3) 0%, rgba(7, 11, 23, 0.58) 72%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: abaco-fade-in var(--abaco-ease) both;
  z-index: 2147483001;
}

.abaco-ai-overlay[hidden],
.abaco-ai-modal[hidden] {
  display: none !important;
}

.abaco-ai-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(84vw, 1220px);
  height: min(84vh, 900px);
  background: var(--abaco-surface);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--abaco-stroke);
  box-shadow: var(--abaco-shadow-strong);
  animation: abaco-modal-in 300ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
  z-index: 2147483002;
}

.abaco-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 18px;
  min-height: 60px;
  background: linear-gradient(130deg, #f8fbff 0%, #eef3fa 100%);
  border-bottom: 1px solid rgba(10, 42, 102, 0.1);
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.abaco-ai-title {
  margin: 0;
  font-size: 15px;
  color: var(--abaco-ink-900);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.abaco-ai-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82) !important;
  color: var(--abaco-ink-900) !important;
  background-color: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid rgba(15, 33, 71, 0.08);
  appearance: none;
  -webkit-appearance: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--abaco-ease), background-color var(--abaco-ease), box-shadow var(--abaco-ease);
}

.abaco-ai-close:hover {
  background: #ffffff !important;
  color: var(--abaco-ink-900) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18, 36, 70, 0.14);
}

.abaco-ai-body {
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, var(--abaco-surface-soft) 0%, #f3f7fb 100%);
  padding: 10px;
}

.abaco-ai-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--abaco-shadow-soft);
}

.abaco-ai-lock-scroll,
.abaco-ai-lock-scroll body {
  overflow: hidden;
}

@keyframes abaco-bubble-intro {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes abaco-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes abaco-modal-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -47%) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .abaco-ai-bubble,
  .abaco-ai-overlay,
  .abaco-ai-modal,
  .abaco-ai-close {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .abaco-ai-bubble {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .abaco-ai-modal {
    width: min(94vw, 980px);
    height: min(90vh, 980px);
    border-radius: 18px;
  }

  .abaco-ai-header {
    padding: 12px 14px;
    min-height: 54px;
  }

  .abaco-ai-body {
    padding: 8px;
  }

  .abaco-ai-frame {
    border-radius: 12px;
  }

  .abaco-ai-beta {
    right: calc(100% + 10px);
    max-width: min(68vw, 260px);
    font-size: 11px;
    padding: 7px 10px;
  }
}
