/* Help center: index list, topic article, inline drawer. */

.help-topic-list a {
  text-decoration: none;
  color: var(--brand-700, #2a4365);
}

.help-topic-list a:hover {
  text-decoration: underline;
}

.help-article h1,
.help-article h2,
.help-article h3 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
}

.help-article h1:first-child,
.help-article h2:first-child {
  margin-top: 0;
}

.help-article p,
.help-article ul,
.help-article ol,
.help-article blockquote,
.help-article pre,
.help-article table {
  margin: 0 0 0.9em 0;
}

.help-article ul,
.help-article ol {
  padding-left: 1.4em;
}

.help-article li {
  margin: 0.25em 0;
}

.help-article code {
  background: var(--gray-100, #f3f4f6);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

.help-article pre {
  background: var(--gray-100, #f3f4f6);
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
}

.help-article pre code {
  background: transparent;
  padding: 0;
}

.help-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.help-article th,
.help-article td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.help-article th {
  font-weight: 600;
  color: var(--gray-700, #374151);
}

.help-article blockquote {
  border-left: 3px solid var(--gray-300, #d1d5db);
  padding-left: 12px;
  color: var(--gray-600, #4b5563);
}

/* Inline ? button (used inside detail-header). */
/* WORK-1053 — the per-user help-hints switch. `helpButton()` in
 * help-drawer.js stays the single seam for all of its render sites; the switch
 * sets one attribute on the root and this rule does the rest, so no view has
 * to thread a flag through its markup. Help Center, Search Help and Go to...
 * stay reachable with hints off. */
:root[data-help-hints="off"] .help-button {
  display: none;
}

.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--gray-300, #d1d5db);
  background: white;
  color: var(--gray-600, #4b5563);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
}

.help-button:hover {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-900, #111827);
}

.help-context-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary-700, #1d4ed8);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.help-context-link:hover {
  color: var(--primary-900, #1e3a8a);
  text-decoration: underline;
}

/* Drawer. */
#help-drawer[hidden] {
  display: none;
}

#help-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.help-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 180ms ease;
  pointer-events: none;
}

#help-drawer.open .help-drawer-backdrop {
  background: rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.help-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 90vw);
  background: white;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 180ms ease;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

#help-drawer.open .help-drawer-panel {
  transform: translateX(0);
}

.help-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.help-drawer-header h2 {
  margin: 0;
  font-size: 18px;
}

.help-drawer-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-500, #6b7280);
  padding: 0 4px;
}

.help-drawer-close:hover {
  color: var(--gray-900, #111827);
}

.help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.55;
}

/* ── Help T2: search (drawer + full page), related links ───────────── */

.help-search-box,
.help-page-search {
  position: relative;
  margin-bottom: 10px;
}

.help-page-search {
  margin: 18px 0 8px;
}

.help-search-mag {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400, #9ca3af);
  pointer-events: none;
}

.help-search-input,
.help-page-search-input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  font-size: 15px;
  color: var(--gray-800, #1f2937);
  background: #fff;
}

.help-search-input:focus,
.help-page-search-input:focus {
  outline: none;
  border-color: var(--primary-500, #3b82f6);
  box-shadow: 0 0 0 3px var(--primary-100, #dbeafe);
}

.help-search-hint {
  font-size: 12px;
  color: var(--gray-400, #9ca3af);
  margin-bottom: 12px;
}

.help-search-hint kbd {
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: ui-monospace, Menlo, monospace;
  margin: 0 1px;
}

.help-search-count,
.help-results-count {
  font-size: 12px;
  color: var(--gray-500, #6b7280);
  margin-bottom: 8px;
}

/* Result buttons (drawer) and result cards (full page) share a look. */
.help-search-result,
.help-result-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 6px);
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font: inherit;
}

.help-search-result:hover,
.help-search-result.sel,
.help-result-card:hover {
  border-color: var(--primary-500, #3b82f6);
  background: var(--primary-50, #eff6ff);
}

.help-search-result-title,
.help-result-title {
  font-weight: 600;
  color: var(--brand-700, #2a4365);
  margin-bottom: 3px;
}

.help-search-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-600, #4b5563);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

.help-search-snippet,
.help-result-snippet {
  font-size: 13px;
  color: var(--gray-600, #4b5563);
  line-height: 1.5;
}

.help-search-snippet mark,
.help-result-snippet mark {
  background: #fde68a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.help-search-empty {
  color: var(--gray-500, #6b7280);
  font-size: 14px;
  padding: 8px 0;
}

.help-back {
  background: transparent;
  border: 0;
  color: var(--primary-700, #1d4ed8);
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 12px;
}

/* Related block — used in the drawer and both help pages. */
.help-related {
  margin-top: 22px;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  padding-top: 16px;
}

.help-related-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500, #6b7280);
  margin: 0 0 10px;
}

.help-related-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: var(--radius, 6px);
  color: var(--brand-700, #2a4365);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.help-related-link:hover {
  background: var(--gray-100, #f3f4f6);
}

.help-related-arw {
  color: var(--gray-400, #9ca3af);
}

/* WORK-283 Track B — extracted from inline styles (rubric rule 4). */
.help-drawer-loading {
  color: var(--gray-500);
}

.help-drawer-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.help-drawer-fullpage-link {
  font-size: 13px;
}

/* Help index page. */
.help-muted-msg {
  color: var(--gray-500);
}

.help-index-subtitle {
  color: var(--gray-500);
  margin-top: 4px;
}

.help-topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-topic-item {
  margin: 8px 0;
}

.help-topic-link {
  font-weight: 500;
}

.help-topic-excerpt {
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 2px;
}

.help-error-msg {
  color: #991b1b;
}

/* Help detail page. */
.help-back-link {
  font-size: 13px;
  color: var(--gray-500);
}

.help-detail-title {
  margin-top: 6px;
}

.help-detail-meta {
  color: var(--gray-500);
  margin-top: 4px;
  font-size: 13px;
}

.help-error-text {
  color: var(--gray-500);
}
