/* FAQ direct links (faq.js): the link icon and its copy menu, the arrival pulse, "Was this helpful?", staff counts.
   The FAQ keeps its own look (the inline .rankpage rules in faq.html); this only adds the small pieces beside it. */

/* the icon (and the staff counts) sit inline right after the question, so the entry keeps its exact look */
.fq-link {
  display: inline-grid; place-items: center; vertical-align: middle; width: 26px; height: 26px; margin: -4px 0 -3px 0.35rem; padding: 0;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted, #9aa3b5); cursor: pointer;
  opacity: 0; transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.faq-item > summary:hover .fq-link, .fq-link:focus-visible, .fq-link[aria-expanded="true"], .faq-item[open] > summary .fq-link { opacity: 1; }
.fq-link:hover, .fq-link[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); }
.fq-link:focus-visible { outline: 2px solid var(--rk-accent, #ffb347); outline-offset: 1px; }
@media (hover: none) { .fq-link { opacity: 0.75; } }

.fq-menu {
  position: fixed; z-index: 2147483000; min-width: 196px; padding: 0.3rem; border-radius: 12px;
  background: #171a24; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.fq-menu[hidden] { display: none; }
.fq-menu button {
  display: flex; align-items: center; gap: 0.55rem; width: 100%; padding: 0.55rem 0.7rem; border: 0; border-radius: 8px;
  background: none; color: #e6ebf5; font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer;
}
.fq-menu button:hover, .fq-menu button:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
.fq-menu button svg { flex: none; color: var(--rk-accent, #ffb347); }

.fq-toast {
  position: fixed; z-index: 2147483001; left: 50%; bottom: 1.4rem; transform: translate(-50%, 12px); padding: 0.6rem 1rem; border-radius: 999px;
  background: #1f2433; border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; font-size: 0.92rem; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.fq-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* jumps to an entry (a link, the browser, the script) stop below the sticky header */
.rankpage .faq-item, .rankpage .faq-section { scroll-margin-top: calc(var(--zl-header-bottom, 80px) + 14px); }

/* a short glow on the entry a link opened */
.rankpage .faq-item.fq-pulse { animation: fq-pulse 2s ease-out 1; border-radius: 10px; }
@keyframes fq-pulse {
  0% { background: rgba(255, 179, 71, 0); box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); }
  18% { background: rgba(255, 179, 71, 0.12); box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.55); }
  100% { background: rgba(255, 179, 71, 0); box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); }
}

/* "Was this helpful?" */
.fq-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px dashed rgba(255, 255, 255, 0.08); font-size: 0.86rem; color: var(--muted, #9aa3b5); }
.fq-fb-q { margin-right: 0.15rem; }
.fq-fb-b { display: inline-grid; place-items: center; width: 32px; height: 28px; padding: 0; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); color: var(--muted, #9aa3b5); cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.fq-fb-b:hover, .fq-fb-b:focus-visible { color: #8ff0b4; border-color: rgba(95, 227, 154, 0.45); background: rgba(95, 227, 154, 0.08); outline: none; }
.fq-fb-b.is-down svg { transform: scaleY(-1); }
.fq-fb-b.is-down:hover, .fq-fb-b.is-down:focus-visible { color: #ff9a8c; border-color: rgba(255, 92, 72, 0.45); background: rgba(255, 92, 72, 0.08); }
.fq-fb-b:disabled { opacity: 0.5; cursor: default; }
.fq-fb-thanks { color: #cfd6e6; }

/* staff only: tiny counts */
.fq-stats { display: inline-flex; vertical-align: middle; gap: 0.35rem; margin-left: 0.45rem; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.7rem; color: var(--muted, #9aa3b5); white-space: nowrap; }
.fq-stats b { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.05rem 0.35rem; border-radius: 6px; font-weight: 600; background: rgba(255, 255, 255, 0.05); }
.fq-stats b svg { width: 11px; height: 11px; }
.fq-stats .is-up { color: #8ff0b4; } .fq-stats .is-down { color: #ff9a8c; }

@media (prefers-reduced-motion: reduce) { .rankpage .faq-item.fq-pulse { animation: none; box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.55); } .fq-toast, .fq-link { transition: none; } }
@media (max-width: 640px) { .fq-stats b svg { display: none; } }
.fq-fb[hidden] { display: none; }
