/* FAQ widget and page. Neutral tokens from app.css only (docs/DESIGN.md): no gradients, one accent for focus/active state. */
.fq { --fq-h: 520px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--ink); max-height: var(--fq-h); min-height: 0; }
.fq-tall { --fq-h: 680px; }
@media (max-width: 720px) { .fq, .fq-tall { --fq-h: 60dvh; } }
.fq-top { flex: none; display: grid; gap: 10px; padding: 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.fq-search { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--muted); }
.fq-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.fq-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; min-height: 44px; padding: 0; box-shadow: none; }
.fq-search input::-webkit-search-cancel-button { display: none; }
.fq-clear, .fq-go { border: 0; background: transparent; color: var(--ink-2); border-radius: 8px; min-width: 36px; min-height: 36px; display: inline-grid; place-items: center; cursor: pointer; font: inherit; font-weight: 700; font-size: 13px; padding: 0 10px; }
.fq-clear[hidden] { display: none; }
.fq-clear:hover, .fq-go:hover { background: var(--surface-2); }
.fq-go { display: none; background: var(--brand); color: var(--on-brand); } .fq-go:hover { background: var(--brand-d); }
.fq:not(.fq-js) .fq-go { display: inline-grid; }
.fq-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding-inline: 12px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.fq-chips::-webkit-scrollbar { display: none; }
.fq-chip { flex: none; position: relative; }
.fq-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fq-chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.fq-chip input:hover + span { background: var(--surface-2); }
.fq-chip input:checked + span { border-color: var(--brand); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--surface); }
.fq-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.fq-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; scroll-padding-top: 8px; position: relative; contain: layout paint; }
.fq-list::-webkit-scrollbar { width: 10px; } .fq-list::-webkit-scrollbar-track { background: transparent; }
.fq-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid var(--surface); }
.fq-list:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.fq.fq-loading .fq-list { opacity: .55; transition: opacity .15s; }
.fq-scrolled .fq-top { box-shadow: 0 1px 0 var(--line); }
.fq-count { margin: 0; padding: 10px 16px 6px; font-size: 12.5px; color: var(--muted); }
.fq-item { border-top: 1px solid var(--line); }
.fq-item:first-of-type { border-top: 0; }
.fq-item:target > h3 .fq-q, .fq-item.fq-hit > h3 .fq-q { box-shadow: inset 3px 0 0 var(--brand); }
.fq-item h3 { margin: 0; font-size: inherit; font-weight: inherit; letter-spacing: 0; }
.fq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 12px 16px; border: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; font-size: 15.5px; font-weight: 650; line-height: 1.35; cursor: pointer; transition: background-color .15s; }
.fq-q:hover { background: var(--surface-2); }
.fq-q:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.fq-qt { display: grid; gap: 3px; min-width: 0; }
.fq-qt mark, .fq-snip mark { background: transparent; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.fq-snip { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.fq-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.fq-q[aria-expanded="true"] .fq-chev { transform: rotate(180deg); }
.fq-a { padding: 0 16px 14px; overflow: hidden; }
.fq-a[hidden] { display: none; }
.fq-prose { max-width: 70ch; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.fq-prose p { margin: 0 0 10px; } .fq-prose p:last-child { margin-bottom: 0; }
.fq-prose ul, .fq-prose ol { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 4px; }
.fq-prose strong { color: var(--ink); }
.fq-prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.fq-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.fq-vote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .fq-vote form { display: inline-flex; gap: 6px; }
.fq-vb { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.fq-vb:hover { background: var(--surface-2); } .fq-vb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fq-thanks { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.fq-link { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; border-radius: 8px; color: var(--muted); } .fq-link:hover { background: var(--surface-2); color: var(--ink); }
.fq-none { display: grid; gap: 8px; justify-items: start; padding: 28px 18px; } .fq-none p { margin: 0; color: var(--muted); font-size: 14px; max-width: 46ch; }
.fq-empty { padding: 20px 16px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .fq-chev, .fq-chip span, .fq-q, .fq.fq-loading .fq-list { transition: none; } }

/* /faq/ page: topics sidebar + widget, full width */
.fq-page { display: grid; gap: 20px; padding: clamp(20px, 3vw, 36px) var(--pad) clamp(36px, 6vw, 72px); }
.fq-th { display: none; }
.fq-side h2 { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px; letter-spacing: 0; }
.fq-aud { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.fq-aud a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.fq-aud a[aria-current] { border-color: var(--brand); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.fq-topics { list-style: none; margin: 0 0 18px; padding: 0; display: none; }
.fq-topics a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.fq-topics a:hover { background: var(--surface-2); color: var(--ink); }
.fq-topics a[aria-current] { color: var(--brand); background: var(--surface-2); }
.fq-topics em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fq-help { display: none; border: 1px solid var(--line); border-radius: 14px; padding: 16px; gap: 6px; } .fq-help p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
@media (min-width: 960px) {
  .fq-page { grid-template-columns: 280px minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: start; }
  .fq-side { position: sticky; top: calc(var(--top-h, 64px) + 16px); }
  .fq-th { display: block; }
  .fq-topics { display: block; } .fq-help { display: grid; justify-items: start; }
}
