/* Help center (/help): the knowledge-page family (enterprise-site.css) plus the
   reading surface for imported articles, guide indexes and full-text search.
   Loaded from <head> so it survives view-transition swaps. */
@layer components {
  .help-center {
    --help-aside-top: calc(var(--space-24) + var(--space-8));
    --help-rule: var(--border-width-sm) solid var(--border);
    --help-rule-strong: var(--border-width-sm) solid var(--border-strong);
  }

  /* -- Hero ---------------------------------------------------------------- */
  .help-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    margin: var(--space-6) 0 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--enterprise-secondary-ink);
  }
  .help-meta span:not(:last-child)::after {
    content: '·';
    margin-inline-start: var(--space-3);
  }
  .help-lead :is(strong, b) {
    color: var(--foreground);
    font-weight: 600;
  }
  .help-lead a {
    text-decoration: underline;
    text-underline-offset: var(--space-1);
  }
  .help-article .enterprise-hero h1 {
    max-width: 24ch;
  }

  /* -- Reading layout ------------------------------------------------------- */
  .help-reading {
    border-block-start: var(--help-rule);
  }
  .help-aside {
    display: grid;
    gap: var(--space-10);
    max-height: calc(100vh - var(--help-aside-top) - var(--space-6));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-inline-end: var(--space-2);
  }
  .help-aside nav > p {
    margin: 0 0 var(--space-4);
    padding-inline: var(--space-3);
    font-weight: 650;
  }
  .help-aside nav > p a:hover {
    text-decoration: underline;
    text-underline-offset: var(--space-1);
  }
  /* Aside links: the current section (scroll) and current article share the legal
     TOC's active treatment, a 1px Tacet Orange registration mark on a faint tint. */
  .help-aside a {
    padding-inline: var(--space-3);
    transition:
      color var(--duration-fast, 150ms) ease,
      background-color var(--duration-fast, 150ms) ease;
  }
  .help-aside nav > p a {
    padding-inline: 0;
  }
  .help-aside a:is([aria-current='location'], [aria-current='page']) {
    color: var(--foreground);
    background: color-mix(in oklch, var(--org-on-light), transparent 92%);
    box-shadow: inset var(--border-width-sm) 0 0 var(--org-on-light);
  }
  .help-section-nav a[aria-current='page'] {
    font-weight: 650;
  }
  .help-center .help-aside a:focus-visible {
    outline-offset: calc(var(--border-width-md) * -1);
  }

  /* Breadcrumbs: one hairline under the whole trail and the heavier mark exactly
     under the current label, so separators never join the current step. */
  .help-center .enterprise-breadcrumbs ol {
    align-items: flex-end;
    border-bottom: var(--border-width-sm) solid var(--border);
  }
  .help-center .enterprise-breadcrumbs li {
    padding: 0 0 var(--space-2);
    border-bottom: 0;
  }
  .help-center .enterprise-breadcrumbs [aria-current] {
    position: relative;
  }
  .help-center .enterprise-breadcrumbs [aria-current]::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: calc((var(--space-2) + var(--border-width-sm)) * -1);
    height: var(--border-width-md);
    background: var(--border-strong);
  }

  /* -- Article prose -------------------------------------------------------- */
  /* Running text keeps the reading measure; tables, figures and section rules
     use the full body column so dense reference tables do not wrap word by word. */
  .help-prose {
    font-size: 1.0625rem;
    line-height: 1.7;
  }
  .help-prose > :is(p, ul, ol, pre, blockquote, .help-callout) {
    max-width: var(--enterprise-measure);
  }
  .help-prose > :first-child {
    margin-block-start: 0;
  }
  .help-prose :is(p, ul, ol) {
    margin: 0 0 var(--space-6);
  }
  .help-prose :is(ul, ol) {
    padding-inline-start: var(--space-6);
  }
  .help-prose ul {
    list-style: disc;
  }
  .help-prose ol {
    list-style: decimal;
  }
  .help-prose li {
    margin-block: var(--space-2);
    padding-inline-start: var(--space-1);
  }
  .help-prose li > :is(ul, ol) {
    margin-block: var(--space-2) 0;
  }
  .help-prose li::marker {
    color: var(--enterprise-secondary-ink);
  }
  .help-prose h2 {
    scroll-margin-top: var(--help-aside-top);
    margin: var(--space-16) 0 var(--space-6);
    padding-block-start: var(--space-8);
    border-block-start: var(--help-rule);
    font-family: var(--tacet-narrative-font);
    font-size: var(--text-3xl);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }
  .help-prose > h2:first-child {
    padding-block-start: 0;
    border-block-start: 0;
  }
  .help-prose h3 {
    scroll-margin-top: var(--help-aside-top);
    margin: var(--space-10) 0 var(--space-4);
    font-family: var(--tacet-narrative-font);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.35;
  }
  .help-prose :is(strong, b) {
    font-weight: 600;
    color: var(--foreground);
  }
  .help-prose a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--org-on-light) 60%, transparent);
    text-underline-offset: var(--space-1);
  }
  .help-prose a:hover {
    color: var(--org-on-light);
    text-decoration-color: currentColor;
  }
  .help-prose :not(pre) > code {
    padding: 0.1em 0.35em;
    border: var(--help-rule);
    border-radius: var(--tacet-radius-sm);
    background: var(--surface-container);
    font-family: var(--font-mono);
    font-size: 0.86em;
    overflow-wrap: anywhere;
  }
  .help-prose pre {
    margin: 0 0 var(--space-6);
    padding: var(--space-4) var(--space-6);
    overflow-x: auto;
    border: var(--help-rule);
    border-radius: var(--radius-lg);
    background: var(--surface-container);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
  }
  .help-prose blockquote {
    margin: 0 0 var(--space-6);
    padding-inline-start: var(--space-4);
    border-inline-start: var(--help-rule-strong);
    color: var(--enterprise-secondary-ink);
  }

  /* Figures: product screenshots on a quiet plate, caption below. */
  .help-figure {
    margin: var(--space-8) 0;
  }
  /* Width and height attributes hold the display size (see the importer), so the
     figure's space is reserved before the image loads. */
  .help-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border: var(--help-rule);
    border-radius: var(--radius-lg);
    background: var(--surface-container);
    box-shadow: var(--tacet-shadow-sm);
  }
  .help-figure figcaption {
    margin-block-start: var(--space-3);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--enterprise-secondary-ink);
  }

  /* Tables reuse .enterprise-table; dense reference tables read at a step down. */
  .help-table {
    margin-block: var(--space-6) var(--space-8);
  }
  .help-table table {
    font-size: var(--text-sm);
  }
  .help-table :is(th, td) {
    padding: var(--space-3);
  }
  .help-table tbody th {
    width: auto;
    min-width: 9rem;
  }
  .help-table code {
    white-space: nowrap;
  }

  /* Callouts reuse the Tacet ruled note (.tacet-info-note); the label carries the meaning. */
  .help-prose .help-callout {
    margin: var(--space-8) 0;
  }
  .help-prose .help-callout .tacet-info-note__heading {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 650;
  }
  .help-prose .help-callout .tacet-info-note__description {
    max-width: none;
  }
  .help-prose .help-callout .tacet-info-note__description :is(p, ul, ol) {
    margin-block-end: var(--space-3);
  }
  .help-prose .help-callout .tacet-info-note__description > :last-child {
    margin-block-end: 0;
  }
  .help-prose .help-callout .tacet-info-note__description a {
    color: var(--foreground);
  }

  /* Previous / next */
  .help-pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
    margin-block: var(--space-16) var(--space-12);
    padding-block-start: var(--space-6);
    border-block-start: var(--help-rule-strong);
  }
  .help-pager__link {
    display: grid;
    gap: var(--space-2);
    align-content: start;
  }
  .help-pager__link--next {
    grid-column: 2;
    text-align: end;
    justify-items: end;
  }
  .help-pager__link span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--enterprise-secondary-ink);
  }
  .help-pager__link strong {
    font-weight: 600;
    line-height: 1.4;
  }
  .help-pager__link:hover strong {
    text-decoration: underline;
    text-underline-offset: var(--space-1);
  }

  /* -- Search ------------------------------------------------------------------ */
  .help-search {
    margin-block-end: var(--space-12);
  }
  .help-search .enterprise-library__input {
    position: relative;
  }
  .help-search .enterprise-library__input input::-webkit-search-cancel-button {
    display: none;
  }
  /* One focus ring around the whole field, not a rectangle around the text input. */
  .help-center .help-search .enterprise-library__input:focus-within {
    outline: var(--border-width-md) solid var(--org-on-light);
    outline-offset: var(--border-width-md);
  }
  .help-center .help-search .enterprise-library__input input:focus-visible {
    outline: none;
  }
  /* Clear sits inside the field and only exists while there is a query. */
  .help-search .help-search__clear {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: var(--space-8);
    min-height: 0;
    height: var(--space-8);
    border-radius: var(--tacet-radius-full);
    color: var(--enterprise-secondary-ink);
    text-decoration: none;
  }
  .help-search .help-search__clear[hidden] {
    display: none;
  }
  .help-search .help-search__clear:hover {
    background: var(--surface-container);
    color: var(--foreground);
  }
  .help-search__status a {
    color: var(--foreground);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: var(--space-1);
  }
  .help-search__status a:hover {
    color: var(--org-on-light);
  }
  .help-search__status:empty {
    display: none;
  }
  .help-search__empty {
    margin: 0;
    padding-block: var(--space-6);
    border-block-start: var(--help-rule-strong);
    color: var(--enterprise-secondary-ink);
  }
  .help-results {
    list-style: none;
    margin: 0;
    padding: 0;
    border-block-start: var(--help-rule-strong);
  }
  .help-results[hidden] {
    display: none;
  }
  .help-results li {
    border-block-end: var(--help-rule);
  }
  .help-results a {
    display: grid;
    gap: var(--space-2);
    padding-block: var(--space-6);
  }
  .help-results__kicker {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--enterprise-secondary-ink);
  }
  .help-results strong {
    font-size: var(--text-xl);
    font-weight: 400;
    line-height: 1.35;
  }
  .help-results a:hover strong {
    text-decoration: underline;
    text-underline-offset: var(--space-1);
  }
  .help-results__snippet {
    max-width: 80ch;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--enterprise-secondary-ink);
  }
  .help-results mark {
    background: color-mix(in oklab, var(--org) 22%, transparent);
    color: inherit;
    border-radius: var(--tacet-radius-xs);
    padding-inline: 0.08em;
  }
  [data-help-empty][hidden],
  [data-help-browse][hidden] {
    display: none;
  }

  .help-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    margin-block-start: var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
  }
  .help-suggestions p {
    margin: 0;
    color: var(--enterprise-secondary-ink);
  }
  .help-suggestions ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .help-chip {
    min-height: var(--space-8);
    padding: var(--space-1) var(--space-3);
    border: var(--help-rule-strong);
    border-radius: var(--tacet-radius-full);
    background: var(--background);
    color: var(--foreground);
    font: inherit;
    font-weight: 600;
    transition:
      border-color var(--duration-fast, 150ms) ease,
      background-color var(--duration-fast, 150ms) ease;
  }
  .help-chip:hover {
    border-color: var(--foreground);
    background: var(--surface-container);
  }

  /* -- Help home ----------------------------------------------------------------- */
  .help-home__browse {
    padding-block-end: var(--space-16);
  }
  .help-guides > h2,
  .help-popular > h2 {
    margin: 0 0 var(--space-8);
    font-family: var(--tacet-narrative-font);
    font-size: var(--text-3xl);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }
  /* Guide panels: one solid, fully clickable entry per guide in the search
     panel's material. Sections live on the guide page and in the help directory,
     so the hub keeps these to a title, what the guide covers, and its size. */
  .help-guides__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
  }
  .help-guide-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    background: var(--muted);
    transition: background-color var(--duration-fast, 150ms) ease;
  }
  .help-guide-card:hover {
    background: color-mix(in oklab, var(--foreground) 6%, var(--muted));
  }
  .help-guide-card h3 {
    margin: 0;
    padding-inline-end: var(--space-12);
    font-family: var(--tacet-narrative-font);
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
  }
  .help-guide-card__summary {
    max-width: 44ch;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--enterprise-secondary-ink);
  }
  .help-guide-card__meta {
    margin-block-start: auto;
    padding-block-start: var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--foreground);
  }
  .help-guide-card__arrow {
    position: absolute;
    inset-block-start: var(--space-8);
    inset-inline-end: var(--space-8);
    display: grid;
    place-items: center;
    width: var(--space-10);
    height: var(--space-10);
    border: var(--help-rule-strong);
    border-radius: var(--tacet-radius-full);
    background: var(--background);
    transition:
      transform var(--duration-fast, 150ms) ease,
      background-color var(--duration-fast, 150ms) ease,
      color var(--duration-fast, 150ms) ease,
      border-color var(--duration-fast, 150ms) ease;
  }
  .help-guide-card:hover .help-guide-card__arrow {
    border-color: var(--foreground);
    background: var(--foreground);
    color: var(--background);
    transform: translate(2px, -2px);
  }
  @media (prefers-reduced-motion: reduce) {
    .help-guide-card,
    .help-guide-card__arrow {
      transition: none;
    }
    .help-guide-card:hover .help-guide-card__arrow {
      transform: none;
    }
  }
  .help-popular {
    margin-block-start: var(--tacet-narrative-gap);
  }
  .help-popular .enterprise-resource h3 {
    font-family: var(--tacet-narrative-font);
    font-weight: 400;
    font-size: var(--text-2xl);
    line-height: 1.3;
    margin: 0 0 var(--space-4);
  }
  .help-popular .enterprise-resource h3 a:hover {
    text-decoration: underline;
  }

  /* -- Guide index ---------------------------------------------------------------- */
  .help-index__section {
    scroll-margin-top: var(--help-aside-top);
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 2fr);
    gap: var(--space-4) var(--space-12);
    padding-block: var(--space-8);
    border-block-start: var(--help-rule-strong);
  }
  .help-index__section:first-child {
    padding-block-start: 0;
    border-block-start: 0;
  }
  .help-index__header h2 {
    margin: 0;
    font-family: var(--tacet-narrative-font);
    font-size: var(--text-2xl);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  .help-index__header p {
    margin: var(--space-2) 0 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--enterprise-secondary-ink);
  }
  .help-index__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .help-index__list li + li {
    border-block-start: var(--help-rule);
  }
  .help-index__list a {
    display: grid;
    gap: var(--space-1);
    padding-block: var(--space-4);
  }
  .help-index__list li:first-child a {
    padding-block-start: 0;
  }
  .help-index__list strong {
    font-weight: 600;
    line-height: 1.4;
  }
  .help-index__list span {
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--enterprise-secondary-ink);
  }
  .help-index__list a:hover strong {
    text-decoration: underline;
    text-underline-offset: var(--space-1);
  }

  /* -- Responsive --------------------------------------------------------------- */
  @media (max-width: 1023px) {
    .help-aside:not(:has([data-help-toc])) {
      display: none;
    }
    .help-aside {
      max-height: none;
      overflow: visible;
      gap: var(--space-6);
    }
    .help-reading .help-section-nav {
      display: none;
    }
    .help-index__section {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  @media (max-width: 639px) {
    .help-prose h2 {
      font-size: var(--text-2xl);
      margin-block-start: var(--space-12);
    }
    .help-pager {
      grid-template-columns: minmax(0, 1fr);
    }
    .help-pager__link--next {
      grid-column: 1;
    }
    .help-guides__grid {
      grid-template-columns: minmax(0, 1fr);
    }
    .help-guide-card {
      padding: var(--space-6);
    }
    .help-guide-card__arrow {
      inset-block-start: var(--space-6);
      inset-inline-end: var(--space-6);
    }
  }
}
