.ai-fab{position:fixed;right:22px;bottom:24px;z-index:1200;display:flex;align-items:center;gap:.6rem;border:0;cursor:pointer;
  background:linear-gradient(135deg,var(--brand-700,#14693f),var(--brand-500,#22a65b));color:#fff;font:700 .95rem 'Plus Jakarta Sans',system-ui,sans-serif;
  padding:.95rem 1.3rem;border-radius:999px;box-shadow:0 14px 34px rgba(var(--b500-rgb,34,166,91),.45);transition:transform .2s}
.ai-fab:hover{transform:translateY(-3px)}
.ai-fab i{font-size:1.1rem;color:#ffd45c}
.ai-fab-pulse{position:absolute;inset:0;border-radius:999px;box-shadow:0 0 0 0 rgba(var(--b500-rgb,34,166,91),.55);animation:aiPulse 2.4s infinite;pointer-events:none}
@keyframes aiPulse{70%{box-shadow:0 0 0 18px rgba(var(--b500-rgb,34,166,91),0)}100%{box-shadow:0 0 0 0 rgba(var(--b500-rgb,34,166,91),0)}}
.ai-fab.open{display:none}

.ai-panel{position:fixed;right:22px;bottom:24px;z-index:1250;width:390px;max-width:calc(100vw - 24px);height:600px;max-height:calc(100vh - 48px);
  display:flex;flex-direction:column;background:#fff;border-radius:22px;overflow:hidden;box-shadow:0 30px 80px rgba(6,42,31,.35);
  border:1px solid #e3ebe7;transform-origin:bottom right;animation:aiIn .25s cubic-bezier(.16,1,.3,1)}
.ai-panel[hidden]{display:none}
@keyframes aiIn{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}
.ai-head{display:flex;align-items:center;gap:.7rem;padding:1rem 1rem;background:linear-gradient(135deg,var(--brand-900,#0a3d2c),var(--brand-700,#14693f));color:#fff}
.ai-avatar{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.15);display:grid;place-items:center;color:#ffd45c}
.ai-title{flex:1;line-height:1.2}
.ai-title strong{display:block;font:800 1rem 'Plus Jakarta Sans',system-ui,sans-serif}
.ai-title small{opacity:.85;font-size:.75rem}
.ai-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#4ade80;margin-right:4px}
.ai-icon-btn{border:0;background:rgba(255,255,255,.12);color:#fff;width:34px;height:34px;border-radius:50%;cursor:pointer}
.ai-icon-btn:hover{background:rgba(255,255,255,.25)}
.ai-msgs{flex:1;overflow-y:auto;padding:1rem;background:var(--brand-50,#f6faf8);display:flex;flex-direction:column;gap:.7rem;scroll-behavior:smooth}
.ai-m{max-width:86%;padding:.7rem .95rem;border-radius:16px;font-size:.92rem;line-height:1.55;word-wrap:break-word;animation:aiIn .2s ease}
.ai-m.bot{align-self:flex-start;background:#fff;color:#0f1f1a;border:1px solid #e3ebe7;border-bottom-left-radius:4px}
.ai-m.user{align-self:flex-end;background:linear-gradient(135deg,var(--brand-700,#14693f),var(--brand-600,#1b8a4c));color:#fff;border-bottom-right-radius:4px}
.ai-m a{color:var(--brand-700,#14693f);font-weight:600}
.ai-m.user a{color:#ffd45c}
.ai-typing{display:inline-flex;gap:4px;padding:.2rem 0}
.ai-typing i{width:7px;height:7px;border-radius:50%;background:#9bb3a9;animation:aiBlink 1.2s infinite}
.ai-typing i:nth-child(2){animation-delay:.15s}.ai-typing i:nth-child(3){animation-delay:.3s}
@keyframes aiBlink{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-3px)}}
.ai-chips{display:flex;flex-wrap:wrap;gap:.45rem;padding:.6rem 1rem;background:var(--brand-50,#f6faf8);border-top:1px solid #e3ebe7}
.ai-chips button{border:1px solid var(--brand-100,#bfe3cd);background:#fff;color:var(--brand-700,#14693f);font-size:.8rem;font-weight:600;padding:.4rem .75rem;border-radius:999px;cursor:pointer;transition:all .15s}
.ai-chips button:hover{background:var(--brand-700,#14693f);color:#fff}
.ai-form{display:flex;gap:.5rem;padding:.8rem 1rem;border-top:1px solid #e3ebe7;background:#fff}
.ai-form input{flex:1;border:1px solid #d5e2db;border-radius:999px;padding:.7rem 1rem;font-size:.92rem;outline:none}
.ai-form input:focus{border-color:var(--brand-500,#22a65b);box-shadow:0 0 0 3px rgba(var(--b500-rgb,34,166,91),.18)}
.ai-form button{width:44px;height:44px;border:0;border-radius:50%;background:var(--brand-700,#14693f);color:#fff;cursor:pointer}
.ai-form button:disabled{opacity:.5}
.ai-foot{text-align:center;font-size:.7rem;color:#6b7d75;padding:0 1rem .7rem;background:#fff}
@media(max-width:520px){
  .ai-panel{right:0;bottom:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}
  /* keep the "TOTAL TVC Assistant" pill visible on phones (slightly smaller) */
  .ai-fab{right:14px;bottom:18px;padding:.8rem 1.05rem;gap:.45rem;font-size:.82rem;max-width:calc(100vw - 100px)}
  .ai-fab-label{display:inline;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:360px){
  .ai-fab{font-size:.76rem;padding:.7rem .9rem}
}