/* A1 Assistant - help widget. Self-contained: works on the public site, the docs and the portal. */
.a1a, .a1a *{ box-sizing:border-box; }
.a1a{
  --a1a-blue:#1d6ff2; --a1a-teal:#2ce6c4; --a1a-violet:#7a5cff;
  --a1a-bg:#ffffff; --a1a-bg2:#f3f6fd; --a1a-line:#e0e7f5; --a1a-text:#0b1b4d; --a1a-muted:#5b6b94; --a1a-bot:#eef3fd; --a1a-shadow:0 24px 70px rgba(11,27,77,.28);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif; font-size:14px; line-height:1.5; color:var(--a1a-text);
}
html[data-theme="dark"] .a1a, .a1a.is-dark{
  --a1a-bg:#0f1730; --a1a-bg2:#0a1124; --a1a-line:#223158; --a1a-text:#eaf0ff; --a1a-muted:#93a1c9; --a1a-bot:#17213f; --a1a-shadow:0 24px 70px rgba(0,0,0,.6);
}
@property --a1a-ang{ syntax:'<angle>'; inherits:false; initial-value:0deg; }

/* ---------- launcher pill with animated gradient border ---------- */
.a1a-fab{
  position:fixed; z-index:2147483000; bottom:22px; left:22px; display:inline-flex; align-items:center; gap:10px; cursor:pointer; border:0; padding:2px; border-radius:999px;
  background:conic-gradient(from var(--a1a-ang), var(--a1a-teal), var(--a1a-blue), var(--a1a-violet), var(--a1a-teal));
  animation:a1a-spin 3.2s linear infinite; box-shadow:0 10px 30px rgba(29,111,242,.35); transition:transform .25s ease, box-shadow .25s ease;
}
.a1a.pos-right .a1a-fab{ left:auto; right:22px; }
.a1a.pos-right-high .a1a-fab{ left:auto; right:22px; bottom:96px; }
.a1a-fab:hover{ transform:translateY(-3px); box-shadow:0 16px 40px rgba(29,111,242,.5); }
.a1a-fab:focus-visible{ outline:3px solid var(--a1a-teal); outline-offset:3px; }
.a1a-fab-in{ display:flex; align-items:center; gap:10px; padding:10px 18px 10px 12px; border-radius:999px; background:#0b1636; color:#fff; font-weight:600; font-size:14.5px; white-space:nowrap; }
html:not([data-theme="dark"]) .a1a-fab-in{ background:#0b1636; }
.a1a-spark{ width:30px; height:30px; border-radius:50%; background:linear-gradient(135deg,var(--a1a-teal),var(--a1a-blue)); display:grid; place-items:center; position:relative; flex:none; }
.a1a-spark svg{ width:17px; height:17px; fill:#fff; }
.a1a-spark::after{ content:""; position:absolute; right:-1px; top:-1px; width:9px; height:9px; border-radius:50%; background:#34d399; border:2px solid #0b1636; animation:a1a-pulse 2s ease-in-out infinite; }
.a1a-fab-label small{ display:block; font-weight:500; font-size:10.5px; color:#9fb0dd; line-height:1; margin-top:2px; }
.a1a.open .a1a-fab{ opacity:0; pointer-events:none; transform:scale(.8); }
@keyframes a1a-spin{ to{ --a1a-ang:360deg; } }
@keyframes a1a-pulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(52,211,153,.6);} 50%{ box-shadow:0 0 0 5px rgba(52,211,153,0);} }

/* ---------- panel ---------- */
.a1a-panel{
  position:fixed; z-index:2147483001; bottom:22px; left:22px; width:392px; max-width:calc(100vw - 24px); height:640px; max-height:calc(100vh - 44px);
  display:flex; flex-direction:column; background:var(--a1a-bg); border-radius:22px; box-shadow:var(--a1a-shadow); overflow:hidden; border:1px solid var(--a1a-line);
  transform:translateY(18px) scale(.97); opacity:0; visibility:hidden; transform-origin:bottom left; transition:transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease, visibility .22s;
}
.a1a.pos-right .a1a-panel, .a1a.pos-right-high .a1a-panel{ left:auto; right:22px; transform-origin:bottom right; }
.a1a.open .a1a-panel{ transform:none; opacity:1; visibility:visible; }
.a1a-panel::before{ content:""; position:absolute; inset:0; border-radius:22px; padding:1.5px; pointer-events:none; z-index:3;
  background:conic-gradient(from var(--a1a-ang), var(--a1a-teal), var(--a1a-blue), var(--a1a-violet), var(--a1a-teal)); animation:a1a-spin 6s linear infinite;
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; opacity:.9; }

.a1a-head{ position:relative; display:flex; align-items:center; gap:12px; padding:16px 16px 14px; color:#fff;
  background:radial-gradient(120% 140% at 100% 0%, rgba(44,230,196,.35), transparent 55%), linear-gradient(135deg,#0b1636,#10285f); }
.a1a-av{ width:40px; height:40px; border-radius:12px; background:#fff; display:grid; place-items:center; overflow:hidden; flex:none; }
.a1a-av img{ width:30px; height:30px; object-fit:contain; }
.a1a-ht{ flex:1; min-width:0; } .a1a-ht b{ display:block; font-family:'Space Grotesk','Inter',sans-serif; font-size:16px; letter-spacing:-.01em; }
.a1a-ht span{ font-size:12px; color:#b9c7ee; display:flex; align-items:center; gap:6px; } .a1a-ht span i{ width:7px; height:7px; border-radius:50%; background:#34d399; display:inline-block; }
.a1a-ib{ width:32px; height:32px; border-radius:10px; border:0; background:rgba(255,255,255,.12); color:#fff; cursor:pointer; display:grid; place-items:center; transition:background .2s; }
.a1a-ib:hover{ background:rgba(255,255,255,.24); } .a1a-ib svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.a1a-body{ flex:1; overflow-y:auto; padding:16px 14px 6px; background:var(--a1a-bg2); scroll-behavior:smooth; overscroll-behavior:contain; }
.a1a-row{ display:flex; gap:8px; margin:0 0 12px; align-items:flex-end; animation:a1a-in .3s ease both; }
.a1a-row.user{ justify-content:flex-end; }
.a1a-mini{ width:26px; height:26px; border-radius:50%; background:linear-gradient(135deg,var(--a1a-teal),var(--a1a-blue)); flex:none; display:grid; place-items:center; } .a1a-mini svg{ width:14px; height:14px; fill:#fff; }
.a1a-msg{ max-width:82%; padding:10px 13px; border-radius:16px; word-wrap:break-word; overflow-wrap:anywhere; }
.a1a-row.bot .a1a-msg{ background:var(--a1a-bot); color:var(--a1a-text); border-bottom-left-radius:5px; border:1px solid var(--a1a-line); }
.a1a-row.user .a1a-msg{ background:linear-gradient(135deg,var(--a1a-blue),#3b8bff); color:#fff; border-bottom-right-radius:5px; }
.a1a-msg p{ margin:0 0 8px; } .a1a-msg p:last-child{ margin-bottom:0; } .a1a-msg ul{ margin:4px 0 8px 18px; padding:0; } .a1a-msg li{ margin:2px 0; }
.a1a-msg code{ font-family:'JetBrains Mono',ui-monospace,monospace; font-size:12px; background:rgba(29,111,242,.12); padding:1px 5px; border-radius:5px; }
.a1a-msg a{ color:var(--a1a-blue); font-weight:600; text-decoration:none; border-bottom:1px solid rgba(29,111,242,.35); } html[data-theme="dark"] .a1a-msg a{ color:#7db1ff; }
.a1a-row.user .a1a-msg a{ color:#fff; }
.a1a-links{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.a1a-links a{ display:inline-flex; align-items:center; gap:5px; padding:6px 11px; border-radius:999px; background:var(--a1a-bg); border:1px solid var(--a1a-line); color:var(--a1a-blue)!important; font-size:12.5px; font-weight:600; border-bottom:1px solid var(--a1a-line)!important; transition:all .2s; }
.a1a-links a:hover{ border-color:var(--a1a-blue)!important; transform:translateY(-1px); }
.a1a-fb{ display:flex; gap:6px; margin-top:8px; align-items:center; font-size:11.5px; color:var(--a1a-muted); }
.a1a-fb button{ border:1px solid var(--a1a-line); background:var(--a1a-bg); color:var(--a1a-muted); border-radius:8px; padding:2px 8px; cursor:pointer; font-size:12px; } .a1a-fb button:hover{ border-color:var(--a1a-blue); color:var(--a1a-blue); }
.a1a-typing{ display:inline-flex; gap:4px; padding:4px 2px; } .a1a-typing i{ width:7px; height:7px; border-radius:50%; background:var(--a1a-muted); animation:a1a-dot 1.1s infinite ease-in-out; } .a1a-typing i:nth-child(2){ animation-delay:.15s; } .a1a-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes a1a-dot{ 0%,60%,100%{ transform:translateY(0); opacity:.4;} 30%{ transform:translateY(-4px); opacity:1;} }
@keyframes a1a-in{ from{ opacity:0; transform:translateY(8px);} to{ opacity:1; transform:none;} }

.a1a-chips{ display:flex; flex-wrap:wrap; gap:7px; padding:2px 0 12px 34px; animation:a1a-in .35s ease both; }
.a1a-chip{ border:1px solid var(--a1a-line); background:var(--a1a-bg); color:var(--a1a-text); padding:7px 12px; border-radius:999px; font-size:12.8px; cursor:pointer; font-family:inherit; transition:all .2s; }
.a1a-chip:hover{ border-color:var(--a1a-blue); color:var(--a1a-blue); transform:translateY(-1px); box-shadow:0 6px 16px rgba(29,111,242,.15); }

.a1a-foot{ border-top:1px solid var(--a1a-line); background:var(--a1a-bg); padding:10px 12px 8px; }
.a1a-form{ display:flex; gap:8px; align-items:center; }
.a1a-input{ flex:1; border:1px solid var(--a1a-line); background:var(--a1a-bg2); color:var(--a1a-text); border-radius:14px; padding:11px 14px; font:inherit; outline:none; min-width:0; transition:border-color .2s, box-shadow .2s; }
.a1a-input:focus{ border-color:var(--a1a-blue); box-shadow:0 0 0 3px rgba(29,111,242,.16); } .a1a-input::placeholder{ color:var(--a1a-muted); }
.a1a-send{ width:42px; height:42px; border-radius:13px; border:0; cursor:pointer; background:linear-gradient(135deg,var(--a1a-teal),var(--a1a-blue)); display:grid; place-items:center; transition:transform .2s, filter .2s; flex:none; }
.a1a-send:hover{ transform:scale(1.06); filter:brightness(1.08); } .a1a-send svg{ width:18px; height:18px; stroke:#fff; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.a1a-note{ display:flex; justify-content:space-between; gap:8px; align-items:center; margin-top:8px; font-size:11px; color:var(--a1a-muted); }
.a1a-note a{ color:#16a34a; font-weight:700; text-decoration:none; display:inline-flex; gap:4px; align-items:center; } html[data-theme="dark"] .a1a-note a{ color:#4ade80; }

@media (max-width:520px){
  .a1a-panel{ left:0!important; right:0!important; bottom:0!important; width:100vw; max-width:100vw; height:92vh; max-height:92vh; border-radius:22px 22px 0 0; }
  .a1a-panel::before{ border-radius:22px 22px 0 0; }
  .a1a-fab{ bottom:16px; left:14px; } .a1a.pos-right .a1a-fab, .a1a.pos-right-high .a1a-fab{ right:14px; }
  .a1a-fab-label{ display:none; } .a1a-fab-in{ padding:10px; }
}
@media (prefers-reduced-motion:reduce){ .a1a-fab, .a1a-panel::before, .a1a-spark::after, .a1a-typing i{ animation:none!important; } .a1a-panel, .a1a-row, .a1a-chips{ transition:none; animation:none; } }
@media print{ .a1a{ display:none!important; } }
