#orthoserve-chatbot {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

#orthoserve-chatbot * { box-sizing: border-box; }

#orthoserve-chat-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 18px 12px 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(135deg, var(--ms-secondary), var(--ms-primary));
  box-shadow: 0 18px 45px rgba(0, 103, 177, 0.32);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}

#orthoserve-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 55px rgba(0, 103, 177, 0.42);
}

#orthoserve-chat-toggle img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  padding: 6px;
  border-radius: 50%;
  background: #fff;
}

#orthoserve-chat-window {
  display: none;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 110px);
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

#orthoserve-chat-window.ms-open { display: block; }

.ms-chat-header {
  min-height: 92px;
  padding: 18px;
  background: linear-gradient(135deg, var(--ms-secondary), var(--ms-primary) 72%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ms-chat-brand { display: flex; align-items: center; gap: 13px; }

.ms-chat-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 10px 25px rgba(0,0,0,.12);
}

.ms-chat-logo-wrap img, .ms-avatar {
  object-fit: contain;
}

.ms-chat-logo-wrap img { width: 42px; height: 42px; }

.ms-chat-header h3 {
  margin: 0;
  color: #fff;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 850;
}

.ms-chat-header p { margin: 6px 0 0; font-size: 13px; opacity: .92; }
.ms-status-dot { display: inline-block; width: 9px; height: 9px; background: #19e28a; border-radius: 99px; margin-right: 6px; }

#orthoserve-chat-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.ms-chat-body {
  height: calc(100% - 168px);
  padding: 18px 17px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.ms-message-row { display: flex; gap: 10px; margin-bottom: 14px; }
.ms-user-row { justify-content: flex-end; }
.ms-avatar { width: 34px; height: 34px; padding: 4px; border-radius: 50%; background: #fff; box-shadow: 0 7px 18px rgba(15,23,42,.10); flex: 0 0 auto; }

.ms-message {
  max-width: 84%;
  padding: 13px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.48;
}

.ms-message p { margin: 0 0 6px; }
.ms-message small { display: block; color: #64748b; font-size: 12px; line-height: 1.4; }
.ms-bot-message { background: #fff; color: #172033; border: 1px solid rgba(15,23,42,.08); border-bottom-left-radius: 7px; box-shadow: 0 8px 20px rgba(15,23,42,.06); }
.ms-user-message { background: #eaf4ff; color: #0f172a; border-bottom-right-radius: 7px; }

.ms-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0 18px 44px; }
.ms-quick-actions button {
  padding: 10px 12px;
  border: 1px solid rgba(0,103,177,.22);
  border-radius: 999px;
  background: #fff;
  color: var(--ms-primary);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.ms-quick-actions button:hover { background: #f0f7ff; border-color: var(--ms-primary); transform: translateY(-1px); }

.ms-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.ms-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; display: block; animation: msBlink 1.2s infinite ease-in-out; }
.ms-typing span:nth-child(2) { animation-delay: .16s; }
.ms-typing span:nth-child(3) { animation-delay: .32s; }
@keyframes msBlink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ms-chat-input-area {
  height: 66px;
  padding: 11px 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-top: 1px solid rgba(15,23,42,.08);
}
#orthoserve-chat-input {
  flex: 1;
  height: 44px;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 999px;
  padding: 0 15px;
  outline: none;
  font-size: 14px;
  background: #fff;
}
#orthoserve-chat-input:focus { border-color: var(--ms-primary); box-shadow: 0 0 0 4px rgba(0,103,177,.10); }
#orthoserve-chat-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--ms-primary);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.ms-secure-note { height: 28px; text-align: center; color: #64748b; font-size: 12px; background: #fff; }

.ms-lead-card {
  margin: 10px 0 15px 44px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(15,23,42,.06);
}
.ms-lead-card label { display: block; margin-bottom: 8px; font-size: 12px; color: #475569; font-weight: 750; }
.ms-lead-card input, .ms-lead-card textarea {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.13);
  font: inherit;
}
.ms-lead-card button { width: 100%; padding: 11px 14px; border: 0; border-radius: 999px; background: var(--ms-primary); color: #fff; font-weight: 800; cursor: pointer; }

@media (max-width: 520px) {
  #orthoserve-chat-toggle span { display: none; }
  .ms-message { max-width: 88%; }
}

/* Rev 1.1 — reduced typography size + stronger WordPress theme isolation */
#orthoserve-chatbot,
#orthoserve-chatbot * {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

#orthoserve-chat-window {
  font-size: 14px !important;
}

.ms-chat-header {
  min-height: 82px !important;
  padding: 14px 16px !important;
}

.ms-chat-logo-wrap {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
}

.ms-chat-logo-wrap img {
  width: 36px !important;
  height: 36px !important;
}

.ms-chat-header h3 {
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
}

.ms-chat-header p {
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.ms-message {
  font-size: 13.5px !important;
  line-height: 1.42 !important;
  padding: 11px 13px !important;
}

.ms-message p,
.ms-message div,
.ms-message span {
  font-size: inherit !important;
  line-height: inherit !important;
}

.ms-message small {
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}

.ms-quick-actions button {
  font-size: 12.5px !important;
  line-height: 1.2 !important;
  padding: 9px 10px !important;
  font-weight: 750 !important;
}

#orthoserve-chat-input {
  font-size: 13.5px !important;
}

.ms-secure-note {
  font-size: 11.5px !important;
}

@media (max-width: 520px) {
  #orthoserve-chatbot {
    right: 0 !important;
    bottom: 0 !important;
  }

  #orthoserve-chat-window {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 82vh !important;
    max-height: 82vh !important;
    border-radius: 22px 22px 0 0 !important;
  }

  .ms-chat-header {
    min-height: 76px !important;
    padding: 13px 14px !important;
  }

  .ms-chat-brand {
    gap: 10px !important;
  }

  .ms-chat-logo-wrap {
    width: 46px !important;
    height: 46px !important;
    border-radius: 15px !important;
  }

  .ms-chat-logo-wrap img {
    width: 34px !important;
    height: 34px !important;
  }

  .ms-chat-header h3 {
    font-size: 16px !important;
    line-height: 1.12 !important;
  }

  .ms-chat-header p {
    font-size: 11.5px !important;
    margin-top: 4px !important;
  }

  #orthoserve-chat-close {
    width: 34px !important;
    height: 34px !important;
    font-size: 22px !important;
  }

  .ms-chat-body {
    padding: 14px 12px !important;
    height: calc(100% - 160px) !important;
  }

  .ms-avatar {
    width: 30px !important;
    height: 30px !important;
    padding: 4px !important;
  }

  .ms-message-row {
    gap: 8px !important;
    margin-bottom: 11px !important;
  }

  .ms-message {
    max-width: 82% !important;
    font-size: 13px !important;
    line-height: 1.38 !important;
    padding: 10px 12px !important;
    border-radius: 16px !important;
  }

  .ms-quick-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin: 12px 0 14px 38px !important;
  }

  .ms-quick-actions button {
    font-size: 12px !important;
    padding: 8px 9px !important;
    min-height: 40px !important;
  }

  .ms-chat-input-area {
    height: 62px !important;
    padding: 9px 11px !important;
  }

  #orthoserve-chat-input,
  #orthoserve-chat-send {
    height: 42px !important;
  }

  #orthoserve-chat-send {
    width: 42px !important;
  }
}


/* Rev 1.3 — desktop glow launcher + mobile centered launcher */
#orthoserve-chat-toggle {
  position: relative;
  overflow: visible;
}

#orthoserve-chat-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(218,31,54,.45), rgba(0,103,177,.45));
  filter: blur(14px);
  opacity: 0;
  z-index: -1;
  transition: opacity .25s ease, transform .25s ease;
}

#orthoserve-chat-toggle::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.06));
  z-index: -1;
  pointer-events: none;
}

#orthoserve-chat-toggle img {
  box-shadow: 0 0 0 0 rgba(255,255,255,.30), 0 0 0 0 rgba(0,103,177,.18);
  transition: box-shadow .25s ease, transform .25s ease;
}

@media (min-width: 521px) {
  #orthoserve-chat-toggle {
    box-shadow: 0 18px 45px rgba(0, 103, 177, 0.32), 0 0 0 1px rgba(255,255,255,.10) inset;
    animation: msLauncherGlow 2.8s ease-in-out infinite;
  }

  #orthoserve-chat-toggle::before {
    opacity: .88;
    animation: msLauncherAura 2.8s ease-in-out infinite;
  }

  #orthoserve-chat-toggle:hover::before {
    opacity: 1;
    transform: scale(1.02);
  }

  #orthoserve-chat-toggle:hover img {
    box-shadow: 0 0 0 6px rgba(255,255,255,.16), 0 0 26px rgba(255,255,255,.40), 0 0 36px rgba(0,103,177,.30);
    transform: scale(1.04);
  }
}

@keyframes msLauncherGlow {
  0%, 100% {
    box-shadow: 0 18px 45px rgba(0,103,177,.30), 0 0 0 0 rgba(0,103,177,.12);
  }
  50% {
    box-shadow: 0 22px 54px rgba(0,103,177,.40), 0 0 0 8px rgba(0,103,177,.08);
  }
}

@keyframes msLauncherAura {
  0%, 100% { transform: scale(0.98); filter: blur(14px); }
  50% { transform: scale(1.03); filter: blur(16px); }
}

@media (max-width: 520px) {
  #orthoserve-chatbot {
    right: 12px !important;
    top: 72% !important;
    bottom: auto !important;
    transform: translateY(-50%);
  }

  #orthoserve-chat-window {
    position: fixed;
    right: 12px;
    top: 54%;
    bottom: auto;
    transform: translateY(-50%);
    width: min(calc(100vw - 24px), 420px);
    height: min(78vh, 680px);
    max-height: calc(100vh - 24px);
  }

  #orthoserve-chat-toggle {
    min-height: 56px;
    padding: 10px;
    box-shadow: 0 16px 38px rgba(0,103,177,.22);
  }

  #orthoserve-chat-toggle::before,
  #orthoserve-chat-toggle::after {
    display: none;
  }

  #orthoserve-chat-window.ms-open + #orthoserve-chat-toggle {
    transform: none;
  }
}


/* Rev 1.6 — mobile safe-area layout so the full widget stays clearly visible */
@media (max-width: 520px) {
  #orthoserve-chatbot {
    right: 12px !important;
    left: auto !important;
    top: auto !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 96px) !important;
    transform: none !important;
  }

  #orthoserve-chat-toggle {
    min-height: 56px;
    padding: 10px;
    box-shadow: 0 16px 38px rgba(0,103,177,.22);
  }

  #orthoserve-chat-toggle::before,
  #orthoserve-chat-toggle::after {
    display: none;
  }

  #orthoserve-chat-window {
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    top: calc(env(safe-area-inset-top, 0px) + 70px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    height: auto;
    max-height: none;
    transform: none;
    border-radius: 24px;
  }

  .ms-chat-header {
    min-height: 78px !important;
    padding: 12px 14px !important;
  }

  .ms-chat-header h3 {
    font-size: 15px !important;
  }

  .ms-chat-header p {
    font-size: 11px !important;
  }

  .ms-chat-logo-wrap {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
  }

  .ms-chat-logo-wrap img {
    width: 31px !important;
    height: 31px !important;
  }

  #orthoserve-chat-close {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

  .ms-chat-body {
    height: calc(100% - 154px);
    padding: 14px 12px;
  }

  .ms-message {
    max-width: 92%;
    font-size: 12.5px !important;
    line-height: 1.36 !important;
    padding: 10px 11px !important;
  }

  .ms-avatar {
    width: 28px;
    height: 28px;
    padding: 3px;
  }

  .ms-quick-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 14px 0;
  }

  .ms-quick-actions button {
    padding: 9px 8px;
    font-size: 12px;
    line-height: 1.15;
  }

  .ms-chat-input-area {
    height: 58px;
    padding: 8px 10px;
  }

  #orthoserve-chat-input {
    height: 40px;
    font-size: 13px;
  }

  #orthoserve-chat-send {
    width: 40px;
    height: 40px;
  }

  .ms-secure-note {
    height: 22px;
    font-size: 11px;
  }

  .ms-lead-card {
    margin: 10px 0 14px 0;
  }
}


/* Rev 1.7 — tighter spacing between welcome message and quick answer buttons on mobile */
@media (max-width: 520px) {
  .ms-message-row.ms-bot-row {
    margin-bottom: 6px !important;
  }

  .ms-message p {
    margin-bottom: 4px !important;
  }

  .ms-message small {
    margin-top: 0 !important;
  }

  .ms-quick-actions {
    margin: 4px 0 10px 38px !important;
    gap: 6px !important;
  }

  .ms-quick-actions button {
    min-height: 36px !important;
    padding: 7px 8px !important;
  }
}


/* Rev 1.8 — move the mobile window higher and make the open widget more compact */
@media (max-width: 520px) {
  #orthoserve-chat-window.ms-open {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    top: calc(env(safe-area-inset-top, 0px) + 110px) !important;
    bottom: auto !important;
    height: min(60vh, 560px) !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 130px) !important;
    transform: none !important;
    border-radius: 22px !important;
  }

  .ms-chat-body {
    height: calc(100% - 142px) !important;
    padding: 12px 12px 10px !important;
  }

  .ms-message-row {
    margin-bottom: 8px !important;
  }

  .ms-quick-actions {
    margin: 4px 0 8px 38px !important;
  }

  .ms-chat-input-area {
    height: 56px !important;
    padding: 8px 10px !important;
  }

  .ms-secure-note {
    height: 20px !important;
  }
}


/* Rev 1.9 — make the bottom security/lock message clearly visible on mobile */
@media (max-width: 520px) {
  #orthoserve-chat-window.ms-open {
    top: calc(env(safe-area-inset-top, 0px) + 100px) !important;
    height: min(59vh, 550px) !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 118px) !important;
  }

  .ms-chat-body {
    height: calc(100% - 148px) !important;
    padding: 12px 12px 8px !important;
  }

  .ms-chat-input-area {
    height: 54px !important;
    padding: 7px 10px !important;
    border-top: 1px solid rgba(15,23,42,.08) !important;
    border-bottom: 1px solid rgba(15,23,42,.06) !important;
    background: #ffffff !important;
  }

  .ms-secure-note {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 10px 6px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    color: #64748b !important;
    background: #ffffff !important;
    border-radius: 0 0 22px 22px !important;
    position: relative !important;
    z-index: 3 !important;
    overflow: visible !important;
  }
}


/* Rev 2.0 — extra bottom spacing after the security text on mobile */
@media (max-width: 520px) {
  #orthoserve-chat-window.ms-open {
    top: calc(env(safe-area-inset-top, 0px) + 96px) !important;
    height: min(56vh, 520px) !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 126px) !important;
  }

  .ms-chat-body {
    height: calc(100% - 152px) !important;
  }

  .ms-chat-input-area {
    height: 52px !important;
    padding: 7px 10px 6px !important;
  }

  .ms-secure-note {
    height: 40px !important;
    min-height: 40px !important;
    padding: 4px 10px 14px !important;
    margin-bottom: 6px !important;
    border-radius: 0 0 22px 22px !important;
  }
}


/* Rev 2.1 — separate the medical warning text inside the welcome message */
.ms-bot-message small {
  display: block !important;
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(15,23,42,.10) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: #111111 !important;
  font-weight: 600 !important;
}

@media (max-width: 520px) {
  .ms-bot-message small {
    margin-top: 8px !important;
    padding-top: 8px !important;
    font-size: 10.5px !important;
    line-height: 1.32 !important;
    color: #111111 !important;
  }
}


/* Rev 2.2 — add breathing room after the 6 quick action buttons */
@media (max-width: 520px) {
  .ms-quick-actions {
    margin-bottom: 22px !important;
  }

  .ms-chat-body::after {
    content: "";
    display: block;
    height: 8px;
  }
}

@media (min-width: 521px) {
  .ms-quick-actions {
    margin-bottom: 26px !important;
  }
}


/* Rev 2.3 — more bottom breathing room below the 6 quick actions while keeping the top text visible */
@media (max-width: 520px) {
  #orthoserve-chat-window.ms-open {
    top: calc(env(safe-area-inset-top, 0px) + 92px) !important;
    height: min(62vh, 585px) !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 112px) !important;
  }

  .ms-chat-body {
    height: calc(100% - 160px) !important;
    padding: 14px 12px 8px !important;
  }

  .ms-message-row.ms-bot-row {
    margin-bottom: 8px !important;
  }

  .ms-bot-message {
    padding-bottom: 12px !important;
  }

  .ms-quick-actions {
    margin: 10px 0 28px 38px !important;
    gap: 8px !important;
  }

  .ms-quick-actions button {
    min-height: 38px !important;
    padding: 8px 8px !important;
  }

  .ms-chat-input-area {
    margin-top: 0 !important;
  }

  .ms-secure-note {
    margin-top: 0 !important;
  }
}


/* Rev 3.7 — reverted launcher behavior; only compact welcome text changes retained */
.ms-bot-message p {
  margin-bottom: 0 !important;
}

.ms-bot-message small {
  margin-top: 12px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(15,23,42,.09) !important;
  font-size: 10.5px !important;
  line-height: 1.34 !important;
  color: #687386 !important;
  font-weight: 500 !important;
}

@media (max-width: 520px) {
  .ms-bot-message {
    padding: 10px 12px !important;
  }

  .ms-bot-message p {
    font-size: 12.75px !important;
    line-height: 1.34 !important;
  }

  .ms-bot-message small {
    margin-top: 9px !important;
    padding-top: 8px !important;
    font-size: 10px !important;
    line-height: 1.28 !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
  }

  .ms-quick-actions {
    grid-template-columns: 1fr 1fr !important;
    margin: 10px 0 22px 38px !important;
    gap: 7px !important;
  }

  .ms-quick-actions button {
    min-height: 36px !important;
    padding: 7px 8px !important;
    font-size: 11.75px !important;
  }

  .ms-quick-actions button:nth-child(n+5) {
    display: none !important;
  }
}


/* OrthoServe v1.1 — authoritative scoped layout reset/fix */
#orthoserve-chatbot {
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

#orthoserve-chatbot,
#orthoserve-chatbot * {
  box-sizing: border-box !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

#orthoserve-chat-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  min-height: 58px !important;
  width: auto !important;
  height: auto !important;
  padding: 12px 18px 12px 12px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--ms-secondary), var(--ms-primary)) !important;
  box-shadow: 0 18px 45px rgba(0,103,177,.30) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

#orthoserve-chat-toggle::before,
#orthoserve-chat-toggle::after {
  display: none !important;
  content: none !important;
}

#orthoserve-chat-toggle img {
  display: block !important;
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  object-fit: contain !important;
  padding: 6px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

#orthoserve-chat-toggle span {
  display: inline-block !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

#orthoserve-chat-window {
  display: none !important;
  position: relative !important;
  width: 410px !important;
  height: 620px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 110px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 28px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  box-shadow: 0 28px 80px rgba(15,23,42,.24) !important;
  transform: none !important;
  pointer-events: auto !important;
}

#orthoserve-chat-window.ms-open {
  display: flex !important;
  flex-direction: column !important;
}

#orthoserve-chat-window .ms-chat-header {
  flex: 0 0 auto !important;
  width: 100% !important;
  min-height: 82px !important;
  height: auto !important;
  padding: 14px 16px !important;
  margin: 0 !important;
  background: linear-gradient(135deg, var(--ms-secondary), var(--ms-primary) 72%) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  overflow: hidden !important;
}

#orthoserve-chat-window .ms-chat-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

#orthoserve-chat-window .ms-chat-logo-wrap {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 48px !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#orthoserve-chat-window .ms-chat-logo-wrap img,
#orthoserve-chat-window .ms-avatar {
  display: block !important;
  object-fit: contain !important;
}

#orthoserve-chat-window .ms-chat-logo-wrap img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#orthoserve-chat-window .ms-chat-header h3 {
  margin: 0 !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
  white-space: normal !important;
}

#orthoserve-chat-window .ms-chat-header p {
  margin: 5px 0 0 !important;
  padding: 0 !important;
  color: rgba(255,255,255,.88) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

#orthoserve-chat-window .ms-status-dot {
  display: inline-block !important;
  width: 9px !important;
  height: 9px !important;
  margin-right: 6px !important;
  border-radius: 99px !important;
  background: #19e28a !important;
}

#orthoserve-chat-close {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 36px !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.16) !important;
  color: #ffffff !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#orthoserve-chat-window .ms-chat-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  padding: 16px 15px !important;
  margin: 0 !important;
  overflow-y: auto !important;
  background: linear-gradient(180deg, #f8fbff, #ffffff) !important;
}

#orthoserve-chat-window .ms-message-row {
  display: flex !important;
  gap: 9px !important;
  width: 100% !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
}

#orthoserve-chat-window .ms-user-row {
  justify-content: flex-end !important;
}

#orthoserve-chat-window .ms-avatar {
  flex: 0 0 30px !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 4px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 7px 18px rgba(15,23,42,.10) !important;
}

#orthoserve-chat-window .ms-message {
  max-width: 86% !important;
  width: auto !important;
  min-width: 0 !important;
  padding: 10px 12px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  font-size: 13px !important;
  line-height: 1.38 !important;
}

#orthoserve-chat-window .ms-message p {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  line-height: 1.38 !important;
}

#orthoserve-chat-window .ms-bot-message {
  background: #ffffff !important;
  color: #172033 !important;
  border: 1px solid rgba(15,23,42,.08) !important;
  border-bottom-left-radius: 7px !important;
  box-shadow: 0 8px 20px rgba(15,23,42,.06) !important;
}

#orthoserve-chat-window .ms-user-message {
  background: #eaf4ff !important;
  color: #0f172a !important;
  border-bottom-right-radius: 7px !important;
}

#orthoserve-chat-window .ms-bot-message small {
  display: block !important;
  margin-top: 9px !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(15,23,42,.09) !important;
  color: #6b7280 !important;
  font-size: 10px !important;
  line-height: 1.28 !important;
  font-weight: 500 !important;
}

#orthoserve-chat-window .ms-quick-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin: 10px 0 22px 39px !important;
  padding: 0 !important;
}

#orthoserve-chat-window .ms-quick-actions button {
  display: block !important;
  width: 100% !important;
  min-height: 36px !important;
  padding: 7px 8px !important;
  margin: 0 !important;
  border: 1px solid rgba(0,103,177,.22) !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: var(--ms-primary) !important;
  font-size: 11.75px !important;
  line-height: 1.15 !important;
  font-weight: 750 !important;
  text-align: center !important;
  cursor: pointer !important;
}

#orthoserve-chat-window .ms-chat-input-area {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: 58px !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  border-top: 1px solid rgba(15,23,42,.08) !important;
}

#orthoserve-chat-input {
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 42px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border: 1px solid rgba(15,23,42,.14) !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 13.5px !important;
  line-height: 42px !important;
  outline: none !important;
  box-shadow: none !important;
}

#orthoserve-chat-send {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 42px !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--ms-primary) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#orthoserve-chat-window .ms-secure-note {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 10px 6px !important;
  margin: 0 !important;
  color: #64748b !important;
  background: #ffffff !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  text-align: center !important;
}

@media (max-width: 520px) {
  #orthoserve-chatbot {
    right: 16px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 110px) !important;
  }

  #orthoserve-chat-toggle {
    min-height: 56px !important;
    width: 56px !important;
    height: 56px !important;
    padding: 8px !important;
    border-radius: 50% !important;
  }

  #orthoserve-chat-toggle span {
    display: none !important;
  }

  #orthoserve-chat-toggle img {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    padding: 6px !important;
  }

  #orthoserve-chat-window.ms-open {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: calc(env(safe-area-inset-top, 0px) + 96px) !important;
    bottom: auto !important;
    width: auto !important;
    height: min(62vh, 585px) !important;
    max-width: none !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 112px) !important;
    border-radius: 22px !important;
  }

  #orthoserve-chat-window .ms-chat-header {
    min-height: 76px !important;
    padding: 13px 14px !important;
  }

  #orthoserve-chat-window .ms-chat-logo-wrap {
    flex-basis: 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 15px !important;
  }

  #orthoserve-chat-window .ms-chat-logo-wrap img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }

  #orthoserve-chat-window .ms-chat-header h3 {
    font-size: 16px !important;
  }

  #orthoserve-chat-window .ms-quick-actions button:nth-child(n+5) {
    display: none !important;
  }
}


/* v1.2 — CPAP-style hover preview bubble with typing animation */
#orthoserve-chatbot {
  isolation: isolate !important;
}

#orthoserve-chatbot.ms-is-open #orthoserve-chat-preview {
  display: none !important;
}

#orthoserve-chat-preview.os-chat-preview {
  position: absolute !important;
  right: 0 !important;
  bottom: 76px !important;
  width: 340px !important;
  max-width: calc(100vw - 34px) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(10px) scale(.98) !important;
  pointer-events: none !important;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease !important;
  z-index: 2147483600 !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

#orthoserve-chat-preview .os-preview-agent {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 0 9px 2px !important;
  padding: 4px 12px 4px 4px !important;
  background: #1f1f1f !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.20) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

#orthoserve-chat-preview .os-preview-avatar {
  width: 28px !important;
  height: 28px !important;
  display: grid !important;
  place-items: center !important;
  background: #fff !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.20) !important;
}

#orthoserve-chat-preview .os-preview-avatar img {
  width: 22px !important;
  height: 22px !important;
  object-fit: contain !important;
  padding: 2px !important;
  margin: 0 !important;
  max-width: 22px !important;
  max-height: 22px !important;
}

#orthoserve-chat-preview .os-preview-message {
  position: relative !important;
  display: block !important;
  margin: 0 !important;
  padding: 17px 21px !important;
  min-height: 66px !important;
  background: #2b2b2b !important;
  color: #ffffff !important;
  border: 4px solid #171717 !important;
  border-radius: 26px !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.22) !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
}

#orthoserve-chat-preview .os-preview-message:after {
  content: "" !important;
  position: absolute !important;
  right: 24px !important;
  bottom: -10px !important;
  width: 18px !important;
  height: 18px !important;
  background: #2b2b2b !important;
  border-right: 4px solid #171717 !important;
  border-bottom: 4px solid #171717 !important;
  transform: rotate(45deg) !important;
  border-radius: 4px !important;
}

#orthoserve-chat-preview .os-preview-typing {
  position: absolute !important;
  left: 22px !important;
  top: 22px !important;
  display: inline-flex !important;
  gap: 5px !important;
  align-items: center !important;
  opacity: 0 !important;
}

#orthoserve-chat-preview .os-preview-typing i {
  width: 7px !important;
  height: 7px !important;
  display: block !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.78) !important;
  animation: osPreviewDot 1s infinite ease-in-out !important;
}

#orthoserve-chat-preview .os-preview-typing i:nth-child(2) { animation-delay: .15s !important; }
#orthoserve-chat-preview .os-preview-typing i:nth-child(3) { animation-delay: .30s !important; }

#orthoserve-chat-preview .os-preview-copy {
  display: block !important;
  opacity: 1 !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview .os-preview-typing,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview .os-preview-typing {
  animation: osTypingFlash 2.4s ease both !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview .os-preview-copy,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview .os-preview-copy {
  animation: osMessageReveal 2.4s ease both !important;
}

@keyframes osPreviewDot {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@keyframes osTypingFlash {
  0%, 44% { opacity: 1; }
  55%, 100% { opacity: 0; }
}

@keyframes osMessageReveal {
  0%, 48% { opacity: 0; transform: translateY(3px); }
  60%, 100% { opacity: 1; transform: translateY(0); }
}

/* clean circular launcher option inspired by reference */
#orthoserve-chat-toggle {
  overflow: visible !important;
}

#orthoserve-chat-toggle:before {
  content: "" !important;
  position: absolute !important;
  inset: -10px !important;
  border-radius: 999px !important;
  background: radial-gradient(circle, rgba(0,103,177,.16), rgba(0,103,177,0) 68%) !important;
  opacity: .9 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

@media (min-width: 521px) {
  #orthoserve-chat-toggle {
    position: relative !important;
  }
}

@media (max-width: 520px) {
  #orthoserve-chat-preview {
    display: none !important;
  }
}


/* v1.4 — theme-matched circular launcher and darker neutral color system */
#orthoserve-chat-toggle {
  position: relative !important;
  width: 72px !important;
  height: 72px !important;
  min-height: 72px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  justify-content: center !important;
  gap: 0 !important;
  background: #f4f6f8 !important;
  border: 1px solid #d7e0e8 !important;
  box-shadow: 0 14px 32px rgba(15,23,42,.14) !important;
  color: #111827 !important;
}
#orthoserve-chat-toggle span {
  display: none !important;
}
#orthoserve-chat-toggle::before,
#orthoserve-chat-toggle::after {
  display: none !important;
}
#orthoserve-chat-toggle:hover {
  background: #eef2f6 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 18px 36px rgba(15,23,42,.18) !important;
}
#orthoserve-chat-toggle img {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.ms-chat-header {
  background: linear-gradient(135deg, #111827, #213247 76%) !important;
}
#orthoserve-chat-send,
.ms-lead-card button {
  background: #143b63 !important;
}
#orthoserve-chat-input:focus {
  border-color: #143b63 !important;
  box-shadow: 0 0 0 4px rgba(20,59,99,.10) !important;
}
.ms-quick-actions button {
  color: #143b63 !important;
  border-color: rgba(20,59,99,.18) !important;
}
.ms-quick-actions button:hover {
  background: #f4f8fb !important;
  border-color: #143b63 !important;
}
#orthoserve-chat-preview .os-preview-avatar img {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
}
#orthoserve-chat-preview .os-preview-agent {
  background: #1f2937 !important;
}
#orthoserve-chat-preview .os-preview-message,
#orthoserve-chat-preview .os-preview-message:after {
  background: #1f2937 !important;
}
#orthoserve-chat-preview .os-preview-message {
  border-color: #111827 !important;
}
#orthoserve-chat-preview .os-preview-message:after {
  border-right-color: #111827 !important;
  border-bottom-color: #111827 !important;
}
@media (max-width: 520px) {
  #orthoserve-chatbot {
    right: 14px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px) !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
  }
  #orthoserve-chat-toggle {
    width: 68px !important;
    height: 68px !important;
    min-height: 68px !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.14) !important;
  }
  #orthoserve-chat-toggle img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }
}


/* v1.5 — OrthoServe site-theme header colors */
.ms-chat-header {
  background: linear-gradient(135deg, #031a31 0%, #082746 58%, #0b325b 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,.05) !important;
}

.ms-chat-logo-wrap {
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 8px 22px rgba(0,0,0,.16) !important;
}

#orthoserve-chat-close {
  background: rgba(255,255,255,.14) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important;
}

#orthoserve-chat-close:hover {
  background: rgba(255,255,255,.22) !important;
}


/* v1.6 — mobile: show only the 2 most important quick-action buttons */
@media (max-width: 520px) {
  .ms-quick-actions button:nth-child(n+3) {
    display: none !important;
  }

  .ms-quick-actions {
    grid-template-columns: 1fr 1fr !important;
    margin: 10px 0 18px 38px !important;
  }
}


/* v1.7 — lock the top header to the OrthoServe dark navy theme */
#orthoserve-chatbot .ms-chat-header,
#orthoserve-chat-window .ms-chat-header,
body #orthoserve-chatbot #orthoserve-chat-window .ms-chat-header {
  background: #061d33 !important;
  background-image: linear-gradient(135deg, #061d33 0%, #08243d 55%, #0b2f4f 100%) !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
}

#orthoserve-chatbot .ms-chat-header h3,
#orthoserve-chatbot .ms-chat-header p {
  color: #ffffff !important;
}

#orthoserve-chatbot .ms-status-dot {
  background: #20d889 !important;
}

#orthoserve-chatbot #orthoserve-chat-close {
  background: rgba(255,255,255,.14) !important;
  color: #ffffff !important;
}

#orthoserve-chatbot #orthoserve-chat-close:hover {
  background: rgba(255,255,255,.22) !important;
}


/* v1.8 — hide the launcher circle whenever the chat window is open */
#orthoserve-chatbot.ms-is-open #orthoserve-chat-toggle {
  display: none !important;
}

#orthoserve-chatbot.ms-is-open #orthoserve-chat-preview {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}


/* v1.9 — remove hover preview/name badge entirely */
#orthoserve-chat-preview,
.os-chat-preview,
.os-preview-agent,
.os-preview-message {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}


/* v2.0 — CPAP-inspired hover typing bubble, without the top name badge */
#orthoserve-chatbot.ms-is-open #orthoserve-chat-preview {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

#orthoserve-chat-preview.os-chat-preview {
  display: block !important;
  position: absolute !important;
  right: 0 !important;
  bottom: 82px !important;
  width: 360px !important;
  max-width: calc(100vw - 34px) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(10px) scale(.98) !important;
  pointer-events: none !important;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease !important;
  z-index: 2147483600 !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

#orthoserve-chat-preview .os-preview-agent {
  display: none !important;
}

#orthoserve-chat-preview .os-preview-message {
  position: relative !important;
  display: block !important;
  margin: 0 !important;
  padding: 18px 22px !important;
  min-height: 70px !important;
  background: rgba(31, 41, 55, .94) !important;
  color: #ffffff !important;
  border: 3px solid rgba(17, 24, 39, .95) !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 40px rgba(0,0,0,.24) !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
}

#orthoserve-chat-preview .os-preview-message:after {
  content: "" !important;
  position: absolute !important;
  right: 28px !important;
  bottom: -10px !important;
  width: 18px !important;
  height: 18px !important;
  background: rgba(31, 41, 55, .94) !important;
  border-right: 3px solid rgba(17, 24, 39, .95) !important;
  border-bottom: 3px solid rgba(17, 24, 39, .95) !important;
  transform: rotate(45deg) !important;
  border-radius: 4px !important;
}

#orthoserve-chat-preview .os-preview-typing {
  position: absolute !important;
  left: 22px !important;
  top: 25px !important;
  display: inline-flex !important;
  gap: 5px !important;
  align-items: center !important;
  opacity: 0 !important;
}

#orthoserve-chat-preview .os-preview-typing i {
  width: 7px !important;
  height: 7px !important;
  display: block !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.78) !important;
  animation: osPreviewDot 1s infinite ease-in-out !important;
}

#orthoserve-chat-preview .os-preview-typing i:nth-child(2) { animation-delay: .15s !important; }
#orthoserve-chat-preview .os-preview-typing i:nth-child(3) { animation-delay: .30s !important; }

#orthoserve-chat-preview .os-preview-copy {
  display: block !important;
  opacity: 1 !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview .os-preview-typing,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview .os-preview-typing {
  animation: osTypingFlash 2.15s ease both !important;
}

#orthoserve-chatbot:hover #orthoserve-chat-preview .os-preview-copy,
#orthoserve-chatbot.os-preview-show #orthoserve-chat-preview .os-preview-copy {
  animation: osMessageReveal 2.15s ease both !important;
}

@media (max-width: 520px) {
  #orthoserve-chat-preview {
    display: none !important;
  }
}


/* v2.1 — force CPAP-style hover typing preview to work after prior no-preview release */
@media (min-width: 521px) {
  #orthoserve-chat-preview.os-chat-preview {
    display: block !important;
    position: absolute !important;
    right: 0 !important;
    bottom: 86px !important;
    width: 360px !important;
    max-width: calc(100vw - 34px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(12px) scale(.98) !important;
    pointer-events: none !important;
    z-index: 2147483600 !important;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease !important;
  }

  #orthoserve-chatbot:not(.ms-is-open):hover #orthoserve-chat-preview,
  #orthoserve-chatbot:not(.ms-is-open).os-preview-show #orthoserve-chat-preview {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
  }

  #orthoserve-chat-preview .os-preview-agent {
    display: none !important;
  }

  #orthoserve-chat-preview .os-preview-message {
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    padding: 18px 22px !important;
    min-height: 70px !important;
    background: rgba(31, 41, 55, .96) !important;
    color: #fff !important;
    border: 3px solid rgba(17,24,39,.98) !important;
    border-radius: 26px !important;
    box-shadow: 0 18px 40px rgba(0,0,0,.24) !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
  }

  #orthoserve-chat-preview .os-preview-message:after {
    content: "" !important;
    position: absolute !important;
    right: 28px !important;
    bottom: -10px !important;
    width: 18px !important;
    height: 18px !important;
    background: rgba(31, 41, 55, .96) !important;
    border-right: 3px solid rgba(17,24,39,.98) !important;
    border-bottom: 3px solid rgba(17,24,39,.98) !important;
    transform: rotate(45deg) !important;
    border-radius: 4px !important;
  }

  #orthoserve-chat-preview .os-preview-typing {
    position: absolute !important;
    left: 22px !important;
    top: 25px !important;
    display: inline-flex !important;
    gap: 5px !important;
    align-items: center !important;
    opacity: 0 !important;
  }

  #orthoserve-chat-preview .os-preview-typing i {
    width: 7px !important;
    height: 7px !important;
    display: block !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.82) !important;
    animation: osPreviewDot 1s infinite ease-in-out !important;
  }

  #orthoserve-chat-preview .os-preview-typing i:nth-child(2) { animation-delay: .15s !important; }
  #orthoserve-chat-preview .os-preview-typing i:nth-child(3) { animation-delay: .30s !important; }

  #orthoserve-chat-preview .os-preview-copy {
    display: block !important;
    opacity: 0 !important;
  }

  #orthoserve-chatbot:not(.ms-is-open).os-preview-show #orthoserve-chat-preview .os-preview-typing,
  #orthoserve-chatbot:not(.ms-is-open):hover #orthoserve-chat-preview .os-preview-typing {
    animation: osTypingFlash 2.15s ease both !important;
  }

  #orthoserve-chatbot:not(.ms-is-open).os-preview-show #orthoserve-chat-preview .os-preview-copy,
  #orthoserve-chatbot:not(.ms-is-open):hover #orthoserve-chat-preview .os-preview-copy {
    animation: osMessageReveal 2.15s ease both !important;
  }
}

@media (max-width: 520px) {
  #orthoserve-chat-preview { display: none !important; }
}


/* v2.2 — enforce only 2 quick-action bubbles on mobile */
@media (max-width: 520px) {
  #orthoserve-chat-window .ms-quick-actions button:nth-child(n+3),
  #orthoserve-chatbot #orthoserve-chat-window .ms-quick-actions button:nth-child(n+3) {
    display: none !important;
  }

  #orthoserve-chat-window .ms-quick-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 24px !important;
  }
}


/* v2.4 — clickable links inside bot answers */
.ms-bot-message a {
  color: #0A4E8A !important;
  font-weight: 750 !important;
  text-decoration: underline !important;
  word-break: break-word !important;
}
.ms-bot-message a:hover {
  color: #061D33 !important;
}
