/* ================================================================
   help.css — help page
   ================================================================
   Phone-first. FAQ accordion preserved. No borders on cards —
   separation via box-shadow: inset only.
   ================================================================ */

.page-help .main-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: none;
}

/* ----------------------------------------------------------------
   Search
   ---------------------------------------------------------------- */

.help-search-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.help-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 620px;
}

.help-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.help-search-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 38px 8px 36px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--duration-fast) var(--ease),
    outline-color var(--duration-fast) var(--ease);
}

.help-search-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.help-search-input:hover {
  background: var(--bg-elevated);
}

.help-search-input:focus {
  outline: none;
  background: var(--bg-elevated);
}

.help-search-input:focus-visible {
  outline: var(--focus-ring-width) solid var(--accent);
  outline-offset: 2px;
}

.help-search-input::-webkit-search-cancel-button {
  display: none;
}

.help-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.help-search-clear:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.help-search-clear svg {
  width: 12px;
  height: 12px;
}

.help-search-clear[hidden] {
  display: none;
}

.help-search-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-height: 1.2em;
}

.help-search-status.has-results {
  color: var(--text-secondary);
}

.help-search-status.no-results {
  color: var(--warning);
}

/* ----------------------------------------------------------------
   Sections
   ---------------------------------------------------------------- */

.help-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.help-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.help-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: var(--leading-snug);
}

.help-section-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Feature cards
   ---------------------------------------------------------------- */

.help-feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .help-feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

@media (min-width: 900px) {
  .help-feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.help-feature-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .help-feature-card {
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    gap: var(--space-3);
  }
}

.help-feature-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.help-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent);
  flex-shrink: 0;
}

.help-feature-icon svg {
  width: 16px;
  height: 16px;
}

.help-feature-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: var(--leading-snug);
  margin: 0;
}

.help-feature-card p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ----------------------------------------------------------------
   FAQ toolbar
   ---------------------------------------------------------------- */

.help-faq-toolbar {
  display: inline-flex;
  gap: 4px;
}

.help-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 var(--space-2);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.help-toolbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.help-toolbar-btn svg {
  width: 12px;
  height: 12px;
}

/* ----------------------------------------------------------------
   FAQ
   ---------------------------------------------------------------- */

.help-faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.help-faq-loading {
  padding: var(--space-4) var(--space-3);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
}

.help-faq-category {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.help-faq-category[hidden] {
  display: none;
}

.help-faq-category-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding-left: 2px;
}

.help-faq-category-title svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.help-faq-count {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-left: auto;
}

.help-qa {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-fast) var(--ease);
}

.help-qa:hover {
  box-shadow: var(--shadow-md);
}

.help-qa[hidden] {
  display: none;
}

.help-qa-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  cursor: pointer;
  list-style: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  min-height: 44px;
  transition: color var(--duration-fast) var(--ease);
}

.help-qa-summary::-webkit-details-marker {
  display: none;
}

.help-qa-summary:hover {
  color: var(--accent);
}

.help-qa-summary:focus-visible {
  outline: var(--focus-ring-width) solid var(--accent);
  outline-offset: -2px;
}

.help-qa-caret {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  transition:
    transform var(--duration-base) var(--ease),
    color var(--duration-base) var(--ease);
}

.help-qa[open] .help-qa-caret {
  transform: rotate(90deg);
  color: var(--accent);
}

.help-qa-question {
  flex: 1;
  min-width: 0;
}

.help-qa-answer {
  padding: 0 var(--space-3) var(--space-3) calc(var(--space-3) + 12px + var(--space-2));
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.help-qa-answer p {
  margin: 0 0 var(--space-2);
}

.help-qa-answer p:last-child {
  margin-bottom: 0;
}

.help-qa-answer strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.help-qa-answer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.help-qa-answer ul,
.help-qa-answer ol {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: disc;
}

.help-qa-answer li {
  line-height: var(--leading-snug);
}

.help-faq-empty {
  padding: var(--space-4);
  text-align: center;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  line-height: var(--leading-relaxed);
}

/* ----------------------------------------------------------------
   Glossary
   ---------------------------------------------------------------- */

.help-glossary {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .help-glossary {
    border-radius: var(--radius-lg);
    padding: var(--space-4);
  }
}

.help-glossary dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.help-glossary-item {
  padding: var(--space-2) 0;
  box-shadow: inset 0 -1px 0 var(--divider);
}

.help-glossary-item:first-child {
  padding-top: 0;
}

.help-glossary-item:last-child {
  box-shadow: none;
  padding-bottom: 0;
}

.help-glossary dt {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  margin: 0 0 2px;
}

.help-glossary dd {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ----------------------------------------------------------------
   Responsive + reduced motion
   ---------------------------------------------------------------- */

@media (max-width: 640px) {
  .help-search {
    max-width: 100%;
  }

  .help-search-input {
    min-height: 44px;
    font-size: var(--text-md);
  }

  .help-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .help-faq-toolbar {
    align-self: flex-start;
  }

  .help-qa-summary {
    padding: var(--space-2);
    font-size: var(--text-sm);
  }

  .help-qa-answer {
    padding: 0 var(--space-2) var(--space-2) calc(var(--space-2) + 12px + var(--space-2));
  }

  .help-glossary {
    padding: var(--space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-search-input,
  .help-search-clear,
  .help-feature-card,
  .help-toolbar-btn,
  .help-qa,
  .help-qa-summary,
  .help-qa-caret {
    transition-duration: 0.01ms !important;
  }
}