.gideon-room-help {
  --help-end: max(12px, env(safe-area-inset-right));
  --help-start: max(12px, env(safe-area-inset-left));
  --help-bottom: max(12px, env(safe-area-inset-bottom));
  --help-top: max(12px, env(safe-area-inset-top));
  position: fixed;
  z-index: 29;
  inset-inline-end: var(--help-end);
  inset-block-end: var(--help-bottom);
  color: #f9f6ff;
}

html.client-locked .gideon-room-help {
  z-index: 1210;
}

.gideon-room-help[hidden],
.gideon-help-panel[hidden],
.tour-running .gideon-room-help,
html[data-presentation] .gideon-room-help:not(:has(.gideon-help-launcher[aria-expanded="true"])),
html:has(dialog[open]) .gideon-room-help {
  display: none;
}

html[data-presentation] .gideon-help-launcher {
  display: none;
}

html[data-presentation] .gideon-help-panel {
  inset-block-end: 0;
}

.gideon-help-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  min-height: 46px;
  padding-block: 5px;
  padding-inline: var(--help-start-padding, 5px) 12px;
  border: 1px solid #7cdcce;
  border-radius: 999px;
  background: #161222;
  color: inherit;
  font: inherit;
  font-weight: 750;
  box-shadow: 0 5px 18px #09061199;
  cursor: pointer;
}

.gideon-help-launcher[aria-expanded="false"]:is(:hover, :focus-visible)::after {
  content: "Meet Gideon";
  display: var(--help-portrait-display, block);
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: calc(100% + 8px);
  padding: 6px 10px;
  border: 1px solid #7cdcce;
  border-radius: 8px;
  background: #161222;
  font-size: .8rem;
  white-space: nowrap;
  pointer-events: none;
}

.gideon-help-avatar {
  --tour-guide-size: 34px;
  display: var(--help-portrait-display, block);
}

:is(html:not(.client-locked) .gideon-room-help[data-room-portrait-visible],
    html.client-locked .gideon-room-help[data-sign-in-cameo-visible],
    html:has([data-gideon-loading-splash]) .gideon-room-help) {
  --help-start-padding: 12px;
  --help-portrait-display: none;
}

:is(html.client-locked, html:has(#tourWelcome[open], #tourReportDialog[open], [data-gideon-loading-splash]), .tour-running)
    .brand-hero .gideon-character-name,
:is(.tour-running, html:has([data-gideon-loading-splash])) .decision-output-portrait,
html:has(#tourReportDialog[open], [data-gideon-loading-splash]) #pageTourLayer .gideon-tour-guide {
  visibility: hidden;
}

.gideon-help-panel {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: 56px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(360px, calc(100vw - var(--help-start) - var(--help-end)));
  max-height: min(510px, calc(100dvh - var(--help-top) - var(--help-bottom) - 56px));
  border: 1px solid #433858;
  border-radius: 16px;
  background: #161222;
  color: #f9f6ff;
  box-shadow: 0 14px 40px #06040bbb;
  overflow: hidden;
}

.gideon-help-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 8px 10px 8px 15px;
  border-bottom: 1px solid #433858;
}

.gideon-help-heading h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: normal;
}

.gideon-help-close {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.gideon-help-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 10px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.gideon-help-intro,
.gideon-help-history p {
  margin: 0;
  line-height: 1.48;
}

.gideon-help-intro {
  color: #e4dae9;
  font-size: 0.92rem;
}

.gideon-help-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gideon-help-prompts button {
  min-height: 44px;
  padding: 4px 9px;
  border: 1px solid #534266;
  border-radius: 10px;
  background: #21192d;
  color: #f8eefb;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.gideon-help-prompts .gideon-help-tour {
  border-color: #7cdcce;
  color: #a9f3e8;
  font-weight: 750;
}

.gideon-help-history {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.89rem;
}

.gideon-help-history > li {
  padding: 9px 11px;
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.gideon-help-user {
  justify-self: end;
  max-width: 90%;
  background: #342441;
}

.gideon-help-answer {
  justify-self: stretch;
  background: #212134;
}

.gideon-help-jump {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94e7da;
  font: inherit;
  font-weight: 720;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.gideon-help-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 12px 12px;
  margin: 0;
  border-top: 1px solid #433858;
}

.gideon-help-label {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.gideon-help-form input,
.gideon-help-form button {
  min-height: 44px;
  border-radius: 9px;
  font: inherit;
}

.gideon-help-form input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #60506d;
  background: #21192d;
  color: inherit;
  font-size: 16px;
}

.gideon-help-form input::placeholder {
  color: #c7bacf;
}

.gideon-help-form button {
  padding: 6px 13px;
  border: 1px solid #94e7da;
  background: #94e7da;
  color: #102320;
  font-weight: 750;
  cursor: pointer;
}

.gideon-room-help :focus-visible {
  outline: 2px solid #94e7da;
  outline-offset: 2px;
}

@media (orientation: landscape) and (max-height: 340px) {
  .gideon-help-launcher[aria-expanded="true"] {
    visibility: hidden;
  }

  .gideon-help-panel {
    inset-block-end: 0;
    max-height: calc(100dvh - var(--help-top) - var(--help-bottom));
  }

  .gideon-help-heading { padding: 3px 8px 3px 12px; }
  .gideon-help-content { padding-block: 6px; }
  .gideon-help-form { padding: 4px 8px 6px; }
}
