/* Global, compact SBUSH AI companion. Visible on every authenticated workspace page. */
.ai-float-root {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'DM Sans', 'Noto Sans Bengali', sans-serif;
}
.ai-float-launcher {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 9px 17px 9px 10px;
  border: 1px solid rgba(118, 137, 255, .42);
  border-radius: 18px;
  color: #f4f7ff;
  background: linear-gradient(125deg, #27205b 0%, #172949 58%, #103d51 100%);
  box-shadow: 0 14px 42px rgba(4, 8, 24, .42), 0 0 0 4px rgba(111, 100, 255, .08), inset 0 1px 0 rgba(255,255,255,.12);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ai-float-launcher:hover { transform: translateY(-3px); border-color: rgba(83, 221, 237, .68); box-shadow: 0 18px 48px rgba(4,8,24,.5), 0 0 26px rgba(70,215,232,.14); }
.ai-float-launcher:focus-visible, .ai-float-icon:focus-visible, .ai-float-send:focus-visible { outline: 3px solid #65e1ef; outline-offset: 3px; }
.ai-float-launcher-icon, .ai-float-mark {
  width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px;
  border-radius: 13px; color: #fff; font-size: 23px;
  background: linear-gradient(145deg, #876bff, #3ac9e2);
  box-shadow: 0 5px 18px rgba(83, 134, 255, .35);
}
.ai-float-launcher-copy { display: grid; gap: 2px; text-align: left; }
.ai-float-launcher-copy strong { font-size: 12px; letter-spacing: .01em; }
.ai-float-launcher-copy small { color: #acbbdc; font-size: 9px; }
.ai-float-launcher-pulse { width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: #59e3bd; box-shadow: 0 0 0 4px rgba(89,227,189,.12), 0 0 13px rgba(89,227,189,.62); }
.ai-float-panel {
  width: min(386px, calc(100vw - 32px));
  height: min(590px, calc(100dvh - 112px));
  min-height: 410px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(134, 151, 206, .26);
  border-radius: 23px;
  color: #edf3ff;
  background: linear-gradient(155deg, rgba(17, 24, 44, .98), rgba(8, 14, 28, .985));
  box-shadow: 0 25px 90px rgba(0,0,0,.56), 0 0 0 1px rgba(113,103,255,.06), 0 0 38px rgba(69,102,255,.11);
  backdrop-filter: blur(22px);
  transform-origin: bottom right;
  animation: aiFloatIn .2s ease-out both;
}
@keyframes aiFloatIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.ai-float-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 16px 12px; border-bottom:1px solid rgba(145,161,203,.13); background:linear-gradient(105deg,rgba(94,76,190,.14),rgba(42,174,198,.07)); }
.ai-float-brand { display:flex; align-items:center; gap:10px; min-width:0; }
.ai-float-brand>span:last-child { display:grid; gap:3px; }
.ai-float-brand strong { font-size:13px; letter-spacing:.025em; }
.ai-float-brand small { color:#94a4c1; font-size:9px; }
.ai-float-mark { width:34px; height:34px; flex-basis:34px; border-radius:11px; font-size:20px; }
.ai-float-header-actions { display:flex; gap:6px; }
.ai-float-icon { width:30px; height:30px; border:1px solid rgba(150,166,207,.17); border-radius:9px; color:#bfcce6; background:rgba(255,255,255,.045); font-size:16px; cursor:pointer; }
.ai-float-icon:hover { color:#fff; border-color:rgba(82,210,229,.4); background:rgba(63,188,211,.12); }
.ai-float-page-context { display:flex; align-items:center; gap:7px; padding:9px 16px 5px; color:#bbc9e2; font-size:10px; }
.ai-float-context-dot { width:6px; height:6px; border-radius:50%; background:#54ddc0; box-shadow:0 0 9px rgba(84,221,192,.65); }
.ai-float-context-label { margin-left:auto; color:#6d7d9d; font-size:8px; letter-spacing:.13em; font-weight:800; }
.ai-float-controls { padding:7px 15px 10px; display:grid; gap:8px; }
.ai-float-controls label { min-width:0; display:grid; gap:4px; color:#8393b3; font-size:9px; }
.ai-float-controls select { width:100%; min-width:0; height:32px; padding:0 9px; border:1px solid rgba(143,164,207,.17); border-radius:9px; color:#e5edff; background:#121d34; font-size:10px; outline:none; }
.ai-float-controls select:focus { border-color:rgba(73,208,231,.65); box-shadow:0 0 0 3px rgba(73,208,231,.09); }
.ai-float-subject-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ai-float-log { flex:1; min-height:105px; overflow-y:auto; display:flex; flex-direction:column; align-items:stretch; gap:9px; padding:11px 14px; border-top:1px solid rgba(145,161,203,.1); border-bottom:1px solid rgba(145,161,203,.1); background:rgba(4,9,21,.28); scroll-behavior:smooth; }
.ai-float-message { max-width:94%; padding:10px 11px; border-radius:13px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:11px; line-height:1.6; }
.ai-float-message.assistant { align-self:flex-start; color:#d5e1f7; border:1px solid rgba(128,151,199,.14); border-top-left-radius:5px; background:rgba(111,132,184,.105); }
.ai-float-message.user { align-self:flex-end; color:#e8fcff; border:1px solid rgba(64,194,214,.2); border-top-right-radius:5px; background:linear-gradient(130deg,rgba(68,92,190,.34),rgba(27,151,172,.2)); }
.ai-float-message.pending { color:#93a6c7; font-style:italic; }
.ai-float-form { display:grid; grid-template-columns:1fr 39px; align-items:end; gap:8px; padding:10px 12px 7px; }
.ai-float-form textarea { width:100%; min-height:42px; max-height:105px; resize:vertical; padding:10px 11px; border:1px solid rgba(143,164,207,.2); border-radius:12px; outline:none; color:#edf4ff; background:rgba(16,27,48,.9); font-family:inherit; font-size:11px; line-height:1.5; }
.ai-float-form textarea::placeholder { color:#7183a4; }
.ai-float-form textarea:focus { border-color:rgba(75,210,231,.6); box-shadow:0 0 0 3px rgba(75,210,231,.08); }
.ai-float-send { width:39px; height:39px; border:0; border-radius:12px; color:#071522; background:linear-gradient(140deg,#70e2eb,#9c8cff); box-shadow:0 5px 16px rgba(85,143,239,.2); font-size:18px; cursor:pointer; transition:transform .15s ease, opacity .15s ease; }
.ai-float-send:hover { transform:translateY(-2px); }
.ai-float-send:disabled { opacity:.45; cursor:wait; }
.ai-float-footnote { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:0 14px 11px; color:#677895; font-size:8px; }
.ai-float-footnote button { flex:0 0 auto; padding:2px 0; border:0; color:#8da2cc; background:none; font-size:8px; cursor:pointer; }
.ai-float-footnote button:hover { color:#d4e2ff; text-decoration:underline; }
body:not(.dark) .ai-float-panel { color:#1d2942; border-color:rgba(65,86,133,.18); background:linear-gradient(155deg,rgba(255,255,255,.99),rgba(243,247,255,.99)); box-shadow:0 24px 80px rgba(24,43,78,.24),0 0 0 1px rgba(90,106,161,.05); }
body:not(.dark) .ai-float-header { border-color:rgba(65,86,133,.12); background:linear-gradient(105deg,rgba(124,104,230,.09),rgba(42,174,198,.07)); }
body:not(.dark) .ai-float-brand strong { color:#1c2944; }
body:not(.dark) .ai-float-brand small, body:not(.dark) .ai-float-controls label { color:#697a99; }
body:not(.dark) .ai-float-icon { color:#465775; border-color:rgba(65,86,133,.17); background:rgba(64,83,130,.04); }
body:not(.dark) .ai-float-page-context { color:#445571; }
body:not(.dark) .ai-float-context-label { color:#8b98ac; }
body:not(.dark) .ai-float-controls select { color:#273552; border-color:rgba(65,86,133,.17); background:#f7f9ff; }
body:not(.dark) .ai-float-log { border-color:rgba(65,86,133,.1); background:rgba(230,237,250,.45); }
body:not(.dark) .ai-float-message.assistant { color:#33435f; border-color:rgba(65,86,133,.11); background:#eef3fc; }
body:not(.dark) .ai-float-message.user { color:#174452; border-color:rgba(45,151,174,.15); background:#def4f7; }
body:not(.dark) .ai-float-form textarea { color:#253653; border-color:rgba(65,86,133,.17); background:#fff; }
body:not(.dark) .ai-float-form textarea::placeholder { color:#8c9ab0; }
body:not(.dark) .ai-float-footnote { color:#8793a7; }
body:not(.dark) .ai-float-footnote button { color:#657da7; }
@media (max-width: 760px) {
  .ai-float-root { right:14px; bottom:14px; gap:9px; }
  .ai-float-launcher { min-height:52px; padding:7px 13px 7px 8px; border-radius:16px; }
  .ai-float-launcher-icon { width:36px; height:36px; flex-basis:36px; }
  .ai-float-panel { width:min(390px,calc(100vw - 28px)); height:min(570px,calc(100dvh - 92px)); min-height:390px; border-radius:20px; }
}
@media (max-width: 380px) {
  .ai-float-root { right:10px; bottom:10px; }
  .ai-float-launcher-copy small { display:none; }
  .ai-float-panel { width:calc(100vw - 20px); height:calc(100dvh - 82px); min-height:360px; }
  .ai-float-controls { padding-inline:10px; }
  .ai-float-subject-row { gap:6px; }
}
@media (prefers-reduced-motion: reduce) { .ai-float-launcher,.ai-float-panel,.ai-float-send { transition:none!important; animation:none!important; } }
