/* ==========================================================================
   Help center (/help). Only loaded by the Help views.
   Uses the site tokens (--primary, --text, --bg ...) defined in general.css.
   Note: general.css sets `ul { padding: 0 !important }`, so lists here set their own padding with !important.
   ========================================================================== */

:root {
  --help-header-h: 70px;
  --help-bar-h: 52px;
  --help-border: #e4e8f0;
  --help-muted: #5f6b7a;
  --help-soft: #f1f6ff;
  --help-radius: 12px;
  --help-sidebar-w: 272px;
  --help-toc-w: 232px;
}

body header {
  background-color: #fff;
}

.help-page {
  margin-top: var(--help-header-h);
  padding-bottom: 80px;
  color: var(--text, #292929);
}

.help-page a {
  text-decoration: none;
}

.help-kbd,
.help-search-foot kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #d5dae5;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--help-muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
}

/* ---------- Landing ---------- */

.help-hero {
  background: var(--bg, #f8f9fc);
  border-bottom: 1px solid var(--help-border);
  padding: 16px 0 56px;
}

.help-hero h1 {
  margin: 28px 0 12px;
  font-size: 40px;
  font-weight: 700;
}

.help-hero p {
  max-width: 640px;
  margin-bottom: 28px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--help-muted);
}

.help-search-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #d5dae5;
  border-radius: var(--help-radius);
  background: #fff;
  color: var(--help-muted);
  font-size: 16px;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.help-search-trigger:hover,
.help-search-trigger:focus-visible {
  border-color: var(--primary, #0069f2);
  box-shadow: 0 0 0 3px rgba(0, 105, 242, 0.12);
  outline: 0;
}

.help-search-trigger span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-apps {
  padding-top: 48px;
}

.help-section-title {
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 700;
}

.help-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.help-app-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
  background: #fff;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.help-app-card:hover,
.help-app-card:focus-visible {
  border-color: var(--primary, #0069f2);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  outline: 0;
}

.help-app-card img {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
}

.help-app-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #292929);
}

.help-app-card p {
  flex: 1;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--help-muted);
}

.help-app-card-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #0069f2);
}

/* ---------- Sub bar (breadcrumb + search) ---------- */

.help-bar {
  position: sticky;
  top: var(--help-header-h);
  z-index: 3;
  height: var(--help-bar-h);
  border-bottom: 1px solid var(--help-border);
  background: #fff;
}

.help-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.help-crumbs {
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}

.help-crumbs::-webkit-scrollbar {
  display: none;
}

.help-crumbs .breadcrumb-item {
  white-space: nowrap;
}

.help-crumbs .breadcrumb-item.active span {
  display: inline-block;
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.help-search-btn,
.help-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d5dae5;
  border-radius: 8px;
  background: #fff;
  color: var(--text, #292929);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s, background-color 0.2s;
}

.help-search-btn:hover,
.help-menu-btn:hover,
.help-search-btn:focus-visible,
.help-menu-btn:focus-visible {
  border-color: var(--primary, #0069f2);
  background: var(--help-soft);
  outline: 0;
}

.help-menu-btn {
  display: none;
}

/* ---------- App page ---------- */

.help-app-page {
  padding-top: 40px;
}

.help-app-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.help-app-header h1 {
  margin-bottom: 4px;
  font-size: 32px;
  font-weight: 700;
}

.help-app-header p {
  margin: 0;
  font-size: 16px;
  color: var(--help-muted);
}

.help-doc-section {
  margin-bottom: 48px;
}

.help-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.help-group {
  padding: 20px 24px 8px;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
}

.help-group h3 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--help-muted);
}

.help-group ul {
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

.help-group li + li {
  border-top: 1px solid var(--help-border);
}

.help-group li a {
  display: block;
  padding: 14px 0;
  color: inherit;
}

.help-group-link-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #292929);
}

.help-group li a:hover .help-group-link-title,
.help-group li a:focus-visible .help-group-link-title {
  color: var(--primary, #0069f2);
}

.help-group-link-summary {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--help-muted);
}

.help-empty {
  padding: 56px 24px;
  border: 1px dashed #cdd4e2;
  border-radius: var(--help-radius);
  background: var(--bg, #f8f9fc);
  text-align: center;
}

.help-empty h2 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 700;
}

.help-empty p {
  max-width: 520px;
  margin: 0 auto 20px;
  color: var(--help-muted);
}

.help-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--primary, #0069f2);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
}

.help-btn:hover {
  background: var(--primary-dark, #1559ee);
}

/* ---------- Document layout ---------- */

.help-layout {
  display: grid;
  grid-template-columns: var(--help-sidebar-w) minmax(0, 1fr) var(--help-toc-w);
  gap: 48px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.help-layout--no-toc {
  grid-template-columns: var(--help-sidebar-w) minmax(0, 1fr);
}

.help-sidebar,
.help-toc-inner {
  position: sticky;
  top: calc(var(--help-header-h) + var(--help-bar-h) + 24px);
  max-height: calc(100vh - var(--help-header-h) - var(--help-bar-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* sidebar */

.help-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.help-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--help-muted);
}

.help-back:hover {
  color: var(--primary, #0069f2);
}

.help-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #292929);
}

.help-app-switch {
  width: 100%;
  height: 40px;
  margin-bottom: 20px;
  padding: 0 12px;
  border: 1px solid #d5dae5;
  border-radius: 8px;
  background-color: #fff;
  color: var(--text, #292929);
  font-size: 15px;
  font-weight: 600;
}

.help-nav-group {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--help-muted);
}

.help-nav-list,
.help-toc ul,
.help-toc-mobile ul {
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

.help-nav-list a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--help-border);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text, #292929);
}

.help-nav-list a:hover {
  background: var(--bg, #f8f9fc);
}

.help-nav-list a.active {
  border-left-color: var(--primary, #0069f2);
  background: var(--help-soft);
  font-weight: 600;
  color: var(--primary, #0069f2);
}

/* article */

.help-article {
  min-width: 0;
  max-width: 820px;
}

.help-doc-group {
  display: inline-block;
  margin-bottom: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--help-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary, #0069f2);
}

.help-article-header h1 {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
}

.help-article-summary {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--help-muted);
}

.help-article-meta {
  margin-bottom: 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--help-border);
  font-size: 14px;
  color: var(--help-muted);
}

/* content typography (content HTML comes from Compass) */

.help-content {
  padding-top: 8px;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.help-content h2,
.help-content h3 {
  scroll-margin-top: calc(var(--help-header-h) + var(--help-bar-h) + 16px);
  font-weight: 700;
  line-height: 1.3;
}

.help-content h2 {
  margin: 40px 0 16px;
  font-size: 26px;
}

.help-content h3 {
  margin: 28px 0 12px;
  font-size: 20px;
}

.help-content p {
  margin-bottom: 16px;
  color: #292929e6;
}

.help-content a {
  color: var(--primary, #0069f2);
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.help-content ul,
.help-content ol {
  margin: 0 0 16px;
  padding-left: 24px !important;
}

.help-content ul {
  list-style: disc;
}

.help-content ol {
  list-style: decimal;
}

.help-content li {
  margin-bottom: 6px;
}

.help-content img,
.help-content video,
.help-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.help-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.help-content th,
.help-content td {
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--help-border);
  text-align: left;
  vertical-align: top;
}

.help-content th {
  background: var(--bg, #f8f9fc);
  font-weight: 700;
}

.help-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef1f6;
  font-size: 0.9em;
  color: #c2255c;
}

.help-content pre {
  margin: 20px 0;
  padding: 16px;
  overflow-x: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;
}

.help-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.help-content blockquote {
  margin: 20px 0;
  padding: 4px 16px;
  border-left: 4px solid #cdd4e2;
  color: var(--help-muted);
}

.help-content hr {
  margin: 32px 0;
  border-color: var(--help-border);
}

.help-note {
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--primary, #0069f2);
  border-radius: 8px;
  background: var(--help-soft);
  line-height: 1.6;
}

.help-note strong {
  color: var(--primary, #0069f2);
}

/* previous / next */

.help-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
}

.help-pager-link {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
  color: inherit;
  transition: border-color 0.2s;
}

.help-pager-link:hover,
.help-pager-link:focus-visible {
  border-color: var(--primary, #0069f2);
  outline: 0;
}

.help-pager-next {
  grid-column: 2;
  text-align: right;
}

.help-pager-label {
  display: block;
  font-size: 13px;
  color: var(--help-muted);
}

.help-pager-title {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary, #0069f2);
}

/* ---------- On this page ---------- */

/* stretch to the row height: the sticky inner box needs room to travel inside its parent */
.help-toc {
  align-self: stretch;
}

.help-toc-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--help-muted);
}

.help-toc li a,
.help-toc-mobile li a {
  display: block;
  padding: 5px 0 5px 14px;
  border-left: 2px solid var(--help-border);
  font-size: 14px;
  line-height: 1.45;
  color: var(--help-muted);
}

.help-toc li.help-toc-level-3 a,
.help-toc-mobile li.help-toc-level-3 a {
  padding-left: 28px;
}

.help-toc li a:hover,
.help-toc-mobile li a:hover {
  color: var(--text, #292929);
}

.help-toc li a.active,
.help-toc-mobile li a.active {
  border-left-color: var(--primary, #0069f2);
  font-weight: 600;
  color: var(--primary, #0069f2);
}

.help-toc-mobile {
  display: none;
  margin: 20px 0 0;
  border: 1px solid var(--help-border);
  border-radius: 10px;
  background: var(--bg, #f8f9fc);
}

.help-toc-mobile summary {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.help-toc-mobile ul {
  padding: 0 16px 12px !important;
}

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

.help-search {
  width: min(680px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 96px));
  margin: 72px auto auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.3);
  background: #fff;
  color: var(--text, #292929);
  overflow: hidden;
}

.help-search[open] {
  display: flex;
  flex-direction: column;
}

.help-search::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

body.help-lock {
  overflow: hidden;
}

.help-search-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 64px;
  border-bottom: 1px solid var(--help-border);
}

.help-search-icon {
  flex: 0 0 auto;
  color: var(--help-muted);
}

.help-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 18px;
  color: var(--text, #292929);
}

.help-search-input:focus {
  outline: 0;
}

/* the dialog has its own close button; hide the browser's clear (x) of type="search" */
.help-search-input::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

.help-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d5dae5;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--help-muted);
}

.help-search-close-icon {
  display: none;
}

.help-search-scope {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
}

.help-search-scope label {
  margin: 0;
  cursor: pointer;
}

.help-search-scope input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.help-search-scope span {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #d5dae5;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--help-muted);
}

.help-search-scope input:checked + span {
  border-color: var(--primary, #0069f2);
  background: var(--help-soft);
  color: var(--primary, #0069f2);
}

.help-search-scope input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(0, 105, 242, 0.25);
}

.help-search-body {
  flex: 1;
  min-height: 120px;
  padding: 12px 12px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.help-search-hint,
.help-search-empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--help-muted);
}

.help-search-widen {
  display: block;
  margin: 12px auto 0;
  padding: 6px 14px;
  border: 1px solid var(--primary, #0069f2);
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #0069f2);
}

.help-search-result {
  display: block;
  padding: 12px;
  border-radius: 10px;
  color: inherit;
}

.help-search-result:hover,
.help-search-result.is-active {
  background: var(--help-soft);
}

.help-search-result-meta {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.help-badge {
  padding: 1px 8px;
  border-radius: 20px;
  background: #eef1f6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--help-muted);
}

.help-badge--group {
  background: var(--help-soft);
  color: var(--primary, #0069f2);
}

.help-search-result-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #292929);
}

.help-search-result-snippet {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--help-muted);
}

.help-search mark,
.help-content mark {
  padding: 0;
  border-radius: 2px;
  background: #fff1a8;
  color: inherit;
}

.help-search-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--help-border);
  background: var(--bg, #f8f9fc);
  font-size: 12px;
  color: var(--help-muted);
}

.help-search-foot kbd {
  margin-right: 2px;
}

/* ---------- Overlay (mobile menu) ---------- */

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(15, 23, 42, 0.5);
}

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

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
  :root {
    --help-header-h: 67px; /* the site header is 67px high below the xl breakpoint, 70px above */
  }

  .help-layout,
  .help-layout--no-toc {
    grid-template-columns: var(--help-sidebar-w) minmax(0, 1fr);
    gap: 40px;
  }

  .help-toc {
    display: none;
  }

  .help-toc-mobile {
    display: block;
  }
}

@media (max-width: 991.98px) {
  .help-layout,
  .help-layout--no-toc {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 24px;
  }

  .help-menu-btn {
    display: inline-flex;
  }

  .help-kbd {
    display: none;
  }

  .help-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    width: min(320px, 86vw);
    max-height: none;
    padding: 16px 20px 32px;
    background: #fff;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.2);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }

  .help-sidebar.is-open {
    transform: none;
    visibility: visible;
  }

  .help-sidebar-close {
    display: inline-flex;
  }

  .help-group-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .help-bar-inner {
    padding: 0 16px;
    gap: 8px;
  }

  .help-layout,
  .help-layout--no-toc {
    padding-left: 16px;
    padding-right: 16px;
  }

  .help-hero h1 {
    font-size: 30px;
  }

  .help-hero p {
    font-size: 16px;
  }

  .help-article-header h1 {
    font-size: 28px;
  }

  .help-article-summary {
    font-size: 16px;
  }

  .help-content h2 {
    font-size: 22px;
  }

  .help-content h3 {
    font-size: 18px;
  }

  /* narrow bar: keep only "app > document" of the breadcrumb (Home / Help Center are in the menu) */
  .help-bar:not(.help-bar--app) .help-crumbs li:nth-child(-n + 4) {
    display: none;
  }

  /* app page: keep "Help Center > App" so there is a way back to the list */
  .help-bar--app .help-crumbs li:nth-child(-n + 2) {
    display: none;
  }

  .help-bar .help-crumbs .breadcrumb-item.active span {
    max-width: 150px;
  }

  .help-search-btn span,
  .help-menu-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .help-search-btn,
  .help-menu-btn {
    width: 44px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .help-pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .help-pager-next {
    grid-column: 1;
  }

  .help-app-header {
    align-items: flex-start;
  }

  .help-app-header h1 {
    font-size: 26px;
  }

  .help-search {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .help-search-close-text,
  .help-search-foot {
    display: none;
  }

  .help-search-close {
    width: 40px;
    height: 40px;
    border: 0;
  }

  .help-search-close-icon {
    display: block;
  }

  .help-search-input {
    font-size: 16px; /* keeps iOS from zooming the page on focus */
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-sidebar,
  .help-app-card {
    transition: none;
  }
}
