/* Assistente Medical Save — widget de qualificação (protótipo). Modular: pode ser removido sem afetar o resto. */
.ms-ai * { box-sizing: border-box; }

/* Launcher */
.ms-ai-launcher {
  position: fixed; right: 20px; bottom: 84px; z-index: 155;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy, #10263F); color: #fff; border: none; cursor: pointer;
  border-radius: 0; padding: 12px 18px 12px 14px; font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .02em; font-size: 14.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
}
.ms-ai-launcher:hover { background: #163454; }
.ms-ai-launcher .dot { width: 9px; height: 9px; border-radius: 50%; background: #35D07F; flex: none; box-shadow: 0 0 0 3px rgba(53,208,127,.25); }
.ms-ai-launcher svg { width: 20px; height: 20px; flex: none; }
.ms-ai-launcher.hidden { display: none; }

/* Painel */
.ms-ai-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  width: 374px; max-width: calc(100vw - 32px); height: 588px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 0; overflow: hidden; display: none; flex-direction: column;
  box-shadow: 0 24px 64px rgba(6,15,26,.34); font-family: 'Barlow', sans-serif;
  border: 1px solid rgba(6,15,26,.08);
}
.ms-ai-panel.open { display: flex; }

/* Header */
.ms-ai-head { background: var(--navy, #10263F); color: #fff; padding: 14px 16px 12px; }
.ms-ai-head-top { display: flex; align-items: center; gap: 11px; }
.ms-ai-ava { width: 38px; height: 38px; border-radius: 50%; background: var(--red, #C8102E); display: flex; align-items: center; justify-content: center; flex: none; }
.ms-ai-ava svg { width: 22px; height: 22px; color: #fff; }
.ms-ai-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.15; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .01em; }
.ms-ai-head .status { font-size: 12px; color: #B9C7D6; display: flex; align-items: center; gap: 6px; margin-top: 1px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .04em; }
.ms-ai-head .status .dot { width: 7px; height: 7px; border-radius: 50%; background: #35D07F; }
.ms-ai-close { margin-left: auto; background: none; border: none; color: #B9C7D6; cursor: pointer; padding: 6px; border-radius: 0; }
.ms-ai-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.ms-ai-close svg { width: 20px; height: 20px; }

/* Faixa de emergência — sempre visível */
.ms-ai-emerg {
  display: flex; align-items: center; gap: 9px; margin-top: 11px;
  background: #fff; border-radius: 0; padding: 8px 11px; color: #7A1010;
}
.ms-ai-emerg svg { width: 20px; height: 20px; color: var(--red, #C8102E); flex: none; }
.ms-ai-emerg span { font-size: 12.5px; line-height: 1.35; font-weight: 600; font-family: 'Barlow', sans-serif; }
.ms-ai-emerg a { color: #7A1010; font-weight: 800; white-space: nowrap; text-decoration: underline; }

/* Corpo de mensagens */
.ms-ai-body { flex: 1; overflow-y: auto; padding: 16px; background: #F4F7FA; display: flex; flex-direction: column; gap: 10px; }
.ms-ai-msg { max-width: 84%; font-size: 14.5px; line-height: 1.5; padding: 10px 13px; border-radius: 0; font-family: 'Barlow', sans-serif; }
.ms-ai-msg.bot { background: #fff; color: #22303F; border: 1px solid #E3E9EF; border-bottom-left-radius: 0; align-self: flex-start; }
.ms-ai-msg.user { background: var(--navy, #10263F); color: #fff; border-bottom-right-radius: 0; align-self: flex-end; }
.ms-ai-msg.alert { background: #FDECEC; color: #7A1010; border: 1px solid #F1B9B9; font-weight: 600; max-width: 100%; }
.ms-ai-msg strong { font-weight: 800; }
.ms-ai-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid #E3E9EF; border-radius: 0; }
.ms-ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: #B4C0CC; animation: msblink 1.1s infinite; }
.ms-ai-typing span:nth-child(2) { animation-delay: .18s; }
.ms-ai-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes msblink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* Rodapé de interação */
.ms-ai-foot { border-top: 1px solid #E3E9EF; padding: 12px; background: #fff; }
.ms-ai-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-ai-choice {
  border: 1.5px solid var(--navy, #10263F); background: #fff; color: var(--navy, #10263F);
  border-radius: 0; padding: 9px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .02em;
  transition: background .12s, color .12s;
}
.ms-ai-choice:hover { background: var(--navy, #10263F); color: #fff; }
.ms-ai-choice.primary { background: var(--red, #C8102E); border-color: var(--red, #C8102E); color: #fff; }
.ms-ai-choice.primary:hover { background: #9E0C24; }
.ms-ai-choice.wa { background: var(--wa, #0F7A43); border-color: var(--wa, #0F7A43); color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.ms-ai-choice.wa:hover { background: #0B5F34; }
.ms-ai-choice.wa svg { width: 17px; height: 17px; }
.ms-ai-inputrow { display: flex; gap: 8px; }
.ms-ai-inputrow input {
  flex: 1; border: 1.5px solid #D3DBE3; border-radius: 0; padding: 10px 12px; font-size: 14px;
  font-family: 'Barlow', sans-serif; color: #22303F;
}
.ms-ai-inputrow input:focus { outline: 3px solid rgba(200,16,46,.22); border-color: var(--red, #C8102E); }
.ms-ai-send { border: none; background: var(--navy, #10263F); color: #fff; border-radius: 0; padding: 0 14px; cursor: pointer; font-weight: 700; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.ms-ai-send:hover { background: #163454; }
.ms-ai-disclaimer { font-size: 11px; color: #5A6B7C; text-align: center; margin: 9px 2px 0; line-height: 1.4; font-family: 'Barlow', sans-serif; }

@media (max-width: 480px) {
  .ms-ai-panel { right: 12px; left: 12px; bottom: 12px; width: auto; height: calc(100vh - 24px); }
  .ms-ai-launcher { right: 12px; bottom: 76px; }
  .ms-ai-launcher .label { display: none; }
  .ms-ai-launcher { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-ai-typing span { animation: none; }
}
