/* Salesforge rebuild, version 4, round 4: "Ask anything".
   One box, on all six pages, answers a visitor's question on the spot in Salesforge's own words: every FAQ answer
   and every section of the six pages, ranked as the visitor types, with typos and other words for the same thing
   understood. It also works things out: "Agent Frank for 3,000 contacts" or "price for 8,000 prospects" gives the
   price from Frank's own price tables, and a domain such as acme.com goes to the domain check. "Show me" opens the
   page at the exact place (FAQ rows open by themselves), every answer has a link of its own, and the button under
   each answer leads to the right next step. Opens from the header, from the FAQ sections, with "/" or Ctrl+K, and
   from a link with ?ask=. Nothing is sent anywhere; "Ask the team" is in demo mode. */

/* ---------------------------------------------------------------- header button */
.ask-trigger {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; width: 232px; height: 40px; padding: 0 8px 0 12px;
  border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white);
  color: var(--gray-500); font-size: 14px; line-height: 20px; text-align: left; box-shadow: var(--shadow-xs);
  transition: border-color .2s, box-shadow .2s, color .2s;
}
.ask-trigger:hover { border-color: #b692f6; color: var(--gray-700); box-shadow: 0 0 0 4px rgba(110, 64, 215, .08); }
.ask-trigger:focus-visible { outline: 2px solid #b692f6; outline-offset: 2px; }
.ask-trigger__icon { flex: none; width: 18px; height: 18px; color: var(--violet); }
.ask-trigger__icon svg { width: 100%; height: 100%; }
.ask-trigger__text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-key {
  flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border: 1px solid var(--gray-200); border-radius: 5px; background: var(--gray-50);
  font: 500 12px/1 "Inter", sans-serif; color: var(--gray-500);
}
@media (max-width: 1199px) and (min-width: 992px) { .ask-trigger { width: 176px; } }
@media (max-width: 991px) {
  .ask-trigger {
    top: 10px; right: 60px; transform: none; width: 44px; height: 44px; padding: 0; justify-content: center;
    border-color: transparent; box-shadow: none; background: transparent; color: var(--ink);
  }
  .ask-trigger:hover { border-color: transparent; box-shadow: none; color: var(--violet); }
  .ask-trigger__icon { width: 26px; height: 26px; color: inherit; }
  .ask-trigger__text, .ask-trigger .ask-key { display: none; }
}
@media (hover: none) { .ask-trigger .ask-key, .ask-inline .ask-key { display: none; } }

/* ---------------------------------------------------------------- the question bar in the FAQ sections */
.ask-inline {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 440px; height: 52px; padding: 0 6px 0 16px;
  border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white);
  color: var(--gray-500); font-size: 16px; line-height: 24px; text-align: left; box-shadow: var(--shadow-xs);
  transition: border-color .2s, box-shadow .2s;
}
.ask-inline:hover { border-color: #b692f6; box-shadow: 0 0 0 4px rgba(110, 64, 215, .08); }
.ask-inline:focus-visible { outline: 2px solid #b692f6; outline-offset: 2px; }
.ask-inline__icon { flex: none; width: 20px; height: 20px; color: var(--violet); }
.ask-inline__icon svg { width: 100%; height: 100%; }
/* width 0: the words never make the FAQ column wider than Frank's heading does; they fill what is there */
.ask-inline__text { flex: 1 1 0; width: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-inline__go {
  flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 6px;
  background: var(--violet); color: var(--white); font-size: 14px; font-weight: 600; transition: background-color .3s;
}
.ask-inline:hover .ask-inline__go { background: var(--violet-hover); }
.faq__head .ask-inline { margin: 24px auto 0; }
.pfaq__head .ask-inline { margin-top: -4px; }
@media (max-width: 991px) and (min-width: 480px) {     /* the question column is narrow here: the words get the room */
  .pfaq__head .ask-inline { padding-right: 12px; font-size: 15px; }
  .pfaq__head .ask-inline__go { display: none; }
}

/* ---------------------------------------------------------------- the box */
.ask-locked, .ask-locked body { overflow: hidden; }
.ask {
  position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start;
  padding: max(56px, 9vh) 24px 24px; font-size: 16px; line-height: 1.4; color: var(--body);
}
.ask[hidden] { display: none; }
.ask__backdrop {
  position: absolute; inset: 0; background: rgba(16, 24, 40, .48); opacity: 0; transition: opacity .18s ease-out;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ask.is-open .ask__backdrop { opacity: 1; }
.ask__panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 720px;
  max-height: calc(100vh - max(56px, 9vh) - 24px); overflow: hidden;
  border-radius: 16px; background: var(--white);
  box-shadow: 0 32px 64px -12px rgba(16, 24, 40, .28), 0 0 0 1px rgba(16, 24, 40, .06);
  opacity: 0; transform: translateY(10px) scale(.985);
  transition: opacity .18s ease-out, transform .24s cubic-bezier(.2, .9, .25, 1);
}
.ask.is-open .ask__panel { opacity: 1; transform: none; }
.ask__panel:focus { outline: 0; }

.ask__bar { flex: none; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--gray-200); }
.ask__icon { flex: none; width: 22px; height: 22px; color: var(--violet); }
.ask__icon svg { width: 100%; height: 100%; }
.ask__input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  font-size: 18px; line-height: 24px; color: var(--ink); -webkit-appearance: none; appearance: none;
}
.ask__input::placeholder { color: var(--gray-400); }
.ask__input::-webkit-search-cancel-button, .ask__input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.ask__clear { flex: none; height: 32px; padding: 0 10px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--gray-500); }
.ask__clear:hover { background: var(--gray-100); color: var(--gray-700); }
.ask__esc { flex: none; display: flex; align-items: center; height: 32px; padding: 0 4px; border-radius: 6px; }
.ask__esc-key {
  display: inline-grid; place-items: center; height: 24px; padding: 0 7px; border: 1px solid var(--gray-200);
  border-radius: 5px; background: var(--gray-50); font: 500 12px/1 "Inter", sans-serif; color: var(--gray-500);
}
.ask__esc:hover .ask__esc-key { border-color: var(--gray-300); color: var(--gray-700); }
.ask__esc-word { display: none; font-size: 15px; font-weight: 600; color: var(--violet); }

.ask__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px 8px 12px; }
.ask__list { display: flex; flex-direction: column; gap: 2px; }
.ask__label {
  padding: 12px 12px 6px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--gray-500);
}
.ask__wait { padding: 16px 12px; font-size: 14px; color: var(--gray-500); }

.ask__opt { position: relative; padding: 12px 14px; border-radius: 10px; cursor: pointer; scroll-margin: 8px; }
.ask__opt.is-active { background: var(--gray-50); }
.ask__opt::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px;
  background: var(--violet); opacity: 0; transition: opacity .15s;
}
.ask__opt.is-active::before { opacity: 1; }

/* popular questions and examples */
.ask__row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 15px; line-height: 22px; color: var(--ink); }
.ask__row-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--violet-50); color: var(--violet); }
.ask__row-icon svg { width: 16px; height: 16px; }
.ask__row-text { flex: 1; min-width: 0; }
.ask__row-go { flex: none; width: 16px; height: 16px; color: var(--gray-400); opacity: 0; transition: opacity .15s; }
.ask__row.is-active .ask__row-go { opacity: 1; }

/* answers */
.ask__src { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 4px; font-size: 12px; line-height: 16px; color: var(--gray-500); }
.ask__src-page { flex: none; font-weight: 600; color: var(--violet); }
.ask__src-group { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ink); }
.ask__snip {
  margin: 4px 0 0; font-size: 14px; line-height: 21px; color: var(--gray-500);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ask__full { margin: 8px 0 0; font-size: 15px; line-height: 24px; color: var(--body); white-space: pre-line; }
.ask__hit.is-open { background: var(--violet-50); cursor: default; }
.ask__hit.is-open.is-active { background: var(--violet-50); }
.ask mark { background: var(--violet-100); color: inherit; border-radius: 3px; padding: 0 1px; }
.ask__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ask__btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s;
}
.ask__btn svg { width: 16px; height: 16px; flex: none; }
.ask__btn--primary { background: var(--violet); border-color: var(--violet); color: var(--white); }
.ask__btn--primary:hover { background: var(--violet-hover); border-color: var(--violet-hover); }
.ask__btn--light { background: var(--white); border-color: var(--gray-300); color: var(--gray-700); box-shadow: var(--shadow-xs); }
.ask__btn--light:hover { background: var(--gray-50); }
.ask__btn--icon { width: 36px; padding: 0; background: var(--white); border-color: var(--gray-300); color: var(--gray-500); }
.ask__btn--icon:hover { color: var(--violet); }
.ask__btn--icon.is-done { color: #079455; border-color: #abefc6; }
.ask__tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 8px; border-radius: 6px;
  background: var(--ink); color: var(--white); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.ask__btn--icon:hover .ask__tip, .ask__btn--icon.is-done .ask__tip { opacity: 1; }
.ask__link { padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }
.ask__btn:focus-visible, .ask__link:focus-visible, .ask__more-btn:focus-visible, .ask__clear:focus-visible, .ask__esc:focus-visible { outline: 2px solid #b692f6; outline-offset: 2px; }

/* worked-out answers */
.ask__card { margin: 2px 0 6px; border: 1px solid #e9d7fe; background: linear-gradient(180deg, #faf7ff 0%, var(--white) 70%); cursor: default; }
.ask__card.is-active { background: linear-gradient(180deg, #f6f0ff 0%, var(--white) 70%); }
.ask__card-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; line-height: 16px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--violet);
}
.ask__card-label svg { width: 14px; height: 14px; flex: none; }
.ask__figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; }
.ask__big { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -.75px; color: var(--ink); }
.ask__per { font-size: 14px; color: var(--gray-500); }
.ask__lines { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.ask__line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 7px 0; border-top: 1px dashed var(--gray-200); font-size: 14px; line-height: 20px; }
.ask__line-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; color: var(--ink); }
.ask__line-sub { font-weight: 400; font-size: 13px; color: var(--gray-500); }
.ask__line-value { flex: none; text-align: right; color: var(--gray-700); font-variant-numeric: tabular-nums; }
.ask__note { margin: 10px 0 0; font-size: 13px; line-height: 20px; color: var(--gray-500); }

/* no answer: ask the team */
.ask__none { margin: 4px 4px 8px; padding: 18px; border: 1px dashed var(--gray-300); border-radius: 12px; }
.ask__none-title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ask__none-sub { margin-top: 4px; font-size: 14px; color: var(--gray-500); }
.ask__team { display: flex; gap: 8px; margin-top: 14px; }
.ask__team[hidden] { display: none; }
.ask__team-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 15px; color: var(--ink); background: var(--white); box-shadow: var(--shadow-xs);
}
.ask__team-input:focus { outline: 0; border-color: #b692f6; box-shadow: 0 0 0 4px rgba(110, 64, 215, .1); }
.ask__team .ask__btn { height: 44px; }
.ask__team-done { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 15px; font-weight: 500; color: var(--ink); }
.ask__team-done[hidden] { display: none; }
.ask__ok { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #17b26a; color: var(--white); }
.ask__ok svg { width: 14px; height: 14px; }
.ask__more { padding: 12px 14px 4px; font-size: 13px; color: var(--gray-500); }
.ask__more-btn { font-size: 13px; font-weight: 600; color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }

.ask__foot {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px;
  border-top: 1px solid var(--gray-200); background: var(--gray-50); font-size: 12px; line-height: 16px; color: var(--gray-500);
}
.ask__keys kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin: 0 2px; padding: 0 5px;
  border: 1px solid var(--gray-200); border-radius: 4px; background: var(--white); font: 500 11px/1 "Inter", sans-serif; color: var(--gray-700);
}
.ask__keys kbd + kbd { margin-left: 0; }

/* phones: the box fills the screen, the keyboard has room */
@media (max-width: 767px) {
  .ask { padding: 0; }
  .ask__backdrop { display: none; }
  .ask__panel { max-width: none; height: 100%; max-height: none; border-radius: 0; box-shadow: none; transform: translateY(16px); }
  @supports (height: 100dvh) { .ask__panel { height: 100dvh; } }
  .ask__bar { height: 60px; padding: 0 8px 0 16px; gap: 10px; }
  .ask__input { font-size: 17px; }
  .ask__esc { padding: 0 8px; }
  .ask__esc-key { display: none; }
  .ask__esc-word { display: inline; }
  .ask__foot { display: none; }
  .ask__body { padding: 6px 4px 24px; }
  .ask__opt { padding: 12px; }
  .ask__big { font-size: 32px; line-height: 36px; }
  .ask__team { flex-direction: column; }
  .ask__team-input { flex: none; }   /* round 6 fix: in the column the field keeps its 44 px height (flex: 1 had squashed it to 21 px) */
}
@media (max-width: 479px) { .ask__long { display: none; } }
@media (hover: none) { .ask__foot .ask__keys { visibility: hidden; } }

/* ---------------------------------------------------------------- the place an answer points to */
[data-ask-place] { scroll-margin-top: calc(var(--nav-h) + 20px); }
.ask-flash { border-radius: 10px; animation: ask-flash 2.6s ease-out 1; }
@keyframes ask-flash {
  0% { background-color: rgba(244, 235, 255, 0); box-shadow: 0 0 0 0 rgba(244, 235, 255, 0); }
  10% { background-color: rgba(244, 235, 255, 1); box-shadow: 0 0 0 10px rgba(244, 235, 255, 1); }
  70% { background-color: rgba(244, 235, 255, 1); box-shadow: 0 0 0 10px rgba(244, 235, 255, 1); }
  100% { background-color: rgba(244, 235, 255, 0); box-shadow: 0 0 0 10px rgba(244, 235, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ask__backdrop, .ask__panel { transition: none; }
  .ask-flash { animation: none; background-color: var(--violet-100); box-shadow: 0 0 0 10px var(--violet-100); }
}
.shot .ask-flash { background-color: var(--violet-100); box-shadow: 0 0 0 10px var(--violet-100); }
