/* Munawar Surgical Hospital — website assistant (uses the site's own colours and fonts) */
.mshc-launch, .mshc-panel, .mshc-teaser { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }

/* launcher */
.mshc-launch {
  position: fixed; z-index: 60;
  right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #1B2C6B 0%, #2A55E0 100%);
  box-shadow: 0 16px 32px -14px rgba(14, 26, 69, .7), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.mshc-launch:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -14px rgba(14, 26, 69, .78), inset 0 1px 0 rgba(255, 255, 255, .22); }
.mshc-launch:focus-visible { outline: 3px solid rgba(42, 85, 224, .45); outline-offset: 3px; }
.mshc-launch svg { width: 27px; height: 27px; }
.mshc-launch .mshc-i-close { display: none; }
html.mshc-open .mshc-launch .mshc-i-chat { display: none; }
html.mshc-open .mshc-launch .mshc-i-close { display: block; }

/* window */
.mshc-panel {
  position: fixed; z-index: 60;
  right: max(20px, env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 70px);
  width: min(380px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 120px)); height: min(620px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden; margin: 0; padding: 0;
  background: #F5F8FE; border: 1px solid #CBD6EC; border-radius: 18px;
  box-shadow: 0 34px 80px -34px rgba(14, 26, 69, .6);
  transform-origin: 100% 100%;
}
.mshc-panel[hidden] { display: none; }

.mshc-head { display: flex; align-items: center; gap: 12px; padding: 13px 12px 13px 16px; color: #fff; background: linear-gradient(135deg, #0E1A45 0%, #1B2C6B 55%, #2A55E0 100%); }
.mshc-head img { width: 38px; height: 38px; flex: none; border-radius: 50%; background: #fff; padding: 3px; }
.mshc-title { margin: 0; font-family: 'Fraunces', Georgia, serif; font-size: 17px; font-weight: 600; line-height: 1.2; color: #fff; }
.mshc-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 1.3; color: #C3CFF0; }
.mshc-x { margin-left: auto; width: 38px; height: 38px; flex: none; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.mshc-x svg { width: 22px; height: 22px; }
.mshc-x:hover { background: rgba(255, 255, 255, .12); }
.mshc-x:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* conversation */
.mshc-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.mshc-msg { display: flex; }
.mshc-bubble { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.mshc-bot .mshc-bubble { background: #fff; color: #111A38; border: 1px solid #DCE4F4; border-bottom-left-radius: 4px; }
.mshc-user { justify-content: flex-end; }
.mshc-user .mshc-bubble { background: #2A55E0; color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.mshc-bubble p { margin: 0; }
.mshc-bubble p + p, .mshc-bubble ul + p, .mshc-bubble p + ul { margin-top: 7px; }
.mshc-bubble ul { margin: 0; padding-left: 18px; }
.mshc-bubble li { margin: 3px 0; }
.mshc-bubble a { color: #2A55E0; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mshc-bubble strong { font-weight: 600; color: #0E1A45; }
.mshc-muted { color: #5C6684; font-size: 13.5px; }
.mshc-nw { white-space: nowrap; }
.mshc-ur { display: inline-block; font-size: 16px; line-height: 1.9; color: #5C6684; }

.mshc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; }
.mshc-chip {
  font: 600 13.5px/1.2 'Inter', system-ui, sans-serif; color: #1B2C6B; background: #fff;
  border: 1px solid #B9C8EA; border-radius: 999px; padding: 8px 13px; cursor: pointer; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.mshc-chip:hover { border-color: #2A55E0; background: #EEF3FF; }
.mshc-chip:focus-visible { outline: 2px solid #2A55E0; outline-offset: 2px; }
.mshc-chip.mshc-primary { background: #1B2C6B; border-color: #1B2C6B; color: #fff; }
.mshc-chip.mshc-primary:hover { background: #2A55E0; border-color: #2A55E0; }

.mshc-typing .mshc-bubble { display: flex; align-items: center; gap: 4px; padding: 14px; }
.mshc-typing i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #8A96B8; }

/* composer */
.mshc-form { display: flex; gap: 8px; padding: 10px 12px 6px; background: #fff; border-top: 1px solid #DCE4F4; margin: 0; }
.mshc-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 13px; border: 1px solid #CBD6EC; border-radius: 12px;
  font: 16px/1.2 'Inter', system-ui, sans-serif; color: #111A38; background: #F7F9FE;
}
.mshc-input::placeholder { color: #7A849F; }
.mshc-input:focus { outline: none; border-color: #2A55E0; background: #fff; box-shadow: 0 0 0 3px rgba(42, 85, 224, .18); }
.mshc-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: #2A55E0; color: #fff; cursor: pointer; display: grid; place-items: center; }
.mshc-send svg { width: 20px; height: 20px; }
.mshc-send:disabled { background: #B9C8EA; cursor: default; }
.mshc-send:focus-visible { outline: 3px solid rgba(42, 85, 224, .4); outline-offset: 2px; }
.mshc-note { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 11.5px; line-height: 1.4; color: #5C6684; }
.mshc-note a { color: #5C6684; }
.mshc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* one-time invitation next to the launcher */
.mshc-teaser {
  position: fixed; z-index: 60;
  right: calc(max(20px, env(safe-area-inset-right)) + 70px); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 7px);
  max-width: 240px; padding: 10px 34px 10px 14px; border: 1px solid #CBD6EC; border-radius: 14px;
  background: #fff; color: #111A38; font-size: 14px; line-height: 1.4;
  box-shadow: 0 18px 40px -22px rgba(14, 26, 69, .55);
}
.mshc-teaser span { cursor: pointer; }
.mshc-teaser button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #5C6684; font-size: 18px; line-height: 1; cursor: pointer; }
.mshc-teaser button:hover { background: #EEF2FA; }

/* motion that answers the visitor's action only */
@media (prefers-reduced-motion: no-preference) {
  .mshc-panel.mshc-in { animation: mshcIn .22s cubic-bezier(.2, .8, .2, 1); }
  .mshc-teaser { animation: mshcIn .3s ease; }
  .mshc-typing i { animation: mshcDot 1s infinite ease-in-out; }
  .mshc-typing i:nth-child(2) { animation-delay: .15s; }
  .mshc-typing i:nth-child(3) { animation-delay: .3s; }
}
@keyframes mshcIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes mshcDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* phones: the chat takes the whole screen */
@media (max-width: 560px) {
  .mshc-launch { width: 54px; height: 54px; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .mshc-panel { inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
  html.mshc-open .mshc-launch { display: none; }
  html.mshc-lock, html.mshc-lock body { overflow: hidden; }
  .mshc-note { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .mshc-teaser { right: 82px; bottom: 20px; max-width: 200px; }
}
@media print { .mshc-launch, .mshc-panel, .mshc-teaser { display: none !important; } }
