/* ============ FAQ identity ============
     Help-LIBRARY metaphor.
     - Card-catalog Q-IDs (Q-001 ... Q-XYZ) in mono
     - Category palette dots + count badges
     - Search bar that filters in realtime
     - Sticky category sidebar = table of contents
     - Each Q has a "was this helpful?" vote footer
     - "Still stuck?" multi-path triage at bottom
     */

  .crumb { padding: 20px 0 0; font-size: 13px; color: var(--fg-mute); display: flex; gap: 10px; align-items: center; }
  .crumb a { color: var(--fg-mute); }
  .crumb a:hover { color: var(--accent); }
  .crumb .sep { opacity: 0.4; }

  /* ---- HERO ---- */
  .help-hero { padding: 48px 0 56px; }
  .help-hero h1 {
    font-size: clamp(48px, 6.4vw, 96px); line-height: 0.95;
    letter-spacing: -0.04em; font-weight: 600;
    margin: 24px 0 22px; max-width: 18ch;
  }
  .help-hero h1 em {
    font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400;
    letter-spacing: -0.02em; color: var(--accent);
  }
  .help-hero .lede { font-size: 19px; color: var(--fg-dim); max-width: 56ch; }

  /* card-catalog stats row */
  .help-stats {
    display: flex; gap: 0; margin-top: 32px; flex-wrap: wrap;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-elev); overflow: hidden;
  }
  .help-stats > div {
    flex: 1; padding: 18px 24px; min-width: 140px;
    border-right: 1px solid var(--border);
  }
  .help-stats > div:last-child { border-right: 0; }
  .help-stats .k {
    font-family: "Geist Mono", monospace; font-size: 10.5px;
    letter-spacing: 0.12em; color: var(--fg-mute);
    text-transform: uppercase; margin-bottom: 6px;
  }
  .help-stats .v {
    font-size: 22px; letter-spacing: -0.015em; line-height: 1;
    display: flex; align-items: baseline; gap: 6px;
  }
  .help-stats .v small { font-size: 12px; color: var(--fg-mute); font-family: "Geist Mono", monospace; }
  .help-stats .v .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 4px; }

  /* ---- SEARCH ---- */
  .search-wrap {
    margin-top: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--bg-card);
    padding: 6px 8px 6px 22px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 18px 50px -30px rgba(0,0,0,0.3);
    transition: border-color 140ms ease, box-shadow 140ms ease;
  }
  .search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 18px 60px -28px color-mix(in oklch, var(--accent) 60%, transparent);
  }
  .search-icon {
    width: 20px; height: 20px; flex-shrink: 0;
    border: 2px solid var(--fg-mute); border-radius: 50%;
    position: relative;
  }
  .search-icon::after {
    content: ""; position: absolute; right: -6px; bottom: -6px;
    width: 8px; height: 2px; background: var(--fg-mute);
    transform: rotate(45deg); transform-origin: left center;
  }
  .search-wrap:focus-within .search-icon,
  .search-wrap:focus-within .search-icon::after {
    border-color: var(--accent); background-color: var(--accent);
  }
  .search-wrap:focus-within .search-icon { background: transparent; }
  #q {
    flex: 1; border: 0; outline: 0; background: transparent;
    color: var(--fg); font-size: 17px; font-family: inherit;
    padding: 16px 0; letter-spacing: -0.005em;
  }
  #q::placeholder { color: var(--fg-mute); }
  .search-meta {
    display: none;
    font-family: "Geist Mono", monospace; font-size: 11px;
    color: var(--fg-mute); padding: 0 14px; white-space: nowrap;
  }
  .search-meta.is-visible { display: block; }
  .search-meta strong { color: var(--accent); font-weight: 500; }
  .kbd {
    font-family: "Geist Mono", monospace; font-size: 11px;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px; padding: 3px 7px; color: var(--fg-mute);
  }

  /* ---- SUGGESTIONS (chips) ---- */
  .sug { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
  .sug .sug-lbl { font-family: "Geist Mono", monospace; font-size: 11px; color: var(--fg-mute); margin-right: 4px; }
  .sug button {
    padding: 6px 12px; border-radius: 999px;
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 12.5px; color: var(--fg-dim);
    transition: 120ms ease;
  }
  .sug button:hover { color: var(--accent); border-color: var(--accent); }

  /* ============ POPULAR ROW ============ */
  .pop-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-top: 48px;
  }
  @media (max-width: 980px) { .pop-row { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 600px) { .pop-row { grid-template-columns: 1fr; } }
  .pop-card {
    padding: 20px 22px 22px;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: 180ms ease;
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
  }
  .pop-card:hover { background: var(--bg-card); border-color: var(--border-strong); transform: translateY(-2px); }
  .pop-card .qid {
    font-family: "Geist Mono", monospace; font-size: 10.5px;
    color: var(--fg-mute); letter-spacing: 0.06em;
    display: flex; justify-content: space-between; align-items: center;
  }
  .pop-card .qid .views { color: var(--accent); }
  .pop-card .views::before {
    content: "↑"; margin-right: 4px;
  }
  .pop-card .q {
    font-size: 16px; letter-spacing: -0.01em; font-weight: 500;
    line-height: 1.25; color: var(--fg);
  }
  .pop-card .a-preview {
    font-size: 13px; color: var(--fg-mute); line-height: 1.5;
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pop-card .cat-dot {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: "Geist Mono", monospace; font-size: 10.5px;
    color: var(--fg-mute); letter-spacing: 0.04em;
    text-transform: uppercase; margin-top: 4px;
  }
  .pop-card .cat-dot::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--cat-color, var(--accent));
  }

  /* ============ MAIN: SIDEBAR + LIST ============ */
  .help-main {
    display: grid; grid-template-columns: 280px 1fr; gap: 56px;
    align-items: start;
  }
  @media (max-width: 980px) { .help-main { grid-template-columns: 1fr; gap: 32px; } }

  /* SIDEBAR */
  .toc {
    position: sticky; top: 84px;
    padding: 24px 8px 24px 0;
    border-right: 1px solid var(--border);
  }
  @media (max-width: 980px) {
    .toc { position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; }
  }
  .toc h6 {
    font-family: "Geist Mono", monospace; font-size: 10.5px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--fg-mute); margin: 0 0 12px;
    padding: 0 14px;
  }
  .toc-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  @media (max-width: 980px) {
    .toc-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  }
  .toc-list a {
    padding: 9px 14px; border-radius: 8px;
    color: var(--fg-dim); font-size: 14px;
    display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center;
    line-height: 1.2;
    transition: 120ms ease;
  }
  .toc-list a:hover { background: var(--bg-elev); color: var(--fg); }
  .toc-list a.active {
    background: color-mix(in oklch, var(--accent) 10%, transparent);
    color: var(--fg);
  }
  .toc-list a::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--cat-color, var(--fg-mute));
  }
  .toc-list a .ct {
    font-family: "Geist Mono", monospace; font-size: 11px;
    color: var(--fg-mute);
  }
  @media (max-width: 980px) {
    .toc-list a { padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; }
  }

  /* LIST */
  .help-cats { display: flex; flex-direction: column; gap: 64px; }
  .cat-block {}
  .cat-head {
    display: flex; align-items: baseline; gap: 14px;
    padding-bottom: 14px; margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }
  .cat-head .cat-num {
    font-family: "Instrument Serif", serif; font-style: italic;
    font-size: 36px; color: var(--cat-color, var(--accent));
    line-height: 1; letter-spacing: -0.02em;
  }
  .cat-head .cat-title { font-size: 24px; letter-spacing: -0.02em; font-weight: 500; }
  .cat-head .cat-meta {
    font-family: "Geist Mono", monospace; font-size: 11px;
    color: var(--fg-mute); margin-left: auto;
  }

  /* Question entry */
  .q-entry {
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
  }
  .q-entry summary {
    list-style: none; padding: 22px 0;
    cursor: pointer;
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 24px; align-items: center;
    color: var(--fg);
  }
  .q-entry summary::-webkit-details-marker { display: none; }
  .q-entry .qid {
    font-family: "Geist Mono", monospace; font-size: 11px;
    color: var(--fg-mute); letter-spacing: 0.06em;
  }
  .q-entry .q-text {
    font-size: 17.5px; letter-spacing: -0.01em; font-weight: 500;
    line-height: 1.3;
  }
  .q-entry .toggle {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border);
    display: grid; place-items: center;
    color: var(--fg-mute); font-family: "Geist Mono", monospace; font-size: 18px;
    transition: 160ms ease;
    flex-shrink: 0;
  }
  .q-entry[open] .toggle {
    background: var(--accent); color: var(--accent-ink);
    border-color: var(--accent);
    transform: rotate(45deg);
  }
  .q-entry[open] .toggle::before { content: "+"; }
  .q-entry .toggle::before { content: "+"; }
  .q-entry[open] summary { color: var(--cat-color, var(--accent)); }
  .q-entry summary:hover .toggle { border-color: var(--border-strong); color: var(--fg); }

  /* Answer body */
  .q-body {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    padding: 0 0 28px;
  }
  .q-body .q-side { /* empty placeholder to align under qid */ }
  .q-body .q-content { max-width: 68ch; }
  .q-body p { margin: 0 0 14px; color: var(--fg-dim); font-size: 15px; line-height: 1.6; }
  .q-body p:last-of-type { margin-bottom: 0; }
  .q-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .q-body strong { color: var(--fg); font-weight: 500; }
  .q-body ul { margin: 0 0 14px; padding: 0; list-style: none; }
  .q-body ul li {
    padding: 6px 0 6px 22px; position: relative;
    color: var(--fg-dim); font-size: 14.5px;
  }
  .q-body ul li::before {
    content: "→"; position: absolute; left: 0; top: 6px;
    color: var(--accent); font-family: "Geist Mono", monospace;
  }
  .q-body code {
    font-family: "Geist Mono", monospace; font-size: 12.5px;
    background: var(--bg-elev); padding: 2px 6px; border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--accent);
  }
  .q-vote {
    margin-top: 24px; padding-top: 16px;
    border-top: 1px dashed var(--border);
    display: flex; align-items: center; gap: 14px;
    font-size: 13px; color: var(--fg-mute);
  }
  .q-vote .vote-lbl { font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
  .q-vote button {
    padding: 6px 12px; border-radius: 8px;
    background: var(--bg-elev); border: 1px solid var(--border);
    font-size: 12.5px; color: var(--fg-dim);
    display: inline-flex; align-items: center; gap: 6px;
    transition: 120ms ease;
  }
  .q-vote button:hover { color: var(--fg); border-color: var(--border-strong); }
  .q-vote button.voted { background: color-mix(in oklch, var(--accent) 14%, var(--bg-elev)); color: var(--accent); border-color: var(--accent); }
  .q-vote .related {
    margin-left: auto; font-size: 12.5px;
    color: var(--fg-mute);
  }
  .q-vote .related a { color: var(--accent); }

  /* Empty / no-result state */
  .empty {
    text-align: center; padding: 80px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elev);
  }
  .empty .em-em {
    font-family: "Instrument Serif", serif; font-style: italic;
    font-size: 56px; color: var(--accent); line-height: 1;
  }
  .empty h3 { font-size: 22px; letter-spacing: -0.015em; font-weight: 500; margin: 16px 0 8px; }
  .empty p { color: var(--fg-mute); margin: 0 0 24px; }

  /* ============ STUCK CALLOUT ============ */
  .stuck {
    margin-top: 96px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .stuck-hd {
    padding: 36px 48px 28px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  }
  .stuck-hd h2 {
    font-size: clamp(28px, 3.4vw, 44px);
    letter-spacing: -0.025em; line-height: 1.05;
    font-weight: 600; margin: 0;
  }
  .stuck-hd h2 em { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; color: var(--accent); }
  .stuck-hd .stuck-status {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: "Geist Mono", monospace; font-size: 11.5px;
    color: var(--fg-dim);
  }
  .stuck-hd .stuck-status .dot {
    width: 8px; height: 8px; border-radius: 50%; background: oklch(0.7 0.15 145);
    box-shadow: 0 0 12px oklch(0.7 0.15 145 / 0.6);
  }
  .stuck-paths {
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--border);
    gap: 1px;
  }
  @media (max-width: 880px) { .stuck-paths { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 520px) { .stuck-paths { grid-template-columns: 1fr; } }
  .stuck-path {
    background: var(--bg);
    padding: 28px 28px 32px;
    display: flex; flex-direction: column; gap: 8px;
    transition: 180ms ease;
  }
  .stuck-path:hover { background: var(--bg-card); }
  .stuck-path .glyph {
    width: 36px; height: 36px; border-radius: 10px;
    background: color-mix(in oklch, var(--accent) 12%, var(--bg-card));
    border: 1px solid color-mix(in oklch, var(--accent) 40%, var(--border));
    color: var(--accent);
    display: grid; place-items: center;
    margin-bottom: 12px;
    font-family: "Geist Mono", monospace; font-size: 14px;
  }
  .stuck-path h4 { font-size: 16px; letter-spacing: -0.01em; font-weight: 500; margin: 0; }
  .stuck-path p { font-size: 13px; color: var(--fg-mute); margin: 0 0 14px; line-height: 1.5; }
  .stuck-path .go {
    margin-top: auto;
    color: var(--accent); font-size: 13px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 6px;
  }

  /* highlight match marks */
  mark { background: color-mix(in oklch, var(--gold) 50%, transparent); color: var(--fg); padding: 0 2px; border-radius: 3px; }

  /* category color tokens (set on each block) */
  .cat-getting   { --cat-color: oklch(0.65 0.18 27); }   /* red — keep with brand */
  .cat-events    { --cat-color: oklch(0.66 0.15 60); }   /* warm orange */
  .cat-billing   { --cat-color: oklch(0.74 0.14 80); }   /* gold */
  .cat-revenue   { --cat-color: oklch(0.66 0.14 145); }  /* sage */
  .cat-tech      { --cat-color: oklch(0.62 0.12 230); }  /* slate-blue */
  .cat-apps      { --cat-color: oklch(0.6 0.14 290); }   /* heather */
  .cat-account   { --cat-color: oklch(0.55 0.05 50); }   /* ink mute */

  .cat-block.faq-cat-hidden { display: none !important; }

/* mono-cats override (set by tweak) */
  body.mono-cats .cat-getting,
  body.mono-cats .cat-events,
  body.mono-cats .cat-billing,
  body.mono-cats .cat-revenue,
  body.mono-cats .cat-tech,
  body.mono-cats .cat-apps,
  body.mono-cats .cat-account { --cat-color: var(--fg); }
  body.mono-cats .toc-list a { --cat-color: var(--fg-mute) !important; }
  body.mono-cats .pop-card { --cat-color: var(--fg) !important; }
