#if-assistant {
  --if-primary: #1E90C8;
  --if-secondary: #17B89A;
  --if-success: #2EAE8F;
  --if-text-primary: #0D1F2D;
  --if-text-secondary: #4A6580;
  --if-text-muted: #8BA3BA;
  --if-shadow-orb: 0 10px 24px -4px rgba(30,144,200,0.5), 0 4px 10px -2px rgba(23,184,154,0.3);
  --if-shadow-panel: 0 16px 48px rgba(15,76,129,0.14), 0 4px 12px rgba(15,76,129,0.06);
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'DM Sans', system-ui, sans-serif;
}

#if-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
}
#if-btn:focus-visible {
  outline: 2px solid var(--if-primary);
  outline-offset: 4px;
  border-radius: 50%;
}

#if-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,144,200,0.32) 0%, transparent 70%);
  animation: ifRing 3s ease-out infinite;
  pointer-events: none;
}

#if-orb-wrap {
  position: absolute;
  inset: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#if-orb {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #2EAE8F 0%, #17B89A 35%, #1E90C8 100%);
  box-shadow:
    inset -6px -8px 14px rgba(15,76,129,0.45),
    inset 4px 5px 12px rgba(224,245,239,0.55),
    var(--if-shadow-orb);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: ifBreath 3.5s ease-in-out infinite;
}

.if-orb-highlight {
  position: absolute;
  top: 16%;
  left: 22%;
  width: 16px;
  height: 11px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  transform: rotate(-25deg);
  pointer-events: none;
}

.if-orb-shadow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 8px;
  background: radial-gradient(ellipse, rgba(15,76,129,0.35) 0%, transparent 70%);
  filter: blur(3px);
  z-index: -1;
}

#if-face { position: relative; z-index: 2; }
#if-eyes {
  transform-origin: center;
  transform-box: fill-box;
  animation: ifBlink 4.5s infinite;
}

#if-hand {
  position: absolute;
  top: -8px;
  right: -10px;
  width: 26px;
  height: 26px;
  z-index: 4;
  opacity: 0;
  transform: scale(0.4) rotate(-20deg);
  transform-origin: bottom left;
  pointer-events: none;
}
#if-hand svg { filter: drop-shadow(0 2px 4px rgba(15,76,129,0.25)); }

#if-btn:hover #if-orb {
  transform: scale(1.1) rotate(6deg);
  animation: none;
}
#if-btn:active #if-orb { transform: scale(0.94); }

#if-orb.flip   { animation: ifFlip   0.9s cubic-bezier(0.5, 0, 0.5, 1) !important; }
#if-orb.bounce { animation: ifBounce 0.9s ease-in-out !important; }
#if-orb.shake  { animation: ifShake  0.7s ease-in-out !important; }
#if-orb.spin   { animation: ifSpin   1.2s cubic-bezier(0.45, 0, 0.55, 1) !important; }
#if-hand.wave  { animation: ifHandWave 1.6s ease-in-out !important; }

#if-panel {
  position: absolute;
  bottom: 84px;
  right: 0;
  width: 300px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--if-shadow-panel);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transform-origin: bottom right;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#if-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.if-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15,76,129,0.08);
}
.if-panel-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--if-primary) 0%, var(--if-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}
.if-panel-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: var(--if-success);
  border-radius: 50%;
  border: 2px solid white;
}
.if-panel-info { flex: 1; }
.if-panel-title {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--if-text-primary);
}
.if-panel-status {
  font-size: 11px;
  color: var(--if-success);
  font-weight: 500;
}
.if-panel-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--if-text-muted);
  padding: 4px;
  border-radius: 6px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.if-panel-close:hover {
  background: rgba(15,76,129,0.06);
  color: var(--if-text-primary);
}

.if-panel-greeting {
  background: linear-gradient(135deg, rgba(30,144,200,0.08) 0%, rgba(23,184,154,0.06) 100%);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--if-text-primary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.if-panel-actions { display: flex; flex-direction: column; gap: 6px; }
.if-quick {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(30,144,200,0.15);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--if-text-primary);
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: background 0.2s, border-color 0.2s;
}
.if-quick i { font-size: 15px; }
.if-quick[data-action="qr"]      i { color: var(--if-primary); }
.if-quick[data-action="plan"]    i { color: var(--if-secondary); }
.if-quick[data-action="demo"]    i { color: var(--if-success); }
.if-quick[data-action="contact"] i { color: var(--if-text-secondary); }
.if-quick:hover {
  background: rgba(30,144,200,0.08);
  border-color: rgba(30,144,200,0.3);
}

.if-panel-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,76,129,0.08);
  font-size: 11px;
  color: var(--if-text-muted);
  text-align: center;
}

@keyframes ifBreath {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.04) translateY(-2px); }
}
@keyframes ifRing {
  0%   { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes ifFlip {
  0%   { transform: rotateY(0) scale(1); }
  50%  { transform: rotateY(180deg) scale(1.05); }
  100% { transform: rotateY(360deg) scale(1); }
}
@keyframes ifBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30%      { transform: translateY(-12px) scale(1.06); }
  55%      { transform: translateY(0) scale(0.94); }
  75%      { transform: translateY(-5px) scale(1.02); }
}
@keyframes ifShake {
  0%, 100% { transform: rotate(0); }
  20%      { transform: rotate(-12deg); }
  40%      { transform: rotate(10deg); }
  60%      { transform: rotate(-8deg); }
  80%      { transform: rotate(6deg); }
}
@keyframes ifSpin {
  0%   { transform: rotate(0) scale(1); }
  50%  { transform: rotate(180deg) scale(0.95); }
  100% { transform: rotate(360deg) scale(1); }
}
@keyframes ifHandWave {
  0%   { opacity: 0; transform: scale(0.4) rotate(-30deg); }
  15%  { opacity: 1; transform: scale(1) rotate(-20deg); }
  35%  { transform: scale(1) rotate(15deg); }
  55%  { transform: scale(1) rotate(-15deg); }
  75%  { transform: scale(1) rotate(10deg); }
  90%  { opacity: 1; transform: scale(1) rotate(-5deg); }
  100% { opacity: 0; transform: scale(0.4) rotate(0); }
}
@keyframes ifBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 98%      { transform: scaleY(0.1); }
}

@media (prefers-reduced-motion: reduce) {
  #if-orb, #if-ring, #if-eyes, #if-hand,
  #if-orb.flip, #if-orb.bounce, #if-orb.shake, #if-orb.spin, #if-hand.wave {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  #if-assistant { bottom: 16px; right: 16px; }
  #if-btn { width: 56px; height: 56px; }
  #if-panel { width: calc(100vw - 32px); max-width: 300px; }
}
