.help-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: var(--sans);
}

.help-bubble-toggle {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(79, 63, 100, .16);
  border-radius: 50%;
  background: var(--lavender);
  color: #4f3f64;
  box-shadow: 0 12px 30px rgba(65, 48, 84, .22);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.help-bubble-toggle:hover {
  background: #d3c3e9;
  box-shadow: 0 15px 34px rgba(65, 48, 84, .27);
  transform: translateY(-2px);
}

.help-bubble-toggle svg { width: 25px; height: 25px; }
.help-bubble-x-icon { display: none; }
.help-bubble.is-open .help-bubble-chat-icon { display: none; }
.help-bubble.is-open .help-bubble-x-icon { display: block; }

.help-bubble-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(340px, calc(100vw - 28px));
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  border: 1px solid rgba(79, 63, 100, .14);
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(220, 208, 239, .72), transparent 44%),
    var(--white);
  box-shadow: 0 22px 60px rgba(42, 34, 27, .18);
}

.help-bubble-panel[hidden] { display: none; }

.help-bubble-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.help-bubble-kicker {
  margin: 0 0 7px;
  color: var(--lavender-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.help-bubble-heading h2 {
  max-width: 245px;
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.08;
}

.help-bubble-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 253, 249, .7);
  cursor: pointer;
}

.help-bubble-close svg { width: 15px; height: 15px; }

.help-bubble-links {
  display: grid;
  gap: 8px;
  margin-top: 19px;
}

.help-bubble-links a {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 253, 249, .82);
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.help-bubble-links a:hover {
  border-color: rgba(140, 117, 172, .5);
  background: var(--paper);
  transform: translateX(2px);
}

.help-bubble-links .help-bubble-guide {
  border-color: transparent;
  background: var(--lavender);
  color: #4f3f64;
}

.help-bubble-guide > span > span { margin-right: 5px; color: var(--lavender-deep); }
.help-bubble-guide strong { font-size: 13px; }

.help-bubble-note {
  margin: 16px 2px 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

/* Leave the lower-right corner to help while preserving the existing utility. */
.back-to-top { right: 92px; }
.toast { right: 94px; }

@media (max-width: 760px) {
  .help-bubble {
    right: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .help-bubble-toggle { width: 54px; height: 54px; }
  .help-bubble-panel {
    max-height: calc(100dvh - 170px);
    border-radius: 19px;
    padding: 19px;
  }

  .help-bubble-heading h2 { font-size: 23px; }
  .back-to-top { right: 78px; bottom: 80px; }
  .toast { right: 14px; bottom: 144px; }
}

@media (prefers-reduced-motion: reduce) {
  .help-bubble-toggle,
  .help-bubble-links a { transition: none; }
}
