/* Help Center (/help/ and help articles) and the inside of the Ask ED panel: search, popular
   articles and the guided chat. Loaded by partials/help-page.hbs and custom-help-article.hbs, and
   by assets/js/ask-ed.js on the panel's first open. The floating button and the panel frame live
   in editorial.css (they're on every page). Uses the shared tokens from design-system.css. */

.hc { --hc-width: 1120px; --hc-pad: clamp(16px, 4vw, 32px); }
.hc a { color: inherit; }
.help-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.hc :is(a, button, input):focus-visible,
.ask-ed-body :is(a, button, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Hero: the question and the search box ─────────────────────────────── */
.hc-hero { position: relative; overflow: hidden; padding: 28px var(--hc-pad) 120px; border-bottom: 1px solid var(--border); background:
  radial-gradient(60% 120% at 85% 0%, rgb(83 214 209 / 14%), transparent 60%),
  radial-gradient(40% 90% at 0% 100%, rgb(83 214 209 / 7%), transparent 70%), var(--surface); }
.hc-hero-inner { max-width: var(--hc-width); margin: 0 auto; text-align: center; }
.hc-hero .breadcrumb { justify-content: center; text-align: center; margin-bottom: 28px; }
.hc-kicker { display: block; margin-bottom: 12px; color: var(--accent); font: 500 11px/1.4 var(--font-mono); letter-spacing: 1.6px; text-transform: uppercase; }
.hc-hero h1 { margin: 0 0 14px; color: var(--text); font: 680 clamp(36px, 5.4vw, 64px)/1.04 var(--gh-font-heading) !important; letter-spacing: -0.02em; }
.hc-lede { max-width: 620px; margin: 0 auto 28px; color: var(--text-muted); font: 16px/1.65 var(--gh-font-body); }

/* Search box (also small, in the article bar) */
.hc-search { position: relative; display: flex; align-items: center; max-width: 680px; margin: 0 auto; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); box-shadow: 0 18px 50px -24px rgb(0 0 0 / 90%); }
.hc-search:focus-within { border-color: var(--accent); }
.hc-search-icon { position: absolute; left: 20px; color: var(--text-muted); pointer-events: none; }
.hc-search input { flex: 1; min-width: 0; min-height: 58px; padding: 0 12px 0 52px; border: 0; background: none; color: var(--text); font: 16px/1.4 var(--gh-font-body); outline: none; }
.hc-search input::placeholder { color: var(--text-dim); }
.hc-search input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.hc-search button { flex: none; min-height: 44px; margin: 7px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: var(--bg); font: 650 14px var(--gh-font-body); cursor: pointer; }
.hc-search button:hover { background: var(--accent-soft); }
.hc-search-small { max-width: 340px; margin: 0; box-shadow: none; }
.hc-search-small input { min-height: 42px; padding-left: 42px; font-size: 15px; }
.hc-search-small .hc-search-icon { left: 14px; }
.hc-search-small button { min-height: 32px; margin: 5px; padding: 0 14px; font-size: 13px; }

/* ── Section cards, overlapping the hero ───────────────────────────────── */
.hc-body { max-width: var(--hc-width); margin: 0 auto; padding: 0 var(--hc-pad); }
.hc-cards { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: -84px 0 0; padding: 0; list-style: none; }
.hc-cards[hidden] { display: none; }
.hc-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 20px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); box-shadow: 0 24px 50px -30px rgb(0 0 0 / 90%); transition: border-color .15s ease, transform .15s ease; }
.hc-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.hc-card:focus-within { border-color: var(--accent); }
.hc-card-icon { color: var(--accent); }
.hc-card-title { margin: 4px 0 0; font: 650 18px/1.25 var(--gh-font-heading); }
.hc-card-title a { text-decoration: none; }
.hc-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; } /* whole card is the link */
.hc-card-title a:focus-visible { outline: none; }
.hc-card p { flex: 1; margin: 0; color: var(--text-muted); font: 14px/1.55 var(--gh-font-body); }
.hc-card-cta { align-self: flex-start; margin-top: 6px; color: var(--accent); font: 500 11px/1.4 var(--font-mono); letter-spacing: 1.4px; text-transform: uppercase; }
.hc-card-cta::after { content: " →"; }

/* ── Popular articles and the section lists ────────────────────────────── */
.hc-browse[hidden] { display: none; }
.hc-browse h2, .hc-results h2 { margin: 0 0 16px; color: var(--text); font: 650 24px/1.2 var(--gh-font-heading); }
.hc-popular { margin: 56px 0 8px; }
.hc-popular-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; }
.hc-popular-list li { border-top: 1px solid var(--border); }
.hc-popular-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 2px; color: var(--text); font: 600 15.5px/1.4 var(--gh-font-body); text-decoration: none; }
.hc-popular-list a::after { content: "›"; margin-left: auto; color: var(--accent); font-size: 20px; }
.hc-popular-list a:hover { color: var(--accent); }
.hc-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 48px; margin-top: 48px; }
.hc-section { scroll-margin-top: 96px; padding-top: 24px; border-top: 2px solid var(--accent); }
.hc-section h2 { font-size: 20px; }
.hc-list { margin: 0 0 32px; padding: 0; list-style: none; }
.hc-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.hc-list-title { color: var(--text); font: 600 15.5px/1.4 var(--gh-font-body); text-decoration: none; }
.hc-list-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.hc-list-excerpt { margin: 4px 0 0; color: var(--text-muted); font: 14px/1.55 var(--gh-font-body); }
.hc-empty { margin: 0 0 32px; color: var(--text-muted); font: 14px/1.6 var(--gh-font-body); }
.hc-notes { max-width: 720px; margin: 24px 0 0; padding-top: 24px; border-top: 1px solid var(--border); }

/* ── Search results ────────────────────────────────────────────────────── */
.hc-results { margin: 48px 0 0; }
.hc-results[hidden] { display: none; }
.hc-results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 20px; }
.hc-results-head h2 { margin: 0; outline: none; }
.hc-clear { color: var(--text-muted); font: 14px var(--gh-font-body); text-decoration: underline; text-underline-offset: 3px; }
.hc-clear:hover { color: var(--text); }
.hc-results-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.hc-filter { position: sticky; top: 96px; }
.hc-filter ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hc-filter-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: none; color: var(--text); font: 14px/1.3 var(--gh-font-body); text-align: left; cursor: pointer; }
.hc-filter-btn:hover { border-color: var(--border-strong); background: var(--surface); }
.hc-filter-btn[aria-pressed=true] { border-color: var(--accent); background: var(--accent-dim); font-weight: 600; }
.hc-filter-count { color: var(--accent); font: 500 12px var(--font-mono); }
.hc-hits { margin: 0; padding: 0; list-style: none; }
.hc-hit { padding: 20px 0; border-bottom: 1px solid var(--border); }
.hc-hit:first-child { padding-top: 0; }
.hc-hit h3 { margin: 0; font: 650 18px/1.35 var(--gh-font-heading); }
.hc-hit-title { text-decoration: none; }
.hc-hit-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.hc-hit-crumb { display: flex; gap: 6px; margin: 4px 0 8px; color: var(--accent); font: 12.5px/1.4 var(--gh-font-body); }
.hc-hit-snippet { margin: 0 0 8px; color: var(--text-muted); font: 14.5px/1.6 var(--gh-font-body); }
.hc-hit-snippet mark, .ae-item-snippet mark { padding: 0 1px; border-radius: 2px; background: rgb(83 214 209 / 22%); color: var(--text); font-style: italic; }
.hc-hit-more { color: var(--accent); font: 500 11px/1.4 var(--font-mono); letter-spacing: 1.3px; text-transform: uppercase; text-decoration: none; }
.hc-hit-more::after { content: " ›"; }
.hc-hit-more:hover { text-decoration: underline; }
.hc-hit-note { margin-bottom: 16px; color: var(--text-muted); font: 13.5px/1.5 var(--gh-font-body); }
.hc-hit-empty p { margin: 0 0 12px; color: var(--text-muted); font: 15px/1.6 var(--gh-font-body); }

/* ── Article page ──────────────────────────────────────────────────────── */
.hc-bar { border-bottom: 1px solid var(--border); background: var(--surface); }
.hc-bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: var(--hc-width); margin: 0 auto; padding: 14px var(--hc-pad); }
.hc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--text-muted); font: 13.5px/1.4 var(--gh-font-body); }
.hc-crumbs a { color: var(--accent); text-decoration: none; }
.hc-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hc-crumb-sep { color: var(--text-dim); }
.hc-article-layout { display: grid; grid-template-columns: minmax(0, 700px) 260px; justify-content: space-between; gap: 56px; max-width: var(--hc-width); margin: 0 auto; padding: 44px var(--hc-pad) 72px; }
.hc-article h1 { margin: 0 0 10px; color: var(--text); font: 680 clamp(30px, 4vw, 44px)/1.1 var(--gh-font-heading) !important; letter-spacing: -0.015em; }
.hc-updated { margin: 0 0 28px; color: var(--text-dim); font: 500 11px/1.4 var(--font-mono); letter-spacing: 1.2px; text-transform: uppercase; }
.hc-article-body { color: var(--text); font: 17px/1.75 var(--gh-font-body); }
.hc-article-body > * { margin: 0 0 18px; }
.hc-article-body h2 { margin: 34px 0 12px; font: 650 22px/1.3 var(--gh-font-heading); }
.hc-article-body h3 { margin: 26px 0 10px; font: 650 18px/1.35 var(--gh-font-heading); }
.hc-article-body ul, .hc-article-body ol { padding-left: 22px; }
.hc-article-body li + li { margin-top: 6px; }
.hc-article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.hc-article-body strong { color: var(--text); font-weight: 650; }
.hc-article-body code { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); font: 0.9em var(--font-mono); }
.hc-helpful { margin-top: 44px; padding: 20px 22px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.hc-helpful-q { margin: 0 0 12px; color: var(--text); font: 600 16px var(--gh-font-body); }
.hc-helpful-actions { display: flex; gap: 10px; }
.hc-helpful-actions button { min-width: 84px; min-height: 42px; padding: 8px 18px; border: 1px solid var(--border-strong); border-radius: 999px; background: none; color: var(--text); font: 600 14px var(--gh-font-body); cursor: pointer; }
.hc-helpful-actions button:hover { border-color: var(--accent); }
.hc-helpful-actions button[aria-pressed=true] { border-color: var(--accent); background: var(--accent-dim); }
.hc-helpful-reply:not(:empty) { margin-top: 14px; }
.hc-helpful-reply p { margin: 0 0 12px; color: var(--text-muted); font: 14.5px/1.6 var(--gh-font-body); }
.hc-side { position: sticky; top: 96px; padding-top: 6px; }
.hc-side-title { margin: 0 0 12px; color: var(--text-muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase; }
.hc-side-list { margin: 0 0 20px; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.hc-side-list li { border-bottom: 1px solid var(--border); }
.hc-side-list a { display: block; padding: 11px 0; color: var(--text); font: 14.5px/1.45 var(--gh-font-body); text-decoration: none; }
.hc-side-list a:hover { color: var(--accent); }
.hc-side-all { margin: 0; }
.hc-side-all a { color: var(--accent); font: 14px var(--gh-font-body); text-decoration: none; }
.hc-side-all a:hover { text-decoration: underline; }

/* ── "Didn't find what you're looking for?" ────────────────────────────── */
.hc-contact { margin-top: 72px; padding: 52px var(--hc-pad) 60px; border-top: 1px solid var(--border); background: var(--surface-2); text-align: center; }
.hc-article-page .hc-contact { margin-top: 0; }
.hc-contact-inner { max-width: 560px; margin: 0 auto; }
.hc-contact h2 { margin: 0 0 10px; color: var(--text); font: 650 24px/1.25 var(--gh-font-heading); }
.hc-contact p { margin: 0 0 22px; color: var(--text-muted); font: 15px/1.6 var(--gh-font-body); }
.hc-contact-button { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--accent); color: var(--bg) !important; font: 650 15px var(--gh-font-body); text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
.hc-contact-button:hover { background: var(--accent-soft); }
.hc-contact-button:active { transform: scale(.97); }
.hc-contact-small { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* ── Ask ED panel: home view (search + popular) ────────────────────────── */
.ae-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ae-view[hidden] { display: none; }
.ae-search { position: relative; flex: none; display: flex; align-items: center; margin: 14px 14px 4px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); }
.ae-search:focus-within { border-color: var(--accent); }
.ae-search svg { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.ae-search input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px 0 42px; border: 0; background: none; color: var(--text); font: 16px/1.4 var(--gh-font-body); outline: none; }
.ae-search input::placeholder { color: var(--text-dim); }
.ae-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 14px; }
.ae-label { margin: 6px 2px 8px; color: var(--text-muted); font: 500 10.5px/1.4 var(--font-mono); letter-spacing: 1.4px; text-transform: uppercase; }
.ae-list { margin: 0; padding: 0; list-style: none; }
.ae-item { display: flex; flex-direction: column; gap: 3px; padding: 11px 10px; border-radius: 8px; text-decoration: none; }
.ae-item:hover { background: var(--surface-2); }
.ae-item-title { color: var(--text); font: 600 14.5px/1.4 var(--gh-font-body); }
.ae-item-cat { color: var(--accent); font: 12px/1.3 var(--gh-font-body); }
.ae-item-snippet { color: var(--text-muted); font: 13px/1.5 var(--gh-font-body); }
.ae-note { margin: 8px 2px; color: var(--text-muted); font: 13px/1.5 var(--gh-font-body); }
.ae-browse { display: inline-block; margin: 12px 2px 0; color: var(--accent); font: 13.5px var(--gh-font-body); text-decoration: none; }
.ae-browse:hover { text-decoration: underline; }
.ae-contact { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface-2); }
.ae-contact p { margin: 0; color: var(--text); font: 600 14px/1.35 var(--gh-font-body); }
.ae-contact-button { flex: none; min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--bg); font: 650 14px var(--gh-font-body); cursor: pointer; }
.ae-contact-button:hover { background: var(--accent-soft); }

/* ── Guided chat ───────────────────────────────────────────────────────── */
.hchat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hchat-disclosure { flex: none; margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); font: 12px/1.5 var(--gh-font-body); }
.hchat-log { flex: 1; min-height: 80px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; }
.hchat-msg { max-width: 90%; }
.hchat-me { align-self: flex-end; }
.hchat-who { display: block; margin-bottom: 4px; color: var(--text-muted); font: 500 10px/1.4 var(--font-mono); letter-spacing: 1px; text-transform: uppercase; }
.hchat-me .hchat-who { text-align: right; }
.hchat-bubble { padding: 11px 13px; border-radius: 10px; color: var(--text); font: 14.5px/1.55 var(--gh-font-body); overflow-wrap: anywhere; }
.hchat-bot .hchat-bubble { border-top-left-radius: 3px; background: var(--surface-2); border-left: 2px solid var(--accent); }
.hchat-me .hchat-bubble { border-top-right-radius: 3px; background: var(--accent-dim); border: 1px solid var(--border-strong); }
.hchat-bubble p { margin: 0; }
.hchat-bubble > * + * { margin-top: 8px; }
.hchat-links { margin: 10px 0 0; padding: 0; list-style: none; }
.hchat-links li + li { margin-top: 4px; }
.hchat-links a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hchat-links a::after { content: " →"; text-decoration: none; }
.hchat-rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 10px 0 0; font-size: 13.5px; }
.hchat-rows dt { color: var(--text-muted); }
.hchat-rows dd { margin: 0; }
.hchat-ticket { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 8px; background: var(--bg); }
.hchat-ticket-label { color: var(--text-muted); font: 500 10px/1.4 var(--font-mono); letter-spacing: 1.3px; text-transform: uppercase; }
.hchat-ticket-number { color: var(--accent); font: 700 28px/1.15 var(--font-mono); letter-spacing: .02em; }
.hchat-typing .hchat-bubble { padding: 14px 16px; }
.hchat-dots { display: inline-flex; gap: 5px; }
.hchat-dots::before, .hchat-dots::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: hchat-blink 1.1s ease-in-out infinite; }
.hchat-dots::after { animation-delay: .3s; }
@keyframes hchat-blink { 50% { opacity: .25; } }
.hchat-dock { flex: none; max-height: 60%; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); }
.hchat-dock:empty { display: none; }
.hchat-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.hchat-choice { min-height: 40px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 999px; background: none; color: var(--text); font: 600 13.5px/1.3 var(--gh-font-body); text-align: left; cursor: pointer; transition: background-color .12s ease; }
.hchat-choice:hover { background: var(--accent-dim); }
.hchat-choice-quiet { border-color: var(--border-strong); color: var(--text-muted); font-weight: 500; }
.hchat-choice-quiet:hover { border-color: var(--text-muted); background: none; color: var(--text); }
.hchat-form { display: flex; flex-direction: column; gap: 12px; }
.hchat-field { display: flex; flex-direction: column; gap: 5px; color: var(--text); font: 600 13px/1.4 var(--gh-font-body); }
.hchat-field input, .hchat-field textarea { width: 100%; min-height: 44px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--gh-font-body); }
.hchat-field textarea { min-height: 76px; resize: vertical; }
.hchat-field :is(input, textarea):focus { border-color: var(--accent); outline: none; }
.hchat-check { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); font: 12.5px/1.5 var(--gh-font-body); }
.hchat-check input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); }
.hchat-check a { color: var(--text); text-decoration: underline; }
.hchat-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hchat-send { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: var(--bg); font: 650 14px var(--gh-font-body); cursor: pointer; }
.hchat-send:hover { background: var(--accent-soft); }
.hchat-send:disabled { opacity: .55; cursor: wait; }
.hchat-error { min-height: 0; margin: 0; color: var(--text); font: 13.5px/1.5 var(--gh-font-body); }
.hchat-error:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hc-card, .hc-contact-button, .hchat-choice { transition: none; }
  .hc-card:hover { transform: none; }
  .hchat-dots::before, .hchat-dots::after { animation: none; }
}
@media (max-width: 1000px) {
  .hc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hc-article-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hc-side { position: static; }
}
@media (max-width: 760px) {
  .hc-hero { padding-bottom: 84px; }
  .hc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -56px; gap: 10px; }
  .hc-card { padding: 16px 14px; }
  .hc-card p { display: none; }
  .hc-popular-list, .hc-sections { grid-template-columns: minmax(0, 1fr); }
  .hc-results-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hc-filter { position: static; }
  .hc-filter ul { flex-direction: row; flex-wrap: wrap; }
  .hc-filter-btn { width: auto; min-height: 38px; }
  .hc-bar-inner { flex-direction: column; align-items: stretch; }
  .hc-search-small { max-width: none; }
}
@media (max-width: 420px) {
  .hc-search button { padding: 0 16px; }
  .hc-search input { padding-left: 46px; }
  .hc-search-icon { left: 16px; }
}
@media print { .hc-contact, .hc-helpful, .hc-bar .hc-search { display: none; } }
