.innvotek-chatbot-root {
  --innvotek-bg: #1c1917;
  --innvotek-panel: #ffffff;
  --innvotek-accent: #f47621;
  --innvotek-accent-soft: rgba(244, 118, 33, 0.15);
  --innvotek-muted: #64748b;
  --innvotek-launcher-size: 72px;
  --innvotek-ripple-extra: 24px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  box-sizing: border-box;
}

.innvotek-chatbot-root *,
.innvotek-chatbot-root *::before,
.innvotek-chatbot-root *::after {
  box-sizing: border-box;
}

.innvotek-chatbot-root--inline {
  max-width: 420px;
  margin: 1.5rem 0;
}

.innvotek-chatbot-floating {
  --innvotek-ripple-dur: 2.5s;
  --innvotek-ripple-stagger: 1.25s;
  --innvotek-ripple-op: 0.72;
  --innvotek-ripple-scale: 1.28;
  --innvotek-ripple-border-a: 0.58;
  --innvotek-ripple-glow-a: 0.32;
  position: fixed;
  z-index: 99999;
  bottom: 1rem;
  right: 1rem;
  left: auto;
  width: calc(var(--innvotek-launcher-size) + var(--innvotek-ripple-extra) * 2);
  height: calc(var(--innvotek-launcher-size) + var(--innvotek-ripple-extra) * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.innvotek-chatbot-floating .innvotek-chatbot-toggle {
  pointer-events: auto;
}

.innvotek-chatbot-floating::before,
.innvotek-chatbot-floating::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--innvotek-launcher-size);
  height: var(--innvotek-launcher-size);
  margin-left: calc(var(--innvotek-launcher-size) / -2);
  margin-top: calc(var(--innvotek-launcher-size) / -2);
  border-radius: 50%;
  border: 3px solid rgba(244, 118, 33, var(--innvotek-ripple-border-a, 0.58));
  box-shadow:
    0 0 0 2px rgba(244, 118, 33, calc(var(--innvotek-ripple-glow-a, 0.32) * 0.55)),
    0 0 28px 8px rgba(244, 118, 33, var(--innvotek-ripple-glow-a, 0.32));
  animation: innvotek-ripple-wave var(--innvotek-ripple-dur, 2.5s) ease-out infinite;
  pointer-events: none;
  z-index: 0;
}

.innvotek-chatbot-floating::after {
  animation-delay: var(--innvotek-ripple-stagger, 1.25s);
}

@keyframes innvotek-ripple-wave {
  0% {
    transform: scale(1);
    opacity: var(--innvotek-ripple-op, 0.72);
  }
  55% {
    opacity: calc(var(--innvotek-ripple-op, 0.72) * 0.48);
  }
  100% {
    transform: scale(var(--innvotek-ripple-scale, 1.28));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .innvotek-chatbot-floating::before,
  .innvotek-chatbot-floating::after {
    animation: none;
    opacity: 0;
  }
}

.innvotek-chatbot-floating.innvotek-chatbot-floating--left {
  right: auto;
  left: 1rem;
}

.innvotek-chatbot-toggle {
  position: relative;
  z-index: 1;
  width: var(--innvotek-launcher-size);
  height: var(--innvotek-launcher-size);
  border-radius: 50%;
  border: none;
  background: var(--innvotek-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(244, 118, 33, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.innvotek-chatbot-toggle:focus-visible {
  outline: 3px solid rgba(244, 118, 33, 0.5);
  outline-offset: 2px;
}

.innvotek-chatbot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(244, 118, 33, 0.5);
}

.innvotek-chatbot-toggle--image:hover {
  box-shadow:
    0 14px 32px rgba(244, 118, 33, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.28);
}

.innvotek-chatbot-toggle--image {
  background: transparent;
  padding: 0;
  overflow: hidden;
  border: none;
  box-shadow:
    0 10px 28px rgba(244, 118, 33, 0.42),
    0 0 0 2px rgba(255, 255, 255, 0.28);
}

.innvotek-chatbot-toggle-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
}

/*
 * Main sites often ship global button/img rules (min-height, padding, max-width:100% + height:auto on img).
 * Lock the floating launcher to a perfect circle so it cannot collapse into a tall strip.
 */
.innvotek-chatbot-floating.innvotek-chatbot-root button.innvotek-chatbot-toggle {
  width: var(--innvotek-launcher-size) !important;
  height: var(--innvotek-launcher-size) !important;
  min-width: var(--innvotek-launcher-size) !important;
  min-height: var(--innvotek-launcher-size) !important;
  max-width: var(--innvotek-launcher-size) !important;
  max-height: var(--innvotek-launcher-size) !important;
  aspect-ratio: 1 / 1;
  border-radius: 9999px !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box !important;
  appearance: none;
  -webkit-appearance: none;
}

.innvotek-chatbot-floating.innvotek-chatbot-root .innvotek-chatbot-toggle-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 50% !important;
  display: block !important;
}

.innvotek-chatbot-panel {
  position: absolute;
  bottom: calc(var(--innvotek-launcher-size) + var(--innvotek-ripple-extra) + 0.75rem);
  right: 0;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 6rem));
  background: var(--innvotek-panel);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(244, 118, 33, 0.22);
}

/* pointer-events inherits; parent .innvotek-chatbot-floating is none — re-enable hits on the panel subtree */
.innvotek-chatbot-floating > .innvotek-chatbot-panel {
  pointer-events: auto;
  z-index: 2;
}

.innvotek-chatbot-floating--left .innvotek-chatbot-panel {
  right: auto;
  left: 0;
}

.innvotek-chatbot-root--inline .innvotek-chatbot-panel {
  position: relative;
  bottom: auto;
  right: auto;
  left: auto;
  width: 100%;
  max-height: 480px;
}

.innvotek-chatbot-header {
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #292524 0%, var(--innvotek-bg) 55%, #0c0a09 100%);
  color: #fafaf9;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 3px solid var(--innvotek-accent);
  position: relative;
  isolation: isolate;
}

.innvotek-chatbot-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.innvotek-chatbot-logo-mark {
  flex-shrink: 0;
  color: var(--innvotek-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(244, 118, 33, 0.45));
}

.innvotek-chatbot-logo-img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.innvotek-chatbot-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.innvotek-chatbot-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
}

.innvotek-chatbot-close:hover {
  background: rgba(248, 250, 252, 0.12);
}

.innvotek-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: linear-gradient(180deg, #fafaf9 0%, #f4f4f5 100%);
}

.innvotek-chatbot-welcome {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.innvotek-chatbot-welcome--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.innvotek-chatbot-welcome-inner {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-left: 4px solid var(--innvotek-accent);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: 0 4px 20px rgba(244, 118, 33, 0.08);
}

.innvotek-chatbot-welcome-text {
  margin: 0;
  font-size: 0.98rem;
  color: #1c1917;
  line-height: 1.5;
  min-height: 1.5em;
}

.innvotek-chatbot-welcome--typing .innvotek-chatbot-welcome-text::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--innvotek-accent);
  animation: innvotek-chatbot-caret 0.7s step-end infinite;
}

.innvotek-chatbot-welcome--done .innvotek-chatbot-welcome-text::after {
  display: none;
}

@keyframes innvotek-chatbot-caret {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .innvotek-chatbot-welcome {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .innvotek-chatbot-welcome--typing .innvotek-chatbot-welcome-text::after {
    animation: none;
    opacity: 0.6;
  }
}

.innvotek-chatbot-msg {
  max-width: 88%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.innvotek-chatbot-msg--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e7e5e4;
  color: #1c1917;
}

.innvotek-chatbot-msg--user {
  align-self: flex-end;
  background: var(--innvotek-accent);
  color: #fff;
}

.innvotek-chatbot-typing {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.65rem 0.85rem;
}

.innvotek-chatbot-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  height: 1rem;
}

.innvotek-chatbot-typing-dot {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--innvotek-muted);
  animation: innvotek-chatbot-typing-bounce 1.05s ease-in-out infinite;
}

.innvotek-chatbot-typing-dot:nth-child(1) {
  animation-delay: 0ms;
}

.innvotek-chatbot-typing-dot:nth-child(2) {
  animation-delay: 160ms;
}

.innvotek-chatbot-typing-dot:nth-child(3) {
  animation-delay: 320ms;
}

@keyframes innvotek-chatbot-typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .innvotek-chatbot-typing-dot {
    animation: none;
    opacity: 0.65;
  }
}

.innvotek-chatbot-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e7e5e4;
  background: #fff;
}

.innvotek-chatbot-input {
  flex: 1;
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

.innvotek-chatbot-input:focus {
  outline: 2px solid rgba(244, 118, 33, 0.35);
  outline-offset: 1px;
  border-color: var(--innvotek-accent);
}

.innvotek-chatbot-send {
  border: none;
  border-radius: 10px;
  padding: 0 1rem;
  background: var(--innvotek-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.innvotek-chatbot-send:hover {
  filter: brightness(1.05);
}

.innvotek-chatbot-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Themes often restyle inputs/buttons globally — lock panel chrome inside the widget root. */
.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-brand {
  position: relative !important;
  z-index: 0 !important;
  min-width: 0 !important;
  max-width: calc(100% - 3rem) !important;
  overflow: hidden !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-logo-img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-close {
  position: relative !important;
  z-index: 6 !important;
  pointer-events: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 2.25rem !important;
  min-height: 2.25rem !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 0 0 auto !important;
  padding: 0.2rem 0.45rem !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #fafaf9 !important;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-close:hover {
  background: rgba(248, 250, 252, 0.14) !important;
  color: #fafaf9 !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-form {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  padding: 0.75rem !important;
  background: #fff !important;
  border: none !important;
  border-top: 1px solid #e7e5e4 !important;
  box-sizing: border-box !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.55rem 0.65rem !important;
  border: 1px solid #d6d3d1 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #1c1917 !important;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-input::placeholder {
  color: #78716c !important;
  opacity: 1 !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-input:focus {
  outline: 2px solid rgba(244, 118, 33, 0.35) !important;
  outline-offset: 1px !important;
  border-color: var(--innvotek-accent) !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-send {
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 4.5rem !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0.55rem 1rem !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  background: var(--innvotek-accent) !important;
  color: #fff !important;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-send:hover {
  filter: brightness(1.05) !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel .innvotek-chatbot-send:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

.innvotek-chatbot-root.innvotek-chatbot-floating > .innvotek-chatbot-panel {
  pointer-events: auto !important;
  z-index: 2 !important;
}

.innvotek-chatbot-hidden {
  display: none !important;
}

.innvotek-chatbot-root .innvotek-chatbot-panel.innvotek-chatbot-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
