/* MGHS chat widget — one accent colour is the whole per-tenant theme.
   Deliberately scoped under .mghs-cb so it cannot leak into a client's theme, and deliberately
   plain so it inherits the site's own font rather than importing one. */

.mghs-cb {
  --mghs-accent: #1A2332;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

/* ---- launcher ---- */
.mghs-cb-launch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mghs-accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
  transition: transform .15s ease;
}
.mghs-cb-launch:hover { transform: translateY(-2px); }
.mghs-cb-launch:focus-visible { outline: 3px solid var(--mghs-accent); outline-offset: 3px; }

/* ---- panel ---- */
.mghs-cb-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.mghs-cb-panel[hidden] { display: none; }

.mghs-cb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--mghs-accent);
  color: #fff;
}
.mghs-cb-x {
  background: none;
  border: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

/* ---- messages ---- */
.mghs-cb-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f7f7f8;
}
.mghs-cb-msg { display: flex; margin-bottom: 10px; }
.mghs-cb-you { justify-content: flex-end; }
.mghs-cb-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  background: #fff;
  color: #222;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .10);
  white-space: pre-wrap;      /* the model uses blank lines; honour them */
  overflow-wrap: anywhere;    /* a pasted URL must never widen the panel */
}
.mghs-cb-you .mghs-cb-bubble { background: var(--mghs-accent); color: #fff; }
.mghs-cb-typing .mghs-cb-bubble { color: #999; letter-spacing: 3px; }

/* ---- composer ---- */
.mghs-cb-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e6e6e8;
  background: #fff;
}
.mghs-cb-input {
  flex: 1;
  border: 1px solid #d7d7db;
  border-radius: 9px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;   /* 16px or iOS zooms the whole page on focus */
  min-width: 0;
}
.mghs-cb-input:focus { outline: none; border-color: var(--mghs-accent); }
.mghs-cb-send {
  background: var(--mghs-accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;   /* a real touch target */
}

/* ---- phones: full-height sheet, and keep clear of the sticky call bars
       most of these sites run along the bottom ---- */
@media (max-width: 480px) {
  .mghs-cb { right: 12px; bottom: 76px; }
  .mghs-cb-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 160px);
    bottom: 60px;
  }
  .mghs-cb-launch-t { display: none; }
  .mghs-cb-launch { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .mghs-cb-launch { transition: none; }
  .mghs-cb-launch:hover { transform: none; }
}
