.mcm-chat [hidden], .mcm-chat[hidden] { display: none; }
.mcm-chat, .mcm-chat *, .mcm-chat-dock { box-sizing: border-box; }
.mcm-chat-dock {
  --mcm-chat-target: max(3rem, 44px);
  --mcm-chat-bottom: max(.75rem, env(safe-area-inset-bottom));
  --mcm-chat-right: max(.75rem, env(safe-area-inset-right));
  position: relative;
  height: calc(var(--mcm-chat-target) + var(--mcm-chat-bottom) + .75rem);
}
.mcm-chat-dock:has(.mcm-chat[hidden]) { display: none; }
.mcm-chat {
  position: fixed;
  z-index: 100;
  inset: auto var(--mcm-chat-right) var(--mcm-chat-bottom) auto;
  color: #251939;
  font: 1rem/1.45 system-ui, sans-serif;
}
.mcm-chat-dock[data-docked] .mcm-chat { position: absolute; }
.mcm-chat button, .mcm-chat input { font: inherit; }
.mcm-chat button { cursor: pointer; min-height: 44px; }
.mcm-chat button:focus-visible, .mcm-chat input:focus-visible, .mcm-chat a:focus-visible {
  outline: 2px solid #7654b8;
  outline-offset: 3px;
}
.mcm-chat .mcm-chat-launch {
  display: grid;
  place-items: center;
  width: var(--mcm-chat-target);
  height: var(--mcm-chat-target);
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #6f5598;
  border-radius: 50%;
  background: #cde748;
  box-shadow: 0 3px 12px #24163536;
}
.mcm-chat-launch img { display: block; width: 75%; height: 75%; object-fit: contain; }
.mcm-chat-dock[data-docked] .mcm-chat-panel {
  position: fixed;
  inset: auto var(--mcm-chat-right) calc(var(--mcm-chat-target) + var(--mcm-chat-bottom) + .5rem) auto;
}
.mcm-chat-panel {
  position: absolute;
  inset: auto 0 calc(100% + .5rem) auto;
  width: min(25rem, calc(100vw - 2rem));
  max-height: min(36rem, calc(100vh - 5.5rem));
  max-height: min(36rem, calc(100dvh - 5.5rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ded3eb;
  border-radius: 1rem;
  box-shadow: 0 12px 40px #24163545;
}
.mcm-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .75rem;
  background: #382463;
  color: #fff;
}
.mcm-chat-header h2 { color: inherit; font: 700 1rem/1.35 system-ui, sans-serif; margin: 0; }
.mcm-chat-header button { width: 44px; border: 0; background: transparent; color: #fff; font-size: 1.5rem; }
.mcm-chat-transcript { padding: .85rem; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.mcm-chat p { margin: 0 0 .55rem; color: inherit; font: inherit; overflow-wrap: anywhere; }
.mcm-chat-prompts { display: flex; flex-wrap: wrap; gap: .4rem; }
.mcm-chat-prompts button { padding: .3rem .6rem; border: 1px solid #dcd0eb; border-radius: .55rem; background: #f8f5fc; color: #392463; font-size: .875rem; }
.mcm-chat-log:not(:empty) { margin-top: .75rem; }
.mcm-chat p.mcm-chat-user, .mcm-chat-answer { padding: .65rem .7rem; border-radius: .65rem; }
.mcm-chat p.mcm-chat-user { margin-left: 1.2rem; background: #392463; color: #fff; }
.mcm-chat-answer { margin: 0 1.2rem .65rem 0; background: #f4effa; }
.mcm-chat-answer > div + div { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid #dcd0eb; }
.mcm-chat-answer a { color: #4d327f; text-decoration: underline; font-weight: 650; }
.mcm-chat .mcm-chat-form { padding: .65rem .85rem; border-top: 1px solid #e5dced; margin: 0; display: block; }
.mcm-chat-form label { display: block; margin-bottom: .25rem; font-weight: 650; }
.mcm-chat-form > div { display: flex; gap: .4rem; }
.mcm-chat-form input { flex: 1; min-width: 0; padding: .5rem; border: 1px solid #9785b1; border-radius: .45rem; background: #fff; color: #251939; }
.mcm-chat-form button { padding: .4rem .75rem; border: 0; border-radius: .45rem; background: #392463; color: #fff; font-weight: 700; }
.mcm-chat-form button:disabled { opacity: .6; cursor: wait; }
.mcm-chat .mcm-chat-status { margin: .35rem 0 0; font-size: .8125rem; }
