/* ==========================================================================
   Maximus FHIR API Documentation
   Static documentation stylesheet. No build step, no framework.

   Replaces the former React bundle (js/js_main.js). Edit this file directly.
   ========================================================================== */

/* ---------- design tokens ---------- */
:root {
  --mx-blue:        #2283c6;
  --mx-blue-dark:   #1b6aa1;
  --mx-blue-light:  #e8f3fb;

  --bg:             #ffffff;
  --bg-alt:         #f7f9fb;
  --bg-sidebar:     #fbfcfd;
  --surface:        #ffffff;

  --text:           #1f2933;
  --text-muted:     #5b6b7b;
  --text-faint:     #8292a2;

  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  --code-bg:        #1e293b;
  --code-text:      #e2e8f0;
  --code-inline-bg: #f1f5f9;
  --code-inline-fg: #be123c;

  --ok:             #15803d;
  --ok-bg:          #ecfdf3;
  --warn:           #b45309;
  --warn-bg:        #fffbeb;
  --info:           #1d4ed8;
  --info-bg:        #eff6ff;
  --danger:         #b91c1c;
  --danger-bg:      #fef2f2;

  --sidebar-w:      272px;
  --toc-w:          220px;
  --header-h:       60px;

  --radius:         8px;
  --radius-sm:      5px;

  --font: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 14px rgba(15, 23, 42, .08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:             #0f172a;
    --bg-alt:         #131c30;
    --bg-sidebar:     #111a2d;
    --surface:        #16203a;

    --text:           #e6edf5;
    --text-muted:     #9fb0c4;
    --text-faint:     #76889d;

    --border:         #243049;
    --border-strong:  #32415f;

    --code-bg:        #0b1220;
    --code-inline-bg: #1c2740;
    --code-inline-fg: #fda4af;

    --mx-blue-light:  #152b40;

    --ok-bg:          #0d2a1a;
    --warn-bg:        #2b2110;
    --info-bg:        #111f3d;
    --danger-bg:      #2a1316;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 4px 14px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  --bg:             #0f172a;
  --bg-alt:         #131c30;
  --bg-sidebar:     #111a2d;
  --surface:        #16203a;
  --text:           #e6edf5;
  --text-muted:     #9fb0c4;
  --text-faint:     #76889d;
  --border:         #243049;
  --border-strong:  #32415f;
  --code-bg:        #0b1220;
  --code-inline-bg: #1c2740;
  --code-inline-fg: #fda4af;
  --mx-blue-light:  #152b40;
  --ok-bg:          #0d2a1a;
  --warn-bg:        #2b2110;
  --info-bg:        #111f3d;
  --danger-bg:      #2a1316;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 4px 14px rgba(0, 0, 0, .45);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--mx-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.doc-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.doc-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
}
.doc-header .brand:hover { text-decoration: none; }
.doc-header .brand img { height: 30px; width: auto; }
.doc-header .brand span { color: var(--text-muted); font-weight: 600; }

.doc-header .spacer { flex: 1; }

.hdr-badge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 0;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }

.nav-toggle { display: none; }

/* ---------- layout ---------- */
.doc-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.doc-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 22px 0 60px;
}

.doc-search {
  padding: 0 18px 16px;
}
.doc-search input {
  width: 100%;
  padding: 8px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.doc-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--mx-blue) 40%, transparent);
  outline-offset: 1px;
  border-color: var(--mx-blue);
}

.nav-group { margin-bottom: 20px; }

.nav-group > h4 {
  margin: 0 0 6px;
  padding: 0 18px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-group ul { list-style: none; margin: 0; padding: 0; }

.nav-group a {
  display: block;
  padding: 6px 18px 6px 18px;
  font-size: 14px;
  color: var(--text-muted);
  border-left: 3px solid transparent;
}
.nav-group a:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}
.nav-group a.active {
  color: var(--mx-blue);
  background: var(--mx-blue-light);
  border-left-color: var(--mx-blue);
  font-weight: 700;
}

.nav-group a .tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  vertical-align: 1px;
}

/* ---------- main ---------- */
.doc-main { min-width: 0; display: flex; justify-content: center; }

.doc-content {
  width: 100%;
  max-width: 880px;
  padding: 36px 40px 100px;
}

.doc-content.wide { max-width: 1100px; }

/* ---------- typography ---------- */
.doc-content h1 {
  margin: 0 0 8px;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.015em;
}

.lede {
  margin: 0 0 28px;
  font-size: 16.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-content h2 {
  margin: 44px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.doc-content h3 {
  margin: 30px 0 10px;
  font-size: 17px;
  font-weight: 700;
}

.doc-content h4 {
  margin: 22px 0 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.doc-content p { margin: 0 0 14px; }
.doc-content ul, .doc-content ol { margin: 0 0 16px; padding-left: 22px; }
.doc-content li { margin-bottom: 6px; }

.anchor {
  float: left;
  margin-left: -22px;
  padding-right: 6px;
  opacity: 0;
  color: var(--text-faint);
  font-weight: 400;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ---------- code ---------- */
code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
  padding: .14em .4em;
  border-radius: 4px;
  word-break: break-word;
}

/*
  The colour and font live on `pre` itself, not only on `pre code`.

  Not every block has a <code> inside it: the EHI export and MFA documents emit
  a bare <pre> for their diagrams. With the colour set only on the child, such a
  block took the dark background from here and then INHERITED the body text
  colour - which in light mode is nearly black. Dark text on a dark panel,
  invisible, and only in one theme.
*/
pre {
  position: relative;
  margin: 0 0 18px;
  padding: 15px 17px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
}
pre code {
  background: none;
  color: var(--code-text);
  padding: 0;
  font-size: 13px;
  line-height: 1.62;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.copy-btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 20px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th {
  text-align: left;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-alt); }

td code, th code { font-size: 12.4px; }

/* ---------- callouts ---------- */
.note {
  margin: 0 0 20px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-faint);
  background: var(--bg-alt);
  font-size: 14.2px;
}
.note > :last-child { margin-bottom: 0; }
.note strong:first-child { display: block; margin-bottom: 3px; }

.note.info    { border-left-color: var(--info);   background: var(--info-bg); }
.note.ok      { border-left-color: var(--ok);     background: var(--ok-bg); }
.note.warn    { border-left-color: var(--warn);   background: var(--warn-bg); }
.note.danger  { border-left-color: var(--danger); background: var(--danger-bg); }

.note.info strong:first-child   { color: var(--info); }
.note.ok strong:first-child     { color: var(--ok); }
.note.warn strong:first-child   { color: var(--warn); }
.note.danger strong:first-child { color: var(--danger); }

/* ---------- HTTP verb + endpoint ---------- */
.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 13px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13.2px;
  word-break: break-all;
}

.verb {
  flex: none;
  padding: 2px 9px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #fff;
}
.verb.get  { background: #0f766e; }
.verb.post { background: #1d4ed8; }

/* ---------- cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}

.card {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.card:hover {
  text-decoration: none;
  border-color: var(--mx-blue);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card h3 { margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--mx-blue); }
.card p  { margin: 0; font-size: 13.6px; color: var(--text-muted); line-height: 1.55; }

/* ---------- resource reference blocks ---------- */
.resource {
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.resource > summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15.5px;
  list-style: none;
  background: var(--bg-alt);
}
.resource > summary::-webkit-details-marker { display: none; }
.resource > summary::after {
  content: "\203A";
  margin-left: auto;
  font-size: 20px;
  color: var(--text-faint);
  transform: rotate(90deg);
  transition: transform .18s;
  line-height: 1;
}
.resource[open] > summary::after { transform: rotate(-90deg); }
.resource > summary:hover { background: var(--mx-blue-light); }

.resource .body { padding: 18px 16px 6px; border-top: 1px solid var(--border); }

.pill {
  flex: none;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--mx-blue-light);
  color: var(--mx-blue);
  border: 1px solid color-mix(in srgb, var(--mx-blue) 28%, transparent);
}

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

/* ---------- scope list ---------- */
.scope-list {
  columns: 2;
  column-gap: 22px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12.6px;
}
.scope-list li {
  break-inside: avoid;
  padding: 3px 0;
  color: var(--text-muted);
}

/* ---------- forms ---------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-field { margin: 0 0 16px; }

.form-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.form-field .req { color: var(--danger); }

.field-help {
  margin: 0 0 7px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.form-field textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 170px;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid color-mix(in srgb, var(--mx-blue) 38%, transparent);
  outline-offset: 1px;
  border-color: var(--mx-blue);
}

/* ---------- access-type picker ----------
   Cards rather than bare radios: each option carries a sentence explaining what
   it means, because applicants know what their application does but often not
   which SMART flow that implies. */
.choice-set { margin: 0 0 22px; }

.choice {
  display: block;
  position: relative;
  margin: 0 0 10px;
  padding: 14px 16px 14px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.choice:hover { border-color: var(--mx-blue); }

.choice.is-on {
  border-color: var(--mx-blue);
  box-shadow: inset 0 0 0 1px var(--mx-blue);
}

.choice input[type="radio"] {
  position: absolute;
  top: 17px;
  left: 16px;
  margin: 0;
}

.choice-title {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}

.choice-note {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Revealed by the picker. [hidden] alone loses to display:block in some
   resets, so it is stated here. */
.access-panel[hidden] { display: none; }

.access-panel {
  margin: 0 0 22px;
  padding: 18px 18px 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}

.access-panel h3 { margin-top: 0; }

/* ---------- checkboxes and radios ----------
   .form-field input is width:100% for text inputs, which made every checkbox
   stretch the width of the form and threw its label onto its own line. Ticks
   are never full-width. */
.form-field input[type="checkbox"],
.form-field input[type="radio"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
}

/* A declaration is a sentence you agree to, so the tick sits beside the first
   line of it and the text wraps under itself, not under the tick. */
.form-field label.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  cursor: pointer;
}

.form-field label.check input[type="checkbox"] { margin-top: 3px; }
.form-field label.check:last-child { margin-bottom: 0; }

/* ---------- scope picker ----------
   Generated from the server's own scopes_supported, so nothing here can be
   requested that the server would refuse. */
.scope-list { margin-top: 4px; }

.scope {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.scope code {
  font-size: 12.5px;
  background: none;
  padding: 0;
}

/* The one-click "everything" option. Laid out as a named choice rather than
   a scope string so it is recognisable as the shortcut it is; the scope
   itself sits on the right, still visible for anyone checking exactly what
   is being asked for. */
.scope-all {
  align-items: flex-start;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.scope-all-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.scope-all-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.scope-all code { font-weight: 600; flex: 0 0 auto; }

/* The checkbox keeps its own line height next to a two-line label. */
.scope-all input[type="checkbox"] { margin-top: 2px; flex: 0 0 auto; }

/* Two columns at a comfortable width, one when there is no room. Capped and
   scrollable: 36 resource scopes would otherwise push the submit button off
   the end of a long page. */
.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 18px;
  max-height: 290px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* Taken over by the wildcard above it. */
.scope.is-off { opacity: 0.4; cursor: default; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.btn-primary {
  padding: 10px 22px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  background: var(--mx-blue);
  border: 1px solid var(--mx-blue);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-primary:hover { background: var(--mx-blue-dark); border-color: var(--mx-blue-dark); }

.btn-plain {
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.btn-plain:hover { background: var(--bg-alt); color: var(--text); text-decoration: none; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- hub: document cards ---------- */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin: 4px 0 34px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.doc-card:hover {
  text-decoration: none;
  border-color: var(--mx-blue);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.doc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.doc-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--mx-blue);
  line-height: 1.3;
}

.doc-card .criterion {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--mx-blue-light);
  color: var(--mx-blue);
  border: 1px solid color-mix(in srgb, var(--mx-blue) 26%, transparent);
  white-space: nowrap;
}

.doc-card .blurb {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.58;
}

.doc-card .audience {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 600;
}

.doc-card .cta {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mx-blue);
}

/* ---------- EHI export document ----------
   Classes emitted by the b10 build's body fragment. It is rendered inside the
   normal page shell, so it only needs what the shared stylesheet does not
   already give it: a narrower control table, and the per-file column lists.
   ------------------------------------------ */

/* The document control block - a small two-column table, not a full-width one. */
table.control { max-width: 540px; }

/* "28 columns" above each file's column list. */
.colcount {
  margin: 0 0 6px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

/* The column names themselves, as a wrapped run of code chips. */
.cols {
  margin: 0 0 20px;
  line-height: 2.1;
}
.cols code {
  display: inline-block;
  margin: 0 3px 2px 0;
  font-size: 12.2px;
  background: var(--code-inline-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .14em .45em;
}

/* ---------- on-this-page ---------- */
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 36px);
  align-self: start;
  width: var(--toc-w);
  max-height: calc(100vh - var(--header-h) - 70px);
  overflow-y: auto;
  padding: 0 0 0 22px;
  border-left: 1px solid var(--border);
  font-size: 13px;
}
.doc-toc h4 {
  margin: 0 0 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin-bottom: 5px; }
.doc-toc a { color: var(--text-muted); display: block; line-height: 1.4; }
.doc-toc a:hover { color: var(--mx-blue); text-decoration: none; }
.doc-toc a.active { color: var(--mx-blue); font-weight: 700; }

/* ---------- footer ---------- */
.doc-footer {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
}
.doc-footer p { margin: 0 0 6px; }

/* ---------- utility ---------- */
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.text-ok { color: var(--ok); font-weight: 700; }
.text-danger { color: var(--danger); font-weight: 700; }
.hidden { display: none !important; }

/* Lives in the footer now, so it is a quiet line of footer text rather than
   a pill competing with the page title. Kept first in the footer: a revision
   date is about the document and belongs above the product and legal lines. */
.updated {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .doc-toc { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  .nav-toggle { display: inline-flex; }

  .doc-layout { grid-template-columns: minmax(0, 1fr); }

  .doc-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 280px;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 45;
    box-shadow: var(--shadow);
  }
  .doc-sidebar.open { transform: translateX(0); }

  .sidebar-scrim {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(15, 23, 42, .45);
    z-index: 44;
  }

  .doc-content { padding: 26px 16px 80px; }
  .doc-content h1 { font-size: 25px; }
  .doc-content h2 { font-size: 19px; }
  .scope-list { columns: 1; }
  .hdr-badge { display: none; }
}

@media print {
  .doc-header, .doc-sidebar, .doc-toc, .copy-btn { display: none !important; }
  .doc-layout { grid-template-columns: 1fr; padding-top: 0; }
  .doc-content { max-width: none; padding: 0; }
  /* Colour on `pre` as well as `pre code`, for the same reason as the screen
     rules above: a bare <pre> would otherwise keep the light on-screen code
     colour against this light background and vanish on paper. */
  pre { background: #f5f5f5; color: #111; }
  pre code { color: #111; }
  a { color: #000; text-decoration: underline; }
}
