#cbWidget{position:fixed;right:1.0888rem;bottom:1.0888rem;z-index:99999;font-family:Arial,sans-serif;}
#cbWidget *{box-sizing:border-box;}
/* lock background scroll while chat is open on mobile (beats body.horizontal !important) */
html.cb-locked, html.cb-locked body{overflow:hidden; height:100%;}
#cbToggle{
  width:3.5175rem;height:3.5175rem;border-radius:50%;border:none;cursor:pointer;
  background:linear-gradient(135deg,#1A2B4B 0%,#2a4880 100%);color:#fff;
  box-shadow:0 .335rem 1.0888rem rgba(26,43,75,.40);display:flex;align-items:center;justify-content:center;
  transition:transform .15s, box-shadow .15s;
}
#cbToggle:hover{transform:translateY(-.0838rem);box-shadow:0 .5025rem 1.2563rem rgba(26,43,75,.5);}
#cbToggle i{font-size:1.4238rem;}
/* Animated droid (static/js/bot-avatar.min.js). Until it mounts the button keeps
   its round icon look; once ready, the circle gives way to the avatar itself. */
#cbToggle .cb-avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%;line-height:0;}
#cbToggle:has(.cb-avatar[data-bot-ready]),
html[data-mode="dark"] #cbToggle:has(.cb-avatar[data-bot-ready]),
html[data-mode="dark"] #cbToggle:has(.cb-avatar[data-bot-ready]):hover{background:none;box-shadow:none;}
#cbToggle:has(.cb-avatar[data-bot-ready]) canvas{filter:drop-shadow(0 .2513rem .5025rem rgba(26,43,75,.30));}
html[data-mode="dark"] #cbToggle:has(.cb-avatar[data-bot-ready]) canvas{filter:drop-shadow(0 .2513rem .5863rem rgba(0,0,0,.55));}
/* Keep the launcher out of sight until the avatar mounts, so the old round icon
   never flashes first. If the bundle fails or is slow, .cb-fallback shows the icon. */
#cbToggle{transition:transform .15s, box-shadow .15s, opacity .25s;}
#cbToggle:not(.cb-fallback):not(:has(.cb-avatar[data-bot-ready])){opacity:0;pointer-events:none;}

#cbPanel{
  position:absolute;right:0;bottom:4.1875rem;
  width:min(25.9625rem, calc(100vw - 1.675rem));
  /* capped so it doesn't get too tall on big screens (≈ a MacBook-height panel) */
  height:min(50.25rem, calc(100vh - 5.4438rem));
  max-height:calc(100vh - 4.6063rem);
  min-width:14.2375rem;min-height:21.775rem;
  background:#fff;border:.0419rem solid #dde3ec;border-radius:.7538rem;overflow:hidden;
  box-shadow:0 .7538rem 2.0938rem rgba(26,43,75,.30);display:flex;flex-direction:column;
}
html[data-mode="dark"] #cbPanel{background:#15171c;border-color:rgba(255,255,255,.10);box-shadow:0 .7538rem 2.0938rem rgba(0,0,0,.55);}
#cbPanel[hidden]{display:none;}
/* Left-edge handle: drag (or arrow keys) to widen the panel up to 1.8x its default
   width; reset on every open. Desktop only. */
.cb-resize{position:absolute;left:0;top:0;bottom:0;width:.4188rem;cursor:ew-resize;z-index:3;touch-action:none;outline:none;}
.cb-resize::after{content:"";position:absolute;left:.1256rem;top:50%;width:.1675rem;height:1.8425rem;margin-top:-.9213rem;
  border-radius:.0838rem;background:rgba(26,43,75,.28);opacity:0;transition:opacity .15s;}
#cbPanel:hover .cb-resize::after,.cb-resize:focus-visible::after,.cb-resize.cb-drag::after{opacity:1;}
html[data-mode="dark"] .cb-resize::after{background:rgba(34,197,94,.55);}
html.cb-resizing,html.cb-resizing *{user-select:none;cursor:ew-resize;}

.cb-head{
  background:linear-gradient(135deg,#0f1f3d 0%,#1A2B4B 50%,#2a4880 100%);
  color:#fff;padding:.67rem .7538rem;display:flex;align-items:center;gap:.5025rem;flex-shrink:0;
}
.cb-head .cb-ava{width:1.675rem;height:1.675rem;border-radius:50%;background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;font-size:.8375rem;}
.cb-ttl-row{display:flex;align-items:center;gap:.335rem;}
.cb-head .cb-ttl{font-size:1.005rem;font-weight:800;line-height:1.15;}
.cb-test{font-size:.4606rem;font-weight:800;text-transform:uppercase;letter-spacing:.5px;
  background:#f59e0b;color:#1a1a1a;padding:.0838rem .2931rem;border-radius:.2513rem;line-height:1;flex-shrink:0;}
.cb-head .cb-sub{font-size:.6281rem;opacity:.65;font-weight:500;}
.cb-head button{background:rgba(255,255,255,.12);border:none;color:#fff;width:1.5913rem;height:1.5913rem;border-radius:.3769rem;cursor:pointer;font-size:.7119rem;}
.cb-head button:hover{background:rgba(255,255,255,.22);}

.cb-msgs{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:.67rem;display:flex;flex-direction:column;gap:.5025rem;background:#f4f7fb;}
html[data-mode="dark"] .cb-msgs{background:#0f1115;}
.cb-msgs::-webkit-scrollbar{width:.2931rem;}
.cb-msgs::-webkit-scrollbar-thumb{background:rgba(26,43,75,.25);border-radius:.1675rem;}
html[data-mode="dark"] .cb-msgs::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);}

.cb-row{display:flex;}
.cb-row.user{justify-content:flex-end;}
.cb-bub{max-width:84%;padding:.4606rem .6281rem;border-radius:.67rem;font-size:.67rem;line-height:1.5;word-wrap:break-word;white-space:normal;}
.cb-row.user .cb-bub{background:#1A2B4B;color:#fff;border-bottom-right-radius:.2094rem;}
.cb-row.bot .cb-bub{background:#fff;color:#1e293b;border:.0419rem solid #e2e8f0;border-bottom-left-radius:.2094rem;}
/* headings and lists the assistant writes in markdown */
.cb-bub .cb-h{font-weight:700;line-height:1.35;margin:.4188rem 0 .1675rem;}
.cb-bub .cb-h:first-child{margin-top:0;}
.cb-bub .cb-h1{font-size:1.18em;}
.cb-bub .cb-h2{font-size:1.10em;}
.cb-bub .cb-h3,.cb-bub .cb-h4{font-size:1.03em;}
.cb-bub .cb-list{margin:.1675rem 0 .2513rem;padding-left:.8375rem;}
.cb-bub .cb-list li{margin:.0838rem 0;}
.cb-bub .cb-sub{margin:.0838rem 0 .0838rem;padding-left:.7538rem;}
html[data-mode="dark"] .cb-row.bot .cb-bub{background:#1e2128;color:#e2e8f0;border-color:rgba(255,255,255,.08);}
.cb-bub strong{font-weight:700;}

/* tables inside a bot bubble: scroll both ways, bounded */
.cb-tablewrap{width:100%;max-width:100%;max-height:16.75rem;overflow:auto;margin:.335rem 0;border:.0419rem solid #e2e8f0;border-radius:.335rem;}
html[data-mode="dark"] .cb-tablewrap{border-color:rgba(255,255,255,.10);}
.cb-tablewrap table{border-collapse:collapse;font-size:.6281rem;width:100%;table-layout:fixed;}
.cb-tablewrap th,.cb-tablewrap td{border:.0419rem solid #e2e8f0;padding:.2931rem .4606rem;text-align:left;white-space:normal;word-break:break-word;}
html[data-mode="dark"] .cb-tablewrap th,html[data-mode="dark"] .cb-tablewrap td{border-color:rgba(255,255,255,.08);}
.cb-tablewrap th{background:#C8DAEF;color:#0F172A;font-weight:700;position:sticky;top:0;}
html[data-mode="dark"] .cb-tablewrap th{background:#1c2840;color:#C8DAEF;}

.cb-typing{display:flex;align-items:center;gap:.4188rem;padding:.0838rem;}
/* Thinking orb (static/js/bot-avatar.min.js); three dots until it mounts. */
.cb-orb{display:inline-flex;align-items:center;justify-content:center;width:1.34rem;height:1.34rem;flex:0 0 1.34rem;line-height:0;}
.cb-dots{display:inline-flex;gap:.2094rem;}
.cb-dots span{width:.335rem;height:.335rem;border-radius:50%;background:#9aa6b8;animation:cbBlink 1.2s infinite;}
.cb-dots span:nth-child(2){animation-delay:.2s;} .cb-dots span:nth-child(3){animation-delay:.4s;}
.cb-typing-label{font-style:normal;font-size:.95em;color:#7b8798;transition:opacity .25s ease;}
.cb-typing-label.cb-fade{opacity:0;}
html[data-mode="dark"] .cb-typing-label{color:#9aa4b2;}
/* blinking caret after the text while an answer is streaming in */
.cb-streaming > :last-child::after{content:'';display:inline-block;width:.45em;height:1em;margin-left:.0838rem;vertical-align:-.15em;background:currentColor;opacity:.6;animation:cbCaret 1s steps(1) infinite;}
@keyframes cbCaret{50%{opacity:0;}}
@keyframes cbBlink{0%,80%,100%{opacity:.25;}40%{opacity:1;}}

.cb-foot{flex-shrink:0;border-top:.0419rem solid #e7edf4;padding:.5025rem;display:flex;gap:.4188rem;align-items:flex-end;background:#fff;}
html[data-mode="dark"] .cb-foot{background:#15171c;border-top-color:rgba(255,255,255,.08);}
.cb-foot textarea{flex:1;resize:none;border:.0419rem solid #d8e0ea;border-radius:.5025rem;padding:.5025rem .6281rem;font-size:.7538rem;font-family:inherit;max-height:5.4438rem;outline:none;background:#fff;color:#1e293b;}
html[data-mode="dark"] .cb-foot textarea{background:#1e2128;border-color:rgba(255,255,255,.12);color:#e2e8f0;}
.cb-foot textarea:focus{border-color:#2a4880;}
.cb-send{width:2.01rem;height:2.01rem;border-radius:.5025rem;border:none;background:#1A2B4B;color:#fff;cursor:pointer;font-size:.7956rem;flex-shrink:0;}
.cb-send:disabled{opacity:.5;cursor:default;}
/* admin kill switch (TZ 4.1.11-5): reason shown above the disabled input */
.cb-off{flex-shrink:0;padding:.4188rem .5863rem;font-size:.6281rem;line-height:1.45;white-space:pre-line;
  background:#EAF0FA;color:#1A2B4B;border-top:.0419rem solid #C8DAEF;}
html[data-mode="dark"] .cb-off{background:rgba(76,175,80,.12);color:#e2e8e0;border-top-color:rgba(76,175,80,.35);}
.cb-foot textarea:disabled{opacity:.6;cursor:not-allowed;}
.cb-disclaimer{font-size:.5444rem;color:#94a3b8;text-align:center;padding:0 .5025rem .3769rem;background:#fff;}
html[data-mode="dark"] .cb-disclaimer{background:#15171c;}

/* daily-limit chip + help */
.cb-limit{display:flex;align-items:center;gap:.2513rem;background:rgba(255,255,255,.14);border-radius:.3769rem;height:1.5913rem;padding:0 .5025rem;flex-shrink:0;cursor:pointer;}
.cb-limit:hover{background:rgba(255,255,255,.22);}
.cb-limit .cb-lim-txt{font-size:.6281rem;font-weight:700;color:#fff;white-space:nowrap;}
.cb-limit .cb-lim-txt small{font-weight:500;opacity:.7;}
.cb-limit .cb-help{border:none;background:none;color:#fff;font-size:.67rem;font-weight:800;cursor:pointer;line-height:1;padding:0 .1256rem;opacity:.8;width:auto;height:auto;}
.cb-limit .cb-help:hover{background:none;opacity:1;}
.cb-limit.low .cb-lim-txt{color:#fecaca;}

/* confirm modal actions */
.cb-confirm-actions{display:flex;gap:.4188rem;justify-content:flex-end;margin-top:.7538rem;}
.cb-btn{border:none;border-radius:.4188rem;padding:.3769rem .7538rem;font-size:.5863rem;font-weight:700;cursor:pointer;}
.cb-btn-cancel{background:#e8edf4;color:#334155;}
html[data-mode="dark"] .cb-btn-cancel{background:rgba(255,255,255,.1);color:#cbd5e1;}
.cb-btn-danger{background:#dc2626;color:#fff;}
.cb-btn-danger:hover{background:#b91c1c;}

/* modal */
.cb-modal{position:absolute;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;padding:.7538rem;z-index:5;}
.cb-modal[hidden]{display:none;}
.cb-modal-box{background:#fff;border-radius:.67rem;max-width:18.425rem;width:100%;max-height:90%;overflow-y:auto;box-shadow:0 .7538rem 2.0938rem rgba(0,0,0,.4);}
html[data-mode="dark"] .cb-modal-box{background:#1b1e25;color:#e2e8f0;}
.cb-modal-head{display:flex;align-items:center;justify-content:space-between;padding:.67rem .7538rem;border-bottom:.0419rem solid #eef2f7;}
html[data-mode="dark"] .cb-modal-head{border-bottom-color:rgba(255,255,255,.08);}
.cb-modal-head h3{margin:0;font-size:.7538rem;font-weight:800;color:#1A2B4B;}
html[data-mode="dark"] .cb-modal-head h3{color:#93c5fd;}
.cb-modal-head button{background:none;border:none;font-size:.8375rem;cursor:pointer;color:#94a3b8;}
.cb-modal-body{padding:.67rem .7538rem;font-size:.6072rem;line-height:1.6;color:#334155;}
html[data-mode="dark"] .cb-modal-body{color:#cbd5e1;}
.cb-modal-body ul{margin:.335rem 0;padding-left:.8375rem;}
.cb-modal-body b{color:#1A2B4B;}
html[data-mode="dark"] .cb-modal-body b{color:#93c5fd;}

/* welcome popup (auto pop-up bubbles near the launcher) */
/* explicit width: #cbWidget is only as wide as the launcher, so an absolute child
   with only `right` set would shrink badly — give the popup a real width. */
.cb-popup{position:absolute;right:0;bottom:4.1875rem;width:15.9125rem;max-width:80vw;
  display:flex;flex-direction:column;gap:.335rem;align-items:flex-end;}
@media (min-width: 992px) { .cb-popup { max-width: 53.6vw; } }
.cb-popup[hidden]{display:none;}
.cb-pop-msg{background:#fff;color:#1e293b;border:.0419rem solid #dde3ec;border-radius:.6281rem;border-bottom-right-radius:.1675rem;
  padding:.5444rem .7119rem;font-size:.6491rem;line-height:1.45;box-shadow:0 .335rem 1.005rem rgba(26,43,75,.20);cursor:pointer;
  max-width:100%;opacity:0;transform:translateY(.4188rem) scale(.96);transition:opacity .28s,transform .28s;}
.cb-pop-msg[hidden]{display:none;}
.cb-pop-msg.show{opacity:1;transform:none;}
html[data-mode="dark"] .cb-pop-msg{background:#11160f;color:#e2e8e0;border-color:rgba(34,197,94,.45);box-shadow:0 .335rem 1.005rem rgba(0,0,0,.55);}

/* ── DARK MODE: green + black (matches site dark theme) ── */
html[data-mode="dark"] #cbToggle{background:linear-gradient(135deg,#052e16 0%,#14532d 55%,#16a34a 100%);box-shadow:0 .335rem 1.0888rem rgba(22,163,74,.40);}
html[data-mode="dark"] #cbToggle:hover{box-shadow:0 .5025rem 1.2563rem rgba(22,163,74,.55);}
html[data-mode="dark"] #cbPanel{background:#0b0f0c;border:.0419rem solid rgba(34,197,94,.5);box-shadow:0 .7538rem 2.0938rem rgba(0,0,0,.6);}
html[data-mode="dark"] .cb-head{background:linear-gradient(135deg,#070b08 0%,#0f2417 50%,#14532d 100%);}
html[data-mode="dark"] .cb-msgs{background:#0a0d0b;}
html[data-mode="dark"] .cb-row.user .cb-bub{background:#15803d;color:#fff;}
html[data-mode="dark"] .cb-row.bot .cb-bub{background:#11160f;color:#e2e8e0;border-color:rgba(34,197,94,.16);}
html[data-mode="dark"] .cb-foot{background:#0b0f0c;border-top-color:rgba(34,197,94,.16);}
html[data-mode="dark"] .cb-foot textarea{background:#11160f;border-color:rgba(34,197,94,.22);color:#e2e8e0;}
html[data-mode="dark"] .cb-foot textarea:focus{border-color:#22c55e;}
html[data-mode="dark"] .cb-send{background:#16a34a;}
html[data-mode="dark"] .cb-send:hover{background:#15803d;}
html[data-mode="dark"] .cb-disclaimer{background:#0b0f0c;}
html[data-mode="dark"] .cb-tablewrap{border-color:rgba(34,197,94,.18);}
html[data-mode="dark"] .cb-tablewrap th{background:#14532d;color:#bbf7d0;}
html[data-mode="dark"] .cb-tablewrap th,html[data-mode="dark"] .cb-tablewrap td{border-color:rgba(34,197,94,.14);}
html[data-mode="dark"] .cb-msgs::-webkit-scrollbar-thumb{background:rgba(34,197,94,.4);}
html[data-mode="dark"] .cb-modal-box{background:#0b0f0c;color:#e2e8e0;}
html[data-mode="dark"] .cb-modal-head{border-bottom-color:rgba(34,197,94,.16);}
html[data-mode="dark"] .cb-modal-head h3{color:#4ade80;}
html[data-mode="dark"] .cb-modal-body{color:#cbd5cb;}
html[data-mode="dark"] .cb-modal-body b{color:#4ade80;}
html[data-mode="dark"] .cb-btn-cancel{background:rgba(255,255,255,.08);color:#cbd5cb;}

@media (max-width:991.98px){
  #cbWidget{right:.5863rem;bottom:.5863rem;}
  .cb-popup{bottom:3.2663rem;width:13.4rem;max-width:82vw;} .cb-pop-msg{font-size:.6072rem;}
  #cbToggle{width:2.5962rem;height:2.5962rem;} #cbToggle i{font-size:1.0888rem;}
  /* full-screen on mobile; 100dvh tracks the visible area so the keyboard pushes
     the input up instead of hiding the header (100vh would not shrink) */
  #cbPanel{position:fixed;inset:0;top:0;left:0;right:0;bottom:0;width:100%;
    height:100vh;height:100dvh;max-height:100dvh;min-width:0;min-height:0;border-radius:0;}
  #cbWidget.cb-open #cbToggle{display:none;}
  .cb-resize{display:none;}   /* hide launcher behind full-screen panel */
}


/* ── moved from inline style attributes ── */
.cb-head-text { flex:1; min-width:0; }
