/* Help center styles. Loads on /help/** only, on top of design-system.css. */

.help-body {
  background: var(--c-page);
  color: var(--c-text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.help-topbar {
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.help-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
}
.help-brand { display: inline-flex; align-items: center; }
.help-brand:hover { text-decoration: none; }

.help-menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
  cursor: pointer;
  border-radius: 8px;
}
.help-menu-toggle svg { width: 22px; height: 22px; }
.help-menu-toggle:hover { background: var(--c-page); }

.help-search {
  position: relative;
  max-width: 520px;
  width: 100%;
  justify-self: stretch;
}
.help-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--c-text-muted);
}
.help-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-button);
  background: var(--c-page);
  font: var(--f-body);
  color: var(--c-text);
}
.help-search input:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  background: var(--c-card);
}
.help-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
}
.help-search-results[hidden] { display: none; }
.help-search-result-section {
  padding: 8px 10px 4px;
  font: var(--f-label);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-placeholder);
}
.help-search-result {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--c-text);
  line-height: 1.4;
}
.help-search-result:hover,
.help-search-result.is-active {
  background: var(--c-blue-tint-light);
  text-decoration: none;
}
.help-search-result-title { font-weight: 500; display: block; }
.help-search-result-desc { color: var(--c-text-muted); font-size: 13px; display: block; }
.help-search-empty {
  padding: 16px 12px;
  color: var(--c-text-muted);
  text-align: center;
  font-size: 13px;
}

.help-topnav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-topnav a {
  color: var(--c-text-secondary);
  font-size: 14px;
}
.help-topnav a.btn { color: #fff; }

.help-back-to-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--radius-button);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.help-back-to-app:hover {
  background: var(--c-page);
  border-color: var(--c-text-placeholder);
  color: var(--c-text);
  text-decoration: none;
}
.help-back-to-app svg { width: 14px; height: 14px; }

.help-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-text);
  max-width: 240px;
}

.help-sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--c-blue-tint-light);
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
.help-sidebar-back:hover { background: var(--c-blue-tint-medium); text-decoration: none; }
.help-sidebar-back svg { width: 14px; height: 14px; }
.help-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-blue-tint-medium);
  color: var(--c-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.help-account-labels {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.help-account-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.help-account-email {
  font-size: 11px;
  color: var(--c-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .help-account-labels { display: none; }
  .help-account { padding: 2px; border-color: transparent; }
  .help-back-to-app span { display: none; }
  .help-back-to-app { padding: 7px 9px; }
}

/* Shell */
.help-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  align-items: start;
}

/* Sidebar */
.help-sidebar {
  align-self: start;
  padding: 24px 12px 24px 24px;
  border-right: 1px solid var(--c-border);
}
.help-sidebar-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--c-text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}
.help-sidebar-home:hover { background: var(--c-page); text-decoration: none; }
.help-sidebar-home svg { width: 14px; height: 14px; }

.help-sidebar-section { margin-bottom: 6px; }
.help-sidebar-section > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  user-select: none;
}
.help-sidebar-section > summary::-webkit-details-marker { display: none; }
.help-sidebar-section > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 120ms ease;
  margin-right: 6px;
  color: var(--c-text-placeholder);
  font-size: 10px;
}
.help-sidebar-section[open] > summary::before { transform: rotate(90deg); }
.help-sidebar-section > summary:hover { background: var(--c-page); }
.help-sidebar-section ul {
  list-style: none;
  margin: 2px 0 8px;
  padding: 0 0 0 16px;
}
.help-sidebar-section li a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--c-text-secondary);
  font-size: 13px;
  line-height: 1.4;
}
.help-sidebar-section li a:hover { background: var(--c-page); text-decoration: none; }
.help-sidebar-section li a.active {
  background: var(--c-blue-tint-light);
  color: var(--c-primary);
  font-weight: 500;
}

/* Main */
.help-main {
  padding: 32px clamp(20px, 4vw, 56px);
  max-width: 760px;
  width: 100%;
}

/* Hero (index) */
.help-hero {
  text-align: center;
  padding: 32px 0 16px;
}
.help-hero h1 {
  font: 600 32px/1.15 var(--f-stack);
  letter-spacing: -0.5px;
  margin: 0 0 10px;
}
.help-hero p {
  color: var(--c-text-muted);
  font-size: 16px;
  margin: 0;
}

.help-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.help-section-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text);
  transition: border-color 120ms ease, transform 120ms ease;
}
.help-section-card:hover {
  text-decoration: none;
  border-color: var(--c-primary);
  transform: translateY(-1px);
}
.help-section-illo {
  width: 56px;
  height: 56px;
  background: var(--c-blue-tint-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-section-illo img { width: 40px; height: 40px; }
.help-section-body h2 {
  font: 500 16px/1.2 var(--f-stack);
  margin: 0 0 4px;
}
.help-section-body p {
  color: var(--c-text-muted);
  font-size: 13px;
  margin: 0 0 8px;
  line-height: 1.5;
}
.help-section-count {
  color: var(--c-text-placeholder);
  font-size: 12px;
}

.help-popular { margin: 32px 0; }
.help-section-h2 {
  font: 500 18px/1.2 var(--f-stack);
  margin: 0 0 12px;
}
.help-popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.help-popular-list li a {
  display: block;
  padding: 14px 16px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  color: var(--c-text);
}
.help-popular-list li a:hover {
  text-decoration: none;
  border-color: var(--c-primary);
}
.help-popular-desc {
  display: block;
  color: var(--c-text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.help-contact-cta {
  margin: 40px 0 16px;
  padding: 24px;
  background: var(--c-blue-tint-light);
  border-radius: var(--radius);
  text-align: center;
}
.help-contact-cta h2 {
  font: 500 18px/1.2 var(--f-stack);
  margin: 0 0 6px;
}
.help-contact-cta p {
  margin: 0;
  color: var(--c-text-secondary);
}

/* Article */
.help-breadcrumbs {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 16px;
}
.help-breadcrumbs a { color: var(--c-text-muted); }
.help-breadcrumb-sep { margin: 0 6px; color: var(--c-text-placeholder); }

.help-article-header {
  margin-bottom: 24px;
}
.help-article-illo {
  width: 80px;
  height: 80px;
  background: var(--c-blue-tint-light);
  border-radius: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-article-illo img { width: 64px; height: 64px; }
.help-article-header h1 {
  font: 600 30px/1.15 var(--f-stack);
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}
.help-article-lede {
  color: var(--c-text-muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}

.help-article-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text);
}
.help-article-body h2 {
  font: 500 20px/1.2 var(--f-stack);
  margin: 32px 0 10px;
  letter-spacing: -0.2px;
}
.help-article-body h3 {
  font: 500 16px/1.25 var(--f-stack);
  margin: 24px 0 8px;
}
.help-article-body p { margin: 0 0 14px; }
.help-article-body ul, .help-article-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.help-article-body li { margin-bottom: 6px; }
.help-article-body code {
  background: var(--c-page);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}
.help-article-body strong { font-weight: 600; }
.help-article-body a { color: var(--c-primary); }

.help-article-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--c-border); }
.help-updated { color: var(--c-text-muted); font-size: 13px; margin: 0 0 24px; }
.help-related h3,
.help-still-stuck h3 {
  font: 500 14px/1.2 var(--f-stack);
  margin: 0 0 10px;
  color: var(--c-text-secondary);
}
.help-related ul { list-style: none; margin: 0 0 24px; padding: 0; }
.help-related li { margin-bottom: 6px; }
.help-still-stuck p { color: var(--c-text-secondary); margin: 0; }

/* Footer */
.help-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-card);
  padding: 16px 24px;
  margin-top: 40px;
}
.help-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--c-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.help-footer-inner a { color: var(--c-text-muted); }
.help-footer-sep { color: var(--c-text-placeholder); }

/* Mobile */
@media (max-width: 900px) {
  .help-topbar-inner {
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .help-menu-toggle { display: inline-flex; }
  .help-brand { grid-column: 2; }
  .help-search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }
  .help-topnav { grid-column: 3; grid-row: 1; justify-self: end; }

  .help-shell {
    grid-template-columns: 1fr;
  }
  .help-sidebar {
    position: fixed;
    top: 124px;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--c-card);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    z-index: 25;
    box-shadow: 4px 0 20px rgba(15,23,42,0.06);
    overflow-y: auto;
  }
  .help-sidebar.open { transform: translateX(0); }
  .help-main { padding: 20px 16px; }
}
