/* ==========================================================================
   Vela — support page (help centre)
   Builds on vela.css: page hero, cards, docs layout, FAQ.
   ========================================================================== */

/* ---- Hero search ---------------------------------------------------------- */
.help-hero .lead { max-width: 30em; }
.help-search { position: relative; max-width: 640px; margin-top: clamp(26px, 4vw, 36px); }
.help-search input {
  width: 100%; min-height: 60px; padding: 0 58px 0 54px; border-radius: 999px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--text); font: 17px/1.3 var(--font-text);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s, box-shadow 0.25s, background-color 0.2s;
}
.help-search input::placeholder { color: var(--text-3); opacity: 1; }
.help-search input::-webkit-search-cancel-button,
.help-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.help-search input:focus { outline: none; border-color: var(--accent); background: var(--bg-2); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18), 0 24px 60px -34px rgba(0, 0, 0, 0.7); }
.help-search-icon { position: absolute; left: 21px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; transition: color 0.2s; }
.help-search:focus-within .help-search-icon { color: var(--accent); }
.help-key { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.help-search.has-value .help-key, .help-search:focus-within .help-key { opacity: 0; }
.help-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: transparent; color: var(--text-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.help-clear[hidden] { display: none; }
.help-clear:hover { color: var(--text); background: var(--surface-2); }
.help-clear .icon { width: 18px; height: 18px; }
@media (pointer: coarse) { .help-key { display: none; } }

.help-status { min-height: 1.6em; margin-top: 12px; padding-left: 4px; font: 500 12.5px/1.6 var(--font-mono); letter-spacing: 0.02em; color: var(--text-3); }
.help-status b { color: var(--text); font-weight: 600; }
.help-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.help-popular > span { margin-right: 4px; font: 600 11px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.help-popular .chip {
  min-height: 38px; padding: 0 15px; cursor: pointer; font-size: 12px; color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.25s var(--spring);
  -webkit-tap-highlight-color: transparent;
}
.help-popular .chip:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.55); }
.help-popular .chip:active { transform: scale(0.96); }
.help-popular .chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
@media (pointer: coarse) { .help-popular .chip { min-height: 44px; } }
html:not(.js) .help-popular, html:not(.js) .help-key { display: none; }

/* ---- Quick help cards ------------------------------------------------------ */
.help-cards { padding-bottom: clamp(52px, 8vw, 96px); }
.help-card {
  display: block; color: var(--text); text-decoration: none;
  transition: border-color 0.25s, background-color 0.25s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.help-card:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.45); background: var(--surface-2); transform: translateY(-3px); box-shadow: 0 24px 50px -30px var(--glow); }
.help-card:active { transform: scale(0.985); }
.help-card:focus-visible { border-radius: var(--radius); outline-offset: 2px; }
.help-card h3 { margin-bottom: 6px; }
.help-card-arrow { position: absolute; top: clamp(22px, 3vw, 32px); right: clamp(22px, 3vw, 32px); width: 20px; height: 20px; color: var(--text-3); transition: transform 0.25s var(--ease), color 0.2s; }
.help-card:hover .help-card-arrow { color: var(--accent); transform: translateX(3px); }
@media (max-width: 639px) {
  .help-card-arrow { top: 18px; right: 16px; width: 18px; height: 18px; }
  .help-cards .grid-4 .card p { font-size: 14px; }
}
.is-searching .help-cards { display: none; }

/* ---- Help centre: topics nav ---------------------------------------------- */
.help-docs { scroll-margin-top: var(--nav-h); }
.help-nav a { display: flex; align-items: center; gap: 10px; }
.help-nav a .icon { width: 17px; height: 17px; color: var(--text-3); transition: color 0.2s; }
.help-nav a:hover .icon, .help-nav a.is-active .icon { color: var(--accent); }
.help-nav .n { margin-left: auto; min-width: 26px; padding: 3px 7px; border-radius: 99px; background: var(--surface-2); font: 600 11px/1 var(--font-mono); color: var(--text-3); text-align: center; }
.help-nav a.is-active .n { color: var(--accent); background: rgba(var(--accent-rgb), 0.14); }
.help-nav li[hidden] { display: none; }
.help-nav .nav-contact { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

@media (min-width: 1000px) {
  .help-nav > div { padding-bottom: 12px; }
  .help-nav .group:first-child { padding-top: 0; }
}

/* Phones and tablets: a sticky row of topic pills under the navigation */
@media (max-width: 999px) {
  html { scroll-padding-top: calc(var(--nav-h) + 78px); }
  .help-docs { display: block; }
  .help-nav {
    position: sticky; top: var(--nav-h); z-index: 30;
    margin: 0 calc(var(--gutter) * -1) clamp(28px, 6vw, 44px); padding: 10px 0;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(20px); backdrop-filter: saturate(160%) blur(20px);
    border-block: 1px solid var(--line);
  }
  .help-nav .group, .help-nav .nav-more { display: none; }
  .help-nav ul {
    position: relative; display: flex; gap: 8px; margin: 0; padding: 0 var(--gutter);
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .help-nav ul::-webkit-scrollbar { display: none; }
  .help-nav li { flex: none; }
  .help-nav .nav-contact { margin: 0; padding: 0; border: 0; }
  .help-nav a {
    min-height: 44px; padding: 0 8px 0 16px; gap: 8px; border-radius: 999px;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
    font-size: 14.5px; font-weight: 500; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  }
  .help-nav a .icon { display: none; }
  .help-nav .nav-contact a { padding-right: 16px; }
  .help-nav a:hover { background: var(--surface-2); }
  .help-nav a.is-active { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
  .help-nav a.is-active .n { color: var(--accent-ink); background: rgba(255, 255, 255, 0.28); }
  :root[data-theme="light"] .help-nav a.is-active .n, :root[data-theme="sand"] .help-nav a.is-active .n,
  :root[data-theme="midnight"] .help-nav a.is-active .n { background: rgba(255, 255, 255, 0.22); }
  .help-nav .n { min-width: 28px; padding: 5px 8px; }
}

/* ---- Help centre: topics --------------------------------------------------- */
.help-docs .docs-main { max-width: 860px; }
.topic + .topic { margin-top: clamp(64px, 9vw, 104px); }
.topic[hidden] { display: none; }
.topic-head { display: grid; gap: 12px; margin-bottom: clamp(22px, 3vw, 30px); }
.topic-tag { display: flex; align-items: center; gap: 12px; }
.topic-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  color: var(--accent); background: rgba(var(--accent-rgb), 0.12); border: 1px solid rgba(var(--accent-rgb), 0.22);
}
.topic-icon .icon { width: 21px; height: 21px; }
.topic-meta { font: 600 11.5px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.topic-head h2 { font-size: clamp(32px, 4.6vw, 50px); letter-spacing: -0.035em; line-height: 1.02; margin-top: 6px; }
.topic-head p { color: var(--text-2); max-width: 38em; }
.topic-head .text-link { justify-self: start; min-height: 44px; }
.is-searching .topic + .topic { margin-top: 48px; }
.is-searching .topic-head p, .is-searching .topic-head .text-link { display: none; }
.is-searching .topic-head h2 { font-size: clamp(26px, 3.4vw, 34px); }

/* FAQ answers */
.help-docs .faq details[hidden] { display: none; }
.help-docs .faq summary { min-height: 64px; padding-top: 18px; padding-bottom: 18px; }
.help-docs .faq summary:focus-visible { outline-offset: -2px; border-radius: 18px; }
.help-docs .faq details { scroll-margin-top: calc(var(--nav-h) + 20px); }
@media (max-width: 999px) { .help-docs .faq details { scroll-margin-top: calc(var(--nav-h) + 78px); } }
.help-docs .faq details:target { border-color: rgba(var(--accent-rgb), 0.55); }
.help-docs .faq mark { background: rgba(var(--accent-rgb), 0.22); color: inherit; border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.faq-body { overflow-wrap: anywhere; line-height: 1.65; }
.faq-body > * + * { margin-top: 12px; }
.faq-body ul { margin: 0; padding-left: 1.25em; display: grid; gap: 8px; }
.faq-body ul ul { margin-top: 8px; gap: 6px; }
.faq-body li::marker { color: var(--accent); }
.faq-body strong { color: var(--text); font-weight: 600; }
.faq-body a { color: var(--accent); }
.faq-body code {
  font-size: 0.86em; padding: 0.12em 0.45em; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
@media (max-width: 639px) {
  .help-docs .faq summary { padding-left: 18px; padding-right: 16px; font-size: 16.5px; }
  .help-docs .faq details > div { padding: 0 18px 18px; }
}

/* Keys */
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 7px;
  border-radius: 7px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface-2);
  font: 600 12.5px/1 var(--font-mono); color: var(--text); white-space: nowrap;
}
.faq-body kbd { min-width: 24px; height: 23px; padding: 0 6px; font-size: 11.5px; vertical-align: 1px; margin: 0 1px; }
.help-key { min-width: 26px; height: 26px; color: var(--text-3); }

/* Keyboard shortcuts */
/* Rows are divided by top borders; the first row's border hides under the panel's edge. */
.keys-panel { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; padding: 0 clamp(18px, 3vw, 28px); }
.keys { list-style: none; margin: -1px 0 0; padding: 0; display: grid; }
@media (min-width: 720px) { .keys { grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 4vw, 48px); } }
.keys li { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--line); }
.keys li[hidden] { display: none; }
.keys li > span:first-child { color: var(--text); font-weight: 500; }
.kbds { display: inline-flex; gap: 5px; flex: none; }
.keys-note { margin-top: 14px; font-size: 14px; color: var(--text-3); }
.keys-note kbd { min-width: 22px; height: 22px; padding: 0 5px; font-size: 11px; vertical-align: 1px; }
.is-searching .keys-note { display: none; }

/* No results */
.help-empty { display: grid; justify-items: start; gap: 12px; margin-bottom: 24px; }
.help-empty[hidden] { display: none; }
.help-empty-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--accent); background: rgba(var(--accent-rgb), 0.12); border: 1px solid rgba(var(--accent-rgb), 0.22); }
.help-empty-icon .icon { width: 22px; height: 22px; }
.help-empty h3 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.help-empty p { color: var(--text-2); }
.help-empty a { color: var(--accent); }
.help-empty .btn { margin-top: 4px; }

/* ---- Still need help? ------------------------------------------------------ */
.help-contact { overflow: hidden; padding-top: clamp(40px, 6vw, 80px); }
.help-contact .glow { width: 900px; height: 640px; max-width: 160vw; left: 50%; top: 46%; transform: translate(-50%, -50%); opacity: 0.75; }
.help-contact .wrap { position: relative; }
.contact-mark {
  width: 68px; height: 68px; border-radius: 21px; margin: 0 auto 26px; display: grid; place-items: center;
  color: var(--accent-ink); background: var(--accent); box-shadow: 0 22px 54px -16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.contact-mark .icon { width: 30px; height: 30px; }
.help-contact h2 { margin: 16px 0 18px; }
.help-contact .btn-row { margin-top: 32px; }
.help-contact .btn-primary { max-width: 100%; }
.contact-note { margin-top: 18px; font: 500 13px/1.6 var(--font-mono); color: var(--text-3); }
.report-tips { margin-top: clamp(44px, 6vw, 64px); text-align: left; }
.report-tips h3 { font: 600 11.5px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); text-align: center; margin-bottom: 16px; }
.help-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .help-steps { grid-template-columns: repeat(3, 1fr); } }
.help-steps li { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 6px; align-content: start; }
.help-steps b { font: 600 12px/1 var(--font-mono); letter-spacing: 0.08em; color: var(--accent); }
.help-steps span { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.report-tips .fine { margin-top: 16px; text-align: center; font-size: 14px; color: var(--text-2); }
.report-tips .fine strong { color: var(--text); font-weight: 600; }
@media (max-width: 479px) {
  .help-contact .btn-row { display: grid; }
  .help-contact .btn-row .btn { width: 100%; }
}
