/* ============================================================================
   Refetcher Docs — calm reading layout
   Brand grays from site.css · system font for reading, Outfit for headings ·
   blue only on the main button · quiet sidebar with a platform picker card ·
   light code · on-this-page rail with copy / ask-AI actions.
   Only docs.html loads this file.
   ========================================================================== */

:root {
  --d-header-h: 56px;
  --d-nav-w: 256px;
  --d-toc-w: 220px;
  --d-read: 740px;

  --d-canvas: var(--paper);
  --d-surface: var(--white);
  --d-sunken: #EEF1F6;
  --d-code: #FBFCFE;
  --d-line: var(--line);
  --d-line-2: var(--line-2);
  --d-tint: rgba(11, 16, 32, 0.05);
  --d-hover: rgba(11, 16, 32, 0.035);
  --d-ring:
    0 0 0 1px rgba(11, 16, 32, 0.08),
    0 1px 1px -0.5px rgba(11, 16, 32, 0.05),
    0 2px 2px -1px rgba(11, 16, 32, 0.035),
    0 4px 4px -2px rgba(11, 16, 32, 0.02);

  --d-ink: var(--ink);
  --d-ink-2: var(--ink);
  --d-text: #4C586E;
  --d-muted: var(--muted);
  --d-faint: var(--faint);

  --d-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --d-head: var(--font);
  --d-mono: var(--mono);
  --d-code-ink: #2B3550;
  --d-code-bg: rgba(11, 16, 32, 0.05);
}

/* site.css sets overflow-x:hidden on html/body, which turns them into scroll
   containers and breaks position:sticky. `clip` hides overflow without that. */
html, body { overflow-x: clip; }
html { scroll-padding-top: calc(var(--d-header-h) + 24px); }

body.docs {
  background: var(--d-canvas);
  color: var(--d-text);
  font-family: var(--d-ui);
  font-size: 14px;
  line-height: 1.6;
}
body.docs.is-locked { overflow: hidden; }

/* Logo, main button and footer stay in Outfit so they match every other page */
body.docs .wordmark, body.docs .btn, body.docs .footer { font-family: var(--font); }

/* Quiet small label (card title, "On this page") */
.d-label { font-size: 12px; font-weight: 500; color: var(--d-muted); }

/* ---------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.dh {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--d-header-h);
  background: rgba(247, 249, 252, 0.86);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--d-line);
}

.dh__row {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  max-width: 1480px;
  margin-inline: auto;
}

.dh__brand { display: flex; align-items: center; gap: 9px; flex: none; }
.dh__brand .wordmark { font-size: 1.12rem; gap: 7px; }
.dh__brand .wordmark img { height: 19px; width: auto; border-radius: 8px; }

.dh__badge {
  font-family: var(--d-ui);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: var(--d-muted);
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--d-surface);
  box-shadow: 0 0 0 1px var(--d-line-2);
}

.dh__tabs {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 22px;
}

.dh__tab {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--d-muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.dh__tab:hover { color: var(--d-ink); }
.dh__tab.is-active { color: var(--d-ink); }
.dh__tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--d-ink);
}

.dh__spacer { flex: 1; }


/* Uses the site's .btn.btn--primary; only the size is tightened for a 56px bar */
.dh .dh__cta { padding: 7px 14px; font-size: 0.82rem; }

.dh__icon-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--d-text);
  place-items: center;
}
.dh__icon-btn:hover { background: var(--d-hover); color: var(--d-ink); }
.dh__icon-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------------- */
.docs-shell {
  display: grid;
  grid-template-columns: var(--d-nav-w) minmax(0, 1fr) var(--d-toc-w);
  gap: 0 44px;
  max-width: 1480px;
  margin-inline: auto;
  padding: var(--d-header-h) 28px 0;
  align-items: start;
}

/* ---------------------------------------------------------------------------
   Left navigation
   ------------------------------------------------------------------------- */
.dn {
  position: sticky;
  top: var(--d-header-h);
  height: calc(100dvh - var(--d-header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 4px 48px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--d-line-2) transparent;
}

.dn__products { display: none; }

.dn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--d-surface);
  box-shadow: 0 0 0 1px var(--d-line-2);
  color: var(--d-muted);
  font-family: var(--d-ui);
  font-size: 13px;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.dn-search:hover { box-shadow: 0 0 0 1px rgba(11, 16, 32, 0.24); }
.dn-search svg { width: 14px; height: 14px; flex: none; }
.dn-search span { flex: 1; }

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--d-surface);
  box-shadow: 0 0 0 1px var(--d-line-2);
  font-family: var(--d-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--d-muted);
  line-height: 1;
}

/* Platform picker card */
.dn-card {
  margin-top: 12px;
  border-radius: 10px;
  background: var(--d-sunken);
  box-shadow: inset 0 0 0 1px rgba(11, 16, 32, 0.04);
  padding: 0 0 3px;
}

.dn-card__title { padding: 8px 12px 6px; }

.dn-card__item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  margin: 0 3px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--d-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.dn-card__item:hover { color: var(--d-ink-2); background: rgba(255, 255, 255, 0.55); }
.dn-card__item.is-active {
  color: var(--d-ink);
  font-weight: 500;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
}

.glyph {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: var(--g, var(--d-ink));
}
.glyph svg { width: 11px; height: 11px; }

/* Platform icons stay gray until that platform is open, so they don't pull the eye */
.dn-card__item .glyph, .dk__item .glyph { filter: grayscale(1); opacity: 0.38; transition: filter 0.2s ease, opacity 0.2s ease; }
.dn-card__item:hover .glyph, .dk__item.is-active .glyph { opacity: 0.6; }
.dn-card__item.is-active .glyph { filter: none; opacity: 1; }


/* Groups */
.dn-group { margin-top: 18px; }
.dn-group[hidden] { display: none; }

.dn-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  padding: 0 8px 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: var(--d-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--d-ink-2);
  text-align: left;
}
.dn-group__head:hover { background: var(--d-hover); }
.dn-group__head svg { width: 14px; height: 14px; color: var(--d-faint); transition: transform 0.2s var(--ease); }
.dn-group.is-collapsed .dn-group__head svg { transform: rotate(-90deg); }
.dn-group.is-collapsed .dn-group__list { display: none; }

.dn-group__list { display: grid; gap: 1px; margin-top: 2px; }

.dn-link {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px 5px 20px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--d-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.dn-link:hover { color: var(--d-ink-2); background: var(--d-hover); }
.dn-link.is-active { color: var(--d-ink); background: var(--d-tint); font-weight: 500; }

/* ---------------------------------------------------------------------------
   Main column
   ------------------------------------------------------------------------- */
.dm {
  min-width: 0;
  padding: 44px 0 96px;
}

.dm__inner { max-width: var(--d-read); margin-inline: auto; }

.doc-page { display: none; }
.doc-page.is-active { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .doc-page.is-active { animation: docFade 0.22s ease both; }
}
@keyframes docFade { from { opacity: 0; } to { opacity: 1; } }

.doc-section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--d-line);
}
.doc-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }

/* Breadcrumb */
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--d-muted);
}
.crumbs svg { width: 12px; height: 12px; color: var(--d-faint); }
.crumbs a { color: inherit; }
.crumbs a:hover { color: var(--d-ink); }

/* Typography */
.dm h1 {
  font-family: var(--d-head);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--d-ink-2);
  margin: 0 0 14px;
}

.dm h2 {
  font-family: var(--d-head);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.3;
  color: var(--d-ink-2);
  margin: 0 0 12px;
}

.dm h3 {
  font-family: var(--d-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  color: var(--d-ink-2);
  margin: 28px 0 8px;
}

.dm p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--d-text);
  margin: 0 0 14px;
}
.dm p strong, .dm li strong { color: var(--d-ink-2); font-weight: 600; }

.doc-lede {
  font-size: 15.5px !important;
  line-height: 1.65 !important;
  max-width: 62ch;
  margin-bottom: 26px !important;
}

.dm ul, .dm ol { padding-left: 20px; margin: 0 0 14px; }
.dm li { font-size: 14px; line-height: 1.7; color: var(--d-text); margin-bottom: 4px; }

.dm a:not([class]) {
  color: var(--d-ink);
  text-decoration: underline;
  text-decoration-color: rgba(11, 16, 32, 0.28);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease;
}
.dm a:not([class]):hover { text-decoration-color: var(--d-ink); }

/* Inline code */
.dm :not(pre) > code {
  font-family: var(--d-mono);
  font-size: 0.84em;
  color: var(--d-code-ink);
  background: var(--d-code-bg);
  padding: 0.12em 0.42em;
  border-radius: 5px;
  white-space: nowrap;
}
.dm p code, .dm li code { white-space: normal; word-break: break-word; }

.label-sm {
  font-size: 12px !important;
  font-weight: 600;
  color: var(--d-ink) !important;
  margin: 22px 0 8px !important;
}

/* ---------------------------------------------------------------------------
   Overview: quick facts + steps
   ------------------------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  margin: 4px 0 14px;
  border-radius: 12px;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
  overflow: hidden;
}
.facts__cell { padding: 14px 16px; min-width: 0; }
.facts__cell + .facts__cell { border-left: 1px solid var(--d-line); }
.facts__label { display: block; margin-bottom: 6px; font-family: var(--d-ui); font-size: 12px; font-weight: 500; color: var(--d-muted); }
.facts__value { display: block; font-size: 13.5px; font-weight: 500; color: var(--d-ink-2); line-height: 1.35; }
.facts .endpoint { box-shadow: none; padding: 0; background: transparent; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 28px;
}
.step {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
  transition: box-shadow 0.18s ease, transform 0.18s var(--ease);
}
.step:hover { box-shadow: 0 0 0 1px rgba(11, 16, 32, 0.14), 0 6px 16px -10px rgba(11, 16, 32, 0.2); transform: translateY(-1px); }
.step__n { font-size: 12px; font-weight: 500; color: var(--d-faint); }
.step__t { font-size: 13.5px; font-weight: 600; color: var(--d-ink-2); }
.step__d { font-size: 12.5px; color: var(--d-muted); }

/* ---------------------------------------------------------------------------
   Platform header
   ------------------------------------------------------------------------- */
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.phead__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent, var(--d-ink));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.12);
}
.phead__icon svg { width: 18px; height: 18px; }
.phead__title h1 { margin: 0 !important; }

.phead-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 20px; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--d-text);
  background: var(--d-surface);
  box-shadow: 0 0 0 1px var(--d-line-2);
}

/* Endpoint chip */
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 5px 6px 5px 5px;
  border-radius: 9px;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
}
.endpoint__method {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-family: var(--d-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.endpoint__url { font-family: var(--d-mono); font-size: 12.5px; color: var(--d-ink-2); white-space: nowrap; }
.endpoint__copy {
  flex: none;
  border: 0;
  border-radius: 6px;
  padding: 3px 8px;
  background: var(--d-sunken);
  color: var(--d-muted);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.endpoint__copy:hover { color: var(--d-ink); background: #E6EAF1; }

.phead-meta .endpoint { height: 24px; padding: 0 9px 0 3px; border-radius: 999px; box-shadow: 0 0 0 1px var(--d-line-2); gap: 6px; }
.phead-meta .endpoint__method { padding: 1px 6px; border-radius: 999px; font-size: 10.5px; }
.phead-meta .endpoint__url { font-size: 11.5px; }

.endpoint--block { margin: 2px 0 18px; }

/* ---------------------------------------------------------------------------
   Resource cards, chips, map list
   ------------------------------------------------------------------------- */
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 8px; }
.res-card { padding: 14px 15px 13px; border-radius: 12px; background: var(--d-surface); box-shadow: var(--d-ring); }
.res-card__top { margin-bottom: 4px; }
.res-card h3 { margin: 0; font-size: 13.5px; }
.res-card p { font-size: 13px; line-height: 1.55; margin: 0 0 10px; color: var(--d-text); }
.res-card__fields { display: flex; flex-wrap: wrap; gap: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.dm .chips code, .chip {
  font-family: var(--d-mono);
  font-size: 11.5px;
  color: var(--d-code-ink);
  background: var(--d-code-bg);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.maplist { list-style: none; margin: 4px 0 18px; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.maplist li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 8px; background: var(--d-surface); box-shadow: var(--d-ring); font-size: 12.5px; margin: 0; }
.maplist .arr { color: var(--d-faint); }

.resource { margin: 18px 0 4px; }
.resource__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.resource__head h3 { margin: 0; }

/* ---------------------------------------------------------------------------
   Code card (light)
   ------------------------------------------------------------------------- */
.code-card {
  margin: 14px 0 22px;
  border-radius: 12px;
  background: var(--d-code);
  box-shadow: var(--d-ring);
  overflow: hidden;
}

.code-card__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 6px 0 4px;
  background: var(--d-surface);
  border-bottom: 1px solid var(--d-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.code-card__bar::-webkit-scrollbar { display: none; }

.code-card__tabs { display: flex; align-items: stretch; height: 100%; gap: 2px; }

.code-tab {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0 10px;
  font-family: var(--d-ui);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--d-muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.code-tab:hover { color: var(--d-ink-2); }
.code-tab.is-active { color: var(--d-ink); }
.code-tab.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--d-ink);
}

.code-card__copy {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--d-muted);
  font-family: var(--d-ui);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.code-card__copy:hover { color: var(--d-ink); background: var(--d-tint); }
.code-card__copy svg { width: 13px; height: 13px; }
.code-card__copy.is-done { color: #047857; }

.code-card__body { position: relative; }
.code-panel { display: none; margin: 0; padding: 14px 18px 16px; overflow-x: auto; }
.code-panel.is-active { display: block; }
.code-panel code {
  display: block;
  font-family: var(--d-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--d-code-ink);
  white-space: pre;
  background: transparent;
}
.code-panel code.hljs { background: transparent; padding: 0; overflow: visible; color: var(--d-code-ink); }

.hljs-attr, .hljs-attribute { color: #3B4E86; }
.hljs-string { color: #047857; }
.hljs-number, .hljs-literal { color: var(--amber); }
.hljs-keyword, .hljs-built_in, .hljs-meta { color: #7C3AED; }
.hljs-comment { color: var(--faint); font-style: italic; }
.hljs-title, .hljs-title.function_ { color: #3B4E86; }
.hljs-punctuation { color: #8893AE; }
.hljs-variable, .hljs-params { color: var(--d-code-ink); }

/* ---------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */
.table-wrap {
  margin: 14px 0 22px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
}
.doc-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.doc-table th {
  padding: 9px 14px;
  background: #FAFBFD;
  border-bottom: 1px solid var(--d-line);
  font-size: 12px;
  font-weight: 500;
  color: var(--d-muted);
  white-space: nowrap;
}
.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--d-line);
  vertical-align: top;
  color: var(--d-text);
  line-height: 1.6;
}
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td code { white-space: nowrap !important; }
.doc-table .field-cell code { display: inline-block; margin: 0 3px 4px 0; }
.type-label { font-family: var(--d-mono); font-size: 11.5px; color: var(--d-faint); }
.req-tag {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--d-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--d-faint);
  vertical-align: middle;
}
.req-tag--req { color: var(--d-ink); }

/* ---------------------------------------------------------------------------
   Plain lists, wide error/reason tables
   ------------------------------------------------------------------------- */
.doc-list { margin: 0 0 16px; max-width: 70ch; }
.doc-list li { margin-bottom: 6px; }

.doc-table--errors { table-layout: fixed; }
.doc-table--errors th:nth-child(1) { width: 27%; }
.doc-table--errors th:nth-child(2) { width: 13%; white-space: normal; }
.doc-table--errors th:nth-child(3), .doc-table--errors th:nth-child(4) { width: 30%; }
.doc-table--errors td code { white-space: normal !important; }
.doc-table--reasons th:nth-child(1) { width: 17%; }
.doc-table--reasons th:nth-child(2) { width: 9%; }
.doc-table--reasons th:nth-child(3) { width: 30%; }
.doc-table--reasons th:nth-child(4), .doc-table--reasons th:nth-child(5) { width: 22%; }
.doc-table--reasons th { white-space: normal; }
.doc-table--reasons td[rowspan] { border-right: 1px solid var(--d-line); }
.doc-table--reasons td code { white-space: normal !important; word-break: break-word; }
/* Keep HTTP status digits together; continuation rows have only three cells. */
.doc-table--reasons tr:has(> td:nth-child(5)) > td:nth-child(2) code {
  white-space: nowrap !important;
  word-break: normal;
}

/* ---------------------------------------------------------------------------
   Field card: tabbed list of every response field (light)
   ------------------------------------------------------------------------- */
.fcard__panel { padding: 2px 18px 14px; background: var(--d-surface); }
.fcard__panel[hidden] { padding: 0; }
.dm .fcard__sub { margin: 12px 0 2px; font-size: 13px; color: var(--d-muted); }
.dm .fcard__group { margin: 20px 0 2px; font-size: 12px; font-weight: 600; color: var(--d-ink); }
.fcard__obj { margin-left: 4px; font-family: var(--d-mono); font-size: 11.5px; font-weight: 500; color: var(--d-faint); }
.fcard__head, .fcard__row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.15fr) 104px minmax(0, 1.55fr);
  gap: 4px 16px;
  align-items: start;
}
.fcard__row { grid-template-areas: "name code type desc"; padding: 10px 0; border-top: 1px solid var(--d-line); }
.fcard__head { padding: 12px 0 8px; border-bottom: 1px solid var(--d-line); font-size: 12px; font-weight: 500; color: var(--d-muted); }
.fcard__name { grid-area: name; font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--d-ink); }
.fcard__code { grid-area: code; line-height: 1.45; }
.fcard__code code { display: inline-block; margin: 0 4px 4px 0; white-space: normal !important; }
.fcard__type { grid-area: type; padding-top: 2px; font-family: var(--d-mono); font-size: 11.5px; color: var(--d-faint); }
.dm .fcard__desc { grid-area: desc; margin: 0; font-size: 13px; line-height: 1.6; color: var(--d-text); }
.fcard__row.is-na .fcard__name, .dm .fcard__row.is-na .fcard__desc { color: var(--d-faint); }
.dm .fcard__row.is-na code { opacity: 0.6; }

@media (max-width: 720px) {
  .fcard__head { display: none; }
  .fcard__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name type" "code code" "desc desc"; gap: 4px 12px; }
}
@media (max-width: 560px) {
  .fcard__panel { padding: 2px 14px 12px; }
  .doc-table--wide { min-width: 540px; }
}

/* ---------------------------------------------------------------------------
   Callouts
   ------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 16px 0 22px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--d-muted); }
.alert__body { font-size: 13px; line-height: 1.65; color: var(--d-text); }
.alert__body strong { color: var(--d-ink); }
.alert__body p { font-size: 13px; margin: 0; }
.alert__body p + p { margin-top: 8px; }
.alert__body ol { margin: 4px 0 0; padding-left: 18px; }
.alert__body li { font-size: 13px; margin-bottom: 3px; }

.alert--note svg { color: var(--d-muted); }
.alert--tip svg { color: var(--emerald); }
.alert--warning { background: #FFFBF0; box-shadow: 0 0 0 1px rgba(194, 130, 10, 0.2); }
.alert--warning svg { color: var(--amber); }
.alert--danger { background: #FFF6F7; box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.16); }
.alert--danger svg { color: #E11D48; }

/* ---------------------------------------------------------------------------
   Prev / next pager
   ------------------------------------------------------------------------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--d-line);
}
.pager__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--d-surface);
  box-shadow: var(--d-ring);
  transition: box-shadow 0.18s ease;
}
.pager__link:hover { box-shadow: 0 0 0 1px rgba(11, 16, 32, 0.14), 0 6px 16px -10px rgba(11, 16, 32, 0.2); }
.pager__link--next { grid-column: 2; text-align: right; }
.pager__dir { font-size: 12px; color: var(--d-muted); }
.pager__title { font-size: 14px; font-weight: 500; color: var(--d-ink-2); }

/* ---------------------------------------------------------------------------
   Right rail
   ------------------------------------------------------------------------- */
.dt {
  position: sticky;
  top: var(--d-header-h);
  height: calc(100dvh - var(--d-header-h));
  overflow-y: auto;
  padding: 44px 0 48px;
  scrollbar-width: thin;
}

.dt__title { padding: 0 12px; margin: 0 0 6px; color: var(--d-ink-2); }

.dt__list a {
  display: block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--d-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.dt__list a:hover { color: var(--d-ink-2); background: var(--d-hover); }
.dt__list a.is-active { color: var(--d-ink); font-weight: 500; }

.dt__actions { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--d-line); display: grid; gap: 1px; }
.dt__action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 5px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: var(--d-ui);
  font-size: 13px;
  color: var(--d-muted);
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease;
}
.dt__action:hover { color: var(--d-ink-2); background: var(--d-hover); }
.dt__action svg { width: 14px; height: 14px; flex: none; }
.dt__action.is-done { color: #047857; }

/* ---------------------------------------------------------------------------
   Search palette (⌘K)
   ------------------------------------------------------------------------- */
.dk {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(11, 16, 32, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dk.is-open { display: flex; }

.dk__panel {
  width: min(620px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--d-surface);
  box-shadow: 0 0 0 1px rgba(11, 16, 32, 0.08), var(--shadow-pop);
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .dk.is-open .dk__panel { animation: dkIn 0.16s var(--ease) both; }
}
@keyframes dkIn { from { opacity: 0; transform: translateY(-6px) scale(0.99); } to { opacity: 1; transform: none; } }

.dk__field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--d-line); }
.dk__field svg { width: 16px; height: 16px; color: var(--d-muted); flex: none; }
.dk__input {
  flex: 1;
  height: 50px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--d-ui);
  font-size: 15px;
  color: var(--d-ink);
}
.dk__input::placeholder { color: var(--d-faint); }

.dk__list { overflow-y: auto; padding: 6px; }
.dk__group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--d-faint); }
.dk__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.dk__item.is-active { background: var(--d-tint); }
.dk__item .glyph { width: 20px; height: 20px; }
.dk__hash {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--d-sunken);
  color: var(--d-muted);
  font-size: 12px;
}
.dk__text { min-width: 0; display: flex; flex-direction: column; }
.dk__title { font-size: 13.5px; color: var(--d-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk__meta { font-size: 12px; color: var(--d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk__title mark { background: transparent; color: var(--d-ink); font-weight: 600; }
.dk__empty { padding: 28px 12px; text-align: center; font-size: 13px; color: var(--d-muted); }

.dk__foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--d-line);
  background: #FAFBFD;
  font-size: 11.5px;
  color: var(--d-muted);
}
.dk__foot .kbd { height: 18px; margin-right: 3px; }

/* ---------------------------------------------------------------------------
   Footer + mobile drawer
   ------------------------------------------------------------------------- */

.dn-overlay { display: none; }

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: var(--d-nav-w) minmax(0, 1fr); gap: 0 40px; }
  .dt { display: none; }
}

@media (max-width: 1020px) {
  .dh__tabs { display: none; }
  .dh__icon-btn { display: grid; }
  .dh__row { padding: 0 14px 0 18px; gap: 6px; }

  .docs-shell { display: block; padding: var(--d-header-h) 22px 0; }

  .dn {
    position: fixed;
    top: var(--d-header-h);
    left: 0;
    bottom: 0;
    z-index: 300;
    width: 300px;
    height: auto;
    padding: 18px 16px 48px;
    background: var(--d-canvas);
    border-right: 1px solid var(--d-line);
    box-shadow: var(--shadow-pop);
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
  }
  .dn.is-open { transform: none; }

  .dn__products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--d-sunken);
  }
  .dn__products a {
    display: grid;
    place-items: center;
    height: 30px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--d-muted);
  }
  .dn__products a.is-active { color: var(--d-ink); background: var(--d-surface); box-shadow: var(--d-ring); }

  .dn-overlay {
    position: fixed;
    inset: var(--d-header-h) 0 0 0;
    z-index: 250;
    background: rgba(11, 16, 32, 0.42);
  }
  .dn-overlay.is-open { display: block; }

  .dm { padding-top: 28px; }
}

@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; }
  .facts__cell + .facts__cell { border-left: 0; border-top: 1px solid var(--d-line); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-grid { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { grid-column: 1; }
  .dh__brand .dh__badge { display: none; }
}

@media (max-width: 460px) {
  .docs-shell { padding-inline: 16px; }
  .dm h1 { font-size: 26px; }
  .dh .dh__cta { padding: 6px 12px; }
}
