/* help.css — 28 Oct (Ali): the floating Help button and its support panel, bottom-right on every page
   (the live site's support entry sits there). Desktop keeps the Discord bubble bottom-left; on phones,
   where home-mobile.css puts that bubble bottom-right, Help sits above it. */
.help {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--blue, #2b2bf5);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(43, 43, 245, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.help svg {
  width: 22px;
  height: 22px;
}
.help:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(43, 43, 245, 0.4);
}
.help:focus-visible {
  outline: 2px solid var(--blue, #2b2bf5);
  outline-offset: 3px;
}
.help[aria-expanded='true'] {
  opacity: 0;
  pointer-events: none;
}
.help__panel {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  color: var(--ink, #0c0f2c);
  border: 1px solid var(--line-d, #dcdff5);
  border-radius: 20px;
  padding: 18px 18px 12px;
  box-shadow: 0 30px 80px -30px rgba(7, 10, 60, 0.45), 0 0 0 1px rgba(43, 43, 245, 0.06);
  animation: help-in 0.22s ease-out both;
}
.help__panel[hidden] {
  display: none;
}
@keyframes help-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.help__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.help__k {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue, #2b2bf5);
  margin-bottom: 4px;
}
.help__head b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.help__x {
  flex: none;
  width: 36px;
  height: 36px;
  margin: -6px -8px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2, #55598a);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.help__x:hover {
  background: var(--lav, #eef0ff);
  color: var(--ink, #0c0f2c);
}
.help__p {
  margin: 8px 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2, #55598a);
}
.help__row {
  display: block;
  padding: 10px 12px;
  margin: 0 -6px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink, #0c0f2c);
  min-height: 44px;
}
.help__row b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.help__row span {
  display: block;
  font-size: 13px;
  color: var(--ink-2, #55598a);
  margin-top: 1px;
}
.help__row:hover,
.help__row:focus-visible {
  background: var(--lav, #eef0ff);
  outline: none;
}
.help__row[hidden] {
  display: none;
}
@media (max-width: 768px) {
  /* the Discord bubble is bottom-right on phones (home-mobile.css); Help sits above it */
  .help {
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
    height: 44px;
    padding: 0 16px 0 12px;
    font-size: 14px;
  }
  .help__panel {
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  }
  .help__row span {
    font-size: 14px;
  }
}
@media (max-width: 640px) {
  /* 28 Oct (Alfi): phones have no Discord bubble (mobile.css), so Help drops into the corner as a
     round icon-only button, 16px from the edges plus the safe-area insets; the name stays on the
     aria-label and the panel, behaviour and colours are unchanged. The id outranks mobile.css's
     phone-wide `button:not(.burger):not(.eye) { height: auto; min-height: 44px }`, which a plain
     .help rule would lose to. */
  #help-btn.help {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    width: 52px;
    height: 52px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 50%;
    /* 29 Oct (Alfi): the desktop shadow (10px drop, 30px blur) reached ~40px below the button, past the
       16px gap to the viewport edge, so Safari drew it as a straight cut-off line above its toolbar; a
       shorter drop fades out inside the gap. The id also outranks .help:hover, so a sticky tap-hover
       cannot bring the long shadow back. */
    box-shadow:
      0 4px 10px rgba(43, 43, 245, 0.32),
      0 1px 3px rgba(43, 43, 245, 0.22);
  }
  .help span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .help__panel {
    animation: none;
  }
}

/* ---- "Ask the agent" (28 Oct): the live support chat's structure (Otis, back, legal line, round send)
   in the site's white-and-blue look ---- */
.help__agent {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 61;
  width: min(440px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  color: var(--ink, #0c0f2c);
  background: #fff;
  border: 1px solid var(--line-d, #dcdff5);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(7, 10, 60, 0.5), 0 0 0 1px rgba(43, 43, 245, 0.06);
  animation: help-in 0.22s ease-out both;
}
.help__agent[hidden] {
  display: none;
}
.help__ahead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 8px;
  border-bottom: 1px solid var(--line-d, #dcdff5);
}
.help__back,
.help__x--dark {
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2, #55598a);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.help__back svg {
  width: 20px;
  height: 20px;
}
.help__back:hover,
.help__x--dark:hover {
  color: var(--ink, #0c0f2c);
  background: var(--lav, #eef0ff);
}
.help__x--dark {
  margin-left: auto;
  font-size: 26px;
  line-height: 1;
}
.help__avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--blue, #2b2bf5);
  background: var(--lav, #eef0ff);
  box-shadow: 0 0 0 1px rgba(43, 43, 245, 0.35);
}
.help__atitle b {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.help__atitle span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2, #55598a);
}
.help__log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fafbff;
}
.help__turn {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.help__turn--me {
  align-items: flex-end;
}
.help__who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #0c0f2c);
}
.help__who i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--blue, #2b2bf5);
  box-shadow: 0 0 0 1px rgba(43, 43, 245, 0.5);
}
.help__msg {
  max-width: 92%;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.help__msg--bot {
  padding: 10px 14px;
  margin-left: 26px;
  border-radius: 6px 16px 16px 16px;
  background: #fff;
  border: 1px solid var(--line-d, #dcdff5);
  color: var(--ink, #0c0f2c);
}
.help__msg--bot a {
  color: var(--blue, #2b2bf5);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.help__msg--me {
  padding: 10px 14px;
  border-radius: 16px 16px 6px 16px;
  background: var(--blue, #2b2bf5);
  color: #fff;
}
.help__msg.is-typing:empty::after {
  content: '\2026';
  color: var(--ink-2, #55598a);
}
.help__legal {
  margin: 0;
  padding: 8px 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2, #55598a);
  border-top: 1px solid var(--line-d, #dcdff5);
}
.help__compose {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 12px;
  padding: 5px 5px 5px 14px;
  border: 1.5px solid #c9ccef;
  border-radius: 999px;
  background: #fff;
}
.help__compose:focus-within {
  border-color: var(--blue, #2b2bf5);
  box-shadow: 0 0 0 3px rgba(43, 43, 245, 0.18);
}
.help__compose textarea {
  flex: 1;
  resize: none;
  min-height: 24px;
  max-height: 96px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink, #0c0f2c);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
}
.help__compose textarea::placeholder {
  color: #6f7394;
}
.help__compose textarea:focus {
  outline: none;
}
.help__send {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--blue, #2b2bf5);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.help__send svg {
  width: 18px;
  height: 18px;
}
.help__send:hover {
  background: #1f1fd8;
}
@media (max-width: 768px) {
  .help__agent {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}
.help__src {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--ink-2, #55598a);
}
.help__msg--bot b {
  display: block;
  margin-bottom: 2px;
}
