/* Help & guide page. Follows the chosen appearance like the chat does. */
:root:has(.help-page) {
  --help-bg: #f6f7f5;
  --help-card: #fff;
  --help-ink: #22302a;
  --help-muted: #6b756f;
  --help-line: #e3e7e2;
  --help-accent: #2f7a52;
  --help-accent-soft: #e5f2ea;
  --help-kbd: #f1f3f1;
  background: var(--help-bg);
}
:root[data-theme='dark']:has(.help-page) {
  --help-bg: #121516;
  --help-card: #1b1f20;
  --help-ink: #e7ebe9;
  --help-muted: #9aa3a0;
  --help-line: #2c3234;
  --help-accent: #5fd08f;
  --help-accent-soft: #1f2d26;
  --help-kbd: #262b2d;
  color-scheme: dark;
}
.help-page {
  min-height: 100vh;
  color: var(--help-ink);
  background: var(--help-bg);
}
.help-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.help-header {
  position: sticky;
  top: var(--notice-height);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--help-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--help-line);
}
.help-brand img {
  display: block;
  height: 34px;
  width: auto;
}
.help-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.help-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--help-line);
  border-radius: 999px;
  background: var(--help-card);
  color: var(--help-ink);
  font-weight: 550;
  cursor: pointer;
}
.help-back:hover {
  border-color: var(--help-accent);
  color: var(--help-accent);
}
:root[dir='ltr'] .help-back svg {
  transform: scaleX(-1);
}
.help-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) 16px 24px;
  text-align: center;
}
.help-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--help-accent-soft);
  color: var(--help-accent);
  font-size: 13px;
  font-weight: 650;
}
.help-hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.2;
  font-weight: 800;
}
.help-hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--help-muted);
  font-size: 16px;
  line-height: 1.6;
}
.help-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 26px auto 0;
  padding: 0 16px;
  border: 1px solid var(--help-line);
  border-radius: 14px;
  background: var(--help-card);
  color: var(--help-muted);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.05);
}
.help-search:focus-within {
  border-color: var(--help-accent);
}
.help-search input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--help-ink);
  font-size: 16px;
}
.help-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 40px) 64px;
}
.help-toc {
  position: sticky;
  top: calc(var(--notice-height) + 84px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.help-toc strong {
  margin-bottom: 8px;
  color: var(--help-muted);
  font-size: 13px;
}
.help-toc a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--help-ink);
  text-decoration: none;
  font-size: 14.5px;
}
.help-toc a:hover {
  background: var(--help-accent-soft);
  color: var(--help-accent);
}
.help-content h2 {
  margin: 8px 0 18px;
  font-size: 24px;
  font-weight: 750;
  scroll-margin-top: 90px;
}
.help-content h2 + .help-faq {
  margin-bottom: 24px;
}
.help-topic {
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid var(--help-line);
  border-radius: 16px;
  background: var(--help-card);
  scroll-margin-top: 90px;
}
.help-topic h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 19px;
}
.help-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--help-accent-soft);
  color: var(--help-accent);
}
.help-lead {
  margin: 0 0 12px;
  color: var(--help-muted);
}
.help-steps {
  margin: 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 10px;
  line-height: 1.65;
}
.help-steps li::marker {
  color: var(--help-accent);
  font-weight: 700;
}
.help-page kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--help-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--help-kbd);
  font-family: inherit;
  font-size: 0.88em;
  white-space: nowrap;
}
.help-keys {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 24px;
}
.help-keys li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--help-line);
}
.help-faq {
  display: grid;
  gap: 10px;
}
.help-question {
  border: 1px solid var(--help-line);
  border-radius: 14px;
  background: var(--help-card);
}
.help-question summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.help-question summary::-webkit-details-marker {
  display: none;
}
.help-question summary span {
  display: inline-flex;
  color: var(--help-muted);
  transition: transform 0.2s;
}
.help-question[open] summary span {
  transform: rotate(180deg);
}
.help-question[open] {
  border-color: color-mix(in srgb, var(--help-accent) 40%, var(--help-line));
}
.help-question p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--help-muted);
  line-height: 1.65;
}
.help-empty,
.help-footnote {
  color: var(--help-muted);
  text-align: center;
}
.help-footnote {
  margin-top: 32px;
}
@media (max-width: 820px) {
  .help-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .help-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .help-toc strong {
    width: 100%;
    margin-bottom: 2px;
  }
  .help-toc a {
    border: 1px solid var(--help-line);
    border-radius: 999px;
    background: var(--help-card);
    font-size: 13.5px;
  }
  .help-topic {
    padding: 18px 16px;
  }
  .help-header .language-toggle,
  .help-header [data-language-toggle] {
    font-size: 13px;
  }
}
.auth-language {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-help-link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.auth-help-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.help-back {
  white-space: nowrap;
}
:root[data-theme='dark'] .help-brand img {
  filter: brightness(1.7) saturate(0.85);
}
@media (max-width: 480px) {
  .help-brand img {
    height: 28px;
  }
  .help-back {
    padding: 7px 11px;
    font-size: 14px;
  }
}
