/* vajraos.com: the help bubble on every page, sharing a help article, and the FAQ's copy link
   (design: docs/design/site/share-and-bubble.html). Uses each page's own colour tokens. */

/* Share this guide (option B) */
.share-row {
  margin: 34px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.share-menu {
  position: relative;
  display: inline-block;
}
.share-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
}
.share-menu > summary::-webkit-details-marker {
  display: none;
}
.share-menu > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.share-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  padding: 6px;
}
.share-pop a,
.share-pop button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.share-pop a:hover,
.share-pop button:hover,
.share-pop a:focus-visible,
.share-pop button:focus-visible {
  background: var(--bg);
  outline: none;
}
.share-pop svg {
  flex: none;
  color: var(--muted);
}
.share-pop hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 4px;
}
.share-pop .done {
  color: var(--accent-ink, var(--ink));
  font-weight: 600;
}

/* The FAQ's copy link */
.copy-lnk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.copy-lnk svg {
  width: 14px;
  height: 14px;
}
.copy-lnk:hover {
  color: var(--ink);
  text-decoration: underline;
}
.copy-lnk.done {
  color: var(--accent-ink, var(--ink));
  font-weight: 600;
  text-decoration: none;
}

/* The help bubble */
.hb {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 45;
  font-size: 15px;
}
.hb-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.hb-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.hb-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent, #0a0b0d);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}
.hb-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.hb-panel[hidden] {
  display: none;
}
.hb-top {
  background: #0a0b0d;
  color: #f2f3f5;
  padding: 16px 16px 26px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hb-top b {
  display: block;
  font-size: 17px;
}
.hb-top span {
  font-size: 13px;
  color: #c9cdd4;
}
.hb-x {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f3f5;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hb-find {
  margin: -16px 12px 0;
  position: relative;
}
.hb-find input {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 0 12px 0 40px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.hb-find input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.hb-find svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.hb-body {
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.hb-h {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 6px 6px 6px;
}
.hb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hb-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.hb-list a:hover,
.hb-list a:focus-visible {
  background: var(--bg);
  outline: none;
}
.hb-list a small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 12.5px;
  margin-top: 1px;
}
.hb-list a::after {
  content: "›";
  color: var(--muted);
}
.hb-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 6px 8px;
}
.hb-cta {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
}
.hb-cta a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--ink);
}
.hb-cta a.acc {
  background: var(--accent);
  color: var(--on-accent, #0a0b0d);
  border-color: transparent;
}
@media (max-width: 560px) {
  .hb-fab {
    padding: 0 14px 0 10px;
  }
}
@media print {
  .hb {
    display: none;
  }
}

/* A phone: the help panel takes the whole screen, and the page behind doesn't scroll (owner, 16 Nov). */
@media (max-width: 560px) {
  .hb-panel {
    position: fixed;
    inset: 0;
    width: auto;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 60;
  }
  .hb-top {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(56px, env(safe-area-inset-right));
  }
  .hb-x {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }
  .hb-body {
    flex: 1;
  }
  .hb-cta {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .hb[data-open] .hb-fab {
    display: none;
  }
  html.hb-lock,
  html.hb-lock body {
    overflow: hidden;
  }
}

/* A button that leads to another page shows it's on its way (owner, 16 Nov 2026): the app can take a
   moment to answer. Set by help.js; cleared when the page comes back (the Back button). */
.is-busy {
  pointer-events: none;
  position: relative;
}
.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  flex: none;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: hb-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}
@keyframes hb-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-busy::after {
    animation-duration: 2s;
  }
}
