/* Keep theme typography from stretching the chat controls. */
#max-chat-widget.mhc-open #max-chat-toggle { display: none; }
#max-chat-widget #max-chat-panel {
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  line-height: 1.4;
}
#max-chat-widget #max-chat-messages {
  min-height: 0;
  padding: 18px 16px;
  gap: 12px;
  overscroll-behavior: contain;
}
#max-chat-widget .max-chat-bubble {
  flex-shrink: 0;
  max-width: 88%;
  font-size: 14px;
  line-height: 1.5;
}
#max-chat-widget #mhc-chat-status {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #eee8da;
  font-size: 12px;
  line-height: 1.45;
  color: #5b626d;
  background: #fff;
}
#max-chat-widget #mhc-chat-status a {
  color: #0056bb;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  white-space: nowrap;
}
#max-chat-widget #max-chat-form {
  align-items: center;
  border-top: 0;
  padding: 4px 12px 8px;
  gap: 8px;
}
#max-chat-widget #max-chat-input {
  min-width: 0;
  height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 22px;
}
#max-chat-widget #max-chat-send {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 16px;
  line-height: 1;
}
#max-chat-widget #mhc-chat-handoff {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding: 8px 14px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #0056bb;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  text-transform: none;
  cursor: pointer;
}
#max-chat-widget #mhc-chat-handoff[hidden] { display: none; }
#max-chat-widget #mhc-chat-handoff:hover { background: #eef5ff; }
#max-chat-widget #mhc-chat-handoff:focus-visible { outline: 2px solid #0056bb; outline-offset: -2px; }
#max-chat-widget #max-chat-footer-note {
  flex: 0 0 auto;
  padding: 4px 12px 10px;
  font-size: 10px;
  line-height: 14px;
}
@media (max-width: 480px) {
  #max-chat-widget {
    left: 12px;
    right: 12px;
    top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh) - env(keyboard-inset-height, 0px) - 12px);
    bottom: auto;
    transform: translateY(-100%);
  }
  #max-chat-widget #max-chat-toggle { align-self: flex-end; }
  #max-chat-widget #max-chat-panel {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    height: 620px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    max-height: calc(var(--visual-viewport-height, 100dvh) - env(keyboard-inset-height, 0px) - 32px);
  }
}
