.bamsi-mc-launcher{position:fixed;right:24px;bottom:22px;z-index:900;border:0;border-radius:18px;background:#2563eb;color:#fff;padding:13px 18px;box-shadow:0 8px 28px #162e5a38;cursor:pointer;font:600 14px system-ui}
.bamsi-mc-frame{position:fixed;right:24px;bottom:22px;width:min(450px,calc(100vw - 32px));height:min(620px,calc(100dvh - 48px));z-index:901;display:flex;flex-direction:column;border-radius:18px;background:white;color:#17243b;box-shadow:0 14px 54px #101b3040;overflow:hidden;font:14px system-ui}
.bamsi-mc-frame[hidden],.bamsi-mc-launcher[hidden],.bamsi-mc-sidebar[hidden]{display:none!important}
.bamsi-mc-header{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid #e8ecf2;cursor:grab;touch-action:none}
.bamsi-mc-header strong{flex:1}.bamsi-mc-header button,.bamsi-mc-sidebar button{background:none;border:0;cursor:pointer;padding:6px 9px;border-radius:8px;color:inherit}
.bamsi-mc-main{display:flex;min-height:0;flex:1}.bamsi-mc-sidebar{width:160px;flex-shrink:0;border-right:1px solid #e8ecf2;padding:9px;overflow:auto;background:#f7f9fc}
.bamsi-mc-history button{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bamsi-mc-sidebar .bamsi-mc-new {
  display: flex;
  flex: none;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  text-align: left;
  white-space: nowrap;
}
.bamsi-mc-new svg { flex: none; }
.bamsi-mc-sidebar .bamsi-mc-new:is(:hover, :focus-visible) {
  background: #ffffff12;
}

.bamsi-mc-chat-area{display:flex;flex:1;min-width:0;flex-direction:column}.bamsi-mc-messages{flex:1;overflow-y:auto;padding:15px;display:flex;flex-direction:column;gap:12px}
.bamsi-mc-message{max-width:95%;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5}.bamsi-mc-message.user{align-self:flex-end;background:#eaf2ff;border-radius:14px;padding:10px 12px}.bamsi-mc-message.assistant{align-self:flex-start}.bamsi-mc-message.status{color:#64748b}.bamsi-mc-message.error{color:#a11}
.bamsi-mc-form{display:flex;align-items:end;gap:7px;padding:12px;border-top:1px solid #e8ecf2}.bamsi-mc-form textarea{flex:1;min-width:0;resize:none;border:1px solid #d8e0ea;border-radius:12px;padding:10px;font:inherit}.bamsi-mc-form button{border:0;background:#2563eb;color:white;border-radius:10px;padding:10px;cursor:pointer}
.bamsi-mc-widget-menu{position:fixed;z-index:902;background:white;border:1px solid #e8ecf2;box-shadow:0 8px 30px #15294b25;border-radius:12px;padding:5px;min-width:155px}.bamsi-mc-widget-menu button{display:block;width:100%;text-align:left;background:none;border:0;border-radius:7px;padding:9px;cursor:pointer}
.bamsi-mc-widget-menu button:hover,.bamsi-mc-history button:hover{background:#eaf2ff}
@media(max-width:640px){.bamsi-mc-frame{inset:8px!important;width:auto;height:auto;border-radius:12px}.bamsi-mc-sidebar{width:135px}.bamsi-mc-launcher{right:12px;bottom:12px}}

.bamsi-mc-proposal{border:1px solid #dce7f7;border-radius:12px;padding:10px;background:#f5f9ff}.bamsi-mc-proposal button{border:0;border-radius:8px;padding:8px 16px;margin-right:8px;cursor:pointer;background:#2563eb;color:white}.bamsi-mc-proposal button+button{background:#e8edf5;color:#17243b}
.bamsi-mc-work-cards { display: grid; gap: 6px; width: min(100%, 264px); }
.bamsi-mc-work-tasks .bamsi-mc-work-card { cursor: default; }
.bamsi-mc-work-tasks .bamsi-mc-work-card:hover {
  background: var(--bk-card);
  border-color: var(--bk-card-border);
}
.bamsi-mc-work-state { display: block; margin-bottom: 8px; color: var(--bk-muted); font-size: 11px; }
.bamsi-mc-work-tasks .bk-summary {
  margin-bottom: 0;
  display: block;
  overflow: visible;
}
.bamsi-mc-work-card .bk-card-foot { color: var(--bk-muted); }
.bamsi-mc-work-confirm {
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid #45464e;
  border-radius: 10px;
  background: #25262d;
  color: #f7f7fa;
  font: inherit;
  cursor: pointer;
}
.bamsi-mc-work-confirm:hover { background: #34353e; }
.bamsi-mc-work-question { margin: 10px 0 0; }
.bamsi-mc-work-status { margin: 4px 0; overflow-wrap: anywhere; }
.bamsi-mc-work-status:empty { display: none; }
.bamsi-mc-work-tasks .bamsi-mc-nav-action { margin: 8px 0 0; }

/* BAMSI dark management surface — scoped to management chat only. */
.bamsi-mc-frame{background:linear-gradient(145deg,#303139,#202127 65%,#191b21);color:#f2f3f7;border:1px solid #ffffff20;box-shadow:0 24px 90px #0009,0 2px 18px #0005;border-radius:24px}
.bamsi-mc-header{border-bottom:1px solid #ffffff18;padding:17px 18px;background:#ffffff07}
.bamsi-mc-header strong{font-size:16px;letter-spacing:-.25px}
.bamsi-mc-header button,.bamsi-mc-sidebar button{color:#e5e7ee}
.bamsi-mc-header button:hover,.bamsi-mc-sidebar button:hover{background:#ffffff15}
.bamsi-mc-sidebar{background:#1d1f26;border-right:1px solid #ffffff17}
.bamsi-mc-message{line-height:1.65;font-size:13.5px}
.bamsi-mc-message.user{background:#3164d7;color:#fff;border:1px solid #ffffff1c;border-radius:17px 17px 5px 17px;padding:11px 14px}
.bamsi-mc-message.assistant{background:#ffffff0a;border:1px solid #ffffff12;border-radius:17px 17px 17px 5px;padding:12px 14px}
.bamsi-mc-message.status{color:#abb2c4}.bamsi-mc-message.error{color:#ff9e9e}
.bamsi-mc-form{background:#17191f;border-top:1px solid #ffffff1a;padding:13px}
.bamsi-mc-form textarea{background:#282b34;color:#fff;border:1px solid #ffffff25;outline:none;border-radius:14px;line-height:1.5}
.bamsi-mc-form textarea::placeholder{color:#9ea5b5}
.bamsi-mc-form textarea:focus{border-color:#5789ff;box-shadow:0 0 0 2px #5789ff25}
.bamsi-mc-widget-menu{background:#272931;color:#f4f5f8;border:1px solid #ffffff20;box-shadow:0 15px 45px #0009}
.bamsi-mc-widget-menu button:hover,.bamsi-mc-history button:hover{background:#ffffff18}
.bamsi-mc-proposal{background:#222c40;color:#e9efff;border-color:#52627b}
.bamsi-mc-proposal button+button{background:#444955;color:#f5f6f9}

/* Launcher only: approved Home active-circle visual, with original BAMSI mark. */
.bamsi-mc-launcher{display:inline-flex;align-items:center;gap:12px;padding:7px 7px 7px 17px;border-radius:26px;background:linear-gradient(145deg,#3478ff,#1f61f2);box-shadow:0 7px 14px rgba(0,0,0,.23),0 0 16px rgba(36,104,255,.16),inset 0 1px 0 rgba(255,255,255,.22);font-weight:600}
.bamsi-mc-launcher-mark{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#3478ff,#1f61f2);box-shadow:0 0 0 4px rgba(27,28,31,.15),0 4px 9px rgba(0,0,0,.10),inset 0 1px 0 rgba(255,255,255,.22)}
.bamsi-mc-launcher-mark svg{display:block;width:22px;height:22px;transform:translateX(-1.5px)}

/* Keep the same launcher box and anchor; logo is right, label is left. */
.bamsi-mc-launcher-label{white-space:nowrap}

/* Compact BAMSI launcher: fixed right/bottom anchor, smooth inward caption. */
.bamsi-mc-launcher{gap:12px;overflow:visible;transition:padding .48s cubic-bezier(.22,1,.36,1),gap .48s cubic-bezier(.22,1,.36,1);white-space:nowrap}
.bamsi-mc-launcher-label{display:inline-block;max-width:170px;overflow:hidden;opacity:1;transform:translateX(0);transition:max-width .55s cubic-bezier(.22,1,.36,1),opacity .25s ease,transform .48s ease;white-space:nowrap}
.bamsi-mc-launcher-mark{position:relative;isolation:isolate}
.bamsi-mc-launcher-mark svg{width:26px;height:26px;transform:none;overflow:visible}
.bamsi-mc-launcher.is-compact{gap:0;padding-left:7px}
.bamsi-mc-launcher.is-compact .bamsi-mc-launcher-label{max-width:0;opacity:0;transform:translateX(14px)}
@media(prefers-reduced-motion:reduce){.bamsi-mc-launcher,.bamsi-mc-launcher-label{transition:none}}

/* Chat transition: unfolds from the fixed BAMSI button, retaining the existing brand palette. */
/* Animate the whole surface gently from its launcher-side anchor; avoid extreme
   scaling, which compresses text and makes the chat appear to snap open. */
.bamsi-mc-frame{transform-origin:calc(100% - 24px) calc(100% - 24px)}
.bamsi-mc-frame.is-opening{pointer-events:none;animation:bamsi-mc-unfold .42s cubic-bezier(.16,1,.3,1) both}
.bamsi-mc-frame.is-closing{pointer-events:none;animation:bamsi-mc-fold .34s cubic-bezier(.4,0,.7,.35) both}
@keyframes bamsi-mc-unfold{from{opacity:0;transform:translate(12px,22px) scale(.88)}to{opacity:1;transform:translate(0,0) scale(1)}}
@keyframes bamsi-mc-fold{from{opacity:1;transform:translate(0,0) scale(1)}to{opacity:0;transform:translate(12px,22px) scale(.88)}}
/* Modern composer, using the existing dark surface and BAMSI blue. */
.bamsi-mc-form{margin:10px 12px 13px;padding:10px 10px 10px 15px;align-items:flex-end;gap:9px;border:1px solid #ffffff2b;border-radius:24px;background:#282b34;box-shadow:inset 0 1px 0 #ffffff0d}
.bamsi-mc-form:focus-within{border-color:#5789ff;box-shadow:0 0 0 2px #5789ff20}
.bamsi-mc-form textarea{border:0!important;background:transparent!important;box-shadow:none!important;padding:8px 0;min-height:42px;max-height:150px;outline:0!important;font-size:14px}
.bamsi-mc-form .bamsi-mc-send{width:44px;height:44px;flex:0 0 44px;padding:0;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#3478ff,#1f61f2);box-shadow:0 3px 12px #0004,inset 0 1px 0 #ffffff38;transition:transform .18s ease,opacity .18s ease}
.bamsi-mc-form .bamsi-mc-send svg{width:23px;height:23px}
.bamsi-mc-form .bamsi-mc-send:not(:disabled):hover{transform:translateY(-1px)}
.bamsi-mc-form .bamsi-mc-send:disabled{opacity:.5;cursor:wait}
@media(prefers-reduced-motion:reduce){.bamsi-mc-frame.is-opening,.bamsi-mc-frame.is-closing{animation:none}.bamsi-mc-form .bamsi-mc-send{transition:none}}
@media(max-width:640px){.bamsi-mc-frame{transform-origin:calc(100% - 32px) calc(100% - 32px)}.bamsi-mc-form{margin:8px}}

/* Compact send control: precise centered arrow, distinct empty/ready states. */
.bamsi-mc-form .bamsi-mc-send{width:38px;height:38px;flex:0 0 38px;min-width:38px;min-height:38px;align-self:center;padding:0!important;display:flex;align-items:center;justify-content:center;line-height:0;border-radius:50%;background:linear-gradient(145deg,#3478ff,#1f61f2);color:#fff;opacity:1;box-shadow:0 3px 10px #0003,inset 0 1px 0 #ffffff38}
.bamsi-mc-form .bamsi-mc-send svg{display:block;width:20px;height:20px;flex:none}
.bamsi-mc-form .bamsi-mc-send:disabled{opacity:1;background:#3478ff35;color:#ffffff7a;box-shadow:none;cursor:default;transform:none}
.bamsi-mc-form .bamsi-mc-send:not(:disabled):hover{transform:translateY(-1px)}

/* Align the send-circle center with the compact BAMSI launcher (right/bottom). */
.bamsi-mc-form{margin-right:0;margin-bottom:0;padding-right:8px;padding-bottom:8px}
@media(max-width:640px){.bamsi-mc-form{margin-right:0;margin-bottom:0;padding-right:8px;padding-bottom:8px}}

/* Fine alignment: lower the composer content and send circle without moving the chat. */
.bamsi-mc-form{padding-bottom:5px}
.bamsi-mc-form .bamsi-mc-send{position:relative;top:3px}

/* Fine-align the dark composer panel relative to the chat window. */
.bamsi-mc-form{transform:none;margin:10px 12px 13px;padding-right:10px;padding-bottom:10px}
@media(max-width:640px){.bamsi-mc-form{margin:8px}}

/* Dashboard mobile: keep the launcher as an unobtrusive icon, not a wide content overlay. */
@media(max-width:640px){
  body.bamsi-dashboard-live .bamsi-mc-launcher{right:12px;bottom:12px;gap:0;padding:7px;width:54px;height:54px;justify-content:center;border-radius:50%}
  body.bamsi-dashboard-live .bamsi-mc-launcher .bamsi-mc-launcher-label{max-width:0;opacity:0;transform:none;pointer-events:none}
  body.bamsi-dashboard-live .bamsi-mc-launcher .bamsi-mc-launcher-mark{flex:0 0 40px}
}

.bamsi-mc-reference { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 16px; }
.bamsi-mc-reference small { flex-basis: 100%; }
.bamsi-mc-reference .bamsi-mc-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: 0;
  padding: 8px 11px;
  border-radius: 10px;
  text-decoration: none;
}
.bamsi-mc-reference button.bamsi-mc-nav-action {
  border: 1px solid #45464e;
  background: #25262d;
  color: #f7f7fa;
}
.bamsi-mc-reference button.bamsi-mc-nav-action:hover { background: #34353e; }
.bamsi-mc-reference a.bamsi-mc-nav-action {
  padding-inline: 0;
  border: 0;
  background: transparent;
  color: #d4d6e0;
}
.bamsi-mc-reference a.bamsi-mc-nav-action:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 640px) {
  .bamsi-mc-reference { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
}

/* Mobile AI workspace: above dock; keep the BAMSI launcher on the same baseline. */
@media(max-width:640px){
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher:not([hidden]){
    position:fixed!important;left:auto!important;right:12px!important;bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;
    width:52px!important;height:52px!important;padding:6px!important;gap:0!important;justify-content:center!important;border-radius:50%!important;z-index:941!important;
  }
  .bamsi-mc-launcher .bamsi-mc-launcher-label{display:none!important}
  .bamsi-mc-launcher .bamsi-mc-launcher-mark{width:38px!important;height:38px!important;flex:0 0 38px!important}
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame{
    position:fixed!important;left:10px!important;right:10px!important;top:10px!important;bottom:calc(76px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;height:auto!important;max-height:none!important;
    border-radius:30px!important;z-index:920!important;
    background:radial-gradient(ellipse 85% 42% at 52% 0%,rgba(25,83,234,.40),transparent 80%),linear-gradient(165deg,#111b41 0%,#10131e 38%,#101114 100%)!important;
    box-shadow:0 22px 65px #0009,0 0 0 1px #ffffff1b!important;
  }
  .bamsi-mc-header{background:transparent!important;border-bottom:1px solid #ffffff13!important}
  .bamsi-mc-messages{overscroll-behavior:contain}
  .bamsi-mc-form{margin:8px 10px 10px!important;border-radius:24px!important}
  body.bamsi-mc-mobile-open .bamsi-mc-launcher:not([hidden]){background:linear-gradient(145deg,#1747bf,#112a70)!important}
}
@media(max-width:360px){body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher:not([hidden]){right:9px!important}}
@media(max-width:640px) and (max-height:550px){
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame{top:4px!important;bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;border-radius:18px!important}
}

/* BAMSI Mobile v1.4.2 — edge-to-edge AI workspace above the persistent dock. */
.bamsi-mc-welcome{display:none}
@media(max-width:640px){
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame{
    left:0!important;right:0!important;top:0!important;
    bottom:calc(76px + env(safe-area-inset-bottom,0px))!important;
    width:100%!important;height:auto!important;max-width:none!important;max-height:none!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:radial-gradient(ellipse 95% 43% at 47% -8%,rgba(22,86,255,.62),transparent 85%),linear-gradient(180deg,#101b49 0%,#101323 36%,#090a0e 100%)!important;
    transform-origin:center top!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame.is-opening{animation:bamsi-ai-enter .3s cubic-bezier(.2,.8,.2,1) both}
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame.is-closing{animation:bamsi-ai-exit .35s cubic-bezier(.2,.8,.2,1) both}
  .bamsi-mc-header{flex:0 0 64px;padding:12px 20px!important;border-bottom:0!important;cursor:default;touch-action:pan-y}
  .bamsi-mc-header strong{font-size:20px}
  .bamsi-mc-header button[title="Свернуть"]{display:none}
  .bamsi-mc-main{position:relative;min-height:0}
  .bamsi-mc-chat-area{min-height:0}
  .bamsi-mc-welcome:not([hidden]){display:flex;position:absolute;top:10%;left:0;right:0;align-items:center;flex-direction:column;gap:20px;pointer-events:none;color:#eef3ff}
  .bamsi-mc-welcome-mark{display:grid;place-items:center;width:60px;height:60px;border-radius:50%;border:1px solid #6b92ff70;background:#2155c91c;box-shadow:0 0 48px #276aff66;font-size:27px}
  .bamsi-mc-welcome-title{font-size:16px;letter-spacing:.01em}
  .bamsi-mc-messages{position:relative;z-index:1;padding:14px 20px;min-height:0}
  .bamsi-mc-form{position:relative;z-index:2;margin:8px 14px 14px!important;padding:7px 8px 7px 16px!important;border-radius:24px!important;background:#202127!important}
  .bamsi-mc-form textarea{min-height:36px!important;padding:7px 0!important}
}
@keyframes bamsi-ai-enter{from{opacity:0;transform:translateY(-28px)}to{opacity:1;transform:translateY(0)}}
@keyframes bamsi-ai-exit{from{opacity:1;transform:translateY(0)}to{opacity:1;transform:translateY(calc(-100% - 12px))}}
@media(max-width:640px) and (max-height:550px){body:has(#platform-screen:not([hidden])) .bamsi-mc-frame{top:0!important;border-radius:0!important}}
@media(prefers-reduced-motion:reduce){body:has(#platform-screen:not([hidden])) .bamsi-mc-frame.is-opening,body:has(#platform-screen:not([hidden])) .bamsi-mc-frame.is-closing{animation:none!important}}

/* v1.4.3: continuous mobile AI surface; dock remains above it. */
@media(max-width:640px){
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame{
    bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;
    min-height:0!important;overflow:hidden!important;
  }
  body.bamsi-mc-mobile-open:has(#platform-screen:not([hidden]))::before{
    content:"";position:fixed;inset:0;z-index:919;pointer-events:none;
    background:#090a0e;
  }
  body.bamsi-mc-mobile-open .bamsi-mc-launcher{display:none!important}
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form{
    margin:6px 12px 8px!important;padding:5px 8px 5px 13px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form textarea{min-height:30px!important;padding:5px 0!important}
}

.bamsi-mc-frame {
  --bamsi-mc-top-glow:
    linear-gradient(transparent 78%, #08090b) center top / 100% 72% no-repeat,
    url('/assets/bamsi-chat-reference-mist.jpg') center top / 100% 72% no-repeat;
}

/* v1.4.4 — focused, edge-to-edge mobile AI visual refinement. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame {
    background:
      var(--bamsi-mc-top-glow),
      linear-gradient(180deg,#09133c 0%,#0b1026 31%,#08090d 75%,#08090b 100%)!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header {
    flex:0 0 54px!important;
    min-height:54px!important;
    padding:6px 15px!important;
    justify-content:space-between;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header strong {
    position:absolute!important;
    width:1px!important;height:1px!important;
    padding:0!important;margin:-1px!important;
    overflow:hidden!important;clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header button {
    width:44px;min-width:44px;height:44px;
    display:grid;place-items:center;
    font-size:19px;opacity:.82;
    -webkit-tap-highlight-color:transparent;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header button[title="Свернуть"]{display:none!important}
  body:has(#platform-screen:not([hidden])) .bamsi-mc-welcome:not([hidden]) {
    top:7%!important;gap:16px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-welcome-mark {
    width:54px!important;height:54px!important;
    font-size:24px!important;
    border-color:rgba(101,150,255,.43)!important;
    background:rgba(13,33,95,.20)!important;
    box-shadow:0 0 45px rgba(35,102,255,.24),inset 0 0 20px rgba(44,93,255,.08)!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-welcome-title {
    font-size:14px!important;font-weight:400!important;
    color:rgba(237,242,255,.80)!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form {
    margin:5px 12px 11px!important;
    padding:5px 7px 5px 15px!important;
    border-radius:25px!important;
    background:linear-gradient(180deg, #0d0d0d 0%, #0e0e0e 68%, #111 100%)!important;
    border:1px solid #222!important;
    border-color:#222 #1c1c1c #181818!important;
    box-shadow:0 10px 28px rgba(0,0,0,.20), inset 0 1px 2px #ffffff22, inset 0 -2px 5px #0009!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form:focus-within {
    border-color:#252525 #202020 #1b1b1b!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form textarea {
    min-height:38px!important;
    font-size:14px!important;
    line-height:1.45!important;
    padding:8px 0!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form .bamsi-mc-send {
    top:0!important;width:42px!important;height:42px!important;
    min-width:42px!important;min-height:42px!important;
    flex:0 0 42px!important;
  }
}

/* v1.4.5 — mobile suspended AI sheet; only requested visual changes. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame {
    bottom:calc(100px + env(safe-area-inset-bottom,0px))!important;
    border-radius:0 0 30px 30px!important;
    overflow:hidden!important;
    box-shadow:0 18px 42px rgba(0,0,0,.42)!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame::after {
    content:"";position:absolute;bottom:9px;left:50%;transform:translateX(-50%);
    width:38px;height:4px;border-radius:999px;background:rgba(255,255,255,.55);
    pointer-events:none;z-index:5;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header button[title="Закрыть"] {display:none!important}
  body:has(#platform-screen:not([hidden])) .bamsi-mc-welcome-title {display:none!important}
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form {
    margin:4px 17px 34px!important;padding:3px 7px 3px 14px!important;
    min-height:48px!important;align-items:center!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form textarea {
    height:34px!important;min-height:34px!important;max-height:88px!important;
    padding:7px 0!important;line-height:20px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form .bamsi-mc-send {
    width:36px!important;height:36px!important;min-width:36px!important;
    min-height:36px!important;flex-basis:36px!important;
  }
}

/* v1.4.6: mobile AI sheet — minimal requested corrections. */
@media (max-width:640px) {
  /* Remove the central decorative cross, not the chat content. */
  body:has(#platform-screen:not([hidden])) .bamsi-mc-welcome {display:none!important}
  /* History is a floating control immediately above the composer, at right. */
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header button[title="История диалогов"] {
    position:absolute!important;
    top:auto!important;left:auto!important;
    right:17px!important;bottom:100px!important;
    z-index:12!important;
    width:40px!important;height:40px!important;min-width:40px!important;
    border-radius:50%!important;
    background:rgba(36,42,60,.92)!important;
    border:1px solid rgba(255,255,255,.17)!important;
    box-shadow:0 6px 22px rgba(0,0,0,.28)!important;
    opacity:1!important;
  }
  /* The dock lives on the dashboard surface, distinct from the blue AI sheet. */
  body.bamsi-mc-mobile-open:has(#platform-screen:not([hidden]))::before {
    background:#d9dce2!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame {
    border-radius:0 0 48px 48px!important;
  }
}

/* v1.4.7: tappable sheet edge; history icon without a circular button. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame::after {
    content:none!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-sheet-handle {
    position:absolute!important;
    bottom:0!important;
    left:50%!important;
    transform:translateX(-50%)!important;
    width:90px!important;
    height:24px!important;
    border:0!important;
    padding:0!important;
    margin:0!important;
    border-radius:12px!important;
    background:transparent!important;
    cursor:pointer!important;
    z-index:30!important;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-sheet-handle::after {
    content:"";
    position:absolute;
    left:50%;bottom:9px;
    transform:translateX(-50%);
    width:38px;height:4px;
    border-radius:999px;
    background:rgba(255,255,255,.55);
    pointer-events:none;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-header button[title="История диалогов"] {
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
}
@media (min-width:641px) {
  .bamsi-mc-sheet-handle {display:none!important}
}

/* v1.4.8: history drawer only; desktop management chat remains unchanged. */
.bamsi-mc-history-head,.bamsi-mc-history-backdrop{display:none}
@media(max-width:640px){
  .bamsi-mc-main{position:relative;isolation:isolate}
  .bamsi-mc-sidebar:not([hidden]){
    display:flex!important;flex-direction:column;position:absolute;inset:0 auto 0 0;
    width:min(85%,340px)!important;max-width:calc(100% - 40px);
    box-sizing:border-box;z-index:40;padding:20px 14px 16px;
    background:rgba(27,29,36,.98)!important;border-right:1px solid rgba(255,255,255,.10);
    border-radius:0 22px 22px 0;box-shadow:16px 0 42px rgba(0,0,0,.32);
    overflow:hidden;animation:bamsi-history-enter .26s cubic-bezier(.2,.8,.2,1) both;
  }
  .bamsi-mc-history-head{display:flex;align-items:center;justify-content:space-between;min-height:42px;margin:0 2px 14px}
  .bamsi-mc-history-title{font-size:19px;font-weight:650;letter-spacing:-.35px}
  .bamsi-mc-sidebar .bamsi-mc-history-close{width:42px;height:42px;font-size:25px;font-weight:300;color:#c8cbd5}
  .bamsi-mc-sidebar .bamsi-mc-new { min-height: 46px; padding: 11px 14px; }
  .bamsi-mc-history{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 0 12px}
  .bamsi-mc-history .bamsi-mc-history-item{display:flex;flex-direction:column;align-items:flex-start;gap:5px;
    width:100%;min-height:54px;padding:10px 12px;margin:2px 0;border-radius:12px;text-align:left}
  .bamsi-mc-history-item-title{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
  .bamsi-mc-history-item small{font-size:11px;color:#9ba0b0}
  .bamsi-mc-history .bamsi-mc-history-item.is-active{background:rgba(59,113,255,.18);color:#f5f7ff}
  .bamsi-mc-history-backdrop:not([hidden]){display:block;position:absolute;inset:0;z-index:21;
    width:100%;height:100%;border:0;padding:0;background:rgba(0,0,0,.48);backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);cursor:pointer}
  @keyframes bamsi-history-enter{from{opacity:.85;transform:translateX(-18px)}to{opacity:1;transform:translateX(0)}}
  @media(prefers-reduced-motion:reduce){.bamsi-mc-sidebar:not([hidden]){animation:none}}
  .bamsi-mc-header button[title="История диалогов"]{visibility:visible}
  .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-header button[title="История диалогов"]{visibility:hidden}
}

/* v1.4.9 — compact history list, readable empty state and keyboard focus. */
@media(max-width:640px){
  .bamsi-mc-history-empty{margin:20px 12px;color:#9ba0b0;font-size:13px;line-height:1.5}
  .bamsi-mc-sidebar .bamsi-mc-history-item:focus-visible,
  .bamsi-mc-sidebar .bamsi-mc-new:focus-visible,
  .bamsi-mc-sidebar .bamsi-mc-history-close:focus-visible{
    outline:2px solid #77a3ff;outline-offset:2px;
  }
  .bamsi-mc-history .bamsi-mc-history-item{transition:background-color .16s ease}
}
@media(prefers-reduced-motion:reduce){.bamsi-mc-history .bamsi-mc-history-item{transition:none}}

/* v1.4.10 — history sheet: square bottom, preserve AI gradient, side edge handle. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) {
    background:var(--bamsi-mc-top-glow),linear-gradient(180deg,#09133c 0%,#0b1026 31%,#08090d 75%,#08090b 100%)!important;
  }
  .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-sidebar {
    border-radius:0!important;
  }
  .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-history-backdrop {
    background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-sheet-handle {
    display:none!important;
  }
  .bamsi-mc-history-handle {display:none!important}
  .bamsi-mc-sidebar:not([hidden]) .bamsi-mc-history-handle {
    display:block!important;position:absolute;right:0;top:50%;transform:translateY(-50%);
    width:25px;height:90px;margin:0;padding:0;border:0;border-radius:12px 0 0 12px;
    background:transparent;cursor:pointer;z-index:4;touch-action:manipulation;
  }
  .bamsi-mc-sidebar:not([hidden]) .bamsi-mc-history-handle::after {
    content:"";position:absolute;right:9px;top:50%;transform:translateY(-50%);
    width:4px;height:38px;border-radius:999px;background:rgba(255,255,255,.55);pointer-events:none;
  }
  .bamsi-mc-sidebar:not([hidden]) .bamsi-mc-history-handle:focus-visible {outline:2px solid #77a3ff;outline-offset:-2px}
}

/* v1.4.11 — only mobile history drawer edge and right corners. */
@media (max-width:640px) {
  .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-sidebar {
    border-right:0!important;
    border-radius:0 22px 22px 0!important;
    box-shadow:none!important;
  }
}

/* v1.4.12 — history edge handle lower; square bottom-left corner only. */
@media (max-width:640px) {
  .bamsi-mc-sidebar:not([hidden]) .bamsi-mc-history-handle { top:62%; }
  .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-sidebar { border-bottom-left-radius:0!important; }
}

/* v1.4.13 — two targeted mobile history corrections. */
@media (max-width:640px) {
  /* Lower the three-line history opener toward the message field. */
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame .bamsi-mc-header button[title="История диалогов"] {
    bottom:72px!important;
  }
  /* The visible lower-left rounding comes from the enclosing AI frame. */
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) {
    border-bottom-left-radius:0!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame:has(.bamsi-mc-sidebar:not([hidden])) .bamsi-mc-sidebar {
    border-bottom-left-radius:0!important;
  }
}

/* v1.4.14 — mobile history close, opener placement, multiline composer. */
@media (max-width:640px) {
  .bamsi-mc-sidebar .bamsi-mc-history-close { display:none!important; }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame .bamsi-mc-header button[title="История диалогов"] {
    bottom:84px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form textarea {
    height:auto!important;
    max-height:120px!important;
    box-sizing:border-box!important;
    overflow-y:auto;
  }
}

/* v1.4.15 — keep history opener above a growing composer, never on top of send. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame .bamsi-mc-header button[title="История диалогов"] {
    bottom:calc(84px + var(--bamsi-mc-composer-extra, 0px))!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form { align-items:flex-end!important; }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form .bamsi-mc-send { align-self:flex-end!important; }
}

/* v1.4.16 — center compact composer contents and slightly raise smaller send button. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form {
    align-items:center!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form textarea {
    align-self:center!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form .bamsi-mc-send {
    width:32.4px!important;height:32.4px!important;
    min-width:32.4px!important;min-height:32.4px!important;
    flex:0 0 32.4px!important;
    align-self:center!important;
    top:0!important;
  }
}

/* v1.4.17 — center send button only when the composer is empty. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form:has(textarea:placeholder-shown) .bamsi-mc-send {
    top:0!important;
  }
}

/* v1.4.19 — remove ONLY outer blue launcher ring; keep inner BAMSI circle. */
.bamsi-mc-launcher.is-compact {
  background:transparent!important;box-shadow:none!important;border:0!important;
}
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher:not([hidden]) {
    width:44.2px!important;height:44.2px!important;padding:5.1px!important;
    background:transparent!important;box-shadow:none!important;border:0!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher .bamsi-mc-launcher-mark {
    width:32.3px!important;height:32.3px!important;flex:0 0 32.3px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher .bamsi-mc-launcher-mark svg {
    width:22.1px!important;height:22.1px!important;
  }
}

/* v1.4.28 — reveal the actual platform beneath the AI sheet.
   The opaque body overlay, not the navigation dock, hid the platform until
   the closing timer removed the mobile-open class. Fade only that overlay. */
@media (max-width:640px) {
  body.bamsi-mc-mobile-open.bamsi-mc-platform-reveal:has(#platform-screen:not([hidden]))::before {
    animation:bamsi-mc-platform-uncover 350ms linear both;
  }
}
@keyframes bamsi-mc-platform-uncover {
  from { opacity:1; }
  to { opacity:0; }
}
@media (prefers-reduced-motion:reduce) {
  body.bamsi-mc-platform-reveal::before { animation:none!important; }
}

/* v1.4.29 — the entire lower edge of the mobile AI sheet dismisses it.
   Keep composer controls above the tap strip so typing/sending is unaffected. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-sheet-handle {
    left:0!important;transform:none!important;width:100%!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form {
    position:relative;z-index:31;
  }
}

/* v1.4.32 — lower only the bottom edge of the mobile AI sheet by ~5 mm
   (19 CSS px); keep its top, toolbar, launcher, shadows and animations. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame {
    bottom:calc(81px + env(safe-area-inset-bottom,0px))!important;
  }
}

/* v1.4.34 — soft directional shadow for the BAMSI AI launcher everywhere.
   Remove the hard gray circular halo; retain only subtle depth below the mark. */
.bamsi-mc-launcher-mark {
  box-shadow:0 8px 20px rgba(0,0,0,.11),inset 0 1px 0 rgba(255,255,255,.22);
}
.bamsi-mc-launcher:not(.is-compact) {
  box-shadow:0 9px 24px rgba(0,0,0,.10),inset 0 1px 0 rgba(255,255,255,.22);
}


/* Smooth ONLY the backdrop below the mobile toolbar on AI sheet open/close. */
@media (max-width:640px) {
  body.bamsi-mc-mobile-open:not(.bamsi-mc-platform-reveal):has(#platform-screen:not([hidden]))::before {
    animation:bamsi-mc-dock-lighten 350ms ease-out both;
  }
  body.bamsi-mc-mobile-open.bamsi-mc-platform-reveal:has(#platform-screen:not([hidden]))::before {
    animation:bamsi-mc-platform-uncover 350ms linear both,
              bamsi-mc-dock-darken 350ms ease-in-out both;
  }
}
@keyframes bamsi-mc-dock-lighten {
  from { background-color:#191a20; }
  to { background-color:#d9dce2; }
}
@keyframes bamsi-mc-dock-darken {
  from { background-color:#d9dce2; }
  to { background-color:#191a20; }
}
@media (prefers-reduced-motion:reduce) {
  body.bamsi-mc-mobile-open:has(#platform-screen:not([hidden]))::before {
    animation:none!important;
  }
}

/* Mobile BAMSI launcher: 15% larger; center the actual logo within its circle. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher:not([hidden]) {
    width:50.83px!important;height:50.83px!important;padding:5.87px!important;
    display:grid!important;place-items:center!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher .bamsi-mc-launcher-mark {
    width:37.15px!important;height:37.15px!important;flex:0 0 37.15px!important;
    display:grid!important;place-items:center!important;
    margin:0!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher .bamsi-mc-launcher-mark svg {
    width:25.42px!important;height:25.42px!important;
    display:block!important;margin:0!important;transform:none!important;
  }
}

/* v1.4.38 — additional 15% mobile BAMSI launcher; logo 1 mm to the left. */
@media (max-width:640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher:not([hidden]) {
    width:58.45px!important;height:58.45px!important;padding:6.75px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher .bamsi-mc-launcher-mark {
    width:42.72px!important;height:42.72px!important;flex:0 0 42.72px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-launcher .bamsi-mc-launcher-mark svg {
    width:29.23px!important;height:29.23px!important;
    transform:none!important;
  }
}

/* Mobile history: oldest at top, newest immediately above New dialog. */
@media (max-width:640px) {
  .bamsi-mc-sidebar:not([hidden]) .bamsi-mc-new {
    order: 2;
    margin-top: 12px;
    margin-bottom: 0;
  }
  .bamsi-mc-sidebar:not([hidden]) .bamsi-mc-history { order: 1; }
}

/* Mobile AI sheet: no backdrop flash on open; no dark right-edge stripe. */
@media (max-width:640px) {
  body.bamsi-mc-mobile-open:not(.bamsi-mc-platform-reveal):has(#platform-screen:not([hidden]))::before {
    animation:none!important;
    background:#d9dce2!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-frame {
    box-shadow:0 16px 24px -18px rgba(0,0,0,.42)!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-messages {
    scrollbar-width:none;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-messages::-webkit-scrollbar {
    display:none;
  }
}

/* Mobile AI: wait for the descending sheet before revealing the gray dock.
   Keep the existing sheet movement and closing transition unchanged. */
@media (max-width:640px) {
  body.bamsi-mc-mobile-open:not(.bamsi-mc-platform-reveal):has(#platform-screen:not([hidden]))::before {
    animation:bamsi-mc-dock-after-sheet 100ms linear both!important;
    inset:-1px!important;
    right:-2px!important;
    width:auto!important;
    max-width:none!important;
    box-shadow:none!important;
  }
  /* On narrow screens, the document scrollbar can appear as a dark edge
     above the fixed gray backdrop. Hide its paint, not page scrolling. */
  html:has(body.bamsi-mc-mobile-open #platform-screen:not([hidden])) {
    scrollbar-width:none;
  }
  html:has(body.bamsi-mc-mobile-open #platform-screen:not([hidden]))::-webkit-scrollbar {
    display:none;
  }
}
@keyframes bamsi-mc-dock-after-sheet {
  0% { opacity:0; background-color:#d9dce2; }
  100% { opacity:1; background-color:#d9dce2; }
}
@media (max-width:640px) and (prefers-reduced-motion:reduce) {
  body.bamsi-mc-mobile-open:not(.bamsi-mc-platform-reveal):has(#platform-screen:not([hidden]))::before {
    animation:none!important;
    background-color:#d9dce2!important;
  }
}

@media (min-width: 641px) {
  .bamsi-mc-frame {
    width: min(480px, calc(100vw - 48px));
    height: min(680px, calc(100dvh - 48px));
    border-radius: 15% / 8%;
    corner-shape: squircle;
    border-color: #747fff36;
    background:
      var(--bamsi-mc-top-glow),
      #07070b;
    box-shadow: 0 24px 68px #000a, 0 0 28px #314aee24;
    color-scheme: dark;
  }
  .bamsi-mc-frame .bamsi-mc-header {
    padding: 14px 17px;
    border-bottom: 0;
    background: transparent;
  }
  .bamsi-mc-frame .bamsi-mc-header strong { visibility: hidden; }
  .bamsi-mc-frame .bamsi-mc-header button { min-width: 32px; min-height: 32px; }
  .bamsi-mc-frame .bamsi-mc-chat-area { position: relative; }
  .bamsi-mc-frame .bamsi-mc-header button[title="Свернуть"] { display: none; }
  .bamsi-mc-frame .bamsi-mc-messages { padding: 20px 18px; scrollbar-color: #454763 transparent; }
  .bamsi-mc-frame .bamsi-mc-message.assistant {
    background: #14141be8;
    border-color: #ffffff15;
  }
  .bamsi-mc-frame .bamsi-mc-messages:has(.user) .status {
    display: grid;
    justify-items: start;
    align-self: flex-start;
    gap: 10px;
    max-width: 100%;
    margin: 12px 0;
    color: #e3e9ff;
  }
  .bamsi-mc-frame .bamsi-mc-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    margin: 10px 20px 20px;
    padding: 14px 14px 12px 18px;
    border-radius: 38px;
    corner-shape: superellipse(1.35);
    border-color: #222 #1c1c1c #181818;
    background: linear-gradient(180deg, #0d0d0d 0%, #0e0e0e 68%, #111 100%);
    box-shadow: inset 0 1px 1px #ffffff0e, inset 0 -2px 4px #0006;
  }
  .bamsi-mc-frame .bamsi-mc-form:focus-within {
    border-color: #252525 #202020 #1b1b1b;
    box-shadow: inset 0 1px 1px #ffffff0e, inset 0 -2px 4px #0006;
  }
  .bamsi-mc-frame .bamsi-mc-form textarea {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
    max-height: 180px;
    overflow-y: auto;
  }
  .bamsi-mc-frame .bamsi-mc-form .bamsi-mc-send {
    grid-column: 2;
    justify-self: end;
    align-self: end;
    top: 0;
  }
  .bamsi-mc-frame .bamsi-mc-sidebar {
    background: #101018;
    border-right-color: #a3b1ff25;
  }
}
@media (min-width: 641px) and (prefers-reduced-motion: reduce) {
}


.bamsi-mc-form .bamsi-mc-attach {
  grid-column: 1;
  justify-self: start;
  align-self: end;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #050505;
  color: #fff;
  font: 400 21px/1 system-ui;
}
.bamsi-mc-form .bamsi-mc-attach:hover:not(:disabled) { background: #202020; }
.bamsi-mc-form .bamsi-mc-attachment {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  padding: 3px 7px 3px 10px;
  border-radius: 12px;
  background: #222228;
  color: #e9e9ef;
  font-size: 12px;
}
.bamsi-mc-form .bamsi-mc-attachment[hidden] { display: none; }
.bamsi-mc-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bamsi-mc-form .bamsi-mc-attachment button {
  background: transparent;
  color: inherit;
  padding: 3px 5px;
}
@media (max-width: 640px) {
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 6px 13px 7px!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form textarea {
    grid-column: 1 / -1;
    width: 100%;
    position: relative;
    top: 1mm;
    padding-left: 2mm!important;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form .bamsi-mc-send {
    grid-column: 2;
    justify-self: end;
  }
  body:has(#platform-screen:not([hidden])) .bamsi-mc-form .bamsi-mc-attach {
    width: 32.4px;
    height: 32.4px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .bamsi-mc-message.is-thinking {
    animation: bamsi-mc-thinking 1.25s ease-in-out infinite alternate;
  }
}
@keyframes bamsi-mc-thinking {
  from { opacity: 1; }
  to { opacity: .68; }
}

.bamsi-mc-stage-findings { display:block; margin-top:10px; font-size:.9em; opacity:.8; line-height:1.45; }
.bamsi-mc-analysis-actions { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0; }

.bamsi-mc-analysis-coverage { display:block; opacity:.65; font-size:.8em; margin:8px 0; }

.bamsi-mc-message.assistant strong { font-weight:700; color:inherit; }
