/* Online help (docs/online-help.md): arrangement only. Controls, buttons, forms and cards use the shared UI
   foundation; there are no outlines or replacement focus rings here. */
:root { --help-panel-width: 420px; }

/* Help center */
#page-help { display: grid; gap: 16px; align-content: start; }
#page-help.hidden { display: none; }
.helpView { display: grid; gap: 16px; min-width: 0; }
.helpSearchCard .helpSearchForm { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; max-width: 900px; }
.helpSearchActions > button { width: auto; margin-top: 0; }
.helpIntro, .helpLead { color: #4b5563; }
.helpTopics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.helpTopic { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; min-width: 0; }
.helpTopicLink { font-weight: 600; }
.helpArticleList { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.helpArticleItem { padding: 10px 0; border-bottom: 1px solid #f1f5f9; min-width: 0; }
.helpArticleItem:last-child { border-bottom: 0; }
.helpArticleTitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-weight: 600; }
.helpArticleSummary, .helpArticleMeta { margin: 4px 0 0; overflow-wrap: anywhere; }
.helpArticleMeta { color: #64748b; font-size: 12px; }
.helpBadge { font-size: 11px; font-weight: 600; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; padding: 1px 8px; }
.helpBreadcrumb { font-size: 13px; color: #64748b; margin-bottom: 12px; overflow-wrap: anywhere; }
.helpLink { color: #1d4ed8; text-decoration: underline; text-underline-offset: 2px; }
.helpStatus { color: #64748b; margin: 0; }
.helpStatus:empty { display: none; }
.helpEmpty { color: #4b5563; }
.helpHints { margin: 0 0 12px; padding-left: 20px; color: #4b5563; }
.helpNotice { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 12px; }

/* Article content */
.helpArticle { min-width: 0; max-width: 900px; line-height: 1.55; overflow-wrap: anywhere; }
.helpArticleHeading { margin: 0 0 4px; }
.helpContent h3, .helpContent h4, .helpContent h5 { margin: 20px 0 6px; }
.helpContent ul, .helpContent ol { padding-left: 22px; }
.helpContent li + li { margin-top: 4px; }
.helpSteps > li { padding-left: 4px; }
.helpTableWrap { max-width: 100%; overflow-x: auto; margin: 10px 0; }
.helpTable { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.helpTable th, .helpTable td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; vertical-align: top; }
.helpTable th { background: #f8fafc; font-weight: 600; }
.helpCallout { border-left: 4px solid #3b82f6; background: #eff6ff; border-radius: 6px; padding: 8px 12px; margin: 12px 0; }
.helpCallout.warning { border-left-color: #b91c1c; background: #fef2f2; }
.helpCallout.tip { border-left-color: #15803d; background: #f0fdf4; }
.helpCallout p { margin: 4px 0 0; }
.helpCode { background: #f1f5f9; border-radius: 6px; padding: 10px 12px; overflow-x: auto; font-size: 12px; }
.helpFigure { margin: 12px 0; }
.helpFigure img { max-width: 100%; height: auto; border: 1px solid #e5e7eb; border-radius: 6px; }
.helpFigure figcaption { color: #64748b; font-size: 12px; margin-top: 4px; }
.helpTags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.helpTagsLabel { color: #64748b; font-size: 12px; }
.helpTags .helpTag { width: auto; margin: 0; }
.helpRelated { margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 8px; }

/* Context help panel: non-modal, beside the content; the content makes room for it on wide screens. */
.appHeader .helpButton { flex-shrink: 0; }
.helpPanel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--help-panel-width); max-width: 100%;
    display: flex; flex-direction: column; background: #fff; border-left: 1px solid #e5e7eb; box-shadow: -4px 0 12px rgba(0, 0, 0, .08); z-index: 850; }
.helpPanel[hidden] { display: none; }
.helpPanelHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; }
.helpPanelHeader h2 { margin: 0; font-size: 18px; }
.helpPanelHeader .helpPanelClose { width: auto; margin: 0; }
.helpPanelSearch { padding: 12px 16px 0; }
.helpPanel > .helpStatus { padding: 8px 16px 0; }
.helpPanelBody { flex: 1; overflow-y: auto; padding: 4px 16px 24px; min-height: 0; }
.helpPanelBody > h3 { margin: 12px 0 8px; }
.helpPanelActions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.helpPanelActions > button { width: auto; margin-top: 0; }
@media (min-width: 761px) {
    body.helpPanelOpen .appContent { padding-right: var(--help-panel-width); box-sizing: border-box; }
}
@media (max-width: 760px) {
    .helpPanel { left: 0; width: auto; border-left: 0; z-index: 960; }
    .helpSearchCard .helpSearchForm { grid-template-columns: minmax(0, 1fr); }
}
