/* Documentation pages (docs/lib/Doc.php). Site colours only: var(--msg-*). */
body.lv-page.lv-docs { background: var(--msg-bg); color: var(--msg-text); height: auto; min-height: 100%; padding-top: 0; } /* (the live pages' fixed-height body would stop the bar from staying on screen; the guides have no site header above them) */
.dx-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; min-height: 56px; padding: 6px 24px; background: var(--msg-bar); border-bottom: 1px solid var(--msg-bar-line); }
.dx-brand { display: inline-flex; align-items: center; flex: none; }
.dx-brand img { height: 32px; width: auto; display: block; }
.dx-brand img.is-dark-on-light { filter: brightness(0); }
.dx-bar-t { color: var(--msg-text); font-weight: 700; font-size: 17px; text-decoration: none; padding-left: 18px; border-left: 1px solid var(--msg-bar-line); }
.dx-bar-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dx-bar-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 99px; color: var(--msg-text); text-decoration: none; font-size: 15px; font-weight: 600; }
.dx-bar-nav a:hover { background: var(--msg-hover); }
.dx-bar-nav a.dx-site { background: linear-gradient(135deg, var(--msg-accent), var(--msg-accent-2)); color: var(--msg-on-accent); }
@media (max-width: 599px) { .dx-bar { padding: 6px 14px; gap: 10px; } .dx-bar-t { display: none; } .dx-bar-nav a { min-height: 44px; padding: 0 12px; } }
.dx-page { max-width: 1360px; margin: 0 auto; padding: 24px 24px 64px; scroll-margin-top: 70px; }
.dx-head { padding: 12px 0 28px; border-bottom: 1px solid var(--msg-border); margin-bottom: 28px; }
.dx-crumb { margin: 0 0 10px; color: var(--msg-muted); font-size: 14px; }
.dx-crumb a { color: var(--msg-link); text-decoration: none; }
.dx-head h1 { margin: 0 0 12px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
.dx-lead { margin: 0 0 14px; max-width: 70ch; font-size: 18px; line-height: 1.55; color: var(--msg-muted); }
.dx-own { margin: 0; display: inline-block; padding: 8px 14px; border-radius: 12px; background: var(--msg-surface); border: 1px solid var(--msg-border); font-size: 14px; }
.dx-own.is-guest { color: var(--msg-muted); }
.dx { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
.dx-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; gap: 10px; }
.dx-find input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--msg-border); background: var(--msg-surface) !important; color: var(--msg-text) !important; font: inherit; font-size: 16px; }
.dx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dx-navlist { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; }
.dx-navlist ul { list-style: none; margin: 2px 0 8px 34px; padding: 0 0 0 10px; border-left: 1px solid var(--msg-border); }
.dx-navlist a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; color: var(--msg-muted); text-decoration: none; font-size: 15px; line-height: 1.3; }
.dx-navlist ul a { padding: 4px 8px; font-size: 14px; }
.dx-navlist a:hover { background: var(--msg-hover); color: var(--msg-text); }
.dx-navlist a.is-on { color: var(--msg-text); background: var(--msg-surface); box-shadow: inset 3px 0 0 var(--msg-accent); font-weight: 600; }
.dx-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--msg-surface-2); border: 1px solid var(--msg-border); }
.dx-none { margin: 0; color: var(--msg-muted); font-size: 14px; }
.dx-toc-btn { display: none; }
.dx-main { min-width: 0; max-width: 880px; }
.dx-sec { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--msg-border); scroll-margin-top: 76px; }
.dx-sec:last-of-type { border-bottom: 0; }
.dx-sec h2 { margin: 0 0 16px; font-size: 28px; line-height: 1.2; position: relative; }
.dx-sec h3 { margin: 32px 0 10px; font-size: 20px; line-height: 1.3; position: relative; scroll-margin-top: 76px; }
.dx-anchor { position: absolute; left: -24px; color: var(--msg-muted); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover > .dx-anchor, h3:hover > .dx-anchor, .dx-anchor:focus { opacity: 1; }
.dx-main p { margin: 0 0 14px; line-height: 1.65; font-size: 16px; }
.dx-main code { padding: 1px 6px; border-radius: 6px; background: var(--msg-surface-2); border: 1px solid var(--msg-border); font-size: .92em; overflow-wrap: anywhere; }
.dx-main a { color: var(--msg-link); }
.dx-list, .dx-steps { margin: 0 0 16px; padding-left: 24px; line-height: 1.65; }
.dx-list li, .dx-steps li { margin: 4px 0; padding-left: 4px; }
.dx-steps li::marker { color: var(--msg-accent); font-weight: 700; }
.dx-note { display: flex; flex-direction: column; gap: 4px; margin: 18px 0; padding: 14px 16px; border-radius: 14px; background: var(--msg-surface); border: 1px solid var(--msg-border); border-left-width: 4px; line-height: 1.55; }
.dx-note.is-info { border-left-color: var(--msg-link); }
.dx-note.is-warn { border-left-color: var(--msg-danger); }
.dx-note.is-tip { border-left-color: var(--msg-accent); }
.dx-ep { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 18px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--msg-surface); border: 1px solid var(--msg-border); }
.dx-verb { flex: none; padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 800; letter-spacing: .04em; background: var(--msg-accent); color: var(--msg-on-accent); }
.dx-verb.is-post { background: var(--msg-link); color: var(--msg-bg); }
.dx-ep .dx-path { font-size: 15px; background: transparent; border: 0; padding: 0; font-weight: 600; word-break: break-all; }
.dx-epnote { flex-basis: 100%; color: var(--msg-muted); font-size: 14px; }
.dx-tbl { margin: 0 0 20px; border-radius: 14px; border: 1px solid var(--msg-border); overflow-x: auto; background: var(--msg-surface); }
.dx-tbl table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dx-tbl th { text-align: left; padding: 10px 14px; background: var(--msg-surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--msg-muted); }
.dx-tbl td { padding: 10px 14px; border-top: 1px solid var(--msg-border); vertical-align: top; line-height: 1.5; }
.dx-tbl td:first-child { white-space: nowrap; }
.dx-req { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--msg-border); }
.dx-req.is-yes { background: var(--msg-accent); color: var(--msg-on-accent); border-color: transparent; }
.dx-req.is-no { color: var(--msg-muted); }
.dx-def { display: block; margin-top: 4px; color: var(--msg-muted); font-size: 13px; }
.dx-code { margin: 0 0 20px; border-radius: 14px; border: 1px solid var(--msg-border); background: var(--msg-surface-2); overflow: hidden; }
.dx-code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 10px; border-bottom: 1px solid var(--msg-border); background: var(--msg-surface); color: var(--msg-muted); font-size: 13px; }
.dx-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.dx-tab, .dx-copy { min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid transparent; background: transparent; color: var(--msg-muted) !important; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.dx-tab:hover, .dx-copy:hover { background: var(--msg-hover); color: var(--msg-text) !important; }
.dx-tab[aria-selected="true"] { background: var(--msg-surface-2); border-color: var(--msg-border); color: var(--msg-text) !important; }
.dx-copy { border-color: var(--msg-border); }
.dx-copy.is-done { color: var(--msg-accent) !important; border-color: var(--msg-accent); }
.dx-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.6; tab-size: 2; }
.dx-code pre[hidden] { display: none; }
.dx-code pre code { padding: 0; border: 0; background: transparent; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.dx-tk-k { color: var(--msg-accent); }
.dx-tk-s { color: var(--msg-link); }
.dx-tk-n { color: var(--msg-text); font-weight: 700; }
.dx-tk-c { color: var(--msg-muted); font-style: italic; }
.dx-top { margin: 0; text-align: right; font-size: 14px; }
@media (max-width: 999px) {
  .dx { grid-template-columns: 1fr; gap: 16px; }
  .dx-page { padding: 16px 16px 56px; }
  .dx-toc-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; width: 100%; border-radius: 12px; border: 1px solid var(--msg-border); background: var(--msg-surface); color: var(--msg-text) !important; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
  .dx-nav { position: static; max-height: none; display: none; padding: 12px; border-radius: 14px; background: var(--msg-surface); border: 1px solid var(--msg-border); }
  .dx-nav.is-open { display: flex; }
  .dx-navlist { max-height: 50vh; }
  .dx-anchor { display: none; }
  .dx-tab, .dx-copy { min-height: 44px; }
  .dx-sec h2 { font-size: 24px; }
  .dx-tbl table, .dx-tbl thead, .dx-tbl tbody, .dx-tbl tr, .dx-tbl td { display: block; }
  .dx-tbl thead { display: none; }
  .dx-tbl tr { padding: 10px 14px; border-top: 1px solid var(--msg-border); }
  .dx-tbl tr:first-child { border-top: 0; }
  .dx-tbl td { border: 0; padding: 3px 0; white-space: normal !important; }
  .dx-tbl td::before { content: attr(data-l); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--msg-muted); }
}
/* the index page */
.dx-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.dx-card a { display: flex; flex-direction: column; gap: 8px; height: 100%; box-sizing: border-box; padding: 20px; border-radius: 18px; background: var(--msg-surface); border: 1px solid var(--msg-border); color: var(--msg-text); text-decoration: none; }
.dx-card a:hover { border-color: var(--msg-accent); }
.dx-card b { font-size: 20px; }
.dx-card span { color: var(--msg-muted); line-height: 1.5; }
.dx-card em { margin-top: auto; font-style: normal; color: var(--msg-link); font-weight: 600; }
.dx-actions { margin: -10px 0 18px; }
.dx-printbtn { min-height: 40px; padding: 0 16px; border-radius: var(--btn-r, 99px); border: 1px solid var(--msg-border); background: var(--msg-surface); color: var(--msg-text) !important; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.dx-printbtn:hover { border-color: var(--msg-accent); }
/* printing / saving as PDF: a plain page of text (print uses the paper's own colours; these two words are the only colours here) */
@media print {
  .dx-bar, .dx-nav, .dx-toc-btn, .dx-copy, .dx-top, .dx-anchor, .dx-own, .dx-actions, .dx-tab, .lv-fm, .ch, .appbar { display: none !important; }
  body.lv-page.lv-docs { background: white; color: black; font-size: 11pt; }
  .dx-page { max-width: none; padding: 0; }
  .dx { display: block; }
  .dx-main { max-width: none; }
  .dx-head { border-bottom: 1px solid black; }
  .dx-head h1, .dx-crumb a { color: black; }
  .dx-lead, .dx-crumb, .dx-main p, .dx-list, .dx-steps, .dx-main td, .dx-main th, .dx-main li, .dx-sec h2, .dx-sec h3, .dx-main a, .dx-main code { color: black !important; background: transparent !important; }
  .dx-sec { break-inside: auto; border-bottom: 1px solid black; padding-bottom: 14px; margin-bottom: 18px; }
  .dx-sec h2 { break-after: avoid; }
  .dx-sec h3 { break-after: avoid; margin-top: 16px; }
  .dx-tbl, .dx-code, .dx-note { break-inside: avoid; border-color: black; }
  .dx-tbl th { color: black; background: transparent; border-bottom: 1px solid black; }
  .dx-tbl td { border-color: black; }
  .dx-panel[hidden] { display: none; }
  .dx-code pre { white-space: pre-wrap; color: black; }
}


/* inside the Help panel of a page (docs/*.php?embed=1): no bar of its own, the panel's Close button is the way out */
body.dx-embed .dx-crumb, body.dx-embed .dx-actions { display: none; }
