.mgi-help-launch,
.mgi-help-panel {
  /* Leave room for the hosting badge at the bottom of the screen. */
  --mgi-help-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  position: fixed;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  z-index: 60;
  color: #172e45;
  font: 16px/1.45 system-ui, sans-serif;
}

.mgi-help-launch {
  bottom: var(--mgi-help-bottom);
  border: 1px solid #8b6d43;
  border-radius: 2rem;
  padding: .7rem 1rem;
  background: #f0d49e;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px #162c4840;
}

.mgi-help-panel {
  bottom: calc(var(--mgi-help-bottom) + 3.6rem);
  width: min(23rem, calc(100% - 2rem));
  max-height: calc(100dvh - var(--mgi-help-bottom) - 4.6rem);
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #c5a570;
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 8px 28px #162c4840;
}

.mgi-help-panel[hidden] { display: none; }
.mgi-help-header,
.mgi-help-topics,
.mgi-help-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.mgi-help-header { justify-content: space-between; align-items: center; }
.mgi-help-panel h2 { margin: 0; font: 700 1.2rem/1.4 system-ui, sans-serif; }
.mgi-help-panel form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; margin: 0 0 .7rem; }
.mgi-help-panel label { grid-column: 1 / -1; }
.mgi-help-panel input { width: 100%; min-width: 0; box-sizing: border-box; padding: .55rem; border: 1px solid #718092; border-radius: .45rem; font: inherit; }
.mgi-help-panel button { width: auto; border: 1px solid #a4b1bd; border-radius: .5rem; padding: .45rem .6rem; color: #172e45; background: #f3f6f9; font: inherit; cursor: pointer; }
.mgi-help-panel button[type="submit"] { background: #f0d49e; }
.mgi-help-panel :focus-visible,
.mgi-help-launch:focus-visible { outline: 2px solid #285782; outline-offset: 2px; }
.mgi-help-answer:empty { display: none; }
.mgi-help-links { margin-top: .8rem; }
.mgi-help-links a { color: #224f75; text-decoration: underline; }
