.gideon-site-help {
  --help-inset: max(12px, env(safe-area-inset-right));
  --help-bottom: max(12px, env(safe-area-inset-bottom));
  --help-line: #455b57;
  --help-accent: #bff4eb;
  position: fixed;
  z-index: 40;
  right: var(--help-inset);
  bottom: var(--help-bottom);
  color: #f4f4f5;
  font: 0.875rem/1.45 Aptos, "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
}

.gideon-site-help button { cursor: pointer; }
.gideon-site-help :is(button, input, a):focus-visible {
  outline: 2px solid var(--help-accent);
  outline-offset: 2px;
}

html:has(dialog[open], .vip-overlay) .gideon-site-help,
.site-help-panel[hidden] {
  display: none;
}

.site-help-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  margin-inline-start: auto;
  padding: 5px 12px 5px 5px;
  border: 1px solid #659388;
  border-radius: 999px;
  background: linear-gradient(135deg, #243831, #282132);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px #09090b66;
}

.site-help-launcher img {
  display: block;
  border-radius: 50%;
  background: #dcebe5;
}

.site-help-launcher[aria-expanded="false"]:is(:hover, :focus-visible)::after {
  content: "Meet Gideon";
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  border: 1px solid var(--help-line);
  border-radius: 9px;
  padding: 5px 9px;
  background: #18181b;
  white-space: nowrap;
  pointer-events: none;
}

.site-help-panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(22.5rem, calc(100vw - var(--help-inset) - max(12px, env(safe-area-inset-left))));
  max-height: min(30rem, calc(100dvh - var(--help-bottom) - max(12px, env(safe-area-inset-top)) - 56px));
  overflow: hidden;
  border: 1px solid var(--help-line);
  border-radius: 16px;
  background: #18181b;
  box-shadow: 0 14px 38px #09090b99;
}

.site-help-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 14px;
  border-bottom: 1px solid #3f3f46;
}

.site-help-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 700;
}

.site-help-close {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 1.5rem;
}

.site-help-close:hover { background: #27272a; }

.site-help-content {
  min-height: 0;
  padding: 0.75rem 0.875rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.site-help-content p { margin: 0; }

.site-help-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.625rem;
}

.site-help-prompts button,
.site-help-form button {
  min-height: 44px;
  padding: 5px 9px;
  border: 1px solid var(--help-line);
  border-radius: 9px;
  background: #202a28;
  color: var(--help-accent);
  font-weight: 600;
}

.site-help-prompts button:hover,
.site-help-form button:hover { background: #2b3a36; }

.site-help-history {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0.75rem 0 0;
  list-style: none;
}

.site-help-history:empty { display: none; }

.site-help-history li {
  padding: 0.625rem;
  border-radius: 9px;
  background: #27272a;
  overflow-wrap: anywhere;
}

.site-help-history .site-help-question {
  margin-bottom: 0.25rem;
  color: #f0abfc;
  font-weight: 700;
}

.site-help-history :is(a, button[data-start-site-tour]) {
  display: inline-block;
  margin-top: 0.375rem;
  color: var(--help-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-help-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0.625rem 0.875rem;
  border-top: 1px solid #3f3f46;
}

.site-help-form input {
  min-width: 0;
  padding: 0.625rem;
  border: 1px solid #71717a;
  border-radius: 9px;
  background: #09090b;
  color: inherit;
  font-size: 1rem;
}
