/* Help center search (HELP-CENTER-PORT-PLAN-2026-10-23 G4): the big search
   field (home hero and search page), the search page (count, topic chips,
   result rows, the 280px rail, the no-results help grid), the typeahead popup
   and the "Still need help?" band on every page (helpcanvas-v1
   templates/kb/search.html.twig, _typeahead.html.twig, home .cta-card).
   Loaded on every help center page: every rule is scoped to a G4 class.
   Tokens come from help.css. */

/* ============ Search field ============ */
.hc-search-field {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--brand-ink) 18%, var(--bg)); border-radius: var(--radius);
  box-shadow: 0 12px 32px -14px color-mix(in srgb, var(--brand-ink) 22%, transparent), 0 2px 6px color-mix(in srgb, var(--brand-ink) 5%, transparent);
  transition: border-color .15s, box-shadow .15s;
}
.hc-search-field:hover { border-color: var(--brand); }
.hc-search-field:focus-within { border-color: var(--brand-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.hc-search-field > svg { color: var(--muted); }
.hc-search-field input[type="search"] {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 16px;
}
.hc .hc-search-field input:focus-visible { outline: none; }
.hc-search-field input::placeholder { color: var(--muted); opacity: 1; }
.hc-search-field input::-webkit-search-cancel-button, .hc-search-field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.hc-search-go {
  flex: none; height: 42px; padding: 0 20px; border: 0; border-radius: var(--r-md);
  background: var(--brand-deep); color: var(--on-brand); font-weight: 650; font-size: 14px;
}
.hc-search-go:hover { background: var(--brand-ink); }
.hc .hc-search-go:focus-visible { outline-color: var(--ink); }
.hc-search-field--hero { max-width: 620px; height: 58px; margin: 0 auto; padding: 0 8px 0 18px; }
.hc-search-field--page { height: 56px; margin-top: 22px; padding: 0 6px 0 16px; box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--brand-ink) 18%, transparent), 0 2px 6px color-mix(in srgb, var(--brand-ink) 5%, transparent); }
.hc-search-field--page .hc-search-go { height: 44px; padding: 0 18px; }
.hc-search-clear {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
}
.hc-search-clear:hover { color: var(--ink); background: var(--mint-soft); }
@media (pointer: coarse) { .hc-search-clear { width: 44px; height: 44px; } }
@media (max-width: 420px) {
  .hc-search-field--hero { padding-left: 14px; }
  .hc-search-field--page { padding-left: 12px; }
  .hc-search-go, .hc-search-field--page .hc-search-go { padding: 0 14px; }
}

/* ============ Search page ============ */
.hc-search-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; padding: 8px 0 72px; }
.hc-search-main { min-width: 0; }
/* No results or no query: the help grid and the contact band carry the lists and the contact, so there is no rail. */
.hc-search-layout--single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1023px) { .hc-search-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 760px; } }
@media (max-width: 420px) { .hc-search-layout { padding-bottom: 56px; } }
.hc-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin: 30px 0 12px; }
.hc-results-head h1, .hc-search-none h1 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; line-height: 1.3; overflow-wrap: anywhere; }

.hc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; padding: 0; list-style: none; }
.hc-filters a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card);
  font-size: 14px; font-weight: 600; color: var(--body); white-space: nowrap;
}
.hc-filters a:hover { border-color: var(--brand); color: var(--ink); }
.hc-filters a[aria-current="true"] { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--on-brand); }
.hc-filters-n {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--mint); color: var(--brand-deep); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* S-R3-02: the count pill of the active chip is a step further from the text than the chip
   (brand-ink: darker in light mode, lighter in dark), so it keeps 4.5:1 for every brand
   (HelpTokensTest); a tint of the text colour fell to 4.07:1 in dark mode. */
.hc-filters a[aria-current="true"] .hc-filters-n { background: var(--brand-ink); color: var(--on-brand); }
@media (pointer: coarse) { .hc-filters a { min-height: 44px; } }
/* E3 (S-R4-02): on phones help-search.js keeps the chips to one row and hides the rest behind
   this button (a chip outline, the brand text colour); the button opens them all. */
.hc-filters li[hidden] { display: none; }
.hc-filters-more button {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px dashed var(--line); border-radius: var(--r-pill); background: transparent;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--brand-deep); white-space: nowrap; cursor: pointer;
}
.hc-filters-more button:hover { border-color: var(--brand); color: var(--ink); }
@media (pointer: coarse) { .hc-filters-more button { min-height: 44px; } }

.hc-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.hc-results li + li { border-top: 1px solid var(--line-soft); }
.hc-result, .hc a.hc-result { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; color: inherit; transition: background .13s; }
.hc-result:hover { background: var(--mint-soft); }
.hc-result:focus-visible { outline-offset: -3px; }
.hc-result-icon { width: 32px; height: 32px; margin-top: 2px; border-radius: var(--r-sm); }
.hc-result-icon svg { width: 15px; height: 15px; }
.hc-result-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.hc-result-topic { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-deep); }
.hc-result-title { font-size: 16.5px; color: var(--ink); font-weight: 680; letter-spacing: -.15px; line-height: 1.35; overflow-wrap: anywhere; }
.hc-result:hover .hc-result-title { color: var(--brand-deep); }
.hc-result-excerpt { font-size: 14.5px; color: var(--body); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hc-result-meta { font-size: 13px; color: var(--muted); }
.hc-result-chev { flex: none; margin-top: 8px; color: var(--muted); transition: transform .15s, color .15s; }
.hc-result:hover .hc-result-chev { transform: translateX(3px); color: var(--brand-deep); }
@media (max-width: 640px) {
  .hc-result, .hc a.hc-result { padding: 16px; gap: 12px; }
  .hc-result-icon, .hc-result-chev { display: none; }
}
mark.hc-hl { padding: 0 .12em; border-radius: .2em; background: var(--mark-bg); color: var(--mark-ink); font-style: normal; }
.hc-results-more { margin-top: 14px; font-size: 14px; color: var(--muted); }

.hc-search-none { padding: 40px 0 8px; text-align: center; }
.hc-search-none-icon { display: flex; justify-content: center; margin: 0 auto 12px; color: var(--muted); }
.hc-search-none > p { margin-top: 8px; font-size: 15px; color: var(--body); }
.hc-search-none > p a { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.hc-help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; text-align: left; }
.hc-help-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .hc-help-grid { grid-template-columns: minmax(0, 1fr); } }
.hc-help-grid-card { min-width: 0; padding: 18px 18px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.hc-help-grid-card h2 { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hc-help-grid-card ul { list-style: none; margin: 0; padding: 0; }
.hc-help-grid-card li + li { border-top: 1px solid var(--line-soft); }
.hc-help-grid-card a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.hc-help-grid-card a:hover { color: var(--brand-deep); }
.hc-help-grid-n { flex: none; font-size: 13px; color: var(--muted); font-weight: 600; }

/* Rail: popular articles, topics, help card (below the results under 1024px) */
.hc-rail-search { position: sticky; top: 88px; padding-top: 30px; min-width: 0; }
@media (max-width: 1023px) { .hc-rail-search { position: static; padding-top: 0; } }
.hc-rail-search h2 { margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hc-rail-search section + section { margin-top: 28px; }
.hc-rail-search-list { list-style: none; margin: 0; padding: 0; }
.hc-rail-search-list li + li { border-top: 1px solid var(--line-soft); }
.hc-rail-search-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 40px; padding: 8px 0; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.hc-rail-search-list a:hover { color: var(--brand-deep); }
.hc-rail-search-n { flex: none; font-size: 13px; color: var(--muted); }
.hc-rail-search-help { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--wash); }
.hc-rail-search-help strong { display: block; font-size: 15px; color: var(--ink); }
.hc-rail-search-help p { margin: 4px 0 12px; font-size: 14px; color: var(--body); line-height: 1.5; }
.hc-rail-search-help .hc-btn { white-space: normal; height: auto; min-height: 42px; padding: 8px 16px; text-align: left; width: 100%; justify-content: flex-start; }
.hc-rail-search-help .hc-btn + .hc-btn { margin-top: 8px; }

/* ============ "Still need help?" band (every page) ============ */
.hc-contact {
  display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; margin-top: 40px;
  padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--brand-ink) 16%, var(--bg)); border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 7%, var(--bg)), color-mix(in srgb, var(--brand) 2.5%, var(--bg)) 55%);
}
.hc-contact-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--brand-deep); box-shadow: var(--shadow-sm); }
.hc-contact-text { flex: 1 1 240px; min-width: 0; }
.hc-contact-text h2 { font-size: 19px; color: var(--ink); font-weight: 750; letter-spacing: -.3px; }
.hc-contact-text p { margin-top: 3px; font-size: 14px; color: var(--body); }
.hc-contact-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.hc-contact-actions .hc-btn { height: auto; min-height: 42px; }
@media (max-width: 700px) {
  .hc-contact-actions { margin-left: 0; width: 100%; }
  .hc-contact-actions .hc-btn { flex: 1 1 auto; }
}
@media (max-width: 480px) { .hc-contact { padding: 20px 18px; } .hc-contact-icon { display: none; } }
.hc-search .hc-contact { margin-top: 32px; }

/* ============ Typeahead popup (appended to .hc by help-search.js) ============ */
.hc-ta {
  position: fixed; z-index: 250; display: none; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 0 0; text-align: left; background: var(--card); color: var(--body);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--ink) 28%, transparent), 0 2px 6px color-mix(in srgb, var(--ink) 6%, transparent);
}
.hc-ta.is-open { display: block; }
.hc-ta-grp { padding: 10px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hc-ta [role="option"] { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px; cursor: pointer; color: var(--ink); font-size: 14.5px; line-height: 1.35; }
.hc-ta-ic { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--mint); color: var(--brand-deep); }
.hc-ta-t { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hc-ta-c { flex: none; max-width: 40%; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-ta [role="option"][aria-selected="true"], .hc-ta [role="option"]:hover { background: var(--mint-soft); }
.hc-ta [role="option"][aria-selected="true"] { box-shadow: inset 3px 0 0 var(--brand-deep); }
.hc-ta [role="option"].hc-ta-all { margin-top: 6px; border-top: 1px solid var(--line-soft); color: var(--brand-deep); font-weight: 650; }
.hc-ta-empty { padding: 12px 14px; font-size: 14px; color: var(--muted); }
.hc-ta-foot { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; padding: 8px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.hc-ta-foot .hc-kbd { margin: 0 2px 0 0; }
@media (pointer: coarse) { .hc-ta-foot { display: none; } }
.hc-ta mark.hc-hl { background: transparent; color: inherit; font-weight: 750; padding: 0; }

@media print {
  .hc-contact, .hc-rail-search, .hc-filters, .hc-ta { display: none !important; }
  .hc-search-layout { display: block; padding: 0; }
}
