/* In-product user manual: /UserManual, the page-help drawer (?), field help and the public /help page.
   W2 · Anhydrite: colours come only from the semantic tokens in diriyah-theme.css (W2ThemeGuardTests).
   Content HTML is generated by docs/user-manual/gen-in-product.mjs (classes m-*). */

/* ------------------------------------------------------------------ topic content */
.m-topic { padding: var(--space-5) 0; border-top: 1px solid var(--border); max-width: 80ch; }
.m-topic:first-of-type { border-top: 0; }
.m-topic h2, .m-topic h3, .m-topic h4 { color: var(--ink); font-weight: 700; margin: 0 0 var(--space-3); line-height: 1.35; }
.m-topic h2 { font-size: 20px; }
.m-topic h3 { font-size: 18px; }
.m-topic h4 { font-size: 16px; }
.m-topic .intro { color: var(--ink-muted); margin: 0 0 var(--space-3); }
.m-topic code { color: var(--ink); background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 0 4px; font-size: .92em; }
.m-topic .ui { font-weight: 600; color: var(--ink); background: var(--primary-soft); border-radius: var(--radius-sm); padding: 0 4px; }
/* #306/#318: UI-name chips quote whole messages; let them wrap (no box-decoration-break: clone, whose repeated
   end padding is not counted when the line breaks and pushes the chip past its box) instead of widening
   /UserManual, /help and the drawer past a phone's width. */
.m-topic .ui, .dg-field-help .ui { white-space: normal; overflow-wrap: anywhere; }
.m-topic { overflow-wrap: anywhere; }

.m-steps { margin: 0 0 var(--space-3); padding-inline-start: 1.6em; }
.m-steps li { margin: 0 0 var(--space-2); line-height: 1.6; color: var(--ink); }
.m-steps li::marker { color: var(--primary); font-weight: 700; }

.m-note { margin: var(--space-3) 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--success-soft); border-inline-start: 4px solid var(--success); color: var(--ink); }
.m-note.m-warn { background: var(--warning-soft); border-inline-start-color: var(--warning); }
.m-note p { margin: var(--space-1) 0 0; }

/* figures: a capture, or a dashed placeholder with its caption while the capture does not exist */
.m-fig { margin: var(--space-3) 0; }
.m-fig img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.m-fig figcaption { font-size: 13px; color: var(--ink-muted); margin-top: var(--space-1); }
.m-slot { border: 2px dashed var(--border-strong); border-radius: var(--radius-md); padding: var(--space-3); background: var(--surface-sunken); }
.m-slot .m-slot-box { height: 72px; border-radius: var(--radius-sm); background: var(--surface); margin-bottom: var(--space-2); }
.m-slot figcaption { margin-top: 0; }

.m-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-pill);
  background: var(--surface-sunken); color: var(--ink-muted); border: 1px solid var(--border); vertical-align: middle; }
.m-coming { color: var(--ink-subtle); }
.m-draft { font-size: 13px; color: var(--ink-muted); background: var(--surface-sunken); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-4); }

/* ------------------------------------------------------------------ /UserManual */
.m-manual { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.m-manual-main { min-width: 0; }
.m-toc { position: sticky; top: calc(var(--topbar-h, 64px) + var(--space-4)); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4); max-height: calc(100vh - 120px); overflow: auto; }
.m-toc h2 { font-size: 14px; font-weight: 700; color: var(--ink-muted); margin: 0 0 var(--space-2); }
.m-toc ol { list-style: none; margin: 0; padding: 0; }
.m-toc li { margin: 0; }
.m-toc a { display: block; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px; }
.m-toc a:hover, .m-toc a:focus-visible { background: var(--surface-hover); color: var(--ink); }
.m-roles { color: var(--ink-muted); margin: 0 0 var(--space-4); }
.m-roles strong { color: var(--ink); }
.m-search { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0 0 var(--space-5); }
.m-search input[type="search"] { flex: 1 1 260px; min-width: 0; }
.m-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-6); margin: 0 0 var(--space-5); box-shadow: var(--shadow-card); }
.m-section > h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 var(--space-2); }
.m-results-head { color: var(--ink); font-weight: 600; margin: 0 0 var(--space-3); }

@media (max-width: 991px) {
  .m-manual { grid-template-columns: minmax(0, 1fr); }
  .m-toc { position: static; max-height: none; }
  .m-section { padding: var(--space-4); }
}

/* ------------------------------------------------------------------ page-help drawer (?) */
/* :where() keeps this at the specificity of one class, so the responsive sizes in diriyah-theme.css
   (header block, same sizes as the quick-access button) win on tablets and phones (#328). */
:where(.topbar-right) .dg-help-trigger {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted);
  cursor: pointer; font-weight: 700; font-size: 16px;
}
.topbar-right .dg-help-trigger:hover { background: var(--surface-hover); color: var(--ink); }
.dg-help-trigger:focus-visible, .dg-field-help-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.dg-help.offcanvas { width: min(480px, 100vw); background: var(--surface); color: var(--ink); border-color: var(--border); }
/* #295: the top bar is z-index 1060 (diriyah-theme.css); Bootstrap's offcanvas (1045) and backdrop (1040) sat under it,
   hiding the drawer header and its close button. Above the top bar and the phone side menu (1070/1065), below SweetAlert. */
.dg-help.offcanvas { z-index: 1080; }
.offcanvas-backdrop { z-index: 1075; }
.dg-help .offcanvas-header { border-bottom: 1px solid var(--border); }
.dg-help .offcanvas-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--ink); }
.dg-help .offcanvas-body > * { max-width: 70ch; }
.dg-help .m-fig { display: none; } /* the drawer is open on the screen it describes: no screenshots there */
.dg-help .m-topic { padding: var(--space-4) 0; }
.dg-help .m-help-foot { border-top: 1px solid var(--border); padding-top: var(--space-3); margin-top: var(--space-3); }
.dg-help .m-help-screen { font-size: 12px; color: var(--ink-subtle); }
.dg-help .m-help-index { padding-inline-start: 1.2em; }
.dg-help .m-help-index li { margin-bottom: var(--space-1); }
html[data-theme="dark"] .dg-help .btn-close { filter: invert(1); }

/* ------------------------------------------------------------------ field help */
.dg-field-help { display: block; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); margin-top: var(--space-1); }
.dg-field-help .ui { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------ public /help */
.m-public { max-width: 900px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-10); }
.m-public-head { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.m-public h1 { font-size: 26px; font-weight: 700; color: var(--ink); margin: 0 0 var(--space-2); }
.m-public .m-public-intro { color: var(--ink-muted); margin: 0 0 var(--space-4); }
.m-public .m-section { padding: var(--space-4) var(--space-5); }
.m-public-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

@media print {
  .m-toc, .m-search, .dg-help-trigger { display: none; }
  .m-manual { display: block; }
  .m-section { box-shadow: none; border: 0; padding: 0; }
}
