#ibr-ai-root{
  --ibr-teal:#004D6D;
  --ibr-teal-bright:#0A6B8F;
  --ibr-yellow:#FFD500;
  --ibr-ink:#0B1C24;
  --ibr-muted:#5E7480;
  --ibr-soft:#DCEEF4;
  --ibr-panel:#F4F8FA;
  --ibr-bubble:#FBFCFD;
  position:fixed;
  right:18px;
  left:auto;
  bottom:18px;
  z-index:99998;
  font-family:"Rubik",system-ui,sans-serif;
  line-height:1.4;
  color:var(--ibr-ink);
}
#ibr-ai-root *,
#ibr-ai-root *::before,
#ibr-ai-root *::after{box-sizing:border-box}
#ibr-ai-root button{
  font-family:inherit;
  appearance:none;
  -webkit-appearance:none;
  margin:0;
  line-height:1.2;
}

#ibr-ai-toggle{
  width:56px;height:56px;border-radius:50%;border:0;cursor:pointer;
  padding:0;
  background:var(--ibr-teal);
  box-shadow:0 14px 30px rgba(7,21,28,.28);
  display:grid;place-items:center;
  transition:transform .2s cubic-bezier(.16,1,.3,1), background .2s ease;
}
#ibr-ai-toggle:hover{background:var(--ibr-teal-bright);transform:translateY(-2px)}
#ibr-ai-toggle .ibr-ai-toggle-icon,
#ibr-ai-toggle .ibr-ai-toggle-icon svg{display:block;width:24px;height:24px;line-height:0}
#ibr-ai-toggle .ibr-ai-toggle-icon path{fill:#FFD500!important}

#ibr-ai-panel{
  position:absolute;right:0;left:auto;bottom:68px;
  width:min(352px,calc(100vw - 24px));
  height:min(500px,calc(100vh - 96px));
  display:none;flex-direction:column;
  border-radius:26px;overflow:hidden;
  background:
    linear-gradient(180deg, rgba(244,248,250,.88) 0%, rgba(236,245,248,.84) 100%);
  border:1px solid rgba(0,77,109,.10);
  box-shadow:
    0 24px 50px rgba(7,21,28,.24),
    0 2px 0 rgba(255,255,255,.45) inset;
  backdrop-filter:blur(10px) saturate(1.12);
  -webkit-backdrop-filter:blur(10px) saturate(1.12);
}
#ibr-ai-root.is-open #ibr-ai-panel{display:flex}
#ibr-ai-panel[hidden]{display:none!important}
#ibr-ai-root.is-open #ibr-ai-panel[hidden]{display:flex!important}

#ibr-ai-head{
  flex:0 0 auto;
  background:linear-gradient(135deg,#004D6D 0%,#0A6B8F 100%);
  color:#F4F8FA;
  padding:12px 12px 12px 14px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
#ibr-ai-head-main{display:flex;align-items:center;gap:10px;min-width:0}
#ibr-ai-avatar{
  width:36px;height:36px;border-radius:50%;flex:0 0 auto;
  background:#FFD500;
  display:grid;place-items:center;
  box-shadow:0 4px 10px rgba(7,21,28,.18);
}
#ibr-ai-avatar svg{width:18px;height:18px;display:block}
#ibr-ai-avatar svg path{fill:#004D6D}
#ibr-ai-head strong{
  display:block;font-size:14px;font-weight:700;line-height:1.15;
  letter-spacing:.01em;
}
#ibr-ai-head span{
  display:block;font-size:11px;opacity:.84;font-weight:500;margin-top:2px;
}
#ibr-ai-close{
  width:30px!important;height:30px!important;
  min-width:30px!important;max-width:30px!important;
  padding:0!important;
  border-radius:50%!important;border:0;cursor:pointer;
  background:rgba(244,248,250,.14);color:#F4F8FA;
  font-size:18px;line-height:1;
  display:grid;place-items:center;
  flex:0 0 30px;
}
#ibr-ai-close:hover{background:rgba(244,248,250,.24)}

#ibr-ai-msgs{
  flex:1 1 auto;min-height:0;
  overflow-y:auto;overflow-x:hidden;
  padding:14px 12px 6px;
  display:flex;flex-direction:column;gap:10px;
  scrollbar-width:thin;
  scrollbar-color:rgba(0,77,109,.28) transparent;
}
.ibr-ai-row{display:flex;align-items:flex-end;gap:7px;max-width:100%}
.ibr-ai-row.bot{justify-content:flex-start}
.ibr-ai-row.user{justify-content:flex-end}
.ibr-ai-bubble-avatar{
  width:26px;height:26px;border-radius:50%;flex:0 0 auto;
  display:grid;place-items:center;
  background:var(--ibr-teal);
  box-shadow:0 3px 8px rgba(0,77,109,.18);
}
.ibr-ai-bubble-avatar svg{width:13px;height:13px;display:block}
.ibr-ai-bubble-avatar svg path{fill:#FFD500}
.ibr-ai-row.user .ibr-ai-bubble-avatar{
  order:2;background:var(--ibr-soft);color:var(--ibr-teal);
  font-size:9px;font-weight:700;letter-spacing:.02em;
}
.ibr-ai-msg{
  max-width:78%;
  padding:10px 12px;
  font-size:13.5px;line-height:1.45;
  color:var(--ibr-ink);
  word-break:break-word;
}
.ibr-ai-msg.bot{
  background:rgba(251,252,253,.94);
  border:1px solid rgba(0,77,109,.06);
  border-radius:16px 16px 16px 5px;
  box-shadow:0 8px 18px rgba(7,21,28,.06);
}
.ibr-ai-msg.user{
  background:rgba(220,238,244,.92);
  border-radius:16px 16px 5px 16px;
}
.ibr-ai-msg.err{
  max-width:92%;
  background:#FFF5F5;color:#8A1F1F;
  border:1px solid #F0C8C8;border-radius:14px;
}
.ibr-ai-msg a{color:var(--ibr-teal-bright);font-weight:650;text-decoration:underline;text-underline-offset:2px}
.ibr-ai-msg a:hover{opacity:.88}

#ibr-ai-typing{display:none;align-items:flex-end;gap:7px}
#ibr-ai-typing.is-on{display:flex}
#ibr-ai-typing .ibr-ai-msg{
  display:flex;gap:5px;align-items:center;min-width:52px;padding:12px 14px;
}
#ibr-ai-typing .dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--ibr-teal-bright);opacity:.4;
  animation:ibrAiBounce 1.15s infinite ease-in-out;
}
#ibr-ai-typing .dot:nth-child(2){animation-delay:.14s}
#ibr-ai-typing .dot:nth-child(3){animation-delay:.28s}
@keyframes ibrAiBounce{
  0%,80%,100%{transform:translateY(0);opacity:.35}
  40%{transform:translateY(-3px);opacity:1}
}

/* Compact floating chips — no heavy card eating the first screen */
#ibr-ai-chooser{
  flex:0 0 auto;
  margin:0;
  padding:2px 12px 10px;
  background:transparent;
  border:0;
  box-shadow:none;
}
#ibr-ai-chooser[hidden],
#ibr-ai-root.is-chatting #ibr-ai-chooser{display:none!important}
#ibr-ai-chooser-label{
  margin:0 0 6px 2px;
  font-size:10px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--ibr-teal);
  opacity:.72;
}
#ibr-ai-chips{
  display:flex;flex-wrap:wrap;gap:6px;
  padding:0;background:transparent;
  align-items:center;
}
#ibr-ai-chips button{
  border:0;cursor:pointer;
  border-radius:999px;
  padding:6px 11px;
  font-size:12px;font-weight:650;
  color:#F4F8FA;background:var(--ibr-teal);
  box-shadow:0 3px 8px rgba(0,77,109,.14);
  transition:transform .15s cubic-bezier(.16,1,.3,1), background .15s ease;
}
#ibr-ai-chips button:hover{background:var(--ibr-teal-bright);transform:translateY(-1px)}
#ibr-ai-chips button.ibr-chip-ghost{
  background:rgba(255,255,255,.42);
  color:var(--ibr-teal);
  border:1px solid rgba(0,77,109,.14);
  box-shadow:none;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
#ibr-ai-chips button.ibr-chip-ghost:hover{background:rgba(255,255,255,.72)}

#ibr-ai-composer{
  flex:0 0 auto;
  background:var(--ibr-teal);
  padding:10px 10px 8px;
}
#ibr-ai-form{
  display:flex;align-items:center;gap:8px;
  min-height:44px;
  padding:4px 4px 4px 14px;
  border-radius:999px;
  background:rgba(244,248,250,.14);
}
#ibr-ai-input{
  flex:1;min-width:0;border:0;outline:none;background:transparent;
  color:#F4F8FA;font-size:13.5px;font-weight:500;
  padding:0;margin:0;box-shadow:none;
}
#ibr-ai-input::placeholder{color:rgba(244,248,250,.68)}
#ibr-ai-send{
  width:36px!important;height:36px!important;
  min-width:36px!important;max-width:36px!important;
  flex:0 0 36px!important;
  padding:0!important;
  border:0;border-radius:50%!important;cursor:pointer;
  background:#FFD500!important;
  display:grid!important;place-items:center!important;
  box-shadow:0 6px 14px rgba(7,21,28,.18);
  transition:transform .15s cubic-bezier(.16,1,.3,1), filter .15s ease;
  overflow:visible;
}
#ibr-ai-send:hover{filter:brightness(1.04);transform:scale(1.05)}
#ibr-ai-send:disabled{opacity:.55;cursor:wait;transform:none}
#ibr-ai-send svg{
  width:16px!important;height:16px!important;
  min-width:16px;min-height:16px;
  display:block!important;
  pointer-events:none;
  flex:none;
}
#ibr-ai-send svg path{
  fill:#004D6D!important;
  stroke:none!important;
}
.ibr-ai-col{
  display:flex;flex-direction:column;gap:8px;
  max-width:min(86%, 280px);min-width:0;
}
.ibr-ai-col .ibr-ai-msg{max-width:100%}
.ibr-ai-previews{
  display:flex;flex-direction:column;gap:6px;
  width:100%;
  max-width:100%;
}
.ibr-ai-preview{
  display:flex!important;align-items:center;gap:8px;
  overflow:hidden;text-decoration:none!important;
  border-radius:12px;
  background:rgba(251,252,253,.96);
  border:1px solid rgba(0,77,109,.10);
  box-shadow:0 4px 12px rgba(7,21,28,.06);
  color:var(--ibr-ink);
  min-height:52px;
  max-height:58px;
  padding:0 8px 0 0;
  transition:transform .15s cubic-bezier(.16,1,.3,1), box-shadow .15s ease;
}
.ibr-ai-preview:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 16px rgba(7,21,28,.1);
}
.ibr-ai-preview-media{
  flex:0 0 52px;width:52px;height:52px;
  background:linear-gradient(135deg,#DCEEF4,#F4F8FA);
  overflow:hidden;
  border-radius:11px 0 0 11px;
}
.ibr-ai-preview-media img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.ibr-ai-preview-body{
  flex:1;min-width:0;padding:4px 4px 4px 0;
}
.ibr-ai-preview-title{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;
  font-size:11.5px;font-weight:700;line-height:1.25;
  color:var(--ibr-ink);
}
.ibr-ai-preview-host{
  display:block;margin-top:2px;
  font-size:10px;font-weight:600;letter-spacing:.02em;
  color:var(--ibr-teal-bright);opacity:.9;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ibr-ai-preview.is-loading .ibr-ai-preview-media{
  animation:ibrAiPulse 1.2s ease-in-out infinite;
}
@keyframes ibrAiPulse{
  0%,100%{opacity:.55}
  50%{opacity:1}
}

#ibr-ai-foot{
  margin-top:8px;
  display:flex;justify-content:center;
}
#ibr-ai-wa{
  display:inline-flex!important;align-items:center;justify-content:center;gap:8px;
  min-height:36px;padding:8px 16px;
  border-radius:999px;border:0;cursor:pointer;
  background:#25D366!important;
  color:#F4F8FA!important;
  font-size:13px;font-weight:700;
  text-decoration:none!important;
  box-shadow:0 8px 18px rgba(37,211,102,.28);
  transition:transform .15s cubic-bezier(.16,1,.3,1), filter .15s ease;
}
#ibr-ai-wa:hover{filter:brightness(1.05);transform:translateY(-1px);text-decoration:none!important}
#ibr-ai-wa svg{width:16px;height:16px;display:block;flex:none}
#ibr-ai-wa svg path{fill:#F4F8FA!important}

#ibr-ai-wa-sheet{
  display:none;
  flex-direction:column;gap:8px;
  margin-top:8px;
  padding:10px;
  border-radius:14px;
  background:rgba(244,248,250,.12);
  border:1px solid rgba(244,248,250,.16);
}
#ibr-ai-wa-sheet.is-open{display:flex}
#ibr-ai-wa-sheet-label{
  margin:0;
  font-size:11px;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;color:rgba(244,248,250,.82);
}
#ibr-ai-wa-text{
  width:100%;min-height:88px;max-height:140px;resize:vertical;
  border:0;border-radius:12px;padding:10px 12px;
  background:rgba(244,248,250,.96);color:var(--ibr-ink);
  font:inherit;font-size:12.5px;line-height:1.4;
  outline:none;
}
#ibr-ai-wa-actions{
  display:flex;gap:8px;align-items:center;justify-content:flex-end;
}
#ibr-ai-wa-cancel{
  border:0;cursor:pointer;border-radius:999px;
  padding:8px 12px;background:rgba(244,248,250,.14);
  color:#F4F8FA;font-size:12px;font-weight:650;
}
#ibr-ai-wa-send{
  display:inline-flex!important;align-items:center;gap:6px;
  border-radius:999px;padding:8px 14px;
  background:#25D366!important;color:#F4F8FA!important;
  font-size:12.5px;font-weight:700;text-decoration:none!important;
}
#ibr-ai-wa-send:hover{filter:brightness(1.05)}

@media (max-width:767px){
  #ibr-ai-root{right:12px;left:auto;bottom:12px}
  #ibr-ai-panel{
    width:calc(100vw - 22px);
    height:min(66vh,520px);
    border-radius:22px;
  }
  #ibr-ai-toggle{width:52px;height:52px}
  #ibr-ai-chooser{padding:2px 10px 8px}
  #ibr-ai-chips button{padding:6px 10px;font-size:11.5px}
}
