@layer components {
  /* Documentation layout; surfaces and colors use the shared ui components. */
  .help-dialog { max-width: 1180px; height: min(900px, calc(100dvh - 32px)); }
  .help-shell { padding-inline: var(--ui-gutter); background: var(--ui-surface); border-radius: 16px; }
  .app-shell-docked .help-shell { padding-inline: 0; }
  .help-body-wrap { display: flex; flex: 1; min-height: 0; padding: 0; overflow: hidden; }
  .help-body { display: flex; flex: 1; min-width: 0; min-height: 0; }
  .help-center { display: grid; grid-template-columns: 248px minmax(0, 1fr); flex: 1; min-width: 0; min-height: 0; color: var(--ui-text); }
  .help-sidebar { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 20px 24px 0; border-right: 1px solid var(--app-shell-line, var(--ui-line)); }
  .help-search { margin-bottom: 16px; }
  .help-search .ui-label, .help-mobile-menu .ui-label { display: block; margin-bottom: 8px; }
  .help-search-field { position: relative; }
  .help-search-field input { width: 100%; padding-right: 42px; font-size: 13px; min-height: 44px; }
  .help-search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
  .help-search-clear { position: absolute; right: 2px; top: 2px; bottom: 2px; min-height: 40px; width: 40px; padding: 0; font-size: 22px; }
  .help-search-status { font-size: 12px; margin: 6px 0 0; }
  .help-search-status:empty { display: none; }
  .help-mobile-menu { display: none; }
  .help-navigation { display: grid; gap: 20px; }
  .help-nav-group > p { margin: 0 0 8px; font-size: 10px; }
  .help-nav-link { width: 100%; min-height: 40px; justify-content: flex-start; text-align: left; font-weight: 500; font-size: 13px; margin: 1px 0; line-height: 1.45; }
  .help-nav-link[aria-current="page"] { color: var(--ui-blue); background: rgba(59,130,246,.14); border-color: rgba(59,130,246,.38); font-weight: 700; }
  .help-reader { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(24px, 3vw, 42px); padding-right: max(0px, calc(clamp(24px, 3vw, 42px) - var(--ui-gutter))); scrollbar-gutter: stable; }
  .help-article, .help-support { max-width: 840px; margin-inline: auto; overflow-wrap: anywhere; }
  .help-article-header { margin-bottom: 26px; }
  .help-article-header > .ui-kicker { margin: 0 0 14px; font-size: 10px; line-height: 1.7; }
  .help-article-header h3 { margin: 0 0 14px; font-size: clamp(26px, 3vw, 38px); line-height: 1.16; font-weight: 750; letter-spacing: -.025em; text-wrap: balance; }
  .help-lead { margin: 0; font-size: 16px; line-height: 1.75; }
  .help-shortcuts { margin: 0 0 28px; }
  .help-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; cursor: pointer; transition: border-color .15s ease; }
  .help-card:hover { border-color: var(--ui-accent, var(--ui-blue)); }
  .help-card .ui-kicker { font-size: 10px; line-height: 1.6; }
  .help-card .ui-card-title { font-size: 15px; }
  .help-card .ui-card-copy { font-size: 13px; }
  .help-toc { display: flex; flex-wrap: wrap; column-gap: 20px; row-gap: 8px; padding: 0 0 22px; border-bottom: 1px solid var(--app-shell-line, var(--ui-line)); margin-bottom: 28px; }
  .help-toc > p { width: 100%; margin: 0 0 4px; font-size: 10px; }
  .help-toc a, .help-support-links > a:not(.ui-button) { color: var(--ui-blue); font-size: 13px; text-underline-offset: 4px; text-decoration: underline; line-height: 1.75; }
  .help-block { margin-bottom: 32px; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
  .help-block h4, .help-related h4, .help-empty h4 { margin: 0 0 12px; font-size: 19px; font-weight: 700; line-height: 1.4; }
  .help-block p { margin: 0 0 12px; }
  .help-block ul, .help-block ol { padding-left: 24px; margin: 12px 0; }
  .help-block ul { list-style: disc; }
  .help-block ol { list-style: decimal; }
  .help-block li { padding-left: 5px; margin-bottom: 10px; }
  .help-block li::marker { color: var(--ui-blue); font-weight: 700; }
  .help-tip { margin-top: 20px; font-size: 14px; line-height: 1.7; }
  .help-tip strong { display: block; color: var(--ui-amber); margin-bottom: 6px; }
  .help-tip p { margin: 0; }
  .help-related { border-top: 1px solid var(--app-shell-line, var(--ui-line)); padding-top: 24px; margin-top: 36px; }
  .help-pagination { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 28px; }
  .help-pagination .ui-button { font-size: 13px; align-items: center; white-space: normal; line-height: 1.5; }
  .help-pagination small { display: block; color: var(--ui-muted); font-size: 11px; font-weight: 400; }
  .help-previous { justify-content: flex-start; text-align: left; }
  .help-next { justify-content: flex-end; text-align: right; }
  .help-support { margin-top: 32px; border-top: 1px solid var(--app-shell-line, var(--ui-line)); padding-top: 24px; font-size: 13px; line-height: 1.7; }
  .help-support > p { margin: 8px 0 14px; }
  .help-support-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
  .help-empty { display: grid; justify-items: start; gap: 12px; }
  .help-empty p, .help-empty h4 { margin: 0; }
  .help-center :is(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--ui-blue); outline-offset: 3px; }
  .help-center [hidden] { display: none; }

  @media (max-width: 1100px) {
    .help-center { grid-template-columns: 212px minmax(0, 1fr); }
    .help-sidebar { padding-right: 14px; }
    .help-reader { padding-left: 24px; }
    .help-center .ui-grid { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 1023px) {
    .help-shell .ui-page-header { flex-wrap: nowrap; min-height: 76px; gap: 12px; }
    .help-shell .ui-page-header h2 { font-size: 20px; }
    .help-shell .ui-page-header p { display: none; }
    .help-center { display: flex; flex-direction: column; }
    .help-sidebar { flex: 0 0 auto; overflow: visible; padding: 14px 0; border-right: 0; border-bottom: 1px solid var(--app-shell-line, var(--ui-line)); }
    .help-search { margin: 0 0 10px; }
    .help-search .ui-label, .help-mobile-menu .ui-label { font-size: 11px; margin-bottom: 4px; }
    .help-search-field input { font-size: 16px; }
    .help-navigation { display: none; }
    .help-mobile-menu { display: block; }
    .help-mobile-menu select { width: 100%; min-height: 44px; font-size: 16px; text-overflow: ellipsis; }
    .help-reader { flex: 1; padding: 24px 0 32px; scrollbar-gutter: auto; }
    .help-article-header { margin-bottom: 20px; }
    .help-article-header h3 { font-size: 28px; }
    .help-lead { font-size: 14px; line-height: 1.7; }
    .help-block { font-size: 14px; line-height: 1.8; }
    .help-toc { column-gap: 16px; }
    .help-pagination { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-height: 540px) and (max-width: 1023px) {
    .help-sidebar { padding-block: 8px; }
    .help-search .ui-label, .help-mobile-menu .ui-label { display: none; }
    .help-search { margin-bottom: 6px; }
  }
}
